sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6b6eb6192b4e8a441f1f29939a6eb3a965c13f90be7ce1cc5b51bc38ac4ff0f8
Python
4,821
146
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.op_run import OpRun def _fft(x: np.ndarray, fft_length: int, axis: int) -> np.ndarray: """Compute the FFT return the real representation of the complex resul...
d37b5b92a35567460575a62fbfb02f95c35a50cfb144875d0876307dd0d28ca4
Python
4,821
164
#!/usr/bin/env python3 import inspect from pathlib import Path from collections import MutableMapping def stack_magic(stack): if len(stack) > 2 and 'exec_module' in [f.function for f in stack]: if '__builtins__' not in stack[1][0].f_locals: index = 2 # we are in function scope in module cont...
294fb0f5c2c1e1c9ab75312cd907c4b78a4acd3a01462f94e6cdaa7a2d9c4656
Python
4,822
125
"""Canonical time warping distance, from tslearn.""" __author__ = ["fkiraly"] from sktime.dists_kernels.base import BasePairwiseTransformerPanel from sktime.dists_kernels.base.adapters import _TslearnPwTrafoAdapter class CtwDistTslearn(_TslearnPwTrafoAdapter, BasePairwiseTransformerPanel): """Canonical time war...
63e7a5749aef875aa6c1d413feaa2456cea6a5dab54b833d6140a522ef766d19
Python
4,825
164
# SPDX-License-Identifier: LGPL-3.0-or-later from abc import ( ABC, abstractmethod, ) import array_api_compat from deepmd.dpmodel.array_api import ( Array, ) from deepmd.dpmodel.common import ( NativeOP, ) from deepmd.utils.data import ( DataRequirementItem, ) from deepmd.utils.plugin import ( ...
7ce1d50513cde516c772b5efdfdc8a228b6291bf1c334ff4e9dbe720ea95f47c
Python
4,827
127
from utils import AverageMeter, str2bool from tqdm import tqdm import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.optim as optim import archs from collections import OrderedDict import pandas as pd import numpy as np def train(train_loader, model, criterion, optimizer): avg_meter...
1a10b830a4580351ef40f93e5936674ee43c0179103f39cd7b21a9cd186da521
Python
4,828
150
#!/usr/bin/env python import click import copy import json import numpy as np import os import pandas as pd import re from sklearn.preprocessing import OneHotEncoder import sys sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), os.pardir)) from utils import ...
feea15c3c41ee278193c6e9886674c89c5b80cad47071dc4eca405cec22a1534
Python
4,832
130
""" @file: quantize_model.py Created on 02.01.2021 @project: CrazyAra @author: queensgambit Script for creating INT8 quanitzation weights for the MXNet-CPU backend. References: https://cwiki.apache.org/confluence/display/MXNET/MXNet+Graph+Optimization+and+Quantization+based+on+subgraph+and+MKL-DNN https://medium.com/...
c3e9e8a87a4c329a90672c2453fb275e8ad252b53e63452eba879fe5153267dc
Python
4,838
148
import numpy as np from scipy.signal import find_peaks def set_rates_na8st(seg, rates, vshift_inact=0): """ Sets the rates for the 8-state model in segment seg. vshift_inact can be used to locally change the voltage dependence of inactivation rates. :param seg: the segment to set rates for :p...
3e6809c3e57fa215e8202fc871b3e95a98cd53279c9301e1315a8e7613635cfe
Python
4,839
131
"""Image Encoder.""" import torch.nn as nn import torch.nn.functional as F import torch from onmt.encoders.encoder import EncoderBase class ImageEncoder(EncoderBase): """A simple encoder CNN -> RNN for image src. Args: num_layers (int): number of encoder layers. bidirectional (bool): bidirec...
3f27b749052352e9fa36aa8bf5757075fd5881f98fa7b77cc4cc7539936ecdea
Python
4,840
158
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Creates Figure 2 from Wang et al. (2023) Temporal stability of intracranial EEG abnormality maps for localizing epileptogenic tissue. Change the variable "pnt" at the beginning of the script to plot a different example patient. Calculates time-varying D_RS from abno...
65fdcc6dd8c71d87efd1927f13211e494a5bc94597f2d519246bc5b7b17fff0d
Python
4,842
128
# Copyright 2026 DeepMind Technologies Limited # # 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 agr...
3e847ea19992b92d1b3b40b5cad87f39ddd1937351e0dfa87f82ed7f52c7d373
Python
4,844
149
import json import numpy as np import pandas as pd from time import time import seaborn as sns import matplotlib.pyplot as plt from genetic_selection import GeneticSelectionCV from sklearn.feature_selection import SelectFromModel, RFECV sns.set() def feature_importance(model, X, Y, threshold=None, save=False): '...
987217215e7ef6db4855e1d8bdbf15e81fff86aa4de5d99d4aee64398cfa2294
Python
4,844
132
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops.aionnxml._common_classifier import ( logistic, probit, softmax, softmax_zero, ) from onnx.reference.ops.aionnxml._op_run_aionnxml import OpRunA...
abd0a20771eb56a0a9e13f32008146c59b6b29510ca38d82f34feb434e7c1f2e
Python
4,846
151
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Implements adapter for tslearn distances and kernels.""" import numpy as np __all__ = ["_TslearnPwTrafoAdapter"] __author__ = ["fkiraly"] def _subset_dict(d, keys): """Subsets dictionary to keys in iterable keys. Parameters ----...
d285fabe034b88a91b2a8d8984e4b5b1d986d0ba65ef804a9022d9b519e8fd90
Python
4,847
149
import multiprocessing import os from dataclasses import dataclass, field from .helper import run_shell_command @dataclass class ANTSTransformationStages: transformation: str inverse: bool @dataclass class ANTSTransformationParams: interpolation: str = "Linear" class ANTSImageTransformation: def __i...
2aa8c70ee2e4c19e008e4275792b82f10434095b0b8002553f07661ab3971bb4
Python
4,848
178
""" This code is for "breaking the dendrites" from cells. Mostly it just allows us to remove the dendrites from a hoc file. This is run as a script from the command line. Run with python break_dendrites.py --help to see the command arguments. Note: *** DEPRECATED ***: replaced by compare_hoc.py (use that instead!) Th...
0aaf2358314d1bd4af3e99ad8bca320528745616ecebd1bfe6fd8d8e1c83b435
Python
4,849
158
# Copyright 2026 DeepMind Technologies Limited # # 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 agr...
a91b7b4eecde5aa9ea90ca06c2e6b50ed93045e33d51acbdf769d7572d3ce21e
Python
4,852
151
import torch import math import logging from typing import List, Union, Tuple def rot( theta: float, dir: Union[str, torch.Tensor, Tuple[float, float, float], List[float]] = "z", ) -> torch.Tensor: """ Get the rotation matrix for a given angle and axis of spatial rotation. :param theta: angle of ...
f4782fce70005925bb8b2b3447840b4f898796c38bca71e7226f87ddd3a711a0
Python
4,852
134
from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from pathlib import Path import pandas as pd import numpy as np import os import argparse import subprocess import re #Get file name and directory parser = argparse.ArgumentParser() parser.add_argument('-f', '--file', help='path to csv f...
5917c3216cafd26790b24aa8177f389c4f4055be94917206f57dd153d34d7de3
Python
4,853
128
import numpy as np import pandas as pd def _npedges2dfedges(edges, edge_threshold=0, edge_thresholddirection='absabove'): """ A function which transforms numpy array edges into dataframe. This function is required for compatiblity with other functions. Parameters --------------------- edges ...
f38d645325efd41f81f1364050230490a702ba7fed7cf43ae76b9a3a0ea7e8bb
Python
4,854
94
import plotly.express as px import pandas as pd import numpy as np ########## donor ############# df = pd.read_csv('./umap_3d_metadata_donor.txt', sep = '\t', header = 0, index_col = 0) df.loc[df['cellclass_draft_v2'] == 'OPC', 'cellclass_draft_v2'] = 'IPC4' # order cell type and extract important cells cellclass_ord...
b93866873d392e517201b97e69f49628bb978af049eff17956e3d7330f0626c3
Python
4,859
141
r""" This module contains encoder/decoder/autoencoder model blocks. """ import torch from torch import nn as nn from torch.nn import functional as F from torchvision import transforms as TF from torchvision.transforms import Resize from vp_suite.model_blocks.conv import DCGANConv, DCGANConvTranspose from vp_suite.base...
9b807a74f75abb70533ceb59c3e01288636f9f44b8638af1a5ac9c3063cf6239
Python
4,861
124
#------------------------------------------------------------------------------- # elftools tests # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- import unittest from io import BytesIO from elftools.dwarf.constant...
db72052b9ba4e369970ee04abcf34fa563b19d03a6a46d40c405b71e6f7d4248
Python
4,862
148
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from collections import namedtuple from typing import TYPE_CHECKING, Any, NewType import onnx.checker import onnx.onnx_cpp2py_export.checker as c_checker from onnx import IR_VERSION, ModelProto, NodePr...
d568419429552b9e5752eb5e0177afa441aa47133c4d9a12c777c7a3108dfec9
Python
4,865
161
import click import gzip from functools import partial import numpy as np import pandas as pd import random from sklearn.model_selection import train_test_split from torch import cuda, Tensor from torch.utils.data import DataLoader, TensorDataset from explainn.utils.tools import dna_one_hot ##########################...
069c3c545dd40aafc4e80a5b9deeffafe69e3d7345cf158d7e3676ec5a4129db
Python
4,867
149
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu May 12 17:13:23 2022 Big simulation: short version of shj-multiunitnbank.py - to run SHJ with many units (hippocampus scale) and save results @author: robert.mok """ import os import sys import torch import pickle location = 'cluster' # 'mbp' or 'cl...
b44c89dac89bed99e476fdf85cd4727b90372ec5df04d49fbf17661a6955d883
Python
4,868
173
"""NIfTI structural manipulation: ROI extraction, merging, splitting, geometry copying.""" import os from pathlib import Path from typing import List, Optional, Tuple, Union import numpy as np import nibabel as nib from bcblib.imaging._types import NiftiLike from bcblib.imaging.io import load_nifti # -------------...
1166e76e785f9c09d4554e0980fb2ded03a1348be1124658abb11222820d15f5
Python
4,874
157
"""Low-level NIfTI I/O helpers: loading, saving, format detection.""" import os from pathlib import Path from typing import List, Optional, Tuple, Union import nibabel as nib from bcblib.imaging._types import NiftiLike # --------------------------------------------------------------------------- # Format detection...
d8cd2c85248180e87da2ed369f52dfc883ce7ce8c8864f13008fb5d169439259
Python
4,875
153
import pandas as pd import seaborn as sns from matplotlib import pyplot as plt, patches as patches from sklearn.metrics import classification_report, roc_curve, roc_auc_score # Coordinates are best display for the label (not the exact values) FP_orig = {'Bt133': (61.5, 0.78), 'LYRa3': (84, 0.82)} FP_mers_...
c81b5a89aa1b05019443b26bf28a883897ee204601d22700962eecf02b0b67dc
Python
4,880
127
import cv2 as cv import numpy as np from math import sqrt from multiprocessing import Pool from skimage.feature import blob_log import Switches_Static as st_switches from Switches_Static import rx,cx import time # Class to hold outputs; now using list as a class attribute rather than an instance attribute class OUTPU...
683d62cb3e3b76f16171a17650626c032cca6f69283bc8f809bbffd0814f435d
Python
4,881
143
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Sequential, Linear, ReLU from torch_geometric.nn import GATConv from torch_geometric.nn import global_max_pool as gmp from torch_geometric.nn import GINConv, global_add_pool from torch_geometric.nn import global_mean_pool...
aefafb418e6e004b46b6c4630e16f36cd4c0fb30c6fcea1d2d4a98ab07f7e1be
Python
4,882
131
import collections as col import logging import os import re import sys import click import numpy as np import scipy as sp import scipy.spatial import pandas as pd import atom3d.datasets.datasets as da import atom3d.splits.splits as spl import atom3d.util.file as fi import atom3d.util.formats as fo logger = loggin...
cd13b8a7002649abe078feba3ac6ffd0b070cce9c06cad535734f1dae04e408e
Python
4,883
124
""" Take in a network, and render its structure using the package 'graphviz'. """ from sns_toolbox.networks import Network from sns_toolbox.color_utilities import set_text_color import warnings graphviz_available = True try: # see if graphviz is available from graphviz import Digraph except ImportError: wa...
ead27519fe12f58562e16aff071d354602bcfc1b3b60a3156adbf2cc67a5c617
Python
4,883
159
import logging import os import os.path as osp from pathlib import Path import torch import glob import matplotlib.pyplot as plt import numpy as np def get_model_folder(args): make_dir(args.save_dir) path = Path(args.save_dir) / get_model_fname(args) path.mkdir(parents=True, exist_ok=True) return path...
cf337abedf02d88f75e1bc7bbf6f471530caf283d1083cfa3e2dbd0ee166247b
Python
4,885
120
import os import pandas as pd from rdflib import Graph BDSO_ONT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../bdso-full.owl") PCL_ONT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../resources/pCL_4.1.0.owl") PCL_MAPPING_OUTPUT = os.path.join(os.path.dirname(os.path.realpath(__file_...
24c297aa32e57d7a1b6e21d9bca3a6c9933905f762625b0a78b8346dd1e8cfb9
Python
4,888
185
import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pickle import os import sys import pandas as pd import Levenshtein as lev MAX_DISTANCE = 4 TL_BASE_PATH = '../data/tl_train/U6T7/' def get_folders(path): folders = [] names = [] for folder in os.listdir(p...
3a4a262a24a9ed7f796f80b6ddb54c31eba93e78293cb490b577dc8dcbca86b8
Python
4,888
176
#------------------------------------------------------------------------------- # elftools: elf/constants.py # # Constants and flags, placed into classes for namespacing # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #---------------------------------------------------------------------------...
730332c03eb21b27e4151f1746da0895116c73a84c2cc89dbdf9293043b88002
Python
4,888
137
import numpy as np from scipy.stats import entropy import matplotlib.pyplot as plt import seaborn as sns import sciunit class kl_divergence(sciunit.Score): r""" Kullback-Leibner Divergence :math:`D_{KL}(P||Q)` Calculates the difference of two sampled distributions P and Q in form of an entropy measur...
902457db73fdb5b8fba52e56dc554bef74c140a3f2bdf3cfa6d566f3beba3b49
Python
4,888
120
""" @file: train_cli.py Created on 10.11.23 @project: CrazyAra @author: queensgambit Provides a command-line interface to run training experiments. For the main configuration files please modify * CrazyAra/DeepCrazyhouse/configs/main_config.py * CrazyAra/DeepCrazyhouse/configs/train_config.py A decision was made to o...
6173886b1b6e12c62133d046f761d068ac32669e0f22db21723b878f05aeab3d
Python
4,889
113
import sys import os import pickle import numpy as np import rdkit import random import torch import torch.nn as nn import pandas as pd from rdchiral.main import rdchiralReaction, rdchiralReactants, rdchiralRun from datetime import datetime from pathlib import Path from typing import Dict, List, Optional, Tuple, Union...
c87b5ec39f8c5a8bca1599d816768a98e1978e60aef932bf8aa700582b100f25
Python
4,889
159
"""BCBToolKit run_disco.sh wrapper.""" import os import re import subprocess import sys import warnings from pathlib import Path from typing import Dict, Optional from bcblib.tools.lesion_features._constants import DEFAULT_BCBTOOLKIT def find_bcbtoolkit(path_hint: Optional[str] = None) -> Path: """Locate the BC...
3021f41cf07bb193210ef3b5f2298ab80f7d39b7d313b62d4fd4703962f8b306
Python
4,892
128
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Oct 9 10:42:51 2018 @author: tpisano """ import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.mlab import bivariate_normal from matplotlib.colors import ListedColormap from matplotlib.colors import Norm...
9305baf1e05a7f8c91cdd302ffa5dca494d23248e37c8f66bc0849c32df39001
Python
4,892
158
# Copyright 2026 DeepMind Technologies Limited # # 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 agr...
00a5f635ac00982ab8aa150ee8c2f6b249e50d5fca8696c66267250a8c9a0963
Python
4,893
136
# Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import os import tempfile import numpy as np import numpy.testing as npt import pytest import onnx import onnx.helper import onnx.model_container import onnx.numpy_helper import onnx.reference def _...
977ce42e5136f040049a0ef9b6ff72a7561889a1d591fe198bcaca9fd4d4595b
Python
4,893
113
# Copyright 2018-2025 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # 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/LICE...
85d8ba35a4ad2e1eb76a888f42d92c1fbb385751e6f16add4a7ac0494850fac0
Python
4,894
154
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jan 17 12:20:45 2018 @author: tpisano """ import cv2 import skvideo.io from skimage.external import tifffile import skimage import numpy as np from matplotlib import pyplot as plt from matplotlib import animation from mpl_toolkits.mplot3...
fe7dd1b610636b0ad63766c9c49d7ce655fd6dcedf6e156a03040a187a581081
Python
4,898
155
import torch from torch import nn, rand from collections import OrderedDict def save_model(path, epoch_id, model, optimizer=None): if isinstance(model, torch.nn.DataParallel): state_dict = model.module.state_dict() else: state_dict = model.state_dict() data = {'epoch': epoch_id, ...
bd579e4b727cb9b711802544840e876eccc3a775a05647ecb5a02f4dcf87d006
Python
4,899
139
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
f8fb8e81dde67b2a79fc2e0f1be93d75ca70b758e9d75b8d1a7b369a1f603391
Python
4,901
156
from __future__ import division import re import sys import numpy as np import pandas as pd from SPHARM.lib import spharm import SPHARM.lib.parallel as prl from helper_lib import filelib def extract_metadata_Tcells(inputfile, spectrum_file): stat = pd.read_csv(inputfile, sep='\t') # extract group info ...
a4e06dadbaf1eb9caa786518fc46aab85f0f7a944e8b8949594e3ddb1d5b5178
Python
4,902
138
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
628d979c5500903fe6a966e2d5186df16d4c13d4a0e8583d2533cadaae91e1ec
Python
4,903
115
import os, sys import numpy as np import torch import pytorch_lightning as pl from six.moves import cPickle from evoaug import evoaug, augment sys.path.append('../../evoaug_analysis') import utils from model_zoo import CNN device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') output_dir = '../resul...
8aeed364b2f5091dc54e4f048a10508885cd9f843c375ad7325c7c2aa8791659
Python
4,903
148
from __future__ import division import numpy as np from SPHARM.classes.surface import Surface from SPHARM.classes.profile import Profile import SPHARM.lib.transformation as tr class Ellipsoid(Surface): """ Class for a surface of a ellipsoidal object. """ def __init__(self, grid_shape, size, rotation...
011b601ca3c2c04c14578975d1074d1457c1894c4ef537cc7349c9ebe6558cd7
Python
4,904
125
""" Evaluate models on synthetic data: classification and interpretability performance. """ import os import numpy as np from six.moves import cPickle from tensorflow import keras from gradient_correction import helper, explain, model_zoo, geomath import tfomics #------------------------------------------------------...
aff482b3480d4b8c2642cd1cd978d74e0989cb766b429376fe723ed3c0be37d2
Python
4,904
169
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
54092ee1b74fd021ee858f8151417d2fa8bcf7e4f7dc7cce127fa9ee8c0b7746
Python
4,910
128
""" Find the neighbors of each vertex of the surface mesh and outputs to a text file. Parameters: --------- a,b,c,x,y,z: Outputs from the coord_nodes.py file subjects_dir, subject, hemi: These are defined in the curveball.py file Returns: ------- ndl: vertex neighbor information stored in a circul...
3b3cb10a98880730ec0d9ad251d7d8498f60eff41bc0d914607e5ec21e160eb3
Python
4,915
147
# SPDX-License-Identifier: LGPL-3.0-or-later """The readout gate of a bridging window on the pt fitting networks. A bridged descriptor hands the fitting a per-atom source gate. The gate fades the learned part of the output, the deviation of the output from the per-type bias the fitting stores, so an atom whose gate is...
045f5ca9a7c85027c066c4746c276be599c95215cce47099ce6cf6f64431c14c
Python
4,919
122
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Tests for BaseAligner API points.""" __author__ = ["fkiraly"] import numpy as np import pandas as pd from sktime.datatypes._check import check_raise from sktime.tests.test_all_estimators import BaseFixtureGenerator, QuickTester from sktime.ut...
0b6a87a63222ce7a392aebcb4ec75358da07264b698d5fbe6c82b095115af7ae
Python
4,919
156
from collections import OrderedDict import copy import numpy as np from .geometry import Box, Vec3d from .tensor import TensorData from . import utils class Dataset(object): """Dataset for volumetric data. Attributes: spec (dict): mapping key to tensor's shape. data (dict): mapping key to Te...
94ef4d1b60614225ee81c52b122fc1bd9afc7a01aab5454fb179e2e91fd8c951
Python
4,920
146
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
b36b8a747840abe19c8d7cc3271ea6441f9313363bf49e600913ebabd249d73d
Python
4,923
102
# The test_gnudebugaltlink* and test_debugsup* files have been generated as # follows: # $ cat test_sup.c # int main(int argc, char** argv) # { # return argc; # } # # $ gcc test_sup.c -o test_debugsup1 # $ gcc test_sup.c -o test_debugsup2 # $ dwz test_debugsup1 test_debugsup2 -m test_debugsup.common --dwarf-5 # ...
cc9518244a42a2111d0c420e4efd75901796e8ceb078c881c4c681035cc74438
Python
4,923
147
#!/usr/bin/env python import sys, os import string from ftplib import FTP use_message = ''' ''' ftp_address = 'ftp.illumina.com' user_id = 'igenome' password = 'G3nom3s4u' visible_organisms = \ ['Homo_sapiens', 'Mus_musculus', 'Rattus_norvegicus', 'Bos_taurus', 'Canis_familiaris', 'Gall...
f2866171a84171e85a614062e9da3f5d36c8b14727d4c951ac4f7fdb264041e2
Python
4,925
163
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
eae31a6ddf5c689cca4e13196102a8dec6e2f46989442f86939dac17e5c185cb
Python
4,926
110
#------------------------------------------------------------------------------- # elftools example: dwarf_range_lists.py # # Decode DW_AT_ranges from .debug_ranges (DWARF <= 4) or .debug_rnglists # (DWARF 5), showing the resulting code address intervals [begin, end). # The beginning address is included; the ending add...
36d6ed2c6c13f7342931093435aeb1eeb5e84b23550c758f650370d8c9ee413d
Python
4,928
162
# SPDX-License-Identifier: LGPL-3.0-or-later import copy import unittest import numpy as np import paddle from deepmd.pd.model.model import ( get_model, ) from deepmd.pd.utils import ( decomp, env, ) from deepmd.pd.utils.nlist import ( extend_input_and_build_neighbor_list, ) from ...seed import ( ...
94365682c4dcef38b980e625919d13082d10e830208ed815fecbd9d7160630de
Python
4,932
99
# load the annotations from Brat # brat files were generated using generate_brat_annotations.py # then domain experts annotate the brat files by ticking or unticking the true_phenotype/false_phenotype, and may add notes if necessary # this program then post-process the brat annotations and fill the results to the ...
a111c59fa35bc4ebc6555b648275ae34a2b886bfc374f9ce3d9db0a37e078b04
Python
4,935
185
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Dec 28 17:05:56 2016 @author: tpisano NOTE WITH CROPPING THIS DOES NOT YET HAVE AN EFFECT ON THE ANNOTATION FILE....THIS NEEDS TO BE INCOROPORATED """ import os, numpy as np from tools.utils.io import listdirfull, makedir, removedir, chunkit, writer, ...
e9daf7fb9867240fa742c6b4027e92cd7629d1cd7c5b447959deda1d7d12cecb
Python
4,937
130
""" @file: input_representation.py Created on 17.08.23 @project: CrazyAra @author: queensgambit Input representation v3 which is compatible to all available lichess variants and passed to the neural network. """ import numpy as np import chess from DeepCrazyhouse.src.domain.variants.default_input_representation import...
c432d1b4945b8162aa93031195d4815e4e8ece76cf4ca2554b666a8b41f532df
Python
4,938
144
""" Data Summary Module for pciSeq This module provides functionality to summarize and format the results of the pciSeq analysis for visualization and reporting. It processes both cell and spot data into structured DataFrames. Key Functions: ------------ cells_summary: Summarizes cell-level information including:...
f9e2da8c66e3073854f6a73af8118855fb1610e1e941ad1df21510b6dc743671
Python
4,941
149
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import locale as pylocale import unicodedata import warnings import numpy as np from onnx.reference.op_run import OpRun, RuntimeTypeError class StringNormalizer(OpRun): """The operator is not rea...
b40a0de84cd75c594598ffb8f8af8b34f6b9e46272cbbbaea496a09819b8c049
Python
4,942
133
import logging import os from typing import Any from flair.trainers.plugins.base import TrainerPlugin, TrainingInterrupt from flair.trainers.plugins.metric_records import MetricRecord from flair.training_utils import AnnealOnPlateau log = logging.getLogger("flair") class AnnealingPlugin(TrainerPlugin): """Plugi...
b41af7d068521c53a61106a0a8d7ab60a61e0e5fda27c7bc3108335db2ca2026
Python
4,942
148
"""Hampel filter for univariate anomaly detection.""" import numpy as np import pandas as pd from sktime.detection.base import BaseDetector __author__ = ["SpitFire19"] class HampelDetector(BaseDetector): """ Anomaly detector based on Hampel filter described in [1]. Parameters ---------- window...
49650e15264136789369a98371656c80b9cc57a554c037cdb4f2bd92f66a39cc
Python
4,943
131
# Copyright 2022 DeepMind Technologies Limited # # 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 agr...
91d8dcab5d721d1fe79a753eaa2f28a24e39b5fd473e559d65eeebce56735eb3
Python
4,945
145
from typing import List import pandas as pd from sklearn.utils import check_random_state class ValidationClassifierChain: """Classifier chain that takes training and validation set. Code modeled after sklearn.multioutput.ClassifierChain Args: model (DepthwiseXGBPipeline or LogisticRegressionMode...
f3e3c0e9709e3eacc946d3bc8701b371687cb875759f5fa2df4c09b8fdef8099
Python
4,945
140
import pytest # Assuming these tokenizers are in flair.tokenization from flair.tokenization import ( SegtokTokenizer, SpaceTokenizer, SpacyTokenizer, JapaneseTokenizer, SciSpacyTokenizer, StaccatoTokenizer, TokenizerWrapper, ) # Helper function for basic serialization/deserialization test...
50177ac54e1e9942b7161e404eacfee8f9e25f78a426b34e80056dcc085ba179
Python
4,947
126
#!/usr/bin/env python3 #This tool was developed for the purposes of the Vertebrate #Genomes Project. 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 #not...
dff8b5bdc5589f6e28dac5ac046072482350f612fa48e71c3e04b6a37a487396
Python
4,947
158
# Copyright 2026 DeepMind Technologies Limited # # 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 agr...
d9e7dd435a38f4b6a51fad9df686230ab4933918a7a9b70821913de5233a3bd1
Python
4,948
127
# SPDX-License-Identifier: LGPL-3.0-or-later """forbidden_dims_from_model accessor handling (CodeRabbit #5779).""" import pytest import torch from deepmd.pt.utils import ( compile_compat, ) from deepmd.pt.utils.compile_compat import ( build_inductor_compile_options, forbidden_dims_from_model, ) class _W...
0b3cf2c7d111176fa5e0cad6ab7026a2a35a926e3a0fa9e62204eee886db9317
Python
4,949
174
"""This module implements a Mel Filter Bank. In other words it is a filter bank with triangular shaped bands arnged on the mel frequency scale. An example ist shown in the following figure: .. plot:: from pylab import plt import melbank f1, f2 = 1000, 8000 melmat, (melfreq, fftfreq) = melbank.comput...
b86344ed98ef67deaa9c2cc8bc76a6df6f3bb3d178f0c07ce977d836f8aa0cab
Python
4,950
163
import pytest import torch import torchvision # type: ignore[import-untyped] from packaging import version from tests.fixtures.genotype import GenotypeNetwork # type: ignore[attr-defined] from tests.fixtures.tmva_net import TMVANet # type: ignore[attr-defined] from torchinfo import summary from torchinfo.enums impo...
17a000712b388f0e09c4b7679b76574e07229edeeed7ba7995b691d3f6aeb2ee
Python
4,952
140
"""CLI: bcb-lesion-features — extract lesion and disconnectome features.""" import argparse import sys from pathlib import Path def _build_parser(): p = argparse.ArgumentParser( prog="bcb-lesion-features", description=( "Stage 2 of the lesion-features pipeline: compute atlas overlap "...
b3ef9dce9428d1b8753c711e3f9c89a7d12e8e05e3f28875d9a4de311349a893
Python
4,953
174
#!/usr/bin/env python from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqUtils import gc_fraction import click import copy import importlib import json import random import re import sys lib = importlib.import_module("subsample-seqs-by-gc") CONTEXT_SETTINGS = { "help_option_names": ["-h", "--help"], } @c...
07f393b51b2256f19f615a954223632d6c7432b26d5ae44d2c0e0b226fffa1ba
Python
4,955
173
# Copyright 2019-2020 The ASReview 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 appl...
2efc2c9413ce723dc68b86bd4f6c0b86c38b7b168131f4af727dfbee2f5423b9
Python
4,955
122
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
3ba5334210bc49143d84b6b3276077745f33d9a9b7e1d766f010be4ccdbe682a
Python
4,956
139
# BASILISK: A generative, probabilistic model of side chains in proteins # # Copyright (C) 2010 Tim Harder and Jes Frellsen # # BASILISK is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
15e8ec2b795c5802710258593994ffc68f01a06b04c811e3231267da194dccfd
Python
4,957
138
import os import biom import numpy as np import pandas as pd import birdman from scipy.stats.mstats import gmean from birdman.model_base import TableModel, SingleFeatureModel import warnings def _normalization_func(table, norm='depth'): if norm == 'median_ratios': K = table.matrix_data.todense().T + 0.5 ...
eba91ce8310006580c563a0efd867b6ec18928425f26af5efdf492afc46d4d63
Python
4,957
133
# Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # from ampligraph.datasets.partitioning_reporter import PartitioningReporter from...
0ba62e1bdbf1fc3c2b87461aa3c5635c984f80480936b0b9e4b951d8f6acb8da
Python
4,958
146
#------------------------------------------------------------------------------- # elftools: common/construct_utils.py # # Some complementary construct utilities # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- from...
393a06f4622415d06310e5d31a25df6971a5971e3eb2c14344ecd42429594d5d
Python
4,958
142
# Copyright 2026 DeepMind Technologies Limited # # 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 agr...
0081715b47de491cc87657bef3c60bc0bf8407292a8ea23530426cba58b0a5e1
Python
4,960
155
from gensim.test.utils import common_texts from gensim.models import Word2Vec from gensim.models import FastText import pandas as pd import numpy as np from gensim.models.callbacks import CallbackAny2Vec class EpochLogger(CallbackAny2Vec): '''Callback to log information about training''' def __init__(self): ...
7c08741c77ea21c495fd61b04db430c2e2067b1973d5c671d78e1c0213f46359
Python
4,961
144
# Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # import contextlib import tqdm from tensorflow.python.framework import errors ...
1f47815e2b5b460677a88a6a19ad401fa07d60dae3b6515f6390e1dda62d65b4
Python
4,964
144
#!/usr/bin/env python """Defacing utility for MRI images.""" import argparse from nibabel import load, Nifti1Image from pkg_resources import require import pydeface.utils as pdu import sys import shutil import numpy as np import os def is_interactive(): """Return True if all in/outs are tty""" # TODO: check ...
b328dab2d5c9e31e11509be94f4ba1b4bfc4d088ad3f60cdbe5e618e90f4bfe1
Python
4,964
128
import os import glob from lxml import etree import rdflib from pyontutils.core import LabelsBase, Collector, Source, ParcOnt from pyontutils.core import makePrefixes from pyontutils.namespaces import nsExact from pyontutils.namespaces import FSLATS from pyontutils.namespaces import NCBITaxon, UBERON from nifstd_tools....
bc45432ed42181c0f3c84849e878f41d55db485ee163ba2869b461debca51edc
Python
4,968
136
#!/usr/bin/env python import logging import os import importlib import sys import numpy as np import pandas as pd import torch from torch.utils import data from torch import save, load import my_data from torch import cuda, device from sklearn.metrics import mean_squared_error from scipy.stats import pearsonr, spearman...
c8e0837fae5c2bf6e097b3235ab3df88230482cc6cdc61680831aeff0f18785f
Python
4,973
158
from dataclasses import dataclass import numpy as np import pandas as pd import matplotlib as mpl import pytest from numpy.testing import assert_array_equal from seaborn._marks.base import Mark, Mappable, resolve_color class TestMappable: def mark(self, **features): @dataclass class MockMark(...
0ab92cf19b21607a00332666de293311d177a361403815fc0334451be5138a5e
Python
4,977
146
#!/usr/bin/env python """Training on a single process.""" import os import torch from onmt.inputters.inputter import build_dataset_iter, \ load_old_vocab, old_style_vocab, build_dataset_iter_multiple from onmt.model_builder import build_model from onmt.utils.optimizers import Optimizer from onmt.utils.misc import...
7769d84dfebb1bd57d00dc745f27bc4df2ba0f339ccb91d64edafb484506f32a
Python
4,979
154
#!/usr/bin/env python import os, imp import collections import torch from torch.nn import functional as F import dataprovider3 as dp import forward import utils import models def main(noeval, **args): #args should be the info you need to specify the params # for a given experiment, but only params should ...
8544f8c85c6e0271d15b870cd19c686047969725d77a89a764d6fbde26557534
Python
4,982
156
import cv2 import matplotlib.pyplot as plt import numpy as np import torch from scipy.stats import mode as major_value from sklearn.metrics import confusion_matrix #### class BaseCallbacks(object): def __init__(self): self.engine_trigger = False def reset(self): pass def run(self, state...
03d2d8546fe56a1c350da841b2deca74289bbb39443a27e76671ab8302d6ebb3
Python
4,984
142
# Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # import abc class AmpligraphDatasetAdapter(abc.ABC): """Abstract class for...
bfc041da34997e5c28a41e606be56b81942a0b89acf3d0b40becef41790e6c0c
Python
4,988
155
import os import unittest import pathlib as pl import pytest import ontquery as oq import augpathlib as aug from pyontutils import sneechenator as snch from pyontutils.core import OntGraph from pyontutils.config import auth from pyontutils.namespaces import rdf from pyontutils.integration_test_helper import Repo from ....
948048ca57d9466db019394aa0bd6a1e3ee2218576234307d1141d3a196ea913
Python
4,991
143
import numpy as np import pytest from mock_data_stream import MockStreamData from pyxdf.pyxdf import _detect_breaks # Segment at absolute time-intervals exceeding a given threshold. Sequences of # identical absolute intervals should be segmented the same regardless of # whether they are positive or negative. # Monot...