sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
ac84399335386904b5ba7351d02259212fcf70e026aeb6b34bdd2613ec12a484 | Python | 16,962 | 267 | #! /usr/bin/python3.7
# -- coding: utf-8 -- **
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow, QSizePolicy, QMessageBox, QWidget, \
QPushButton, QLineEdit, QDesktopWidget, QGridLayout, QFileDialog, QListWidget, QLabel, \
QFrame, QGroupBox, QTableWidget
from P... |
bc93a60a023c756a66c1808429c2ab169ee0707de3394a7c4e2474e6e1e1ca9d | Python | 16,986 | 428 | #############################################################################
# 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... |
cc45192f0191578b52b7b89b413a04d012363082561cb39508913090021fff3c | Python | 17,009 | 467 | """
Form Widget classes specific to the Django admin site.
"""
import copy
import json
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models.deletion import CASCADE
from django.urls import reverse
from django.urls.exceptions import NoReverseM... |
7315a66ae7a2f844bb87080404b8ae87889148438f9437ce753c565444e8c0da | Python | 17,122 | 489 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Config file for coverage.py"""
import collections
import os
import re
import sys
from coverage.backward import configparser, iitems, string_class
from coverage... |
88184594dfd6b92b53615c87598e8cabadb233b25cd551d8e9c5d485c0b14c9d | Python | 17,127 | 431 | from __future__ import print_function, division
from methods import base
import segmentation_models_pytorch as smp
import torch.optim
import torch.nn as nn
import glob
from torch.utils.data import DataLoader
from torchvision.transforms import Compose
from tqdm import tqdm
from torch.cuda.amp import autocast, GradScale... |
66f50372735b12921dec49ab1d43854bc1798483bf518f28339ecf2bf2ccf877 | Python | 17,157 | 423 | from dipy.align import floating
import numpy as np
import numpy.linalg as npl
import scipy.ndimage.filters as filters
class ScaleSpace(object):
def __init__(self, image, num_levels,
image_grid2world=None,
input_spacing=None,
sigma_factor=0.2,
mas... |
faab392464a34e914bc46a7327742594f67bfd5c5c81bef2fe9727e7f34136aa | Python | 17,189 | 358 | # -*- coding: utf8 -*-
"""
Creates AdExpIF PC and BC populations in Brian2, loads in recurrent connection matrix for PC population
runs simulation and checks the dynamics
authors: András Ecker, Bence Bagi, Szabolcs Káli last update: 06.2022
"""
import os
import sys
import numpy as np
import random as pyrandom
from bri... |
4e0df18b4c55afae401d0d4dedbad32c367f0920fe0ab8fb4830df8740bf5937 | Python | 17,192 | 315 | # 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 ... |
34378eef0516ed94fa420c7b7319300eb19d507292a342ccafb378dc73626e25 | Python | 17,240 | 418 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.contrib.admin.op... |
7a4416d8cdf6d04d1319955c63628ab6caf819a7a3c5ddc88e2b4cb8d1402015 | Python | 17,244 | 455 | # ######################### LICENSE ############################ #
# Copyright (c) 2005-2018, Michele Simionato
# 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 so... |
d8ddb7d7fb60458f67ed8ca387b441204af44ba8c7391a56a00da851c5f5c9de | Python | 17,292 | 342 | #!/usr/bin/env python3
"""
MAG-S2 confirmatory analysis, protocol version 0.1.
I1-I5 code and physics invariants: "bug" invalidates the run
Q1-Q3 expectations: the atlas check of the pipeline in the run itself and the physics of the compass
H1-H4 hypotheses: "met", "not met" or "not testable"
A seed is on... |
3d4db61dd141cdfb750be2b87b2d559ff68c41a4be47e871d54e8e974f0fde67 | Python | 17,306 | 479 | """Generate publication-quality data acquisition methods section from BIDS
dataset.
Parsing functions for generating the MRI data acquisition portion of a
methods section from a BIDS dataset.
"""
from __future__ import print_function
import logging
from os.path import basename
import math
from num2words import num2wo... |
7b40f3a02c7fc55e4b79b112d946d721ab0fe6e5183be2681cfb2c75b4e2c49c | Python | 17,331 | 496 | # -*- coding: utf-8 -*-
from unittest.mock import patch
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils.translation import ugettext as _
from django.urls import reverse
from dateutil.relativedelta import relativedelta
from datetime impor... |
ce81e2c2c787ed5c3960e71eae10cca552a883d42020f5daecf39d31379be893 | Python | 17,387 | 539 | from __future__ import absolute_import
import errno
from datetime import datetime, timedelta
from pickle import dumps, loads
from celery import beat
from celery.five import keys, string_t
from celery.schedules import schedule
from celery.utils import uuid
from celery.tests.case import AppCase, Mock, SkipTest, call, ... |
8ae9a67a40b629b5f3018de44fcc9d8f94610948e8406b93e778bab77761d314 | Python | 17,398 | 468 | #!/usr/bin/env python3
"""Fail-loud gate -- ratchet on silent-fallback patterns.
This gate counts seven AST-detectable silent-fallback categories in
the production package and refuses any PR that grows any category's
total. Same base-vs-head ratchet as the typing gate: the head budget
cannot be weakened in the same PR... |
2b269c950f023e96bb02eac0b06680d36adab20530d8a38e79f971c0062d975a | Python | 17,412 | 468 | import numpy as np
from numpy.random import multinomial
from scipy.special import expit
from scipy.misc import logsumexp
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import gen_even_slices, check_array
from sklearn.utils.extmath import safe_sparse_dot
from sklearn.utils.validation import ... |
5b2f6aa4679c5991527f7f219de91c748a21dd0365d96530d881c3905fb2b066 | Python | 17,470 | 423 | import functools
import sys
import threading
import warnings
from collections import Counter, OrderedDict, defaultdict
from functools import partial
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from .config import AppConfig
class Apps:
"""
A registry that stores the configura... |
4b252ab89570217a3910307b7e37d4c6be378c970242237ab440e4d64d72e351 | Python | 17,496 | 439 | #############################################################################
# bidsify.py is a script that bidsifyes prepared dataset accordingly to
# created identification map
#############################################################################
# Copyright (c) 2018-2020, University of Liège
# Author: Nikita... |
fdefd0bab9969a3cae109f2da33bac232073858978745e863cc6b6bd92ab85f3 | Python | 17,527 | 580 | #
# Module for starting a process object using os.fork() or CreateProcess()
#
# multiprocessing/forking.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
import os
import sys
import signal
import warnings
from pickle import load, HIGHE... |
ac36fb6433c67dc67a1517f7648ecb3a435bcd6a9a3af0480b3e56dbf43ee5de | Python | 17,542 | 457 |
#
# myloss.py : implementation of the Dice coeff and the associated loss
#
from math import exp
import torch
from torch.autograd import Function, Variable
from torch.nn.modules.loss import _Loss
import numpy as np
import torch.nn.functional as F
from saveNet import *
class DiceCoeff(Function):
"""Dice coeff f... |
5da4c1309cacbab885b37252a6a7e032a4fd5239096214e84f788282ffb1044c | Python | 17,714 | 465 | #!/usr/bin/env python3
"""Version gate -- every PR must bump version and record a CHANGELOG trail.
Enforces seven rules, all deterministic:
1. The head commit's `pyproject.toml` is different from the base's.
2. `[project].version` at the head is strictly greater than at base
(semver compare).
3. The head c... |
8201f7887ddc3078f29a62e54ea6639f0d1cfb547b861fd0154cf6a0a9bfc432 | Python | 17,760 | 291 | #! /usr/bin/python3.7
# encoding=utf-8
from PyQt5.QtWidgets import QApplication, QSizePolicy, QMessageBox, QWidget, \
QPushButton, QLineEdit, QDesktopWidget, QGridLayout, QFileDialog, QListWidget, QLabel,QFrame,QGroupBox,QProgressBar
from PyQt5.QtCore import Qt, QThread
import PyQt5.QtWidgets as QtWidgets
import... |
8c5fc5e7ec707004eac6cfb6429a3d57cde585f0cd62e6594dde0e0e92a7c803 | Python | 17,792 | 652 | # coding: utf-8
"""
ASN.1 type classes for the online certificate status protocol (OCSP). Exports
the following items:
- OCSPRequest()
- OCSPResponse()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
f... |
58b2a5d85d82f60369784e75f85b961d6d2242515d381e011a5d8928dad550b6 | Python | 17,934 | 485 | import datetime
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (
display_for_field, display_for_value, label_for_field, lookup_field,
)
from django.contrib.admin.views.main import (
ALL_VAR, ORDER_VAR, PAGE_VAR, SEARCH_VAR,
)
from django.co... |
a35024cb83fd9c8f8f3c025cf4feb29196e4dbebc2f24cd8a266369a07498f8d | Python | 17,953 | 514 | """
BORIS
Behavioral Observation Research Interactive Software
Copyright 2012-2020 Olivier Friard
module for testing export_observation.py
pytest -vv test_export_observation.py
"""
import pytest
import sys
import json
import os
from pathlib import Path
from openpyxl import load_workbook
import tablib
sys.path.inser... |
081d761b1fe685b36ad6d3d812d6dad02a8e81d88775c5843deb39f5b5c27eec | Python | 17,971 | 318 | # -*- coding: utf-8 -*-
"""
aid_imports
list of each import
---------
@author: maikherbig
"""
import os,shutil,json,re,urllib
import sys,traceback,ast
import numpy as np
import h5py,time
import hdf5plugin
import gc,tempfile
import pandas as pd
import tensorflow as tf
from tensorflow import *
from te... |
7a981ac6f4a5b3411da3790c67c55daffa662928578dd5f5484ab5b0e176aa5c | Python | 18,010 | 453 | """Functional implementations for domain adaptation image transformations.
This module provides low-level functions and classes for performing domain adaptation
between images. It includes implementations for histogram matching, Fourier domain adaptation,
and pixel distribution matching with various normalization tech... |
95b4fc93d5d91302104173d8a851a506e2095e70deb3f4a7bda7ff7907b1ee92 | Python | 18,011 | 408 | """
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... |
b3082324125fc6c91d2f3022509fe327d940ce49fcdee9f94eabe2e1f57ca7df | Python | 18,021 | 478 | # 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 math
from cryptography import utils
from cryptography.exceptions ... |
74bbe384937701f91d35942ad6c61bfee3ea914313a6779a097dd12ab194c908 | Python | 18,032 | 500 | """
Testing the Intravoxel incoherent motion module
The values of the various parameters used in the tests are inspired by
the study of the IVIM model applied to MR images of the brain by
Federau, Christian, et al. [1].
References
----------
.. [1] Federau, Christian, et al. "Quantitative measurement
of brain ... |
9b775ced7b66422abffee0b41b68dcc876246893ec9e6eca1805a20978fec62a | Python | 18,043 | 712 | # coding: utf-8
"""
Miscellaneous data helpers, including functions for converting integers to and
from bytes and UTC timezone. Exports the following items:
- OrderedDict()
- int_from_bytes()
- int_to_bytes()
- timezone.utc
- inet_ntop()
- inet_pton()
- uri_to_iri()
- iri_to_uri()
"""
from __future__ import ... |
c0776d37a04982911d85153cbad49f0e4eb3968193276c64abc4264555ede514 | Python | 18,059 | 511 | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
# Copyright 2023 Masatoshi Suzuki (@singletongue)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... |
02de4ec48fff0dc33161aebc807f96678f19b24c92cfd7ac7508db92d6855049 | Python | 18,125 | 470 | import numpy as np
from numpy.testing import (assert_equal,
assert_array_equal,
assert_array_almost_equal,
assert_raises)
from dipy.align import floating
from dipy.align import expectmax as em
def test_compute_em_demons_step_2d():
r"... |
f2c667a1b639ef863ecfcd4ecd851ff00ad6bb852fba93576c66b85338c5a358 | Python | 18,273 | 461 | """Transform classes for dropout-based augmentations.
This module contains transform classes for various dropout techniques used in image
augmentation. It provides the base dropout class and specialized implementations like
PixelDropout. These transforms randomly remove or modify pixels, channels, or regions
in images... |
e2c510f1eba5670a1a211c523b0c5538df3a4249d8d913bd49ff1dbedcf24d9b | Python | 18,311 | 544 | # -*- coding: utf-8 -*-
"""
celery.events.cursesmon
~~~~~~~~~~~~~~~~~~~~~~~
Graphical monitor of Celery events using curses.
"""
from __future__ import absolute_import, print_function
import curses
import sys
import threading
from datetime import datetime
from itertools import count
from textwrap import... |
2eaadd10b85158fad6d38659e52cd090339a9982ae389ed039b363c8df5f16db | Python | 18,336 | 452 | import torch
import pandas as pd
import numpy as np
from torchdiffeq import odeint
import plotly.figure_factory as ff
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
# Data operations
class EluTimeControl(torch.nn.Module):
"""
Very simple Elu architectur... |
8a252b63dfc8621c81e304addbb6c22a75d6822afd81f2a1ac17c02463c0669b | Python | 18,340 | 499 | """Module for reading and writing bzip2-compressed files.
This module contains a backport of Python 3.4's bz2.open() function and
BZ2File class, adapted to work with earlier versions of Python.
"""
__all__ = ["BZ2File", "open"]
__author__ = "Nadeem Vawda <nadeem.vawda@gmail.com>"
import io
import sys
import warning... |
f0a25ce2440b223486c18aa9943848a69fcaf78420a5fa735562cf5e19448275 | Python | 18,357 | 513 | """Schedule parameter combinations with filters and checkpointed interventions."""
from __future__ import annotations
from collections import deque
from collections.abc import Callable
from typing import Any, cast
from talos.experiment.param_domain import ParamDomain, values_equal
from talos.experiment.param_search.... |
bf6d069942d0260fba3147efd4a508703cb7e5ee2a37da5dc5557b4f1e4f2f9f | Python | 18,361 | 418 | import numpy as np
import pandas as pd
from os.path import join
from bids.utils import listify
from .entities import NodeIndex
from .variables import SparseRunVariable, DenseRunVariable, SimpleVariable
import warnings
BASE_ENTITIES = ['subject', 'session', 'task', 'run']
ALL_ENTITIES = BASE_ENTITIES + ['datatype', 's... |
e9cc95dca165a005770c88acb0e7d7cd4a4558ddef007c43d76f6bc6ec1ad06e | Python | 18,361 | 456 | ###############################################################################
# mapper.py is a script that tries to identify each recordings in the prepared
# dataset using template map, and creates a local bidsmap
###############################################################################
# Copyright (c) 2018-20... |
cd871d718e9f131ff74ce81b5c078b01b45159fd9c1a0a45c7fc3a3baecec6f0 | Python | 18,370 | 484 | """Test spherical harmonic models and the tools associated with those models.
"""
import warnings
import numpy as np
import numpy.linalg as npl
from dipy.testing import assert_true
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal, assert_raises, run_modu... |
4a35cdbf49df168b785a58ca6bf397cb05a9197d4067f5cf6e041038a02ea9a1 | Python | 18,425 | 621 | """Command-line interface of DeLTA."""
import argparse
import logging
from pathlib import Path
from typing import cast, get_args
import keras
import delta
from delta.config import MODEL, PRESETS, Config
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
level=logging.WARNING... |
752cfc31569716f9e7b7037b7bd8dad3a93fee756f776ec52f2cecd2b832ca07 | Python | 18,446 | 347 | # Author: Timothée Proix
# License: GPL-3.0-only
import os
import numpy as np
import scipy.io as sio
from sklearn import *
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import pandas as pd
from scipy.sparse import *
import copy
from statsmodels.stats.anova import anova_lm
import statsmodels.api... |
997e60ba30dfbafc03586937dbec2d376ef14795add438dabae78026ea40a984 | Python | 18,481 | 392 | """Bounded regressions for the legacy security candidate, with real Iris behavior."""
import contextlib
import hashlib
import importlib
import io
import json
import tarfile
import zipfile
from importlib import metadata
from pathlib import Path
import pytest
installed_keras = next(metadata.distributions(name='keras'),... |
7a2aeac7eb1c28fcfc6e02e8bad79308c90e02726b7db26cf5093cd9f4828373 | Python | 18,584 | 539 | import datetime
import decimal
from collections import defaultdict
from django.core.exceptions import FieldDoesNotExist
from django.db import models, router
from django.db.models.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.forms.utils import pretty_name
from django.urls impo... |
8b47af2848f0f3e38f6724fbec58ebeeafa7ad528f2b293721b43de23273a0e9 | Python | 18,647 | 671 | # -*- coding: utf-8 -*-
"""
celery.datastructures
~~~~~~~~~~~~~~~~~~~~~
Custom types and data structures.
"""
from __future__ import absolute_import, print_function, unicode_literals
import sys
import time
from collections import defaultdict, Mapping, MutableMapping, MutableSet
from heapq import heapify... |
57b60c4cff4c88a86e80e1a885e7b15040b1af3181ed67dcccdbfc627f67497c | Python | 18,663 | 456 | 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 *
# params = Parameters()
def resizeImage(img,newSize, Interpolation=False):
if img.ndim == 2:
img = np.expand_dims(img, 2)
if Int... |
f9bafe2b90068a51ed21e6e6f52e1a0aba79acd947aab88830edca8a49c85981 | Python | 18,663 | 525 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
0ab30ca8cdddbb314c0add713c70dfec6369a7bfbda2d0891623764781d52375 | Python | 18,700 | 588 | from __future__ import absolute_import
import sys
from anyjson import dumps
from datetime import datetime
from celery import __main__
from celery.platforms import EX_FAILURE, EX_USAGE, EX_OK
from celery.bin.base import Error
from celery.bin.celery import (
Command,
list_,
call,
purge,
result,
... |
0981bc24ac03e7fc4eeaec049f8c05d14ac49f475504699a27091271d2c324a6 | Python | 18,758 | 431 | from collections import OrderedDict
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_P... |
e87f9cad438dfbd0b3e8870737d40774b4fc3da41782befebe559dc5dc5bf228 | Python | 18,775 | 374 | """Execute release boundaries without publishing or manufacturing signed evidence."""
from __future__ import annotations
import hashlib
import json
import os
import shutil
import subprocess
import sys
from pathlib import Path
import pytest
import yaml
from _common import REPO_ROOT
WORKFLOW = REPO_ROOT / '.github/wor... |
b700d709daef4bb4f42809649d3fd7b9b4c834f7a85f2baa54f3674ac12a4203 | Python | 18,826 | 536 | # -*- coding: utf-8 -*-
"""This module defines the :class:`Request` class, that specifies
how tasks are executed."""
from __future__ import absolute_import, unicode_literals
import logging
import sys
from datetime import datetime
from weakref import ref
from billiard.common import TERM_SIGNAME
from kombu.utils.encod... |
e9ec48dce689dde302498b75fe00a0053cd867fea555f9b64a34b254ad3d57dd | Python | 18,838 | 582 | from __future__ import absolute_import
import pickle
from decimal import Decimal
from random import shuffle
from time import time
from itertools import count
from celery import states
from celery.events import Event
from celery.events.state import (
State,
Worker,
Task,
HEARTBEAT_EXPIRE_WINDOW,
H... |
824e12c981ecb82f5806de54592aaa42e96671d68d87c5fa9acdb04b6b1c3257 | Python | 18,890 | 572 | """ discover and run doctests in modules and test files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import platform
import sys
import traceback
from contextlib import contextmanager
import pytest
from _pytest._code.code import Excepti... |
91cc0231fc5c4bb26f776a7b74c98ad09e0d3bbf7e3a55506c92689095837072 | Python | 19,009 | 571 | # -*- coding: utf-8 -*-
"""
celery.beat
~~~~~~~~~~~
The periodic task scheduler.
"""
from __future__ import absolute_import
import errno
import os
import time
import shelve
import sys
import traceback
from threading import Event, Thread
from billiard import ensure_multiprocessing
from billiard.process ... |
7de0f9ac0b7f4760e1b2bece6538034e3778516fd0c9eed78ae6838981c30f5b | Python | 19,082 | 491 | #!/usr/bin/env python
desc="""Filter QSEQ/FastQ reads. Store output as FastQ.
Reads are clipped at first undetermined base (. in qseq or N in fastq)
and at first base having qual below -q.
Reads (and their pairs if -p) not passing filtering are discarded.
Orphaned reads may be store optionally (-u).
"""
epilog="""Autho... |
e11bd07011fa8bc905360696edc08652b6bc0d43d44818de5779560b5d210948 | Python | 19,089 | 521 | """Module for handling keypoint operations during augmentation.
This module provides utilities for working with keypoints in various formats during
the augmentation process. It includes functions for converting between coordinate systems,
filtering keypoints based on visibility, validating keypoint data, and applying
... |
c0e886dce6da2ebc3d63c96a31ce1c1f84a5d13daafdffa5984e8043eb7202d6 | Python | 19,099 | 494 | import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
Invali... |
30202609ddb48571803b48a557bf015143c337146913980b0fbbca228750b309 | Python | 19,101 | 512 | # -*- coding: utf-8 -*-
"""
celery.app.amqp
~~~~~~~~~~~~~~~
Sending and receiving messages using Kombu.
"""
from __future__ import absolute_import
import numbers
from datetime import timedelta
from weakref import WeakValueDictionary
from kombu import Connection, Consumer, Exchange, Producer, Queue
from... |
14b88c2117867b4d7734b892a2416797f3d5cbd42ccec1da52dd79747caa22b4 | Python | 19,144 | 380 | # 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 ... |
81655a984be3aa25b10410bc28ad30b489367ca96245c8c3754352fb3b166981 | Python | 19,273 | 550 | """ Core pybids data structures. """
import os
import re
import json
from keyword import iskeyword
import warnings
from copy import deepcopy
from .writing import build_path, write_contents_to_file
from ..utils import listify, check_path_matches_patterns
from ..config import get_option
from ..external import six
__a... |
d904f4b18dc4850b7c744c92f01b010a1761b2f11bec9fdbe6ed556425f05ec3 | Python | 19,291 | 438 | #!/usr/bin/env python3
"""Shared helpers for the governance gates.
One place for the things several gates would otherwise each re-implement:
the repo root, setup-failure reporting, package-root resolution, the
significant-line counter, and the Conventional-Commits patterns. This is
infrastructure shared by the gates, ... |
653ca0b1af49676dbe75d5a2575a8cb7d68901e25c9fe4e2ef96724d3991cf42 | Python | 19,488 | 382 | """Loopback HTTPS contract tests, without accounts or physical entropy claims."""
import json
import ssl
import subprocess
import threading
from contextlib import ExitStack, contextmanager
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.error import HTTPError, URLError
from urllib.parse... |
c4798bb4e2612940950fad7af32b9c27d7e49d424f00cb347944cf81550ef864 | Python | 19,611 | 621 | # -*- coding: utf-8 -*-
"""
click._termui_impl
~~~~~~~~~~~~~~~~~~
This module contains implementations for the termui module. To keep the
import time of Click down, some infrequently used functionality is
placed in this module and only imported as needed.
:copyright: © 2014 by the Pallets team.
:license: BSD, see LIC... |
64eebcd6e932621509dd2a0eff916d4e3edf0c96316da7faa3be652363a2200b | Python | 19,639 | 521 | import numpy as np
from sklearn.externals import six
from scipy.special import expit
from scipy.linalg import solve_triangular
from sklearn.linear_model.base import LinearModel, LinearClassifierMixin
from sklearn.base import RegressorMixin, BaseEstimator
from sklearn.utils import check_X_y,check_array
from sklearn.metr... |
216af14d337c9b2e9560a9b45451bc080f4a211f8713ffd645686ae62fa36fd0 | Python | 19,755 | 620 | from __future__ import annotations
import pathlib
import subprocess
from pathlib import Path
import pytest
from governance import slice_gate
SIGNIFICANCE_BLOCK = (
'> **Significance.** This is the exact slice contract.\n'
'> It must be preserved byte-for-byte.'
)
DONE_MEANS_COMPLETE = (
'## Done Means\... |
f6930387c191839802f93dc8c9b29c982f77478f8bed649d87459884543d75a9 | Python | 19,804 | 620 | #
# The Python Imaging Library.
# $Id$
#
# standard image operations
#
# History:
# 2001-10-20 fl Created
# 2001-10-23 fl Added autocontrast operator
# 2001-12-18 fl Added Kevin's fit operator
# 2004-03-14 fl Fixed potential division by zero in equalize
# 2005-05-05 fl Fixed equalize for low number of values
... |
0a0f6542d16cc0ee9cdee83a47da463f434525ca4e85c07093112ae6cb56ddd3 | Python | 19,824 | 411 | import json
import os
from operator import itemgetter
from os import path
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.urls... |
d3d8c2bad9c45d37027d595e70058f7ca04af408168c8cb9252b3405ec2b2198 | Python | 19,854 | 501 | '''
Created on May 21, 2018
@author: helrewaidy
'''
# sub-parts of the U-Net model
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils.cmplxBatchNorm as cmplxBatchNorm
from complexnet.cmplxconv import ComplexConv2d, ComplexConv3d, ComplexConvTranspose2d
from complexnet.cmplxbn import Comp... |
b0e963dcc00619a07e2710a48a04be9f7ab0d1f63b4c0340b17bf5a5abebf09e | Python | 19,931 | 581 | from collections import namedtuple
from .const import Bound, inf
Atomic = namedtuple("Atomic", ["left", "lower", "upper", "right"])
def mergeable(a, b):
"""
Tester whether two atomic intervals can be merged (i.e. they overlap or are adjacent).
:param a: an atomic interval.
:param b: an atomic inter... |
85ee855f8bce2ae1de5675ff3510d52b865a13affa761190140628b0149740ce | Python | 20,065 | 569 | """
This is an implementation of the Linear Fascicle Evaluation (LiFE) algorithm
described in:
Pestilli, F., Yeatman, J, Rokem, A. Kay, K. and Wandell B.A. (2014). Validation
and statistical inference in living connectomes. Nature Methods 11:
1058-1063. doi:10.1038/nmeth.3098
"""
import numpy as np
import scipy.sparse... |
15cb243100566d0939f64ec3db34b3f94f69e6ce3b9b242cf5a14b45e5aad5a3 | Python | 20,074 | 622 | import numpy as np
import pytest
from albumentations.augmentations.geometric import functional as fgeometric
from albumentations.augmentations.geometric.functional import (
from_distance_maps,
to_distance_maps,
)
from tests.utils import set_seed
import cv2
@pytest.mark.parametrize(
"image_shape, keypoin... |
cebd37dc5d87d2f55ea6a9ca0904413e11dca0f094c59af781662293a61a822e | Python | 20,097 | 546 | # 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 operator
from cryptography import utils, x509
fro... |
c290da132162c1d1d951baaf2cacbfd0e3618c9a6a2f574e370c09ab47617ce7 | Python | 20,124 | 838 | """
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... |
469f2dc21922ac5427bcc0b1f7196bdcfd35de9b1682b6aaffd545db8830a0b6 | Python | 20,153 | 515 | import numpy as np
from dipy.segment.clustering import qbx_and_merge
from dipy.tracking.streamline import length, Streamlines
from dipy.io.streamline import save_trk
from dipy.utils.optpkg import optional_package
fury, have_fury, setup_module = optional_package('fury')
if have_fury:
from dipy.viz import actor, wi... |
53a9c5b75500598aeeb8921d389bc5abce38b225b75b3c15bd5ed5b07f7cd7c2 | Python | 20,290 | 673 | from __future__ import division, print_function, absolute_import
import numpy as np
import warnings
from dipy.utils.six.moves import xrange
from dipy.core.geometry import cart2sphere, sphere2cart, vector_norm
from dipy.core.onetime import auto_attr
from dipy.reconst.recspeed import remove_similar_vertices
__all__ =... |
eca70bd24de1f2b16a414c89dba23785ff961f929e6ad4c3d1246ef92fcec4a0 | Python | 20,378 | 595 | #! /usr/bin/python3.6
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
... |
0f8e40159f37b53438c2342cdb93166f3a2db0bb11dc12276aa1b0fa512ebdaf | Python | 20,402 | 573 | from __future__ import division, print_function, absolute_import
from warnings import warn
from dipy.utils.six import string_types
import numpy as np
try:
from scipy.linalg import polar
except ImportError: # Some elderly scipy doesn't have polar
from dipy.fixes.scipy import polar
from scipy.linalg import in... |
ee4ac4cc686101d6088ebf5ecf6190fb7d01faf3e2e66f8992e50921f90f628f | Python | 20,470 | 534 | from functools import update_wrapper
from weakref import WeakSet
from django.apps import apps
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured
from django.db.models.base import ModelBase
from django.http imp... |
47ef9271d1653687dd34b331550624e9fca0ae8da17dd2d1631893bd169e2a33 | Python | 20,499 | 538 | """
The Sparse Fascicle Model.
This is an implementation of the sparse fascicle model described in
[Rokem2015]_. The multi b-value version of this model is described in
[Rokem2014]_.
.. [Rokem2015] Ariel Rokem, Jason D. Yeatman, Franco Pestilli, Kendrick
N. Kay, Aviv Mezer, Stefan van der Walt, Brian A. Wandell
... |
e53e31b8b2a870ad154ff6ac0a93013c807d550324868323c9f0e51db943449a | Python | 20,583 | 598 | # -*- coding: utf-8 -*-
"""
babel.messages.pofile
~~~~~~~~~~~~~~~~~~~~~
Reading and writing of files in the ``gettext`` PO (portable object)
format.
:copyright: (c) 2013-2018 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import os
im... |
dfa75db467ec7f1fa62d06b5cd7d5c9e56e657a75dd32ff617a5298ac5ca4158 | Python | 20,616 | 583 | """Define, read and write DeLTA's configuration."""
import dataclasses
import json
import logging
import tomllib
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Literal
import keras
import tomli_w
from delta import assets
LOGGER = logging.getLogger(__name__)
MODEL = Literal["rois... |
efcf2627d8ebb7b47eaaf98b4e373c77dbd6c2d499c22c7209f3707155999705 | Python | 20,658 | 462 | #! /usr/bin/python3.7
# encoding=utf-8
import sys
from PyQt5.QtWidgets import QApplication, QSizePolicy, QMessageBox, QWidget, \
QPushButton, QLineEdit, QDesktopWidget, QGridLayout, QFileDialog, QListWidget, QLabel,QFrame,QGroupBox,QProgressBar
from PyQt5.QtCore import Qt, QThread
import PyQt5.QtWidgets as QtWid... |
a77198a499ea6e867705d6056248c510dec52568cc1f3a67c65139b62fb9e859 | Python | 20,730 | 444 | #!/usr/bin/env python3
"""
MAG-S3b analysis - invariants, expectations, hypotheses and exploratory maps. Protocol version 0.4 (draft).
Order: the pair grid and the receptor maps (mode physics and receptor of mag_s3b.py), the calibration (C1, C3), the
blind estimates (estimate.py) and only then the truth. The truth fil... |
bfd83f7a0ae4b93e92d3af7848a1c1452c19e37e08f811f5c5f09026eee049e9 | Python | 20,775 | 582 | import warnings
import nibabel as nib
import numpy as np
import numpy.testing as npt
from numpy.testing import (assert_, assert_equal, assert_almost_equal,
assert_array_almost_equal, run_module_suite,
assert_array_equal)
from dipy.testing import assert_greater
from ... |
cbf12e063dd23008eb048daa7a7433051e4bb305a74594b7a6202804b13b1368 | Python | 20,823 | 675 | #
# The Python Imaging Library.
# $Id$
#
# base class for image file handlers
#
# history:
# 1995-09-09 fl Created
# 1996-03-11 fl Fixed load mechanism.
# 1996-04-15 fl Added pcx/xbm decoders.
# 1996-04-30 fl Added encoders.
# 1996-12-14 fl Added load helpers
# 1997-01-11 fl Use encode_to_file where possibl... |
426cfcf036a1622141489f2eb1c456b05ddd4013b3a2b2a33515f1770ec678c0 | Python | 20,891 | 471 | from decimal import Decimal
from pathlib import Path
from types import SimpleNamespace
import pytest
from boris import config as cfg
from boris import write_event
class RecordingLabel:
def __init__(self):
self.text = ""
def setText(self, text):
self.text = text
class RecordingWindow:
... |
087540e3b9d6e82f7725d5e63bc93bffc0f5bb0277d0735937d2cc3b10460ea6 | Python | 20,913 | 605 | """Module containing utility functions and classes for the core Albumentations framework.
This module provides a collection of helper functions and base classes used throughout
the Albumentations library. It includes utilities for shape handling, parameter processing,
data conversion, and serialization. The module def... |
b220ece9f7df61eeb95dc4482b764689c0c53a6d57fb8c22f9894adbc66e4e2a | Python | 20,984 | 627 | """
report test results in JUnit-XML format,
for use with Jenkins and build integration servers.
Based on initial code from Ross Lawley.
Output conforms to https://github.com/jenkinsci/xunit-plugin/blob/master/
src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
"""
from __future__ im... |
6e690a49577906e1dc19d43f827dcc25e78b931ffe881bca4d14c898baed0582 | Python | 21,054 | 595 | # -*- coding: utf-8 -*-
"""
celery.worker.job
~~~~~~~~~~~~~~~~~
This module defines the :class:`Request` class,
which specifies how tasks are executed.
"""
from __future__ import absolute_import, unicode_literals
import logging
import socket
import sys
from billiard.einfo import ExceptionInfo
from d... |
b83ba6088e554354d7321c613d51b1322f582ed2dceff75558a22770ec3a0d81 | Python | 21,078 | 522 | ###############################################################################
# mapper.py is a script that tries to identify each recordings in the prepared
# dataset using template map, and creates a local bidsmap
###############################################################################
# Copyright (c) 2018-20... |
ceed64618e0b4666b25a8bedb6a4267a6e781c829af92f93a1eb49bde3bcb69c | Python | 21,083 | 459 | """Tests for behavior binary table generation."""
from decimal import Decimal
from types import SimpleNamespace
import tablib
from boris import behavior_binary_table, config
OBSERVATION_ID = "observation"
SUBJECT_ID = "subject-1"
SUBJECT_NAME = "Alice"
def make_project():
return {
config.ETHOGRAM: {
... |
e77b72da5e70de2b04a8b03f085d03b83e424216a5ff16abf1774fac6db046f3 | Python | 21,107 | 635 | """ hook specifications for pytest plugins, invoked from main.py and builtin plugins. """
from pluggy import HookspecMarker
from _pytest.deprecated import PYTEST_LOGWARNING
hookspec = HookspecMarker("pytest")
# -------------------------------------------------------------------------
# Initialization hooks called f... |
b964326d54b27237576a54aaf5fad4890ef972b81370480dc1536bcce87c4420 | Python | 21,228 | 533 | # -*- coding: UTF-8 -*-
import re
from django.contrib.auth.models import Group
from django.contrib.auth.tokens import default_token_generator
from django.contrib.messages import get_messages
from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse, resolve
from django.shortcuts impor... |
a30caac5d41138c14025432df8be4115cf0342f79229fb431dc6439518ecfd27 | Python | 21,265 | 646 | # -*- coding: utf-8 -*-
"""
.. program:: celery multi
Examples
========
.. code-block:: bash
# Single worker with explicit name and events enabled.
$ celery multi start Leslie -E
# Pidfiles and logfiles are stored in the current directory
# by default. Use --pidfile and --logfile argument to chang... |
c08be285e58f82d9fe169df49e51aa9d7530fe792b2f504865ce83867a0c6cb4 | Python | 21,270 | 434 | """
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 ... |
29b21911463a3a7ecd3d56fc17a7160ef343064f9661847672d4ddc7942f71f0 | Python | 21,312 | 632 | # -*- coding: utf-8 -*-
"""
babel.numbers
~~~~~~~~~~~~~
CLDR Plural support. See UTS #35.
:copyright: (c) 2013-2018 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
from babel._compat import decimal
_plural_tags = ('zero', 'one', 'two', 'few', 'many', 'other')
_fal... |
898e8112f8f2e230e4e6ccbb4538296adcfb6736892be26bbc5f8482236b9354 | Python | 21,324 | 601 | from __future__ import absolute_import
import sys
import socket
from collections import defaultdict
from datetime import datetime, timedelta
from kombu import pidbox
from celery.datastructures import AttributeDict
from celery.five import Queue as FastQueue
from celery.utils import uuid
from celery.utils.timer2 impo... |
b1ac5c7859c00f090d54bc9202a812681bb55bd2ca7c3dab7cfe9ca3fc2d7014 | Python | 21,336 | 668 | # -*- coding: utf-8 -*-
"""
.. _preload-options:
Preload Options
---------------
These options are supported by all commands,
and usually parsed before command-specific arguments.
.. cmdoption:: -A, --app
app instance to use (e.g. module.attr_name)
.. cmdoption:: -b, --broker
url to broker. default is '... |
6af4814728f9b8876ff11742b25307f8e3c840644287d534f96ecde08c94a2dc | Python | 21,510 | 576 | """
Regression module contains bare-bones version of the PCM toolbox that can be used to tune ridge/Tikhonov coefficients in the context of tranditional regression models. No assumption are made about independent data partitions.
"""
import numpy as np
from numpy.linalg import solve, eigh, cholesky
from numpy import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.