sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d41e595d712be53e9bdb1a952d51fdbf5ff12f5768f8431e1b0e5d8989328551 | Python | 38,350 | 1,131 | """PyPI and direct package downloading."""
import sys
import os
import re
import io
import shutil
import socket
import base64
import hashlib
import itertools
import configparser
import html
import http.client
import urllib.parse
import urllib.request
import urllib.error
from functools import wraps
import setuptools
f... |
1fa3860c24469893a4bc3d0323c3849c01f5df16a68fa78983000274724fc7a8 | Python | 38,375 | 843 | #!/usr/bin/env python3
import os
import sys
import glob
import argparse
import numpy as np
import torch
import torch.nn as nn
from PIL import Image, ImageFilter, ImageStat
import openslide
from openslide.deepzoom import DeepZoomGenerator
from skimage import io, transform, color, img_as_ubyte, exposure
from collections ... |
76fcc4307dee11a9ba9c3da54b6904f7e8860675a43876f0d36fe563f35403dc | Python | 38,426 | 938 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.
#
# 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.or... |
9a9cf749347de2d19f653e662a687ea314a172e22a3b07423bbfa17a249d4ab6 | Python | 38,449 | 876 | # -*- coding: utf-8 -*-
#
# Decorators for Syncopy metafunctions and `computeFunction`s
#
# Builtin/3rd party package imports
import functools
import h5py
import inspect
import numpy as np
import dask.distributed as dd
import syncopy as spy
from syncopy.shared.errors import (
SPYTypeError,
SPYValueError,
... |
35ee16405f732d5bf3b8a18ce1044000d32de8b004841031f88184e683b62cbc | Python | 38,469 | 808 | import random
import scipy
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib import rc, rcParams
from mpl_toolkits.mplot3d import Axes3D
rc('text', usetex=False)
rc('axes', linewidth=1.5)
rc('font', weight='regular')
cm... |
1d53a4cc34e36da9411087a98d15d2f8216c1b749b88f89852f5d787d5cb95f2 | Python | 38,582 | 915 | from __future__ import annotations
from typing import TYPE_CHECKING, cast
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.stats as ss
from fast_array_utils.conv import to_dense
from ott.geometry.pointcloud import PointCloud
fro... |
e2927c898ca572555128a07853b5d07c305b63785e58d519b9d3834b6ecf5bcd | Python | 38,596 | 845 | # Pipeline imports
import argparse
import itertools
import os
import shutil
import time
import zlib
import docker
import pandas as pd
# from pymol import cmd
from rdkit import Chem
from rdkit.Chem import PandasTools
# Extra VinaGPU imports
import datetime
import re
import subprocess as sp
from meeko import MoleculeP... |
8b9e335c04000b883769b227e1bc7340040745b769ace77ddb89f1821978d359 | Python | 38,626 | 1,006 | __all__ = ['Distribution']
import io
import itertools
import numbers
import os
import re
import sys
from contextlib import suppress
from glob import iglob
from pathlib import Path
from typing import List, Optional, Set
import distutils.cmd
import distutils.command
import distutils.core
import distutils.dist
import d... |
059247080f124b4a588a8df428641373dc36a8c39a2b862967b85cbc76e74e09 | Python | 38,646 | 1,100 | # helpers.py
import html.entities
import re
import sys
import typing
from . import __diag__
from .core import *
from .util import (
_bslash,
_flatten,
_escape_regex_range_chars,
replaced_by_pep8,
)
#
# global helpers
#
def counted_array(
expr: ParserElement,
int_expr: typing.Optional[ParserEl... |
8cf909a9150e338c266744c6bbc2926900ce15aa1bb0992fe4dee8efaca241ca | Python | 38,657 | 1,022 | from fitnessFunctions import fF,frange
from optionHandler import optionHandler
import sys
import logging
import numpy as np
import copy
import random
import json
import time
import os
from math import sqrt
from multiprocessing import Pool
from itertools import combinations, product
from types import MethodType
try:
... |
a866afa759e09ecbcb3aa170a00babc1cdfb78978f5fffbe089c8b4780cf2222 | Python | 38,705 | 984 | # Node-group asset "Color PyMOL" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump.
from typing import TYPE_CHECKING, ... |
97a304a582bd07b630bcd4488608de244a673160395fe4b408ca831359776ecd | Python | 38,817 | 1,074 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
e4487d3e1cc5b5d8b249312cb8723164cc87329e892079ea052fe4a51676e156 | Python | 38,818 | 1,827 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
49853ee696f65907a6f87a9c72de05dab1e26fb39a231630c9cc9c35ae2d1a75 | Python | 38,908 | 787 | # Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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 applicabl... |
55d4e74206e827d58aa28dbf2ee88e97a0c185835c6eb0cf966b8d451e9e0797 | Python | 38,934 | 1,078 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology
with the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
8b68f9cfda7026ea86b4aa5bfa95f14e2b031d364f81cb1e694c9754705cf949 | Python | 38,959 | 959 | #! /usr/bin/python3
#
# Copyright (c) 2018 Warren J. Jasper <wjasper@ncsu.edu>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) a... |
18ead5583888fc1ac9c5c92352eb6ab1cc094c52c21bd27357253905ca9f35c4 | Python | 39,029 | 934 | from utils.logger import get_logger
from pathlib import Path
from datetime import datetime
from concurrent.futures import ThreadPoolExecutor
from operator import itemgetter
import numpy as np
import pandas as pd
from scipy.stats import f_oneway
from hdf5storage import savemat, loadmat
from utils.api.tcga_api import (ge... |
b7041feb977fb6a096605ac16877b4034a7e1d0d8d780d237bbff30e6327f218 | Python | 39,030 | 880 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
Output: - Plots by tomograms:
+ Number of particles by list
+ Particles densities by list
... |
357dc98e29417f806cd5a6e3206f3e64a1afd1016ce71738def3bc1a8907c571 | Python | 39,047 | 1,006 | # 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.
"""
.. testsetup::
from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
from packaging.version import Versio... |
ea293eaaabd989944a51a8dd246e0ec30fac5356a33baae08e2a68ac06a30b2c | Python | 39,053 | 830 | """Quantify a segmentation against the atlas, per region.
Reports for each atlas region present in the data: how many objects touch it,
their average size, and what fraction of the region they cover.
THE MEASUREMENT HAPPENS IN THE DATA'S FRAME, NOT THE ATLAS'S. Amyloid plaques
are roughly 10-50 um and the CCF i... |
248f409e24d7a09d912c07bfc6a5ff779a6570e2984b6e281fdcb381088f5783 | Python | 39,056 | 1,059 | import os
import numpy as np
import shutil
import pyqtgraph as pg
from pyqtgraph.exporters.ImageExporter import ImageExporter
try:
from pyqtgraph.exporters.ImageExporter import ImageExporter
except ImportError:
import pyqtgraph.exporters.ImageExporter as ImageExporter
try:
from pyqtgraph.opengl.MeshData import Me... |
4b5b67af6fb9ebe91739ea070b59f8b309b68df22676a529e150ad63bd88e62e | Python | 39,112 | 1,998 | from __future__ import annotations
from pathlib import Path
import cv2
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import umap
from matplotlib.colors import to_rgb
from .config import PlotConfig
from .style import (
mg_color,
cluster_display_order,
style_axis,
add_cluster... |
e2bed46ca2614a3fbb04b8137d32e8f3e0265ff22151589584fda3fb4f4d5e86 | Python | 39,175 | 684 | import os
import random
import numpy as np
import torch
from tqdm import tqdm
import wandb
from dataset import Edinb_SE_Dataset #, collate_batch_coherence_net
from model.coherence_net.model import CoherenceNet
from model.coherence_net.loss import CoherenceNetLoss
from utils.checkpoint_saver import CheckpointSaver
impo... |
64ea6a2ffc3f2a3e9917f396765890533844c879436e2ebdf3d92bfac179187b | Python | 39,206 | 1,008 | # 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.
"""
.. testsetup::
from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
from packaging.version import Version... |
752fb729e8378c36921c24a526dfaa7abcc78867f677da354da3771d6975a5b8 | Python | 39,276 | 1,205 | # Node-group asset "Color Element" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump.
from typing import TYPE_CHECKING... |
1b75746d2145cec4301e6cf64d5d3a1c15e57d9a847ee7c26be9fd1c73548a32 | Python | 39,379 | 1,043 | #!/usr/bin/env/python
import sys, os
# sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
# from rdkit import Chem
# from rdkit.Chem import rdmolops
# from rdkit.Chem import QED
from copy import deepcopy
import glob
import csv, json
import numpy as np
# from utils import bond_dict, dataset... |
a0159324ea7e2bcf223a2a03874ca9c7a4cec52c44a0bd6f7b734d0206548df7 | Python | 39,405 | 1,085 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
d92fbb14eb94c6e2f247531d9aefaf65cec5d0a6c859d6e7503137be6b6eeb4a | Python | 39,413 | 880 | # -*- coding: utf-8 -*-
# @Author: Diljit Singh Kajal
# @Date: 2022-04-08 15:00:00
#
# load_tdt.py Merge separate TDT SEV files into one HDF5 file
import os
from datetime import datetime
import re
import numpy as np
from tqdm.auto import tqdm
import h5py
# Local imports
from syncopy.shared.parsers import io_parser,... |
d0a3c72ce4f2e56ad109676790ee89cadd02d908450c82a94c8e56b82d460f4f | Python | 39,439 | 1,161 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
7e22c04ab867591433b6df05eb7e303229e8b4a2e880a695fc0a963bbff6a18e | Python | 39,443 | 902 | from typing import Dict, Tuple, Union
from scipy.signal import butter, lfilter, hann
import numpy as np
from ..base_transform import EEGTransform
np.seterr(all="ignore")
def butter_bandpass(low_cut, high_cut, fs, order=3):
nyq = 0.5 * fs
low = low_cut / nyq
high = high_cut / nyq
b, a = butter(order... |
80f2de156df11f257d9ebba0ebc10c3f5c9a302389959b26367882d168d095bb | Python | 39,444 | 973 | from Pose_mmpose import Pose_mmpose
from mmpose.models import build_posenet
from mmcv.runner import DistSamplerSeedHook, EpochBasedRunner, OptimizerHook, IterBasedRunner, Hook, load_checkpoint
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmpose.core import wrap_fp16_model
from mmpose.dataset... |
e902cc05ccadccab54262e99d67e8efe595238cc803c7d032da0c7776df60dfc | Python | 39,454 | 1,116 | #!/usr/bin/env python3
"""
modeller6.py — Build & Mutate pipeline for Modeller
Two modes:
1) Build mode (default): PDB_ID + UniProt_ID → align2d → automodel → CRYST1 reinsertion
(optional --range/--length to set UniProt region; optional --truncate; optional mutations)
2) Mutate-only: mutate an existing PDB with one... |
db657f17c8fe1fd0ae7238bb98449f8023e7f1a1b5a4e711ae12f692c291bff6 | Python | 39,473 | 1,028 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
945fc706850d7945640e4962a647f7dc14c3e60723d2713a17de453e734cbfe5 | Python | 39,505 | 1,088 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
29697a2c6e3163626b7cb414c61df270671aefc56576e4eb18d77f458c6e0325 | Python | 39,513 | 802 | import itertools as it
import math
import os
import sys
import time
import warnings
from abc import ABC, abstractmethod
from typing import Optional, Union, Tuple, Dict, Any
import numpy as np
import scipy.stats
import scipy.stats as stats
import torch
import torch.nn
from . import ArrayOrTensor
torch.set_default_dty... |
aa00ccf5228f972494ff5c0376a64cd04cd02f3a33799268c586e54ebf1a2ee3 | Python | 39,517 | 1,088 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
c7089544d8eb5c16bfd67b4c197909265973560bd4b31771c06da232130e279f | Python | 39,518 | 1,088 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
def5ffd842eefe36aa5cad24eed1654da24c2d3bc47de079746dbaa4471c6b80 | Python | 39,535 | 1,088 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
cd7937698a825fa92651b57556fa68d49ad99bb8daf796e736e94cbe25675ad1 | Python | 39,538 | 1,254 | from dreamcoder.program import *
from dreamcoder.type import arrow, baseType, tint, tlist, t0, t1, t2, tboolean
from dreamcoder.task import Task
from dreamcoder.grammar import Grammar
from dreamcoder.program import Primitive
from scipy.ndimage import binary_dilation, label
from scipy import ndimage
from scipy.ndimage ... |
f10ae3cf94329222e1a11841dd9f8b1e45d516e4913f4cad7d08e9b151405f6a | Python | 39,553 | 969 | """
Defines class Clusters that holds clusters-related data from one or more observations
(experiments) divided (classified) in groups.
The observations are expected to be generated by scripts/cluster_analysis.py.
# Author: Vladan Lucic (Max Planck Institute for Biochemistry)
# $Id$
"""
from __future__ import unic... |
d2c63597d2f59c5e5a67f0ec9f14b726a65e28109b93c566ccdb336afe174c2e | Python | 39,597 | 1,089 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
fc750bedc36f1799c273b3e5f6dfd1f537773f8793e0a3d61eb615100115f7c0 | Python | 39,597 | 1,089 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
3e91d46e5d3bf657e2778fcb5b8680ab59b448679c0ad2d092a9460cf1538a3a | Python | 39,601 | 1,122 | """Module reads and writes header and data for KTLX data. The files are:
- .eeg (patient information)
- .ent (notes, sometimes with a backup file called .ent.old)
- .erd (raw data)
- .etc (table of content)
- .snc (synchronization file)
- .stc (segmented table of content)
- .vtc (video table of content)
... |
3398f92d9e1e482085749f49e8745d85606f2f98b6a5f198225faa48aeb50ff1 | Python | 39,679 | 1,294 | import numpy as np
import matplotlib.pyplot as plt
from help_funcs import load_exp_variables, vis_permutation_cluster_test
# ----- #
# Hyperparameters.
metric = "rocauc"
if metric == "rocauc":
metric_str = "score"
elif metric == "accuracy":
metric_str = metric
remove_fooof = False
if remove_fooof == True:
... |
f96cdeb0bf9524ab1a883537bb2733a49307cba5426927b0058270c7c46e748f | Python | 39,684 | 1,002 | from dataclasses import dataclass, field, replace
from typing import (
TYPE_CHECKING,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Union,
)
from . import box, errors
from ._loop import loop_first_last, loop_last
from ._pick import pick_bool
from ._ratio import ratio_... |
4d343d6e7fcd95900c02d57bd79153205200bedae130c9d510263cb2ac28091b | Python | 39,686 | 966 | """
Clases for resenting networks, collections of geometric objects with geometry and without topology
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 16.10.14
"""
__author__ = 'martinez'
try:
from graph import *
except:
from pyseg.graph import *
try:
from globals impor... |
3099e323d4536b5dcebc72856a0ff53f2515ac5cec97fde9b65ce245115c6028 | Python | 39,689 | 1,092 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
a65afdd55abb455c1141e047a5d5cdd6ecb5429746879433db326177e7ff2a9f | Python | 39,689 | 1,092 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
c9333004f5790f864c7be1112bb83c5922d26b3f238a03bb7a415bb4f5f85394 | Python | 39,720 | 1,093 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
e17e8059cbead88664a8df54b6ee35bfdfc4ac6b34b3739b81041c7555f04b66 | Python | 39,720 | 1,093 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Modified parameters file for the Hybrid LFP scheme, applying the methodology with
the model of:
Potjans, T. and Diesmann, M. "The Cell-Type Specific Cortical Microcircuit:
Relating Structure and Activity in a Full-Scale Spiking Network Model".
Cereb. Cortex (2014) 24 (... |
23b2713848c020123a18c9e43ac9467992db2b95ff58d48a70fde9bdc49f7084 | Python | 39,771 | 835 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import glob
import copy
import collections
import pickle
import numpy as np
import pandas as pd
import seabo... |
d8eea80147a78d41fc5ca45584a19c9cde45d84ab3d9a43b1b651217b8502d5a | Python | 39,774 | 702 | # this lib, together with the preprocess_mice_trials script
# is used to process the raw excel files that have the tracking
# of the mouse in the arena looking for the hidden food
#
# the experiments were originally performed by Kelly Xu from Len Maler lab
#
# the original excel files are not going to be included in th... |
5d1f3e6ad66dda975f001f0519bd4a639adb93eb9c7b0a85969b211bdf4f7ef3 | Python | 39,776 | 1,096 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 29 09:27:42 2024
@author: andrea santoro
"""
import numpy as np
import matplotlib.pyplot as plt
#from tqdm.notebook import tqdm as tqdm_notebook
import glob
#import scipy.io as sio
#import h5py
import networkx as nx
#from itertools import combinati... |
83f0c88aef2705747303e9963d1a5ab4719b98566a685a2cb3bcfd4c6ed04945 | Python | 39,801 | 1,076 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and 2.2).
"""
from __future__ import unicode_literals
import codecs
from email impo... |
56e710423e1b84d21ec9d7395f70d1f5806f0ae8ed315e998ecc7a7d8fdeee39 | Python | 39,813 | 1,255 | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simplefilter(action='ignore', category=RuntimeWarning)
import bct
import numpy as np
from netneurotools.modularity import zrand
from scipy.stats import kstest, linregress
#requires MATLAB
#import matlab.engine
#eng = matlab.engine... |
a3e63a808aa850ab7e879c91deb590e3012a9278351791573f79f66dd2295992 | Python | 39,854 | 1,102 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
5f01af339a61a07485d1d9c3f9e7023f7e7c67b5a36abeaee345a93223e6018c | Python | 39,868 | 943 | # coding=utf-8
# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.
#
# 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
#
# Un... |
801737962103df2dd9305b040dd96a3ce3980780edba4f2ac8c3a27481a66fc8 | Python | 39,869 | 734 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
2afbe2c1f621251dc474ed0a4eef1a4aad40f1ef004d07752a64e4599f69775a | Python | 39,871 | 999 |
# EyeNED OCT-ONH segmentation and feature extraction
# Copyright (C) 2024 Erasmus MC
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your opti... |
1a6fafce9f643426c30e00a15b48ff5f73ffa904665c79daf6579f684da93d45 | Python | 39,892 | 1,118 | from abc import abstractmethod
import math
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import functools
from .fp16_util import convert_module_to_f16, convert_module_to_f32
from .nn import (
checkpoint,
conv_nd,
linear,
avg_pool_nd,
zero_module,
... |
02cd1ebab139d386c35fdbb115be2ca562c583710f644e77fa9ce29404a2d6ea | Python | 39,920 | 993 | """
CLI pipeline for creating NIfTI volumes from TIFF image data.
Supports any imaging modality - converts directories of individual TIFF
sections or multi-page TIFF files into NIfTI (.nii.gz) volumes with
user-specified voxel spacing, zero-padding, and axis corrections.
This module is also the canonical home ... |
808f18dd6bbc3bc26b553cbf361b3caf7f7beda8074ee5b45613a895cb843ed9 | Python | 39,973 | 1,014 | import os
from typing import Any
import numpy as np
from numpy.typing import NDArray
from openmm.openmm import Force
from openmm.unit import (
dimensionless,
kilojoules_per_mole,
nanometer, # pyright: ignore[reportAttributeAccessIssue]
radian,
)
from pandas import read_csv
from scipy.special import ex... |
9fd5dfb0c262103ea5f5b93a6a08fd2326e8aaa8d1fdb7e1850fdc95e12fccb1 | Python | 39,974 | 941 | # -*- coding: utf-8 -*-
"""This file implements different models to predict the charge response kernel (CRK)
and polarizability tensor by fitting polarizability tensor data.
All models output the polarizability tensor 'alpha' and CRK 'chi'.
Implemented models: ACKS2, EEM, EtaInv, Local chi, and Local.
For model det... |
939349a7bb5dca2a904836affab1d0cd2c4c0070406bd10d67679897b59a0c4d | Python | 39,986 | 950 | # -*- coding: utf-8 -*-
"""
Created on Nov 4 2022
@author: Jonas A. Thiele
"""
###Training of prediction models with FC (100 node parcellation) of the main sample (610 subjects, 5-fold cross-validation)
###Train with different network-specific selections of functional brain links
#%% Imports
import pand... |
22d5436ac0e73d13cff51f1b37163bb4f0650bbdb89c9f679715605c6fd22db2 | Python | 39,990 | 1,132 | from __future__ import absolute_import
import errno
import logging
import re
import socket
import sys
import warnings
from socket import error as SocketError
from socket import timeout as SocketTimeout
from .connection import (
BaseSSLError,
BrokenPipeError,
DummyConnection,
HTTPConnection,
HTTPEx... |
bc0fbbce44f06185a73e9d584f54104e95102f2be742b1848960e7bfa2de83bc | Python | 39,994 | 1,135 | #!/usr/bin/env python
"""
Makes and analyzes clusters of (already existing) boundaries and segments.
For example, in case of presynaptic terminal, vesicles are boundaries and
connectors are segments.
Clustering can be done based on connectivity (see "Clustering by connectivity"
parameter section) or on distance (see ... |
9b5670fa247c2ba31291a5038d0c231ddbd22b1d48ef944e9ddc9c2035422ab8 | Python | 40,044 | 944 | from typing import Dict, Tuple, Union
from scipy.signal import butter, lfilter
try:
from scipy.signal.windows import hann
except ImportError:
from scipy.signal import hann
import numpy as np
from ..base_transform import EEGTransform
np.seterr(all="ignore")
def butter_bandpass(low_cut, high_cut, fs, order... |
acd01de042aaeab062a387f2bb720429425c4399bf43d77bb789b2e885e33e11 | Python | 40,068 | 928 | """
Self-contained HTML registration report.
Bundles a single registration run's artifacts - parameters
(``registration_metadata.json``), quality metrics
(``registration_metrics.csv``), and figures (JPG/PNG under the output dir) -
into ONE portable ``registration_report.html`` file per run. The HTML is
fully s... |
5983ffb463fdb3259ed4a164f7f5ad0516a6e5ad0835a171ab0c7e0d51aa2cb1 | Python | 40,107 | 935 | # Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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 applicabl... |
0bdf8d6fab71aacf15e0f077b98aa248c4b7ab24be87ebca0b626d983c067583 | Python | 40,128 | 1,134 | from dreamcoder.program import *
from dreamcoder.type import arrow, baseType, tint, tlist, t0, t1, t2, tbool
from dreamcoder.task import Task
from dreamcoder.grammar import Grammar
from dreamcoder.program import Primitive
from scipy.ndimage import measurements
from math import sin,cos,radians,copysign
import numpy as ... |
be6d48ede95b558488ed6e2f68498b8bd9cf01fcdadd19954057212c7e275c28 | Python | 40,145 | 785 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import numpy as np
import pandas as pd
from logD_analysis import mae, rmse#, barplot_with_CI_errorbars
from lo... |
b08ef714a17644adc89e87eacf126991472d572d3c96c15f1a6edd00d1bf64f4 | Python | 40,171 | 839 | #!/usr/bin/env python
# Credit:
# This adapted by David Mobley from Andrea Rizzi's file of the same name which he wrote for SAMPL6
# at https://github.com/samplchallenges/SAMPL6/blob/master/host_guest/Analysis/ExperimentalMeasurements/generate_tables.py
# He gets credit for anything good about it; I deserve blame for ... |
ded9e187b6ddaaeb571d434080cdaf0a3f39c80e39f719bd9b8e701b137156d6 | Python | 40,222 | 1,252 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
49b42b1d5661dabc4d92a602ac0c6c42a282a943316940e6ade7b21abe77bd83 | Python | 40,279 | 1,148 | # -*- coding: utf-8 -*-
#
# Test connectivity measures
#
# 3rd party imports
import psutil
import pytest
import inspect
import numpy as np
import matplotlib.pyplot as ppl
import dask.distributed as dd
# Local imports
import syncopy as spy
from syncopy import AnalogData, SpectralData
from syncopy.connectivity.connect... |
27d74b3c5725b73c59da7e4102c02e29992e1efb36e2b753f38837623cb53ff3 | Python | 40,302 | 997 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
5cfb149ec8aa99a1043884868b836110af3eed4ee3b69d94d0ca5c6d0cdb4dcf | Python | 40,304 | 1,041 | import numpy as np
from warnings import warn
########################################################################################
def n_points(dim_in, dim_out, dt,
t_cs=np.array([10]),
targets=None,
input_amp=0.,
target_amp=1.,
t_max=None,
i_in=0,
i_out=0,
fixate_idle_channels=Fa... |
2d774917fadfb57cd27e5294e7dea9dee64c004faafb5dabb60bacf4f1c80e21 | Python | 40,337 | 1,031 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2012 Computational Neuroscience Group, NMBU.
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 3 of the License, or
(at you... |
c3adb6c97630ab5b90964cdb8c98b0738aa4d6e6f31bb1bb5608d76c64f25fd2 | Python | 40,351 | 1,270 | from __future__ import print_function
from .miscUtil import prettyString, makeDiag, argmaxWithVal
from . import miscUtil
from functools import reduce
from itertools import product
from numpy import exp, linalg, complex128, identity, mat, prod, zeros, mod
import random
import operator as op
import copy
import scipy.st... |
87f928624505a3e1455318ece7ae091d4033ecedf226957023a7ca377318cc6d | Python | 40,386 | 940 | """
pygments.filters
~~~~~~~~~~~~~~~~
Module containing filter lookup functions and default
filters.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pip._vendor.pygments.token import String, Comment, Keyword, Name,... |
b7b0248161f3e99ef9d5731d0515765840e6babc4c14772a41e92ffe5f14c717 | Python | 40,412 | 1,303 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... |
865444f7278a7af333f72ecc5ad87ae70914a3f9600213cff47f924a9d9c063a | Python | 40,430 | 891 | import pathlib
import os
# from urllib.request import HTTPPasswordMgrWithDefaultRealm
# import sys
# sys.path.append(os.path.join(pathlib.Path(__file__).parent.resolve(),'mmpose'))
import mmcv
# from mmcv import Config
import mmpose
# from mmpose.models import build_posenet
import poseConfig
import copy
# from mmpose i... |
aceb726dbc114b38bce0afb5325118e5cd65305388e3991564deec07ddd4bae5 | Python | 40,475 | 948 | from __future__ import annotations
import json
from pathlib import Path
from typing import TYPE_CHECKING, Any, cast
import anndata as ad
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
from adjustText import adjust_text
from anndata import ... |
ef2f2a354ec4ce80bd359794f68d6d645d42351a7c7ece61b484b845a5a8c6c1 | Python | 40,538 | 892 | ################################################################
# Libraries
################################################################
import os
import numpy as np
from PIL import Image
from PIL import ImageFilter
from tqdm import tqdm
################################################################
#########... |
2a61d8b985d45db6f1b8705fa7495d83c2b627e91281449eaea659bda346ca90 | Python | 40,596 | 1,303 | # -*- coding: utf-8 -*-
from dreamcoder.type import *
from dreamcoder.utilities import *
from time import time
import math
class InferenceFailure(Exception):
pass
class ShiftFailure(Exception):
pass
class RunFailure(Exception):
pass
class PrimitiveException(Exception):
pass
class Program(object... |
3b2160631ac96c1006b3abca0c0ff2766c73cf360a50587d6d15621a17425c78 | Python | 40,607 | 881 | """ Schema for colored full field flicker """
import datajoint as dj
import numpy as np
import scipy
import hashlib
from collections import OrderedDict, Iterable, Mapping
from sklearn import decomposition
from sklearn.mixture import GaussianMixture
from pipeline import reso, treadmill
stimulus = dj.create_virtual_modu... |
a397425e891739c40bb3b2affe96aefa45ace9a77bc807a8c9906616f39f3920 | Python | 40,673 | 795 | """
DeepLabCut2.0 Toolbox (deeplabcut.org)
copyright A. & M. Mathis Labs
https://github.com/AlexEMG/DeepLabCut
Please see AUTHORS for contributors.
https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS
Licensed under GNU Lesser General Public License v3.0
"""
import sys
import wx
import os
import pandas as pd
im... |
0aebcbd852074aecf816b0220e788ebaeb0ed632e3f4b157787762a4760863cd | Python | 40,741 | 1,059 | import json
import os
import re
from datetime import datetime
from flask import (
Blueprint,
Response,
redirect,
request,
url_for,
)
from user_agents import parse as parse_ua
from codex.blueprints.base import (
activity_suffix,
render_error,
render_info,
render_template,
warnin... |
93fc27b617c7f971075f31a260d669000d3ade980283fd985538825870746851 | Python | 40,800 | 1,053 | """
Core cell detection pipeline using Cellpose-SAM (cellpose v4).
Cellpose v4 ships a unified ``cpsam`` model that combines Cellpose
flow-based detection with SAM-style segmentation in a single pass.
Pipeline:
1. Load 16-bit stitched TIFF section
2. Run CellposeModel (cpsam) to detect & segment cells... |
44bc4c942d88177f04572346e311d465577c88850634d8be8d60c397acc98d86 | Python | 40,808 | 781 | import ants
import antspynet
import numpy as np
import glob
import os
import sys
import time
import shutil
import tempfile
import datetime
os.environ["ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS"] = "12"
os.environ["intra_op_parallelism_threads"] = "12"
os.environ["inter_op_parallelism_threads"] = "12"
def preprocess_origi... |
1d86fcacfef6ca6257bb03a18138c8c857a801bd2d8e8168fd0f434404b62be6 | Python | 40,813 | 1,062 | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team, Microsoft Corporation.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 ... |
99fb960c28c081b8f6d94369a332945dbf6afaeafb8185f2f148911f2fc34b05 | Python | 40,839 | 1,357 | import numpy as np
import matplotlib.pyplot as plt
import pickle
from os.path import join
from matplotlib.style import use
from preprocess import (
load_sub,
apply_preprocessing,
)
from help_funcs import load_exp_variables, vis_permutation_cluster_test
use("default")
# ----- #
# Hyperparameters.
metric = "r... |
daf0c0f0284aa1bedcd4a70b99962c620a5fd32f8dbb2ece95a84a07b59caab7 | Python | 40,883 | 888 | import numpy as np
from psychopy import logging
from psychopy.core import Clock as psychopy_clock
from pylink import getEYELINK
from scipy.signal import find_peaks
# Configurations that a user might wish to change but are not crucial to algorithm
# things like initial thresholds, experimental setup, directories, etc... |
b2972ecd14bd2e17eb399f9d66ab74fe15aa50e9530004c69f03e40a3986a2b8 | Python | 40,956 | 1,080 | """Abstract subclasses for implementing connectivity processing methods.
CLASSES
-------
ProcConnectivity
- Class for processing connectivity results. A subclass of 'ProcMethod'.
ProcMultivariateConnectivity
- Class for processing multivariate connectivity results. A subclass of
'ProcConnectivity'.
"""
from ... |
7763f122fac403806dabb7bfe853b9fb27f1e71f774f646e0a56c344f10439ea | Python | 41,120 | 822 | """The MidsagittalPlane model: geometry, serialisation, slice restriction."""
import numpy as np
import pytest
def _p():
from regtools.hemisphere import plane
return plane
# PIR-like affine: world-X on voxel axis 2, positive polarity (Allen CCF).
PIR_AFFINE = np.array([[0, 0, 25.0, 0], [-25.0... |
6906b858a26c2bb63a1527530b658859e80623debe8b45d33e81d494584dd8c2 | Python | 41,123 | 847 | """
Fast run mode: check locally, through data loaded from the SPARQL endpoint, whether a write to the Wikibase instance
is actually required, so that a synchronisation bot can skip the entities that are already up to date.
"""
from __future__ import annotations
import collections
import logging
import re
from collect... |
4857a6176733ce93d27b67576495aa7183009c7582b0431fba1a724c8c3f3d0b | Python | 41,187 | 1,235 | """Spike analysis
-----------------
Functions to preprocess spike activity and compute statistics.
"""
from mesocircuit.parameterization import helpers_analysis as helpana
from mesocircuit.helpers import helpers
from mesocircuit.helpers import parallelism_time as pt
from mesocircuit.helpers.io import load_h5_to_spars... |
8b8a531a0364f6b073c159e67f72202a491372d8223b25911274dafcf1a60540 | Python | 41,236 | 1,016 | # Modified version of inspyred/ec.py that allows for Sobol sampling and evolution of
# PSO metaparameters
"""
===============================================
:mod:`ec` -- Evolutionary computation framework
===============================================
This module provides the framework f... |
8d21728e2a1e23ed0bcffad2cf5ae7fef43abb2a8c42385e1bee801a23eadc27 | Python | 41,236 | 1,027 | from typing import Union
import numpy as np
from numpy.typing import NDArray
from scipy.signal import butter, buttord, cheby1, cheb1ord, filtfilt
from scipy.spatial.distance import cdist
EVENTS = ("id", "on", "off", "onoff", "dur", "re", "fe", "refe", "diff", "diffsplit")
def correct_latency(
X: NDArray,
y... |
eedea99fc16055a15495f456917312e9d5106da2626e3fdb37893afa8316c73e | Python | 41,236 | 1,132 | """
General Classes for modelling filaments
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 15.09.15
"""
__author__ = 'martinez'
import pyseg as ps
import heapq as pq
from pyseg.globals import *
from pyseg.filament.variables import *
from pyseg import pexceptions
# import pexceptio... |
4d897c0c66fae4d356535020089ebeb3c9103d4cd4ce7c587682a77abd8b39f7 | Python | 41,251 | 1,113 | from scipy.sparse import csr_matrix
from scipy.io import mmwrite
from collections import deque
import multiprocessing
import seaborn as sns
import numpy as np
import logging
import pysam
import copy
import gzip
import ray
import csv
import os
import matplotlib
gui_env = ['Agg', 'TKAgg', 'GTKAgg', 'Qt4Agg', 'WXAgg']
fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.