sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
1b238d6bbb1b3e667f03e5b17e7c3c3ce37ffa4300d07ffd642b6daa8dec9232 | Python | 22,697 | 615 | """Contains functions for computing the longest common subsequence between two lists
of domains or CDS in a RecordPair
Into any of the main functions in this module goes a RecordPair object, which contains
two regions. These regions can be either protoclusters or full regions. The functions
in this module are used to ... |
48d43691977a27a6520e61f5061c3bdd2bbb6d1cb6485b3b9f9929e7d6a0377c | Python | 22,727 | 698 | """
Some plotting utilities to use scale bars rather than coordinate axes.
04 Feb 2011, C. Schmidt-Hieber, University College London
From the stfio module:
http://code.google.com/p/stimfit
"""
# TODO: Pin scale bars to their position
# TODO: Implement 2-channel plots
import os
import sys
import numpy as np
import n... |
149ee4d4782144453bb9d87c66e3b96591779c725f3a48fb8968a3868545a884 | Python | 22,729 | 700 | """A file interface for handling local and remote data files.
The goal of datasource is to abstract some of the file system operations
when dealing with data files so the researcher doesn't have to know all the
low-level details. Through datasource, a researcher can obtain and use a
file with one function call, regar... |
c8b3377c194f5f45a47b9396447f29bd5706ca4900dab902e18f4b8fe28c2221 | Python | 22,732 | 516 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 18 21:39:48 2019
@author: kevin
"""
import os
import numpy as np
from tqdm import tqdm
import scipy.spatial.distance as dist
import torch
import cudaSpline as deconv
from scipy.interpolate import splrep
from numpy.linalg import inv as inv
def fit... |
e35b3ded6f596adaead8477b45cdea7810da1def2928abd8ab69868f06a17d79 | Python | 22,745 | 656 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import annotations
import logging
import platform
import re
import struct
import subprocess
import sys
import sysconfig
fr... |
05268344833004b2139ff9b499344b3ea304e6afaab8675232e60ca587982707 | Python | 22,755 | 661 | """Light wrapper around the Win32 Console API - this module should only be imported on Windows
The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions
"""
import ctypes
import sys
from typing import Any
windll: Any = None
if sys.platform == "win32":
wind... |
57d8d4bba8996e26dd9e7e74203a8273234589b14da395a33d38212053a7ee3c | Python | 22,758 | 747 | """Inferred spikes and burst bar plots for multi-well analysis.
This module provides bar plot visualizations for inferred spike and burst metrics:
- Inferred spike frequency (thresholded spikes and rising edges)
- Burst count, average duration, average interval, and rate
- Spike synchrony and correlation across condit... |
9c3ce4ae8916bdc98791e1d68c4f2e98f7f15f8951e809d0a2b015ee9a449422 | Python | 22,761 | 611 | import numpy as np
import pytest
from pandas.errors import InvalidIndexError
from pandas import (
NA,
Index,
RangeIndex,
Series,
Timestamp,
)
import pandas._testing as tm
from pandas.core.arrays import (
ArrowExtensionArray,
FloatingArray,
)
@pytest.fixture
def index_large():
# large... |
4eace1db85f7e1ec07cb36c4ddf5bedf790cc4b3378ea08a22037e721d114ce4 | Python | 22,816 | 626 | """Parallelized FOV analysis using multiprocessing for CCG computation.
This module provides a parallelized version of compute_fov_analysis that uses
multiprocessing to speed up the expensive CCG (cross-correlogram) computation.
KEY DESIGN:
===========
1. Use multiprocessing.Pool for CCG pairs (avoids numba lock cont... |
dea3b9dda391b9ede8daebc74437fc4e25cff80405046d640396010d6fa155d3 | Python | 22,817 | 700 | import pandas as pd
import MDAnalysis as mda
from MDAnalysis.analysis.distances import distance_array
import numpy as np
import torch
import sbmlcore
from pandas.api.types import is_numeric_dtype, is_bool_dtype
from sklearn.preprocessing import MinMaxScaler
from tqdm import tqdm
from torch_geometric.data import Data, H... |
e18e399849d524d06f137f445fb7a5b3911e305ce8d9198c1d13609e48eb0806 | Python | 22,846 | 630 | """Multiple functions to import the behavioral data.
Some other functions to transform the data are included.
"""
import os
import glob
import re
import pandas as pd
import numpy as np
from src import utils
from src.model import single
DIR = os.path.dirname(os.path.abspath(__file__))
DATA_FOLDER = os.path.abspath('... |
692b0f475aeca3f444f369e74f50fa4839b2cc524952f9bff0cbe295ce1aaee8 | Python | 22,850 | 581 | """Functions to BIDSify and deBIDSify data."""
import os
import glob
import re
import json
import ipdb
import pandas as pd
import numpy as np
from scipy.interpolate import interp1d
import utils
SPEED_THRESHOLD = 50 # mm/s
MAINTAIN = 10 # frames
DT = 0.01 # framerate from QTM.
DIR = os.path.dirname(os.path.abspat... |
940c495d8ef99d8d07efb719bb59c04c3e6668486f5e5832cfc06f45202509d1 | Python | 22,866 | 510 | #!/usr/bin/env python3
import os
import sys
import time
import logging
import argparse
import resource
import collections
import parallel_tools
import consensus
import shims
from bfx import swalign
try:
from bfx import pair_align
except ImportError:
pair_align = None
# There can be problems with the submodules, but... |
03ec028d635cc5ab4ac2c4b5bacc7c0ee1db51def2e1229f6c7858f2b3359745 | Python | 22,908 | 589 | import os.path as op
import pickle
import sys
from pathlib import Path
# Need this to make sure that ants.registration is available for mocking in tests
import ants.registration # ruff: ignore[F401]
import mne
import nibabel as nib
import numpy as np
import pytest
from mne.datasets import sample
from nibabel import N... |
682876f77a0b3e76caee08b43d6fe294bf4672bebedd4a4ed0c3334b7f43f127 | Python | 22,930 | 616 | import sys
import numpy as np
import numpy._core.umath as ncu
from numpy._core._rational_tests import rational
import pytest
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises, assert_warns,
HAS_REFCOUNT
)
def test_array_array():
tobj = type(object)
ones11 = np... |
13f655b5f412b3b20d193386bc631f71fb5ab5e12432533e22fd6fa6055f7f64 | Python | 22,953 | 613 | #!/usr/bin/env python3.7
"""Defines Slide class.
The copyrights of this software are owned by Duke University.
Please refer to the LICENSE and README.md files for licensing
instructions. The source code can be found on the following GitHub
repository: https://github.com/wmglab-duke/ascent
"""
import itertools
import ... |
931af83e1cfc1c702c11bcb1f49e52098678c44361a199c598c100508f8da485 | Python | 22,976 | 748 | """ miscellaneous sorting / groupby utilities """
from __future__ import annotations
from collections import defaultdict
from typing import (
TYPE_CHECKING,
Callable,
DefaultDict,
cast,
)
import numpy as np
from pandas._libs import (
algos,
hashtable,
lib,
)
from pandas._libs.hashtable im... |
1f4db33ddf76570e4190ad9b9b150ad5083be7036bf003694fb6df53fc1ecc20 | Python | 22,980 | 533 | #!/usr/bin/env python3.7
"""Defines the runner module.
The copyrights of this software are owned by Duke University.
Please refer to the LICENSE and README.md files for licensing instructions.
The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent
"""
import base64
imp... |
f60db94d74862ecbdf788ae5910f25d5fc7fa59e3c6f87710b35d751bb0a0b98 | Python | 22,997 | 647 | import numpy as np
from numpy._core._rational_tests import rational
from numpy.testing import (
assert_equal, assert_array_equal, assert_raises, assert_,
assert_raises_regex, assert_warns,
)
from numpy.lib._stride_tricks_impl import (
as_strided, broadcast_arrays, _broadcast_shape, broadcast_to,
bro... |
59cea6986f80989c52f07a882b7e277b60100d4df8787f8e5d3fac393dc965a1 | Python | 23,035 | 548 | # Robustness of the "generalization increases as the memory ages" result.
from __future__ import annotations
from typing import Dict, List, Tuple
from copy import deepcopy
import numpy as np
import gc
from model.model import AmygdalaEngrams, Phase
from utils.util import online_learning, gen_random_simple_pattern, am... |
7be03cff5f9ee078edf7be1200c28aa21e56640f551532991959c5aca27f7bb2 | Python | 23,059 | 558 | import bisect
import collections
import torch
from .event_handling import find_event
from .interp import _interp_evaluate, _interp_fit
from .misc import (_compute_error_ratio,
_select_initial_step,
_optimal_step_size,
_handle_unused_kwargs)
from .misc import Pert... |
7dba4e2a4cd2b5c144278a2cf0fa8f8af7964449c55cb2cd3cc6970ffd22d4c6 | Python | 23,074 | 549 | """Defines Model class.
The copyrights of this software are owned by Duke University. Please
refer to the LICENSE and README.md files for licensing instructions. The
source code can be found on the following GitHub repository:
https://github.com/wmglab-duke/ascent
"""
import os
import warnings
from copy import deepco... |
22cc58749ed760c30397d310a273dea392905e25155de6de76b1a367ae5306a8 | Python | 23,091 | 498 | #!/usr/bin/env python
# coding: utf-8
# # Data preparation
# Author: R.M.D. Kock
# In[2]:
import os, sys
import math
import random
import h5py
import copy
import numpy as np
import keras
import tensorflow as tf
import datetime
from keras.layers import Conv1D, Activation, Concatenate, AvgPool1D, Flatten, Dense
fro... |
7096417f19e65b6a8b75c6e6503ec75f76f59c855a9cfd33129e973af939692b | Python | 23,093 | 757 | import marimo
__generated_with = "0.18.0"
app = marimo.App(width="full")
with app.setup:
import os
from pathlib import Path
import numpy as np
import pandas as pd
from scipy import signal
from scipy.io import loadmat
from glob import glob
from sklearn.linear_model import LinearRegressi... |
1fe52e234ed65db0c66abbabe005064f4af6cd46b03324f056c60222f5ba06a9 | Python | 23,126 | 399 | #################################################################
#
# source activate my-rdkit-env
#
#!/user/bin/python
import sys, os
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdForceFieldHelpers
from rdkit.Chem import ChemicalForceFields
###########################################... |
3be4ffdbcd7adea90479a5fc6cb82a24bb8e2d8babd79702dbfc6903444435f3 | Python | 23,153 | 751 | import ast
import io
import os
import sys
import warnings
import functools
import importlib
from collections import defaultdict
from functools import partial
from functools import wraps
from glob import iglob
import contextlib
from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.exter... |
62c4eb959e05c100328dc97f824e953dc3846190aa3069409205f4bae8b24b25 | Python | 23,239 | 704 | import sys
import math
import itertools
from math import log
def frequency(tol_str, tar_str):
"""Generate the frequency of tar_str in tol_str.
:param tol_str: mother string.
:param tar_str: substring.
"""
i, j, tar_count = 0, 0, 0
len_tol_str = len(tol_str)
len_tar_str = len... |
c90c2f27fc6862352d6af0a2ba08c6388cae1f32a80cd2dda5ab3e1b15f7da88 | Python | 23,257 | 422 | import numpy as np
from sklearn.ensemble import RandomForestClassifier
from skimage.transform import resize
import torch
from torchvision.transforms import ToTensor
from time import time
loaded_dinov2_models = {}
### FEATURE EXTRACTION ###
def extract_features_rgb(image, dinov2_model='s'):
'''
Takes an RGB i... |
8f65a5b9b04f82ce8227cbb59c91e184b3a2f4bc4592177a4a2d9f83633bc867 | Python | 23,266 | 715 | from textwrap import dedent
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
TimedeltaIndex,
Timestamp,
)
import pandas._testing as tm
from pandas.core.indexes.datetimes import date_range
@pytest.fi... |
a56447a7306876f0c6a0a1b5824440289d6e3f143f7d5fd5a889bbed20f40650 | Python | 23,290 | 622 | import sys
import platform
import pytest
import numpy as np
# import the c-extension module directly since _arg is not exported via umath
import numpy._core._multiarray_umath as ncu
from numpy.testing import (
assert_raises, assert_equal, assert_array_equal, assert_almost_equal, assert_array_max_ulp
)
# TODO:... |
6800e25cb3c092000517cd3fb5173386e1fa955c8c2dc03793f01b19c0de9a9e | Python | 23,292 | 620 | import sys
import itertools
import pytest
import numpy as np
import numpy._core.numerictypes as nt
from numpy._core.numerictypes import (
issctype, sctype2char, maximum_sctype, sctypes
)
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_raises_regex, IS_PYPY
)
# This is the structure of... |
4794e45bbd27b3009621d5308505d1f5e41894df3774a2b25213ceceb2d3990a | Python | 23,311 | 548 | """Tools for resampling data and bootstrapping."""
from __future__ import annotations
from warnings import warn
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from tqdm import tqdm
from arcos4py import ARCOS
from arcos4py.tools import calculate_statistics, filterCollev
from ..tools._arco... |
d63129aa37ea62643a2b70f8fcef315d23e7f1a11f1f6b8c3a534ceca3ef4ab8 | Python | 23,374 | 765 | from __future__ import annotations
import errno
import getpass
import hashlib
import logging
import os
import posixpath
import shutil
import stat
import sys
import sysconfig
import urllib.parse
from collections.abc import Generator, Iterable, Iterator, Mapping, Sequence
from dataclasses import dataclass
from functools... |
e31610733a17ee2ff01e3ba09e5d1b6b5544c526d5e3c9dd568c34f12f06d164 | Python | 23,388 | 775 | import os
import sys
import textwrap
import types
import warnings
import functools
import platform
from numpy._core import ndarray
from numpy._utils import set_module
import numpy as np
__all__ = [
'get_include', 'info', 'show_runtime'
]
@set_module('numpy')
def show_runtime():
"""
Print information abo... |
540127c393b47a0aad95acf3032ea826480518708a0d7a77370472044435f5ab | Python | 23,413 | 666 | """ test the scalar Timedelta """
from datetime import timedelta
import sys
from hypothesis import (
given,
strategies as st,
)
import numpy as np
import pytest
from pandas._libs import lib
from pandas._libs.tslibs import (
NaT,
iNaT,
)
from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
from panda... |
04d3a60c7d603d252db937a1d741328fbce67f2ce0b5cf32d5faffac1f6ce0ef | Python | 23,416 | 676 | """
VQNHE application
"""
from functools import lru_cache
from itertools import product
import time
from typing import (
List,
Any,
Tuple,
Callable,
Optional,
Dict,
)
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from ..circuit import Circuit
from ..quantum import generate_... |
0e092121f0bf304ad4944c9a06869e6f993b4bc6eaa0cbbd18087887c1dd9c87 | Python | 23,423 | 739 | """Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import math
import torch
from .atom_update_block import AtomUpdateBlock
from .base_layers import Dense, ResidualLayer
from .efficient import ... |
9fb5084d180fd8fff0fc307b737602efc08b360a948c2fcd66f3f69a1d9af31b | Python | 23,477 | 669 | """Accessors for Cedalion data types."""
from __future__ import annotations
from typing import Dict, List, Union
import numpy as np
import pandas as pd
import statsmodels
import xarray as xr
from numpy.typing import ArrayLike
from typing import Callable
import cedalion.dataclasses as cdc
import cedalion.typing as c... |
f93d1ef5b87c92d82b1eb07c09777e32372f2e7724ba2492c810bc0abeaafae1 | Python | 23,479 | 647 | from string import ascii_letters
import numpy as np
import pytest
from pandas.errors import (
SettingWithCopyError,
SettingWithCopyWarning,
)
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
date_range,
option_cont... |
ee78e6ce4149beb3d242e76c80e36c810cda1ab1a9a5e04835ebca8167ac70f9 | Python | 23,521 | 634 | from __future__ import annotations
import importlib.util
import os
import sys
import typing as t
from datetime import datetime
from functools import cache
from functools import update_wrapper
import werkzeug.utils
from werkzeug.exceptions import abort as _wz_abort
from werkzeug.utils import redirect as _wz_redirect
f... |
4166c3ed16d69e7ab61a2cbd6b2c3b49fe4a7142949a5b36e87f1a9e8ceeb9a4 | Python | 23,530 | 767 | import re
import warnings
from typing import List, Literal, Optional, Union
import numpy as np
import pandas as pd
from numpy import ndarray
from pandas import DataFrame
from scipy.sparse import csr_matrix, issparse, spmatrix
from anndata import AnnData
from scvelo import logging as logg
from ._arithmetic import sum... |
f0e70f6dade0e92fc5c2bc4b06cac5f101853b763d547f9b00f7aed79879d1e4 | Python | 23,530 | 696 | import numpy as np
import pytest
from pandas.compat.pyarrow import pa_version_under10p1
from pandas.core.dtypes.missing import na_value_for_dtype
import pandas as pd
import pandas._testing as tm
from pandas.tests.groupby import get_groupby_method_args
@pytest.mark.parametrize(
"dropna, tuples, outputs",
[
... |
f51b960aaf7b233308ac56b1a7e4f2c0b41160bc14a55fe4ecec0f6cc5d8f715 | Python | 23,534 | 504 | #!/usr/bin/env python3.7
"""Defines MockSample class.
The copyrights of this software are owned by Duke University. Please
refer to the LICENSE and README.md files for licensing instructions. The
source code can be found on the following GitHub repository:
https://github.com/wmglab-duke/ascent
"""
import json
impor... |
63c556c8afbe476ade8ec203f29fd9051155788d7fbb37dc7fe58e56b255893a | Python | 23,539 | 621 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 2 18:07:26 2021
@Orignal author: Dr. Cao Dong Sheng (https://faculty.csu.edu.cn/caodongsheng/en/index.htm)
@updated by: Shen Wan Xiang
"""
"""
#########################################################################################
Instead of using the convention... |
9aaf508e86ec16ea0b8037c59e5b3b2aa3e698859030a3ab2da3ecfe83e0bc11 | Python | 23,541 | 738 | import builtins
import jax
import pytest
from pytest_lazyfixture import lazy_fixture as lf
import numpy as np
import opt_einsum
import tensornetwork as tn
import tensorcircuit as tc
import tensorcircuit.cons as cons
BACKENDS = [lf("npb"), lf("jaxb"), lf("tfb"), lf("torchb")]
@pytest.fixture
def contractor_setup(requ... |
fe17dc750ddba3bc1bacbc0ff4046a2c3abf873b388bfb7b9a850fb4d4c9d366 | Python | 23,556 | 563 | import streamlit as st
import logging
from kani import ChatRole, ChatMessage
import asyncio
from upstash_redis import Redis
import base64
import dill
import hashlib
import urllib.parse
from kani_utils.utils import _seconds_to_days_hours, _sync_generator_from_kani_streammanager
import json
import datetime
import os
impo... |
1d386da1f3c02efac236ac27164fada9dbc221efe28f67fe54e39b25f650f77c | Python | 23,574 | 666 | from datetime import (
datetime,
timezone,
)
import numpy as np
import pytest
import pytz
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
Series,
Timestamp,
bdate_range,
date_range,
)
import pandas._testing as tm
... |
c8540347131d8032dff4e98f5f87747324fab6c6091162d5e10812e72b8d8241 | Python | 23,612 | 692 | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
04fcdb9abeceee28668cb284f40df5724e7800d8c0b6ba7cf9d553db4311e5f4 | Python | 23,632 | 810 | """
missing types & inference
"""
from __future__ import annotations
from decimal import Decimal
from functools import partial
from typing import (
TYPE_CHECKING,
overload,
)
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import lib
import pandas._libs.missing as ... |
9d792e1f06b482f54eb32b8a2369b551f56ef07c8a885a81bc82b6dffcce771c | Python | 23,702 | 677 | import sys
import copy
import platform
import pytest
from pathlib import Path
import numpy as np
from numpy._core._type_aliases import c_names_dict as _c_names_dict
from . import util
wrap = None
# Extend core typeinfo with CHARACTER to test dtype('c')
c_names_dict = dict(
CHARACTER=np.dtype("c"),
**_c_name... |
ac47059666a5068c5627da8e400a2018019a142168e64a68af4bcf665509e298 | Python | 23,706 | 600 | '''
Primary Auditory Area
'''
from braincog.base.brainarea.BrainArea import BrainArea
from Modal.sequencememory import SequenceMemory
from Modal.notesequencelayer import NoteSequenceLayer
from Modal.temposequencelayer import TempoSequenceLayer
from Modal.synapse import Synapse
import numpy as np
import math
from conf... |
6698992562d5023d1fb0c1695a31e9d0af40275a483c938e3c2c628dfd49dbde | Python | 23,715 | 571 | import logging
import math
import os
import sys
from copy import deepcopy
from datetime import timedelta
from pathlib import Path
from typing import Tuple
import numpy as np
from PySide6 import QtCore
from PySide6.QtGui import QPixmap, QImage, QShortcut, QKeySequence
from numpy import ndarray
from app.config.hard_con... |
8472c9ab5d67ad4f007d4523bd43dcc0bb129e3340b0ae8d9a0421db2d51dbf7 | Python | 23,728 | 548 | import time
import numpy as np
import scipy.io as scio
import torch
from torch import nn
from braincog.base.node.node import *
from braincog.base.brainarea.BrainArea import *
import pandas as pd
import matplotlib.pyplot as plt
from numpy import genfromtxt
device_ids = [0,2,3,4,5,7,8,9]
device = 'cuda:0'
class Mul... |
e1212c9f2a0938cd4b85cc336300d2fa6c15b42c90372ef1bb65bf00cdc5e942 | Python | 23,740 | 489 | from ControlPort import ControlPort
import time
import numpy as np
import datetime
PUMP_STEPS_FOR_100uL = 9257
class Inkuflow:
"""Class to control inkulevel and inkube pump with valves for multplexing"""
# stepper motor steps that correspond to pumped volume of 100 ul
pump_steps_for_100uL = PUMP_STEPS_FOR_1... |
d7110391cc24301d5d84134f35c9f0e1047c2d0e0a9ea667436d155b53eb3c9a | Python | 23,742 | 506 | """
Build and visualize the inter-protein crosslink-validated PPI network:
genes containing exact-crosslink-matched motifs, linked to their crosslink
interactor genes, coloured by their SynGO GO term (Cellular Component /
Biological Process, from the SynGO_2024 gene set database) -- genes not
annotated in SynGO at all ... |
642c6c37ea6f458a5d730d3e0dccb9c0b2f43053377deb01c10be15dc5c28e73 | Python | 23,778 | 653 | """
Tests for the pandas.io.common functionalities
"""
import codecs
import errno
from functools import partial
from io import (
BytesIO,
StringIO,
UnsupportedOperation,
)
import mmap
import os
from pathlib import Path
import pickle
import tempfile
import numpy as np
import pytest
from pandas.compat impor... |
8e72f515ceb13cea687480838f96366c6ea01d9bf542b18dd07573c64196e40f | Python | 23,783 | 731 | #
# Copyright (c) 1996-2005, SR Research Ltd., All Rights Reserved
#
#
# For use by SR Research licencees only. Redistribution and use in source
# and binary forms, with or without modification, are NOT permitted.
#
#
#
# Redistributions in binary form must reproduce the above copyright
# notice, this list of condition... |
1fa39478fb5ba98a157b8d528b5f62639a05d09a3b57e5b28829eae244650c94 | Python | 23,794 | 560 | """
This script contains functions for sending commands to the intan RHS2116 and reading data from its registers.
"""
import time
import numpy as np
import multiprocessing as mp
import copy
from ctypes import *
import multiprocessing.connection as con
import struct
import unittest
# Store command package timing for p... |
9e97b548a7096df2cceaf48f5434037a812c3c821f2739402acb733469a83954 | Python | 23,835 | 676 | """ parquet compat """
from __future__ import annotations
import io
import json
import os
from typing import (
TYPE_CHECKING,
Any,
Literal,
)
import warnings
from warnings import catch_warnings
from pandas._config import using_pyarrow_string_dtype
from pandas._config.config import _get_option
from pandas... |
c55c03bdd602f2d87c37e3bb3732ad561cb3790174516bbd2ea74619987fe216 | Python | 23,875 | 470 | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Validate a trained YOLOv5 segment model on a segment dataset
Usage:
$ bash data/scripts/get_coco.sh --val --segments # download COCO-segments val split (1G, 5000 images)
$ python segment/val.py --weights yolov5s-seg.pt --data coco.yaml --img 640 # validate COCO... |
d6a2c892c5c2775fc1065211f07bff8e81230fb2b53c3bab10f225a730312be5 | Python | 23,942 | 642 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mne.stats import permutation_cluster_test
from matplotlib.colors import LinearSegmentedColormap
np.random.seed(42)
# =============================================================================
# DATA PATHS - UPDATE THESE FOR YOUR SYS... |
d896fb702de90e4180d27844c2c2205b4b4d27899e132f21b45c17df33bd1657 | Python | 23,988 | 703 | """
This module tests the functionality of StringArray and ArrowStringArray.
Tests for the str accessors are in pandas/tests/strings/test_string_array.py
"""
import operator
import numpy as np
import pytest
from pandas.compat.pyarrow import pa_version_under12p0
from pandas.core.dtypes.common import is_dtype_equal
i... |
4ceab22b9cec3b8e1079dce0e665abc83c6557ba93869b1a0be855f985eeacc0 | Python | 24,009 | 626 | from __future__ import print_function
import sys
import os
import numpy as np
np.random.seed(42)
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.patches import ConnectionPatch
from scipy.optimize import leastsq
import stfio
import stfio_plot
try:
import spectral
except Imp... |
ab644b44bd7c5ed031ab7f0a107988f58353f335efe8712353e27fd1623d4fa7 | Python | 24,050 | 572 | """Defines Model class.
The copyrights of this software are owned by Duke University. Please
refer to the LICENSE and README.md files for licensing instructions. The
source code can be found on the following GitHub repository:
https://github.com/wmglab-duke/ascent
"""
import os
import warnings
from copy import deepco... |
c08ae7c63bdc6ea8795705b6f0d4a47e8b620eaf2a342c4839215b1948922c1e | Python | 24,055 | 693 | """API and implementations for loading templates from different data
sources.
"""
import importlib.util
import os
import posixpath
import sys
import typing as t
import weakref
import zipimport
from collections import abc
from hashlib import sha1
from importlib import import_module
from types import ModuleType
from .e... |
6f052a13ae9eb73d9b70f69bab179dd7cfa2caaa9bfa4c7712bd9a4fa19e5096 | Python | 24,060 | 598 | """Dependency Resolution
The dependency resolution in pip is performed as follows:
for top-level requirements:
a. only one spec allowed per project, regardless of conflicts or not.
otherwise a "double requirement" exception is raised
b. they override sub-dependency requirements.
for sub-dependencies
... |
63d7aea43b6169b32a755799a88872032617ad557ee4ae01667c2b2b4b9ee199 | Python | 24,074 | 429 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'WGrimaceBox.ui'
##
## Created by: Qt User Interface Compiler version 6.7.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###############... |
961cb6181ec87c82235fcb3063efb8fc1ec9656de8542f60f8f7a477fb640a87 | Python | 24,081 | 696 | # pylint: disable=invalid-name
import os
import sys
import numpy as np
import pytest
from pytest_lazyfixture import lazy_fixture as lf
# see https://stackoverflow.com/questions/56307329/how-can-i-parametrize-tests-to-run-with-different-fixtures-in-pytest
thisfile = os.path.abspath(__file__)
modulepath = os.path.dir... |
74298e1edfbd45a241abddb52f8b4c1f73e62010deb46a659db8d1297986b74d | Python | 24,099 | 639 | from __future__ import annotations
import functools
import os
import sys
import sysconfig
from collections.abc import Generator, Iterable
from importlib.util import cache_from_source
from typing import Any, Callable
from pip._internal.exceptions import LegacyDistutilsInstall, UninstallMissingRecord
from pip._internal... |
e539fb6a144ad9cd9dbcfc701de7a2e8eb8ac8c25e01032ddff10378430ab1d4 | Python | 24,120 | 467 | import os
import numpy as np
import pandas as pd
import re
from PIL import Image
import napari
from scribbles_creator import create_even_scribbles
from napari_convpaint.conv_paint_utils import compute_image_stats, normalize_image
from scribbles_testing.image_analysis_helpers import single_img_stats
from seghub.ilastik... |
ad1a77a3d7bb64a4b87f2ad645b10bc8b729b8655315c9e8a1a39ad6ac7f1489 | Python | 24,129 | 766 | import enum
import json
import os
import re
import typing as t
from collections import abc
from collections import deque
from random import choice
from random import randrange
from threading import Lock
from types import CodeType
from urllib.parse import quote_from_bytes
import markupsafe
if t.TYPE_CHECKING:
impo... |
3c1705c41daeeedb4a55aa734e29e9eea47f703632c00b4f24bcf0424b6a02d9 | Python | 24,158 | 666 | """Utility functions for cali.sqlmodel database operations.
This module provides helper functions for database operations including:
- Creating database tables
- Loading experiments from database
- Checking analysis settings consistency
"""
from __future__ import annotations
from dataclasses import dataclass, replac... |
02244e7d6c5346b313ef92d9b2b04c25322cde4cbd9f5c779d49d7ccaa5920b3 | Python | 24,165 | 646 | """
Module for formatting output data in HTML.
"""
from __future__ import annotations
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Final,
cast,
)
from pandas._config import get_option
from pandas._libs import lib
from pandas import (
MultiIndex,
option_context,
)
fro... |
dc9ff3916fac0f7118f8194d5e3ca59fffe78e9c87e67d146494fab95ec285e0 | Python | 24,212 | 627 | from __future__ import annotations
import collections
import itertools
import operator
from typing import TYPE_CHECKING, Generic
from ..structs import (
CT,
KT,
RT,
DirectedGraph,
IterableView,
IteratorMapping,
RequirementInformation,
State,
build_iter_view,
)
from .abstract import... |
dda173768a9b69b13c5ccf8562375821cb53a6cfec4c024324cae111b0effd45 | Python | 24,235 | 747 | """
Pyperclip
A cross-platform clipboard module for Python,
with copy & paste functions for plain text.
By Al Sweigart al@inventwithpython.com
Licence at LICENSES/PYPERCLIP_LICENSE
Usage:
import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
spam = pyperclip.paste()
if not pyperclip.is_a... |
344fdc895fd3c0b6d31a8ab53855055f9c9a772898a0fde6e69a553a80f9dbae | Python | 24,263 | 721 | from datetime import datetime
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
NaT,
Series,
concat,
)
import pandas._testing as tm
def test_rank_unordered_categorical_typeerror():
# GH#51034 should be TypeError, not NotImplementedError
cat = pd.Categorical... |
105cd935a34d63f1f585dddd48f059db066ddc4ebb0fa2a90c4dd868e331fd76 | Python | 24,313 | 567 | import platform
import pytest
import numpy as np
from numpy import uint16, float16, float32, float64
from numpy.testing import assert_, assert_equal, IS_WASM
def assert_raises_fpe(strmatch, callable, *args, **kwargs):
try:
callable(*args, **kwargs)
except FloatingPointError as exc:
assert_(st... |
d8ec3a7c3d17e799cb140a9a49f6dda9ed68202af8a9cfa6e333847217794b06 | Python | 24,328 | 609 | import torch
import torchaudio
import random
import numpy as np
import sys
from scipy.io import loadmat
import scipy.signal as sps
sys.path.append('/om/user/imgriff/python-packages/chcochleagram')
import chcochleagram
from chcochleagram import compression
from chcochleagram import cochleagram
from chcochleagram import ... |
6d1eb78cf84443531414d243c633704a6c076ffc20140dc0c83061d1047f6785 | Python | 24,336 | 631 | """
Functional dense MPO data, Pauli-string builders, and contractions.
"""
from dataclasses import dataclass
from itertools import product
from typing import Any, Callable, Iterable, Optional, Tuple
import jax
import jax.numpy as jnp
import numpy as np
from .layout import BlockLayout, MPOSpec, validate_mps_mpo_spec... |
035010f0055c893a9baf82f0d37c4e46190563170692f254898b84836174a3c9 | Python | 24,392 | 507 | from torch.utils.data import DataLoader
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm import tqdm
from torch.optim import Adam
from pl_bolts.optimizers import LinearWarmupCosineAnnealingLR
from model_scripts.competing_models import CrossViewModel
from utils import ABIDE... |
7ae0bb380f3f87f110d1a3bf52a04d3c0471df16f62e0252fabb167b75e213e5 | Python | 24,410 | 589 | import numpy as np
import pytest
from numpy.random import random
from numpy.testing import (
assert_array_equal, assert_raises, assert_allclose, IS_WASM
)
import threading
import queue
def fft1(x):
L = len(x)
phase = -2j * np.pi * (np.arange(L) / L)
phase = np.arange(L).reshape(-1, 1) * ph... |
4cb8b35d6af1aec523e4ab57195076908c472b76b2ab922c8e78d30ea1623f36 | Python | 24,431 | 735 | """
Series.__getitem__ test classes are organized by the type of key passed.
"""
from datetime import (
date,
datetime,
time,
)
import numpy as np
import pytest
from pandas._libs.tslibs import (
conversion,
timezones,
)
from pandas.core.dtypes.common import is_scalar
import pandas as pd
from pan... |
0fdf825dbde81f3374aceabc7121037bb77e5bcba1e92d1316a826ab8c2937bf | Python | 24,501 | 683 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
fce17fa077218422777f5aadf9670d6e82e5890272ec613b9730f58ecc2a8579 | Python | 24,506 | 711 | """Contains methods for extension of comparable regions with record pairs"""
# from python
import math
import logging
# from other modules
import big_scape.hmm as bs_hmm
# from this module
from .comparable_region import ComparableRegion
from .record_pair import RecordPair
def reset(pair: RecordPair) -> None:
"... |
a653966d91229de8e9b35f8bd0693dbd7c55ef66e9d413f9729b453b0e943379 | Python | 24,511 | 565 | #!/usr/bin/env python3.7
"""Defines the runner module.
The copyrights of this software are owned by Duke University.
Please refer to the LICENSE and README.md files for licensing instructions.
The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent
"""
import base64
imp... |
bebf53335030a4973573fae81e2e37c9d67770c0cf06f36fdbdaaa622ca96c39 | Python | 24,554 | 791 | import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DataFrame,
DatetimeIndex,
Index,
Interval,
IntervalIndex,
Series,
TimedeltaIndex,
Timestamp,
cut,
date_range,
interval_range,
isna,
qcut,
timedelta_range,
to_datetime,
... |
09f2c6a34a4de87c3bde0472dda15525c136ee44608f3d3137c584ee7bd59dfe | Python | 24,579 | 551 | import numpy as np
import multiprocessing as mp
import os
import time
import threading
import datetime
from multiprocessing.managers import BaseManager
import multiprocessing.connection as con
import socket
import zmq
import struct
import json
import time
from h5_saver import parse_spike_events
from Client_config im... |
02f07a5c88c4836340ad90592320aa19d905652a4f804624a776557baa5f299a | Python | 24,604 | 515 | from re import L
import h5py
import torch
import glob
import sys
import os
# sys.path.append('/om4/group/mcdermott/user/imgriff/projects/End-to-end-ASR-Pytorch')
# import src.audio_transforms as audio_transforms
import pickle
import numpy as np
from pathlib import Path
class BinauralAttentionDataset(torch.utils.data... |
338ca6e8a2c21c3e352170c54eb544ebe0fc6239ff601df80297215f9f11c7b6 | Python | 24,606 | 579 | '''
Created on 2016.7.6
@author: liangqian
'''
from Areas.pfc import PFC
from Areas.pac import PAC
from conf.conf import *
from Modal.synapse import Synapse
import random
import numpy as np
from Areas.apac import APAC
from Areas.pac import Music_Sequence_Mem
class Cortex():
'''
This class is used to control ... |
4ea7beec4919fad6d67219bc883a027c3f38f1fd3fde72efe8d3637883ef1f03 | Python | 24,637 | 632 | from __future__ import annotations
import os
import typing as t
from collections import defaultdict
from functools import update_wrapper
from .. import typing as ft
from .scaffold import _endpoint_from_view_func
from .scaffold import _sentinel
from .scaffold import Scaffold
from .scaffold import setupmethod
if t.TYP... |
297bbed78fd3c3dc082c5483fe71d856c8241eda49e647e3cd5f6552c745cde8 | Python | 24,651 | 396 | import os
from statistics import mean
import pandas as pd
from math import log2
from statistics import mean
import numpy as np
def preprocess(folder, mice=False, isogenic_control=False, path=None, log_scaled=False, remove_small_values=False):
# Create folders if they don't exist
os.makedirs(f'table/{folder}/ful... |
775c0e4718f990599a1c8bc250214717f50a408dd1ffd7085e95ace1ae8b6f94 | Python | 24,719 | 433 | import os
import json
import shutil
import argparse
import subprocess
import numpy as np
import torch
from tm import get_net_info
import micro_encoding
import logging
import yaml
from braincog.utils import save_feature_map, setup_seed
from tm import train_motifs
from datetime import datetime
from timm.utils import *
fr... |
eab22e6fcaed2b8f8f060cb2210dff14fddad6b0ba2c89751c8b6ce5feef4d87 | Python | 24,732 | 627 | from __future__ import annotations
import json
import warnings
from typing import TYPE_CHECKING, Any, NamedTuple, cast
import numpy as np
from pymmcore_widgets.useq_widgets._well_plate_widget import (
DATA_COLOR,
DATA_INDEX,
DATA_POSITION,
DATA_SELECTED,
WellPlateView,
)
from qtpy.QtCore import QS... |
a2d9ca78a18457e591950568b1f2557850dc0f100a1e9bc9fe12f34aee65ba63 | Python | 24,743 | 752 | from enum import IntEnum
from functools import lru_cache
from itertools import filterfalse
from logging import getLogger
from operator import attrgetter
from typing import (
TYPE_CHECKING,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Type,
Union,
)
from .cells im... |
c586cdf6d3f93da4afe4fc0ba8515c02bf3130ad917bc7389de38eb235925cad | Python | 24,746 | 620 | from typing import Dict, Union
import torch
from torch.nn.modules.loss import _Loss
from torch_geometric.data import Data
from torch_cluster import radius_graph
import torch.nn as nn
from e3nn import o3
from e3nn.math import soft_one_hot_linspace
from e3nn.nn import Gate, Dropout, BatchNorm, FullyConnectedNet
# from ... |
af3d7471137b72bb118ecbfa4e601e79cbb69015d572e898a3da7d3d11ed5b0e | Python | 24,773 | 681 | import math
import numpy as np
import torch
from e3nn import o3
from e3nn.nn import FullyConnectedNet
from e3nn.o3 import Linear, TensorProduct
from torch import nn
from torch.nn import functional as F
from torch_scatter import scatter
def prod(x):
"""Compute the product of a sequence."""
out = 1
for a i... |
6b9cfb23d80e15e326bbb19bebf44fc90f063ee54fd4479b962c5c5923d240f9 | Python | 24,783 | 788 | """
This module contains implementations for the termui module. To keep the
import time of Click down, some infrequently used functionality is
placed in this module and only imported as needed.
"""
import contextlib
import math
import os
import sys
import time
import typing as t
from gettext import gettext as _
from i... |
4109149669a6c1c9a059c9466e98eac251329c9f8498c5294f4af162c09ce165 | Python | 24,785 | 513 | """
pytorch CNN scorer that creates functions that map images to
activation values of their hidden units.
"""
from sys import platform
import os
from os.path import join
import numpy as np
import timm
import torch
from torchvision import models
from torchvision import transforms
import torch.nn.functional as F
from cor... |
47d2f7d7a4948aa67e0cbb3b706bfdd35db1e443f5f5e07569b8811b120d74a0 | Python | 24,798 | 428 | import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as stats
from scipy import stats
from scipy.stats import kstest
from statistics import mean, median, mode
import numpy as np
from distance_calculations import *
import shutil
# , 'sqrt_high_variation_genes', 'log10_high_variation_genes', 'log2_high... |
152a655c42f9f985b5c9937273d73143c900392be3a7f363b8e6873f7debad3a | Python | 24,897 | 622 | # -*- coding: utf-8 -*-
#
# score_fun.py
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.