sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
499b9226afd9c5e7aa8fe125c9330ec0ed7a1e54a82542ff663a0c6913e59236 | Python | 31,488 | 700 | #!/usr/bin/env python
"""Module Description: Test the bdgpeakcall subcommand
(MACS3/Commands/bdgpeakcall_cmd.py): naive peak calling on a bedGraph
score track and the --cutoff-analysis report.
Output content is checked in-process (the real argparse parser plus
``run``) on tiny bedGraphs whose expected peaks are deriv... |
fe92366d52d37972135e3d607f39191049530705f9c73a1ee10ff4d9392507f4 | Python | 31,494 | 650 | import collections
import pysam
from src.cigar_op import HyperCigar, DetailCigar
import numpy as np
from src.cluster_op import hierarchical_cluster, iterative_cluster, dbscan_cluster
from src.align_op import fetch_ref_seq
class Partition:
def __init__(self, included_hyper_cigars):
self.update_included_hy... |
fe8f2b6c9ee91e7e5638eddd6571df0318a733c614bbb9d42a7ea010069e4f8b | Python | 31,529 | 890 | """
Tests for DatetimeArray
"""
from __future__ import annotations
from datetime import timedelta
import operator
from dateutil.tz import tzlocal
import numpy as np
import pytest
from pandas._libs.tslibs import tz_compare
from pandas.compat import is_platform_windows
from pandas.compat.numpy import (
is_numpy_d... |
6bc1c14dfcc67bc743d7ddf1f3852077cc1f04ff7597a271469a01d2e94d844f | Python | 31,542 | 1,009 | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
import csv
from datetime import datetime
from inspect import signature
from io import StringIO
import os
import re
import sys
import numpy as np
import pytest
from pandas._config import usi... |
5ae0f1753192adc318fdf804277be2cdfb383015ef08df187d0e24d8d99daff4 | Python | 31,549 | 770 | #!/usr/bin/env python
"""Module Description: Test functions of the randsample subcommand
(MACS3/Commands/randsample_cmd.py), called directly and through
``macs3 randsample``.
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 ... |
298af4dd1707b18619bbe9aa5d67a161c74237795b610622fcbde07a3b964c75 | Python | 31,555 | 1,009 | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
import csv
from datetime import datetime
from inspect import signature
from io import StringIO
import os
import re
import sys
import numpy as np
import pytest
from pandas._config import usi... |
5c721f4825580bea13894ca8c591f20b21e0fa4e86492e6004c8e5b64637a209 | Python | 31,563 | 931 | #!/usr/bin/env python
# Time-stamp: <2025-09-29 15:04:42 Tao Liu>
"""Module Description: Test functions to calculate probabilities.
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).
"""
import unittest
from ... |
25c889f520bf5bf7ab16703b3ff596ae47e9f3e1334874e89e21cce314f95c67 | Python | 31,593 | 812 | # 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... |
bbe595d69c717642a245a6ea720f6c9f25f3f3f484895efb5ed606209ad6ed93 | Python | 31,596 | 666 | """
Created on Aug 6, 2022.
Training_Valid_DP.py
@author: Soroosh Tayebi Arasteh <soroosh.arasteh@rwth-aachen.de>
https://github.com/tayebiarasteh/
"""
import os.path
import time
import numpy as np
from tensorboardX import SummaryWriter
import torch
import torch.nn.functional as F
from sklearn import metrics
from opa... |
67dba1484b025ddf2e8a0cbe9ab00d40c717cf93ae18116150df72d9507e5b12 | Python | 31,614 | 966 | import numpy as np
import pytest
from pandas.core.dtypes.common import ensure_platform_int
import pandas as pd
import pandas._testing as tm
import pandas.core.indexes.range as range_module
from pandas.core.indexes.range import min_fitting_element
class TestRangeIndex:
@pytest.fixture
def simple_index(self):... |
811a37c4828f1ac73535e5122b8cff4e227eaefc146f3539551a55777903db6a | Python | 31,640 | 928 | from datetime import datetime
from decimal import Decimal
import numpy as np
import pytest
from pandas._libs import missing as libmissing
from pandas._libs.tslibs import iNaT
from pandas.core.dtypes.common import (
is_float,
is_scalar,
pandas_dtype,
)
from pandas.core.dtypes.dtypes import (
Categoric... |
d48989e869da799cb06bbbab3c74a0601077bfdbfa664c809509f6eb65f454c2 | Python | 31,651 | 759 | #!/usr/bin/env python
"""Module Description: Test functions of the predictd subcommand
(MACS3/Commands/predictd_cmd.py), called directly and through
``macs3 predictd``.
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 distri... |
77b5a2d26f052474c50d487d56d0781b46c2ce6b0b8923236fe0532964af8284 | Python | 31,655 | 650 | """
Created on Aug 6, 2022.
main_2D_DP.py
@author: Soroosh Tayebi Arasteh <soroosh.arasteh@rwth-aachen.de>
https://github.com/tayebiarasteh/
"""
import torch
import os
from torch.utils.data import Dataset
from torch.nn import BCEWithLogitsLoss
from torchvision import models
from opacus.validators import ModuleValidat... |
791dff3f263a999dcc62aea19bb02d4fed3340d70cf1d56a38e7938939719a6d | Python | 31,776 | 672 | # 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... |
fb4d6da03bd84e22b8faab5181df649aa20a833f51a77e2d57315275600a1879 | Python | 31,785 | 874 | """Manual clustering views."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import gc
import logging
from collections.abc import Mapping
from functools import partial
from types import Mapping... |
4fc379e4693f5befd82516b220cc22fe078df6ba03061aae0da526accfeb3e7c | Python | 31,791 | 871 | #funcs.py
from blis.py import gemm # for
import numpy as np
import pickle
import os
import nbformat
import nbparameterise
from nbconvert.preprocessors import ExecutePreprocessor
from scipy.special import gamma as gammafunc
import matplotlib.pyplot as plt
import numexpr as ne
"""
Generating jupyter notebooks from a te... |
6cbf6724decb149b6709d1f8505e8910a0375de07e52cc8f0baaece97dc7c76f | Python | 31,858 | 1,054 | from datetime import (
UTC,
datetime,
timedelta,
)
import decimal
import re
import numpy as np
from numpy import iinfo
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
@pytest.fixture(params=[None, "raise", "coerce"])
def errors(request):
retu... |
6f29d839f96d30ec6f52bc5c32a3b5ee28f5accac1c1b00268300130b189724e | Python | 31,862 | 654 | # Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
e26be1b284b8be0e0e44488455ee3faf27f20ad8733655d2586fbb8488a6b361 | Python | 31,896 | 754 | """Test cases for DataFrame.plot"""
import re
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_colors,
_check_plot_works,
_unpack_cycler,
)
mpl = pytest.importorskip("matplotlib")
plt = pytest.importorskip("matplotlib.pyp... |
b102068b4a338f30384ac1e2b455db9a4b083f4c3d6b122e2fd5131a676fd442 | Python | 31,920 | 862 | # 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... |
798df1fb7503a226c0e765a62a34cdf7069c11b57b77cba4054867a75b5e219a | Python | 31,948 | 897 | from collections import deque
from datetime import (
date,
datetime,
time,
timedelta,
)
import re
import string
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.arrays impor... |
33f95d7efcb89e707ec7ada9ec4bc4993042e6c3bf03256dbd5309ac1097602a | Python | 31,952 | 960 | from datetime import datetime
import re
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.strings import (
_convert_na_value,
is_object_or_nan_string_dtype,
)
@pytest.mark.parametrize("method", ["split", "rsplit"])
def test_split(any_string_dtype, method):
... |
100b86c207fc363a808b5e1632b7b80733ec969380ab9cc743750bd6906fcda1 | Python | 32,019 | 881 | # Copyright 2018-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... |
3e7c7dadbd58a87a0e141e3f7d8c22815dad51218dad3ad1ba38f086be76eebe | Python | 32,041 | 536 | # 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... |
328e183461313c87c98aed3d7d149416f418c64b3a9fd2eb741b071626ddf836 | Python | 32,062 | 879 | #funcs.py
from blis.py import gemm # for
import numpy as np
import pickle
import os
import nbformat
import nbparameterise
from nbconvert.preprocessors import ExecutePreprocessor
from scipy.special import gamma as gammafunc
import matplotlib.pyplot as plt
import numexpr as ne
"""
Generating jupyter notebooks from a te... |
85869a78f6562b34f46e07c25563f96d629a228c7d70bdadf3637d16440627e0 | Python | 32,111 | 719 | import logging
import os.path
from collections import Counter
from copy import deepcopy
from typing import List
import json
import cv2
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tifffile
from imagesize import imagesize
from SCTrack.base import Cell
from SCTrack.tracker import Tracke... |
c692dd1d39e0cbc3c50752ab6bc5a39fe5302dc7ba3ff9c2f94f3784b91bbb1e | Python | 32,134 | 840 | # Copyright 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 agre... |
25f94c7cf5c81c31fb504a7b0766970404997363732ac3027cfc56f9ef857efe | Python | 32,157 | 707 | import ast
import gc
import json
import math
import re
import unicodedata
from datetime import date
from pathlib import Path
from urllib.parse import unquote, urlsplit
import torch
ARRAY_FIELDS = ("tissue", "platform", "predicts", "training_target", "unit")
CONTROLLED_SCALAR_FIELDS = ("data_type", "species", "model_t... |
9770a253a7669f636c857aa807b93fe09fef4255b3b8af8b2e79c978b32693f8 | Python | 32,170 | 597 | import matplotlib
from nnunet.training.network_training.network_trainer import NetworkTrainer
from nnunet.network_architecture.neural_network import SegmentationNetwork
from batchgenerators.utilities.file_and_folder_operations import *
from nnunet.utilities.nd_softmax import softmax_helper
import torch
import numpy as ... |
e25aa11ee3c8eb01cd4ba9f3e4f980cc9ca8614702d22b33649403fe281a0f93 | Python | 32,233 | 837 | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import logging
import os
import pathlib
from collections import defaultdict
from pathlib import Path
import pickle
import numpy as np
import ... |
582d165695b4154f4a0b83e62ad86350cbec2c183632c1f3394d0586f5cdc9c2 | Python | 32,235 | 805 | import copy
import json
from pathlib import Path
from unittest.mock import MagicMock
import pytest
import torch
from lightning import LightningModule, Trainer
from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor, ModelCheckpoint
from lightning_pose.callbacks import (
AnnealWeight,
JSONIn... |
23b192efe0a89cab36c2f86a097e46d42b5655254941544a533aae8565e27fb4 | Python | 32,256 | 795 | # 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... |
78cda53757d0ffcc7ff72e083694b8c5630fadc9d03e2f816e0d42f6d05fe205 | Python | 32,279 | 694 | import os
import glob
import logging
from . import curves, curve_distances as cd
from . import pointSets
from . import kernelFunctions as kfun
from . import conjugateGradient as cg, grid, matchingParam, pointEvolution as evol, bfgs
from .affineBasis import *
import matplotlib.pyplot as plt
from matplotlib import cm
fro... |
ded8729b8bb2fc0d24e8247573f222bc2ebd82661fea07e43b77ece5130a1458 | Python | 32,309 | 849 | # 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... |
6320926f7f1681cd47eb81cb59293ebf96f68167b05c6a219dcffd1b34098ad7 | Python | 32,319 | 975 | from datetime import timedelta
from itertools import product
import re
import numpy as np
import pytest
from pandas._libs.tslibs import OutOfBoundsTimedelta
from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
from pandas.compat.numpy import (
is_numpy_dev,
np_version_gt2_5,
)
from pandas.errors import Pand... |
64b9696db35ca19dc1027069d2aa270d8754038a54c1d0a80b16bb2675c37844 | Python | 32,328 | 647 | '''
Use the init function in this module to load simulation data generated
with the simrun2 module into a ModelDataBase.
'''
import os, glob, shutil, fnmatch
import hashlib
import numpy as np
import pandas as pd
import dask.dataframe as dd
import dask
import single_cell_parser as scp
import single_cell_analyzer as sc... |
1330347fd5405864e589ad247cc5d4a409c237f4380da57d4194aa9de39fa199 | Python | 32,387 | 658 | # Time-stamp: <2025-07-24 12:46:43 Tao Liu>
"""Description: Main HMMR command
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).
"""
# ------------------------------------
# python modules
# ------------------... |
7d1d8de5d0e2116659911e3213e60d6126d902561a10ed8895e092f0a5b483a4 | Python | 32,391 | 867 | # 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... |
ddb69f0ec9eff8f0b68c54570b116284981331b0d8367e689164f26188b71d8f | Python | 32,421 | 843 | #!/usr/bin/env python
import pandas as pd
import os
import scanpy as sc
import argparse
import numpy as np
from mudata import MuData
parser = argparse.ArgumentParser(description="Parameters for summary process")
parser.add_argument(
"--demuxem", help="Folder containing output files of demuxem", default=None
)
pars... |
e2e3e6fac0023852af0e2ad33c877e6bc5ea3ebccaa13a2a0a6623d1f2b2f233 | Python | 32,474 | 749 | # 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... |
62cbcd33c4d3c97b2690bd573e0128a3c3ca0b85efa452f5fa9db4a61b6b3bf6 | Python | 32,492 | 682 | # 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... |
79718b180af26960d0738973144f75ce5edfc257d352b0f770c56136b74bfac8 | Python | 32,524 | 888 | # 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... |
6ae817fac1a0537df6e33c136fa0ce23d1f5d1bf6aaa9af33414582f2c34426c | Python | 32,529 | 741 | import re
from collections import Counter
class Align:
def __init__(self, ref_chrom, ref_start, ref_end, read_start, read_end, strand, cigar, source):
self.ref_chrom = ref_chrom
self.ref_start = ref_start
self.ref_end = ref_end
self.read_start = read_start
self.read_end = r... |
a333665f72f0310ddce3c7e1c27613711673d399f9f912d0893ead90d3131d00 | Python | 32,553 | 927 | """Tests for Table Schema integration."""
from collections import OrderedDict
from datetime import (
timedelta,
timezone,
)
from io import StringIO
import json
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.dtypes import (
CategoricalDtype,
Datetime... |
c6a4f4a4a14527d87d5d6b9bbb021fcdca9ce87f96a580007f0eaf09495e93f6 | Python | 32,568 | 816 | # -*- coding: utf-8 -*-
'''
SYNTHETIC_DATA_GENERATOR_GUI
PYSIMPLEGUI BASED GUI TO GENERATE SYNTHETIC TRXYT FILES USED FOR NANOSCALE SPATIOTEMPORAL INDEXING CLUSTERING (NASTIC AND SEGNASTIC) OR 3D DBSCAN (BOOSH).
Design and coding: Tristan Wallis and Alex McCann
Queensland Brain Institute
The University of Queensland... |
b2428630ce1ef37851205941e047ee1b0de4d4e06c54ba494f72470564c35071 | Python | 32,667 | 983 | """Utility functions for NiMARE."""
import contextlib
import datetime
import inspect
import logging
import multiprocessing as mp
import os
import os.path as op
import re
from functools import wraps
from tempfile import mkstemp
import joblib
import nibabel as nib
import numpy as np
import pandas as pd
from nilearn.inpu... |
1349aedac514b00a4e4236ae7a20283611419205386642c1e0bb413065001d53 | Python | 32,726 | 927 | #!/usr/bin/env python3
"""
Given pairwise self-alignments in lastz's general format, identify palindromes
"""
from sys import argv,stdin,stdout,stderr,exit
from math import ceil
from collections import defaultdict
from copy import copy
from gzip import op... |
21787bafbe0c6aefc3798cc9d4b433ad4a29d8b8d572c8d88181d615f5abf74d | Python | 32,734 | 949 | """Pipeline registry + Deployment CRUD + in-house serving.
Three concerns in one router because they're tightly coupled:
1. **Pipelines** — a fitted pipeline that came out of a Run can be *promoted*
into a workspace-scoped `pipelines` row. Pipelines are reusable across
projects (via `pipeline_project_links`).
... |
e0dad8bf3f0d3b86a88345f7003deb2b27419679df20965132ded3170dacf577 | Python | 32,735 | 1,081 | """
This module is imported from the pandas package __init__.py file
in order to ensure that the core.config options registered here will
be available as soon as the user loads the package. if register_option
is invoked inside specific modules, they will not be registered until that
module is imported, which may or may... |
7909998c1cab61c30244cea0d81228378b70fe9a7c0b408ca720cbc144eac52a | Python | 32,739 | 1,036 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 21 09:09:39 2022
Script to run the analysis for the paper titled
"Reactivation strength during cued recall is modulated by
graph distance within cognitive maps"
@author: Simon Kern
"""
import os
import random
import time
import compress_pickle
import matplotlib.pyplot... |
a0846eb19a6823ff4e97dbc607a400db92452397a8fe04ed4953a6b760ac6e0e | Python | 32,769 | 882 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
@pytest.fixture
def df():
df = pd.DataFrame(
{
"A": [
"foo",
"foo",
"foo",
"foo",
"bar",
"bar",
"ba... |
a5788718528087f52fa4126450e8e7dd4fab3c46fc9b30e91ef47f342ce9d0a0 | Python | 32,781 | 841 | import os
import pprint
from pathlib import Path
import json
import numpy as np
import torch
from PyQt5 import QtCore, QtWidgets, QtGui
from scipy.io.matlab.miobase import MatReadError
from kilosort.gui.logger import setup_logger
from kilosort.gui.minor_gui_elements import ProbeBuilder, create_prb
from kilosort.io im... |
176a29062ca88acc2df2db18b3a0b6f7c1b42c69a4b29661afff6ad22ede645d | Python | 32,782 | 567 | # 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... |
d81f18fafa0070609c3768757c80f6c7f2dc51d0dc809f3fe4684e0d357a1be3 | Python | 32,792 | 716 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Step S5 (CheckM2 branch): Deep-learning-based outlier bin removal.
This module applies trained DL models to identify and remove
contaminated or low-quality bins, preparing cleaner binsets for
subsequent contig retrieval and reassembly steps.
"""
from Bio import SeqIO... |
f85201550b4c985c5d3b5608a43b8be25a38d0a864f6413cbc201f6a0f7dfce9 | Python | 32,794 | 941 | import json
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.io.json._normalize import nested_to_record
@pytest.fixture
def deep_nested():
# deeply nested data
return [
{
"country": "USA",
"states": [
{
... |
b39b0526519bb2474e4eac82b23047250526eb075793185403c51e849cb7672d | Python | 32,805 | 743 | from Environment_ui import *
from typing import Optional
from einops import rearrange
def drop_path(x, drop_prob: float = 0., training: bool = False):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
This is the same as the DropConnect impl I created for EfficientNet... |
c9f07adb99240bbe1bdefa776e26232cdac5a660200c126076c4534eb340c82b | Python | 32,809 | 1,013 | """Qt dock window."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import logging
from collections import defaultdict
from functools import partial
from phylib.utils import connect, emit
fro... |
3a7b9a73889e44bf5fcc47a79ce6c675cdcca20d4bd1b3a8edff87b78cee29b4 | Python | 32,869 | 889 | import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
class TestDataFrameShift:
def test_shift_axis1_with_valid_fill_value_one_array(self):
# Case with axis=1 that does not go through the "len(arrays)>1" path
# in DataFrame.sh... |
a0180f7ea2eaf101a57eeb5e4f55bce2488393b34645c7def61211a76d8022c0 | Python | 32,899 | 720 | """Non-Uniform Fast Fourier Operator."""
from collections.abc import Sequence
from functools import partial
from itertools import product
from types import EllipsisType
from typing import Literal
import einops
import numpy as np
import torch
from pytorch_finufft.functional import finufft_type1, finufft_type2
from typ... |
bb7a9b1539b4f02498dd1342fe695cbdba49e0250ec398ffa4a8c001eb402254 | Python | 32,903 | 747 | import torch
import torch.nn as nn
import torch.utils.checkpoint as checkpoint
import torch.nn.functional as F
from typing import Optional
from einops import rearrange
def drop_path(x, drop_prob: float = 0., training: bool = False):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual... |
4a00fe3deb1a0d78f3721fcb119db32fe81691f2fa5984fa3988ddbdd87035b7 | Python | 32,905 | 816 | """CBMA methods from the ALE and MKDA families."""
import logging
import multiprocessing as mp
import nibabel as nib
import numpy as np
import pandas as pd
from scipy import ndimage
from tqdm.auto import tqdm
from ...base import MetaEstimator
from ...results import MetaResult
from ...stats import null_to_p, nullhist_... |
0fa8445b0c686b43e6c86aae100c3f69e1db26656570f486ee21e05d0654cc4f | Python | 32,919 | 703 | import pandas as pd
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
import sys
from os.path import dirname, realpath
from GATmann import prepare_dataloaders, prepare_dataloaders_prism, prepare_dataloaders_allgenes, prepare_dataloaders_corrupted
from utils import create_pytorch_... |
89d6d530693cef5c4682706a06715e92a6ef133687bd7b6a4d192ceb0255cd90 | Python | 32,925 | 568 | from Environment_ui import *
from PySide2.QtWidgets import QWidget, QFileDialog, QPushButton, QLabel, QProgressBar
from PySide2.QtUiTools import QUiLoader
from PySide2.QtCore import Signal, QObject
from threading import Thread
from concurrent.futures import ThreadPoolExecutor
from torch.utils.data import DataLoader
fro... |
757dc25f060f087c311de64eed41e7ef154ed7c55f621b9e424e4346167dcfd0 | Python | 32,927 | 1,047 | """
Functions for handling evolutionary couplings data.
.. todo::
1. clean up
2. add Pompom score
3. add mapping tools (multidomain, complexes)
4. ECs to matrix
5. APC on subsets of positions (e.g. for complexes)
Authors:
Thomas A. Hopf
Agnes Toth-Petroczy (original mixture model code)
John... |
68c252e1b9493639eb98c98ed3eb58faa4fc5d1bb41aa7fad7804396258c5026 | Python | 32,986 | 1,040 | """
Concat routines.
"""
from __future__ import annotations
from collections import abc
from itertools import pairwise
import types
from typing import (
TYPE_CHECKING,
Literal,
cast,
overload,
)
import warnings
import numpy as np
from pandas._libs import lib
from pandas.errors import Pandas4Warning
... |
716cbababe607f2f739ab848219a19d2ec0ef26566ac03a4dd5776d9a83e6c62 | Python | 33,054 | 1,130 | # 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... |
fdfefd762a1a9531b6bac00ab493ee6a8a86d7f04bd54e9256ebe28d307f5f7c | Python | 33,079 | 681 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 27 14:28:10 2022|
@author: jcagle
"""
import matplotlib.pyplot as plt
import numpy as np
import os, sys
import re
import copy
import pandas as pd
from matplotlib import ticker, colors
from matplotlib.dates import DayLocator, HourLoca... |
f42f0d9bea8328cfe45392ef8e483a1d08ea2eac6249e9ebbc4190987b76c08d | Python | 33,084 | 649 | import pandas as pd
import numpy as np
import pathlib
import logging
logger = logging.getLogger(__name__)
from .peak import Peak
class Feature():
"""
Representation of an MS feature.
Can contains several peaks that are grouped together from the same sample (adduct, isotopic peak, fragment...),
mz a... |
23e1dbeeb13d3c228beca13d812288d1ca099d7cfb46f60a103a25df24d01641 | Python | 33,093 | 758 | # 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... |
3351fab10ed6f44cbdea56f8ddd0cc846228587ab96aad44d37226445f59b2c0 | Python | 33,093 | 583 |
from ...utils import PheWebError
from ...file_utils import get_generated_path, make_basedir, get_filepath, read_maybe_gzip
from ..read_input_file import PhenoReader
import os
import string
import json
import csv
import glob
import re
import itertools
import sys
import copy
import boltons.iterutils
import tqdm
import ... |
88e2b6023caf7d4ba0672d30c87ee6dbde00e653684e79193b379cab8fdd25fd | Python | 33,105 | 824 | '''
Created on Apr 28, 2012
@author: regger
'''
#from neuron import h, nrn
import numpy as np
from . import synapse
from collections import Sequence
import neuron
nrn = neuron.nrn
h = neuron.h
from itertools import chain
import single_cell_analyzer as sca
import pandas as pd
class Cell(object):
'''
Cell obje... |
fc96a4f53983e450974b1abf59075aac3ff2920cb6b7d0f5baf34c7058ae7403 | Python | 33,132 | 690 | import rdkit
from rdkit import Chem
import torch
from torch import nn
from torch.nn import functional as F
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, DataLoader
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
from utils import *
impor... |
126b58fc7bb7da75c107b0c8940e84329746c8f6686f7fad092d93186ae363f8 | Python | 33,136 | 935 | import numpy as np
import pytest
from pandas.errors import (
InvalidIndexError,
OutOfBoundsDatetime,
Pandas4Warning,
)
import pandas as pd
import pandas._testing as tm
from pandas.tests.frame.common import _check_mixed_float
class TestFillNA:
def test_fillna_dict_inplace_nonunique_columns(self):
... |
e5d2d14ea0c7a8d72c10d2cc6b622a8400b8b00e789894d4d8555d49e67d3e59 | Python | 33,153 | 830 | # 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... |
8d2792627febfb45b73c6c2a964a97ce670350f195f373e28251c872635ebe60 | Python | 33,166 | 867 | # Copyright 2018-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... |
b25d6d79a4b9197dff54965f1f9a520ea515485cf3281b4d96b2fd98fbaf348a | Python | 33,201 | 854 | # 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... |
1476285c046b6ad37467060fe892a865ca909ee835f48df763e732d97df06f85 | Python | 33,237 | 754 | # 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... |
893fdef9f0ba43b1884d97c5e9465ec26f4b759483ca023d09bce9f7d904cbed | Python | 33,334 | 935 | # 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... |
0d004eb8a402f1164113778639b0506cf9b8fdf6bcf606589970de9b20af614c | Python | 33,361 | 871 | # 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... |
2d9e2db8f97adf959b4ddbd5c2cea9f36c69a20bfd43d7ad8290e895868bb91d | Python | 33,366 | 818 | # Copyright 2018-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... |
adff8d0cffe752296aba8aac91a2003b754e45ac4feccf3ae624f31a8efbb2fa | Python | 33,407 | 1,052 | """
Concat routines.
"""
from __future__ import annotations
from collections import abc
from itertools import pairwise
import types
from typing import (
TYPE_CHECKING,
Literal,
cast,
overload,
)
import warnings
import numpy as np
from pandas._libs import lib
from pandas.errors import Pandas4Warning
... |
ea9eda92e74a6dfae0fd8daaeb235111d2c4b5d29b5a153be5c66acc1ea77dc6 | Python | 33,422 | 736 | # 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... |
85d5822455ad35b84253b1c793d233d8a23ed129bcb3f9b5e477f5ccfbf7301e | Python | 33,435 | 680 | #!/usr/bin/env python3
"""Final ADNI SBF: fresh dictionaries and validation-selected neural state.
Each invocation is one seed/round. It reads raw training and validation
imaging from a view containing no held-out-test directories, learns five new
dictionaries, projects/normalizes coefficients, and trains the repaired... |
88c2c4531af4978a90b653044f99fad223ce2121edfa7b5e651e4199ca636d51 | Python | 33,442 | 786 | """Test cases for DataFrame.plot"""
import re
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.plotting.common import (
_check_colors,
_check_plot_works,
_unpack_cycler,
)
mpl = pytest.importorskip("matplotlib")
plt = pytest.importorskip("matplotlib.pyp... |
5cc141429c70e881a6a59d7570bb317b2206b34a79a8e8b7f231dbd715765dae | Python | 33,496 | 1,009 | 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... |
2e40161b99a86c267cd3de5d63b11d117cf843a51e6814235517532920f2671c | Python | 33,515 | 861 | #! /usr/bin/env python3
"""
CIFTI connectivity wrapper
Greg Conan: conan@ohsu.edu
Created 2019-06-18
Last Updated 2019-11-26
"""
##################################
#
# Command-line wrapper for CIFTI connectivity matrix scripts.
# This wrapper can run any one or multiple of the three following scripts:
# 1. Run `cifti... |
a74e4d0eecac13fcf1dfc3b750502ddcb8b14e8810c862dd09478e38fbc03036 | Python | 33,525 | 955 | # -*- coding: utf-8 -*-
"""
Following people have contributed code and/or ideas to the current version of kCSD
Chaitanya Chintaluri[1] Marta Kowalska[1] Michal Czerwinski[1] Joanna Jędrzejewska – Szmek[1] Władysław Średniawa[1]
Jan Mąka [1, 3*] Grzegorz Parka[2] Daniel K. Wojcik[1]
[1] Laboratory of Neuroinformatics... |
2ee94613089161f93b06a0448692c86de991bcb53815183961c85a2ced5aebf4 | Python | 33,542 | 754 | import numpy as np
import pandas as pd
from scipy.sparse import coo_matrix
from scipy.sparse import csc_matrix
from tqdm import tqdm
import torch
import csv
import torch.nn as nn
import torch.optim as optim
from torch.nn import functional as F
from scipy.stats import pearsonr
from scipy.stats import spearmanr
#load dat... |
49467600c2bf83515f6ae1533f13fee6238f3d3d32eb554434c51af7edd0eac2 | Python | 33,555 | 1,098 | from textwrap import dedent
import numpy as np
import pytest
import pandas as pd
pytest.importorskip("jinja2")
from pandas.io.formats.style import Styler
from pandas.io.formats.style_render import (
_parse_latex_cell_styles,
_parse_latex_css_conversion,
_parse_latex_header_span,
_parse_latex_table_st... |
072bced90c785b6f88c1937f29734ecdc30d130e94a71d1f6a9a8b14f5b59a15 | Python | 33,655 | 682 | ######################
### Import Library ###
######################
# my library
from molgraph.simplemodel import *
from molgraph.dataset import *
from molgraph.experiment import *
# general
import math as math
from tqdm.notebook import tqdm
from tqdm import tqdm, trange
# sklearn
import sklearn.metrics as metrics
fr... |
fef38d5e750af080e663c3f29ceefd4306820a688b0d2fc03c73f00b7580e77e | Python | 33,690 | 908 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
@pytest.fixture
def df():
df = pd.DataFrame(
{
"A": [
"foo",
"foo",
"foo",
"foo",
"bar",
"bar",
"ba... |
960dc596acb72555a2f062bd378edfb8328e774bc7b5acef154bcbc74df397a1 | Python | 33,703 | 756 | #%%
from defs import *
import copy
import set_params
import set_params_preg #for pregnancy model
import flux
import numpy as np
import equations
import electrochemical
import water
from values import *
import Newton
import Newton_preg # for pregnancy model
import timeit
import boundaryBath
import time
import os
import... |
31bc16096fb81fc02d8cb50a78fb33c5c6b8fbcd2d7107303f3999a779f6c6f3 | Python | 33,718 | 684 | ######################
### Import Library ###
######################
# my library
from molgraph.graphmodel import *
# from molgraph.graphmodel_star import *
# from molgraph.graphmodel_signed import *
from molgraph.dataset import *
from molgraph.experiment import *
# general
import math as math
from tqdm.notebook impor... |
6dd72ed0e1c56fcabc5bba3394b4e5267bf10658917009a38557bbc8845b7a14 | Python | 33,718 | 927 | # Copyright 2018-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... |
b26ccddcb2bc169472927e3e8745dd9fee54dcbf0e4cad76658f1f31d17a862a | Python | 33,754 | 826 | from datetime import (
date,
datetime,
)
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.common import (
is_float_dtype,
is_integer_dtype,
)
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
import pandas._testing as tm
cla... |
b843916eb1ff446f0d0e41086de839220886b5d4feafbd5637af83c3bffa8528 | Python | 33,755 | 927 | ''' delete_cdm.py
This program will delete a sample or body ID from NeuronBridge
'''
import argparse
from operator import attrgetter
import sys
from types import SimpleNamespace
import boto3
from boto3.dynamodb.conditions import Key
import botocore
from botocore.exceptions import ClientError
import inquirer
import... |
db2e6f9808de25dd524cdd0d3f2e7f81bfb163cd19f27bce7dc042c96a1c9f84 | Python | 33,790 | 929 | import re
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
def _check_cast(df, v):
"""
Check if all dtypes of df are equal to v
"""
assert all(s.dtype.name == v for _, s in df.items()... |
3786668074c40d51944e3b79cfb6711a8d8a6e1da5a488feca64bf3513066193 | Python | 33,821 | 672 | #!/usr/bin/env python
import re,sys,os,subprocess
import argparse
from argparse import RawTextHelpFormatter
###################################################
### 0. script description and parsing arguments ###
###################################################
synopsis1 = "\
- updates '.BestHitPairs' files, fix... |
ee20169122bac2adf2d58a626f563b13dcc8195d85e00ba7afde1354743cf2b9 | Python | 33,829 | 920 | """Base class for all data classes."""
import dataclasses
from collections.abc import Callable, Iterator, Sequence
from copy import copy as shallowcopy
from typing import ClassVar, TypeAlias, cast
import einops
import torch
from typing_extensions import Any, Protocol, Self, TypeVar, dataclass_transform, overload, run... |
464ececb090a5607bab05d4adbef113527812fd432a709f359b7523c62211729 | Python | 33,924 | 958 | """Tests for Table Schema integration."""
from collections import OrderedDict
from datetime import (
timedelta,
timezone,
)
from io import StringIO
import json
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.dtypes import (
CategoricalDtype,
Datetime... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.