sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a84bbdb4f4aa4a2b7ee4be8cb8e258d4416eb458a6f095462fd6e479df6e485c
Python
6,849
220
# -*- coding: utf-8 -*- """ celery.task.http ~~~~~~~~~~~~~~~~ Webhook task implementation. """ from __future__ import absolute_import import anyjson import sys try: from urllib.parse import parse_qsl, urlencode, urlparse # Py3 except ImportError: # pragma: no cover from urllib import urlencod...
cb001619425b483a5c2a9bcb81d766bb68f83759ef2d678cb5a24876567c4f24
Python
6,852
262
"""Exceptions used by amqp""" # Copyright (C) 2007-2008 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 o...
2f9cbd68e368b70f3ba9efaffd778dc1c902f4098eea129b8142fc8d4aaa5e8b
Python
6,863
194
""" 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...
850b8b6189316d338be9fc387a898afd1a29d14d09599225963070b698ff8deb
Python
6,870
237
# # The Python Imaging Library # $Id$ # # simple postscript graphics interface # # History: # 1996-04-20 fl Created # 1999-01-10 fl Added gsave/grestore to image method # 2005-05-04 fl Fixed floating point issue in image (from Eric Etheridge) # # Copyright (c) 1997-2005 by Secret Labs AB. All rights reserved. # ...
e86a16a72d94400a975c523b33b2da14da69e1c744bc8ebf0858510555d22bb3
Python
6,870
221
""" version info, help messages, tracing configuration. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys from argparse import Action import py import pytest from _pytest.config import PrintHelp class HelpAction(Action): """Th...
bb32bbaa97b406da8792054b4ab346b6c91ad70dc949437fb99a7a5c00392cc6
Python
6,891
254
# 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 from cryptography import utils @six.add_metacla...
8ea2b772c6c4742123ed7c11ba66c64c4676a0be052ead7154d3876a4cd5e13e
Python
6,893
167
# -*- coding: utf-8 -*- """ Created on Wed Apr 7 14:28:48 2021 @author: hqin Description: This script main used to extract the intersect sites with one liminted depth(eg: totalRN>=10) in all reps, in order to used varify the accuracy of our LSTM models among reps with the same sites with same depth....
8af43737522956f82efa6f0130313b0966b64aaff712c9a5f81076038699428b
Python
6,900
198
from itertools import chain from collections import namedtuple from . import kollekshuns as clc import pandas as pd class Node(object): ''' Base class for objects that represent a single object in the BIDS hierarchy. Args: id (int, str): A value uniquely identifying this node. Typically the ...
249e54fddb2b009c5705eaf5c7fe44ba0edd322fd5f477827b62f0e616aa2f66
Python
6,926
183
""" A class which will be inherited by anything that requires the functionality to be converted to bids data. This class shouldn't ever be instantiated directly, only to be used as a base class or tested for with `issubclass`. """ from tkinter import StringVar, ACTIVE, DISABLED from Biscuit.Management import OptionsV...
eb8bd54289b8fcfe0c3081e2cf7f2a2c24c7a595eee5516df2496cbd91f059bb
Python
6,930
175
""" BORIS plugin Inter Rater Reliability (IRR) Unweighted Cohen's Kappa - Supports behaviors with duration (start < stop) AND instantaneous events (start == stop) - COHERENT with "with modifiers" logic: * elementary intervals are built from segment boundaries ONLY * interval coding uses segments ONLY (events are N...
a6b98e9f44e46202385e5245cfd757eee1594cc6aada8dbae673ffc7eb4e80eb
Python
6,946
156
import os, cv2 import numpy as np import scipy import scipy.misc import openslide from PIL import ImageFilter, Image import matplotlib.pyplot as plt from skimage.transform import PiecewiseAffineTransform, warp from skimage.color import rgb2hsv,hsv2rgb,rgb2lab,lab2rgb from skimage import exposure def save_ws...
687e46ba8350cdcc30358e410b81f0c7a438c19df27e3dd4229565a13b6b309f
Python
6,948
224
''' Transformations that primarily involve numerical computation on variables. ''' import numpy as np import pandas as pd from bids.utils import listify from .base import Transformation from bids.analysis import hrf from bids.variables import SparseRunVariable, DenseRunVariable class Convolve(Transformation): "...
344686243ca2182b8afa0ba4cb5f4e6e5a5c325ed95f12439022a552b11e4476
Python
6,953
185
#!/usr/bin/env python2 desc="""Report SNPs from amplicons. CHANGELOG: v1.1 """ epilog="""Author: l.p.pryszcz+git@gmail.com Bratislava, 17/09/2015 """ import argparse, os, re, sys from datetime import datetime import subprocess import numpy as np #find stats of the reads in mpileup ##http://samtools.sourceforge.ne...
6b7b3454466cddbd911eb7b0aeee64f1781561dda8499abdaa3a2f5f7da5035d
Python
6,956
238
""" widget to edit duration > 24 h or < 0 https://stackoverflow.com/questions/44380202/creating-a-custom-widget-in-PySide6 """ from decimal import Decimal as dec from PySide6.QtWidgets import ( QWidget, QHBoxLayout, QPushButton, QSpinBox, QLabel, QSpacerItem, QSizePolicy, QDoubleSpin...
3b261d0a2efe039f2d7f2f09409dedd48a05e707f1aa716c7d391c165c862e43
Python
6,959
228
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Collection of different utility functions @author: jdiedrichsen """ import numpy as np from numpy import sum,mean,trace,sqrt, zeros, ones from PcmPy.matrix import indicator, pairwise_contrast from scipy.linalg import solve, pinv from scipy.spatial import procrustes f...
96a4ea6793977f9a6687e418ae54daee01e6b38f3379622ce26787bfa4b6b930
Python
6,959
228
# -*- coding: utf-8 -*- """ babel.localedata ~~~~~~~~~~~~~~~~ Low-level locale data access. :note: The `Locale` class, which uses this module under the hood, provides a more convenient interface for accessing the locale data. :copyright: (c) 2013-2018 by the Babel Team. :license: B...
b5867724c290cebb2b071f34d35ee3cfdf14470495dcc409fa197846b8e49642
Python
6,959
186
#!/usr/bin/env python2 ### # UNFINISHED!!! # ### from Bio import SeqIO from Bio.Seq import Seq from Bio.Alphabet import IUPAC import os, sys from datetime import datetime from optparse import OptionParser def _get_fasta_dict( fPath ): """Return dictionary of entries from fasta file""" fasta_dict = {} for r in S...
94bd7705895a132c4336408908f9c5664d777b245bf693a438eac074fd7a42dc
Python
6,970
178
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
096a58a9973283a5cb5932f55c48aaeb0c9f3f44cc5b0b8fbb1f8e0bd30f7a31
Python
6,997
158
import copy import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytest from matplotlib.colors import to_rgba import scikit_posthocs as sp @pytest.mark.parametrize("flat", [False, True]) @pytest.mark.parametrize("labels", [False, True]) @pytest.mark.parametrize("input_type", ["array", "data...
d89499e76c25166af8fc9938f7d5b975477bc0e0c91f0f44add96d82cff6e0bc
Python
7,006
177
''' Contains helper functions that involve writing operations. ''' import logging import os import re import sys from ..utils import splitext, listify from os.path import join, dirname, exists, islink, isabs, isdir __all__ = ['replace_entities', 'build_path', 'write_contents_to_file'] def replace_entities(entities...
8c72e35bee10c021246a0eeec219ef4dc141dfe81d6c5a489b475a97f4103bcc
Python
7,007
235
from __future__ import absolute_import from contextlib import contextmanager from celery import group from celery import canvas from celery import result from celery.exceptions import ChordError, Retry from celery.five import range from celery.result import AsyncResult, GroupResult, EagerResult from celery.tests.case...
94e53fb03522ff29949d88e4982d5ba1a98451b80fd06ccafbec29b95eb1b02d
Python
7,007
206
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
0d08e8ce52da2c83780cd83903939a5f6bc1fa2df059e79719e2bb418a1fe5ba
Python
7,014
205
"""Generate the intrinsic dimension estimates for the epileptic recordings 1. Load data chunks 2. Compute Current Source Densities and measure dimensions 3. Save out results """ import numpy as np import os import matplotlib.pyplot as plt import sys sys.path.append("/home/phrenico/Projects/Codes/dimension-correction...
21c6e9a8f31568eb0bfbdbdab2406af07c7657bff4f42602e58f24ba86d7e77f
Python
7,022
251
from __future__ import absolute_import from functools import wraps from kombu.pidbox import Mailbox from celery.app import control from celery.exceptions import DuplicateNodenameWarning from celery.utils import uuid from celery.tests.case import AppCase class MockMailbox(Mailbox): sent = [] def _publish(s...
732be179f862dd6aec4fceebb94e4732f1810cc8d77935c2871bd87ca39bfff2
Python
7,031
206
from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * # http://maverick.inria.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html # http://www.lsv.ens-cachan.fr/~markey/bibla.php?lang=en class BibTeXEntry(dict): def __...
2f3ef3661320a803f2774697f77c98a3f344c4c5cbdaf8ddc55906efb321376f
Python
7,040
156
import unittest import os import logging import shutil import glob from bidsme.plugins.tools import General from bidsme.bidsMeta import BidsSession data_path = os.path.dirname(__file__) data_path = os.path.join(data_path, "data", "plugins", "curation") class TestCuration(unittest.TestCase): @classmethod de...
049e384daf63d01b0eda1fd2986185d740d308d5cde81a44723c926ff942ccb4
Python
7,075
221
#!/usr/bin/env python2 desc="""Report distance matrix between proteins. Dependencies: - Biopython, numpy & scipy """ epilog="""Author: l.p.pryszcz+git@gmail.com Bratislava, 28/04/2016 """ import os, sys, gzip import numpy as np from datetime import datetime from Bio import SeqIO from multiprocessing import Pool from...
a7c274fffb085c999f51b54ef76689d57caa99df184cbb60a9d42812776eaadc
Python
7,076
166
############################################################################### ## Vision Research Laboratory and ## ## Center for Multimodal Big Data Science and Healthcare ## ## University of California at Santa Barbara ## ...
5ae02bbb1d4eda97825a3b7299e5d6cd7bb77bbebbb3f6ecb0312a53a13994c8
Python
7,086
154
"""Match inherited quality debt to exact source evidence without admitting new findings.""" from __future__ import annotations import ast import hashlib import json import re import subprocess from collections import Counter from pathlib import Path from _common import REPO_ROOT, comparison_ref, fail_setup BASELINE ...
8e23f3f86611688fc47c6939f4b1b41a351c87c37470eac79f54c3aa8c4cd384
Python
7,090
246
'''Script generating Figure0.pdf - presents the FSA estimator - example estimates on: - hypercube data - coupled logistic maps ''' import numpy as np import matplotlib.pyplot as plt # ^^^ pyforest auto-imports - don't write above this line import pyforest from cmfsapy.dimension...
20969a7a72e01fe4935a9fe67fad440b08fd2cfa49957079de26f11d6c9f3de5
Python
7,101
218
# Tests for FORECAST fitting and metrics import numpy as np from dipy.data import get_sphere, get_3shell_gtab from dipy.reconst.forecast import ForecastModel from dipy.sims.voxel import MultiTensor from numpy.testing import (assert_almost_equal, assert_equal, run...
ac8ed6ee6f24221e6b6ab1dd0354534136d1b24382d7bc4693e992ee2e777055
Python
7,115
201
############################################################################### # bidsmeNIFTI.py provides an implementation of PET class for Nifti file format # with dumped header in form of json file ############################################################################### # Copyright (c) 2019-2020, University o...
0e1e7056d6a10236343ac4a757c51264da308c2617970625c35383de206332cf
Python
7,117
218
""" 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...
919b3bc94dd593bd392be3faa9a3839cf48fe60825329b56c40350b4818d4843
Python
7,120
197
# 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 collections import threading import types import warnings import ...
6c907defc112dfc22e436f4776f121f2148413dc6c25578f0b04eb605d2eaece
Python
7,130
200
############################################################################### # bidsmeNIFTI.py provides an implementation of MRI class for Nifti file format # with dumped header in form of json file ############################################################################### # Copyright (c) 2019-2020, University o...
8547b930f55e581fb6d5a928ebfc95188ec604d0a744e9244b9df3cbca123bea
Python
7,144
235
# 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 from cryptography import utils from cryptography....
b373e390c615dfc7f8972a8a10e49f22292ff77c82ef584370e5289176463fb5
Python
7,152
190
import os, subprocess import argparse import logging def write_header(cluster=None): if cluster == 'supercloud': header = """#!/bin/bash #SBATCH -p normal #SBATCH -J uvvis_pred #SBATCH -o uvvis_pred-%j.out #SBATCH -t 1:00:00 #SBATCH -n 1 #SBATCH -N 1 #SBATCH --mem=10gb #SBATCH --gres=gpu:volta:1 echo "Dat...
d4669a270efb4d28ec948dc1fe2625791accf843c10c236cb6671a842f0447b5
Python
7,152
249
# -*- coding: utf-8 -*- """ celery.contrib.batches ====================== Experimental task class that buffers messages and processes them as a list. .. warning:: For this to work you have to set :setting:`CELERYD_PREFETCH_MULTIPLIER` to zero, or some value where the final multiplied value is higher than...
04f3bfd03bb648c1a17e0a91a8ce37e89a5e4734fbff99c40d346e817bd376f6
Python
7,157
252
import numpy as np # import scipy.stats as stats from dipy.sims.voxel import SingleTensor, diffusion_evals import dipy.sims.voxel as vox from dipy.core.geometry import vec2vec_rotmat from dipy.data import get_fnames from dipy.core.gradients import gradient_table def add_noise(vol, snr=1.0, S0=None, noise_type='ricia...
997477eb321b94281f5e0e4d2511169cccc8c44f083aad38795981c513514e1e
Python
7,178
184
#!/usr/bin/env python2 desc="""Identify SNP sites in mpileup out from BAM alignments. CHANGELOG: + 1.1: - mpileup options added """ epilog="""Author: l.p.pryszcz+git@gmail.com Barcelona, 28/06/2012 """ import argparse, os, re, sys from datetime import datetime import subprocess #find stats of the reads in mpileup...
7423b8a9edd383eb6d229bb9d92e8caf7474159f7cee24fe1e37a856219defe6
Python
7,180
192
import os, subprocess import argparse import logging def write_header(cluster=None): if cluster == 'supercloud': header = """#!/bin/bash #SBATCH -p normal #SBATCH -J uvvis_pred #SBATCH -o uvvis_pred-%j.out #SBATCH -t 1:00:00 #SBATCH -n 1 #SBATCH -N 1 #SBATCH --mem=10gb #SBATCH --gres=gpu:volta:1 echo "Dat...
34b5bb98caed51cc14a98940877664ff7ef5990787421e3fcb0c4a5f09d30345
Python
7,197
171
from tkinter import StringVar, BooleanVar from tkinter import Entry as tkEntry from tkinter.ttk import Frame, Label, Checkbutton from Biscuit.FileTypes import con_file from Biscuit.CustomWidgets import WidgetTable class ChannelInfoFrame(Frame): def __init__(self, master, default_settings, *args, **kwargs): ...
73310fda64e296fe90988eb5165a3b763f8030c33e6b46ec3117356d5ee507b4
Python
7,198
189
from __future__ import annotations import logging from collections.abc import Sequence from typing import Any, Literal, cast import numpy as np import pandas as pd logger = logging.getLogger(__name__) _FRAMEWORK_LOG_COLUMNS = frozenset({ 'id', '_id', '_round_index', '_trial_id', '_param_hash', 'start', 'end', ...
5df7c7c0913c844e460729cb2fae266c676c8ea2ee207cd48136af45ae2e2e59
Python
7,203
197
#!/usr/bin/env python import os from os.path import join from dipy.utils.optpkg import optional_package import numpy.testing as npt from numpy.testing import run_module_suite, assert_raises import nibabel as nib from nibabel.tmpdirs import TemporaryDirectory from dipy.io.streamline import save_trk import numpy as np f...
0398c1c125713fd186dc661346ba348875499d37f9f9e61137a3afca6e8acd3f
Python
7,204
158
"""Verified, bounded transports for explicitly selected remote entropy services.""" import json import math import os import re import ssl import time from collections.abc import Iterator from pathlib import Path from typing import cast from urllib.request import HTTPRedirectHandler, HTTPSHandler, Request, build_opene...
2636d8baef468f556411f8ca46e483bfb39c75324f7448924ae875991364060f
Python
7,206
257
# -*- coding: utf-8 -*- """ babel.messages.plurals ~~~~~~~~~~~~~~~~~~~~~~ Plural form definitions. :copyright: (c) 2013-2018 by the Babel Team. :license: BSD, see LICENSE for more details. """ from babel.core import default_locale, Locale from operator import itemgetter # XXX: remove this file,...
95de71c877894ebdad725bfa77ea0f3933472d3159194e70ae02572c13c704b6
Python
7,206
198
# This script mainly builds a class to train the deep neuron network and obtain the optimized solution based on the DNN. import time import numpy as np import scipy.io as scio import torch import torch.nn as nn from torch.utils.data import DataLoader from ba import ba class mlopt(): def __init__(self, filename...
707e9b06b5b2938d9ca29bc27cf20b621a5391d9e0c40d5df2fd52ed1f6897e6
Python
7,217
228
# # The Python Imaging Library. # $Id$ # # a Windows DIB display interface # # History: # 1996-05-20 fl Created # 1996-09-20 fl Fixed subregion exposure # 1997-09-21 fl Added draw primitive (for tzPrint) # 2003-05-21 fl Added experimental Window/ImageWindow classes # 2003-09-05 fl Added fromstring/tostring me...
50be2a78561ae6a502d04ee825199c8b62610e9e73eddfce3cdb099e4c3e07a3
Python
7,219
196
# -* coding: utf-8 -*- """ celery.backends.cassandra ~~~~~~~~~~~~~~~~~~~~~~~~~ Apache Cassandra result store backend. """ from __future__ import absolute_import try: # pragma: no cover import pycassa from thrift import Thrift C = pycassa.cassandra.ttypes except ImportError: # pragma: no cov...
a6c50eeac17094cc5c4fccbc9a9d4e0e986dfc245704953ca737b5c609707881
Python
7,223
172
from tkinter import Toplevel, StringVar, WORD, IntVar, END, Entry from tkinter.ttk import Frame, Label, Button from tkinter.scrolledtext import ScrolledText from Biscuit.CustomWidgets import DateEntry, WidgetTable from Biscuit.CustomWidgets.InfoEntries import InfoEntry, ValidatedEntry class ProjectSettingsWindow(Topl...
a327df292580d3f2263d565b74892f813ed087ff60bae49f5e8b952f7043f70d
Python
7,232
193
#!/usr/bin/env python2 desc="""Report exact repeats in chromosomes. Apply distance criteria as a function of repeat length: #f(x) = 133.7480609953 * EXP( 0.2011797391 * x ) f(x) = 2x**2.0 you may optimise this! there is a hard limit of Require MUMMER3 (repeat-match): -f only forward (ff) matches otherwise ff an...
84d6c555e93c306b216df1af1e69a4acbe12ba1b218b8dddbfd348af721bcf83
Python
7,235
185
""" BORIS plugin Inter Rater Reliability (IRR) Unweighted Cohen's Kappa with modifiers - Supports behaviors with duration (start < stop) AND instantaneous events (start == stop) - Aggregated warning when kappa is NaN to avoid multiple popups """ import math import pandas as pd from PySide6.QtWidgets import QInputDia...
3d9d4c0ab69510e75dbb17ba87290accc213bc74f4d87dc093be84c29c7e3110
Python
7,237
189
"""Module containing PyTorch-specific transforms for Albumentations. This module provides transforms that convert NumPy arrays to PyTorch tensors in the appropriate format. It handles both 2D image data and 3D volumetric data, ensuring that the tensor dimensions are correctly arranged according to PyTorch's expected f...
29eaed7680117d92a683e29f538454c93e679bfb87bfa38c7926c806472c6649
Python
7,239
188
#!/usr/bin/env python2 desc="""Generate plot of raw counts from BED files. First generate cov.bed files is: for f in *.bam; do if [ ! -s $f.gff.bed ]; then echo `date` $f; bedtools coverage -abam $f -b yeast_chromosomes.gff > $f.gff.bed; fi; done Note: outname has to finish with one of the following: png, pdf, ps, e...
bb0f08c4944ba73d9c0d17f4b71b0383bb4679603edafaa1e03a9edb330e4b8e
Python
7,253
180
from __future__ import division, print_function import numpy as np import nibabel as nib from numpy.testing import (assert_almost_equal, assert_equal, assert_, assert_array_almost_equal) from dipy.denoise.noise_estimate import _inv_nchi_cdf, piesno, estimate_sigma from dipy.denoise.noise_es...
5926feb505861d454e9346966b05ddec953279cb170d2501538950c9a3ad8459
Python
7,257
196
import numpy as np import pytest import random from albucore import get_num_channels from PIL import Image, ImageFont import albumentations.augmentations.text.functional as ftext @pytest.mark.parametrize( "sentence, num_words, expected_length", [ ("The quick brown fox jumps over the lazy dog", 0, 9),...
8c6e296b865b9929f008a971441262e9004ee600ceeb3a38bf90680e419e7ab5
Python
7,261
166
"""Implementation of grid-based dropout augmentation. This module provides GridDropout, which creates a regular grid over the image and drops out rectangular regions according to the specified grid pattern. Unlike random dropout methods, grid dropout enforces a structured pattern of occlusions that can help models lea...
c2182d81e67289c4e3b4e7688aa6189c8b89fdc3a8938ce61fa06af2f04fbfe0
Python
7,291
186
import os import os.path as op import numpy as np import numpy.testing as npt import numpy.testing.decorators as dec import scipy.sparse as sps import scipy.linalg as la import nibabel as nib import dipy.tracking.life as life import dipy.tracking.eudx as edx import dipy.core.sphere as dps import dipy.core.gradients ...
bec7d96add684f028010f326fdc8ef804e77d079d064a602420c9c3713aa9867
Python
7,299
200
import os import numpy as np from dipy.data import get_fnames, get_sphere from dipy.core.gradients import gradient_table from dipy.reconst.gqi import GeneralizedQSamplingModel from dipy.reconst.dti import TensorModel, quantize_evecs from dipy.tracking import utils from dipy.tracking.eudx import EuDX from dipy.tracking...
c7db780a95ac228fac4fbc54ae5e7f170d57cb5cbc425d43099cc174d34e457e
Python
7,299
213
# -*- coding: utf-8 -*- """ babel.messages.mofile ~~~~~~~~~~~~~~~~~~~~~ Writing of files in the ``gettext`` MO (machine object) format. :copyright: (c) 2013-2018 by the Babel Team. :license: BSD, see LICENSE for more details. """ import array import struct from babel.messages.catalog import Cata...
78efa2574f2aa3aceb36e3e26ed6f986b432072ab6d150e4d298d648b6135c51
Python
7,301
184
from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.test import modify_settings from django.test.selenium import SeleniumTestCase from django.utils.deprecation import MiddlewareMixin from django.utils.translation import gettext as _ class CSPMiddleware(MiddlewareMixin): """The admi...
174d5930769e7e0b2f31e4ad8454046b5833feaef9e772cc6bf22a3aaf2d0fbc
Python
7,305
189
# 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.x509 import certificate_transparency from cryptography....
808d4f76ac6ccc62ffeef23a02c7e819caa2772a582dfea43e251bebf0adfb65
Python
7,305
189
"Memcached cache backend" import pickle import re import time from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils.functional import cached_property class BaseMemcachedCache(BaseCache): def __init__(self, server, params, library, value_not_found_exception): super().__...
97475de52e29a93dd186d6caf78613c3253a4ae4907b0cd5fe84ccd911ae174a
Python
7,313
154
import os import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.model_selection import GroupShuffleSplit from sklearn.preprocessing import StandardScaler from scaffold_splits import scaffold_split def data_split_and_write(X, feature_names=None, target_names=['peakwavs...
d676b44dcbe95bf6e8cb4955fdaf200ee1f9016af5541687034634c0b9b1d9f1
Python
7,332
239
""" 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...
4986294b4c7ab88ec446b6d715e92d15d744c758fd52b7c008b2f964eaf623e9
Python
7,342
165
import numpy as np import math from sklearn.metrics import roc_auc_score, precision_recall_curve def model_evaluate(yt, yp): precision, recall, _, = precision_recall_curve(yt, yp) aupr = -np.trapz(precision, recall) auc = roc_auc_score(yt, yp) # ---f1,acc,recall, specificity, precision r...
5b6dee437876ac121335ecb6b5da97dfb794d5437f7bd0a68f843a0e2bb4ec6d
Python
7,344
183
import os, cv2, random import numpy as np import scipy import scipy.misc import openslide import pandas as pd from PIL import ImageFilter, Image import matplotlib.pyplot as plt from skimage.transform import PiecewiseAffineTransform, warp from skimage.color import rgb2hsv,hsv2rgb,rgb2lab,lab2rgb from skimage i...
f4486e1783652d2d03489913439100dbfd4dde41075dfac67f71898f5aab922c
Python
7,356
220
"""Transforms for spectrogram augmentation. This module provides transforms specifically designed for augmenting spectrograms in audio processing tasks. Includes time reversal, time masking, and frequency masking transforms commonly used in audio machine learning applications. """ from __future__ import annotations ...
f974310aef122e35c0c80394606789f2865810ee1609fefdeb3f26340ededef1
Python
7,365
195
from tensorflow.keras.layers import AveragePooling2D, MaxPool2D, Dropout, Flatten, Dense, Input from tensorflow.keras.layers import ConvLSTM2D, BatchNormalization, Conv3D from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.applications import ResNet50 from tensorflow.keras.opti...
34515cf1d31ef2c348d149ba8f25a62749fc368bf8f00ac0d9b41020b1f5bb04
Python
7,367
190
#----------------------------------------------------------------------- #Copyright 2019 Centrum Wiskunde & Informatica, Amsterdam # #Author: Daniel M. Pelt #Contact: D.M.Pelt@cwi.nl #Website: http://dmpelt.github.io/foam_ct_phantom/ #License: MIT # #This file is part of foam_ct_phantom, a Python package for generating...
7cdd4ef45213215b31d59e8bb750ff1d798483d5fefcfebff5fbe1960d6319f7
Python
7,381
160
import csv from io import StringIO from unittest.mock import patch from django.contrib.auth.models import Group from django.test import TestCase from custom_user.tests_helper import create_user from experiment.models import ScheduleOfSending, Component from experiment.portal import send_experiment_to_portal, \ se...
41924876da053df24d41c77f77161b2b855eeb4af8c39b3870e02406ac98296f
Python
7,383
303
# # The Python Imaging Library # $Id$ # # Adobe PSD 2.5/3.0 file handling # # History: # 1995-09-01 fl Created # 1997-01-03 fl Read most PSD images # 1997-01-18 fl Fixed P and CMYK support # 2001-10-21 fl Added seek/tell support (for layers) # # Copyright (c) 1997-2001 by Secret Labs AB. # Copyright (c) 1995-20...
dc7a7843d252ce2b9a89ed9cd0a2c7f99ed11ecdedd0c81b89cb239cb2315769
Python
7,413
214
import copy from itertools import chain from django import forms from django.contrib.postgres.validators import ( ArrayMaxLengthValidator, ArrayMinLengthValidator, ) from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from ..utils import prefix_validation_erro...
e8503d2583dc09f34d5ed0c1b8adcfc488bc235165ea34a9f1f2d07c93b0996b
Python
7,418
211
############################################################################### # BIDSme is a toolkit for bidsification of multy-modal neural imagery dataset ############################################################################### # Copyright (c) 2019-2020, University of Liège # Author: Nikita Beliy # Owner: Lie...
7ae15ab859cb62188b50b292537a134fb3d513fde82838cbf75ab59a11434539
Python
7,419
193
from tkinter.ttk import Label, Combobox, Button, Frame from tkinter import StringVar, Entry, Text, Scrollbar, filedialog, messagebox from tkinter import END, FLAT, NORMAL, DISABLED, HORIZONTAL, NONE from webbrowser import open_new as open_hyperlink from bidshandler import Scan from Biscuit.utils.utils import str_to_o...
64e48866808ded1714b91317e2134c9706068f64949aca53f72e2988b705c5bc
Python
7,429
184
#!/usr/bin/env python2 desc="""Plot histogram """ epilog="""Author: l.p.pryszcz+git@gmail.com Barcelona, 29/11/2012 """ import argparse, os, sys, random from datetime import datetime import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np from scipy.stats import stats, wilcoxon, ranksums def grou...
d52ade42d60770253b48589388a459aeec9b34d9a8ba128651e29862a5e7ccb2
Python
7,439
208
#!/usr/bin/env python2 desc="""Report differentially expressed genes and their annotation. v1.1: - added expression for all controls, as this cause misunderstandings sometimes """ epilog="""AUTHOR: l.p.pryszcz+git@gmail.com Barcelona, 17/07/2012 """ import argparse, os, sys, urllib from datetime import datetime from...
24a6332d79a21909973d11d3e69ee0dc84a62c64209b5a2e9b3f90234000df51
Python
7,456
201
"""Prove a Surfaces glob means what the issue author reads it to mean. `fnmatch` does not treat `/` as a separator, so `governance/*` covered the whole subtree beneath it while rule 7 still reported PASS. The scope contract is the only thing standing between a slice and an unrelated file, so the interesting cases here...
9372af7314b9566d3b21656766aab4171f1c79507531db019581e82d8ae90f2b
Python
7,463
271
# # The Python Imaging Library # $Id$ # # a simple math add-on for the Python Imaging Library # # History: # 1999-02-15 fl Original PIL Plus release # 2005-05-05 fl Simplified and cleaned up for PIL 1.1.6 # 2005-09-12 fl Fixed int() and float() for Python 2.4.1 # # Copyright (c) 1999-2005 by Secret Labs AB # Copy...
07a946ad3c5b288cc8eeff05a370c4b5f720dcde9c6ee3b905e3edb8ea1d25f2
Python
7,469
201
""" Settings and configuration for Django. Read values from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global_settings.py for a list of all possible variables. """ import importlib import os import time import warnings from pathlib impor...
252b38d59b0c71f7f39bafde0fcdad0bfda5a0d098540f2c89e87b0aacaf9ecb
Python
7,501
182
from tkinter import Toplevel, IntVar, StringVar, BooleanVar from tkinter.ttk import Frame, Label, Button, Progressbar, Checkbutton import os import os.path as op from bidshandler import BIDSTree from Biscuit.Management import RangeVar, ToolTipManager from Biscuit.utils.utils import get_fsize, threaded from Biscuit.ut...
800a7219e8f71e694084e3f68f1a86f3428347424ce9ca2b466939c49383c0af
Python
7,509
175
# -*- coding: utf-8 -*- # @Author: liangou # @Date: 2020-12-14 15:44:53 # @Last Modified by: liangou # @Last Modified time: 2020-12-16 23:01:42 #import modules from __future__ import unicode_literals, absolute_import from builtins import map import sys import argparse import pandas as pd import numpy as np from tom...
a4656c7d8e39982b8480eef6027381c588abd59403217159e119e97b6e1abe1b
Python
7,538
139
"""Checks added in v0.1.1 after an external review of v0.1.0. They are exploratory and leave the frozen protocol, code, run and verdicts unchanged. A. Readout rank. Symmetry under field reversal makes every neuron an even function of the field direction, so the population factors through RP². The population is RP² ...
2a29035dcd162b155fd4591fada98144fa1b1a16a569a24ac6939eae26084832
Python
7,543
176
""" 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 ...
4846090bbba920fe2181d0c7b4ec1156138ab3e835d1908eefa7f2b9c955cb0f
Python
7,544
244
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Python source expertise for coverage.py""" import os.path import types import zipimport from coverage import env, files from coverage.misc import contract, exp...
0dc525a3c15c6f4c97a1aeb50d80b7dfb9afe226fa42630d24546f34bea3926a
Python
7,545
243
from typing import Any import warnings import numpy as np import pytest from PIL import Image, ImageFilter import cv2 import albumentations as A from albumentations.augmentations.blur import functional as fblur from albumentations.core.transforms_interface import BasicTransform from tests.conftest import UINT8_IMAG...
8639ddf300a426abeb2aafcd81c2aa169b7a6cbf01fb72f640b565bd9b045125
Python
7,549
214
""" Descriptor support for NIPY. Copyright (c) 2006-2011, NIPY Developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright no...
aaf4953d505708a9a2467798f370b56f964e3f909739f855f95f215dda418ea9
Python
7,550
212
############################################################################### # bidsmeNIFTI.py provides an implementation of PET class for Nifti file format # with dumped header in form of json file ############################################################################### # Copyright (c) 2019-2020, University o...
7017a3730938bb477cea027af5649e2da46be8e77d4cddcd115469fb52998769
Python
7,553
184
# -*- coding: utf8 -*- """ Analyse pure BC network with Poisson input (based on PC rate) -> This is supposed to show that a pure BC network with sufficient external drive can oscillate on ripple frequnecy (see also Schlingloff et al. 2014) author: András Ecker, last update: 03.2022 """ import os, pickle from tqdm impo...
fed952dd469e1e592fbae82aee411e140119f839050c0cac150a5c8821a22930
Python
7,556
199
""" Asset downloads (model files, training sets, and demonstration movies). We provide our trained models, training sets, and evaluation movies in `this google drive folder <https://drive.google.com/drive/folders/1nTRVo0rPP9CR9F6WUunVXSXrLNMT_zCP?usp=sharing>`_. We refer to these data files as "assets". You can of co...
4ccff400d6b4cf98c46445d602a164cdb02fab3eb2231095be42423fe48c7d32
Python
7,562
199
#!/usr/bin/env python2 desc="""Generate chromosome graphs for given genome. http://biopython.org/DIST/docs/tutorial/Tutorial.html#sec343 """ epilog="""Author: l.p.pryszcz+git@gmail.com Barcelona, 13/05/2014 """ import argparse, os, sys from datetime import datetime from reportlab.lib import colors #from genome_anno...
a33044b198ef1901963994cdf15ba90cc54bd7d9872d7332599a44495833582d
Python
7,565
252
import datetime import json from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range from django.contrib.postgres import forms, lookups from django.db import models from .utils import AttributeSetter __all__ = [ 'RangeField', 'IntegerRangeField', 'BigIntegerRangeField', 'FloatRangeField',...
2374662e303b7f46d0f2616b4a92cd1fdb3e8fd1a0d2c069b59c7bc06f57deba
Python
7,580
247
# -*- coding: utf-8 -*- """ celery.worker.components ~~~~~~~~~~~~~~~~~~~~~~~~ Default worker bootsteps. """ from __future__ import absolute_import import atexit import warnings from kombu.async import Hub as _Hub, get_event_loop, set_event_loop from kombu.async.semaphore import DummyLock, LaxBoundedSema...
b1d48f58f018614ba262e4b347d1e2d2882588d4ca238ad37dd7512634cea44d
Python
7,591
140
"""Select real Iris model results without losing objective or trial identity.""" import numpy as np import polars as pl import pytest from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_score, log_loss from sklearn.model_selection import train_...
e49f19fe7b6838a4ef7f21ff053659f2edd7ce22291d03d781d6693428b2e6d4
Python
7,593
225
from unittest.mock import Mock import pytest from boris import config as cfg from boris import connections class Signal: def __init__(self): self.callbacks = [] def connect(self, callback): self.callbacks.append(callback) def emit(self, *args): for callback in self.callbacks: ...
6eb725dbc2a5b314dde4f46e677169501364a4735a9cf6df5b71e59a962f7c4e
Python
7,602
219
import os import pickle import numpy as np import matplotlib.pyplot as plt import pandas as pd # from sympy.plotting import plot_implicit from constants import * import matplotlib.colors as mcolors import bz2 def plot_grid(grid, ax, is_colbar=False, cm_range=None, cm='inferno', cb_txt=''): ylabels = ['Gr-{}'.f...
27b1161ac86c45e353e17c7451365df2c5442f7844f2880c52ff69a1f5415d24
Python
7,604
222
""" Caffe network visualization: draw the NetParameter protobuffer. .. note:: This requires pydot>=1.0.2, which is not included in requirements.txt since it requires graphviz and other prerequisites outside the scope of the Caffe. """ from caffe.proto import caffe_pb2 """ pydot is not supported under p...
879cb36f0b8bb55a901de63b20dabd9e61110299e1c16b3511badf3fc2db921f
Python
7,630
244
from __future__ import absolute_import import anyjson import warnings from celery import uuid from celery.result import TaskSetResult from celery.task import Task from celery.canvas import Signature from celery.tests.tasks.test_result import make_mock_group from celery.tests.case import AppCase, Mock, patch class ...
d98c89556c7a5220358cac5f83025559c9075d2eda7049024006036ca7b0f5ec
Python
7,631
205
import functools import gzip import re from difflib import SequenceMatcher from pathlib import Path from django.conf import settings from django.core.exceptions import ( FieldDoesNotExist, ImproperlyConfigured, ValidationError, ) from django.utils.functional import lazy from django.utils.html import format_html, f...
3be72c1f99f5874e208a03b3d06c5c64900f4a9198d9bce1aedd74614de35476
Python
7,645
239
"""Module containing Pydantic validation utilities for Albumentations. This module provides a collection of validators and utility functions used for validating parameters in the Pydantic models throughout the Albumentations library. It includes functions for ensuring numeric ranges are valid, handling type conversion...