sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
783f520af8879b479d71db6644e5f4d0b78827af9d3077c6b90581072dfa73a6 | Python | 43,318 | 1,129 | """
Circuit class for U(1) conserving circuits.
"""
from functools import lru_cache, partial
from itertools import combinations
import logging
from math import comb
from typing import Any, Dict, List, Optional, Sequence, Tuple
import numpy as np
from .abstractcircuit import AbstractCircuit
from .cons import backend,... |
752a71c2f4981165c5168158e53014e3ccc6f2c95d6d97970d4065a264878ef3 | Python | 43,390 | 1,228 | from typing import Dict, List, Optional, Tuple, Union
import hypothesis.strategies as st
import pytest
from hypothesis import given, settings
import numpy as np
import pandas as pd
from numpy.testing import assert_array_equal
from scipy.sparse import csr_matrix, issparse
from anndata import AnnData
from scvelo.core... |
dca612f6fa1eff14c2c9a567667aaa12ab7596fd5854cf41cdcbee576eec23f7 | Python | 43,404 | 1,235 | from __future__ import annotations
from collections import abc
from datetime import date
from functools import partial
from itertools import islice
from typing import (
TYPE_CHECKING,
Callable,
TypedDict,
Union,
cast,
overload,
)
import warnings
import numpy as np
from pandas._libs import (
... |
6e5e78f0352543bff4065c40aa8af8bde3c7ee219b4f3b8dacbdd700c95a7607 | Python | 43,488 | 1,302 | from typing import Callable, Dict, Optional, Union
import pytest
from hypothesis import given
from hypothesis import strategies as st
from hypothesis.extra.numpy import arrays
import numpy as np
import pandas as pd
from scipy.sparse import csc_matrix, csr_matrix, issparse, spmatrix
from anndata import AnnData
from ... |
a43891fd71ff34056a86d3dbf3ccfcbcaf63bd1d5356ba58f358949913c17927 | Python | 43,522 | 991 | import logging
import os
import re
import requests
from typing import Annotated, List, Tuple
from typing import List, Dict, Any
from typing_extensions import Annotated
from dotenv import load_dotenv
from kani import AIParam, ai_function
from kani_utils.base_kanis import StreamlitKani
import streamlit as st
# Load envi... |
704296c94a17bbe60651b649223efd9b490efc158062cabe435fdbc6a4ca40a9 | Python | 43,748 | 957 | import os
import shutil
import nibabel as nib
from nipype.interfaces import fsl
import nipype.pipeline.engine as pe
import nipype.interfaces.utility as niu
from nipype.interfaces.ants import DenoiseImage
from nipype.interfaces.ants import N4BiasFieldCorrection
from niworkflows.interfaces.nibabel import IntensityClip
im... |
ec6689975657ce2a0bee6965f9174d89edde568922f7516882dc816107454644 | Python | 43,847 | 1,234 | import re
import weakref
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
from pandas.core.dtypes.base import _registry as registry
from pandas.core.dtypes.common import (
is_bool_dtype,
is_categorical_dtype,
is_datetime64_any_dtype,
is_datetime64_dt... |
d0c95e4ca4b092de276ab64f4ead06828330a2718945764dc5106f42b9c1d095 | Python | 43,853 | 1,300 | import sys
import os
import pytest
import numpy as np
from pytest_lazyfixture import lazy_fixture as lf
from scipy.linalg import expm
from scipy.sparse.linalg import expm_multiply as scipy_expm_multiply
thisfile = os.path.abspath(__file__)
modulepath = os.path.dirname(os.path.dirname(thisfile))
sys.path.insert(0, mod... |
cf3202ca9bd56eef3f3c27cbde38831a34895927e55a325ba6a4b988d91dd640 | Python | 43,922 | 1,204 | from __future__ import annotations
from datetime import (
datetime,
timedelta,
timezone,
)
from functools import partial
from operator import attrgetter
import dateutil
import dateutil.tz
from dateutil.tz import gettz
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import (
OutO... |
abf40a9444c629d6f5afc6852957d5e19acca153b5c053400b624d1c267aac61 | Python | 43,927 | 1,340 | """
Experimental manager based on storing a collection of 1D arrays
"""
from __future__ import annotations
import itertools
from typing import (
TYPE_CHECKING,
Callable,
Literal,
)
import numpy as np
from pandas._libs import (
NaT,
lib,
)
from pandas.core.dtypes.astype import (
astype_array,... |
2871eb958842ad55598783787bc50c69cf282b8697e37f0d6b501c853749b315 | Python | 43,987 | 1,042 |
import numpy as np
import numpy.ma as ma
from numpy.ma.mrecords import MaskedRecords
from numpy.ma.testutils import assert_equal
from numpy.testing import assert_, assert_raises
from numpy.lib.recfunctions import (
drop_fields, rename_fields, get_fieldstructure, recursive_fill_fields,
find_duplicates, merge_ar... |
ff0c965b36a485453d9557cada387b258e35feb68e360e869b664ac99ea6ce3f | Python | 44,019 | 1,170 | import itertools
import warnings
from pathlib import Path
from typing import cast
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from bids import BIDSLayout
from joblib import Parallel, delayed
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.lines imp... |
bf4649595884793e433a520472439879af43813fe8e1a60c562af2fac3f65e50 | Python | 44,030 | 874 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 7 17:33:30 2019
@author: bxin
"""
import os
import keras
import numpy as np
from keras import backend as K
from keras.optimizers import Adam
from keras.layers.core import Dropout
import keras.regularizers as kr
import matplotlib.pyplot as plt
import csv
from collections... |
654081aaba891d5d743dd96aa5a756f6319a8d5a04ed5f1d261dab85e0afeb22 | Python | 44,063 | 1,303 | """ This module contains helpful utility function for running statistics using BFP """
# try:
# import vtk
# VTK_INSTALLED = 1
# except ImportError as e:
# VTK_INSTALLED = 0
#VTK_INSTALLED = 0
import csv
import glob
import itertools
import multiprocessing
import os
import sys
from functools import partial
fr... |
c9af8aea0545d083fc737f86369218ac43120dcc28620ea05fdf2bb44c4a8655 | Python | 44,075 | 1,232 | import os
import numpy as np
import pandas as pd
from scipy.optimize import minimize
import matplotlib.pyplot as pl
from matplotlib import rcParams
from scvelo import logging as logg
from scvelo import settings
from scvelo.core import get_n_jobs, parallelize
from scvelo.preprocessing.moments import get_connectivitie... |
cea47892962fd4ff2aae401bee174e7509be548bfa2b6e1d952f1f4105d3860b | Python | 44,212 | 1,067 | import math
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torch_scatter import scatter_add, scatter_mean
import utils
import subprocess
class ConditionalDDPM(nn.Module):
"""
Conditional Diffusion Module.
"""
def __init__(self,
dynamics, a... |
3967f067c05aa33b9b718f56a965f40461009c29df47954db118397b830ae45f | Python | 44,254 | 1,116 | """Tests for backend-generic matrix-function primitives."""
import numpy as np
import pytest
from pytest_lazyfixture import lazy_fixture as lf
from scipy.sparse import csr_matrix
import tensorcircuit as tc
def _reference_action(matrix, vector, coefficient):
eigenvalues, eigenvectors = np.linalg.eigh(matrix)
... |
a21563d57816fa5e2b93501f4dee9b227ad19a887d172c04cca819f7dfc191e5 | Python | 44,277 | 1,061 | """
This module contains pipelines and functions for generating t1, t2 and
t2star qMRI maps.
Author: Himanshu Aggarwal (himanshu.aggarwal@inria.fr), 2021-22
"""
import json
import shutil
import time
from os import listdir, makedirs, sep, system
from os.path import exists, join
import numpy as np
from matplotlib impor... |
eab0f90b2e264839360acb807493aada17be3d26be662aac760cb2400179ab1d | Python | 44,294 | 1,458 | """
Functions to operate on polynomials.
"""
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit']
import functools
import re
import warnings
from .._utils import set_module
import numpy._core.numeric as NX
from numpy._cor... |
3a995453d387dc513a6eb682e5e145af2fb042c8cf915bbfe76c7749430e3792 | Python | 44,298 | 1,142 | """CCA-like models for multimodal data decomposition.
Includes:
- ElasticNetCCA: CCA with L1 + L2 regularization
- StructuredSparseCCA: CCA with L1 + graph-structure regularization
- RidgeCCA: CCA with L2 regularization
- SparseCCA: CCA with L1 regularization
- CCA: Standard CCA
- SparsePLS: PLS with L1 regularization... |
573e70f509b5f18e9e78bbacfcda0076b54289d5a88e1e8805ce09b4f4d412ae | Python | 44,402 | 1,065 | import torch
from torch_cluster import radius_graph
from torch_scatter import scatter
import e3nn
from e3nn import o3
from e3nn.util.jit import compile_mode
from e3nn.nn.models.v2106.gate_points_message_passing import tp_path_exists
import torch_geometric
from torch_geometric.data import Data
import math
from typing ... |
afac6ea7feb8538a683513711fa25c4770742f072725fc941d4326bdf94dbcbd | Python | 44,443 | 1,339 | """
Constants and setups
"""
# pylint: disable=invalid-name
import logging
import sys
import time
from collections import deque
from contextlib import contextmanager
from functools import partial, reduce, wraps, lru_cache
from operator import mul
from typing import Any, Callable, Dict, Iterator, List, Optional, Seque... |
d6ea30fc6408d15656d9eb106bf823100a91461bd097ac62f54730f4ae65663c | Python | 44,487 | 559 | # ------------------------------------------------------------------------------
# 4_bids_conversion.py
# Author: Dr. Timo Hofsähs
# Based on code provided by Dr. Jil Meier
#
# Copyright © 2024 Charité Universitätsmedizin Berlin.
# This software is licensed under the terms of the European Union Public License
# (EUPL... |
46e27b1a436c89990124165a25fe75cb32848af46d674546201b8073db789c8a | Python | 44,609 | 1,036 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 5 07:55:36 2022
@author: phykc
"""
import cv2 as cv2
import os
import numpy as np
from math import sqrt, pi
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import ast
class FileManager:
def __init__(sel... |
ec4deeac480900f364b7cab60419891ac72501079cb12dea9ff07c7121a1ce85 | Python | 44,670 | 1,056 | import math
from argparse import Namespace
from typing import Optional
from time import time
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
import pytorch_lightning as pl
import wandb
from torch_scatter import scatter_add, scatter_mean
f... |
236c221853bfd712b06c4256a0c39e4d797e6ad9b9d38ec39682e1f08d2c974b | Python | 44,761 | 1,068 | import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn_ensemble_cv import reset_random_seeds, Ensemble, ECV
from causarray.gcate_glm import fit_glm
import causarray.gcate_glm as _gcate_glm # module-q... |
11b500df016905aa9180812486adb4a2d7b444e55da303adc895764750ec3f67 | Python | 44,885 | 311 | import numpy as np
from rdkit import Chem
import torch
# ------------------------------------------------------------------------------
# Computational
# ------------------------------------------------------------------------------
FLOAT_TYPE = torch.float32
INT_TYPE = torch.int64
# --------------------------------... |
db4418bee1e3436618e8e3ff1344a5db4b560ba8c32a79aa32c2b23f241aed92 | Python | 44,932 | 1,107 | """
app/utils/hypothesis_utils.py
Pure helpers + every prompt for the EvoAge hypothesis pipeline.
Nothing here holds request state or loads a model -- see hypothesis_routes_new.py
for the stateful resources (RESCAL, edge tensor, Neo4j driver).
"""
from __future__ import annotations
import json
import logging
import ... |
785241f93c527bbba725a00e461bcd0eb56e203c30387051675e4247f375f9be | Python | 44,937 | 947 | import numpy as np
import pickle
import matplotlib.pyplot as plt
import os
from sklearn.metrics import f1_score,roc_curve
import pandas as pd
import seaborn as sns
from statannotations.Annotator import Annotator
path_results = r'' #here, enter the path where results have been saved
if not os.path.exists(os.path.join(... |
4c78d6e8cc3d618dd41ed56cb48037fdb11ab05a5add422ced006033a1e8af40 | Python | 45,043 | 880 | #!/usr/bin/env python3
import os
import logging
import json
from logging import StreamHandler, FileHandler
from lib.designer_input_utils import get_input_info, convert_input_data, create_shell_table, assert_inputs
from lib.designer_fit_wrappers import refit_or_smooth, save_params
from lib.io import load_mrtrix
from mr... |
3a52e9ba33ba3a7c40655950452da764f3b7f26b944b806f389b4b1cc8b4912d | Python | 45,174 | 1,047 | # Copyright 2024 RADar-AZDelta
# SPDX-License-Identifier: gpl3+
# pylint: disable=unsubscriptable-object
"""Holds the ETL abstract class"""
import logging
import os
import platform
import tempfile
from abc import abstractmethod
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_... |
ba27825131d1d04ab1986b250ad892341cf20f8e406bf08b70532abdc6afb0af | Python | 45,319 | 1,317 | # FIXME: this file needs refactoring
import logging
import numpy as np
import scipy.special as specsci
import math
from numpy.random import dirichlet
import scipy.spatial as ss
from numpy.random import dirichlet
from sklearn.cluster import KMeans
from sklearn.mixture import GaussianMixture
logger = logging.getLogger(... |
e0a9b627d28e5edfe698b3a49d4190b278d2bb9cfa80daccbc2eb161131600ba | Python | 45,347 | 1,077 | #!/usr/bin/env python3
"""Tests for .claude/hooks/claude_code/time-budget.sh and its claude-code.yml wiring.
The script runs as a subprocess through /bin/bash, the way Claude Code runs the hook
entries in claude-code.yml's settings, and every case passes an explicit env with a
temporary RUNNER_TEMP: the script is driv... |
79119afbb635b87f08cbd569b3d33151779f313bf5c58fd5e94c6c377be611f6 | Python | 45,406 | 963 | #!/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 ... |
4a90b1c3c851fce71b9b9b4dad47063d34c876e10675224fc5193212d2992e42 | Python | 45,423 | 1,344 | from __future__ import annotations
import re
import warnings
import numpy as np
import pytest
from pandas._libs import (
NaT,
OutOfBoundsDatetime,
Timestamp,
)
from pandas._libs.tslibs.dtypes import freq_to_period_freqstr
from pandas.compat.numpy import np_version_gt2
import pandas as pd
from pandas imp... |
fd1ac0253fcb5bf8ca3665bc0e2eaa695bb33b2dfd03673a40794422f56e6724 | Python | 45,640 | 1,378 | """Test versioned detection and analysis results with CaliResult tracking.
This test validates the CaliResult model and its relationship with settings.
It focuses on testing the database schema and settings equality, without
requiring full detection/analysis pipeline integration.
"""
from pathlib import Path
import ... |
c027d9ddbdff58a6372d9d1c3e7e485eb4cdeb05ed0927daf09aefa739f3f397 | Python | 45,672 | 1,641 | """
This module contains a set of functions for vectorized string
operations.
"""
import sys
import numpy as np
from numpy import (
equal, not_equal, less, less_equal, greater, greater_equal,
add, multiply as _multiply_ufunc,
)
from numpy._core.multiarray import _vec_string
from numpy._core.overrides import se... |
42ee91749a150087b4cd6f99f6a20614127e02d56e98f0d6446595a3a4c7edaf | Python | 45,860 | 1,363 | """Contains functionality for handling .snirf files."""
from __future__ import annotations
import logging
import re
from collections import OrderedDict
from enum import Enum
from pathlib import Path
from typing import Any
from dataclasses import dataclass
import numpy as np
import pandas as pd
import xarray as xr
fro... |
d0abab6301bef90cf06a42340dadfb65f3fcdaa129318a76db2fb05abbc8965f | Python | 45,862 | 1,236 | """
test where we are determining what we are grouping, or getting groups
"""
from datetime import (
date,
timedelta,
)
import numpy as np
import pytest
import pandas as pd
from pandas import (
CategoricalIndex,
DataFrame,
Grouper,
Index,
MultiIndex,
Series,
Timestamp,
date_ran... |
87fd392f7e6bb4d021eda9b804746ad5575f0fbadd6a690450fadb3afb627098 | Python | 45,893 | 1,143 | # Class to do parallelized clustering
import os
import numpy as np
import networkx as nx
from sklearn.decomposition import PCA
from scipy.spatial import cKDTree
from scipy.stats import chi2
from yass.template import shift_chans, align_get_shifts_with_ref
from yass import mfm
from yass.util import absolute_path_to_asse... |
be4e31354ebe9dab72ae8dbd388892c8a3c097129a172c80077978e4c2d275ef | Python | 45,985 | 1,133 | """Two-surface head model and standard atlas loading for DOT forward modelling."""
from __future__ import annotations
import gzip
import json
import os
import warnings
from dataclasses import dataclass
from functools import lru_cache
from pathlib import Path
import nibabel
import numpy as np
import pandas as pd
impo... |
20e310031dd4779b89ffb4db206813b6084a5bade9525e05a58926f839164bc6 | Python | 46,179 | 1,231 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------
# SLT_DCM - fMRI MAIN
#
# Preamble
#
#
#
#
# ----------------------------------------------------------
# --------
# Librarys
# --------
from __future__ import division
import viz
import vizact
import vizinput
import vizshape
impo... |
c19f11216f1d227324838beb9450ccc6e2dfdf60e5ea1e1847da9856ac866c6b | Python | 46,356 | 1,119 | import os
import logging
import numpy as np
import time
from tqdm import tqdm
import torch
import sys
import cudaSpline as deconv
import matplotlib.pyplot as plt
from scipy.interpolate import splrep, splev, splder, sproot
import parmap
# these functions are same asin match_pursuit; copied just in case
def transfo... |
ef976846bf096128e8c5b1a1910ac8bbb8fa2bbfa8546466a7aa12c12364b27a | Python | 46,540 | 927 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 7 17:33:30 2019
@author: bxin
"""
import os
import keras
import numpy as np
from keras import backend as K
from keras.optimizers import Adam
import keras.regularizers as kr
import matplotlib.pyplot as plt
import csv
from collections import OrderedDict
from sklearn.util... |
5ae56d912bbde91ef198c2881fb9ce6eab5da2dbda2fb40de91f4ffbc8086b6d | Python | 46,601 | 1,177 | ## ...........................................................................
##
## PIMMS (Polymer Interactions in Multicomponent Mixtures)
## Alex Holehouse, Pappu Lab, Holehouse Lab
## Copyright 2015 - 2026
## ...........................................................................
import numpy as np
from . ... |
00a1e2974ee7935c4381c11452f037c110d1fb16635b0136935cefbfa9273982 | Python | 46,631 | 1,165 | import contextlib
import sys
import warnings
import itertools
import operator
import platform
from numpy._utils import _pep440
import pytest
from hypothesis import given, settings
from hypothesis.strategies import sampled_from
from hypothesis.extra import numpy as hynp
import numpy as np
from numpy.exceptions import C... |
5b2c908f55a277f71b8e3bc542b26f436f5217cf12c8c058f7b356d82cd4fbc1 | Python | 46,702 | 506 | ## ...........................................................................
##
## PIMMS (Polymer Interactions in Multicomponent Mixtures)
## Alex Holehouse, Pappu Lab, Holehouse Lab
## Copyright 2015 - 2026
## ...........................................................................
#
import numpy as np
# Def... |
a2d22d0f7abec3d05d8bc92e32fe1b95ea967aeb275aa7abcf36fb2e5ac96c67 | Python | 46,758 | 1,140 | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
General utils
"""
import contextlib
import glob
import inspect
import logging
import logging.config
import math
import os
import platform
import random
import re
import signal
import sys
import time
import urllib
from copy import deepcopy
from datetime import datetime
fr... |
beb8384be72fb8e6b83e5731e73218071518579bd3e52d080c1092022bbfa500 | Python | 46,883 | 1,264 | # -*- coding: utf-8 -*-
#
# test_topk.py
#
# Copyright 2018 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.... |
93755f1338f92d0be5a6d1a954314cbc81fd3f0c18793bc0eb48ad8c6417d415 | Python | 47,050 | 1,190 | # Class to do parallelized clustering
import os
import numpy as np
import networkx as nx
from sklearn.decomposition import PCA
from scipy.spatial import cKDTree
from scipy.stats import chi2
from yass.template import shift_chans, align_get_shifts_with_ref
from yass import mfm
from yass.util import absolute_path_to_asse... |
ca9e69de00496e67acfcff905000d261ff23d6550446ba1ddd7728a2b0b8951f | Python | 47,082 | 995 | #!/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 ... |
87c99d4b2268e66adcd32f8f709c0124f5b3624e4707cbf543dee75ad1141071 | Python | 47,139 | 978 | import argparse
import time
import timm.models
import yaml
import os
import logging
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
from braincog.base.node.node import *
from braincog.utils import *
from braincog.base.utils.criterions import *
from braincog.datasets.d... |
9c2ca0aceedd6832c1981b4fa49ca9f3b7b11604fae5a71c258810723261341f | Python | 47,201 | 1,435 | from __future__ import annotations
import operator
from typing import (
TYPE_CHECKING,
Literal,
NoReturn,
cast,
)
import numpy as np
from pandas._libs import lib
from pandas._libs.missing import is_matching_na
from pandas._libs.sparse import SparseIndex
import pandas._libs.testing as _testing
from pa... |
a2c564f4fb5caac5074234a1f3f18fcc57d2da6e35fe888b476487fed8e8e1f8 | Python | 47,304 | 1,325 | from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from functools import partial
from typing import TYPE_CHECKING, Any, Callable, cast
from typing_extensions import TypeAlias
from cali._constants import EVOKED
from ._multi_wells_plots import (
compute_burst_avg_duration_d... |
4d5b78287a677ccdb61ee245270db6561489a13c6d46b83ab2aa5c8c036d3094 | Python | 47,311 | 1,552 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 25 20:29:36 2019
@author: charleshen
@Note: The code are copyed from PyBioMed, with a minor repair
https://www.ncbi.nlm.nih.gov/pubmed/29556758
these are SMARTS patterns corresponding to the PubChem fingerprints
https://astro.temple.edu/~tua87106... |
d0a4137e31c2e9f85ca5783af7e68c179e12b9121015e887cd4ff55415721b38 | Python | 47,319 | 1,748 | """
Common type operations.
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Callable,
)
import warnings
import numpy as np
from pandas._libs import (
Interval,
Period,
algos,
lib,
)
from pandas._libs.tslibs import conversion
from pandas.util._exceptions imp... |
3d5218bb2fcb12b8147b7a8085dee06a3ee4d10a154825090c65e971e5c15d27 | Python | 47,421 | 1,257 | """
Experimental features
"""
# pylint: disable=unused-import
from functools import partial
import logging
from typing import Any, Callable, Dict, Optional, Tuple, List, Sequence, Union
import pickle
import uuid
import time
import os
import numpy as np
from .cons import backend, dtypestr, rdtypestr, get_tn_info
fro... |
a715705425b97d4cfa843b7106f19a003f364b5346d7dedc173b07cacdffc216 | Python | 47,474 | 1,198 | """Defines plotting functions used for analyzing data.
See ``examples/analysis`` for examples of how to use.
"""
import glob
import json
import os
import pickle
import sys
import warnings
import matplotlib.colorbar as cbar
import matplotlib.colors as mplcolors
import matplotlib.pyplot as plt
import matplotlib.ticker... |
00eec93c2cfafa068dd6d8552d73019ed1260cf55816014d1b5a0ceb5fec6a75 | Python | 47,552 | 1,361 | import re
from functools import partial, reduce
from math import gcd
from operator import itemgetter
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Pattern,
Tuple,
Union,
)
from ._loop import loop_last
from ._pick import pick_b... |
31c2dc5847ff3bbd6d08a452f03ff43d1e369d1f7a734878495f40623612ac12 | Python | 47,642 | 1,138 | # 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.
"""
Rules must be provided to Parser as a single strings, one string for each rule.
All whitespace is treated only as a separator for symbols, so spaces or tabs are
fine.... |
61b7ab9e5a46659a8a9dfcd949f27cd787c835c6bc7227198949418f250fc9a3 | Python | 47,644 | 1,123 | """distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
import sys, os, re
from distutils.errors import *
from distutils.spawn import spawn
from distutils.file_util import move_file
from distutils.dir_util import mkpath
from distuti... |
79f07fe1e30acf4939a68bd7c6b6e474debeac12c1c5f3f36bd170c6fe121bee | Python | 47,702 | 1,289 | """
Quantum circuit: MPS state simulator
"""
# pylint: disable=invalid-name
from functools import reduce, partial
from typing import Any, List, Optional, Sequence, Tuple, Dict, Union
from copy import copy
import logging
import types
import numpy as np
import tensornetwork as tn
from . import gates
from .cons import... |
1399669f653966044836af7bea61c55d29fe4804e0c361afac7993d7ee1a55aa | Python | 47,996 | 1,029 | #!/usr/bin/env python2.7
"""
relion_it.py
============
Simple GUI to set up RELION-4.0 schemer.
Authors: Sjors H.W. Scheres & Colin M. Palmer
Usage:
relion_it.py [extra_options.py [extra_options2.py ....] ] [--nogui]
To get started, go to the intended location of your RELION project directory and make sure yo... |
b6636f1e4e1d7069eb67cd44039506b4faba2dd49ad18eb8c90e4ccc866828ff | Python | 48,343 | 1,327 | from datetime import (
datetime,
timedelta,
)
import inspect
import numpy as np
import pytest
from pandas._libs.tslibs.timezones import dateutil_gettz as gettz
from pandas.compat import (
IS64,
is_platform_windows,
)
from pandas.compat.numpy import np_version_gt2
import pandas.util._test_decorators as... |
a009b5ced3c5c25b2608a7bb94002cbff38839f4b57160eef5b34191ebbeda7b | Python | 48,398 | 759 |
from __future__ import annotations
from typing import TypedDict
class SPDXLicense(TypedDict):
id: str
deprecated: bool
class SPDXException(TypedDict):
id: str
deprecated: bool
VERSION = '3.25.0'
LICENSES: dict[str, SPDXLicense] = {
'0bsd': {'id': '0BSD', 'deprecated': False},
'3d-slicer-1... |
f5f9c04398854300444f2fbaa6dbbaebedcfa6ef2d9fcd421924726318601362 | Python | 48,456 | 1,387 | from __future__ import annotations
from collections import (
abc,
defaultdict,
)
from collections.abc import (
Hashable,
Iterator,
Mapping,
Sequence,
)
import csv
from io import StringIO
import re
from typing import (
IO,
TYPE_CHECKING,
DefaultDict,
Literal,
cast,
)
import w... |
2b112b38be31e489129c5b208afbcd06ce995ae4b10165f6f5c2a0ba4d8e110b | Python | 48,572 | 1,505 | from __future__ import annotations
from abc import (
ABC,
abstractmethod,
)
from collections import abc
from io import StringIO
from itertools import islice
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
Literal,
TypeVar,
final,
overload,
)
import warnings
import n... |
7588ab7f093df6344ffd6d51db406f533f769abaa859ebe55b765d7eef5f4390 | Python | 48,625 | 1,980 | """
This file is very long and growing, but it was decided to not split it yet, as
it's still manageable (2020-03-17, ~1.1k LoC). See gh-31989
Instead of splitting it was decided to define sections here:
- Configuration / Settings
- Autouse fixtures
- Common arguments
- Missing values & co.
- Classes
- Indices
- Serie... |
0c9f8df90ec4dbd5416385589905934785f345cc502a9b4291ee42c310a5fdac | Python | 48,650 | 1,335 | # NOTE: Please avoid the use of numpy.testing since NPYV intrinsics
# may be involved in their functionality.
import itertools
import math
import operator
import re
import pytest
from numpy._core._simd import targets, clear_floatstatus, get_floatstatus
from numpy._core._multiarray_umath import __cpu_baseline__
def che... |
1e0f9560d822fefa64ccbf8f5c115c8afd9df9fa27c9baa08c5981caee267b64 | Python | 48,763 | 964 | ### Copyright (c) 2024, Fundació Privada Institut d’Investigació Oncològica de Vall d’Hebron (Vall d'Hebron Institute of Oncology, VHIO, Barcelona, Spain).
# All rights reserved.
# This code is distributed under the Attribution-NonCommercial-ShareAlike 4.0 International license ([CC BY-NC-SA 4.0](https://creativec... |
cfecbd81434e631dee33a45767a6d39ef684100107f110e5771ac18737f59f40 | Python | 48,775 | 1,333 | from __future__ import annotations
import contextlib
import random
from typing import TYPE_CHECKING, ClassVar
import pyqtgraph as pg
from qtpy.QtCore import Qt, Signal
from qtpy.QtGui import QIcon, QStandardItem, QStandardItemModel
from qtpy.QtWidgets import (
QCheckBox,
QComboBox,
QDialog,
QDialogBut... |
9716dcbd063fddbc6edaa0c7b714935ae123642639ba47f7abfb31d23abec9cb | Python | 48,808 | 1,449 | import sys, os, argparse, pickle, copy, random, string, csv, warnings
from datetime import datetime
import numpy as np
import pandas as pd
import scanpy as sc
from tqdm import tqdm
from pathlib import Path
from scipy import linalg as LA
from scipy.spatial.transform import Rotation as R
import scipy.cluster.hierarchy as... |
661422d39757eec615f521c681779a53642a268d26fae09e646826df36bad5ae | Python | 48,841 | 1,002 | import argparse
import time
import timm.models
import yaml
import os
import random as buildin_random
import logging
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
from braincog.base.node.node import *
from braincog.utils import *
from braincog.base.utils.criterions i... |
34a171d7ae7e630230fac7fb7add7f335710d95e2dea787c24de4de068a8858c | Python | 49,068 | 1,281 | import sys
import gc
from hypothesis import given
from hypothesis.extra import numpy as hynp
import pytest
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_warns, HAS_REFCOUNT,
assert_raises_regex, IS_WASM
)
from numpy.testing._private.utils import run_threaded
fr... |
b0f80b01c579475847a47efc7465f34dd979f12ad7d0e9eff8b6e5af95aef78d | Python | 49,131 | 1,009 | import argparse
import time
import timm.models
import yaml
import os
import random as buildin_random
import logging
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
from braincog.base.node.node import *
from braincog.utils import *
from braincog.base.utils.criterions i... |
350a9c8eec451aff759f9d4c077f299db00884f42461c7d334e87d80951f64fb | Python | 49,187 | 1,356 | """A variety of tools for analyses."""
import logging
import numpy as np
import pandas as pd
import scipy as sp
from scipy import stats, signal
from src import utils
from src import simulations as sims
from src import import_data as imda
from src import paper_conf as pc
from src.model import hierarchical as hie
logg... |
609d8f66e15c4cf2f81604841ff6888470a37d2c9255e9d98ddfad3b5b1084fd | Python | 49,275 | 1,011 | import argparse
import time
import timm.models
import yaml
import os
import random as buildin_random
import logging
from collections import OrderedDict
from contextlib import suppress
from datetime import datetime
from braincog.base.node.node import *
from braincog.utils import *
from braincog.base.utils.criterions i... |
5ea6de7da7008434f8cebfedae76c0d79798f2f74ae064e08609af506ac433fe | Python | 49,430 | 1,403 | #!/usr/bin/env python
# Copyright 2015-2021 Nir Cohen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
1d1cd904ad9f9bd7668bb39c06296356d41d77a73e716b0265c1cb15189b968d | Python | 49,443 | 1,448 | from __future__ import annotations
from collections import defaultdict
from copy import copy
import csv
import datetime
from enum import Enum
import itertools
from typing import (
TYPE_CHECKING,
Any,
Callable,
cast,
final,
overload,
)
import warnings
import numpy as np
from pandas._libs impor... |
134f17aa6b644e8e77566bfe8390a14c4278806656e19df8dc269ca0f17332bc | Python | 49,566 | 1,012 | import time
import os
from os.path import dirname, abspath
import sys
import shutil
import warnings
import numpy as np
from collections import namedtuple
import json
import h5py
from tqdm import tqdm
import torch
from torch import optim
from torch.utils.data import SubsetRandomSampler, DataLoader
from torch.utils.tens... |
8de597aa9508127ca03b40709c775064db28941baca31bd148d9dd81a0a7b941 | Python | 49,657 | 1,422 | from datetime import (
date,
datetime,
)
import itertools
import re
import numpy as np
import pytest
from pandas._libs.internals import BlockPlacement
from pandas.compat import IS64
import pandas.util._test_decorators as td
from pandas.core.dtypes.common import is_scalar
import pandas as pd
from pandas impo... |
337f762559637db7bb5e4a63083ee9007af2092aae8cdec9a434ea9be61c2ea2 | Python | 49,909 | 868 | import numpy as np
from skimage.morphology import skeletonize, binary_closing, binary_dilation, binary_erosion, rectangle
from skimage.draw import line
from scipy.spatial import distance
def create_even_scribbles(ground_truth, max_perc=0.2, margin=0.75,
rel_scribble_len=False, scribble_width=... |
55ef770fcf46d0677f73fb72e0ee21d947c51e0e19a06f6e52ad200adfe90051 | Python | 50,001 | 1,364 | ###########################################################################################
# Implementation of MACE models and other models based E(3)-Equivariant MPNNs
# Authors: Ilyes Batatia, Gregor Simm
# This program is distributed under the MIT License (see MIT.md)
###############################################... |
9efce99eca13cd42e3d66d29cd1e77c5129dac8925fe0a8d92dffb16a49f1d18 | Python | 50,215 | 1,427 | """ test parquet compat """
import datetime
from decimal import Decimal
from io import BytesIO
import os
import pathlib
import numpy as np
import pytest
from pandas._config import using_copy_on_write
from pandas._config.config import _get_option
from pandas.compat import is_platform_windows
from pandas.compat.pyarro... |
b4dc44efeeecd289589d4d12f792773f7c2823fc02f157d47baeeff2ff5852fd | Python | 50,352 | 1,349 | ###########################################################################################
# Elementary Block for Building O(3) Equivariant Higher Order Message Passing Neural Network
# Authors: Ilyes Batatia, Gregor Simm
# This program is distributed under the MIT License (see MIT.md)
################################... |
06d2d75e975e469264f290feb60835a58654a5fada164d8f28e4d32f1040f3b4 | Python | 50,617 | 1,668 | from rdkit import Chem
import torch
import networkx as nx
def ATOMIC_NUMBER():
return [
# Alkali Metals (1 electron in the valence shell)
1, 11, 19,
# Alkaline Earth Metals (2 electrons in the valence shell)
12, 20,
# Transition Metals (various numbers of electro... |
0e7de03f972c4266c05d273fdc8322cbd9b9e20c57a24dc8f4cd7085f6367d9f | Python | 50,725 | 1,462 | from __future__ import annotations
import re
from typing import TYPE_CHECKING, cast
import numpy as np
import pyqtgraph as pg
from sqlmodel import Session, col, select
from cali.plot._util import disconnect_hover_handlers
from cali.sqlmodel._model import (
FOV,
ROI,
AnalysisSettings,
CaliResult,
... |
a95ec650a51045e2d8471bd8c029c4adba9e3f85a4f43fd9b38c6e4eb75caafa | Python | 50,837 | 1,604 | """
Converter from TensorCircuit to PyZX.
Includes graph preparation and reduction utilities.
"""
from __future__ import annotations
from collections import defaultdict, deque
from dataclasses import dataclass, field, replace
from fractions import Fraction
from numbers import Real
from typing import Any, Dict, List, O... |
909a58a9683813e0fcf4739772e7eab991f4feb3c545b81b9990142f28290e75 | Python | 50,984 | 1,748 | from __future__ import annotations
import functools
import itertools
from typing import (
Any,
Callable,
cast,
)
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import (
NaT,
NaTType,
iNaT,
lib,
)
from pandas._typing import (
ArrayLike,
... |
c685c1a15193a129650ec5875379c140948140b84964184ca40fdb7a66170c74 | Python | 50,994 | 1,605 | """
==================================================
Legendre Series (:mod:`numpy.polynomial.legendre`)
==================================================
This module provides a number of objects (mostly functions) useful for
dealing with Legendre series, including a `Legendre` class that
encapsulates the usual arit... |
fa434cd62a1e4b8f3a6b6e43ac022493e2095426aff45605fbb4296598747ca6 | Python | 51,044 | 1,395 | from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
import pyqtgraph as pg
from cali.logger import cali_logger
from cali.plot._util import disconnect_hover_handlers
from cali.sqlmodel._model import (
ROI,
CaliResult,
DataAnalysis,
FOVAnalysis,
Traces,
)
if TYPE... |
964674dd37330b7cae91ca6d71e1fbd20a4ae17df6937b1e77a857c1ec82acc7 | Python | 51,324 | 1,486 | """Test CSV export functionality."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pandas as pd
import pytest
from sqlmodel import Session, col, create_engine, select
from cali._constants import (
CALCIUM_DEN_DFF_CORRELATION,
CALCIUM_DFF_CORRELATION,
DEN_DFF_TRACES,
DFF_... |
63a2dd0c83959d6a0b95ca9523c78ba11c12e1382934d462a6bd10fbdd056ccd | Python | 51,335 | 1,478 | """ test positional based indexing with iloc """
from datetime import datetime
import re
import numpy as np
import pytest
from pandas.errors import IndexingError
import pandas.util._test_decorators as td
from pandas import (
NA,
Categorical,
CategoricalDtype,
DataFrame,
Index,
Interval,
... |
cf998f18d9f1bf99cd9693c98837976ed75444041e5c879d76c2b33ddfb73961 | Python | 51,434 | 1,419 | from datetime import datetime
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.base import _registry as ea_registry
from pandas.core.dtypes.common import is_object_dtype
from pandas.core.dtypes.dtypes import (
CategoricalDtype,
DatetimeTZDtype,
IntervalDt... |
09f3d9bf37a1ef3b94aa9af3dd2f3dfed6a32c15cdb89aa6fbdec76b7c1219da | Python | 51,584 | 1,401 | """Signal quality metrics and channel pruning functionality."""
from __future__ import annotations
import logging
from functools import reduce
import numpy as np
import pandas as pd
import xarray as xr
from numpy.typing import ArrayLike
from scipy import signal
from scipy.stats import gaussian_kde
from scipy.stats im... |
35a5e65ec293edbf4e4780beb3ce200d45a71bc29356d5209d5b33fb781731ea | Python | 51,669 | 1,287 | import sys
import pytest
import operator
import numpy as np
from numpy.testing import assert_array_equal, assert_raises, IS_PYPY
from numpy.testing._private.utils import requires_memory
COMPARISONS = [
(operator.eq, np.equal, "=="),
(operator.ne, np.not_equal, "!="),
(operator.lt, np.less, "<"),
(ope... |
c64c7bea4a71586ed92ba85c4c46f47ad965160e7fb92cb474ba353ba91fba02 | Python | 51,721 | 1,406 | import csv
from io import StringIO
import os
import numpy as np
import pytest
from pandas.errors import ParserError
import pandas as pd
from pandas import (
DataFrame,
Index,
MultiIndex,
NaT,
Series,
Timestamp,
date_range,
period_range,
read_csv,
to_datetime,
)
import pandas._... |
02b32f4de1c0ec412b83347bdd03207d3f47144542393dfe842bd10a4fe61262 | Python | 52,198 | 1,559 | """Export calcium imaging analysis data from database to CSV files.
This module provides efficient methods to export various data types from the
database to CSV format, including traces, correlation matrices, and more.
"""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, ... |
96da368d845c495337fcfb8a9b7adb6d8907a7878c6ce557dd548eeab1e606b7 | Python | 52,202 | 1,617 | """
=================================================
Power Series (:mod:`numpy.polynomial.polynomial`)
=================================================
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmeti... |
71ed0f3a549ba904eabe47172c89fbbfb1aab6611ac5cdc9d7199a683f1511fc | Python | 52,208 | 1,642 | """
===================================================================
HermiteE Series, "Probabilists" (:mod:`numpy.polynomial.hermite_e`)
===================================================================
This module provides a number of objects (mostly functions) useful for
dealing with Hermite_e series, including... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.