sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
aef4117c46b9941ae75ca30f8f2ac6e4d9a257702effa63026f754ed880278f4
Python
27,125
627
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
928593d9a927718e726189c7f7e30ab05ac095cbf97cfb0ee304c244008288f6
Python
27,330
619
import numpy as np import scipy as sp from functools import reduce from operator import mul from dipy.core.ndindex import ndindex from dipy.data import get_fnames from dipy.align import vector_fields as vf from dipy.align.transforms import regtransforms from dipy.align.parzenhist import (ParzenJointHistogram, ...
e0b7626813f4ee9c2d85d81d0559ef3a592a0b9869821686ba59606a265a0d1e
Python
27,442
772
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample pick weighted random sample generate random permutation distributions on the real line: ---------------------...
33837df4e2a12d1c636c41062f7d677d4e3c53afd41bb55b879d708f41f16d87
Python
27,497
616
import numpy as np import scipy as sp import nibabel as nib import numpy.linalg as npl from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_almost_equal, assert_equal, assert_raises) f...
7e8995a9f6b06a320407a80688912eeb83562bacd14a54bf09f602b9153ecde5
Python
27,500
745
import functools import json import shutil from collections.abc import Callable, Iterator from dataclasses import dataclass from pathlib import Path from typing import Any, Optional, Union import numpy as np import polars as pl import tqdm from PIL import Image import histoprep.functional as F from histoprep._backend...
75f22380e2ec851415a2df6e4d63b4d15c0020bafea563199f8eb67b44fd5e2e
Python
27,511
692
from django.shortcuts import render # Create your views here. # -*- coding: utf-8 -*- from django.http import JsonResponse, HttpResponse, FileResponse from django.views.decorators.http import require_http_methods from django.core import serializers from django import forms from django.middleware.csrf import get_token,...
f44d9100f31ba9361ef026dd0a54f62ddcfc77a35c4324554ab590e84907fb57
Python
27,518
736
from __future__ import absolute_import import math import pprint import sys import warnings from decimal import Decimal from numbers import Number import six from more_itertools.more import always_iterable from six.moves import filterfalse from six.moves import zip import _pytest._code from _pytest import deprecated...
d512041b725241da836f16388f8eeeedd1d6445037a783caec9bfceac585e173
Python
27,615
733
""" Testing DKI """ from __future__ import division, print_function, absolute_import import numpy as np import random import dipy.reconst.dki as dki import dipy.reconst.dti as dti from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_almost_equal, assert_raises) f...
c030620c30b6a71c3bf45e89ebb6b161b350a96c7412b65768dca65891d5493a
Python
27,621
880
#!/usr/bin/env python # if necessary, edit preceding line to point to your Python # or launch as "python Make.py ..." # Purpose: manage LAMMPS packages, external libraries, and builds # create a version of LAMMPS specific to an input script(s) # Syntax: Make.py switch args ... # Help: type Make.py or Make.py ...
4296c8addb932ac0a554472f65d466581c8b02775960593e846e70515f135ced
Python
27,717
804
# # The Python Imaging Library. # $Id$ # # JPEG (JFIF) file handling # # See "Digital Compression and Coding of Continuous-Tone Still Images, # Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1) # # History: # 1995-09-09 fl Created # 1995-09-13 fl Added full parser # 1996-03-25 fl Added hack to use t...
187344078e8834f264175f852e5e26dba9516418c0a12d449a9d77bd0d395414
Python
27,822
823
import io from pathlib import Path from typing import Any, Dict, Set from io import StringIO import numpy as np import pytest from deepdiff import DeepDiff import albumentations as A import albumentations.augmentations.geometric.functional as fgeometric from albumentations.core.serialization import SERIALIZABLE_REGIS...
714200a454cac34ad1897b3683e9775fd81117bf765515cb68533e09dff6722b
Python
27,895
719
from __future__ import division, print_function, absolute_import import warnings from dipy.utils.six.moves import xrange import numpy as np from dipy.io.bvectxt import orientation_from_string from dipy.tracking.utils import (affine_for_trackvis, connectivity_matrix, density_map, leng...
55d7391d38be944286a41773cfa791898f52decb873465099c80989d0f17587d
Python
28,065
852
# # The Python Imaging Library. # $Id$ # # GIF file handling # # History: # 1995-09-01 fl Created # 1996-12-14 fl Added interlace support # 1996-12-30 fl Added animation support # 1997-01-05 fl Added write support, fixed local colour map bug # 1997-02-23 fl Make sure to load raster data in getdata() # 1997-07...
1c7e1d021a9d7aa168408e12c6fa101a2ebf20892c733867cf497913d646bf63
Python
28,259
668
#! /usr/bin/python3.7 # -- coding: utf-8 -- ** ### Here are a set of functions used in elec_pipe ### and a set of qthread class for elec_main_gui import sys import os import re import math import numpy as np from numpy import ndarray import nibabel as nib from scipy import ndimage from sklearn.mixture import Gaussian...
2b18e218c5e3bb31abd0866c6fe06987602150f78d00a3610416a305267b5cda
Python
28,559
717
from __future__ import absolute_import import time from contextlib import contextmanager from datetime import datetime, timedelta from pickle import dumps, loads from celery.five import items from celery.schedules import ParseException, crontab, crontab_parser from celery.tests.case import AppCase, SkipTest @conte...
470aa3bd9393a47a59ac677137f542670c47560e94116b548e73ddbd8eb77438
Python
28,606
651
# numpy and pandas for data manipulation import pandas as pd import numpy as np # model used for feature importances import lightgbm as lgb # utility for early stopping with a validation set from sklearn.model_selection import train_test_split # visualizations import matplotlib.pyplot as plt import seaborn as sns #...
93394c59b5b163fadf23dd11b26ad5d8b07c73b5f68890da61c3a1e5eb00872f
Python
28,701
925
# -*- coding: utf-8 -*- """ celery.result ~~~~~~~~~~~~~ Task results/state and groups of results. """ from __future__ import absolute_import import time import warnings from collections import deque from contextlib import contextmanager from copy import copy from kombu.utils import cached_property from...
5f54ab1c9d3310ceebb058dbfa846285b6df3ff05b403369510f726af98392ec
Python
28,824
794
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Coverage data for coverage.py.""" import glob import itertools import json import optparse import os import os.path import random import re import socket from ...
2ca03dc07cb4b6fcca4ed072fc40cd06ec1d500fb56d63e6b2d6eccbfc24f53b
Python
28,981
810
#!/usr/bin/env python """This file store python modules to handle genome annotation formats like GTF, GFF, EMBL, GenBank. hmmer tblout etc """ import gzip, os, sys import numpy as np def get_handle(inhandle): """Return opened file object Consider adding bzip support. """ #first check if it's file or s...
b0d76dd60b183c00da372963e68384c0a79169af281711df3a4f5c8618de7a7b
Python
28,989
660
from base64 import b64decode from unittest.mock import patch from django.contrib.auth.models import Group from django.urls import reverse from django.test import TestCase, override_settings from django.test.client import RequestFactory from custom_user.tests_helper import create_user from experiment.tests.tests_helpe...
b064cc243040e5ad708f845ac4315633d0b6ef34c314a64b288e6e86a8e5cfb7
Python
29,047
474
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import datetime import patient.models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('survey', '0001_initial'), mig...
2206af8d55b64144d221f9ae7f9aaf4b4ee3cb6e66857169cd1bed6ee12e851c
Python
29,210
827
from __future__ import division from warnings import warn from math import factorial import numpy as np from scipy.special import genlaguerre, gamma, hyp2f1 from dipy.reconst.cache import Cache from dipy.reconst.multi_voxel import multi_voxel_fit from dipy.reconst.shm import real_sph_harm from dipy.core.geometry im...
0069adc3b74700f1d89b1d432f2dd1d866cb25adf42971e868cacb2a6c0baf39
Python
29,347
887
# -*- coding: utf-8 -*- """ celery.worker.consumer ~~~~~~~~~~~~~~~~~~~~~~ This module contains the components responsible for consuming messages from the broker, processing the messages and keeping the broker connections up and running. """ from __future__ import absolute_import import errno import kombu import logg...
abec7ca6d43be95c919508f8d36a4caf2941a13f670c2bf82aa495ca2855866c
Python
29,411
885
import pytest import numpy as np import albumentations as A import cv2 from tests.conftest import RECTANGULAR_UINT8_IMAGE, SQUARE_UINT8_IMAGE from tests.utils import get_2d_transforms, get_3d_transforms, get_dual_transforms @pytest.mark.parametrize( ["volume_shape", "min_zyx", "pad_divisor_zyx", "expected_shape"]...
e017d15a299096d6c3cd4a882a6abf3929b65f80d8870520734ca9c8369b2e28
Python
29,485
850
# -*- coding: utf-8 -*- """ The :program:`celery` umbrella command. .. program:: celery """ from __future__ import absolute_import, unicode_literals import anyjson import numbers import os import sys from functools import partial from importlib import import_module from celery.five import string_t, values from ce...
6c8dcf908b7f5ba519a0a4f1be661de95d3f77cc0b11439cff47082a5a7d912a
Python
29,626
520
"""Real-data contracts for native artifacts, public commands and legacy helpers.""" import json import os import subprocess import sys from pathlib import Path from types import SimpleNamespace import numpy as np import pandas as pd import pytest from sklearn.datasets import load_breast_cancer, load_iris from sklearn....
d44a7c319ee3912e3ff5ca3794bd5e56b3bdf19b35f61ad4756f3e1d72803430
Python
29,702
770
import copy from collections import Counter, defaultdict from itertools import combinations import os import pickle import numpy as np import pandas as pd from scipy.stats import spearmanr from scipy.special import softmax from scipy.optimize import minimize from sklearn.impute import KNNImputer from sklearn.preprocess...
b3dc6b1c50e1f122a375d32fef9499e2819cfbf9f9a01c5d7351cb0a0730f96d
Python
29,757
712
import shutil import sys import random # import pyCompare # import pingouin as pg import scipy from scipy.io import loadmat, savemat from tensorboardX import SummaryWriter from torch import optim import matplotlib.pyplot as plt from Loss import * import torch.nn.modules.loss as Loss # import torchvision.utils as vutil...
a44baab7c925cb834fc9dc6a12c8332885ec826f9109344ccfb3bcf6d9346d8b
Python
29,799
644
#!/usr/bin/python # full assembly of the sub-parts to form the complete net import time import torch from parameters import Parameters from saveNet import * import torch.nn as nn import torch.nn.functional as F from complexnet.cmplxfc import ComplexLinear import matplotlib.pyplot as plt import numpy as np from compl...
b884e00bdf9ea2150e33e8f5075953ea5ad53984bf00dbdb96b7056841f8746c
Python
29,864
788
import numpy as np from scipy.spatial.distance import mahalanobis from dipy.tracking.streamline import (set_number_of_points, nbytes, select_random_set_of_streamlines, values_from_volume, orient_by_streamli...
2f2ca1f6238df0aeba40b8c7872ceb5e95189dc90027e552047b92e6a87c5f3a
Python
29,911
750
import nibabel as nib import numpy as np import numpy.testing as npt from dipy.core.gradients import gradient_table from dipy.core.sphere import HemiSphere, unit_octahedron from dipy.data import get_fnames, get_sphere from dipy.direction import (BootDirectionGetter, ClosestPeakDirectionGet...
ee059645185ff448dc3ac39c4e1e6f17344f5372dc751b40b25f407f1e7c66a8
Python
30,058
652
""" 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...
c83f0cc881e10428828c7978c9cb911cab7d718e0927c79c8f56a8e808510f7c
Python
30,155
801
"""Testing DTI.""" from __future__ import division, print_function, absolute_import import numpy as np import numpy.testing as npt import nibabel as nib import scipy.optimize as opt import dipy.reconst.dti as dti from dipy.reconst.dti import (axial_diffusivity, color_fa, fractional_anis...
43dacd50c1a37175f950fc4e30f45baf29f0a349dcf19ef074aebf42bec133e2
Python
30,308
965
# # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import import io import os import sys import select import socket import struct import errno i...
b2a0c39fc3359cbc987a8739f0c48d0530355465538fb1c026b36b7bbb669938
Python
30,341
448
from django.conf.urls import url from experiment import views urlpatterns = [ # keyword url(r'^keyword/search/$', views.keyword_search_ajax, name='keywords_search'), url(r'^keyword/new/(?P<research_project_id>\d+)/(?P<keyword_name>.+)/$', views.keyword_create_ajax, name='keyword_new'), url(r'^k...
e2020b7301d5249f5fb86f3a7a1f2440998980b99ddf7d8e99f02d3bbde2fd7c
Python
30,510
1,005
# -*- coding: utf-8 -*- from __future__ import division import numpy as np from numpy import dot from dipy.core.geometry import sphere2cart from dipy.core.geometry import vec2vec_rotmat from dipy.reconst.utils import dki_design_matrix from scipy.special import jn # Diffusion coefficients for white matter tracts, in m...
46cbc2327372a474267e5535a3d1a76b42d0d272d45377d9831979169c886f9a
Python
30,554
693
import torch from torch.utils import data from parameters import Parameters from scipy.io import loadmat, savemat import numpy as np import os from saveNet import * from utils.gridkspace import * from utils.gaussian_fit import gauss_fit, kspacelines_gauss_fit, kspaceImg_gauss_fit # params = Parameters() def resizeIm...
f5a8fc1ad627fad3ed1f4a5a32ddc881b56260b383373f4bf69524cbf0c6fa47
Python
30,982
687
import numpy as np import pandas as pd import cv2 from scipy import ndimage #Run inference (using OpenCV's dnn module) on images using your model trained #in AIDeveloper. #Script contains functions: #- to pre-preprocess images according to the input criteria of a loaded model #- forward images through a mod...
8fca374a5078cd9ec31cbe2fd185991851a1373e57f96dd66cc42711de63e4c4
Python
31,054
1,027
""" Utility functions for algebra etc """ from __future__ import division, print_function, absolute_import import math import numpy as np import numpy.linalg as npl # epsilon for testing whether a number is close to zero _EPS = np.finfo(float).eps * 4.0 # axis sequences for Euler angles _NEXT_AXIS = [1, 2, 0, 1] # ...
8e0ffb08ab548e387850abe5a1f11669762b2c80b1f8fc9c908be31315657629
Python
31,346
816
"""functools.py - Tools for working with functions and callable objects """ # Python module wrapper for _functools C module # to allow utilities written in Python to be added # to the functools module. # Written by Nick Coghlan <ncoghlan at gmail.com>, # Raymond Hettinger <python at rcn.com>, # and Łukasz Langa <lukasz...
b7ce8c9b8e583e4cddc5e2fa0c4bcb7b9a83d4fa4a7dd5c49542b4ef5d1720ec
Python
31,436
751
from tkinter import Variable, DISABLED from tkinter import Button as tkButton from tkinter import Entry as tkEntry from tkinter.ttk import (Label, Separator, Button, Frame, Checkbutton, Combobox, Entry) from PIL import Image, ImageTk # import copy so we can create static copies of the reference...
2841284281a4515f355bd06690e6a13087a9b89a531af9ec4eb785031ac8d7e8
Python
31,467
969
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import anyjson import os import signal import socket import sys from datetime import datetime, timedelta from billiard.einfo import ExceptionInfo from kombu.transport.base import Message from kombu.utils.encoding import from_utf8, defau...
7010be1d644fff9bec45f82ed56a56beaf233909b0aef0ec82a8c35689f7fb09
Python
32,004
1,091
"""Image manipulation functions.""" import itertools as it import logging from collections.abc import Sequence from dataclasses import dataclass from pathlib import Path from typing import Any, cast import cv2 import numpy as np import numpy.typing as npt import skimage.transform as trans import xarray as xr LOGGER ...
285ad901088b397b3ecf41aba51522f138d2395f1fc0f5ac1006ad3c5d237e10
Python
32,110
846
# -*- coding: utf-8 -*- """ babel.messages.catalog ~~~~~~~~~~~~~~~~~~~~~~ Data structures for message catalogs. :copyright: (c) 2013-2018 by the Babel Team. :license: BSD, see LICENSE for more details. """ import re import time from cgi import parse_header from datetime import datetime, time as ...
4a8b092493e5cb5262e032dd1b09db0c781627398a417b58c6c446490001d987
Python
32,244
886
# -*- coding: utf-8 -*- import warnings from typing import Optional, Union, List, cast import itertools as it import numpy as np from numpy.typing import ArrayLike import scipy.stats as ss from pandas import DataFrame, Categorical, Series from scikit_posthocs._posthocs import ( __complete_block_matrix, __conve...
c1515a036610ee85957294a352f7ec9bfd5c0e32283faef0be81abdab6389eb7
Python
32,277
802
""" Classes and functions for fitting tensors without free water contamination """ from __future__ import division, print_function, absolute_import import warnings import numpy as np import scipy.optimize as opt from dipy.reconst.base import ReconstModel from dipy.reconst.dti import (TensorFit, design_matrix, deco...
73cff36b4c356537ceedc63f837b58e1dd667ed6428700ad4bf1219a72965e30
Python
32,345
687
import csv import os import re import shutil import tempfile import zipfile from unittest import skip from unittest.mock import patch from django.conf import settings from django.contrib.messages import get_messages from django.urls import reverse, resolve from django.utils.translation import ugettext_lazy as _ from d...
4c708409fb723a30d5fcba8b556600c3e62dd6bd370772aafc3c38540ee142e2
Python
32,535
883
from copy import deepcopy from warnings import warn import types from distutils.version import LooseVersion from scipy.spatial.distance import cdist import numpy as np import nibabel as nib from nibabel.affines import apply_affine from dipy.tracking.streamlinespeed import set_number_of_points from dipy.tracking.strea...
3b5de07bec28281762a803afa151a58c15683e4e5e910a0ad775d8cbda312973
Python
32,553
798
"""Tests for event table operations.""" from collections import deque from decimal import Decimal from types import SimpleNamespace import pytest from PySide6.QtCore import Qt from PySide6.QtWidgets import QAbstractItemView, QTableWidget, QTableWidgetItem from boris import config as cfg from boris import event_opera...
cde19a1a23e67a77f5a773d4ac19b43435f551b121e014cd537a1e2f65ee9761
Python
32,615
741
""" 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...
dc8db418204beb98d69810e47f8fea145c3daf7dd2b85771c6975d8512abac53
Python
32,685
864
"""Transforms for rotating images and associated data. This module provides classes for rotating images, masks, bounding boxes, and keypoints. Includes transforms for 90-degree rotations and arbitrary angle rotations with various border handling options. """ from __future__ import annotations import math from typing...
4eef274b049e219213026457623a1678b42ddebac1698ad8b83575d26960ddbb
Python
32,745
941
# -*- coding: utf-8 -*- """ babel.numbers ~~~~~~~~~~~~~ Locale dependent formatting and parsing of numeric data. The default locale for the functions in this module is determined by the following environment variables, in that order: * ``LC_NUMERIC``, * ``LC_ALL``, and * ``LANG`` ...
4db14f303a54a52097574d4c919f483f4e4561055cba7b9d0adf7a4d579e4f91
Python
32,758
892
# 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 datetime import ipaddress import asn1crypto.core import six fro...
12181ab79599ad4ced7e30d62f31a62a75bcf61fec1e7b6daf316c231112ffd5
Python
33,006
828
import platform import time from math import factorial from scipy.special import gamma import scipy.integrate as integrate import numpy as np from numpy.testing import (assert_almost_equal, assert_array_almost_equal, assert_equal, run_mod...
f5b4607a4a23893d6339c368ad2318aeac50a43e12af207f24084a0e7f20299c
Python
33,011
924
""" terminal reporting of the full testing process. This is a good source for looking at the various reporting hooks. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import collections import platform import sys import time import attr ...
86caaf7e9505e68d087d49e5233e359c4f422f5eaf1e1e3782051e9eef9bded0
Python
33,190
838
import datetime import os import random import tempfile import zipfile from django.apps import apps from django.contrib.auth.models import User, Group as UserGroup from django.core.files import File from django.db import IntegrityError from django.test import RequestFactory, TestCase from faker import Factory from cu...
3266b6b37033387986b19174a1e11acd624df8ae2bd7a21bba34436ef27f7510
Python
33,258
961
from __future__ import print_function import numpy as np import nibabel.eulerangles as eulerangles from numpy.testing import (assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises) from dipy.data import get_fnames from...
8f76b9a06f1bfefa0e96441ee74d3f5d7c52571148f87dbcc263463bf431e850
Python
33,317
1,013
""" 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...
c50cdd52af51abc3d20aa00eab2425b118e2138340b2e6cd90b2bcaebbe2a867
Python
33,431
910
"""Cell- and lineage-related objects and functions.""" from collections.abc import Callable from dataclasses import dataclass, field import matplotlib.pyplot as plt import numpy as np import numpy.typing as npt import scipy.signal as sig from delta import utils type Pole = npt.NDArray[np.int16] class CellDoesNotE...
c778484d1a4a2c5306bf4362b2dd6a635298f06db2f23b252ad87fa14e0578a1
Python
33,594
683
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'observation.ui' ## ## Created by: Qt User Interface Compiler version 6.10.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ##############...
30c38fd06f6c03608525e8b350ec8bf1455b9ee15079ef3cb660a3da4f5268d8
Python
33,606
877
import sys from types import MappingProxyType, DynamicClassAttribute from functools import reduce from operator import or_ as _or_ # try _collections first to reduce startup cost try: from _collections import OrderedDict except ImportError: from collections import OrderedDict __all__ = [ 'EnumMeta', ...
b5b6126c81c7d735193d64027ec2d22c2b93d3f06b1d0810c7ff73e989b28862
Python
33,631
719
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ cif to rtdc converter This module reads image data from compensated image files (.cif files) and converts the file to hdf5 (.rtdc), compatible to AIDeveloper The cif files are generated by imaging flow cytometry (IFC) instruments Amnis ImageStream dependencie...
e745b9da6cef95bf7d4503f7f88ba9fe335383cedb53619a218e0e5a40595778
Python
33,682
964
""" Classes and functions for fitting ivim model """ from __future__ import division, print_function, absolute_import from distutils.version import LooseVersion import numpy as np import scipy import warnings from dipy.reconst.base import ReconstModel from dipy.reconst.multi_voxel import multi_voxel_fit from dipy.uti...
54bd7afd00a6b466a3167676bdc8b65114b450a8201f61fe430405aad6b87653
Python
33,934
1,045
# This code is © K. Heining, 2020, developed at the University of Freiburg. # This code is made available under the BSD license enclosed with the software (see licence.txt). # Over and above the legal restrictions imposed by this license, if you use this software for an academic # publication then you are obliged to pr...
09449225df17520178b2c05f4fb92a11594b18f4c3e8d3ce3ca5067b80d99b42
Python
33,984
793
#!/usr/bin/python import os import re import sys import glob import requests import argparse from time import sleep from json import loads try: from urllib.parse import urlencode except ImportError: # pragma: no cover from urllib import urlencode try: from shlex import quote except ImportError: # pragma...
cdc2603fc5676534fad228d1e7e44fba123dbf891cc6b5a0cefeff1239597d6d
Python
34,095
1,143
# coding: utf-8 """ ASN.1 type classes for various algorithms using in various aspects of public key cryptography. Exports the following items: - AlgorithmIdentifier() - AnyAlgorithmIdentifier() - DigestAlgorithm() - DigestInfo() - DSASignature() - EncryptionAlgorithm() - HmacAlgorithm() - KdfAlgorithm() - P...
486a99e1a60cc29cbc0bcf961b65d967956c831a20edd0cde7b936513315f1c9
Python
34,235
1,008
"""AMQP Connections""" # 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 option) ...
ab49873f164e1750bcb821073f2cdda54c3991dec6e60093393406a2bfc7bf8f
Python
34,380
832
"""Transforms that combine multiple images and their associated annotations. This module contains transformations that take multiple input sources (e.g., a primary image and additional images provided via metadata) and combine them into a single output. Examples include overlaying elements (`OverlayElements`) or creat...
0234fe6b0715d2d8215067fa4decbb31c586a586b5e41d130320cc40f1d7240b
Python
34,558
787
"""Domain adaptation transforms for image augmentation. This module provides transformations designed to bridge the domain gap between datasets by adapting the style of an input image to match that of reference images from a target domain. Adaptations are based on matching statistical properties like histograms, frequ...
e957c968694673de4505f00f1746ad7c660c880289c34606557152d8d61d10b0
Python
34,942
878
"""Functional implementations for image mixing operations. This module provides utility functions for blending and combining images, such as copy-and-paste operations with masking. """ from __future__ import annotations import random from collections.abc import Sequence from typing import Any, Literal, TypedDict, ca...
6b438d6c6fa59538818b96e0fed920c3fde75a53733ed054d01c80ec06a831ce
Python
35,013
920
#!/usr/bin/env python3 """Slice gate -- mechanical enforcement of the PR <-> slice-issue contract. This gate blocks a PR that: 1. Does not cite its slice issue via Closes/Fixes/Resolves #N. The closing set must contain exactly one slice-labelled issue; a second reference is permitted only for the slice...
e997a492bb3accfceea3bf440f85287bd0e2bbc17177b3fc6fa22a29998da917
Python
35,122
966
""" 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...
288c79ed0b10613e0172ef31d7758957840891e6d07abdb08b535ea1a5aace28
Python
35,184
941
""" 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...
7c7f61041ab66ee4b7efcb0a4bc398147a5149048e536a824a7c6a31e7860479
Python
35,185
1,249
# coding: utf-8 """ ASN.1 type classes for public and private keys. Exports the following items: - DSAPrivateKey() - ECPrivateKey() - EncryptedPrivateKeyInfo() - PrivateKeyInfo() - PublicKeyInfo() - RSAPrivateKey() - RSAPublicKey() Other type classes are defined that help compose the types listed above. """ ...
4dc94be7d1acefd4a7ee1e4755d1ce750b710d4dc07e0409281ecf673e51cd96
Python
35,574
948
# -*- coding: utf-8 -*- """ celery.app.task ~~~~~~~~~~~~~~~ Task Implementation: Task request context, and the base task class. """ from __future__ import absolute_import import sys from billiard.einfo import ExceptionInfo from celery import current_app from celery import states from celery._state impo...
cac4384d6ebc34448ebed58d75e2315eefe903e737efc22b67aeadfa92d9fece
Python
35,646
1,162
"""Utility functions and class definitions that are used in pipeline.py.""" import datetime import heapq import logging import re import subprocess # ruff: ignore[suspicious-subprocess-import] from collections.abc import Iterable, Sequence from pathlib import Path from typing import Any, Literal, overload import bio...
f1ec37278d8e87214ad538a624c65bcf61f5eb9514564105d048f33dde313a9d
Python
35,659
920
"""Utilities for handling bounding box operations during image augmentation. This module provides tools for processing bounding boxes in various formats (COCO, Pascal VOC, YOLO), converting between coordinate systems, normalizing and denormalizing coordinates, filtering boxes based on visibility and size criteria, and...
0dfbcf0dd0899c28a1f4dde196f12b8d0f5e28e1d431e091b309d9c79140f81c
Python
35,718
1,164
""" 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...
91e909f0708c63dfbcd71e6948f17591765830ef7d80e9f103931d38907ece7a
Python
35,788
1,169
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import # # Imports # import sys import threading import array from traceback import ...
55d48741186d218e7972871a187f5c0c403dca87701be6e9763276f167367822
Python
35,839
976
import calendar import codecs import collections import mmap import os import re import time import zlib from ._util import py3 try: from UserDict import UserDict # Python 2.x except ImportError: UserDict = collections.UserDict # Python 3.x if py3: # Python 3.x def make_bytes(s): return s.enco...
45d5fbc817c8efe58c57370b3ebf67e6bf759294633fd67f8ff9174199547ae4
Python
36,022
955
# The Python Imaging Library. # $Id$ # Optional color management support, based on Kevin Cazabon's PyCMS # library. # History: # 2009-03-08 fl Added to PIL. # Copyright (C) 2002-2003 Kevin Cazabon # Copyright (c) 2009 by Fredrik Lundh # Copyright (c) 2013 by Eric Soroos # See the README file for information on u...
893fba299d037fad442429ce4d86a5a6132bd9db527bb5a4a3b97359dbe52212
Python
36,027
1,090
from __future__ import absolute_import from __future__ import division from __future__ import print_function import inspect import pprint import re import sys import traceback from inspect import CO_VARARGS from inspect import CO_VARKEYWORDS from weakref import ref import attr import pluggy import py import six from ...
885f92f283d91e8b0c8c2f63686cd81e04adbd011bad553de379f01de6a160ef
Python
36,181
830
# encoding=utf-8 import sys from PyQt5.QtWidgets import QApplication, QSizePolicy, QMessageBox, QWidget, \ QPushButton, QLineEdit, QDesktopWidget, QGridLayout, QFileDialog, QListWidget, QLabel,QFrame,QGroupBox from PyQt5.QtCore import Qt, QThread import PyQt5.QtWidgets as QtWidgets import PyQt5.QtCore as QtCore ...
7003ad6de6d7af665b35ac2155cbb13f6872111a43489871fbdd0c9beb4696fa
Python
36,246
1,097
import abc import numpy as np from dipy.utils.six import with_metaclass from dipy.core.optimize import Optimizer from dipy.align.bundlemin import (_bundle_minimum_distance, _bundle_minimum_distance_asymmetric, distance_matrix_mdf) from dipy.tracking.st...
86cc1bbdbde916b92732b8813d0195c12c1d06eea277202118dc007637d0f725
Python
36,276
1,113
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import builtins, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError as why: raise SystemErro...
997a34384ecdf2c7303a722a934a832a163b79d094de9a14c0df9e509e511141
Python
36,732
898
import torch import numpy as np import torch.nn as nn from saveNet import * from math import exp # class CmplxConvCalc(nn.Module): # def __init__(self, conv_func, args): # super(CmplxConvCalc, self).__init__() # self.real_conv = conv_func(**args) # self.imag_conv = conv_func(**args) # ...
881779edf0b0287341f0594910d8e240eb7047570a7a37987eff034e7e1076b6
Python
36,894
1,133
# -*- coding: utf-8 -*- """ babel.core ~~~~~~~~~~ Core locale representation and locale data access. :copyright: (c) 2013-2018 by the Babel Team. :license: BSD, see LICENSE for more details. """ import os from babel import localedata from babel._compat import pickle, string_types from babel.plur...
56cd29af5768bb543619a74b2d45100368ee662bd877c9df61a16ef4cdc9bdca
Python
36,996
750
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain ...
8027dab6aa3f7d2364188e7d90aeb004c6606476477fa669f36b8f9188e20167
Python
37,138
976
"""Module containing base interfaces for all transform implementations. This module defines the fundamental transform interfaces that form the base hierarchy for all transformation classes in Albumentations. It provides abstract classes and mixins that define common behavior for image, keypoint, bounding box, and volu...
77b51eed2877707deeea1c3cfbe2429206144181cdec2ee68b2ddf9d28038475
Python
37,526
1,069
r"""OS routines for NT or Posix depending on what system we're on. This exports: - all functions from posix or nt, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix' or 'nt' - os.curdir is a string representing the current directory (always '.') - os.pardir is a strin...
29c08428867143751915500b01bdd6e5975a39cab3c4c6e46ed1eb8063996275
Python
37,766
1,075
from __future__ import annotations import math from typing import Any import numpy as np import pytest import cv2 import albumentations as A import albumentations.augmentations.geometric.functional as fgeometric from albumentations.augmentations.utils import angle_2pi_range from albumentations.core.keypoints_utils i...
b6fb4a310f6cc594eea74d987db5c27db7074210458ec3b0087778c4e6c3f51e
Python
37,847
1,068
from typing import Any import numpy as np from numpy import exp, eye, log, sqrt from numpy.linalg import solve, eigh, cholesky, pinv from scipy.linalg import block_diag import PcmPy as pcm import pandas as pd import warnings class Model: """ Abstract PCM Model Class """ def __init__(self,name): ...
4ab2649d0a88572134fbdc238b6d09c8e332932df73c620b40b02e2b560166b7
Python
37,867
1,149
"""Various tools related to creating and working with streamlines This module provides tools for targeting streamlines using ROIs, for making connectivity matrices from whole brain fiber tracking and some other tools that allow streamlines to interact with image data. Important Note: --------------- Dipy uses affine ...
dd7092faeb56ee3bed42bbd8c577e179de626067791cead11ca2adf3a04cf655
Python
37,917
1,027
# -*- coding: utf-8 -*- from sklearn.base import BaseEstimator from scipy.special import psi,gammaln from scipy.misc import logsumexp from scipy.linalg import pinvh from sklearn.utils import check_array from sklearn.utils.validation import check_is_fitted from sklearn.utils.extmath import safe_sparse_dot from scipy.spa...
18eb836fc79119714268ee89f2a19703f2b56eb484e254f5023eecd8e2525492
Python
38,113
1,023
# -*- coding: utf-8 -*- """ babel.messages.frontend ~~~~~~~~~~~~~~~~~~~~~~~ Frontends for the message extraction functionality. :copyright: (c) 2013-2018 by the Babel Team. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import logging import optparse import...
2352aefe0fe5974732c318b365f4fb5477ffc47fb78b12748bca2515465829c4
Python
38,186
779
#!/usr/bin/env python3 """ MAG-S2 - the shape of the quantum compass signal. Protocol version 0.1. Physics. A radical pair (flavin anion with N5 and N10, tryptophan cation with N1; anisotropic hyperfine tensors from the RadicalPy database) starts in the singlet state in a 50 uT field and recombines with rate k (expo...
5a9bf83faa501cddeb8dbb54b6206afbb81c2ee5677b342278645b602b03db7d
Python
38,362
1,017
"""Functional implementations of dropout operations for image augmentation. This module provides low-level functions for various dropout techniques used in image augmentation, including channel dropout, grid dropout, mask dropout, and coarse dropout. These functions create and apply dropout patterns to images, masks, ...
f4870ff3f593e2e8cb48f2febf9306a787f05295008cb1c848934133beedcdcb
Python
38,397
1,128
from __future__ import absolute_import, print_function import os import socket from collections import deque from datetime import datetime, timedelta from threading import Event from amqp import ChannelError from kombu import Connection from kombu.common import QoS, ignore_errors from kombu.transport.base import Mes...
8a873959bd559cfe6d1f95b57bc49f44e680cb3fab1f452452657fb67221f984
Python
38,563
988
#!/usr/bin/env python3 """Typing gate — mechanical enforcement of type discipline. This gate blocks a PR that: 1. Weakens the pyright configuration (gate-config ratchet). 2. Adds a ``pyrightconfig.json`` anywhere in the repo (pyright would prefer it over ``pyproject.toml`` and bypass the strict config). 3....
f2b7a8c643ce4acf027e268e56747aa9cee35fca941524e842d464f9d5baa90c
Python
38,600
1,102
""" command line options, ini-file and conftest.py processing. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import copy import inspect import os import shlex import sys import types import warnings import py import six from pluggy imp...