sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
22905065d03e1a388fb26331db544da5a8b5a58f61ad5adfe9a55a47bb9092af
Python
9,841
417
from datetime import datetime from typing import ( Annotated, Literal, Optional, ) from pydantic import ( Field, RootModel, ) from galaxy.schema.fields import ( DecodedDatabaseIdField, EncodedDatabaseIdField, ) from galaxy.schema.schema import Model SOURCE_TYPE = Literal["tool"] class C...
e0713f1f04a1eee9bc2519fddd765dcc3ccab9a91a5f93f6bc9d54b3f2bb810c
Python
9,841
245
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
231c0120c20eeeaec67134c0fcf4cb0913eeb1d7b7c717a62d08ac040e2af093
Python
9,843
250
# -*- coding:utf-8 -*- __author__ = 'yangjian' """ """ import random import time import numpy as np import pandas as pd from sklearn import manifold from sklearn.metrics import roc_auc_score, mean_squared_error, f1_score from deeptables.datasets import dsutils from deeptables.models import deeptable, deepmodel from ...
da4156bb96900eeca46b92fcde3bede0e685a1c9d14bd9b7f4271a51278f983c
Python
9,844
263
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from typing import final import pandas as pd from ax.adapter.base import Adapter from ax.analysis.analysis import Analysis f...
0c0e9cd027485ca1bc989ef0e19a32bd22b5e7318e15d051643d1ebd4f14d4b9
Python
9,855
351
#! /usr/bin/env python """ # ----------------------------------------------------------------------- # # localization.py # # by Joerg Menche # Last Modified: 2014-12-06 # # This code determines the network-based distance and sepration for # two given sets of nodes on given network as described in # # Uncovering Dise...
d5dac3b36a24f737b394b505d692582246e62148bd7117e92ff24048ef89ec7e
Python
9,855
350
# -*- coding: utf-8 -*- """ Inteface to Illastik for pixel classification / object detection This module allows to integrate ilastik into the *ClearMap* pipeline. To use ilastik within *ClearMap* use the followng steps: * start ilastik interface (e.g. manually or using :func:`~ClearMap.Imageprocessing.Ilastik...
d1feebfcc7c6195f4ab226d88521ef35c9f1f76e46cdb27caf247f4ecf51825c
Python
9,856
239
import functools import random import networkx as nx import numpy as np import torch import torch.nn as nn from cogdl.utils import split_dataset_general from .. import BaseModel class PatchySAN(BaseModel): r"""The Patchy-SAN model from the `"Learning Convolutional Neural Networks for Graphs" <https://arxiv...
ca2569844d5f6de5606be25a2c0d636361bcb5e92f549829630f6f8e60d245ac
Python
9,859
253
""" Ring attractor simulation. Analysis library (:mod:`lib_analysis`) ================================================================= .. currentmodule:: lib_analysis :platform: Linux :synopsis: module for analyzing simulated data from the ring attractor network. .. moduleauthor:: Jose M. Esnaola-Acebes <josem...
3d483dc7238280a75ba6961281a6fb55b74eea5a72c79e8e937444e3bf90a9ed
Python
9,866
235
# -*- coding: utf-8 -*- import numpy as np from sklearn.utils.random import sample_without_replacement from sklearn.metrics import auc, precision_recall_curve, roc_curve from sklearn.svm import OneClassSVM import argparse import load_data import networkx as nx from graph_autoencoder import * import torch im...
45d961b79a8945fe3bb749fb73bba1ca64ca1bc5838ea01bd36fd82e75fd53a4
Python
9,867
236
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: chris3arcadia @description: template script to generate transfer lists for acid/base computing @created: Thr Feb 28 2019 """ # Libraries import numpy import chemcpupy from chemcpupy import Plating, Containers from acidbase_network import AcidBaseNetwork impo...
8a87b541fe3aab08c1ee81641057c75b24bf0e6f32381970193817eacea7ad91
Python
9,872
241
import sys from collections.abc import Sequence if sys.version_info >= (3, 12): from typing import override else: from typing_extensions import override import numpy as np import tensorflow as tf from hidten.tf.emitter.categorical import (T_shapelike, T_TFTensor, TFC...
75098693043fb7c951be8b9fcf37d9ea611472b38ba92483f398138e48347957
Python
9,877
247
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Spatial Factorization- Hybrid version with both spatial and nonspatial factors Created on Wed Apr 21 17:02:48 2021 @author: townesf """ import numpy as np import tensorflow as tf from os import path from math import ceil from sklearn.decomposition import TruncatedSV...
9cee461ef07987689b321bcb54dc8445f88daf3bc76e21c3755afcee5f0640ad
Python
9,878
210
import numpy as np import common def pre_fr_list(): return np.array([0.0001*i for i in range(50)]) #the list of presynaptic firing rates def up_down_parameters(state): """ set the frequency of up and down states """ if state == 'down': g_index = 1 elif state == 'up': g_index =...
cff9271d786ed17b43e1ca16eec0930f14169c00d682117eb6b5d24cd6d4a5ef
Python
9,878
222
import numpy as np import torch from visual import visual_plt from visual import visual_visdom from utils import get_data_loader,checkattr ####--------------------------------------------------------------------------------------------------------------#### ####-----------------------------#### ####----CLASSIFIER EV...
843ca8a07ce2b06fe7efda5e6edbbc4e5002ae89d05bc9aa3c45b2dfa41053ea
Python
9,888
301
import abc import logging import os import re from collections.abc import Callable from typing import ( Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols imp...
3aefae5b0edbae1e7225001498c8debc1a931670b431545985dfbcd4abe14705
Python
9,890
246
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Spatial Factorization- Hybrid version with both spatial and nonspatial factors Created on Wed Apr 21 17:02:48 2021 @author: townesf """ import numpy as np import tensorflow as tf from os import path from math import ceil from sklearn.decomposition import TruncatedSV...
905000641940220ed7721eab8a08ccaa6fe5939efce3de3368d3c3745018dcc0
Python
9,896
247
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import numpy as np from ax.analysis.plotly.surface.contour import compute_contour_adhoc, ContourPlot from ax.core.arm import ...
a8cb2abd4b4a84c521492fc9e3778f81375c5358c52c565c3b053b97c2a62d3a
Python
9,896
257
from brian2.core.namespace import get_local_namespace from brian2 import Synapses, Function from brian2.input.spikegeneratorgroup import SpikeGeneratorGroup from brian2lava.utils.const import HARDWARE MAX_SYNAPSES = 2147483647 def spike_queue(self, source_start, source_end): """ TODO Parameters ----...
ae64faf5442a2d0ec75d72669966320ea051c71e0f4a9b66adecbfe3b0f88ff1
Python
9,905
190
#!/usr/bin/env python # # Copyright (c) 2017 10X Genomics, Inc. All rights reserved. # import cellranger.analysis.io as analysis_io import cellranger.analysis.constants as analysis_constants import cellranger.h5_constants as h5_constants import cellranger.io as cr_io import cellranger.analysis.stats as analysis_stats ...
7cc21e4aea80ef842855b7f66b04003e3875646f9f9a9eda8316f7dc58194122
Python
9,907
317
import contextlib import os import shutil import subprocess import typing from pathlib import Path from tempfile import TemporaryDirectory, mkdtemp from . import _mpi from ._fs import get_cache_path, read_cache, update_cache from ._hash import get_package_hash, get_package_mods_hash from .exceptions import * if typin...
c044e2b62b3cf21e351576a1cb967f3370f33bd032f042dd7865bb3d07e53841
Python
9,907
343
"""Main flow of the eComp experiment.""" # %% import datetime import numpy as np from psychopy import core, event, monitors, visual from ecomp_experiment.define_eyetracking import ( setup_eyetracker, start_eye_recording, stop_eye_recording, ) from ecomp_experiment.define_routines import ( display_blo...
2dee6375fceb2f8fc8ee29a8774474a82c081b824cd925aacff19aeaf7a3170a
Python
9,908
312
## ------------------------------------------------------------------------ ## ------------------------------------------------------------------------ ## ## # ~/opt/anaconda3/envs/mrcnn/bin/python # /home/jorgeassis/miniconda3/envs/mrcnn/bin/python ## Erase memory objects for element in dir(): if element[0:2] !...
8055d32cbca6a113df22386e8648ab2e421c0f3dc85c9a2eff940c89079aa5b4
Python
9,912
324
from math import floor import numpy as np import pandas as pd import pynndescent from sklearn.metrics import adjusted_rand_score def _purity(label1, label2): """Calculate purity score.""" # contingency table ct = pd.crosstab(label1, label2) purity = ct.apply(max, axis=1).sum() / label1.size retur...
0af0b3585f85112a3b8fbd68deed89a8f48d6137578623b24661fd159a2c319b
Python
9,915
335
import json from enum import Enum from typing import ( Annotated, Any, Literal, Optional, Union, ) from pydantic import ( AliasChoices, ConfigDict, Field, field_validator, HttpUrl, Json, TypeAdapter, UUID4, ) from galaxy.schema.fields import DecodedDatabaseIdField f...
8671e5739e87d99bf74c1ffe0d33bf7a3b3024c97173218b74d73a28a9da1f22
Python
9,918
216
""" General functions for analyzing the memory neural system """ import numpy as np import roblib import settings from pathlib import Path import pandas as pd from utils import load_config from sklearn.metrics import roc_auc_score from training import get_test_time_point import os def get_intersect(x, y, ...
dd0d57495cda611cddeef5d9903b0bcff19b9eeadbe30a911720f218ce71faea
Python
9,920
237
#author: Dimitris Spathis (ds806@cl.cam.ac.uk) """ what: load individual feature CSVs of Fenland's repeats cohort, concat, split to train/test, normalize and do ML difference from task1: here we focus on the repeats and create regression tasks based on FII delta in: CSVs with extracted features, IDs, metadata out: t...
47985f9c8724020b562ede80d7c95212310c0a86d6b91ebedb05eaed638afcd7
Python
9,921
209
# Implementation based on the following publication of Tiago P. Peixoto # Nonparametric Bayesian inference of the microcanonical stochastic block model # full version with scipy import math from scipy.special import binom from .peixotos_flat_sbm_full import ModelLikelihoodOfFlatMicrocanonicalDegreeCorrectedSbm from...
41beb758b1cc7b12c3159155ca9b9fc8dd6cc4526144afc49fbb6f13057c80c4
Python
9,925
230
""" Provide plotting functions for genomic data types. Many common data types used in genomics research are supported. Including, but not limited to, :class:`Hi-C <fanc.plotting.HicPlot>`, :class:`bed <fanc.plotting.GenomicFeaturePlot>`, :class:`bigwig <fanc.plotting.BigWigPlot>` and :class:`gene (GTF) <fanc.plotting....
07f15f10bf035b067687a1f16cbb35303b959e50ecaf8fb4066575a295cbb737
Python
9,929
282
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 11 13:56:08 2020 @author: amelie """ from brian2 import * from scipy import signal from FEF_full3_alternatec import * from LIP_full_alternatec import * from itertools import * from joblib import Parallel, delayed import multiprocessing def sav...
eb03e873d3b6348f1a79bb9a3e92e15df2cc615940561d8d9eec5a36db0574b0
Python
9,929
328
# -*- coding: utf-8 -*- """Docking_MC_Parallel.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/13sohHmkOWAWa5QIEAjIESIqJ8IZkOcHi """ import os import sys from pyrosetta import * from rosetta import * from rosetta.protocols.rigid im...
2bf90faa422c337425a24a1d5706054db376de90bd2c4eb255ec5ed6fe0a5112
Python
9,930
458
from nl_expr.utils.orderedset import OrderedSet from nl_expr.logic.expression_processing import extract_logic_free_variables from nl_expr.logic.transformations import ( CheckConjunctiveQueryWithNegation, GuaranteeConjunction, ExtractConjunctiveQueryWithNegation, PushExistentialsDown, RemoveExistent...
497302111d5379df9c149263b03b42ee70602c1ec3e9885bd9163681718c0804
Python
9,940
261
import os import os.path as osp import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from .. import BaseModel from .mlp import MLP from cogdl.utils import spmm def average_neighbor_features(graph, feats, nhop, norm="sym", style="all"): results = [] if norm == "sym": ...
c9771dd96f4bb0957bed4f13d38ae717f03c183360a2b7efcb779a4d4706bf33
Python
9,940
260
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from ax.analysis.plotly.constraint_feasibility import ConstraintFeasibilityPlot from ax.analysis.plotly.plotly_analysis impor...
4bf9796278087ff613dde22834f801a270d8041765dd6bc4e5d11e478d6aa6a5
Python
9,941
233
# -*- coding: utf-8 -*- import pandas as pd import os import seaborn as sb from matplotlib import pyplot as plt import numpy as np def change_cell_number_to_string(number): #not needed right now since all cells are just ints #convert int to string with cellXXXX #where XXXX is the int filled to ...
7c78bede4a89c15fa490530c15b597939c08069d369fa3ba1699695161bc5cb3
Python
9,944
218
from scipy.stats import pearsonr import numpy as np from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import r2_score, mean_squared_error, roc_auc_score, precision_recall_curve, average_precision_score, ndcg_score phenoLabels = {0:['kinship_additive_minMAF0.01_maxMAF0.5.csv','kinship_additive_minMAF...
15d245bf70ced55d609932123b735d590b53a2598721dde85752e769afb5118e
Python
9,945
327
"""Utilities for loading and reasoning about unparsed tools in directories.""" import fnmatch import glob import logging import os import re import sys import yaml from galaxy.tool_util import loader from galaxy.tool_util.parser import get_tool_source from galaxy.util import checkers log = logging.getLogger(__name_...
c6f279adc970e497c7ce13212c3f2a766b15e76c3fea3e47e8f1f9b3d0897b29
Python
9,945
388
import inspect import operator as op from typing import AbstractSet, Callable, Mapping, Sequence, Tuple import pickle import pytest import numpy from ..config import config from .. import expressions, logic from ..expression_walker import ( ExpressionBasicEvaluator, TypedSymbolTableEvaluator, ) from ..expres...
1c968456766cdbe5fa6038ffbe974de67bd9f4a29ed067c41e3afb520f116de6
Python
9,948
246
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: chris3arcadia @description: template script to generate transfer lists for acid/base computing @created: Thr Feb 28 2019 """ # Libraries import numpy as np import chemcpupy from chemcpupy import Plating, Containers from acidbase_network import AcidBaseNetwor...
1f4aa0774847418ac308cb8b418439437508ddf0ec05d40cc21555bfa5ea34f4
Python
9,949
274
import warnings import numpy as np from fanc.tools.matrix import remove_sparse_rows, restore_sparse_rows from fanc.legacy.data.genomic import Hic, AccessOptimisedHic, Edge import logging logger = logging.getLogger(__name__) def correct(hic, whole_matrix=True, intra_chromosomal=True, inter_chromosomal=True, ...
70e923c709ca287987abb3f394e2e82f1cfb561dbfe8b5139f3ea2e450517263
Python
9,960
297
"""DOC-Forest. ================================================== Compute markers used for DOC-Forest recipe ================================================== Here we compute the markers from previously computed markers as published [1]. For simplicity, we only compute scalars using a trimmed mean (80%) accross epo...
316f527bec7c12e818b245ed78d5adf776789f2ededb40e4d5f4da280620c01a
Python
9,965
249
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations from copy import deepcopy from functools import partial from itertools import pr...
4e02aa1ed2d1861b9bc30089995879736b0394c52e3c6756b6bd4b400b5d6585
Python
9,967
286
# MIT License # # Copyright (c) 2019-2024 The PyQMC Developers # # 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, m...
eebf5d859ef6a381cdcc5646279e0599a6f0f0c545802d4343da75d34d1d8e8f
Python
9,974
140
# -*- coding: utf-8 -*- """ @title: a more concise tester script for the Andrew class @description: writes "BROWN DARPA" in a 384 well plate (based on 'example_protocol_2-unencrypted.anp') @author: chrisarcadia @created: 2018/04/03 """ import Andrew # create a new protocol recipe = Andrew.Protocol(); # set protocol...
093730d7c630571989da24068ef76f22fb3860c11617ba317e5e497c1ba1fab4
Python
9,975
264
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
544932c89d60bae0ea5db417378aa70255db5a13ad2c526b67d8d60268619800
Python
9,975
227
import pathlib from typing import List, Union import xarray as xr import numpy as np import os from skimage.io import imread from skimage.morphology import label from skimage.measure import regionprops_table import pandas as pd from alpineer import load_utils, image_utils from ark.segmentation.ez_seg.ez_seg_utils impor...
481aaed6108246b98722d553970d7d2c4939d5442b5c979cbefdd0dc800372df
Python
9,978
282
import numpy as np from bisect import bisect_left from collections import defaultdict import intervaltree from genomic_regions import GenomicRegion from future.utils import string_types def vector_enrichment_profile(matrix, vector, mappable=None, per_chromosome=True, percentiles=(20.0, 4...
89d181dff2371e677e37e902157a4518cd4fee0db14563aaa67a7fa57aed2cf0
Python
9,982
260
""" Utilities for validating inputs related to user objects. The validate_* methods in this file return simple messages that do not contain user inputs - so these methods do not need to be escaped. """ import logging import re from typing import ( Optional, ) import dns.resolver from dns.exception import DNSExce...
90ffdebddd0db5a997076180f251bb6cee7299ec476d55f71c6814129738c053
Python
9,983
300
#!/usr/bin/env python3 """ Script to validate file sources configuration by attempting to create instances of each configured file source. This script loads the currently configured file_sources_config_file YAML file and tries to instantiate each of the specified file sources in order to validate the configuration mod...
35acc4816c2052289d7ca014e7dc8c1b6adf9605ef0a4c96a9278f8dd69fdd53
Python
9,985
280
"""Color transformation and composites. Copyright (C) 2021 Ionpath, Inc. All rights reserved.""" import numpy as np from scipy import ndimage from mibidata import constants def _trim(array, lower=0., upper=1.): """Trims an array to a specified range; used for floating point errors.""" return np.minimum(np...
579b019f2b49180c5cbf522be5811b175a4cdf9d18d715a8a1e2b2f775eaf102
Python
9,985
363
import time import numpy as np import matplotlib.pyplot as plt import sys import os import skimage from skimage import color as skcolor from skimage import graph as skgraph from skimage import data as skdata from skimage import segmentation as sksegmentation import imageio import cv2 import maxflow from skimage.feature...
219cc58c1ed864e09f9ba35a15b490f2ad043ed2b42f3a8330acb345974ed6f6
Python
9,987
304
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 11 13:56:08 2020 @author: amelie """ from brian2 import * from scipy import signal from FEF_full3_alte import * from LIP_full_alte import * from itertools import * from joblib import Parallel, delayed import multiprocessing def save_raster(nam...
0b49256f4b23aa8de5dbd96796bf851a9eac93533d136d71ced9c87d7ff5b623
Python
9,988
228
#author: Dimitris Spathis (ds806@cl.cam.ac.uk) """ what: load individual feature CSVs of Fenland's repeats cohort, concat, split to train/test, normalize and do ML difference from task1: here we focus on the repeats and create three binary tasks based on FII delta in: CSVs with extracted features, IDs, metadata out:...
5bd3d1467eddeff6dd75975813320563c5fe8621b3e3c46be366962a4d30e4e6
Python
9,989
361
""" ***** Pydot ***** Import and export NetworkX graphs in Graphviz dot format using pydot. Either this module or nx_agraph can be used to interface with graphviz. Examples -------- >>> G = nx.complete_graph(5) >>> PG = nx.nx_pydot.to_pydot(G) >>> H = nx.nx_pydot.from_pydot(PG) See Also -------- - pydot: h...
8a3220b6fcd1bbef4d399d8e0f360d061bd9ef3ca7f08096ced619c862cd8be5
Python
9,992
323
import dataclasses import itertools import typing from ._util import MechId from .definitions import ( CableProperties, CableType, Definition, Ion, Mechanism, Synapse, _parse_dict_def, ) class Constraint: def __init__(self): self._upper = None self._lower = None ...
3391cbe306b4813a9c342b94dd831a1a32d185a40afabbf7e5b8094028b8f87e
Python
9,994
232
""" Module for the configuration node of the Glomerulus to Granule ConnectionStrategy """ import itertools import numpy as np from bsb import ( CfgReferenceError, ConfigurationError, ConnectionStrategy, ConnectivityError, InvertedRoI, config, pool_cache, refs, ) class TooFewGlomeruli...
81563a70982f3e05ec88d894d306480713ed8fbbc3a7f261c7d6ba3bb2e33982
Python
9,994
182
import re import sys import os import math from scipy import stats print("PPI_mutation_sites_mapping_by_category") Disease_list = [] Category_list =[] Disease_category = {} with open(r'E:\OneDrive\学术\PPI article\data\de novo mutation data\20190514_MasterFile_allDNMs-codingLoc_v1.5.txt') as fp: text = fp...
960007712f671639814e5ac80f2d37c266c98b14a16df82b196168aa10c6a3d4
Python
9,995
261
import numpy as np from scipy.special import expit as sigmoid import igraph as ig import random def set_random_seed(seed): random.seed(seed) np.random.seed(seed) def is_dag(W): G = ig.Graph.Weighted_Adjacency(W.tolist()) return G.is_dag() def simulate_dag(d, s0, graph_type): """Simulate random...
2a5bc70041fcf2497e0b23a025bc5a6a0700a32546fda14fb3ac429f3ed5de12
Python
10,003
228
# -*- coding: utf-8 -*- """ Created on Sat Feb 17 20:26:05 2018 @author: jacobrosenstein An UgiLibrary stores a list of Ugi molecules. It inherits from the CompoundList class. """ import json import csv from datetime import datetime import pubchempy as pcp from pyteomics import mass from chemcpupy import Compoun...
07051a188d3535041d3558a6b7684a6c37533d59b90ff7aaa478850472456897
Python
10,004
298
import uuid import numpy as np from datetime import datetime import logging import os import sys import torch from allennlp.data import DataLoader from allennlp.modules import TextFieldEmbedder, Seq2VecEncoder, FeedForward from allennlp.modules.seq2vec_encoders import PytorchSeq2VecWrapper from allennlp.nn import Acti...
0d0915bed6ff824aae9b77854a837975b2d7aca513706ada717d00a20b4b0241
Python
10,004
232
"""Utilities for parsing "Galaxy Flavored Markdown". See markdown_util.py for loading objects and interacting with the rest of Galaxy. This file is meant to be relatively self contained and just used to "parse" and validate Galaxy Markdown. Keeping things isolated to allow re-use of these utilities in other projects (...
aada0a2fcc84e626c9202189930fd052fdc961c24805876043f5463550ed6a60
Python
10,008
261
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from typing import final import numpy as np import plotly.express as px from ax.adapter.base import Adapter from ax.analysis...
f58c9c095fae86e203747744e8da4f4d99005ac0a139e302bbff8bda879666f4
Python
10,008
303
from pathlib import Path import numpy as np import nibabel as nib import shutil import json from clpipe.config_json_parser import GLMConfigParser DEFAULT_NUM_BIDS_SUBJECTS = 10 DEFAULT_NUM_DICOM_SUBJECTS = 5 DEFAULT_NUM_FMRIPREP_SUBJECTS = 8 DEFAULT_RANDOM_NII_DIMS = (12, 12, 12, 36) DICOM_SESSIONS = ["2000", "2010",...
db4318186ed8b250ff8d0fdeac8c99cdcbc44695996da36497b84913658ed97a
Python
10,016
279
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 29 08:58:41 2020 @author: amelie """ from brian2 import * from scipy import signal from cells.RS_FEF import * from cells.FS_FEF import * from cells.SI_FEF import * from cells.VIP_FEF_vis import * def generate_visual_neurons(theta_phase,N_FS,N_RS,...
32d2d0bb126f03f325bab25a33dfd75a53fbedf3b9646ceecc788f1db16e6657
Python
10,017
200
import numpy as np import pytest from alpineer import misc_utils from sklearn.cluster import KMeans from test_utils import make_cell_table from typing import List, Tuple, Callable import pandas as pd import ark.settings as settings import ark.spLDA.processing as pros from ark.utils.spatial_lda_utils import within_clust...
7dae29f314fc495555d858be584c1e02fe4806d0772639c98efe235db36a458b
Python
10,025
201
import os import numpy as np import nibabel as nb import shutil import scipy from scipy import stats as st from os.path import join as opj import subprocess from subprocess import Popen import meld_classifier.mesh_tools as mt from meld_classifier.tools_commands_prints import get_m def get_adj_mat(surf): all_...
6338b05fa2b07370ed45e9dfab0113381ce619f75bfdab0b57bb0a6ee13b9adc
Python
10,028
291
""" Support for aggregations according to [1]_. For instance the encoding of ``P(x, count<y>):-Q(x, y)`` in intermediate representation ``Implication(P(x, AggregationApplication(count, y), Q(x, y))`` produces the set ``P(x, z)`` where ``z`` is the number of tuples ``(x, ...)`` in the set ``Q``. .. [1] T. J. Green, S. ...
f1146078d4834b2f2b9f48be3318299d8b375f4ad929e8a5f49e1bfd43a9e040
Python
10,034
236
# Copyright 2018 The TensorFlow Authors. 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 applica...
3acda7f7036c17ba1f4a21fd47e87ac4011acea033ad9332fb11df7ad70fbb70
Python
10,035
214
from uff.ic.mell.sentimentembedding.datasets.dataset_loader import DataSetLoader from uff.ic.mell.sentimentembedding.classificadores.analisador import Analisador from uff.ic.mell.sentimentembedding.vocabularios.deepmoji_vocabulario import DeepMojiVocabulario from uff.ic.mell.sentimentembedding.vocabularios.emo2vec_voc...
8762f600fa231de845952e7d770563323b54354e389dc1b9eb045bcc24357a98
Python
10,035
263
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from typing import final, Literal from ax.adapter.base import Adapter from ax.analysis.analysis import Analysis from ax.anal...
53d50033614fb121ba4eb55292de826b3d158e769a38a0b027659cf31152ad44
Python
10,036
260
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
5f7ae080122db0e28e57efcad907167065b01756942d5e4a42c479fc7edea723
Python
10,043
255
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import numpy as np from ax.adapter.registry import Generators from ax.core.data import Data from ax.c...
2c6c6284b5f7c8a7010070808d4bbeae05e68163526b2005280d375fe5c756c8
Python
10,044
253
""" This example shows how to use a PointsDensity actor to show the density of labelled cells """ # We begin by adding the current path to sys.path to make sure that the imports work correctly import sys sys.path.append('/home/wirrbel/brainrender_update_2022-01/') import os from shutil import copyfile import in...
48e05cf37167c03b98b3a2e09eadc9abf9313dbebb7bbc365bea6ca4fef7c8cb
Python
10,046
297
import logging import numpy as np from datetime import datetime import os import sys import uuid import torch from allennlp.modules import TextFieldEmbedder, Seq2VecEncoder, FeedForward from allennlp.modules.seq2vec_encoders import PytorchSeq2VecWrapper from allennlp.nn import Activation from allennlp.training import ...
e13f2932587ebac107036fab64587e0a665b058f5d7172078e8a91fa8276852c
Python
10,048
296
"""Functions for computing sparsifiers of graphs.""" import math import networkx as nx from networkx.utils import not_implemented_for, py_random_state __all__ = ["spanner"] @not_implemented_for("directed") @not_implemented_for("multigraph") @py_random_state(3) @nx._dispatchable(edge_attrs="weight", returns_graph=T...
fe62244dbe5e738e533b696fb934158223bbc46a8919cd9ddb6848d8a3efbaa3
Python
10,054
373
from operator import eq, lt from typing import AbstractSet, Callable, Tuple import pytest from nl_expr.type_system import Unknown from nl_expr import exceptions from nl_expr.expression_walker import ExpressionBasicEvaluator, IdentityWalker from nl_expr.expressions import ( Constant, ExpressionBlock, Func...
01d4e8101c03c2201aa1bf9953670ab5433db7254e33d4e417e4fd54ff414dcf
Python
10,064
281
#!/usr/bin/env python3 import os from param_stamp import get_param_stamp_from_args from visual import visual_plt import numpy as np import main from param_values import check_for_errors,set_default_values import options from utils import checkattr ## Memory budget values to compare budget_list_CIFAR100 = [1, 2, 5, 10...
34e324005baa8b46278f0f7eff950223c6b9ccf1ff3337c8ed9df0b2e0f14504
Python
10,065
224
import numpy as np import pickle import torch from torch.utils import data from torch.utils.data.dataset import TensorDataset from torch.utils.data import DataLoader from torch.nn.utils.rnn import pad_sequence from sklearn.preprocessing import StandardScaler torch.set_default_dtype(torch.float64) class MyDataset_te...
336068d1e9d52923d8a1966e531fa78579e5ec247eb77d71e75471536ec8ca85
Python
10,068
329
# -*- coding: utf-8 -*- """ IlluminationCorrection ====================== The module provides a function to correct systematic illumination variations and vignetting in intensity. The intensity image :math:`I(x)` given a flat field :math:`F(x)` and a background :math:`B(x)` the image is corrected to :math:`C(x)` as:...
d6c8a939a761f1bb2ecc7674ffb85a6a9294e95ae7d2b6d92f91d7bdbb2da39c
Python
10,072
259
import pytest import networkx as nx from networkx import approximate_current_flow_betweenness_centrality as approximate_cfbc from networkx import edge_current_flow_betweenness_centrality as edge_current_flow np = pytest.importorskip("numpy") pytest.importorskip("scipy") class TestFlowBetweennessCentrality: def ...
f8eeeaca6be53bc7580e693a096723e4fe62e8ecd9510b03cb6d3125996e31e5
Python
10,079
323
# -*- coding: utf-8 -*- # # project-template documentation build configuration file, created by # sphinx-quickstart on Mon Jan 18 14:44:12 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated fi...
3acf3f839fca4ba6e1b8ab5f04cf9a1ebd46ed01726c831f879d525b265835c1
Python
10,081
252
#!/usr/bin/env python import argparse import os.path import subprocess import tempfile from glob import glob from subprocess import check_output from typing import ( Any, Dict, List, ) from galaxy.util import unicodify from galaxy.util.path import StrPath from .get_tests import ( hashed_test_search, ...
f5cde70983057bad866c1cb495276fa86da49132001a419a886501b779df4041
Python
10,084
300
# rmf 3.25.2020, last modified 9.20.2021 # cleaned up 3.1.2022 import sys, re import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plot import numpy as np # USAGE usage = 'python ' + sys.argv[0] + ' <summary file> <q-value threshold>' if len(sys.argv) != 3 or '-h' in sys.argv or '--help' in sys.ar...
0ec0340185184157824ef20e713146d596b64d4aa7b59ed287da617faffd6720
Python
10,085
277
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from __future__ import annotations import inspect import logging import warnings from collections.abc...
fb685b72a54961ced633bbda747d6f4df9ab61a12c79098011954202f819a8f2
Python
10,089
182
"""05_mre_efield_comparison.py - per-ROI comparison: MRE mechanics vs MD-dMRI microstructure vs tDCS E-field. Two outputs: consistency QC (MD vs stiffness negative, uFA vs stiffness positive) and a relevance map (dE_model_pct = 100*(E_MDdMRI - E_DTI)/E_DTI, isolates the conductivity model since the shared-montage field...
9d0e51ee8fc035be4d5a8c42f06b92ba9ae29a2325a6f0dfbe73a9a71386d8a1
Python
10,098
334
# test_meme_writer.py # Contact: Jacob Schreiber <jmschreiber91@gmail.com> import numpy import pytest from modiscolite.meme_writer import MEMEWriterMotif from modiscolite.meme_writer import MEMEWriter from modiscolite.meme_writer import array_to_string from memelite.io import read_meme from numpy.testing import ass...
5db6ff452972072fd5e3de774549c55e22136a382eb7bd57ef34a8a2b9962837
Python
10,100
351
"""Perform epoching. Here we make epochs out of the cleaned raw data. Our main target are epochs centered on each sample number (6000 per subj) --> "number epochs". However, for sanity checking the EEG data, we will also create epochs centered on the button press for each choice (600 per subj). We can then use these ...
90d4de7517273ba10ab36ff28e55ea3aaf75c689681b5953b026821bce755b96
Python
10,100
244
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' This script is for rescaling and resampling the aligned t1w mris ''' import SimpleITK as sitk import numpy as np import matplotlib.pyplot as plt import os import argparse import neurite as ne # # parse commandline args # parser = argparse.ArgumentParser() # parser.add_a...
89807617b8f542ddd00079211a718a720891341d46abd331b44df5e765dd4bf0
Python
10,102
264
"""Unit tests for the :mod:`networkx.generators.lattice` module.""" from itertools import product import pytest import networkx as nx from networkx.utils import edges_equal def test_hexagonal_lattice_no_pos(): # Test positions are note computed/stored when with_positions=False G = nx.hexagonal_lattice_grap...
c27d574f533d1164dcf56bacc6077ed40afdfbcc030bc26addb128695a0deb08
Python
10,112
282
#!/usr/bin/env python3 import os import numpy as np # -custom-written code import main from utils import checkattr from params.param_stamp import get_param_stamp_from_args from params.param_values import check_for_errors,set_default_values from params import options from visual import visual_plt ## Memory budget valu...
a55a5be45b5e816053c67b3a0d7830bbb0918b10e53b2bfb7695b6e13459d561
Python
10,114
318
"""Configuration sphinx documentation.""" # Ionpath's mibilib documentation build configuration file, # created by sphinx-quickstart on Tue Aug 2 08:57:24 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this ...
b12b314aab41185ece1c69b70dd537e89123d0bc6125b27473018c5f1e0de85c
Python
10,117
298
"""Train DNN models end-to-end to predict the EEG responses to arbitrary images. Parameters ---------- sub : int Used subject. modeled_time_points : str Whether each DNN should model 'single' or 'all' EEG time points. dnn : str DNN model used. pretrained : bool If True use a pretrained network, if False use a rand...
f33adf0bc984f818900b03b0d67908ffd1378bfae8fef31222163ad20585b466
Python
10,117
264
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
a2a4815f5d6d63d483195ba7a07cd62728a9207a97228b00d214d4625026f522
Python
10,128
235
from unittest.mock import patch import pytest from data_import.functions import _async_import_background_streaming, _async_reimport_background_streaming from data_import.models import FileUpload from data_import.serializers import ImportApiSerializer from data_import.uploader import load_tasks_for_async_import_streami...
2924dd8173dce903a2eff56834eb87f351970f122a16d19a2c2bdf5aa26867a3
Python
10,130
417
from pathlib import Path from unittest.mock import patch import numpy as np import numpy.testing as npt import pandas as pd import pytest from voxcell import RegionMap, VoxelData import atlas_densities.densities.excitatory_inhibitory_splitting as tested from atlas_densities.app.utils import DATA_PATH TESTS_PATH = Pa...
245e27d34f95abcf5b91ab362fbbb89e0a33e7416a19a12f2e63518a195ef5dd
Python
10,132
307
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache Licens...
9b4ed60328b24b1f8910845ff4a3eaec617db12b5c908cb065a69d3ed532c81b
Python
10,133
281
import numbers import numpy as np from .backend import get_backend from .validation import check_random_state def compute_lipschitz_constants(Xs, kernelize="XTX", random_state=None): """Compute Lipschitz constants of gradients of linear regression problems. Find the largest eigenvalue of X^TX for several X...
a4d951c74640f6385b96b361c40a1c5a597ca987e9b43195ae69c4abbaba291f
Python
10,137
204
import numpy as np from ..strategy import ConnectionStrategy from .shared import MorphologyStrategy from ...helpers import DistributionConfiguration from ...models import MorphologySet from ...exceptions import * class VoxelIntersection(ConnectionStrategy, MorphologyStrategy): """ This strategy voxelizes morp...
2d70b120fdf970413ef35b54395faa3a54aef675cfe9d0232ac2cd0575fd0af3
Python
10,142
240
# -*- coding: utf-8 -*- """ Created on Thru March 10 21:47:26 2022 @author: Zhiye """ import os, sys, glob, re, platform import time sys.path.insert(0, sys.path[0]) from generate_feature import * from keras.models import model_from_json,load_model, Sequential, Model from keras.utils import CustomObjectScope from kera...
bf5d1817445f35b42c1fbe7c4234871f4bc2752ef9425bcdc13a8b093d1cb1c1
Python
10,147
242
import sys from PyQt5 import QtGui from PyQt5 import QtCore from PyQt5 import QtWidgets from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import \ NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure from matp...
71b244bf19019457d28c16a542b6d3a9bfca151e9e2cca3b329fc95edb4fc902
Python
10,150
301
from __future__ import absolute_import import json import logging from pip._vendor import six from pip._vendor.six.moves import zip_longest from pip._internal.cli import cmdoptions from pip._internal.cli.base_command import Command from pip._internal.exceptions import CommandError from pip._internal.index import Pac...