sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
2d98f6f6bdb1b8a52fb7fabfdf2e068bf92b0d72c2c7317b67e836440fc13aed | Python | 21,539 | 480 | #
# The Python Imaging Library.
# $Id$
#
# PIL raster font management
#
# History:
# 1996-08-07 fl created (experimental)
# 1997-08-25 fl minor adjustments to handle fonts from pilfont 0.3
# 1999-02-06 fl rewrote most font management stuff in C
# 1999-03-17 fl take pth files into account in load_path (from Rich... |
e8b5c37553c4a1961c6a9f1ac2b0c90f7246c3b246115c787f051604740c2ba2 | Python | 21,661 | 452 | import collections
import re
# TODO (NES-956): see this
from _csv import reader
from operator import itemgetter
from io import StringIO
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from survey.abc_search_engine import Questionnaires
from survey.models import Survey
... |
018ca34b6eae885297b649b8dea992b69cbdcdf1a1e475491785044d8141b7ac | Python | 21,682 | 614 | import types
import weakref
from .lock import allocate_lock
from .error import CDefError, VerificationError, VerificationMissing
# type qualifiers
Q_CONST = 0x01
Q_RESTRICT = 0x02
Q_VOLATILE = 0x04
def qualify(quals, replace_with):
if quals & Q_CONST:
replace_with = ' const ' + replace_with.lstrip()
... |
ea2cc9de111ce37a22196c0958536d405974da607a7febabfa01d4b9c58cd60f | Python | 21,717 | 645 | """Tests for the behaviors coding map creator."""
import json
import runpy
import sys
import warnings
from types import SimpleNamespace
import pytest
from PySide6 import QtWidgets
from PySide6.QtCore import QEvent, QPoint, QPointF, Qt
from PySide6.QtGui import QColor, QMouseEvent, QPixmap, QPolygonF
from PySide6.QtWi... |
a2d1a36fdd899c28595add31393f9e24261118af702736461d927994cf1f22a5 | Python | 21,781 | 890 | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Philippe Faist
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation t... |
3927b3aa9298b4b52d8d03bcdce0d3f65a65b184f10ee077ac392ae0999e48e6 | Python | 21,784 | 583 | import json
import logging
import pathlib
from collections import namedtuple
from enum import Enum
from typing import Dict, List, Tuple
import bg_space as bg
import brainreg as program_for_log
import napari
import numpy as np
from bg_atlasapi import BrainGlobeAtlas
from brainglobe_napari_io.cellfinder.reader_dir impor... |
5eb5a0b9729af3eba621b1bcd39b6fccf9946cce81d9de3548aaabf3a098532f | Python | 21,787 | 593 | # -*- coding: utf-8 -*-
"""
celery.schedules
~~~~~~~~~~~~~~~~
Schedules define the intervals at which periodic tasks
should run.
"""
from __future__ import absolute_import
import numbers
import re
from collections import namedtuple
from datetime import datetime, timedelta
from kombu.utils import ca... |
f463bb674d0a5abd6dc0f22fee7236ca74568cd442b282a107f042a32d14737e | Python | 21,859 | 662 | import numpy as np
from scipy.ndimage import map_coordinates
from scipy.fftpack import fftn, fftshift, ifftshift
from dipy.reconst.odf import OdfModel, OdfFit
from dipy.reconst.cache import Cache
from dipy.reconst.multi_voxel import multi_voxel_fit
class DiffusionSpectrumModel(OdfModel, Cache):
def __init__(self... |
cf853d14648b340029563554dbd70526ab834962bab257851f1c79b5b8f1c355 | Python | 21,868 | 630 | """
BORIS
Behavioral Observation Research Interactive Software
Copyright 2012-2020 Olivier Friard
module for testing utilities.py
https://realpython.com/python-continuous-integration/
pytest test_utilities.py
"""
import pytest
import os
import sys
import shutil
import subprocess
from decimal import Decimal
import j... |
6db1455255cb3977ee87dc6188966bbd8cf0fcc1a343167d307f1e7f41321d3d | Python | 21,904 | 503 | """Derive a study specification snippet describing a DICOM series based on the
DICOM metadata as provided by datalad.
"""
import logging
import os.path as op
from datalad.core.local.save import Save
from datalad.distribution.dataset import EnsureDataset
from datalad.distribution.dataset import datasetmethod
from data... |
88dd30e166c2439864e368c6787a77740d3b4660cc9987c60185970ba1d57f87 | Python | 21,955 | 635 | """
Default Django settings. Override these with settings in the module pointed to
by the DJANGO_SETTINGS_MODULE environment variable.
"""
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
def gettext_noop(s):
return s
####... |
237a04f4b547b568a0196940c44d8d25080247fa172bb13364c316eefaa77b18 | Python | 21,964 | 551 | import SimpleITK as sitk
import numpy as np
import torch
import cv2
import tkinter as tk
from tkinter import messagebox
from PIL import Image, ImageTk
#from torchmetrics import Dice, JaccardIndex
from brainCT.train_utils.metrics import DiceScore
from monai.metrics import HausdorffDistanceMetric
class SegmentationGUI:... |
899115f5c08b63ff5e02a967ec2e89e4bfc938660b7c07dfb97263bb8ca29b1f | Python | 21,984 | 423 | # 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
import seaborn as sns
from scipy.sparse import *
import copy
from scipy.stats import norm
sns.set_context(... |
1667a18ecf471624042e46b97f02e0739b9c59d31da6ae3b2c294a640e6a98a6 | Python | 22,084 | 637 | import base64
import binascii
import functools
import hashlib
import importlib
import warnings
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receiver
from django.ut... |
ad7782cd7cc72fe5a785b40e198add771bffab7843567d2046d0a612c8729460 | Python | 22,125 | 663 | ###############################################################################
# General.py contains general tools, that can be used in user plugins
# general tools do not require additional modules installation
###############################################################################
# Copyright (c) 2019-2020, ... |
35e410970cc7d94afe6a4e0ee57aa65128787a7af0c1b5f75d30237f08dc428e | Python | 22,152 | 519 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import time
import decimal
import codecs
import csv
from sklearn.pipeline import Pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import permutation_test_score
from sklearn.metrics import roc_auc_s... |
31d94745171d46d4477b837d416aefebbb9b5619fcc7049871ef5d0e831a4b6f | Python | 22,184 | 425 | # 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
import seaborn as sns
from scipy.sparse import *
import copy
from scipy.stats import norm
sns.set_context(... |
3e6b2f6c48cca321c1b3e73ea2a6bb8512c1ca3200a2a99433961b2b5436c195 | Python | 22,256 | 462 | #! /usr/bin/python3.7
# -- coding: utf-8 -- **
import sys
import os
import re
import nibabel as nib
import numpy as np
import mayavi
from mayavi import mlab
import matplotlib
matplotlib.use("Qt5Agg")
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
f... |
b9e8f4cb0fa4618cf79cb1125f193bad571e322bbe70ca35cdd8337cd060c187 | Python | 22,302 | 609 | # -*- coding: utf-8 -*-
"""
babel.support
~~~~~~~~~~~~~
Several classes and functions that help with integrating and using Babel
in applications.
.. note: the code in this module is not used by Babel itself
:copyright: (c) 2013-2018 by the Babel Team.
:license: BSD, see LICENSE for more d... |
719546a1fc0bc586902fc8c875434615461936148bc8be7e079e6d28956a6d0e | Python | 22,309 | 563 | import numpy as np
import pandas as pd
import math
from copy import deepcopy
from abc import abstractmethod, ABCMeta
from bids.utils import listify
from itertools import chain
from six import add_metaclass
from bids.utils import matches_entities
@add_metaclass(ABCMeta)
class BIDSVariable(object):
''' Base represe... |
4180c4417951c70cf352f275ddee3c140c360b3d6df7a81d5c54f86548d2a37d | Python | 22,342 | 390 | #!/usr/bin/env python3
"""Execute root documentation fences in retained, local-only fixture projects.
Installer examples use the unpublished wheel and preinstalled dependency matrix.
An identical same-run framework suite may supply a validated execution receipt.
Other development commands execute; no remote repository... |
ec4f78babb31a40f58ce94239c0fa24b9017728daf55dae692c0f1aa25bfa8c3 | Python | 22,442 | 501 | from scipy import interpolate as interp
import numpy as np
import sys, os
from saveNet import saveTensorToMat, saveArrayToMat
import matplotlib.pyplot as plt
#from pynufft import NUFFT_cpu
from utils.data_vis import tensorshow, ntensorshow
import multiprocessing
import ctypes
from functools import partial
NUFFTobj = NU... |
94963fe8b1613e485ab43e6fbdcba9bd1e77714385b9b399f94d4e30342fda64 | Python | 22,453 | 653 | # -*- coding: UTF-8 -*-
import datetime
import random
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from simple_history.models import HistoricalRecords
from survey.models import Surve... |
6f959966a747b88d9b8556eba0c63e2b6554fd75c16349b9864c5fcb7f8a3456 | Python | 22,501 | 698 | # -*- coding: utf-8 -*-
"""
celery.canvas
~~~~~~~~~~~~~
Composing task workflows.
Documentation for some of these types are in :mod:`celery`.
You should import these from :mod:`celery` and not this module.
"""
from __future__ import absolute_import
from collections import MutableSequence
from c... |
a7a1a9b37cccdbf97bc3ab7c90c3d5affcea98dae44dd44b93c412f9768ca55c | Python | 22,514 | 633 | """
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... |
a410e2e4af923bb6d6441fa05cd703932e400ced31c096b37ce91116fb0cb857 | Python | 22,572 | 623 | # -*- coding: utf-8 -*-
"""
celery.backends.base
~~~~~~~~~~~~~~~~~~~~
Result backend base classes.
- :class:`BaseBackend` defines the interface.
- :class:`KeyValueStoreBackend` is a common base class
using K/V semantics like _get and _put.
"""
from __future__ import absolute_import
import... |
8d2961bc8446c3c4d231b3f8882b81ebb4a2182925056a272ace2f5f9bcdc39b | Python | 22,591 | 582 | from __future__ import division, print_function, absolute_import
from multiprocessing import cpu_count, Pool
from itertools import repeat
from os import path
from warnings import warn
from dipy.utils.six.moves import xrange
from nibabel.tmpdirs import InTemporaryDirectory
import numpy as np
import scipy.optimize as... |
0b9840067fb24d874c6a4c2a84a53da0419710f70ce4515975885ec623047256 | Python | 22,795 | 662 | """ Access and control log capturing. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import re
from contextlib import contextmanager
import py
import six
import pytest
from _pytest.compat import dummy_context_manager
from _pytest.config... |
9764a53ff488afe4063119f489cf95ee52b9368e6f3d466085f4e555cc6d7086 | Python | 22,863 | 35 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-04-17 15:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('patient', '0006_auto_20190401_1144'),
]
operations = [
migrations.AlterFie... |
e4e7381978c763cc8800333f3d62fa34519af7d4ab37d2fbd913146d02d988d9 | Python | 22,929 | 607 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
b48592871556bd28ebcc872ce8e12c01ae6034efed77471426774a7369cd979e | Python | 23,070 | 691 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
# strings representing various path-related bits and pieces
# These are primarily for export; internally... |
a3f6570768f2bcbd9171eecffdb146ab8e768b206af72909c9102920f30264ed | Python | 23,207 | 606 | import os
import sys
import struct
import inspect
import itertools
from ._compat import raw_input, text_type, string_types, \
isatty, strip_ansi, get_winterm_size, DEFAULT_COLUMNS, WIN
from .utils import echo
from .exceptions import Abort, UsageError
from .types import convert_type, Choice, Path
from .globals imp... |
be5cad6964d6ed570e86a20ce113e4713463a69ed7b53c0f8e9130a3b002de7b | Python | 23,272 | 726 | from __future__ import absolute_import
import gc
import os
import itertools
from copy import deepcopy
from pickle import loads, dumps
from amqp import promise
from kombu import Exchange
from celery import shared_task, current_app
from celery import app as _app
from celery import _state
from celery.app import base a... |
e507dfafa01b8fb012c6d578fa9ffad0f707495567793a16d1ed92720c7acf94 | Python | 23,275 | 656 | # -*- coding: utf-8 -*-
"""
celery.events.state
~~~~~~~~~~~~~~~~~~~
This module implements a datastructure used to keep
track of the state of a cluster of workers and the tasks
it is working on (by consuming events).
For every event consumed the state is updated,
so the state represents th... |
d90f76f69f9a04ffd962e30526a251f88a6e7287efddf9837392730433e6cc95 | Python | 23,287 | 668 | import os
import stat
from datetime import datetime
from ._compat import open_stream, text_type, filename_to_ui, \
get_filesystem_encoding, get_streerror, _get_argv_encoding, PY2
from .exceptions import BadParameter
from .utils import safecall, LazyFile
class ParamType(object):
"""Helper for converting value... |
bd89afa23e28a4fc68f9cfb618c4108d84ffaff42438ac9b91f1a8795aedd1d0 | Python | 23,399 | 703 | import re
import io
import os
import sys
import codecs
from weakref import WeakKeyDictionary
PY2 = sys.version_info[0] == 2
CYGWIN = sys.platform.startswith('cygwin')
# Determine local App Engine environment, per Google's own suggestion
APP_ENGINE = ('APPENGINE_RUNTIME' in os.environ and
'Development/' ... |
4ec36a8790b9abf931fedd23a2728c9fe6780ecfb82d9891033427ef0e791d01 | Python | 23,412 | 654 | # 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 calendar
import ipaddress
import six
from cryptography import ut... |
f4b249ac38f3450cccecb00f6c4174b0ae66c4b8fc5e98eca3d721383809890b | Python | 23,503 | 681 | from __future__ import absolute_import
import logging
import os
import sys
from billiard import current_process
from kombu import Exchange, Queue
from celery import platforms
from celery import signals
from celery.app import trace
from celery.apps import worker as cd
from celery.bin.worker import worker, main as wor... |
66d65054037e9222538d128706b831dea0b7f0a6c0677626851f8f2cc252e6e1 | Python | 23,646 | 611 | # -*- coding: utf8 -*-
"""
Helper functions used here and there
author: András Ecker, last update: 06.2022
"""
import os
from shutil import rmtree
import pickle
from copy import deepcopy
import numpy as np
from scipy.sparse import coo_matrix, save_npz, load_npz
import pywt
from brian2.units import *
from poisson_proc ... |
a7539655c368457fdde002774d34883ab14fbe0b8278f19b953ef564d8bf5a26 | Python | 23,739 | 753 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import datetime
import os
from enum import Enum
import six
f... |
e5b4bf2102f71f1c7770218dab4b7595366d4a69eec385f368ca937c6a754195 | Python | 23,740 | 630 | ###############################################################################
## Vision Research Laboratory and ##
## Center for Multimodal Big Data Science and Healthcare ##
## University of California at Santa Barbara ##
... |
3d824f6eee71976d88922b7b87a06293cdb1cc31b1150f01873991588c877175 | Python | 23,906 | 713 | from __future__ import absolute_import
import errno
import os
import sys
import signal
import tempfile
from celery import _find_option_with_arg
from celery import platforms
from celery.five import open_fqdn
from celery.platforms import (
get_fdmax,
ignore_errno,
set_process_title,
signals,
maybe_d... |
f0c1f3803f9a647c8c8a5cd1252731451ea979d1bbc76ffaa583daf6e8173e6a | Python | 23,934 | 540 | """
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... |
00b04201d32f00b7d9ba0cb6108971863f6a8b541f648d226300e5823d30dffa | Python | 23,957 | 634 | # coding=utf-8
import re
from abc import abstractmethod, ABC
from base64 import b64decode, b64encode
from jsonrpc_requests import Server, TransportError
from django.conf import settings
class ABCSearchEngine(ABC):
QUESTION_PROPERTIES = [
'gid', 'question', 'question_order', 'subquestions', 'answeroptions'... |
521d63354f3dd9d000ecc2001d890d37307b6961697bc3b3ddcb261999519f9c | Python | 24,066 | 657 | """
Created on Tue Oct 19 15:01:05 2021.
@author: ooconnor
"""
from pathlib import Path
import cv2
import numpy as np
import numpy.random as npr
import numpy.typing as npt
import pytest
import scipy.optimize as opt
from scipy.special import logit
from delta import imgops, utils
from delta.imgops import CroppingBox,... |
e4f6c634644749c2b7f6894e446a509735f9cfa751174fdc23012390ea4bf1e3 | Python | 24,086 | 541 | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import argparse, sys, re, os
import matplotlib.pyplot as plt
import matplotlib_venn as mv
import seaborn as sns
from matplotlib.pyplot import MultipleLocator
import scipy.stats as sci
import venn
# from scipy.stats import spearmastat_funcnr
# i... |
099d5195755167ba7aa2ce9e68699b189ffc1c59d6f3e9e8510cc35c702c38ba | Python | 24,103 | 473 | MODEL_ROOT_NODES = [
'experiment.researchproject', 'experiment.manufacturer', 'survey.survey', 'experiment.coilshape',
'experiment.material', 'experiment.electrodeconfiguration', 'experiment.eegelectrodelocalizationsystem',
'experiment.filtertype', 'experiment.amplifierdetectiontype'... |
1157d50c13adf6b051185ec23319927d0c635aa01be1925b27f3ae28a5882a8c | Python | 24,105 | 578 | import numpy as np
from dipy.data import get_gtab_taiwan_dsi
from numpy.testing import (assert_,
assert_almost_equal,
assert_array_almost_equal,
assert_equal,
assert_raises,
run_module_... |
68c3aa6c069fe9282dacd0702166e30c2ee90c570dcb49d6cda6d0222b871eea | Python | 24,135 | 731 | from __future__ import absolute_import
from contextlib import contextmanager
from celery import states
from celery.exceptions import IncompleteStream, TimeoutError
from celery.five import range
from celery.result import (
AsyncResult,
EagerResult,
TaskSetResult,
result_from_tuple,
)
from celery.utils ... |
8a757a7d0857838611ca87b3019cf2810c3168883ebf3e73127e1d219966c31d | Python | 24,155 | 651 | import json
import logging
import pathlib
from collections import namedtuple
from enum import Enum
from typing import Dict, List, Tuple
import brainglobe_space as bg
import napari
import numpy as np
from brainglobe_atlasapi import BrainGlobeAtlas
from brainglobe_atlasapi.list_atlases import get_all_atlases_lastversion... |
9272f365f7db3a6682dcb005fb35c3ccd795cee3a7cebdbca3fcbb119eff985b | Python | 24,196 | 675 | # -*- coding: utf-8 -*-
"""
celery.app.base
~~~~~~~~~~~~~~~
Actual App instance implementation.
"""
from __future__ import absolute_import
import os
import threading
import warnings
from collections import defaultdict, deque
from copy import deepcopy
from operator import attrgetter
from amqp import pro... |
99886736b0e1bab0050b8bae244717639e87bb579a870c5d946e1e7a59ae6ec5 | Python | 24,360 | 714 | """
The OGRGeometry is a wrapper for using the OGR Geometry class
(see https://www.gdal.org/classOGRGeometry.html). OGRGeometry
may be instantiated when reading geometries from OGR Data Sources
(e.g. SHP files), or when given OGC WKT (a string).
While the 'full' API is not present yet, the API is "pythonic" unli... |
a5fabd0e3a2cac3ee0b9f72c86dc3ab117f69020c8d69a529ed5d5dd9e98197e | Python | 24,454 | 400 | """MAG-S2: synthetic tests of the analysis logic on fabricated records with known answers.
No model output is read. Each world changes one thing against a baseline in which every criterion is met, and most
thresholds are probed just inside and just outside. The last block builds run folders on disk and tests evaluate()... |
0033779d7a546125d3c61c1ca6914e181c074d020d61854d891b18e0447a19f4 | Python | 24,455 | 625 | #!/usr/bin/python
""" Classes and functions for fitting the DKI-based microstructural model """
from __future__ import division, print_function, absolute_import
import numpy as np
from dipy.reconst.dti import (lower_triangular, from_lower_triangular,
decompose_tensor, trace, mean_diffusiv... |
9b9c0d1a52c7b8da72f4bdac48d754bffd7f1e64c449c0f86ec17e5dba4b3ef3 | Python | 24,487 | 660 | """Tests for compose operators (+, -, __radd__)."""
from __future__ import annotations
import numpy as np
import pytest
import albumentations as A
from albumentations.core.composition import BboxParams, KeypointParams
# Sample data fixtures
@pytest.fixture
def sample_image():
"""Create a sample image for testi... |
e330f527668f9d26c50753859b755aa38e55058a566bdd1b698cd4eaf6cfb70a | Python | 24,492 | 567 | """Implementation of coarse dropout and random erasing augmentations.
This module provides several variations of coarse dropout augmentations, which drop out
rectangular regions from images. It includes CoarseDropout for randomly placed dropouts,
ConstrainedCoarseDropout for dropping out regions based on masks or boun... |
ff2febd6308c61ffcbe27601d70d0c72c8106c31571c3cb2c50a12147e78871a | Python | 24,628 | 600 | import os
import numpy as np
import torch
from torch import optim
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import yaml
import cv2
from monai.data import DataLoader
from monai.losses import DiceLoss, GeneralizedDiceLoss, TverskyLoss, SSIMLoss
from monai.transforms import AsDiscrete
from t... |
161e0a40c20bb2c6a5a9576056c6008bcdf9857fcfcb39c0882cf613756f2da6 | Python | 24,698 | 651 | import numpy as np
import pickle
from io import BytesIO
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_almost_equal, run_module_suite,
assert_equal, assert_)
from dipy.reconst.odf import (OdfFit, OdfModel, gfa)
from dipy.directio... |
d16d564a4f1bdc043aa0d86d33924480ddbb0c7a17673cd2109de7be3c2e06cd | Python | 24,774 | 813 | # -*- coding: utf-8 -*-
"""
celery.platforms
~~~~~~~~~~~~~~~~
Utilities dealing with platform specifics: signals, daemonization,
users, groups, and so on.
"""
from __future__ import absolute_import, print_function
import atexit
import errno
import math
import numbers
import os
import platform as _pla... |
f6a5692aa8086c57cc527e183db81613a367def49ba6a3d86b5056326a27903c | Python | 24,787 | 521 | # -*- coding: utf-8 -*-
"""
aideveloper_bin
some useful functions that I want to keep separate to
make the main script a bit shorter
---------
@author: maikherbig
"""
import os,shutil,json,re,urllib
import numpy as np
import dclab
import h5py
import aid_start #import a module that sits in the AIDeveloper ... |
53cdf5eb4004d2343f6ef63f75cc8ca90882b713bc66fe75d29a0db9bcc93096 | Python | 24,835 | 398 | # 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... |
79c1363a03203bb6955bece71f98b1cacb03569badeb2abbdbc0eaa95707c874 | Python | 24,869 | 639 | import unittest
import logging
from bidsschematools import schema as bst
from bidsschematools import expressions
from bidsme.schema.BIDSschema import modalities
from bidsme.schema import parcing
from bidsme.schema import functs
from bidsme.schema import validate
from bidsme.schema import BIDSschema
from bidsme.schema... |
18cfe6818796c6faf523e19b953af442bdbacd0e4db75995505566326843c0ba | Python | 24,873 | 825 | """MySQL ER Constants
These constants are error codes for the bulk of the error conditions
that may occur.
"""
if __name__ == "__main__":
"""
Usage: python ER.py [/path/to/mysql/mysqld_error.h ...] >> ER.py
"""
import fileinput, re
data = {}
error_last = None
for line in fileinput.input():... |
45a72c352793d1461f983b9250d03c38c66689ef80e46b019fbe049c7314add9 | Python | 24,887 | 597 | __author__ = "Matt Sanderson"
from tkinter import PhotoImage, Menu, TclError
from tkinter import HORIZONTAL, RIDGE, LEFT, BOTH
from tkinter import PanedWindow as tkPanedWindow
from tkinter import filedialog, messagebox
from tkinter.ttk import Frame, Style, Button, Label
from copy import deepcopy
import pickle
import ... |
72506f0c4f0c7864835b5dd7e27c048f6ccdf6ec4b2e0bffcf89e9a98210a8d2 | Python | 24,903 | 599 | # -*- coding: utf-8 -*-
import datetime
import calendar
import operator
from math import copysign
from six import integer_types
from warnings import warn
from ._common import weekday
MO, TU, WE, TH, FR, SA, SU = weekdays = tuple(weekday(x) for x in range(7))
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR"... |
3173d86e0827d4e1829d105eecb0212023e5e735671274969c5c068a181de3d3 | Python | 24,995 | 822 | from pathlib import Path
import cv2
import numpy as np
import numpy.random as npr
import pytest
from delta import imgops
from .utils import rand_mask
class TestCroppingBox:
@staticmethod
@pytest.mark.parametrize("dimx", [0, 1, 2, 5])
@pytest.mark.parametrize("dimy", [0, 1, 2, 5])
def test_croppingb... |
4ba2a6e5c66c88de8ccc358ae71b66b65f697a31a6db03e734a4179ad0e89fdf | Python | 25,021 | 895 | """ Metrics for tracks, where tracks are arrays of points """
from __future__ import division, print_function, absolute_import
from dipy.utils.six.moves import xrange
import numpy as np
from scipy.interpolate import splprep, splev
def winding(xyz):
"""Total turning angle projected.
Project space curve to b... |
0792e4811aae6f42b0bdfe5bb401ace2ea20451013e7f2b48095fe3d7054dfb9 | Python | 25,029 | 630 | import contextlib
import textwrap
import os
import os.path
import sargasso.separator.options as opts
from sargasso.utils import log
from datetime import datetime
class Writer(object):
def __init__(self):
self.lines = []
def _add_line(self, line_string):
self.lines.append(line_string)
@c... |
127c2591b0387ebf0269932538ebbaf95812770555f0b904cb3308ea8fc65681 | Python | 25,039 | 985 | """Segmentation of blood vessels and pericytes. A much improved
version of this code is available at https://github.com/chcomin/pyvesto"""
import numpy as np
import scipy.ndimage.measurements as me
import scipy.ndimage as nd
import scipy.ndimage.filters as fil
import scipy
import matplotlib.pyplot as plt
import os
fr... |
04e592ddb4f7dd97e632974bff2a201bedcfc08d9f6d612bd45edac3fe4f159a | Python | 25,118 | 932 | # coding: utf-8
"""
ASN.1 type classes for cryptographic message syntax (CMS). Structures are also
compatible with PKCS#7. Exports the following items:
- AuthenticatedData()
- AuthEnvelopedData()
- CompressedData()
- ContentInfo()
- DigestedData()
- EncryptedData()
- EnvelopedData()
- SignedAndEnvelopedData()... |
27e0b2f2175071c401c26886ba50ea02ce2750892f512fc7c0226c43064df7e0 | Python | 25,198 | 742 | from typing import Dict, List, Optional, Set, Tuple, Union
import numpy as np
from matplotlib import colors, pyplot
from matplotlib.axes import Axes
from matplotlib.colorbar import Colorbar, ColorbarBase
from matplotlib.colors import ListedColormap
from pandas import DataFrame, Index, Series
from seaborn import heatma... |
d995651610d283a327f2688c3ad45e993cb6bb41b80deffc1bb82c3ab3e333da | Python | 25,203 | 752 | """Geometric transformations for flip and symmetry operations.
This module contains transforms that apply various flip and symmetry operations
to images and other target types. These transforms modify the geometric arrangement
of the input data while preserving the pixel values themselves.
Available transforms:
- Ver... |
916b488441f9f3681448d72f48025e1f7ed1bd4bb2104cbcb2f0f3b93e9ec0c8 | Python | 25,267 | 880 | from __future__ import absolute_import
try:
import unittest # noqa
unittest.skip
from unittest.util import safe_repr, unorderable_list_difference
except AttributeError:
import unittest2 as unittest # noqa
from unittest2.util import safe_repr, unorderable_list_difference # noqa
import importlib
... |
579e1671905c45876d71420f0e3be13f65568c8b8f68eed3f51bd3b318a65723 | Python | 25,297 | 762 | import operator
import numpy as np
from time import time
from abc import ABCMeta, abstractmethod
from dipy.segment.metric import Metric
from dipy.segment.metric import ResampleFeature
from dipy.segment.metric import AveragePointwiseEuclideanMetric
from dipy.segment.metric import MinimumAverageDirectFlipMetric
from dip... |
264b94b2510581862677e040f99d316038466d561b506642c9ba384f524e26d6 | Python | 25,372 | 676 | """Padding transformations for images and related data.
This module provides transformations for padding images and associated data. Padding is the process
of adding pixels to the borders of an image to increase its dimensions. Common use cases include:
- Ensuring uniform sizes for model inputs in a batch
- Making im... |
5a33754f0d1a655a71e302b0af05adbc4bc976f80bf909c4ab195948cd6f5db2 | Python | 25,378 | 732 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
import re
from ctypes import addressof, byref, c_double
from django.contrib.gis import gdal
from django.contrib.gis.geometry import hex_regex, json_regex, wkt_regex
from django.contrib.gis.geos import prototy... |
64d7f7d5f214adce4186e73bf7202ba142682e5e309a2e60d48a92d7a9949a36 | Python | 25,590 | 612 | #!/usr/bin/env python2
desc="""Scan alignments (SAM/BAM) for structural variants.
Detection of deletions, duplications and inversions from paired reads is implemented.
In addition, deletions and duplications are detected from deviations from mean depth
of coverage.
By default, the program dumps reads of interest and ... |
082d0b66a631ae2028a9d5c88f88f4ca1402fe4f1f9b39d809dce43213eb1fe1 | Python | 25,681 | 683 | """
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... |
62cea4531d52f4d63195d1e5916d69d2b58a20789d6a398c62e39cd1b5917353 | Python | 25,705 | 695 | import copy
import tempfile
from pathlib import Path
import cv2
import matplotlib.pyplot as plt
import numpy as np
import numpy.testing as npt
import pytest
import delta
# ruff: file-ignore[ambiguous-variable-name]
DATA_PATH = Path(__file__).parent / "data"
FAKE_FEATURES = delta.lineage.CellFeatures(
new_pole... |
4f1fd07ba7f34ce382e6c83609dc3e28f987158834563d33d013d87f0a5e452a | Python | 25,718 | 554 | # 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... |
406956cbc321eca6f96bb84dd9dbaac15001a81da0732e2c81bcba042cce00ac | Python | 25,807 | 492 | """One executor: real Iris callbacks, SFDs, durable records and crash recovery."""
import json
import os
import signal
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_iris
from sklearn.linear_... |
63c0877218a81908f2b9c149b1cfbe59f9da5dfedd261e8b293943ac8a07fb41 | Python | 25,863 | 698 | # 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... |
66481f068f97a8a1fb044dda1aa6b537cc50c09f5a8790ae2647517506350b6a | Python | 25,964 | 753 | import numpy as np
from dipy.align import floating
from dipy.align import sumsqdiff as ssd
from numpy.testing import (assert_equal,
assert_almost_equal,
assert_array_almost_equal,
assert_allclose)
def iterate_residual_field_ssd_2d(delta_... |
5c77cfd346a0fa4ca39df8e2e86fe33fe4aa04f553082d2402d0e49b699d51ac | Python | 25,976 | 760 |
import numpy as np
import itertools
import copy
from dipy.segment.clustering import Cluster, ClusterCentroid
from dipy.segment.clustering import ClusterMap, ClusterMapCentroid
from dipy.segment.clustering import Clustering
from dipy.testing import assert_true, assert_false, assert_arrays_equal
from numpy.testing imp... |
76e2a7be9eee0afbd8c73c2bab81d76921ca936f1a5349b529aa3c32a07378ae | Python | 26,017 | 773 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Command-line support for coverage.py."""
from __future__ import print_function
import glob
import optparse
import os.path
import sys
import textwrap
import tra... |
5790d5b5dad3dfbf510748071bf5127b047c478ca4370fbbf03e691013386a86 | Python | 26,238 | 542 | """Caller-owned preparation and training manifests, forked from Limen."""
from __future__ import annotations
import copy
import inspect
import logging
import random
import re
from collections.abc import Callable, Mapping
from dataclasses import dataclass, field, fields, is_dataclass
from typing import Any
import nump... |
3793ae8cdcbc52e2a30f0d0e56f6851b4aaf8f6aa8a3c0619711dd615e1246f7 | Python | 26,240 | 635 | """
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... |
dcce57b2554be1eaec338e92de78c1c59c5ba62b85783686e579d71417cbf070 | Python | 26,302 | 679 | from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, models, router, transaction
from django.db.models import DO_NOTHING
from django.... |
9a8ffeaf36371e3db0512fe7d7fdfdd3bc3e371445fef444208e71101a2cefa1 | Python | 26,314 | 589 | import time
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import dclab
import cv2
from scipy import ndimage
from keras.models import load_model
import aid_cv2_dnn
#this script contains all functions from AIDeveloper, that are required
#to preprocess images before forwarding through... |
e58e1be0a883b4cad4b744cda2b2da77dcfd753afd2b9fc27106fdc0b45ba8b3 | Python | 26,323 | 693 | import pytest
import numpy as np
from skimage.measure import label as ski_label
from albumentations.augmentations.dropout.functional import label as cv_label
from albucore import MAX_VALUES_BY_DTYPE
import albumentations.augmentations.dropout.functional as fdropout
from tests.utils import set_seed
@pytest.mark.para... |
d10a35657a38e792f50e5682d1813f8b13f886452f31a9ca0fe4aff74ef99f8f | Python | 26,330 | 772 | ###############################################################################
# BIDSschema.py contains class that loads BIDS schema, creates models for given
# sullfix and datatype, and performs validation of bidsified files
###############################################################################
# Copyright (... |
7185e3d0f0e96bbe58327cbc04fb01b2737725138f238c45da817fb1bf2af734 | Python | 26,384 | 545 | #!/usr/bin/env python3
"""
Synthetic tests of MAG-S3b with known answers. The estimate is checked on hand-made worlds (linear counts with
known gamma and eps, Poisson noise and a shared gain term) and on noise-free records of the neural model; the pair
physics on exact symmetries; the receptor on closed-form moments. N... |
36e57ff3a6481219af29a7b8c6eeb4ae5a703232df55f494f299d483ecba7765 | Python | 26,392 | 1,011 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Awaitable", "Coroutine",
"Asyn... |
068259d3b2838aa0632924e1bbbdb5acdd22a7ecf5defe6c989bc25aa8c081ec | Python | 26,428 | 642 | # -*- coding: utf-8 -*-
"""
babel.messages.extract
~~~~~~~~~~~~~~~~~~~~~~
Basic infrastructure for extracting localizable messages from source files.
This module defines an extensible system for collecting localizable message
strings from a variety of sources. A native extractor for Python source
... |
2f5452469bbf9b9e4a368d39bf27c3e2408952d4fa47cb07a4e465ebe90fe393 | Python | 26,444 | 541 | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import argparse, sys, re, os
import matplotlib.pyplot as plt
import matplotlib_venn as mv
import seaborn as sns
from matplotlib.pyplot import MultipleLocator
import scipy.stats as sci
import venn
# from scipy.stats import spearmastat_funcnr
# i... |
6c68439cfdb1873fd90fbd77a5958ec9e3e4a10c222ed5e9983646c77a2dd649 | Python | 26,605 | 822 | """
per-test stdout/stderr capturing mechanism.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
import io
import os
import sys
from io import UnsupportedOperation
from tempfile import TemporaryFile
import six
impor... |
223dc7fac9cb8b95163d78ea7dab186bf41775e8d360395ee34e433580a53298 | Python | 26,632 | 773 | """ core implementation of testing process: init, session, runtest loop. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import fnmatch
import functools
import os
import pkgutil
import sys
import warnings
import attr
import py
import s... |
664ab4f8475e6709faa94bdffc223c89412cd94c5522f0e62821f58f4fb2d062 | Python | 26,676 | 675 | #
# DEPRECATED: implementation for ffi.verify()
#
import sys, os
import types
from . import model
from .error import VerificationError
class VGenericEngine(object):
_class_key = 'g'
_gen_python_module = False
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
... |
a9b007e901ce783ee941fff60da1718eff8da1e3ce0d21a5deba6e5b417506bd | Python | 26,729 | 711 | #!/usr/bin/env python3
"""Configure a repository created from the law template."""
from __future__ import annotations
import argparse
import json
import keyword
import os
import re
import shutil
import subprocess
import sys
import urllib.parse
from pathlib import Path
from typing import Final
try:
import tomllib... |
11b29e39cbc45263362f601ef82303287856641888aa5b28fca8027a6cf8781a | Python | 26,998 | 915 | #
# The Python Imaging Library.
# $Id$
#
# PNG support code
#
# See "PNG (Portable Network Graphics) Specification, version 1.0;
# W3C Recommendation", 1996-10-01, Thomas Boutell (ed.).
#
# history:
# 1996-05-06 fl Created (couldn't resist it)
# 1996-12-14 fl Upgraded, added read and verify support (0.2)
# 1996-12-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.