sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
15a8e21afcbb5c4990971f2ea70bae228cfd5c2332e3df37551b9c40090c5117
Python
11,221
253
import json import logging import os from pathlib import Path from unittest import TestCase from unittest.mock import patch, mock_open, MagicMock from urllib.parse import quote import pytest import NDATools from NDATools.Utils import parse_local_files, sanitize_file_path, check_read_permissions, \ sanitize_window...
700f9b4a29e34b278b61d7127488d9812e3f294971ce790e2f13f6997d20d1c1
Python
11,221
301
# -*- coding: utf-8 -*- from __future__ import annotations import os from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Union, Sequence import nltk from supar.models.const.crf.transform import Tree from supar.utils.logging import get_logger from supar.utils.tokenizer import Tokenizer from supar.util...
3a008c8815e07ac483129a066bcc44b1218174eb2baeba6d2386103f9b0bb126
Python
11,223
424
import click import numpy as np import pandas as pd import random import os from sequence import SeqDreamChallange1D from model import ( standard, simplified, ResNet1D_Classification, ResNet1D_Regression, ResidualUnit1D_BN, ResNet1D_Classification_medium, ResNet1D_Regression_medium, R...
8c7ae4051e5fa717cc22d96681bc658b9cb986718e9481c37892d9356e605771
Python
11,224
260
# -*- coding: utf-8 -*- #!/usr/bin/env python # Aplicación para comprobar diferentes parámetros de la CNN. # Se pueden modificcar los siguientesi parámetros (los valores indicados son de la configuración por defecto): import sys # Configuración base de la CNN # 0. Dialecto # 1. numCapas=2 # 2. activacionCapaSalida="so...
4f10c0077e829f553c415bd0710021ba3821bdd02cf7c072f0bf29c5de338d23
Python
11,231
259
import os import argparse import lxml.etree as ET import math import numpy as np import carla from utils import ALL_TOWNS, \ parse_annotations_file, interpolate_trajectory, scan_route_for_scenarios ID_START = 0 SAMPLING_DISTANCE = 30 PRECISION = 2 def main(args): route_id = ID_START client = ...
8cbf8239481525ed53aaa9674747a5b7f7594e210097b13acf09660630d42f92
Python
11,231
178
""" Main run function for finding synapse cluster on assembly neurons last modified: András Ecker 07.2023 """ import os import logging from tqdm import tqdm import numpy as np from assemblyfire.config import Config import assemblyfire.utils as utils from assemblyfire.assemblies import AssemblyGroup from assemblyfire....
632ad982c799f5f20a041b7f25a0ee262d8815d710d44051b99289627eaf28c2
Python
11,233
309
# 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...
32c75e3861061677cd62d9f6c86736cbd3a446a7ba7a505925717cb44dbeb505
Python
11,238
284
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch_scatter import scatter from torch_geometric.utils.num_nodes import maybe_num_nodes from torch_geometric.nn import GATConv from utils.common import Device from typing import Optional, Tuple from t...
4ea6d5da2997a7e1cf1b9b01dd4eb06314af5c5454cd296e1b08d69f6dfdb660
Python
11,246
236
options = dict( model_extensions=[ 'h2o.model.extensions.Trees', ], ) supervised_learning = False def update_param(name, param): if name == 'stopping_metric': param['values'] = ['AUTO', 'anomaly_score', 'deviance', 'logloss', 'mse', 'rmse', 'mae', 'rmsle', 'auc'...
537a7a1bae99476a25a93409d892d3416c458239553b47cc0972bfde08606497
Python
11,247
306
# Node-group asset "Animate Action" (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...
70353269c7382767c5e57677e19264fb988f9ed88797197f4386300a95ef5407
Python
11,248
257
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class GradientBlender: ''' Implements gradient blending outlined in What Makes Training Multi-modal Classification Networks Hard? https://arxiv.org/pdf/1905.12681.pdf , Facebook AI Usage: This class forms a w...
c62920f61afacfbcc8d340dccab1b63f0e315bb1b0675c5455d999cb23265e07
Python
11,257
279
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
bd6883b3486394206367f8385eccec87dee520ff4ce3f25a2d0e8c090dba5bd5
Python
11,266
318
import io import json import logging import os import re from contextlib import contextmanager from textwrap import indent, wrap from typing import Any, Dict, Iterator, List, Optional, Sequence, Union, cast from .fastjsonschema_exceptions import JsonSchemaValueException _logger = logging.getLogger(__name__) _MESSAGE...
5037f6c8bd088ce2fecbb3c304c0ee8ca991e65f4ddd1557295d6ddfcd4868dc
Python
11,267
298
# 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...
b269bef28d2304a5a73bdefff648acb7c65b7c8bffc562fe663a36dcbdc7a81a
Python
11,267
226
"""Qt UI plugin system: docks, events across threads, lifecycle, layout, failures, end-to-end plugin.""" import json import sys import types from pathlib import Path from types import SimpleNamespace import numpy as np import pandas as pd import pytest import shiboken6 from PySide6.QtCore import QCoreApplication, QEve...
f203838da3900007b2c194155ba742aa5bd307f62994d7ae3dbeaea9f1adf846
Python
11,269
448
# Node-group asset "Menu Atom 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...
f22abcff2942335f48c3df98ca74e3e3d79a522341e17637f45a4a505b6b0c25
Python
11,271
208
""" READOUT_COMPARE_D04_ARMC_STRAT.py - written 2026-09-16. Closes V-47 / D-04. WHAT THIS IS AND WHY IT IS A SEPARATE FILE. V-47 ends: *"the V-50 construction (size-stratified decile matching, 0 of 18 draws) is the cleaner one and is what should be quoted. To close this properly: re-run READOUT_COMPARE_D04_AR...
8b808630fa49490e3e9c5b3515762870c5ffbfa52c05d0cdfbdc1bd8717146b7
Python
11,272
340
# -*- coding: utf-8 -*- """ Created on Mon Sep 14 10:17:02 2020 @author: JiaLi """ import numpy as np import networkx as nx from scripts import basic_comp as bcomp # from adjactent matrix to graph def convert_from_adj2networkX(A,weighted=True): edges_ind = np.where(A>0) num_edges = len(edges_ind[0]) G =...
5a7710ff337d675d3b9ec0ddb357b6e2a73bdb608da1d95149a073ae1e303298
Python
11,275
269
#!/usr/bin/python # -*- coding:utf-8 -*- import logging import os import time import warnings import torch from torch import nn from torch import optim import numpy as np import models import datasets def apply_dropout(m): if type(m) == nn.Dropout: m.eval() class train_utils(object): def __init__(se...
f0903e8736a83eab7353072eb3bf93b84f8f8d4f97ac4c9523c4325f11b58d9e
Python
11,276
259
# Copyright (C) 2019 Computational Science Lab, UPF <http://www.compscience.org/> # Copying and distribution is allowed under AGPLv3 license # This script defines various functions and classes for generating molecular compounds from SMILES representations. # It includes SMILES decoding, filtering valid molecules, sequ...
b55de68eb57760734093dc1c653d2bbda66bd1eec72502419cffdef11a3de46b
Python
11,282
183
# 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...
dc1efb435cbf3778dbac566728ce3345ddc14211c907866764616339632da6c7
Python
11,285
214
import unittest from hed import HedTag, load_schema_version from hed.errors import DefinitionErrors, ErrorHandler, ErrorSeverity, ValidationErrors from hed.models.definition_dict import DefinitionDict from hed.models.hed_string import HedString from tests.validator.test_tag_validator_base import TestHedBase # The nam...
6e42ed6767649632c258c8b2a6982f6db1ae305fd6200785dbc85a4d6a91f303
Python
11,290
272
# -*- coding: utf-8 -*- from sklearn import base import lib.spectgr import lib.spectgrList import os import numpy as np from keras.utils import to_categorical import lib.tensores as tensores import tensorflow as tf import keras.losses as losses import keras.optimizers as optimizers from sklearn.model_selection import K...
1dd30be6a132b169b4dd393efc6adf5650117888c5f93e5723af5a678f5893fc
Python
11,294
284
from collections import Counter from pddlstream.algorithms.common import compute_complexity from pddlstream.language.constants import get_args, is_parameter, get_prefix, Fact from pddlstream.language.conversion import values_from_objects, substitute_fact, obj_from_value_expression from pddlstream.language.object impor...
703d52aa412d86d6dcab9f0db399ceadb456ddc027594b3973fcd051226d5d5f
Python
11,294
293
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 17 11:45:50 2021 @author: mpolonenko """ import numpy as np from expyfun import ExperimentController, decimals_to_binary from expyfun.visual import ProgressBar from expyfun.stimuli import TrackerDealer, TrackerUD from expyfun.io import read_wav, rea...
f890a9156e88ffcea6d032140967b0ba40b6170a51600fe949947a26b2d790ac
Python
11,296
361
import os import sys import platform import numpy as np from time import time from pyclamp.dsp.lsfunc import * from pyclamp.dsp.dtypes import * from pyclamp.gui.display import DISPLAY PLATFORM = platform.platform() CONSOLECOL = {'w':97, 'm':95, 'r':91, 'y':93, 'g':92, 'c':96, 'b':94, 'k':30, 'e':1, 'W':9...
7b0975efa3d5bbd1d221eada59e835e5ef6d99e81366d672971cfcfe025423a0
Python
11,299
338
""" Estimate T2 and S0, and optimally combine data across TEs. """ import argparse import logging import os import os.path as op import numpy as np from scipy import stats from threadpoolctl import threadpool_limits from tedana import __version__, combine, decay, io, utils from tedana.workflows.parser_utils import is...
3886adc4eae4d931fb65b6bcf9bf0d89623e7c2cb1073e54eaf7d37f325db019
Python
11,303
308
# Node group "Curve Split Splines" (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 rege...
c74996fa920fa1d24ce2bcba82b82698bae5f15669f7d92a72676705eef46180
Python
11,303
376
from typing import Any, Generic, List, Optional, TextIO, TypeVar, Union, overload from . import get_console from .console import Console from .text import Text, TextType PromptType = TypeVar("PromptType") DefaultType = TypeVar("DefaultType") class PromptError(Exception): """Exception base class for prompt relat...
8c0be1c22ffdbacc60e3a58daa810a888d128009bd057f5ce29b0d4c87424eeb
Python
11,304
225
import os import sys import argparse import copy import glob import json import pdb import numpy as np def prepare_localization_example(example, nervegram_slice_length=10000, signal_slice_length=50000, rate_in=44100, ...
4208dfbefaeb43a372ee92ac3d4e8b1a0e08bd042e7ef1e67956480f71432009
Python
11,307
256
# 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...
9fcff99f8c0e517747f43e41132711ccde209427950ef0b71a21c0a6adcfff8b
Python
11,309
264
''' author: matthias wilms ''' import numpy as np import scipy as sp import kernels import scipy.integrate as integrate import scipy.interpolate as interpolate import scipy.sparse.csgraph as csgraph from numpy import matlib def mean_error_2d_contour(gt,pred): return np.mean(np.sqrt(np.square(gt[0::2,:]-pred[0::2,...
6bba91bd15354f7ae034a76b3dfbda852b9999d19b6a7e69ff3fa64f3c9656fa
Python
11,315
345
#!/usr/bin/env python # coding: utf-8 # ### TCGA <-> CCLE mutation prediction: LASSO parameter range experiments # # Here, we're interested in: # # * Training mutation status models on data from TCGA (human tumor samples) and testing on data from CCLE (cancer cell lines), or # * Training mutation status models on da...
e5322739c75390c89fbe370795355f96128347a9d0698903177c758154219bbf
Python
11,315
312
import os import time import numpy as np import torch import torch.multiprocessing import torch.multiprocessing as mp from src import config from src.Mapper import Mapper from src.Tracker import Tracker from src.utils.datasets import get_dataset from src.utils.Logger import Logger from src.utils.Mesher import Mesher ...
503ef5df0412dcaacd0f0b9b6ab8ff457e032073c92212bf513a18dbf0c57abe
Python
11,323
377
# levenshtein.py import sys import dnaio from itertools import combinations from polyleven import levenshtein from fba.utils import open_by_suffix, get_logger logger = get_logger(logger_name=__name__) # In-memory implementation of TinyFastSS # https://github.com/fujimotos/TinyFastSS def indexkeys(word, max_dist)...
491b3f642a5706e4aab414319d059c1bcba8ee7ede87905bd27bcc3f7934d861
Python
11,328
346
from __future__ import annotations import io from unittest.mock import patch from colorama import Fore from bayes_opt import BayesianOptimization from bayes_opt.logger import ScreenLogger def target_func(**kwargs): """Simple target function for testing.""" return sum(kwargs.values()) PBOUNDS = {"p1": (0,...
dc9fa9e8e66792e8389cd158b7ec84bb62fbba86aef58e10ca0465e2798d710f
Python
11,333
368
# 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...
d17c7c10b61ed0ad213701f1b714f9855bf3c34ce34d11341b1ccbd100c60507
Python
11,340
379
# 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...
fa54e8dae5664a5b066edfb35bf528f7e5fc9ec21ed50c451481135c8f675ca9
Python
11,342
264
""" AMBIGUITY_REPRODUCIBILITY.py - written 2026-09-17. THE QUESTION. The transmitter classifier outputs a distribution over six transmitters and everyone downstream keeps the argmax. This project has spent a month on what the discarded uncertainty costs. This script asks the opposite question: is the SECOND...
2ef93190bd0cb1c81429d17c33ff15563494def54eba712cc809be36d5251e3f
Python
11,344
254
import io import json import os import unittest import numpy as np import pandas as pd from hed.errors import HedFileError from hed.models.sidecar import HedString, Sidecar from hed.models.tabular_input import TabularInput from hed.schema.hed_schema_io import load_schema_version from hed.tools.analysis.event_manager ...
5bb11d24e075283bc4bd894f087c181d61cdf5dbad575e8b8f19727b2b3b35c7
Python
11,346
336
from typing import Optional, Union, List import numpy as np import inspect from sella.peswrapper import PES, InternalPES from .stepper import get_stepper, BaseStepper, NaiveStepper from sella._constants import _LSTSQ_RCOND class _CoordinateSelectionTranspose: def __init__(self, selection): self.selecti...
941ff2f2acbc6fda91964f2470441763548ea28a627b5b0661c78525b9446ced
Python
11,349
225
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Compute the logistic weights of priors and sensory likelihood at each trial around the change points. This script gather, for each subject, trials with the same distance to a change point and compute for each distance, a logistic regression of the sensory likelihood...
14f958a3235a5d8c2daf6eb5aace3c4ba1f5d3f6cce65a3ab055b1c0feb63a98
Python
11,350
282
from .nbo_data_point import NboDataPoint from .tools import Tools from .enums.nbo_type import NboType class QmData(): """Class for storing relevant QM data.""" def __init__(self, id: str, stoichiometry: str, n_atoms: int, atomic_numbers: li...
f55a99296e890948ab3931b5aa7d4da5a1379a6963f320f151a28896a59a1d5a
Python
11,351
293
""" Generates a ListTomoParticle object from a input STAR file 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 numpy as np import scipy as sp import ...
71ca756c355ffe99641cf3c22a09a23376b9f78c35552b5afc2af4814c6cd929
Python
11,354
256
"""Error codes used in different error messages.""" from enum import IntEnum class ErrorSeverity(IntEnum): """Severity codes for errors.""" ERROR = 1 WARNING = 10 class ErrorContext: """Context this error took place in, each error potentially having multiple contexts.""" # Use this one to dis...
af7c0a9c578e7039b0c5225c543905dc10cf08ccd4dc4005e70f1ee416c6c9ab
Python
11,359
248
# -*- coding: utf-8 -*- """ Created on Thu Oct 21 15:00:46 2021 @author: CY """ import torch from torch.utils.tensorboard import SummaryWriter from typing import List, Callable, Dict import time from tqdm import tqdm from nnunet.training.ssl import eval_metrices import copy from pathlib import Path DIR...
a7692898ae213cdd163fae2c82be04d262f271d04d77ef493a0412f642ba6e6d
Python
11,365
294
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 17 11:45:50 2021 @author: mpolonenko """ import numpy as np from expyfun import ExperimentController, decimals_to_binary from expyfun.visual import ProgressBar from expyfun.stimuli import TrackerDealer, TrackerUD from expyfun.io import read_hdf5 # ...
eabf1491820f696b7b263e62ab8bf588e29107c28acb9172f85f4be658b0df34
Python
11,366
230
import argparse import random import sys from timeit import default_timer as timer import numpy as np import torch from scipy import stats from torch.utils.data import DataLoader from utils import data_setup, model, engine, utils, loss_function, data_preprocess, augmentation_utils if __name__ == "__main__": # se...
ab6a5e78869204b09473b0dc4b9d1068ac8969537e65b330267aa3dd53f1c5ab
Python
11,367
350
#!/usr/bin/env python #================================================================ # Copyright (C) 2022 Yufeng Liu (Braintell, Southeast University). All rights reserved. # # Filename : common_utils.py # Author : Yufeng Liu # Date : 2022-09-12 # Description : # #==================...
532eae0b29f74bbc2a1d907097febd33f0d3278c3644d2bcd956878858c6998b
Python
11,369
302
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu. """ import matplotlib.pyplot as plt from matplotlib import patches import os import numpy as np from fig_utils import * ccolor = [[0,1,0], [0,0,0.8]] def panel_neuron_pos(fig, grid, il, yratio, xpos0, ypos0, isort...
19a50a0edd1f39c0cedab8d82f36117b228f8f8093f4c6751be71df5b5ddb005
Python
11,370
351
from functools import partial import numpy.linalg as npla from autograd import builtins from autograd.extend import defjvp, defvjp from . import numpy_wrapper as anp from .numpy_wrapper import wrap_namespace wrap_namespace(npla.__dict__, globals()) # Store the primitive-wrapped norm for internal use; see numpy_wr...
5bb232f23ef0453fab329c6dfd97083bf3691810d43165100550467ed4d6a5ba
Python
11,370
292
import numpy as np import probayes as pb import scipy as sp import scipy.stats try: import scipy.misc comb = scipy.misc.comb except AttributeError: import scipy.special comb = scipy.special.comb import tqdm import multiprocessing import h5py from joblib import Parallel, delayed NEARLY_ZERO = 1e-300 MINIMUM_GAM...
70d5ea7ae37f9fd6997d4b86c8da1b986a09f7afe5c228fd065abf8ea8047a4a
Python
11,370
305
import os import io import re import json import tarfile from pathlib import Path from collections import OrderedDict import requests from requests.adapters import HTTPAdapter, Retry TCGA_API_BASEURL = 'https://api.gdc.cancer.gov' TCGA_CASE_ENDPOINT = '/'.join([TCGA_API_BASEURL, 'cases']) TCGA_PROJECT_ENDPOINT = '/'.j...
ae592ebe5e61e53a4a1108881489dc3eb26200f76216303af045d7d259c9b637
Python
11,370
281
"""Test the find_noisy_channels module.""" import numpy as np import pytest from numpy.random import RandomState from pyprep.find_noisy_channels import NoisyChannels from pyprep.removeTrend import removeTrend # Set a fixed random seed for reproducible test results RNG = RandomState(30) # Define some fixtures and u...
5a147f6f26d871a7c89f7fd9f89c278f259969851a5e7dd8e36bfb721025f68a
Python
11,371
289
# -*- coding: utf-8 -*- import numpy as np import tensorflow as tf from six.moves import xrange from .. import _logging as logging from .core import * __all__ = [ 'transformer', 'batch_transformer', 'SpatialTransformer2dAffineLayer', ] def transformer(U, theta, out_size, name='SpatialTransformer2dAffin...
e5e15ee0b7b996f6a43ebf7fc58d3519ee13413f7af2b70797da4fa2349f73c8
Python
11,374
285
import torch import torch.nn.functional as F from prettytable import PrettyTable import numpy as np import random from sklearn import metrics import wandb from tqdm import tqdm from utils import * import wandb import pickle from sklearn.metrics import precision_recall_curve def normalized_laplacian(A): """ Inp...
0f0f6b4057674a04e15c7b3de898d09dfaac6f9761639d1ffec1394587a12ea6
Python
11,376
299
import logging from typing import Any, Dict, List, Tuple, Union import pytorch_lightning as pl import torch import torch.nn as nn import torchmetrics from torch.utils.data import DataLoader from torchmetrics import MetricCollection _EVALUATE_OUTPUT = List[Dict[str, float]] # 1 dict per DataLoader _log = logging.get...
4fb94a57de2b79b2137e5f2b7500e62907f84d28d2e62ebedc70c257348ca725
Python
11,377
256
import math import numpy as np from pybullet_tools.utils import clip, INF, \ waypoints_from_path, adjust_path, get_difference, get_pairs, get_max_velocities, get_duration_fn, wait_if_gui #ARM_SPEED = 0.15*np.pi # radians / sec ARM_SPEED = 0.2 # percent DEFAULT_SPEED_FRACTION = 0.3 ###############################...
df0eeea076d2ff642d1abd029b1e898b54e813666b77c75b40d050738c4ca166
Python
11,380
323
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter import matplotlib.pyplot as plt import operator from functools import reduce from functools import partial from timeit import default_timer from utilities3 import * import scipy fr...
7563d0b1720779be10a2c6d7af426c3c2a6b860e403df5e0b097e2cb02f0dbcd
Python
11,384
310
import warnings from typing import Dict, Generator, List, Tuple import numpy as onp import meep as mp def is_leaf_node(partition: mp.BinaryPartition) -> bool: """Returns True if the partition has no children. Args: partition: the BinaryPartition node Returns: A boolean indicating whether p...
1878b45a1249d79b2c83af47733d3efa64c67511ad4269650a225b73e5947e4a
Python
11,387
282
""" Unsupervised and deterministic classification of membrane-bound particles Input: - The STAR file with the particles to classify - Classification parameters Output: - A set of STAR files with the new classes - 2D rotational averaged around membrane normal exemplars and inter-p...
2493dd0992046b08097c338fc432a7ea3efe9af18f4e1f4b4d411bfe2ac6f60c
Python
11,393
320
import argparse from datetime import datetime import random import shutil import numpy as np import os import time from utils import * from params import * import sys from datetime import date import pickle import train_inductive from trials.hyperparam_config import config import pickle import optuna import copy from u...
2f5d5bb0736dbea25fcd93c5f6fe555ded1f9db27c00b21ae7ee392bd7a0c312
Python
11,393
292
""" Unsupervised and deterministic classification test for PCA-KMEAS algorithm Input: - The STAR file with the particles to classify - Ground truth mask - Classification parameters Output: - A set of STAR files with the new classes - 2D rotational averaged around memb...
66d575b1e5a11d45ab9d10e3261976d4e0d69ec4cf20e98a4bbfab1101094e3a
Python
11,393
282
import numpy as np from pandas import DataFrame from scipy.stats import f from numpy.typing import NDArray def sumsq_total(df_long: DataFrame, values: str) -> NDArray: """ Calculate the total sum of squares for a given column in a DataFrame. The total sum of squares is the sum of the squared differences b...
e1bd46fbc1a21a0fb5e884159908829875ee421ac081687e58ce50bcf29d3787
Python
11,396
313
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
5e1ad484d60fe1a210312c04df8f8ae68b689c1b2e4e1ce2ce4d78dcf2646943
Python
11,398
205
"""SIGN_FROM_FUNCTION.py 2026-09-25. Pre-registration: 04-NOTES/PREREG-2026-09-25d-SIGN-FROM-FUNCTION.md (sha e348b2c4...) Is the sign of an antennal-lobe local neuron (LN) type readable from projection-neuron (PN) responses to real odours? Hidden truth = laboratory prior at type level; recording = glomerular PN spik...
9de74c2c7497735dc38ab1af02016e7465d01c1448b18a10a378b91d3abe008c
Python
11,399
295
from __future__ import division import logging import numpy as np import matplotlib.pyplot as plt import pandas as pd from IterativeMethod import iterativeTCCT """ Created on Sat Nov 17 19:48:14 2018 @author: Hannah Choi """ """ This code genereates shuffled versions of the CT connectitivity data and c...
45e5519575ef02300773a9eea59ff52a79f4df61acfe376203349988d2296cf7
Python
11,401
299
# 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...
7e575bf0b209f7df707c56a253fa3f6bfd1e0e02cb107241ee1b1f8cea9b7969
Python
11,401
323
# 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...
5e2cb7beff918becf045048707d4e2df76c5737c084cecd098ae3ea19b4e3518
Python
11,402
260
import numpy as np import scipy as sp import kernels import scipy.integrate as integrate import scipy.interpolate as interpolate import scipy.sparse.csgraph as csgraph from numpy import matlib def mean_error_2d_contour(gt,pred): return np.mean(np.sqrt(np.square(gt[0::2,:]-pred[0::2,:])+np.square(gt[1::2,:]-pred[1:...
a82cf80c530d6646fa4ad914315459c74312d839733bf6da4bd6f2657cdf8f5b
Python
11,404
306
""" This module, 'bands.py', contains recipes for performing bands and fermi surface calculations using the bands.x and fs.x binaries from Quantum ESPRESSO via the quacc library. """ from __future__ import annotations from typing import TYPE_CHECKING from ase.dft.kpoints import bandpath from pymatgen.io.ase import A...
b3a3c3a93af60361f959010b2caa5fa8f4512d83f86470e9a73a022188b94774
Python
11,406
278
""" Download Allen Mouse Brain CCF **2017** reference files at one or more resolutions. This script intentionally targets the publicly-released *CCF 2017* (a.k.a. Allen CCFv3) atlas - the latest revision Allen distributes through their open data archive. Any newer internal revision (sometimes referred to as "CC...
4d7c225993cc01335703f8255507863c61a05fe57a822e789aace08eb87bf041
Python
11,408
351
# # 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,...
79858a7af05e08d75be6197b5a0ff4a69da4c968e59cd00c5f830cdee557455a
Python
11,409
288
#!/usr/bin/env python3 # Runs spin permutation with for within and between network dispersion analyses with lmer controling for total surface area ### Define parameters surface_name='fsa5' parcellation_name='schaefer_400' n_rot=1000 ### Load required packages import os import sys import numpy as np import pandas ...
4b8a45a4001a1a2e2df0c9dd8c6ab58357a9a1d0c56b19536b4219ebb6fed159
Python
11,416
336
#!/usr/bin/env python # This script computes the Gabor filter response in a simulation # Uses multiprocessing # Make sure current directory is added in the PATH variable import h5py import math import multiprocessing from multiprocessing import Pool, RawArray import numpy as np import os os.environ['TF_CPP_MIN_LOG_LE...
0104e0989b1e03d7adf62d17d925f10b6ec2e9eba7817422a39bb362f8f067dc
Python
11,419
262
import pandas as pd import numpy as np import os import pysam chr_list = ['chr1', 'chr10', 'chr11', 'chr12', 'chr13', 'chr14', 'chr15', 'chr16', 'chr17', 'chr18', 'chr19', 'chr2', 'chr20', 'chr21', 'chr22', 'chr3', 'chr4', 'chr5', 'chr6', 'chr7', 'chr8', 'chr9', 'chrX'] chrom_size = pd.read_c...
4ffb378f0fd00198b2c064180da749f863bc453fe8ed9f44c471bc935e2e343b
Python
11,419
296
from typing import Optional, Tuple, Mapping import pandas as pd import math import subprocess import pickle import sys import shutil from pathlib import Path from argparse import ArgumentParser from Bio.SeqUtils import seq1 from Bio.PDB import PDBParser from Bio.PDB.Structure import Structure from pymol import cmd, st...
fcce4f90d1b73946b3dacd6f919791906d36b51158b29b8b62b11a37a61009c1
Python
11,420
311
from __future__ import print_function import os from collections import Counter from pddlstream.language.constants import is_plan from pddlstream.utils import INF, read_pickle, ensure_dir, write_pickle, get_python_version LOAD_STATISTICS = True SAVE_STATISTICS = True DATA_DIR = 'statistics/py{:d}/' DEFAULT_SEARCH_...
ec8afeeda48ae413df5cc2f3f6fa6796b4331150dfaa5aebe1e60ca2c2fb0777
Python
11,423
325
"""Qt tests for AtlasSelectorDialog. Uses the same qapp / settings-isolation pattern as test_ccf_boundary_viewer_qt.py.""" import pytest @pytest.fixture def qapp(): from PySide6.QtWidgets import QApplication app = QApplication.instance() or QApplication([]) yield app def _force_status...
1672cea2921072b62f556ffda5d68efc89c9209b2ffea39e024e1cb505b3e2d4
Python
11,433
239
import numpy as np import pandas as pd import xgboost as xgb 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 combination, ...
99a23a41469439425649c0063833bde1c6e4aad9943815ac0b43713051849154
Python
11,433
337
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
bc0167f3b72bf61f8575bc17024e90b06d75bb7ab563365f0bdb1b5bf78ed745
Python
11,434
313
""" Script for segmenting the filaments in a tomogram without assuming any geometric constrain Input: - Original tomogram (density map) - Mask tomogram (0-fg, otherwise-bg) Output: - vtkPolyData with the filaments - Segmentation tomogram """ __author__ = 'Antonio Martinez-Sanch...
934788b504865ef687c3b97669f40992869e3fc341d3418f7216c483cd10396f
Python
11,437
371
# 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...
64b124f342754178eba101d5b45a36f29e8268c897d3152b2d0c8fa7ec90f737
Python
11,441
145
# C. Cocuzza, 2021 # Function to compute category selectivity: quantifying the selective responsiveness of a # given set of nodes (vertices, functional ROIs, etc) to a semantic category. # EX: the regions comprising the FFA to images of faces. NOTE: this may also be applicable # to non-semantic-category conditions. ...
a82290a74c845c2fa5c4f4764dc263492a1f445c7f6245ad9b09e044a79e9108
Python
11,444
275
""" Tests that correspondence.py has no module-level imports of config or io_utils. This ensures the Laplacian refinement code can be extracted as a standalone package without pulling in ANSI color constants or NIfTI loader utilities. """ import ast import os import numpy as np import pytest CORRESPOND...
de56a6ebf08270a05144aee05249c3441255962c71eaffbd4620d4325d913d6d
Python
11,444
254
import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import warnings warnings.simplefilter("ignore") import time import tqdm import util import pprint import random import torch import numpy as np import pandas as pd from datetime import datetime from torch.optim import lr_sc...
b9aaa6686490653426793c75db519a2e1b3e0b7566f0f9a35f0d29b274dca219
Python
11,446
335
# -*- coding: utf-8 -*- import itertools import os import platform import subprocess import sys from lab.experiment import ARGPARSER from lab.steps import Step from lab import tools from downward.experiment import FastDownwardExperiment from downward.reports.absolute import AbsoluteReport from downward.reports.compa...
ef3457b1220bfd3354a921455d83d468f31be4151b171263a358dc7f0cc9ec36
Python
11,447
267
# Script to run CCA on the data # Using the meet package https://github.com/neurophysics/meet.git to run the CCA import os import mne import numpy as np from meet import spatfilt from scipy.io import loadmat from Functions.get_channels import get_channels from Functions.IsopotentialFunctions_CbarLabel import mrmr_esg...
82aca25564475d9ea40743f69c5ff124249473464cc431b43d104368903e5117
Python
11,450
291
# 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...
9269ef5b464af080de0f9eb65f687103e6a3da2cd51b067c375add894485e5c2
Python
11,450
314
'''This module handles task-dependent operations (A) and noises (n) to simulate a measurement y=Ax+n.''' from abc import ABC, abstractmethod import torch from ConditionalNeuralField.cnf.inference_function import pass_through_model_batch from ConditionalNeuralField.cnf.utils.normalize import Normalizer_ts from Conditio...
cbe7de6ebc9e1485e87af21aa071c0be80736de8f7069cc8a7868e6c2788507c
Python
11,451
249
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from Temporal_components import WindowTransformerBlock, STFeatureExtractionLayer from Graph_learning_representations_module import SpatialCell, BGraphConvolutionalNetwork from Graph_learning_module import AdaptiveGraphStructureL...
17efa37d441cb57a3ce6b3ea846be2d293e6c76173efe678f11bcacc2d21d5bc
Python
11,453
302
#!/usr/bin/env python3 # ****************************************** # # SHARC Program Suite # # Copyright (c) 2023 University of Vienna # # This file is part of SHARC. # # SHARC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
4d9ba3360031f2216404c9ae11bb649e9356218d02b42e513db0b006a63d7cd9
Python
11,454
435
#!/usr/bin/env python # coding: utf-8 # ## Preprocessing and Datahandling # In[1]: import sys sys.path.append("../scripts") # In[2]: import os import pandas as pd import Utils_00 as utils import Paths as paths from monai.data import DataLoader, PersistentDataset from monai.transforms import ( Compose, ...
a19cec86065dd3e48fcc921b375fec7b4c2798bd94b06fd496eaf60e058dce3e
Python
11,457
264
import os import copy from collections import defaultdict import numpy as np import networkx as nx from tqdm import tqdm from rdkit import Chem import torch from torch.utils import data as torch_data from torch_scatter import scatter_max from torchdrug import data, utils from torchdrug.core import Registry as R @R...
489d87db5db8143aaa5e8d567f7c972ab5b32c0fa554b4ed0780fb5a662394cf
Python
11,458
323
""" Utility functions for visualizing SMART meshes using pyvista. """ import dolfin try: from ufl_legacy import vertex except ImportError: from ufl import vertex from typing import Tuple import numpy.typing as npt import numpy as np import functools import pathlib from typing import Optional import warnings im...
b9725bf9330004da1f60e60567fbc55b80ea36963ae68605368db44cac89b415
Python
11,458
313
import torch from torch import nn from torchvision.transforms import ToTensor from torch.optim import * from models import * from torchvision import datasets, transforms from torch.utils.data import DataLoader import os from utils import Logger, AverageMeter, accuracy import time from PIDAO_SI import PIDAccOptimizer_...
29fbaa1e426a987503176add4207d6f26df543ae4d83290fc8cb787dcf01a628
Python
11,459
317
import os import csv import numpy as np import scipy.io as sio import torch.nn.functional as F import torch.nn.functional from matplotlib import pyplot as plt from sklearn.feature_selection import RFE from sklearn.linear_model import RidgeClassifier from sklearn.feature_selection import RFE from nilearn import connecto...
7d787f2ed12330048758f81be905eccc75ef45495bf877b2acfe55c8d533f20a
Python
11,462
360
import typing import bpy from bpy.props import ( BoolProperty, EnumProperty, FloatProperty, FloatVectorProperty, IntProperty, StringProperty, ) from ..blender.utils import viewport_tag_redraw from ..entities.base import MolecularEntity from .base import BaseAnnotation from .utils import get_all_...
e456776c61d13acc3730d78f418b71cc2ddc8a4fbab16c11a52c3e4cdb91954d
Python
11,464
393
# 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...
6f44bd60f6e6b4bb242f3370852523c06d88dc758a6f6959e059d7004cc8352c
Python
11,467
335
# -*- coding: utf-8 -*- import itertools import os import platform import subprocess import sys from lab.experiment import ARGPARSER from lab.steps import Step from lab import tools from downward.experiment import FastDownwardExperiment from downward.reports.absolute import AbsoluteReport from downward.reports.compa...