sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
16c2ecfff77752b3171edffbf50b6773a213f9d5ae71aa106aff0dc806a20fd7
Python
12,365
314
# -*- coding: utf-8 -*- # @Author: liangou # @Date: 2021-02-25 12:39:08 # @Last Modified by: liangou # @Last Modified time: 2021-04-18 16:32:48 # -*- coding: utf-8 -*- # @Author: liangou # @Date: 2021-01-25 22:08:08 # @Last Modified by: liangou # @Last Modified time: 2021-02-22 20:53:50 import pandas as pd imp...
e4f6f240a0ab3212d76243aa3afaa2b3513fa0261023ff7de3eba87c82086f49
Python
12,366
303
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'add_modifier.ui' ## ## Created by: Qt User Interface Compiler version 6.10.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #############...
012952cdfd8315f61f3afb6e77ea7e9bfce8ecaddfe482aca734c0ce395f35cf
Python
12,382
422
# -*- coding: utf-8 -*- """ celery.bootsteps ~~~~~~~~~~~~~~~~ A directed acyclic graph of reusable components. """ from __future__ import absolute_import, unicode_literals from collections import deque from threading import Event from kombu.common import ignore_errors from kombu.utils import symbol_by_n...
780f3d1acfb10fcb8a22a7f64d933936eda18655605b98e5202d5f7c610f8983
Python
12,413
242
""" JPEG quality settings equivalent to the Photoshop settings. More presets can be added to the presets dict if needed. Can be use when saving JPEG file. To apply the preset, specify:: quality="preset_name" To apply only the quantization table:: qtables="preset_name" To apply only the subsampling setting:: ...
77d4ff021609df9f40fef7f2e1faf03d0cea36e9d94935e4c9fb1d232d8774bc
Python
12,415
397
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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/licenses/LICENSE-2.0 # # Unless required by ...
25a1eeb5422fd3dca142e6e42f5a0dbad62078b521e6c237f6a0d28a6682bf43
Python
12,438
282
from mne.io import read_raw_fif from mne.io.constants import FIFF from datetime import datetime from numpy import ndarray from tkinter import messagebox, StringVar, IntVar import os.path as path import re from Biscuit.Management import OptionsVar from .BIDSFile import BIDSFile from .BIDSContainer import BIDSContainer ...
27d17b33073e82dc6cc029ab02e6a935dbfef69a0bd46e4279cfab0541f7bd09
Python
12,442
304
"""Create specification snippets for arbitrary paths""" import os.path as op import posixpath from six import text_type from datalad.interface.base import build_doc, Interface from datalad.support.constraints import EnsureStr from datalad.support.constraints import EnsureNone from datalad.support.param import Parame...
128799b6913380a43a304af5813664251bbc682f64cf9c1b1a64122068df0c7e
Python
12,446
431
############################################################################### # _dicom_common.py provides common functionalities to read and parce DICOM file ############################################################################### # Copyright (c) 2019-2020, University of Liège # Author: Nikita Beliy # Owner: L...
180cdbe6d6027e3d3e4d5a3b35df33ffed3ee33d4ab1588932461e2a88e92f47
Python
12,471
267
''' Created on May 17, 2018 @author: helrewaidy ''' # models import argparse from pycparser.c_ast import Switch import torch import numpy as np import os ########################## Initializations ######################################## model_names = 'recoNet_Model1' """ parser = argparse.ArgumentParser(descriptio...
900fcf38c066ccc85e334bceeff552f778cc8fe21c4a0d87b8306b35b23322af
Python
12,472
318
from __future__ import division, print_function, absolute_import import logging from dipy.workflows.workflow import Workflow from dipy.io.image import save_nifti, load_nifti import numpy as np from time import time from dipy.segment.mask import median_otsu from dipy.io.streamline import load_trk, save_trk from dipy.se...
6d8e54e21d82b9706407290ef1553f24dcc6172ff0e9ea32cc786965775c558c
Python
12,474
299
"""This module provides mixin functionality for the Albumentations library. It includes utility functions and classes to enhance the core capabilities. """ from __future__ import annotations import functools import logging from pathlib import Path from typing import Any, Callable from albumentations.core.serializati...
0a2867d287e5ba1fc21d42e495c375f8fa3bc271a69e37e43c7932624ec00df9
Python
12,487
290
# -*- coding: utf8 -*- """ Functions used to analyse oscillations: filtering, AC, phase, PSD, checking for significant frequencies... authors: András Ecker, Bence Bagi, Eszter Vértes, Szabolcs Káli last update: 02.2019 """ import pickle import numpy as np from scipy import signal from scipy.special import comb import ...
09d9f3735c3c3d0313012621626fcbcc9b26098946721f528a35a81f35b06cc7
Python
12,502
569
""" LANG_INFO is a dictionary structure to provide meta information about languages. About name_local: capitalize it as if your language name was appearing inside a sentence in your language. The 'fallback' key can be used to specify a special fallback logic which doesn't follow the traditional 'fr-ca' -> 'fr' fallbac...
b33cab736dca87b2b2552e8e9b1106f51971f0e052f3319dfd6d738c3692335f
Python
12,520
325
#DEGnext #Copyright Tulika Kakati 2020 #Distributed under GPL v3 open source license #This code may be used to train and test the model on T1 and T2 data for all the cancer datatsets and save the model for each cancer dataset. ################################## import torch import torch.nn as nn import numpy as np imp...
73c9b1021092a46e4af6c9cf5c7c290e70823a08153252a71f8b12d83abc48ef
Python
12,555
372
# -*- coding: utf-8 -*- """ celery.apps.worker ~~~~~~~~~~~~~~~~~~ This module is the 'program-version' of :mod:`celery.worker`. It does everything necessary to run that module as an actual application, like installing signal handlers, platform tweaks, and so on. """ from __future__ import abs...
b5c68dfcb5940daaef43492e4e72ed2b4c51e6d0b4b566821ec43fb145c99424
Python
12,556
304
import json from types import SimpleNamespace import pytest from PySide6.QtWidgets import QLineEdit, QPlainTextEdit, QPushButton, QTableWidget, QTableWidgetItem, QWidget from boris import config as cfg from boris import converters class ConverterWindow(QWidget): def __init__(self): super().__init__() ...
2bffe01c8fd4c96d2a52016ae0a6749c3ea2d64418d74c56ddca592734567318
Python
12,622
371
from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import re import unicodedata from warnings import warn from ...types import (ARTICLE, ARTICLE_JOURNAL, BOOK, CHAPTER, MANUSCRIPT, PAMPHLET, PAPER_CONFER...
fb3fdbe066e9624b0df3b97e5464bbff67362c5ac26211d59dc1e4609a7fb13b
Python
12,632
295
import os.path import schema import sargasso.separator.options as opts from schema import And, Or, Schema, Use from sargasso.utils import log class ParameterValidator(object): @classmethod def validate(cls, options): """ Validate command line options are correctly specified. options...
b98f98320fba0b8d151669bb477710aa977c2bc2d1b90b6e642541e420c3447a
Python
12,675
419
# # The Python Imaging Library. # $Id$ # # EPS file handling # # History: # 1995-09-01 fl Created (0.1) # 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2) # 1996-08-22 fl Don't choke on floating point BoundingBox values # 1996-08-23 fl Handle files from Macintosh (0.3) # 2001-02-17 fl ...
4dee4d487de3d67a65623e678c69ab1ae9f3a6c06593f2f778d1323600797487
Python
12,695
382
import numpy as np import skimage.io from scipy.ndimage import zoom from skimage.transform import resize try: # Python3 will most likely not be able to load protobuf from caffe.proto import caffe_pb2 except: import sys if sys.version_info >= (3, 0): print("Failed to include caffe_pb2, things mi...
924038acb1ad5b01fd9bcfa48c3c61ea97e07f448660efb205a83ebebb14101b
Python
12,713
407
# -*- coding: utf-8 -*- """ celery.utils ~~~~~~~~~~~~ Utility functions. """ from __future__ import absolute_import, print_function import numbers import os import re import socket import sys import traceback import warnings import datetime from collections import Callable from functools import partial,...
8b6b199707420467bc51348ff356028392deea721bc4e17c11381fe4cd9ce947
Python
12,741
298
# coding=utf-8 from django.contrib.auth.decorators import login_required, permission_required from django.contrib import messages from django.contrib.auth.models import User, Group from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render, redirect, get_object_or_4...
3567232f876bc10d20fd1fc22d3e7c23fbe318c5ff078324d239098c5b5f9e1d
Python
12,744
307
""" 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 ...
9d6fee3065119079c4b3ebc41a0f9c8936109973e841771f02f7d27bb8cf6696
Python
12,745
385
from __future__ import absolute_import import sys import logging from collections import defaultdict from io import StringIO from tempfile import mktemp from celery import signals from celery.app.log import TaskFormatter from celery.utils.log import LoggingProxy from celery.utils import uuid from celery.utils.log im...
654b3ab92fc9d6840eb21451c58c3544bbccb04a6b21de8c25a65c103645b734
Python
12,777
278
import random import numpy as np from dipy.tracking.local.localtrack import local_tracker, pft_tracker from dipy.tracking.local.tissue_classifier import ConstrainedTissueClassifier from dipy.align import Bunch from dipy.tracking import utils # enum TissueClass (tissue_classifier.pxd) is not accessible # from here....
92ba848fd0de5d38e0585d1a214359840e30e59ebb29a9acd40b5a1e6af4f5e1
Python
12,797
346
import numpy as np from scipy.ndimage import gaussian_laplace import math from math import sqrt from scipy import spatial from skimage.util import img_as_float from skimage.feature import peak_local_max """This basic blob detection algorithm is based on the blob_log function from https://scikit-image.org/""" def _...
f2e5c69240693dc3b7965ac8de2a03913b1acdc2690c4bce85b4776723dfefdf
Python
12,826
379
from abc import ABC, abstractmethod from pathlib import Path from typing import Union import cv2 import numpy as np from aicspylibczi import CziFile from PIL import Image from histoprep.functional._level import format_level from histoprep.functional._tiles import _divide_xywh, _get_allowed_dimensions, _pad_tile try:...
06d9012ee4ae84ece4e8aabc04310bcc8b20cc4bfc539f76bcf9f16eba18ef14
Python
12,834
326
""" Testing DKI microstructure """ from __future__ import division, print_function, absolute_import import numpy as np import random import dipy.reconst.dki_micro as dki_micro from numpy.testing import (assert_array_almost_equal, assert_almost_equal, assert_, assert_raises) from dipy.sims.v...
36eeb67824dfd655caa585df4a24d5d2a07645fb24d043935b706ce4cfb8a302
Python
12,856
331
from __future__ import division from __future__ import print_function from datetime import datetime from models import * from utils import * from metrics import * from attention import attentionModel import tensorflow.compat.v1 as tf import random import matplotlib.pyplot as plt tf.disable_eager_execution()...
c757436fd525d986f2e5b76a1273734259f54a717d7ee3893890e54557cf3d1a
Python
12,869
318
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # -*- coding: utf-8 -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and...
9b8ccdb73cf3b77ad31861d1086836bc318a3c4d3cc6cde0a04bce48e8f365e2
Python
12,872
339
############################################################################### # hmriNIFTI.py provides the implementation of MRI class for Nifti file format # as created by SPM12 (hMRI tollbox) ############################################################################### # Copyright (c) 2019-2020, University of Lièg...
adcc0a82419fa79cde685e0455725f1a184f70bdd1ee08d1171b0e3e0664059e
Python
12,880
333
#!/usr/bin/env python2 desc="""Generate nice graph with coverage for multiple samples. Tracks are in colors and merged track is added if less than 13 samples. First generate cov.bed files is: for f in bowtie2/*.bam; do echo `date` $f; bedtools coverage -counts -abam $f -b ../ensembl/Fusarium_oxysporum.FO2.15.dna.topl...
f4951399cfd054d73c01e4397592f4520e0a56bc2303cde4a7b2334815d48bd6
Python
12,889
325
#!/usr/bin/env python2 desc="""Generate nice graph with coverage for multiple samples. Tracks are in colors and merged track is added if less than 13 samples. First generate cov.bed files is: for f in bowtie2/*.bam; do echo `date` $f; bedtools coverage -counts -abam $f -b ../ensembl/Fusarium_oxysporum.FO2.15.dna.topl...
66424739b77ea992b4aa380e15bb618d2de1e233136be022102b88b11f978bcf
Python
12,897
259
import numpy as np import polars as pl import pytest from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from talos.experiment.manifest_core import MachineLearningManifest, Manifest, MLManifest from talos.scalers.robust_scaler import RobustScaler def iris_splits(): iris = ...
d5f0feaba68c65e2f1aaf3587af12516490a0d0f2470e574bc31c24e5e0b6d5c
Python
12,923
289
# 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...
0ae66203a582011c80a98c26f0c514a69562f3a4d9116f7dc51b6f5d5a8b35cc
Python
12,924
293
# -*- coding: utf-8 -*- """ Created on Tue Feb 04 10:36:35 2020 @author: Dong Li """ from skimage import io import os import numpy as np import matplotlib.pyplot as plt import powerlaw from scipy import asarray as ar,exp from scipy.optimize import curve_fit import scipy.stats as stats import random as ...
ecb936f33a12e0d23d91b628db4f30c77aacf9a39901ffbee5af159ef56b74ff
Python
12,960
422
# 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 from enum import Enum import six from crypto...
3a0289392b293934c230c4570eeaf3ea34ec00bd38391791100adb4072f01df2
Python
12,975
419
from six import PY2 from functools import wraps from datetime import datetime, timedelta, tzinfo ZERO = timedelta(0) __all__ = ['tzname_in_python2', 'enfold'] def tzname_in_python2(namefunc): """Change unicode output into bytestrings in Python 2 tzname() API changed in Python 3. It used to return bytes,...
3e5a97f11c13ba71851665824c45a84cf79dde535447d35423219e1979858f7b
Python
13,000
320
import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_, assert_almost_equal) from dipy.sims.voxel import (_check_directions, SingleTensor, MultiTensor, all_tensor_evecs, add_noise, single_tensor, ...
18953711b1cae4b5afc745456e86157c44353ccc065992e046c0a1333ee2c6ea
Python
13,017
141
# 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 ...
c949cd987abfcd09f0d7f8bb7396a2edc5edc8a6085effecb39ba196bcc00b0a
Python
13,019
430
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2013 Benjamin Peterson # # 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 with...
abb1400d4faa866cc97dafa4ee608fca888c598353ef6e98993ce2134a50c7ae
Python
13,027
457
from deg_analytic_func import * from deg_numeric_func import * from gwcc_conf_func import * import numpy as np from progress.bar import Bar import time from numpy import linalg as LA class AdaptiveDegradation: def __init__(self,ins,dist,SAMPLES,outstring,plot,TOLLK): self.instring = ins self.weight...
a4ac76c40efb7fe9f9287bb306e5fa8546c5522c010f5c77805a1d1ae0e72c9b
Python
13,044
470
""" Model and loss/metrics functions definitions. This module contains the declaration of the U-Nets in Keras / Tensorflow as well as the loss function we used to train them. See our publications for descriptions of the models and losses. For the seminal paper describing the structure of the U-Net model: `Ronneberg...
6981aa63f8962eeda9e24ee592e27ab777eaa5fe9a3c6a93b322f3358fe780a8
Python
13,062
374
import os import sys import shutil import tempfile import contextlib import shlex from ._compat import iteritems, PY2, string_types # If someone wants to vendor click, we want to ensure the # correct package is discovered. Ideally we could use a # relative import here but unfortunately Python does not # support tha...
d50428dd17b1a671b07372b440727b44154df6a1ba5ec597fa6c1c37064e440b
Python
13,082
339
"""Module for managing and transforming label data during augmentation. This module provides utilities for encoding, decoding, and tracking metadata for labels during the augmentation process. It includes classes for managing label transformations, preserving data types, and ensuring consistent handling of categorical...
f8d84e19538815d8a0713890d2c94dc545fd3aebe5490ae24d3c78f0519ed402
Python
13,089
317
""" 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...
f2fdd74fec66d66338fb7578e90a6bc43e057f55d51349793fc1e3c12685af27
Python
13,106
411
# -*- coding: utf-8 -*- """ This module offers a parser for ISO-8601 strings It is intended to support all valid date, time and datetime formats per the ISO-8601 specification. ..versionadded:: 2.7.0 """ from datetime import datetime, timedelta, time, date import calendar from dateutil import tz from functools impor...
dee986bfba65b1dae7392180a5007a16f682281733b787d783a23559dd0c2b9b
Python
13,109
442
"""CLI interface for cutting slides into small tile images.""" __all__ = ["cut_slides"] import functools import glob import sys from pathlib import Path from typing import NoReturn, Optional, Union import mpire import rich_click as click from histoprep import SlideReader # LOGO = """ # ██╗ ██╗██╗███████╗████████╗...
28c0768c58a4946e1a50a71f30246cbd0996d9536b4ab73a8a8e66e23136cb3e
Python
13,141
314
import os import numpy as np import cv2 import torch import yaml from argparse import Namespace from monai.transforms import ( Compose, ToTensord, ScaleIntensityd, AsDiscrete ) from monai.networks.nets import UNet from torchmetrics import JaccardIndex from monai.metrics import HausdorffDistanceMetric im...
e8e807de915f7605f21fe8fd5a72541a039bf8256f368a35aeadf7b2598f93aa
Python
13,207
397
"""Utilities for assertion debugging""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import pprint import six import _pytest._code from ..compat import Sequence from _pytest import outcomes from _pytest._io.saferepr import saferepr # The _reprcompare a...
e1e9900c59ae2f8fd1edb2b1a2c2e37546fe5523d69039bbb2ecb7f05e4429c0
Python
13,260
305
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'param_panel.ui' ## ## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ###############...
d9d16d462e2c0db9345f6cdc98a4441619c03b6288f5ef222f5bb33f43ad3a81
Python
13,346
324
""" 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...
a9eadffc6039b498f5a77f21504f40800cab4427140587b60744980a5941f657
Python
13,409
400
import torch import torch.nn as nn import torch.nn.functional as F import models as m import constant as c import sys import os sys.path.append(os.path.join(sys.path[0], '../')) from utils.config import device ############################################################### # Functions layer_val = {} def hook_laye...
697d9faca8f50eb542b3e912bac2165086aa7dfcd75965dd039a03efb7d744fc
Python
13,410
359
from urllib.parse import urlparse, urlunparse from django.conf import settings # Avoid shadowing the login() and logout() views below. from django.contrib.auth import ( REDIRECT_FIELD_NAME, get_user_model, login as auth_login, logout as auth_logout, update_session_auth_hash, ) from django.contrib.auth.decorato...
808ffe44b54e060194c0f53c90f5b4240eb1453045d6b13c5be701b0058e7e96
Python
13,451
312
""" 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...
e782458ef8d7de14af25a04620537503ab45e6751e4da4c7adba47ed825252d6
Python
13,469
316
# 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...
b74aee3d21aaa4e12915000cc3a986ba7d0dc29727bba7ba88c394b40b322779
Python
13,486
337
from tkinter import messagebox #from warnings import warn from mne.io import read_raw_kit from mne.io.constants import FIFF from Biscuit.Management import OptionsVar from Biscuit.utils.utils import get_object_class from .BIDSContainer import BIDSContainer from .generic_file import generic_file from .BIDSFile import B...
a8b9940d7fea26d986431a274f024ef79dd66c375b371e3e049fb140f71831d1
Python
13,487
322
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):...
73831752bcacba2adddd6bc5260a6c3c0cbefd1ff6f9cf56224f0d1761ed0303
Python
13,491
516
""" This was taken directly from the file test_docscrape.py of numpydoc package. Copyright (C) 2008 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1...
06e49d7f728306c1ad8bc7e7086fc73f9e08fc9ab253fd677dc7188df54699c5
Python
13,496
377
from collections import defaultdict, namedtuple from django.contrib.gis import forms, gdal from django.contrib.gis.db.models.proxy import SpatialProxy from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.geos import ( GeometryCollection, GEOSException, GEOSGeometry, LineString, Multi...
ed706bc8495decf46bed2e5c1b8b5897862fe23c2787c28fd8c2dd647a715473
Python
13,502
344
############################################################################### # hmriNIFTI.py provides the implementation of MRI class for Nifti file format # as created by SPM12 (hMRI tollbox) ############################################################################### # Copyright (c) 2019-2020, University of Lièg...
0b644fc81a93dc862012de5a052312ce096e3e5d4ae5ff63c63516c8ee193edc
Python
13,561
388
#!/usr/bin/env python3 """Conventional Commits gate -- hard-fail on any deviation. The linked-issue rule checks every closing-referenced issue rather than short-circuiting on a single reference: under slice-gate rule 9 the last slice's PR closes {slice, parent PRD}, and a single-reference short-circuit would skip slic...
b44e50a319bfd629c3d7b040e5bc2095b93123420be657c92d6d2ee2e47b9723
Python
13,561
358
#! /usr/bin/python3.7 # -- coding: utf-8 -- ** import sys import socket import time import pickle import os import shutil import mayavi from mayavi import mlab import nibabel as nib import numpy as np import matplotlib matplotlib.use("Qt5Agg") from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as Figure...
ec566142c523d74ac8df622ce01013f013bb52df0242439b605f9adf8b47dfb8
Python
13,566
441
""" This was taken directly from the file docscrape.py of numpydoc package. Copyright (C) 2008 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Red...
b7838f32dcd6f1df968c76d4ae15e880af1e6232e4e22392d5546f0b017569c6
Python
13,575
254
#!/usr/bin/env python3 """Execute documented control/command pages with real held-out Iris data.""" import argparse import contextlib import hashlib import io import json import os import re import subprocess import sys import tempfile import time import traceback from pathlib import Path PAGES = ['Analyze', 'Predict'...
be0ed7903c73c263f9f71cc384c94a7fed8355fb1672d84c3f636b044182b0cc
Python
13,580
361
import warnings import numpy as np import numpy.testing as npt from dipy.data import get_fnames from dipy.core.gradients import (gradient_table, GradientTable, gradient_table_from_bvals_bvecs, gradient_table_from_qvals_bvecs, ...
0196959aa68914901c65d72614b4e6b1f77b5e141a2cf4a1a890c1aacda45984
Python
13,626
329
#!/usr/bin/env python2 desc="""Report chromosome/contig ploidy TBA: - some function fitting ploidy with int - same for alt alleles """ epilog="""Author: l.p.pryszcz+git@gmail.com Warsaw, 13/12/2017 """ import os, sys, pysam, resource from datetime import datetime from multiprocessing import Pool import numpy as np f...
6fc7d7a424655df41560e9f2a63571f702bcb6e33e40a8b56a99d2374ce3d9e1
Python
13,628
449
# # Module implementing synchronization primitives # # multiprocessing/synchronize.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import import itertools import os import signal import sys import threading from ._ext import _billiard, ensu...
bc5c3311dea95094eed63a14f4e2ff1483d8e831b828d72b5c9cae251b869cfc
Python
13,641
393
# -*- coding: utf-8 -*- """ celery.worker ~~~~~~~~~~~~~ :class:`WorkController` can be used to instantiate in-process workers. The worker consists of several components, all managed by bootsteps (mod:`celery.bootsteps`). """ from __future__ import absolute_import import os import sys import trac...
b68ffa78d28423f71fb362cdde78523eeabb96a36519e35b641c254127f53a54
Python
13,651
457
""" python version compatibility code """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import codecs import functools import inspect import re import sys from contextlib import contextmanager import py import six from six import text_type import _pytest...
7b8bf2f7071a9c4487ea93997ed3c648ac7a10b2e982fba5ac1cd272b63a2027
Python
13,654
452
"""Expose manifest, parameter-sweep and recovery commands through Click.""" from pathlib import Path import click from talos import __version__ @click.group() @click.version_option(version=__version__, prog_name='talos') def cli() -> None: ''' Talos — declarative ML experiment runner. \b Define e...
9670a6e5edfb94ba2a23f75381fd9dbf9a92faf1a8f022f731087aa232c5040d
Python
13,654
381
# 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 functools from cryptography import utils, x509 from cryptography....
1e5604a1c349ab63311966f04984ac864998d853741b95d412005e5e5922edc0
Python
13,699
275
"""Real Iris recovery preserves realized legacy rows without another entropy request.""" import importlib.util import json import sys import numpy as np import pytest from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split import talos from talos.experiment import RunResult from t...
7408d4c2b45cca33906a07bacc188017deacba9fea8c9bd4709e1c9b0501625a
Python
13,716
387
""" merged implementation of the cache provider the name cache was not chosen to ensure pluggy automatically ignores the external pytest-cache """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os from collections import OrderedDict imp...
0cd46facd843138be569de98f82b81994411f12f1884eff13b2b010c8cbd6103
Python
13,734
398
"""Tests for the reusable Qt dialogs and widgets.""" from decimal import Decimal from pathlib import Path import pytest from PySide6.QtCore import QDateTime, QTime from PySide6.QtWidgets import QDialog, QMessageBox, QTableWidgetItem from boris import config as cfg from boris import dialog @pytest.fixture def warni...
6f1610d3aeeedbe829942955660fdd7998c463ab18be193702de8b566fc2a31f
Python
13,737
427
from pprint import pprint import py import six from _pytest._code.code import ExceptionInfo from _pytest._code.code import ReprEntry from _pytest._code.code import ReprEntryNative from _pytest._code.code import ReprExceptionInfo from _pytest._code.code import ReprFileLocation from _pytest._code.code import ReprFuncAr...
c4eedea23e5674a7dd4b2bddff8e23f9ebd7c58a93de5718360b61f4e916d463
Python
13,745
322
import os import sargasso.separator.options as opts import subprocess from sargasso.utils import log class Separator(object): DOC = """Usage: species_separator -h | --help species_separator -v | --version species_separator <data-type> [<args>...] Options: {help_option_spec} {help_option_descript...
a26937d82de8c884aece31f7ee59b33b67bde43537aa79133f0cd90075e3e1dc
Python
13,758
500
# 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 warnings import six from cryptography import utils fr...
6cee688a588aa8bee9f7c60e7b6665ee5743ebace8c724f3daeed57b1a50241b
Python
13,776
438
"""Functional implementations of various blur operations for image processing. This module provides a collection of low-level functions for applying different blur effects to images, including standard blur, median blur, glass blur, defocus, and zoom effects. These functions form the foundation for the corresponding t...
c8a1556ae306eb4e0d1ae7f7948b220646e1e341637e974becc560609424a12b
Python
13,785
387
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
fd8d099771e1dd1c077170f62f8f903c8c9c786f711c92621453d8dc4831d926
Python
13,804
268
from __future__ import division, print_function, absolute_import import numpy as np import numpy.testing as npt import nibabel as nib from nibabel.tmpdirs import InTemporaryDirectory from dipy.io.streamline import (save_trk, load_trk, save_tractogram, save_tck, load_tck, load_tractogram...
df729d07fc563199ceef471b31eea09e1e8c04cf257e0936f6939cf46385eb43
Python
13,834
449
import cv2 import numpy as np import albumentations as A transforms2metadata_key = { A.FDA: "fda_metadata", A.HistogramMatching: "hm_metadata", A.PixelDistributionAdaptation: "pda_metadata", } AUGMENTATION_CLS_PARAMS = [ [ A.ImageCompression, { "quality_range": (10, 80), ...
1638912c427becd54b3b513bcce6bee2b2b06334dad0716fd9d61aa23b7cb8a3
Python
13,885
381
from typing import Union, List import numpy as np from numpy.typing import ArrayLike from scipy.stats import t def outliers_iqr( x: Union[List, np.ndarray], ret: str = "filtered", coef: float = 1.5 ) -> np.ndarray: """Simple detection of potential outliers based on interquartile range (IQR). Data that lie...
28cbef06d378b3ac8b016f9415aad095e9720c11f25400772632a354ef72ba4e
Python
13,896
411
"""Focus parameter exploration around observed metric breakthroughs.""" import logging from math import ceil, floor from numbers import Integral, Real from typing import Any import polars as pl from typing_extensions import override from talos.experiment.reducer.filter_types import FILTER_KEEP_BETWEEN, FILTER_KEEP_V...
abcfb5545539147cab47a99a6d069cefdec3b373294587130053367afbf47cfe
Python
13,897
447
############################################################################### # _run.py defines Run class that manages individual runs from which bidsmap # is constructed ############################################################################### # Copyright (c) 2019-2020, University of Liège # Author: Nikita Bel...
65373eef56590885cb162ff340b443404df6f7bdee9131d2671ea2caba1e7648
Python
13,909
428
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import warnings import py import six import _pytest._code from _pytest.compat import getfslineno from _pytest.mark.structures import NodeKeywords from _pytest.outcomes import fail SEP = "/" traceb...
1a0da6ce03f38891996eb6221cca8dfa813b1d18fe8e3bcdf7a533b4ac27ce08
Python
13,924
430
import glob import os class Loader: """Parent class to load datafrom implimented datasets. To build ground truth datasets.""" FOLDERS = None DATASET = None def __init__(self, data_path, gt_standard, gt_type, ext=".tif"): self.img_file_names = [] self.tmp_img_file_names = ...
04bd0acbfb3ab3f51cd574175e951ade5a2fbd4f6c2ca49e63ec43b08632cd42
Python
13,957
423
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """File wrangling.""" import hashlib import fnmatch import ntpath import os import os.path import posixpath import re import sys from coverage import env from cov...
9ad7eb95cb04c0d2d93d3f62979214d10b00c5567734b4913c3556090ce98371
Python
14,016
363
""" BORIS CLI Behavioral Observation Research Interactive Software Command Line Interface 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 o...
f687698169d0b45cf12988dffc6642e321074cf67ecf6db6390397385d0ba9be
Python
14,069
215
#! /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 PyQt5.QtC...
ca79ae4f2fe269c7a9db44c305d188cd3f4b30fd7fd02988a6cddab5d4b22017
Python
14,080
293
"""Supply-chain law: workflow actions are pinned by commit SHA and checkout credentials are never persisted. One assertion per law over every workflow file, so a regression in any one of them reds the required tests gate: 1. Every ``uses:`` reference is pinned to a full 40-hex commit SHA with a trailing ``# vX...
bb950c8402e556f4c107a35ff7a49b72bd95a77e903df7e181e3a2e7487a0879
Python
14,088
320
from django.test import TestCase from patient.models import Gender, Payment, FleshTone, Religion, Schooling, AmountCigarettes, AlcoholFrequency,\ AlcoholPeriod from patient.views import * from django.contrib.auth.models import User from patient.tests.tests_orig import UtilTests USER_USERNAME = 'myadmin' USER_PWD =...
8fa1c2509bf82409fe5068f1f65c16f996eb7061739175cfc6d5bef8279a1836
Python
14,161
406
from __future__ import absolute_import import json import pickle import socket from contextlib import contextmanager from datetime import timedelta from pickle import dumps, loads from billiard.einfo import ExceptionInfo from celery import states from celery.backends.amqp import AMQPBackend from celery.exceptions i...
1d5498134af924a330b416e679ab3f9ccd0b64ce7008148f851e6543b1a96222
Python
14,166
408
# -*- coding: utf-8 -*- """ celery.events ~~~~~~~~~~~~~ Events is a stream of messages sent for certain actions occurring in the worker (and clients if :setting:`CELERY_SEND_TASK_SENT_EVENT` is enabled), used for monitoring purposes. """ from __future__ import absolute_import import os import tim...
cbfa2342aaa49f6aa7566c3fa8050619e91d6ef1fae1bd0a707ed6663ec051c1
Python
14,175
422
import numpy as np import pytest from albumentations.augmentations.mixing.domain_adaptation_functional import PCA, MinMaxScaler, StandardScaler, apply_histogram import numpy as np import pytest from skimage.exposure import match_histograms as skimage_match_histograms from skimage.metrics import structural_similarity a...
0e6be49be69e328b2f19d15b3465ee6b9a2d93cd508f0879bc42068e56633c38
Python
14,180
379
# -*- coding: utf-8 -*- """ celery.app.builtins ~~~~~~~~~~~~~~~~~~~ Built-in tasks that are always available in all app instances. E.g. chord, group and xmap. """ from __future__ import absolute_import from collections import deque from celery._state import get_current_worker_task, connect_on_app_fi...
91fb10c1973e45ded1d6bf1b1835538c3cab4832a531ee07286bd5121d2be0c5
Python
14,184
425
""" Read test or example data """ from __future__ import division, print_function, absolute_import import sys import json import warnings from nibabel import load from os.path import join as pjoin, dirname import gzip import numpy as np from dipy.core.gradients import GradientTable, gradient_table from dipy.core.sph...
38cb96f5f52fdf872926d44823135276898345288a7d55f384854441b5a3aedf
Python
14,234
430
from django.contrib import auth from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.core.mail import send_mail from django.db import models from django.db.models.manager imp...
c466d539797b25fce98b59d8a15030dd11911fe97cf4761b7a3312d38fa2f123
Python
14,247
366
from __future__ import absolute_import import datetime import uuid from pickle import loads, dumps from celery import states from celery.backends import mongodb as module from celery.backends.mongodb import MongoBackend, pymongo from celery.exceptions import ImproperlyConfigured from celery.tests.case import ( A...
33783d6cc9354f13d266ddf559de2e78ffae326500de8752ccfd771565ef2377
Python
14,268
312
from tensorflow.keras.layers import AveragePooling2D, MaxPool2D, Dropout, Flatten, Dense, Input from tensorflow.keras.layers import ConvLSTM2D, BatchNormalization, Conv3D from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.applications import ResNet50 from tensorflow.keras.opti...