sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
c31bd30cdc6be9ca2df02f9ddbdac0ba06f4fc3e3fc3fe7c5906251b2fc9b519
Python
11,721
212
import re import sys import os import math from scipy import stats print("ALL_PPI_mutation_sites_mapping_with_allonco") output = open(r'E:\OneDrive\学术\PPI article\data\mapped data\3. DNM_complex_mapping\ALL_Complex_PPI_mutation_sites_allonco.txt','w+') with open(r'E:\OneDrive\学术\PPI article\data\mapped data\...
cefc114578aef6880a684a07acfb429db54a699f8a267d84c019bb8db9c5c55d
Python
11,729
329
import torch # import torch.fft import torch.nn as nn import torch.nn.functional as F from cogdl.data import Graph from cogdl.utils import row_normalization from cogdl.utils.link_prediction_utils import GNNLinkPredict, sampling_edge_uniform, cal_mrr from .. import BaseModel # def ccorr(a, b): # return torch.fft...
4e437bdd277647391b073283ff29ed6fa740c9da5ba4a9d8502e9b7228c8907f
Python
11,732
349
from typing import Union, Tuple, Set from .aabb_tree import AABB import numpy as np from copy import deepcopy from functools import singledispatch, update_wrapper def methdispatch(func): dispatcher = singledispatch(func) def wrapper(*args, **kw): return dispatcher.dispatch(args[1].__class__)(*args, *...
24309967f3cb112a888046d4f263f2a04b9f5b0a0e888ab2800d7bf906487b7b
Python
11,733
396
from . import idnadata import bisect import unicodedata import re import sys from .intranges import intranges_contain _virama_combining_class = 9 _alabel_prefix = b'xn--' _unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]') if sys.version_info[0] == 3: unicode = str unichr = chr class IDNAError(Unico...
632856c42d0a1186c07a36f4612e6d44bb26e9fc23e5221e953ebbca0e007c96
Python
11,733
223
""" Created on May 2, 2025. @author: voodoocode """ import numpy as np import sklearn import pyvista import finnpy.src_rec.fwd_mdl # @UnresolvedImport import copy def plot_reg_avg(subj_to_fsavg_mdl, morphed_channels, color_data, signal_type = None, rec_meta_info = None, coreg = None, ch_names = Non...
633204add3b4df58e74f0ed77d1ea5be85624c4f3c931839500d4a76b64bd842
Python
11,733
337
# rmf 3.25.2020, last modified 5.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> <p-value threshold> <asterisk threshold> <FDR annotation (True or False)>' details =...
b7ac1546dc77ce9c3a9f409a56b4253c8ec5a1a6eb63c73d64ae47ced4cff68a
Python
11,734
354
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 7 11:45:28 2024 @author: colin """ from dicom2bids import * import os from os.path import join as pjoin from os.path import exists as pexists import sys import subprocess import fcntl import random import shutil import zipfile import time from pyd...
838b40af86fb63312f5a9e6b5cdc6de9e038acde1423859c15bc43a95019190e
Python
11,735
222
#!/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 ...
04d1311bb6622fbe92f3d5cee8d8298d7f909f38ed1e1534329b153b7de71a69
Python
11,737
323
"""Unit tests for the :mod:`networkx.algorithms.bipartite.matching` module.""" import itertools import pytest import networkx as nx from networkx.algorithms.bipartite.matching import ( eppstein_matching, hopcroft_karp_matching, maximum_matching, minimum_weight_full_matching, to_vertex_cover, ) ...
98a9ed4e141285d4f32079141ece5917ea1bd3dc37db9c36b94c4c06317b9eac
Python
11,739
294
import pathlib from typing import Optional, Tuple, Union, Literal import numpy as np from skimage import measure, filters, morphology from skimage.util import map_array import pandas as pd from alpineer import misc_utils, load_utils, image_utils, io_utils from ark.segmentation.ez_seg.ez_seg_utils import log_creator imp...
f6f4f61b0399dd4c57c75f4c838c258b66e51044e7c046ef44cd50fcac1a75ef
Python
11,741
265
""" Unit tests of the `ConnectomeGlomerulusGranule` strategy """ import unittest from os.path import abspath, dirname, join import numpy as np from bsb import ( Configuration, ConfigurationError, ConnectivityError, Scaffold, WorkflowError, ) from bsb_test import NetworkFixture, NumpyTestCase, Rand...
02a7e85dde609359cd0f2d8d94454042cfc0519943f6d8e0329003a02699aaee
Python
11,756
388
""" FlexSN Triton Kernel Templates. Insert a single-step kernel into a multi-step kernel template. """ from spikingjelly.logger import logger try: import triton except (ImportError, OSError) as e: from .. import triton_missing as dummy logger.info("Optional Triton dependency unavailable: {}", e) tr...
e19c9e9148606626a122b030ca6a1866971857d9c1df43362781553d316b6726
Python
11,758
262
""" Module for the configuration node of the Golgi to Glomerulus ConnectionStrategy """ import itertools import numpy as np from bsb import ( CfgReferenceError, ConfigurationError, ConnectionStrategy, ConnectivityError, config, pool_cache, refs, ) from cerebellum.connectome.presyn_dist_st...
53dff0ec9ae26fec3cb69018529a68227153cf17d2ade36155404192e9431f10
Python
11,781
379
from __future__ import annotations import string from typing import cast import numpy as np import pandas as pd import pytest from anndata._core.xarray import Dataset2D from anndata.compat import XDataArray, XDataset, XVariable from anndata.tests.helpers import gen_typed_df pytest.importorskip("xarray") @pytest.f...
4c717561f859806b85c1dd8109f959440129de9f20bb66e0da39eab236c19e9b
Python
11,786
355
#!/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_alternate import * from LIP_full import * from itertools import * def generate_syn(source,target,syntype,connection_pattern,g_i,taur_i,taud_i,V...
f29a97b6342494fa364f739f16b7972431fe5a806da0c78a11074ac229c3be92
Python
11,789
279
from functools import partial import numpy as np import pytest import scipy.linalg import sklearn.linear_model from himalaya.backend import ALL_BACKENDS, set_backend from himalaya.kernel_ridge import KERNEL_RIDGE_SOLVERS, WEIGHTED_KERNEL_RIDGE_SOLVERS from himalaya.kernel_ridge._solvers import _weighted_kernel_ridge_...
259a9cddd84ca3121120734b96777c3b451fb2394503e599b7f3ec30c8cf6cc3
Python
11,793
337
# 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...
66ece56cd897daa6e58fdd05828d6e67587a3253b24e7ea2fa9cdfa8b7fb1fa8
Python
11,794
303
import os from dataclasses import dataclass from typing import Sequence import numpy as np import tensorflow as tf from tensorflow.keras.initializers import Initializer import learnMSA.legacy.DirichletMixture as dm from learnMSA.hmm.util.value_set import PHMMTransitionIndexSet, PHMMValueSet class EmissionInitialize...
5a21dbe573b2c38a6855e0419653267b912c3bc81debe97760db1a4536f88f6c
Python
11,799
357
# Copyright 2020 DeepMind Technologies Limited. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
50d7a061235b1d924d288de0e51e1c27ca358c9aad70243f72a8309c76c26c7f
Python
11,813
363
""" Compiler for the intermediate representation of a Datalog program. The :class:`DatalogProgram` class processes the intermediate representation of a program and extracts the extensional, intentional, and builtin sets. """ import operator as op from itertools import tee from typing import AbstractSet, Any, Callable,...
4820eb8e1d3ee7ae5b5640d47f30d9da4addeb3d4a4acfd198578006d39ae702
Python
11,815
240
########################################################################################## # # psim_parse.py # # - Utility functions for parsing text-based inputs to ProBioSim. # ########################################################################################## # # ProBioSim # Copyright (C) 2021 Matthew L...
280a2a63e03076afbdd34cfdf2ba6d018cbebfcbc5b12e8af444dbccbc78d776
Python
11,816
355
#!/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_altd import * from LIP_full_altd import * from itertools import * def generate_syn(source,target,syntype,connection_pattern,g_i,taur_i,taud_i,V...
3f7bde5e92c4573fbb3d6e6502bfdd13c30fe9af666327c740285f0545330a84
Python
11,818
290
""" Error analysis agent for tool error diagnosis. """ import logging import re from functools import partial from pathlib import Path from typing import ( Any, Optional, ) import anyio from pydantic import BaseModel from pydantic_ai import Agent from galaxy.schema.agents import ConfidenceLevel from .base im...
143555c1585859be266fc2211f89f38108a3d8daccfb9accd20b6aaafa48a922
Python
11,820
339
import copy from types import SimpleNamespace import pytest import torch try: import transformers except ImportError: transformers = None from spikingjelly.activation_based import functional from spikingjelly.activation_based.ann2snn import ( ModuleConverter, Qwen2SNNCalibration, Qwen2SNNConfig, ...
0f9055e4ca53ae55bbffbd6a56c85d52aa489d6e6d8ed769146a35d4ed169f75
Python
11,824
311
# 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.registry import Generators from ax.adapter.torch import TorchAdapter from ax...
7a6d2ff6b63a997f4de7c1c8ac149f1fabc39e38c7378a62c8620d60d765ea6f
Python
11,825
348
import copy import math import pytest import torch import torch.nn as nn import torch.nn.functional as F from spikingjelly.activation_based import functional, layer, neuron def test_delay_step_matches_sequence_delay_and_gradients(): x_seq = torch.randn(5, 2, 3, requires_grad=True) queue = () outputs = [...
21b2416e385d8daf7b96a4f1618a46812c232c40137b2427089d906fe14862ce
Python
11,835
351
''' The baseline model implementation is from: https://github.com/MilesCranmer/symbolic_deep_learning/blob/master/models.py (MIT license) ''' import numpy as np import torch from torch import nn from torch.functional import F from torch.optim import Adam from torch_geometric.nn import MetaLayer, MessagePassing from ...
ce27d00be7780265f64c1474582ff203069cca67c1d12119b3d65f5dd87c07ac
Python
11,838
356
#!/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 import * from LIP_full_alternate import * from itertools import * def generate_syn(source,target,syntype,connection_pattern,g_i,taur_i,taud_i,V...
b601a9fbe363c5d299bb1e8d1af81327e64d3d36e6755baf829704e1aeac8933
Python
11,841
282
# 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 enum import Enum, unique from math import ceil, floor from typing import Any from ax...
8ca45199cebff6c4fe11d17fc7d53cab46e775f5e7485ee69fd6c782add66e73
Python
11,842
281
""" Manager and Serializers for Quotas. For more information about quotas: https://galaxyproject.org/admin/disk-quotas/ """ import logging from typing import ( cast, Optional, Union, ) from sqlalchemy import ( and_, select, ) from galaxy import ( model, util, ) from galaxy.exceptions imp...
434fc14f421aefbdd1876ab668ec5d71200a5b7d1ea3e6e4f212085493a33d5a
Python
11,846
337
#!/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 import pandas as pd from ax.early_stopping.simulation import ( _check_patience...
6dad645d0faa349d5737412397dca5d9ae3e05a5e67af3a847e7d39dbc0ef0bc
Python
11,847
323
# Adapted from # https://github.com/funkelab/scikit-image/blob/fix_clahe/skimage/exposure/_adapthist.py """ Adapted code from "Contrast Limited Adaptive Histogram Equalization" by Karel Zuiderveld <karel@cv.ruu.nl>, Graphics Gems IV, Academic Press, 1994. http://tog.acm.org/resources/GraphicsGems/ The Graphics Gems ...
682267df8343888119b30bd5a558cb08793890c89515d3ac1de686f5a311d7ba
Python
11,855
316
"""Progress updates and stale-job detection for ProjectImport / ProjectReimport.""" import logging import django_rq import rq from core.redis import redis_connected from django.conf import settings from django.db.models import Q from django.utils import timezone from rq.job import Job logger = logging.getLogger(__na...
6fcbecb653f25556a27eb661072db37634dab5a888fd5cdcc978569f3fcfa2f6
Python
11,864
297
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 30 22:07:08 2022 @author: wirrbel """ # We begin by adding the current path to sys.path to make sure that the imports work correctly import sys sys.path.append('../brainrender/') import os import pandas as pd import numpy as np from shutil import co...
2e1cc05d21c508f436906feb3e05dbd3a60a769a4eedbb80a64b020b8188e30f
Python
11,878
338
""" Label propagation community detection algorithms. """ from collections import Counter, defaultdict, deque import networkx as nx from networkx.utils import groups, not_implemented_for, py_random_state __all__ = [ "label_propagation_communities", "asyn_lpa_communities", "fast_label_propagation_communit...
e6e825391a519971d63ad52699803137bd52c401b9222b51a961224ae75bd655
Python
11,878
293
#!/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 collections.abc import Callable, Mapping, Sequence from datac...
df2a3348fc97f9e82226daa38609706245a575bfaea14bc83bc55f8a47a08581
Python
11,880
398
import functools import math import typing import numpy as np from .. import config from ..config import refs, types from ..rng import RngConsumer if typing.TYPE_CHECKING: # pragma: nocover from ..cell_types import CellType from .cell import CellModel def _target_name(targetting) -> str: """Name a tar...
e25f4b2fedce3b1c9639571bed5c0339ef24e97069f73171ea98e547c89c8d1a
Python
11,881
325
from typing import Optional import torch from .. import functional, surrogate from .base_node import BaseNode, NonSpikingBaseNode, SimpleBaseNode __all__ = ["SimpleLIFNode", "LIFNode", "NonSpikingLIFNode"] class SimpleLIFNode(SimpleBaseNode): def __init__( self, tau: float, decay_input...
425e2b967ddb2ced067f51d87626596c0faed3bb03b13b75be74573027739909
Python
11,883
367
from __future__ import annotations from string import ascii_letters import numpy as np import pandas as pd import pytest from scipy import sparse import anndata as ad from anndata.compat import CupyArray, CupyCSRMatrix, DaskArray from anndata.tests.helpers import ( BASE_MATRIX_PARAMS, CUPY_MATRIX_PARAMS, ...
d7d48dcb863e4ac266ed604fe64274de0acaf6cdcce00de6c106abb8fa576cf4
Python
11,888
329
""" """ import hashlib import logging import os import threading import time from math import inf from typing import ( List, Tuple, ) from uuid import UUID from typing_extensions import NamedTuple from galaxy.util import ( nice_size, string_as_bool, ) from galaxy.util.sleeper import Sleeper log = lo...
eb76723ed2a63c346f5d0644da2b6490b67993c20380252be0e5d137747d441c
Python
11,890
377
import pytest import networkx as nx def test_random_partition_graph(): G = nx.random_partition_graph([3, 3, 3], 1, 0, seed=42) C = G.graph["partition"] assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}] assert len(G) == 9 assert len(list(G.edges())) == 9 G = nx.random_partition_graph([3, 3, 3], 0...
203f58f8e26ff46a40a9763efec90f686ed4516858b40f3aead9231218bbc46c
Python
11,894
303
#!/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 itertools import product from typing import Any from unittest.mock import MagicMock import numpy...
ac023cb54e1c54d312fd508d7a7e9055bfc341f2512bf35143d65879c09b1fb5
Python
11,897
290
#!/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 collections.abc import Iterable from dataclasses import dataclass from heapq import nsmallest im...
4b0874e4f608f86fd5c0d68718ffa0183e2455cefae8e6413c96eda2873b3472
Python
11,902
369
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 12 16:23:57 2020 @author: amelie """ #!/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_full import * from LIP_full import * from mdP...
54e0fbcea76620acf08aae3ed6e9c75af67880e77faae9d6167d4b8d52bea524
Python
11,903
375
# -*- coding: utf-8 -*- """ Plot ==== Plotting routines for overlaying labels, tilings, and sectioning of 3d data sets Supported functionality: * plot volumetric data as a sequence of tiles via :func:`plotTiling` * overlay points on images via :func:`overlayPoints` and :func:`plotOverlayPoints` * ...
4554074e5e322291353594c40e7d7811a2418534557b11bbab3077f8a40e8026
Python
11,904
356
"""Interface layer for pykube library shared between Galaxy and Pulsar.""" import logging import os import re from pathlib import PurePath try: from pykube.config import KubeConfig from pykube.exceptions import ( HTTPError, ObjectDoesNotExist, ) from pykube.http import HTTPClient f...
434f3a5c2079aa76ec56549e728f3ea889b6b4c46f7fa757d0c485789ed5a2cf
Python
11,918
280
# 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...
10d5db8c6547432bf690520cc0f7e751ae65b107475ea1643f36230a77bc5db9
Python
11,927
272
import os, sys, argparse, time from multiprocessing import Pool from tqdm import tqdm from lib.common.util import is_dir, is_file, read_option_file, makedir_if_not_exists # from lib.complex_alignment_generation.geno_dist import Geno_interact # from lib.complex_alignment_generation.pdb_interact import PDB_interact from ...
77dec13f2c43a092fc0f54dd8705df5008c82218f492fc94bd1438a0c081459e
Python
11,929
328
# 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...
7cf27f83f4ba14717d7c5e01245abe16394c0fb85da0dc4fb94b51da0f4d6464
Python
11,954
287
""" Pipeline to prepare data from new patients : 1) combat harmonise (make sure you have computed the combat harmonisation parameters for your site prior) 2) inter & intra normalisation 3) Save data in the "combat" hdf5 matrix """ ## To run : python run_script_preprocessing.py -site <site_code> -ids <text_file_with_s...
b126e0a49b9da44f3b9382ca6a8dff4306cc2b547e5f12785acead882d7403b6
Python
11,968
255
import errno import logging import os from typing import ( Any, Optional, ) from galaxy.tool_shed.galaxy_install.client import ( DataManagerInterface, INSTALLATION_RELOAD_TIMEOUT, InstallationTarget, ) from galaxy.util import ( Element, etree, parse_xml_string, xml_to_string, ) from...
9e12ca3041266b7e939d2ab29283db9bdf1b67e069aca4202a91cad06287ae07
Python
11,971
316
import logging import os.path from collections.abc import Sequence from typing import ( Optional, Union, ) from sqlalchemy import ( false, null, select, ) from sqlalchemy.orm import ( aliased, Session, ) from galaxy.exceptions import RequestParameterInvalidException from galaxy.model impor...
a414c8e47fd53b812eecae01db79c9a03d52a913f0a3b339e73b18d0532a00cd
Python
11,976
353
import os.path as osp import numpy as np import torch from cogdl.data import Graph, Dataset from cogdl.utils import download_url class BidirectionalOneShotIterator(object): def __init__(self, dataloader_head, dataloader_tail): self.iterator_head = self.one_shot_iterator(dataloader_head) self.i...
9ab81f82373da5e47345c301ec1acaf43cc8f3a132b76a985f6eff87de84f469
Python
11,985
322
""" NeuroSynth engine initialization. Registers the following predicates: * ``peak_reported(i, j, k, study_id)`` — reported activation peaks converted to voxel coordinates, the Talairach ones converted to MNI (see :func:`process_peaks` for those of ``UNKNOWN`` space). * ``peak_mni(x, y, z, study_id)`` — the same ...
ade7f4474fb47f9a81196da643001d62b4293fe46fd8675acfaf0dfc3246ebd1
Python
11,992
320
# 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 Callable, Iterable, Mapping, Sequence from dataclasses import dataclass, field, InitVar from func...
875ddda1ffb2a7d361289a5f45824713ab86e611e51ec4ec42654b70f24a4dc0
Python
11,999
393
import logging import nipype.pipeline.engine as pe from pathlib import Path import os from typing import List DEFAULT_GRAPH_STYLE = "colored" def find_sub_list(sl, l): results = [] sll = len(sl) for ind in (i for i, e in enumerate(l) if e == sl[0]): if l[ind : ind + sll] == sl: resu...
a601daf6f4854c0776ad3b0fe7e2ebe50a9ad7d6810c7d76b8acdd00893f4a6a
Python
12,008
302
#!/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 collections.abc import Callable, Iterable from logging import...
1708e292cb66ba82eb30bf28fbebf670e52890384ee784e918b420a968300820
Python
12,009
260
import os import tempfile import timeit import numpy as np import pytest import test_utils import xarray as xr import pandas as pd import ark.settings as settings import ark.spLDA.processing as pros from ark.analysis import visualize import test_utils as ark_test_utils def test_draw_heatmap(): # Create random Z...
63f0691a9209bf8672bfd17afbebbc24d24e2c56afa488d9bdb1f36f4855e759
Python
12,009
320
# 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...
5a4aa4c75bd0f9b6eb000c5c4a316a3358747c71def84348c3742eeba276fb61
Python
12,013
334
"""Tests for mibidata.segmentation Copyright (C) 2021 Ionpath, Inc. All rights reserved.""" import unittest import numpy as np from numpy.testing import assert_array_equal import pandas as pd import pandas.testing as pdt from mibidata import mibi_image as mi, segmentation class TestSegmentation(unittest.TestCase...
9f47d9e9723bffd71b90b77a47f6a2df07238d3291f5cb65bdf30647e47d4cff
Python
12,015
346
# NICE # Copyright (C) 2017 - Authors of NICE # # 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, either version 3 of the License, or # (at your option) any later version. # # This program ...
9828676df40496ae9c23c02d0868e49f65650310aad35b0e581447ad4f8fe164
Python
12,034
319
# -*- coding: utf-8 -*- """ Created on Fri Jul 5 13:08:06 2019 @author: schelskim """ from scipy.spatial import distance import numpy as np import cv2 from skimage import morphology as morph from scipy import ndimage import copy from skimage.morphology import disk from matplotlib import pyplot as plt #import pyopen...
a61c74c22a760e09534f75f054ed7342d7a175b38c675695151b596576e467b6
Python
12,040
259
import errno import logging import os from time import sleep from typing import TYPE_CHECKING from galaxy import model from galaxy.jobs import ( JobWrapper, TaskWrapper, ) from galaxy.jobs.runners import BaseJobRunner if TYPE_CHECKING: from galaxy.app import GalaxyManagerApplication from galaxy.jobs i...
87937db09f13df1bfab8b4c2987a332159a9b596ee5edfed4799a38129713cf8
Python
12,041
275
import itertools import math import os import pathlib import random import tempfile from typing import Generator import numpy as np import pandas as pd import pytest from alpineer import io_utils, test_utils, misc_utils from pytest_mock import MockerFixture import ark.settings as settings from ark.segmentation import...
1420cab022ab28a62867753e8dc55dee0b1f96bb2329679da2d84ac217e136d5
Python
12,053
319
""" =========================== Creating annotated heatmaps =========================== It is often desirable to show data which depends on two independent variables as a color coded image plot. This is often referred to as a heatmap. If the data is categorical, this would be called a categorical heatmap. Matplotlib'...
a888878ca4d06dcacd79b12f20564971f82a57ce84336fc053ec8630db359d85
Python
12,061
286
#!/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 copy import deepcopy from ax.adapter.base import DataLoaderConfig from ax.adapter.data_utils imp...
ef0a032df91609489f479ebdf32357f902c9f3d9c2b60bba1829021b97aa8122
Python
12,072
216
import re import sys import os import math from scipy import stats print("ALL_PPI_mutation_sites_mapping_with_allonco") output = open(r'E:\OneDrive\学术\PPI article\data\mapped data\4. DNM_MIPPI_mapping\ALL_MIPPI_psymukb_mapping.txt','w+') with open(r'E:\OneDrive\学术\PPI article\data\mapped data\0.data filter\I...
76c65534d16e3a7996fa03152f8bab796619bcd5ba0c72ed15a10e2a98c3aa45
Python
12,087
287
#!/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 typing import Any import torch from ax.adapter.registry import Generators from ax.api.utils.str...
bdcead01cd2667eb630e774903b6b4fbd401750f53959528452cf0fbfb4332e4
Python
12,089
325
import logging from functools import wraps from core.feature_flags import flag_set from core.redis import start_job_async_or_sync from core.utils.common import load_func from core.utils.io import ssrf_safe_post from django.conf import settings from django.db.models import F, Q from django.db.models.functions import Co...
9348bc44c26c5096a79011c75b2ecef6a27493b9f463f58f01923181f2c83edf
Python
12,094
470
# -*- coding: utf-8 -*- """ TIF module provides interface to read and write tif image files. Note ---- This modules relies onf the tifffile library. """ __author__ = 'Christoph Kirst <christoph.kirst.ck@gmail.com>' __license__ = 'GPLv3 - GNU General Pulic License v3 (see LICENSE.txt)' __copyright__ = 'Copyright ©...
a149b94b3e75bd24b24134c4c89248dca0a1efc993a05cdd8f70a2f0355076a3
Python
12,095
315
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See the COPYING file distributed along with the smile package for the # copyright and license terms. # # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## from .video import WidgetState from kivy.uix.wid...
821d466b4ca25a092ba4ee30bc16b9600c1a2cc4de5b723112de003fc386fd8d
Python
12,098
352
import os import h5py import pandas import shutil import tempfile import logomaker from matplotlib import pyplot as plt import numpy as np import pandas as pd from pathlib import Path from typing import List, Union from memelite import tomtom from memelite.io import read_meme pd.options.display.max_colwidth = 500...
9ba9ede139a0643dceb0e123baeed49a744fbd89c14217338f8d3f86244e53e6
Python
12,105
332
""" Object Store plugin for the Microsoft Azure Block Blob Storage system """ import logging import os from datetime import timedelta try: from azure.core.exceptions import HttpResponseError from azure.storage.blob import ( BlobSasPermissions, BlobServiceClient, generate_blob_sas, ...
b6d0db78d67af1e5608b04d000e73f1e92637605401a06a15d04b27b43fe04fd
Python
12,110
352
import rdkit import random import itertools from rdkit import Chem from rdkit.Chem import rdFMCS from collections import defaultdict, deque from MolRep.Explainer.Attribution.utils.fuseprop.vocab import MAX_VALENCE lg = rdkit.RDLogger.logger() lg.setLevel(rdkit.RDLogger.CRITICAL) def set_atommap(mol, num=0): for ...
ab3768cf358af2f2da83e08052aad700cd82659c0c14de6f32ee9376bc1d7fe1
Python
12,128
362
import pickle import pytest import networkx as nx class TestAtlasView: # node->data def setup_method(self): self.d = {0: {"color": "blue", "weight": 1.2}, 1: {}, 2: {"color": 1}} self.av = nx.classes.coreviews.AtlasView(self.d) def test_pickle(self): view = self.av pview...
76cb697f8f096891fa847f6a017536e344dd074b30db7169a65eea2721f9f1ce
Python
12,132
295
""" Identifies likely barcode multiplets. Copyright (c) 2019 10x Genomics, Inc. All rights reserved. """ from __future__ import absolute_import, division, print_function from barcodes import query_barcode_subsequences, split_barcode, merge_barcode from tools import ReferenceManager, grouped_fragments_from_contig impo...
fa47c2cbf07781d0fa10ec9a93eddd4a2d8545b6cf4c8f1ee12f7978c3449283
Python
12,142
252
# -*- 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 input_folder = os.path.dirname(os.path.abspath(__file__)) figure = Figure(input_folder,number="S16",dpi=600,width=4.75) figure....
6e75dce055aaa3d4a3199ca5863c15afcfc408078e8d9520d0c4694c2106efce
Python
12,144
259
# 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...
48c2d77bc0ce4e00320957ef959fe5baad6264c5eadb88c5025820e6ca856c82
Python
12,150
334
#!/usr/bin/env python3 import sys import os import numpy as np # -expand module search path to parent directory sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) # -custom-written code import main import utils from utils import checkattr from params.param_stamp import get_param_stamp_from_...
a43054370080d938b1c39c297841d75e9039e8784be71c8c102483bf3b2d4fa5
Python
12,153
315
#!/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 unittest.mock import patch import torch from ax.exceptions.c...
2b251e6e1968f78cffcd67bda2210571bcd8fbe0c18a445e299e1d325f021329
Python
12,157
312
#!/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 collections.abc import Mapping, Sequence import numpy as np from ax.adapter.adapter_utils impor...
526cb9bbedd9f79ec68ab75aa6789c5d53a91da338c5d39900126e2717da7890
Python
12,162
346
""" Low-level helpers for the SecureTransport bindings. These are Python functions that are not directly related to the high-level APIs but are necessary to get them to work. They include a whole bunch of low-level CoreFoundation messing about and memory management. The concerns in this module are almost entirely abou...
2219908ef9fe45f973af0339860c391e8a52df9c524c7884756b2546e895b7e0
Python
12,165
306
#!/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 warnings from copy import deepcopy from logging import Logge...
28f8c5beca2647bfe5c4856db169301ab9597adec12d8637d3ef7b2a4c585ede
Python
12,167
285
import logging import mimetypes import posixpath import uuid from datetime import timedelta from urllib.parse import unquote import jwt from django.conf import settings from django.contrib.auth import get_user_model from django.http import HttpResponse from django.utils import timezone from drf_spectacular.utils impor...
408fd6931e818510cd4e1226bb7cc90da381156468db0ff108984112293dd76b
Python
12,168
353
from dataclasses import dataclass import torch from spikingjelly.logger import logger from .layout import _layout_args from .triton_runtime import ( is_fp8_dtype, normalize_cuda_device, normalize_triton_compute_dtype_name, normalize_triton_storage_dtype, resolve_triton_compute_dtype, tl, ...
927ff6fc3a10dc5c53ee3c952d9b945e662d43af1261a2027f58e3684e5e7e2c
Python
12,170
318
from datasets import ScanpathLoadDatasets from torchvision import transforms import torch import os import scipy.io as sio from numpy import asarray import scipy.io as spio import numpy as np import random from PIL import Image print(' Computing Model ') entro_folder = 'x' #train scanpath prediction # Applying Tran...
3b08c0683748e27b0c73e0e1479fa9d925d0241ee6f5a709f83b26a6415c923a
Python
12,173
323
"""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 django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.db.mod...
4853955f2e61f44c30693ac7332379a24758cd3bcdaeb08d4ec841a82642e10d
Python
12,173
303
# -- Extend metaDataTags to support addition of new unspecified datasets ------ class MetaDataTags(MetaDataTags): def add(self, name, value): """Add a new tag to the list. Args: name (str): The name of the tag to add (will be added as an attribute of this `MetaDataTags` in...
a19b706ff87cc11132471a92f014d4e601b9e2910ffb9326009efbc149304212
Python
12,174
385
from vedo import Plotter from vedo import settings as vsettings import numpy as np from datetime import datetime from rich import print from pathlib import Path from myterial import orange, amber, deep_purple_light, teal from rich.syntax import Syntax from loguru import logger from brainrender import settings from bra...
05d6504beaac59b11b457b9600dbc7d9e5c4bfb9b200acae95db50cc78fa9f86
Python
12,190
451
import pytest import networkx as nx from networkx.utils import edges_equal def test_union_attributes(): g = nx.Graph() g.add_node(0, x=4) g.add_node(1, x=5) g.add_edge(0, 1, size=5) g.graph["name"] = "g" h = g.copy() h.graph["name"] = "h" h.graph["attr"] = "attr" h.nodes[0]["x"] ...
373f3ef125fb7265bfbda0f1aedb771f2fb7780446d9f9c02cb96194a59aa142
Python
12,193
348
""" Base processing tasks for cloud workflows """ import time from .. import seg_utils from . import seg from . import edge from . import overlap from . import anchor from . import hashing from . import utils from . import colnames as cn def timed(fn_desc, fn, *args, **kwargs): """ Measures the execution time ...
f7d4a73e7a944b52699f45a8a80665cde8cf4f4049f37920c1e704711d4ed8b7
Python
12,194
304
import sys, os, platform from src.utils import get_p_val_string, get_exact_p import numpy as np import pandas as pd import scipy as sp import nibabel as nib import math from scipy import stats import seaborn as sns import pkg_resources import matplotlib as mpl import matplotlib.pyplot as plt def set_plotting_params...
4564dadc1636e6c35825cb729cc126dc91166ae5f3778a9076c458eca1a94fff
Python
12,197
368
#!/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_alternate3 import * from LIP_full_alternate3 import * from itertools import * def generate_syn(source,target,syntype,connection_pattern,g_i,tau...
3a8d9cf4a771a322b8e1ae2904896b0db0f70bbb9f9f6cec282695ddfb1de7c9
Python
12,204
204
""" 06_cohort_stats.py - Cohort statistics for the tDCS conductivity-model study (the main group deliverable). Concatenates per-subject ROI E-field CSVs; computes paired MD-dMRI-vs-DTI/ISO (Wilcoxon), PD-vs-HC, and partial age correlation per ROI per montage, with BH-FDR within each (montage, test-family). PD-vs-HC PR...
a8e6001d1ae2fc1cac67189440fc599a8559171e0cea32b41dce47ea7e2ed5bb
Python
12,204
304
# 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...
3c2d5334d28a5a23b2d48f5bcfe5f4d74c8eebd444083856022cfca247fd686a
Python
12,205
331
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Example usage: python -m utils.benchmark 2 scrna/visium_brain_sagittal/data/visium_brain_sagittal_J2000.h5ad Fit a model to a dataset and save the results. Inputs: * integer row ID (from slurm job array), pulls out one set of params from csv * parent directory o...
b094c758e8e6213ddd5d773f1c1a5532b4f6423afd0a02c4fc6a6c81cb5b7c80
Python
12,210
353
"""Functions for splitting a network into two communities (finding a bipartition).""" import random from copy import deepcopy import networkx as nx __all__ = [ "kernighan_lin_bisection", "spectral_modularity_bipartition", "greedy_node_swap_bipartition", ] def _kernighan_lin_sweep(edge_info, side): ...
b608eb29858ae06c27cc114e30ff54c6393503fe191ced32b8109abba13a89b8
Python
12,218
355
# 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 enum import StrEnum from logging import Logger from typing import Protocol import n...
d4fd83f4d314dcc0eb4a61cbc1a492a6a109d50514e7cfac5aa607d8018d1bff
Python
12,223
334
import os import matplotlib matplotlib.use("agg") import numpy as np import nibabel as nib import scipy.io as sio import matplotlib.pyplot as plt from bids.layout import BIDSLayout, parse_file_entities from scipy import stats, signal from scipy.sparse import lil_matrix from rsHRF import ( spm_dep, processing, ...
97f6b50d090dbe40a2852bbe7a955ced36d4e5873d35b4ec626bda06a06a31ac
Python
12,230
263
from torch.utils.data import Dataset import pandas as pd import os from typing import List, Tuple, Iterable import numpy as np from tqdm import tqdm from torch.utils.data import DataLoader import torch from sklearn.model_selection import StratifiedShuffleSplit class CovidData: def __init__(self, csvs_dir: str, st...