sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
05f68eeda720a37c0b6b8b4db7a691184be8ebc0c27362bbce39325e09296fbc
Python
7,584
182
# # 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,...
ef0595d1df0d18efb6c8fd1e7125f5911ad21032d02f847721388023c12ebe95
Python
7,584
228
# Copyright (c) Facebook, Inc. and its affiliates. # # Contents of this file were adapted from the open source fairseq repository. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math from typing import Any, Dict, List, Optional impo...
9966f49f888a37257fc0177592caa36d05893ea603a04e5947490c5570351910
Python
7,586
192
import numpy as np import math import os from scipy.linalg import toeplitz import numpy as np import math def bilateral_filter(j, t, y_j, y_t, delta1=1.0, delta2=1.0): idx1 = -1.0 * (math.fabs(j-t) **2.0)/(2.0*delta1**2) idx2 = -1.0 * (math.fabs(y_j-y_t) **2.0)/(2.0*delta2**2) weight = (math.exp(idx1)*mat...
c7a7da59c041a831d72c1adea4739362c2abac94a51388afcb9e2ca6e6c75c2c
Python
7,586
205
# 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...
37effea720d5536133f6c53de523f2b1fe23f979980f53f0dfeaa97f7090261b
Python
7,587
143
from typing import Optional from pathlib import Path import math import numpy as np import pandas as pd from transformers import T5Tokenizer, T5EncoderModel import torch import re from tqdm.auto import tqdm from pyproteonet.data import Dataset import pandas as pd from datasets import load_breast_cancer_dataset, load_...
1d858346dfb9fcfb7c02a8cd4fcca80155f2d530c9120fe76bb7129324b8d29f
Python
7,588
179
import numpy as np from sklearn.model_selection import KFold from datetime import datetime import os import time import csv from model import CNN from dataloader import DATA, DATA_TEST from config import DEBUG, RUN_NAME, SKIP_FOLDS, RUN_PARAMETERS, TEST, DATA_AUGMENTATION, LABEL_FORMAT, BINNING, CONV_LAYERS from helpe...
5ae28a4a94c9882755ce246bedd2ab37714f487fe4fd71f0b659e7ca2bddb26f
Python
7,588
145
#!/usr/bin/env python3 """Consistency checks for the ``retired_ids`` registry in ``library_data.json``. A hedId is permanent. When an element is removed from a released schema, or an id is assigned in a prerelease and then withdrawn before release, the id goes into ``retired_ids`` for the owning schema and must never ...
7cb534882dd06f03d13dc106bd5bdfc5026276b44f12fe89a37a7742481c9833
Python
7,588
227
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Copyright (C) 2012 Computational Neuroscience Group, NMBU. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
5f7cea577bb39a8f2a691f0327601b3acc4c46f03c13bafc1074ea9d4dbc2e6e
Python
7,591
234
## # \file image_similarity_evaluator.py # \brief Class to evaluate image similarity between stacks and a reference # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date February 2018 # # Import libraries import os import re import numpy as np import SimpleITK as sitk import nsol.observer as ...
3aac79b5b5158069133f6169c6c11d10df9ef4d5610973dcdb9100ffc122e1a0
Python
7,593
244
import numpy as np from dreamcoder.task import Task from dreamcoder.type import arrow import dreamcoder.domains.arc.arcPrimitives as p from dreamcoder.domains.arc.arcPrimitives import Grid, Input, tgrid, tinput, toutput from dreamcoder.type import arrow, baseType, tint, tlist, t0, t1, t2, tbool from dreamcoder.domains....
878cdc80b18027d58a8afd54218495c9a43a4eecfcd53ab21c02a8c18f27c90a
Python
7,593
230
#!/usr/bin/env python # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides the ScenarioManager implementations. It must not be modified and is for reference only! """ from __future__...
ec096120589c6a8e339e3b9b14565beb09f6d08dee0fda57e69c9eaae4299f18
Python
7,593
191
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import math import os import torch from torch import nn as nn from torch.autograd import Function from torch.autograd.function import once_di...
6a732d14b1178b23a188e900dc47f2fbd896130929bfdaa7a9373d9522f2bacd
Python
7,594
230
# ---------------------------------------------------------------------- # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/...
7e5edbabe923dfae53203483f3f8b8fcbacbef4da9522e69ca57a42703b437a7
Python
7,596
137
""" Created on 02/06/2020 :author: Mahyar Osanlouy :summary: """ from SimpleITK import GetDefaultParameterMap, VectorOfParameterMap class RegistrationParameters: """ We will define a general registration parameters in this class. If further parameters are required to add to a specific regis...
477108970d452095e6913137f43547b2d9fe8b8c39cd06712eff10821b9f5842
Python
7,598
296
import numpy as np import matplotlib.pyplot as plt from help_funcs import load_exp_variables # ----- # # Hyperparameters. metric = "rocauc" if metric == "rocauc": metric_str = "score" elif metric == "accuracy": metric_str = metric band = "beta" # "beta", "mu" if band == "beta": band_letter = "β" elif b...
57bf6343c799fdca22fa22be3cf2939ef77e3e6a00a0044e3581f6bd83d8117a
Python
7,599
174
""" toposampling - Topology-assisted sampling and analysis of activity data Copyright (C) 2020 Blue Brain Project / EPFL & University of Aberdeen This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation...
7bd9838c68ba31894a2b784f64ccbb1a796b7a3d7a702e87fdf7c4dd7c45223e
Python
7,599
167
import warnings warnings.filterwarnings("ignore") warnings.filterwarnings("ignore", category=UserWarning, message="A NumPy version >=1.18.5 and <1.25.0 is required for this version of SciPy*") import sys import os import argparse import pandas as pd from glob import glob from nilearn.glm.first_l...
9c983e002b1f3bff5b2332171196800bfc66e1cd00db7bea12ddd8d75ed1934b
Python
7,599
235
"""Summarizes events in a tabular file by checking tag coverage and quality.""" from hed import TabularInput from hed.errors import ErrorHandler from hed.errors.error_types import TagQualityErrors from hed.tools.analysis.event_checker import EventsChecker class EventsSummary: """Summarizes HED event annotations ...
4b3a9d411908fb0eb2aa778edd19c574828cefbecbb2e7a64273fccd806bdc44
Python
7,601
227
# 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...
a4d960779de31ce0a3f64b3d3072dd5f7b2411ddef0761d192e50c51bf4ff01d
Python
7,602
164
import torch from transformers import AutoModel, AutoTokenizer import numpy as np from rdkit import Chem from tokenizers import Tokenizer from tokenizers.pre_tokenizers import Split from tokenizers import Regex from tokenizers.models import WordLevel import os def predict(embedding_matrix, scaler, model, device)...
60fd3258011d2933c61db6db44ccb32c06244880820f29493c596f357f1fe166
Python
7,604
166
# import libraries import numpy as np import sys import os # import modules within repository sys.path.append('C:\\Users\\dreww\\Desktop\\hyperbolic-learning\\utils') sys.path.append('C:\\Users\\dreww\\Desktop\\hyperbolic-learning\\hyperbolic_gaussian') from utils import * from riemann_mean import * from distribution...
97669b2807b6a1e3f15955c6cb7c1ad8ef875d0a7f840ebaa1ae2fe71176d317
Python
7,605
225
import os import glob import torch import pickle import numpy as np import pandas as pd import scprep as scp import anndata as ann import seaborn as sns import matplotlib.pyplot as plt import scanpy as sc, anndata as ad from os import name from PIL import Image from sklearn import preprocessing from sklearn.cluster imp...
a8f03fe290e40335d2b9afb1753703b9867cd6deedd155e90b64a567134ace55
Python
7,605
147
from sklearn.linear_model import LinearRegression from sklearn.decomposition import PCA from sklearn.model_selection import cross_val_predict from sklearn.metrics import mean_squared_error, r2_score import numpy as np def pc_multregconn(activity_matrix, target_ts=None, n_components=None, n_comp_search=False, n_compon...
f29efc863f96765bd8c0a38f980ec6faa1d1ef1744427ce8d5b50fc90f3c3d4f
Python
7,605
161
import numpy as np import scanpy as sc import torch import anndata as ad import pandas as pd from scHetG_master import train_scHetG from scHetG_master import preprocess import random import warnings warnings.filterwarnings('ignore') #os.environ['CUDA_VISIBLE_DEVICES'] = '0' from scipy.sparse import csr_matri...
b6e23505656e11338b10efe919bc86b23b86eb07d6612a9269f3f3171f1b3cdc
Python
7,606
217
import torch from torch.utils.data import DataLoader from rocf_scoring.config import (RESUME_CHECKPOINT, PATH_CHECKPOINT, SAVE_MODEL_CHECKPOINTS, RUN_NAME, TRAINING_RESULTS_DIR, TRAINED_MODELS) from rocf_scoring.data_preprocessing.loading_data import load_raw_data from sklearn.model_sel...
fc8f1318a60005339d5da0e514df6a41f1527049cbdaa2f536b97609ef358bb5
Python
7,606
195
#!/usr/bin/python3 import os import argparse import tensorflow as tf from osgeo import gdal # imports from this package import utils from cnn_lib import AugmentGenerator from architectures import create_model from visualization import visualize_detections from cnn_exceptions import DatasetError def main(data_dir...
a70fbc8840e4c81632033a7529811d0730bba3f59ee6eee1126898cee106ee90
Python
7,607
161
import numpy as np import scanpy as sc import torch import anndata as ad import pandas as pd from scHetG_master import train_scHetG from scHetG_master import preprocess import random import warnings warnings.filterwarnings('ignore') #os.environ['CUDA_VISIBLE_DEVICES'] = '0' from scipy.sparse import csr_matri...
e5d3b26e6350def014747378595c4fde38f8d225b1715fac7d573e9dd6b9d927
Python
7,608
170
import os import numpy as np import pandas as pd import scanpy as sc import matplotlib import matplotlib.style import matplotlib.pyplot as plt import seaborn as sns from scipy import sparse import anndata from scipy import stats def adata2numpy(adata): if sparse.issparse(adata.X): return adata.X.A els...
91596111a2d70ff26e3a9af139fde4c1006c7b0d3a781bb4e77705c16b79e478
Python
7,609
137
import numpy as np import nibabel as nib import h5py import os import pkg_resources dilateMM = 10 partitiondir = pkg_resources.resource_filename('ActflowToolbox.dependencies', 'ColeAnticevicNetPartition/') defaultdlabelfile = partitiondir + 'CortexSubcortex_ColeAnticevic_NetPartition_wSubcorGSR_parcels_LR.dlabel.nii'...
480bf1d5c5e490cf1ab7d6542fff70a509e749d7c0573c14d01de6438ab641df
Python
7,610
235
import torch import torch.nn as nn from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule from elasticai.creator.nn.integer.MPQ.linear import Linear from elasticai.creator.nn.integer.MPQ.mha.design import MHA as MHADesign from elasticai.creator.nn.integer.MPQ.scaleddotproductattention impor...
ccd82b49ee60e51eae97755fa17eb22028f75c483bc9e369121d2aec1cbb5e48
Python
7,610
201
import re import os from pathlib import Path from functools import reduce, partial from operator import getitem from datetime import datetime from utils.logger import setup_logging from utils.util import read_json, read_yaml, write_json class ConfigParser(object): def __init__(self, config, resume=None, modificat...
16ed396034914ada92578591fa5a74f83aa0174d52eccca3e1acf49ddfba2a3b
Python
7,613
205
from typing import Any, Callable, Optional, Sequence, Union import torch from pytorch_lightning import LightningDataModule from torch.utils.data import DataLoader, Dataset, random_split import torchvision.transforms as T from torchvision.datasets import ImageFolder from pl_bolts.datamodules.vision_datamodule import V...
938978c8085b05f2daef43c3a7e81d1a098842516ea6fa3dcbb16d2f8a96769c
Python
7,613
296
#!/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 from tqdm.auto import tqdm import torch from umap import UMAP import pancancer_evaluation.config as cfg from csd_simulations import simula...
c0477e29e72c4bee1155468c7e72fef3e26d900f8358d352ff3c2c847a2543fc
Python
7,615
221
from __future__ import print_function import numpy as np # This is the "standard" transformations.py file # https://www.lfd.uci.edu/~gohlke/code/transformations.py # http://docs.ros.org/jade/api/tf/html/python/transformations.html from pybullet_tools.transformations import rotation_matrix, translation_matrix from pyb...
d822951d8f2f15d239338ac5673e9a729ac0d758d8aeea80d8b12e3ce9db300f
Python
7,615
161
import numpy as np import scanpy as sc import torch import anndata as ad import pandas as pd from scHetG_master import train_scHetG from scHetG_master import preprocess import random import warnings warnings.filterwarnings('ignore') #os.environ['CUDA_VISIBLE_DEVICES'] = '0' from scipy.sparse import csr_matri...
c2df979f0b87c642a62d30023d4085a821157ba5c7366fb870fc4017127bc166
Python
7,617
144
"""Deterministic behaviour capture for before/after refactoring comparisons (exact equality). PYTHONPATH=<src> python scripts/behaviour_capture.py cpu OUT.json PYTHONPATH=<src> CUBLAS_WORKSPACE_CONFIG=:4096:8 python scripts/behaviour_capture.py gpu OUT.json Run it with PYTHONPATH pointing at two checkouts (e.g. a...
25e22bcb0cd1f4f133cc3316680fd0f7d8813b14165697f475e3bfa3b1396b27
Python
7,618
238
# -*- coding: utf-8 -*- # # LFPy documentation build configuration file, created by # sphinx-quickstart on Mon Oct 3 13:36:41 2011. # # This file is execfile()d with the current dir. set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configu...
741021000230130d837609ef958768b9c6b008f189aa46e29071df26db631ebb
Python
7,618
205
import torch from torch import nn from torch.nn import functional as F from elasticai.creator.nn.integer.conv1d.design import Conv1d as Conv1dDesign from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule from elasticai.creator.nn.integer.math_operations import ( get_padded_q_inputs, ...
8597e9611341843b7da406617e4ecb3bc9b6cabba4c1c5fe4f1a01b19d09698e
Python
7,619
177
import json import os import xml.etree.ElementTree as ET import numpy as np from ..constants import bohr2ang, hartree2ev from .. import config as CFG from ..utils.structure import Structure from ..utils.misc import atom_name2number, atom_number2name, unique_nosort from .bgwio import bgw_wfn, bgw_vsc, bgw_vkb, bgw_fil...
8a99a843f84f6ab721385fd1570be1afef8d9e5d1affc063c1fdd6ac5c723045
Python
7,619
187
""" Generates a ListTomoOMSegmentations object from a input STAR file Input: - STAR file with the list of segmentations, each list pairs membrane and lumen segmentations Output: - A ListTomoOMSegmentations pickled object for every STAR file row """ ################# Package import import os impor...
a30d7d69d5765f8a0ba75437e4ea4a45005f99aba816af02c086580ad16124c4
Python
7,620
161
import numpy as np import scanpy as sc import torch import anndata as ad import pandas as pd from scHetG_master import train_scHetG from scHetG_master import preprocess import random import warnings warnings.filterwarnings('ignore') #os.environ['CUDA_VISIBLE_DEVICES'] = '0' from scipy.sparse import csr_matri...
45187c9d6fa426cb499a3309ed0d6956a5180ed2ec3e853438c14351952e33fe
Python
7,622
172
from functools import reduce from operator import __add__ import torch import torch.nn as nn class Conv2dSamePadding(nn.Conv2d): def __init__(self, *args, **kwargs): super(Conv2dSamePadding, self).__init__(*args, **kwargs) self.zero_pad_2d = nn.ZeroPad2d(reduce(__add__, ...
23151fb52b6357489b51890d8468503277fdbe041333f61616e271e1f548f97d
Python
7,623
170
''' Description: Test scNODE when using different number of pre-training timepoints. Author: Jiaqi Zhang <jiaqi_zhang2@brown.edu> ''' import os.path import sys import matplotlib.pyplot as plt import torch import torch.distributions as dist import numpy as np import pandas as pd from datetime import datetime f...
00c89cd893be3a03655efcb6e95ac7cdce25aae0fddb0ed0de443a68f89aba7d
Python
7,624
114
import numpy import modules.io as io import modules.plot_func as pltt import modules.traj_analysis as tran import modules.helper_func_class as misc #import modules.process_mouse_trials_lib as plib import matplotlib.pyplot as plt import scipy.io import scipy.stats import os import datetime import time #import matplotlib...
faf1fde0b1b67aab399e0c9ef6bdf77fe11ea29b2019664b28a2327616c8f944
Python
7,625
236
import sys from collections import defaultdict as d import re from optparse import OptionParser, OptionGroup import math import gzip #Author: Martin Kapun ######################################################### HELP ######################################################################### usage="""python %prog ...
0631ad979d6d37f1e12c23287fa6e050fee2e919a92dc85974fe1aacc4ea16c1
Python
7,628
154
from itertools import combinations, product, islice import numpy as np from control_tools.ik.pr2_ik import get_arm_ik_generator from control_tools.common import get_arm_prefix from plan_tools.common import Conf, COLLISION_BUFFER, get_pr2_safety_limits, get_weights_resolutions from plan_tools.samplers.collision import...
69367f11bb5635b60be979642caea4e280b1f61c44474113a967953cdc5eff48
Python
7,628
293
# Settings for connectivity # p - probability of connection (divergence) # strength - base synaptic weight scaling factor # delay mean - mean delay for AP conduction # delay std - standard deviation for AP conduction delay # syn_types - synapse types for connection params = {} params["conduction_velocity"] = 570 # un...
896123305069938a7d891bcfbbb6ff178eaaf6799ba9afb79ab6fcf490e9e875
Python
7,628
161
import os import re from typing import Iterator, Callable, Dict, Tuple, Union import pandas as pd from sklearn import model_selection from torcheeg.datasets.module.base_dataset import BaseDataset from .base_model_selection import BaseModelSelection from .utils import create_subset, read_indices, write_indices class...
4ee00323eb4fc23ab8ccf305c955aae009fa55167532e513b1e1c302f2cb45dc
Python
7,631
258
# 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...
b22512c2acafb44ccdd1e1fecb3b1670c32fedff9077e490a93b9203c1cdb8a2
Python
7,631
147
""" OXASL - Structural data module Copyright (c) 2008 University of Nottingham """ import os import glob import numpy as np import fsl.wrappers as fsl from fsl.data.image import Image from fsl.utils.path import PathError from oxasl.options import OptionCategory, OptionGroup from oxasl.reporting import LightboxImage...
084e93836bbad7929a73fcb9ff3e3eb61293e23d500cdf25c86b9e13008bf035
Python
7,632
181
import math import torch from torch import nn import time from warnings import warn from collections import OrderedDict import numpy as np class RNN_Net(nn.Module): def __init__(self, dim_in, dim_hid, dim_out, n_layers=2, nonlin=torch.nn.Tanh(), bias=False, out_scale="small", g=...
d46569fc450b412438dda132ae6f4de2de145e08b2e4dc1405278e3144f523e6
Python
7,633
281
#!/usr/bin/env python # coding: utf-8 # ## Generalization of selected features to non-carcinoma data types # # Do the pan-cancer/median univariate correlations correspond to high correlations on non-carcinoma data types? # In[1]: import os import sys import numpy as np import pandas as pd import matplotlib.pyplot...
c0e419032840714b5b72a4cba4d3b960fd0eec43d985c412aca6821bb8993702
Python
7,634
224
# filter.py import regex from fba.utils import open_by_suffix, get_logger logger = get_logger(logger_name=__name__) def compile_regex_ref_barcodes_single(sequence, num_mismatches=1): """Compiles a regular expression pattern, returning a pattern object. Parameters ---------- sequence : str ...
da5dd8778bb5127b7e865ac81ca286bf39942b9ce53e323645b88aace99765df
Python
7,636
158
import contextlib import copy import io import json import os import shutil import unittest from hed import load_schema, load_schema_version from hed.schema import HedKey, HedSectionKey from hed.scripts.hed_convert_schema import convert_and_update, format_removed_row from hed.scripts.schema_script_util import add_exte...
93b5170f487e03064a2e9de757b175c7ac6ca9b0b2b9782da4233b70813b425d
Python
7,637
247
""" Integration tests for "real" data """ import glob import os import re import shutil import tarfile from gzip import GzipFile from io import BytesIO import pandas as pd import pytest import requests from pkg_resources import resource_filename from tedana.workflows import t2smap as t2smap_cli from tedana.workflows...
04e96855be470a8f9f55116fd0ab9f3f107359d5c2df542f07f5f77d13713159
Python
7,638
225
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Written by Tong He and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md """ import os import time import random import argparse import numpy as np from pathlib import PurePath import torch import torch.utils.data import torch.nn as ...
d8f5d576e6193c23d99244057b527519b7c725678253ef855e89c6c887f0f5e5
Python
7,638
210
"""Lazy ZIP over HTTP""" __all__ = ["HTTPRangeRequestUnsupported", "dist_from_wheel_url"] from bisect import bisect_left, bisect_right from contextlib import contextmanager from tempfile import NamedTemporaryFile from typing import Any, Dict, Generator, List, Optional, Tuple from zipfile import BadZipFile, ZipFile f...
4fe75caa6e51c6b7aad3ca1d83d5288e92d7f86c685e619377c7ac2df518aac5
Python
7,641
183
from pathlib import Path import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import sys #********************************** PLOT Utils****************************************** PALETTE = sns.cubehelix_palette(start=0.3, hue=1, gamma=0.4,dark=0.1, light=0.9, rot=-0.6...
6a57dfc47ba293c52e892dcf40f73b1b6604d28081a9af9105d9c8a4dc62c0fb
Python
7,641
188
# Extract and separately save out TVAT surfaces used in Fig 5A-B # from full dataset from os.path import join from get_paths import * import h5py import numpy as np import pickle if __name__ == "__main__": ## File names fname_regressions = "data_tvat_polynomialregressions.pickle" fname_tvat ...
5fe275edcf8ee9298dbcdad9122e264e61e83a3acbcb5ee74b03f87d91e89b91
Python
7,642
213
import itertools import re import bpy import databpy as db import numpy as np import pytest import molecularnodes as mn from molecularnodes.nodes.geometry import ( StyleBallAndStick, StyleCartoon, StyleRibbon, StyleSpheres, StyleSurface, ) from .constants import codes, data_dir from .utils import Ge...
ce669c78263f6e844903a94937e2f2c5d54ea25928f78cdd3ccf512ec8b1fbb2
Python
7,644
292
import os from pathlib import Path import numpy as np from typing_extensions import Annotated from ._ctyped import Library try: lib = Library("libcudaDecon") except FileNotFoundError: raise FileNotFoundError( "Unable to find library 'lidbcudaDecon'\n" "Please try `conda install -c conda-forge...
44cc31d845e45a5592032145d54859a3f5074ee8314aa59c609ad32b2829d217
Python
7,650
204
#!/usr/bin/env python # ---------------------------------------------------------------------- # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you ca...
756ab8d68c59d1521242eb3c2929fe9bc118ff251e4819c2e5759b99d736749a
Python
7,650
174
#!/usr/bin/env python import os import argparse import sys sys.path.append(os.path.dirname(__file__)+'/..') from maggie import score, utils, visual, simulate import numpy as np import pandas as pd def check_positive(value): ivalue = int(value) if ivalue <= 0: raise argparse.ArgumentTypeError("%s is ...
83467e1387f053723b331c7c2f1d8c5585dfa1908eb39740c74690e999d57914
Python
7,650
225
""" Lovasz-Softmax and Jaccard hinge loss in PyTorch Maxim Berman 2018 ESAT-PSI KU Leuven (MIT License) """ from __future__ import print_function, division from typing import Optional import torch import torch.nn.functional as F from torch.nn.modules.loss import _Loss from .constants import BINARY_MODE, MULTICLASS_MO...
d682a8e29f6d33677345347b23084f7266a9411ccf6cffdc4d03a38b84979edb
Python
7,650
218
import numpy as np import math from examples.drake.utils import get_random_positions, get_joint_limits, set_joint_positions, exists_colliding_pair, \ create_transform, solve_inverse_kinematics, get_unit_vector, get_body_pose from examples.pybullet.utils.motion.motion_planners.rrt_connect import birrt from examples...
f346b420dc4251905101d267a797dfba620386a3df5bdc702fe847225d791f33
Python
7,651
199
#============================ # merge two plink filesets #============================ def tmp_file(bfile, suffix=''): return tmp_path + "/" + os.path.basename(bfile) + suffix def strip_a1a2(bfile, suffix): # strips the A1:A2 suffixes from variant rsIDs out_path = tmp_file(bfile, suffix) with open(ou...
527e30e9a07a25c40a445d37f6820da2c79e37e0f6c5a072a410f3e81de0f8e0
Python
7,652
203
# \file TestStack.py # \brief Class containing unit tests for module Stack # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date December 2015 import SimpleITK as sitk import numpy as np import unittest import random import os import niftymic.base.stack as st import niftymic.base.data_reader as dr impor...
599f531dec7d2e07b6db122e506ba7d468268ca72d2f322d8f2e7024a930d444
Python
7,652
243
import logging import time import unittest from shutil import rmtree import neurolib.utils.functions as func import numpy as np from neurolib.models.aln import ALNModel from neurolib.models.multimodel import MultiModel from neurolib.models.multimodel.builder.fitzhugh_nagumo import FitzHughNagumoNode from neurolib.opti...
dc39021d7049e9c5f6c274d6b2e5fa0416910e586faca9a4f695519df05770a2
Python
7,652
176
"""Volume-to-affine alignment via longitudinal fissure detection.""" import numpy as np from tqdm import tqdm from .align_utils import load, preprocess, bbox, find_lines, process_lines, svd_fit, get_affine def vol2affine( moving: np.ndarray = "data/brain_25.nii.gz", template: np.ndarray = "data/temp...
4f5c8b2a12a0bec8eb6d3e23c2b6549b1993c13e11e90bf13779ea25412cb52e
Python
7,653
249
# https://www.lammps.org/workshops/Aug17/pdf/tranchida.pdf import numpy as np from ase import Atoms from hotpp.data.utils import atoms_collate_fn, AtomsDataset from typing import Dict import types from ase.io import read, write import torch from copy import deepcopy from datetime import datetime import cupy as cp from...
7490d4fb76505c6f8287969049af44b868a02901c525fc237586e704fa570270
Python
7,654
231
# 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...
9b7005dca6266d3fbd01fa38cecfc1f20fa984aaf82132970192dc3ff9a551b2
Python
7,655
291
# Environments for the Simulations import numpy as np import matplotlib.pyplot as plt from copy import deepcopy import math # Base Env class for subclassing to define the environment interface class BaseEnv(object): def __init__(self): pass def init(self): pass def reset(self): pass def step(se...
0d8b5263da4079b8b968dff6de40eb419608d49916e661bc8557fe918652b145
Python
7,656
245
#!/bin/env python3 ''' Define a Feynman diagram ''' import numpy as np import pdlfeynman as fy import pdlfeynman.particle as fyp import pdlfeynman.reaction as fyr import yaml def determine_particle(node:fy.diagram.Node, key:str='products') -> fyp.Particle|None: match node.nodetype: case fy.diagram.NodeType...
0e480fd893d53be9a71f70598c6bad4fde2990ec48b6ca291b5a99f281469dac
Python
7,658
183
''' Created on 1 May 2018 High level class containing the necessary methods. @author: Miguel Molina Romero, Technical University of Munich @contact: miguel.molina@tum.de @License: LPGL ''' from dry.utils import generate_synthetic_data from keras.layers import Dense from keras.models import Sequential from keras.opti...
797b8e975f549cb4c8deeb68b0176c5caddae6e7015c3d47302fbeb664598cf8
Python
7,659
198
# Node-group asset "Color Sample Grid" (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...
6a46f64a629cdcee036a0d6330283759db1facce2bc0f26cc8d68720b34ceea2
Python
7,661
199
#============================ # merge two plink filesets #============================ def tmp_file(pfile, suffix=''): return tmp_path + "/" + os.path.basename(pfile) + suffix def strip_a1a2(pfile, suffix): # strips the A1:A2 suffixes from variant rsIDs out_path = tmp_file(pfile, suffix) with open(ou...
33f74bfc6d0209e4e0713a4fd50eb8fd07966436edd2becf1bde5133c4c388ca
Python
7,662
157
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import re from scipy import stats def one_sample_ttest(sample_data, null_hypothesis_mean=0.0, significance_level=0.01): # Calculate the T-test for the mean of ONE group of scores t_statistic, p_value = stats.ttest_1samp(sample_dat...
dfc75a803e213145a8e556aa647b6c5c7f7f03be76957146ba01d41676ec1a9a
Python
7,662
234
import re from collections.abc import Iterable import pytest from elasticai.creator import ir from elasticai.creator.ir2vhdl import Node as VhdlNode from elasticai.creator.ir2vhdl import Shape, factory from elasticai.creator.ir2vhdl.language import Instance from ..vhdl_nodes.node_factory import ( InstanceFactory...
27f3a274d10da6f6e96d9987731a6e62e19af5db0499ca42f3069d451a3db31e
Python
7,666
184
"""The input pane keeps the loaded volume's affine, for orientation labelling. A plain 3D NIfTI preview is loaded ``reorient=None`` - raw on-disk axis order - so only its affine can say what is actually on screen. It has to reach the panel. """ import numpy as np import pytest nib = pytest.importorskip("nib...
d684ed8833b7c584fda6a9cd0d00d19434b19e77bda05dc10d8cd5b198b4c89c
Python
7,666
238
"""Materials Project-compatible recipes using the MP24 sets.""" from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING from monty.dev import requires from quacc import flow, job from quacc.calculators.vasp.params import MPtoASEConverter from quacc.recipes.vasp._base...
e6bb2a4e7f8a791a6f190792ad6edc7bdf4b3f619371b6f7d7d7b76c309ab7f6
Python
7,666
194
## # \file data_preprocessing.py # \brief Performs preprocessing steps # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date May 2017 # import numpy as np import niftymic.base.stack as st import niftymic.utilities.intensity_correction as ic import niftymic.utilities.n4_bias_field_correction as...
730b7e6a8447e921caa3a5af7f66f8a57365916422dfb7a13d3440224d95544d
Python
7,671
208
import torch from torch import nn from torch.nn import functional as F from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule from elasticai.creator.nn.integer.fusedffn.fc1relu.design import ( Linear as LinearReLUDesign, ) from elasticai.creator.nn.integer.math_operations import MathOpe...
0930beb5aa1117c69412057e4a5f1b2d0ce94cf956005674b1b8f3304fbf54bd
Python
7,679
245
# 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...
8f2355b547cc21fd26b7263e5e9d66f7243c8b0102a334955459a390df5adb2c
Python
7,680
213
import logging import os import sys import sysconfig import typing from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid from pip._internal.models.scheme import SCHEME_KEYS, Scheme from pip._internal.utils.virtualenv import running_under_virtualenv from .base import change_root, get_m...
a1a46df422dc811e213e5b1d00a2e0a9608a2f1cb68f2b6e13bf5fde94d5b5c5
Python
7,680
202
import xml.etree.ElementTree as ET import h5py import numpy as np from scipy.sparse import coo_array, diags_array from ..constants import hartree2ev from ..utils.structure import Structure from ..utils.misc import mytqdm, KGData from ..utils.mpi import one_by_one, distrib_vec, is_master from ..utils.math import make_k...
e32890dc2e501bf1eaf6ed03302b95b5906823fa373e2ff5f54b35d64730f476
Python
7,682
216
#!/usr/bin/env python #Main function scanning BAM import pysam import sys from collections import defaultdict import numpy as np import pandas as pd import itertools from scipy.sparse import csr_matrix import scipy.sparse from SCanSNP.GenUtils import CountData from SCanSNP.VCFUtils import * from SCanSNP.DBLsutils i...
43896737a445d7004deb871005dc8f71ad7b27a7f94d8022922d29548a578f55
Python
7,684
243
from typing import Callable, List, Dict, Optional, Literal import torch from torch import nn from .base import AtomicModule from ..layer import EmbeddingLayer, RadialLayer, ReadoutLayer from ..layer.equivalent import MultiBodyLayer, GraphConvLayer, NonLinearLayer, GraphNorm from ..utils import find_distances, _scatter_...
b2d473813ea07573139ac122f0fcae7443b7d990c2ee23fefac75412b70cb8eb
Python
7,684
207
"""distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.""" # XXX this module has *lots* of code ripped-off quite transparently from # build_ext.py -- not surprisingly really, as the work req...
c730affa671c9e3b4e4d48b8a79e69dd6601ccabcc15f122a32208b67020a5b0
Python
7,684
233
# ---------------------------------------------------------------------- # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/...
d07886276b7aa576c8f39f0a25b5c74cb6f5bd0e107b69d99fae072102de185e
Python
7,684
172
#!/usr/bin/env python """ Script to plot example whisker (wsk) and spike (spk) trace of selected clusters from choosen recording. Contains the following: - plot_wskspk: loads metadata, retrieve whisker and spike data through align_fun, then plot clusters of interest and example of whisking bout; """ # Ensure /data_an...
112cf8878609c3d06b2d29f67b5e9ee82e03193b160abada0f3eaef3222e7976
Python
7,688
216
from itertools import islice, product import numpy as np from examples.pybullet.utils.pybullet_tools.pr2_primitives import State, Pose, Conf, create_trajectory from examples.pybullet.utils.pybullet_tools.utils import get_subtree_aabb, link_from_name, joints_from_names, \ get_joint_positions, set_joint_positions, ...
ea9a7aefe9af765058e35d69e599491f367738a0bd228d181f1af5c581012a56
Python
7,689
259
import numpy as np from pyclamp.dsp.lsfunc import * #------------------------------------------------------------------------------- def intravel(X): x = np.array(X.ravel(), dtype = int) if x.ndim: return x return x.reshape(1) #-------------------------------------------------------------------------------...
0c533855f4e12c6c757847fc7ccbe7c88176b9f9eeee45083ec59df82d81ec7a
Python
7,690
222
import os.path as osp import numpy as np import torch import pandas as pd from torch_geometric.data import InMemoryDataset from torch_geometric import data as DATA from rdkit import Chem from rdkit.Chem import MolFromSmiles import networkx as nx from rdkit import Chem from rdkit.Chem import ChemicalFeatures from rdkit ...
fd6ade62936dad9d96b156685223376d405009361c1c94833c4cb2d279c16da7
Python
7,692
210
# pylint: disable=invalid-name, line-too-long """Functions for extracting dataset features and labels""" from importlib import import_module import numpy as np from scipy import stats from sklearn.model_selection import StratifiedKFold from omegaconf import OmegaConf, DictConfig, open_dict def data_factory(cfg: Dic...
1fb44cc9350a31ce26bad08b450d0d79bf27a4ca4dec43349e3dab7ce598c1e7
Python
7,693
204
from __future__ import annotations from dataclasses import dataclass @dataclass class InstanceRefinementConfig: """ Optional refinement of canonical 2D instance maps. Public controls --------------- remove_small Remove statistically suspicious small objects after repair/splitting. t...
23a58728ed36c30921b1632509c8798080c2ca890ee9a0729f994bf445386651
Python
7,694
256
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 17 11:55:01 2025 @author: deeperthought """ GPU = 0 import tensorflow as tf if tf.__version__[0] == '1': config = tf.ConfigProto() config.gpu_options.allow_growth = True config.gpu_options.visible_device_list="0" tf.keras.backend.s...
e62732f6f6d4da51462a4f4834ad548096483ad30db1271f0340f9ee25d452b4
Python
7,695
315
# Benchmark suites from the Fast Downward benchmark collection. def suite_alternative_formulations(): return ['airport-adl', 'no-mprime', 'no-mystery'] def suite_ipc98_to_ipc04_adl(): return [ 'assembly', 'miconic-fulladl', 'miconic-simpleadl', 'optical-telegraphs', 'philosophers', 'psr-large...
2ec9e58e79228f9fbf0d8886a72db02ca4b74b15d715a787b2789244f03c7cf9
Python
7,700
230
# 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...
45189ced0e6ab7f26a989fb3c2623031b8526bad1044a545e6279a2ebfb08883
Python
7,700
268
"""Base jobs for espresso.""" from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING from ase.atoms import Atoms from ase.io.espresso import Namelist from ase.io.espresso_namelist.keys import ALL_KEYS from quacc.calculators.espresso.espresso import ( Espresso, EspressoP...
0394331ddddca4306a0c4afc3ba47a8eac0b2a2aa42e575ee958df81d417a394
Python
7,701
196
from __future__ import annotations import csv import hashlib import os.path import re import stat import time from io import StringIO, TextIOWrapper from zipfile import ZIP_DEFLATED, ZipFile, ZipInfo from wheel.cli import WheelError from wheel.util import log, urlsafe_b64decode, urlsafe_b64encode # Non-greedy matchi...