sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4017d1b425495b35dd0d630a7bfd40f0a3d17751a583a7f8befbb29201fce9c1
Python
37,750
1,012
# tfmodisco.py # Authors: Jacob Schreiber <jmschreiber91@gmail.com> # adapted from code written by Avanti Shrikumar import mmap import pickle import numba import numpy as np import scipy import scipy.sparse from collections import defaultdict from concurrent.futures import ThreadPoolExecutor from . import affinit...
1893adc947e374157e16c3572db269cdb527b278b9c036878f0a05e018bf7611
Python
37,771
1,040
import itertools as it import pytest import networkx as nx from networkx.algorithms import isomorphism as iso graph_classes = [nx.Graph, nx.DiGraph, nx.MultiGraph, nx.MultiDiGraph] labels_same = ["blue"] labels_many = [ "white", "red", "blue", "green", "orange", "black", "purple", "y...
9b1fa25844349f7e12a9261232189c7ecd65b46302cb3e63e833e49cae218dc8
Python
37,771
1,008
from skimage import morphology, measure, io, util # For performing morphology operations (should maybe import more from skimage...) from mpl_toolkits.mplot3d import Axes3D # Plotting in 3D import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit from pylab imp...
b1806e55b2a4975d58aa29f1048c6ba3cfedc74190ff99f881bc7d1294b7c4dd
Python
37,840
990
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import cgi import itertools import logging import mimetypes import os import posixpath import re import sys from collections import namedtuple from pip._vendor import html5lib, requests, six from pip._vendor.distlib.compat import unescape ...
c1f569d8535bad4e9510c83c77c006b05318f2a2f57aa29940cddc786b082bd4
Python
37,877
784
# 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...
407950b9f7e8e4b2e2c7805ae52b55318249fc41ba76e5be5845dc9604ddb58d
Python
37,882
837
""" TensorFlow implementations of the core MSA decoding operations. These functions mirror :func:`AlignmentModel.decode_core` and :func:`AlignmentModel.decode_flank` exactly but operate on ``tf.Tensor`` inputs so they can be JIT-compiled and executed on GPU. Each function: * accepts either a ``tf.Tensor`` or a ``np...
b91dbf0932ab99461cb6ad86fbb5d37edd56ff9148e54cb52e77e11218f4dcb6
Python
37,901
1,093
""" Mothur Metagenomics Datatypes """ import logging import re from typing import ( Optional, ) from galaxy.datatypes.data import Text from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, HasMetadata, ) from galaxy.datatypes.sniff import ( bui...
dbfb255bd217434b39ff1d1c42b2573f07395068dca14d7216397fbc0902b7bc
Python
37,913
697
# -*- coding: utf-8 -*- """ Generate docs/_generated/usecase_map.html — a "Global Reach" panel of published SimBA use-cases, built from the public Google Sheet of citing studies. Reuses the same vendored Chart.js as the download-stats page, so the styling matches. The country and institution maps are the globe above i...
6881b37c59c4ced1371e9c38adb9134d46bb1cf99171a196cd415ef333324db5
Python
37,966
810
from meld_classifier.paths import NVERT import meld_classifier.mesh_tools as mt from meld_classifier.meld_cohort import MeldSubject import meld_classifier.meld_plotting as mpt from meld_classifier.dataset import load_combined_hemisphere_data from meld_classifier.saliency import integrated_gradients, vanilla_backprop i...
c9c478399f6c8cfb76ef834e55322522baff7eef5543d47a5e2254fc451776dd
Python
37,997
867
""" Google Cloud Batch Job Runner This runner submits Galaxy jobs to Google Cloud Batch for execution. """ import json import logging import os import time from typing import ( Any, ) from google.api_core import exceptions as gcp_exceptions from google.auth import default from google.cloud import batch_v1 from ...
9a3ef280b985ef7620837c0da1f79745ba442fb1688cfd43b72648b2837ea8c6
Python
38,089
850
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import ast import json import math import unittest from pathlib import Path from types import SimpleNamespace from unittest import mock import datumaro as dm import numpy as np from attrs import evolve from django...
3745c4445fa4551e8183d27ba15af8676d3f0d58f2a6d65afce57340dbf95687
Python
38,107
1,032
# -*- coding: utf-8 -*- # # # Brainbow segmentation Python XTension # # <CustomTools> # <Menu name = "Brainbow plugins"> # <Item name="Brainbow PCA segmentation (Three component selection)" icon="Python" tooltip="Brainbow segmentation based on PCA."> # <Command>PythonXT::XTBB(%i)</Comma...
29313ee6bcbb31eff4faefafc17ce6b0a0c6d73a026d5922d3e0692cf0d69a6b
Python
38,127
918
import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit import numpy as np import random import math import time # Function for curve_fit def costheta_exponential(s,P): return np.exp(-s/P) start_time = time.process_time() arctest = False # Max number of iterations in cur...
6adbc9e30ecdca35947a2b73a273cadbf73ad2b54826b6fd62c88b5d484b37dc
Python
38,270
1,009
# 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 import numpy as np import pandas as pd from ax.analysis.plotly.utils import STALE_FAIL_REASON,...
f98b277e0a2135746c3036afa6aa633ce5d40ac839b9898b946111c4b3ea5f6c
Python
38,289
884
import os.path import warnings from tqdm.auto import trange import numpy as np import tensorflow as tf from . import feeder from . import custom_layers from .autoencoder import BaseAutoencoder class AE_AR(BaseAutoencoder): def __init__(self, *, rank=None, input_dim=None, inner_dim=None, nodes=None, ...
6963692d38563cf562faa930f5ca54244424ba64becd5b98b852bc429344d86e
Python
38,307
1,129
"""Graph diameter, radius, eccentricity and other properties.""" import math import networkx as nx from networkx.utils import not_implemented_for __all__ = [ "eccentricity", "diameter", "harmonic_diameter", "radius", "periphery", "center", "centroid", "barycenter", "resistance_dis...
c5f82d3329d867a20416d2a1034c54f2bbcb1415bbab924aebdf69758d2200f0
Python
38,495
822
""" Different Objective Functions evaluating the probability of a certain partition """ # real non truncating division (same behaviour as in python 3) from __future__ import division import math class ObjectiveFunction(object): """Measures the fitting of the SBM to the given graph""" title = "Forgot to rep...
6fcc703f3b032321dc9c8d4d2bc1e05bf0708336b7592e8d30ce6b08d53b2842
Python
38,531
1,140
from __future__ import annotations from contextlib import nullcontext from copy import deepcopy from functools import partial from importlib.metadata import version from importlib.util import find_spec from typing import TYPE_CHECKING import joblib import numpy as np import pandas as pd import pytest from dask.base i...
177652877e101e7b032fb9f9156562b044001c7acda4d14eaaaf3897fd0cacb7
Python
38,541
1,259
from spikingjelly.logger import logger import math import os import shutil import struct from pathlib import Path from typing import Callable, Optional, Union import numpy as np import torch import torch.utils.data import tqdm from matplotlib import pyplot as plt from torchvision import transforms from .. import conf...
8936de7ff9fe0d8060a9f4711c94de70b84809fc90ebbfb80fcbbf5ab5900dc2
Python
38,546
871
import logging from galaxy import util from galaxy.tool_shed.util.container_util import ( generate_repository_dependencies_key_for_repository, get_components_from_key, ) from galaxy.tool_shed.util.repository_util import ( extract_components_from_tuple, get_tool_shed_repository_by_id, ) from galaxy.util...
ddafa479e9a124e828cd4df88433ee2e13957dc302c08de79a0289f5ea6f0de5
Python
38,557
1,014
""" File format detector """ import bz2 import gzip import io import logging import os import re import shutil import struct import tempfile import zipfile from collections.abc import ( Callable, Iterable, ) from functools import partial from typing import ( IO, NamedTuple, Optional, TYPE_CHECK...
168ee28b66b9e5bd99e74dbd55071f228a46eea27fcabb8aec47c6eeb40a5ffd
Python
38,607
913
import base64 import time import unittest from unittest.mock import MagicMock, patch import jwt import pytest from django.test import override_settings from io_storages.react_code_proxy import ( REACT_CODE_TOKEN_AUDIENCE, REACT_CODE_TOKEN_TTL_DEFAULT, REACT_CODE_TOKEN_TTL_MAX, REACT_CODE_TOKEN_TTL_MIN,...
9de4cbb203192c5a1049326a33ccda1486d29976a3cafce2e524d5bde345e37f
Python
38,624
1,058
# 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...
3acceaef277ac9ad06dc732569acd275002d1f804bc044e302a6c541ccea876d
Python
38,643
1,151
# 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...
0b1bab6c5f4a6ecfc7b8ad92f97be9975bebc138272dc55681e16f20b507585e
Python
38,684
835
#!/usr/bin/env python # Copyright 2016 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 # # Unle...
b1f920caaa7e9b34814c83e33560abf08a7ea5045f05599a4da8007d99405307
Python
38,691
1,110
from __future__ import annotations import re import warnings import zipfile from contextlib import contextmanager from functools import partial from importlib.util import find_spec from pathlib import Path from string import ascii_letters from typing import TYPE_CHECKING import h5py import numpy as np import pandas a...
f47eff570a45bf4ee00e5705c775db0c947afaefc9b88e77682e36d9099f1aa3
Python
38,720
1,029
from skimage import morphology, measure, io, util # For performing morphology operations (should maybe import more from skimage...) from mpl_toolkits.mplot3d import Axes3D # Plotting in 3D import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit from pylab imp...
e180ecc4352f3adeb6f5c34e5010d38824bbeb835bcd3db711dba2f12920b283
Python
38,807
828
from __future__ import print_function, unicode_literals, absolute_import, division from statistics import mean import numpy as np import sys import warnings import math from tqdm import tqdm from collections import namedtuple from pathlib import Path from csbdeep.models.base_model import BaseModel from csbdeep.utils....
7d8dfcbf909ccf4276916cd892e80de283a1af3433598a06fb793b2a69d25b88
Python
38,819
1,279
from operator import eq from typing import AbstractSet import pytest from ...datalog.translate_to_named_ra import TranslateToNamedRA from nl_expr.config import config from nl_expr.exceptions import ( NonLiftableException, NotInFONegE, UnsupportedSolverError, ) from nl_expr.expressions import Constant, Sym...
d1e81b8c994e80616451733d9c08d846817f7dd46393f7b959e29fc36f5b9f45
Python
38,831
1,008
# 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...
c1b87da752d64ac9ede482161f8fc524dfe0786e60e31b526da1efef1ebad4aa
Python
38,849
1,053
from skimage import morphology, measure, io, util # For performing morphology operations (should maybe import more from skimage...) from mpl_toolkits.mplot3d import Axes3D # Plotting in 3D import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit from pylab import ...
3f74895ff329e1b7006597361e5399f3fef5eedb7fa87466ecce70ffa05cf6e3
Python
38,878
1,062
""" Shared operations layer for AI agents (MCP and internal pydantic-ai). Delegates to the Galaxy service layer for validation, permission checks, and pagination. """ import logging from typing import ( Any, Optional, ) from sqlalchemy import select from galaxy.agents import iwc from galaxy.managers.context...
436965de91021587a8f0e884a8f00d1236d5bba7d47f2db90d9fae8eb5b6dc5d
Python
38,886
903
""" Manager and Serializer for Users. """ import hashlib import logging import random import string import time from typing import ( Any, Optional, ) from markupsafe import escape from sqlalchemy import ( and_, exc, select, true, ) from sqlalchemy.exc import NoResultFound from galaxy import (...
4ba2771d2d7ac4e13ab319df755494ee69b464579eefcf4dcc24758eea6efd7c
Python
38,898
779
# 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...
7df432b6dc28e8bcfe252ab667511923602027b1202857e48926027df193b17f
Python
38,937
1,091
import copy from contextlib import contextmanager, nullcontext import sys import types import pytest import torch from spikingjelly.activation_based import layer, neuron from spikingjelly.activation_based.layer.attention import SpikingSelfAttention from spikingjelly.activation_based.model import Spikformer from spiki...
2b93e9f9bfda2d96aebefc3db1d605c1f5d878feab05df9071a335022be7c021
Python
38,992
774
########################################################################################## # # psim_model.py # # - Class for creating and manipulating ProBioSim models, along with related functions. # ########################################################################################## # # ProBioSim # Copyrigh...
f40fce0bb84be32e588f5aac98187ea060c1e6d03a581edba3feb2be8e3d0cb8
Python
39,064
1,028
# 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...
36c43e5b638d284b9228ce6667fdbccd01b2e36434471a8727ba7a22d35286fa
Python
39,117
1,236
from ..exceptions import NotInFONegE from ..expression_walker import ( ChainedWalker, ExpressionWalker, IdentityWalker, PatternWalker, ReplaceExpressionWalker, ReplaceSymbolWalker, add_match ) from ..logic.expression_processing import ( ExtractFreeVariablesWalker, WalkLogicProgramAgg...
2d0c89a773d4416d6ecd33309c701f06d2f0c3b950653c141b3364c21f7eb6d0
Python
39,139
820
from ..utils import nextPowerOf2, closestDividableNumber, checkForCupy import logging from oct.utils.psUtils import stokes, unweaveInputPolarizations from ..load.metadata import Metadata cp, np, convolve, gpuAvailable, freeMemory, e = checkForCupy() class Tomogram: """ Tomogram reconstruction for OCT """ def ...
8a8a16b0ad9a71773d8caa90af673575bd760702530f4a6244a928486e9fa60a
Python
39,166
904
# -*- coding:utf-8 -*- """Training and inference for tabular datasets using neural nets.""" import os import pickle import time import numpy as np import pandas as pd from joblib import Parallel, delayed from sklearn.metrics import roc_auc_score from sklearn.model_selection import KFold, StratifiedKFold from keras.ap...
11e3f8e45b7afd3999add561b62ed9dc4dd57b4e5e77a32f4ef1a1c459938d31
Python
39,180
931
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 5 19:01:33 2018 @author: jacobrosenstein """ from chemcpupy import MixtureList,CompoundList #from chemcpupy.tools.misc import * import numpy as np import copy import matplotlib.pyplot as plt import matplotlib.patches as mpatches import pandas as ...
4792d0f6a9bc783b746282a4da71a15ae9cc1b62c396d9b97119f34b518c6e3e
Python
39,264
829
import ray def val_pc_gauss(data_trans,alpha): from timeawarepc.pcalg_ray_1 import estimate_skeleton, estimate_cpdag, causaleff_ida, ci_test_gauss import networkx as nx (g, sep_set) = estimate_skeleton(indep_test_func=ci_test_gauss, data_matrix=data_trans, ...
11aaaa7970fa5cfe15f67aae34b8acabffc8a8a526bffe428c119d5ce5f3574f
Python
39,308
1,063
""" *************** VF2++ Algorithm *************** An implementation of the VF2++ algorithm [1]_ for Graph Isomorphism testing. The simplest interface to use this module is to call: `vf2pp_is_isomorphic`: check whether two graphs are isomorphic. `vf2pp_isomorphism`: obtain the node isomorphism mapping between two g...
0bad1ddfd246148d50d443b373ec0b7499038823397a7cbc883b915d7ff73930
Python
39,314
740
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See the COPYING file distributed along with the smile package for the # copyright and license terms. # ### ### ### ### ### ### ##...
6059c6811992d484aea6e08be72540d94a869c29310dad05690de357c7f1a9a7
Python
39,318
577
# -*- coding: utf-8 -*- """ Generate docs/_generated/usecase_globe.html, an interactive globe.gl view of the published SimBA studies (top of the published-studies page) with three views: * Countries - countries raised & coloured by number of studies (log scale). Default. * Institutions - one bar per institution...
92f76a8e1edc778de8cb620d72eee776c7a96fe60717ab8d4ae3764a8f31747f
Python
39,330
818
"""Functions to create volumetric neuron densities for the following inhibitory neuron types of the mouse brain: - PV+ - SST+ - VIP+ - GAD67+ (a superset of the union of the previous three) The algorithm is presented in "Atlas of inhibitory neurons in the mouse brain" by D. Rodarie et al., to appear in <journal>. Thi...
8345de0c1cc2288cc2fd971da130c30c0620c81507bfb6807664d3259e93815f
Python
39,372
893
# 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 itertools import product from unittest.mock import Mock import numpy as np import numpy.typin...
5037326c3285845ca1f825aea36cd8e555f7bb4cd0408e91012fc19869d157a5
Python
39,418
1,029
""" This module handles all configuration of the scaffold. """ import os, sys, site from inspect import isclass from .models import CellType, Layer from .morphologies import Representation from .connectivity import ConnectionStrategy, FiberTransform from .placement import PlacementStrategy from .output import Outp...
fcaa315945526a272815c4b436211ff459284e09e88799f3675f0e6c30d14f61
Python
39,474
1,127
import os import pathlib import shutil import subprocess import warnings from concurrent.futures import ProcessPoolExecutor, as_completed import dask import joblib import numpy as np import pandas as pd import pybedtools import pyBigWig import xarray as xr import yaml from pybedtools import BedTool from ALLCools.util...
b143cd4d7603c88c529a03b8591272bbdad51bac505f4f6cb11902be6db8f9a3
Python
39,477
1,037
"""Generators for geometric graphs.""" import math from bisect import bisect_left from itertools import accumulate, combinations, product import networkx as nx from networkx.utils import py_random_state __all__ = [ "geometric_edges", "geographical_threshold_graph", "navigable_small_world_graph", "ran...
63caa5a9fda10910a026ebf2e5de08394fa446d32493c177ef2b267e3a58ba89
Python
39,496
798
import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0" import numpy as np import torch from torch.autograd import Variable from matplotlib import pyplot as plt import pickle as pkl from torch_geometric.data import Data, DataLoader from tqdm import tqdm import math import random...
8178450c679e680872d4eb6af1ca100fa117d69b0ce91d80d2c6386b05d9164e
Python
39,581
798
import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0" import numpy as np import torch from torch.autograd import Variable from matplotlib import pyplot as plt import pickle as pkl from torch_geometric.data import Data, DataLoader from tqdm import tqdm import math import random...
790db9fe1ead876d8fff343131d57522ff10fcfac370b25eeea8c98c76471fc5
Python
39,612
715
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 25 14:31:34 2020 This is the main script for processing scRNA-Seq Data through ScanPy. @author: smith """ #%% import os os.chdir('/d1/software/scanpy/') import scanpy as sc import scanpy.external as sce import numpy as np import pandas as pd from s...
b327068977dea21c0bc05d4461e8a2edf9fd62880d016fe8c317515b75bef5ce
Python
39,648
986
# 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 """ Module for benchmarking Ax algorithms. Key terms used: * Replication: 1 run of an optimization loop; (BenchmarkProblem,...
1fd0f63ceb712fcdeffa1ad62af721f0df43ae984f88f3817d358700bbd33f80
Python
39,651
868
# 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 collections.abc import Mapping, Sequence from logging import Logger ...
bd51e0f2b665f957082ece7d41f62a267fa134cf3b7a1c169a46cc3a95c0fd8e
Python
39,680
834
def val_pc_gauss(data_trans,alpha): from timeawarepc.pcalg_ray import estimate_skeleton, estimate_cpdag, causaleff_ida, ci_test_gauss import networkx as nx (g, sep_set) = estimate_skeleton(indep_test_func=ci_test_gauss, data_matrix=data_trans, ...
9c10792567d3f47d0ffea46717e73643853e694e02dbe89591b4edf4f87305d1
Python
39,781
788
# 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...
815e772831bb0606f1b1d78a8e70136cfe3b81310944dca5708784d531629f5a
Python
39,880
988
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime import distutils.util from email import message_from...
60d20148759b2aa822f57536f1fd27443a2c1aca3d811c8fca08cd08e5b2617f
Python
39,893
840
def val_pc_gauss(data_trans,alpha): from timeawarepc.pcalg_ray import estimate_skeleton, estimate_cpdag, causaleff_ida, ci_test_gauss import networkx as nx (g, sep_set) = estimate_skeleton(indep_test_func=ci_test_gauss, data_matrix=data_trans, ...
6cff9e0a089fca3dc61bdcdad83712364d0c4d6305f7308b374b59a0921769b3
Python
39,947
1,121
from skimage import morphology, measure, io, util # For performing morphology operations (should maybe import more from skimage...) from mpl_toolkits.mplot3d import Axes3D # Plotting in 3D import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit from pylab import ...
057ae9722471ebf021d4e7de60742dffc04a520a51a6044fa8e4f42e86ccb03f
Python
39,955
1,021
from __future__ import absolute_import import logging import os import shutil import sys import sysconfig import zipfile from distutils.util import change_root from pip._vendor import pkg_resources, six from pip._vendor.packaging.requirements import Requirement from pip._vendor.packaging.utils import canonicalize_nam...
e617a41f93fcd329b6c9e9de5466073dbf7bc679039dc6b4ff4c7fb3a83d82cb
Python
39,959
875
# 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...
ed8051120a918b53ac5e4cbbdbf05b1fe412189e47ad8a2925cab9c12f386ae4
Python
40,001
953
"""Job control via the HTCondor DRM using the htcondor2 Python API. See the Galaxy cluster documentation (doc/source/admin/cluster.md) for configuration, architecture details, and testing instructions. """ import json import logging import os import select import shlex import subprocess import sys import threading fr...
542d4710108eda02a3bb73cc95c7ffc9af8a10953d02988d956f09572d107953
Python
40,113
1,116
from skimage import morphology, measure, io, util # For performing morphology operations (should maybe import more from skimage...) from mpl_toolkits.mplot3d import Axes3D # Plotting in 3D import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit from pylab import ...
380f9acfbd0071458ab3d369a2fd86995b87164bac0ccfa54c5c243801694014
Python
40,139
1,054
""" Some code are adapted from https://github.com/liyaguang/DCRNN and https://github.com/xlwang233/pytorch-DCRNN, which are licensed under the MIT License. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import random import torch im...
04d0a7a517c556c97265ca2caf8be713f61b9116f74cdc57b64ed3ac3b3325d7
Python
40,172
1,094
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Implementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). """ from __future__ import unicode_literals import codecs from email...
f8f0bc53e09456157a7eec9d15067d555b2c18fcf8898a09c73f6f256a6f5924
Python
40,183
953
""" Galaxy FilesSource implementation for eLabFTW. This module implements a FilesSource that interacts with an eLabFTW [1] instance. eLabFTW revolves around the concepts of *experiment* [2] and *resource* [3]. Experiments and resources can have files attached to them. To get a quick overview, try out the live demo [4]...
cccb3b057c9a19ff7ac98a74eb4cde5ed9814910627a2900855fcb50e1efd9f5
Python
40,229
1,036
"""Functions for measuring the quality of a partition (into communities). """ from collections import defaultdict from itertools import combinations from math import isfinite, log2 import networkx as nx from networkx.algorithms.community.community_utils import is_cover, is_partition from networkx.utils.decorators im...
cc788a3a4b63a24f73cbc4c6f8a324648c2307918b09e26e27d19eec38061727
Python
40,291
858
import fnmatch import logging import time import os from oct import * cp, np, convolve, gpuAvailable, freeMemory, e = checkForCupy() class Post: """ A post-processing object for managing pipeline of OCT processing after acquisition Notes: The post processing object will not run without a populat...
5ec8f813b87ba668b968ea9ec2e174ec2e4019e81301c5a847fdd1417962c244
Python
40,317
1,180
import os import numpy as np from fanc.compatibility.cooler import to_cooler from genomic_regions import GenomicRegion from fanc.matrix import Edge, RegionPairsTable, RegionMatrixTable, RegionMatrix from fanc.hic import Hic, _get_overlap_map, _edge_overlap_split_rao, kr_balancing, ice_balancing from fanc.regions import...
afd5ffaf42f1eaf96bbda09336e9a8761cd0f06c294d7b6b17bcab9fd9b0a59f
Python
40,396
913
""" Copyright © 2025 Howard Hughes Medical Institute, Authored by Carsen Stringer , Michael Rariden and Marius Pachitariu. """ import logging import cv2 import numpy as np import torch from scipy.ndimage import gaussian_filter1d from torch.fft import fft2, fftshift, ifft2 from torchvision.transforms import functional ...
7a5f87f383e8adaef189b8e9a9970241d6f3925298bd625dd3d7353caac2d4b9
Python
40,464
831
import math import random as rd import unittest as ut import networkx as nx from pysbm.sbm import PeixotoInference from pysbm.sbm.nxpartitiongraphbased import NxPartitionGraphBased from pysbm.sbm.partition import NxPartition from pysbm.sbm.objective_function_newman_group_size import * from pysbm.sbm.objective_functio...
1e2461430c107f98fc8d9e7b4c9637b976b1670d4f0c007ac632418907732afa
Python
40,595
1,047
"""Tests for engine initialization modules.""" import numbers import tempfile from pathlib import Path import numpy as np import pandas as pd import pytest from unittest.mock import MagicMock, patch from neurolang.frontend.neurosynth_utils import StudyID # Where the engines keep their cache: a directory of the run,...
7f681547d97ecc5b7f4749fbfa98b165a38aa3f957a9b9c491eaae03dc290b6e
Python
40,617
1,095
""" ******* GraphML ******* Read and write graphs in GraphML format. .. warning:: This parser uses the standard xml library present in Python, which is insecure - see :external+python:mod:`xml` for additional information. Only parse GraphML files you trust. This implementation does not support mixed grap...
0067b057d45bf1608b664a449d2766b8ff36689aabe685f1a7d0af7006df2333
Python
40,628
1,328
import abc import functools import typing from pathlib import Path import numpy as np from .. import config, plugins from .._util import immutable, obj_str_insert from ..trees import BoxTree from ._chunks import Chunk if typing.TYPE_CHECKING: # pragma: nocover from ..cell_types import CellType @config.pluggab...
4ed40a2af0d765424695e55343a367268438bbe49d9087d3edbd52a8f6c5ac4d
Python
40,660
1,029
""" This module performs iterative mapping of reads in FASTQ files to a reference genome. The main function is :func:`~iterative_mapping`, which requires an input FASTQ file, an output SAM file, and a suitable mapper. Mapper options are :class:`~Bowtie2Mapper` and :class:`~BwaMapper` for the time being, but by subclas...
44d8e3289e0c17b24118bdbccbe8d49d383a3edc0e4b8b6ce79a6ce659c2115f
Python
40,668
1,118
from skimage import morphology, measure, io, util # For performing morphology operations (should maybe import more from skimage...) from mpl_toolkits.mplot3d import Axes3D # Plotting in 3D import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit from pylab import ...
0b97717bedc193c2e42788c36e7031b7df0269374ba3a1d2cc80bccaad0f0af6
Python
40,798
1,200
""" Tests that each element in an anndata is written correctly """ from __future__ import annotations import re from contextlib import ExitStack, nullcontext from dataclasses import dataclass from importlib.metadata import version from pathlib import Path from types import SimpleNamespace from typing import TYPE_CHEC...
1e4c7950e9d04cc57aaac8d4d8be105143143afbfc92b0248fe74fdc2686ceac
Python
40,829
1,464
from operator import add, eq, lt, mul, pow, sub, truediv import pytest from nl_expr.logic import Disjunction, ExistentialPredicate from nl_core.datalog import Conjunction, Fact, Implication, Negation, Union from nl_expr.expressions import ( Command, Constant, FunctionApplication, Lambda, Query, ...
82cbd8a2650f1df908af3f7b58a6803a888141e69587ef15b3ee3e9bc72871b5
Python
40,873
997
#!/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 collections import OrderedDict from collections.abc import Mapping, Sequence from...
e811822510a12d4bb4d2a79222e396c21103f8f5b9a621ded57884796c57a6d1
Python
40,895
906
import itertools import numpy as np from brian2.parsing.bast import brian_dtype_from_dtype from brian2.parsing.rendering import NumpyNodeRenderer from brian2.core.functions import DEFAULT_FUNCTIONS, timestep from brian2.core.variables import Constant, ArrayVariable from brian2.utils.stringtools import get_identifiers...
1d768f170ebf600274aa9a4008fbb460b0142ed46cdd0a2f44cfc20991c6758d
Python
40,899
1,979
# This file is automatically generated by tools/idna-data __version__ = "11.0.0" scripts = { 'Greek': ( 0x37000000374, 0x37500000378, 0x37a0000037e, 0x37f00000380, 0x38400000385, 0x38600000387, 0x3880000038b, 0x38c0000038d, 0x38e000003a2, ...
6bd3b0d5b279d6171f66c56986b821382d7afc5b305dfafad271f5d0e1382e15
Python
40,960
1,034
import numba as nb import itertools import os import pathlib import re from typing import List, Literal, Union, Sequence from numpy.typing import ArrayLike, DTypeLike from numpy import ma import feather import natsort as ns import numpy as np import pandas as pd import skimage.io as io from alpineer import data_utils,...
1048b4d22daff660251de3b6cb0b6110211d8e047121217e60553baff0bf49f4
Python
40,996
1,057
from __future__ import annotations import functools import importlib import inspect import json import os import random import time from collections.abc import Callable from concurrent.futures import Future from contextlib import ExitStack from dataclasses import asdict from pathlib import Path from typing import Any,...
d75d1dfbc0b8b20fd19991f0f9b5403ef1e202217d4c0859257a3db6f3753c89
Python
41,001
1,095
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import collections import compileall import csv import hashlib import logging import os.path import re import shutil import stat import sys import warnings from base64 import urlsafe_b64encode from ema...
ac32622685215ad4bb267c787d614edf6c232906b926273895a6d43172ce159c
Python
41,145
978
import matplotlib.pyplot as plt from scipy.optimize import curve_fit from pylab import * import numpy as np import random import math import time import os import glob # change the default font family plt.rcParams.update({'font.family':'Arial'}) def myexponential(x,A,l): return A*np.exp(-x/l)+1 ...
974daae8f327c1e9e0f047d49ba674ca8afe532fb377a58dd139b6f25877a415
Python
41,248
1,158
import pytest import networkx as nx from networkx.algorithms.similarity import ( graph_edit_distance, optimal_edit_paths, optimize_graph_edit_distance, ) from networkx.generators.classic import ( circular_ladder_graph, cycle_graph, path_graph, wheel_graph, ) @pytest.mark.parametrize("sour...
4975cf9bb2d1b347f5f2a5f0d48a58fefeee732c313c68860f62fe1f6baf398c
Python
41,306
1,041
# 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...
04c58a324713944d721fc2d207915563459ce420a4bdf466718a77d4f7f09843
Python
41,316
882
import os import scipy.io import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import logging from mpl_toolkits.mplot3d import Axes3D, art3d # Import 3D plotting toolkit from scipy import stats import re from sklearn.preprocessing import MinMaxScaler class MUSIC_TUS_DataAnalyze...
bc595273fec70e663d5d21759736f60a81ee65acae31c7bca5951fc1bfdc064a
Python
41,353
1,116
from skimage import morphology, measure, io, util # For performing morphology operations (should maybe import more from skimage...) from mpl_toolkits.mplot3d import Axes3D # Plotting in 3D import matplotlib.pyplot as plt # To plot from scipy.optimize import curve_fit from pylab imp...
786092798e0477ee482944c8670306da73f9c1a3d79eb6c5d3037ad1b1471c18
Python
41,404
921
# 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...
30aa4fc54979ecd1c483aeb7572bc8dcae06c651caa3debe4a67c9605b795356
Python
41,429
1,098
from __future__ import print_function, unicode_literals, absolute_import, division import numpy as np import sys import warnings import math from tqdm import tqdm from collections import namedtuple from pathlib import Path from csbdeep.models.base_model import BaseModel from csbdeep.utils.tf import export_SavedModel,...
bc2bcf223089e92393f96a6f4fc477c3583294078b36e56ba7670610437f8486
Python
41,450
1,086
# 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...
d2eeb395250408bef7e4e78ae64cf78923b16b482024a561f4a1492aaf962669
Python
41,514
967
import copy import os import tempfile import numpy as np import pytest import skimage.morphology as morph import test_utils import xarray as xr from alpineer import image_utils, misc_utils from alpineer.test_utils import (create_paired_xarray_fovs, gen_fov_chan_names, make_images_xarra...
e21b1adfdef18de00a0611325c552974423137d6a3c5ff7de9d74e19c4dccb85
Python
41,578
1,209
"""Workflow Builder Functions. Contains a collection of image processing workflow builders used to create a postprocessing pipeline. """ import os from math import sqrt, log from pathlib import Path import pkg_resources import pandas as pd # TODO: import these without specifying, to help with code readability from ...
0bd805af3a294ad8d707bf75a819f030fc91e7df0a433747cb8a7e6eec4df45b
Python
41,626
1,212
"""Workflow Builder Functions. Contains a collection of image processing workflow builders used to create a postprocessing pipeline. """ import os from math import sqrt, log from pathlib import Path import pkg_resources import pandas as pd # TODO: import these without specifying, to help with code readability from ...
1856b2063062072932e231ce07ed63b366c7e9777e44c36470edb8ffebdf0211
Python
41,757
1,148
import copy import os import shutil import tempfile import types import unittest import warnings import numpy as np from bsb_arbor import ArborSimulation, SpikeRecorder from bsb_test import FixedPosConfigFixture, NumpyTestCase, RandomStorageFixture from neo import io from bsb import ( MPI, AfterPrepareHook, ...
d7a1bddeb18f1fbabbd1e4716d41dd7bfcda193b541b4fec9979e793bd794737
Python
41,760
747
import numpy as np import math import torch from torch import nn from torch.nn import functional as F from models.fc.layers import fc_layer,fc_layer_split,fc_layer_fixed_gates from models.fc.nets import MLP,MLP_gates from models.conv.nets import ConvLayers,DeconvLayers from models.cl.continual_learner import ContinualL...
7a5f02614d0e9a02448a9d0a9e3430b6743f980845546df251b964c6edc11d15
Python
42,037
1,050
#!/usr/bin/env python # # Copyright (c) 2018 10X Genomics, Inc. All rights reserved. # from collections import OrderedDict import copy import h5py as h5 import itertools import json import numpy as np import scipy.io as sp_io import os import pandas as pd pd.set_option("compute.use_numexpr", False) import shutil import...
3e69b77eea726fd8ac8dd72399ad595f6b0b293e3811d1f738c0e8f939a2901d
Python
42,133
1,124
from __future__ import annotations import argparse from contextlib import nullcontext, suppress import json import os import platform import signal import statistics import subprocess import sys import time from dataclasses import asdict from datetime import datetime, timezone from pathlib import Path from typing impo...