sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
bfa5c6fe13277a4cbe0079994714d2458d5dc85b6b72f092114471b5b5e9c56b
Python
2,273
54
#!/usr/bin/env python import os import pandas as pd ## location of main project directory on HPC proj_path = '/project/3011157.03/Simon/proj_2022_CABB_movie/' ## location of R output files to visualize r_path = os.path.join(proj_path, 'Scripts', 'MovVar_CommsBio_Revision01', 'control_ISRSA', 'r_output_nocontrol') ## l...
142cd5bcac1a31743252fe32e88e9e84d6555ff950cf9c668522503bcbc8cd28
Python
2,274
55
# This file is to give neurons stimulus from network.Network import Network from network.Connection import Connection from network.Cell import Cell from network.Segment import Segment from network.init import * from network_assemble.data_structure import Circuit, Neuron, Connect, make_connect from network_assemble.da...
c379a86a36e227d6db12cf9ade216f6262fb475985a06d3742ee28407bd1cec1
Python
2,274
68
import numpy as np from itertools import cycle class Lines: def __init__(self, resolution=20, smooth=None): self.COLORS = cycle( [ "#377eb8", "#e41a1c", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", ...
1dd1cd5cbbcfe7caf9ba09652b5cd9d869f28c17f1c1190bd65bb0b3d6d2999f
Python
2,275
47
# 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 # # ht...
3d769ed747625c2d2ddbef6298dc01af792866f659134020b79f2c4d06663959
Python
2,275
67
# processing.py (ES_Adaptive class definition) import numpy as np import networkx as nx import sys sys.path.append('../Model/tES/') sys.path.append('./MouseBrainLib/') # wrapper.py (Wrapper class and network creation) import networkx as nx from tES_Adaptive import tES_Adaptive from DataUtils import DataUtils class M...
4b73c3ecffd7da0f29181c38d4d36a04edabaec081159d7d75ed90624f04fd40
Python
2,275
79
import torch.nn as nn from segmentation_models_pytorch.base import modules class TransposeX2(nn.Sequential): def __init__(self, in_channels, out_channels, use_batchnorm=True): super().__init__() layers = [ nn.ConvTranspose2d(in_channels, out_channels, kernel_size=4, stride=2, padding=...
c84570b235e6affcc36e7c03f638d28cc9ac67b8fbc5a1599d713c3b13874af8
Python
2,275
73
# 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...
f474fe48152143e45fb5ed53cf53e95edfac536f2ed873c5e7a17bb4cd983e0a
Python
2,275
64
import os import numpy as np from .mask import roiSlice from yacs.config import CfgNode from .sitk_tile import sitkTile from tiffile import imread, imwrite from .transformation import computeTform, warpAll def saveMask(cfg: CfgNode): ''' save masked image volume in the results directory ''' print(f'Re...
343909c7699f3f80ca5046476bdb6f403e0cfbf338f59c7888e09c95ab062492
Python
2,276
59
#!/bin/python from IlluminaBeadArrayFiles import GenotypeCalls, BeadPoolManifest from datetime import datetime import sys, os, argparse parser = argparse.ArgumentParser("Generate a final report from a directory of GTC files") parser.add_argument("manifest", help="BPM manifest file") parser.add_argument("gtc_directory...
347dd5b80aab0c802245948f0eb0e84d381a4ade17a96a274ddb39526dfa6944
Python
2,276
63
# 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...
b75fa6ac6d313500b648888071bf281ae478342f8c43657ffca147803794b7cc
Python
2,276
68
# 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...
58423719f1458c85265f7456da74d8fa8c5467bb9843445b052b6a37d6ef4b28
Python
2,277
76
""" :author: Chinchien Lin :summary: create neuroglancer single resolution mesh. ref: https://neurodata.io/help/precomputed/ dependencies: - neuroglancer==1.1.6 """ import json import sys from pathlib import Path import numpy as np import tifffile as tiff import neuroglancer def crea...
6e7f5072be518b0a7aec5028cedf253376055e678555b0472be39681acd9b011
Python
2,277
61
# -*- coding: utf-8 -*- def _qm9_spec(label_map): """Returns format dict for the QM9 dataset""" ds_spec = { 'elems': {'dtype': 'int32', 'shape': [None]}, 'coord': {'dtype': 'float', 'shape': [None, 3]}} for k, v in label_map.items(): ds_spec[k] = {'dtype': 'float', 'shape': []...
52db59023287614c3539523cbcf990e7290471dd1cc94ff8407fb5f06b7e8cc0
Python
2,278
67
""" Pure-Python helpers for cellpose_sam GUI command building and model discovery. Owns: - Model-file discovery constants and ``_discover_custom_cellpose_models()`` - The sentinel value used by the model combo-box to trigger a file-browser No Qt imports - everything here is testable without a QApplication. ""...
f7385e988a68b0942a767580b6ae184313e77fa4f45aaeaa934550755723c429
Python
2,278
65
import pytest import numpy as np from cobolt.model.clustering import ClusterUtil class TestClusterUtil: def test_check_version(self): obj = ClusterUtil(20, 30) assert not obj.check_version(10, 30) assert not obj.check_version(20, 10) assert not obj.check_version(0, 0) def tes...
10ef0b6d5680db79e8b3adc37bb69f3a17fb9874349b084493ef54ebc89465d9
Python
2,279
75
"""Slab recipes for EMT.""" from __future__ import annotations from typing import TYPE_CHECKING from quacc import flow from quacc.recipes.common.slabs import bulk_to_slabs_subflow from quacc.recipes.emt.core import relax_job, static_job from quacc.wflow_tools.customizers import customize_jobs if TYPE_CHECKING: ...
0020cd6b97ed983c6dc952b6d15fe4dd5f5ea84d4681092d3f8c261a292b1bb9
Python
2,280
74
import datetime import os import random import binutil from dreamcoder.dreamcoder import commandlineArguments, ecIterator from dreamcoder.grammar import Grammar from dreamcoder.program import Primitive from dreamcoder.task import Task from dreamcoder.type import arrow, tint from dreamcoder.utilities import numberOfCP...
0b7e77a54e86da6b37db5e4ee61f6b40356976b3d99996bdf294b5d1a653a495
Python
2,280
79
import torch import torch.nn as nn import torch.nn.functional as F import argparse import os import wandb import tqdm import numpy as np import pandas as pd import data import util import net as networks from torch.utils.data import DataLoader # write down test data path data_path = 'data/test_sequences.txt' def p...
828dc7f8953899f74868a78943327794c10d40ea045a19f3f4779934f7033eca
Python
2,280
82
"""Verilog implementation of HDL abstractions.""" from elasticai.creator.hdl_ir import Node from elasticai.creator.ir2verilog import ( BaseWire, Instance, NullWire, TemplateDirector, VectorWire, Wire, ) from .protocols import HDLInstance, HDLTemplateDirector, Template # Verilog wire types al...
f9307e02e710a31711279ab950c9c83ffd518de1a64d9369b5c59912cce20cf5
Python
2,280
58
import torch import torch.nn as nn from torch import Generator from typing import List from collections import OrderedDict from ..prixfixe import CoreBlock from .add_blocks import ConvBlock class BHICoreBlock(CoreBlock): """ The coreBlock of the BHI model. Consists of a bidirectional LSTM layer, mult...
47d875b9894bb723d7aee79ca115776de4bf119a44c704ff54b6627ddb3d7c41
Python
2,282
84
# Node-group asset "VDW Radii" (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 fro...
b6500d66cab1327c22bfdd8516dbcc6d6297de76d1a3222ca3eb544a0baf8663
Python
2,282
68
import numpy as np import seaborn as sns from matplotlib import pyplot as plt def get_palette(num_classes): palette = {0: (0, 0, 0)} for k, color in enumerate(sns.color_palette("hls", num_classes)): palette[k + 1] = tuple(np.asarray(255 * np.array(color), dtype="uint8")) return palette # --------...
319ab9c63deaae78f6099b0bdce63be6934c197a354055dab153f46d88501780
Python
2,283
72
"""""" """ Prosper_nn provides implementations for specialized time series forecasting neural networks and related utility functions. Copyright (C) 2022 Nico Beck, Julia Schemm, Henning Frechen, Jacob Fidorra, Denni Schmidt, Sai Kiran Srivatsav Gollapalli This file is part of Propser_nn. Propser_nn is free softw...
967d85b626ed39387d9c04ab75dc8efe21d6132eca73948d53523d0e9027f5e6
Python
2,283
77
import numpy as np from pyclamp.dsp.channel import * def si16read(fn, datatype = 'h'): f = open(fn, 'rb') Data = np.fromfile(file=f, dtype = datatype) f.close(); return Data class SI16: # a fairly primitive short-data binary type reader IntData = None fileName = None chinfo = None nChan = 0 # number o...
dece331ccf6769c7317af588c3fdf7652ca8c9e3d05c67083b94648753a94776
Python
2,284
50
import os import subprocess import numpy as np import pandas as pd import glob import sys from multiprocessing import Pool import multiprocessing ########################### # This script will lift over your sumstats from hg19 to hg38 # 10.04.2023 (provided by Yasmina Mekki) # https://github.com/hakyimlab/summary-gwas...
2485dfc844ed99a339aada801df17c259f150f430278e893146c55333d549b10
Python
2,285
37
MDATA_BIN_FILE_NAME = "mdata.bin" # name of binary metadata file MDATA_BIN_FILE_VERSION = 2 # version of binary metadata file MC_MDATA_BIN_FILE_NAME = "cmap.bin" # name of binary metadata file for multichannel volumes FORMAT_MDATA_FILE_NAME = ".iim.format" # name of format metadata file CHANNEL_PREFIX = "CH_" # pr...
52069b290d582637c890cf5d266f14079e7cffaeacd40a9caf411cae9e43b419
Python
2,285
62
from collections import deque from heapq import heappop, heappush from recordclass import recordclass import numpy as np from .utils import INF Node = recordclass('Node', ['g', 'parent']) def retrace(visited, q): if q is None: return [] return retrace(visited, visited[tuple(q)].parent) + [q] def ...
fcb886698189fd01ce594e2a03e47b921c474b45cd3e559288634ec693d7fd21
Python
2,285
69
__author__ = "Zoe Wefers" __credits__ = ["Ryan Huang"] __version__ = "1.0.0" __maintainer__ = "Zoe Wefers" __email__ = "zoe.wefers@mail.mcgill.ca" """Purpose: Object definitions for various cellular compartments.""" import ui class Dendrite: def __init__(self, img_name): self.img_name = img...
52fbe82d7b2cfcfd23e7ac41872024625618e93e716de2274897a9c74367e7dc
Python
2,287
44
"""Example C: one plugin, three contributions (interface, panel, experiment) sharing one id prefix.""" from liquidaion_fly.plugin_api import Parameter from .gated_interface import GatedSteeringInterface INTERFACE = "example_research_interface.gated" def make_interface(context): return GatedSteeringInterface(con...
674430f0d4bb41e247d04f98c0fe68f77436e09e2784d4bef244ca8762091484
Python
2,287
68
""" Small script that moves the final results of the subjects For safekeeping and backup reasons. """ import click import shutil import os import pandas as pd import numpy as np @click.command( help="Move the results folder to create a backup on the desired folder ." ) @click.option("--pip_csv", type=click.STRIN...
744c4914a9342041ff29c8043bc9436dcefbdf56bd59f8eb50f10e5b90217011
Python
2,287
59
# -*- coding: utf-8 -*- """This module tests that trained models and checkes that the evaluation matches what is saved in the evaluation log. Versioned regression test data is stored at: https://www.dropbox.com/scl/fo/tkq0zumunvofp7dckfta5/AC_WcVOW-ihchdKTTVOHrno?rlkey=6nz86x7eflli58rlajfspzf8v&dl=0 Upon a breaking...
9e3229d58cd01dd6d236b29e4bb13bdd2f8ae9576d95b33064c10563aeea2b41
Python
2,287
60
# 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...
a7347f3b26b14e43302af08a3208e75a9117997f6ecf95d7a4193a5a7f81cf75
Python
2,287
94
from __future__ import annotations import numpy as np import pytest from quacc import flow, job from quacc.wflow_tools.job_patterns import ( kwarg_map, map_partition, map_partitioned_lists, partition, ) def test_partition(): @job def simple_list(): return list(range(10)) @flow ...
345e12e5e15f3c5cb6d36dee9bc0977b63e6ad525f8c85e0c253ee742399d27d
Python
2,288
55
import torch import torch.nn as nn from .base_converter import BaseConverter from ..utils import _triple_same class Conv3dConverter(BaseConverter): """ Decorator class for converting 2d convolution modules to corresponding 3d version in any networks. Args: model (torch.nn.module): model th...
83f5845f0b29df7a1a760d63d22fce090254736fb3520babc0b62ad659c3e843
Python
2,288
94
# Functions used to run simulations to evaluate ideal time-step from neuron import h import numpy as np h.load_file('stdrun.hoc') h.load_file('negative_init.hoc') ################################# # Custom simulation initializer # ################################# def initsim(v_init=-65, cvode=1, atol=5e-5,...
a3cc15b74db2ca294153e6c4ef415d32235e9f392543e50d30d8c842e1e19767
Python
2,288
68
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
ba52565fc8d3dca8463a1e5f08ea7499ccab1831cc8cf8cc25b86a28c9d71bba
Python
2,289
42
# script to replace values of the @chrs, @StartSites, @StopSites perl variables with suzukii contig information import os import re env_vars = ['Altitude', \ 'Annual_mean_wind_speed', \ 'Annual_Precipitation', 'Precipitation_Seasonality', \ 'Mean_Diurnal_Range', 'Mean_Temperature_of_Coldest_Quarter', 'Mea...
c5e146827c14e7336a09f6a048ead89508d4dc622ed729c3c069b5b299646330
Python
2,289
98
#!/usr/bin/env python3 """ Run a blocked flickering checkerboard stimulus. """ import argparse import subprocess import os.path as op def cli_parser(): """ Parse command line arguments to generate a call to my LOVE flickering checkerboard experiment. """ parser = argparse.ArgumentParser(description=__...
d73476db7aa6dbd39107137ecf81e14c40a933a9f80089d501e3e1ed0cdcfbe2
Python
2,289
29
"""posthoc_realscan_size_2026-10-02.py (post hoc; v2LN30's value was seen first). REAL_SIGN_SCAN (29 Sept, Seki's real PNs): flipping each inhibitory local-neuron type to excitatory lowers the fit; is v2LN30's drop larger than its output size predicts? Output: 06-OUTPUT/posthoc_realscan_size.txt""" import sys, os s...
a78c76ff8b0776cbe2e5d4bd853d870f17887aa3d299f3e257bbc7dcf2243114
Python
2,290
68
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
548db6ba86de3536155334fb653327271edb92d421534bbc9f118b88600b62a3
Python
2,291
68
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
8c678b55a01ad5217e8f4c4add230df8800545c4fbd949f1285f05bf7acefdd1
Python
2,292
71
"""Functions for parsing text from dataframes/text formats""" import re # Might need separate version again for wiki header_attr_expression = '([^ ,]+?)="(.*?)"' attr_re = re.compile(header_attr_expression) def _parse_header_attributes_line(version_line): matches = {} unmatched = [] last_end = 0 fo...
2ec6d0a3c64bacc78e7aa59038a3188c37b8fc516979169e89a1d2b2597449ac
Python
2,293
72
from typing import cast from elasticai.creator.file_generation.in_memory_path import InMemoryFile, InMemoryPath from elasticai.creator.nn.fixed_point.precomputed.silu import SiLU def test_vhdl_code_matches_expected_silu() -> None: expected = """library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all;...
3f2149616e1354eced1f445ac61d1b98e260e760033d3564f09134b5b801154c
Python
2,293
85
import os import pandas as pd from calvados.cfg import Config, Job, Components import subprocess import numpy as np from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('--name',nargs='?',required=True,type=str) args = parser.parse_args() cwd = os.getcwd() sysname = f'{args.name:s}' # se...
93b9b55a2d9c258955d783b4acbfd6ad6bc454739fb43e5c1840f4c13c6045ff
Python
2,293
74
# 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...
5843685e918ca87a8b59499a21e0744a223f60fb1f6a29fefb0004f162b28fd1
Python
2,294
59
from elasticai.creator.file_generation.savable import Path from elasticai.creator.file_generation.template import ( InProjectTemplate, module_to_package, ) from elasticai.creator.nn.integer.ram.design import Ram from elasticai.creator.nn.sequential.design import Sequential as _SequentialDesign from elasticai.cr...
5908992dcabd4afdefe23a7dba9cc6e3ba5bbdcd151efbaee6a4165eef431d45
Python
2,294
71
import elasticai.creator_plugins.lutron_filter.rules._ir as _ir import pytest from elasticai.creator.ir import attribute from elasticai.creator.ir.datagraph_impl import DefaultIrFactory as Factory from elasticai.creator.ir.serializer import IrSerializer @pytest.fixture def factory(): return Factory() _serializ...
cc989386fb7c4f1108c53319d61b552feba49bb87cded55a5998858581de980a
Python
2,294
72
from typing import cast from elasticai.creator.file_generation.in_memory_path import InMemoryFile, InMemoryPath from elasticai.creator.nn.fixed_point.precomputed.tanh import Tanh def test_vhdl_code_matches_expected_tanh() -> None: expected = """library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all;...
fcc7686db2cfc99e9b3b6601f404638de6744a086da3a3a32e0cab098238c22e
Python
2,294
81
# 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...
705e3a512492d0ef0afeed5891c6a3d7713d0a9e207611aa605003f5f6c0955a
Python
2,295
71
#! /usr/bin/env python # -*- coding: utf-8 -*- import itertools import os from lab.environments import LocalEnvironment, MaiaEnvironment from downward.reports.compare import ComparativeReport import common_setup from common_setup import IssueConfig, IssueExperiment, RelativeScatterPlotReport DIR = os.path.dirname...
dbc1783508451416230a15a84579932867198b448e4c5f398a8e32ae2d79d397
Python
2,295
54
import binutil from dreamcoder.domains.arc import arcPrimitivesIC2 import numpy as np import pytest grid_test_case = arcPrimitivesIC2.Grid(np.array([[0, 0, 0], [0, 1, 0], [3, 0, 3], [4, 4, 5]])) grid_test_case2 = arcPrimitivesIC2.Grid(np.array([[0, 0, 0], [0, 1, 8], [3, 0, 3], [4, 4, 5]])) pos_test_case = (1, 5) size...
0a69e36c6a671629ae164cd325bc9411467db4afcc11bee187047b6f5bc3c240
Python
2,296
87
# Node-group asset "Is Boundary Edge" (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_CHECK...
0c819e6a35a84b3a7e0bdbc3d5f8d8e9f4136c1846efe16a2ea06f483fe45a6d
Python
2,296
57
import csv import numpy as np from unittest.mock import patch def test_registration_2d_forwards_edit_params(monkeypatch): # registration_2d -> register_ndim: assert the two params arrive at register_ndim. import regtools.registration.registration_2d as r2d captured = {} def fake_register_...
43782369e793a1204c3453dfd90ed961a7065ede1059da11c62d2f4052aa0ca5
Python
2,297
87
#!/usr/bin/env python3 ## create personality distance matrix (correlation distance across 5 traits) import os import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from sklearn.metrics import pairwise_distances # ------------------------------------------------------------------...
b3107646d652483a77cc76331de26df33958e9d62a958f902326d57b7c0e7fdc
Python
2,297
66
import json import torch import tqdm import numpy as np import torch.nn as nn from pathlib import Path from typing import Any from ..prixfixe import Trainer, PrixFixeNet, DataProcessor, DEFAULT_METRICS class AutosomeTrainer(Trainer): def __init__( self, model: PrixFixeNet, dataprocessor...
0265f07b34871f42fc5337d55b049505039bcbae7dcf2fbe824fff07d215f54a
Python
2,298
83
# Node group "Override Index" (GeometryNodeTree), dumped by nodebpy.assets.dump_library. # Rebuild the library with nodebpy.assets.build_library (nodebpy build). # Shared by several assets, which import it; not an asset itself. # _build_group() is the source of truth: the docstring, __init__ and accessors are regenerat...
2f14516079ffbf0d7ec46b615e3fc7ba47f9473affeb2e45baef8d373709142a
Python
2,298
77
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: A.Akdogan """ import matplotlib.pyplot as plt import numpy as np def visualize(**images): """ Plot images in one row """ n_images = len(images) plt.figure(figsize=(20,8)) for idx, (name, image) in enumerate(images.items()): plt...
4da172ad0309864f187286d93cd760cd20e6580adf5143e33e558c93ee77459b
Python
2,298
56
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from lab.environments import LocalEnvironment, BaselSlurmEnvironment from downward.reports.compare import ComparativeReport import common_setup from common_setup import IssueConfig, IssueExperiment from relativescatter import RelativeScatterPlotReport DIR = ...
6aa98db279597c5a72713c86c2587919760a8db2da2ae089ebb81216854582f1
Python
2,298
80
import pytest import numpy as np from scipy.stats import ortho_group from sella.linalg import NumericalHessian from test_utils import poly_factory @pytest.mark.parametrize("dim,subdim,order,threepoint", [(3, None, 1, False), (3, None, 1, True), ...
77f6b83132bf81c725e9a41844c92260bf7ecf83e19db441df10bb81ca72c501
Python
2,298
88
from __future__ import annotations import numpy as np import pytest from quacc import job from quacc.wflow_tools.job_patterns import ( kwarg_map, map_partition, map_partitioned_lists, partition, ) def test_partition(): @job def simple_list(): return list(range(10)) partitioned_l...
9e80dbd21df642375f07bab07e00d0152a61044b3aea323fc41c992af4ad4538
Python
2,299
62
""" Modified from torch.utils.data.distributed.DistributedSampler Support enlarging the dataset for *iteration-oriented* training, for saving time when restart the dataloader after each epoch """ import math import torch from torch.utils.data.sampler import Sampler import torch.distributed as dist class DistIterSampl...
b4c88aa45893413fba028e0691d8a36fa2b07c3e226fb89da4083ae6b3356c8e
Python
2,299
99
"""A script for running the correlation analysis on the marged data set.""" import matplotlib import matplotlib.pyplot as plt import pandas as pd import seaborn as sns font = {"size": 10, "weight": "bold"} matplotlib.rc("font", **font) import imp plot = imp.load_source("plot", "src/plot.py") df = pd.read_csv("data...
e5be2ca1f700d51c9ae9a5cccc854cbbad0c80f8742e873ebe4b64e870f1770c
Python
2,299
69
#! /usr/bin/env python # -*- coding: utf-8 -*- import itertools import os from lab.environments import LocalEnvironment, MaiaEnvironment from downward.reports import compare import common_setup from common_setup import IssueConfig, IssueExperiment DIR = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS_DIR = o...
fdbe95c886d07e97fec1172f9fc2134facdbd805974446623d8e96a5d3eac174
Python
2,299
56
import wsgiref.simple_server from opentelemetry import metrics from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor from opentelemetry.instrumentation.wsgi import OpenTelemetryMiddleware from opentelemetry.sdk....
6982a39a548232f7f35423e654f1aad87b1f4dbdedd448fc858137638fe024ad
Python
2,300
59
import json import torch from torch import optim from constants import ( RESNET18_CONFIG, RESNET50_CONFIG, RESNET101_CONFIG, RESNEXT50_CONFIG, EFFICIENTNET_B0, EFFICIENTNET_L2 ) __all__ = ['get_train_setup'] class TrainSetup: def __init__(self, epochs, learning_rate, lr_decay, lr_schedul...
69e1bf3d660a28878449447722b842435127aae104c91e4bd8521c44e724ab0d
Python
2,300
88
from __future__ import annotations import numpy as np import pytest from quacc import flow, job from quacc.wflow_tools.job_patterns import ( kwarg_map, map_partition, map_partitioned_lists, partition, ) def test_partition(): @job def simple_list(): return list(range(10)) @flow ...
c9d55971708333dc1c05272292677505c9ad0fe2881a793017f3ee63a70023bc
Python
2,300
70
# 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...
d2f21b89e496c7eb24608700d6e645c01c19cdffe98ed4a842e4ba2f833d062a
Python
2,300
94
from unittest import TestCase import numpy as np import matplotlib.pyplot as plt from soundsig.timefreq import power_spectrum_jn from soundsig.spikes import simulate_poisson, plot_raster, spike_trains_to_matrix class SpikeFFTestCase(TestCase): def setUp(self): pass def tearDown(self): pas...
5c161f0ff8d89128cb49e44ed978fb8cb1f6a08518b30961337a80cbe40b1b75
Python
2,301
82
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import suites from lab.reports import Attribute, gm from common_setup import IssueConfig, IssueExperiment try: from relativescatter import RelativeScatterPlotReport matplotlib = True except ImportError: print 'matplotlib not available, scatter plots...
6608e68bbb93e03cd83bb7246541dbfa74d78c21ed2ef1b394af8bf0d2aac0b7
Python
2,301
86
# 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...
95a7f35ae7035e007abe8b8386ad231e594f1de128959592aad4e28c99176574
Python
2,301
61
from typing import Union, Dict, List import numpy as np from ..base_transform import EEGTransform class Downsample(EEGTransform): r''' Downsample the EEG signal to a specified number of data points. .. code-block:: python transform = Downsample(num_points=32, axis=-1) # normalize along...
0c61b691c119bf40db33b6acf04628b87f1225761c8a0e23d196a7dd2ac6d228
Python
2,302
46
# 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 # # ht...
46b00fd8da9c9c4399e75894264ea6b93f82fa8c32da2b410f302e74f14f15e7
Python
2,302
89
from __future__ import annotations import logging import pytest from quacc import Remove from quacc.utils.dicts import finalize_dict, recursive_dict_merge, remove_dict_entries LOGGER = logging.getLogger(__name__) LOGGER.propagate = True def test_remove_dict_entries(): d = { "output": { "ou...
ff7af86f099839c07dfd9411eb29748ca389bf6f2f8a76f63c20dd73b51a5c80
Python
2,302
83
# Manuel A. Morales (mmoraleq@bidmc.harvard.edu) # Beth Israel Deaconess Medical Center # Harvard Medical School import os import datetime import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.optim as optim from Models import * import sys # ============================================...
641e4e6831dafc45a30e995cb4fa9da0f387a157df700e55369a1bdd046a5284
Python
2,303
60
# Credits: https://github.com/davda54/sam import torch class SAM(torch.optim.Optimizer): def __init__(self, params, base_optimizer, rho=0.05, adaptive=False, **kwargs): assert rho >= 0.0, f"Invalid rho, should be non-negative: {rho}" defaults = dict(rho=rho, adaptive=adaptive, **kwargs) s...
51bde2667e7eb757df74bb3449bc102088c1042643609fc36f3cef67477a2f4b
Python
2,304
46
# 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 # # ht...
abf928b53663ac3a774531025261e5b1e039031122c653739e7c00681fa827fa
Python
2,304
75
"""Elastic constants recipes for EMT.""" from __future__ import annotations from typing import TYPE_CHECKING from quacc import flow from quacc.recipes.common.elastic import bulk_to_deformations_subflow from quacc.recipes.emt.core import relax_job, static_job from quacc.wflow_tools.customizers import customize_funcs ...
294e701aeb8f1f6c4977cee3e3e0027a59cae07a0b81f55f53e8cc9c92426947
Python
2,305
72
from typing import cast from elasticai.creator.file_generation.in_memory_path import InMemoryFile, InMemoryPath from elasticai.creator.nn.fixed_point.precomputed.sigmoid import Sigmoid def test_vhdl_code_matches_expected_sigmoid() -> None: expected = """library ieee; use ieee.std_logic_1164.all; use ieee.numeric...
2ba4541822cc3d97258fc65915b98b5e1f01f4e1703402fb104f758e44795308
Python
2,305
82
# -*- coding: utf-8 -*- # # Syncopy's (deep) copy function # # Builtin/3rd party package imports from copy import copy as py_copy import shutil import h5py import numpy as np # Syncopy imports from syncopy.shared.parsers import data_parser from syncopy.shared.errors import SPYInfo __all__ = ["copy"] # Return a dee...
3f50ae52bc8455f62237f632902a90eaf9d29b691fe99eb28153bdf2b9669490
Python
2,305
82
import os from calvados.cfg import Config, Job, Components import subprocess import numpy as np from argparse import ArgumentParser from Bio import SeqIO parser = ArgumentParser() parser.add_argument('--name',nargs='?',required=True,type=str) parser.add_argument('--replica',nargs='?',required=True,type=int) args = pa...
48d6a0c972722fc1f666b701895dca955db149f6bfec3118c3992eb7cd8bf8a6
Python
2,305
66
import json import torch import tqdm import numpy as np import torch.nn as nn from pathlib import Path from typing import Any from ..prixfixe import Trainer, PrixFixeNet, DataProcessor, DEFAULT_METRICS class AutosomeTrainer(Trainer): def __init__( self, model: PrixFixeNet, dataprocessor...
b2fd7a743efb795fbbeeb0b06bf0add8d536b0a4662f18293ea11c1f5f37dde1
Python
2,305
81
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 31 16:54:57 2023 @author: emma code for fitting PCA model to full velocity fields (for inter-subject variability/subject effects) """ # python imports import os import glob import sys import random import tensorflow as tf import numpy as np os.en...
ef39d6b679a04662b8602e3baa43d62ca5ab131a619f9dcbd4f1f4f5adacdccf
Python
2,305
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...
9c56ae92152acdad3c29bff5cf64208e42970a9b233cdcc03be01f3e966fbb8a
Python
2,306
70
# Renamed from types.py to avoid clash with stdlib module. # In the future, use explicitly relative imports or absolute # imports as a better solution. import itertools def _get_type_predicate_name(type_name): # PDDL allows mixing types and predicates, but some PDDL files # have name collisions between types...
154ab83ed4fce0cd374b816906d77fdf1a0ed0756ea1925d3dff54f314b5b84e
Python
2,307
61
# 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...
f3e07ab16477124059aa05ca1ca95fb8f5049621b8967cb2372edf0655e6ca89
Python
2,307
75
# Parameters import argparse # Create an ArgumentParser object parser = argparse.ArgumentParser(description='Pretrained models for pseudobulk data') # Add parameters to the parser parser.add_argument('--inPath', type=str, help='Folder with the input data') parser.add_argument('--modelFile', type=str, help='Saved mode...
407541d9253cdac7030d507c3b5b2f528c475cdc38b9018a604d770dd96b0891
Python
2,308
65
import torch.nn as nn class SFCNBlock(nn.Module): def __init__(self, c_in:int, c_out:int, act_fn, grouped_maps=1): """ Inputs: c_in - Number of input feature maps from the previous layers c_red - Dictionary with keys "3x3" and "5x5" specifying the output of the dimensio...
7db52031bd225250be327824b4c9eb855c7ba741b748a6d438135f3ffb770a70
Python
2,308
64
# 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...
cf49d31dce4fa4694a7fcba9117c0b45a3154a42af8c8543736890e52532f513
Python
2,308
63
import sys, math from pybioshell.core.data.io import Pdb from pybioshell.std import vector_core_data_basic_Vec3 from pybioshell.core.calc.structural.transformations import * from pybioshell.utils import LogManager LogManager.INFO() if len(sys.argv) < 3 : print(""" Calculates cRMSD (coordinate Root-Mean-Square De...
42fc91bdfc461a5af1bc97dd5ded0bdc45b32658415ebf8bc5cb68f9324833ce
Python
2,309
65
"""Subject demographics of the EEG LEMON and MEG Cam-CAN datasets """ # Set up dependencies import os import numpy as np from sys import argv from utils import data as Data if __name__ == "__main__": # ------- [1] ------- # # Settings # # ------------------- # print("*** STEP 1: SETTINGS ...
73b93143b866310c59a2c230cbd0da5ed62fd746efbb4677e8ea33c40861c27f
Python
2,309
66
# ********** a running example ********** # initializa a network # and give input to the network # and get the output of the network # and export the data for visualization # commond: python run.py --config /home/zhaomengdi/Project/eworm/Celegans_as_deep_net_net/chemotaxis_net/config.json --randseed 0 from cProfile i...
9e92b4e4000c6ccb2d117309e773e1031b26df42bf273fa4371a6c4781375e64
Python
2,309
66
import numpy as np import numpy.testing as npt import pytest from pycudadecon import affineGPU, deskewGPU, rotateGPU def test_deskew(raw_image, deskewed_image): """test basic deskewing of a file acquired on a lattice light sheet""" deskewed = deskewGPU(raw_image, dzdata=0.3, angle=31.5, pad_val=98) npt.a...
bc4903bf7159699a18d76e62c1ee2ce3e4d49888864e95e4016ac07507043f83
Python
2,309
61
### KMeans class from sklearn.cluster import KMeans from BEBE.models.model_superclass import BehaviorModel from BEBE.models.preprocess import whitener_standalone, static_acc_filter, load_wavelet_transformed_data import yaml import numpy as np import pickle import os import pandas as pd class kmeans(BehaviorModel): ...
c07843dd1d915f4b2cf94c98db2889d747d498f5d47a51ba0beca69545e56b48
Python
2,309
59
# -*- coding: utf-8 -*- # @title Software configuration file # @file SwConfigFile.py # @author Romain Beaubois # @date 01 May 2023 # @copyright # SPDX-FileCopyrightText: © 2023 Romain Beaubois <refbeaubois@yahoo.com> # SPDX-License-Identifier: GPL-3.0-or-later # # @brief Script to generate...
e6c01a17944e83b0f380a391d60069181efd570d8fa6123a61a5c41b850046e6
Python
2,309
81
import os from calvados.cfg import Config, Job, Components import subprocess import numpy as np from argparse import ArgumentParser from Bio import SeqIO parser = ArgumentParser() parser.add_argument('--name',nargs='?',required=True,type=str) parser.add_argument('--gpu_id',nargs='?',required=True,type=int) parser.add_...
02521d5ae16046d7efbd95a158a3e10ae17a5f7442face85c3ab032fa42d3bf6
Python
2,310
66
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm, axes from scipy import optimize import numpy as np def fit_func(x, a, b): return (a*x+b) def plotter(matrix, dim, x, fit, outfile, outdir): num=0 plt.clf() palette = plt.get_cmap('hsv') ...
a667ab1ac1147670dcfd2624a7a6385af06c433fb8debc773db3d3c475b4e694
Python
2,310
73
from __future__ import print_function,division import numpy as np import pandas as pd import sys import os def parse_args(): import argparse parser = argparse.ArgumentParser('Script for matching predicted particles with a test particle set') parser.add_argument('path', help='path to predictions') pars...
47be8ef7b1f00c611d4fe209686338e54262fb2a1bde338e44af89c48074937b
Python
2,311
88
# A module for circular statistics import numpy as np import scipy.stats as stats def cang(X, maxx = np.pi): # -pi <= angle <= pi twopi = 2.*np.pi x = np.mod(X, twopi) if maxx >= twopi: return x if type(X) is np.ndarray: if x.ndim: x[x>maxx] -= twopi elif x > maxx: x -= twop...
7c71466b22b365a5ec7a2fb56e8375e0acc2a9e46df8c17e18219280e54b5e66
Python
2,311
73
from importlib.util import find_spec from typing import Literal from urllib.error import URLError import anndata as ad import numpy as np import pandas as pd import pytest import scipy.sparse as sp PYDESEQ2_AVAILABLE = find_spec("pydeseq2") is not None def _load_example_data(modality: Literal["raw_counts", "metadat...
a397aef489709931a6680d0064347485bf161ca623e98047fa1f872a1321ac3a
Python
2,311
68
import open_pose4 as op import os import pickle import PoseTools # import tensorflow # tensorflow.get_logger().setLevel('ERROR') # vv = [int(v) for v in tensorflow.__version__.split('.')] # if vv[0] == 1 and vv[1] > 12: # tf = tensorflow.compat.v1 # elif vv[0] == 2: # tf = tensorflow.compat.v1 # tf.disabl...