sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b04332dedaa6e59b7c77feb526f26d8a91fbb6b155dba31af8e027bfbddc1bb5
Python
12,873
273
""" Downstream task: ClinTox: Qualitative data of drugs approved by the FDA and those that have failed clinical trials for toxicity reasons Dataset source: DeepChem """ import os, sys, argparse, time import json from tqdm import tqdm from rdkit import Chem import deepchem as dc import torch import torch.nn ...
3cfd0e3fa076be221108ce37b2101d4a011077cf0389f4cfe76f73dacee64d9a
Python
12,875
330
#!/usr/bin/env python from collections import Counter from itertools import combinations import numpy as np import networkx as nx from irescue.misc import get_ranges, getlen, writerr, run_shell_cmd from irescue.network import build_substr_idx, gen_ec_pairs from irescue.em import run_em import gzip import os class Equ...
cdf534b1a86509826c91c649395e0743743703133a99fbdaad4fe3d7fe51028a
Python
12,875
313
""" 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-...
7d33655c8fa8e185e13bf2f9e5acafec04fdb2d84e2e4691d0bb3e200e85a326
Python
12,878
334
#!/usr/bin/env python3 """Compute segmentation metrics (Dice, HD95, volume, instance count) between ground-truth and predicted masks, without a specialized third-party metrics package (no medpy, MONAI, SimpleITK, or seg-metrics) -- just numpy/scipy/nibabel. Ground truth is expected to be binary (a single "tumor" class...
2210fd46fb6317ecc62d9bb4d595750e405fef54e4cb5435d33f31e783d99caa
Python
12,879
334
# -*- coding: utf-8 -*- from __future__ import annotations import os from typing import Iterable, Optional, Union import torch from supar.utils.common import CACHE from supar.utils.fn import download from supar.utils.logging import progress_bar from torch.distributions.utils import lazy_property class Embedding(ob...
1690c316f1bfed361b29ade59720498bef287886b503794ccb88d01d2c2f6789
Python
12,883
310
""" Pre-processing for star_graph_batch.py of un-oriented membranes from TomoSegMemTV output Input: - STAR file with 3 columns: + _rlnMicrographName: tomogram original + _rlnImageName: TomoSegMemTV density map output + _psSegImage: (optional) binary mask to foc...
c20cc70e57e1bac79832c237481c6892a1bdde56082e8aae0870ae0e6568153e
Python
12,883
314
# Import libraries import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import Dataset, DataLoader import torch.nn.functional as F import matplotlib.pyplot as plt import os import pickle import numpy as np from sklearn import metrics from sklearn.mode...
a6e2071ea9a99127f5161bad977203286a5d064790afb5cc9c35ec8f9debf292
Python
12,884
299
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 31 15:56:34 2023 @author: daltonm """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib import pickle import dill import os import glob import math import re import seaborn as sns from scipy.ndimage import med...
afb0bf6a6142280ce4256697c91dafe40869a6a19f1b52cb8bfdf112447c9ea1
Python
12,884
350
from atom3d.filters import filters import os import torch import numpy as np import pandas as pd import random import torch import torch_geometric as tg # import e3nn.point.data_helpers as dh from transformers import BertTokenizer, BertForMaskedLM import os from eudockscore.utils.interface import get_pair_interface_...
af927e58ac20548bde1b20eabd4305f8e2b1705ce049b860753ac5e66947cb13
Python
12,885
196
import argparse import subprocess import requests import tarfile import tempfile import pandas as pd import numpy as np from functools import partial from pathlib import Path from tqdm import tqdm import multiprocessing as mp from fix_pdb import fix_pdb MAX_DDG_STD = 1 FOLD2PDBS = [['1AO7_ABC_DE', '1B3S_A_D', '1E50...
ce82791301c020212c2d19eedaa757c79dea420f7be9c5713eb13d50690895be
Python
12,886
356
""" Generate the "Color matplotlib" node from matplotlib's colormaps. uv run docs/dev/colormap_node.py uv run -m nodebpy.assets build && uv run -m nodebpy.assets dump Writes ``molecularnodes/nodes/geometry/color_matplotlib.py`` with the ramp data inline; build + dump turns it into the literal tree source that...
ad4022b95f3b74a35dc9d1f28eedaa897485d652e2d716f9c9637a2c404ae8b2
Python
12,888
288
# -*- coding: utf-8 -*- import time import numpy as np import six import tensorflow as tf from tfsnippet.scaffold import TrainLoop from tfsnippet.shortcuts import VarScopeObject from tfsnippet.utils import (reopen_variable_scope, get_default_session_or_error, e...
7d986dd9f7173048fb11b09381d0339f5d36c6b74e9c506dcaa0dfcdc33d8e0d
Python
12,889
369
import os import torch from utils.lr_scheduler import WarmupMultiStepLR from config import * import datetime import torch.distributed as dist from datasets.operators import result_compute, normalize_exp from func_timeout import func_timeout import random import gc def save_checkpoint(state, is_best, dump_path=None): ...
c207779e2e7fd88a7021396ac6998f736e405e669ec9d149718dbd617112992e
Python
12,892
350
from atom3d.filters import filters import os import torch import numpy as np import pandas as pd import random import torch import torch_geometric as tg # import e3nn.point.data_helpers as dh from transformers import BertTokenizer, BertForMaskedLM import os from eudockscore.utils.interface import get_pair_interface_...
062ed1d596412e7a5a5a149ac5854ecb2c27e86df01a592c81b00d630119cdbb
Python
12,897
301
import os import shutil from multiprocessing import Manager from typing import Any, Dict from joblib import Parallel, delayed from torch.utils.data import Dataset from tqdm import tqdm from torcheeg.io import EEGSignalIO, MetaInfoIO MAX_QUEUE_SIZE = 1024 class MockLock(): def __enter__(self): pass ...
6a8368e0bf26502f1850d9d709beba3ee72258c676545a00438aa45ebcedf16f
Python
12,899
386
""" SimpleICPOptimization class. """ from __future__ import ( annotations, ) from dataclasses import dataclass, fields from typing import List, Optional, Tuple import lmfit import numpy as np from . import corrpts, utils class SimpleICPOptimization: """ Class for setting up and solve least squares ...
a8181ca24d1b679d11d7bf4e93fd114cbe494336144844a84392f32d307bb9f4
Python
12,899
273
""" Downstream task: ToxCast: Toxicology data for a large library of compounds based on in vitro high-throughput screening, including experiments on over 600 tasks Dataset source: DeepChem """ import os, sys, argparse, time import json from tqdm import tqdm from rdkit import Chem import deepchem as dc import...
131f1bff371eeccf030f97a48723bc138c3708b222d5a5f02a790632127be854
Python
12,900
473
#!/usr/bin/env python # coding: utf-8 # ## Download and preprocess drug response data from GDSC # # * Drug responses come from processed data in [Sharifi-Noghabi et al. 2019](https://doi.org/10.1093/bioinformatics/btz318) # * Cell lines are binarized into resistant/sensitive for each drug as described in [Iorio et al...
12acffe1a4cdebfd9f44150fe1c5bf7d11888a3f8d98fae21382449f0fcf99cb
Python
12,901
377
import hashlib import numpy as np import re import tifffile from typing import List from merlin.util import dataportal # The following code is adopted from github.com/ZhuangLab/storm-analysis and # is subject to the following license: # # The MIT License # # Copyright (c) 2013 Zhuang Lab, Harvard University # # Perm...
eac90bea751c01d43d2198808c5e01319639b05ca1984e7b06261957f18a9f88
Python
12,902
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...
7eedaabb7d800c7209cfafbabbc887ddfb604148f8c1345e811b1081c2221bd2
Python
12,903
319
import numpy as np import pandas as pd from data_loader import mapping_DK_vEK from data_loader.voneconomokoskinas import VonEconomoKoskinas from data_loader.ratio_exc_to_inh import ratio_exc_to_inh # TODO __repr__(self) class NeuronNumbers(): """ Provides neuron numbers. Parameters -...
d687d8ed85edb993a294bd411e122c05f61362c5a4202814cf808e1ca7f97e88
Python
12,905
288
from itertools import chain import numpy as np from scipy.sparse import csr_matrix from scipy.spatial import KDTree from ..utils.misc import atom_number2name from ..utils.supercell import minimum_supercell from .matao import PairsInfo def neighbors_csr(iat1: np.ndarray, iat2: np.ndarray, iorb2, n_nodes_uc, n_nodes_s...
edd6460121e89d93f4d33decbb4678fca03b605a179889aef0b78bec9ebf7443
Python
12,912
332
# 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...
0c01a851209abaf770560a0eb206dde6b35a01a8e2e28d735db3461e8d5ac759
Python
12,915
283
# set QT_API environment variable import os os.environ["QT_API"] = "pyqt5" import qtpy # qt libraries from qtpy.QtCore import * from qtpy.QtWidgets import * from qtpy.QtGui import * import control.utils as utils from control._def import * from control.core import * import control.tracking as tracking from queue imp...
2b209a291ca2ffe0fa563b7dafdc47cc1c3828572c631e5c97d752846d9cb584
Python
12,917
362
# # 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,...
1fa87f7b9b250c9789f195cfa02af0dd65b8fa08297ff97434cde7c2d507dac7
Python
12,918
340
# 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...
2e1461e1c52c4932abab5b561b87fbc08aca5a21a847921776c72132cf753caa
Python
12,921
266
import numpy as np from scipy.special import expit as sigmoid from typing import Optional class NeuralMassModel: """ Refactored code for running the neural mass simulation from: Cole MW, Ito T, Schultz D, Mill R, Chen R, Cocuzza C (2019). "Task activations produce spurious but systematic inflation ...
dc6274ed31d0a5d1ad21260c92938a9dce431921060683183593e9ff604f9e17
Python
12,938
310
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import pandas as pd pd.options.mode.chained_assignment = None import pyabf import sys import os import datetime from scipy.signal import find_peaks from scipy.signal import peak_widths from scipy import optimize from...
eee1fd56de4839985ee048b335d761599258b9f5d6f2ebd81d3e924835254c3b
Python
12,939
230
# A python script for managing the pre-requisites and steps involved in running TrAnnoScope pipeline. from snakemake.utils import min_version import yaml import os import sys import argparse import subprocess import logging # Set minimum Snakemake version min_version('6.0') # Configure logging logging.basicConfig(le...
580e3ecfb5a813c0d944519715f7fc8e75a51c8c441c51b9e8d7a3d2121e7de6
Python
12,943
326
from matplotlib.cm import get_cmap from IPython import embed import sys import matplotlib.pyplot as plt import numpy as np from clean_data import clean_velocity_data import os import matplotlib regions = ["parenchyma", "grey_matter", "white_matter", "cingulum", "amygdala", "hippocampus"] region_names = ["parenchyma", ...
1789d00186b87cf70c5ce46e6797ce71e8bc4e4ed4508baca7cba140ad620e2c
Python
12,945
312
"""Tests for regtools.atlas.contours functions. Many of these were untested per audit; this file fills the gap. Covers: load_parcellation_indices, get_default_target_region_ids, build_parcellation_label_map, identify_contour_regions, find_closest_correspondences, find_ordered_correspondences. """ import numpy...
8a7509f800db289f6f65d77c39cb0e537cc7350bdeb3c83744c67bb1657118d6
Python
12,948
283
import random import numpy as np from collections import defaultdict from dimensions.common import BOWLS from dimensions.bowls.dimensions import BOWL, BOWL_PROPERTIES from learn_tools.collectors.common import INFEASIBLE, get_contained_beads, fill_with_beads, InitialRanges, \ create_table_bodies, randomize_dynamic...
3940cadfe7e612545308b95d54cd5772a136e66a10b6f8c525b9c9085786f6c2
Python
12,949
382
import os import sys import pdb import numpy as np import pandas as pd import matplotlib.pyplot as plt import util_figures import util def make_plot_kell_like_recognition( ax, df, key_task='word', restrict_background_condition=None, restrict_snr=[-9, -6, -3, 0, 3, np.inf], ...
c3bf0aceaaae7a9f6af293240c33d223e7161f468ca0cc70e5a583e6c2c6d666
Python
12,950
302
import os import shutil from multiprocessing import Manager from typing import Any, Dict from joblib import Parallel, delayed from torch.utils.data import Dataset from tqdm import tqdm from torcheeg.io import EEGSignalIO, MetaInfoIO MAX_QUEUE_SIZE = 1024 class MockLock(): def __enter__(self): pass ...
d49c5c8702b39310529fb47fa02135da806edde56ec74573771a2598869ddb83
Python
12,950
400
from . import idnadata import bisect import unicodedata import re from typing import Union, Optional from .intranges import intranges_contain _virama_combining_class = 9 _alabel_prefix = b'xn--' _unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]') class IDNAError(UnicodeError): """ Base exception for all I...
4bc7ec7f29ef0a322dcecb51f3829fa1bc10598474cbeed913fb6c53bbcdeced
Python
12,951
321
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter class ChannelAttention(nn.Module): def __init__(self, in_channelsnel, ratio=2): super(ChannelAttention, self).__init__() self.max_pool...
f5d09aec970259706b7c652cbfb673bea9be32b7fbc9a2ba702e71473c778aa8
Python
12,951
357
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVe...
9ee31ef6ae8c181ea6f408460f02fe578df636e9d7b3236a2e198e2cda433610
Python
12,954
292
"""Poisson-Gaussian mixture model for gRNA assignment. Implements the model of ``crispat.ga_poisson_gauss`` (Velten group, https://github.com/velten-group/crispat). For every guide, the log2 of its non-zero UMI counts is modelled as a mixture of a continuous Poisson background and a Gaussian on-target component with p...
55217d51f3a4b5ae61f7b9ada0c20d385611e0a0ed35c63c4aaebf8b90d7c8be
Python
12,965
358
# -*- coding: utf-8 -*- import itertools import os import platform import sys from lab.environments import LocalEnvironment, MaiaEnvironment from lab.experiment import ARGPARSER from lab.steps import Step from downward.experiments import DownwardExperiment, _get_rev_nick from downward.checkouts import Translator, Pr...
765f239612b88145010e3e385e3d44845d059cf4b5ae04b828a1418b1b3a5ddf
Python
12,966
265
import torch import torch.nn.functional as F from .dcs import DCS_multi_lay_resolution from .attention import Gate_Attention class Stream1(torch.nn.Module): def __init__( self, input_channels: int = 1, kernel_size: int = 3, embedding_dim: int = 128, dcs_num_layers: int = 3...
9c7dab8ca9ba2976831794dc7dfc074fe0e97fa104311b8008ece9d29ca30c25
Python
12,966
300
# OWNER : SUBINOY ADHIKARI # EMAIL : subinoyadhikari@tifrh.res.in import sys import os import pickle import numpy as np import tensorflow as tf tf.compat.v1.disable_eager_execution() from tensorflow.keras import Model from tensorflow.keras import backend as K from tensorflow.keras.optimizers import Adam fro...
7f90cbd4cd45bf1ae90be5f050ec5cc160ec14bf9c09239f8392202ae7a98078
Python
12,967
375
"""Utility functions for dealing with slabs.""" from __future__ import annotations import logging from copy import deepcopy from typing import TYPE_CHECKING import numpy as np from pymatgen.analysis.adsorption import AdsorbateSiteFinder from pymatgen.core.structure import Structure from pymatgen.core.surface import ...
9de4eeeeaec3051d25aa1a5a8e76ece45baa25afb91f44742bda065bce0e54e5
Python
12,968
389
# 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...
42ce196db0f4e28d681dfeb996d5ec1a0f8993a5c886c842e93675bfd2aa9314
Python
12,970
331
# Copyright 2021 DeepMind Technologies Limited # # 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 agr...
e95997af0895775d143fb61bbb9f6cc6778e4ea8db9620e38f6b8ccfa89a26d4
Python
12,971
378
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 24 23:36:06 2018 @author: Carlos A Ariza """ import base64 import numpy as np import os from urllib.parse import quote as urlquote import dash from PIL import Image, ImageOps from flask import Flask, send_from_directory from tflite_pred import tflit...
a90c8f36a5ade3978c8a2bebc716a0ad6db2adc0ec16474e8856546e303f2b66
Python
12,974
422
import numpy as np import numba from ...utils import model_utils as mu def timeIntegration(params): """Sets up the parameters for time integration :param params: Parameter dictionary of the model :type params: dict :return: Integrated activity variables of the model :rtype: (numpy.ndarray,) ...
f56c9b05729f96dd430b3ae4d2a2dee7da7f1cf344bffa4903c6069e0acf34a6
Python
12,975
342
"""""" """ 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...
44eb496b15085dd2886ac4f9d51f0168223f901260bd9acf819dec66c7c4869c
Python
12,980
349
#!/bin/env python3 ''' Create flowchart for PDL topology paper introducing Feynman diagrams. ''' import numpy as np import matplotlib.pyplot as plt import ithildin as ith import yaml import sys import pdlfeynman as fy import zeus from matplotlib.colors import ListedColormap, BoundaryNorm from matplotlib.ticker import N...
1ee436c74965c0b326d22b115541b347ca7ec2842af9d879a55d2eeb3738e9ce
Python
12,984
324
## # \file linear_operators.py # \brief Implementation of linear operations associated with the physical # slice acquisition model. # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date October 2017 # Import libraries import itk import numpy as np import pysitk.simple_itk_helper as sitkh ...
4b41baef8af2d68c8c928fc37aa2c5e148b6692b41c046af9a1e199807d0eeaa
Python
12,985
346
#!/usr/bin/env python import sys, os import logging VERSION = "version 1.4 (20140115)" # all is a keyword since Python 2.7 try: all except: def all(iterable): for element in iterable: if not element: return False return True # convenient functions def myopen(fn...
68a225244c6f080ef677bb5a3c58a0071927fb9b8b9c44db24042e007602660e
Python
12,988
358
# -*- coding: utf-8 -*- # # Test Syncopy's parsers for consistency # # Builtin/3rd party package imports import os import platform import tempfile import pytest import numpy as np # Local imports from syncopy.shared.parsers import ( io_parser, scalar_parser, array_parser, filename_par...
3fd24688ae45bc5d87f41008a6f775388e7027792c280aa24fdc6f0e06c39049
Python
12,991
329
"""Custom pyqtgraph graphics items + Qt widgets for the CCF boundary editor. These are intentionally self-contained - no dependency on the viewer module - so they can be unit-tested or re-used independently: * :class:`BrushCurveItem` - a draggable polyline contour with a Wendland C² radius falloff (the soft-r...
86bdeeeae69a6a0a81fa3c262894567ce591b0fda401497b8323ef392e4fb74f
Python
12,997
271
import torch import torch.nn.functional as F import numpy as np import ABIDEParser as Reader import argparse import random from torch_geometric.data import Data from sklearn.model_selection import StratifiedKFold from scipy.spatial import distance from model_RGAT import RGAT from sklearn.metrics import roc_au...
8e57147f7fa4b91d91bedd9e2587e57638a97379ba8604d7fd28cc326e95a1c5
Python
13,001
312
import argparse import random import time from sklearn.svm import LinearSVC import numpy as np from sklearn.model_selection import StratifiedKFold, train_test_split from sklearn.metrics import accuracy_score, cohen_kappa_score, f1_score, precision_score, recall_score, confusion_matrix import os import joblib import h5p...
c70ec631602e6ac785b7204c15e4e0ba4940fce289ac8d53c1ed3d4b3d893829
Python
13,001
355
import numpy as np import pytest from SurvivalEVAL.nonparametric_estimator.single_event import ( CopulaGraphic, KaplanMeier, KaplanMeierArea, NelsonAalen, TurnbullEstimator, ) @pytest.mark.parametrize( "estimator_class, kwargs", [ (KaplanMeier, {}), (NelsonAalen, {}), ...
d737380b16773a7e52c4272cb67aba1f502009b2ae59d293303480bf956ea4b4
Python
13,001
387
# 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...
98ed019097c7e171a4bf579bd9f268873c2d20b555d4fc0ff54fdc00e7616960
Python
13,011
397
from __future__ import annotations import Levenshtein import numpy as np from deepdiff import DeepDiff from google.protobuf import json_format from ord_schema import reaction_pb2 from pydantic import BaseModel from .base import MessageType, DeltaType, CompoundLeafType from ..utils import parse_deepdiff, flatten, find...
0b152e5b218a665955cd67e88e3d9f4e7d8805558d54c92c01fc5a71bd9b1e42
Python
13,013
399
import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d from numba import jit # @jit() def lifac( time: np.ndarray, stimulus: np.ndarray, taum=0.01, tref=0.003, noisedv=0.01, vreset=0.0, vthresh=1.0, taua=0.1, alpha=0.05, noiseda=0.0, rng=n...
77bf438f291caf6b6a10a68619584c1a0a6b2584ffdbfabaaef1dc7f76c90212
Python
13,020
351
#================================================================================ #= Import #================================================================================ import os import time tic = time.perf_counter() from os.path import join import sys import zipfile import matplotlib import matplotlib.pyplot as p...
858404f5a7f3d66a437e074ea066d459e76bc8b4d524e01d3579c82911569b7d
Python
13,022
309
import os import logging import platform import warnings import torch import pystow from MolNexTR.model import molnextr # Suppress unnecessary warnings logging.getLogger("absl").setLevel("ERROR") # Control level of debug output DEBUG_LEVEL = os.environ.get("MOLNEXTR_DEBUG", "INFO").upper() # Filter specific PyTorch ...
79cf7308adf354be18c391713793592836782cf8cbc045cd1f18ae04068a3653
Python
13,023
283
"""LANGUAGE MODEL selector and MODEL COUPLING (Neural Bypass list) controls. The panel only displays what the engine reports and requests changes; the engine validates and applies them between operations. Layer indices are zero-based. """ from __future__ import annotations from PySide6.QtCore import Signal from PySid...
e65dc91e121d84140885734b1a147a617ff5326c22553f1f26bfb31cd6dff5d0
Python
13,028
348
""" Introduction to the trainers Module =================================== Welcome to the guide on TorchEEG's ``trainers`` Module! This module provides you with a suite of trainers, built on Pytorch-lightning, for model training. These trainers are designed to handle a wide array of models, ranging from discriminativ...
6669d5a7fd9b4b9fe1e68e857109be2dad88065532f9397e0a1e95f8af457a83
Python
13,040
354
from atom3d.filters import filters import os import torch import numpy as np import pandas as pd import random import torch import torch_geometric as tg # import e3nn.point.data_helpers as dh from transformers import BertTokenizer, BertForMaskedLM import os from eudockscore.utils.interface import get_pair_interface_...
28120bd334eea00a0ec09424f07eb6f58c0176b4ecaf54d5f8ac910591fe78f8
Python
13,043
340
## # \file reconstruct_volume_from_slices.py # \brief Script to reconstruct an isotropic, high-resolution volume from # multiple motion-corrected (or static) stacks of low-resolution 2D # slices. # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date March 2017 # import o...
d203cc52543aa7bf6bf26f7f2dab4ebbff5177f5a16e7a91c143de331d658a09
Python
13,043
448
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from sklearn.decomposition import PCA import torch from umap import UMAP import pancancer_evaluation.config as cfg from csd_simulations import simulate_csd from preprocess_and_...
4370f3540f7e9282b531834cee31201de485bb2c902aff0673f8e014a593ca7c
Python
13,044
256
import os import pickle as pkl from typing import Callable, Dict, Tuple, Union import numpy as np from ....utils import get_random_dir_path from ..base_dataset import BaseDataset from .faced import _EMOTION_DICT, _VALENCE_DICT class FACEDFeatureDataset(BaseDataset): r''' The FACED dataset was provided by th...
aee94fbb11364214254fb1ad659e95efe95bf3b2978b31df3038c266005b00ea
Python
13,044
334
#%% # Imports import os import sys import numpy as np import pandas as pd import datatable as dt from pathlib import Path from sklearn import metrics from scipy.stats import zscore from func.utils import filter_outliers, sort_files, transform2SD, cor_true_pred_pearson, cor_true_pred_spearman, prep_confs from func.mod...
ae673b9923fa417a42a0c5b3790345eade9620d49bc22e900acf1b9340ef1466
Python
13,047
313
import torch.nn.functional as F from typing import Tuple, Optional import torch import torch.nn as nn from .fbcnet import VarLayer, MaxLayer, StdLayer, LogVarLayer, LinearWithConstraint, MeanLayer, swish, Conv2dWithConstraint ## CONV_SAME_PADDING def _calc_same_pad(i: int, k: int, s: int, d: int): return max((-(i...
88106d6b4e815dd83f51bb6ba1cb4840892bdb5ddc26901116d5ba253b805297
Python
13,051
277
""" Script to run pan-cancer classification experiments for all chosen combinations of gene and cancer type. Output files are identified by {gene}_{cancer_type} (in this order). """ import sys import argparse import itertools as it from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm ...
03a44baa3a1cca2047d930c8ca24997927f1119647de03ea9ac1fbe7d54bc074
Python
13,055
332
"""Widget tests for InputAtlasPreviewPanel (plain _qapp; pyqtgraph headless).""" import numpy as np import pytest @pytest.fixture(scope="module") def _qapp(): try: from PySide6.QtWidgets import QApplication except Exception as exc: # pragma: no cover pytest.skip(f"PySide6 unavaila...
bbddd59b87aac1b2241ee3181a51190c951c09d8b9c6dbc55e1f71feaa876bc9
Python
13,059
293
import rdkit import rdkit.Chem as Chem from typing import List, Union, Tuple import pandas as pd import torch import numpy as np class MolecularFeaturizer(): """ Featurizer to represent molecular datasets. Given molecules in SMILES format, it creates a Pytorch with the following attributes: - atoms: ...
bcac8af0f34033320dbf9073c753329b46569020261eecb0bf774e78ed63a60e
Python
13,059
240
import os import unittest from pandas import DataFrame from hed.models import DefinitionDict from hed.models.hed_string import HedString from hed.models.tabular_input import TabularInput from hed.schema.hed_schema_io import load_schema_version from hed.tools.analysis.event_manager import EventManager from hed.tools.a...
ec6f7406ce3d673d784a1a3191f61e8a169be45c96211ef2c7ff8cbf3117fdbb
Python
13,060
266
import copy import unittest from hed import HedString, load_schema_version from hed.models.string_util import cleanup_empties, gather_descriptions, split_base_tags, split_def_tags hed_schema_global = load_schema_version("8.4.0") class TestHedStringSplit(unittest.TestCase): @classmethod def setUpClass(cls): ...
985cccce9942bf44cc799291fa9788e45cb74dd4d4f4255d271b711a231c1b0a
Python
13,061
290
import torch import torch.utils.data import time import os import numpy as np import csv import dgl from dgl.data.utils import load_graphs import networkx as nx from tqdm import tqdm import random random.seed(42) from sklearn.model_selection import StratifiedKFold, train_test_split class DGLFormDataset(torch.utils.da...
02d11aff584c36eacb7143f46c9ea76ad12b056349b97a66933a1da095cdad20
Python
13,065
315
# SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL # # SPDX-License-Identifier: AGPL-3.0-or-later '''Description: Functions to pre-process spike trains via gaussian kernel and mean centering Author: C. Pokorny Created: 11/2022 Last modified: 10/2023 ''' import h5py import json import multiprocessing im...
4dd2e2f32c9bf0de39b715b68c5f424a76039bcd8132832e3990913cb87ac5ce
Python
13,065
294
import numpy as np import torch from typing import List, Union def after_hook_normalize( data: List[Union[np.ndarray, torch.Tensor]], eps: float = 1e-6) -> List[Union[np.ndarray, torch.Tensor]]: r''' A common hook function used to normalize the signal of the whole trial/session/subject after ...
ee00a88682e2f874a44f6b0505792fd8d7e156a2929c1257567a95328c88aad5
Python
13,065
292
import numpy as np from scipy.sparse import csr_matrix from .. import config as CFG from ..utils.supercell import minimum_supercell from .matao import PairsInfo, MatAO class OrbInfo: def __init__(self, aodata, structure=None): if structure is None: self.structure = stru = aodata.structure ...
2f0d3412b67b5f7e093f04fc7a4fe063f6a9a4b96148a662241fe4eb2761e798
Python
13,076
268
import torch import torch.nn.functional as F from .dcs import DCS_multi_lay_resolution from .attention import Gate_Attention class Stream1(torch.nn.Module): def __init__( self, input_channels: int = 1, kernel_size: int = 3, embedding_dim: int = 128, dcs_num_layers: int = 3...
9c1c30facef8e99bcc6b71b6abfee81eb2e2bb9f15abc9837f2e334391e7c78b
Python
13,076
343
import tensorflow as tf import numpy as np import os import datetime import random from tensorflow.keras import losses from shutil import copyfile import tensorflow_addons as tfa import models import utils import data_augmentation def run_once(f): """ Wrapper for functions that should only run once every run...
154f2401a9e902f69a79c05b4594ef67b95ca31c415eae7f9d3b9fc0ec995178
Python
13,077
376
"""distutils.command.config Implements the Distutils 'config' command, a (mostly) empty command class that exists mainly to be sub-classed by specific module distributions and applications. The idea is that while every "config" command is different, at least they're all named the same, and users always see "config" i...
507aa1acdf4b4a9b340d9f4a39d8ac192bfbbfb1e9300508ad1d4bc561d4e7b8
Python
13,077
305
import os import shutil from multiprocessing import Manager from typing import Any, Dict from joblib import Parallel, delayed from torch.utils.data import Dataset from tqdm import tqdm from torcheeg.io import EEGSignalIO, MetaInfoIO MAX_QUEUE_SIZE = 1024 class MockLock(): def __enter__(self): pass ...
652b96c41819ee85c4663464d9599e042c6c860ebfd6f6f32359563b4345d6ac
Python
13,080
397
#!/usr/bin/env python # -*- coding: utf-8 -*- from plot_methods import plot_signal_sum, calc_signal_power, plotting_correlation from cellsim16popsParams_modified_spontan import multicompartment_params import analysis_params import plotting_helpers as phlp from hybridLFPy import CachedNetwork, GDF import h5py import os ...
e76557c90c0ac0d4b121893e308d9111489959d213d45a8de1b0831b8bfb5356
Python
13,083
323
"""Educational help content for registration options (Qt-free). One OptionHelp per selectable value, grouped by GUI control. Rendered into tooltips and a help dialog by regtools.registration.gui.help_widgets. Kept Qt-free so it imports headlessly (tests, CLI, docs). Option keys mirror the combo `data` keys in reg...
ba67f6ab7e52a2a848f55a38e960bcfd19eac4b539780e1935d674a00e2a811f
Python
13,085
353
#================================================================================ #= Import #================================================================================ import os import time tic = time.perf_counter() from os.path import join import sys import zipfile import matplotlib import matplotlib.pyplot as p...
cdb591db66c828e73dfeebf93e4f6d960771e258499e84b72711475db09e69e4
Python
13,088
279
from __future__ import division import logging import numpy as np import matplotlib.pyplot as plt import pandas as pd from func_unsupervised_CC import fit from IterativeMethod import iterativeCC """ Created on Sun Mar 10 17:16:12 2019 @author: Hannah Choi """ """ This code genereates shuffled versions o...
649f416bb00e03d81b1e97591d60df225dabd79d8e12ba061d97b9b7e9f5985a
Python
13,089
355
""" PCA and related signal decomposition methods for tedana """ import logging from numbers import Number import numpy as np import pandas as pd from mapca import ma_pca from scipy import stats from sklearn.decomposition import PCA from tedana import io, metrics, utils from tedana.selection import kundu_tedpca from t...
89d904f61af258d1eb334a67a9d7c554b9d7587bbd0de100d0cc5dad5c5af59b
Python
13,092
372
import re import types import inspect from collections import defaultdict from contextlib import contextmanager from decorator import decorator class _MetaContainer(object): """ Meta container that maintains meta types about members. The meta type of each member is tracked when a member is assigned. ...
42be2bd11b2199bc366bb0ccfc9619c39979c21c85e69fe68bb490e71a4f3f7b
Python
13,105
263
''' Here we compare the ML regression on the first part of the samples to the regression on the second part of the samples, where the even is uut of the tableau (i.e. its info cannot be conveyed by self pulsing) ''' import numpy as np from matplotlib import pyplot as plt # import scipy.io as sio # load data ...
70d619c354f3677152fe4a7e4d04a9aeccc75b8dd88f01d4f3a2c07df27601da
Python
13,107
288
from __future__ import unicode_literals, absolute_import import sys from . import _option_parsers from ._version import TOMBO_VERSION import argparse class SubcommandHelpFormatter(argparse.RawDescriptionHelpFormatter): def _format_action(self, action): parts = super(SubcommandHelpFormatter, self)._format...
3fa7ab286d998a1f5bda378a129dff81c10dc727a05ea3d2b72de3d140e46dca
Python
13,108
284
import numpy as np from scipy.integrate import odeint def mechanotransduction_ode_calc(timeSpan, stiffness, geoParam): # # YAP/TAZ and MRTF mechanotransduction model, originally implemented in # # VCell # # # # input: # # timeSpan is a vector of start and stop times (e.g. timeSpan = [0 10.0]) ...
31177da3cc5aa054667cec7b8bc266bfc18d6849513ad0184ac4c05faac08348
Python
13,111
367
from __future__ import division, unicode_literals, absolute_import from builtins import int, range, dict, map, zip import sys # Future warning from cython in h5py import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import h5py import numpy as np from operator import itemgetter if sys.ve...
67d1b2a36ccc59a5e8c9f2e79cf1ceec514723ed5d2c9cce4c22c0ae69e47439
Python
13,112
361
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: emma """ import os import pickle import cv2 import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from datagenerator_3d import DataGenerator import pandas as pd import keras.backend as K from pathlib import Path import SimpleITK as sitk f...
bc9a35b8842bd3f546e833be522238d39335d591a7ff40cfd075882eb83785c9
Python
13,113
355
from atom3d.filters import filters import os import torch import numpy as np import pandas as pd import random import torch import torch_geometric as tg # import e3nn.point.data_helpers as dh from transformers import BertTokenizer, BertForMaskedLM import os from eudockscore.utils.interface import get_pair_interface_...
4afc091c73daebd9e1e8493dc90cfd6323f22aa32a61034ff7d86d66f038f8de
Python
13,115
344
# 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...
52ea444acd087848d2fbcb9b0a464c76b55dea098fdf3b0f549b3595cc3985b1
Python
13,117
395
from collections.abc import Callable from itertools import chain, starmap from typing import Protocol, cast from elasticai.creator import ir from elasticai.creator.graph import dfs_iter from elasticai.creator.ir2vhdl import ( DataGraph, IrFactory, Node, Registry, Shape, type_handler, ) from ela...
8a2a57a09f6db10d4c097685a2dc46fe4cf79eb8000e16f42ac99bbf62c43d1c
Python
13,131
354
import torch from torch_geometric.nn import MessagePassing from torch_geometric.utils import add_self_loops, degree, softmax from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool, GlobalAttention, Set2Set import torch.nn.functional as F from loader import BioDataset from dataloader import Da...
0fdcd3e814754ad3fb713a1c3aee0b26fd066bdae8900de0ef3cf1981f8b8ac0
Python
13,132
452
#!/usr/bin/env python # coding: utf-8 # In[1]: import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.datasets import make_classification from sklearn.decomposition import PCA from sklearn.linear_model import LogisticRegression, SGDClassifier from sklearn.metrics im...
522cf32390443ea150af51829f2b584ca6087ef8cea4c961b2b2872afe95a64b
Python
13,133
343
# 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...
fc8a507dcf9f6d0f5983b52a17ca31cd2fbef0f757de3db97fac1449ab3ece4b
Python
13,133
212
''' This script is used to dock compounds using DiffDock. NOTE: Currently this script requires that the argument --protein_ligand_csv is used. ''' import copy import os import torch from argparse import ArgumentParser, Namespace from rdkit.Chem import RemoveHs from functools import partial import numpy as np import pa...
efd69b4929c75f5df61ff12b9b64397ac58735ad4292901e394a9fa81f2557a1
Python
13,134
359
import h5py import numpy as np from scipy.ndimage import distance_transform_edt from wsilearn.utils.cool_utils import * from wsilearn.utils.df_utils import print_df, df_merge_check from wsilearn.utils.files_utils import FilesInfo from wsilearn.utils.path_utils import PathUtils import pandas as pd from wsilearn.utils....