sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3606debc76b21473b0ef5e24658f069bd901a2b8d2591b486760daebe1eac2d9
Python
19,567
340
# Copyright (c) 2021, Ko Sugawara # 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 conditions and t...
9bd440828978783958b3a8f2efe8da1d6b582761e3a12b7e5ae0b9a45f8f6af7
Python
19,569
656
""" Functions for creating stimuli and noise inputs for models. """ import inspect import logging import numba import numpy as np from chspy import CubicHermiteSpline from ..models.model import Model from scipy.signal import square class Input: """ Generates input to model. Base class for other input t...
d29d2960dd3de4eb060ee182f651e28158726a185ab84203c0854af0cca9b4a8
Python
19,571
521
#!/usr/bin/env python # -*- coding: utf-8 -*- """Demonstrate usage of LFPy.Network with network of ball-and-stick type morphologies with active HH channels inserted in the somas and passive-leak channels distributed throughout the apical dendrite. The corresponding morphology and template specifications are in the file...
4088c0a7de34400b1b80304183cc4827914f79d99787f9c6852d09339b7d9c4e
Python
19,574
513
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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 applicab...
ea3c628cf7b8c01afb7d1ba72997b193c68b3b71bab7b66536d733bcae680913
Python
19,582
451
#=========================================================================== # Import, Set up MPI Variables, Load Necessary Files #=========================================================================== from mpi4py import MPI import time tic_0 = time.perf_counter() #script runtime calculation value import os from o...
b56d97ab29b2e0b529653d78b1e4de575147811ffb41c00373e21c5260785f78
Python
19,587
614
""" This code was taken from: https://github.com/aaren/wavelets """ from __future__ import division import numpy as np import scipy import scipy.signal import scipy.optimize import scipy.special from .wavelets import Morlet __all__ = ['cwt', 'WaveletAnalysis', 'WaveletTransform'] def cwt(data, wavelet=None, widt...
3330fc268aab7297db7926096e9efec844c24faabbeda6564433450e119345be
Python
19,605
516
""" m6a_cnn.py Author: Anupama Jha <anupamaj@uw.edu> This module predicts whether an adenine is methylated or not. The model is trained with Fiber-seq HiFi read sequence, inter-pulse distance and pulse width signal from pacbio. The model is a convolution neural network. """ import torch import numpy as np import _pick...
5724ffa1e1bb07709854f0747ffec40918734e40a59867b740d58dc02184162d
Python
19,607
515
""" m6a_cnn_ont.py Author: Anupama Jha <anupamaj@uw.edu> This module predicts whether an adenine is methylated or not. The model is trained with ONT read sequence, read quality score and methylation score from oxford nanopore. The model is a convolutional neural network. """ import torch import numpy as np import _pi...
89a67e40c1b58e1779b24da0c98b303e4944da61fa59cd6ecef8e33aa68b9912
Python
19,616
517
"""Helper classes for trajectory data management and Blender integration. Provides utility classes for position caching, frame management, Blender property synchronization, and attribute metadata collection. """ import logging from typing import Optional import databpy as db import numpy as np import numpy.typing as ...
b16342fe05215b3434164092e9b0f74e3d85be59e4d80c0b9cff0ebdc57f82f4
Python
19,616
568
"""distutils._msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for Microsoft Visual Studio 2015. The module is compatible with VS 2015 and later. You can find legacy support for older versions in distutils.msvc9compiler and distutils.msvccompiler. """ # Written by Perry Stoll # h...
f1dc23cbc93ecac8bc35e6ac7f22759e09072e86f4164e13e9e9de685e2e9603
Python
19,631
577
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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 applicab...
255c9339a9c2196378153763ebe176fe68e29dbacef54275c8cd4b6d8794b940
Python
19,636
414
##################################### ######## Paper Draft Cartoon ######## ##################################### #%%# Catalyzer import os import sys path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources' sys.path.append(path) import numpy as np import torch import pickle from Utilities import make_para...
54dded0a3a542d8782b7fafab97998ec6e5e08ce377ae8672084d238bb29ff3c
Python
19,636
462
""" Mapping of a base input file columns into HED tags. """ import copy import warnings from collections import Counter from functools import partial from hed.errors.error_reporter import ErrorHandler from hed.errors.error_types import ValidationErrors from hed.models.column_metadata import ColumnMetadata, ColumnType...
b3dc79085f3c0e84d2d11d2d02706ba12253fbe80b61e3f5f0bb4e374c8532d2
Python
19,638
431
""" Generates a ListTomoParticle object from a input STAR file (translocon project version) Input: - STAR file for pairing STAR files with particles and particles shapes Output: - A ListTomoPaticles pickled object for every STAR file row """ ################# Package import import os import vtk impor...
f2d551b7b0e8e8cd5cb436b3c0e591e622423134249ae6c4373add5fa38a697e
Python
19,650
360
import os import pickle as pkl from typing import Any, Callable, Dict, Tuple, Union from ..base_dataset import BaseDataset class DEAPDataset(BaseDataset): r''' A multimodal dataset for the analysis of human affective states. This class generates training samples and test samples according to the given p...
b0e317097adbd46907b34d3022f3ed4aaeaf4cf086ea6591a3d78f49dda5b0ab
Python
19,651
353
import os import shutil import tempfile import unittest from hed.models.sidecar import Sidecar from hed.schema import hed_cache from hed.schema.hed_schema import HedSchema from hed.schema.hed_schema_group import HedSchemaGroup from hed.schema.hed_schema_io import _load_schema_version, load_schema_version from hed.tool...
002e69327a2d5d6d913269d9f760888fbb15b4236f52897af8c2b7079d9cc1e1
Python
19,653
498
# -*- coding: utf-8 -*- from __future__ import annotations import os from typing import (TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Union) import nltk from supar.utils.logging import get_logger from supar.utils.tokenizer import Tokenizer from supar.utils.transform import Sen...
2e636cdb90f0e0894b368c4855171e42a03ac8a93596cc3c29b8e4234d3bac1c
Python
19,656
389
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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 applicab...
49547a84e89d4a04e1118e66a8650140866562fc071d3c24eb79aa47c78e979a
Python
19,670
410
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
e9670d53e88c1a8d01ac3f3e91147244f2d6def51c440c6b0b87061381b0c68c
Python
19,678
493
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 23 13:19:47 2020 @author: hugwei """ import os from typing import List, Union, Tuple try: import h5py h5py_available = True except ImportError: print("h5py not installed, some functions will not work.") h5py_available = False import ...
d2d712d5a58032f921c20bd54dc32ae86bbc9dc15a2b43081918a33a52fc04cb
Python
19,686
492
# Computational model used for studying fragmented network bursts in Doorn et al. 2024. # Model of neuronal network derived from hiPSCs on MEA (Doorn et al. 2023) # Using a HH-type model including a slow after-hyperpolarization current and membrane noise (Masquelier, Deco 2013). # Connected into a network with N neuron...
89d8fa7197087772f9c4d35e27b89e38bb70ddac0993903ae3151f7ad1f0ab73
Python
19,697
538
""" requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket # noqa: F401 from pip._vendor.urllib3.exceptions import ClosedPoolError, ConnectTimeoutError from pip._vendor.urllib3.exceptions import HTTPErro...
b25379362c8befbe859b9e9e9c3262d3e3085e0d2a0f4621a59acbf483c16f5c
Python
19,703
472
import numpy as np import os import pandas as pd import glob import matplotlib.backends.backend_pdf import nibabel as nib from nilearn.plotting import plot_img from nilearn.image import index_img import pv_conv2Nifti as pr import alive_progress as ap import pv_parser as par from QC import * #%% Feature calculation of t...
b4404fc7caf2c2c9cca2df204f2c708bf778bfb91a669a3196151e420914444b
Python
19,703
499
"""kNN evaluation modules and script. Copyright (c) 2024 University of Michigan. All rights reserved. Licensed under the MIT License. See LICENSE for license information. """ import os import logging from shutil import copy2 from functools import partial from typing import List, Union, Dict, Any import yaml import n...
2c6e3bbc9d012b160904af3c62e75478cd2a10a2851a421172a9fd55ab3aad80
Python
19,705
564
#!/usr/bin/env python3 import pysam import numpy as np import argparse import logging import pomegranate as pom import array import git D_TYPE = np.int64 def get_commit_hash(short=7): repo = git.Repo(search_parent_directories=True) sha = repo.head.commit.hexsha return repo.git.rev_parse(sha, short=short)...
8391d27ee562737b2a2c10539a83dcde6b9a59c0970ded150529c315c84d2376
Python
19,731
547
# basic import os, glob, gc, random, math, tsaug import numpy as np, pandas as pd import matplotlib.pyplot as plt, seaborn as sns from collections import OrderedDict from Bio.Seq import IUPACData from tqdm.auto import tqdm from joblib import Parallel, delayed from itertools import product # pytorch import torch from t...
eb90d16fa7934aaa99fcb8853d388a2129eebe7fcbed1d19a54ff086c3dd3d78
Python
19,732
533
from __future__ import division, unicode_literals, absolute_import from builtins import int, range, dict, map, zip import io import os import re import sys import queue # Future warning from cython in h5py import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import h5py from tqdm import tq...
37fe7dc1043fe34d3d7c7d8aa8042b4b368cf76deb13e181264c8cf51c9531ff
Python
19,735
431
""" Generates a ListTomoParticle object from a input STAR file (translocon project version) Input: - STAR file for pairing STAR files with particles and particles shapes Output: - A ListTomoPaticles pickled object for every STAR file row """ ################# Package import import os import vtk impor...
cf0682baa1d601d62a99439562ff063967599dcd137a490a2b5511afda9d5adc
Python
19,743
525
import os import pygame import random from dataclasses import dataclass pygame.init() pygame.font.init() pygame.mixer.init() @dataclass class G: ''' Keeps track of globals, game constants and variables not related to the players or the cards. Fields: FPS: The number of times the game loop runs p...
1cd8ae8632648d5f6854313b51959d43046bc0f5552ac1dff225c128519d0120
Python
19,749
629
import numpy as np import numba from ...utils import model_utils as mu def timeIntegration(params): """Sets up the parameters for time integration :param params: Parameter dictionary of the model :type params: dict :return: Integrated activity variables of the model :rtype: (numpy.ndarray,) ...
d22f1c260aeaba9cdaebb2013d9feef635ef9d2c6be54065544894a9d90fb582
Python
19,752
537
from __future__ import absolute_import import collections import functools import logging from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme from .exceptions import ( LocationValueError, MaxRetryError, ProxySchemeUnknown, ...
b9a925b846c97a2e579e6bde889b66d584082f9f5f5b21d97c93e198b4d241d0
Python
19,753
474
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 7 15:39:18 2024 @author: deeperthought """ import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import nibabel as nib from skimage.transform import resize from tensorflow.keras import Input, Model from tensorflo...
d2b0b9e4a788e9cea2a078d6bef50be969482b359c5ec4b614cdccf3d3e4b62e
Python
19,754
450
""" DeepLabCut2.0 Toolbox (deeplabcut.org) copyright A. & M. Mathis Labs https://github.com/AlexEMG/DeepLabCut Please see AUTHORS for contributors. https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS Licensed under GNU Lesser General Public License v3.0 """ from __future__ import print_function import wx import...
8fa1bc546a3ad34e053eca1a19f578da01703da969a0f6573f7ab287b0ebe962
Python
19,759
513
"""Linear mixed models with one random intercept, shared by Milo, Dialogue and the differential expression interface. Random intercepts are written as ``(1 | variable)`` in formulas, the syntax of lme4 and R Milo. The numba kernels fit ``y ~ X + (1 | group)`` by REML and compute Satterthwaite degrees of freedom like `...
77c6d00c7b8f1779bd531ba48c1dbdddd3bcb6101c6594d1283462467a3824e9
Python
19,761
508
from os import SEEK_SET, SEEK_END, SEEK_CUR from datetime import datetime, date, timedelta from logging import getLogger from struct import unpack from numpy import array, dtype, empty, fromfile, iinfo, memmap, nan, pad, where from numpy.lib.recfunctions import append_fields N_ZONES = 15 MAX_SAMPLE = 128 MAX_CAN_VIEW...
018e9677996bbd9bad6d47ec62764442ad693ea6d266951be2a839a0dfdfe8dd
Python
19,764
430
from dreamcoder.fragmentUtilities import * from dreamcoder.grammar import * from dreamcoder.program import * from itertools import chain import time class FragmentGrammar(object): def __init__(self, logVariable, productions): self.logVariable = logVariable self.productions = productions s...
db86c74a602a5b1eb03ad5b672d39aa67cd7b19cf45ef85aa216406b9c1c3a44
Python
19,787
403
import numpy as np import json import torch import torch.nn as nn from torch.utils.data.sampler import SubsetRandomSampler import os from dataset import * from setting import * ### Functions for TCGA data def get_number_features(data): for X, y in data: n_feat = X.shape[0] break return n_feat ...
02ca388a4ac5aebebc177c56016e7a7c35e39140223af5607d052370e0174b1b
Python
19,788
505
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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 applicab...
4ee30c55c8351fdd13b7491c04bbc5f8fdd29f202a918d66a7fca1ec30e72e06
Python
19,792
520
# coding=utf-8 # Copyright 2019 The Open AI Team Authors and The HuggingFace Inc. team. # # 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 # # ...
dd9b08d5ecd8e7895dc628d9413bd21a2384aae39cd8f33c83b5aa48914ff371
Python
19,794
392
from nipype.pipeline.engine import Workflow, Node from nipype import DataGrabber, DataSink, IdentityInterface import nipype.interfaces.fsl as fsl import nipype.interfaces.freesurfer as fs import nipype.interfaces.spm as spm import nipype.interfaces.matlab as mlab import os import json from nipype.interfaces.utility imp...
4db061edcbb04ca6a548801761892727a4b2c24fc7e3d64a09f2df6aacba66f2
Python
19,800
755
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 13 20:01:56 2020 @author: usingh """ import os import sys import time import multiprocessing from contextlib import closing import gc #import pyximport; pyximport.install() import orfipy_core as oc import subprocess import orfipy.utils as ut import ...
8d56c2ca938384298db4936528e8990d53d2bc7920fc8303d1673b430c9e8df4
Python
19,804
600
"""Utilities for train_and_predict.py script.""" import os import warnings from collections import Counter, defaultdict from pathlib import Path from typing import Any import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib_scalebar.scalebar import ScaleBar # from...
68a4b9861e5450a3b2af0810942a370c913eb6830da4f1d08799473837d7a774
Python
19,805
506
from __future__ import print_function import sys import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import random import os import argparse import numpy as np from PreResNet_cifar import * import dataloader_...
2856490b09f0ac7690481a5a0acb0769fb24a62fcdeecadc05d587106ab253a7
Python
19,809
436
""" Generates a ListTomoParticle object from a input STAR file (translocon project version) Input: - STAR file for pairing STAR files with particles and particles shapes Output: - A ListTomoPaticles pickled object for every STAR file row """ ################# Package import import os import vtk impor...
865b54f14a683467e23d2de4bd0d4a5600357d8d4116c3979fc0a2c17773fec8
Python
19,810
639
import warnings from typing import Optional, Tuple, Union import jax import jax.numpy as jnp import numpyro.distributions as dist import torch import torch.nn.functional as F from numpyro.distributions import constraints as numpyro_constraints from numpyro.distributions.util import promote_shapes, validate_sample from...
83874655351699ff60453aa34d1c2b0c07c87c1a342b55f44f9a7b7442586d7f
Python
19,828
441
from __future__ import print_function import time from collections import namedtuple, Sized from heapq import heappush, heappop, heapreplace from operator import itemgetter from pddlstream.algorithms.common import is_instance_ready, EvaluationNode from pddlstream.algorithms.disabled import process_instance, update_bi...
c5864a7d873e074c0b909c09b3fcc93002a984d578869960ed5a979d8d0c1523
Python
19,830
570
import logging, time, yaml, os, shutil import numpy as np import torch from torch import nn import pytorch_lightning as pl from pytorch_lightning.utilities import rank_zero_only from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateMonitor import torch.nn.functional as F from torch.optim.swa_utils import...
4b7dd3f9c0b02829b3243011212172e8be0a2b08b43a262038b331e5ab5d616f
Python
19,832
426
########################################################################################### # # # Evaluator class: Implements the most popular metrics for object detection # # ...
84560830b5fc162b7c145d8d4aad66ec551966e78c5daa58b2668f02779cff01
Python
19,835
388
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team, The Hugging Face Team. # # 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...
1119aeb3851a525cc3723bad547beba072f50a84afaf67b268674b4bb9643a5c
Python
19,840
446
import os from typing import Callable, Dict, Tuple, Union import numpy as np from scipy.io import loadmat from scipy.signal import filtfilt, firwin from ....utils import get_random_dir_path from ..base_dataset import BaseDataset def _apply_fir_filter(eeg_data: np.ndarray, lowpass: float, highpass: float, sampling_r...
c9c8532cec1ad0d72fb71e40268a006318ecc032ac9592c8b29efebae3538f31
Python
19,840
521
# # MIT License # # Copyright (c) 2022 GT4SD team # # 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,...
2704f75e8bd0ec6d6377b2d52324d9b693d3020a0d0142857012b13f4775277a
Python
19,841
437
""" Generates a ListTomoParticle object from a input STAR file (translocon project version) Input: - STAR file for pairing STAR files with particles and particles shapes Output: - A ListTomoPaticles pickled object for every STAR file row """ ################# Package import import os import vtk impor...
aebd753f915d1a8e532576a61341a02a90e4d7b60af660348f82351dd29b4941
Python
19,857
618
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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 applicab...
5220b498f7d38842effdc0192ea3cba0d01be2a1c9235e411f07816b739284a8
Python
19,858
453
#!/bin/env python from libraries import * class OpEquilibrium(nn.Module): def __init__(self, kf, kb, fact, gmin, qe, Hill=1): super().__init__() self.kf = nn.Parameter(torch.tensor(kf)) self.kb = nn.Parameter(torch.tensor(kb)) self.fact = fact self.gmin = nn.Parameter(gmin)...
9878444e2e74eebe6fbc75e9653a1f8009d911cdccb39a7c028541f19a2014ee
Python
19,859
437
""" Assembly detection related utility functions (mostly loading simulation related stuff) author: András Ecker, last update: 06.2023 """ import os import json import h5py import warnings from collections import namedtuple import numpy as np import pandas as pd from libsonata import EdgeStorage from bluepysnap import ...
b66362ac38412e87958d1f524be6fbc16c89b27754ca3543348e3789adddddf3
Python
19,861
481
""" Contains (abstract) class MultiData for input of data stored in multiple files. Each file contains results (data) of one observation (experiment). # Author: Vladan Lucic (Max Planck Institute for Biochemistry) # $Id$ """ from __future__ import unicode_literals from builtins import object __version__ = "$Revision...
1d12cb5977f21d88dc7689e66a430abb01e250c763ab97885d18894d78fd31e3
Python
19,871
401
import time import os import subprocess import sys sys.path.insert(0, '/home/jupyter/repos/genformer') import re import argparse import collections import gzip import math import shutil import numpy as np import time from datetime import datetime import random import seaborn as sns import logging os.environ['TPU_LOA...
b3f91db54bf8de647aacd5855cd89d760e7a1aee3e7c1518dc3d2c352ecca71a
Python
19,871
433
""" Generates a ListTomoParticle object from a input STAR file (translocon project version) Input: - STAR file for pairing STAR files with particles and particles shapes Output: - A ListTomoPaticles pickled object for every STAR file row """ ################# Package import import os import vtk impor...
4824e9e50d17ba322d42dbad6b13df7bc23c1599f6464413116e51dfbd69bb65
Python
19,883
666
# map.py import sys from collections import Counter, defaultdict from multiprocessing import cpu_count from pathlib import Path from tempfile import _get_candidate_names import dnaio import numpy as np import pandas as pd import pysam from packaging import version from umi_tools import UMIClusterer from umi_tools imp...
e7f7cbb75c349ebc206d4470318e2376c703308676781913619a1d5719726c26
Python
19,884
468
# -*- coding: utf-8 -*- # # Test functionality of SyNCoPy-container I/O routines for NWB format files. # # Builtin/3rd party package imports import os import tempfile import pytest import numpy as np from glob import glob import matplotlib.pyplot as ppl # Local imports import syncopy as spy from syncopy.datatype impo...
4c8cf44b716dd4535ac7094d5a7fa18552d6582f9c553f4c652f24ba63ccec98
Python
19,887
673
import time from xml.etree.ElementTree import Element as e, SubElement as se from xml.etree import ElementTree from xml.dom import minidom import pickle as pickle import collections class OrderedSet(collections.MutableSet): def __init__(self, iterable=None): self.end = end = [] end += [None, en...
b3d437b8f89bc6048cbaf702a8543e7a7e2b46b511de9edf4be0886990888b49
Python
19,889
475
import argparse import copy import random import sys import shutil import time import numpy as np import os import pandas as pd from typing import Tuple import torch from torch import optim from torch.utils.tensorboard import SummaryWriter from src.preprocessing.augmentation import AugmentParameters from old_code.dat...
4427248645bfa9d822134468d08e39fa921e113a3f48c5b0285e9bd6b9551ddc
Python
19,897
586
from pycocotools.coco import COCO import os import matplotlib.pyplot as plt import cv2 import numpy as np import json import re from deeplabcut.utils import auxiliaryfunctions as dlc_aux import deeplabcut as dlc import pandas as pd import pickle plt.ion() def describe_dataset(coco): for catid,cat in coco.cats.item...
4928042a56fdc1d33ac8c4db04613930d64d0e06ed934794a49e27b61c8e3d95
Python
19,910
516
#!/bin/env python3 """ Simulation result data ---------------------- The SimData class is used to store the results of a simulation of ithildin. """ from glob import glob from itertools import chain from typing import List, Union, Tuple, Dict import datetime import numpy as np import os import pandas import re import...
b40c18aa685b254e8042c80219ba2a52622ba6df1c676aa5d28aa40070d0c119
Python
19,912
427
import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import warnings warnings.simplefilter("ignore") import json import time import tqdm import util import pprint import random import torch import scipy.stats import numpy as np import pandas as pd from datetime import dateti...
2b3938016e883325ff878eb859c941bfa54383ded9d206f00b3f88b333804063
Python
19,914
409
import numpy as np from scipy.stats import gamma, norm, truncnorm, multivariate_normal import matplotlib.pyplot as plt from numpy.random import multivariate_normal as multi_norm from scipy.misc import logsumexp import sys sys.path.append("../useful_functions/") import useful_functions as uf def ibis(actions, rewards,...
067128d31407ec09f89d2eadaef0eb8fbc0643367fc6c874d2d9b6a9a39bb379
Python
19,924
608
""" Tests for CALIB module FIXME need satrecov tests FIXME need sensitivity correction tests FIXME need test with edge correction """ import math from six import StringIO import pytest import numpy as np from fsl.data.image import Image from oxasl import Workspace, calibration, m0 pytest.skip("skipping calibration...
fba8ca71c51e91602a47ab6be8201045895211d86fcc9f6d9f04ab2b5b3967dc
Python
19,928
437
""" Generates a ListTomoParticle object for the statistical spatial analysis of particles Input: - A STAR file with particles - A STAR file for paring picked particles and (sub-)volumes segmentations (Volume Of Interes, VOI) Output: - A STAR file with the pickled ListTomoPaticles objects "...
8def0fd405a1cc2454f948f9a28cba74c42c3464902b13d93afaebcdff708d61
Python
19,933
546
""" Performs Univariate 2nd order analysis from a STAR file with a set of ListTomoParticles entries Input: - A STAR file with a set of ListTomoParticles pickles Output: - Plots with the analysis - Matrix with the analysis for further post-processing """ ################# Package import im...
a6ec3e7ed70e0915e643cc28189adfda5cb5a8b4b61554a9616c547eb1b23ed4
Python
19,939
546
""" Performs Univariate 2nd order analysis from a STAR file with a set of ListTomoParticles entries Input: - A STAR file with a set of ListTomoParticles pickles Output: - Plots with the analysis - Matrix with the analysis for further post-processing """ ################# Package import im...
e9101cfecaf4c549a8a38d05116c0030433dd2a490bcc98fccb0726e5693e8b4
Python
19,945
622
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :AUTHOR: Jens Petersen :ORGANIZATION: Heidelberg University Hospital; German Cancer Research Center :CONTACT: jens.petersen@dkfz.de :SINCE: Wed May 17 14:29:20 2017 :VERSION: 0.1 DESCRIPTION ----------- Create longitudinal analysis for XNAT subject REQUIRES --------...
f05a28d58cc6a2f7df402a8bfaae3eca87c5850f2ca4868e2b9bb5ed786d0259
Python
19,954
408
import logging import os import pickle from collections import OrderedDict from contextlib import redirect_stdout from multiprocessing import Process, Queue, cpu_count import numpy as np import psutil from .hs2 import HSClustering from skopt import gp_minimize from skopt.space import Integer, Real from tqdm import tqd...
41107e24552de0356bc0f591af930acd4c51dfb785f5a1d44ae403eccda71f98
Python
19,957
444
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import pytorch_lightning as pl from pytorch_lightning import Trainer from pytorch_lightning.logging import TensorBoardLogger from pytorch_lightning.callbacks import EarlyStopping from Loader import SignedPairsData...
890125b9ef5b37a11d11ad1888209c78f88a93d292a7a5f444ff7c5dc73a2e2b
Python
19,965
528
"""Main module. Holds the `BayesianOptimization` class, which handles the maximization of a function over a specific target space. """ from __future__ import annotations import json from collections import deque from collections.abc import Iterable from os import PathLike from pathlib import Path from typing import ...
ca4aacca9aa41ca9a6826e6ffd91760db7a95d51860fc945fc5c81937d31de7f
Python
19,966
374
# https://github.com/Perik-Zavodskii/TCRscape import numpy as np import pandas as pd import seaborn as sns import scipy.stats as stats from scipy.io import mmread import matplotlib.pyplot as plt import matplotlib as mpl from sklearn.decomposition import PCA import umap.umap_ as umap import hdbscan pd.options.mode.cha...
97f644a4bb66f9648507d5754b8a9eb01f10796952f1af1ac7f5c6e759711faa
Python
19,970
353
# Copyright 2020 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 # # ht...
6468792a669d195a6bb3fa1688c46dce3cf14990772c245ed72b7da79dabcec1
Python
19,973
630
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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 applicab...
818d95b9511c59c7bca0c91f6c2b09f1f6b57d302fad9c0da35b563e26fa7b1f
Python
19,974
556
from __future__ import absolute_import from __future__ import print_function from __future__ import division !pip install dotmap import math import tensorflow as tf import time import matplotlib import math import time import random import numpy as np import pandas as pd from dotmap import DotMap from __f...
dd9ab5af7a0855497874d131e9dd57fa41818a88bb3bf2e8766840f8c83e3cd0
Python
19,976
402
""" DeepLabCut2.0 Toolbox (deeplabcut.org) copyright A. & M. Mathis Labs https://github.com/AlexEMG/DeepLabCut Please see AUTHORS for contributors. https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS Licensed under GNU Lesser General Public License v3.0 Hao Wu, hwu01@g.harvard.edu contributed the original OpenC...
f9899ffbd4583e2cf25e95147c8250e7e3bc2159b7195c890fd112bde5bac1cf
Python
19,977
617
# coding=utf-8 # Copyright 2026 The Google Research Authors. # # 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 applicab...
47cec51d61bfd6878ddd50e13ff32debe396a9d5bf309c2bb84976ad967ad30f
Python
19,980
382
"""Tests for combining partnered library schemas with their standard partner (schema_io.schema_merge).""" import os import shutil import tempfile import unittest from hed import schema from hed.errors import HedExceptions, HedFileError from hed.schema import HedKey, from_string, hed_cache, load_schema, load_schema_ve...
5050e847d63eacdef4d716729d88ac6e6c01bbe5cf62ed9625b80b12e0bb1f08
Python
19,985
431
""" Generates a ListTomoParticle object from a input STAR file (translocon project version) Input: - STAR file for pairing STAR files with particles and particles shapes Output: - A ListTomoPaticles pickled object for every STAR file row """ ################# Package import import os import vtk impor...
3a0de04fb6fee22d2972491f0986577d6c677a52b2372d1409c0ff2c7aeb7b9c
Python
19,993
515
import argparse import pickle import time # Libraries from functools import lru_cache from math import exp, pi, sqrt, tan import matplotlib.pyplot as plt import numpy as np import scipy.integrate import scipy.signal import uptake.figures.utils as fiu import uptake.model.system_definition as sysdef ...
2fe96f2d1d61e86777730f3f1ac826a442f0eb6e3595d9786bf5dfb225121140
Python
19,994
561
from __future__ import absolute_import, division, print_function import os import sys from typing import List, Union import numpy as np import torch import torch.nn.functional as F import torch.utils.data from topaz import mrc from topaz.denoising.datasets import DenoiseDataset, PatchDataset from topaz.denoising.mod...
8319122d4f0403c3a573edbc113c24a3bb3b7b0bb6c004c2a8ff4f4033d100ab
Python
19,995
437
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 16 08:00:51 2020 @author: daltonm """ #%matplotlib notebook import numpy as np import dill import os import time import glob import itertools from sklearn.preprocessing import StandardScaler from sklearn.metrics import auc import statsmodels.api a...
52006c6bc977999c672a301b9d01f0e765cd14303bb571556f743fb3e2eda22d
Python
20,007
431
""" Unsupervised and deterministic classification of membrane-bound particles Input: - The STAR file with the particles to classify - Classification parameters Output: - A set of STAR files with the new classes - 2D rotational averaged around membrane normal exemplars and inter-p...
75ab24fc317c4239efb1318767a03a18bd73073649b1ab1c0252ec2cf09f7ab1
Python
20,016
479
from classifiers.CustomClassifiers import AggregateClassifier,AggregateClassifierGrid from sklearn.svm import SVC from sklearn.metrics import accuracy_score, classification_report, f1_score,roc_auc_score from sklearn.model_selection import cross_val_predict,GridSearchCV,StratifiedKFold,LeaveOneOut,train_test_split from...
30bd48ca207380fecbbeb419c52c3397915c7c7f335a1c02c37f8e17d4ed7547
Python
20,019
554
"""Functions for statistical tests and validations """ import warnings import numpy as np import glmtools as glm from scipy import stats from sklearn.decomposition import PCA from sklearn.model_selection import KFold, GridSearchCV, cross_val_score from sklearn.pipeline import Pipeline from sklearn.preprocessing impor...
d5358398f51f0275113db117ab34169ace1d34de9ce7f453cd7c97b831307afd
Python
20,030
432
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 22 12:55:12 2021 @author: Eve Shalom """ #%% Import all relevent functions from matplotlib import pyplot as plt import numpy as np from matplotlib.gridspec import GridSpec from ROIselection import ROISelector, ICfromROI,ROILasso,maskto4d from TKMo...
762d0f190f88475cfe967573ca89499e7a34894cd3eb95704d7539663b963fd9
Python
20,038
565
from __future__ import annotations from importlib.util import find_spec from pathlib import Path from shutil import copy import pytest from ase import units from ase.calculators.lj import LennardJones from ase.io import read from ase.optimize import FIRE from pymatgen.io.qchem.inputs import QCInput from quacc import...
9a94e2f80b5316b530a90d984b10b20905c8fb63ac4a99f05cae529f24fab2e9
Python
20,038
558
""" Created on Mon Apr 19 13:59:01 2021 @author: Haotian Teng """ from numpy import ndarray import os import vbz_h5py_plugin import h5py import pod5 import itertools import numpy as np from pathlib import Path from tqdm import tqdm from typing import List import contextlib from typing import Dict from scipy.signal imp...
d6b94d0147b0b5b16617c5b142a2153abdaf4987fb4039c2725c7b519bc7990a
Python
20,043
534
#!/usr/bin/env python # -*- coding: utf-8 -*- """Demonstrate usage of LFPy.Network with network of ball-and-stick type morphologies with active HH channels inserted in the somas and passive-leak channels distributed throughout the apical dendrite. The corresponding morphology and template specifications are in the file...
fac495d3fe00c6a6eae92118c2ea6be0cf80e4a52081df3780193b829f9953f6
Python
20,043
582
import math import os from glob import glob import numba import numpy as np import pandas as pd from numba import njit, prange from scipy.stats import t from .numerics import ( _calc_mean_shrunken_residuals, _calc_mean_shrunken_residuals_and_mfracs, _count_n_cpg, ) from .scbs import _find_peaks from .smoo...
be3c27b86735e0c2214a69936f89d55324850dcdf58bf217144a1f9863a53bc7
Python
20,075
566
# adapted from scVI-tools # A Python library for probabilistic analysis of single-cell omics data # Adam Gayoso, Romain Lopez, Galen Xing, Pierre Boyeau, Valeh Valiollah Pour Amiri, Justin Hong, Katherine Wu, Michael Jayasuriya, Edouard Mehlman, Maxime Langevin, Yining Liu, Jules Samaran, Gabriel Misrachi, Achille Naza...
26de511196e9787deb3b9769948dc91185185bbb998a6bf6ed355ac283d8eb6b
Python
20,082
461
# -*- coding: utf-8 -*- # # Syncopy data selection methods # # Builtin/3rd party package imports import numpy as np import h5py # Local imports import syncopy as spy from syncopy.shared.tools import get_frontend_cfg, get_defaults from syncopy.shared.parsers import data_parser from syncopy.shared.errors import SPYValu...
aca5bb663fc91791d63bb8869be586dc633fba0119b6a876575e6a7f118568fc
Python
20,091
534
"""A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on t...
4a4924fbe01c60dc3d4150a8d091d11c87cc7c2013b237a853560116f2f53412
Python
20,110
555
################################################################################ # Copyright (c) 2021-2024, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # Written by D. Jones <djones@llnl.gov> and UCSD collaborators in listed in CONTRIB.md # # All rights reserved....
78f7668dbf1d61dde08cf46eee81ccfa855ab4de505abdd71afc289f8710b76d
Python
20,111
586
# -------------------------------------------------------- # 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 # --...
b751f8b5d19ae8409fb44157ab2d9412ad81aa0be4075ea344afab648bd0da31
Python
20,113
629
import json import os import numpy as np from numpy.random import default_rng import random import math from dreamcoder.task import Task from dreamcoder.type import arrow, tint, tlist from dreamcoder.domains.arc.arcPrimitives2 import * import dreamcoder.domains.arc.arcPrimitives2 as p def make_rotation_tasks(): ...
e448608820d3b407e54bcef110176d59fb3ca4dbc228b8d01ee62b936323f008
Python
20,119
604
from __future__ import division, print_function import copy import numpy as np import networkx as nx import matplotlib.pyplot as plt import matplotlib.cm as cm import operator from sklearn.cluster import KMeans from plots import multi_plot class EigenvectorModularity(object): def __init__(self, g, heuristic_s...