sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
bb017011ad4c4f747387e320fb39a664ef24f33374be90f4872bf6d23289f4f1
Python
42,191
1,173
""" This module includes the main classes that handle the training of the ANN models as well as the predictions of the new chemical shifts. """ # Python import(s). import warnings import logging import sys from datetime import date from gc import collect as collect_mem_garbage from pathlib import Path from time import...
fd1e556055be55e2c16520c7cb25050a0479cdb297d4baee6fe7ef746e76dee9
Python
42,206
1,164
#!/usr/bin/env python # # Copyright (c) 2014 10X Genomics, Inc. All rights reserved. # # Utilities for manipulating bam files # import os import pysam import log_subprocess import random import resource import logging import shutil import math import tenkit.bio_io as tk_io import tenkit.seq as tk_seq import csv import ...
9492a01d9f2a35b9eb452ea1379af721d26c1a32d231a955d4ae2f5d689d2305
Python
42,275
1,167
""" Module for handling genomic regions such as chromosomes, bins, and restriction fragments. The class :class:`~RegionsTable` is an implementation of the :class:`~RegionBased` interface from the :mod:`genomic_regions` package. More details on how to use the :class:`~genomic_regions.RegionBased` interface can be found...
b0603e84a5409e72013b4ed01d7b476944dd6ed213b67d72a078ca73e78ade22
Python
42,284
1,063
# 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...
e901905c51502a2d7205426f6af6f5ecb98aa62b5ee6fce2522e5a1cbd6d02b3
Python
42,305
952
""" Manager and Serializer for Datasets. """ import glob import logging import os from typing import ( Any, Optional, TypeVar, ) from sqlalchemy import select from galaxy import ( exceptions, model, ) from galaxy.datatypes import sniff from galaxy.exceptions import ObjectInvalid from galaxy.manag...
a6b8a4bfeb834da3a7101b9995e31b49cb6d9465a1179d43618e045553cf4341
Python
42,355
1,444
import pickle from copy import deepcopy import pytest import networkx as nx from networkx.classes import reportviews as rv from networkx.classes.reportviews import NodeDataView # Nodes class TestNodeView: @classmethod def setup_class(cls): cls.G = nx.path_graph(9) cls.nv = cls.G.nodes # Nod...
fd568d2300b3e7be46d5e0157f9177505b9d57bae6a06f5f7e75cc156a888589
Python
42,374
1,451
from typing import Optional, Sequence, Union import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch.nn.common_types import ( _size_any_t, _size_1_t, _size_2_t, _size_3_t, _ratio_any_t, ) import numpy as np from .. import base, functional __all__ = ...
74e32b8c85effb71a611bb4ff8d25cd39ed2bf5f4fed901d91efafd1305e362a
Python
42,455
1,197
# Copyright 2015,2016,2017 Nir Cohen # # 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 writi...
5c1f4d56a4dd67b044bd7e439f307a8f27ad816b353cd3de7e002078f3d615d7
Python
42,458
840
""" Created on Oct 12, 2022. @author: voodoocode """ import numpy as np import mne.forward import mne.io.constants import scipy.sparse import finnpy.src_rec.utils # @UnresolvedImport def compute(bem_mdl, cort_mdl, coreg, signal_type, rec_info = None, _mag_factor=1e-7, conductivity = None): """ Calculate th...
6011111cb5174a0c891f2a48b3729e75bafe7c09d5fd828f925ad16cd21a260d
Python
42,460
855
# -*- coding: utf-8 -*- """ Created on Wed Feb 22 21:47:26 2019 @author: Zhiye """ from Model_construct import * from generate_feature import * import numpy as np import os, sys, shutil, platform, time, pickle from collections import defaultdict from six.moves import range import keras.backend as K import tensorflow...
54d949f51059fc22f69c75aa0639d1f4a2b73ebf05549e6e2aee74b1de2d7e29
Python
42,560
991
#!/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 math from typing import Any, cast import pandas as pd from ax.adapter.torch import TorchAdapte...
712192862fdf2ee747dbd09d1c287f8fa8f52fe6d6b1eb73a3da340aa7d400b2
Python
42,595
1,040
"""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 copy import os from typing import Any import ujson as json from data_manager.models import Filter, FilterGroup, View from data_manager.prep...
8e854529c07f939aae8dfa5ebd4223ec30a4f9baefa358af2bf44a0d4690f676
Python
42,656
1,501
# -*- coding: utf-8 -*- """ Slice ===== This module provides basic handling of slicing of sources. The main functionality is to virtually slice an array and return its expected shape and order. Virtual slices can also be used as handles with low communication overhead in parallel processing. Example ------- >>> im...
122cceaedd9a1c0294e9ebca9c47e4e9fc2865171c06e3512ac7cc230f5cab69
Python
42,764
1,005
# 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...
b216d4aadd624d8a5892e70ee96d5b8af6110c0a89b1bd18b76a4274cbac7419
Python
42,797
1,098
# 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...
2054ec49e749abc007ebfbb5bcb40b200ac59618d10804dc01142414f7b46333
Python
42,840
1,254
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import itertools import math from abc import ABCMeta from collections import Counter from copy import deepcopy from enum import StrEnum from functools import cached_property, lru_cache from io import StringIO from ...
e67ef3bd8462d436a8aa91f4371226a883a6a458d2b1a8ccaed3c966a8a63005
Python
42,909
1,307
import math import operator from typing import AbstractSet, Callable, SupportsFloat, Tuple import numpy import pandas.core.computation.ops from nl_expr import expression_walker as ew, type_system from nl_expr.exceptions import ( NeuroLangException, ProjectionOverMissingColumnsError, RelationalAlgebraNotIm...
0849666381eb718acaf9c8b29e98540d161ca389c130afc564fb3ab3011b5930
Python
42,977
1,150
"""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 json from unittest.mock import patch import pytest from data_manager.models import View from rest_framework import status from ..utils imp...
0c1fa1682e5e8b8bb5cfdbd0b3b02f93c19675934c255b30ccd8ed2182bc2b0a
Python
43,099
1,122
# -*- coding: utf-8 -*- """ From https://github.com/sbyrnes321/tmm (MIT license). For information see the docstring of each function, and also see manual.pdf (should be included with the distribution, otherwise get it at http://sjbyrnes.com/fresnel_manual.pdf ). Physics background, conventions, and derivations are at h...
86c63070d2685137b1388e88c1812ff77150e44e7b8dd4b60e5117171406c822
Python
43,294
1,234
""" ======================== Cycle finding algorithms ======================== """ from collections import defaultdict from itertools import combinations, product from math import inf import networkx as nx from networkx.utils import not_implemented_for, pairwise __all__ = [ "cycle_basis", "simple_cycles", ...
56a2a2bf29829179b36d442d9b71a64f310d06ac986e4327014d33e1a32d2381
Python
43,348
1,377
from __future__ import annotations import itertools import random import warnings from collections import Counter, defaultdict from collections.abc import Mapping from functools import partial, singledispatch, wraps from importlib.metadata import version from importlib.util import find_spec from string import ascii_le...
2ebd38cee2b293ee0f4e2ec343f922f3cc60c5d70891bace87a1f021ee076158
Python
43,418
1,077
from .config import config from .regions import Chromosome, Genome from .matrix import RegionMatrixTable, RegionMatrixContainer, Edge, LazyEdge from abc import abstractmethod, ABCMeta from future.utils import with_metaclass, string_types, viewitems from .tools.load import load from .tools.general import distribute_inte...
14ead9a90a94c09879acf9ebe645b57d66b1dbba4b2b45b21e7cf7fe4568e15d
Python
43,545
1,072
#!/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 import defaultdict from collections.abc import Ca...
fe5014600b969d2234968a44440e908bf7efe68bad1c89b326e86ceb7c7b9020
Python
43,552
1,104
from typing import Callable, Optional, Union import torch import torch.nn as nn import torch.nn.functional as F from .. import base, monitor from ..functional import learning as functional_learning __all__ = [ "STDPLearner", "MSTDPLearner", "MSTDPETLearner", ] def _check_open(learner) -> None: if ...
a984dab839dc673c7660e6e31452a7ccb6e4c515773a0ca7310712ed04680ac8
Python
43,573
1,236
""" rgenetics datatypes Use at your peril Ross Lazarus for the rgenetics and galaxy projects genome graphs datatypes derived from Interval datatypes genome graphs datasets have a header row with appropriate columnames The first column is always the marker - eg columname = rs, first row= rs12345 if the rows are snps su...
68d1bd77ef731c8aedf9441736c0c77eaf477369c7c1e21133c8929dbc992400
Python
43,633
1,314
import itertools as it import operator import pytest import networkx as nx from networkx.algorithms.isomorphism.vf2pp import ( _feasibility, _feasible_look_ahead, _feasible_node_pair, _find_candidates, _find_candidates_Di, _GraphInfo, _init_info, _matching_order, _restore_Tinout, ...
c74e559feb46b3950379bc101da21b9571724e08fd0a07a51343f7217eaaa10a
Python
43,649
817
import torch from torch import optim from torch.utils.data.dataloader import DataLoader from torch.utils.data import ConcatDataset import numpy as np import tqdm import copy from utils import get_data_loader,checkattr from data.manipulate import SubDataset, MemorySetDataset from models.cl.continual_learner import Conti...
e4e6444680856ce13fa1cec71387f189c98fef4ceba95a6dd344786c0541bee3
Python
43,674
1,060
# import libraries import torch from torch import nn from math import sqrt import argparse class Reshape(nn.Module): def __init__(self, in_features, out_channels): super(Reshape, self).__init__() self.in_features = in_features self.out_channels = out_channels self.k = 1 if self.in_f...
3f35a0f552a9270665d7f220a913d17c42eb35f7aeca1c81ffeca24d4367ae21
Python
43,693
1,081
from jinja2 import FileSystemLoader, Environment import os import importlib import inspect import re import numpy as np from brian2lava.utils.files import scrap_folder from brian2 import get_device, Quantity, units, second from brian2 import NeuronGroup, SpikeGeneratorGroup from brian2.synapses.synapses import Synaptic...
3c74f9683853a2fbfcfabe46d73274275657e8104f7f1fe5871e225bccbc42ed
Python
43,717
1,004
""" Base classes for job runner plugins. """ import datetime import os import string import subprocess import sys import threading import time import traceback import uuid from queue import ( Empty, Queue, ) from typing import ( Any, Generic, Optional, TYPE_CHECKING, TypeVar, Union, ) ...
49afeb370f4147d68fe32fa17f5f77528706b6f31ad5444c12523c92897c6c57
Python
43,731
1,239
#!/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 numbers import warnings from collections import OrderedDict from collections.abc import Callabl...
08910881cde10df061013320c3c5275f1998ae3817c34d805208845865af3541
Python
43,830
1,123
from ..simulation import ( SimulatorAdapter, SimulationComponent, SimulationCell, TargetsNeurons, ) from ..models import ConnectivitySet from ..helpers import ListEvalConfiguration, listify_input from ..reporting import report, warn from ..exceptions import * import time, os, json, weakref, numpy as np ...
55fc387b8af15568abc9ff1f23a1bef8ed83a566a07e8657dae8750df7f0dd2b
Python
43,876
1,173
"""Generate and save cell densities A density value is a non-negative float number corresponding to the number of cells in mm^3. A density field is a 3D volumetric array assigning to each voxel a density value, that is the mean cell density within this voxel. In BBP terminology, a density field is often referred to a...
fffb2e63da7602c96e57e33be4247eaa41bff103ff09bfc4dfa00b0c3262c579
Python
43,895
1,265
""" Algorithms for finding k-edge-augmentations A k-edge-augmentation is a set of edges, that once added to a graph, ensures that the graph is k-edge-connected; i.e. the graph cannot be disconnected unless k or more edges are removed. Typically, the goal is to find the augmentation with minimum weight. In general, i...
3c76e640e3bfe1618c42173a0f4dd8bbf582780a0000c51a55e6cf1ae7a8c151
Python
43,910
967
import logging from collections.abc import Callable from typing import ( Any, Literal, Optional, overload, TYPE_CHECKING, Union, ) from zipfile import ZipFile from sqlalchemy.orm import ( joinedload, Query, ) from galaxy import model from galaxy.datatypes.registry import Registry from ...
20ab41ae96d6032de01b18d577ca637501f8c979def56655755737b77230b9cc
Python
44,069
1,076
''' ''' # # 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) # import itertools import math from PIL import Image import numpy as np from moten.backend import get_backend from moten.backend._utils ...
7f568c4364095e9d5c57fa077d16c7238e45c877d6ea9abab4ed4bdebf48aab3
Python
44,247
932
import os import importlib import numpy as np from brian2.core.namespace import get_local_namespace from brian2.groups.neurongroup import NeuronGroup, StateUpdater from brian2.synapses.synapses import Synapses from brian2.input.spikegeneratorgroup import SpikeGeneratorGroup from brian2.units import second from brian2 ...
0a66ea3b67745743887fc9d0c18ff70512f874d0d5a376570394a61a10524e56
Python
44,314
1,148
"""Functions for computing and verifying matchings in a graph.""" from itertools import repeat import networkx as nx from networkx.utils import not_implemented_for __all__ = [ "is_matching", "is_maximal_matching", "is_perfect_matching", "max_weight_matching", "min_weight_matching", "maximal_m...
a4229670b51765185fe86d2041a25eff2c683f432b682ceadbc74d5daa624674
Python
44,314
1,148
"""Visualization functions for cerebellar cortical data. Provides plotting in normal 3D and inflated 3D views using PyVista, as well as flatmap view using Matplotlib. """ # --------------------------------------------------------------------------- # Authors: John G Samuelson <johnsam@mit.edu> # Christoph Din...
a081166c8cb51bddcd6fe6a183069b99eef5b6642356939e90bc8c29f072bdca
Python
44,412
953
""" Custom tool creation agent for Galaxy. """ import asyncio import logging import re from collections.abc import ( Callable, Sequence, ) from dataclasses import dataclass from pathlib import Path from typing import ( Any, Literal, Optional, ) import yaml from pydantic import ( BaseModel, ...
8c6ea278f38d65173d1fe27c8ddd4c663fa0be710365c7c6c91bfc9a2f601299
Python
44,551
1,374
import copy from typing import Tuple, Generator, Optional, Callable import torch import torch.nn as nn class StepModule: r""" **API Language** - :ref:`中文 <StepModule-cn>` | :ref:`English <StepModule-en>` ---- .. _StepModule-cn: * **中文** 步进模式接口基类。 实现该接口的模块通过 ``step_mode`` 区分单步模式 ``"s"...
f5dc8d298eba5ba50874dbba1942121454cae36334e47c2a389bd0360fc3a316
Python
44,730
704
# 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...
a7b77b24d4459eac8966872a328a49375be86ec334418fe0cd71f4912ae28d54
Python
44,746
1,291
import gc import pytest import torch import torch.nn as nn from spikingjelly.activation_based import functional, layer, learning, neuron def f_weight(x): return torch.clamp(x, -1.0, 1.0) def _count_alive_tensors(): gc.collect() return sum(1 for obj in gc.get_objects() if torch.is_tensor(obj)) def _b...
8ed6851220b7802d09c3a2e629fce91adcef662c7dce7de2d2626cd78cf7015a
Python
44,785
1,111
""" General purpose preprocessing library ===================================== .. module:: lib_sconf :platform: Linux :synopsis: tool library to manage argument parsing, logging, path configuration, object saving, etc. .. moduleauthor:: Jose M. Esnaola-Acebes <josemesnaola@gmail.com> Parsing methods --------...
8c064f232b3f4794b631cce17ba2f6239e39e686c05733ce7432673e69b9a2e3
Python
44,846
980
"""Find bad channels.""" # Authors: The PyPREP developers # SPDX-License-Identifier: MIT import logging import mne import numpy as np from mne.utils import check_random_state from scipy import signal from pyprep.ransac import find_bad_by_ransac from pyprep.removeTrend import removeTrend from pyprep.utils import _fi...
5449c0c81159b0d6e8dac1cb10c6eee2f09cf7e1130339be7689fe2405e3e925
Python
44,925
1,236
import bz2 import collections import gzip import inspect import re import threading from collections import defaultdict from os.path import splitext from pathlib import Path import networkx as nx from networkx.utils import create_py_random_state, create_random_state __all__ = [ "not_implemented_for", "open_fi...
fc66af4a7d84621dce824ed60f0b3eb7203a4e9cb8297352c8e330bef1fcbaab
Python
45,078
1,043
# 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 itertools from collections.abc import Callable from copy import deepcopy from typing import Any import numpy.typing a...
87ec148559ad9f07281cdb1406a138153317b47e1fe944eecdb6b10b4e866a3c
Python
45,098
952
""" Classes for velocity-observing filters with D spatial dimentions. The "logical" format for indexing is X[t,d,m] for time 't', spatial dimension 'd', and motion source 'm'. However, for the implementation, we use X.reshape(T, D*M) to obtain efficient matrix equations. """ import numpy as np from . impor...
bfcd014ea5f70ed0eb15396058a63af4007a7a4514def7c38d20928c7c2f8ccf
Python
45,185
1,208
"""Read and write graphs in GEXF 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 GEFX files you trust. GEXF (Graph Exchange XML Format) is a language for describing complex network s...
5998431c0d9e747e7c0b9a2f36bbf8801a43eb1ff2439a8609a15b7991bd45c7
Python
45,239
1,191
"""Playwright-backed implementation of the HasDriver abstraction layer. This module provides a Playwright-based implementation that mirrors the API of has_driver.py, allowing Galaxy tests to run with either Selenium or Playwright backends with minimal code changes. Overview -------- HasPlaywrightDriver provides a hig...
777ff194be438132a5d93f70c4c1cadde0435b794fb860d262143c2ce769ac33
Python
45,245
1,192
from abc import ABC, abstractmethod import warnings from sklearn.base import BaseEstimator, RegressorMixin, MultiOutputMixin from sklearn.utils.validation import check_is_fitted from ._solvers import KERNEL_RIDGE_SOLVERS from ._solvers import WEIGHTED_KERNEL_RIDGE_SOLVERS from ._hyper_gradient import MULTIPLE_KERNEL_...
110158c121eddc9316b4800302405ec573629a7b1e2faace22c0035cb0214b68
Python
45,299
1,453
import numpy import numpy as np import pytest from numpy.testing import assert_array_equal import zarr from zarr.indexing import ( make_slice_selection, normalize_integer_selection, oindex, oindex_set, replace_ellipsis, PartialChunkIterator, ) def test_normalize_integer_selection(): asse...
5abfa1f7c7dc0078e33ea4ecec79334d8ba5fa9feefe9ac487e6ee871c31411e
Python
45,489
1,397
"""Create portable serialized representations of Python objects. See module cPickle for a (much) faster implementation. See module copy_reg for a mechanism for registering custom picklers. See module pickletools source for extensive comments. Classes: Pickler Unpickler Functions: dump(object, file) ...
039d30cf5a88a0846acb466aff3d17c9b449447bd3f2b4e884fade6b49347d4b
Python
45,526
1,380
""" Utilities to process intermediate representations of Datalog programs. """ import collections import operator import typing from typing import Iterable import numpy as np from scipy import sparse from nl_expr.exceptions import ( RuleNotFoundError, SymbolNotFoundError, UnsupportedProgramError, ) from...
feb58256daece51f4c947e38eea3e1e579c2035c1cedeba7711e21a43d903247
Python
45,572
1,611
"""Functional interface to graph methods and assorted utilities.""" from collections import Counter from itertools import chain import networkx as nx from networkx.utils import not_implemented_for, pairwise __all__ = [ "nodes", "edges", "degree", "degree_histogram", "neighbors", "number_of_no...
47a47c980e88617ee843ba8ec295356b63c2389b8f65aa7597037aa93d93dd54
Python
45,669
1,058
""" Created on Oct 12, 2022. @author: voodoocode """ import functools import numpy as np import scipy.optimize import scipy.spatial import nibabel.freesurfer import os import mne import warnings import copy import pyvista import finnpy.src_rec.extract_anatomy # @UnresolvedImport import finnpy.src_rec.utils # @Unre...
6541c0f83be13c0b6bec55352f03f736daab18eae217d781d5283ebee6db7933
Python
45,805
1,368
""" An attrs-inspired class annotation system, but my A stands for amateuristic. """ import builtins import contextlib import typing from collections.abc import Mapping from functools import wraps import errr from ..exceptions import ( BootError, CastError, CfgReferenceError, ReferenceLambdaError, ...
1104b49223df1a056e8a879af143ea59cd0843e7baaed76e8ba5108a2bc65a78
Python
45,847
1,197
from dataclasses import dataclass, field from typing import List import marshmallow_dataclass from marshmallow import validates, ValidationError import json, yaml, os from pathlib import Path from typing import Union from .package import VERSION from ..utils import get_logger DEFAULT_CONFIG_FILE_NAME = "clpipe_config....
d2f56e2090ad7f905e89af8e411b33da16913f17a9eebf908737dd33ddc65d67
Python
45,876
887
import os import numpy from matplotlib import pyplot as plt import numpy as np import pandas as pd import copy from scipy import ndimage from skimage.morphology import disk from skimage import morphology as morph from skimage import filters from skimage import io from pyneurite.neuriteanalyzer import Neuri...
442a2d6a96930d82b932b17f3b90c2068abce3ba06418cbbe06efccb7e1e5dff
Python
46,127
1,077
import fanc from fanc.config import config from fanc.plotting.base_plotter import BasePlotterMatrix, BasePlotter1D, BasePlotter2D, ScalarDataPlot, \ PlotMeta, BaseOverlayPlotter from fanc.plotting.helpers import append_axes, style_ticks_whitegrid from fanc.tools.general import str...
9923e417a6c91c392d3e08c74ada462955fd5771007525b8e5821c3dd046b92c
Python
46,235
1,143
"""Functions for neighborhood enrichment analysis (permutation test, centralities measures etc.).""" from __future__ import annotations import warnings from collections.abc import Sequence from typing import Any, Literal, NamedTuple import numpy as np import pandas as pd from anndata import AnnData from fast_array_u...
ada23c757f412317afaae8c95e514705adf93eba8f239246b30f66d0a4605b31
Python
46,386
1,206
# 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 from logging import Logger import numpy as np import numpy.typing as npt impor...
02f9be6d2717ab47248a79d6fb5fb0d9cba836943e2aa570f0892e022225ed70
Python
46,418
909
# 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...
4262ca330ac0ab4e0e5ca8172bfe4f055f10e8af7657ab41390721ff07ccff2f
Python
46,520
1,159
"""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.""" """ Django Base settings for Label Studio. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the ...
0fc7b2ecdc1193c3e0647e21fb43290572c15947a49e21ce8888d99e857b8494
Python
46,607
1,280
from typing import Callable, Optional, Union import torch import torch.nn as nn import torch.nn.functional as F from . import base, neuron, quantize, surrogate from .functional import neuron as functional from spikingjelly.logger import logger _hw_bits = 12 step_quantize = quantize.step_quantize def quantize_8b...
3f2ce1082729fc31a2266ed389da3ae6049bd2697382dc8b2f3b8b7a8f9aa570
Python
46,615
1,238
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import itertools import json from abc import ABC, abstractmethod from collections import Counter from collections.abc import Sequence from copy import deepcopy from typing import TYPE_CHECKING, Any, cast import at...
95c2233a58a53df2ece45f555f243e22e1ceafb61c1f368b68803880d52e3238
Python
46,698
998
""" Likelihood function ICLex like described in Model selection and clustering in stochastic block models with the exact integrated complete data likelihood from Etienne Come and Pierre Latouche (2014) """ import math from .objective_functions import ObjectiveFunction # @formatter:off def calculate_icl_ex_jeffrey_...
116e87ec1c53e6598e027032e6963cab41a79e4c3d38579e839e54a8daff5d1e
Python
46,702
1,000
def val_pc_gauss(data_trans,alpha): from timeawarepc.pcalg 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, ...
d7112c7ff462abf455cb4ee4f36761e5a927dd1efefb40849cf01a5219f249de
Python
46,828
1,260
import os import numpy as np import pytest import tensorflow as tf from learnMSA import Configuration from learnMSA.align.align import align from learnMSA.align.align_hits import HitAlignmentMode from learnMSA.align.alignment_metadata import AlignmentMetaData from learnMSA.align.alignment_model import AlignmentModel ...
220966499dafbce90a668e99af4d1a474d70f62655b8d80616107e28a1a29dc3
Python
46,838
1,304
"""Convenience functions for storing and loading data.""" import io import itertools import os import re from collections.abc import Mapping, MutableMapping from zarr._storage.store import data_root, meta_root, assert_zarr_v3_api_available from zarr.core import Array from zarr.creation import array as _create_array fr...
db1b02c3d90ee2c76f6c3a63b8325b33bfd40ef0ff600498c12e8831163fc8e5
Python
46,844
1,350
"""Functions to convert NetworkX graphs to and from common data containers like numpy arrays, scipy sparse arrays, and pandas DataFrames. The preferred way of converting data to a NetworkX graph is through the graph constructor. The constructor calls the `~networkx.convert.to_networkx_graph` function which attempts t...
b44ff2dfa4a9c6a1160462ee6efd0650f3502ff0e417420377f73c3c0ad0ab9b
Python
46,892
1,462
"""Algorithms for directed acyclic graphs (DAGs). Note that most of these functions are only guaranteed to work for DAGs. In general, these functions do not check for acyclic-ness, so it is up to the user to check for that. """ import heapq from collections import deque from itertools import combinations, product fro...
9f4889dbdffb0d21f6bd80309c1ffaea3c67f3b88f935e7ddfb7324fc556c34e
Python
46,894
1,138
""" Manager and Serializer for histories. Histories are containers for datasets or dataset collections created (or copied) by users over the course of an analysis. """ import json import logging from typing import ( Any, cast, Literal, Optional, TYPE_CHECKING, Union, ) from uuid import UUID f...
85870fa9a75687dd2267a8c2a677dc0fd4d3697a981c398292aa1b1e4fd15fc5
Python
46,931
871
import json import logging import os from typing import ( Any, Optional, ) from sqlalchemy import or_ from galaxy import ( exceptions, util, ) from galaxy.tool_shed.galaxy_install.client import InstallationTarget from galaxy.tool_shed.galaxy_install.metadata.installed_repository_metadata_manager impor...
a8cf763421ae1b2513a22783935e938724decbe34d0e7e71048b282cd61bb037
Python
47,055
1,222
""" ************* VF2 Algorithm ************* An implementation of VF2 algorithm for graph isomorphism testing. The simplest interface to use this module is to call the :func:`is_isomorphic <networkx.algorithms.isomorphism.is_isomorphic>` function. Introduction ------------ The GraphMatcher and DiGraphMatcher are r...
7683c32645c79392b949bae3883eb64a719ac1d51ad8da8ee89149f40ffa848c
Python
47,077
1,149
#!/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 itertools import product from typing import Any import torch from ax.adapter.regi...
d9e9f6366adc3b86a2f06777ba1936193732ff0364e3afdb2d5946207362a536
Python
47,162
1,232
from dataclasses import dataclass, field from typing import List import marshmallow_dataclass from marshmallow import validates, ValidationError import json, yaml, os from pathlib import Path from typing import Union from .package import VERSION from ..utils import get_logger DEFAULT_CONFIG_FILE_NAME = "clpipe_config....
760d4345ce40ad5307d654f4a04014f769943a77dd455913725721fb924183b4
Python
47,266
1,316
"""This module provides proxy objects around objects from the common workflow language reference implementation library cwltool. These proxies adapt cwltool to Galaxy features and abstract the library away from the rest of the framework. """ import copy import json import logging import os from abc import ( ABCMet...
37df0d7f13ad441ec9644691fdb272945c6af77ea4493c9453e61add0fa41dd7
Python
47,364
1,087
# 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...
b7ab4db38060ae4ed9f601e41be9d64b7adc0a205562b51883d0f0c9fb7e9650
Python
47,379
1,340
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ | Title: cluster analysis on the WMH burden on the different JHU WM tracts | Date: 2021-03-03 | Author(s): Theodor Rumetshofer | Description: Performs cluster analysis on the WMH burden on the different JHU WM tracts extr...
3ce1d88cf5ed82822888ebe1e7e893faec75716c18b75ddc70ffd5ea7c10acea
Python
47,425
1,161
# -*- coding: utf-8 -*- """Module for reading, writing and validating SNIRF files. SNIRF files are HDF5 files designed to facilitate the sharing of near-infrared spectrocopy data. Their specification is defined at https://github.com/fNIRS/snirf. This library wraps each HDF5 Group and offers a Pythonic interface on li...
96522defb0a8e5aa86b53cd171868547444d9da1eea1271c0fe50fb415332d90
Python
47,459
1,316
""" Algorithms for calculating min/max spanning trees/forests. """ from dataclasses import dataclass, field from enum import Enum from heapq import heappop, heappush from itertools import count from math import isnan from operator import itemgetter from queue import PriorityQueue import networkx as nx from networkx....
8522fca4edb8df2f95973554bfd204142ca00df4e83adce52c172b707519e1a2
Python
47,466
1,074
""" Ring attractor network simulation library: auxiliary tools ========================================================== .. module:: lib_ring :platform: Linux :synopsis: auxiliary library for the ring attractor network simulation .. moduleauthor:: Jose M. Esnaola-Acebes <josemesnaola@gmail.com> The Neural fi...
d21bba8dd30cef331bb9a8f13f184c6e501fde7eff27e4dfa4d997b458956c54
Python
47,473
1,186
# -*- coding:utf-8 -*- import tensorflow as tf from keras.api.layers import Layer, Dense, Dropout, BatchNormalization, Activation, Concatenate, Flatten, Input, \ Embedding, Lambda, Add, Conv2D, MaxPooling2D, SpatialDropout1D # from tensorflow.python.keras.legacy_tf_layers.base import Layer from keras import bac...
81595837ac259be9abcd48522edf2ac22fa85981cab107d0c5ee8a109e32570f
Python
47,478
707
# Page layout for build_data_inventory.py (exec'd at the end of it, so every name defined there is available). # One page, ordered for finding things: jump menu -> start here -> one searchable table -> browse by location # -> repo files -> about. Maintainer notes go to a local, gitignored maintainer_notes.html, not the...
1ed4eac0310363831e330493cc2162b74d18a1011c139446ec8386dc5e7ff60b
Python
47,504
986
# 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...
e5af2c5fbcbe40ce1097ee5261dd8888e9430637b8789d4d43ec758cd7296ed9
Python
47,615
1,156
# TODO: revisit ignoring type and write some tests for this, the multi-inheritance in this # this file is challenging, it should be broken into true mixins. """ Constructive Solid Geometry file formats. """ import abc import logging import re from typing import ( Optional, TYPE_CHECKING, ) from galaxy import ...
e680e4cb89c1d6e1e060642c0c3682d09fc275d61b0f401fd3a45a56c599f61b
Python
47,690
1,280
import os import numpy as np import pytest import tensorflow as tf from learnMSA.config.language_model import LanguageModelConfig from learnMSA.config.structure import StructureConfig from learnMSA.hmm.util.value_set import PHMMValueSet from learnMSA.hmm.util.value_set_emb import PHMMEmbeddingValueSet import tests.hm...
92741f3d085a7a7b53ab52b63f3c89452bab3d33faa9745ea06db7e5302bf591
Python
47,755
1,285
# aggregator.py # Authors: Jacob Schreiber <jmschreiber91@gmail.com> # adapted from code written by Avanti Shrikumar import numpy as np from numba import njit from . import affinitymat from . import core from . import forked from . import precompile from . import util from collections import OrderedDict @precomp...
de167f8222c581e647943e8606413abfb83a3942af34e794add2557acb46786d
Python
47,759
1,152
import json import shutil import time import warnings from enum import Enum from pathlib import Path import numpy as np import tensorflow as tf from learnMSA.align.align_inserts import AlignedInsertions from learnMSA.align.alignment_metadata import AlignmentMetaData from learnMSA.align.align_hits import HitAlignmentM...
4ecbf664d29212a7e35844bcfb3ea7663e4ac2fa0848c6eebda90b83c4fb37d3
Python
47,814
844
import unittest 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 try: import snirf from snirf import Snirf, validateSnirf, loadSnirf, saveSnirf except ImportError: sys.path.append(o...
7e221f01a4ab58cac370779ab40dc1af9d80f5e8ced46cac98b136a99a818b34
Python
47,864
1,154
# 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...
30421d852a577fc2a81dcde99852cdd6bb18f9a06810d9aa4e44fc3a9d544062
Python
47,869
1,256
"""Tests for saving and viewing results in the interactive REPL.""" import io from pathlib import Path import numpy as np import pandas as pd import pytest pytest.importorskip("prompt_toolkit") pytest.importorskip("rich") import nibabel as nib # noqa: E402 from rich.console import Console # noqa: E402 from neuro...
e212e4d87d13725f41f6160ff365dd6a9a3249903fe8c32e4be494c6f3d4f27b
Python
47,914
1,005
# 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...
a5ecc5f30d60ca42deee79f81df020f7abbc7b49620b3faab9c284fad905618f
Python
47,928
1,294
"""Base class for MultiGraph.""" from copy import deepcopy from functools import cached_property import networkx as nx from networkx import NetworkXError, convert from networkx.classes.coreviews import MultiAdjacencyView from networkx.classes.graph import Graph from networkx.classes.reportviews import MultiDegreeView...
18be6628753590771e02eed0b616fb4bc85927fdb92991d5f893108d5f62b762
Python
48,011
1,171
"""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 import os import pathlib from core.filters import NumberInFilter from core.label_config import config_essential_data_has_changed fr...
b3921bfd0638e101c54886cfe85d5f5aee95a53597efd2ed51ec339958af93a5
Python
48,056
1,276
"""Utilities for discovering files to add to a model store. Working with input "JSON" format used for Fetch API, galaxy.json imports, etc... High-level utilities in this file can be used during job output discovery or for persisting Galaxy model objects corresponding to files in other contexts. """ import abc import ...
4844369971f064b60305f5a57baf0eb6babf394734ae76cd7ed7e64dc69f6c6e
Python
48,059
1,151
import matplotlib import matplotlib.pyplot as plt import numpy as np import pickle as pk import string, re from scipy.signal import butter, filtfilt, cheby1 from sklearn.decomposition import PCA from tqdm import tqdm import parmap import os class EventTriggeredMaps(): def __init__(self): pass def...
88dae36d7fdece067cae25dfb4947cf1b6fd1173f8e63c4dff0933415cccf323
Python
48,120
988
from meld_classifier.paths import ( DEMOGRAPHIC_FEATURES_FILE, BASE_PATH, DK_ATLAS_FILE, MELD_PARAMS_PATH, ) import pandas as pd import numpy as np import nibabel as nb import os import h5py import random import csv import json import sys import pickle import shutil from itertools import chain import po...
4be34d0df6cf5f33419257f579546712d78a9018a181ad530d485b9dcd100990
Python
48,428
1,241
from .statistics import Statistics from .plotting import plot_network import numpy as np import time from .trees import TreeCollection from .output import MorphologyRepository from .helpers import map_ndarray, listify_input from .models import CellType from .connectivity import ConnectionStrategy from warnings import w...