sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ee99437a9dbf282cd94389849e169c7c91b5c0a45f9d5fe32b9a0c5a8d6b2540
Python
10,153
184
import re import sys import os import math from scipy import stats print("PPI_mutation_sites_mapping_by_disease") 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....
9e472a28b94c17593de2fbb32c8f57b2885087ded11fb588398366517cd8742a
Python
10,158
279
import math from collections import defaultdict from typing import List import numpy as np import tensorflow as tf from PIL import Image from tensorflow.python.keras.preprocessing.image import img_to_array from data import Data from utils import split_keys LABEL_INDEX = { 'ap': 0, 'bs': 1, 'mid': 2, ...
422a0a615853ea1f200013e0a48dec7a85bee65d7c99fb90a1bb8df230baa7ce
Python
10,162
303
import pandas as pd import numpy as np from tqdm.auto import tqdm from pathlib import Path import os,json from dataclasses import dataclass,field from typing import Optional from transformers import ( AutoModelForCausalLM, AutoTokenizer, AutoConfig, HfArgumentParser, TrainingArguments, MODEL_FOR...
66f5e4b7cb3993055afe20aa94ffc1899cd5b1b3e87790790a8c23eefc4a844c
Python
10,164
309
""" Logic simplifier for SQUALL parsed expressions. Collapses nested conjunctions, removes trivial operations, and normalizes quantifier expressions produced by the SQUALL parser. """ from nl_core.datalog.expressions import AggregationApplication as _AggApp from nl_expr.expression_walker import ( ExpressionWalker,...
53c184e1cc8571fd291c5422e3c5ab99ee8f1c83e27e9cc7c6ff426385fffaff
Python
10,166
243
"""Pairwise decoding of the synthetic EEG test data, and noise ceiling calculation. For each EEG time point, a SVM classifier is trained to decode between each combination of two biological data image conditions (using the EEG channels data), and is then tested on the corresponding combinations of two synthetic data im...
2f56511a9ebac03f4bad2861cd91c44fb848a4a0826a249cb62ee17b2b889d16
Python
10,167
302
from __future__ import division import numpy as np import pandas as pd import sys from scipy.stats import t from scipy.stats import fisher_exact from scipy.sparse import csc_matrix import numexpr as ne import cellranger.analysis.diffexp as cr_diffexp ALLOWED_NB2_MODELS = ['poisson', 'geometric', 'nb'] def sanitize(Y...
7425aadb3fae14e2fcc6ae0e20fd66ad9961925b467d85087312b989186e6453
Python
10,175
290
# -*- coding: utf-8 -*- """Prepare data for training based on a specified config file """ # Created on Wed June 17 2020 # Contributions and Changelog accessed via a private git repository: # https://github.com/philipwijesinghe/deep-learning-lsm.git # philip.wijesinghe@gmail.com # Copyright (c) 2020 Philip Wijesinghe...
28715443752c4dfc760b32252a18e96c3b5157a8654827ac3da3774aa91320b8
Python
10,178
281
import random import time import numpy as np import scipy.sparse as sp import torch import torch.nn.functional as F from tqdm.auto import tqdm from ..base import InjectionAttack, EarlyStop from cogdl.utils.grb_utils import eval_acc, feat_preprocess, adj_preprocess, getGraph, getGRBGraph class FGSM(InjectionAttack):...
b0318162a6ff366b8c0a151692fe58b6b16798bb0c0eca678d3f9d237ea24c0c
Python
10,179
190
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...
bce12646cd4c92e00fb1f7120ac83c7d6c33045f1a4359202367472ff1afd190
Python
10,182
235
#!/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 from logging import Logger from typing import TYPE_CHECKING from ...
59d211936ec3fc0ae63ecf6d769bd02d0095e139aeb36d76050871b0520c6209
Python
10,184
297
"""Priority queue class with updatable priorities.""" import heapq __all__ = ["MappedQueue"] class _HeapElement: """This proxy class separates the heap element from its priority. The idea is that using a 2-tuple (priority, element) works for sorting, but not for dict lookup because priorities are o...
e7fad9e6b23fa3c54326bf91e1b7ac47e5dc3f0298f3e7479f8566aeb941a2b7
Python
10,190
318
""" Unit tests for edgelists. """ import io import textwrap import pytest import networkx as nx from networkx.utils import edges_equal, graphs_equal, nodes_equal edges_no_data = textwrap.dedent( """ # comment line 1 2 # comment line 2 3 """ ) edges_with_values = textwrap.dedent( """ ...
fba8fa38a480c55ef4cbfd22505fba1e16cf5d677c97e6d2aa8c06d62843f502
Python
10,190
338
""" This module has functions or callable objects that can be used to compute features from segmented time series data Sets of these functions or callables can be passed in a dictionary object to initialize the ``FeatureRep`` transformer. All functions follow the same template and process a single segmented time seri...
e57963a757bfb364140e99aec57a7504dbe378e7ac76031e2b2ee50983f3f6ed
Python
10,196
298
""" Tests for closeness centrality. """ import pytest import networkx as nx @pytest.fixture() def undirected_G(): G = nx.fast_gnp_random_graph(n=100, p=0.6, seed=123) cc = nx.closeness_centrality(G) return G, cc @pytest.mark.parametrize("precompute_sp", (True, False)) class TestClosenessCentrality: ...
3e7420b6a74a67498fd904fc660f1e0638ddcc95ddffee392cc77fae65e4b5b3
Python
10,201
319
from random import Random import pytest import networkx as nx floyd_fns = [ nx.floyd_warshall_predecessor_and_distance, nx.floyd_warshall_tree, ] @pytest.mark.parametrize("floyd_fn", floyd_fns) class TestFloyd: @classmethod def setup_class(cls): pass def test_floyd_warshall_predecessor...
052c5f20c8304ca0a3e1205068c45ef081fc1b1c45f19e8172760ea8b40f37ec
Python
10,202
270
import sys sys.path.insert(0, "..") import numpy as np import tensorflow as tf from learnMSA.legacy.MsaHmmLayer import MsaHmmLayer from learnMSA.legacy.MsaHmmCell import HmmCell from learnMSA.legacy.Initializers import ConstantInitializer # from learnMSA.legacy import Align, Emitter, Transitioner, Initializers, MsaHmm...
401dbe712523d63aef5997cf5edb6c669c8069c420b4a2d5935e2f416f53a521
Python
10,206
305
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading import warnings from base64 import b64encode from .compat import urlparse, str, basestring from .cookies import extract_cookies_...
30fd24b85571d705ae3ecb43194b7990a528ffb66113096858c59000e79fe428
Python
10,208
248
#!/usr/bin/env python3 """Compare two Kraken 2 installs (a PR and its base) on the test fixture. Usage: tests/pr_compare.py BASE_INSTALL HEAD_INSTALL WORK_DIR [BIG_READS_PREFIX] Each install builds its own database from data/ with kraken2-build and then classifies the frozen fixture reads in tests/data (and, when giv...
2f2d65cc95649efba0a3d7829190656025cd91fd5cd99e650cf4f4577fec7f38
Python
10,210
245
import numpy as np from ..strategy import ConnectionStrategy from .shared import MorphologyStrategy from ...helpers import ( DistributionConfiguration, assert_attr_in, ) from ...reporting import report, warn from random import sample as sample_elements class TouchInformation: def __init__( self, f...
1bf25012ba16ba89d7b66d627496c947954b5bced9cd31e9c581f7935747082f
Python
10,214
267
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import xarray as xr from pynndescent import NNDescent from scipy.stats import ks_2samp from sklearn.decomposition import PCA from sklearn.metrics import roc_curve from ALLCools.mcds.utilities import calculate_posterior_mc_frac...
51d7319e919b9c57609fd5c47ef97e931742572fe9af959b4c68f66a7e0639da
Python
10,224
231
#!/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 time from abc import ABC, abstractmethod from collections.abc import Sequence from typing impor...
52f087a7feaddb37505ebdc03e24beae3caf40b89f19f28ad9ca70d883935880
Python
10,224
284
import argparse import os import numpy as np import math import itertools import datetime import time import torchvision.transforms as transforms from torchvision.utils import save_image, make_grid from torch.utils.data import DataLoader from torchvision import datasets from torch.autograd import Variable from model...
3f8732d0966cd1b2dc1c8d2354fc8b7271ec261909255286482a0e46cc658223
Python
10,225
259
# coding=utf-8 # Copyright (c) DLUP Contributors import h5py import torch import torch.nn.functional as F from pytorch_lightning import LightningModule import torchmetrics from torch import nn from pathlib import Path import json class Attention(LightningModule): #TODO implement slide-level or patient-level AUC? ...
b836a73083dfe7e977f147017a9ff59789df75d2d03c5999c0461f2f2f7e936b
Python
10,229
192
from brian2 import SpikeMonitor, get_logger from brian2lava.utils.utils import mode_dependent from brian2lava.utils.const import HARDWARE from lava.proc.monitor.process import Monitor import os try: from lava.utils.loihi2_state_probes import StateProbe # import here because this is only part of lava-loihi from ...
fa2d3a7329935fee6e96acc0648c3070cb71d52d6026885f477fad174c67c5f1
Python
10,232
224
#!/usr/bin/env python import os import sys import errno import argparse def parse_args(args=None): Description = "Reformat nf-core/nanoseq samplesheet file and check its contents." Epilog = "Example usage: python check_samplesheet.py <FILE_IN> <FILE_OUT>" parser = argparse.ArgumentParser(description=Des...
5f056e2761167ddba4bb06e14aae6c7397ec5f57155eb2a308afe732d8cac5da
Python
10,242
268
import argparse import json import os import time import uuid import dgl import numpy as np import torch import torch.nn.functional as F from dgl.data import register_data_args from nci_model import * from nci_process import get_network from pytorch_lightning.metrics.classification import Accuracy fr...
8d60ec834f1c33c70e7a4016b5ce4479f7e5cc08261d4a4b588e29bb1e2d760b
Python
10,244
219
import os, sys, json sys.path.append('..') # import libraries import torch import pandas as pd import torchvision from torchvision import transforms from torch.utils.data import DataLoader from utils.data_utils import ImageDataset from trainScript import Trainer from clutils import logger, save_config, set_seed # set...
b9641845bb5acc3c4eb4984913b0233c9861a7dc4f340b400e389946037e86f4
Python
10,245
270
import os import fanc from fanc.config import config import fanc.plotting as kplt import fanc.commands.fancplot_command_parsers as parsers def triangular(parameters): parser = parsers.triangular_parser() args = parser.parse_args(parameters) if args.colormap is None: colormap = config.colormap_hic...
767987b493da54ac892101f1c0c12a4c45ded8f441b6352bd0bd0f2717001935
Python
10,250
321
#!/usr/bin/env python3 # # zarr documentation build configuration file, created by # sphinx-quickstart on Mon May 2 21:40:09 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 file. # # All c...
567106bded7eefa3c04dd6c98620cf68c4d11267fefc6cd4679b917704c43a30
Python
10,253
264
from torch.utils.data import Dataset import os from PIL import Image import numpy as np import torch from torchvision import transforms import scipy.io as spio class ScanpathLoadDatasets(Dataset): """ A PyTorch Dataset class to be used in a PyTorch DataLoader to create batches. """ def __init__(self, ...
bf14091e92092f6119d79055dcfba264f20f935693d6b8242d00fc687adcafb0
Python
10,256
247
import copy import itertools import logging import cooler import numpy as np from matplotlib import cm, colors from pygenometracks.tracks.GenomeTrack import GenomeTrack from pygenometracks.utilities import change_chrom_names DEFAULT_MATRIX_COLORMAP = "RdYlBu_r" logging.basicConfig(level=logging.DEBUG) log = logging.g...
ccc8cb6c23832f3225cb9a1d8d30221316db26993a1323b3357bc432985054e5
Python
10,260
270
import os import pickle import matplotlib.pyplot as plt import numpy as np import palettable.colorbrewer.qualitative as qual_palettes import pandas as pd import seaborn as sns import spatial_lda.online_lda from alpineer import io_utils, misc_utils from scipy.spatial.distance import pdist from spatial_lda.visualization...
03bb1758e74fa80c45d3eb333699ad9723f1292469c2d9d95a04c1419c9d3d97
Python
10,262
262
# 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...
94043d54eabb8ecf281f6aade5ce11b421e797bb70a9f966171aab07b68ff51c
Python
10,268
306
"""Generate and save combined annotations or combined markers Combination operates on two or more volumetric files with nrrd format. """ from __future__ import annotations import json import logging from pathlib import Path import click import numpy as np import pandas as pd import voxcell # type: ignore import yam...
a4db0565fbadeb12a481a19ce8ebb5a152900b3a3488903d892f34562f45c7bc
Python
10,268
373
""" ************** Adjacency List ************** Read and write NetworkX graphs as adjacency lists. Adjacency list format is useful for graphs without data associated with nodes or edges and for nodes that can be meaningfully represented as strings. Format ------ The adjacency list format consists of lines with node ...
cedd3235015009adf43806bae198840318322b2e8d5f704170807d3817c9dc1c
Python
10,280
310
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ | Title: Quality assessment of the preprocessing pipeline | Date: 2021-02-01 | Author(s): Theodor Rumetshofer | Description: This script generates images for each subject for manual quality assessment. | List of functions: ...
5b6b02d821caed5596401229125eb3a100ce5269eca14de6a56775160cd561e1
Python
10,284
233
import itertools import re from copy import deepcopy from typing import Iterable, Optional, Sequence, Tuple, Union import numpy as np from pymatgen.core import Composition, Structure from rlmolecule.sql import hash_to_integer from rlmolecule.tree_search.graph_search_state import GraphSearchState from rlmolecule.tree_...
f5b777fba02c41cdf258662316916b2683094c8e6173747e02394eb31ddd3da0
Python
10,285
313
# dataset name: DGraphFin from utils import Dgraph_Dataloader from utils.utils import prepare_folder from utils.evaluator import Evaluator from logger import Logger from cogdl.data import Graph from cogdl.datasets import NodeDataset from models import GCN, MLP, GAT, Grand, Graphsage, GraphSAINT, MixHop, sgc, D...
2b9b18eaacabfa55ba4be20076003feafd8d645d30368c7f1d13cfeeb9c35356
Python
10,290
224
# 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 # NOTE: Do not add `from __future__ import annotations` to this file. Adding # `annotations` postpones evaluation of types an...
fc094bb8880165a4965aefa07dca061f07ffc96dcdc2a8c7cdd63ccf7294a7d0
Python
10,291
296
import pathlib import subprocess from concurrent.futures import ProcessPoolExecutor, as_completed import anndata import numpy as np import pandas as pd import scipy.sparse as ss from anndata import AnnData from ..utilities import ( chrom_dict_to_id_index, generate_chrom_bin_bed_dataframe, get_bin_id, ...
930f1df73a172b130f539725298da6cc8965c7db20845c6b54952bcdb8def208
Python
10,295
294
from tracemalloc import start from turtle import pos from typing import List import os import random import numpy as np import scipy.sparse as sp import torch import torch.utils.data from cogdl.utils import remove_self_loops, row_normalization from cogdl.data import Graph, DataLoader from cogdl.utils import RandomWalk...
6b1dada3e2692520d2097c7c18e56064a5b06ba64416b2fae97696e6e9fda252
Python
10,297
295
# -*- coding: utf-8 -*- """ Created on Thu Aug 26 15:20:33 2021 @author: Estefany Suarez """ import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import os import itertools as itr import numpy as np import pandas as pd from scipy import stats from sklearn.manifold import MD...
7788252464b3a767fbbb295cafec146db83dbd1fd01977e133355d002b46bbfc
Python
10,299
228
from __future__ import annotations from typing import Any, Literal import numpy as np import pytest from anndata import AnnData from pandas.testing import assert_frame_equal from squidpy._constants._pkg_constants import Key from squidpy.gr import co_occurrence, spatial_autocorr from squidpy.gr._ppatterns import _fin...
6130aaf5f036a1d0042988f02726d230ebc1a9786c79d6b13b551f192f304332
Python
10,303
296
# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # Modified by C. Kirst to allow arbitrary rotations from __future__ import division import numpy as np from vispy.scene.cameras.perspective import Base3DRota...
fb8345666caf4da7b6ab21c5c431898b62f895c3d505d72182c83e1f26f7ed0a
Python
10,304
229
# -*- coding: utf-8 -*- from figureflow import figure import seaborn as sb import numpy as np import os import importlib importlib.reload(figure) Figure = figure.Figure # get the path to the data of the respective figure or movie # the data is in the data folder in a folder with the same # name as the folder that t...
b5fd8aa99c18dc4c186f5bcb2716ed9178e245a6eba9ab4ef0d2da0ab458c804
Python
10,306
233
import os import numpy as np import pickle import torch from torchvision import transforms import copy import tqdm from torch import nn from torch.utils.data import DataLoader,TensorDataset from models.fc import excitability_modules as em from data.available import AVAILABLE_TRANSFORMS ##------------------------------...
784cf866281038667a93b135c5d6b2af235eb79446a1dc622e35485ce086f348
Python
10,307
238
# -*- coding: utf-8 -*- import pandas as pd import os import re import copy import numpy as np import time def goDeeper(props,this_path,a,max_a,conditions,folders): a += 1 for newFolder in os.listdir(this_path): print(newFolder) if conditions[a-1] != "": if newFolder...
37a563886ba363e7796997ed56b0e073fc60bb7d0e009403f7cfcbf8f3fa2f4b
Python
10,309
233
import os import numpy as np import pickle import torch from torchvision import transforms import copy import tqdm from torch import nn from torch.utils.data import DataLoader,TensorDataset from models.fc import excitability_modules as em from data.available import AVAILABLE_TRANSFORMS ##------------------------------...
8f13f1955acf6832adc12180f586db5b26d50bdf44b84ac030e198a79d79b50a
Python
10,313
335
from collections import namedtuple from inspect import isclass from itertools import tee from functools import lru_cache from typing import Tuple, Iterable import numpy as np from nl_expr.expression_walker import ReplaceExpressionsByValues from nl_expr.expressions import Constant from nl_expr.type_system import Unkno...
2c9b8fea18223483acc3d5e8fe04f9c2672c46587a4e1954b3c25e3101f12754
Python
10,314
252
"""Macenko and Vahadane stain decomposition (fit + apply). Pure DataArray/numpy layer: no ``sdata``, no public export. The stain-matrix fits run on tissue pixels (a bounded reduction at the chosen scale); the apply transform is a single per-pixel matmul and stays lazy. ``params`` arguments must already be resolved by...
9c4f9078cab21883309d0eafe2eb11c7154b17077bf5b441ffc2cbacfcb3132a
Python
10,316
215
# 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...
e4032f8b8061f9b86dcba9a5d7d3199838be7c7bea25e7e52528bfb21178c569
Python
10,316
268
import argparse import json import os import time import uuid import dgl import numpy as np import torch.nn.functional as F from dgl.data import register_data_args from pytorch_lightning.metrics.classification import Accuracy from pytorch_lightning.metrics.functional import auroc from reactome_model im...
79d718386707d21330a998e6cbcff18fc8280982c1e77a49c04ae82c91b4e9ef
Python
10,322
258
"""Bindings for the Barnes Hut TSNE algorithm with fast nearest neighbors Refs: References [1] van der Maaten, L.J.P.; Hinton, G.E. Visualizing High-Dimensional Data Using t-SNE. Journal of Machine Learning Research 9:2579-2605, 2008. [2] van der Maaten, L.J.P. t-Distributed Stochastic Neighbor Embedding http://homepa...
a47ac19a2b3988905c47f7e2b1d65cf35800b0958eafc8812a5e3d6ab3be0be9
Python
10,322
242
import abc import optuna import joblib import numpy as np import pathlib class BaseModel(abc.ABC): """ BaseModel parent class for all models that can be used within the framework. Every model must be based on :obj:`~easypheno.model._base_model.BaseModel` directly or BaseModel's child classes, e.g. :o...
f624bc9bc2dd64a6a4636c1f0bec64d40b4de36ef526d80efbbf73fdd07c0710
Python
10,322
285
import random import time import numpy as np import scipy.sparse as sp import torch import torch.nn.functional as F from tqdm.auto import tqdm from ..base import InjectionAttack, EarlyStop from cogdl.utils.grb_utils import eval_acc, feat_preprocess, adj_preprocess, getGraph, getGRBGraph class PGD(InjectionAttack): ...
dad0d792576a3d0261c9a757ccbdab1a155b8d4c8135e5d785a11f9dc1e5da24
Python
10,326
341
import string, re, sys, datetime from .core import TomlError from .utils import rfc3339_re, parse_rfc3339_re if sys.version_info[0] == 2: _chr = unichr else: _chr = chr def load(fin, translate=lambda t, x, v: v, object_pairs_hook=dict): return loads(fin.read(), translate=translate, object_pairs_hook=objec...
94634a486b49c582604af258c57d15ce42ddd425d402beaec41793c602551e33
Python
10,336
191
import re import sys import os import math from scipy import stats print("PPI_mutation_sites_mapping_by_disease") 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....
f395f0f1cdb5cdf8f64be5b16bd17af1a302beb9517bb94af18eaf4392cf398a
Python
10,337
261
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.""" import logging from datetime import timedelta from core.utils.common import create_hash, load_func from django.conf import settings from django.db...
13872a6f4e2bdc6b50d3c821f63dbd13d8b5e9898b96717e42ce92d02f751914
Python
10,338
288
from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import LinearSVC, SVC from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import (LogisticRegression, LinearRegression, ...
648f3b5c4b95062e792995b562210532aac288b314672a2936fc257024b1eab1
Python
10,339
291
# 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 collections.abc import Mapping from typing import final, Literal from ax.adapter.base import Adapter from ax.adapter.to...
c89b7a92be286fed345886565a97c08122a77a797b6238e090d0bb129b2e5250
Python
10,339
425
# -*- coding: utf-8 -*- """ NPY === IO interface to numpy arrays. """ __author__ = 'Christoph Kirst <christoph.kirst.ck@gmail.com>' __license__ = 'GPLv3 - GNU General Pulic License v3 (see LICENSE.txt)' __copyright__ = 'Copyright © 2020 by Christoph Kirst' __webpage__ = 'http://idisco.info' __download__ = 'htt...
efc73d572c991d58c63b0f00427aef9d7e3a5e53a7e4b2bda0a1669a23fb8c4a
Python
10,342
159
# 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...
3f497913a92c9af7c2360dabc9fac9b99c1b30fd91d72a4fa32bf3ab7b76423f
Python
10,347
270
import logging import os import numpy as np from tqdm import tqdm import torch from utils import ( WandbLogger, build_args, create_optimizer, set_random_seed, load_best_configs, show_occupied_memory, ) from models import build_model from datasets.lc_sampler import ( setup_training_datalode...
b401a1c811a33ed9d1cc2b8b9d53dcf09467344c7d3012f12bf3c6507b80d210
Python
10,348
266
""" Build what the in-browser REPL downloads, in OUTPUT_DIR: - the wheels of NeuroLang's packages, - the data the ``neurosynth`` engine needs, as a zip in the layout of its data directory, and - ``bundle.json``, which names them for ``doc/_static/repl/worker.js``, - ``highlight.json``, the words the page's code box ...
f7cb5dca558aaab2d029d365a634f636f229b8e176993d8b861e4ecd58371eef
Python
10,355
338
""" Min-heaps. """ from heapq import heappop, heappush from itertools import count import networkx as nx __all__ = ["MinHeap", "PairingHeap", "BinaryHeap"] class MinHeap: """Base class for min-heaps. A MinHeap stores a collection of key-value pairs ordered by their values. It supports querying the min...
5cd3b1d6cb219b4278ecc278a49173c8900dba67b7724ff3a4e713fcee165a1a
Python
10,358
315
# -*- coding: utf-8 -*- """ Created on Wed Dec 4 11:35:36 2019 @author: aaussel """ from cells.RE_mdPul import * from cells.TC_mdPul import * from cells.HTC_buffer_mdPul_Destxhe_tests import * from mdPul_one_column_v3 import * from scipy import signal prefs.codegen.target = 'numpy' defaultclock.dt = 0.01*ms run...
94db6effd441e5a3b71a28ee5ce50909f52dc6e0d113eebcc3e960cf11eee3d9
Python
10,363
251
# -*- coding: utf-8 -*- """ Example script to set up the parameters for the image processing pipeline """ ######################### Import modules import os, numpy, math import ClearMap.Settings as settings import ClearMap.IO as io from ClearMap.Alignment.Resampling import resampleData; from ClearMap.Alignment.Elas...
7090d119426687e39c23fd4ec7a9ab6e8594ae3fbe284442e16a8a901fa1a2ce
Python
10,372
233
# 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 License, Version 2.0 (the # "Li...
381fa2cc041a7866e2a9b4b883d37c807a850976a380824de5eb0057a6112ab8
Python
10,373
186
import pandas as pd import numpy as np import os import re import time import csv import pathlib from ..preprocess import base_dataset from ..utils import helper_functions from ..evaluation import eval_metrics from ..model import _param_free_base_model class ParamFreeFitting: """ Class that contains all info...
6ef85afcad558079fa2835f333d65c85681589634de38f08be561e5074211e39
Python
10,375
277
#!/usr/bin/env python # # Copyright (c) 2019 10x Genomics, Inc. All rights reserved. # from __future__ import division import sys import urllib import re import os import json import subprocess import shutil import requests import numpy as np import pyfasta from tools import ReferenceManager from tools.io import pea...
20ef577e47b9564d120b873b511e186d032355906e003401b7fc2531a3b14d24
Python
10,381
281
import pytest import networkx as nx from networkx.utils import graphs_equal np = pytest.importorskip("numpy") sp = pytest.importorskip("scipy") class TestConvertScipy: def setup_method(self): self.G1 = nx.barbell_graph(10, 3) self.G2 = nx.cycle_graph(10, create_using=nx.DiGraph) self.G3...
85af31c2b5834a9381956a1b70aff6ad0a9b8ff18b53ad7cade8ed99ce840f8a
Python
10,385
244
#!/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 from copy import deepcopy from typing import cast, TYPE_CHECKING ...
2d1e54f7793fbdef3c1d2bb4e26e50311275069e39d345a96405ee3b3de2027c
Python
10,391
307
from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING import numpy as np import pandas as pd import pytest from pandas.api.extensions import ExtensionArray from scipy import sparse as sp from anndata import read_h5ad from anndata.acc import A from anndata.compat imp...
9618df2fefb8d4606c07e610729427ffa65a2c8a17f885385a8b87a00f8c779d
Python
10,393
297
from __future__ import annotations from importlib.util import find_spec from typing import TYPE_CHECKING import numpy as np import pandas as pd import pytest import zarr from zarr.storage import MemoryStore from anndata import AnnData from anndata._core.xarray import Dataset2D from anndata.compat import DaskArray fr...
270395fdb59fec357c62a22dab8987ed436805eb235bb9005dac6098cae7ab3e
Python
10,400
297
from __future__ import division import matplotlib as mpl import numpy as np from math import log10, floor import pybedtools as pbt import fanc from genomic_regions import RegionBased style_ticks_whitegrid = { 'axes.axisbelow': True, 'axes.edgecolor': '.15', 'axes.facecolor': 'white', 'axes.grid': True...
3b4712c54a96cf15ae6f4457ee91baf8ce7a2e990870884204a689e31a5143e1
Python
10,407
322
from typing import Optional import torch import triton import triton.language as tl from ..triton_layout import ( _block_minor, _neuron_grid, _neuron_indices, _spatial_offsets, _time_offset, _triton_layout_args, ) from ..triton_surrogate import _surrogate_gradient from .autograd import _check_...
a844a4fac0beb74d6f2d872b0d08fb02668bf16abe953534a214dbdad68061b9
Python
10,408
241
# 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...
6f3be8d4ce2506352bc15c9cb3861314fbfe960ad8305cd099577935d282981a
Python
10,411
252
#!/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 from logging import Logger from typing import TYPE_CHECKING impor...
6e38527a61b7b99b304337408f33f5db527855ef08677ac022e02e880a252dc7
Python
10,412
295
#!/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,...
47b508949848328287366e64886d3f118e1a3d2d78a76e93279857fdc1e426ac
Python
10,414
264
# -*- coding: utf-8 -*- """ Inteface to Illastik pixel classification This module allows to integrate ilastik pixel classification into the *ClearMap* pipeline. To train a classifier ilastik should be used: * Note: Note that ilastik classification works in parallel, thus it is advised to process the da...
436ee0c5c4cb5165d2d777c64f10eb93e7e15411db441e14af4fd2f90b609998
Python
10,415
298
# 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 from collections.abc import Sequence from logging import Logger from typing import final ...
7aac22e5b84231c848b4a951014c38c06551b4750ad09cd391a5c9154cb15c4c
Python
10,419
416
"""Functions for finding and evaluating cuts in a graph.""" from itertools import chain import networkx as nx __all__ = [ "boundary_expansion", "conductance", "cut_size", "edge_expansion", "mixing_expansion", "node_expansion", "normalized_cut_size", "volume", ] # TODO STILL NEED TO ...
6bb98101aa06b7d3d51f8f8f9a17e4c483cb7f012f3fabb13dab14e07747227e
Python
10,425
346
BEST_CONFIGS = { "chebyshev": {"general": {}}, "dropedge_gcn": {"general": {}}, "gat": { "general": {"lr": 0.005, "epochs": 1000}, "citeseer": {"weight_decay": 0.001}, "pubmed": {"weight_decay": 0.001}, "ppi-large": { "nhead": 4, "hidden_size": 256, ...
0d6b76db6772ecfdc0a84dc0d5e7bb4ad27ee0464e5c50f7df8302202b0d96c3
Python
10,427
264
from __future__ import annotations import platform from collections.abc import Sequence from functools import partial import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytest import scanpy as sc from anndata import AnnData from matplotlib.colors import ListedColormap from squidpy import p...
ce1df14e9e599bf542b6cd22c60d0e69f24e5bd63581e35b75d869eb596b21ae
Python
10,429
232
#!/usr/bin/env python # Copyright Michael Fonder 2021. All rights reserved. # ============================================================================== from __future__ import absolute_import from __future__ import division from __future__ import print_function from utils.custom_layers import * from utils import ...
49b0e5981d8af68ff970cb8d4c785111ac7ae1ecfa8162f5c5072ebad829a014
Python
10,430
306
from collections import defaultdict from typing import ( TYPE_CHECKING, ) from pydantic import ValidationError from typing_extensions import Self from galaxy.model import CollectionStateSummary from galaxy.tool_util_models.parameters import ( AdaptedDataCollectionPromoteCollectionElementToCollectionRequestInt...
73fc928b7d56e23fcb1e8c3923d53178494d5d47eff7271a77e686e35e08a00f
Python
10,433
287
# -*- coding: utf-8 -*- import torch import torch.nn as nn from torch.nn import init import torch.nn.functional as F import numpy as np class GraphConv(nn.Module): def __init__(self, input_dim, output_dim, add_self=False, normalize_embedding=False, dropout=0.0, bias=True): super(G...
d09f741fb5e3e5d70c9bb056095c4f85ab56adb8af21eab14bc0b2598be1d2d0
Python
10,433
278
# 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...
5eb2c2fcfd49a0150f3605d8e4ae95c5a4246857101881a1ac2858d2bf2500e3
Python
10,443
252
import numpy as np from brian2.core.variables import Variables from brian2.units.fundamentalunits import Quantity def variableview_set_with_index_array(self, variableview, item, value, check_units): """ Is called when a variable is set with a numerical (or slice) index and numerical target value (e.g. ``G.v[...
3270eb345c04c36daae2cb303e18719f0b52df52191c3accb078a721d423ccee
Python
10,454
301
import torch from dotmap import DotMap def _get_transformed_grid(Nx_undersampled, Ny_undersampled, N_layers, thicknesses): """Creates x,y,z in the space [-1,1]**3 . Z weighted by thicknesses Args: model (torch.model): Trained neural network model. Should map one 4D input. Nx_undersampled (i...
660cd8bfe73e85b8025c73c3d3b01dd861ba7bfc091b4726636b70954434c5a7
Python
10,456
300
import os import random import matplotlib.cm as cm import matplotlib.pyplot as plt import networkx as nx import numpy as np import torch from grave import plot_network, use_attributes from tabulate import tabulate from cogdl.data import Graph from cogdl.datasets import build_dataset_from_name, NodeDataset from cogdl....
85544564fe1903034fc541a7a3841901497bef2f5062d2b28919e9e2bc373432
Python
10,460
242
# 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...
f048e0da8abea81a52e25aee4ffd4c02e6a2c5940dd317f34272d731d42db31b
Python
10,461
253
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 14 16:08:34 2021 @author: kurata """ import os import pandas as pd import torch import torch.utils.data as data from torch.utils.data import DataLoader from torch import optim import numpy as np from network import Deepnet import argparse import wa...
163b0a7978eafb16b88003ae23fd9cede1340b1c9786d18dde6c97f10051474b
Python
10,462
308
import argparse import os import numpy as np import math import itertools import torchvision.transforms as transforms from torchvision.utils import save_image from torch.utils.data import DataLoader from torchvision import datasets from torch.autograd import Variable from mnistm import MNISTM import torch.nn as nn ...
84cbaafc963e284cb281cb170e08229e21ddb3d857767a1d1faf569ec688ad1e
Python
10,467
266
# 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 unittest.mock import patch from ax.adapter.random import RandomAdapter from ax.adapter.registry import Generators from ...
35b1fee77a879c6cd3c1cc019e5853955454862baecda3898c3f79df22d1052d
Python
10,481
231
# 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 License, Version 2.0 (the # "Li...
f6e4522db13f98dc1b8bdb2e361d16fee477d35e52bcfb72b7542a4c6ad4c85a
Python
10,481
293
#!/usr/bin/env python3 import os import numpy as np from param_stamp import get_param_stamp_from_args from visual import visual_plt import main_task_free from utils import checkattr from param_values import check_for_errors,set_default_values import options ## Function for specifying input-options and organizing / ch...
8fe5d76106a3699d54f7780f8fcf4b6ba7197a8a02e8e464691428c4ddb55665
Python
10,488
238
import logging from typing import Dict, List, Optional, Tuple from pymatgen.core import Composition, Structure from pymatgen.analysis.phase_diagram import PhaseDiagram, PDEntry from src import reward_utils from src import ehull logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class Stru...
3276c54e8be1fc92444a3057b60543f88df61c68cf2de09c7ef86f2434740d01
Python
10,489
262
#!/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 warnings from unittest import mock from unittest.mock import MagicMock, Mock, patch from ax.ad...
3863bded27e56feb3c9bb18eeab9af38a2d34f55aa8bcc750ca78b08fd0f8942
Python
10,493
221
## This script runs the MELD surface-based FCD classifier on the patient using the output features from script 2. ## The predicted clusters are then saved as file " " in the /output/<pat_id>/xhemi/classifier folder ## The predicted clusters are then registered back to native space and saved as a .mgh file in the /outpu...