sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
68e52b6c072976c274f97663dfbf732bc7fee08921a4f3f7aaec051120d0963b | Python | 13,960 | 286 | import os
import tensorflow as tf
import numpy as np
import learnMSA.legacy.Emitter as emit
import learnMSA.legacy.Transitioner as trans
from learnMSA.legacy.Utility import get_num_states, get_num_states_implicit, deserialize
class HmmCell(tf.keras.layers.Layer):
""" A general cell that computes one recursion st... |
dc98b5fd0e2814e326f907e4af33d5cd2922f7da3bfbe9bda3b7006a9eacd172 | Python | 13,964 | 387 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: chris3arcadia
@description: template script to generate transfer lists for acid/base computing
@created: Thr Feb 28 2019
"""
# Libraries
import numpy
import chemcpupy
from chemcpupy import Plating, Containers
from acidbase_network import AcidBaseNetwork
impo... |
1274bbd38aec33a2b41d11fe3ce658c204e7aefe1bf59bc82899d4b173a70927 | Python | 13,967 | 471 | # -*- coding: utf-8 -*-
"""
ImageProcessing
===============
Provides GUI to run image processing analysis routines and pipelines of *ClearMap*
"""
__author__ = 'Christoph Kirst <christoph.kirst.ck@gmail.com>'
__license__ = 'GPLv3 - GNU General Pulic License v3 (see LICENSE)'
__copyright__ = 'Copyright © 2020 by C... |
ee884f17d1a7363c05d7ac80b8d8127a7af04e43db39844279bdf336e6082a39 | Python | 13,969 | 411 | # 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 contextlib import ExitStack
from ax.api.configs import ChoiceParameterConfig, RangeParameterConfig
from... |
9062b4e7312b3b7cb35eb369b36e2a796de6b2197943327670faf3d1e48e2efe | Python | 13,971 | 327 |
# import package to work with
from figureflow.figure import Figure
"""
For all strings (e.g. text which are labeled, title page etc),
"\n" in the string/text will make line break.
"""
"""
You need one folder where the tiff file is that should be used to generate
the movie. The tiff file needs to be formated as a H... |
7e5fd1172b4d6910f660a7482bd4feb317f1bca8375b71a4eaf9f801e9109667 | Python | 13,986 | 461 | from __future__ import print_function
import numpy as np
import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.patches as mpatches
from matplotlib.artist import Artist
import sys
def onHotswap():
"""
Hotswap function
The hotswap functi... |
7e7afcbe4d2ace20543804c16229ada176467d3be041e41433f49913028bcd31 | Python | 13,993 | 398 | """
Unit tests for inhibitory cell density computation
"""
from pathlib import Path
import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.testing as pdt
import pytest
import atlas_densities.densities.refined_inhibitory_neuron_densities as tested
TESTS_PATH = Path(__file__).parent.parent
... |
40d6c012624455fead58d8966d635120d78f9dbcaeb22dc125da3ca59881e070 | Python | 14,002 | 362 | """Tests for saving and viewing results on the regions of atlases."""
import io
import json
import re
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import yaml
pytest.importorskip("prompt_toolkit")
pytest.importorskip("rich")
import nibabel as nib # noqa: E402
from rich.console impo... |
685c18eb94ecd8322f3fe93208d78979e8a823b16552f2b622e33b3637353c98 | Python | 14,003 | 398 | import math
import torch
import torch.nn as nn
from .. import base
__all__ = ["DSRIFNode", "DSRLIFNode"]
class DSRIFNode(base.MemoryModule):
def __init__(
self,
T: int = 20,
v_threshold: float = 6.0,
alpha: float = 0.5,
v_threshold_training: bool = True,
v_thresh... |
d0fbe0251627a03cc959b0783574a2eb845b4506cfd58a1a455a08f44417f052 | Python | 14,006 | 377 | # 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... |
ed85a7c41c7c63bddc338a1bb1f8c3b8b56ec26aa425dee2fac6da537ba86c2a | Python | 14,013 | 246 | import pandas as pd
import pathlib
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.patches import Rectangle
from ..utils import helper_functions, check_functions
def summarize_results_per_phenotype_and_datasplit(results_directory_genotype_level: str, eval_metric: str = None):
"""
Summar... |
ef512ffabb7b29e2aa7e8fc1e66e39ca2b94054f68c0431cc941d96a283751e9 | Python | 14,013 | 427 | import itertools
import typing
from collections import OrderedDict
from operator import add, and_, invert, mul, neg, or_, pos, sub, truediv
from warnings import warn
from .exceptions import NeuroLangException
from .expression_walker import (ExpressionBasicEvaluator, PatternWalker,
Repla... |
71c5573054fd1abb6a7d59234a04c97374c5ef72f78fba9056dae6eeb1f6923a | Python | 14,019 | 319 | import pandas as pd
import numpy as np
import pickle
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors
from rdkit.Chem import rdMolDescriptors
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import Draw
from rdkit.Chem.Draw import rdMolDraw2D
import kerastuner... |
a403ea76dea0144df2b18ae85b87813b21394dce0ec28598ef5d3c05f831ef81 | Python | 14,025 | 332 | import math
import random
from copy import deepcopy
from typing import Optional
import numpy
import torch
from torch import Tensor
from torch import nn
from transformers import BertModel, BertConfig, AutoModel
USE_CUDA = torch.cuda.is_available()
MAX_OUTPUT_LENGTH = 50
class Beam: # the class save t... |
565edfb286a3f98fff41a8a76c04ac5c1d83629899e0f16d063dd93555429908 | Python | 14,026 | 391 | """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 csv
import io
import logging
import mimetypes
import os
try:
import ujson as json
except: # noqa: E722
import json
from core.util... |
ab1af7bcb5d0035ecb2b9d0c924cd4a1b8f460c374dffe09f155384354cd0632 | Python | 14,039 | 457 | """Tests for activation-based functional helpers."""
import gc
import weakref
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from spikingjelly.activation_based import base, layer, neuron
from spikingjelly.activation_based.functional import (
chunk_multi_step_forward,
collect... |
7f0d8e793e52c2869a1a8a66b90183cd6daa63f96c74c3f7bf55cff1423ed5b1 | Python | 14,040 | 378 | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 22 10:46:47 2019
@author: Amelie Aussel
"""
from brian2 import *
defaultclock.dt = 0.01*ms
prefs.codegen.target = 'numpy'
eq_HTC_buffer_mdPul='''
dV/dt=(-INa-IK-IL-IKL-IH-ITLT-ITHT-IAHP-IGJ-Iapp-Iapp2-J-Isyn)/Cm_HTC : volt
J : amp * meter ** -2
Iap... |
bd332fb696d3bcdd07fa9a38d098f3f53e03e2069994cb046a6f02dc82b9f659 | Python | 14,044 | 447 | """
This module is an sklearn compatible pipeline for machine learning
time series data and sequences using a sliding window segmentation
"""
# Author: David Burns
# License: BSD
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.pipeline import Pipeline
from .transform import XyTransformerMixin, ... |
93333bb7e4e027323fceb95624f1f08fd8a29bbc4401ff6ec750743e4e85f37c | Python | 14,047 | 414 | import os
import numpy as np
import scipy as sp
from scipy import stats
from scipy import signal
from bct.algorithms.distance import distance_wei, distance_wei_floyd, retrieve_shortest_path
from sklearn.linear_model import LinearRegression
from sklearn.kernel_ridge import KernelRidge
# %% Plotting
import matplotlib.py... |
3b5ba15999d57e45f2e20e9125d150fe3c5b5f2b60654bb897a3e232c3b33157 | Python | 14,048 | 382 | """
Implementation of probabilistic query resolution for
hierarchical queries [^1]. Using this we apply the small dichotomy
theorem [^1, ^2]:
Let Q be a conjunctive query without self-joins or a non-repeating relational
algebra expression. Then:
* If Q is hierarchical, then P(Q) is in polynomial time, and can be comput... |
14790b032cf45f23cd12ea1c14a202932f35746047520c1ddf66d13d81e40f30 | Python | 14,051 | 342 | """
Object Store plugin for Cloud storage.
"""
import logging
import os
import os.path
from ._caching_base import CachingConcreteObjectStore
from ._util import UsesAxel
from .caching import (
CacheShardManager,
CacheTarget,
enable_cache_monitor,
)
from .s3 import parse_config_xml
try:
from cloudbridg... |
88902754bc6e068f4810d1196cd60a6b8488a0ead508c3010c1192c6db3fbde9 | Python | 14,057 | 323 | """
Objectives:
Analyze microtubule (MT) spread from kymographs
with maximum intensity projections.
Measure length in the neurite in um over which 90% of the
MT intensity is spread out and the speed at which MTs spread
anterogradely and retrogradely.
Steps:
1) Get background value of neurite
For that p... |
f02166aecb306eccd5165cec95a1af5960c22550e5ae9ca9704502eb1b5a4dfe | Python | 14,058 | 230 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 5 10:27:05 2019
@author: schelskim
"""
from .generaltools import generalTools
from .analyzers import Analyzers
from .neuriteconstructor import neuriteConstructor
#from tools.dataframecleanup import DataframeCleanup
import numpy as np
import copy
impor... |
c927d49af221199e76446ff868dd80ee755596f22d59f21434e263844f9010f4 | Python | 14,063 | 381 | """Define routines for the experiment flow."""
import datetime
import json
import os
import shutil
from pathlib import Path
import numpy as np
from psychopy import core, event, gui
import ecomp_experiment
from ecomp_experiment.define_settings import (
BLOCKSIZE,
KEYLIST_DICT,
MAXWAIT_RESPONSE_S,
NSA... |
a0eb4abcb506d04b76d5b3e27bed77f96ed35e1ca78ccef3c6de755f6147b357 | Python | 14,078 | 309 | from .inference import Inference
from .inference import KarrerInferenceNoNegativeMove
from .inference import PeixotoInference
from .peixotos_hierarchical_sbm import NxHierarchicalPartition
class HierarchicalInference(Inference):
"""
Hierarchical Inference based on Peixotos agglomerate algorithm and
a se... |
0543f1c025bc5b284fb011da39a73270f9858d7a93987b93840d9ef8f0a27abe | Python | 14,079 | 345 | import tensorflow as tf
from src.utility import get_psf,create_psf_matrix,old_psf_matrix
from src.custom_layers.utility_layer import downsample,upsample
#from tensorflow.keras import initializers
class CompressedSensingInception(tf.keras.layers.Layer):
def __init__(self,*args, iterations, **kwargs ):
super... |
09f85e6c3ccf7f3e44a1bd2cca027350dfd440965e09825bea832db00f9303d5 | Python | 14,081 | 403 | # 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... |
b3ffaa797c3a04303b309f7fb69628bc45f1204795eeb94a451f95ea5392ca4d | Python | 14,081 | 353 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... |
18f753ed3e7cb3015c2b913ca422d0b1a6b3804e71b0f6c6adb9f5ec66ef8d68 | Python | 14,089 | 293 | import numpy as np
from bsb.connectivity import ConnectionStrategy
from bsb.reporting import report, warn
from time import time # usalo per time sttart stop
# import time #usalo per il time.sleep
class ConnectomeMossyGlomerulus(ConnectionStrategy):
"""
Implementation for the connections between mossy fib... |
61501c9e677e4e18b6e1ae7f43abfc17fd5036105f01198e79dd8b1c167832d2 | Python | 14,092 | 411 | # -*- coding: utf-8 -*-
"""
Workspace
=========
The Workspace module keeps track of the data files of a project.
Using this module will simplify access to data and results using coherent
filenames accross experiments and samples.
One can think of a Workspace as a transparent data structure for ClearMap.
Note
----
Ad... |
dc7cd6571c7a941aa80a39403abe9b67b292d2ff4827ef259a908e0dda18493f | Python | 14,094 | 274 | import numpy as np
from ph_calculator import *
def read_file(filepath):
with open(filepath, "r") as f:
return f.read()
class AcidBaseNetwork:
"""" Describes the structure of an acid base network """
def __init__(self, num_neurons=2, weights_per_neuron=64, img_width=8, img_height=8):
self... |
a993536825896be96a75837411e1ab42a41b73e101fd0c694365de5a9860d789 | Python | 14,096 | 441 | import copy
from functools import partial
import pytest
import torch
from spikingjelly.activation_based import (
base,
functional,
layer,
neuron,
surrogate,
)
from spikingjelly.activation_based.model.masnn import MASNN, AttMSResNet
from spikingjelly.activation_based.model.maxformer import MaxForme... |
3ab6d7bf82ce8ef4f6b9d7429ed005c6738faa8af06c89fca8823336b1c615f4 | Python | 14,099 | 359 | ## To be continued....
import pandas as pd
import numpy as np
import glob
import os
import nilearn.signal
import matplotlib.pyplot as plt
from scipy import stats
import pingouin as pg
import statsmodels.api as sm
import seaborn as sns
def loadsnr(snrtrue):
# Loading SNR values for two splits per session
# fo... |
2142583120b37a666502b83f64c538a53c0fd2d7ffaae68f30dc5a8b0116f342 | Python | 14,102 | 364 | # 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... |
ebe692d21b860c31caf97550d5a2fdd7e14b71389207d58d06864f35a4729b10 | Python | 14,103 | 350 | #!/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 logging
import warnings
from logging import Logger
from typ... |
f74a1fd2cb0745b019541cc9ec865a1bb182b2810a3487a94af42816813aea90 | Python | 14,103 | 387 | """
Determine what optional dependencies are needed.
"""
import os
import re
import sys
from os.path import (
dirname,
exists,
join,
)
import yaml
from dparse import parse
from galaxy.config import GalaxyAppConfiguration
from galaxy.util import (
asbool,
etree,
parse_xml,
which,
)
from ga... |
ca5b5a333116040d2421b96eacae39a8b24380de02c9366393550773a741bfef | Python | 14,115 | 354 | #!/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 contextlib import ExitStack
from typing import Any
from unittest import mock
from warnings import... |
456b205e6bc9a80dbd87e8e813f7a37fa057e42662a5955a5ca9f25ada6a3e65 | Python | 14,117 | 274 | # 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... |
4236febbfc74a53c8f090906f04de98e293d3a64310809ea6aa0dd151951d309 | Python | 14,123 | 467 | # -*- coding: utf-8 -*-
"""
Processing Brain Samples - Test Image Processing Parameters
Created on Thu Jun 4 14:37:06 2015
@author: ckirst
"""
import os
import numpy
import sys
# path to illastik installation
sys.path.insert(1, '/home/ckirst/programs/ilastik-05')
from iDISCO.Parameter import *
from iDISCO.IO imp... |
f251c075ee4d30bf179f3c59ac49b57ca7e3d108f123972b7bed4361e8664772 | Python | 14,139 | 344 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Lice... |
6dfbd1abca15ee2721aaa235e7952244d3a82d6894b35d124b269075b42eec47 | Python | 14,147 | 401 | import numpy as np
from matplotlib import pyplot as plt
import os
import glob
from scipy.stats import zscore
import importlib
import zipfile
import math
import utils
import scipy as sp
from scipy import io
from scipy.sparse.linalg import eigsh
import csv
import power_law
import sys
import time
import scipy.stats
import... |
f349d778ce0b7e199537d43e73bfefcbc01e0ebcc31633db75bcdefb70c52fbd | Python | 14,156 | 322 | import pandas as pd
import numpy as np
import pickle
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors
from rdkit.Chem import rdMolDescriptors
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import Draw
from rdkit.Chem.Draw import rdMolDraw2D
import kerastuner... |
e594ffd7babee62a70ecd360362b1a55cc48c6b63a5de4106949415c7c7d93d8 | Python | 14,160 | 459 | from itertools import chain, combinations, product
import pytest
import networkx as nx
tree_all_pairs_lca = nx.tree_all_pairs_lowest_common_ancestor
all_pairs_lca = nx.all_pairs_lowest_common_ancestor
def get_pair(dictionary, n1, n2):
if (n1, n2) in dictionary:
return dictionary[n1, n2]
else:
... |
b42c390b584b1306d46edff2496824bd1c8b2a3fb54f6c1f5d5f474f8171efb4 | Python | 14,162 | 481 | import bz2
import importlib.resources
import pickle
import pytest
import networkx as nx
@pytest.fixture
def simple_flow_graph():
G = nx.DiGraph()
G.add_node("a", demand=0)
G.add_node("b", demand=-5)
G.add_node("c", demand=50000000)
G.add_node("d", demand=-49999995)
G.add_edge("a", "b", weigh... |
3d45bc2a971a8a26d52c337f76e5028c7b26d0f2d09e391a5332ec614a76b311 | Python | 14,188 | 363 | """
FSM State Models for Label Studio.
This module contains the state model definitions (BaseState and concrete state models).
These are separated from models.py to avoid registration issues in LSE where
extended state models need to be registered instead of the base OSS models.
When importing FsmHistoryStateModel, t... |
07d3e7d1fdba0514a298ebccd140a0a0082b753c32142f236801c6d97c52c5d0 | Python | 14,197 | 551 | # -*- coding: utf-8 -*-
"""
TagExpression
=============
Module providing routines to check and convert between tag expressions.
This simplfies the handling of list of files from using regular expressions
to tag expression.
A tag is a simple placeholder for a string or number in a file name.
An expression is a filena... |
c82a8a68672115244f4d10d7abbbb57c7d885d917de3059ff52d742bdf8277a5 | Python | 14,205 | 470 | """
Eulerian circuits and graphs.
"""
from itertools import combinations
import networkx as nx
from ..utils import arbitrary_element, not_implemented_for
__all__ = [
"is_eulerian",
"eulerian_circuit",
"eulerize",
"is_semieulerian",
"has_eulerian_path",
"eulerian_path",
]
@nx._dispatchable
... |
738525f43b5d111a5dbc5b65ccac183bd25f2c39af7f533036278b7a6b37e98b | Python | 14,206 | 340 | #!/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 hashlib
import json
import warnings
from collections.abc import Iterable, Mapping, Sequence
im... |
9b474f00e3c89a2fb84f2736b1d7d4ce65bd535ee188906630400087a8c4e3dd | Python | 14,206 | 327 | # 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... |
5cd48944477254b9fb7197d922f913e240514298e80961bcf292f398e8a74c19 | Python | 14,207 | 305 | #!/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 itertools import product
from math import sqrt
import torch
... |
7150f4176667b34b429107ce2be8c160c0711c66497fc298538c4c92c3f32300 | Python | 14,211 | 381 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 2 14:28:44 2019
@author: aaussel
"""
from brian2 import *
from scipy import signal
from cells.RS_FEF import *
from cells.FS_FEF import *
from cells.SI_FEF import *
from cells.VIP_FEF import *
import os
import time
from itertools import *
def save_raster(name,raster_i... |
8405c1fbaae4e19b4ea43ea6803d9da95ac92facb12e5be284ce9700bd0ebd3a | Python | 14,214 | 465 | import json
import tempfile
from pathlib import Path
import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
from voxcell import RegionMap, VoxelData # type: ignore
import atlas_densities.densities.mtype_densities_from_map.create as tested_create
import atlas_densities.densities.mtype_densit... |
859593597a99b922ea9e9efc34cf91ee92c4e968b494b3e20752c50deffa2069 | Python | 14,214 | 456 | #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.
#
### ### ### ### ### ### ### ... |
f5894f9c84ac8170a27e3e0cf6fafdfd2717bb67eb6eac36da122c1e58c27fa2 | Python | 14,216 | 500 | # See https://github.com/networkx/networkx/pull/1474
# Copyright 2011 Reya Group <http://www.reyagroup.com>
# Copyright 2011 Alex Levenson <alex@isnotinvain.com>
# Copyright 2011 Diederik van Liere <diederik.vanliere@rotman.utoronto.ca>
"""Functions for analyzing triads of a graph."""
from collections import defaultdi... |
ea0e3088257695985307f187f68b8299d3a13aa95afdc5d64cf9261f909b6cb5 | Python | 14,219 | 304 | """
Job control via a command line interface (e.g. qsub/qstat), possibly over a remote connection (e.g. ssh).
"""
import logging
import time
from typing import TYPE_CHECKING
from galaxy import model
from galaxy.jobs.job_destination import JobDestination
from galaxy.jobs.runners import (
AsynchronousJobRunner,
... |
9ecad4e1302dd507729559b409bc8522be6f327011fe70101a12fa643dd3a3cb | Python | 14,233 | 387 | import pathlib
import shlex
import subprocess
import time
from concurrent.futures import ProcessPoolExecutor, as_completed
from functools import partial
from typing import List
import pandas as pd
import pybedtools
from ._doc import *
from ._extract_allc import extract_allc
from ._open import open_gz
from .utilities ... |
e5fc49f66402cc33f05910f07d49e6306e6271c343800ac1830a814e88707446 | Python | 14,234 | 353 | # 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... |
cfd0a7cc7e31f99dc1bfd3a63758020ba2ac07f6ab792a7dbd64fa5e22cfa731 | Python | 14,242 | 443 | """Generates graphs resembling the Internet Autonomous System network"""
import networkx as nx
from networkx.utils import py_random_state
__all__ = ["random_internet_as_graph"]
def uniform_int_from_avg(a, m, seed):
"""Pick a random integer with uniform probability.
Returns a random integer uniformly taken ... |
978084b30961f1f5af2125b8f9152d957b70da116f928d3c399058096053c52c | Python | 14,256 | 441 | from __future__ import absolute_import, division
import contextlib
import itertools
import logging
import sys
import time
from signal import SIGINT, default_int_handler, signal
from pip._vendor import six
from pip._vendor.progress.bar import (
Bar, ChargingBar, FillingCirclesBar, FillingSquaresBar, IncrementalBar... |
4ace18a4a92196cbe046299c2681d729de61064fb40a139dd25c4d755422267b | Python | 14,273 | 380 | #!/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-ignore-all-errors
from unittest.mock import patch
import numpy as np
from ax.adapter.adapter_utils import (
... |
e2a99471a67efa2ff6898e0f510b98c1be52cc39f5715e24a3cd78775432f682 | Python | 14,286 | 464 | import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import os
import glob
from scipy.stats import zscore
import importlib
import zipfile
import math
import utils
import scipy as sp
from scipy import io
import scipy.signal
from scipy.sparse.linalg import eigsh
import csv
impor... |
d192ebb092623470f0c0861170432366fdf96f052591014b81bd7939aa843a69 | Python | 14,297 | 327 |
# import package to work with
from figureflow.figure import Figure
"""
For all strings (e.g. text which are labeled, title page etc),
"\n" in the string/text will make line break.
"""
"""
You need one folder where the tiff file is that should be used to generate
the movie. The tiff file needs to be for... |
5e288f84be58064b7066bdd8fbd408eac09995df29389207b8d1956be1ed4b09 | Python | 14,318 | 388 | import abc
import logging
import os
import re
from typing import (
Optional,
)
import yaml
from cryptography.fernet import (
Fernet,
MultiFernet,
)
from sqlalchemy import select
try:
import hvac
except ImportError:
hvac = None
from galaxy import model
log = logging.getLogger(__name__)
VAULT_KEY... |
c3950f0cc2408052aa1967085bd135fe48be4e220c6a5fb30a81f6b0859ed5fa | Python | 14,318 | 392 | import numbers
import warnings
import numpy as np
try:
from numpy.core.numeric import ComplexWarning
except ImportError:
from numpy.exceptions import ComplexWarning
try:
from scipy.sparse import issparse
except ImportError:
def issparse(X):
return False
from sklearn import get_config
from s... |
114f9ea5ab7ebc35081bc28c8690ca4dfb88f1058d5e1456c419eaa165632dc7 | Python | 14,323 | 361 | import os
import time
from scipy.io import savemat
from tkinter import Tk, Button, Label, OptionMenu, StringVar
from .inputWindow import InputWindow
from .loggingWindow import LoggingWindow
from .plotterOptionsWindow import PlotterOptionsWindow
from .parameterWindow import ParameterWindow
from ..misc.status import St... |
115411ad1ea5af2e4af8d296366f284a07f332f389c856a41a50d4616ec9d79c | Python | 14,324 | 220 | from utils import checkattr
def set_method_options(args, **kwargs):
# If the 'convenience' option for a specific method is selected, select the corresponding defaults
if checkattr(args, 'ewc'):
args.weight_penalty = True
args.importance_weighting = 'fisher'
args.offline = True
if c... |
36363a5cd8d944af39171dd3bc288f3b2bdd695a7662eb9fb438d53fb3687e0b | Python | 14,337 | 389 | import numpy as np
import scipy as sp
import time
from src.imaging_derivs import DataVector, compute_transition_probs_updown, compute_fc
from src.utils import threshold_consistency
class LoadSC():
def __init__(self, environment, Subject):
self.environment = environment
self.Subject = Subject
d... |
afd28e5a7119d674e4dcca1e629735337b68d582f9b1d4dc2bfb921aa311b1a0 | Python | 14,338 | 329 | """Provide the payoff settings to be used in the Sampling Paradigm.
main file: sp.py
For more information, see also the following keys within
define_variable_meanings.make_events_json_dict: action_type, action, outcome
"""
import itertools
from collections import OrderedDict
import numpy as np
def get_payoff_sett... |
6e36fa23485a865076e915fe8f697383c86960504de73c46a754d923e76bc68f | Python | 14,358 | 473 | """
***************
Graphviz AGraph
***************
Interface to pygraphviz AGraph class.
Examples
--------
>>> G = nx.complete_graph(5)
>>> A = nx.nx_agraph.to_agraph(G)
>>> H = nx.nx_agraph.from_agraph(A)
See Also
--------
- Pygraphviz: http://pygraphviz.github.io/
- Graphviz: https://www.graphviz.org
- DO... |
c8e8822bfa859728c7c502b747a430a22ff1b06cabce090fcd808f7e1ba7d230 | Python | 14,362 | 338 | # 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 ax.adapter.adapter_utils import can_map_to_binary, is_unordered_choice
from ax.analysis.healthcheck.complexity_rating i... |
3ca5291072c2261f32adb578ed6cf9f162f5b9d41e44c101e33c0c4d570704fe | Python | 14,367 | 331 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from typing import Any
from django.contrib.auth.models import Group
from rest_framework import status
from cvat.apps.engine.tests.utils import ApiTestBase
from cvat.apps.iam.models import User
from cvat.apps.quality_control import models
class Te... |
937e9df50e76353fb6f1107d2adf41ce7e5e4f8b116fb945c936ec41c54ac9ec | Python | 14,377 | 345 | """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."""
from core.permissions import all_permissions
from core.utils.common import load_func
from django.conf import settings
from rest_flex_fields import ... |
2aaa28611d526a76407d3f9ccef0fb9a60279f1c130613008826cd4512db6c9a | Python | 14,383 | 461 | """
See here https://stackoverflow.com/questions/52371329/fast-spearman-correlation-between-two-pandas-dataframes
Calculate correlation between two matrix, row by row
"""
from concurrent.futures import ProcessPoolExecutor, as_completed
import anndata
import numpy as np
import pandas as pd
import scanpy as sc
import ... |
c5e6538f1d8bcd0d1d4edc92022e64d8b0d6f706ea5db34ca8a9c6c4cc4581b0 | Python | 14,391 | 360 | # 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
import warnings
from collections.abc import Iterable, Mapping, Sequence
from dataclasses import dataclass, fie... |
de4a01a298d184788a1767f04c1a29f9a3fce4feed78a1e95cd1e19039744183 | Python | 14,411 | 443 | import pandas as pd
import numpy as np
import patsy
import math
def biweight_midvar(data, center=None, axis=None):
if center is None:
center = np.median(data, axis=axis, keepdims=True)
mad = np.median(abs(data - center), axis=axis, keepdims=True)
d = data - center
u = d/(9*mad)
... |
636ce9b37786c76fd28e830945ddeb2ff3ff6980ec6a5fde72cee068aec193ce | Python | 14,414 | 372 | import os, sys
import numpy as np
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from bsb.core import Scaffold, from_hdf5
from bsb.config import JSONConfig
scaffold_lookup = {}
mr_path = os.path.join(os.path.dirname(__file__), "..", "morphologies.h5")
mr_top_path = os.path.join(os.path.dirnam... |
f4291eef4754300b5cab5ea8b3fa05440d28ad72ccfa435978f263b81a882582 | Python | 14,419 | 361 | """
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
from data.data_utils import computeFFT
from model.... |
b44062342388ab758b2f518eb8cbce2af5b952577100a9a375ceebc625a9e93a | Python | 14,420 | 379 | # 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 ax.adapter.transfer_learning.utils import (
get_joint_search_space,
merge_dependents,
merge_parameters,
)
fr... |
fcdf55e6db004168f9a31d7b60e0173ae8a27fc5fe924b05d06e3001017abe61 | Python | 14,421 | 323 | import os
from typing import (
Any,
Optional,
)
from webob.compat import cgi_FieldStorage
from galaxy.exceptions import (
ObjectNotFound,
RequestParameterInvalidException,
)
from galaxy.managers.context import ProvidesAppContext
from galaxy.schema.schema import GenerateTourResponse
from galaxy.schema.... |
de0755747a751d0ef10c37454468afa1fcecc37d9d52977feb60ebeaf7b4be55 | Python | 14,424 | 313 | from tkinter import ttk
from tkinter import Canvas
from tkinter import DISABLED # Keep for Entry state if needed, though ttk uses 'readonly'
from tkinter import Frame
from tkinter import IntVar
from tkinter import LabelFrame # ttk.LabelFrame is available if we want to switch this too
from tkinter import Scrollbar
from ... |
ec8ab28039d15d57478c9134d4ed95dfb536fbc1098e763a68fc751252f87268 | Python | 14,432 | 278 | # 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... |
3fb74559b85ad46b2369ffbbf4970fc5100b114bd289aa0e9d228d4948f0e7b8 | Python | 14,437 | 368 | """
Unit tests for excel_reader
"""
import re
import warnings
from pathlib import Path
import numpy as np
import numpy.testing as npt
import pandas as pd
from voxcell import RegionMap
import atlas_densities.densities.excel_reader as tested
from atlas_densities.exceptions import AtlasDensitiesWarning
TEST_PATH = Pat... |
68b6d77015d4138ecdf331ec3580b6ca42039ded42d024ca9945a82f0def1d61 | Python | 14,439 | 373 | # 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... |
f333552aa54e478667021543dbad5e1619a676c3dfd043f31a9f5e0c240ffa50 | Python | 14,443 | 386 | # 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... |
9a28d15dd67416eeb6b5a40e9c0ab7dbe411068fd4f8f090e1241b36365ce5b5 | Python | 14,444 | 407 | """
Capacity scaling minimum cost flow algorithm.
"""
__all__ = ["capacity_scaling"]
from itertools import chain
from math import log
import networkx as nx
from ...utils import BinaryHeap, arbitrary_element, not_implemented_for
def _detect_unboundedness(R):
"""Detect infinite-capacity negative cycles."""
... |
aa892ce12deee4ba5fe34776f37dcc203927690f2820da72ca2c18a38f7726b7 | Python | 14,453 | 386 | import pathlib
import subprocess
from collections import defaultdict
from concurrent.futures import ProcessPoolExecutor, as_completed
from functools import lru_cache
from shutil import rmtree
import numpy as np
import pandas as pd
import pybedtools
import pysam
import xarray as xr
from scipy import stats
from ALLCool... |
c86b8baccd55871352721807f9630227d4e6946dea6b6afaa2d99b2f5a29af11 | Python | 14,456 | 428 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 16:23:57 2020
@author: amelie
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 11 13:56:08 2020
@author: amelie
"""
from brian2 import *
from scipy import signal
from FEF_full import *
from LIP_full import *
from mdP... |
b11cdc42fee328049daf66b6d334436033babf99e641b628153007878c5ce6bd | Python | 14,461 | 405 | """
Integration tests for the FSM system.
Tests the complete FSM functionality including models, state management,
and API endpoints.
"""
from datetime import datetime
from django.test import TestCase
from fsm.state_manager import get_state_manager
from fsm.state_models import AnnotationState, ProjectState, TaskState... |
46f8414edbfcade5c95e4a56959be402a8724fa71aa7a27902e1f09ff8328493 | Python | 14,462 | 448 | import abc
import dataclasses
import typing
from abc import abstractmethod
from ._util import Assert, Copy, Iterable, MechId, MechIdTuple, Merge
from .exceptions import ModelDefinitionError
if typing.TYPE_CHECKING: # pragma: nocover
from .parameter import Parameter
@dataclasses.dataclass
class CableProperties(... |
f82bf811d0b7aab91f22efc312b6e0d0eeab654cffb5fe60a2d3849cba6b8de6 | Python | 14,471 | 388 | import copy
import logging
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from datasets.lc_sampler import setup_eval_dataloder, setup_finetune_dataloder, LinearProbingDataLoader
from utils import accuracy, set_random_seed, show_occupied_memory, get... |
8bd0170f8f4ca63d118e3ead541abf2fa29648a71e5fcb3b9f6d1965ed5c071b | Python | 14,478 | 306 |
##########################################################################################
#
# psim_result.py
#
# - Class for representing the results from ProBioSim simulations, including methods to
# access and export the data.
#
#################################################################################... |
ccde0052343e134ad3e49c6b34da6d442fa040e075c58814be5a00c48b247c06 | Python | 14,478 | 546 | # -*- coding: utf-8 -*-
"""
MMP
===
Interface to numpy memmaps
Note
----
For image processing we use [x,y,z] order of arrays.
To speed up access to z-planes memmaps are created in fortran order by default.
"""
__author__ = 'Christoph Kirst <christoph.kirst.ck@gmail.com>'
__license__ = 'GPLv3 - GNU General Pulic... |
f909ed9061f5db346c245a5d6d3c8780843d81cad03ef7e2abaf1e06e48bcbd1 | Python | 14,479 | 400 | import pytest
import numpy as np
import sklearn.linear_model
import sklearn.model_selection
import scipy.linalg
from himalaya.backend import set_backend
from himalaya.backend import ALL_BACKENDS
from himalaya.scoring import r2_score
from himalaya.utils import assert_array_almost_equal
from himalaya.kernel_ridge._hyp... |
952d4f30a2921915c69ea91c9876a3c214c4b824905f754882efddfc014512dc | Python | 14,481 | 461 | from __future__ import annotations
from collections.abc import Callable, Mapping, Sequence
from functools import WRAPPER_ASSIGNMENTS, cache, wraps
from itertools import pairwise
from types import MappingProxyType
from typing import TYPE_CHECKING, Literal, cast
import numpy as np
import pandas as pd
from .._core.spar... |
db36ee3fefc48d358eec834797c6412389dbb128caf6e2a60fc96077c03f380f | Python | 14,483 | 385 | """
Lifted plans for non-repeating queries with negation.
A query is non-repeating when none of its probabilistic relations occurs
twice in it. Fink and Olteanu show that such a query, possibly with
negations, can be computed in polynomial time if it is hierarchical, and
is #P-hard otherwise [1]_. As the relations of ... |
634cecd27a4fcdc8cc1abfe80d14af426a1a3038835b27cb9ba729a709df8860 | Python | 14,485 | 381 | #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.
#
### ### ### ### ### ### ### ... |
55b99680f51586fc5bcb97172d80caa22d786e36f6e3898a4078543aacd98de7 | Python | 14,495 | 396 | # 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... |
f9810111f3a5eb047f0bebf961542ad37358bbac94193f6728798f2bdd56555a | Python | 14,506 | 326 | # 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... |
a43a874b2f92de1717024571c4135964847a19b667a8a60707412140f53540ce | Python | 14,515 | 288 | #!/usr/bin/env python
import os
os.environ['CUDA_VISIBLE_DEVICES']="0"
import pandas as pd
import numpy as np
from collections import defaultdict
from itertools import combinations
from itertools import chain
from collections import namedtuple
import pickle
import os.path
import shutil
import inspect
from... |
1d075473ced1bcde4128aca2b85aa9ff347f1ff6e9c64f26f101151c095ff167 | Python | 14,524 | 412 | """
Module for the plots and reports related to the structural analysis of BSB scaffold.
"""
from typing import List, Tuple, Union
import numpy as np
from bsb import AfterConnectivityHook, CellType, ConnectivitySet, Scaffold, config, warn
from matplotlib import pyplot as plt
from cerebellum.analysis.plots import Leg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.