sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
cab2308a3e3537d3dd255c0ae4fd2e3cd68c2b77bed3619d3ccd1e62c713162a
Python
37,712
988
## ........................................................................... ## ## PIMMS (Polymer Interactions in Multicomponent Mixtures) ## Alex Holehouse, Pappu Lab, Holehouse Lab ## Copyright 2015 - 2026 ## ........................................................................... ### ### ### ## Set of tool...
b4b1a1970c7fd074e38d0b2710e1346d5d56fa19c1d1998cb5174c101cdcacd0
Python
37,773
932
"""FOOOF - Fitting Oscillations & One-Over F. Notes ----- - Methods without defined docstrings import docs at runtime, from aliased external functions. - Private attributes of the FOOOF method, not publicly exposed, are documented below. Attributes (private) ---------- _spectrum_flat : 1d array Flattened power sp...
870ccd4790f86d84c353ce3a8f4b8aa139d1b19936da398ce4a797662b64be65
Python
37,798
1,414
""" This module contains a set of functions for vectorized string operations and methods. .. note:: The `chararray` class exists for backwards compatibility with Numarray, it is not recommended for new development. Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of ...
7938bc6f5e89ba669cf16231f0b2dfffd65e173038bb59e2a47314a1ce7e9723
Python
37,830
1,185
from __future__ import annotations from datetime import timedelta import operator from typing import ( TYPE_CHECKING, cast, ) import numpy as np from pandas._libs import ( lib, tslibs, ) from pandas._libs.tslibs import ( NaT, NaTType, Tick, Timedelta, astype_overflowsafe, get_...
dba79baed27f9fcdfe91729ee8fd0c30b44341d05bed5a7c273d886fc0665a28
Python
37,847
905
#!/usr/bin/env python3.7 """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 import os import re import shuti...
da2e45a3565109238e7668aa2370d3e6ee4d35101d972f54fe82311b78b41379
Python
37,893
891
import os import sys import pickle import shutil import configparser from pathlib import Path import numpy as np from PySide6.QtCore import Slot, QThread, Qt from PySide6.QtWidgets import QApplication, QMainWindow, QButtonGroup, QFileDialog, QMessageBox, QProgressDialog, \ QInputDialog from PySide6.QtGui import QSt...
639b12d752b9af828670f6991f139aa015090d902371f745eea4afc6957276aa
Python
38,023
1,000
"""Test functions for 1D array set operations. """ import numpy as np from numpy import ( ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique, isin ) from numpy.exceptions import AxisError from numpy.testing import (assert_array_equal, assert_equal, assert_raises, assert_rais...
5a3f4d546b624758ef919f6048577dd6eb1494cf07d20d3a68f573dac321e1bc
Python
38,116
964
from __future__ import annotations import logging import os import sys import typing as t from datetime import timedelta from itertools import chain from werkzeug.exceptions import Aborter from werkzeug.exceptions import BadRequest from werkzeug.exceptions import BadRequestKeyError from werkzeug.routing import BuildE...
637a0e8188d82715001e7fcf896d9e587af3d6d58d56e357b4971fdd1244d8f6
Python
38,125
1,099
from datetime import datetime from hypothesis import given import numpy as np import pytest from pandas.core.dtypes.common import is_scalar import pandas as pd from pandas import ( DataFrame, DatetimeIndex, Index, Series, StringDtype, Timestamp, date_range, isna, ) import pandas._test...
1e7d5515c9d5a397c5e38f3f6fcbdde26e646cb80c40cfcee5b11ed43d0c3377
Python
38,133
1,224
""" Declarations of single-qubit and two-qubit gates and their corresponding matrix. """ import builtins import sys import warnings from copy import deepcopy from functools import reduce, partial from typing import Any, Callable, Optional, Sequence, List, Union, Tuple from operator import mul import numpy as np try:...
9984dd2b8a24c0c8ad58f3e1df7e4b637c33cb98579dc1173e7c4b7755eb0d70
Python
38,156
1,183
""" Tests for scalar Timedelta arithmetic ops """ from datetime import ( datetime, timedelta, ) import operator import numpy as np import pytest from pandas.errors import OutOfBoundsTimedelta import pandas as pd from pandas import ( NaT, Timedelta, Timestamp, offsets, ) import pandas._testing...
efd75d38546c1288fb82545835cabe2fbacf079cb78c5c6e3859c20f99505bea
Python
38,190
1,136
""" define the IntervalIndex """ from __future__ import annotations from operator import ( le, lt, ) import textwrap from typing import ( TYPE_CHECKING, Any, Literal, ) import numpy as np from pandas._libs import lib from pandas._libs.interval import ( Interval, IntervalMixin, Interva...
a993f3a6cf27e7febbfc5706a41c8cf46e0f16aafb7f83d67307f9d8eb35eae2
Python
38,234
1,208
""" Provide classes to perform the groupby aggregate operations. These are not exposed to the user and provide implementations of the grouping operations, primarily in cython. These classes (BaseGrouper and BinGrouper) are contained *in* the SeriesGroupBy and DataFrameGroupBy objects. """ from __future__ import annota...
ef5b4ffe436d6f956065d69fcbf387d6c59d64e03a3da4fb709a97eed2a067e9
Python
38,261
1,008
from __future__ import annotations import os import types import typing as t import warnings from weakref import WeakKeyDictionary import sqlalchemy as sa import sqlalchemy.event as sa_event import sqlalchemy.exc as sa_exc import sqlalchemy.orm as sa_orm from flask import abort from flask import current_app from flas...
06015268503a3b5f17c8c6c7ef6830fd0f62645cf3764ff8801978c888daab39
Python
38,289
853
#!/usr/bin/env python3.7 """Defines Simulation 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 copy import...
6f40798f91c6b618c62f2e052ec310b633cf8e5799107f1a80859f2d59def6fd
Python
38,327
1,127
from __future__ import annotations import datetime as dt import operator from typing import TYPE_CHECKING import warnings import numpy as np import pytz from pandas._libs import ( NaT, Period, Timestamp, index as libindex, lib, ) from pandas._libs.tslibs import ( Resolution, Tick, Tim...
171052f63a6fe8d3c1ab04c5d1586fc6bfae5364adf133b26eb4b9c7c54d43a4
Python
38,402
879
import pandas, openpyxl, io, boto3, datetime, sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from awsglue.context import GlueContext from awsglue.job import Job from awsglue.dynamicframe import DynamicFrame from pyspark.context import SparkContext from pyspark.sql.window impo...
11b6ac027a4e2a1c30f9b2d544be36fc733b45f3afd506cab1ee79456c8eafc2
Python
38,427
886
#!/usr/bin/env python # https://github.com/FoxoTech/methylprep/blob/master/methylprep/files/idat.py#L228 # https://github.com/HenrikBengtsson/illuminaio/blob/develop/R/readIDAT_nonenc.R # https://github.com/bioinformed/glu-genetics/blob/dcbbbf67a308d35e157b20a9c76373530510379a/glu/lib/illumina.py#L44-L61 import idatt...
75b9a0df9cf01703d289847ee4eb9203bf74b2504472df0de82d639045dc841b
Python
38,445
828
import pytest from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG from pandas.errors import OutOfBoundsDatetime from pandas import ( Period, Timestamp, offsets, ) import pandas._testing as tm bday_msg = "Period with BDay freq is deprecated" class TestFreqConversion: """Test frequency conver...
dfc0e81d28f102c2b13b6ab150a33495fa41364107736c5905a39152c283919d
Python
38,649
895
#!/usr/bin/env python3 import json import os import subprocess import tempfile from typing import Any from unittest import main, mock, TestCase import yaml from filter_test_configs import ( filter, filter_selected_test_configs, get_ghstack_below_count, get_labels, get_reenabled_issues, mark_un...
64a1ec14008826194d26a53c9cd0691be3a31d9dae13fc3387de0e381ba3f222
Python
38,656
1,177
""" :mod:``pandas.io.xml`` is a module for reading XML. """ from __future__ import annotations import io from os import PathLike from typing import ( TYPE_CHECKING, Any, Callable, ) import warnings from pandas._libs import lib from pandas.compat._optional import import_optional_dependency from pandas.err...
badc72512eccfac4d86a259e93db916886801c79b48da4db22a0d7f868c41d81
Python
38,672
1,102
""" Provide user facing operators for doing the split part of the split-apply-combine paradigm. """ from __future__ import annotations from typing import ( TYPE_CHECKING, final, ) import warnings import numpy as np from pandas._config import ( using_copy_on_write, warn_copy_on_write, ) from pandas._...
7a56ca41232f57ca77a9610554503f9e77928dd5e5e37d906039616b5706546c
Python
38,699
1,177
from datetime import datetime from io import StringIO import itertools import re import textwrap import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, get_option, option_context, ) import pandas._testing as tm import pandas.io.formats.format as fm...
972af3073dff5c8238ec07f9a271ea9bcc78b70561fb2bbf7079b2bfd3cfd821
Python
38,707
1,018
""" SymbolCircuit: symbolic parameterized quantum circuit. Gate parameters are sympy Symbols (or expressions). Amplitude and expectation values are computed via tensor network contraction of numpy object arrays, producing sympy expressions. The class also supports translation to a Qiskit QuantumCircuit with Parameter ...
2f0ffd2df33f67ba8179fddba1a987e4bb4beea893d748292325b2f548fa953a
Python
38,762
1,090
""" Histogram-related functions """ import contextlib import functools import operator import warnings import numpy as np from numpy._core import overrides __all__ = ['histogram', 'histogramdd', 'histogram_bin_edges'] array_function_dispatch = functools.partial( overrides.array_function_dispatch, module='numpy')...
ba33d9d4ac07ded507bb8741c32e0f3b9b62e3f31b5e405fedbceecb763b2a01
Python
38,775
1,023
"""Forward model for simulating light transport in the head. NOTE: Cedalion currently supports two ways to compute fluence: 1) via monte-carlo simulation using the MonteCarloXtreme (MCX) package, and 2) via the finite element method (FEM) using the NIRFASTer package. While MCX is automatically installed using pip, NIR...
c63b1fb5307624896c09dc68ac3227a1e709e9a7ecd4ed25b2a520e04c5c5c8d
Python
38,835
1,059
"""Routines related to PyPI, indexes""" from __future__ import annotations import enum import functools import itertools import logging import re from collections.abc import Iterable from dataclasses import dataclass from typing import ( TYPE_CHECKING, Optional, Union, ) from pip._vendor.packaging import...
bea13fc06677deff58f8867c998273df67042fe86fe87e72591c1f81f9924ba3
Python
38,920
1,177
import numpy as np import pytest from pytest_lazyfixture import lazy_fixture as lf import tensorcircuit as tc # We will implement this soon from tensorcircuit.u1circuit import U1Circuit @pytest.mark.parametrize("backend", [lf("npb"), lf("tfb"), lf("jaxb")]) def test_u1circuit_correctness(backend): # n=4, k=2, fi...
ac95fcde5b8b3d59b8d7a0eae1b3af5770c86831a9d2c8e9845b563b1839017a
Python
38,997
1,114
import collections.abc as cabc import random from inspect import signature import numpy as np import matplotlib.pyplot as pl from matplotlib import rcParams from matplotlib.path import get_path_collection_extents from scvelo import logging as logg from scvelo import settings from scvelo.tools.paga import get_igraph_...
fd7f7cd40d56a2420221e76902647b7ccb26c89c4a8a0115952d8dd073c25564
Python
39,021
836
""" lib to load formatted neural data from mat and pickle files. """ import mat73 from scipy.io import loadmat import pickle from easydict import EasyDict as edict import os import re import glob from pathlib import Path import numpy as np import os.path from os.path import join from collections import OrderedDict ...
d960d8a3b60e23fae36676cf475735ac4eaba11db43dadc4af932100753aeeda
Python
39,168
1,114
"""Registrating optodes to scalp surfaces.""" from dataclasses import dataclass import numpy as np from numpy.linalg import pinv from scipy.optimize import linear_sum_assignment, minimize from scipy.spatial import KDTree import xarray as xr import warnings import pandas as pd import cedalion import cedalion.dataclass...
a7589ed70fc7e71f831b44bd97fc1d819eacdd91201c75fb4c944f53a712983d
Python
39,174
1,132
import logging import os import random import captum import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytorch_lightning as pl import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim.lr_scheduler import StepLR import wandb from pnet i...
dde9f234ef3eb1d1d258cb1cb50a06955570d75975b9075ab1d5f5c46e1c2915
Python
39,194
895
#!/usr/bin/env python3 """ Adaptive CNN for Influenza Antigen Prediction PyTorch implementation with automatic architecture adaptation DETERMINISTIC MODE: - All seeds (torch, cuda, numpy, random) are fixed for reproducibility - torch.backends.cudnn.deterministic = True - torch.backends.cudnn.benchmark = False ...
8e388c6e73007b9e9642938d7e682506d579ddcb9194974a855557798ab90060
Python
39,298
908
import os import sys import time from copy import deepcopy from enum import Enum from pathlib import Path, PurePath from typing import Optional, Dict, List import cv2 import torch from PySide6.QtCore import QObject, Signal, QTimer, QThread from ultralytics import YOLO from app.config.camera import CameraConfig from a...
0810e81b67d6cf1d0e2136d910a9450f9594a3d1d046a9acc1ea0c3ad1ca423b
Python
39,309
1,215
""" Set operations for arrays based on sorting. Notes ----- For floating point arrays, inaccurate results may appear due to usual round-off and floating point comparison issues. Speed could be gained in some operations by an implementation of `numpy.sort`, that can provide directly the permutation vectors, thus avoi...
0076d73e9e2c1f48042604b233403dce098cf4cc26ea347fa79a56b545dea95f
Python
39,353
1,294
import functools import warnings import numpy._core.numeric as _nx from numpy._core.numeric import asarray, zeros, zeros_like, array, asanyarray from numpy._core.fromnumeric import reshape, transpose from numpy._core.multiarray import normalize_axis_index from numpy._core._multiarray_umath import _array_converter from...
6827133858f074b41b119dc92c4be55324a282963e3381a9f2957cb9ef92d088
Python
39,371
1,216
from datetime import ( datetime, timedelta, ) from io import StringIO import re import sys from textwrap import dedent import numpy as np import pytest from pandas._config import using_pyarrow_string_dtype from pandas import ( CategoricalIndex, DataFrame, Index, NaT, Series, Timestamp...
361abe8757ca4bf01114f77a051ab26b58113a6a80d0a5f5fde18e37903262cc
Python
39,451
1,197
""" Abstract base class for the various polynomial Classes. The ABCPolyBase class provides the methods needed to implement the common API for the various polynomial classes. It operates as a mixin, but uses the abc module from the stdlib, hence it is only available for Python >= 2.6. """ import os import abc import n...
a82d192cd4fbec10e7050d5ab7104ddb4006d3a9a2d74babf3ee013fdcc42838
Python
39,486
1,068
import calendar from datetime import ( date, datetime, timedelta, timezone, ) import zoneinfo import dateutil.tz from dateutil.tz import ( gettz, tzoffset, tzutc, ) import numpy as np import pytest import pytz from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas.compat import...
aade484b66dab639ce1def7450ae63112ee9661825a695bffb5c2278b959cac0
Python
39,511
1,187
from __future__ import annotations from collections.abc import ( Hashable, Iterator, ) from datetime import timedelta import operator from sys import getsizeof from typing import ( TYPE_CHECKING, Any, Callable, Literal, cast, overload, ) import numpy as np from pandas._libs import ( ...
138add653e8355c31149e0da71e06c3295ab73e03d68012f179b1b5b80ecb488
Python
39,546
1,259
""" :mod:`pandas.io.html` is a module containing functionality for dealing with HTML IO. """ from __future__ import annotations from collections import abc import numbers import re from re import Pattern from typing import ( TYPE_CHECKING, Literal, cast, ) import warnings from pandas._libs import lib fr...
1c113e6e15db1f2746fd6c29f3f54d27f38f8b9bde8ef9b51ba900af145e8ead
Python
39,803
1,114
""" Linear Discriminant Analysis and Quadratic Discriminant Analysis """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # Matthew Ning <mhn@bu.edu> # License: BSD 3-Clause import warnings from numbers import Integral from numbers import Real import...
bcec9bdb07dbd51140ff05c04737ece14a68680e4436806a0e459f65b8ea4a82
Python
39,818
1,045
"""Contains tests for extension of comparable regions with record pairs""" # from python import unittest import random import string import big_scape.comparison.record_pair # from other modules import big_scape.genbank as bs_genbank import big_scape.hmm as bs_hmmer import big_scape.comparison as bs_comp import big_sc...
171f65915db729f8a36528fc12f4c7b0fac7fe4853c1162ed5f4433894564842
Python
39,819
1,009
"""Set of functions for visualization of mean waveform if action potentials.""" import numpy as np import os import matplotlib.pyplot as plt import parmap from scipy.spatial.transform import Rotation from scipy.spatial.distance import cdist, pdist, squareform from scipy.signal import argrelmin from tqdm import tqdm ...
e4a9e9a6f6903c29c4d38ed15d3d6a4249694e01a9dd195a90530669d9965a55
Python
39,847
1,124
"""Test for cancellation during mid-position extraction (partial ROI processing). This test verifies that when cancellation happens while processing ROIs within a single position, the position is NOT marked as complete in the database. """ from __future__ import annotations from typing import TYPE_CHECKING, Any from...
f1ac0c12c8c187b47ff2cfb0e6ba00abe999ae197ff4dad640e53c955f0260fb
Python
39,874
1,241
""" these are systematically testing all of the args to value_counts with different size combinations. This is to ensure stability of the sorting and proper parameter handling """ import numpy as np import pytest import pandas.util._test_decorators as td from pandas import ( Categorical, CategoricalIndex, ...
d80d4eedfa535dc7de0f9215e075ab2281175e482ae64f2df5a5ab8f1f74567c
Python
39,886
1,119
"""PyPI and direct package downloading""" import sys import os import re import io import shutil import socket import base64 import hashlib import itertools import warnings import configparser import html import http.client import urllib.parse import urllib.request import urllib.error from functools import wraps impor...
3677cde166fe51af62d569626e2341aec688ebe6022e2efad144498c92490f44
Python
39,926
1,061
from __future__ import annotations from datetime import datetime import weakref import numpy as np import pytest from pandas._config import using_pyarrow_string_dtype from pandas._libs.tslibs import Timestamp from pandas.core.dtypes.common import ( is_integer_dtype, is_numeric_dtype, ) from pandas.core.dty...
6b70a159481269dfbbc97aef454e30afa958e4eaaddb8df4f19fe4324a85c718
Python
40,042
1,157
""" test fancy indexing & misc """ import array from datetime import datetime import re import weakref import numpy as np import pytest from pandas._config import using_pyarrow_string_dtype from pandas.errors import IndexingError from pandas.core.dtypes.common import ( is_float_dtype, is_integer_dtype, ...
6664fb57b30c08e60ac3b4c663d4992f26037fa25d33e5957f4ec5755b958532
Python
40,049
1,006
from dataclasses import dataclass, field, replace from typing import ( TYPE_CHECKING, Dict, Iterable, List, NamedTuple, Optional, Sequence, Tuple, Union, ) from . import box, errors from ._loop import loop_first_last, loop_last from ._pick import pick_bool from ._ratio import ratio_...
186d703cd31c2f47cc24eebcbc5e77c0a31dc277de84371a23eafd3694df8a50
Python
40,074
1,020
# 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. """ .. testsetup:: from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier from packaging.version import Version...
d415c987938747714e39413ac1dcb2ed08096ccef34384cfbc165e0e76213293
Python
40,076
750
from torch.utils.data import DataLoader import numpy as np import torch import torch.nn as nn from utils import InfoNCE from tqdm import tqdm import torch.nn.functional as F from torch.optim import Adam from utils import DualBranchContrast from pl_bolts.optimizers import LinearWarmupCosineAnnealingLR from model_scripts...
c9cf43fccc9c2449b052966f72cd4e64bf477e23459b2c3445969e1d134790fc
Python
40,079
1,019
# 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. """ .. testsetup:: from pip._vendor.packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier from pip._vendor.packagin...
ce31d1553c8f791ef2d9280c9f552c50cd4cdfb11f4f5932a683eeaa3c6c1462
Python
40,121
1,154
from datetime import ( date, datetime, timedelta, ) import re import numpy as np import pytest from pandas._libs.tslibs import iNaT from pandas._libs.tslibs.ccalendar import ( DAYS, MONTHS, ) from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime from pandas._libs.tslibs.parsing import Da...
877460e0dc380617d693e0ca28cad3703b8012c704c670b19bebe60985b59b17
Python
40,131
929
#!/usr/bin/env python3.7 """Defines FiberSet 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 csv import os...
a40c0851e873b4029773d7ce9c1245958a566c9d046216fc13d1df64f541e185
Python
40,181
1,128
""" Circuit object translation in different packages """ import logging from copy import deepcopy from typing import Any, Dict, List, Optional, Sequence, Tuple, Union import numpy as np logger = logging.getLogger(__name__) try: import qiskit.quantum_info as qi from qiskit import QuantumCircuit from qis...
94b385cb7b0498773921a1074621f5b1056721dda6a14433872789653b5d637d
Python
40,383
1,049
"""Parse tokens from the lexer into nodes for the compiler.""" import typing import typing as t from . import nodes from .exceptions import TemplateAssertionError from .exceptions import TemplateSyntaxError from .lexer import describe_token from .lexer import describe_token_expr if t.TYPE_CHECKING: import typing...
e14e23b40d17de23fcdee42707df9323e1c34b0f04f32f333181dad148db6da2
Python
40,392
940
""" pygments.filters ~~~~~~~~~~~~~~~~ Module containing filter lookup functions and default filters. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pip._vendor.pygments.token import String, Comment, Keyword, Name,...
7145e83b42c0c2bb07f5c2ea7430309ef016780b432124b517dfcb594b62b95a
Python
40,401
1,064
""" Quantum circuit: the state simulator. Supports qubit (dim=2) and qudit (3 <= dim <= 36) systems. For string-encoded samples/counts, digits use 0-9A-Z where A=10, ..., Z=35. """ # pylint: disable=invalid-name from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple from functools import reduce from ...
7b67a203035b14d08ac63e1bc0328d2bec3b1c8752cf73a633153f4c8b7e7af4
Python
40,408
1,140
from __future__ import absolute_import import errno import logging import re import socket import sys import warnings from socket import error as SocketError from socket import timeout as SocketTimeout from ._collections import HTTPHeaderDict from .connection import ( BaseSSLError, BrokenPipeError, DummyC...
b8fd122115290464b8ad947b897b700ec7f5be909993fd5fdbd36f61c722ef7f
Python
40,522
1,100
""" Tests specific to `np.loadtxt` added during the move of loadtxt to be backed by C code. These tests complement those found in `test_io.py`. """ import sys import os import pytest from tempfile import NamedTemporaryFile, mkstemp from io import StringIO import numpy as np from numpy.ma.testutils import assert_equal...
243e9df381981181bc01771cf076d4aa8063f8866db762f110c439683af46a79
Python
40,580
978
# -*- coding: utf-8 -*- # # ke_model.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.o...
86c8c1a5973c8bd3bf68a3290a6b34b6e4368c0a9b915ccb5e750a234d5355c5
Python
40,615
1,267
"""Common IO api utilities""" from __future__ import annotations from abc import ( ABC, abstractmethod, ) import codecs from collections import defaultdict from collections.abc import ( Hashable, Mapping, Sequence, ) import dataclasses import functools import gzip from io import ( BufferedIOBas...
0ea7da88a1956a0385b8bd2fdd56716599119d65af972d3f9581ee2e36994c1a
Python
40,625
1,035
"""numpy.distutils.fcompiler Contains FCompiler, an abstract base class that defines the interface for the numpy.distutils Fortran compiler abstraction model. Terminology: To be consistent, where the term 'executable' is used, it means the single file, like 'gcc', that is executed, and should be a string. In contras...
3e6dd1072ba9c5e66d3200164343adaf4cf766817e1e403bf797e2e97cb15b03
Python
40,698
984
""" demixed Principal Component Analysis """ # Author: Wieland Brendel <wieland.brendel@neuro.fchampalimaud.org> # # License: BSD 3 clause from __future__ import print_function import numpy as np from collections import OrderedDict from itertools import combinations, chain from scipy.sparse.linalg import svds from s...
33470b15b1419ffc83f7dcbf910f1863835631a1f59d5772c017f9e82ae98899
Python
40,756
1,313
from __future__ import annotations from datetime import timedelta import operator from typing import ( TYPE_CHECKING, Any, Callable, Literal, TypeVar, cast, overload, ) import warnings import numpy as np from pandas._libs import ( algos as libalgos, lib, ) from pandas._libs.arrays...
e26b042242db15ab41a5f7d857dc0d8ac26ef13109f1337c4869889f680a3b4f
Python
40,808
1,202
#!/usr/bin/env python # coding: utf-8 try: get_ipython # type: ignore except NameError: def get_ipython(): class _DummyShell: def run_line_magic(self, *args, **kwargs): pass def run_cell_magic(self, *args, **kwargs): pass def magic(s...
a5b221b57dc4d3b314f46377d1facbfbe28a316de2626d5e15a4e2c0fab7f4c5
Python
40,911
1,026
# doctest r''' Test the .npy file format. Set up: >>> import sys >>> from io import BytesIO >>> from numpy.lib import format >>> >>> scalars = [ ... np.uint8, ... np.int8, ... np.uint16, ... np.int16, ... np.uint32, ... np.int32, ... np.uint6...
b6f5e6b15ae57e173e06bddb69ee472a2b9096628f58bf6d4556e2ecc861669c
Python
40,940
1,391
""" Base and utility classes for pandas objects. """ from __future__ import annotations import textwrap from typing import ( TYPE_CHECKING, Any, Generic, Literal, cast, final, overload, ) import warnings import numpy as np from pandas._config import using_copy_on_write from pandas._libs...
7e33ab1cb5cf764f2d4d17c9bc64fa41bb94a737e6663710f4ce98af8773c229
Python
41,011
1,049
"""Set of functions for visualization of mean waveform if action potentials.""" import numpy as np import os import matplotlib.pyplot as plt from matplotlib.lines import Line2D from scipy.spatial.transform import Rotation from scipy.spatial.distance import cdist, pdist, squareform from tqdm import tqdm class Geome...
c23966226a204cb1c9b018bc169be51898f718d2d174002073093988ec6dae19
Python
41,070
1,059
"""Panel widget for displaying analysis and detection runs.""" from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING, Any, NamedTuple from qtpy.QtCore import QEvent, QObject, Qt, Signal from qtpy.QtWidgets import ( QCheckBox, QDialog, QDialogButtonBox, QGroupBox...
2649ce77835177829d157ce350a29800dd17bf25f566629b9454363028decd1a
Python
41,210
995
# coding: utf-8 import math import os from argparse import Namespace from collections import defaultdict import numpy as np import torch import torch.nn as nn from .modules import ( BernsteinRadialBasisFunctions, ClebschGordan, EnergyLayer, ExponentialBernsteinRadialBasisFunctions, ExponentialGau...
57970f48a27187962d7f672684681ea42f22d5d9bddff0376669fe317330bf5f
Python
41,328
986
import torch import torch.nn as nn import torch.optim as optim import pytorch_lightning as pl from torch.optim import AdamW from collections import OrderedDict from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.utils.data import DataLoader, TensorDataset, random_split, Subset, ConcatDataset from pytorch_...
02a84174f8c21e8f64ced0e98161abe9e5fb82695c90406061a0209af6d878ae
Python
41,334
1,082
""" ############################################################################## ShinGLMCC.ShinGLMCC.py This module primarily contains functions related to the connectivity estimation algorithms ShinGLMCC and GLMCC. by Yasuhiro Tsubo modified ver. 2023.10.23 ##########################################...
83277e941fc06aed83421d6a4e1385de76b7ce7663d999e5b645bb62e1bf16e3
Python
41,465
860
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Common modules """ import ast import contextlib import json import math import platform import warnings import zipfile from collections import OrderedDict, namedtuple from copy import copy from pathlib import Path from urllib.parse import urlparse import cv2 import nump...
da34528d1238a3ebe55de4cad8108621486473a7bd646852b1a711339a2c793c
Python
41,467
1,137
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import shutil import sys try: import ssl except ImportError: # pragma: ...
4b3a33ccf3fb686e72db2e0c51026795f63b4087dedd478fb8b2229965dbacd6
Python
41,514
1,159
"""Copyright (c) Meta, 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 logging import time from typing import Dict, List import pytorch_lightning as pl import torch import torch.nn as nn from torch.optim impor...
536f673a9033175cde23788de7a599fc93234ddee8c27531d010f28695c067a9
Python
41,557
957
# model import torch import torch_geometric as tg import os # data pre-processing import numpy as np import pandas as pd import pickle as pkl from sklearn.model_selection import train_test_split from scipy.stats import gaussian_kde import math import seaborn as sns # data visualization import matplotlib as mpl impor...
5abd12268f4e671d9f9d2c6f332e5f28aa0b475cc739d89307f8541575637fc3
Python
41,564
1,006
#!/usr/bin/env python3.7 """Defines Sample 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 copy import math...
91af243b16bb74b3f7c107fb6f87461cb34ff6573a4c8d4c09ea6c2d27d8a134
Python
41,660
1,425
import codecs from datetime import datetime from textwrap import dedent import pytest import pandas as pd from pandas import ( DataFrame, Series, ) import pandas._testing as tm pytest.importorskip("jinja2") def _dedent(string): """Dedent without new line in the beginning. Built-in textwrap.dedent ...
4f70f5970eae027844fa4121927b858ae662210583259fe49ea1a4e381cedd8b
Python
41,739
922
# License: GNU Affero General Public License v3 or later # A copy of GNU AGPL v3 should have been included in this software package in LICENSE.txt. """ Implements a more readable and efficient version of biopython's SeqRecord. Most attributes are wrapped, with the record features being secmet features and acc...
32a72d44cd8fc3df32260c32d094da7c5ce42ee338a2e0f57c03b6c786817cc4
Python
41,872
1,176
"""PyPI and direct package downloading""" import sys import subprocess import os import re import io import shutil import socket import base64 import hashlib import itertools import warnings import configparser import html import http.client import urllib.parse import urllib.request import urllib.error from functools i...
90f64c65318c3894b4cf2627abc08ced9c2c809a5919a1b9d31988528da372da
Python
41,878
1,255
import os import h5py import json import argparse import warnings import numpy as np import spglib, seekpath from typing import Callable, Union from mendeleev import element from scipy.optimize import minimize_scalar from scipy.special import erf import matplotlib.pyplot as plt from matplotlib.lines import Line2D impo...
943d285fd384198559e67639dc8569570fa230d6079a03a4f4c3d2b3a593418b
Python
41,880
1,087
""" ############################################################################## ShinGLMCC.ShinGLMCC2.py This module primarily contains functions related to the connectivity estimation algorithms ShinGLMCC and GLMCC. by Yasuhiro Tsubo modified ver. 2024.5.14 ##########################################...
18193eef191041a9644bac7a0e8eb3c39c3d1dc33967341b014db672e0cae197
Python
41,884
1,006
import torch from torch.nn import functional as F from e3nn import o3, nn from abc import abstractmethod from e3nn.util.jit import compile_mode from typing import Callable, List, Optional, Tuple, Union from .from_mfn.blocks import (RealAgnosticResidualInteractionBlockUp, RealAgnosticResidualInteractionBlock, ...
e0d5aaa356bc2403c524fbadb5b0664f8763b3e34bccb59926758a89d72be5e4
Python
41,885
776
''' Several notes: 1. There are two kinds of input files - (a) user data and (b) system data. The former has three files - (a) expression profile, (b) lncRNA target prediction, (c) TF target prediction. LncRNAs' targets are predicted using LongTarget (or the more rapid version Farsim); TFs' targets are pre...
6ef3c51cb8ebc57b40549738bc3821dbe7a326a268063b7b6486f4ef002de53d
Python
41,930
1,019
#!/usr/bin/env python3 import re import os import sys import errno import random import logging import argparse import collections # sys.path hack to access lib package in root directory. sys.path.insert(0, os.path.dirname(sys.path[0])) # sys.path hack to allow overriding installed pyBamParser. for key in 'PYBAMPATH', ...
347552aa7c25f7083513edf45c3e034461245c2066e4b9f837a635021bdf3b69
Python
41,973
969
import numpy as np import glob import pandas as pd import librosa import matplotlib.pyplot as plt import os import csv from pathlib import Path from cross_correlation import cross_corr from butterworth_filter import filterA, butter_filter class ExperimentEvaluator: """Class to preprocess the recordings of the DPOA...
e831aed7453270114155923bbe27fe01a550acf9ba5da15c7a053a5be7d8cc71
Python
41,998
1,381
from fractions import Fraction import random import pytest import numpy as np import jax.numpy as jnp import pyzx_param as pyzx from pytest_lazyfixture import lazy_fixture as lf import tensorcircuit as tc from tensorcircuit.zx.stabilizertcircuit import StabilizerTCircuit from tensorcircuit.zx.scalar_graph import ( ...
9b2a091752446d76a69a8fe30bc4a8c5f58148c0d4a326ee018ca579eac4949d
Python
42,211
1,252
import re import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, date_range, lreshape, melt, wide_to_long, ) import pandas._testing as tm @pytest.fixture def df(): res = DataFrame( np.random.default_rng(2).standard_normal((10, 4)), col...
13a8cd530e4bbab0d87e995a2abed50d4bf65ca3f4fd8b28cd2cdd186057b9df
Python
42,227
1,174
""" Backend magic inherited from tensornetwork: tensorflow backend """ # pylint: disable=invalid-name import os import re from functools import reduce, partial from operator import mul from typing import Any, Callable, Optional, Sequence, Tuple, Union from scipy.sparse import coo_matrix import tensornetwork from ten...
d704fb772bde46e902b160c5f16599b42c58bc695fe787a8b606b6f37ee2becb
Python
42,232
1,103
""" ############################################################################## ShinGLMCC.ShinGLMCC.py This module primarily contains functions related to the connectivity estimation algorithms ShinGLMCC and GLMCC. by Yasuhiro Tsubo modified ver 1.0 2023.10.23 ver 2.0 2024.08.28 (add find...
1af675466e9dfbc59462fa93a51df838cf895690f7b0e6a17a14edab3255d2c7
Python
42,367
950
"""Independent Component Analysis by Entropy Bound Minimization (ICA-EBM). This code is based on :cite:t:`Li2010A` and converted matlab versions provided by the MLSP Lab at the University of Maryland, which is available here: https://mlsp.umbc.edu/resources.html. """ import numpy as np import cedalion.data from cedal...
1c1e5dfcdca6df860371844171d07a096bc155c7c87cc097420c69413c923cf8
Python
42,374
1,084
# Standard library imports import os import json import math import random import re import pickle import warnings from datetime import datetime from collections import defaultdict, Counter from itertools import permutations from pathlib import Path # Third-party imports import numpy as np import pandas...
e1697fdea65d7e17a86beecd900acf88ee6b1d9ebecd39dfcf60853287dcd620
Python
42,737
871
# -*- coding: utf-8 -*- # Time : 2023/2/14 11:52 # Author : Regulus # FileName: main_visual_losslandscape.py # Explain: # Software: PyCharm import sys import tqdm from loss_landscape.plot_surface import * from Pytorch_Grad_Cam.cam import * import argparse import math import time import CKA import numpy ...
e0e506adc80c1e56a2de9eed42dd2c5e8a4d613ac674415251a55fe92ed9cf22
Python
42,980
1,266
import numpy as np import pytest from pandas.errors import SettingWithCopyWarning from pandas.core.dtypes.common import is_float_dtype import pandas as pd from pandas import ( DataFrame, Series, ) import pandas._testing as tm from pandas.tests.copy_view.util import get_array @pytest.fixture(params=["numpy"...
b931035be91f192d5914c4e4201c2ff60c5154d96325e60dff9efbac4cfe5d9f
Python
42,991
1,113
"""Utilities for Pearson correlation statistical analysis.""" import re import warnings from pathlib import Path from typing import TypedDict, cast import h5py as h5 import nibabel as nib import numpy as np import numpy.typing as npt import statsmodels.api as sm from joblib import Parallel, delayed from nilearn impor...
0de506062295f67120f73044976d5f07b65bb656f48472af291b7cc2fddefc1d
Python
43,061
1,397
# ------------------------- # Plotting utilities # ------------------------- import contextlib import logging import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib.gridspec import GridSpec from matplotlib.lines import Line2D from mpl_toolkits.axes_grid1.inset_loca...
ce5682b4dd0823bc4083dfac1c3a3a1dd30d261ae68422d56d259ee103d9911f
Python
43,093
1,100
from datetime import datetime import warnings import dateutil import numpy as np import pytest import pytz from pandas._libs.tslibs.ccalendar import ( DAYS, MONTHS, ) from pandas._libs.tslibs.period import IncompatibleFrequency from pandas.errors import InvalidIndexError import pandas as pd from pandas impor...
ef7bad7e5d0d1d0fd77e9e66dfec256e8ed8680df54bf76495e8793f71932b0b
Python
43,162
1,156
# -*- coding: utf-8 -*- __all__ = ['Distribution'] import io import sys import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist import distutils.command from distutils.util import strtobool from distutils.debug import DEBUG from distutils...