sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8773a7ec212c0368b543def1a0f40b822be4c617a55bf6eb922d11aafddd762b | Python | 36,285 | 1,133 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 31 14:05:26 2023
collection of utility functions for paper
@author: Simon Kern
"""
import datetime
import inspect
import itertools
import json
import os
import random
import re
import warnings
from pathlib import Path
from types import ModuleType
import compress_pickle
... |
fee848561a01992586411beb3e790a6337b14098d3a1d8accda0c38548cc6633 | Python | 36,292 | 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._config import is_nan_na
from pandas._libs import (
NaT,
algos,
lib,
)
from pa... |
d0ac6b101719e1b445bde5adecf48828f9df5c188d48e7156f916afd5a184ee5 | Python | 36,339 | 810 | """Correctness tests for SAC: autoreset/truncation handling, replay-buffer writes,
normalizer statistics, warmup accounting, exit paths, and the benchmark harness."""
import functools
import os
import sys
import numpy as np
import pytest
import torch
import yaml
try:
from gymnasium import spaces
except ImportErro... |
71f04440801f02168c08e3773b87885685e907d355fec8323ce22bd91f0657c9 | Python | 36,383 | 994 | # coding: utf-8
"""
Adapters
"""
import itertools
import logging
import os
import pickle
import re
import sys
from urllib.error import URLError
from urllib.request import urlopen
from atropos import align
from atropos.align import Match
from atropos.io.seqio import ColorspaceSequence, FastaReader
from atropos.util impo... |
eeccbfb5dd85e4976486d79b0f9ebb23801e2400423ce1d4bdbce8cb76478a27 | Python | 36,391 | 1,047 | try:
from mayavi import mlab
from mayavi.core.ui.api import MayaviScene, SceneEditor, MlabSceneModel
from mayavi.core.api import PipelineBase
from traits.api import HasTraits, Range, Instance, on_trait_change, Enum
from traitsui.api import View, Item, VGroup, HGroup
from tvtk.util import ctf
... |
5fef99731aba6fc7fc6a376c85ca14410efe3f9339e817d0d63cc308288293ca | Python | 36,420 | 1,033 | """
Uniprot to PDB structure identification and
index mapping using the SIFTS database
(https://www.ebi.ac.uk/pdbe/docs/sifts/)
This functionality is centered around the
pdb_chain_uniprot.csv table available from SIFTS.
(ftp://ftp.ebi.ac.uk/pub/databases/msd/sifts/flatfiles/csv/pdb_chain_uniprot.csv.gz)
Authors:
Th... |
68cc22407368fbec18fe3965885291547fcf29fdeb8c4a5776aa2fe5f6fda1d8 | Python | 36,509 | 1,153 | from typing import Iterable, List, Literal, Optional, Sequence, Tuple, Union
import matplotlib as mpl
import numpy as np
import pandas as pd
import seaborn as sns
from anndata import AnnData
from matplotlib import cm
from matplotlib import pyplot as plt
from matplotlib import rcParams
from matplotlib.axes import Axes
... |
cd2ca3388bc8ff0ef8c1a9ae09c4b8de2746bf65ca47208e4a7f09c8586f2d3e | Python | 36,529 | 967 | import inspect
from io import StringIO
import operator
import re
import numpy as np
import pytest
from pandas._libs._ujson import ujson_dumps
from pandas._typing import Dtype
from pandas.core.dtypes.common import (
is_bool_dtype,
is_float_dtype,
is_integer_dtype,
)
from pandas.core.dtypes.dtypes import N... |
4e5f499b0b212598d825648253a5cf285c12fd495669f02f1dd1d744b95396c7 | Python | 36,585 | 905 | # Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# 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... |
20bdcda73ef3276a84c4528d93cbdb3c0937967b7f6fcb533c55184e5a344825 | Python | 36,615 | 850 | # Copyright 2026 Xanadu Quantum Technologies Inc.
# 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 agre... |
bb8039275b0c8c508e4d2f141883b48ab85fca6215dba98b746583331e353ac5 | Python | 36,620 | 1,177 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Implementation of control algorithms and strategy optimizers.
Created on Mon Oct 26 12:56:30 2020
@author: jeanbaptiste
"""
import gc
import tensorflow as tf
import numpy as np
from .models import split
from .data import gaussian_img
class _Controller:
"""
... |
1d6526d5fcfbeff6fe90f391ec5377b445e3ff15d6b510a6257d7dbcc07bd42e | Python | 36,688 | 1,094 | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any, Dict, List
import numpy as np
import pymc as pm # type: ignore
import scipy.stats as stats
import xarray as xr
from pcntoolkit.math_functions.basis_function import BsplineBasisFunction
from pcntoolkit.math_functions.facto... |
ce778700b3bd0fb22572ac51ede2b5aa69e7c792070b3b8552bdbfa7c96d5c9a | Python | 36,704 | 943 | # Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# 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... |
f0f563c22a910cbe68e56b271762d1e10275cfe4a955f60e09b6ae5f1b486d92 | Python | 36,708 | 1,255 | from functools import partial
from itertools import product
from string import ascii_letters
import numpy as np
from pandas import (
NA,
ArrowDtype,
Categorical,
DataFrame,
Index,
MultiIndex,
Series,
Timestamp,
date_range,
period_range,
to_timedelta,
)
method_blocklist = {... |
1651ed9796556c55c0008a18d57ec0d74d14d7326a86c45ceff548c57d81dc26 | Python | 36,722 | 1,034 | # Copyright 2022 Xanadu Quantum Technologies Inc.
# 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 agre... |
f6973cea4bfb6eb75a1c978ad6694188c6fa6d0906411be562b6a03ce1a6565f | Python | 36,744 | 990 | from datetime import (
UTC,
datetime,
timedelta,
timezone,
)
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.tseries.offsets import (
BMonthEnd,
Minute,
MonthEnd,
)
START, END = datetime(2009, 1, 1),... |
2817ce82dde8093c64627eab4c2909bc70452657208e39af42106dee889212a3 | Python | 36,747 | 799 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
693cc6af68915c033c3a5b8cb2c29d3a3b8f47bd62bd2d87f9cc0c5847ca5c9d | Python | 36,749 | 888 | # Copyright 2026 Xanadu Quantum Technologies Inc.
# 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 agre... |
b1820c180ea46eeca9ea70841987b68b17681244b0ae2a009ac28e91645386e2 | Python | 36,771 | 1,019 | from __future__ import annotations
import re
import sys
import unicodedata
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import (
ArrowDtype,
)
import pandas as pd
import pandas._testing as tm
pa = pytest.importorskip("pyarrow")
from pandas.core.arrays.arrow.array import ArrowExtensionArray
... |
eddc9cb38980310cda2c977ee508bdde1cae4a6abd8582712e1003e1ab484b87 | Python | 36,775 | 1,261 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module is dedicated to loading, formatting, and feeding data for
training the encoder-decoder network. The Normalization object is also
used during experiments to normalize data on the fly.
Created on Sun Sep 26 19:46:40 2021
@author: jeanbaptiste
"""
import os
... |
00316bcfeefd5250a78800e1a1062b0ac93ce6ee7d4428045f32d05446d56af3 | Python | 36,803 | 1,402 | from __future__ import annotations
from io import (
BytesIO,
StringIO,
)
import os
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.io.common import get_handle
from pandas.io.xml import read_xml
# CHECKLIST
# [x] - Val... |
ec175b33c8acaee41163cce436f65351215cb1c8a2ae1e7b8a996b9cb663aa8e | Python | 36,886 | 991 | from datetime import (
UTC,
datetime,
timedelta,
timezone,
)
import numpy as np
import pytest
from pandas.compat.numpy import np_version_gt2_6
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.tseries.offsets import (
BMonthEnd,
Minute,
... |
4ffe5d8628e3613d5d53be00454fffea043405595dd6897b8779325d50bdf365 | Python | 36,923 | 851 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
ef3f34e71efa46763ed22e077495b7948ebbf6417f8ac7cb8cbe7d26080fc896 | Python | 36,960 | 1,151 | # -*- coding: utf-8 -*-
"""MRI applications.
"""
import numpy as np
import sigpy as sp
from sigpy.mri import linop, nlop
from sigpy.mri.dims import *
__all__ = ['SenseRecon', 'L1WaveletRecon', 'TotalVariationRecon',
'JsenseRecon', 'EspiritCalib', 'HighDimensionalRecon',
'ModelDiffRecon']
def _... |
a609a9ed45fb8a29e540bf8da4e2a570b78b172352b1d5d2fc7b86d33ca7072b | Python | 36,972 | 923 | # Copyright 2018-2025 Xanadu Quantum Technologies Inc.
# 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... |
cbf133b4f59c0f3358df6c3d1204219faa869b1014c2d84911ce4ab18c460661 | Python | 36,972 | 904 | # Copyright 2018-2022 Xanadu Quantum Technologies Inc.
# 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... |
a2ac32c72edaf4a974726893a71aca5a6b7af4a81c910448a192be01f33c7ecf | Python | 36,999 | 933 | """Algorithms for longitudinal (velocity-centile) modelling.
This modules has the mathematical implementation of the correlation matrix,
thrivelines and conditional forecasting.
"""
from __future__ import annotations
import math
import warnings
from collections import defaultdict
from typing import TYPE_CHECKING
im... |
8f8d428dd1581a95570604b2835fd43471345ecd02d250ba8fe18e7b8f8f0752 | Python | 37,095 | 881 | import h5py
import math
import numpy as np
import os
import scipy
from abc import ABC, abstractmethod
from sklearn.model_selection import LeaveOneOut
from scipy.ndimage import binary_dilation
from scipy.io import loadmat
from typing import Optional, Tuple, List, Dict, TypeAlias, Callable, Union
from functools import pa... |
f04ec5cac308a6262f2c6b98413e9455c7222e1ab24f23c91fd0110531fae303 | Python | 37,095 | 1,307 | # Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT
import functools
import inspect
import traceback
import warnings
from collections.abc import Callable, Mapping
from copy import deepcopy
from enum import En... |
3b4958489e32ec5e0eea2455c77bd69cfcefbad3ea6f88e826cce2701077a692 | Python | 37,105 | 1,109 | from __future__ import annotations
from collections import defaultdict
from copy import copy
import csv
from enum import Enum
import itertools
from typing import (
TYPE_CHECKING,
Any,
cast,
final,
overload,
)
import warnings
import numpy as np
from pandas._libs import (
lib,
parsers,
)
im... |
569b200e1524e0c733c4a763a6886d0e18ee91ac15ad167d5315fea7eb559059 | Python | 37,108 | 943 | from typing import Union
from pathlib import Path
import lmdb
import subprocess
import string
import json
import os
from os import path
import pickle as pkl
from scipy.spatial.distance import squareform, pdist, hamming, cdist
import numpy as np
import torch
from torch.utils.data import Dataset
import pandas as pd
fro... |
9f19d5115e8de34b9e521b8062189d9be954f31b33cd509e2b0e6308411af293 | Python | 37,116 | 975 | """
This is the main script you should call to train and test UrsoNet
Copyright (c) Pedro F. Proenza
Licensed under the MIT License (see LICENSE for details)
------------------------------------------------------------
Usage: Check README
"""
import os
import numpy as np
import os.path
import skimage
import pandas... |
ae6f603406af29b13aa44bc44f41572c3329bd1a0532fef3388290a2584a115e | Python | 37,122 | 1,028 | #!/usr/bin/env python3
"""Check that options and subcommands are correctly registered.
Run with scripts/lint.py
## Summary
Reads the options within the helptext (help_<command>() function),
the long_options[] array, the getopt_long() string, and the switch(c)
block, and checks that they are consistent with each othe... |
926a78bfcf30416eb48933b9febae06dd67e30270dc60f1f8f09c571d0e44334 | Python | 37,150 | 758 | ######################
### Import Library ###
######################
# my library
from statistics import harmonic_mean
from molgraph.dataset import *
from molgraph.benchmark import *
from molgraph.gineconv import * # used modified version from torch_geometric
# standard
import numpy as np
import copy as copy
# pytorch... |
64ba54e839f7023b47aac706d41639d061e0e80435e51a9cfafe92d7b6faae72 | Python | 37,168 | 678 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
75fbfb52604af0484bba28ed1f491eb251acd9f65e867dceb95c9a78244a10e1 | Python | 37,180 | 1,053 | import gc
import importlib.util
import json
import os
import subprocess
import sys
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import Mock
import pytest
import torch
from pyaging.models import pyagingModel
REGISTRY_FIELDS = (
"clock_name",
"data_type",
"species",
"ye... |
734fb2d606d868369a7fe766097f1c82f39a4dafe46fe21ae39141828f638738 | Python | 37,220 | 1,018 | """Test cases for Series.plot"""
from datetime import datetime
from itertools import chain
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_ax_scales,
_check_axes_shape,
_check_co... |
ec62f824116168b38e445e96fdbe2862f3748f8d035c0a9aebb78db3f4bfffd4 | Python | 37,242 | 1,014 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
0c4b05e3eabed1ba3f1a78b0a83906d8e704f04a43e6242d273f2fd3c8335f67 | Python | 37,255 | 1,104 | from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
)
import numpy as np
from pandas._libs import index as libindex
from pandas.util._decorators import set_module
from pandas.core.dtypes.common import is_scalar
from pandas.core.dtypes.dtypes import Ca... |
0b8bb77bd76736bb952a9142ee3d0a4760d3c21173eec3fd0484750087051eb4 | Python | 37,282 | 1,104 | """
The tests in this package are to ensure the proper resultant dtypes of
set operations.
"""
from datetime import (
date,
datetime,
)
import operator
import numpy as np
import pytest
from pandas._config import using_string_dtype
from pandas._libs import lib
from pandas.errors import Pandas4Warning
import ... |
61de78c33d3dbf1c1080a563e65b8c16a07f8ec07407e025670340ca5345ad8e | Python | 37,318 | 1,332 | # cython: language_level=3
# Time-stamp: <2024-10-04 15:09:10 Tao Liu>
"""Module Description: statistics functions to calculate p-values
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
# ---------------... |
874937685206c5437c486b8a4c08d6bb041d5c61800b2d7423395ba682c5b650 | Python | 37,331 | 964 | __all__ = ["GlycoPeptideSpectralLibraryBase"]
import abc
from typing import Iterable, List, Optional
import numpy as np
import pandas as pd
from ...util.collections.list import index_ragged_list
from ..common.rtlib import RetentionTimeLibraryBase
from ..common.speclib import Columns, Indices, SpectralLibraryBase
fro... |
71fe90d409d722b2e17e1347be71283b1c03fc084939b22eba162b8a0fdc695d | Python | 37,338 | 984 | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# 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... |
185e945d3ffbdf902b0a4af0485d14479cc37fe09a86c36c7174f2d614286a63 | Python | 37,406 | 1,110 | from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Literal,
Self,
cast,
)
import numpy as np
from pandas._libs import index as libindex
from pandas.util._decorators import (
cache_readonly,
set_module,
)
from pandas.core.dtypes.common import is_scalar
from pandas... |
6ea46c4d7abf68fef5d1277885872f5e7300e7ecbf6dd7a8ec272d275394ab8a | Python | 37,410 | 1,071 | # coding: utf-8
"""Sequence I/O classes: Reading and writing of FASTA and FASTQ files.
TODO
- Sequence.name should be Sequence.description or so (reserve .name for the part
before the first space)
"""
import sys
from atropos import AtroposError
from atropos.io import STDOUT, xopen
from atropos.io.compression import ... |
ec9ac28a46691c89e821bbaeff6cc788c5f1a67620f2329f4ed2bf234dadb52f | Python | 37,426 | 747 | # Copyright (c) 2021-2023, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... |
fa629a062b4849651eb10e3161e5d5052e3a1ad5e7604678399a56e3a850cb54 | Python | 37,452 | 840 | # Copyright (c) 2018-2023, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... |
9f8b08853d5792c621f45ae5a7600a817ef4e2381a87cd8b04b8dea035c43fde | Python | 37,528 | 1,023 | """Test cases for .hist method"""
import re
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_ax_scales,
_check_axes_shape,
_check_colors,
_check_legend_labels,
_check_patches_all_filled,
_check_plot_works,
... |
cd48465ed83e5dff1fefffd361c4b9ed5342572f0b4b06f01c44c28816ef25b2 | Python | 37,544 | 923 | # Copyright 2025 Xanadu Quantum Technologies Inc.
# 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 agre... |
292cd76c0a93dd0699ab22ec6b15cda76e873eabca1695d2b4f09fe445ef6977 | Python | 37,566 | 1,079 | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# 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... |
46fe079fea58eb8c77f1387ac8e6be4599b2e43f4eb31561d4f7270accc6f490 | Python | 37,620 | 1,059 | import argparse
import logging
import os
import shutil
import sys
import warnings
from typing import Optional
from . import __version__
from .config import BAM_GENE_TAG
from .logging import logger
from .preprocessing import CONVERSION_COMPLEMENT
from .technology import STRAND_MAP, TECHNOLOGIES_MAP, detect_strand
from ... |
362573087963acf170f997c76fdb4022d3d4ce5b10df52a46c4638a270d27239 | Python | 37,648 | 1,051 | # Copyright 2018-2022 Xanadu Quantum Technologies Inc.
# 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... |
cdfb685ccc29f1c3ab2276aef81e36bbbc869f29c9fbdafe655f1ded9062451d | Python | 37,695 | 958 | import datetime
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
@pytest.fixture(
params=[
"linear",
"index",
"values",
"nearest",
"slinear",
"zero",
"quadratic",
"cubic",
... |
abb6c71f962dfe189354ba9d8c9dfb37970d046cebb8a049df434c739fce717a | Python | 37,712 | 1,161 | """
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 as pd
import pandas._testing as tm
def tests_value_counts_index_names_category_column():
... |
de6f23b857a78c1a84cbfe50c64160963ec95391bc1bbda74211a4972af04484 | Python | 37,809 | 760 | from __future__ import division
from __future__ import print_function
import time
import argparse
import pickle
import os
import datetime
from tqdm import tqdm
from pathlib import Path
import itertools
import math
import warnings
warnings.filterwarnings("error")
import torch
torch.set_num_threads(4)
torch.set_def... |
dd6191335efd1a89534a02ac3c76c55c7cddba8f8ea86837568d5e0988275761 | Python | 37,817 | 996 | from __future__ import annotations
from datetime import datetime
import weakref
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas.compat import PY315
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.common import (
is_integer_dtype,
is_numeric_dtype,
)
fr... |
c1469c6e54be789332055899403c7e3f5a11e34c8bfa01f9af4c9e0fc401a4ac | Python | 37,821 | 1,131 | # Copyright 2025 Xanadu Quantum Technologies Inc.
# 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 agre... |
6de2196ac3b0b25feb6601c8b29e791600d69332203783647e2e3a00e9bef427 | Python | 37,835 | 1,121 | """
Tests date parsing functionality for all of the
parsers defined in parsers.py
"""
from datetime import (
datetime,
timedelta,
timezone,
)
from io import (
BytesIO,
StringIO,
)
import numpy as np
import pytest
from pandas._libs import lib
from pandas.errors import Pandas4Warning
import pandas... |
6fa48a85390cdcf5013b10ebc88106175172d1bc7ae9da4d3b150082fea048b7 | Python | 37,859 | 1,241 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module contains the class definitions for the different types of
experiments we might want to run. They do not directly implement acquisition
routines like move to xy, snap image, change channel etc..., they use
the series module to do that. They are more to set ... |
e3faeb3854df036f67e4e381cdb246511627379bf632dc21dd363d16ea052789 | Python | 37,883 | 1,116 | import argparse
from typing import Union, Sequence, Optional, Tuple
from .formatters import CommandHelpFormatter, MainHelpFormatter
from .. import __version__, __url__
from .docs import rst, not_doc, doc_mode, show_link, prepare_parser_for_sphinx
# parents parsers
def build_parser_training() -> argparse.ArgumentPar... |
13cd79529557b7a6be4dd6447369e763c69ca198b74963c5fa5be729ada0f464 | Python | 37,891 | 899 | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# 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... |
2eea09ff21634c7dd8e4bac8edff1ec4421b19b7fad25e23d5c6846409b6ed05 | Python | 37,919 | 1,079 | """implement the TimedeltaIndex"""
from __future__ import annotations
import operator
from typing import (
TYPE_CHECKING,
Self,
cast,
)
import warnings
from pandas._libs import (
index as libindex,
lib,
)
from pandas._libs.tslibs import (
Day,
Resolution,
Tick,
Timedelta,
Time... |
5cab437641f73d333d00c68815d279be635b39536b886fa7c936e4f0471ec8e6 | Python | 37,941 | 889 | # Copyright 2018-2024 Xanadu Quantum Technologies Inc.
# 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... |
c3a5526923e17c3213e2a0968d26da59212d657fdfcaf2be8773c6e3dbef7964 | Python | 37,986 | 1,080 | # Copyright 2025 Xanadu Quantum Technologies Inc.
# 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 agre... |
8a41b30b6d9ec75ad916387a8d842a08885b33a652e9375fdcff9e1a63e8cda9 | Python | 38,020 | 966 | import torch
import torch.nn as nn
import scipy.sparse
import numpy.random
import pandas
import numpy
import activationFunctions
from scipy.sparse.linalg import eigs
#from scipy.linalg import norm
from scipy.linalg import eig
#import matplotlib.pyplot as plt
#import seaborn
def gradCliping(grad, n):
clipingFilte... |
18afc0d0ff7b228488522da0951c43e3c41fa2677aec9e2ac01195996b286373 | Python | 38,067 | 1,076 | #!/usr/bin/env python
# Time-stamp: <2025-09-29 13:48:03 Tao Liu>
import io
import os
import pickle
import random
import string
import subprocess
import sys
import unittest
from pathlib import Path
import numpy as np
import pytest
import MACS3
from MACS3.IO.PeakIO import PeakIO
from MACS3.IO.PeakIO import (PeakConte... |
615085fdf7b703b78756dc9e6febdccc31e7d0fdab5835109fa369c4c36378cf | Python | 38,068 | 1,000 | import inspect
from io import StringIO
import operator
import re
import warnings
import numpy as np
import pytest
from pandas._libs._ujson import ujson_dumps
from pandas._typing import Dtype
from pandas.errors import PerformanceWarning
from pandas.core.dtypes.common import (
is_bool_dtype,
is_float_dtype,
... |
18b181370651fc88f31adea356b001b9f68ece0e2a30ed42455faa5a23290bcf | Python | 38,182 | 851 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 18:56:37 2020
@author: wirrbel
"""
# We begin by adding the current path to sys.path to make sure that the imports work correctly
import sys
sys.path.append('/home/wirrbel/brainrender_update_2022-01/')
import os
import pandas as pd
import numpy ... |
ac2852ba2d8645703a106822c3cdc5378b26933fc99c64286f86c2ca902692cf | Python | 38,242 | 1,077 | """
Utilities for conversion to writer-agnostic Excel representation.
"""
from __future__ import annotations
import functools
import itertools
import re
from typing import (
TYPE_CHECKING,
Any,
cast,
)
import warnings
import numpy as np
from pandas._libs.lib import is_list_like
from pandas.util._excepti... |
5824d0e86c5c7b56457990d27cc153b53e930ce6e04a671b7701a6cdece17c57 | Python | 38,280 | 687 | # Copyright (c) 2018-2023, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... |
dc5bbaf4a696543ee8edf9edc9a126bc83ed93b0aae28ca04aa4780f1e9eab48 | Python | 38,292 | 981 | import torch
import torch.nn as nn
import scipy.sparse
import numpy.random
import pandas
import numpy
from scipy.sparse.linalg import eigs
#from scipy.linalg import norm
from scipy.linalg import eig
def MMLactivation(x, leak=0.01):
#x[x<0] = leak*x[x<0]
#x[x>=0.5] = 0.5 * (1 + (1./(0.5/(x[x>=0.5]-0.5) + 1)))... |
d428b8adeeb1cc50e0dbf2680fd620632d950914f1afbd5d1e5710a644cdf407 | Python | 38,320 | 1,179 | """
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 as pd
import pandas._testing as tm
def tests_value_counts_index_names_category_column():
... |
1dad8fe01bbce02b3c96b4a1d903ac5f048b050ce43830e520be679572b1a195 | Python | 38,333 | 952 | import sys
import types
from math import ceil
from types import SimpleNamespace
import pytest
# Provide a minimal cython stub when the real package is unavailable.
if "cython" not in sys.modules:
cython_stub = types.ModuleType("cython")
def _identity_decorator(*args, **kwargs):
def decorate(func):
... |
baeb343d89ca38eb066ade92e31709206ff481d267bb8e05d0c7ff2e802c0608 | Python | 38,380 | 932 | #!/usr/bin/env python3
"""
scatter: plot a scatterplot of a file of numbers. Acceptable formats:
X Y
Category X Y
X Y Weight
Category X Y Weight
Category Y (for dotplot mode only)
Re-uses sample code and documentation from
<http://users.soe.ucsc.edu/~karplus/bme205/f12/Scaffold.html>
"""
import... |
6b09bfa8a5c55fce03f058e9f2400c0e1abc10c8fd17a8c941221e5fe7495ff9 | Python | 38,402 | 898 | # Copyright 2025 Xanadu Quantum Technologies Inc.
# 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 agre... |
562094baed23b0f57fde78bf9f039e2f9f0007d01b5f6cbb2465ec24f2ee2215 | Python | 38,432 | 1,159 | """
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 warnings
import numpy as np
from numpy import ma
from pandas._... |
0c48824c34d5f289966b1d6429f195f742bff50cc6011ba09edc63549daee59f | Python | 38,470 | 813 | import pytest
from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG
import pandas as pd
import pandas._testing as tm
bday_msg = "Period with BDay freq is deprecated"
class TestFreqConversion:
"""Test frequency conversion of date objects"""
@pytest.mark.filterwarnings("ignore:Period with BDay:FutureW... |
a8ebf76d84e87c31198b0df82c0a5f4799f63fd021b4fb5e8a8ef249ea5e7950 | Python | 38,477 | 1,059 | import datetime
from datetime import timedelta
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas as pd
import pandas._testing as tm
pytestmark = [pytest.mark.single_cpu]
tables = pytest.importorskip("tables")
@pytest.mark.filterwarnings("ignore::tables.NaturalName... |
39f96068c7b1ce2371097e4e5db400657b639e03e25b638fbbf3ad47572d57bc | Python | 38,496 | 1,059 | import datetime
from datetime import timedelta
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas as pd
import pandas._testing as tm
pytestmark = [pytest.mark.single_cpu]
tables = pytest.importorskip("tables")
@pytest.mark.filterwarnings("ignore::tables.NaturalName... |
2ab36dc1cc9c352703bf4e93cd33e981f24bd6ebf5a723051e58cd773dee7e63 | Python | 38,562 | 1,086 | # Copyright 2025 Xanadu Quantum Technologies Inc.
# 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 agre... |
1fa4b628dda6792f8c040954795588b79223c793e97c7d15a443a758d049fe05 | Python | 38,629 | 872 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
#import seaborn as sns
from tensorflow import keras
import math
from ast import literal_eval
from tensorflow.keras import layers
import logomaker as lm
from sklearn.model_selection import StratifiedKFold
import sklearn
from s... |
2416f6fa7584b5050515312c5ae0160390aee590ed8da9ec82f0dfe33958ee2f | Python | 38,729 | 1,139 | import numpy as np
import pytest
from pandas.errors import (
IndexingError,
Pandas4Warning,
)
import pandas as pd
import pandas._testing as tm
@pytest.fixture
def frame_random_data_integer_multi_index():
levels = [[0, 1], [0, 1, 2]]
codes = [[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]]
index = pd.Mul... |
94f5f1d3ade7fa2449d1a53453381caada99ad7bb76d3df5f7e3ef01b9b3753b | Python | 38,732 | 883 | """MR raw data / k-space data class."""
import copy
import datetime
import os
import warnings
from collections.abc import Callable, Iterator, Mapping, Sequence
from importlib.metadata import version
from pathlib import Path
from types import EllipsisType
from typing import TYPE_CHECKING, Literal, cast
from xml.etree i... |
5985d81f353977c48d0c850358216b9119a28f1a492110926fefd00c5c1e5bd4 | Python | 38,758 | 1,037 | # Copyright 2023 Xanadu Quantum Technologies Inc.
# 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 agre... |
a7e2e127d7d26c1ef3ea178782ac764507913975ee7cfc2b919daa0a3a06816d | Python | 38,761 | 1,165 | from datetime import datetime
from io import StringIO
import itertools
import re
import textwrap
import numpy as np
import pytest
import pandas as pd
import pandas.io.formats.format as fmt
lorem_ipsum = (
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
"tempor incididunt ut labore... |
b198d3f2aaa240c2c805762baf15e17c81ddf34102e5103bb379f0e2d7762d90 | Python | 38,915 | 881 | #!/usr/bin/env python3
################################################################################
# proteomic_ruler.py 1.0.0 #
# Authors: V. Laigle (Institut Curie) #
# Contact: myproms@curie.fr ... |
edfe15ddada3ca901e12f4b0a0f1b031ffe574415cb5f9e35ee951f225a1dfe9 | Python | 38,920 | 1,124 | from datetime import (
datetime,
timedelta,
)
import re
import numpy as np
import pytest
from pandas.compat import pa_version_under21p0
import pandas as pd
import pandas._testing as tm
from pandas.core.strings.accessor import StringMethods
from pandas.tests.strings import is_object_or_nan_string_dtype
@pyt... |
77ef0990d2affaa007a87b1cf96b46569e38e873efa32bfee531682300aeb4be | Python | 39,054 | 970 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
07ba6bd181f1179530809dc3b1b8395ff34e437acd6fd7542b4c1bf39c57d403 | Python | 39,071 | 849 | # Copyright 2018-2022 Xanadu Quantum Technologies Inc.
# 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... |
a3c27efc4950f880c6046c35ba201f45c16166dcbc3d49edaa89db49c3d0752a | Python | 39,078 | 926 | """Softly gradient-coupled Resnets.
"""
import copy
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import pytorch_lightning as pl
import pytorch_lightning.metrics as metrics
import numpy as np
import pandas as pd
import functions.sgc_optim as sgc_optim
def float_interval(lower=No... |
32c76d9d7b469059c73c7a5eea18a189e7443f2c738c575953a3b9cee5c551a3 | Python | 39,107 | 1,066 | import calendar
from datetime import (
date,
datetime,
time,
)
import locale
import unicodedata
import numpy as np
import pytest
from pandas._libs.tslibs.timezones import maybe_get_tz
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.common import (
is_integer_dtype,
is_list_like,
... |
1132bc2b2db02a54f9abb69fa379df6849687fa42627cbd286945aa5c2da3d05 | Python | 39,128 | 924 | #!/usr/bin/env python
"""
Step S9 (CheckM2 branch): Short-read-based reassembly of bins.
This module performs reassembly of bins using short-read data to
improve contig structure after previous refinement steps.
"""
from Bio import SeqIO
import sys, os, threading, copy, math
from multiprocessing import Pool
def mo... |
29ceeba9ba52d7a17fbcaa5ce5881c0e90eee66a60868fd289fbbdc153c73ead | Python | 39,142 | 866 | import logging
import os
import glob
import numpy.linalg as la
#import scipy as sp
from . import surfaces
from .pointSets import *
from .surfaceMatching import SurfaceMatchingParam
from .surfaceMatching import SurfaceMatching
from . import conjugateGradient as cg, pointEvolution as evol, bfgs
from .affineBasis import g... |
ee28102194cb6e882927c0315e6a8bd414681927e820ebff4c666423aed1d5d9 | Python | 39,151 | 1,066 | """Test cases for Series.plot"""
from datetime import datetime
from itertools import chain
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_ax_scales,
_check_axes_shape,
_check_co... |
889da4fe03dc0c93fdf61c939b668128a8fb0fb78f5b4f2cfb364f686145c05b | Python | 39,153 | 1,239 | """
Looping through batches of jobs
(former submit_job.py and buildali loop)
Authors:
Benjamin Schubert, Thomas A. Hopf
"""
import abc
import inspect
import os
import signal
import subprocess
import traceback
import uuid
import re
import time
import psutil
import queue
import ruamel.yaml as yaml
import billiard as ... |
d9c44bdecadccf4775665d1662a0c064a7ca1c0b0983da58c5e0356ac6ba3205 | Python | 39,155 | 1,086 | from datetime import (
UTC,
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
class TestSeriesFillNA:
def test_fillna_nat(self):
series = pd.Series([0, 1, 2, pd.NaT._value], dtype="M8[ns]")
... |
9647b4b136a1ebb26c1f7b6b72df3256fd49a05604601b8b9d0479347d07ac9f | Python | 39,219 | 1,152 | import numpy as np
import pytest
from pandas.errors import (
IndexingError,
Pandas4Warning,
)
import pandas as pd
import pandas._testing as tm
@pytest.fixture
def frame_random_data_integer_multi_index():
levels = [[0, 1], [0, 1, 2]]
codes = [[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]]
index = pd.Mul... |
df72d8db4da86b5879d0c0d3d5c11c0f6f3230f7cd6326719623db329fd5aed9 | Python | 39,340 | 1,124 | import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
class TestDataFrameSortIndex:
def test_sort_index_and_reconstruction_doc_example(self):
# doc example
df = pd.DataFrame(
{"value": [1, 2, 3, 4]},
ind... |
544e81a80274837097eb60a0efb53db5f24e28d5f8ca275915508da0a5a64bfc | Python | 39,344 | 1,238 | from __future__ import annotations
from datetime import (
datetime,
timedelta,
)
from typing import (
TYPE_CHECKING,
Self,
)
import warnings
import numpy as np
from pandas._libs import index as libindex
from pandas._libs.tslibs import (
BaseOffset,
Day,
NaT,
Period,
Resolution,
... |
08715bea419dc7bbca6f51b61f06ef014d23ddbe1ddd96f83b6ffd32d8531cd5 | Python | 39,416 | 1,015 | from __future__ import absolute_import
import numpy as np
import random
from pprint import pprint
import inspect
import logging
import warnings
import os
import sys
import gzip
import argparse
try:
import configparser
except ImportError:
import ConfigParser as configparser
file_path = os.path.dirname(os.pat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.