sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
08d6a7922d3cde50db077de8401de12c2976b741b300d44f189ed6ff377b2cb3
Python
23,899
556
""" The framework for cell counting for the U01 workflow GUI. Andy Thai andy.thai@uci.edu """ # Import standard libraries import os import sys import glob import time from natsort import natsorted from threading import Thread from regtools import get_project_root _project_root = get_project_root() ...
d6821f77f65512775b7a352d7cc7d5de950861623cbdfd52b355d66a5cb6828a
Python
23,902
636
# Functions used to evaluate particles to match corticospinal response import numpy as np from scipy import signal def butter_bandpass_filter(data, lowcut, highcut, fs, order=2): nyq = 0.5 * fs low = lowcut / nyq high = highcut / nyq sos = signal.butter(order, [low, high], btype="bandpass...
648f314f92aa26d588e7f90f3fd5a924beec14a46aa05a5e5a215bfa00b72623
Python
23,910
650
# 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...
091c7c398a16792ed7b95752c02c8c98b54fa2a457accb62bf116fedd265e8ae
Python
23,913
455
import os import itertools import numpy as np import pandas as pd import seaborn as sns sns.set_style('darkgrid') import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix, classification_report import tensorflow as tf from tensorflow...
73e6c71829a538fb60371e1c0902748fd402838169f6f10bb6a69ec89a7d8838
Python
23,919
676
""" Functions that compute burst rate and statistically significant clusters of burst rate in a time-resolved manner. """ import numpy as np from os.path import join from mne.stats import permutation_cluster_test from scipy.ndimage import gaussian_filter, gaussian_filter1d from help_funcs import significant_features...
1473f40233d43b43e14a70c654c763e952568c0da04789a79feac59c72eeba81
Python
23,927
534
import pickle import sys import pandas as pd sys.path.append('..') import time from contextlib import nullcontext import torch import torch.distributed as dist import torch.multiprocessing as mp from torch.utils.data import DataLoader import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler from t...
1b9f2bbabcadb9635357985800ef96a6d466f7cb49b2e0d4a0cf4fc647e7e4f3
Python
23,933
597
from __future__ import annotations from collections.abc import Callable import numpy as np from SurvivalEVAL.evaluations.util import ( check_and_convert, check_and_convert_event_data, ) from .._concordance_utils import ( _check_has_any_pairs, _ConcordanceCounts, _count_directed_risk_pairs, _...
00128e099bb003603f48a1f716a2ba4e28fc74486beb81f5e173c1ad9b5f1232
Python
23,950
818
# 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...
9873fd2bcda47f2fdddcc7fd868108634a3ae23034ffbef6fcb7f894c97c9021
Python
23,970
569
import os from typing import Callable, Dict, Tuple, Union import numpy as np from scipy import signal from scipy.io import loadmat from ....utils import get_random_dir_path from ..base_dataset import BaseDataset def _apply_notch_filter(eeg_data: np.ndarray, fs: float, notch_freq: float = 50.0) -> np.ndarray: ""...
6aee7894603460e305b123c88fee2fcd7e7b71a53478306fe9f8e995c481f534
Python
23,972
728
# Copyright 2022 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...
d5ea828513ee427c43baeb57a7712a3be63f6f0644b2f8c48b36c840c62a3d57
Python
23,980
542
import warnings from typing import Any, Dict, List, Tuple import pytorch_lightning as pl import torch import torch.autograd as autograd import torch.nn as nn import torchmetrics from torch.utils.data import DataLoader from torchmetrics.image.inception import InceptionScore from .utils import FrechetInceptionDistance ...
eaebec269aa1df7e5e6008a1abc9c18afb82acffc37ff9a812ddcbd7c321ba90
Python
23,985
572
#!/usr/bin/env python # Copyright (c) 2019 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides Challenge routes as standalone scenarios """ from __future__ import print_function import os import math import...
bc36a5820fa16b0f2ccda4f9f4ffa65cd8fc3b7ff1500cd4bb85b769142b5fd8
Python
23,990
526
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2024 Clinic for Diagnositic and Interventional Radiology, University Hospital Bonn, 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 ...
7ebb831574b46c264f7f2e30be6758168810043cd1452263d81377e35bbca404
Python
24,000
489
from collections.abc import Iterable from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union import numpy as np from ..data import SquadExample, SquadFeatures, squad_convert_examples_to_features from ..file_utils import add_end_docstrings, is_tf_available, is_torch_available from ..modelcard import Model...
87d553e295ff6817b53efd25c4d0cd7b4b991bbdb671fee8fa8208e4ce706b29
Python
24,020
602
class AFMimg(): """A class that contains the x-, y-, z-values, filename and directory of the raw AFM file Attributes ---------- xvalues : ndarray N dimensional array with type float that contains the x-values of the igor pro height trace data yvalues : ndarray N dimensional arra...
04a0074b8725d826df691cbd8ad05dc8a9f4249185871713bda0197db6d1bff9
Python
24,033
489
import argparse import torch import torch_geometric from torch_geometric.utils import from_networkx import networkx as nx import pandas as pd import numpy as np import scipy as sp from sklearn.preprocessing import StandardScaler from models import * from data import * from utils import * from tqdm import tqdm impo...
fd7cb35da2e798aff041817f8147a157c5f61f1483a3f426695e1f25c81b6a9d
Python
24,035
573
from argparse import ArgumentParser, Namespace, FileType from Bio.PDB import PDBParser,PDBIO import os,copy import numpy as np from multiprocessing import Pool import tqdm import time from tqdm.contrib.concurrent import process_map # or thread_map from scipy.spatial.distance import cdist from rdkit.Chem import AllCh...
2da3bbe7914d6edb7578828216ee7a372d4111bad16176074bd02fc090bd937f
Python
24,064
561
import io import json import os import unittest import urllib.error from hed import HedFileError, HedString, Sidecar, load_schema_version from hed.errors import ErrorHandler, SchemaWarnings, get_printable_issue_string from hed.models import DefinitionDict from hed.schema import from_string from hed.validator import He...
d3838c3e737f591b1b7f28cf476e0c05fe9e1ad27ce0902580a925400d0f3fcf
Python
24,071
549
import logging import warnings from typing import Any, Dict, List, Tuple import pytorch_lightning as pl import torch import torch.autograd as autograd import torch.nn as nn import torchmetrics from torch.utils.data import DataLoader from torchmetrics.image.inception import InceptionScore from .utils import FrechetInc...
b46581622c270fcf942f50a7fa2990833641a0d1b2189ef945b1c1d240bf6c54
Python
24,112
526
"""tkinter installer wizard - a thin shell over installer.{environment,steps, drift,platform_win}. All install logic lives in those modules; this file only renders screens and calls them. build_plan() is the unit-testable core.""" import os import queue import sys import threading import tkinter as tk from co...
b508e533a4d6b24d85bff0d4981808aef03a073185b7eedcfaf360603686e0ba
Python
24,120
612
# -*- coding: utf-8 -*- """ Created on Thu Feb 9 17:28:36 2023 @author: Dustin Garner """ import os import copy import math import collections import itertools import numpy as np import pandas as pd from pydantic import BaseModel import matplotlib.pyplot as plt import seaborn as sns from fafbseg import flywire impo...
6ce7f4c5120fe4c9e036054442ba7e15c75b1d5bc133957b6d93f28f98aa312b
Python
24,122
531
import numpy as np import itertools from skimage import transform from typing import Dict from typing import List import pandas from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression import merlin from merlin.analysis import decode from merlin.util import decoding from...
96f81fca05aa40c3a7bf41ac0511361592ecd4388a680b58c3ca3ee0504d9c9b
Python
24,124
771
"""Various metrics based on Type I and Type II errors. References: https://en.wikipedia.org/wiki/Confusion_matrix Example: .. code-block:: python import segmentation_models_pytorch as smp # lets assume we have multilabel prediction for 3 classes output = torch.rand([10, 3, 256, 256...
460a807604ea97a86672a16af83c6dd0fcbfce9fba46ac52d881ad74ca8da76c
Python
24,125
531
import numpy as np import itertools from skimage import transform from typing import Dict from typing import List import pandas from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression import merlin from merlin.analysis import decode from merlin.util import decoding from...
b61f9e4cf22f6de71f25a52c76b6c7d5a1d0bc3576c8213e461aeba6c26129b1
Python
24,128
600
"""Dependency Resolution The dependency resolution in pip is performed as follows: for top-level requirements: a. only one spec allowed per project, regardless of conflicts or not. otherwise a "double requirement" exception is raised b. they override sub-dependency requirements. for sub-dependencies ...
e95f7414dcaa46b687792f3a717dfa575c83ce8240382973d08da5ca8d0b05be
Python
24,139
592
from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F ''' # -------------------------------------------- # Advanced nn.Sequential # https://github.com/xinntao/BasicSR # -------------------------------------------- ''' def sequential(*args): """Advanced nn.Sequent...
4ca147ac0296be67baf41c4c6871b422c38c5534dc2418943c991240b1b09f48
Python
24,155
559
"""Original implementation from https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/adafactor.py """ import re import tensorflow as tf from tensorflow import keras from tensorflow.keras import backend as K from tensorflow.python.ops import math_ops # from https://github.com/Smokrow/addons/blob...
4c1f2ab1d2e3178e9d941631580e52df99268808c5bb8914b9dbd279bb4f4f3c
Python
24,157
577
""" Coronal TIFF Export - simple GUI ================================ A small standalone PySide6 window around :func:`regtools.utils.io.coronal_tiff_export.export_coronal_tiffs`: * pick an input volume and an output folder, * **scrub coronal slices** with a slider to preview before exporting (contrast-matc...
ac7f388028f796910e76ca3d1d53ed14e3d833041d271f0a370a3a05ff3f0e67
Python
24,164
548
import pandas as pd import numpy as np import matplotlib.pyplot as plt import os import sys import subprocess import rdkit.Chem as Chem pd.set_option("display.max_rows", 100) pd.set_option('display.max_columns', 100) import torch torch.set_num_threads(1) torch.multiprocessing.set_sharing_strategy('file_system') from ...
2da9f7149e144b63fee715fb8fe5154e96bf9aa230d176c91e923d528ef0c4e1
Python
24,168
525
from functools import partial import torch import torch.nn as nn from torch.nn import functional as F def conv3d(in_channels, out_channels, kernel_size, bias, padding): return nn.Conv3d(in_channels, out_channels, kernel_size, padding=padding, bias=bias) def create_conv(in_channels, out_channels, kernel_size, o...
a5ea9cc167a86e1e26889cfa42e2c9aeae270b51d315c0621fb222ac2ee8c91f
Python
24,175
652
#!/bin/env python3 """ Log files --------- Parse ithildin log files. The class Log is used to make the contents of a logfile easily accessible. """ from typing import Dict, Tuple, List, Union import datetime import re import os import yaml import numpy as np import warnings def log_to_dict(s:str) -> Dict: """ ...
f5cbacf2a9b80f39df31aaf093b75aaaa0fbc4c38a288a8d8010131154d575da
Python
24,180
530
# # User-exposed interface of acme # # Copyright © 2020-2025 Ernst Strüngmann Institute (ESI) for Neuroscience # in Cooperation with Max Planck Society # Copyright © 2026 Ernst Strüngmann Institute (ESI) of the Max Planck Society # # SPDX-License-Identifier: BSD-3-Clause # # Builtin/3rd party package imports import in...
efd673549727163e914fd5d15276233de784bdb24df9ae302249da1970e5f194
Python
24,182
718
"""Manages the optimization domain and holds points.""" from __future__ import annotations from copy import deepcopy from typing import TYPE_CHECKING, Any from warnings import warn import numpy as np from colorama import Fore from bayes_opt.constraint import ConstraintModel from bayes_opt.exception import NotUnique...
f428bce35e712bd8f7c0654348930c58b516b8ae507dd02c7ad8744bd96e8ca2
Python
24,195
562
"""Orginally implementation from https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/adafactor.py """ import os import re import math import argparse import tensorflow as tf from tensorflow import keras from tensorflow.keras import backend as K from tensorflow.python.ops import math_ops # from...
685cc683102b86645a47b8520cef6c3669ac5105894515455c1ac87f580fe48c
Python
24,213
599
import logging import time import math import numpy as np import torch import torch.nn as nn from torch_scatter import scatter_mean from pyexpat.model import XML_CQUANT_OPT from ocpmodels.common.registry import registry from ocpmodels.common.utils import conditional_grad from ocpmodels.models.base import BaseModel fro...
7ae09b0b240eac1acb507352eaf9ed2b9d6e4d073215a3f6ccb3c4e3704fb0cd
Python
24,214
1,383
from __future__ import annotations from pathlib import Path from typing import Mapping, Sequence import matplotlib.pyplot as plt import numpy as np import pandas as pd import math from PIL import Image, ImageDraw, ImageFont from matplotlib.colors import to_rgb from ..plots.style import ( mg_color, ) # =========...
9f19833a8605f4d5ee2da198cb4d6d2858e4351796265ac616e24d584893a3ce
Python
24,215
656
# mypy: ignore-errors import railroad from pip._vendor import pyparsing import typing from typing import ( List, NamedTuple, Generic, TypeVar, Dict, Callable, Set, Iterable, ) from jinja2 import Template from io import StringIO import inspect jinja2_template_source = """\ {% if not emb...
ee9b39fecb90162f5194d73631819d048c9c0f5bc6b3c4e6127d0a7b214b0e47
Python
24,225
655
# 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...
fa71e89c1cab9599fb68578e1566cc39f243004dc824ef5af7af9d30ddf02752
Python
24,227
616
import numpy as np from scipy.sparse import csr_matrix from ..constants import hpro_rng from .. import config as CFG from ..utils.mpi import MPI, comm class PairsInfo: ''' This class is used to deal with atom pairs. The first atom in the pair is always assumed to be in the unit cell at (0, 0, 0), and the...
2c8331e4c24f0763c40d13c2f7cc320db0e500ea537247b8c1e3ee8da5b42040
Python
24,232
545
########################### ######## Utilities ######## ########################### #%%# Catalyzer import os import re import numpy as np from scipy import interpolate import torch from sbi.inference import simulate_for_sbi import time import pickle import matplotlib import matplotlib.pyplot as plt plt.rcParams['fig...
88d5c9ae24d5f832f967e42637f11fc9cc62bea7c9767e4580addc96d05adf05
Python
24,242
715
# 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...
5cb9c9105bdc5776e3695ccc3542627a6de7f25bef23d4c9e4f4eef881b6b938
Python
24,247
739
from enum import IntEnum from functools import lru_cache from itertools import filterfalse from logging import getLogger from operator import attrgetter from typing import ( TYPE_CHECKING, Dict, Iterable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union, ) from .cells im...
47dd397306314da75a319487fd6f0ab7c1a088ac670ed511a5a45bd1a8f5bad6
Python
24,277
498
import numpy as np from .utils.mpi import mpi_watch, is_master, comm from .utils.misc import simple_timer, index_traverse from .matao.findpairs import pairs_within_cutoff from .matao.matao import MatAO from .io.aodata import AOData from .io.struio import load_structure, from_qexml, from_bgw, from_poscar, from_gpaw from...
7f0762f31912ae502fcdd71d0eca52cd775e1ac597d072462c2d1cbce6525a1c
Python
24,278
600
import logging import time import math import numpy as np import torch import torch.nn as nn from torch_scatter import scatter_mean from pyexpat.model import XML_CQUANT_OPT from ocpmodels.common.registry import registry from ocpmodels.common.utils import conditional_grad from ocpmodels.models.base import BaseModel fro...
95d40c571214f110dff923c5f5875dd02ad041b53d045f630a95728dbfe3f3ef
Python
24,278
600
import logging import time import math import numpy as np import torch import torch.nn as nn from torch_scatter import scatter_mean from pyexpat.model import XML_CQUANT_OPT from ocpmodels.common.registry import registry from ocpmodels.common.utils import conditional_grad from ocpmodels.models.base import BaseModel fro...
d099b5fa02087fb56f4300c4d18a4d2cb55fa220e37f484fa5dfda114f5c1139
Python
24,282
607
"""Schema entry classes representing individual nodes in the HED vocabulary.""" from __future__ import annotations import itertools import math from typing import Any import inflect from hed.schema.hed_schema_constants import ANY_UNITS_CLASS, HedKey, HedSectionKey pluralize = inflect.engine() pluralize.defnoun("he...
47c916249547902c8fdbb494e4835fce146ffb2e75851ad4fa112e3f98684fe7
Python
24,287
921
# parsers.py import sys import argparse from fba import __version__ def coords(s): try: # from itertools import chain # s = ''.join([i.strip() for i in chain.from_iterable(s)]).split(',') # return [int(i) for i in s] return [int(i) for i in s.split(',')] except TypeError: ...
87e433004473f136fc329db831168ef04f4c997700860e7278f868424e43bf3d
Python
24,297
1,047
import unittest import filecmp import subprocess import os class TestReform(unittest.TestCase): def setUp(self): self.wd = os.getcwd() self.cleanup() # Clean up before each test case def tearDown(self): os.chdir(self.wd) self.cleanup() # Clean up after each test case def cleanup(self): print("Clean Up...
3a91aa06831d1a4a60615f75ed26522e25847622590d27777a36eec9a291ae2e
Python
24,306
415
from e3nn import o3 import torch from torch import nn from torch.nn import functional as F from torch_cluster import radius, radius_graph from torch_scatter import scatter_mean import numpy as np from models.score_model import AtomEncoder, TensorProductConvLayer, GaussianSmearing from utils import so3, torus from data...
076dacd50056ee922e9ef8200a1fb460a207a4d31f1220a366259f64b0088d3d
Python
24,320
657
#!/bin/env python3 """ Log files --------- Parse ithildin log files. The class Log is used to make the contents of a logfile easily accessible. """ from typing import Dict, Tuple, List, Union import datetime import re import os import yaml import numpy as np import warnings def log_to_dict(s:str) -> Dict: """ ...
2e35fae61025a5e9018f3701e42771b9c30b5e81bcf990e0d3e01f2994064e5a
Python
24,325
886
from __future__ import annotations """ Configuration for MorphoGlia's combined analytical stage. Internal sequence: feature preparation -> dimensionality reduction -> multiresolution clustering -> resolution decision """ # ===============================================================...
72b334dbb90867d29bb288b0e3fa174cbc66633e827c6b69949f7347604503f5
Python
24,333
529
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created by : Alpha Renner (alpren@ini.uzh.ch) """ import os import re import time import warnings import numpy as np import nxsdk.api.n2a as nx from SFC_backprop.input_data import generate_input_data from SFC_backprop.loihi_groups import calc_spiketimes_from_input_ar...
3ada88d0d066f148ba8406905ffdbec460012f0c85a15853ed247b73698edb29
Python
24,334
539
from wsilearn.compress.compression_augm import patch_encoding_map from wsilearn.utils.cool_utils import print_mp from wsilearn.dataconf import DataConf from wsilearn.utils.flexparse import FlexArgumentParser print = print_mp print('entered compress.py') import torch import torch.nn.parallel from wsilearn.utils.cool...
42aebaf1dbbc7cefa4ba6a61df20b653274ad8466fa874cf5041e478cf61294f
Python
24,338
674
# coding=utf-8 # Copyright 2020 Microsoft 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 # # Unless required...
ab57d9700e9f2726ccafaa58864b6c59218c2a1d9ea1f5d0b4dc5e7d590e76d0
Python
24,342
447
""" Modules containing function works for transformation between config, DetailedCircuit, AbstractCircuit, PointCircuit config ---> DetailedCircuit: config2detailed DetailedCircuit ---> AbstractCircuit: detailed2abstract ---> PointCircuit: detailed2point ---> DetailedCircuit (connectio...
91672406b80ec663ba5e1336724cba01a28deb6244b8491c68f407128d3f540f
Python
24,344
652
""" Backend integrator and backends definitions. Currently supported are following backends: - `jitcdde`: (just-in-time compilation into C) which uses `jitcdde` which translates symbolic derivatives into C code and then calls C functions from Python interface: - very reliable - uses adaptive `dt` hence...
ddf381899f1b7753adb8e313a54be4140f9c8ef8ef0b59b12ae3d832e0e99226
Python
24,351
749
""" Download Waxholm Space Atlas of the Sprague Dawley Rat Brain. Downloads the atlas pack from NITRC and extracts the atlas annotation, label file, and MRI templates. Directory layout after download + post-processing: data/templates/waxholm_atlas/ ├── WHS_SD_rat_atlas_v4.label (structu...
013105626973be8cd5f06d0aa9781f96c11606b73921818225af32e4def474d0
Python
24,353
532
# trace generated using paraview version 5.5.1 # Apply a preset using its name. Note this may not work as expected when presets have duplicate names. #### import the simple module from the paraview from paraview.simple import * #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset...
607298529c15ffe91093bc10094c5013e376a2c7c2f4dedbb2423a4c97f8a1fd
Python
24,377
552
# -*- coding: utf-8 -*- # # Test basic functionality of ComputationalRoutine class # # Builtin/3rd party package imports import os import tempfile import time import pytest import numpy as np from glob import glob from scipy import signal import dask.distributed as dd # Local imports from syncopy.datatype import Anal...
66308e056b310bb1e0e4ed7fa2f42ff442adde4039fac4f40b43bd13bade1b58
Python
24,380
493
""" 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 os import click from pathlib import Path import...
c3474abdddd7e88ffb280ecd20441307adb83b6bcbf4314febe5d56babe77554
Python
24,382
618
import time import os import subprocess import sys import re import argparse import collections import gzip import math import shutil import matplotlib.pyplot as plt import wandb import numpy as np from datetime import datetime import random import multiprocessing #import logging #from silence_tensorflow import silen...
5e284ace99909a97a1119e2906a92c3d67f4a104bc0d82fafc50494c1df5783e
Python
24,395
599
import os import cv2 import time import random import re import string import numpy as np import pandas as pd import torch import torch.nn.functional as F from torch.utils.data import DataLoader, Dataset from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence import albumentations as A from albumentations.pyt...
03f5a015b6beb42a6a57b7cd0a57dc4ef55b18af9e91a17bc3495d5bd4d78962
Python
24,403
693
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Hybrid LFP scheme example script, applying the methodology with a model implementation similar to: Nicolas Brunel. "Dynamics of Sparsely Connected Networks of Excitatory and Inhibitory Spiking Neurons". J Comput Neurosci, May 2000, Volume 8, Issue 3, pp 183-208 Synop...
b5a2fe79472d0dd97b035113e79b13992c6b2cfaf5acaf23d7708458f530758f
Python
24,411
606
import numpy as np #needs install import os import pandas #needs install import sys import argparse import mpi4py class Alya_output_parse(): def __init__(self, project_name): self.project_name = project_name self.actmap = [] self.relmap = [] self.maxamp = [] self.maxfound...
fe2fec52d910a751496213763f0570a345a3fd03933403d0c8927c525f5aa40e
Python
24,426
610
# 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...
d2ab74d966456987840cc11fdd7ffeb766b5b02e5d5ddf2a913c207b5b4d6d29
Python
24,431
661
################################################################################ # Copyright (c) 2021-2024, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # Written by D. Jones <djones@llnl.gov> and UCSD collaborators in listed in CONTRIB.md # # All rights reserved....
649540b99fd38ed735eb2ba1390290b5893115ad1bf22ccd45da7d0d23053f57
Python
24,446
672
# 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...
51bbf9e3aa78aeb164334db1006f732f2570b19b0d878c0d62efe2a9ec56dc12
Python
24,449
485
# 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...
a5f352fe88ff1b5ec6630142c9869340a6350934c7651e23725f0218115d56b6
Python
24,465
539
#!/bin/env python from libraries import * from models_GCAMP_torch import OpGCAMP, ImageGenerator, LatentVector, OpEquilibrium from GCAMPparam import get_param torch.manual_seed(0) par = get_param() print('Saving in {}'.format(par.fold_res)) makedirs(par.fold_res) if par.gpu>=0: ordi = platform.system() if or...
060ec55f38ed4eebd1f773813212d38f4ed8ee0fd2d8472855cad70670422525
Python
24,482
648
# -*- coding: utf-8 -*- import os import random import subprocess import sys import time from sys import exit as _exit from sys import platform as _platform import numpy as np import tensorflow as tf import tensorlayer as tl from . import _logging as logging from . import iterate __all__ = [ 'fit', 'test', ...
dbe36f803fa0b93db59d57d6208cf7058d35fafaaf38cc0a3cfe13577791a013
Python
24,484
574
# ---------------------------------------------------------------------------- # Contributors: Thiago O. Bezerra # Antonio C. Roque # ---------------------------------------------------------------------------- # File description: # # Functions to run the astrocyte model from text file, load astrocyte mor...
7dff44c9218ee32efab2bde4d54cdd3eb57241598b51f2ae0fbf1d70ac098416
Python
24,492
561
"""Generating synthetic data to test HMP.""" import os import os.path as op from copy import deepcopy from warnings import warn import mne import numpy as np import xarray as xr from scipy.stats import gamma from hmp.io import read_mne_raw from hmp.models.event import EventModel from hmp.patterndata import PatternDa...
24242e16c894f00e4f6833d46a39e9b3d9342b537b36819f16b47e5a640e09d7
Python
24,493
557
import os,sys os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf #import numpy as np import logging logging.getLogger('tensorflow').setLevel(logging.ERROR) # # Input size (batch_size, fid_length, features) # Features include [time, real, imag] # # Functions to generate Poisson-Gap sampling scheme #...
a74deb219ab1c136cfa5a5a9a1bd2af6b532ce7ffb9933e860086e226b838a27
Python
24,494
682
"""The io module handles most file input and output in the `tedana` workflow. Other functions in the module help write outputs which require multiple data sources, assist in writing per-echo verbose outputs, or act as helper functions for any of the above. """ import json import logging import os import os.path as op ...
666a81d9f9ef211fc2078db1859ff668548bb71a512e87e122173e8735b1cb3b
Python
24,495
603
import numpy as np import pandas from scipy import optimize from sklearn.neighbors import NearestNeighbors from scipy.sparse.csgraph import connected_components from scipy.sparse import csr_matrix from merlin.core import analysistask from merlin.analysis import decode class AbstractFilterBarcodes(decode.BarcodeSavin...
0b1eb162d81cd6473eb840b1e599ebba2bcb95301a3993ff7fca2e8b7da5629f
Python
24,533
745
"""Parameter-related utilities for the Vasp calculator.""" from __future__ import annotations from dataclasses import dataclass, field from importlib.util import find_spec from logging import INFO, WARNING, getLogger from typing import TYPE_CHECKING, cast import numpy as np import psutil from ase.calculators.vasp im...
52de1cbae390543c44186c3f0bb57886cc6990592fcd419e49e9f626969dce02
Python
24,537
502
"""Implementation of receive card.""" import contextlib import logging import threading import time from collections.abc import Callable from ctypes import POINTER, addressof, byref, c_int32, c_short, cast from dataclasses import dataclass from itertools import compress import numpy as np from console.interfaces.rx_...
cd4d2ca5a17567722ef035b29e50c54bb80eb1c8c25360dfa0314d6999a1bcd3
Python
24,540
646
""" Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze Output: ...
292a073ca595e470fe25af97b3956d5a3f00f658ddf2a23a38022b5f3c803c2c
Python
24,562
509
import os from shutil import copy2 as copyfile from shutil import rmtree import pandas as pd from tqdm import tqdm from termcolor import cprint from glob import glob import time import torch import warnings import SimpleITK as sitk import numpy as np import multiprocessing from natsort import os_sorted def predict_si...
cc60e0890338580fc68a1632374c5ba3c7bffe4444a984c6c87111ea1065fb1f
Python
24,563
626
""" Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) - Analysis settings Output: - Plots by tomograms: + Number of particles by list + ...
d3135f3ce55b8584ee5d9bd49a8db02c7070fa760802be5744776be3ba005004
Python
24,576
626
""" Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) - Analysis settings Output: - Plots by tomograms: + Number of particles by list + ...
9ad22e97d3c25f6348b4569a626c94c37b729f42c2a42f61fe7ac44c5b93d919
Python
24,608
585
# coding: utf-8 # In[1]: ''' Mayank Jan 12 2016 Paw detector modified from: Project: https://github.com/aymericdamien/TensorFlow-Examples/ ''' from __future__ import division from builtins import str from builtins import range from operator import floordiv as old_div import tensorflow # Assume TensorFlow 2.x.x tf =...
996b380861d3971647486dec159c2fec5f41878bce9983313fdb391f071dc7f5
Python
24,612
498
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 21 09:32:23 2022 @author: caroline """ import argparse import matplotlib.pyplot as plt import math import numpy as np import pandas as pd import scipy.stats import statsmodels.api as sm from scipy.stats import pearsonr, spearmanr from sklearn.linea...
7a0d76149e2dcbf45bd636d05c43dcd8d06d7a895070646944e9e40bdd132491
Python
24,614
944
import inspect import signal import random import time import traceback import sys import os import subprocess import math import pickle as pickle from itertools import chain import heapq import hashlib import wandb def computeMD5hash(my_string): #https://stackoverflow.com/questions/13259691/convert-string-to-md5...
90a3cfa9df4c344d3eaac6e440716a612999072bd0774748ba307394ebb39e13
Python
24,615
630
""" Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) - Analysis settings Output: - Plots by tomograms: + Number of particles by list +...
6bac5b91e68dfddd20259825db541788475ccd1576e6ac3ed51ab61dbb808d23
Python
24,620
558
# 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...
f25f124d6e18d60320fe21c17b414cf42e51c888c842c0de81a19d3d9e68791c
Python
24,632
697
#!/usr/bin/env python # coding: utf-8 # Copyright (C) 2021 Blue Brain Project, EPFL # # 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 your option) any...
4f4fd11d9a462bd212133eb1d64581217915b402bae16ecaa71141219effc2f7
Python
24,634
518
#!/usr/bin/env python3 """ Copyright (C) 2018-2020 Intel Corporation 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 applic...
8e0ebaabb8cb397a071bfe650de0c9d65a1a75207c569545875cb56f59f7f1a3
Python
24,635
407
import torch from torch import nn import torch.nn.functional as F import timm class GeometricFusionBackbone(nn.Module): """ image_architecture: Architecture used in the image branch. ResNet, RegNet and ConvNext are supported lidar_architecture: Architecture used in the lidar branch. ResNet, RegNet and Conv...
27301e2b30416d7774fe13f498f323c0089de69d413d4d43f278563294cc5c6a
Python
24,642
444
# Inherits TVATAnalysis # Adds functions to generate plots from TVAT analysis from TVATAnalysis import TVATAnalysis import matplotlib.pyplot as plt import numpy as np from colors_paultol import * from scipy.stats import shapiro, levene, ttest_ind import plotly.express as px class TVATPlotting(TVATAnalysis):...
525f4ea7669373355c56cd5cfe943f64fab496affc1d428e510aae2bf597e04f
Python
24,648
656
#!/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...
560573970db303024f022febd1f429f076845580197aa30a94e25416e9b65ebe
Python
24,658
557
#!/usr/bin/env python """Utility classes and functions for SAMPLing analysis.""" # ============================================================================= # GLOBAL IMPORTS # ============================================================================= import os import csv import glob import json import operat...
eb8e871513574fc8377caa866b099759ee1d8431efbbb524e8c53990054ef64d
Python
24,663
705
""" Network sketches -------------------- Diagrams for illustrating network structure and connectivity. """ import mesocircuit from mesocircuit.parameterization.base_network_params import net_dict from mesocircuit.parameterization.base_plotting_params import plot_dict from mesocircuit.parameterization.base_plotting_p...
efcd9a4a6d713f0d14510dd26d8dcb74ce35abd1877edcd99347b3c2b2507bcc
Python
24,665
627
""" This module, 'phonons.py', contains recipes for performing phonon calculations using the ph.x binary from Quantum ESPRESSO via the quacc library. The recipes provided in this module are jobs and flows that can be used to perform phonon calculations in different fashion. """ from __future__ import annotations fro...
1279d7cea4b3c424c76bfe3635805bc7808d3ce6fba667b715afb3154a42042e
Python
24,669
830
""" Custom types used throughout quacc. """ from __future__ import annotations from typing import TYPE_CHECKING from pydantic_settings import BaseSettings class DefaultSetting(BaseSettings): """ Type hint for when a default setting will be applied """ if TYPE_CHECKING: from datetime import dateti...
a7642f5eb040606b09e752566c1ec1ae20d75f413e34033ac201cb504cd36dc1
Python
24,675
647
""" Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze Output: ...
b06c1aff267a5f635c4525095b35256247fc6c3123472480137690e4e7b02160
Python
24,678
650
import functools import os import sys import sysconfig from importlib.util import cache_from_source from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Set, Tuple from pip._internal.exceptions import UninstallationError from pip._internal.locations import get_bin_prefix, get_bin_user from pip....
798bef25f9a8906a25f32029fc3907523f1d33a96a55ede5122cee5212bd21af
Python
24,688
681
import copy import numpy as np import pandas as pd import neuprint as neu import networkx as nx from pathlib import Path from .janelia import JaneliaDataSet from .scenes import _get_mcns_scene from .ds_utils import ( _get_mcns_meta, _get_neuprint_mcns_client, _get_mcns_types, _get_mcns_sides, _ad...
14264f88ad51c4b8f03222002faf0d2e1de160cddb0e0932f282696ad84b22c7
Python
24,704
496
# -*- coding: utf-8 -*- """ Created on Fri May 13 11:53:14 2022 @author: Dalton """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.colors as colors from pathlib import Path import dill import re import seaborn as sns from scipy import sparse from sklearn.metri...
2fa91349e2743e343caf743fec43461b409ca049c44bd043deb95d62362e2683
Python
24,704
630
""" Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) - Analysis settings Output: - Plots by tomograms: + Number of particles by list + ...