sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3b0f3c01938a9a4483fa8d89bad66260dfba44c4a7b6a7cd6bc5f58b0a574489
Python
19,156
365
############################################################################## ## ## ## This file is part of ModelBlocks. Copyright 2009, ModelBlocks developers. ## ## ## #...
59b04997f0a80609455a5da659dcb30c72db8b6975641ce943001f926215d96f
Python
19,159
478
import copy import filecmp import json import shutil from pathlib import Path from unittest.mock import MagicMock, patch import numpy as np import pandas as pd import pytest from omegaconf import OmegaConf from PIL import Image from lightning_pose.utils.cropzoom import ( _compute_bbox_df, _crop_image, cro...
20f6ddf811eee0699224d886027a398fb2b24a6e7fafff4d91e30362ab34bfbf
Python
19,162
452
"""Class for Grid Sampling Operator.""" import warnings from collections.abc import Callable, Sequence from typing import Literal import torch from typing_extensions import Self from mrpro.data.SpatialDimension import SpatialDimension from mrpro.operators.LinearOperator import LinearOperator class _AdjointGridSamp...
c75c95a9139a4b95961f768ebf8403bd734b71a7a56e37a87a5b29f8ae71b971
Python
19,162
478
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
ac4326a263ea81dadd3cc564bdeb7c189c01a806bd7a1f4fc4ddc77ff170037c
Python
19,164
599
from datetime import datetime import re import zoneinfo import numpy as np import pytest from pandas.errors import MergeError import pandas as pd import pandas._testing as tm from pandas.core.reshape.concat import concat @pytest.fixture def left_no_dup(): return pd.DataFrame( {"a": ["a", "b", "c", "d"]...
ce58fde899f8d8b28611383859c8762ea83adb511d038d0449472ce1e416ffe9
Python
19,172
530
from collections import abc import email from email.parser import Parser import numpy as np import pytest import pandas as pd import pandas._testing as tm class TestDataFrameToRecords: def test_to_records_timeseries(self): index = pd.date_range("1/1/2000", periods=10, unit="ns") df = pd.DataFram...
7aab68546226bec72e9ab3d8d3e4663ea254bda7928c097699b983cb327ea3fd
Python
19,177
509
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
6468ce1ccdbb330f677aeb069bd21b539a5ae6dbcf2ab5272d85b040ee8f1052
Python
19,183
495
#!/usr/bin/env python # coding: utf-8 import pandas as pd import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from pyspark.sql import SparkSession from pyspark.sql import dataframe from pyspark.sql.types import StructType, StructField, DoubleType import sklearn.model_selection as ms from sklear...
5578fb2beb1a7946b3de671251465193cff0da38178b56291478203abf2e412b
Python
19,198
438
import os from . import conjugateGradient as cg, pointEvolution as evol from . import surfaceMatching, surfaces import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from .affineBasis import * ## Main class for surface matching # Template: sequence of surface classes (from surface.py); if not...
6ecb07019b32e1d7cb3212bc5adb39cc67578f0050683164cecdd197671d15c7
Python
19,205
465
import csv import functools import json import os import random import warnings import numpy as np import torch from pymatgen.core.structure import Structure from torch.utils.data import Dataset, DataLoader from torch.utils.data.dataloader import default_collate from torch.utils.data.sampler import SubsetRandomSampler...
7f2648903440a8ade78ad3190252b0aa114cae5fc624add0b3cb4f760db2bcd3
Python
19,216
418
#!/usr/bin/env python import sys, os, subprocess import argparse from argparse import RawTextHelpFormatter ################################################### ### 0. script description and parsing arguments ### ################################################### synopsis1 = "\ - creates OrthNet with homologous loc...
2fb7b5cf6f59f7ccdf585676bde71f282c2fce9a530b99ed154a891f5fedc82a
Python
19,217
492
import sys import torch import torch.nn as nn import torch.nn.functional as F import windseer.utils as utils from .custom_modules import SparseConv from .ModelBase import ModelBase class ModelEDNN3D(ModelBase): ''' Encoder/Decoder Neural Network to predict the wind. It can be configured to a VAE structur...
f3c5143b7e50a73bfcf53d64fe26e6a0c71d1dfcb6541eae642f438bb7bd6c0a
Python
19,217
471
# -*- coding: utf-8 -*- import torch import torch.nn.functional as func class Quantizer(torch.autograd.Function): @staticmethod def forward(ctx, inputs): """ Performs the forward operation. :param ctx: Autograd object with helper functions. :param inputs: Input tensors. ...
2e8d945ca7cdee62be9f03c5d919fc540902623f6a9c2fe5fc22cfdcd9f440cc
Python
19,272
505
# Copyright 2024 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
4764ec131796fb60d29d66b22ec6786b11b1ec0ec252d268535cb8202074b8c9
Python
19,272
531
"""Module containing utility functions for time series analysis""" import math import re import warnings from enum import Enum, IntEnum from typing import Any, Dict, List, Optional, Tuple import numpy as np import pandas as pd from sktime.param_est.seasonality import SeasonalityACF from sktime.transformations.series....
6892665e6f8c2a1da819466346881d3f6fe63a9db325ff27ff3023cae3b1247a
Python
19,292
561
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
ed22e69bb2be97e317e699633d14a0d5f991d2f01d065c953997347b152fb37f
Python
19,295
563
""" evcouplings command-line app Authors: Thomas A. Hopf .. todo:: Once there are different pipelines to run, there should be individual commands for these, so will need to define additional entry points for applications (e.g. evcomplex in addition to evcouplings). """ import re from copy import deepc...
a63f217cdf3be1d91a0cf42009615e07aa96693f0cc6b21e331f1446d78525a8
Python
19,303
466
#!/usr/bin/env python import sys, os, math, subprocess, datetime, argparse from argparse import RawTextHelpFormatter ################################################### ### 0. script description and parsing arguments ### ################################################### synopsis1 = "\ parses mRNA and CDS features...
aef823c5a07e14d30ace3ebb4d620f152f989646408a6b5d967e07df80b23755
Python
19,309
384
import os import warnings from datetime import datetime class Messages: FITTING_MODELS = "Fitting models on {n_models} response variables." FITTING_MODEL = "Fitting model for {model_name}." PREDICTING_MODELS = "Making predictions on {n_models} response variables." PREDICTING_MODEL = "Making prediction...
93b5e4a1462034060b7a7a84c4600f86bfe260e956e53f4f085b44e937e11199
Python
19,314
549
import gc import json import shutil from abc import ABC, abstractmethod from itertools import chain import numpy as np import torch import torch.nn as nn from sklearn.metrics import accuracy_score, f1_score from torch.nn.functional import softmax from tqdm.autonotebook import tqdm class BaseModelClass(nn.Module, ABC...
c2ea29ab4027bd66e366b6522832ae85946da3ecfd6b32ab960423903f3b84a1
Python
19,323
579
# Copyright 2018-2020 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
f5b290f7578d82b8f3114729c2e9de2c4cebde884dbd594be04c6c3d1c296b88
Python
19,323
530
""" Test cases for concatenation stage of EVCouplings complex pipeline Author: Anna G. Green """ import unittest import os import tempfile import pandas as pd from unittest import TestCase from copy import deepcopy import ruamel.yaml as yaml from evcouplings.complex.alignment import * from evcouplings.complex.dis...
14061799ea0cecb86bcbaa7afdb9788072e536b64b6f94179564676da6fd3843
Python
19,331
467
import os import numpy as np import pandas as pd import torch from rdkit import Chem, DataStructs from rdkit.Chem import AllChem from torch_geometric.data import Data from tqdm import tqdm import sys from sklearn.neighbors import KernelDensity from scipy.stats import norm sys.path.append("prepare_data") from create_drp...
6f0c87ee3b18a7c6e199a3d15cebb38b49789b7bee89f89b9e58feb243a74e70
Python
19,347
568
""" Methods that can be shared by many array-like classes or subclasses: Series Index ExtensionArray """ from __future__ import annotations import operator from typing import ( Any, Self, ) import numpy as np from pandas._libs import lib from pandas._libs.ops_dispatch import maybe_dispatch_ufunc...
cc9cd82b549787b5e9039c5f43730b4c0170b9c7395779bc15dde2d07b9cb7d6
Python
19,350
344
import sys import os import re import argparse import numpy as np import pandas as pd from cdr.config import Config from cdr.util import sn ENSEMBLE = re.compile('([^ ]+)\.m\d+') CROSSVAL = re.compile('([^ ]+)\.CV([^.~]+)~([^.~]+)(\.m(\d+))?') def new_row(system, results, tasks, base_partitions=None): if base_...
1d27de4e9c8780b837a7c59bab0352dee3c94ecf81cd36bd60a59c3b3685acf6
Python
19,368
363
from typing import Iterator, List, Tuple import torch import math import random from tqdm import trange import re def generate_step(out, gen_idx, temperature=None, top_k=0, sample=False, valid_idx=None): """ Generate a word from from out[gen_idx] args: - out (torch.Tensor): tensor of logits of siz...
93774c84343f6d9cc6fb23e07fca701bde10b98ed8a3dfe47f36ed1dfde037de
Python
19,374
463
"""Create ismrmrd datasets.""" import copy import os from pathlib import Path from typing import BinaryIO, Literal import ismrmrd import ismrmrd.xsd import torch from einops import repeat from ismrmrd.serialization import ProtocolSerializer from mrpro.data import SpatialDimension from mrpro.phantoms import EllipsePha...
abd5ed55d986d1a9282d787480bb87f5ad0a0344e4e7c8754e33897bc317a6d0
Python
19,375
479
""" This is the loadable seq2seq trainer library that is in charge of training details, loss compute, and statistics. See train.py for a use case of this library. Note: To make this a general library, we implement *only* mechanism things here(i.e. what to do), and leave the strategy ...
bb8d66f71ae3809b0798eb8288f4ab10e7186164a05feb0468c959848e8b9860
Python
19,381
398
"""MR image data (IData) class.""" import datetime import re import warnings from collections.abc import Iterable from pathlib import Path import nibabel import numpy as np import pydicom import torch from einops import rearrange, repeat from pydicom import dcmread from pydicom.dataset import Dataset from pydicom.pix...
f2ba0304e4a5ca377b917ede9831a4a33c684e854bca17252d2afacebaa20e64
Python
19,381
584
# -*- coding: utf-8 -*- import os from PIL import Image import os.path import time import torch import torchvision.datasets as dset import torchvision.transforms as trn import torch.utils.data as data import numpy as np from PIL import Image # /////////////// Data Loader /////////////// IMG_EXTENSIONS = ['.jpg', '...
d6709202c144e084c9b002567b9735352825bc5ff86b1f63aa1d3c38a04bdd6b
Python
19,384
601
import numpy as np import pytest from pandas.compat import HAS_PYARROW from pandas.core.dtypes.dtypes import DatetimeTZDtype import pandas as pd import pandas._testing as tm from pandas.core.arrays import ( DatetimeArray, IntervalArray, NumpyExtensionArray, PeriodArray, SparseArray, StringArr...
2b90a805d5ee4eaf1291a002c8f69a14c9b7a209f8518e2cb03d5a28155b8548
Python
19,393
427
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 4 23:20:47 2022 @author: wirrbel """ import os import glob import shutil import numpy as np import nibabel as nib import multiprocessing as mp import tempfile import cv2 import datetime from skimage import io, transform from skimage.util import i...
1df71afcfa83293331ecf054d77d0577be498618c1bbd4001d7136cd253f8e9c
Python
19,396
552
# Copyright 2018-2023 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
c8645e8e6c9484cf5725b4f3256f6519553c539b8af53425085c6d7c3be4cee8
Python
19,402
584
# -*- coding: utf-8 -*- import os from PIL import Image import os.path import time import torch import torchvision.datasets as dset import torchvision.transforms as trn import torch.utils.data as data import numpy as np from PIL import Image # /////////////// Data Loader /////////////// IMG_EXTENSIONS = ['.jpg', '...
3ef52ec1a8db73e80399bb3dc7ab88ac181a18ffe165a3e08e2fbd5986f2408c
Python
19,409
520
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
0cd9d647f6df6900d036d191eeb033d6f8b07c561f47a5c6dc741e12f1d9d443
Python
19,411
473
import csv import functools import json import os import random import warnings from sklearn.preprocessing import OneHotEncoder import numpy as np import torch from pymatgen.core.structure import Structure from torch.utils.data import Dataset, DataLoader from torch.utils.data.dataloader import default_collate from torc...
a8f485bd943d0b7b9037400f592a3d990a87bec81f37ded58e5253c837189a0e
Python
19,421
444
# Copyright 2026 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
0502896fd062ac3f5c9c54db5118db612100e04a0d1d467447f1a85e8a813dce
Python
19,433
515
# Copyright 2018-2022 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
0a81ca49b7522c119d3b3cec54680119d300f38d99b681ea929b01c468d21dfd
Python
19,439
483
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
bb89b0ca365de76b68e30e0cbade2372d052bc017759ebe494042a8a417d16e6
Python
19,452
533
import argparse import matplotlib.pyplot as plt import numpy as np import h5py from scipy.stats import pearsonr import torch from windseer.measurement_campaigns.predict import predict_case, masts_to_string import windseer.plotting as plotting import windseer.utils as utils parser = argparse.ArgumentParser( descri...
870a27ca27c72a9da0591d844e959cb4af7ee6d03cda3f4a3fbcc9e5a837f263
Python
19,502
638
# Copyright 2024 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
7376f596fa95cf790365c1b05274d73fb4dd7e4a97c40c74c034c150f050bd87
Python
19,503
570
""" Methods that can be shared by many array-like classes or subclasses: Series Index ExtensionArray """ from __future__ import annotations import operator from typing import ( Any, Self, ) import numpy as np from pandas._libs import lib from pandas._libs.ops_dispatch import maybe_dispatch_ufunc...
adb2a65e8a7af92912b18915e5403ed9776d363403730b3e3acc9486db90de96
Python
19,505
357
# Copyright (c) 2021-2023, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
cfe69b6b0b9e14bf352da1e9e7c7954ac0a63fae63652dd2b786f01af2334f26
Python
19,513
448
""" Job management module for cptools2. Handles experiment configuration, command generation, and result processing for CellProfiler analysis on computing clusters. """ import os from cptools2 import colours, commands, filelist, loaddata, splitter, utils from cptools2.colours import pretty_print class Job(object):...
5e0a9f59255e71b7a4eadc605dc0006114a15d33ea86ec81177046bdbf9c6db9
Python
19,517
437
import os import numpy as np import numpy.linalg as la import logging import h5py import glob from . import conjugateGradient as cg, kernelFunctions as kfun, pointEvolution as evol, bfgs from . import surfaces from . import surface_distances from . import pointSets from .surfaceMatching import SurfaceMatchingParam, Sur...
1c030b0b7955f49e82891ade06f09266a71236a066c80a8d009a09550694f2e6
Python
19,528
603
import numpy as np import pytest from pandas.compat import HAS_PYARROW from pandas.core.dtypes.dtypes import DatetimeTZDtype import pandas as pd import pandas._testing as tm from pandas.core.arrays import ( DatetimeArray, IntervalArray, NumpyExtensionArray, PeriodArray, SparseArray, StringArr...
56b7c63719705c98d5e74ce834ee28746f4fde4ab547998e7fb76e809832f02b
Python
19,535
524
import os, torch, cv2, re import numpy as np from PIL import Image import torch.nn.functional as F import torchvision.transforms as T from scipy.spatial.transform import Rotation as R # Misc img2mse = lambda x, y : torch.mean((x - y) ** 2) mse2psnr = lambda x : -10. * torch.log(x) / torch.log(torch.Tensor([10.])) t...
00a10c7b7506ba91b423c75c43471ed62433bafb1ccd6187d90006f3402a7a85
Python
19,538
403
#!/usr/bin/env python __author__ = 'etseng@pacb.com' import pdb import os, sys import itertools from pickle import * from collections import defaultdict, namedtuple from Bio import SeqIO from Bio.SeqIO import SeqRecord from Bio.Seq import Seq from bx.intervals.cluster import ClusterTree from cupcake.io import BioRea...
9b6b7333ae02b585a193297fb68c6bcd03b9c6dc5e4196963aa8b8aa8e31cb60
Python
19,545
408
# Copyright (c) 2018-2023, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
b7f36f2602614145e1c833fa2b52a4115170201e4a469d284bff18788c72a80b
Python
19,546
518
import copy from typing import Iterable, List, Literal, Optional, Union import numpy as np import pandas as pd from anndata import AnnData from mudata import MuData def pair_peak_gene_sc( adata_cc: AnnData, adata: AnnData, peak_annotation: Optional[pd.DataFrame] = None, pvalue_adj_cutoff_cc: Optional...
526795e0b857d6f2764c23103be46c5666102957ff4ab1eeffdadbe48fa5e072
Python
19,553
543
"""Tools for downloading datasets.""" import itertools import json import logging import os import os.path as op import shutil import tarfile import time import zipfile from glob import glob from io import BytesIO from lzma import LZMAFile from urllib.request import urlopen import numpy as np import pandas as pd impor...
93d9fe18317591cd9b08fd452cc084db71cfe6dc6e42d44fc5c682496581fbec
Python
19,553
433
"""Transforms relate to tokenization/subword.""" from onmt.utils.logging import logger from onmt.transforms import register_transform from .transform import Transform, ObservableStats class TokenizerTransform(Transform): """Tokenizer transform abstract class.""" def __init__(self, opts): """Initializ...
0fc1dfb1330a93e70b0b5326c5942696e47f67a18fa1491966fcbe4df407ae2f
Python
19,554
493
''' Created on Mar 8, 2012 @author: regger ''' import numpy as np from . import scalar_field from model_data_base.mdbopen import mdbopen class Edge(object): ''' Edge object contains list of points, diameter at each point, label, string hocLabel, parentID Used during reading of hoc files ''' ...
d9a36c8010912400cad415a1fdc1fe042dd912f6ebd13af25925aab2fb1f53e7
Python
19,560
562
#!/usr/bin/env python3 """Small runtime checks shared by BASALT command modules.""" from __future__ import annotations import fcntl import hashlib import os import re import shutil import subprocess from pathlib import Path EXPECTED_MODEL_ENSEMBLES = 5 _CHECKPOINT_STEP = re.compile(r"^(\d+)") _CHECKM2_METRIC_KEYS ...
df09093a9956fc7681949f9b660debe76788c33227498ba68e60584fdf2aec36
Python
19,571
550
from argparse import Namespace from math import log2 from typing import Optional, Dict, Any, Union, TYPE_CHECKING, Tuple import logging import torch import torch.nn.functional as F import torch.nn as nn from .hash_grid_torch import HashEmbedder from ..transform import RigidTransform, ax_transform_points, mat_transform_...
3f66103f207efc11539d64147f57f41c73fbd936b42a56acfaa4e5170f1839a9
Python
19,576
516
from collections import ChainMap import inspect import numpy as np import pytest from pandas.errors import Pandas4Warning import pandas as pd import pandas._testing as tm class TestRename: def test_rename_signature(self): sig = inspect.signature(pd.DataFrame.rename) parameters = set(sig.paramet...
7c86df959e5e6ec7d30671ba884f327d4655423eeaf37981daa85af91b769966
Python
19,578
510
# coding: utf-8 from atropos.adapters import * from atropos.align import MatchInfo from atropos.commands.trim.modifiers import * from atropos.io.seqio import Sequence from atropos.util import reverse_complement as rc DUMMY_ADAPTER = Adapter("ACGT", FRONT) def front_match(read): match = Match(0, 2, 0, 2, 1, 0, Tr...
5635fe213ecee55de83d2304807f4c3c9cb6dcf7436adaf5be38dca6e8b460ac
Python
19,581
543
"""Tools for downloading datasets.""" import itertools import json import logging import os import os.path as op import shutil import tarfile import time import zipfile from glob import glob from io import BytesIO from lzma import LZMAFile from urllib.request import urlopen import numpy as np import pandas as pd impor...
57861f6ec1ebd7d8a3d727cf24be5e884708667976ce868e412a1f4fcf81e586
Python
19,585
517
"""Feature view.""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import logging import re import numpy as np from phylib.utils import Bunch, emit from phy.plot.transform import Range from ph...
14543e0dd5c954ba3232728ec8c17806ee3f75dc66e9f42df70c08b3703b9e86
Python
19,593
508
import math import numpy as np from sklearn.gaussian_process import GaussianProcessRegressor as GPR from sklearn.gaussian_process.kernels import RBF, ConstantKernel import time import torch def bin_log_data_binning(wind_data, grid_dimensions, verbose=False): ''' Bins the input wind data into a grid specified ...
c3dd9c5fa49345b3fe69f93cf56927f4eae08c92e9c8505c5379b784467eb710
Python
19,599
496
# Copyright 2025 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
cf3553ee4075c7439dea162161467b9da1859872d419a2bc816a92a67c660fb2
Python
19,607
639
""" These benchmarks are for Series and DataFrame indexing methods. For the lower-level methods directly on Index and subclasses, see index_object.py, indexing_engine.py, and index_cached.py """ from datetime import datetime import warnings import numpy as np from pandas import ( NA, CategoricalIndex, D...
2787681a44be17219b5f12c86865f228e7edebb66e9d21ee6628ffc94809a9e9
Python
19,616
488
# -*- coding: utf-8 -*- ''' BOOSH_CLI COMMAND LINE (CLI) VERSION FOR SPATIOTEMPORAL CLUSTERING OF MOLECULAR TRAJECTORY DATA USING 3D DBSCAN. TIME CONVERTED TO Z THIS VERSION CLUSTERS THE INDIVIDUAL DETECTIONS RATHER THAN TRAJECTORY CENTROIDS Design and coding: Tristan Wallis Additional coding: Kyle Young, Alex McCann...
06da353739df3ccf29adc4a7b9c41f80b752950c1636ffbeefd3c32873a398dd
Python
19,622
502
__all__ = [ "GlycoPeptideBranchMS2Data", "GlycoPeptideBranchMS2Output", "GlycoPeptideBranchMS2DataConverter", "GlycoPeptideBranchMS2Dataset", "GlycoPeptideBranchMS2DataBatch", ] import itertools from typing import ( Any, List, NamedTuple, Sequence, Tuple, Union, cast, ...
8b91a50833f12bec71241d146a42e02d001ccf582e124929a15c132426d68b55
Python
19,622
429
""" Title: stimulation_protocols.py Author: Matus Tomko Mail: matus.tomko __at__ fmph.uniba.sk """ import numpy as np from neuron import h, gui from CA1_plasticity.model.utils import Synapse class StimulationProtocol: """ A class used to set a stimulation protocol ... Attributes ---------- s...
fee0dbe157de83728e5ec60a40d57be82b0b199af398636f960a3cb422784955
Python
19,625
540
""" Tests for DatetimeIndex methods behaving like their Timestamp counterparts """ import calendar from datetime import ( date, datetime, time, ) import locale import unicodedata import numpy as np import pytest from pandas._libs.tslibs import timezones from pandas.errors import Pandas4Warning import pa...
c20b19dcf4e1142788c64c7a621442c993ccd4182c4d3969bc256e2b86b2d0b5
Python
19,630
551
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
93f22a70c8ae2d7d7ab0b4379753405e8259294f484707445a120e8ff80e2fc0
Python
19,631
502
"""Pure, immutable domain objects for AIND merge propositions. This module deliberately knows nothing about Qt, files, spike arrays, or the curation workflow. The controller and persistence layers exchange ordinary JSON-compatible mappings through the codec functions below. """ from __future__ import annotations fr...
02693c5e12edc87aaefe0f058184ee997beb0b85ec50c2775aed9cb4e66cea02
Python
19,637
540
#!/usr/bin/env python3 """ Simple static site generator for the pandas web. pandas_web.py takes a directory as parameter, and copies all the files into the target directory after converting markdown files into html and rendering both markdown and html files with a context. The context is obtained by parsing the file `...
23cb5d9b3dcff62a7ecaab6900ff941e8d5ce64b27959ae1f5b7479d0ae5ca05
Python
19,652
494
# -*- coding: utf-8 -*- """ Created on Thu Nov 30 07:57:45 2023 @author: lonya """ #%% Load Data import tkinter as tk import tkinter.filedialog as fd import numpy as np import os import matplotlib.pyplot as plt import pandas as pd import my_funcs as mf import pickle #%% Load single limb gait root = tk.Tk() filez = f...
faaa39d293cec62806e8ec02db2c163e3d7203c7c33ade449f5161b852a5d913
Python
19,665
595
#! /usr/bin/env python # -*- coding: utf-8 # # Copyright (c) 2023 Kenneth Atz, Clemens Isert & Gisbert Schneider (ETH Zurich) import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.nn import MessagePassing from torch_geometric.typing import Adj, Size, Tensor from dragonfly_gen.gml.pygm...
47de1a8179fee848879e7d9f7c1c0e3e947cab7192b27cff8bbd403f7230a5b6
Python
19,670
431
"""Test datamodule functionality.""" from collections.abc import Sized import numpy as np import pytest from lightning.pytorch.utilities import CombinedLoader from torch.utils.data import RandomSampler def test_base_datamodule(cfg, base_data_module): im_height = cfg.data.image_resize_dims.height im_width =...
79d7585152f537b088beb4f00378a319dc291daedf5650087855254a357237f9
Python
19,671
440
# Copyright (c) 2018-2023, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
868114fdbb8655c4c5a3d18ec2fd8010c5d4e693bbc4f01adb0d782300637e04
Python
19,673
414
from .utils import PheWebError, get_phenolist, chrom_order from . import conf from . import parse_utils import io import os import csv from contextlib import contextmanager import json import gzip import datetime from boltons.fileutils import AtomicSaver, mkdir_p import pysam import itertools, random from pathlib imp...
69ee5d8767d4e83f43ebcb70b9a3dfc4d474e2fa17aff7a1651a8df0aef7ef57
Python
19,678
505
"""Plot rendering endpoints. The engine's ``pycaret.plots.*`` modules return ``plotly.graph_objects.Figure`` objects. These endpoints expose them over HTTP as JSON the React UI's ``react-plotly.js`` component can consume directly. Two render styles: - **Run-bound** (``GET /runs/{run_id}/plots/{kind}``): for screens ...
cc77eccea6fd042afb05bda5fa63d31485092ea807014c3313b36c9a29248060
Python
19,688
506
# Copyright 2026 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
92cdbfdff0ae5472164ae25093b291ef7d4bc70394348543937db6d7d3ba35d5
Python
19,693
578
import os import argparse import time import csv import sys import json import random import numpy as np import pprint import yaml import torch import torch.multiprocessing as mp import ray from ray import tune from matdeeplearn import models, process, training ######################################################...
1454acc898fdbe73b1f916739cff6ffaaab56800adf78f8698e9fbe1bf4fd46a
Python
19,700
486
#MIT License # #Copyright (c) 2019 Iñigo Prada Luengo # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge,...
a83ba1b2e8929535c8cc247fecc11d42bee1118ba313f9376895d2180f76c423
Python
19,717
460
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
83dce05d45b73e08d00ebc241dcf87817344c5d490bd95762d8f524537f8238b
Python
19,725
418
# Copyright (c) 2018-2023, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
2465b63b6253e14d741956dbdf2fc53c1e341dc9460d822c27ed00c66669afcc
Python
19,735
553
"""Base class and functions for implementing command-line interfaces for Atropos subcommands. """ from argparse import ArgumentParser, ArgumentError, HelpFormatter import copy import logging from multiprocessing import cpu_count import operator import os import platform import re import sys import textwrap import urlli...
5085e342acd07d69f81c4da6f4b3184460ac95c38452d880c3b5606017263132
Python
19,741
530
import matplotlib.colors as colors import matplotlib.cm as cm import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import griddata from windseer.measurement_campaigns.measurements_line import get_tower_distances_on_line def plot_measurement_campaign_scatter(ret): ''' Plot the predictions...
fcf3e9f52230fecc6210d6622d9376d6bdabb60434eadb8943cf50f6282b1894
Python
19,760
506
#!/usr/bin/env python from __future__ import print_function import io from math import trunc from scipy import ndimage import numpy as np import os import pandas as pd import shutil import tarfile import time import torch import h5py import sys def change_dataset_compression(infile, outfile, s_hor=1, s_ver=1, compr...
d2ac2a331368a11ca6864d28f57299c20201354685c561ceea1ab7aeabdbbbfa
Python
19,763
426
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
83b3df2d152ef36779ca57e6cc9eebbb22e840293c8f9295ca487fe463735131
Python
19,767
550
# Copyright 2024 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
d1c3f2cdc9944c5092dfc495b72c44346cba4a3e29295cf93ee4ab266e47995e
Python
19,768
548
""" Should always be faithful duplicate of sequence/BioReaders.py Duplicated here for tofu installation. This one is called via cupcake.io.BioReaders. """ import re, sys, pdb from collections import namedtuple import pysam Interval = namedtuple('Interval', ['start', 'end']) class Sim...
872509eadceec2124feb7d8c8b113388ef51169fdf8c3de482ed45b2ed09d0eb
Python
19,786
541
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
e2f9361580a623729f411137594bdc83c37192f66c3f211662609bc7d2eb1895
Python
19,789
574
# ------------------------------------------------------------------------------------------------------------------------------------- # Following code curated for GCPNet (https://github.com/BioinfoMachineLearning/GCPNet): # ----------------------------------------------------------------------------------------------...
f86151e02645b54ef3e9979dbc8ec2a0843e0189e3d973c55be533694ca447c4
Python
19,789
490
""" Unit tests for transpiler function. """ from math import isclose import pytest import pennylane as qp from pennylane import numpy as np from pennylane.transforms.transpile import transpile def build_qfunc_probs(wires): def qfunc(x, y, z): qp.Hadamard(wires=wires[0]) qp.RZ(z, wires=wires[2])...
f5fa9c9f1af5cd68cd5d7508cdc641793816a3f43f768f1471d850317b5b92d2
Python
19,791
417
#!/usr/bin/env python __version__ = "1.08" import os import sys import re import shutil import glob import argparse import textwrap import pandas as pd import operator import time from collections import defaultdict from collections import Counter from datetime import datetime from Bio import SeqIO class bcolors: ...
0376841f4e2b667557eaaae9065c2b0cf12c89910ea5852076885b12a5795a58
Python
19,796
625
""" Functions for arithmetic and comparison operations on NumPy arrays and ExtensionArrays. """ from __future__ import annotations import datetime from functools import partial import operator from typing import ( TYPE_CHECKING, Any, ) import numpy as np from pandas._libs import ( NaT, Timedelta, ...
2e0d1438bdcb6ff75ddc10cc325dc5f775a8794b983e94f1131c071349f8e86b
Python
19,800
651
""" Extend pandas with custom array types. """ from __future__ import annotations import inspect from typing import ( TYPE_CHECKING, Any, Self, TypeVar, cast, overload, ) import numpy as np from pandas._libs import missing as libmissing from pandas._libs.hashtable import object_hash from pan...
07b44a720dd80b56bb111beedf90806995f0a7ce2e3f1717ea01bdaa02c738ed
Python
19,802
405
import numpy as np import torch from torch.utils.data.dataset import TensorDataset from torch.utils.data import DataLoader import torch.nn.functional as F from torch.autograd import Variable import pickle as pkl torch.set_default_dtype(torch.float64) # input_B_AN_D, target_B_S_D, nodeIncomingEdges_B_S_IE_AE, rel_rec_...
79e8e6ab310915a39732009cc01d311b30e0c67c7ecd4abc3b79221e03e0c058
Python
19,807
386
# Copyright (c) 2021-2023, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
baa5fd9bd9edf926c5464b5cb05c7d08efcfe0852b7cade79f4e8a52a206d52b
Python
19,820
692
from datetime import ( datetime, timedelta, ) import operator import zoneinfo import numpy as np import pytest from pandas._libs.tslibs import iNaT from pandas.errors import Pandas4Warning import pandas as pd import pandas._testing as tm from pandas.core import roperator from pandas.core.arrays import ( ...
f3fb8e9875102519ed391c89e2e6b0eb213d37820fba20dba18431449e9f6f71
Python
19,826
495
"""This script creates the group level figures.""" import os from copy import deepcopy import dill import glmtools as glm import h5py import matplotlib as mpl import matplotlib.pyplot as plt import mne import numpy as np import osl from anamnesis import obj_from_hdf5file from matplotlib.lines import Line2D from lemon...
eff3bec26c34f4ab7b7818cd5b096b634a437a06d63224572a17eae41a68adc1
Python
19,836
514
import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm class TestDataFrameCov: def test_cov(self, float_frame): # min_periods no NAs (corner case) expected = float_frame.cov() result = float_frame.cov(min_periods=len(fl...
177f87732da011dd411fc992b69591a39596c5a170e036be273204ce4a467000
Python
19,842
357
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
644623a500dbe0e2c7d4663489ffe42743751bb25b18a49c5c2b78d78a8a62e8
Python
19,862
411
""" Reads a fasta file of individual protein sequences. Uses ESM2 to infer MSA column-wise probabilities. Writes a profile hmm in HHsearch 1.5 (.hhm) hmmer3 (.hmm) format. """ #TODO: figure out how to calculate cs219 files directly #TODO: Apply Dirichlet priors to probabilities for hmmer3 output. import to...
3653f77364e83d5ddfdb1aff083be8bf978fd48e87f1016c17c17d85b81e722e
Python
19,872
568
import os import subprocess import sys import textwrap import numpy as np import pytest from pandas.compat import WASM import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm from pandas.core.util.hashing import hash_tuples from pandas.util import ( hash_array, hash_pandas_...