sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f02b1aaf66a19dfaaf12a26617fb9325de5c8dbb474f577e7f4800d1cb8dbad5 | Python | 14,346 | 332 | """Every control `governance.yml` declares must actually control something.
The config file is the repository's single answer to "how do I change this".
A key that reads like a control and changes nothing is worse than an absent
one: someone sets it, believes they configured the gate, and the gate carries
on doing wha... |
2dc87d6ef06fb39f002653b54d187c68bbd86b59fcfd6236167357ae5608e8bc | Python | 14,389 | 352 | #
# The Python Imaging Library.
# $Id$
#
# BMP file handler
#
# Windows (and OS/2) native bitmap storage format.
#
# history:
# 1995-09-01 fl Created
# 1996-04-30 fl Added save
# 1997-08-27 fl Fixed save of 1-bit images
# 1998-03-06 fl Load P images as L where possible
# 1998-07-03 fl Load P images as 1 where... |
f1089ae8315ebbeb599f5558179f75f8819724976f8086282c1a6788a0f8a526 | Python | 14,416 | 435 | """
Blizzard Mipmap Format (.blp)
Jerome Leclanche <jerome@leclan.ch>
The contents of this file are hereby released in the public domain (CC0)
Full text of the CC0 license:
https://creativecommons.org/publicdomain/zero/1.0/
BLP1 files, used mostly in Warcraft III, are not fully supported.
All types of BLP2 files us... |
55b5e0364a1ae8f610a8f7f07027a47d572827dd8871694147aae1424b0f6492 | Python | 14,418 | 372 | #!/usr/bin/env python
# Copyright (c) 2005-2010 ActiveState Software Inc.
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# http://support.microsoft.com/default.aspx?scid=kb;en-us;3... |
513fccbcf0535ca8bd2d20bb5d747ed2684ccceec1d996802ec83c66f969375e | Python | 14,454 | 306 | """Verified snapshots of caller Python modules, excluding installed dependencies."""
import ast
import csv
import hashlib
import importlib
import importlib.machinery
import importlib.metadata
import importlib.util
import sys
import sysconfig
from pathlib import Path
from types import ModuleType
_DIRECTORY = 'sources/m... |
fa74cf40e7975618a21bdb7ade3ca50d286d188230a15be7291cde0c5ad530b5 | Python | 14,529 | 366 | #!/usr/bin/env python2
desc="""Align genome onto itself (BLAT) and remove heterozygous (redundant) scaffolds.
TO ADD:
- scaffold extension based on overlapping matches (overlapping already recognised)
- reporting of haplotypes
- recognise heterozygous contigs with translocations
- add min contig length, ignore shorter... |
0cc0b8c6a05086e44808dc1484f5e780ce9abd40e8a2db98ecbc6d2a16794801 | Python | 14,533 | 425 | from __future__ import absolute_import
import socket
from kombu.async import Hub, READ, WRITE, ERR
from celery.bootsteps import CLOSE, RUN
from celery.exceptions import InvalidTaskError, WorkerShutdown, WorkerTerminate
from celery.five import Empty
from celery.worker import state
from celery.worker.consumer import C... |
2593e6f07925ec24f4380ac25bb09c5fdafd391b69f2deaf1c3a2dfe7b3a6d58 | Python | 14,588 | 170 | """Mutation testing of analyze.py against test_analyze.py (author's harness, not part of the study).
Every mutation changes one rule of the analysis; the synthetic tests should fail on each.
Usage: python3 -I scripts/mutate_analyze.py CODE_DIR OUT_DIR"""
import os
import shutil
import subprocess
import sys
CODE, OUT =... |
bae81cdac2a2439c8471c2a0c5227fea05913f8353defa947a03037c145a09e1 | Python | 14,629 | 364 | import os
from datetime import datetime
from urllib.parse import urljoin
from django.conf import settings
from django.core.exceptions import SuspiciousFileOperation
from django.core.files import File, locks
from django.core.files.move import file_move_safe
from django.core.signals import setting_changed
from django.ut... |
2ea312e80e059594c9059083b3e9b11b39f9b7d46e6da912bd5dcde9f51e299e | Python | 14,750 | 322 |
import constants
import ismrmrd
import ctypes
import os
from datetime import datetime
import h5py
import random
import logging
import socket
import numpy as np
class Connection:
def __init__(self, socket, savedata, savedataFile = "", savedataFolder = "", savedataGroup = "dataset"):
self.savedata =... |
4f13dc78f4b7cc2564e1ab4dd02b9d540c28a2e603e877b2c0560c9c02b04d5c | Python | 14,762 | 444 | import numpy as np
from scipy.sparse import spdiags
from pytraction.utils import interp_vec2grid
def fourier_xu(pos, vec, meshsize, E, s, grid_mat):
"""[summary]
Args:
pos ([type]): [description]
vec ([type]): [description]
meshsize ([type]): [description]
E ([ty... |
252779ee313d0cd1b306c1dbcc6a95aa1d1673c5a3889f1e59217b5077dd1282 | Python | 14,779 | 457 | #
# The Python Imaging Library.
# $Id$
#
# TIFF tags
#
# This module provides clear-text names for various well-known
# TIFF tags. the TIFF codec works just fine without it.
#
# Copyright (c) Secret Labs AB 1999.
#
# See the README file for information on usage and redistribution.
#
##
# This module provides constant... |
c9672e764ce06d11abbfb99ba6005f4502654015d9bebbf83737ad9f30b40602 | Python | 14,794 | 352 | """Module for serialization and deserialization of Albumentations transforms.
This module provides functionality to serialize transforms to JSON or YAML format and
deserialize them back. It implements the Serializable interface that allows transforms
to be converted to and from dictionaries, which can then be saved to... |
4c5267dce19cbe1b28d3f19770530be325ce4057a2cde2c3440d7fd20b79dac3 | Python | 14,828 | 287 | import torch
from utils import Batch_evaluate
class Truss:
def __init__(self, device='cpu', batch_size=None, *args, **kwargs):
self.device = device
self.set_parameters_72bar(*args, **kwargs)
self.pre_compute()
self.set_discrete_thres()
self.batch_eval = Batch_evaluate(bat... |
5275f65219e8e59e4e3f88ee06d1adc4f1bc0c494d39fc17f5bdc2ca5a1e7ba0 | Python | 14,844 | 400 | """Collect feedback and audit parameter-queue interventions."""
import json
import logging
import traceback
from collections.abc import Callable
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, cast
from talos.experiment.msq import MSQ
from talos.experiment.param_search.search_... |
21f1fef6f41196e41a18ef5b9ef7bf548e72c359c60148ede93c825ecabf4d3f | Python | 14,861 | 395 | """
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... |
560c007c07b0b5b86e30692f7b8c3c1c932c67494e60635a50b98739e2836484 | Python | 14,884 | 394 | ###############################################################################
# MetaExplorer is a small gui class allowing explore and select meta-data
# values from supported data formats
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# ... |
2ce630bf70d0656e5c5f5df57d054d619ac5ef616f79d06b5d3ead32791b2776 | Python | 14,926 | 385 | #############################################################################
# prepare.py is a script that prepares source dataset for bidsification
# it identifies the subjects, sessions and series that each recording
# in the source dataset belongs and sort them accordingly
##########################################... |
6fed9b8abb9bae29c09459b64518f479899837b709eb346459bcdb0df20685fd | Python | 14,982 | 431 | ###############################################################################
# EDF.py provides an implementation of EDF class of EEG subclass
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: Nikita Beliy
# Owner: Liege University... |
260807fc6ffcc16d6dbd185fc94418575bcc3f171112c076c29e9206d36aafaf | Python | 15,036 | 410 | import numpy as np
from sklearn.base import RegressorMixin
from sklearn.linear_model.base import LinearModel
from sklearn.utils import check_X_y, check_array, as_float_array
from sklearn.utils.validation import check_is_fitted
from scipy.linalg import svd
import warnings
class BayesianLinearRegression(RegressorMixin... |
df2702366d55fe28c2443e5fa347d1d59709e38d571ae1254ee6eb1a81c691b0 | Python | 15,053 | 310 | #!/usr/bin/env python3
"""
MAG-S3b estimate - the dipole test and the blind estimate of eps_eff. Protocol version 0.4 (draft).
Reads only records (counts, sessions, seed, recording point). The estimate knows the retina and the patches of the
bird, rebuilt from the frozen MAG-S2 streams of its seed (receptor axes, patc... |
0b38c5d1a663491f3457c14e01442133cbe455a84ffba4de476996873f7ee24e | Python | 15,066 | 424 | import unicodedata
from django import forms
from django.contrib.auth import (
authenticate, get_user_model, password_validation,
)
from django.contrib.auth.hashers import (
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_to... |
ccb2c08bb133c9a32f27a87c84cb22055fcb9d068e412263fcd672f39aef1205 | Python | 15,069 | 475 | import numpy as np
from scipy import ndimage as nd
import warnings
from functools import wraps
from bg_space.utils import ordered_list_from_set, deprecated
def to_target(method):
"""Decorator for bypassing AnatomicalSpace creation."""
@wraps(method)
def decorated(spaceconv_instance, space_description, *... |
860bda6f2179ca70e6dfac3dc730d8f9bcd45d51c4448c5735e422c3b0710d89 | Python | 15,072 | 445 | """ A unified interface for performing and debugging optimization problems.
Only L-BFGS-B and Powell is supported in this class for versions of
Scipy < 0.12. All optimizers are available for scipy >= 0.12.
"""
import abc
from distutils.version import LooseVersion
import numpy as np
import scipy
import scipy.sparse as ... |
f7d54262736d038a79bbbcfc89a9f2facf54cf0f4ffcf2f0c694b2fbd0b43ba3 | Python | 15,076 | 354 | import os
from collections import OrderedDict
from django.apps import apps
from django.contrib.staticfiles.finders import get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import FileSystemStorage
from django.core.management.base import BaseCommand, CommandEr... |
0e02698442997ebbdd96f099d680cdb3329cd4c81ee680ff16315d8dfdc1840d | Python | 15,103 | 370 | #!/usr/bin/env python2
desc="""Fetch all entries from SRA for given taxid.
Save the biggest run per each SAMPLE (SRS) from given date. Paired first, if any.
Note, it run fastq-dump in background. Make sure you have enough free cores;)
DEPENDENCIES:
Biopython
"""
epilog="""Author:
l.p.pryszcz+git@gmail.com
Barcelona... |
85da890488b78b3f3f239b94ac7d63271bfef6d1927ea58ac4c7e92531490fd8 | Python | 15,105 | 386 | ###############################################################################
# _bidsmap.py defined Bidsmap class which manages the interactions with
# recording identificating map
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: ... |
7faa5729957055132a4171daeeca3b00cdd48dcc27f6fceab048ce3bee024dba | Python | 15,124 | 389 | #############################################################################
# prepare.py is a script that prepares source dataset for bidsification
# it identifies the subjects, sessions and series that each recording
# in the source dataset belongs and sort them accordingly
##########################################... |
0aa464e189062e4c22fdc203ad9b0eef16fd36f6b472240de4afd8917c5988a9 | Python | 15,131 | 442 | """ FSL IO """
from __future__ import with_statement
import os
from os.path import join as pjoin
from subprocess import Popen, PIPE
import numpy as np
import numpy.linalg as npl
from numpy import newaxis
from scipy.ndimage import map_coordinates as mc
from scipy.ndimage import affine_transform
from dipy.io.dpy impo... |
90708189c80fd6fdd8003d0e83491efe53a680e2630b13509d89902ac5b0d36c | Python | 15,165 | 403 | ###############################################################################
# EEG.py provides the base class for EEG recordings, all EEG classes should
# inherit from this class
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: N... |
762e666a892778cffa168b54f203f72f683f43c4f69772e9c534869e340e445a | Python | 15,173 | 438 | import numpy as np
from scipy.optimize import fmin_l_bfgs_b
from sklearn.utils.optimize import newton_cg
from scipy.special import expit, exprel
from scipy.linalg import eigvalsh
from sklearn.utils.multiclass import check_classification_targets
from sklearn.linear_model.base import LinearClassifierMixin, BaseEstimator
... |
3641b43adfa0f742fc36a708147cc26f483906d98c54d32913c81f762d5c5be4 | Python | 15,178 | 463 | """Persist, resolve and verify content-addressed experiment manifests."""
import hashlib
import json
import re
import warnings
from datetime import datetime, timezone
from io import StringIO
from pathlib import Path
from typing import Any, TypeGuard
from ruamel.yaml.error import YAMLError
from talos.yaml.config impor... |
90b20ecab2c01a9ba04e4c16e47fead5a06bcc046ada4597bf35cbd06da6dcb0 | Python | 15,190 | 350 |
import ismrmrd
import os
import itertools
import logging
import numpy as np
import numpy.fft as fft
import xml.dom.minidom
import base64
import ctypes
import re
import mrdhelper
# Folder for debug output files
debugFolder = "/tmp/share/debug"
def process(connection, config, metadata):
logging.info("Config: \n%s"... |
0ebb0edf81266ec260fd7d9a8ae68489efc4ae297bd9a24dc057426744b261b8 | Python | 15,212 | 406 | """
Some graph functions. Usefull, to work with orthologs.
"""
import sys
import numpy as np
class HomologsGraph(object):
"""Undirected Graph class for homologs representation.
Note: score (sos) is given as int. maybe change to float,
but handling floats consumes 25% more memory!
And when compares to b... |
1435283a977e7dc970fbdf6d44997b8a5132e7dc0cae8b9292cc66f450594d30 | Python | 15,233 | 447 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""HTML reporting for coverage.py."""
import datetime
import json
import os
import shutil
import coverage
from coverage import env
from coverage.backward import i... |
b96f41d2cc96cba763271a1be638b28c10e9224ae481604cc5e4005524095098 | Python | 15,298 | 487 | import numpy as np
from numpy.testing import (run_module_suite,
assert_,
assert_equal,
assert_almost_equal,
assert_array_equal,
assert_array_almost_equal,
ass... |
b570488bc05accd4fe8d763cdf031dc88ef8cb67374418b167f497426deb8e94 | Python | 15,364 | 483 | #
# The Python Imaging Library.
# $Id$
#
# standard filters
#
# History:
# 1995-11-27 fl Created
# 2002-06-08 fl Added rank and mode filters
# 2003-09-15 fl Fixed rank calculation in rank filter; added expand call
#
# Copyright (c) 1997-2003 by Secret Labs AB.
# Copyright (c) 1995-2002 by Fredrik Lundh.
#
# See t... |
b8fcb430d22e6f9ecdbaf901cabac29386ab393a8fb3495e83f7c631cf6542c1 | Python | 15,414 | 522 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... |
5bba0b724ba2fd9831878b1a83524d0cc65c351a9b98d2f6bdf0a776dc5afbec | Python | 15,457 | 405 | import json
from django import forms
from django.conf import settings
from django.contrib.admin.utils import (
display_for_field, flatten_fieldsets, help_text_for_field, label_for_field,
lookup_field,
)
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.fields.related import ManyToMany... |
3206f3944e271b88e9d707bc5c02e38c04d2a1f3a2fbf6a6a5ead831c14a5cae | Python | 15,508 | 454 | """
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 ... |
9be9c6673e15c29acce36feab45956146a3bc91250c6406545c6687681f9f776 | Python | 15,510 | 427 | # -*- coding: utf-8 -*-
"""
click.parser
~~~~~~~~~~~~
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting and a lot more).
The pla... |
d527199a16fff6507d27eebfab777e163e2d56dfe4955c149b73bf5bc2f11878 | Python | 15,510 | 391 | ###############################################################################
# _bidsmap.py defined Bidsmap class which manages the interactions with
# recording identificating map
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: ... |
aac27477375c94dc9cd04770bc501439ae10614c98ccc9ed8f180101b8eaa5e3 | Python | 15,536 | 355 | from __future__ import annotations
import json
import re
from pathlib import Path
from typing import Final
import yaml
from _common import loads_toml
REPO_ROOT: Final[Path] = Path(__file__).resolve().parents[2]
CONFIG_PATH: Final[Path] = REPO_ROOT / 'governance.yml'
WORKFLOWS_DIR: Final[Path] = REPO_ROOT / '.github/... |
a25c7e1d517bd22c5647267db5ddc926c56bee63f6e451ed6566dc3538b1d34e | Python | 15,552 | 381 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... |
c800e85638e13f54c944ac3c98fdfad3448052a656fde2d0474e76121773b131 | Python | 15,644 | 357 | from tkinter import Menu, StringVar, messagebox, simpledialog, filedialog
import os.path as path
import re
from bidshandler import BIDSTree, Project, Subject, Session
from Biscuit.FileTypes import con_file, Folder, BIDSContainer
from Biscuit.utils.utils import create_folder, assign_bids_folder
from Biscuit.Windows.Se... |
2369ab9a8b600c0a019a5a6f5d4e18b8f81a0e13b490d59763f856f72f1c5e1e | Python | 15,667 | 425 | """Various conversions to save objects to disk."""
import ast
import logging
from json import JSONDecodeError
import cv2
import numpy as np
import numpy.typing as npt
import xarray as xr
import delta
from delta import imgops, utils
from delta.config import Config
from delta.lineage import Pole
from delta.model impor... |
0a5125293e12ab4b9fc5175ea768ee3b5718df5c4965474f6d47bd2bcf223e76 | Python | 15,706 | 449 | ###############################################################################
# BrainVision.py provides the implementation of EEG class for BrainVision
# file format
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: Nikita Beliy
# ... |
9adc3eeef3d7b2dd4f0e71aa8c2e04d3986555c17d0bb6fa1b3d444d91c13dc8 | Python | 15,708 | 424 | import ismrmrd
import logging
import numpy as np
import numpy.matlib
import base64
import re
import traceback
import ctypes
import xml.dom.minidom
import xml.etree.ElementTree as ET
from torch import optim
from collections import defaultdict
from myloss import *
from unet import UNet
from utils import *
from utils.cm... |
f7e6134797edc22fcf725547e8c4ff1bf660673ab2b95c5491615e78ec162541 | Python | 15,719 | 449 | ###############################################################################
# BrainVision.py provides the implementation of EEG class for BrainVision
# file format
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: Nikita Beliy
# ... |
115d703451f8604122716e4ff2ac5c78e703707d95524a3f30d4e4c96950976c | Python | 15,761 | 409 | import argparse
import warnings
import py
import six
from _pytest.config.exceptions import UsageError
FILE_OR_DIR = "file_or_dir"
class Parser(object):
""" Parser for command line arguments and ini-file values.
:ivar extra_info: dict of generic param -> value to display in case
there's an error pr... |
ebe0f45a4031beff459201d7487c0322fd25f46771f4c9ba679bee28d2c87d92 | Python | 15,763 | 440 | import os
import sys
from .globals import resolve_color_default
from ._compat import text_type, open_stream, get_filesystem_encoding, \
get_streerror, string_types, PY2, binary_streams, text_streams, \
filename_to_ui, auto_wrap_for_ansi, strip_ansi, should_strip_ansi, \
_default_text_stdout, _default_text... |
0881753219de18e214bd47a5c1c043ee3ea15120debe005511077b8baada9792 | Python | 15,806 | 464 | from __future__ import absolute_import
from datetime import datetime, timedelta
from kombu import Queue
from celery import Task
from celery.exceptions import Retry
from celery.five import items, range, string_t
from celery.result import EagerResult
from celery.utils import uuid
from celery.utils.timeutils import pa... |
71b1a0faea84be424b4f95a9a176d75dcfca825fcff1e475a1ef93ba84d8983f | Python | 15,806 | 565 | # -*- coding: utf-8 -*-
"""## Dataloader
- Split dataset into training dataset(90%) and validation dataset(10%).
- Create dataloader to iterate the data.
"""
import torch
from torch.utils.data import DataLoader, random_split
from torch.nn.utils.rnn import pad_sequence
import joblib
from torch.utils import data
impor... |
ab2ec6926da141683c1efa23e7c88746c06371d1383782b48aa54b70d4c3c2ab | Python | 15,850 | 492 | import warnings
from functools import wraps
import numpy as np
from scipy import ndimage as nd
from brainglobe_space.utils import deprecated, ordered_list_from_set
def to_target(method):
"""Decorator for bypassing AnatomicalSpace creation."""
@wraps(method)
def decorated(spaceconv_instance, space_descr... |
79ddc6dfdba7bd5101ac16550f09c4d0516ba1136c38b91b27f4f0213e428c25 | Python | 15,959 | 558 | """
Cycler
======
Cycling through combinations of values, producing dictionaries.
You can add cyclers::
from cycler import cycler
cc = (cycler(color=list('rgb')) +
cycler(linestyle=['-', '--', '-.']))
for d in cc:
print(d)
Results in::
{'color': 'r', 'linestyle': '-'}
{'color'... |
440de13dd0b13f3d1fef45cf138d23c004055410787cdacb70ba45a070636852 | Python | 15,962 | 348 | """Convert DICOM data to BIDS based on the respective study specification"""
__docformat__ = 'restructuredtext'
import os.path as op
from os.path import isabs
from os.path import join as opj
from os.path import basename
from os.path import lexists
from os.path import relpath
from datalad.interface.base import Interf... |
9c08ddf65f4f2a0933f80b1b9dd0c2425263bec2b58dcce2b5ad2f8baac0394c | Python | 15,991 | 354 | """Committed identity and configuration checks stop before trusted caller imports."""
import json
import pytest
from click.testing import CliRunner
from talos.cli.main import cli
from talos.yaml.compiler import CompiledSFD
from talos.yaml.errors import ValidationError
from talos.yaml.store import (
canonical_mani... |
79ef03e8dc95cf42086304a6cee9fc864a8f31d77d30dad7a47aaeb51f9dbc59 | Python | 16,036 | 421 | import numpy as np
import numpy.testing as npt
from dipy.data import get_fnames
from dipy.sims.voxel import add_noise
from dipy.segment.mrf import (ConstantObservationModel,
IteratedConditionalModes)
from dipy.segment.tissue import (TissueClassifierHMRF)
# Load a coronal slice from a T1-... |
f0028b32a9dd2a932185d9c5ef1e58fc92d838b1a718b627f3f63a42d88f31bd | Python | 16,039 | 520 | """
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... |
9641e2d5bd2906f53d3c7b80061721e5174ef7e96cacce4e0d919784a49971eb | Python | 16,054 | 490 | ###############################################################################
# BidsMeta.py contains a set of classes and functions to create BIDS-complient
# tabular and JSON files
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author:... |
36677c2832339573f716af651604bbe95f384b297ea25884633cb12515248024 | Python | 16,058 | 420 | """
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... |
01106540bfe3cdccfc4fc226cd5baff7f0b496a2c187857984ce89a1d49b35ec | Python | 16,065 | 340 | # -*- coding: utf-8 -*-
# This file was created based on what is explained in:
# https://code.djangoproject.com/wiki/InitialSQLDataDiangoORMWay
from django.utils.translation import ugettext as _
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from os... |
7434a17911a89f0b0502be2347a8acf1469f2250bdaee15984bc85b065c267b2 | Python | 16,070 | 396 | import re
from django.conf import settings
from django.contrib.gis.db.backends.base.operations import (
BaseSpatialOperations,
)
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import GeometryField, RasterField
from django.contrib.gis.gdal import GDALRaster
from d... |
beddaf7567a40f46c43d3f8bfa8bddc62b794566c19f74437513268cf04e8257 | Python | 16,071 | 466 | from __future__ import absolute_import
import sys
import types
from contextlib import contextmanager
from celery.exceptions import ChordError
from celery.five import items, range
from celery.utils import serialization
from celery.utils.serialization import subclass_exception
from celery.utils.serialization import fi... |
2892ee127d480c93b5f57e1e2d8851c9a33e0029f12a48a6a06b32027cc67600 | Python | 16,104 | 536 | # coding: utf-8
"""
ASN.1 type classes for certificate revocation lists (CRL). Exports the
following items:
- CertificateList()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
import hashlib
from .algo... |
76e6098bdf99e801ceed3e63f5a87d8049e069b6686fa0244c3d31a782cf37fa | Python | 16,107 | 412 | #!/usr/bin/env python2
desc="""FastA index (.fai) handler compatible with samtools faidx (http://www.htslib.org/doc/faidx.html).
.fai is extended with 4 columns storing counts for A, C, G & T for each sequence.
"""
epilog="""Author: l.p.pryszcz+git@gmail.com
Bratislava, 15/06/2016
"""
import os, sys
from datetime impo... |
4caecd3d981c60cbfc280e31188bf70e472be2d69895e4e423a5aa7ded151af0 | Python | 16,158 | 298 | #! /usr/bin/python3.7
# -- coding: utf-8 -- **
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 PyQt... |
31c5de9c8c60da55ebd7d431297f811a97193240d2e2bfc235ffcc2245ca1a62 | Python | 16,163 | 393 | """Module containing functional implementations of 3D transformations.
This module provides a collection of utility functions for manipulating and transforming
3D volumetric data (such as medical imaging volumes). The functions here implement the core
algorithms for operations like padding, cropping, rotation, and oth... |
fb0e25b2f7c0617fae57d8dcab277fb8ea0df525555c53ad107bd4211b9b5d28 | Python | 16,168 | 390 | ''' Classes and functions related to the management of sets of BIDSVariables.
Why 'kollekshuns'? Because 'collections' would conflict with the standard lib
module of the same name on Python 2. We could go with something sensible but
verbose like 'variable_collections', but that would make far too much sense.
'''
impo... |
6852f35f8ac4d85e7c510a18602167ceca8238c8af9dfa0129430d76544f2c04 | Python | 16,171 | 288 | # 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, Moun... |
f9bc8a4c2d30d9a38342626df52855ea1affec7f293725e8b8503e2b0267584b | Python | 16,172 | 393 | #DEGnext
#Copyright Tulika Kakati 2020
#Distributed under GPL v3 open source license
#This code may be used to test the DEGNextModel.pth on new datasets.
############################################
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data ... |
273aa34ad8e9cf3ac32b866d306ef3ca64c42f78eb94f92a3f439ed97dfb86f2 | Python | 16,178 | 466 | ###############################################################################
# config.py manages the parcing of command line and
# configuration file interface
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: Nikita Beliy
# Owner... |
1c70a38187830c30b59b6a294ffc8aabd6c5a537facaa30ebca7efa00498d49b | Python | 16,202 | 450 | from random import Random
import pytest
from albumentations.augmentations.blur import functional as fblur
import numpy as np
@pytest.mark.parametrize(
"low, high, expected_range",
[
(-8, 7, {3, 5, 7}), # negative low
(2, 6, {3, 5, 7}), # even values
(1, 4, {3, 5}... |
f5ad98e84c704aac7aa954dc3a4c9e004b3950b4c6c050d1e762fb6fc7800e0e | Python | 16,220 | 487 | from __future__ import division
from warnings import warn
import numpy as np
from dipy.reconst.cache import Cache
from dipy.reconst.multi_voxel import multi_voxel_fit
from dipy.reconst.csdeconv import csdeconv
from dipy.reconst.shm import real_sph_harm
from scipy.special import gamma, hyp1f1
from dipy.core.geometry im... |
abf8d51265d55b012331171b3cce5789cff8c07d019d4ef89fb36f48e4781df6 | Python | 16,227 | 487 | """MySQLdb Cursors
This module implements Cursors of various types for MySQLdb. By
default, MySQLdb uses the Cursor class.
"""
from __future__ import print_function, absolute_import
from functools import partial
import re
import sys
from .compat import unicode
from ._exceptions import (
Warning, Error, InterfaceE... |
a8c8600805b44b4f4fac67d6756a53cf8a0c6c34559a09799023fea96cf34c3b | Python | 16,259 | 494 | """
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... |
a476e071bf13cb2cd9b6928912e752ffab5f783d19a94b41933f27673fa836ec | Python | 16,304 | 379 | """Framework imports occur only when an adapter is used."""
import copy
import gc
import hashlib
import importlib
import inspect
import json
import numbers
import sys
import tempfile
from collections.abc import Mapping
from pathlib import Path
def reference(value):
if isinstance(value, str):
return value
... |
7b10bb18d0a2be9e01ff96f3ba2d9af92c256f53067ca9aa9e6941dc973dc52b | Python | 16,315 | 509 | """
Convert between bytestreams and higher-level AMQP types.
2007-11-05 Barry Pederson <bp@barryp.org>
"""
# Copyright (C) 2007 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 Fr... |
ff075056000a2323aeda610a2b5d788fc7dc7e03437b7cba7d7559305b18ee53 | Python | 16,327 | 424 | ###############################################################################
# EEG.py provides the base class for EEG recordings, all EEG classes should
# inherit from this class
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: N... |
7fa8705a55989ce427f2b28fb54ed6698cb90419562145b851d2ba1cf5f3692b | Python | 16,357 | 533 | #!/usr/bin/env python
import sys
import os
files_dir = "erc2-chromatin15state-all-files"
if not os.path.exists(files_dir):
raise SystemError("Could not find files directory...\n")
marks = [ '1_TssA',
'2_TssAFlnk',
'3_TxFlnk',
'4_Tx',
'5_TxWk',
'6_EnhG',
... |
355af82c65cb855aaba5c2b933e67ff014d8102d1d7a6f770a93d12db3f764fc | Python | 16,371 | 473 | ###############################################################################
# config.py manages the parcing of command line and
# configuration file interface
###############################################################################
# Copyright (c) 2019-2020, University of Liège
# Author: Nikita Beliy
# Owner... |
4b6e1ab2751166ffb243034fafdbd2afdbd7e32c993cfdc858d75a4257b26fe2 | Python | 16,389 | 417 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Raw data collector for coverage.py."""
import os
import sys
from coverage import env
from coverage.backward import litems, range # pylint: disable=redefine... |
3151b16da6ca5c33e002674c1372bccd2999f5b4e32a432f88108fd111e8ba6e | Python | 16,477 | 474 | from __future__ import absolute_import
import errno
import signal
import sys
from celery.bin.multi import (
main,
MultiTool,
findsig,
abbreviations,
parse_ns_range,
format_opt,
quote,
NamespacedOptionParser,
multi_args,
__doc__ as doc,
)
from celery.tests.case import AppCase, ... |
f01dd6968268dec636a730a43143d91e0ed1e6ef2b36285a4b55467a578b6a3a | Python | 16,490 | 512 | from __future__ import absolute_import
import errno
import socket
from billiard.exceptions import RestartFreqExceeded
from celery.datastructures import LimitedSet
from celery.worker import state as worker_state
from celery.worker.consumer import (
Consumer,
Heart,
Tasks,
Agent,
Mingle,
Gossip... |
323996f221fc4ef50520aa8a1e584aaffabeacb3af09b4abc829cd90d057260d | Python | 16,535 | 442 | #
# The Python Imaging Library
# $Id$
#
# drawing interface operations
#
# History:
# 1996-04-13 fl Created (experimental)
# 1996-08-07 fl Filled polygons, ellipses.
# 1996-08-13 fl Added text support
# 1998-06-28 fl Handle I and F images
# 1998-12-29 fl Added arc; use arc primitive to draw ellipses
# 1999-01... |
0cdddc9cecf7612f97bf614414fbf13e9cd832a73f8a470bbd30dac90d895ede | Python | 16,539 | 476 | import warnings
import numpy as np
import polars as pl
import pytest
from openslide import OpenSlideUnsupportedFormatError
from PIL import Image, UnidentifiedImageError
import histoprep.functional as F
from histoprep import SlideReader
from histoprep._backend import CziBackend, OpenSlideBackend, PillowBackend
from hi... |
5e094f5867445d30eb8a5e7bb56834e699063d59819e166c48892696ddda1b4e | Python | 16,588 | 419 | #############################################################################
# bidsify.py is a script that bidsifyes prepared dataset accordingly to
# created identification map
#############################################################################
# Copyright (c) 2018-2020, University of Liège
# Author: Nikita... |
9fdcbee6cc1f5e92a18afccd934263cb12165915679ddbfa7d3889ed59df47b5 | Python | 16,603 | 420 | #############################################################################
# process.py is a script that apply process step on prepared dataset
#############################################################################
# Copyright (c) 2018-2020, University of Liège
# Author: Nikita Beliy
# Owner: Liege University... |
2567b1b5fb583aa0007b73bd0753f11cd2f13915013d478c8fa76d5aec0912d4 | Python | 16,611 | 516 | """
This module is for hemodynamic reponse function (hrf) specification.
Here we provide for SPM, Glover hrfs and finite timpulse response (FIR) models.
This module closely follows SPM implementation
Author: Bertrand Thirion, 2011--2015
"""
import warnings
import numpy as np
def _gamma_difference_hrf(tr, oversampli... |
77d0a4cd91f1e7a5389fd1b120ed64a9d9a0f4b48a36e70024689e36a64292a5 | Python | 16,627 | 467 | import warnings
from decimal import Decimal
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
from django.contrib.gis.db.models.sql import AreaField, DistanceField
from django.contrib.gis.geos import GEOSGeometry
from django.core.exceptions import FieldError
from django.db.models import (... |
feb3801467aec649b4abdab27ceb17e8ff348a4c2d4a4bdccbcc10654fa405a2 | Python | 16,634 | 467 | import json
import os
import sys
import uuid
from ctypes import (
addressof, byref, c_buffer, c_char_p, c_double, c_int, c_void_p, string_at,
)
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
fro... |
84142d619495685ce7565570e369ee4a4b1143dbaa6cab1de074132dd64d440b | Python | 16,657 | 417 | import inspect
from importlib import import_module
from pathlib import Path
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.admindocs import utils
from django.contrib.admindocs.uti... |
5212dec2e879974b9cd6a83fff43614971757c04a26d682ddd7da1f05a49b28f | Python | 16,682 | 461 | #! /usr/bin/python3.7
# -- coding: utf-8 -- **
import os
import time
import multiprocessing
import eePipeline
Filename1 = 'task_log.txt'
Filename2 = 'task_done.txt'
FILEPATH = os.path.join(os.getcwd(), 'data', 'recv') # '/home/hello/reconModule_test/testCS/data/recv/'
FILEPATH2 = os.path.join(os.getcwd(), 'data', 're... |
523d25768e27240dcee09229f70208cd0505f4b47c628c2140b301c8dd0aab20 | Python | 16,690 | 482 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""
.. versionadded:: 4.0
Plug-in interfaces for coverage.py.
Coverage.py supports a few different kinds of plug-ins that change its
behavior:
* File tracers imp... |
96674fc81c05292c647d38d53ce29a4c3e919e786cd4520774e85c6dc56685a4 | Python | 16,717 | 441 | # -*- coding: utf-8 -*-
"""
celery.app.trace
~~~~~~~~~~~~~~~~
This module defines how the task execution is traced:
errors are recorded, handlers are applied and so on.
"""
from __future__ import absolute_import
# ## ---
# This is the heart of the worker, the inner loop so to speak.
# It used to be s... |
0ea689db02061fb76a5f145a866b71b8302a2359d4e58bc14a086c8d17db2f0d | Python | 16,794 | 508 | import numpy as np
from scipy.special import psi, gammaln
from scipy.misc import logsumexp
from sklearn.base import BaseEstimator
from sklearn.utils.extmath import safe_sparse_dot
from sklearn.utils.validation import check_is_fitted
from scipy.sparse import isspmatrix
from sklearn.utils import check_array
def _e_log_... |
25353261e78e6c133bdba845b4685b9d65510726fc5e83ee1610f2de61b14a03 | Python | 16,862 | 424 | import numpy as np
from dipy.utils.optpkg import optional_package
matplotlib, has_mpl, setup_module = optional_package("matplotlib")
plt, _, _ = optional_package("matplotlib.pyplot")
def _tile_plot(imgs, titles, **kwargs):
"""
Helper function
"""
# Create a new figure and plot the three images
fig... |
b94ee22898bf00252163bbe9cbdb13504754de82268344b317c68befc137284d | Python | 16,877 | 396 |
import torch
from torch.nn.parameter import Parameter
import numpy as np
import torch.nn as nn
from utils.polarTransforms import *
from saveNet import *
class RadialBatchNormalize(nn.Module):
def __init__(self, rank, num_features ,eps=1e-5, momentum=0.1, affine=True, track_running_stats=True, polar=False):... |
6dfaeff088538ca5e8a30f9d61ea845b9938897e062b6c354ab6ea6ae5bfdb6c | Python | 16,903 | 494 | """Functional implementations of image cropping operations.
This module provides utility functions for performing various cropping operations on images,
bounding boxes, and keypoints. It includes functions to calculate crop coordinates, crop images,
and handle the corresponding transformations for bounding boxes and k... |
5ed45dca34d60075473aa46f46aa139b65e6cf9addee4445641cf11e142d573c | Python | 16,936 | 337 | from __future__ import division
import os
import time
import random
from glob import glob
import tensorflow as tf
import numpy as np
from collections import namedtuple
from module import *
from utils import *
class cyclegan(object):
def __init__(self, sess, args):
self.sess = sess
self.batch_size... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.