sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
592df01d241a6847dc7aed6cca2168e637f87bf0962944dea7f21a6ce548fc9d | Python | 33,225 | 1,086 | """
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import codecs
import contextlib
import io
import os
import re
import socket
import struct
import sys
import tempfile
import warnings
import zipfile
from collections... |
e9070ebca6965f14a726c5eba1091ae17cb5c9289dfaa75e0fe5b412e480773b | Python | 33,341 | 929 | """Contains tests for the pair class and its methods"""
# from python
from unittest import TestCase
from pathlib import Path
from collections import OrderedDict
# from dependencies
from Bio.SeqFeature import SeqFeature, FeatureLocation
from big_scape.comparison.record_pair import RecordPair
# from other modules
from... |
906c0b73170dd41a90e6fb8a5f9d62e9e0b5245056a03839f3e2ca935e0517bc | Python | 33,387 | 1,028 | import logging
import numpy as np
import pandas as pd
from scipy.stats import wilcoxon
from sklearn.metrics import average_precision_score
from statsmodels.stats.multitest import multipletests
from tqdm.auto import tqdm
logger = logging.getLogger(__name__)
# -------------------------
# Core stats utilities
# ------... |
7e11c1fb8d07f24d2efae5bc520af4198adc44da95f0f7d560385d9fa9b236af | Python | 33,418 | 917 | """
Generate the static paper reproduction gallery under ``public/reproduce``.
The gallery is built mechanically from the ``meta.yaml`` files of git-tracked
reproductions in ``examples/reproduce_papers``. Untracked work in progress is
never published. Validation runs first and aborts on the first batch of errors
inste... |
70481af82f89ac31a119ef108371066786f504028b256ec1c23412112829acfa | Python | 33,528 | 633 | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Train a YOLOv5 model on a custom dataset.
Models and datasets download automatically from the latest YOLOv5 release.
Usage - Single-GPU training:
$ python train.py --data coco128.yaml --weights yolov5s.pt --img 640 # from pretrained (recommended)
$ python train.... |
b80d284191fc8b93bc60bb99b789ee2a370cf7569cdd84f8ec96b27e7583c5e4 | Python | 33,534 | 945 | from pathlib import Path
from typing import Any
import colorcet as cc
import matplotlib.pyplot as plt
import networkx as nx
import nibabel as nib
import numpy as np
import numpy.typing as npt
from matplotlib.colors import Colormap
from matplotlib.figure import Figure
from nilearn import image
from opioids_analysis.cr... |
2cb2eb5d98ddd7c7f68630f11945944a24ccfad06da98ee77a4b641f0d79980c | Python | 33,541 | 914 | import re
from typing import Any, Dict, List, Optional
import logging
import unicodedata
from difflib import SequenceMatcher
from fastapi import APIRouter, Depends, HTTPException, Query
from app.utils.database import Neo4jConnection, get_neo4j_connection
from app.utils.schema import (
EntityRelationshipsResponse,
... |
271d10ab3bdb4b67b64a36b38c978e82cccdfbce57a17e92ce6fbd57dcfbb8cc | Python | 33,569 | 836 | import numpy as np
from sklearn.metrics import accuracy_score
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.keras.optimizers import Adam
import tensorcircuit as tc
import jax
import optax
K = tc.set_backend("jax")
tc.set_dtype(... |
eab663bc975c2efb02a8d8cf7c734088654a5338eedf56773859619808d4ec0b | Python | 33,628 | 845 | from __future__ import annotations
import contextlib
import functools
import logging
from collections.abc import Iterable, Iterator, Mapping, Sequence
from typing import (
TYPE_CHECKING,
Callable,
NamedTuple,
Protocol,
TypeVar,
cast,
)
from pip._vendor.packaging.requirements import InvalidRequ... |
f709c5f230c6117251f664bc81479252f528db9deffdd7e6e5fe542b034052bd | Python | 33,653 | 894 | parent_path = r'/home/student1/Desktop/Charalampos_Lamprou/VarCoNetV2_extras'
import sys
sys.path.append(parent_path)
import torch
import torch.nn.functional as F
from abc import ABC, abstractmethod
from torch.utils.data import Dataset
from torch_geometric.data import Dataset as Dataset_geo
from torch_geometric... |
577129b32df5cc8380b1c40595b2c181ff4dc8799badb9d8e857f1da71af1c27 | Python | 33,654 | 869 | from joblib import Parallel, delayed
import numpy as np
from tqdm import tqdm
from lib.mpunits import vectorize
import os
import cvxpy as cp
import scipy.linalg as scl
import scipy.io as sio
from scipy.ndimage import zoom, gaussian_filter
import multiprocessing
import warnings
class TensorFitting(object):
def ... |
a5250778ef6763919fe555f208267daa8463ad74f5638734c51733e457803c26 | Python | 33,694 | 841 | import numpy as np
from numpy import histogram, histogramdd, histogram_bin_edges
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_almost_equal,
assert_array_almost_equal, assert_raises, assert_allclose,
assert_array_max_ulp, assert_raises_regex, suppress_warnings,
)
import ... |
af7d5a067cc2481a6afde9b81f22e248c793891ce51c09fb05de325d8ab21056 | Python | 33,864 | 1,188 | """ Basic functions for manipulating 2d arrays
"""
import functools
import operator
from numpy._core._multiarray_umath import _array_converter
from numpy._core.numeric import (
asanyarray, arange, zeros, greater_equal, multiply, ones,
asarray, where, int8, int16, int32, int64, intp, empty, promote_types,
... |
cddb2a525aa9c3866ec50e4ce5d38dd6abca6c3d6d664255469d3757a9903d77 | Python | 33,922 | 802 | import sys
sys.path.insert(0, '/home/panwenxuan/back')
import numpy as np
import argparse
import time
import obj
import timm.models
import yaml
import os
import logging
from random import choice
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
from micro_encoding import ... |
e1361a8379bf144d450efbef1ae24bf9c8597b99c729da4e93a73eb5f18daebc | Python | 33,949 | 741 | import math
import os
import time
import xml.etree.ElementTree as ET
from xml.dom import minidom
import multiprocessing as mp
import cv2
import matplotlib.pyplot as plt
import numpy as np
import openslide
from PIL import Image
import pdb
import h5py
import math
from wsi_core.wsi_utils import savePatchIter_bag_hdf5, ini... |
22c58faee53a8c38de50042ac6c14950816bd0c1d45cd40d6ad3fe00962fd880 | Python | 33,987 | 1,072 | """
Functions for preparing various inputs passed to the DataFrame or Series
constructors before passing them to a BlockManager.
"""
from __future__ import annotations
from collections import abc
from typing import (
TYPE_CHECKING,
Any,
)
import numpy as np
from numpy import ma
from pandas._config import usi... |
b6670e91420f1f9036f18034d9e86e6440426d7b78b9082af08dc80593af358e | Python | 33,996 | 834 | # -*- coding: utf-8 -*-
#
# KGDataset.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.... |
40ff668fb12551d5b3ee63087ce2412f1605b0f856ba0af33593467a594b5d33 | Python | 34,082 | 1,099 | from datetime import datetime
import re
import numpy as np
import pytest
from pandas._libs import lib
from pandas.errors import UnsupportedFunctionCall
import pandas as pd
from pandas import (
DataFrame,
NamedAgg,
Series,
)
import pandas._testing as tm
from pandas.core.indexes.datetimes import date_range... |
1803d258c010f0c5dd395c23de2a2730bbc6f16fcdf45a2513a7129d4dfdb923 | Python | 34,156 | 932 | import numpy as np
import pytest
from pandas._config import using_pyarrow_string_dtype
import pandas.util._test_decorators as td
from pandas import (
Categorical,
DataFrame,
DatetimeIndex,
NaT,
PeriodIndex,
Series,
TimedeltaIndex,
Timestamp,
date_range,
to_datetime,
)
import p... |
80393e1af76b8895ea82c19b1e0adc2933f4629eb33d7ce1ceb2290851f78c05 | Python | 34,249 | 1,062 | """The runtime functions and state used by compiled templates."""
import functools
import sys
import typing as t
from collections import abc
from itertools import chain
from markupsafe import escape # noqa: F401
from markupsafe import Markup
from markupsafe import soft_str
from .async_utils import auto_aiter
from .... |
8971c947db23a4a937eeda15f53303609004ad582a3b1c4433e48418ebddc85f | Python | 34,308 | 818 | """
The tests exercise the casting machinery in a more low-level manner.
The reason is mostly to test a new implementation of the casting machinery.
Unlike most tests in NumPy, these are closer to unit-tests rather
than integration tests.
"""
import pytest
import textwrap
import enum
import random
import ctypes
impo... |
6cc4d7eddd3d0d1414602f6455b41a1223bd64835a50d04f8935f37461baf355 | Python | 34,320 | 734 | smartsPatts = {
'PubChemFP0': ('[H]', 3),
'PubChemFP1': ('[H]', 7),
'PubChemFP2': ('[H]', 15),
'PubChemFP3': ('[H]', 31),
'PubChemFP4': ('[Li]', 0),
'PubChemFP5': ('[Li]', 1),
'PubChemFP6': ('[B]', 0),
'PubChemFP7': ('[B]', 1),
'PubChemFP8': ('[B]', 3),
'PubChemFP9': ('[C]', 1),
'PubChemFP10': ('[C]', 3),
'... |
d7d095d98ff4666e565d0a854790992e24cc09a4ac75e8eaae9a4ee186a8887b | Python | 34,326 | 873 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_d... |
13149d486c390eb443797091c7dc928a0be7c0ab7ca466f92977e51d1603730b | Python | 34,334 | 660 | """
AmygdalaEngrams Model
This file defines the AmygdalaEngrams model described in:
"Werne et al., Learning, sleep replay and consolidation of contextual fear memories: A neural network model."
The AmygdalaEngrams model simulates associative learning and consolidation processes in hippocampal-amygdala-cortical circu... |
d9f1a7a247a09fd4f962edcf9520a38fae004a68f1c000172acd5aa7644ba8be | Python | 34,396 | 785 | import numpy as np
import scipy
import time, os
import parmap
import copy
from tqdm import tqdm
import time
import logging
# ********************************************************
# ********************************************************
# ********************************************************
def parallel_conv_... |
15e7f5208514147aa97afcd78833db20690329c858d8554a79578b191d50ab78 | Python | 34,446 | 920 | """
SecureTranport support for urllib3 via ctypes.
This makes platform-native TLS available to urllib3 users on macOS without the
use of a compiler. This is an important feature because the Python Package
Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL
that ships with macOS is not capable... |
db3192014c51a6478cd7d632ce12bbaced880a9fba2c8cab613755407a757586 | Python | 34,462 | 972 | """
Modules for DQAS framework
"""
# possibly deprecated, multiprocessing is not the recommended way to do DQAS task now, using vmap!
import sys
import inspect
from functools import partial
from multiprocessing import Pool, get_context
from typing import (
List,
Sequence,
Any,
Tuple,
Callable,
... |
337643d8f9dba1135d6b46268f696cbcfaa5bfb50379314e44ea49bf98e81edc | Python | 34,543 | 1,114 | import sys, boto3, os, io, pandas, datetime
from scipy import stats
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
from pyspark.sql import SQLContext
from awsglue.dynamicframe imp... |
c71d40fafd4759d3dc74ced58fa8c2c8b48fedb240732ddeb7827be7a93e28d4 | Python | 34,547 | 658 | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Train a YOLOv5 segment model on a segment dataset
Models and datasets download automatically from the latest YOLOv5 release.
Usage - Single-GPU training:
$ python segment/train.py --data coco128-seg.yaml --weights yolov5s-seg.pt --img 640 # from pretrained (recommen... |
4e89d88032a117092ba2b14f296f47489a91d1a227d0eeb6ded94c82df5039ca | Python | 34,554 | 922 | """
Stabilizer+T Circuit class using ZX-calculus and JAX.
"""
from __future__ import annotations
from math import ceil
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
import re
import jax
import jax.numpy as jnp
import numpy as np
import pyzx_param as pyzx
from pyzx_param.simulate import Decompos... |
9b50eecdcafaaa1648f0943a57226050d8a78c07f96d0ce28d29839ccb2f531f | Python | 34,579 | 1,206 | """AST nodes generated by the parser for the compiler. Also provides
some node tree helper functions used by the parser and compiler in order
to normalize nodes.
"""
import inspect
import operator
import typing as t
from collections import deque
from markupsafe import Markup
from .utils import _PassArg
if t.TYPE_CH... |
02cd796bea911733b0a2fa8516efb484d1ca26028f5c0754ec0857a1b529631a | Python | 34,603 | 871 | #!/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 math
import os
i... |
f26852ac1f2e61931af7d008de17c8321f8184774dbe156fbf1171248d373c39 | Python | 34,617 | 865 | #!/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 math
import os
i... |
fec967ad805bd59160a8fd79d350f924d1792e65b30f63d0183b6bcf093e78fd | Python | 34,661 | 989 | from __future__ import annotations
import itertools
from typing import (
TYPE_CHECKING,
cast,
)
import warnings
import numpy as np
import pandas._libs.reshape as libreshape
from pandas.errors import PerformanceWarning
from pandas.util._decorators import cache_readonly
from pandas.util._exceptions import find... |
6fd2ccd30057bfb13b4ab6c28c09b8c3037e86b1fe88dc6fd7c2e058d30c28fa | Python | 34,665 | 1,076 | # Copyright (c) 2010-2020 Benjamin Peterson
#
# 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, modify, merge, publi... |
f08644aea4109cd9b9ddd659b98ab8146538fdda728a731e1f540504858891f1 | Python | 34,739 | 862 | from __future__ import annotations
import email.feedparser
import email.header
import email.message
import email.parser
import email.policy
import pathlib
import sys
import typing
from typing import (
Any,
Callable,
Generic,
Literal,
TypedDict,
cast,
)
from . import licenses, requirements, spe... |
2f8668e06588315cc7a4e437434f7e187ff4231b607b901347a90880c6188e87 | Python | 34,741 | 918 | from itertools import permutations
import re
import numpy as np
import pytest
import pandas as pd
from pandas import (
Index,
Interval,
IntervalIndex,
Timedelta,
Timestamp,
date_range,
interval_range,
isna,
notna,
timedelta_range,
)
import pandas._testing as tm
import pandas.co... |
710ddb72843c78b558288bfffef15dc3ccab89b09b410ce61526ec7f6b8ccaa9 | Python | 34,743 | 1,043 | #!/usr/bin/env python3
"""Repository-wide sanity checks for TensorCircuit-NG."""
from __future__ import annotations
import argparse
import ast
import io
import json
import re
import subprocess
import sys
import tokenize
from collections import Counter, defaultdict
from dataclasses import asdict, dataclass
from pathli... |
f7332830ffab183c0acb8c8e92eb6a003547b87ee7d965df37ac695e0722dc12 | Python | 34,755 | 821 | #!/usr/bin/env python3
from __future__ import annotations
import enum
import json
from datetime import datetime, timedelta, timezone
from typing import Any
from unittest import main, mock, TestCase
from urllib.error import HTTPError, URLError
import greenlight_ledger
from greenlight_guard import (
evaluate_green... |
60989b33b1987b8adef3ed1adce9579864be5c38131283b8b6506ddaadb90678 | Python | 34,762 | 863 | from __future__ import annotations
import email.feedparser
import email.header
import email.message
import email.parser
import email.policy
import pathlib
import sys
import typing
from typing import (
Any,
Callable,
Generic,
Literal,
TypedDict,
cast,
)
from . import licenses, requirements, spe... |
e44745ae89a445696d1a8f719647d145bd9e4b022936b57cdf81773ff6ea9cd2 | Python | 34,779 | 963 | """
test with the TimeGrouper / grouping with datetimes
"""
from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
import pytz
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
MultiIndex,
Series,
Timestamp,
date_range,
offsets,
)... |
05b0a37e1fd991ed51eccf5f3e844048e44d7d74b6299d08816385ea3367a2bd | Python | 34,826 | 1,028 | import numpy as np
import pytest
import pandas as pd
from pandas import (
CategoricalDtype,
CategoricalIndex,
DataFrame,
IntervalIndex,
MultiIndex,
RangeIndex,
Series,
Timestamp,
)
import pandas._testing as tm
class TestDataFrameSortIndex:
def test_sort_index_and_reconstruction_do... |
a7ea96c74c23bbd248c080b7c14ad51542698b915e383f3c3a58edcd3ce77669 | Python | 34,833 | 911 | """
Tests for array coercion, mainly through testing `np.array` results directly.
Note that other such tests exist, e.g., in `test_api.py` and many corner-cases
are tested (sometimes indirectly) elsewhere.
"""
from itertools import permutations, product
import pytest
from pytest import param
import numpy as np
impor... |
3d971c8cd0529d5964b51562f3f3a7199a51c75706464e3caf669c64245c732c | Python | 34,853 | 743 | # Copyright 2024 RADar-AZDelta
# SPDX-License-Identifier: gpl3+
# pylint: disable=unsubscriptable-object
import logging
import logging.config
import sys
import traceback
from argparse import ArgumentParser, RawTextHelpFormatter
from configparser import ConfigParser
from os import environ as env
from os import getcwd, ... |
77e4e729f14af4e5c1d3fe4f0889e37baf4c85d01581b0b8a084912342b2f513 | Python | 34,859 | 651 | # -*- coding: utf-8 -*-
# Time : 2023/2/14 11:52
# Author : Regulus
# FileName: main_visual_losslandscape.py
# Explain:
# Software: PyCharm
from loss_landscape.plot_surface import *
import argparse
import math
import time
import CKA
import numpy
import timm.models
import random as rd
import yaml
import ... |
c00241c7307e80a36010b9d5b65c3bcf9fcd507993cfb90e50ca4f0d5f8a15ce | Python | 34,936 | 900 | import torch
import torchaudio
import random
import numpy as np
import sys
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 *
from .time_domain_cochleagr... |
d91924e83946cfd238ad70e3b3aa81ad9891bd43568810c220a938e26d26af1c | Python | 34,972 | 971 | """ Test cases for .hist method """
import re
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
Series,
date_range,
to_datetime,
)
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_ax_scales,
_check_axes_shape,
_check_colors,
_chec... |
2752a5f444a6075a842673de2cfec6695364ff4ef248e0d05b46961b35d566d5 | Python | 35,046 | 914 | """
Pauli Propagation Engine
========================
This module implements a Pauli Propagation Engine (PPE) that tracks the evolution
of Pauli observables through a quantum circuit using a global k-local representation.
Key Features:
- Tracks all k-local Pauli strings globally, avoiding subset boundary issues.
... |
cbbee951ca302698c3f911ca5fb6b1dc976242249adf0032ff5027152e62a671 | Python | 35,100 | 913 | from inspect import signature
import numpy as np
import pandas as pd
from pandas import unique
import matplotlib.pyplot as pl
from matplotlib.colors import is_color_like
from anndata import AnnData
from scvelo import logging as logg
from scvelo import settings
from scvelo.preprocessing.neighbors import get_connecti... |
9e788e3a186baf1f3cc14775886d82dafca14fa99f77537851b0ede2963517bf | Python | 35,190 | 1,095 | from __future__ import annotations
import datetime
from functools import partial
from textwrap import dedent
from typing import TYPE_CHECKING
import numpy as np
from pandas._libs.tslibs import Timedelta
import pandas._libs.window.aggregations as window_aggregations
from pandas.util._decorators import doc
from panda... |
73aaf22c1e52d6eb857bb2f12fb6503a7596cffe33aaffc605aa61e76017659d | Python | 35,204 | 921 | """Independent Component Analysis by Entropy Bound Rate Minimization (ICA-ERBM).
This code is based on :cite:t:`Li2010B` and :cite:t:`Fu2014`. It was converted from
matlab versions provided by the MLSP Lab at the University of Maryland, which is
available here: https://mlsp.umbc.edu/resources.html.
"""
import scipy ... |
921f36a6fc7ab23c9f13edc3f4933468f79d86f6c5e769b30a98fb34c27a4b98 | Python | 35,212 | 1,263 | from __future__ import annotations
import warnings
from .backend import transformations, validations, selections, counts, metrics, utils
class textstatistics:
"""Main textstat class with methods to calculate readability indices.
Attributes
----------
text_encoding : str
Default: "utf-8"
... |
c7f5ce9a07bafe4f6e2228f6b7225904414aa408eed71512f649d085ee6495e5 | Python | 35,270 | 1,158 | """
Routines for filling missing data.
"""
from __future__ import annotations
from functools import wraps
from typing import (
TYPE_CHECKING,
Any,
Literal,
cast,
overload,
)
import numpy as np
from pandas._libs import (
NaT,
algos,
lib,
)
from pandas._typing import (
ArrayLike,
... |
eb65737efb9524ef2719f41f7ce0c12bacd2427b30743fa3e0aa840fbf7cbc48 | Python | 35,294 | 964 | """Single-movement models from the literature, implemented for your pleasure.
"""
import logging
from numpy.linalg import multi_dot as mdot
from scipy.linalg import block_diag
import numpy as np
class LinearTodorov():
"""Model for hand movements.
Implements the linear model of "hand movements" as presented ... |
ef75680692cc2e3287c0869928ce74ac6a4e4b1d6406c0b1971c4d4ac3f087c9 | Python | 35,318 | 985 | """ Test cases for Series.plot """
from datetime import datetime
from itertools import chain
import numpy as np
import pytest
from pandas.compat import is_platform_linux
from pandas.compat.numpy import np_version_gte1p24
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame... |
8866f3f89c258a2fce7e1fead1ec4fe0a7747fe4fa4534f6cfb01012b60f81a5 | Python | 35,328 | 1,052 | """Tests for cluster analysis plot helper functions.
Covers:
- _get_cluster_data_from_db: early-return and data-retrieval paths
- Plot function "no data" early-return branches
- Interactive hover/click handler closures
"""
from __future__ import annotations
import gc
from pathlib import Path
from typing import TYPE_... |
9a096f118e34e77d24963d2e1fb6124be218382e1636a5bcdf93aed48477f903 | Python | 35,329 | 809 | import warnings
import gc
import pathlib
import os
from typing import List, Union, Callable
import numpy as np
import scipy.signal
import cupy as cp
import cupyx
import cupyx.scipy.ndimage
from pydantic import BaseModel, ValidationError
from tqdm.auto import tqdm
import h5py
from .warp import warp_volume
from .utils ... |
fe406b389fcd4f94e5d0854cd2b03d73c7b2b0febfcab946cc4408d1e55807e0 | Python | 35,349 | 963 | """
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import time
from pip._vendor.pygments.filter import apply_filters, Filter
from pip._vendor.pygments.filters im... |
0e0cfbad02624958cb36bd731cc9515bc5b8a13cb35e249b309bc41313e35550 | Python | 35,444 | 842 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 15 12:02:16 2024
@author: Administrator
"""
import pandas as pd
import numpy as np
import torch
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import torch.nn as nn
import math
import torch.optim as optim
from sklear... |
6e18b2bf6394242076219a5adc6a2fc8004689cbc092d3b2445daa4159fc14c2 | Python | 35,484 | 983 | from __future__ import annotations
import re
from itertools import zip_longest
from pathlib import Path
from typing import TYPE_CHECKING, Any, cast
import numpy as np
import pandas as pd
from scipy.ndimage import gaussian_filter1d
from cali._constants import (
EVK_NON_STIM,
EVK_STIM,
MEAN_SUFFIX,
N_S... |
b5a963960eaf2786fec4cbb64da30d14591a8b031ec7f56c110eaa513377c336 | Python | 35,575 | 1,039 | """
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import datetime
# Import encoding now, to avoid implicit import later.
# Implicit import within threads may cause LookupError when standard library is in a ZIP,
# such as in Embedded Python. See https://github.com/p... |
2311bbad3f0a57406086250cbd53327791a46c347dc6a5929920ea4f709400a3 | Python | 35,612 | 1,375 | from __future__ import annotations
from io import (
BytesIO,
StringIO,
)
import os
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
NA,
DataFrame,
Index,
)
import pandas._testing as tm
from pandas.io.common import get_handle
from pandas.io.xml impo... |
92a89c9a23e30535e1fa81b434e58882a633ef9f9f763bae832420562f10b9c3 | Python | 35,746 | 983 | ## ...........................................................................
##
## PIMMS (Polymer Interactions in Multicomponent Mixtures)
## Alex Holehouse, Pappu Lab, Holehouse Lab
## Copyright 2015 - 2026
## ...........................................................................
import numpy as np
import co... |
5081e63a9f130e97ff17895f8e0c6314de150a6bf637c880f3c7aaa3f3e76fa2 | Python | 35,791 | 875 | import threading
# ignore deprecation warnings from oasis
import warnings
from collections.abc import Generator, Iterable
from concurrent.futures import FIRST_COMPLETED, Future, ThreadPoolExecutor, wait
from datetime import datetime
from typing import Callable, cast
import numpy as np
from oasis.functions import GetS... |
4e5a556cdaa2b300420a3829dc7cf818549c3e2a922cabc7b1c46d319a195343 | Python | 35,808 | 903 | """Main experiment. Run to execute experiment.
The code here relies on the QTM streaming markers with certain labels,
regardless of the order. There are three markers that are necessary:
- The fingertip marker, which should be labeled F1.
- The two top markers on the printout, labeled TL for the top-left one, and TR
... |
51020c36264d52d5ea2fa396260b413414b8dcb1ab802eec4e9d5fdf59e781a9 | Python | 35,834 | 832 | """
Some misc. utilities.
"""
import numpy as np
import matplotlib.pyplot as plt
import os
import numpy as np
import pandas as pd
from scipy import signal
from scipy.stats import zscore
from rastermap import Rastermap
from scipy.stats import skew, kurtosis
from scipy.signal import welch
from tqdm import tqdm
from scip... |
23d037ea287991642029ed63fbf34091e0f122dd7cf81418cbd68a2984fc501a | Python | 35,848 | 1,101 | import copy
import numpy as np
import pandas as pd
from anndata import AnnData
from typing import Optional, Union
from shapely.geometry import Point, MultiPoint
from pathlib import Path
from scipy.sparse import spmatrix, issparse, csr_matrix
class Cell(object):
def __init__(
self,
cel... |
7345a607f2f4e3f51f65b2daa07f7cdbf53fb3b7a8b3128c5220159833dd4585 | Python | 35,861 | 899 | import inspect
import linecache
import os
import sys
from dataclasses import dataclass, field
from itertools import islice
from traceback import walk_tb
from types import ModuleType, TracebackType
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Sequence,
Set,
Tupl... |
827721cc7fe1cbf5da4a82eee32d92e29b3b5265d17ce589ba329ca43d032485 | Python | 35,950 | 948 | """Visualization functions for cerebellar cortical data.
Provides plotting in normal 3D and inflated 3D views using PyVista, as well as flatmap
view using Matplotlib.
"""
# ---------------------------------------------------------------------------
# Authors: John G Samuelson <johnsam@mit.edu>
# Christoph Din... |
4bb1d24473ae7ba3d9fa83e5719868beced60d0932047ae66be965f62256f660 | Python | 35,961 | 995 | import torch
from e3nn import o3, nn
import matplotlib.pyplot as plt
import os
import warnings
import torch_geometric
from e3nn.math import soft_one_hot_linspace,soft_unit_step
from torch_scatter import scatter
from e3nn.nn import Gate
from e3nn.util.jit import compile_mode
from torch_geometric.data import Data
fro... |
049df544a7bc8816749786bf72e77ed2a761f11166070d347a32725a6f2237a0 | Python | 36,013 | 960 | """Simulate bimodal data as a toy model for concurrent EEG–fNIRS data.
Follows an approach inspired by Dähne et al., 2014.
Reference: https://doi.org/10.1016/j.neuroimage.2014.01.014
"""
import yaml
from argparse import Namespace
import random
import math
import numpy as np
import xarray as xr
import matplotlib.pyp... |
6521653f65e7bfb7da6af4df157e7fe664f5890111cb5b91e731d77835d4d988 | Python | 36,037 | 880 | import numpy as np
import pandas as pd
import customtkinter
from tkinter import filedialog, messagebox
from utils.image_utils import load_svg_image
from ui.widgets import Tooltip
from ui.window import set_window_style, set_window_icon
class LoadFileDialog(customtkinter.CTkToplevel):
def __init__(self, parent, defa... |
37cdfdbbf307647ffcd5dd179790e5720f9976a41933ca4da5efcfcd5b606a27 | Python | 36,167 | 791 | """
Comprehensive tests for confounder estimation, AIPW inference, and their combination.
Test IDs follow the plan in plan/20260520_comprehensive_test_plan.md.
Run fast suite (skip slow): pytest -m "not slow" tests/test_inference_comprehensive.py
Run all: pytest tests/test_inference_comprehensiv... |
5cc310cd83af73c2e078da715fb4297eeae58b66c6e68f6301a798e79b4ff390 | Python | 36,200 | 1,008 | """
Binary serialization
NPY format
==========
A simple format for saving numpy arrays to disk with the full
information about them.
The ``.npy`` format is the standard binary file format in NumPy for
persisting a *single* arbitrary NumPy array on disk. The format stores all
of the shape and dtype information necess... |
bdacfc24849497df0862a285281a950dc70ce1b584e1d34fbcbf157da13780ec | Python | 36,210 | 878 | import sys
import numpy as np
import argparse
import time
import timm.models
import yaml
import os
import logging
from random import choice
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
from micro_encoding import ops
from braincog.base.node.node import *
from braincog... |
1caeb0c0f496fb22cb9316e3f029f40b59cf868f1606c8cf85cbc6b620c268f3 | Python | 36,280 | 972 | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
)
import pandas._testing as tm
@pytest.fixture(
params=[["linear", "single"], ["nearest", "table"]], ids=lambda x: "-".join(x)
)
def interp_method(request):
"""(interpolation, method... |
78328847097ef9e6742f0a3675ad9146d7eeb5719abeb24eeb50a5e4e912e7d5 | Python | 36,371 | 985 | from __future__ import annotations
import os.path
import re
import sys
import textwrap
from abc import ABC, abstractmethod
from pathlib import Path
from typing import (
Any,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Set,
Tuple,
Type,
Union,
)
from pip._vendor.py... |
8f57bc14cbc871c4992eb37751fc493905a1f3859d69785d9abd7543b223a77b | Python | 36,380 | 1,185 | """
DQAS application kernels as vag functions
"""
from functools import lru_cache, partial, reduce
import logging
import operator
from typing import (
List,
Sequence,
Any,
Tuple,
Callable,
Iterator,
Optional,
Union,
)
import networkx as nx
import numpy as np
import tensorflow as tf
fr... |
832dd2ef6bb8151836cada28ecdd590d60c8bc1e2e9dbcdde625067609bef1f7 | Python | 36,391 | 1,016 | import builtins
import collections
import dataclasses
import inspect
import os
import reprlib
import sys
from array import array
from collections import Counter, UserDict, UserList, defaultdict, deque
from dataclasses import dataclass, fields, is_dataclass
from inspect import isclass
from itertools import islice
from t... |
16cd2b5b66dfae97e8ede5dc50df7725b0bc86717224c01e92956105ce10b67b | Python | 36,398 | 918 | # -*- coding: utf-8 -*-
"""
This is a collection of analysis tools, both for individual cells and populations
Created on Mon Nov 7 11:08:13 2022
@author: glorenz
"""
import os, sys
import numpy as np
import itertools
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import h5py
import scipy
... |
95bc7d90f4057f91057dd099fb28359c64aa989398729b87081302eafb3f66f0 | Python | 36,399 | 1,001 | from datetime import timedelta
import re
import numpy as np
import pytest
from pandas._libs import index as libindex
from pandas.errors import (
InvalidIndexError,
PerformanceWarning,
)
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Index,
MultiIndex,
date_range,
)
impor... |
043e50aaae21fbc91ac0198e2332659aae31cd38407f8c02bda38b652043371d | Python | 36,422 | 1,093 | import os
import stat
import sys
import typing as t
from datetime import datetime
from gettext import gettext as _
from gettext import ngettext
from ._compat import _get_argv_encoding
from ._compat import open_stream
from .exceptions import BadParameter
from .utils import format_filename
from .utils import LazyFile
fr... |
51887cee1c4eef2499eb443cc9c0e36c4ab371b043e75995f6a2253020c0fc57 | Python | 36,424 | 1,087 | import calendar
import datetime
import decimal
import json
import locale
import math
import re
import time
import dateutil
import numpy as np
import pytest
import pytz
import pandas._libs.json as ujson
from pandas.compat import IS64
from pandas import (
DataFrame,
DatetimeIndex,
Index,
NaT,
Perio... |
62fefa21e4b439c754f72aea82626528b8b1b1e4b9310b207946119d87982bcc | Python | 36,539 | 953 | 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
import pyvista as pv
import statsmodels.api as sm
np.random.seed(42)
# ===================================================================... |
0656ef4ad12ca223866c0f39a4ff61c3cb9f657aea8b18d38c6683ea6b0826e1 | Python | 36,668 | 986 | import datetime
from datetime import timedelta
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
_testing as tm,
concat,
date_range,
read_hdf,
)
... |
cab57fa3b319cc888e72d5511894799f45b8923accc5e729d7d33286aaba98ad | Python | 36,798 | 842 | #!/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... |
bdca5c36d21c92005b72fda008203a6f7a4fdd6a14aae2ea9eeb4ca4dc0038c0 | Python | 36,833 | 1,176 | import builtins
import datetime as dt
from string import ascii_lowercase
import numpy as np
import pytest
from pandas._libs.tslibs import iNaT
from pandas.core.dtypes.common import pandas_dtype
from pandas.core.dtypes.missing import na_value_for_dtype
import pandas as pd
from pandas import (
DataFrame,
Mult... |
d14bf6676c41bf161052c021a79cd9dbad9814799237a47f6dacc8fc4c91134d | Python | 36,862 | 1,091 | """
This module contains a set of functions for record arrays.
"""
import os
import warnings
from collections import Counter
from contextlib import nullcontext
from .._utils import set_module
from . import numeric as sb
from . import numerictypes as nt
from .arrayprint import _get_legacy_print_mode
# All of the funct... |
1bf2494b23dc4c27aef24ef809fc754b7cd1a8dc7f9fa86a24db06c4257dc737 | Python | 36,920 | 1,094 | """Dataclasses for representing geometric objects."""
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from enum import Enum
from functools import total_ordering
from typing import Any
from copy import deepcopy
import mne
import numpy as np
import pint
import pyvista as pv
import trimesh
i... |
06b1d3e2b6b1785c8afc143f83899ae55faac6366e480db1bbaa2c88b3c2cc91 | Python | 36,946 | 1,033 | """Contains classes and functions for generating bins of Regions to compare
At this level, the comparisons are referred to as pairs. Whenever anything talks about
pairs, it refers to things generated from these classes. This is distinct from what are
referred to as edges, which are pairs that have a (set of) distances... |
0b08ad04bbee347d59e6ccd9f1d76bf0b526174fa93e2db338aa3dc7c331af39 | Python | 36,957 | 862 | import numpy as np
import sys, os, math
import datetime as dt
import scipy, scipy.signal
import parmap
from scipy.interpolate import splrep, splev, make_interp_spline, splder, sproot, interp1d
from tqdm import tqdm
# doing imports inside module until travis is fixed
# Cat: TODO: move these to the top once Peter's work... |
11c7606aa40f3aa6083b69e807ee89db190e0ec0700136a6bb0037d794825688 | Python | 37,033 | 1,139 | from __future__ import annotations
import contextlib
import datetime as pydt
from datetime import (
datetime,
timedelta,
tzinfo,
)
import functools
from typing import (
TYPE_CHECKING,
Any,
cast,
)
import warnings
import matplotlib.dates as mdates
from matplotlib.ticker import (
AutoLocator... |
5dd9a4043ef84a74f48ebb7682ac87ac4f685c675695c753ac9411fa2e5a0296 | Python | 37,093 | 1,133 | from __future__ import annotations
import ast
import collections.abc as cabc
import importlib.metadata
import inspect
import os
import platform
import re
import sys
import traceback
import typing as t
from functools import update_wrapper
from operator import itemgetter
from types import ModuleType
import click
from c... |
a207e1d54f3c666d5ed21b8ab603461b5e95070829ad9c5aa2b0d4d3d045fd90 | Python | 37,100 | 1,047 | import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas as pd
from pandas import (
DataFrame,
HDFStore,
Index,
MultiIndex,
Series,
_testing as tm,
bdate_range,
concat,
date_range,
isna,
read_hdf,
)
from pandas.tests.io.pytables.common import... |
709ab08c1d24e585d504bcbb726758441347bcfcf5a8e544a9960dd0dd550fb4 | Python | 37,226 | 855 | #!/usr/bin/env python3.7
"""Defines Query 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 pickle... |
9e784183c97c12a50fb14dd2b5758c31772fc4ae8032468fa83fae6c561a86ef | Python | 37,362 | 895 | #!/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... |
7cbe1fd6f9b8d163ddac9d585e531de21cdcf83932424b1131d284746736ec3c | Python | 37,378 | 1,119 | import contextlib
import datetime as dt
import hashlib
import tempfile
import time
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
MultiIndex,
Series,
Timestamp,
concat,
date_range,
period_range,
timedelta_range,
)
impo... |
b675c2114da0dbbaa3af188e411674b6d61dda8a50a8541c49a2b2cb54101fcb | Python | 37,513 | 934 | """ASE Calculator for MACE-H Hamiltonian prediction.
Provides a Calculator interface that loads a trained MACE-H model and
predicts Hamiltonians for arbitrary ASE Atoms objects with periodic
boundary conditions.
Example
-------
from maceh.calculator import MACEHCalculator
from ase.io import read
calc = M... |
b828b690ba762e2ab8df454cb9efe236c1b8f6f30bd49e43b4814ac6cff24727 | Python | 37,570 | 1,101 | import re
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Index,
MultiIndex,
Series,
Timestamp,
bdate_range,
concat,
merge,
option_context,
)
import pandas._testing as tm
def get_test... |
7882c414973dcd7b4585d1105eb8d6e34c94f8cf0432ea98f78f04bdb98aa593 | Python | 37,618 | 895 | import gzip
import os
import pickle
from itertools import chain, combinations
from typing import Any
import numpy as np
import torch
from ase import Atoms
from AIMD import arguments
from AIMD.fragment import FragmentData
from AIMD.preprocess import Preprocess
from AIMD.protein import Protein
from Calculators.device_s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.