sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3af8730824a542da5e82da4b90b533503896e95a5ddf570a48a1dda30e5cbb41
Python
9,650
324
import os, platform import numpy as np import PIL import matplotlib.pyplot as plt import tensorflow as tf import keras from keras.preprocessing.image import ImageDataGenerator,load_img import imgaug import time import cv2 import aid_img color_mode = "RGB" #Load an image path = os.path.join("imgaug","qu...
ae264c9b82114716871428961b0ef76a707dac5ce66dc0bc312bfae071d2213d
Python
9,678
217
"""Verify the required style command rejects real source defects.""" from __future__ import annotations import json import os import re import shlex import shutil import subprocess import sys from pathlib import Path import pytest import yaml from _common import loads_toml ROOT = Path(__file__).resolve().parents[2] ...
2b1e9a1c4af37a6473e06a25c61de5177783a158ea084ebeb04d98bdabe8a419
Python
9,709
321
import logging import tempfile from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser from datetime import datetime from pathlib import Path from brainglobe_atlasapi import BrainGlobeAtlas from brainglobe_utils.general.numerical import check_positive_int from brainglobe_utils.general.system import ensure_d...
eefdcc34c1dd3943f636488b3f0122580a2b06cdee350ab9467ef439daf9baaa
Python
9,725
290
from __future__ import absolute_import, division, print_function import copy from ._compat import iteritems from ._make import NOTHING, _obj_setattr, fields from .exceptions import AttrsAttributeNotFoundError def asdict( inst, recurse=True, filter=None, dict_factory=dict, retain_collection_types...
88e3eb2a3f8b3744ecfce0216a58e98c1ab95e1614fcab58e75759abccc68883
Python
9,735
342
from __future__ import absolute_import from kombu.async import Hub, READ, WRITE, ERR from kombu.async.debug import callback_for, repr_flag, _rcb from kombu.async.semaphore import DummyLock, LaxBoundedSemaphore from celery.five import range from celery.tests.case import Case, Mock, call, patch class File(object): ...
ce63f59596e098c8056ae51e56d12be666905d682e4ba2d4c431315d3cd2ac89
Python
9,755
364
from __future__ import absolute_import, unicode_literals import sys from celery.five import string, long_t from celery.local import ( Proxy, PromiseProxy, maybe_evaluate, try_import, ) from celery.tests.case import Case, Mock PY3 = sys.version_info[0] == 3 class test_try_import(Case): def test...
ab76f734951ea0a25ee8ca66f64de16e8d8e9717bf595851596492670fa1b13a
Python
9,756
298
#!/usr/bin/python import numpy as np import scipy as sp import warnings warningMsg = "This module is most likely to change both as\ a name and in structure in the future" warnings.warn(warningMsg, FutureWarning) def bs_se(bs_pdf): """ Calculates the bootstrap standard error estimate of a s...
c10a196a219c2cbf2dbae8952fc407cff70fe67012aeda9e253f3783523cb56d
Python
9,758
230
#!/usr/bin/env python2 """Return orthologous groups for given species from a phylome. Require rooted_phylomes.py (cgenomics.crg.es:/home/services/web/phylomedb.org/wsgi/rooted_phylomes.py) Based on: ~/workspace/TreeOfLife/src/orthologous_groups.py Command: ./phylome2orthologs.py -p 120 -s 9999991,9999992,9999993,999...
fc1617e93bcb964f881f11e088842973769ff90a1d6f10183fa55bd13675a8cd
Python
9,772
336
import os import torch import torch.nn as nn import torch.nn.functional as F def set_parameter_requires_grad(model, feature_extracting, trainable_layers): if feature_extracting: for name, param in model.named_parameters(): print(name) if name not in trainable_layers: ...
a5b6d1674dfc0dec322a861d73ee93e21206afeaa9d92566b0c3ededb1be92a2
Python
9,796
238
############################################################################### # _nifti_common.py provides common functionalities to read and parce NIFTI file ############################################################################### # Copyright (c) 2019-2020, University of Liège # Author: Nikita Beliy # Owner: L...
86a9031a2233c251c6995cb2402fd090f3923bbaf201715f5c1dd36a27bfb39f
Python
9,803
273
#!/usr/bin/env python desc="""Process trees from phylome tar.gz dump and generates orthologs dump of seed species. KNOWN ISSUES: - if one tree is wrongly rooted, co-orthologs are shared by all trees """ epilog="""Author: l.p.pryszcz@gmail.com Barcelona, 11/01/2013 """ import argparse, os, sys import gzip, tarfile im...
803b16a5f21675f731ea5fb4118818950ca91b3d9ecf79fd141ab93ef55cfbed
Python
9,818
242
""" BORIS Behavioral Observation Research Interactive Software Copyright 2012-2026 Olivier Friard This file is part of BORIS. BORIS 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 of the L...
b305c5655342a5015e91046ebd49d6a23bdc807d0a33ded81500fbe9a43326b6
Python
9,858
287
from tkinter import ALL # import this specifically like this because we can actually set the bg colour from tkinter import Entry as tkEntry from tkinter import Checkbutton as tkCheckbutton from tkinter.ttk import Label, Frame, Checkbutton, Combobox, Entry from Biscuit.utils.utils import clear_widget from Biscuit.Manag...
98b24fe9a7b1befb100cd32aee72331fd4d834108444aa1d25dfec7ab0ecb857
Python
9,871
295
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Control of and utilities for debugging.""" import contextlib import inspect import os import re import sys try: import _thread except ImportError: impor...
e55b3bdbbbce86ce9608cc187b844c41c8da4c854efa13c5c57743e4a6b66b43
Python
9,877
328
from __future__ import absolute_import import errno import select import sys from time import time from celery.worker import autoreload from celery.worker.autoreload import ( WorkerComponent, file_hash, BaseMonitor, StatMonitor, KQueueMonitor, InotifyMonitor, default_implementation, A...
f5afa1ffab25ae9a6037463ae1c48532349164f3bdd50b3e3119ea69fcd75f34
Python
9,881
247
"""Compare mode: the base-vs-head ratchet that stops a PR raising its own ceiling. Both escape-hatch gates are ratchets. Their head-only checks assert the counts sit under the budget; their *compare* checks assert the budget itself was not loosened, and the scan surface not narrowed, by the same PR the gate is guardin...
8504b25a54b185f82ba06dfb3ec7c9f96845387e92cd7ba2655f9c5946173f13
Python
9,917
224
from pathlib import Path import numpy as np import json import sys from sksurv.linear_model import CoxPHSurvivalAnalysis from sksurv.nonparametric import kaplan_meier_estimator from reliableradiomics.selection import SFS from reliableradiomics.utils.radiomics import load_feature_evaluation, load_features from reli...
bd3e763349c1634c4b7f396966f4afcade6f75bf49ec5e179f47305af964b0a7
Python
9,923
274
############################################################################### # BidsMeta.py defines class that provides interface to bids tsv tables ############################################################################### # Copyright (c) 2019-2020, University of Liège # Author: Nikita Beliy # Owner: Liege Univ...
03377b0c60c555ca580f9ce17877183c8153820515d9ec4d7f0e8b3740173780
Python
9,925
224
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'converters.ui' ## ## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################...
9b57039a196fcbf8c42e9fb5ba8a1f08922e3223421402106ea78bf3656d6ccb
Python
9,945
277
"""dicom2spec default rules""" # TODO: RF: Repronim rules to dedicated rule set. Plus: default numbering for runs, aborted run detection etc. # Are default rules a fallback or a configured rule set? from datalad_hirni.support.BIDS_helper import apply_bids_label_restrictions def _guess_subject(record): # Subjec...
3c82a565ee92833e312184f1878d45f57d3ebffa24baacbea52e363909a75e5e
Python
9,964
274
from tkinter import HORIZONTAL, RIGHT, Y, VERTICAL, BOTTOM, X, W from tkinter import TclError from tkinter import Entry as tkEntry from tkinter.ttk import Treeview, Scrollbar import os.path as op from Biscuit.utils.constants import OSCONST class EnhancedTreeview(Treeview): def __init__(self, master, *args, **kw...
0220daabee8be86e6f035268c17a4ec7ef7cbe231d5850310b89ee6236416a0e
Python
9,982
291
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """A simple Python template renderer, for a nano-subset of Django syntax. For a detailed discussion of this code, see this chapter from 500 Lines: http://aosabook....
9192abe8ea4993a864b64ea1472e9bcbe6882d03210970134966a9055fd80a6c
Python
9,991
250
import torch import os import argparse import datetime import numpy as np import random from torch.utils.data import DataLoader from tqdm import tqdm import pandas as pd from brainCT.networks.gen_model import GUNet from monai.transforms import ( Compose, ToTensord, RandAffined, ScaleIntensityd, Ran...
8e36634906117c298c6bc35b6bd13e34d2ef8d690d8b1d87605349945d342a14
Python
10,020
299
# Copyright (C) 2009 Barry Pederson <bp@barryp.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This ...
a83b9f18ffceacc0aa7baa175c7211e1e4c9347d7d03c2be285fb32ac1561858
Python
10,027
312
import logging from brainglobe_utils.general.system import ( SafeExecuteCommandError, safe_execute_command, ) class RegistrationError(Exception): pass class SegmentationError(RegistrationError): pass class TransformationError(RegistrationError): pass class BrainRegistration(object): """...
83ae57fe9dcdb67d552abea3c3109cbae617b35bc53438446b71408fbb045971
Python
10,042
296
"""Trim pending parameter combinations to projected resource budgets.""" import logging import time from typing import Any import polars as pl from typing_extensions import override from talos.experiment.reducer.pruning_strategy import PruningStrategy logger = logging.getLogger(__name__) TRIM_RANDOM = 'random' TR...
13a1b5aa5bea21903fb722c4895f0f5d4bb30bc65bea6406b0c65641e2a43dd2
Python
10,087
259
import numpy as np import dipy.segment.metric as dipymetric import itertools from dipy.testing import (assert_true, assert_false, assert_greater_equal, assert_less_equal) from numpy.testing import (assert_array_equal, assert_raises, run_module_suite, assert_almost_e...
daba851e418be8b34780f8ea4f5fc6dc4bae73a2b5dd839a2e4f39d4aa15151c
Python
10,099
238
############################################################################### # _MNE.py provides additional parameters for EEG classes that uses mne library # It is highly inspired by mne-bids tool, all credits goes there # https://github.com/mne-tools/mne-bids ########################################################...
ec069c2cecebc570d1c3752c2746b4280b33dd9977206655dc79eceb97c9b553
Python
10,099
298
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Better tokenizing for coverage.py.""" import codecs import keyword import re import sys import token import tokenize from coverage import env from coverage.bac...
beb3212ab000a34bdb48339fb1054c5fc3857d1389645a1e6e87e7b651693cc8
Python
10,102
283
"Base Cache class." import time import warnings from django.core.exceptions import ImproperlyConfigured from django.utils.module_loading import import_string class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKeyWarning(RuntimeWarning): pass # Stub class to ensure not passing in a `tim...
58ec0d970025247ed8df71d6c1a1623decc79f44cf70682d3b35b86f404440ca
Python
10,106
272
"""Functional implementations for text manipulation and rendering. This module provides utility functions for manipulating text in strings and rendering text onto images. Includes functions for word manipulation, text drawing, and handling text regions in images. """ from __future__ import annotations import random ...
4f53a555a47c40b6a71f3c5649a5b75b396b81b008b84789d455cf18f824b2c6
Python
10,109
241
from tkinter import StringVar, BooleanVar from struct import unpack from datetime import datetime from .BIDSFile import BIDSFile from mne.io.kit.constants import KIT from .KITData import KITData GAINS = [1, 2, 5, 10, 20, 50, 100, 200] class con_file(BIDSFile): """ .con specific file container. """ d...
acda1931eaad346e425d6f5efbe817c2f7d79fcc5b1ae88ba30dac0d6f8211b9
Python
10,116
269
#!/usr/bin/python3 # from server import Server import argparse import logging import datetime import h5py import socket import sys import ismrmrd import multiprocessing from connection import Connection import time import os defaults = { 'address': 'localhost', 'port': 9002, 'outfile': ...
d421b7b3bf5e3382406da0b1de2d482d95cb71e6f8d7f8065e538b35fa41827c
Python
10,142
248
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'video_equalizer.ui' ## ## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ###########...
91272658aeaa4dacff92cce2b1dd9fa735ef738f252c01aed32c7ea683202b9f
Python
10,147
261
from contextlib import redirect_stdout from time import sleep import os import os.path as op from tkinter import StringVar from datetime import date import shutil from warnings import warn import glob from bidshandler import Session import mne from mne_bids import write_raw_bids, BIDSPath from Biscuit.Management imp...
6b8e92816c90c4a95963f51d7c19ce2d5bc8b3c1c743b35cf31cb612abae883e
Python
10,158
290
import functools import os from collections import OrderedDict from django.apps import apps from django.conf import settings from django.contrib.staticfiles import utils from django.core.checks import Error from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import ( FileSystemSt...
4727383895e2281d7b9f542c38fb282f310fc46afa171dbe6742cf58aeaf6aeb
Python
10,163
194
# -*- coding: utf-8 -*- """ Created on Tue Mar 9 21:20:14 2021 @convert transLoci to genoLoci base on refrence of gtf annotation @author: hqin Platform: Linux, python3.6 Notes: the gtf file must be consistent with the transcriptome reference used for mapping in running DENA, such as download the cdna.fa and .gtf ...
13d2577395ed07285be78260f0f46516f3ca17b6c43f2ce616c9e3cc356549ff
Python
10,169
194
# -*- coding: utf-8 -*- """ Created on Tue Mar 9 21:20:14 2021 @convert transLoci to genoLoci base on refrence of gtf annotation @author: Hang Qin Platform: Linux, python3.6 Notes: the gtf file must be consistent with the transcriptome reference used for mapping in running DENA, such as download the cdna.fa and ....
e15939807f736e36e8e810dfe47ddd2561eefb1adabce6f83fce69f82a87ef7f
Python
10,222
289
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Results of coverage measurement.""" import collections from coverage.backward import iitems from coverage.misc import contract, format_lines, SimpleRepr clas...
4b1e40d446810e540be358e346fdb5baae9b1e629947e6be769a3b8cd4778762
Python
10,223
218
from __future__ import annotations import json import shutil import subprocess import sys import tempfile from pathlib import Path import yaml REPO_ROOT = Path(__file__).resolve().parents[2] CLOSEOUT_GUARD_WORKFLOW = REPO_ROOT / '.github/workflows/slice_closeout_guard.yml' ON_ISSUE_WORKFLOW = REPO_ROOT / '.github/wo...
c117161c3712f71b01734a95a55287062094ea971f16c52fe594bb2762511d2e
Python
10,224
318
''' Transformations that primarily involve manipulating/munging variables into other formats or shapes. ''' import numpy as np import pandas as pd from bids.utils import listify from .base import Transformation from patsy import dmatrix import re from bids.variables import DenseRunVariable, SimpleVariable class Assig...
60e14cfe6976278aba4c8e7ea21f0cf513d2deed9d7145b14f9d58c5fa5bb3ba
Python
10,228
268
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import Invali...
1ba807052017f4e6f7f5a283b0c1241ca07a23435b861888a1c68fbb3f372741
Python
10,266
263
############################################################################### # _nifti_common.py provides common functionalities to read and parce NIFTI file ############################################################################### # Copyright (c) 2019-2020, University of Liège # Author: Nikita Beliy # Owner: L...
a712b0350db886c26f3951f828b0631c00c5521e8cf1723d9ff90ec03109e789
Python
10,266
310
""" support for skip/xfail functions and markers. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from _pytest.config import hookimpl from _pytest.mark.evaluate import MarkEvaluator from _pytest.outcomes import fail from _pytest.outcomes import skip from...
1522df88d21823c1850c4a69843f93414a73a677c4bf9e137e25e49356731c1f
Python
10,267
292
"""Persist and validate parameter queues and experiment recovery state.""" import json import logging from datetime import datetime, timezone from pathlib import Path from typing import Any, cast from talos.experiment.feedback_controller import FeedbackController from talos.experiment.msq import MSQ from talos.experi...
df691e78184718baa50c31f3aaf887c1b01ec2e46940facf4e786fffa696e1f3
Python
10,280
280
from __future__ import absolute_import import sys import types from contextlib import contextmanager from kombu.utils.encoding import str_to_bytes, ensure_bytes from celery import signature from celery import states from celery import group from celery.backends.cache import CacheBackend, DummyClient, backends from ...
674809718308b439811748c7da6e5751c3c8c43279229fd6a3b3572fe7b4662f
Python
10,284
235
#!/usr/bin/env python2 desc="""Align pairs/mates onto contigs and run SSPACE scaffolder. Example: fastq2sspace.py -v -f contigs.fa -n pe300 pe600 pe5000 -1 ../../_archives/PL429.{3,6,50}00_read1*.fastq.gz -2 ../../_archives/PL429.{3,6,50}00_read2*.fastq.gz -i 300 600 5000 -s 0.15 0.25 0.5 -t FR FR RF -u 5000000 """ epi...
e3fca017c070d2f0474a5c8a27f36763f653b215593675691af6e398cd5d628d
Python
10,291
303
import json from django.contrib.postgres import lookups from django.contrib.postgres.forms import SimpleArrayField from django.contrib.postgres.validators import ArrayMaxLengthValidator from django.core import checks, exceptions from django.db.models import Field, IntegerField, Transform from django.db.models.lookups ...
57b30a2b6f41a4d185d9fdee584b371cf61b1ae2f762d0c5ba3be3150ae57b44
Python
10,317
368
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc try: # Only available in math in 3.5+ from math import...
2683a099d130ff06c319ed7048534389ed105c6e351d431c434e381960bf6b71
Python
10,325
227
import torch from torch.nn.parameter import Parameter import numpy as np import torch.nn as nn # from utils.polarTransforms import * def polarToCylindricalConversion(input): real = input[:,:,:,:,0]*torch.cos(input[:,:,:,:,1]) imag = input[:,:,:,:,0]*torch.sin(input[:,:,:,:,1]) return torch.stack([real, ...
5fd7306fc9c54e8c54db310faea77a6527dbe46dfbc82dc8a79a18c1cc5ab4b9
Python
10,361
310
""" Wrap the internal caffe C++ module (_caffe.so) with a clean, Pythonic interface. """ from collections import OrderedDict try: from itertools import izip_longest except: from itertools import zip_longest as izip_longest import numpy as np from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \...
032750c4ee3547ada24dd9612fba1576cf58f5aaf2a62483ba68bcda78f9e474
Python
10,363
356
# # The Python Imaging Library. # $Id$ # # IFUNC IM file handling for PIL # # history: # 1995-09-01 fl Created. # 1997-01-03 fl Save palette images # 1997-01-08 fl Added sequence support # 1997-01-23 fl Added P and RGB save support # 1997-05-31 fl Read floating point images # 1997-06-22 fl Save floating poi...
6f5b12f85411bc88093123b8d5021f082caca2ae9d2c5b681f909f239e7bd5ef
Python
10,366
308
""" interactive debugging with PDB, the Python Debugger. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import pdb import sys from doctest import UnexpectedException from _pytest import outcomes from _pytest.config import hookimpl def...
3952dcce7bfccbaa8f0bcd60b0289e874be40801059930bed872bfff01c653d8
Python
10,376
248
#!/usr/bin/env python2 desc="""Align pairs/mates onto contigs and run SSPACE scaffolder. Example: fastq2sspace.py -v -f contigs.fa -n pe300 pe600 pe5000 -1 ../../_archives/PL429.{3,6,50}00_read1*.fastq.gz -2 ../../_archives/PL429.{3,6,50}00_read2*.fastq.gz -i 300 600 5000 -s 0.15 0.25 0.5 -t FR FR RF -u 5000000 """ epi...
480ba80fa3cecaa426806a64dd071b7e19bc52a001f3ba833577281e60ca300e
Python
10,404
265
import os.path as op import os from .EnhancedTreeview import EnhancedTreeview class FileTreeview(EnhancedTreeview): def __init__(self, master, directory, *args, **kwargs): self.master = master super(FileTreeview, self).__init__(self.master, *args, **kwargs) self.root_path = op.normpath(d...
cd74c93b379db966f93cad204deb70d70dbe74ea8b55c2aa5b9b10997cbcac6c
Python
10,413
282
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Execute files of Python code.""" import marshal import os import struct import sys import types from coverage.backward import BUILTINS from coverage.backward i...
c31da100ec4a39592839f0aa551d1f6237e3e2d92d205d26fca71f2fed47c271
Python
10,421
235
from contextlib import nullcontext import numpy as np import pandas as pd import pytest from scipy import stats import scikit_posthocs as sp @pytest.mark.parametrize("seed", [2, 17, 53]) @pytest.mark.parametrize("alpha", [0.01, 0.05, 0.1]) @pytest.mark.parametrize("input_type", ["list", "array", "series"]) @pytest....
a9b6788c3b4f82397a3185f2e1a1b6909fa01bb317edd7817c762425bf1bbecc
Python
10,422
328
from __future__ import absolute_import from __future__ import division from __future__ import print_function import ast import inspect import linecache import sys import textwrap import tokenize import warnings from ast import PyCF_ONLY_AST as _AST_FLAG from bisect import bisect_right import py import six class Sou...
100c52098fc775802cc8232f35ff243a03cb85f574f60587e10ed87589cfb0a7
Python
10,442
215
import numpy as np from numpy.lib.stride_tricks import as_strided as ast from scipy.signal import butter, filtfilt def buttfilt(x, fs, fc, order, axis=1): """ BUTTFILT applies a lowpass butterworth filter with a correction factor described in Research Methods in Biomechanics (2ed) and explained further her...
730708d587b3d4af4e11d1b4c2e9035867d2fdbeb1376d5e1cec8f682aa3ac66
Python
10,462
360
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import ipaddress import warnings from email.utils import parse...
63ad89b1364f87a84eefadcbf3aa9da9a4166c82d87c5e989b565c704793d6d4
Python
10,466
226
"""Canonical scientific records; live Python objects never become repr strings.""" import base64 import hashlib import importlib import inspect import json import marshal import math from datetime import date, datetime, time, timedelta from pathlib import Path from .errors import NonPortableValueError _TAG = '__talos...
78e95416131954b27aba4b384c4fc0d8c25da540c54f560dfed890828dd2ea01
Python
10,469
289
from __future__ import division, print_function, absolute_import import logging import numpy as np import os import json from scipy.ndimage.morphology import binary_dilation from dipy.utils.optpkg import optional_package from dipy.io import read_bvals_bvecs from dipy.io.image import load_nifti, save_nifti from dipy.co...
e48a46f0c089f7b027979f988c5ecdc1d5b8c0e23f559ec679b83cc811ef3066
Python
10,485
269
#!/usr/bin/env python2 desc="""Report coverage from BAM file. Support spliced alignments and mapping quality filtering. By default ignores secondary alignments, duplicates and quality failed reads. bam2cov_pool.py is nearly 2x faster on large BAM files than bam2cov.py. TDB: - define minimum overlap CHANGELOG: v1....
fdd1ce7bf085f63406bf45056ca5304aa2d6725e0440114b274c2d3bc71fe58e
Python
10,489
320
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Released under the New BSD license. """ This module contains a base type which provides list-style mutations without specific data storage methods. See also http://static.aryehleib.com/oldsite/MutableLists.html Author: Aryeh Leib Taurog. """ from fun...
c487bc2599ac4a30fad921b73fbfd07c1d67fc481753696de2a667b30538d0bd
Python
10,493
293
from typing import Literal import numpy as np import pytest import albumentations as A from albumentations.augmentations.crops.functional import crop_bboxes_by_coords import cv2 from .conftest import IMAGES, RECTANGULAR_UINT8_IMAGE def test_random_crop_vs_crop(bboxes, keypoints): image = RECTANGULAR_UINT8_IMAG...
2ed0fd72412ee963c8e0b404c74a79261e97063f69b926beff5308bbb3160849
Python
10,513
336
""" BORIS Behavioral Observation Research Interactive Software Copyright 2012-2026 Olivier Friard This file is part of BORIS. BORIS 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 of the L...
3025bedd6b324453b834dad120c9ec750487bdc9c8d134b5fff2e38ff62ce9ae
Python
10,515
253
#!/usr/bin/env python2 desc="""Generate RT signatures for modifications """ epilog="""Author: l.p.pryszcz+git@gmail.com Warsaw, 1/12/2017 """ import os, sys reload(sys) sys.setdefaultencoding('utf8') import re, subprocess from datetime import datetime from collections import Counter from modifications2rna import ...
a42a1c3f194cbf9b1ac4073382e7de1758e8e5dd5cd1badaf0759fe8f6369c1a
Python
10,530
239
""" Testing track_metrics module """ from __future__ import division, print_function, absolute_import from dipy.utils.six.moves import xrange import numpy as np from dipy.testing import assert_true, assert_false from numpy.testing import (assert_array_equal, assert_array_almost_equal, asser...
23e152aefe6da37c49de7bcb184c0f5a8667c8543580523a47be949982215e2c
Python
10,566
248
""" BORIS Behavioral Observation Research Interactive Software Copyright 2012-2026 Olivier Friard This program 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 2 of the License, or (at your ...
801cfc0e1444235aca305c10f5b7a135540ff2aad62680705371c08bd0b8b575
Python
10,566
295
# -*- coding: utf-8 -*- """ celery.backends.redis ~~~~~~~~~~~~~~~~~~~~~ Redis result store backend. """ from __future__ import absolute_import from functools import partial from kombu.utils import cached_property, retry_over_time from kombu.utils.url import _parse_url from celery import states from cel...
152c3595b48da07e0466fb64766f4b07cc77c52f88ca35f1084622800ea6ba9f
Python
10,591
217
"""Audit and recover live model, data and local-file strategy changes.""" import hashlib import sys import types from pathlib import Path from talos.experiment.serialization import callable_reference, content_hash, decode, encode _CONTROL_FIELDS = ('model', 'reduction_method', 'reduction_interval', 'reduction_window...
e792e4d4b216d4802d498c00be1cca29553b70ec58d19b05e06e9d547f5b0af6
Python
10,598
328
# -*- coding: utf-8 -*- # # datalad_hirni documentation build configuration file, created by # sphinx-quickstart on Tue Oct 13 08:41:19 2015. # # 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 file....
9013406e9881981fe62edaaae8996f3ab72da57ec1720300b19b111b60bd3c77
Python
10,622
241
import itertools import os import sys sys.path.append(os.path.join(sys.path[0], '../')) import numpy as np import argparse import time import logging import torch import torch.nn as nn import torch.optim as optim from sklearn.model_selection import RepeatedStratifiedKFold import torch.utils.data from sklearn import pr...
6f59ecae8cc64133cc5604b939a4fa46b05034e4205790c392c69d1488bdeea7
Python
10,629
360
from __future__ import absolute_import import pickle import sys from billiard.einfo import ExceptionInfo from time import time from celery.datastructures import ( LimitedSet, AttributeDict, DictAttribute, ConfigurationView, DependencyGraph, ) from celery.five import items from celery.tests.case ...
f4eba8fcfeddaf98242a840438c8f83d3c786b159af14e4b358ba604160ed3b0
Python
10,632
225
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography.hazmat._oid import ObjectIdentifier from cryptography.h...
53ca1ba7aa78e35503bee17a2b627f06488c23fc16afed508857aab0ba81b2fb
Python
10,645
297
from __future__ import division, print_function, absolute_import import numpy as np from dipy.testing import assert_true, assert_false from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_equal, assert_almost_equal) from dipy.tracking import metrics as tm from dip...
66ed223bc27151a8cdcdc39ca60a3f918a13a651d2e5e2350a0ba5052ca991a5
Python
10,664
346
from __future__ import absolute_import from celery.canvas import ( Signature, chain, group, chord, signature, xmap, xstarmap, chunks, _maybe_group, maybe_signature, ) from celery.result import EagerResult from celery.tests.case import AppCase, Mock SIG = Signature({'task': 'TA...
72ca12b9bebc5cc2f7c36194edf7cff19965504154f2d3b8ddbd768b00834e3c
Python
10,669
346
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
ca643da8b4140ee9871d7c59c0d5e30f1ca4e2ca7a794c9fd7e45640e6471ffb
Python
10,679
272
import io import json from decimal import Decimal from pathlib import Path import sys import numpy as np import pandas as pd sys.path.insert(0, str(Path(__file__).resolve().parents[1])) sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "boris")) from boris import config as cfg from boris import plugins ...
d9834834d8e00c89e910a9616212d4e100a633aeebba37e208e23189c3f4663f
Python
10,686
220
from collections import defaultdict import pickle import numpy as np from scipy.stats import linregress import pandas as pd from tqdm import tqdm from scipy.stats import spearmanr from sklearn.metrics import confusion_matrix, cohen_kappa_score, roc_auc_score from sklearn.calibration import calibration_curve from step2_...
f561f577605065404ba85aec7dd156755e4df0247fb672d7eba5da392875bdc5
Python
10,687
271
import sys import numpy as np from scipy.interpolate import interp1d from scipy.stats import linregress, spearmanr import pandas as pd from tqdm import tqdm from sklearn.metrics import confusion_matrix, cohen_kappa_score, roc_auc_score, roc_curve from sklearn.calibration import calibration_curve import matplotlib.pyplo...
c00b409f8d3c2bf6d37dfc0780f2a02c2ca5da45d21366ea46ffa1d34d473002
Python
10,711
368
# # Module providing the `Process` class which emulates `threading.Thread` # # multiprocessing/process.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import # # Imports # import os import sys import signal import itertools import binascii i...
d4d4c391eae4a3bb8e881d70ca9d1ccf1f3818c1e0caa5cffda232d83830dd20
Python
10,757
262
"Database cache backend." import base64 import pickle from datetime import datetime from django.conf import settings from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.db import DatabaseError, connections, models, router, transaction from django.utils import timezone from django.utils.i...
30267c1926d1604ffc7eef4a4db65dd2f3bf6ea6d06db08dab860ecde1ae0984
Python
10,782
329
"""Abstract base classes related to import.""" from . import _bootstrap from . import _bootstrap_external from . import machinery try: import _frozen_importlib except ImportError as exc: if exc.name != '_frozen_importlib': raise _frozen_importlib = None try: import _frozen_importlib_external exc...
6553163641b93ef84f8e449a2bf7848f8378f0a4b258e4da14a6d8bfe383bf1c
Python
10,785
318
"""Tests for worker-aware seed functionality in Compose.""" import multiprocessing import sys import numpy as np import pytest import albumentations as A class MockWorkerInfo: """Mock torch.utils.data.get_worker_info() response.""" def __init__(self, id: int): self.id = id def test_worker_seed_wi...
6fccd9f767a15498dee926efb08e0cc27e4ea5426e8e1224e0c1489a6c0c96be
Python
10,789
395
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import six @six.add_metaclass(abc.ABCMeta) class CipherBack...
9171f42d72ec828ec52cd6a7e95e418a2752df4cd5916370696b9567e9fa5288
Python
10,814
280
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import Unsupp...
ac465f6b9e3cb5a32333c13262f32bff87162a493dd748200d1a4a3642eb7f45
Python
10,818
301
""" module for testing time budget analysis pytest -s -vv test_irr.py """ import pytest import sys import json import os import decimal from pathlib import Path sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) from boris import irr from boris import db_functions from boris import ...
bd70f577e425898b2b280260b088f464d1b52845c77280764f2d4910e587fd88
Python
10,818
373
# -*- coding: utf-8 -*- """ celery.local ~~~~~~~~~~~~ This module contains critical utilities that needs to be loaded as soon as possible, and that shall not load any third party modules. Parts of this module is Copyright by Werkzeug Team. """ from __future__ import absolute_import import im...
365da227bbca424e04bf012a4ffc27698b06a9b54ad6161a0372567b62603f5c
Python
10,831
236
from pathlib import Path import radiomics from radiomics import featureextractor import csv import json import SimpleITK as sitk import numpy as np import h5py import logging import sys import reliableradiomics.metrics.statistics as stats logger = logging.getLogger(__name__) def get_major_idxs(lesion_idxs, lesion...
4f2a9fd152717fd2da186add8b9e6f69619992fee33e11f1aed1eb95615309e8
Python
10,835
295
""" BORIS Behavioral Observation Research Interactive Software Copyright 2012-2026 Olivier Friard This file is part of BORIS. BORIS 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 of the L...
ca57862d76b4a0b918ac7e10805577779ce0ce0982a54d83222dc9fd38760e64
Python
10,849
346
import re from django.contrib.gis.db.models.fields import BaseSpatialField from django.db.models.expressions import Expression from django.db.models.lookups import Lookup, Transform from django.db.models.sql.query import Query class RasterBandTransform(Transform): def as_sql(self, compiler, connection): ...
1df941a5a20c6deb4026dd1f74f773f17ef9fe3d9cbaf4112679512164b07846
Python
10,854
250
############################################################################### # _MNE.py provides additional parameters for EEG classes that uses mne library # It is highly inspired by mne-bids tool, all credits goes there # https://github.com/mne-tools/mne-bids ########################################################...
715690e79824419a812668272eb4605b5b3056b0ff4a105ac5447474c17ac5f7
Python
10,858
264
import os import theano import theano.tensor as T import numpy as np from theano_ops.activations import sigmoid from theano_ops.optimizers import Adam from theano_ops.utils import BatchFactory class DNM(object): def __init__(self, input_image_size, latent_size, ...
6c85f65b08d82802967adbebf12036211293eaec7702449310a962c53e94ce05
Python
10,863
464
""" Operator Interface This module exports a set of functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. The function names are those used for special methods; variants without leading and trailing '__' are also provided for convenience. ...
c89c149b3b76fe889eb04b7bfdff227f12b3e8ac2496e1f23a3fc5069f9a49c1
Python
10,883
288
"""Utility code for constructing importers, etc.""" from . import abc from ._bootstrap import module_from_spec from ._bootstrap import _resolve_name from ._bootstrap import spec_from_loader from ._bootstrap import _find_spec from ._bootstrap_external import MAGIC_NUMBER from ._bootstrap_external import cache_from_sourc...
37a4add86b77f5bc120fa6dcb054b085da8898619a646325fd27fbde8d436d07
Python
10,887
352
############################################################################### # BidsSession.py defines class that conserves information on current processed # subject and session ############################################################################### # Copyright (c) 2019-2020, University of Liège # Author: Ni...
8d294b0a04de1aaf9504339c232bb621b34576b3738cd8ab815aa61885682e43
Python
10,892
263
#!/usr/bin/env python2 desc="""Report embl for gtf file. Note: require Biopython 1.62+ """ epilog="""Author: l.p.pryszcz+git@gmail.com Barcelona, 14/06/2013 """ import argparse, gzip, os, resource, sys from datetime import datetime from Bio import SeqIO from Bio.Alphabet import IUPAC from Bio.SeqFeature impo...
136397bf856245b0e1f339102dead0c0e78c7cd90f9a9bb51e6c6599249c25bb
Python
10,894
286
# -*- coding: utf-8 -*- """ "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ from __future__ import absolute_import import sys import traceback import weakref __all__ = ['safe_ref'] PY3 = sys....
2d5c53fa63bc2eae6ab01f2d5090b474b3d82fae053a987c76f16f1b85bb8c99
Python
10,899
426
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function def cryptography_has_ec2m(): return [ "EC_POINT_set_affine_c...