sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
e03c0b14125bfe1ca0e6516a7680a57082b80c2c319118e761dbd5cd740d313c | Python | 15,919 | 388 | from logging import Logger
import os
from typing import Dict, List
import numpy as np
import pandas as pd
from torch.utils.tensorboard import SummaryWriter
import torch
from tqdm import trange
from torch.optim.lr_scheduler import ExponentialLR
from .evaluate import evaluate, evaluate_predictions
from .predict import ... |
1a3bfb45bc3890b28c170cca0387eb63b917756dbc6019176fe51162c08c5494 | Python | 15,921 | 396 | #https://github.com/sanghvirajit/Medical-Image-Classification-using-CNN/blob/main/Medical_Image_Classification.ipynb
#Fixing issues faced during installation of libraries###
## cv2: https://stackoverflow.com/questions/63732353/error-could-not-build-wheels-for-opencv-python-which-use-pep-517-and-cannot-be
#pip3 inst... |
21b8f8e302334350627c159d2762face4152197b86262dc2073abedf03de689f | Python | 15,923 | 494 | # Node-group asset "Color Res Name" (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_CHECKIN... |
72836b13d989f73a7641575f92cc079e6346585b076d27bd4b361bbc7db3601b | Python | 15,923 | 345 | from __future__ import print_function
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from torch.autograd import Variable
import torch.nn.functional as F
import copy
def choose(matrix, idxs):
if type(idxs) is Variable: idxs = idxs.data
assert(matrix.ndimension()==2)
unrolled_i... |
d172cdbaae59aa987760ec75a059a746d4c379acb2d93a64dcefe903b3c6cdee | Python | 15,926 | 252 | import pandas as pd
from Functions.f_TRC_Reader import *
from Functions.f_SignalProcFuncLibs import *
import scipy.io as sio
import mne
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
# -#######################################
# - Paths
# -###########################... |
7caa2a8db3acb868ad942491d885a14c0d691fc0d2d09a6b4e217f457481021d | Python | 15,928 | 333 | #%%
import nibabel as nib
import os
import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from scipy.stats import norm
#%%
def common_path(arr, pos='prefix'):
# The longest common prefix of an empty array is "".
if not arr:
print("Longest common", pos, ":", ... |
f80f68e29882e4e3eefd3dc36be7442a5757d9fee61fbaf7ab23b00b7bfa6771 | Python | 15,932 | 386 | """Summarize the contents of columnar files."""
import json
from hed.errors.exceptions import HedFileError
from hed.tools.analysis import annotation_util
from hed.tools.util import data_util
class TabularSummary:
"""Summarize the contents of columnar files."""
def __init__(self, value_cols=None, skip_cols=... |
4d000dae753bf7e36b504d24980f50add98b85d601904e0ae5b5531697d0afb2 | Python | 15,933 | 515 | #!/usr/bin/env python
# coding: utf-8
"""
Author:
Hermann F. Degenhardt <degenhardthf@nih.gov>
Maximilia F. S. Degenhardt <frazaodesouzam2@nih.gov>
"""
import pandas as pd
import os, sys, json
import seaborn as sns
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
im... |
6bc5be88e191d9e95eb90f5bad68c1014d1cdd14d02165029dddbf6b4aa2206a | Python | 15,936 | 340 | from __future__ import division
from nipype.interfaces import fsl as fsl # fsl
from nipype.interfaces import utility as util # utility
from nipype.pipeline import engine as pe # pypeline engine
import nipype.interfaces.io as nio
import os
import os.path as op
import shutil
from glob import glob
im... |
9d4816ef15079f95c5980e8ec2f9fa678b123a3257f0a950dda1a27deec989e7 | Python | 15,945 | 253 | import os
import shutil
import tempfile
import unittest
from hed.errors.error_reporter import ErrorHandler
from hed.schema.hed_schema_io import load_schema_version
from hed.tools.analysis.tabular_summary import TabularSummary
from hed.tools.bids.bids_file_group import BidsFileGroup
from hed.tools.util import io_util
... |
dd05fb8412b2172e8b1dbb3e466ec5f444cd56f37d31cf24c1354b7d5b4a7b9b | Python | 15,947 | 431 | from __future__ import annotations
import os
from copy import deepcopy
from pathlib import Path
import pytest
from ase.build import bulk, molecule
from ase.calculators.emt import EMT
from ase.io import read
from ase.optimize import BFGS
from ase.vibrations import Vibrations
from maggma.stores import MemoryStore
from ... |
46fb4ed8983b975e9bf92ae94d954305b194094b2cff806ce40c88c3fac89684 | Python | 15,948 | 404 | """
m6A_calling.py
Author: Anupama Jha <anupamaj@uw.edu>
Training and data generator code adapted from bpnet-lite (https://github.com/jmschrei/bpnet-lite)
This module contains a reference implementation of a CNN model for m6A calling.
GS hackathon participants: you can start with this code to develop your own
models f... |
51b52e9693b9ea99e6b67223596508bbaed1c65cd68b69412d4d89ee49449c4a | Python | 15,951 | 395 | """
PyQt5 dialog widgets for the cellpose_sam GUI.
Owns:
- ``_PreviewLoader`` - QThread that preloads nearby section previews
- ``OrientationPreviewDialog`` - modal dialog for rotate/flip/reverse-z orientation
"""
import os
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QHBoxLa... |
e1933de291922c55ea190ea0dc694fb22e785d801982cb412720a8ccdc3f1186 | Python | 15,954 | 424 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Analysis module for example files
"""
import analysis_params
from cellsim16popsParams_modified_ac_input import multicompartment_params as params_modified_ac_input
from cellsim16popsParams_modified_spontan import multicompartment_params as params_modified_spontan
import ... |
6cc4297116080d1acb115d19d3be6cd7e9ecc040603af161e036e6e0106e4e85 | Python | 15,955 | 462 | # Node-group asset "Animate Wiggle" (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.
import math
from typing import ... |
ccc7df19a429d0e87c230de8a07cf3c5a367c0c2ddfdab7e16cbaa6ba39cb97f | Python | 15,956 | 318 | r"""Functional interface"""
import warnings
import math
import torch
from torch import _VF
from torch._jit_internal import Optional, Tuple
from torch.overrides import has_torch_function, handle_torch_function
from torch.nn.functional import pad, linear, softmax, dropout
Tensor = torch.Tensor
def mult... |
fe3860ce5da60c33876c0e965ff5f587e18f193640965a4b3df12fd2853a0e48 | Python | 15,957 | 338 | from elasticai.creator.file_generation.savable import Path
from elasticai.creator.file_generation.template import (
InProjectTemplate,
module_to_package,
)
from elasticai.creator.vhdl.auto_wire_protocols.port_definitions import create_port
from elasticai.creator.vhdl.design.design import Design
from elasticai.c... |
b7cbdbb6f07e868d19516d59ae7b81a14a3827d909226a929001da24fcf0c9fb | Python | 15,962 | 334 | import contextlib
import copy
import io
import os
import shutil
import unittest
import hed
from hed import load_schema_version
from hed.scripts.schema_script_util import (
add_extension,
sort_base_schemas,
validate_all_schema_formats,
validate_all_schemas,
validate_schema,
validate_schema_objec... |
dccdb7f6dd7ac045115bd50b513c895fb350d627648929eef7090f837aa2c8fe | Python | 15,962 | 408 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 24 11:42:24 2023
@author: Dustin Garner
"""
from enum import Enum
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
import flycode.readfiles as re... |
28c74e90917180a8c3162c5ed9066f2b5347cfd7465d8a927030d03d5fc88477 | Python | 15,964 | 347 | #%%
import nibabel as nib
import os
import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from scipy.stats import norm
#%%
def common_path(arr, pos='prefix'):
# The longest common prefix of an empty array is "".
if not arr:
print("Longest common", pos, ":", "")
# Th... |
be7be59a7afde1a5c3b41528d4476e47ccfbf825609164d586283e5ba7a0d46a | Python | 15,976 | 423 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 27 08:10:52 2023
@author: Dustin Garner
"""
import os
import numpy as np
import pandas as pd
import caveclient
from fafbseg import flywire
import flycode.mapping as mapping
import flycode.flywire_functions as fw
import flycode.utils as utils
import flycode.readfiles as r... |
f8f4959927696c83fe52988b5675a97c7c26dc8f66ebb25c8c8abf10c8da5806 | Python | 15,977 | 362 |
# coding: utf-8
# # Machine learning with bottleneck features for biological microscopy classification
#
# The goal of this project is to using image (.jpg) analysis to classify cell types.
# A pre-trained TensorFlow model - Inception Model v3 for TensorFlow - trained to analyze images was used to create features of... |
38bdaf02bb608dbc30482c1c362b1b7681c6d3d05e7476007add316fc9c60543 | Python | 15,980 | 317 | import os
from typing import Any, List, Callable, Dict, Tuple, Union
from multiprocessing import Manager
from joblib import Parallel, delayed
from tqdm import tqdm
import numpy as np
from torcheeg.io import EEGSignalIO, MetaInfoIO
from .base_dataset import BaseDataset
class MockLock():
def __enter__(self):
... |
f08414dbb7db67768d90acfe17d20a517272cbb4f89315a9036bc441d17d2cb5 | Python | 15,991 | 442 | from typing import Callable, Optional, Union
from collections.abc import Sequence
import jax
import numpy as np
from tqdm import tqdm
import os
import netket as nk
from netket.driver import AbstractVariationalDriver
from netket.driver.abstract_variational_driver import _to_iterable
from netket.logging.json_log import... |
14d71b96225f77a6bc51bf3bf3b4b89215a69076e97c440e503b500b0cfe23bf | Python | 15,993 | 478 | """
QuPath porcessing for rat somatosensory cortex Nissl data module
"""
# 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... |
2e998fc48e16bf531f0a1e14c404ba09a2ec32c095a438a53b755b5f15067244 | Python | 15,994 | 360 | #!/usr/bin/env python3
__author__ = 'M.D. Boer'
__version__ = '0.3'
__date__ = '15 Sept, 2024'
import argparse
import os
import sys
import logging
import logging.config
def parse_arguments():
class PathAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
... |
38c97afcabddc0d13ef19541d4f1fe161e29752a1f78fbc0dac5def59cfb5586 | Python | 15,995 | 447 | import os
import sys
from traceHandler import Trace
import optimizerHandler
import importlib
import neuron
first_hoc_cls = neuron.h.__class__
first_hoc_dict = neuron.h.__dict__
try:
import copyreg
except:
import copyreg
from types import MethodType
class externalHandler():
"""
Handles models which... |
7285e7cf366f4adeedb5b7bc204b4b803642386fe37d46241ee980563c48f8dc | Python | 16,014 | 467 | import numpy as np
import os, sys
import time, datetime
from .deephio import load_deeph_HS
from .utils import is_master, MPI, comm, mpi_watch, simple_timer, distrib_grps, tqdm_mpi_tofile
from .constants import hartree2ev
import sys
use_slepc4py = True
try:
import slepc4py
slepc4py.init(sys.argv)
from pets... |
f43bce15bfc8b79917d73fa1d82e6574e73b141b436d04fc9c86ae8e11a61960 | Python | 16,018 | 446 | """Tests for fingerprint databases.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
import os
import pytest
import tempfile
import numpy as np
class TestFingerprintDatabase:
"""Tests for FingerprintDatabase"""
def test_create(self):
from e3fp.fingerprint.fprint import CountFingerprint
fr... |
9f556bb85bce291820f9f34a0b3936e10cd87641a39ffefa0bddaa5bd24ce16d | Python | 16,026 | 444 | import unittest
import numpy as np
from neurolib.models.aln import ALNModel
from neurolib.control.optimal_control import oc_aln
import test_oc_utils as test_oc_utils
p = test_oc_utils.params
def set_param_init(model, a=15.0, b=40.0):
# intermediate external input to membrane voltage to not reach the boundaries... |
8af9a9a81bbbe574d86be4419aef361d0c421b1d68fba7b8099028287c97fb8c | Python | 16,027 | 393 | #!/usr/bin/env python
# Contains code that helps with simulations of V1 and downstream neurons
import h5py
import math
import matplotlib.pyplot as plt
import numpy as np
import random
import os
import tensorflow as tf
from itertools import combinations
from scipy.signal import correlate
from tick.base import TimeFunc... |
04dae788bc1cadf4af9a0e3028304bce0351015c861144121ee628fa9fb17f98 | Python | 16,032 | 471 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 8 16:24:35 2020
@author: JiaLi
"""
import numpy as np
from scipy import linalg
from scipy.spatial.distance import squareform, pdist
import sys
sys.path.append("..")
# generate nodes coordinators
def generate_nodes_coord(n_nodes):
phi = np.random.random(size=n_node... |
82a1e17400410d188718caca4d5c6962d4841170ccf1208ce7dbb9388ca4e041 | Python | 16,032 | 277 | """Plugin architecture: registry, discovery, component selection and failure isolation (tiny weights)."""
import json
from pathlib import Path
import textwrap
from threading import Event
import numpy as np
import pytest
import torch
from scipy import sparse
from conftest import assert_no_hooks, build_engine
from liqu... |
c9aade714ad85e4b15c87c62e06889b0a5c3b96bbb4f2c8a3cde0a384f9982c9 | Python | 16,033 | 415 | import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
from monai.networks.nets import densenet121
# class DenseNet(nn.Module):
# def __init__(self, **kwargs):
# super().__init__()
# self.densenet = densenet121(**kwargs)
# self.classifi... |
96ad4a4b52e98162c8a4461776ba2c6f93aba4840ab56596c61a4f8228b6a33c | Python | 16,040 | 352 | import struct
from collections import OrderedDict
import json
import os
import platform
from .tools import get_timestamp, mkdir
# ----------------------------------------
# class option <same as 'struct' in C>
# ----------------------------------------
class OptionClass:
pass
# ----------------------------------... |
38ae3b13d69a561f1c9d01156de417c78ac6144a9609202e95444fb45fdb094f | Python | 16,041 | 410 | import random
from collections import defaultdict
import json
import math
import os
import datetime
from dreamcoder.dreamcoder import explorationCompression
from dreamcoder.utilities import eprint, flatten, testTrainSplit
from dreamcoder.grammar import Grammar
from dreamcoder.task import Task
from dreamcoder.type impo... |
fc0a8e47e70e50a6fe4e61e27dbc153ac73993bf0436fc170212782bb72dbff7 | Python | 16,042 | 341 | """ Authored by: Neel Kanwal (neel.kanwal0@gmail.com)"""
# This file provides inference code for ensembles of binary DCNN or ViT models mentioned in the paper.
# Update paths to processed datasets
if __name__ == "__main__":
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
... |
ecd0cb55f465fe1312c970995c98eaf84cdb99af56e24346d82341ba152ecd0e | Python | 16,048 | 351 | #!/usr/bin/env python
__author__ = "Shuai Liu"
__email__ = "shuailiu25@gmail.com"
import shutil
import glob
import pickle
import logging
import sys
import os
import time
import subprocess
import argparse
def mcs(ref_mol, fit_mol):
#do the mcs search and return OEMatch object.
#ignore Hydrogen
OESuppressHy... |
2c045a33094f6bf291f4f40d2c763c9d295b4741b906788097c33d38293c3eb5 | Python | 16,065 | 344 | #!/usr/bin/python3
import sys
import os
import sqlite3
import shutil
import tempfile
from pprint import pprint
import pandas as pd
import numpy as np
import re
import argparse
import datetime
import sys
import collections
import threading
import flex_ddg_db3
rosetta_output_file_name = 'rosetta.out'
output_database_n... |
ae677525510692d9fa7d4510c9e729d18b8b38c9d034f8606089f3b376687aef | Python | 16,066 | 453 | import os
import sys
import unittest
here = os.path.split(__file__)[0]
try:
test = os.write
try:
from cinfony import pybel, rdkit, cdk
except ImportError:
cinfony = None
try:
from openbabel import pybel
except ImportError:
pybel = None
rdkit = cdk = None
except ... |
7b8fe3d61421b073ac6c6ce28b37e1ba05a1de42e29a0549725d7e6d94f85db1 | Python | 16,069 | 426 | import os
import tifffile
import subprocess
import random
import numpy as np
import pandas as pd
from merlin import dataset
from merlin.core import analysistask
from merlin.util import barcodedb
"""
A module for thunderstorm fitting
This could actually be used for compressing the data
Rongxin Fang 11/11/22
"""
class... |
9a629cd8089b1390c4b476c81d329acb0e553542a908a3130c71ffe0711f4494 | Python | 16,069 | 372 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
37bc09174c8cd81759ce325e3839c02c0c9bf293868c4893b4cd9ff72c3e1138 | Python | 16,070 | 457 | #
# MIT License
#
# Copyright (c) 2023 GT4SD team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... |
b81b25f150d0d9f04d03035334e99572255447cae2a4cc34a4c9533597155eb5 | Python | 16,070 | 348 | import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import datetime
import math
import multiprocessing as mp
from mipt import mipt, mipt_full, LHS_maximin
sample_size = 100 # the number of samples to be selected
repeat_times = 5 # the number of ML models to be trained for each parameter com... |
cb618880afb198b3eacc5485267a2a04d1533e3a7027a1b693ccee30362da230 | Python | 16,077 | 359 | import interact
import numpy as np
import os
"""
class WormInEnv(object):
def __init__(self):
print("WormInEnv init ", os.getcwd())
self.f = open("data/mengdi/eworm.muscle-220428-152601.txt", "r")
interact.add_worm(np.array([2,0,0], dtype=np.float32), np.array([-2,0,0],dtype=np.float32))
... |
7d4ce072b19412331d4011cc4bf6667e4d31fbc4ecfc42db682edc685c5b102c | Python | 16,085 | 325 | import os
import pickle as pkl
from typing import Any, Callable, Dict, Tuple, Union
import numpy as np
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
class DEAPDataset(BaseDataset):
r'''
A multimodal dataset for the analysis of human affective states. This class generates t... |
99f33742e3af1aa1a74ebf10f2928a7dd66da0957c90b65868236ea9584210ae | Python | 16,086 | 418 | # 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... |
47efd0a267da73f9265314e30cfa21861f0512d567feee03dbc5d03c337d13b1 | Python | 16,089 | 438 | # 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... |
d8801fbbcc10d8a44b2f7ab1fa0ee67fef521f47bdfe234d778d685b2c5a769f | Python | 16,089 | 369 | import os
import unittest
import numpy as np
import pandas as pd
from hed import TabularInput, load_schema_version
from hed.models import basic_search
from hed.models.basic_search import (
check_parentheses,
construct_delimiter_map,
find_matching,
find_words,
reverse_and_flip_parentheses,
veri... |
61da23700bce12a7a87ac5f0ddd51e24b48d5178a31d34ec8618fcc14a9a7a45 | Python | 16,102 | 998 | # 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... |
85783cb582308fdad598d4b403cb8a0d2fab7ebc5409a38230e216a6b81493f3 | Python | 16,102 | 348 | import random
from itertools import cycle
import numpy as np
from control_tools.execution import ArmTrajectory, Rest
from learn_tools.learner import get_trial_parameter_fn, DESIGNED, CONSTANT, RANDOM, LEARNED, SKLearnSampler, \
get_explore_parameter_fn
from perception_tools.common import get_type
from plan_tools.... |
f4ede15ec5329de6aeb52111900f6b939f42d1f8118ea3584d08e36fb1fb0eb5 | Python | 16,115 | 270 | import pickle
from pathlib import Path
import openturns as ot
import numpy as np
def create_pkl_name(type_of_metamodel, training_amount, folder=""):
"""
Creates the name of the .pkl file in which the metamodel will be stored
Parameters:
----------
type_of_metamodel: string
... |
00abd73055ad20815a0caae80f4f97e2ff8b682177744b39be7ab9540b9d7940 | Python | 16,120 | 472 | ##
# \file brain_stripping.py
# \brief This class implements the interface to the Brain Extraction Tool
# (BET) to automatically segment the brain and/or the skull.
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date Oct 2016
#
import os
import sys
import itk
import SimpleITK as ... |
351d28f08f136577cb186e3f73caa7b40232c455cdd795612d357bdf89864258 | Python | 16,123 | 372 | import warnings
import torch.nn as nn
import torch.nn.functional as F
from utils.common import Device
from typing import Dict, List, Tuple, Optional
from .layers import ComboWGATConv, Interp, NetWeights
from .model_utils import *
class IconCombo(nn.Module):
def __init__(self, in_size: int, gat_shapes: Dict[str, ... |
f7581e7fec75819af9452f937545cefd2abb8947fedf65d05acbfacfc263a1ed | Python | 16,128 | 397 | #! /usr/bin/env python
import copy
import pddl
class ConditionProxy(object):
def clone_owner(self):
clone = copy.copy(self)
clone.owner = copy.copy(clone.owner)
return clone
class PreconditionProxy(ConditionProxy):
def __init__(self, action):
self.owner = action
self.... |
3f0e48f947db935e61fe7b4c05393d71eaa977caaa137885865cdb85191135e4 | Python | 16,131 | 423 | """
version 1.1
author: Felix Plasser, Hans Georg Gallmetzer
usage: package to perform linear algebra operations on structures.
changes: xrange() changed to range() for compatability with python 3.11.4
"""
# improvment: use return to pass structures by value (?).
import os, shutil, locale
import numpy
impo... |
f27ebe95848f5b827aff2ab9abf204d0c7cf70162cb5563589197c32d331e10e | Python | 16,132 | 378 | """Atlas taxonomy: the facet fields, the Allen cross-product, the DevCCF collapse.
The key contract these must not break lives in test_atlas_key_contract.py.
"""
import pytest
def test_facet_fields_have_safe_defaults():
"""Every atlas that predates the facets must read as standard/ageless/declared."""
... |
be43cdc50a473fb2ddc6b3d211a8589f319c9b0fd7026fbdf67eb02624ce212e | Python | 16,135 | 463 | from typing import Sequence, Dict, Union, Optional, Callable, List, Tuple
import numpy as np
import itertools
from itertools import permutations
import torch
import torch.nn as nn
from copy import deepcopy
import torch.nn.functional as F
__all__ = [
"MeanVectorLoss",
"PhaseException",
"PhaseLossAtomistic"... |
50b9cf09d0b4a6534fc8d5a75594304baaad9f3c9833f9889fc2919f7e1bb4b7 | Python | 16,140 | 393 | import numpy as np
from scipy.io import FortranFile
from ..utils.misc import KGData, VKBGData, mytqdm, set_range
from ..utils.mpi import is_master, one_by_one
'''
This module contains classes for reading BerkeleyGW related files, including WFN, VSC, VKB
'''
class bgw_wfn:
def __init__(self, wfnfilename):
... |
98a1f8196dc520bb748cb826e4b3e08fb0f95f212f054d8581cfa30b131f4a78 | Python | 16,143 | 471 | """
This module contains function to analyse dynamic library
headers to extract system information
Currently only for MacOSX
Library file on macosx system starts with Mach-O or Fat field.
This can be distinguish by first 32 bites and it is called magic number.
Proper value of magic number is with suffix _MAGIC. Suffi... |
bf183df5b1c0ce6ae92b8d1a276f0c55b72d0a3eb1259d17fcf1bef7f87f52d9 | Python | 16,148 | 364 | from torch.utils.data import Dataset, DataLoader
import torchvision.transforms as transforms
import random
import numpy as np
from PIL import Image
import json
import torch
import os
from autoaugment import CIFAR10Policy, ImageNetPolicy
from torchnet.meter import AUCMeter
import torch.nn.functional as F
from Asymmetri... |
0ee78dec53ccf6bf37c644cee0ac66688333e1080013c11b91bdb2c8230c220c | Python | 16,151 | 377 | import numpy as np
import pandas
from scipy import optimize
from merlin.core import analysistask
from merlin.analysis import decode
class AbstractFilterBarcodes(decode.BarcodeSavingParallelAnalysisTask):
"""
An abstract class for filtering barcodes identified by pixel-based decoding.
"""
def __init_... |
ad5acf6981b82d1f39b717ccc6aa19803cde6faee810ec6588a989ced4451079 | Python | 16,152 | 404 | # 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... |
652f884ced428c9b3cfcc358035df4f8ea333181a2a90a37352c00cee0d3819f | Python | 16,159 | 294 | # this script, together with the lib process_mouse_trials_lib
# 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 ... |
7c46e36415dddcb271f490bb85c241a44a84de4bf3cde651f6bf1b3e4d0f5a39 | Python | 16,171 | 403 | from __future__ import print_function
import os
import random
import argparse
from datetime import date
from time import time
from typing import List
import shutil
from rdkit import Chem
from rdkit.Chem import AllChem, DataStructs
#import Galaxy
import numpy as np
from scipy.spatial import distance as D
from opps.li... |
c5ffe4076a0cd5e8ea410886d2aa83a7d95e37bb2892998849c6711cacc3789e | Python | 16,173 | 446 | """Cross-metric checks for events-first IPCW and the shared extrapolated tail."""
import numpy as np
import pytest
from scipy.integrate import trapezoid
from SurvivalEVAL import PointEvaluator, SingleTimeEvaluator, SurvivalEvaluator
from SurvivalEVAL.evaluations.discrimination import (
auc,
concordance,
c... |
b092d48dc8e9119b290b3ee3d6716b5b6c0618e4c8e6b894666edd12cab1f793 | Python | 16,175 | 387 | import os
import numpy as np
import pandas as pd
import torch
from typing import List, Dict, Tuple, Optional
import logging
from tqdm.auto import tqdm
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
import skvideo
from skvideo import io as skio
from PIL import Image, ImageOps, ImageDraw
from a... |
68ce9210a70f8bf6a04bad4cdc63724ff32deecade89fdf2b1ca2bd6b459fe8d | Python | 16,177 | 364 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import dill
import os
import time
import glob
from sklearn.metrics import auc
import statsmodels.api as sm
from scipy.fft import rfft, r... |
ef1b13c5f3e28bcd01d8e4899e084dcd73792f5a8467eccfa1f70f791ef9a9e0 | Python | 16,177 | 364 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import dill
import os
import time
import glob
from sklearn.metrics import auc
import statsmodels.api as sm
from scipy.fft import rfft, r... |
37ae5733520186fc312c6a4f50bafbe50dc8ab01fb1ebd11205b299f79911f27 | Python | 16,178 | 351 | import os
from typing import Callable, Dict, Tuple, Union
import mne
import numpy as np
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
mne.set_log_level('CRITICAL')
class SEEDVDataset(BaseDataset):
r'''
The SEED-V dataset provided by the BCMI laboratory, which is led by Pr... |
5b94c40e3c35c94f85d57c71b033d59333dddb2c1a3d48e34420cd6859623d1e | Python | 16,179 | 467 | # ----------------------------------------------------------------------
# Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/... |
b20eb953b861a22d739a316a2c94bc970db0ab071463f9018ea386fb39572df4 | Python | 16,183 | 282 | # -*- coding: utf-8 -*-
################################################################################
## *
## * Function: prepare dag file to run the WGS pipeline on CHTC, from pair-end reads to SNP]
## * Writer:Siyuan Feng
## * Mail: siyuanfeng.bioinfo@gmail.com
## * Version: 12.5.2020
## *
##############... |
abc346cac6e241cb47c55a2dee49e31a6aec9f29fe468bb5c012d1877e28a213 | Python | 16,185 | 417 | # 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... |
87fcfff715e87acdac14ca3e588fe629d27eee95734ad83688026ac3783b98ba | Python | 16,203 | 302 | """
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 pandas as pd
import numpy as np
from pathlib i... |
09d52784b5dfabf7709cf56d8f7e1f54f523e85d728d35d20f8064b802a3c464 | Python | 16,204 | 399 | """
this code is adapted from:
https://raw.githubusercontent.com/lukemelas/EfficientNet-PyTorch/7e8b0d312162f335785fb5dcfa1df29a75a1783a/
efficientnet_pytorch/model.py
"""
# Author: lukemelas (github username)
# Github repo: https://github.com/lukemelas/EfficientNet-PyTorch
# With adjustments and added comments by... |
5f8721941e2aa18e7e5c685f3da436705b6f8e516f696b9e26b4ed3fe7189b2e | Python | 16,206 | 500 | import os
import pytest
import numpy as np
from pupil_recording_interface.process import BaseProcess
from pupil_recording_interface.process.display import VideoDisplay
from pupil_recording_interface.process.recorder import (
VideoRecorder,
MotionRecorder,
)
from pupil_recording_interface.process.cam_params im... |
48053f923a9ddbad1b935170da0cf1b95c4c0703453de70fef90f7494a15a660 | Python | 16,216 | 442 | """Point-set discovery and per-file cell tables.
A registration run can carry SEVERAL point files - e.g. input cells and starter
cells - so every cell statistic in the report is a function of a point-set
SELECTION, not a global. This module is the single place that resolves that:
it finds the point sets a run pro... |
adabbdadef61e304c13187cdf229290a24b014bb2eb739efb6c2b54ef5a56078 | Python | 16,218 | 491 | # 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... |
7fd95d179abfa9c478ad88ab503da09e394db53ea376ab74a09aa16b405e49f6 | Python | 16,219 | 392 | import torch
import torch.nn as nn
from torch.hub import load_state_dict_from_url
#from .utils import load_state_dict_from_url
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
__all__ = ['ResNet', 'resnet18', 'resnet3... |
11d16c437283daa3c61fdafb95c770c30d80f91cd40a1f649fed30038156a6b5 | Python | 16,221 | 249 | """HEAD_TO_HEAD.py 2026-09-30. Pre-registration: 04-NOTES/PREREG-2026-09-30c-HEAD-TO-HEAD.md
Shiu et al.'s own v783 file. Seven conditions: the published file (O); the rival fixes of Santos 2026 (GitHub issue #11,
Zenodo 10.5281/zenodo.23005090): one neuron (O+il3LN6), the antennal-lobe deletion (Rd), all their corre... |
c642c1a0122936649ef5c081b44de90e19e4c76dd6ea21116b1d3b34beba28c1 | Python | 16,222 | 323 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 27 21:22:44 2023
@author: daltonm
"""
import numpy as np
import pandas as pd
import dill
import os
import glob
import re
from pynwb import NWBFile, NWBHDF5IO, TimeSeries, behavior
from pynwb.epoch import TimeIntervals
from ndx_pose import PoseEstim... |
54b01ec97cee5771b098c8e537949ec6416ec2e9da1b10882fcccf65e760d9a7 | Python | 16,223 | 521 | # 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... |
90aee67b77aab02031c1058abbb71704e4911b5864a2b0499a7db551296c8f0d | Python | 16,227 | 352 | # Node-group asset "Cone Shadow" (CompositorNodeTree), 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.
import math
from typing import T... |
afbc4c9dd57543c43cb1f38a69e326430d4ed5bf6d14ed348476b8ad4dee7352 | Python | 16,227 | 341 | """
Script for extracting particles from a filament network in a single membrane graph (Microtubules-Acting version)
Input: - A STAR file with a list of graphs (MbGraphMCF) as it is returned by
by mb_fils_network.py script:
+ Density map tomogram
+ Segmentation tomogra... |
9e627b4d4a1a377cc8c81eb3a73829b3c45f40efe98d7ab4c4111f13b53efee1 | Python | 16,231 | 420 | """
Defines class Catalog that contains meta data for each experiment. The meta
data includes filenames where the data obtained by image analysis is stored
as well as other info such as instrumentation settings and (visual)
characterization of the experimental data.
# Author: Vladan Lucic (Max Planck Institute for... |
0fc2b904011caeed015f8037323439c94199ba0c53299b9109a94f54dc892aa9 | Python | 16,233 | 447 | """Utilities to facilitate annotation of events in BIDS."""
import io
import re
import pandas as pd
from pandas import DataFrame, Series
from hed.errors.exceptions import HedFileError
from hed.models import df_util
from hed.models.hed_string import HedString
from hed.models.sidecar import Sidecar
from hed.models.tab... |
f3bfc1f86ac3cbba7e792de8d9a3437d1a1bfb5fae962aa8e25c66d9a6081672 | Python | 16,236 | 305 | import torch
import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
import copy
import time
from receptive_field import compute_rf_prototype
from helpers import makedir, find_high_activation_crop
# push each prototype to the nearest patch in the training set
def push_prototypes(dataloader, # pytorch ... |
6fdc3e3a78768ef553ccc8af3233f0d95aa9976f994281fd8637b883c0bde490 | Python | 16,237 | 421 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... |
d653e4c1506c3f0cd6ea9b724f5a5c2570bffb5ddbde47f77fc3b3b26e7e345b | Python | 16,237 | 400 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import logging
import math
import random
import os
import torch
import numpy as np
import cv2
from datasets import ava_helper, cv2_transform
from datasets.dataset_utils import retry_load_images, get_frame_idx, get_sequence... |
3dcc0faac37d1f3ddf58afa3c48f12976c8943dae690903c1fab898cd193cfc9 | Python | 16,244 | 456 | """Implementation of CLI repair command."""
import math
from itertools import chain
import numpy as np
from treem import SWC, Morph
from treem.utils.geom import norm, repair_branch, rotation, sample
SKIP = 'not repaired'
def _correct_shrink_xy(morph, args):
"""Corrects for shrinkage in X,Y plane."""
scale... |
23c11ea20c804fbd95c0935daaba2715e46185133f1b228eb83d396563df5f5b | Python | 16,248 | 382 | from itertools import chain
import numpy as np
from ..utils.mpi import distrib_vec, MPI, comm
from ..utils.misc import mytqdm
from ..matao.matao import MatAO
# from time import time
# class timer:
# def __init__(self):
# self.start_time = 0.
# self.total_time = 0.
# def start(self):
# ... |
ad2228aa6599bfcfc146cbc58d8d9f2a347371eb5dbd1ba9bbebda974e1d3125 | Python | 16,261 | 521 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""
This implementation is based on
https://github.com/rwightman/pytorch-image-models/blob/master/timm/data/auto_augment.py
pulished under an Apache License 2.0.
COMMENT FROM ORIGINAL:
AutoAugment, RandAugment, and AugMix for PyTorch
This code imp... |
8c93470d00249c2c284ef64734bb96bdf97bf695fe99e7c3acc226812e37fc3e | Python | 16,269 | 424 | """
# I guess I read in the csv data, each line of which specifies a t1, t2, SDM, and target.
# I then read in that data, and turn it into a dataloader ... if I understand that correctly.
# I then use the dataloader to deliver randomized minibatches of data during training.
#
# A question that I need to deal with is h... |
95306620150613b9c8f6344514778bff314d2a9fba4770eeb9e85a781a57866d | Python | 16,276 | 85 | ########## All code in this script is adopted from https://github.com/gagneurlab/concise/blob/master/concise/utils/letters.py by Ziga Avsec Gagneur lab ########################################################################################################################################################################... |
8d912735ec2fcdd00face3900471a28042321b319dd00a84293d8e8897f87b33 | Python | 16,278 | 508 | """
==============================
Compute group-level statistics
==============================
Compute T- and F- for the effect of conditions and search for
significant (spatio-temporal) clusters.
Authors: José C. García Alanis <alanis.jcg@gmail.com>
License: BSD (3-clause)
"""
# %%
# imports
import sys
import os
i... |
cce3fd8e1aba1af0ed32f08c46a16c4f136846ef5ef3390444cf6110411b695b | Python | 16,278 | 452 | """
Wrapper around dolfin mesh class to define parent and child meshes for SMART simulations.
"""
from typing import Dict, FrozenSet
import logging
import dolfin as d
import numpy as np
from cached_property import cached_property
logger = logging.getLogger(__name__)
class _Mesh:
"""
General mesh class
... |
cd83f6a4e117fa6c8a4d05d142c998e296b66eb67663f5769b1531b8ab5517e0 | Python | 16,278 | 417 | # Node-group asset "Topology DSSP" (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... |
b819ca661daf481df1b49360ebea3631315c904d412fc9d2a451a42820c77c83 | Python | 16,282 | 495 | from typing import overload
import pytest
from elasticai.creator.ir import AttributeMapping, attribute
from elasticai.creator.ir.datagraph import DataGraph, Node
from elasticai.creator.ir.datagraph_impl import DefaultIrFactory
from elasticai.creator.ir.datagraph_rewriting import (
Pattern,
PatternRule,
Pa... |
fd42de7e675d2c32c9f552911405e1b2111dd333fc3983e172308f7d8a2551ba | Python | 16,295 | 563 | # 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.version import parse, Version
"""
import collections
import itertools
import re
from typing import C... |
03a3c78d2ea33e48b09044b7794c2cbc4f6eea10fe448a34dcf379f3d7101eff | Python | 16,303 | 346 | # -*- coding: utf-8 -*-
#
# Common routines for saving Syncopy data objects to Neurodata Withour Borders (NWB) files.
#
# Note that NWB is a very general container format, and that a software can read NBW files does
# not mean that it can interpret the data stored by a different software into an NWB file.
#
# The NWB f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.