sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1ddf5f63b0bd9833058b5e4f58b769296426d430eaa66ee8c764cc9734707f19 | Python | 4,304 | 136 | """Preprocessing: blink masking, glitch removal, drift correction, low-pass."""
from __future__ import annotations
import numpy as np
from msfeature.preprocess import (
correct_drift,
lowpass,
mark_blinks,
preprocess_trial,
remove_glitches,
)
def test_mark_blinks_flags_nan_only_by_default():
... |
50a8a54fd94a1fcfc3d101ea6f3c5d06a72d26df84ef22308d63f5e62124ba01 | Python | 4,304 | 146 | from __future__ import print_function
import sys
import os
import argparse
try:
from Tkinter import Tk
from Tkinter import IntVar
from Tkinter import Checkbutton
from Tkinter import Button
from Tkinter import Label
from Tkinter import mainloop
from Tkinter import W
from tkFileDialog im... |
fbb5c427ba1302f871cb7db41a9269de641d681735a2ebf4b5b527d633629aec | Python | 4,304 | 122 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Scores sequences based on a given structure.
#
# usage:
# score_log_likelihoods.py [-h] [--outpath OUTPATH] [--chain CHAIN] pdbfile seqfile... |
c7177b44cab05caa204af642722bdbb26cbdaa86f9bd95e70ddd3d590aaa31be | Python | 4,305 | 140 | #!/usr/bin/env python
"""
Create long-format neural distance dataframes from the full
subject-by-subject correlation-distance matrices for each movie and
Schaefer parcel.
Each output CSV contains the neural distance value for each ordered
pair of subjects.
"""
import pandas as pd
from pathlib import Path
# --------... |
93dfc11bad54b81a266492c48dafe5c82354f6bf8983ecdc1a2aea4585fd104b | Python | 4,306 | 122 | """Tests for regtools.ccf_boundary_editor.session."""
import numpy as np
import pytest
def _make_state(slice_index, dragged):
from regtools.ccf_boundary_editor.contour_edit import (
ContourComponent,
SliceEditState,
)
src = np.array([[1.0, 1.0], [2.0, 2.0], [3.0, 3.0]])
... |
5731fd14425d226f088c18948ce8f77fa0fe7d4d16c30270a4230cd16179eb52 | Python | 4,307 | 123 | import os
from glob import glob
import click
import scipy.sparse as sp_sparse
# print messages go to stderr
# output file goes to stdout (when using "-" as output file)
# that way you can pipe the output file e.g. into bedtools
def echo(*args, **kwargs):
click.echo(*args, **kwargs, err=True)
return
def sec... |
d0b95bb6e5f2db38229971452cde6b824402769aa3c34d3b40fbddf3f70a9625 | Python | 4,307 | 103 | import importlib.util
from pathlib import Path
from typing import List
import tensorflow as tf
"""
Inside of the models directory there are ptm directories, and inside of the ptm directories there are organism directories.
models -> ptm -> organism -> h5 files
"""
class TestModelDirectory:
@classmethod
def s... |
2f58d41c50021600002fa64698366225c41af832c885ba4351f8ee112d1897cb | Python | 4,308 | 131 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 13 2019
@author: jmagraner
"""
# %%
import autograd.numpy as np
def generate_output(params,target,specs):
### Define LDS as a recurrent neural network ###
def LDSmodel(params):
def update_hiddens(input, hiddens):... |
4a6be2e366e306bd134c1c0af6e024675c798a33718035f46416a5e661eeb6e2 | Python | 4,308 | 140 | #!/usr/bin/env python
"""
Create long-format neural distance dataframes from the upper-triangle
subject-by-subject correlation-distance matrices for each movie and
Schaefer parcel.
Each output CSV contains the neural distance value for each unique
subject pair.
"""
import pandas as pd
from pathlib import Path
# ---... |
b9805244f6263273fd8aa04ad902880b052e3cbc0464c382354274dbd2cd8763 | Python | 4,309 | 126 | import os
import json
import numpy as np
import nibabel as nib
from nilearn.masking import apply_mask
from nilearn.input_data import NiftiMasker
from nilearn.image import resample_img
from argparse import ArgumentParser
def hdr_to_Nifti(files, path_files=''):
"""
Convert hdr files to Nifti-like obje... |
10efe86d1712a8aea0887ec0f3bd753d66cc8582c8bb730681c8e7a31e2210b6 | Python | 4,313 | 107 | # Plot a bar graph showing (num_spikes_detected/num_spikes) for different numbers of spikes in a sample (1, 2, 3, 4 spikes)
from src.model import ModelSpikeSorter
from src.data import RecordingCrossVal
from src.utils import random_seed
from src.plot import set_dpi
import numpy as np
import pandas as pd
import matplotl... |
ea64b6c3dbacf463191226763608159edd0f9217b4917f38eff78c07fe5db94f | Python | 4,314 | 114 | # 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... |
5b0b7d4029e67d4b3b28dbdfb3429386d83d60082d242c17ecdb8bdee4a4d2c8 | Python | 4,315 | 92 | import torch.nn as nn
from types import SimpleNamespace
# from coral_pytorch.layers import CoralLayer
from src.models.components.resnetblock import ResNetBlock
from src.models.components.preactresnetblock import PreActResNetBlock
resnet_blocks_by_name = {
"ResNetBlock": ResNetBlock,
"PreActResNetBlock": PreAct... |
7adbed2320367b7d80319510c1148068cb711fff5635fb0fdd2d21159e38f91f | Python | 4,315 | 107 | """Regression guard for the Allen CCF annotation download.
The annotation NRRD stores *label* codes (structure IDs up to ~614 million),
not intensities. An earlier version of ``_nrrd_to_nifti`` saved
``img.get_fdata()`` (float64), which ``save_nifti`` downcasts to float32.
float32 has a 24-bit mantissa and canno... |
64e8b8c837454461d0a53fcdc6ec41ecdd385f379c39a778da39bb6e3733c158 | Python | 4,317 | 103 | import numpy as np
import mdtraj as md
import pandas as pd
from argparse import ArgumentParser
import itertools
import logging
parser = ArgumentParser()
parser.add_argument('--dirname',nargs='?',const='',type=str,required=True)
parser.add_argument('--ionic',nargs='?',const='',type=int,required=True)
parser.add_argumen... |
68545609e117d64518b30cf9a16673c30f76a3ba3f599ab285749e5a0a980090 | Python | 4,317 | 92 | """
Train a CCNN Model on the SEED Dataset
======================================
In this tutorial, we'll demonstrate how you can leverage TorchEEG to train a Continuous Convolutional Neural Network (CCNN) on the SEED dataset for emotion classification. Let's navigate through this process step-by-step, covering everyt... |
8020d39387ee535554de121933c3ced7dd0e4a7eed7cb71b8e09239e4ab4c1e7 | Python | 4,317 | 120 | """Tests for save_atomic atomicity and robustness."""
import os
import glob
import numpy as np
import pytest
def _write_bytes(data: bytes):
"""Return a writer callable that writes *data* to the given path."""
def writer(path):
with open(path, "wb") as f:
f.write(data)
... |
a05fc1de5935391cdd4b3a253dc7960c6884bd21a4060f432869bc89a4eb0961 | Python | 4,318 | 121 | # Node-group asset "Group Pick" (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
fr... |
0c7e99bec83146b0fd056bf843c4fe9ca4b773d98d0fc9ae578c65bad5e14ee0 | Python | 4,320 | 162 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : learner_dataset.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 01/16/2019
#
# Distributed under terms of the MIT license.
import random
from pyccg.chart import WeightedCCGChartParser, printCCGDerivation
from pyccg.model import Model
from... |
5b73ad6231c81f279dc717ae6999f9380790d40b586334cc2a20ef3524c6cd49 | Python | 4,321 | 143 | import unittest
from elasticai.creator_plugins.grouped_filter import FilterParameters
from elasticai.creator_plugins.grouped_filter.src.index_generators import (
GroupedFilterIndexGenerator,
)
def to_tuple(xs):
if hasattr(xs, "__iter__"):
return tuple(to_tuple(x) for x in xs)
return xs
class Un... |
7b0bb40c1a31c9bcee1d7544e1c179038ba7d1e515b550e13c090d17e9542ee6 | Python | 4,321 | 173 | # 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... |
ef6be19edfe2a41e8c56f9344ca3a5419a36a1d6f41aa40d22c036f8040a4964 | Python | 4,322 | 162 | # 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... |
7540ce56c2740158f150245c9949ec8ecffa3c346d99a278ce65a44c6faaecd0 | Python | 4,323 | 116 | # MIT License
# Copyright (c) 2023 Qiyun Wu
# 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... |
bb41ca081260683f40287371f5be74ac7cf7b435cda919d078c81c519e6a275f | Python | 4,323 | 119 | # -*- coding: utf-8 -*-
#
# syncopy.preproc resampling tests
#
import numpy as np
import scipy.signal as sci_sig
import matplotlib.pyplot as ppl
from syncopy.preproc import resampling, firws
from syncopy.specest import mtmfft
def test_resample():
"""
Tests both the non-trivial resampling method
with non... |
2a15ab7d263c15812039c0008a0f9522303c7cdd9d0a7920e551883684ca8e2d | Python | 4,324 | 121 | import numpy as np
import pytest
from molecularnodes import viewpoint
def _cluster(spacing=0.1):
grid = np.arange(-1, 2) * spacing
return np.array(np.meshgrid(grid, grid, grid)).reshape(3, -1).T
def _shell_with_hole(hole=(-1.0, 0.0, 0.0), radius=1.2, n=4000, cap_degrees=30):
points = viewpoint.fibonacci... |
d9787b5c2323d3c41468c5e621f6e98d52fb8bb28577aff4d70f640fa52904d6 | Python | 4,324 | 130 | """Pure CCF-to-brain alignment math.
The viewer's ``_apply_alignment_to_ccf`` method delegates the actual
resampling here. Keeping it pure (no ``self``, no Qt, no GUI state)
makes the transform unit-testable in isolation and reusable from
headless scripts that want to bake the same alignment into a CCF
annotatio... |
030a9e810906d297f59d861a2c2af02fa6f953c06cfac731edca7f2e5994cf8b | Python | 4,325 | 66 | """validate_brian2_official_2026-09-30.py (a check, not a test). Does SHIU783_SIM reproduce Shiu et al.'s own Brian2 code
(02-DATA/shiu-repo/model.py, unmodified) on their own v783 file? Protocol: Shiu's 21 sugar GRNs (their example list,
ACUCAR in the rival audit as well) at 150 Hz, 1 s.
usage: python validate_brian2_... |
5099d81e82152f34707ebe5cce08d16eced6d8f72b5be4b08beffbc13eb38375 | Python | 4,325 | 150 | # Node-group asset "Primitive Gimbal" (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 impor... |
b19db875ec70ea788d242e2317cfd67bff6c674a33af90199d7647864d8f4f42 | Python | 4,325 | 127 | #!/usr/bin/env python
# encoding: utf-8
# Written by Minh Nguyen and CBIG under MIT license:
# https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
from __future__ import print_function
import argparse
import pickle
import numpy as np
import torch
import cbig.Nguyen2020.misc as misc
def predict_subject(model... |
b2b61041056229ea40eb2b39bc735d6e0d1f20351f8a84fc7e7f1b4d8dbf614d | Python | 4,326 | 153 | from dolfin import *
import numpy as np
import matplotlib.pyplot as plt
import argparse
import os
from IPython import embed
import sys
set_log_level(30)
#os.system("dijitso clean")
# Leser kommmandolinjeargumenter
parser = argparse.ArgumentParser()
parser.add_argument("-T","--Time", type=float, default=3000,
... |
273085a50d9ea85181327a636f80a31106f5a4930fc52fbe3682bd3ffecdb21f | Python | 4,327 | 126 | """Cluster embeddings via K-means, selecting K by silhouette score.
Tries four combinations of (dim_threshold, normalize) preprocessing and
saves the resulting community labels to a single .npz file.
"""
import sys
import numpy as np
import pandas as pd
from sklearn import cluster
from sklearn.metrics import silhoue... |
b84794384054ae114e0605e2015764707d46360251a65dbe18f36f3a4bee491c | Python | 4,327 | 114 | # Classes used in esser network model
# Class for a point neuron with integrate-and-fire dynamics from Esser 2005
# Class to generate Poisson distributed ISIs for afferents
from neuron import h
import numpy as np
class cell_esser:
def __init__(self, celltype, ID, loc):
# Store parameters
... |
e1bc2f2110674b2d5dfc2a797d95a7c3b2086e2a41efea9ed395ceefc9f84dc9 | Python | 4,328 | 168 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import glob
from math import ceil
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pancancer_evaluation.config as cfg
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().r... |
a54b6d859b35a321fb3eeebb0d95473378d3d7247af218e1b5db249404599b7d | Python | 4,329 | 119 | import datetime
from shutil import copyfile
import random
import torch
import torch.backends.cudnn as cudnn
import os
import numpy as np
from torch.nn import Module
import torch.distributed as dist
def get_time_log_dir(*args, **kwargs):
time_stamp = datetime.datetime.now()
arg_str = '_'.join([str(a) for a in a... |
c74ebc7ecef916361d271b21833a21bb4c57a44330c56558e414b7113eaeb7e5 | Python | 4,329 | 119 | r"""
TOSICA (Transformer for One-Stop Interpretable Cell-type Annotation)
"""
try:
from importlib.metadata import version
except ModuleNotFoundError:
from pkg_resources import get_distribution
version = lambda name: get_distribution(name).version
from . import train, pre, TOSICA_model
from .train import f... |
569940599da6a39b65f77805571b854deb8c31363b6ef1304d6eeb4293d2181c | Python | 4,330 | 113 | from typing import TYPE_CHECKING
import numpy as np
from scipy.sparse import vstack as sp_vstack
from sklearn.base import ClassifierMixin
from sklearn.linear_model import LogisticRegression
from pertpy._types import CSBase
if TYPE_CHECKING:
from numpy.typing import NDArray
class PerturbationComparison:
"""... |
817a7d9559f594325f431f145342c506e4266a68e26155359da97e2f44831eab | Python | 4,330 | 112 | #!/usr/bin/env python
# Purpose: Create a .csv file of network-averaged AI values using MSHBM parc.
# Input: ind_parcellation output from Kong2019 pipeline and ai output
# Output: 1 .csv file with network-averaged AI values
#
# Note: Users may need to run 'which python' and paste the correct path following the shebang ... |
8972815998d6d451796d74709a5d8782e6bc96f5d8cf26e3a8b88bfa4336377b | Python | 4,330 | 119 | # 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... |
b19ba4b13d9cc260aeb6cc39979bf04122f33b8773e6602188d031470144e8b6 | Python | 4,330 | 135 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Documentation:
This file reformats NEST output in a convinient way.
'''
import os
import numpy as np
from glob import glob
from hybridLFPy import helpers
import tarfile
from pathlib import Path
from mpi4py import MPI
###################################
# Initializati... |
f31f76218d64fa06321e6ebf0e5845b5462e121cfea1f76b2c4f29f697fc77c2 | Python | 4,331 | 118 | # Node-group asset "Integer Run" (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
f... |
38eae9f9d9dcaf660278cdf6b8840b317d24ce5c5f9d2fb0ba0210aac85b5c5b | Python | 4,332 | 144 | # 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 applicable law or agreed to in writing, software
# distributed under th... |
80111b77521947e2ec768a9c11635340aa0686ec89ed0c949dd71d3994ad9cfc | Python | 4,332 | 76 | """BRIAN2_KEYSTONE.py 2026-10-02. Pre-registration: 04-NOTES/PREREG-2026-10-02-KEYSTONE-ROBUST.md (part R1)
The keystone in the authors' own code: Shiu et al.'s Brian2 model.py (02-DATA/shiu-repo, unmodified), whole brain, their
v783 file with only signs changed in a copy of the connectivity table: F4 (laboratory pri... |
c742dd44c31303553e9fae6aa3f7232dc945cad61cd973b793c07935de805a44 | Python | 4,332 | 138 | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Iterable, Union
import torch
import torch.autograd as autograd
from supar.structs.semiring import (CrossEntropySemiring, EntropySemiring,
KLDivergenceSemiring, KMaxSemiring,
... |
4743693e82c2d39b5da249409ef37b12ca92cffb93f9f7a5cc1257b8c0cc07dc | Python | 4,334 | 132 | '''
Documentation:
'''
import matplotlib.pyplot as plt
# global flag for black and white figures
bw = False
class params():
def __init__(self,
textsize=6,
titlesize=7,):
# label for merged spike files
self.pop_spike_file_label = ['population_spikes-th.gdf',
... |
aa0ff31a0b99f85ccea02f68dcbe226602d46ffd6629b21d425d3a68330c8d8c | Python | 4,335 | 134 | # 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... |
ac5e2cad714dd9d47f19000e79745e68747ffc8f6c64c63708eb7196b6d85758 | Python | 4,335 | 125 | import random
import unittest
import torch.nn as nn
import torch
from torch.utils.data import Dataset
from torch.utils.data.dataloader import DataLoader
from torcheeg.trainers import DDPMTrainer, CDDPMTrainer
from torcheeg.models import BUNet, BCUNet
class DummyDataset(Dataset):
def __init__(self, length: int = ... |
ee907fd17046173faab0147e73b73434d1d2258f8d1bc8da76436d603bdc3d98 | Python | 4,335 | 75 | from wikibaseintegrator import wbi_functions
#List all biomedical relations
biorel = ["P9985", "P10193", "P10228", "P10243", "P351", "P486", "P645",
"P644", "P662", "P681", "P680", "P682", "P684", "P703", "P702",
"P1349", "P1531", "P1582", "P1911", "P1910", "P1913", "P1912",
"P1915"... |
6005168622f776b02d1494309f0f884c24accc66ae368de30bdb99e5cf9442d4 | Python | 4,336 | 104 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
664527f565615eecf8dd265b585cbad73c952ab08349a46ecec8bfb6e4cb8e61 | Python | 4,337 | 69 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
from common_setup import IssueConfig, IssueExperiment
def main(revisions=None):
suite = suites.suite_optimal_with_ipc11()
configs = {
IssueConfig('rl-b50k', ['--search', 'astar(merge_and_... |
cc58e7a550aac01e02dda1e5073db38d32f2597991620b8c121c502352c64954 | Python | 4,337 | 69 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
from common_setup import IssueConfig, IssueExperiment
def main(revisions=None):
suite = suites.suite_optimal_with_ipc11()
configs = {
IssueConfig('rl-b50k', ['--search', 'astar(merge_and_... |
0ba31ec2066c89d3f261242bac447ef718f9f423d854f455d9a0c9417b044abb | Python | 4,338 | 83 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2023 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : config.py
# Author : Yufeng Liu
# Date : 2023-01-19
# Description :
#
#========================... |
64b4d846a2093f3a01b1f0d984ef3ba782126b90c396e6f3455bcbd2bbe93bc3 | Python | 4,338 | 151 | import json
from collections import Counter
import math
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch import Generator
from pathlib import Path
CODES: dict[str, int] = {
"A": 0,
"T": 3,
"G": 1,
... |
8fa98c4c3911dbd13e4127460f87b3886f541f0b51a5a36808d7360ada179713 | Python | 4,338 | 124 | from __future__ import annotations
import os.path
import re
from wheel.cli import WheelError
from wheel.wheelfile import WheelFile
DIST_INFO_RE = re.compile(r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$")
BUILD_NUM_RE = re.compile(rb"Build: (\d\w*)$")
def pack(directory: str, dest_dir: str, build_number... |
95a0e9b2e04397a9327f2c29f5e30c03db3ce237c7d932499febe62f4186f74c | Python | 4,338 | 134 | """A single place for constructing and exposing the main parser
"""
import os
import subprocess
import sys
from typing import List, Optional, Tuple
from pip._internal.build_env import get_runnable_pip
from pip._internal.cli import cmdoptions
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHel... |
5cd2936dda90774762559150effd0b0a6efa82f4fd6a38ac45b44250472f42da | Python | 4,339 | 115 | import torch
from utils.output_region_utils import split_regions_2d, split_regions_2d_edge, split_regions_2d_edge_abs, split_regions_2d_half
from utils.complex_utils import complex_utils as Z
import torch.nn.functional as F
class ResizeLayer(torch.nn.Module):
def __init__(self,config):
super().__ini... |
c4d538f730d3d795daca6bee749e8360c46d3ef595829a47bb552bfb6073a790 | Python | 4,339 | 140 | import os
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
filepath = "/mnt/d/repositories/rodent-tracking/test_data/all_data26.csv"
#filepath = "~/repositories/sussex_neuro/rodent-tracking/test_data/all_data_olenna2020-02-24T18_07_54.csv"
fid = pd.read_csv(filepath)
# p... |
d799280a61740d0783f3e936f0ba6de97ff3250525cc4860a3fe80eaecb8ee57 | Python | 4,339 | 137 | from typing import cast, List, Optional, TYPE_CHECKING, Union
from ._spinners import SPINNERS
from .measure import Measurement
from .table import Table
from .text import Text
if TYPE_CHECKING:
from .console import Console, ConsoleOptions, RenderResult, RenderableType
from .style import StyleType
class Spinn... |
3d623793d54e15932a5c1ae96745e69c96efd24af0794c2d85b311f890daad3e | Python | 4,340 | 116 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
import os, tempfile, shutil
from urllib.request import urlopen
from tqdm import tqdm
from pathlib import Path
def bin1d(X, bin_size, axis=0):
""" mean bin over axis of data with bin bin_si... |
6ff68217645ee08c1990933a1edb71368ef3a0177d125323624231a17de48b63 | Python | 4,340 | 105 | '''
Description:
Run PRESCIENT on extrapolating multiple timepoints.
Author:
Jiaqi Zhang <jiaqi_zhang2@brown.edu>
'''
import torch
import numpy as np
from datetime import datetime
from model_validation.extrapolation.utils import loadSCData, tunedPRESCIENTPars
from baseline.prescient_model.process_data import ... |
5f2dffafbef83be6d200ed4571f9739d3fdcb0d1294a587d992a7b93ff4cb84a | Python | 4,341 | 69 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
from common_setup import IssueConfig, IssueExperiment
def main(revisions=None):
suite = suites.suite_optimal_with_ipc11()
configs = {
#IssueConfig('rl-b50k', ['--search', 'astar(merge_and... |
0a9b80a7ba0671e07f44a286016a7e84cd2431e2d0bea5ea5a76943e63001cd4 | Python | 4,342 | 69 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
from common_setup import IssueConfig, IssueExperiment
def main(revisions=None):
suite = suites.suite_optimal_with_ipc11()
configs = {
IssueConfig('rl-b50k', ['--search', 'astar(merge_and_... |
a7db0ff14e0511f6dde794a106ae09e1ef4a696293d98fd07ea2fa38f9d0e881 | Python | 4,342 | 69 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
from common_setup import IssueConfig, IssueExperiment
def main(revisions=None):
suite = suites.suite_optimal_with_ipc11()
configs = {
IssueConfig('rl-b50k', ['--search', 'astar(merge_and_... |
abb84cf8ac63c573d89cbfa51965a8f6b2111f6c2b6b13881d75bfbaa024be72 | Python | 4,342 | 106 | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning) # Ignore all FutureWarning warnings that might flood the console log
warnings.simplefilter(action='ignore', category=DeprecationWarning) # Ignore all DeprecationWarning warnings that might flood the console log
import os
import json
o... |
193d14b33f89ea5c10b440c10a86dc884e5758271d47f1dc4125ac2c235775fb | Python | 4,343 | 119 | # 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... |
e1dd5e8e433735d6cd1a05c597bb9f37520d28af0e5c0dc27c959e1b762c4526 | Python | 4,343 | 139 | import torch
import random
import subprocess
import numpy as np
from tqdm import tqdm
from scipy import stats
import anndata
import scanpy as sc
from utils.utils import Utils
from options.option import options
from models.scperb_model import scperb
from scipy import sparse
from dataloader.scperbDataset import customDat... |
815ee3f940290e80bd91f4894e585272a0f00073a1b4d335237a59ad3abeb0f7 | Python | 4,344 | 97 | import math
import unittest
from fractions import Fraction
import numpy as np
import pandas as pd
from hed.models import ColumnSource, ListColumnSource, TabularInput, distinct_values
from hed.models.column_source import is_missing
class TestDistinctValues(unittest.TestCase):
def test_maps_each_distinct_text_to_... |
af01a489181bd6fbf914fb510749cf0f3118466de7466bd82fefef7ad066ad82 | Python | 4,345 | 125 | import logging
import ase.db
import numpy as np
import spainn
from spainn.properties import SPAINN
from spainn.asetools.aseutils import DatabaseUtils
log = logging.getLogger(__name__)
__all__ = ["ConvertDB"]
class ConvertDB(DatabaseUtils):
"""
Convert your old SchNarc database to a SPaiNN compatible db,
... |
135c390e14e884529065cd39dc9d291be8acf8dd04d39037f8580f610c52dc4f | Python | 4,346 | 161 | import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
from help_funcs import load_exp_variables
from classification_pipelines import classify_waveforms
# ----- #
# Selection of classification hyperparameters.
data = "zhou2016" # "zhou2016", "2014004", "2014001", "munichmi"... |
5abc3348b57352db87ec14bc70cb9f6141018ac694b4e9ea287ed00e5711f288 | Python | 4,346 | 109 |
import pytest
import os
import numpy as np
import scipy
from cobolt.utils import SingleData, MultiData, MultiomicDataset
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
def load_test_data():
ja = SingleData.from_file(
path=os.path.join(THIS_DIR, "test_data", "joint_a"),
dataset_name="joint... |
66ebf10ba30248a3234e4b0633a69beed81a04fc5f4f22c054ff52872c486804 | Python | 4,346 | 110 | # SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import matplotlib
import numpy as np
import seaborn as sns
from scipy import stats
import pandas as pd
# Figure settings and color schemes
titlesize=8
labelsize=6
ticksize=6
conversion=2.54
marker_size=2
linewid... |
7f3cd154cf62b469310d8a4ea1fc80a27df540f68f8c549cc27d155739ff2777 | Python | 4,347 | 111 | import argparse
from loader import BioDataset
from dataloader import DataLoaderAE
from util import NegativeEdge
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
import numpy as np
from model import GNN
import pandas as pd
criterion = nn.BCEWithLog... |
a5ede4ca1edd5e4d4e3cb1574932c515d2a0b1f46d7cdd82c04cf2d83f0b85a6 | Python | 4,347 | 96 | ########################################################################################################
# Read in the correlation matrices for each subject we previously generated
# Get the average correlation per subject and condition
# Save to excel table
#############################################################... |
1e5ec697ae8fea968d2a784eb267d5b683de25a6c281aef53e95df1545e4fe83 | Python | 4,348 | 100 | import torch
from torch import nn
from torch.nn import functional as F
from torchdrug import core, layers
from torchdrug.layers import functional
from torchdrug.core import Registry as R
@R.register("models.ProteinBERT")
class ProteinBERT(nn.Module, core.Configurable):
"""
Protein BERT proposed in `Evaluatin... |
b7fa287509c880ea1ef4d153c889a10cc3586966ba4230e803154724da6b2bfa | Python | 4,349 | 113 | import json
import pandas as pd
import os
import matplotlib.pyplot as plt
import numpy as np
from typing import Tuple, Iterable
from src.analyze.utils import init_mpl
from src.analyze.performance_measures import PerformanceMeasures
from constants import (ABSOLUTE_ERROR,
ERR_LEVEL_TOTAL_SCORE,
... |
07ab11c7f399edbb6c7c17f9afd8ba5ac9279774023288d03c16caa85b8fa88b | Python | 4,350 | 149 | import glob
import sys
import numpy as np
import pandas as pd
import axelrod as axl
def get_normalised_rank(row):
return row["Rank"] / (row["size"] - 1)
def get_parameters_data_frame(directory):
"""
A function for reading in the parameters data frame.
"""
csv_files = glob.glob("{}parameters_*-... |
ba867bccfd85c73f5e67a5141326901fb8dc30f82b850e8f2e5e125370cb6e58 | Python | 4,350 | 124 | # Node-group asset "Relative Index" (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... |
f185c229edf53efdf004aa72af8679ae1cbf276476643016a3ca3e95a7c269d6 | Python | 4,350 | 125 | import numpy as np
from scipy.stats import ttest_ind
try:
from numba import njit
use_numba = True
except ImportError:
use_numba = False
def _binarize(W):
"""
Binarizes a matrix
Parameters
----------
W : (N, N) array_like
Matrix to be binarized
Returns
-------
binari... |
2be799bc0735bf5945d181d2998bee8341f64fcd2cfa5c676498710c38b51e8a | Python | 4,352 | 108 | #! /usr/bin/env python3
import os
import subprocess
import logging
#import APT_interface
import pickle
import numpy as np
import torch
from argparse import Namespace
class cd :
"""Context manager for changing the current working directory, and automagically changing back when done"""
def __init__(self, path)... |
ec1ba174e7ef1e0e2d5320c8a5c16b8fcfdce9fa032e9023c54e3a1c98133f74 | Python | 4,353 | 83 | from pddlstream.algorithms.downward import get_problem, task_from_domain_problem
from pddlstream.algorithms.instantiate_task import sas_from_pddl
from pddlstream.algorithms.scheduling.recover_streams import get_achieving_streams, extract_stream_plan
from pddlstream.algorithms.scheduling.stream_action import get_stream_... |
098d1a40171a2cfafe96b4340656273840c587cf1826fd22ae8291c52d8751e1 | Python | 4,354 | 112 | # Lmod_run.py
# Created by Ayesh Madushanka
# Created on: May 16 2024
import os
import sys
import shutil
import pandas as pd
from qm40_dataset_for_ml import utils as ut
from qm40_dataset_for_ml import gaussian_info_extractor
class RunLmodCalc:
"""
1. Class to Run Local vibrational mode calculations.
2.... |
0f8ba044692528dc287a84904f9609d1e1ec564bc25682fd85157df704c3b816 | Python | 4,354 | 136 | # Node-group asset "Sample Mix Vector" (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_CHEC... |
0c78af972f27bc1552a3b573200b41ed75c71e58d0a4211ef793bb1418026f10 | Python | 4,355 | 151 | import pandas as pd
import numpy as np
import click
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
@click.command(help="Plot cohort expression data for selected genes as boxplots.")
@click.option(
"--cohort",
type=click.File("r"),
help="Matrix file with gene-sample TPM expression... |
6ffd07157add6a1771dd4655bef87f90a111b235ad5ce95fbdfa70f63797a0b2 | Python | 4,355 | 115 | """
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 wx
import os,sys,pydoc
import deeplabcut
media... |
7acd1c09eccab29ceb890fb757cf21df2273c73d36f1eb95dac53033ad6413ea | Python | 4,355 | 141 | # 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.
import re
from typing import FrozenSet, NewType, Tuple, Union, cast
from .tags import Tag, parse_tag
from .version import InvalidVersion, ... |
66e6d8d1cada7933db920d49d05fdad32e08ac87bbe0a5d827f77c54819cb6fa | Python | 4,356 | 99 | """Python plugins against a real (tiny random-weight) engine: API, results, cancellation, failures."""
import json
from pathlib import Path
from threading import Event
import pytest
from conftest import assert_no_hooks
from liquidaion_fly.plugins import load_plugin, run_plugin
EXAMPLES = Path(__file__).resolve().par... |
336f989d3853879365cbf124ef87ec6d6098f5df8403d4e9c83eb09f53faf7a6 | Python | 4,357 | 96 | import argparse
import os
import time
import numpy as np
import torch
import cv2
from tqdm import tqdm
from torch.utils.data import DataLoader
from src import config
from src.tools.viz import SLAMFrontend
from src.utils.datasets import get_dataset
if __name__ == '__main__':
parser = argparse.ArgumentParser(
... |
9a1510caff2d1bd0ff5718204101220ec8a490ae33deab885c6eb067b9e725bc | Python | 4,357 | 109 | import os
import numpy as np
import random
import shutil
import unittest
from torcheeg import transforms
from torcheeg.datasets import NumpyDataset
class TestNumpyDataset(unittest.TestCase):
def setUp(self):
if os.path.exists('./tmp_out/'):
shutil.rmtree('./tmp_out/')
os.mkdir('./tmp... |
a47a96d4a0f79f5aa094dcc4756234bf47821cd8e5382064f4b02dbb8897273c | Python | 4,357 | 124 | import torch
from torch import nn
from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule
from elasticai.creator.nn.integer.quant_utils import (
AsymmetricSignedQParams,
GlobalMinMaxObserver,
)
from elasticai.creator.nn.integer.sepconv1dbn import DepthConv1d, PointConv1dBN
from elast... |
5fb3e0716ad94bcf1020f9069c62e5b8ca583d51ba36ca83254e6929e9749af6 | Python | 4,360 | 97 | """Sparse leaky rate dynamics; not a biophysical simulation."""
from __future__ import annotations
import hashlib
import json
from dataclasses import asdict, dataclass
from pathlib import Path
import numpy as np
from scipy import sparse
@dataclass(frozen=True)
class Dynamics:
dt: float = 0.2
tau: float = 1.... |
708b12b47712a878e245b28a683a8870fde31afd27954fbc077b733d9fc183bc | Python | 4,360 | 135 | # Node-group asset "Index Distance" (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... |
b03a61d8bb337f72078d66c17c5d99f87d86df97914f39cc2ef728262e4546cd | Python | 4,360 | 126 | # -*- coding: utf-8 -*-
from __future__ import print_function
import itertools
import os
import os.path
import re
from . import returncodes
_PLAN_INFO_REGEX = re.compile(r"; cost = (\d+) \((unit cost|general cost)\)\n")
def _read_last_line(filename):
line = None
with open(filename) as input_file:
... |
0db784abc4593c4393ac6debce675116d17f091f2823e015a2020f6dc109bb66 | Python | 4,361 | 127 | from typing import Dict, Tuple
import schnetpack.properties as structure
import torch
from schnetpack.data import AtomsLoader
from tqdm import tqdm
__all__ = ["calculate_multistats"]
def calculate_multistats(
dataloader: AtomsLoader,
divide_by_atoms: Dict[str, bool],
atomref: Dict[str, torch.... |
7cc2f1e1fb35a70e256bac2b4e40d1704fd26170e3f45d42d5b62cc7719c882c | Python | 4,361 | 147 | #!/usr/bin/python
from __future__ import print_function
import time
import usb.core
import usb.util
try:
user_input = raw_input
except NameError:
user_input = input
# Unknown
# vendor id = 0x46d, product id=0xc215
# Yizish
# Doesn't currently work
# Onyx (5lb)
# vendor id = 0x1446, product id=0x6a73
# Pr... |
00b5f5b133798e0d238ed88c031124ed7df68fc47b3d48045c58e12b0969d715 | Python | 4,362 | 124 | # 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... |
0b7d5619ae6ab3af3001ac75604aa06d9fc90709e2c9e79bfcabbe6956e061d1 | Python | 4,362 | 115 | import os, sys, shutil
import numpy as np
import pandas as pd
from PIL import Image
import gdown, tarfile
def extract_tar(tar_file, dest_path, delete = True):
tar = tarfile.open(tar_file)
tar.extractall(dest_path)
tar.close()
os.remove(tar_file)
def iterative_subset(df, index, cat_list):
out_dict ... |
10dd8bc2578e245cdb9618a0db8142579abe9db3af980f0010787adacb093af9 | Python | 4,362 | 130 | # Node-group asset "Dihedral Phi" (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,... |
daa2ed4a1926f822c4021df11ac5b8eb0d27924c0b6ecc878360c7263905a4b3 | Python | 4,363 | 149 | # Node group ".MN_pivot_peptide" (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 regene... |
1f7277bc67008b73eaf66abe2a7963ea737fdab7b1d5076683cc9bf53ca3c4e9 | Python | 4,364 | 76 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from downward import suites
from lab.reports import Attribute, gm
import common_setup
def main(revisions=None):
SUITE = suites.suite_optimal_with_ipc11()
B_CONFIGS = {
'rl-b50k': ['--search', 'astar(merge_and_shrink(merge_strategy=merge_linear(variable_... |
46a9d438638e7444461fca28350c800b5f09f091de6f395092e03a1da8f11813 | Python | 4,364 | 87 | """
Script to extract values of the corpus callosumfor each subject
Create new dataframe with the values, and ICV.
Probably there is a tool to extract them (fs)
"""
import numpy as np
import os
import click
import subprocess
import numpy as np
import datetime
import pandas as pd
@click.command(help="Run over the ex... |
a4625add10f8c07b5f6e34954db19d49dda30e496facac08b816a631b864f889 | Python | 4,364 | 166 | '''
Fourier analysis module
'''
import numpy as np
from collections import deque
class aswift():
'''
Alpha sliding windowed infinite fourier transform (aSWIFT). The aSWIFT represents the fourier
transform at t=n as a function of the transform at t=n-1. The aSWIFT should be used
whenever the window ove... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.