sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
349c29cbecc0af0b837bf25610223e62da2c190f2edac9bc72fd198d95c5c814
Python
26,736
755
# 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...
fdbc0297a0be4a55ad5233ab09a74b00ca69342c82cefb3be5ccbbe45f7f800e
Python
26,752
744
import sys import numpy as np import os.path as op import json from argparse import ArgumentParser, RawDescriptionHelpFormatter import bids from bids.layout import BIDSLayout from bids.config import set_option from pathlib import Path from rsHRF import spm_dep, fourD_rsHRF, utils from packaging.version import Version ...
9baeba095f4a596ad1385ccd2e582151552c97a5631ea11355e43a37f6ef2716
Python
26,772
686
""" Maximum flow (and minimum cut) algorithms on capacitated graphs. """ import networkx as nx from .boykovkolmogorov import boykov_kolmogorov from .dinitz_alg import dinitz from .edmondskarp import edmonds_karp from .preflowpush import preflow_push from .shortestaugmentingpath import shortest_augmenting_path from .u...
905dd657e0cc392ed6f3452e958d6ff5c0192372b805e8999e61e7cc24f95c18
Python
26,783
795
"""Tests for the core of the interactive REPL.""" import re import pandas as pd import pytest pytest.importorskip("prompt_toolkit") pytest.importorskip("rich") from neurolang_apps.utils.tui import ( # noqa: E402 InteractiveTuiApp, TuiSettings, ) from neurolang_apps.utils.tui.results import rows_table # n...
875bc8a44bf890b66a470e25a0b010eb6b54d0c5aa1584578485183f54d0219a
Python
26,795
747
"""Unit tests for the :mod:`networkx.algorithms.community.quality` module. """ from typing import NamedTuple import pytest import networkx as nx from networkx import barbell_graph from networkx.algorithms.community import ( constant_potts_model, map_equation, modularity, overlapping_modularity, ...
e3d49b8d773665ddb3af01208202821949d8a46e22a2dd2f9a17c8fef08a7344
Python
26,804
547
#!/usr/bin/env python3 import os import numpy as np import time import torch from torch import optim # -custom-written libraries import utils from utils import checkattr from data.load import get_context_set from models import define_models as define from models.cl.continual_learner import ContinualLearner from models....
76d2781b68d95cb2354ef802bf18cdf050d368873a7e15c6caa66f8e54482edc
Python
26,812
623
#!/usr/bin/env python # # Copyright (c) 2015 10X Genomics, Inc. All rights reserved. # import collections import cPickle import csv import itertools import json import math import numpy as np import os import subprocess import sys import re import tenkit.log_subprocess as tk_subproc import tenkit.safe_json as tk_safe_j...
84018750f956f126b8054eb45980cf92138a91080926cfa790e19ce6a9ce7f45
Python
26,827
727
"""\ This module implements on disk sparse datasets. This code is based on and uses the conventions of h5sparse_ by `Appier Inc.`_. See the copyright and license note in this directory source code. .. _h5sparse: https://github.com/appier/h5sparse .. _Appier Inc.: https://www.appier.com/ """ # TODO: # - think about s...
e2b4eb4c227488fe09c6b4e02723b4f0b3495679b412df2d34520b21dd521e28
Python
26,878
679
import json from collections.abc import MutableMapping from copy import deepcopy from typing import ( Any, cast, Dict, List, Optional, Tuple, Union, ) import packaging.version from pydantic import TypeAdapter from galaxy.tool_util.deps import requirements from galaxy.tool_util.parameters.c...
d3abca25c9e47982dc7c5b2f87a316041f9c894ea9062ffaa81afe6c8a0c9c2c
Python
26,882
539
import time import os import numpy as np from cellpose import io, utils, models, dynamics from cellpose.transforms import normalize_img, random_rotate_and_resize from pathlib import Path import torch from torch import nn from tqdm import trange import logging train_logger = logging.getLogger(__name__) def _loss_fn_c...
c12f62d3eb1bf1915829c2aaf801244553804c91f1f4b22ca3c8e97ed1e7b215
Python
26,921
718
# 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 from unittest.mock import patch import pandas as pd from ax.adapter.registry import Gen...
6084b4651841b8fac1bdfd7d24b0e70112c9e15c95483c5e16d67d746e5173a5
Python
26,928
689
# 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...
25d27dced472e0773e6f9f954bbe31de752d744215aff381bccb086fc3b6b237
Python
26,964
788
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
9a7a42ca9802668c3ad0776cf3a28d9bba11f000aa442ad6395a789d472144ae
Python
26,967
776
import numpy as np import torch from torch.utils.data.dataset import TensorDataset from torch.utils.data import DataLoader import torch.nn.functional as F import torch.nn as nn from torch.autograd import Variable import numpy as np import scipy.linalg as slin import scipy.sparse as sp import networkx as nx import panda...
692918da2bd066b23e355b0616ac3935d52d1ec9b67d8e59caccb98c7b5ecbd1
Python
26,972
677
from __future__ import annotations import copy import functools import inspect from typing import Callable import torch from .. import base from spikingjelly.logger import logger __all__ = ["FlexSN"] def _as_tuple(value) -> tuple: return (value,) if isinstance(value, torch.Tensor) else tuple(value) def _con...
7d038081131d0b64878b58549e866e9109df70d92ec74507ce81ce6329125b6d
Python
26,993
645
from cogdl.datasets.grb_data import Cora_GRBDataset from attack.modification import * from attack.injection import * from attack.modification import RAND as RAND_Modify from attack.injection import RAND as RAND_Inject from attack.modification import PGD as PGD_Modify from attack.injection import PGD as PGD_Inject from ...
ea8cb78a5373c1fb813d548343242b4f3ddddcb025e83c04e05c343cd751f743
Python
27,019
819
import pathlib import subprocess import numpy as np import pandas as pd import pyBigWig import xarray as xr from numba import njit from ALLCools.utilities import parse_mc_pattern def _mvalue(mc, cov, alpha=0.1): m = np.log2((mc + alpha) / (cov - mc + alpha)) return m def _frac(mc, cov, alpha=0.001): f...
f7abb1e853402113ac17dec4998a2d39bd07f3a9c85b763e8b0a3bdfb3052110
Python
27,020
519
# -*- coding: utf-8 -*- import os import click import random import logging import pandas as pd import numpy as np from datetime import datetime, timedelta from tqdm import tqdm from itertools import chain from definitions import DATA_DIR, ROOT_DIR from src.omni.functions import save_pickle, load_pickle, save_list2csv...
8540c30c813f28d10a6bcb8452d942b8948a45688c51489b03c21eb79851b6a7
Python
27,031
524
import itertools import numpy as np import pandas as pd pd.set_option("compute.use_numexpr", False) import tenkit.stats as tk_stats import sys import cellranger.analysis.diffexp as cr_diffexp import cellranger.library_constants as lib_constants import os import cellranger.io as cr_io import collections DIFFERENTIAL_EX...
285d2510d0f482184b0b2f8fcca0ee53e383d5a3b38a14d4ff32c71ebc260e8b
Python
27,043
580
"""Consolidated model quality-control checks for Human-GEM. A single entry point for the structural checks. Each check writes a detailed, diff-friendly CSV under data/testResults/ so that whatever is wrong is spelled out in a committed file (not only in the workflow log), and buildReport.py turns the same files into t...
ae4c5ae9fbe5de68ae2f34a2e80a54e3c3e0e6445b7357769140028459c19e5b
Python
27,060
610
""" Actions to be run at job completion (or output hda creation, as in the case of immediate_actions listed below. """ import datetime from markupsafe import escape from galaxy.model import PostJobActionAssociation from galaxy.util import send_mail from galaxy.util.custom_logging import get_logger log = get_logger(...
25589e4024394bfe5dc9b3f23eca34ef324e8203dec0e82efb51792c91982b24
Python
27,075
645
""" Copyright © 2025 Howard Hughes Medical Institute, Authored by Carsen Stringer, Michael Rariden and Marius Pachitariu. """ import sys, pathlib, warnings from qtpy import QtGui, QtCore from qtpy.QtWidgets import QApplication, QScrollBar, QCheckBox, QLabel, QLineEdit import pyqtgraph as pg import numpy as np from s...
13c0814173b9c111de18533bb5b1ded88b37c072ee0eab01e95b44f947704f5e
Python
27,087
781
from __future__ import annotations import copy import warnings from dataclasses import dataclass, field from math import ceil, isfinite, prod from numbers import Real from typing import Any import torch import torch.nn as nn from ..neuron.base_node import BaseNode from ..neuron.integrate_and_fire import IFNode from ...
d282059cd452310f5f04ed6b0f009f65b5376c7f12b4d556616212e2d1a6f12e
Python
27,108
841
# -*- coding: utf-8 -*- # Imports import pandas as pd import numpy as np from scipy.stats import norm import math from random import sample as random_sample from .pd_utils import to_torch, join_to_df, argmax, complement, sample, torch_to_numpy # Main acquisition class class acquisition: """Class represents the...
c2815e12b62ffcb15776739f728ac691799d8f5ab9daf4857d93b0a68f8fa52b
Python
27,121
688
""" Flow based cut algorithms """ import itertools import networkx as nx from networkx.algorithms.approximation.connectivity import ( local_node_connectivity as approx_local_node_connectivity, ) # Define the default maximum flow function to use in all flow based # cut algorithms. from networkx.algorithms.flow im...
36610875fdbb75c95c60114a95fbacba9add89401dc261db218f05bd2464bef6
Python
27,126
603
# 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...
7fb6f44da49cb1fc0dee1abc9df4a5b19c4ce2965ed1ef61a5409315e7790fdd
Python
27,132
791
from collections.abc import Mapping from copy import deepcopy from functools import partial from random import choices from string import ascii_lowercase from anndata import AnnData from anndata.experimental import AnnCollection import numpy as np import pandas as pd import synthetic_spatial_datagen import xarray as xr...
2267c7c0a1370d1f3868305938517daef312cd393d96c6ecec7ad77683d13d65
Python
27,145
915
import abc import builtins import inspect import math from weakref import WeakKeyDictionary import numpy as np from packaging.requirements import Requirement from ..exceptions import ( CastError, ClassMapMissingError, InvalidReferenceError, NoneReferenceError, RequirementError, TypeHandlingErr...
02d3f0ddaa25197957852947088afabdf19ad0c8affd4bf65377e6f993ed1797
Python
27,150
797
# -*- coding: utf-8 -*- """ Created on Tue Feb 22 17:09:31 2022 @author: marcomau """ import os import numpy as np import torch import torch.nn.functional as F from torch_geometric.data import Data import model_RGNN_evolution1 as model from utils_RGNN_evolution1 import* from sklearn.preprocessing import S...
1652371f8f11022eb39233be2a1dc15b4a8b9440c40e5264237a52be62c12002
Python
27,152
981
import argparse import textwrap def fancplot_parser(): usage = '''fancplot [<fancplot global parameters>] <region> [<region> ...] --plot <plot type> [<plot parameters>] <plot data file(s)> [...] Run fancplot --plot <plot type> -h for help on a specific subplot.\n\nPlot types:\n\n''' ...
ea618efcd87becaa1f36ba3ed55c51b7cb423a24f8b48270fb3926ae98260165
Python
27,166
535
import errno import logging from typing import ( Any, ) from galaxy.exceptions import RequestParameterInvalidException from galaxy.tool_shed.galaxy_install.client import InstallationTarget from galaxy.tool_shed.util.basic_util import strip_path from galaxy.tool_shed.util.repository_util import get_repository_owner...
56ce77f8ac0e1f758a0bece88ad2ee1ef66a4dc599b22dd566b82921729e4e1f
Python
27,189
807
# 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. # # ## ### ### ### ### ### ...
3c0e13f8ca045677f2d7ae344412a0b7f3534f755d3505bf8ff60cf35cb7a02f
Python
27,192
677
#!/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 itertools import warnings from collections.abc import Calla...
dc39e4ca1ed3bfd6365b35089b2f982d3c18344a263d6789e8824baad2b3d62a
Python
27,203
548
import numpy as np import torch import torch.nn as nn import random import scipy import time import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import norm from datasets import load_aux_patterns def set_seed(manualSeed): np.random.seed(manualSeed) random.seed(manualSeed) ...
36ff236ca5dc5d7a7ae61f1096856539c77b6bd8e6163cf7bc3152a3f980e70e
Python
27,257
810
# -*- coding: utf-8 -*- """ BlockProcessing =============== Module to process data in parallel for large data sets This strategy allows memory intensive processing of larger data sets. Example ------- >>> import numpy as np >>> import ClearMap.IO.IO as io >>> import ClearMap.ParallelProcessing.BlockProcessing as bp...
91633735860745002d8411021434c75e10b2d104086a3e654a4d13fce8282d05
Python
27,281
692
"""Helper class for making and retrying requests to the MIBItracker. Copyright (C) 2021 Ionpath, Inc. All rights reserved.""" import datetime import io import json import os import warnings import requests from requests.adapters import HTTPAdapter from requests.exceptions import HTTPError from skimage import io as ...
1ab8fd62c27079641333ceb062be8c48f220ba469bca70292c9bdbcf94bd0a02
Python
27,291
955
from __future__ import absolute_import, division import copy import numbers import numpy as np import zarr import h5py import json import logging logger = logging.getLogger(__name__) class Freezable(object): __isfrozen = False def __setattr__(self, key, value): if self.__isfrozen and not hasattr(...
2cfa516236049811fd5a0c2b4f7e1b1eb6559be46910c4bd36bdd007c76b826c
Python
27,292
521
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thur August 30 2018 @author: chrisarcadia @description: script to review a composite library sourceplatesheet and to optionally generate a mass list and Echo recipe for that library Composite Library Style #1 ...
7ba32942452e555570f4d0e7682e45be232e17e2b19f2f678ef9f376d016a9ef
Python
27,309
756
""" The LLM query assistant in the REPL: ``.ask`` and ``.llm``. ``.ask <question>`` turns the question into a query of the session's language with an LLM (see :mod:`neurolang_apps.utils.llm`), printing the steps of the agent as they run. The query is not run: it is put in the next prompt, to be read, edited and run wi...
11a85b03d8bd8089942bfc88d7b07b75df75d3786806c04a04ff409b53a75c00
Python
27,320
570
# Copyright 2019, Mukesh Mithrakumar. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
5551ab8d5e413ad348637dab4fb1f549e67be763141e8655e9a3e8b42ad88e8b
Python
27,381
638
#!/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 Mapping from itertools import groupby ...
c666d9fdf359135bddc60e2f71a58c48628e976cd012c5f11f1ca2811cd6e5bc
Python
27,381
753
#!/usr/bin/env python """Build a mulled image for specified conda targets. Examples Build a mulled image with: mulled-build build 'samtools=1.3.1--4,bedtools=2.22' """ import json import logging import os import platform as _platform_module import shutil import stat import string import subprocess import sys f...
b1687b8848095fb531ae52f00718c71a08f5403bfa9e282f5c98c85ba730c7e6
Python
27,399
682
import bisect import os import pathlib import warnings from abc import ABC, abstractmethod from itertools import combinations from typing import List, Literal, Protocol, runtime_checkable import natsort as ns import feather import numpy as np import pandas as pd from alpineer.io_utils import list_files, validate_paths ...
fc6f1c67e6188ab2e2fd9f83328638d158b26cd521289668c86f8483dd476e53
Python
27,432
688
"""Tests for MSA to HMM conversion functionality.""" import os import numpy as np import pytest from learnMSA.hmm.util.transition_index_set import PHMMTransitionIndexSet from learnMSA.hmm.util.value_set import PHMMValueSet from learnMSA.util.aligned_dataset import AlignedDataset def test_msa_to_counts() -> None: ...
a5c08ba2692ad778e60e7e13dfa91cfb243ab66f4bad1b5905a829b7972b95a0
Python
27,434
682
"""Client-centric CWL-related utilities. Used to share code between the Galaxy test framework and other Galaxy CWL clients (e.g. Planemo).""" import abc import hashlib import io import json import os import tarfile import tempfile import urllib.parse from collections import namedtuple from typing import ( Any, ...
5e5c5a2541c5f4c24dd48a3accda9be5cb80086766e71d9640668a513f2a4da1
Python
27,494
905
r""" Query Resolution Expression =========================== Declares FrontEnd Expression class and subclasses. Those classes are used to build Datalog programs in an ergonomic manner, and attention is paid to their representation """ import operator as op from functools import wraps from types import BuiltinFunctionTy...
b98d745fb5edd0fdc253677e71a5959e129599fdf8d66f3b1820f1407fb0cbb6
Python
27,530
621
# -*- coding: utf-8 -*- """ Functions for generating workflow methods reports Note: all text contained within this module is released under a `CC-0 license <https://creativecommons.org/publicdomain/zero/1.0/>`_. """ import logging import numpy as np from . import __version__ from .datasets import check_donors, fetc...
ee4556069b260ea619035a1e5362ec1c581db4f73c97ed1c5dc79b43ef3e39a5
Python
27,530
818
"""Functions for finding and manipulating cliques. Finding the largest clique in a graph is NP-complete problem, so most of these algorithms have an exponential running time; for more information, see the `Wikipedia article on the clique problem <clique_wiki_>`_. .. _clique_wiki: https://en.wikipedia.org/wiki/Clique_...
455816c8f69542e4678de11ab042d9bac7f7f05eb504ac382e1861ba7fd21c4a
Python
27,534
723
# -*- coding: utf8 -*- """ All loaders for mice datasets. """ __all__ = [ 'load_meta_blood', 'load_full_meta', 'sanity_check', 'filter_CBC_dataset', 'load_lifespan_itp' ] import os import glob import pandas as pd import numpy as np _GLOBAl_DIR_PATH = os.path.dirname(__file__) + '/raw' _GLOBAl_DATA...
33b90af66b5e437d618f44c0eeb5fd828b931182d82032e799e31adddc3b408e
Python
27,540
558
for key in list(globals().keys()): if (not key.startswith("__")) and (key != "key"): globals().pop(key) del key from typing import Any, Iterable, Mapping, Sequence, Tuple, Union import anndata import numpy as np import logging from scipy.sparse import spmatrix from rpy2 import robjects from joblib import Paralle...
3719d0db08c77ed64f4446e88e3d8984fc52f7708571ea32ab0e7257e0bba153
Python
27,545
724
# -*- coding: utf8 -*- """ All loaders for mice datasets. """ __all__ = [ 'load_meta_blood', 'load_full_meta', 'sanity_check', 'filter_CBC_dataset', 'load_lifespan_itp', 'fill_wbc_counts' ] import os import glob import pandas as pd import numpy as np _GLOBAl_DIR_PATH = os.path.dirname(__file__...
c5d0a56123b94c173668c47ebe75e2be9ff857ab0d0bf1622521f43df61ce5de
Python
27,612
739
"""Provides functions for computing minors of a graph.""" from itertools import chain, combinations, permutations, product import networkx as nx from networkx import density from networkx.utils import arbitrary_element __all__ = [ "contracted_edge", "contracted_nodes", "equivalence_classes", "identif...
677d7acdb936ab17a8b33302ef25a2081b17774e86bddec968341db970dc4b64
Python
27,635
943
# encoding: utf-8 """ NRRD ==== IO interface to NRRD volumetric image data files. Note ---- The interface is based on nrrd.py for reading and writing nrrd files. See 'this link <http://teem.sourceforge.net/nrrd/format.html>`_ for specifications. """ __author__ = 'Christoph Kirst <christoph.kirst.ck@gmail.co...
026983d450d76697f77889b50bdbc15dba688bee26b5297300c2297365c1a6c3
Python
27,646
501
"""Functions that either provide an instruction flow or a string to display.""" import os import os.path as op import numpy as np import pandas as pd import sp_experiment from sp_experiment.utils import get_final_choice_outcomes from sp_experiment.define_settings import (txt_color, ...
7248edf96a89b13634bbdb36a03ef03d1490067c10fe6fa281e93a99a68f103b
Python
27,710
667
# 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 agreed...
04b24f44c92ea77865fdeff50b48486879bc7d716679e72f8b28bde7ee60e382
Python
27,723
754
import functools import hashlib import json import logging import os import platform import re import shutil import sys import tempfile from typing import ( Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, TYPE_CHECKING, Union, ) from packaging.version import Vers...
d2e517dcca816420f7570ed9e200db8e6961b49b5db1e10a3589c06d2b843ef5
Python
27,765
634
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 17 14:32:49 2022 @author: akshay """ from dash import dcc,html,dash_table import dash_bootstrap_components as dbc from app import app from dash.dependencies import Input, Output,State import dash_uploader as du import dash from plots import * from b...
8a97d69c6c57be063999c3b3a28c90942dadca16bca9103db273d30cf9d32618
Python
27,783
551
from itertools import combinations from itertools import chain import numpy as np import pandas as pd import numpy as np from collections import defaultdict from itertools import combinations from itertools import chain import itertools import pickle from feature import * import os import warnings def us...
aaee48e45294d2831031c9eebb338172e5494c1b8e01cbb9bcb74eeb02e4a0f0
Python
27,837
621
import copy import warnings from typing import List import re import numpy as np import pandas as pd import xarray as xr from alpineer import io_utils, load_utils, misc_utils from skimage.measure import regionprops, regionprops_table import ark.settings as settings from ark.segmentation import segmentation_utils from...
87a3dedae620096def47b71c3d13e267dd124041a5de891f90b518e762c0e515
Python
27,845
695
import sys from collections.abc import Sequence if sys.version_info >= (3, 12): from typing import override else: from typing_extensions import override import numpy as np import tensorflow as tf from hidten.hmm import HMMConfig from hidten.tf.util import T_initializer, setup_initializer from hidten.tf.emitte...
2cee60a031a2bfe1e883e8170ef6eb4bd756527a4514c2bfeaeff8c966af7a28
Python
27,857
794
import jax import jax.numpy as jnp import numpy as np from functools import partial import pyqmc.wftools from typing import NamedTuple class BasisParameters(NamedTuple): """ These are parameters for the basis functions (polypade and cusp). """ beta_a: float beta_b: float ion_cusp: list rc...
79eb3eac0f1b94be618b45c09af034483e8274e0e0067912c912cc4e8565f88d
Python
27,871
792
import os from shutil import copyfile import sys import logging import argparse import json import re import yaml import numpy as np import torch import tensorboardX import gunpowder as gp import incasem as fos SCRIPT_DIR = os.path.dirname(__file__) REPO_ROOT = os.path.abspath(os.path.join(SCRIPT_DI...
71ac3b79df80669718377c52da7cd0e2cd6eb1a30b9bd83884a92d5612467f0a
Python
27,881
1,032
# -*- coding: utf-8 -*- """ IO == IO interface to read files as sources. This is the main module to distribute the reading and writing of individual data formats to the specialized sub-modules. See :mod:`ClearMap.IO` for details. """ __author__ = 'Christoph Kirst <christoph.kirst.ck@gmail.com>' __license__ =...
dc9537ea2b36c290bca7794ba688918048479885c2c9f7e284b9cf49f3c1815c
Python
27,921
549
# -*- coding: utf-8 -*- import pandas as pd import os import copy import numpy as np import time import re from skimage import io from scipy import ndimage from scipy.ndimage import morphology from matplotlib import pyplot as plt input_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), ...
68226cf15e4f1619048dbd4b92a30b2e7e821002a05c1b2adf6b0cfb54165b36
Python
27,927
699
r""" ***** LaTeX ***** Export NetworkX graphs in LaTeX format using the TikZ library within TeX/LaTeX. Usually, you will want the drawing to appear in a figure environment so you use ``to_latex(G, caption="A caption")``. If you want the raw drawing commands without a figure environment use :func:`to_latex_raw`. And if...
6c07ec270608ca6bc95db69232e3f09c3d7502c67bb60bd34f2791c6e2a83704
Python
27,943
844
# -*- coding: utf-8 -*- """ Interface to Elastix for alignment of volumetric data The elastix documentation can be found `here <http://elastix.isi.uu.nl/>`_. In essence, a transformation :math:`T(x)` is sought so that for a fixed image :math:`F(x)` and a moving image :math:`M(x)`: .. math:: F(x) = M(T(x)) Once...
d3d2d399e3a38dead59f23279000256e7fb0298091aa81cd80134ce20739e9b4
Python
27,943
706
# 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...
bf4061900adae4cbe56dcee64a43888d4a73a41f25f9e5fc059127ffa2a76e96
Python
27,951
532
import unittest import pysnirf2 from pysnirf2 import Snirf, validateSnirf import h5py import os import sys import time from numbers import Number from collections import deque from collections.abc import Set, Mapping import numpy as np import shutil VERBOSE = True # Additional print statements in each test # Need to...
06a0f575694c4370fb3a6c7e63e99b8e78fff959f50a3301758b8bb1141395de
Python
27,975
846
""" CLI defined here When adding new function: 1. add a func_register_subparser function to register the subparser 2. add a condition in main func about this new func name, import the real func as func in main """ import argparse import inspect import logging import os import subprocess import sys import ALLCools f...
bce9b475da1a2913a27cb6fad55aece0bc27ac3510b981122e859e390f32cf82
Python
27,976
680
#Contains MeldCohort and MeldSubject classes from contextlib import contextmanager from meld_classifier.paths import ( DEMOGRAPHIC_FEATURES_FILE, CORTEX_LABEL_FILE, SURFACE_FILE, DEFAULT_HDF5_FILE_ROOT, NVERT, BASE_PATH, MELD_PARAMS_PATH ) import pandas as pd import numpy as np import nibab...
4aa3b01a53714a1d14d6dbfbf1a749a63441fe2b2c417e1ac8d7d3c73fcf54f9
Python
28,018
582
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import os import copy import seaborn as sb from matplotlib import pyplot as plt from scipy.signal import argrelextrema from scipy import stats from scipy.stats import linregress def smoothen(row,new_growth_data,radius,column): #calculat...
1777b957771fc272276582f56903a3e3baed02c15316a6a4e044dd7272b90e41
Python
28,075
726
''' ''' # # Adapted from MATLAB code written by S. Nishimoto (see Nishimoto, et al., 2011). # Anwar O. Nunez-Elizalde (Jan, 2016) # # Updates: # Anwar O. Nunez-Elizalde (Apr, 2020) # # # Implementation notes: # # The terminology here is "pyramid" and "filters". # In moten.core, the termilogy is inconsistent. # # TODO:...
3c018694d76ee1917ff0b9bf7e7352af97ae082fd5708bd2c9c8ddff7c654071
Python
28,075
576
#!/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 logging from math import ceil from typing import Any import torch from ax.adapter.registry imp...
59f75e2b36e8136e7c22d987f777eb24d9e003d1a449932de103df0a5eaa8129
Python
28,089
680
"""This module contains a linting functions for tool tests.""" from io import StringIO from typing import ( Iterator, List, Set, Tuple, TYPE_CHECKING, ) from packaging.version import Version from galaxy.tool_util.lint import Linter from galaxy.tool_util.parameters import validate_test_cases_for_t...
e6e798113b224856b2669a0e4d153d02acb2173582801d3bed92e8a3daaa1034
Python
28,106
705
import cv2 import numpy as np import xlrd import random import os # tolist def get_data(): # 此函数读取datasets文件夹下的图片,并和excel表格的标签一一对应 # 返回数据与标签,单个数据为1维向量形式,非图片的矩阵形式 data = [] label = [] # 先得到标签集 workbook = xlrd.open_workbook('weight.xls') Data_sheet = workbook.sheets()[0] rowNum = Data_she...
2e13ba41046137298063f3bef20514a88732c2dadff61b37c93aa24f97d6a0c9
Python
28,116
755
from ...simulation import ( SimulatorAdapter, SimulationComponent, SimulationCell, TargetsNeurons, TargetsSections, SimulationResult, SimulationRecorder, SimulationDevice, ) from ...helpers import get_configurable_class from ...reporting import report, warn from ...models import Connecti...
86085ef265a3f283508b1a2bf474f0ac905e9c3dac727808b461e3064632f30a
Python
28,158
674
import abc import builtins import os from datetime import ( datetime, timezone, ) from enum import Enum from typing import ( Any, ClassVar, Generic, Optional, TYPE_CHECKING, ) from galaxy.exceptions import ( ConfigurationError, ItemAccessibilityException, RequestParameterInvalid...
d4d5eef9c22338c21f3d03f3170aa75b03e1ecccf608335bc9a847754b853135
Python
28,163
721
""" Created on Dec 29, 2020. This module provides different functions to estimate sfc between two signals from the time domain. @author: voodoocode """ import numpy as np import scipy.signal def dac_td(data_1, data_2, f_min, f_max, fs, nperseg, nfft, return_signed_conn = True, minimal_angle_thresh = 10, volume_con...
925163bbc3a42738ba6cebe13ffe2aca7187c553068fd3973776cd19289f5f9d
Python
28,217
782
from pathlib import Path import sys from learnMSA.run.args import parse_args from learnMSA.run.args_to_config import args_to_config class TestArgsToConfig: """Tests for converting argparse Namespace to Configuration.""" def test_args_to_config_with_minimal_args(self): """Test conversion with only re...
19c324d6d3d6c97314976d5f1a0a0241ff1dd1626648f9c7f606163d32a7d90c
Python
28,354
714
from __future__ import division from fanc.config import config from fanc.regions import RegionsTable, GenomicRegion from fanc.matrix import RegionMatrixTable from fanc.legacy.architecture.architecture import ArchitecturalFeature, calculateondemand, \ _get_pytables_data_type from fanc.general import MaskFilter from ...
a31c19e4c62b37d9715b8f4abf4458ce799064e55636637135f171bc99cc9916
Python
28,374
681
# 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 copy import math from typing import cast from unittest.mock import patch import torch from ax.adapter.base import Ad...
f416b67399751436ffa2333405e9e984a91d5fad4860c206dc44214c3d58de46
Python
28,393
717
import time from collections import deque from itertools import chain import numpy as np import torch import sys import os import copy from scipy import stats import torch.nn as nn from src.utils import get_argparser from src.encoders_ICA import NatureCNN import pandas as pd import datetime from src.lstm_attn import s...
93e3985e68eb64074fac3b813a5c76d2d4662c7005d10d40d86562faac7884f3
Python
28,428
1,212
""" adapted from https://github.com/lab-cosmo/sphericart/blob/main/sphericart/include/macros.hpp https://doi.org/10.1063/5.0156307 Filippo Bigi Guillaume Fraux Nicholas J. Browning Michele Ceriotti J. Chem. Phys. 159, 064802 (2023) Hard-coded expressions for low-l Cartesian spherical harmonics and their deriva...
567dd49e86622d91648780594f23e74917285d6eb37f8cf8683d8aee3625cdcf
Python
28,454
711
import os import tempfile from shutil import rmtree import feather import numpy as np import pandas as pd import pytest import skimage.io as io from alpineer import image_utils, io_utils, load_utils, misc_utils, test_utils from pytest_cases import parametrize_with_cases # import ark.phenotyping.pixie_preprocessing as...
d19b2cc11dcdf1cbc6e55f79f18b7abf0edb991f3eaa2fc4cb38764b2029fa36
Python
28,507
540
"""Class for the network model and for the input tuning functions. Assumes D=2 spatial dims.""" import numpy as np from . import log, asciiL from functools import lru_cache from . import FilterStrinfAdiabaticDiagonalSigma from . import LinearPopulationCode, OneToOnePopulationCode, LinearInputPopulationCode from scip...
54c95fa389e43f75e6dddf91b1bbb690e04976ac9d890d268fd0200528f2e0bb
Python
28,513
535
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on July 27, 2020 @author: chris3arcadia @description: script to review a composite library sourceplatesheet and to optionally generate a mass list and Echo recipe for that library Composite Library Style #4...
7a4e7507468d0a750dd14b0650c23b8c3ec645e76f412ebd2734788d86297418
Python
28,585
814
import argparse from contextlib import contextmanager import json import time from dataclasses import asdict, dataclass from pathlib import Path from typing import Any, Iterator import torch import torch.nn as torch_nn import torch.nn.functional as F if __package__: from .fp8_coverage import _FP8CoverageTracker e...
7bb5b893b0b8e218a2797a32ba2ee81afbc55a03edceb9e7e4fec273d027e964
Python
28,585
758
# 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...
9f818a7cfabea5e6dbb05143727568c0af4592fb557283d0bdb5dcf59a2a21a8
Python
28,669
653
""" Tool recommendation agent for suggesting appropriate Galaxy tools. Despite the historical name, this agent recommends both atomic Galaxy tools and end-to-end IWC workflows. Atomic asks ("which tool sorts a BAM?") still get a tool back; analysis-shaped asks ("RNA-seq from FASTQ to differential expression") get a wo...
c57e16a12271cdeccffdbc2ba41477ef8c6c951c37ed541463e26fba64cea7dd
Python
28,686
532
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on July 27, 2020 @author: chris3arcadia @description: script to review a composite library sourceplatesheet and to optionally generate a mass list and Echo recipe for that library Composite Library Style #5...
a75661f00c0a475ab9dd91058d1dfab518d3bb4faefc0f93d06f33a2274368ef
Python
28,702
907
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ GraphProcessing =============== Module providing tools to create and manipulate graphs. Functions include graph construction from skeletons, simplification, reduction and clean-up of graphs. """ __author__ = 'Christoph Kirst <christoph.kirst.ck@gmail.com>' __licens...
11d4306445b693abd14db91232d8c6f63a51ec0bb6901ec7c10e0177a81e9872
Python
28,762
531
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thur August 30 2018 @author: chrisarcadia @description: script to review a composite library sourceplatesheet and to optionally generate a mass list and Echo recipe for that library Composite Library Style #3 ...
3fcb96a69faf6c1ef1de710fab3b4120e6c88de79ede2b0102dc5b9483a63694
Python
28,767
728
"""Plot the correlation analysis results. Parameters ---------- project_dir : str Directory of the project folder. """ import argparse import os import numpy as np import matplotlib from matplotlib import pyplot as plt # ============================================================================= # Input argumen...
c11019a45f9fdfb1592d06deffac0b88e6e2f29f766d3f9ad2654dbeceaad4c4
Python
28,836
633
import random as rd import unittest as ut import networkx as nx import numpy as np from pysbm import sbm class TestSBMInference(ut.TestCase): """ Test Class for SBMInference and subclasses """ # noinspection PyPep8Naming def __init__(self, methodName='runTest'): super(TestSBMInference, self).__...
eade76393adc1072e4aa90c3fdd39b32142fbdf0c4f485b3f9b6f12332dfc6fe
Python
28,842
752
from __future__ import division import tables import logging import operator from collections import defaultdict from genomic_regions import GenomicRegion, as_region from future.utils import string_types from ..tools.general import RareUpdateProgressBar from ..regions import RegionsTable from ..matrix import RegionMa...
318e4b44c2377ec6b4c2dc9fe71f2d819d05e238fabd7adc233d53f55f6b61f5
Python
28,930
681
import sys import copy from PyQt5 import QtGui from PyQt5 import QtCore from PyQt5 import QtWidgets from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt5agg import \ NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figu...
e03a2081a068606d9b805f6b1027167f1608244ae3c3c5749175c09ca69106c6
Python
28,932
763
import os import glob import click import pandas import nibabel as nib import json import numpy import gc import psutil import re from pkg_resources import resource_filename from .postprocutils.utils import ( get_scrub_vector, calc_filter, apply_filter, regress, scrub_data, notch_filter, ) fro...
36c9e49f6f1b232c736e2da4002f86c38d28a6a650848b95321fc679af4046df
Python
28,933
763
import os import glob import click import pandas import nibabel as nib import json import numpy import gc import psutil import re from pkg_resources import resource_filename from .postprocutils.utils import ( get_scrub_vector, calc_filter, apply_filter, regress, scrub_data, notch_filter, ) fro...
e5ac77255406c3bfe914c14d29657d9b7923d79313bb846aaadaffab78378ba8
Python
28,965
774
from spikingjelly.logger import logger from typing import Callable, Optional, Tuple import os from pathlib import Path import multiprocessing from concurrent.futures import ThreadPoolExecutor from functools import partial import math import h5py import numpy as np from torchvision.datasets.utils import extract_archive...
670641030f2e23498566449400d72f6a23526ca175ab40908b3f82c931a5e100
Python
28,971
526
import os import json import numpy as np import pandas as pd from rdkit import Chem from pathlib import Path from sklearn.model_selection import train_test_split, StratifiedKFold, KFold from MolRep.Evaluations.data_split import scaffold_split, defined_split from MolRep.Featurization.Graph_embeddings import GraphEmb...