sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c2738b45027e90e5f7e38a55fae4187456f50c611969a21107cb9e73db6c3bab
Python
11,840
336
# _*_ encoding: utf-8 _*_ __author__ = 'wjk' __date__ = '2020/6/30 10:32' import math import numpy as np import torch import torch.nn as nn # from einops import rearrange import torch.nn.functional as F from .model_Transformer import GPTDecoderLayer, GPTDecoder from MCMG_utils.utils import Variable device = torch....
a73e72ac4c1deea67230abb64abe8b2b872c4d2808cb226e236c1325104f89c1
Python
11,842
341
import numpy as np #import curves from base.curves import Curve, remesh from base import loggingUtils from base.kernelFunctions import Kernel from base.curveMatching import CurveMatchingParam, CurveMatching import matplotlib matplotlib.use("qt5agg") import matplotlib.pyplot as plt def compute(model='default', dirOut=...
435adc1f1f760aaa86a73344280c9b193f1038843ff390c3938fc62dfbf5f5f7
Python
11,843
334
import numpy as np import logging from . import conjugateGradient as cg from . import bfgs from .gridscalars import GridScalars, saveImage from .diffeo import multilinInterp, multilinInterpGradient, multilinInterpGradientVectorField, jacobianDeterminant, \ multilinInterpDual, imageGradient, idMesh, multilinInterpVe...
5cdac59af8d65c0f07fe89205ee905024471f14507aa2329091adfeb735f65a0
Python
11,847
288
''' Created on Mar 30, 2012 @author: regger ''' import numpy as np #import reader #import writer #import cell_parser class SynapseMapper(object): ''' SynapseMapper assigns synapses to neuron morphology self.cell is neuron SpatialGraph self.synDist is average synapse distribution (3D scalar field) ...
5547830c171a4bfe22a040b1e382987ce617b864b91e5ede785e937d10f180e6
Python
11,865
274
# 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...
e6dc55762bf854f0c111b7d56fc8b5467dd422d89f14a3755962fd03e3e43fd0
Python
11,866
302
# load_trackmate.py from initialization.initialization import * from initialization.config import * from data_processing.cleaning_formatting_filtering import * from data_processing.migration_calculations import * import re import tqdm import pandas as pd import numpy as np # Thanks to Guillaume Jacquemet for the follo...
ba1f161b7ff080dcef94bcd234f3dd1fc5a3ff2728900ff1c5eb3d2bc620894b
Python
11,869
265
import os from unittest import TestCase, mock import dynast.align as align import dynast.config as config import dynast.utils as utils from tests import mixins class TestAlign(mixins.TestMixin, TestCase): def test_STAR_solo(self): with mock.patch('dynast.align.utils.get_STAR_binary_path', return_value='...
c317238fb530a657781d2a1f972569555ba3eb16347c07e8d7f17125cc34599f
Python
11,872
287
#!/usr/bin/env python __author__ = 'etseng@pacb.com' """ Should be used *after* summarize_sample_GFF_junctions.py is called to generate junction report. Looks through the junction reports and scrub it, retaining only junctions that meet one or more of the following criteria: (a). be the only junction in that "label...
5a096214cdaee43e2a12fa578efb953b91ea6b5eafd78058fd4a725dfc08fabd
Python
11,873
319
import datetime import dateutil import numpy as np import pytest from pandas.errors import Pandas4Warning import pandas as pd import pandas._testing as tm class TestDataFrameMissingData: @pytest.mark.filterwarnings("ignore:The inplace keyword in DataFrame.dropna") def test_dropEmptyRows(self, float_frame):...
b1a9cda8ff84639ee5ee43a86f5ce6db9a956d194643dd1ea2355c90d8a71284
Python
11,876
334
# 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...
6f3b7575d212669df348e16a17cbd75a223f95e772cea8e284afe84ecab74098
Python
11,877
329
from models.model import input_dim, output_dim import numpy as np import os import time import cv2 import sys from PIL import Image from inference.segment_brain_gauss import loss_inference import csv import json import re from utilities.utilities import * # Will need to be adjusted depending on the GPU batch_size = 1...
83beb608864b7c78c04f24713b3a8de98453f594beac78e941d119ca4c01c2da
Python
11,882
309
r""" Angular math utils that contain calculations of angles. """ __all__ = ['RotationRepresentation', 'to_rotation_matrix', 'radian_to_degree', 'degree_to_radian', 'normalize_angle', 'angle_difference', 'angle_between', 'svd_rotate', 'generate_random_rotation_matrix', 'axis_angle_to_r...
ce0328ab27be20e5a719f2baed7c545c252e875534a066b9d7a11e0223706a78
Python
11,884
339
"""This script runs the first-level GLM-Spectra and prepares the group data. The script can be set to preprocess just the single example subject by changing 'subj' in the main body. If the group-level data collation is run, then all glm-spectrum datasets found in the output dir are collated. """ import glob import ...
d44944d331e6b998b918ee82bb5555fb16236d2e9e93f8dfad8e5650a0a3d29f
Python
11,884
331
from __future__ import annotations import math from collections import defaultdict, deque from dataclasses import dataclass, field from pathlib import Path from typing import Dict, FrozenSet, List, Optional, Set, Tuple @dataclass class Node: label: Optional[str] = None length: Optional[float] = None chil...
656f0c6ebc1b3d0a8807cd58d97f8b90487f190736d8d814dcf7dbc78bdc04f1
Python
11,885
324
import numpy as np import pytest from pandas._libs.tslibs import ( iNaT, is_supported_dtype, ) from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas._libs.tslibs.np_datetime import ( OutOfBoundsDatetime, OutOfBoundsTimedelta, add_overflowsafe, astype_overflowsafe, is_unitless, ...
093cd672a1c84b5a659a1b5e67ac337de50a85316dc1dcf22807b91e62f92f15
Python
11,887
299
""" Tests for the following offsets: - BQuarterBegin - BQuarterEnd """ from __future__ import annotations from datetime import datetime import pytest from pandas.tests.tseries.offsets.common import ( assert_is_on_offset, assert_offset_equal, ) from pandas.tseries.offsets import ( BQuarterBegin, BQu...
4775988dfaeb7aad5960d9209458fc2da12a5ea9e2f74642cb1b5c284198b137
Python
11,893
289
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Step S1p: Merge closely related bins within the same assembly group. This module analyses paired-end connection files, depth matrices, and CheckM statistics to identify candidate bin pairs that likely belong to the same genome, and records them for downstream merging....
10bd0c98e406e577640592c8ff6a6a045ec52b5e5a077dc313f53c853910b281
Python
11,897
379
# -*- coding: utf-8 -*- """ Created on Tue Mar 14 15:29:22 2023 @author: jeanbaptiste """ import json import numpy as np import matplotlib import matplotlib.pyplot as plt from scipy.spatial import distance import tensorflow as tf import tensorflow.keras from tqdm import tqdm import deepcellcontrol as dcc matplotli...
62296a64271a3edc65d71806193c3a585c2d00c2a8d16420f890117c1a994ffe
Python
11,915
406
""" test cython .agg behavior """ import numpy as np import pytest from pandas.errors import Pandas4Warning from pandas.core.dtypes.common import ( is_float_dtype, is_integer_dtype, ) import pandas as pd import pandas._testing as tm @pytest.mark.parametrize( "op_name", [ "count", "...
52a6ced74ee5803e940b47fa52301ee4e2d0ad9dc3f23ff2a27e2554828fc5a0
Python
11,920
428
# -*- coding: utf-8 -*- # @File name: plot_firing_rate.py # @Author: Alicia Garrido-Peña # @Date: 2023-08-10 21:29:51 # @Contact: alicia.garrido@uam.es # "Copyright (c) 2023 Alicia Garrido-Peña. All Rights Reserved." # Use of this source code is govern by GPL-3.0 license that # can be found in the LICENSE file # C...
4420781ee54ac99b0777641a76eb661a3e0c4e0dd5d6cdb127bcb73b65c4888e
Python
11,924
375
import numpy as np import pytest from pandas.errors import UnsortedIndexError import pandas as pd import pandas._testing as tm from pandas.core.indexes.frozen import FrozenList def test_sortlevel(idx): tuples = list(idx) np.random.default_rng(2).shuffle(tuples) index = pd.MultiIndex.from_tuples(tuples)...
7157a21f05567fcef20569f4d9fcaba727ece3e921763d5c66d00c62e19b1648
Python
11,929
286
from __future__ import annotations from os import PathLike from typing import TYPE_CHECKING import numpy as np import pandas as pd import xarray as xr from pcntoolkit.math_functions.velocity import ( compute_thriveline_y, compute_thriveline_z, thrivelines_to_dataframe, ) from .correlation_matrix import ...
d404db92dabcb00861d88d4c3463e7e2f3ab420be0a43f10b3967a20eab3f019
Python
11,935
265
import scipy as sp import scipy.io import os import numpy as np import pandas as pd import glob import csv import random as rand from tqdm import tnrange, tqdm_notebook from collections import Iterable import matplotlib.pylab as mpl import random as rand from ipywidgets import * import colorlover as cl from scipy impor...
45e76a412340b1925556fc642713d962a393faf0a30331718ba0d4e7d83ae583
Python
11,953
328
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ import math import torch from torch_geometric.nn import SchNet from torch_geometric.nn.models.schnet import GaussianSmearing, InteractionBlo...
6cc18934c1c3102b38596cc3e2f529866b194c2bf4a8362e96db5c7e3e14b409
Python
11,955
199
from botocore.client import Config import ibm_boto3 from io import StringIO import os import pandas as pd import sys import json sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) from config.globals import E...
35e4905e76811f186d0c8e0911b94754d6fbd9547d6c21a83b1ed9862e693812
Python
11,959
329
# 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...
b4d7a1c0547a65ec6914f3b0a16f7f32a6edeb12b691ac70f972cdd260310033
Python
11,961
318
import pandas as pd import graph_tool.all as gt import numpy as np import matplotlib as mpl import matplotlib.cm as cm from matplotlib.colors import LinearSegmentedColormap from tqdm import tqdm class Network(object): def __init__(self, input_dotfile, cmap=cm.Spectral_r, ...
d87bd9d70e6b4860cdd4bc02ccc0a5f6878b20b5adb3b4512e02613743c28d76
Python
11,962
171
import sys import os import argparse from spit.transform_tx_counts_to_ifs import main as transform_counts from spit.filter_and_transform_tx_counts import main as filter_counts from spit.spit_test import main as spit_test from spit.get_p_cutoff import main as get_p from spit.dtu_detection import main as detect_dtu from ...
fb322bbc3dcb2eecba22d222f09b4033cc92069430b92a7a64f3dd69fab6e0d5
Python
11,972
313
__all__ = ["StrucGPReportParser"] import os import re from typing import Iterable, Union import pandas as pd from ..filter import GlycoPeptideSpectrumFilter from .annotation import GlycoPeptideMS2SpectrumAnnotator from ....chem.gpep.glycans import GlycanNode from ....chem.gpep.gpmass import GlycoPeptideMassCalcula...
f6b6b541a245a17cd6ed33b11d07a1e13442ed0c3ebbbf71e4a587ddc6c02dde
Python
11,977
286
# %% [markdown] # # Accelerated proximal gradient descent (FISTA) reconstruction using wavelets and $\ell_1$-norm minimization # %% [markdown] # ### Image reconstruction # Here, we use a proximal gradient descent algorithm to reconstruct an image # from 2D radial k-space data with wavelet regularization. # In particul...
079acf7389b7a5ef7f2ed489c6a164dc8aa578e544123b8a5bf62d80baa54354
Python
11,980
286
"""Models that produce heatmaps of keypoints from images.""" from typing import Any, Literal import torch from jaxtyping import Float from omegaconf import DictConfig, ListConfig from lightning_pose.data.bboxes import model_to_frame_batch from lightning_pose.data.datatypes import ( HeatmapLabeledBatchDict, M...
ab1822a984e6ae61751f3c404919c842c4f4484cb7dfacf104e705c40c75057f
Python
11,981
349
# Copyright 2018-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...
6fcd4a02fb0c2b0f18db1bcc9cce83593d3ed4e202afe20404a9f19bf8fa9af4
Python
12,008
322
''' Configuration file. Fill out this file then run the jupyter notebook to analyze your data ''' ''' Experiment-specific constants to be filled by user ''' # DATA_PATH = 'D:/HERNANDEZ/CSV_files'# Input the path to the folder containing the data OUTPUT_PATH = 'D:/HERNANDEZ/output' # Input the path to the folder wher...
4ba7f88b8b31aff78fe5985f47ac5b779f63365ca92e4ced4b2c1643c56dc974
Python
12,015
389
# 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...
a27c64074d44735ae6fe54537e7776506afc0dbe0dbc5d460b2e4d19cacaae74
Python
12,021
152
"""Clean publication graphics: panel letters only, explanatory text in captions.""" from figure_style import * TOTAL='Midlands Province';YEAR=2022 from matplotlib.lines import Line2D prov=annual[annual.area==TOTAL].sort_values('year') unit_names=[n for n in bounds] latest=annual[(annual.year==YEAR)&(annual.area!=TOTAL)...
ad551a409a36c85aa7f99b3b280866f832d0630752741e8196c9b7be8c704c15
Python
12,029
372
from __future__ import annotations from collections import defaultdict import datetime import json from typing import ( TYPE_CHECKING, Any, overload, ) from pandas.io.excel._base import ExcelWriter from pandas.io.excel._util import ( combine_kwargs, validate_freeze_panes, ) if TYPE_CHECKING: ...
8211f26987a0df5df8f83d30fb06060337d0ab29b0e4358bcd579a10bd6c2a17
Python
12,034
328
# -------------------------------------------------------- # Based on BEiT, timm, DINO and DeiT code bases # https://github.com/microsoft/unilm/tree/master/beit # https://github.com/rwightman/pytorch-image-models/tree/master/timm # https://github.com/facebookresearch/deit # https://github.com/facebookresearch/dino # --...
6f0793ef57f62d25c8dba51d27c726ad30804d4776466eabca383fc6cc5df655
Python
12,039
207
#! /usr/bin/env python import argparse import os import sys from time import strftime import pysam from hashed_read_genome_array import HashedReadBAMGenomeArray, ReadKeyMapFactory, read_length_nmis #, get_hashed_counts from plastid.genomics.roitools import SegmentChain, positionlist_to_segments import multiprocessing...
9126a2cd45af7fa79a15a06126ce94f61868be2d810a326b705a79075e751490
Python
12,042
256
""" Trainer for inducing predicate vectors and cued association transition model Some code is adapted from the DGL implementation of RGCN link prediction: https://github.com/dmlc/dgl/tree/master/examples/pytorch/rgcn """ import sys, configparser, torch, utils import numpy as np import torch.nn as nn import to...
bf3f2a48606c47224423ea40e5d5752e49724f653bffefc7a8e2bc23247dfbab
Python
12,047
354
try: if INIT: print("Initialized.") except: from pyNN.nest import * from pyNN.random import RandomDistribution import matplotlib.pyplot as plt import numpy as np from scipy.signal import find_peaks import pickle import pandas as pd INIT=True def OUProcess(tau,tstop,dt): rng = ...
0781d5256543b4468150bad44b1d9f27f04451702bef98158f4a915fb12ca441
Python
12,048
281
"""Regression tests for the release-preparation correctness fixes: the central value normalizer prior (default from the CV's own geometry; explicit count from central_value_config, else the top-level key), the player's vecenv fallback for creator-less registrations, and discrete PPO honoring multi_gpu_scheduler_kl: 'lo...
dc0557443f41cb1e4213b5f4175c70798a2489c6dd186071be896e349915fc99
Python
12,050
309
r""" Spatial math utils that combine linear and angular calculations for rigid bodies. Also contains utils for articulated body kinematics. """ __all__ = ['transformation_matrix_np', 'adjoint_transformation_matrix_np', 'transformation_matrix', 'decode_transformation_matrix', 'inverse_transformation...
a9dc51cf4e51dcad0c021b7031a29d0621643cc8dc8b7901011ad3ddfc94c097
Python
12,054
332
from typing import Any import pytest import torch from mrpro.operators import EinsumOp, LinearOperator, MagnitudeOp from mrpro.operators.LinearOperatorMatrix import LinearOperatorMatrix from mrpro.utils import RandomGenerator from tests import dotproduct_adjointness_test def random_linearop(size, rng): """Creat...
84a62dc760711dccbbeb69eaff2b5e59fab98c750c8b8ecac2e43ba185f2b1b5
Python
12,058
295
#----------------------------------------------------------------------------- # Bridging Water Features #----------------------------------------------------------------------------- import os import sys import numpy as np from DXGB.get_pdbinfo import * #get the structural information of water molecules and get the ...
e112ec67466f88cdd27b1bc8989a0865fc40d4bc0b01779434510155400c428f
Python
12,063
274
# -*- coding: utf-8 -*- import torch #from sdna.net.core.channel import MarkovModelKL def train(model, optimizer, args, epoch=1, mode="encoder", warmup=False): """ Trains the model depending on the mode and optimizer. :param model: The entire model or rather the network. :param optimizer: The optimi...
5ae1e6b60505c2c04f5dbe23af2a8a9435f8c08cdeaaa5f1d166ef9f6f2ecef1
Python
12,069
275
# 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...
6ede35f48747eb8cb31df1bd6315485bfaa6033029ae79adee81c5eafb9c19ed
Python
12,069
337
import numpy as np import pytest import pandas as pd import pandas._testing as tm class TestDataFrameNonuniqueIndexes: def test_setattr_columns_vs_construct_with_columns(self): # assignment # GH 3687 arr = np.random.default_rng(2).standard_normal((3, 2)) idx = list(range(2)) ...
97d19c6d122ee6703b5dac0770f7dbbf617b4f76797bc04f7bf6f21232b7622d
Python
12,071
319
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
b8a062e20fa56a19e7b45df17934706732034a89a5c53164ac66cad65ac985fc
Python
12,074
326
# 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...
9bd79b22952de5212ea5e97015773ab48cfe3a185fa114c5ef4b2598f908aa24
Python
12,079
272
# 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...
e31a8b644f76dbd059aa4d1f3c82b0798532978a4c954ffd603a7e5c5590177c
Python
12,081
388
import numpy as np import pytest from pandas.errors import ( DataError, Pandas4Warning, SpecificationError, ) import pandas as pd import pandas._testing as tm def test_getitem(step): frame = pd.DataFrame(np.random.default_rng(2).standard_normal((5, 5))) r = frame.rolling(window=5, step=step) ...
13b4c0ef00ef23a02cfb278d784090e2b5961d2adcda41f8e323d71c01bd265a
Python
12,087
337
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
a598c28b9aa506cd1475f33457fb7756580a3a47b5e11d8debb6cf9cf9e8e6e8
Python
12,088
348
import torch import numpy import matplotlib.pyplot as plt import bionetwork import plotting import pandas from scipy.stats import pearsonr import seaborn as sns from scipy.stats import mannwhitneyu import copy def loadModel(refModel, fileName): #work around to copy weights and bias values #because class struc...
e39da4bcd1f35f382ea0044e2b5f97df234cf42306ae96a9745df406929a774e
Python
12,088
325
import os import urllib.request from collections import Counter, deque from typing import List import numpy as np import onnxruntime as ort import SimpleITK as sitk import torch from .utils import clip_and_rescale_sitk_image, crop_cube, resample_sitk_image model_urls = { "RLLandmarkLocalizer": "https://www.resea...
856f6a893143d6f9c55baf41be47cfcaba0d527e97c582921d37b26784a64cd1
Python
12,092
330
import os import numpy as np import nrrd from torch.utils.data import Dataset from pathlib import Path import torch import torch.nn.functional as F from torchvision import transforms # Images should be stored with the following file structure. This is after # they are processed with functions in preprocessing.py # . ...
1fa0f09cd259b6af14bd07713befa997d289285cbd093e1ef8329a2cf6187ba3
Python
12,098
374
# -*- coding: utf-8 -*- # # project-template documentation build configuration file, created by # sphinx-quickstart on Mon Jan 18 14:44:12 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated fi...
b9947d14cf9e74dc31eb79f8596e19f27a0c793b8818cd1ac2f4a4f0cf078267
Python
12,106
323
import figure_Tbasis as fb import targeted_basis as tb import numpy as np import scipy import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from figure_properties import * import os from sklearn import preprocessing from kcsd import oKCSD1D def calculate_eigensources(obj): try: e...
b494aaace6ff80a72edad9c7aa60e865537ec9de91d31eb69fadc9df8007de2b
Python
12,107
275
"""Bounded subprocess driver for compiled public chromosome scheduling calls.""" from concurrent.futures import Future import faulthandler import json import logging from pathlib import Path import sys import numpy as np import MACS3.Signal.CallPeakUnit as unit import MACS3.Signal.CallerExecution as execution from MA...
eb633f029153e272fad304e80df4d1f058f5062b00a50f9ebfa93c88fc5ca7a1
Python
12,107
363
import re import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.tests.plotting.common import ( _check_axes_shape, _check_plot_works, get_x_axis, get_y_axis, ) pytest.importorskip("matplotlib") @pytest.fixture def hist_df(): df = pd.DataFrame( np.r...
a65b254099e4ee21f3fb0c1cb7e93b3e4acb22f9cdec5695e12544bb6a5cdbbc
Python
12,111
330
''' backcheck_aws.py This program will backcheck AWS S3 contents to neuronbridge.neuronMetadata ''' import argparse from operator import attrgetter import sys from types import SimpleNamespace import boto3 import MySQLdb from tqdm import tqdm import jrc_common.jrc_common as JRC import neuronbridge_lib as NB # pyl...
a8a90bfc42a1e3dc2f1ff1fe48851e29bea711952f0c8c3a65b51d2282edca0a
Python
12,131
313
# 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...
cb5567b3fc22dfb89ada6b38d80fa6178f3add4099c51b79f6ca68ec2d8447c6
Python
12,140
280
# 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...
7ee5bef5be9f99def4e6ecd59e8960e87bf18e75950471609da0df2b2f623a64
Python
12,145
299
# ------------------------------------------------------------------------------------------------------------------------------------- # Following code curated for GCPNet (https://github.com/BioinfoMachineLearning/GCPNet): # ----------------------------------------------------------------------------------------------...
d344a48624336ba8703c90344fc2f63c021ae3edc489a34bf8f44e477154486c
Python
12,152
408
import numpy as np from itertools import combinations from scipy.special import binom from indices.indices_info import Indices def _file_name_gen(key): """Generate the name of the file containing a given index. Arguments --------- key : str Key of the Indices dict that corresponds to a given ...
ba75cbfc439ec6e4f3d3beed8e3b414157bbfad7bbc2bf073b32b58571a961c5
Python
12,162
377
''' Created on Nov 3, 2012 @author: regger ''' import numpy as np from model_data_base.mdbopen import mdbopen def vm_mean(vVec, tVec, tStim, dtStim): ''' computes mean subthreshold voltage from voltage trace during stimulation time window [tStim, tStim+dtStim] ''' t = np.array(tVec) v = n...
0ad19bda4b39f06b869426a70462d438a46fdbffcf91d21a247eb203c049128e
Python
12,165
235
# SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of sourc...
e642833122a4ab494abbcebf4af73caccf9dc5074206b06cdf24f8de43817ef7
Python
12,172
284
import regex import unicodedata import logging import langcodes from .language_info import get_language_info, SPACELESS_SCRIPTS, EXTRA_JAPANESE_CHARACTERS from .preprocess import preprocess_text, smash_numbers # Placeholders for CJK functions that we'll import on demand _mecab_tokenize = None _jieba_tokenize = None _...
401b0e289b7f0f138800b15fd79310a3fe2f6ac4785e44a4cc3fa671887331bc
Python
12,174
327
import numpy as np from math import ceil from scipy.special import binom class BaseComparisons(object): """Base class to compare arbitrary numbers of fingerprints. Attributes ---------- fingerprints : {np.ndrarray, int} Numpy array with the fingerprints that will be compared. ...
5b2d2d2e0ce64d0d563d39ec9989b170fbc3ae2b340f363822b18415f453d4d5
Python
12,174
352
#!/usr/bin/env python """Module Description: Test functions in PileupV2 (weighted p-v pileups). Every pileup is compared with a small numpy reference: the weighted coverage of half-open intervals [start, end) accumulated on the elementary segments between distinct coordinates, written as change points (pos, value), wh...
7abcf61c277e595d7301d3ba28324e26f267aad9472542ef1e7eba295a4461fd
Python
12,182
379
"""Plotly-native exploratory data analysis (EDA) plots. Functions: - ``column_distribution`` — histogram (numeric) / bar (categorical) for a single column. - ``correlation_heatmap`` — Pearson correlation matrix as a heatmap. - ``missingness_map`` — per-column missing-rate bar. - ``target_vs_feature`` — joint distri...
e6e10d95efb62e1b522df376871eaaa371472ee3fdcfdfa6fe05110e8232d1a0
Python
12,182
353
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import random import sys import math from torch.distributions.categorical import Categorical from torch.distributions.beta import Beta from collections import defaultdict """"vanilla_RNN""" class RNNnet(nn.Module): def __init__(...
bedea78e7cc049165532a2953c5028dcb5d0e4868ea48e56fe11048f39b1ff75
Python
12,189
383
# 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...
93e713d6ef66da536abd52f4f0b46783291ff718d1373b566d505aa1817725c4
Python
12,193
351
import numpy as np # Format for parameter specification: # parameter: { # 'gui_name': text displayed next to edit box in GUI # 'type': callable datatype for this parameter, like int or float. # 'min': minimum value allowed (inclusive). # 'max': maximum value allowed (inclusive). # 'exclude': list ...
5ccede2fdf62ec301e636bdee97903646ecf0537ccf944eaa0401a82728bc6e3
Python
12,200
391
# 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...
1a5fed3d9024dcb507e3911c9b0d5c8f7da4a42d0c1a480e30e1567d2b526585
Python
12,201
278
# 3D-HSFormer parameter import os data_name = '150819_0_8X-cfos_16-55-11' name = data_name.split('_') if len(name) == 6: name_seg = name[1] + str('_') + name[2] + str('_') + name[3] + str('_') + name[4] + str('_') + name[5] else: print('Recheck the name of the data') Raw_data_root = r'G:\cyx/' + data_name + '/...
9a1c40f6a3a253d9a1c1e191edd380d46a0272b6456eae2887d596a408a5e120
Python
12,206
358
import io import numpy as np import pytest import pandas as pd pytest.importorskip("jinja2") def bar_grad(a=None, b=None, c=None, d=None): """Used in multiple tests to simplify formatting of expected result""" ret = [("width", "10em")] if all(x is None for x in [a, b, c, d]): return ret ret...
9061c9841f3c940a23bbcdcc8e782352378f92cefd130cac8fd6fcf0c316dd0e
Python
12,210
341
# 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...
dface194df2221da8eb007175bee95a562122ade8392288fa35f1ecb93ff7d89
Python
12,210
324
""" Tests for offsets.CustomBusinessHour """ from __future__ import annotations from datetime import ( datetime, time as dt_time, ) import numpy as np import pytest from pandas._libs.tslibs import Timestamp from pandas._libs.tslibs.offsets import ( BusinessHour, CustomBusinessHour, Nano, ) from...
3caebaec2d3a4cf468c732e861521d22e9fb7da2a6da4ab7aa2794b841fddf03
Python
12,211
363
import torch import numpy import matplotlib.pyplot as plt import bionetwork import plotting import pandas from scipy.stats import pearsonr import seaborn as sns import copy from matplotlib import cm from matplotlib.colors import ListedColormap def loadModel(refModel, fileName): #work around to copy weights and bia...
d2879dedfae04e014268a06d298efea94bcbfc9bb5438f4355bb885b501322d7
Python
12,214
297
# Copyright 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 agre...
9942c2bc00b783108c2b38c70c6a4e52224ba871cd4ce8a1ab0fd8b14ba98187
Python
12,228
251
"""Convert the public MIT PAOPAC Conventional release into portable Torch trees. Build-only dependency: cryptography. The original Windows loader's public string table supplies its packaging key. No Windows code or arbitrary pickle globals are executed; a restricted reader retains inert records and NumPy arrays only. ...
25f43b2daabe539330b6ae36c81d3c45e95e1e8e9cbfeb0efbaf98fada4f06cf
Python
12,231
298
import numpy as np, matplotlib.pyplot as plt, sys import pumpprobe as pp, wormdatamodel as wormdm from scipy.optimize import curve_fit from multipy import fdr #this script is to print all the relevant numbers for the paper and save them as latex macros ds_list = "/projects/LEIFER/francesco/funatlas_list.txt" ds_tags ...
aa619db0e19f36fb9c05f16a55223d2fe1ce64d8eb6b26f172a6b994314a6d9b
Python
12,239
343
import os import sys import subprocess import numpy as np import tensorflow as tf from keras.utils import np_utils from util.pretreatment import max_minNorm from util.DANN_ import feature_extracter, classifier, Discriminator, DANN from util.loss import gradient_reversal, loss_domain, early_stop import matplo...
ab2ef8c3bae1a9e198eea3cf787f19c5bf61a136a25f9294c16928f34b71541c
Python
12,240
316
"""Heads that produce heatmap predictions for heatmap regression.""" from typing import Literal import torch from jaxtyping import Float from kornia.geometry.subpix import spatial_softmax2d from torch import nn from lightning_pose.models.heads import HeatmapHead from lightning_pose.models.heads.heatmap import run_s...
2932582dd0501c044ba363e9fdf956f82c1aeb3ee05331d18cc16c610c078dd7
Python
12,248
301
""" Script to produce the plots in Figure 5 in the paper. """ from pathlib import Path import matplotlib.pyplot as plt from matplotlib.pyplot import * from src.np_implementation.data import generate_random_nonlinear_data from src.np_implementation.model import TPC plt.style.use('ggplot') results_path = Path('./res...
5f76f964ba3859ce8a292ecaed620fbcdd84340714dbaac7c393204fd51f7029
Python
12,248
226
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf from tensorflow.keras import backend as K from sklearn.model_selection import StratifiedKFold, StratifiedShuffleSplit from tensorflow.keras.callbacks import EarlyStopping, LearningRateScheduler from functions.OneDCNN_models import OneDCNN fro...
314539168c265e9c4f4a49faee3a986a6bf03efe03696b4eba0bba4c99ef2aa5
Python
12,249
306
import os import sys import numpy as np import pandas as pd import tensorflow as tf from dissect.utils.network_fn import network1 as network from dissect.utils.network_fn import loss from tqdm import tqdm import random from dissect.utils.utils_fn import normalize_per_batch, reproducibility, ccc_fn from sklearn.metrics ...
f3703e0406d7f7649254b6b4c66208c2e118c94177912074eea2fcced1acd5b0
Python
12,249
227
import argparse import textwrap from pgen.esm_msa_sampler import ESM_MSA_sampler from pgen.pgen_msa_revised import delete_msa_cols from pgen import models from pgen.utils import parse_fasta, RawAndDefaultsFormatter, SequenceSubsetter, add_to_msa, write_sequential_fasta, generate_alignment, run_phmmer import sys import ...
dcb196dab1266c434a48121582a4724a16ac7ab244f7b33b81eb592ae66d19e0
Python
12,256
258
# 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...
72cf56dab78a682548011eee43facbef2d2b037219737725f452625566783ad7
Python
12,259
345
"""Figures for manuscript """ #%% #Imports import os from pathlib import Path import matplotlib import matplotlib.backends.backend_pdf import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np from matplotlib.gridspec import GridSpec # style specs matplotlib.rcParams['lines.linewi...
f829420d19d2365b71a1404d234771713a2394109f6aa9d9744c63c4827dbf18
Python
12,260
327
"""Evaluation metrics for assessing pose estimation model quality. CSV format conventions ---------------------- Labels CSV (DLC format, 3-row MultiIndex header: scorer / bodyparts / coords): - coord values are ``x``, ``y``, and optionally ``visible``. - ``visible`` encodes per-keypoint visibility: 2 = labeled, 1 ...
90641d1fc098781dc5a0a803da063a54259457955d60c49d9c6086e7334854ba
Python
12,264
329
#! /usr/bin/env python ############################################################################## ## DendroPy Phylogenetic Computing Library. ## ## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder. ## All rights reserved. ## ## See "LICENSE.rst" for terms and conditions of usage. ## ## If you use this wo...
75288202cfe4b1d54709f1f587e746a32e6b353baebca93099c5112619c29ef7
Python
12,274
334
import pickle import re import numpy as np import pytest from pandas.compat import HAS_PYARROW import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm from pandas.core.arrays.string_ import ( StringArray, StringDtype, ) from pandas.core.arrays.string_arrow import ( Arro...
afccae446c54f35dea6b7978f50fbb4b7c624a4f0d8675e3313c7115ad5df473
Python
12,275
371
"""Clustering utility functions.""" # ------------------------------------------------------------------------------ # Imports # ------------------------------------------------------------------------------ import logging from copy import deepcopy import numpy as np from phylib.utils import Bunch, _as_list, _is_lis...
2471a80cfc0db94cde0e19f30b938ec2c768ce38d4f3241c4547a2bad80fb8f8
Python
12,276
343
# 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...
f205a834211d58f57628b4b316a7cf0f107d208b08201f280d59ba131da556fa
Python
12,279
312
# Ported from the Isaac Lab rl_games integration (isaaclab_rl); original DexPBT # implementation from NVIDIA-Omniverse/IsaacGymEnvs (https://arxiv.org/abs/2305.12127). # Copyright (c) 2022-2026, The Isaac Lab Project Developers. # SPDX-License-Identifier: BSD-3-Clause import datetime import os import random import soc...
e9951530bcaa232da6ad1b2948d68bed5d2d9914242344a644ded66108c988aa
Python
12,282
364
import ast import os from itertools import groupby import numpy as np import pandas as pd import torch from pymatgen.core.structure import Structure from torch.utils.data import Dataset from roost.core import Featurizer class CrystalGraphData(Dataset): def __init__( self, data_path, fea_...
02edbefd1f25113cae66abdce203d61cceda25c9c32c6e91213c8b983f7c733b
Python
12,290
331
# 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...
5de505ee24eeb47d9e1d8b4aae4ef68869a8d7bc0cebea16953ae058433515c9
Python
12,294
388
from __future__ import annotations from typing import ( TYPE_CHECKING, Literal, cast, ) import warnings import numpy as np from pandas.errors import Pandas4Warning from pandas.util._decorators import cache_readonly from pandas.util._exceptions import find_stack_level from pandas.core.dtypes.common impor...
1e7e223ac139888c326559043c6351652920c71d918243f2cabd1b027f948ede
Python
12,306
323
# cython: language_level=3 # Time-stamp: <2024-10-22 17:14:11 Tao Liu> """Module This code is free software; you can redistribute it and/or modify it under the terms of the BSD License (see the file COPYING included with the distribution). """ # ------------------------------------ # python modules # ----------------...