sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
bd2a3a6734032fd0adfe3b2bc1e50fd906759b2915077838881ec787cc4a9410 | Python | 13,661 | 457 | #!/usr/bin/python
""" This utility module interpolates all electrode grids in a strip or grid configuration.
"""
__version__ = '0.1'
__author__ = 'Xavier Islam'
__email__ = 'islamx@seas.upenn.edu'
__copyright__ = "Copyright 2016, University of Pennsylvania"
__credits__ = ["iped", "islamx", "lkini", "srdas",
... |
9eaebdb6d309991247d9f8b56ffdcfb6b3c55115cc984631fbd40069f097af1f | Python | 13,664 | 334 | # -------------------------------------------------------------------------------------------------------------------------------------
# Following code curated for GCPNet (https://github.com/BioinfoMachineLearning/GCPNet):
# ----------------------------------------------------------------------------------------------... |
4fa80a2559278f41d1e4a339e5244d477ad2b363c1ff6f848685bbaa1981d2b9 | Python | 13,670 | 293 | '''
Where it randomly selects an equal number of kernels from both datasets A
and B and then compares them.
1. For each category in Dataset A, it determines the number of selective kernels.
2. It then randomly samples the same number of kernels from both Dataset A and Dataset B for that category.
3. The selected kerne... |
ee97f2f98eeca9cb2d0fdc93aefa4e1622c4d56a07248ce7a3da5d25cc6059df | Python | 13,685 | 396 | #!/usr/bin/env python3
from src.hash_realign.classes import Segment
class HashAligner():
def __init__(self, k, windowSize, mismatchNum, repeat_thresh):
self.k = k
self.windowSize = windowSize
self.mismatchNum = mismatchNum
self.segments = []
self.selfDiffSegs = []
... |
4b748dd938bf36b8eb0c0cea2ddffde56096f34bdc8037b8ae0d870aa22972ca | Python | 13,692 | 302 | # Ported from the Isaac Lab rl_games integration (isaaclab_rl); original DexPBT
# implementation from NVIDIA-Omniverse/IsaacGymEnvs (https://arxiv.org/abs/2305.12127).
# Copyright (c) 2022-2026, The Isaac Lab Project Developers.
# SPDX-License-Identifier: BSD-3-Clause
import os
import random
import sys
import numpy a... |
2b0e1bfdcdb27a3b673a7102e552be3719e9185a1c9e9a755f3c9fee76549ea7 | Python | 13,693 | 307 | """SAC MuJoCo validation harness (envpool).
Batch-runs the SAC MuJoCo configs and reports each run's final score (mean of
the last 10 logged `rewards/step` points) against published single-environment
SAC reference bands. Battery: HalfCheetah/Ant 3 seeds x 1M frames (banded);
Humanoid 3 seeds x 1M + seed 7 extended to... |
ffe861856c58fe87d22f71b73f9b07af63063d5cc38fd539e1f7439ccb4134e8 | Python | 13,695 | 426 | """
Tests that the specified index column (a.k.a "index_col")
is properly handled or inferred during parsing for all of
the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfa... |
69549911e8353cbc2ee484874579fcf840f9a056b38d8a527aca7babc7185dff | Python | 13,699 | 409 | """
Tests encoding functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import (
BytesIO,
StringIO,
TextIOWrapper,
)
import sys
import tempfile
import numpy as np
import pytest
from pandas.errors import (
EmptyDataError,
ParserWarning,
)
import pandas as pd
impor... |
6beccbe341f9b2129e9702e20ffa6762f690e5524018b2bbcbf320b5aee9f540 | Python | 13,699 | 385 | # 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... |
4255895c2bc0d36d2875db7358bae7efd0c29483afe6b68d2488b5e100205b10 | Python | 13,711 | 339 | from typing import List, Literal, Tuple, Union
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.figure import Figure
from matplotlib.cm import ScalarMappable
Palette = Union[str, List[Union[str, Tuple[float, float, float]]]]
class ... |
8db05ec17cd7f6853ad703797fe590872059e195b9efee70e6029408b1a76cab | Python | 13,723 | 375 | # 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... |
242ba1c376cedffd89136e4af4bf526915d3a353a1aa9295480251eec67d4b4b | Python | 13,734 | 426 | """Session 24 — full platform extensions.
Covers the V2 surfaces wired this session:
- Schedules CRUD + immediate-run handler dispatch.
- Experiment templates CRUD.
- Webhooks CRUD (creation only — actual delivery requires a live HTTP
target which we don't spin up here).
- Pipeline versioning + deployment rollback.... |
edc158128852a167655625727234271a3bd622e1d36d593a805d5c0f94b175b0 | Python | 13,744 | 408 | # 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... |
ae55b4243ae777608e6b5d0e2e9ae0a5408f04f53fe6ad78f03c5e40ddb0f051 | Python | 13,747 | 372 | # 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... |
7912d9dacaf1c0cd1a6f91bce9feef5484f25aa46fe20d578748143e43b6b8a0 | Python | 13,753 | 295 | """Tests for losses/factory.py — LossFactory, get_loss_classes, get_loss_factories."""
import copy
import pandas as pd
import pytest
import torch
from lightning_pose.losses import get_loss_classes, get_loss_factories
from lightning_pose.losses.factory import LossFactory
from lightning_pose.losses.losses import Heatm... |
b0c01698c5b6c435f8991c10a910318431fce830405e0c36378fe1c1c01c1d49 | Python | 13,758 | 379 | import hashlib
import io
import json
import os
import pathlib
import shutil
import tempfile
import zipfile
import dclab
from dclab.util import file_monitoring_lru_cache
import numpy as np
from .pipeline import Dataslot, Filter, Pipeline, Plot
from ._version import version
class DataFileNotFoundError(BaseException):... |
e82df1f28229bb3db67c343b610dda1b5d1977b74d6f51825f78b24890b22928 | Python | 13,761 | 482 | import numpy as np
import pytest
from pandas.errors import InvalidIndexError
from pandas.core.dtypes.common import is_integer
import pandas as pd
import pandas._testing as tm
@pytest.mark.parametrize("dtype", ["S1", "V1"])
@pytest.mark.parametrize(
"method,cond",
[
("where", [True, False, True]),
... |
21035edab788aa492e7cb10c38b9527d50990cca66000ff64c5dbf6f86d3356d | Python | 13,764 | 371 | # Copyright 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 agre... |
555931cb54bbfa8300e5386e7321bd61170d88ce65049ed988adb5aa87e15ef4 | Python | 13,772 | 370 | # 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... |
682dc59837535a67311e1533cdfa8542e4ccd308ad23d8cfca5f91a8743bf523 | Python | 13,772 | 323 | """Factory functions for building pose estimation models from a Hydra config.
Public entry points:
- :func:`get_model_class` — pure dispatch: returns the model *class* for a given
``(model_type, semi_supervised)`` pair without instantiating anything.
- :func:`get_model` — full construction: resolves optimizer/sched... |
4ac11760558965fe6ddbfcacb5870f228f0d8d3158539bd39c7553912cf2e020 | Python | 13,773 | 289 | import os
import numpy as np
import pandas as pd
import torch
from scipy.stats import pearsonr
from sklearn.preprocessing import MinMaxScaler
from torch_geometric.data import Data
import torch_geometric
import json
def normalize(data):
# get the minimum and maximum values for each gene
min_values, _ = torch.m... |
116aaf3ebffeab1cce662f4572fba2f78b615f81ea88d84d739ad3c339508a3c | Python | 13,776 | 300 | #!/usr/bin/env python3
# MIT License
#
# Copyright 2026 Broad Institute
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... |
7ac09508dd9fd53598b3c546b7497bb16a52b3237a794a1407c38267c3c57f0d | Python | 13,777 | 369 | import json
import pickle
import gzip
import matplotlib as mpl
import numpy as np
from matplotlib import pyplot as plt, cm
from neuron import h, gui2
plt.style.use('seaborn-colorblind')
mpl.rcParams['pdf.fonttype'] = 42
mpl.rcParams['ps.fonttype'] = 42
mpl.rcParams['font.family'] = 'Arial'
mpl.rcParams['font.size'] = ... |
6b3f672c0f27e8716977d8ba973c1014914631792cf8d5158668b752b861d611 | Python | 13,778 | 279 | import pandas as pd
import numpy as np
import scipy.linalg as LA
from . import diffeo
from . import surfaces
from . import pointSets
from .affineRegistration import rigidRegistration, rigidRegistration_multi, saveRigid
from . import surfaceTemplate as sTemp
from . import surfaceMatching as smatch
from . import loggingU... |
a7894c13b2cdba903b0fd2912be6067a3e42ca3953c35d7acb51b5a68440c0ad | Python | 13,781 | 365 | # Copyright 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 agre... |
9658913c21688bd01f3d47b8aaf00ee672f067c7f3aaf265464d817ce296090f | Python | 13,787 | 298 | """Data pipeline for video prediction based on PyNvVideoCodec (direct NVDEC access).
Import warning
--------------
Same discipline as ``lightning_pose.data.video.dali``: ``pynvvideocodec`` is an unconditional
but platform-gated dependency (Linux x86_64 only), so importing this module at the top
level of any other modu... |
4ad1855f6deeeaf23e4811d98f1315d6d5dfb330bf22de79afd938db1d373106 | Python | 13,793 | 334 | # 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... |
4529c5fdfac5676acb72631fb37468660310573b2e5b3754287111a27b890671 | Python | 13,794 | 331 | # 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... |
8b84f06274e5ca227dd3752da6a03809966f77e6e29f757250fd316000397e90 | Python | 13,798 | 263 | # -*- coding: utf-8 -*-
"""
This is the code for the software DISCERN.
This software is property of The Vall d'Hebron Institute of Oncology (VHIO), Barcelona, Spain.
Terms of Use:
1. The use of any software provided by VHIO as part of its services, from now on referred to as the services, is subject to the terms and... |
762197e43c4ef2ae238d647d17367658ec6282c786a4dfce46516df758aaab50 | Python | 13,800 | 262 | # -*- coding: utf-8 -*-
"""
This is the code for the software DISCERN.
This software is property of The Vall d'Hebron Institute of Oncology (VHIO), Barcelona, Spain.
Terms of Use:
1. The use of any software provided by VHIO as part of its services, from now on referred to as the services, is subject to the terms and... |
3fd973ad99ca09a31f11c4f0f727c384e9c178e831714e41ad68c004b96696a5 | Python | 13,812 | 413 | #!/usr/bin/env python3
#
# PennyLane documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 17 11:43:51 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
c5e1cb0a3d4ed37d5b081f1a054cd6f181d3887b362c9474ff1c77a9bb2c1dfb | Python | 13,821 | 392 | # 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... |
942a2adb41384e2ba3c012ff7b7e42b15ab7900f20f97210d6eb7fd7ea454f14 | Python | 13,827 | 316 | #%%
import numpy as np
import math
import matplotlib.pyplot as plt
import sys,os
import pickle as pkl
sys.path.append('./')
from utils.model import *
from utils.utils import *
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.patches import Wedge
from matplotlib.colors import Liste... |
97eda6c396bc44fc2fa533c3354307c2f25b4b09373ae83ac510dd607b179524 | Python | 13,836 | 416 | """Code for loading and cleaning data."""
import datetime
from functools import wraps
from pathlib import Path
from typing import Any, Callable
import numpy as np
import pandas as pd
import statsmodels.api as sm
from numpy.typing import ArrayLike
from scipy import stats
from scipy.optimize import curve_fit
def save... |
f13b10e5a2d4e27bc540509b746f739f96f7e74b935502832a8e4617c357e93f | Python | 13,836 | 329 | """
Tests for the following offsets:
- HalfYearBegin
- HalfYearEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
HalfYearBegin,
Hal... |
d0ae7b11a1b50071d06b99934ae899bc2cbdcac8b63319ffa1f49460ac97a560 | Python | 13,840 | 274 |
from ..utils import PheWebError
from ..file_utils import read_maybe_gzip, mkdir_p
from .load_utils import run_script, ProgressBar
from collections import OrderedDict
import os, sys, contextlib, urllib.request, functools
class Build:
_allowed_chroms = list(map(str,range(1,22+1))) + ['X','Y','M']
def __init__... |
e06390ede64fcb5fb69841f9a772d99f78f6b9a2b65f49258b3ebd4b027a6959 | Python | 13,840 | 326 | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 3 16:17:37 2022
@author: Anonymous
Code to extract audiovisual features with
pretrained convolutional neural networks and
create a tfrecord dataset.
"""
# %% imports
import sys
import tensorflow as tf
import tensorflow_hub as hub
import pandas as pd
import numpy as n... |
864eb24fa56c568471179bdb87c50c26d63ea81a67c69915ebd211f4631b08c5 | Python | 13,844 | 369 | # 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... |
14d88de4d7cbdbc00fc4d7ce3fe0d5eb38f6fdd14a2c9a0265bb4ded5e926bbd | Python | 13,847 | 331 | """Bounded public peak-call probes for ownership of temporary pileup files."""
import multiprocessing
import os
import signal
import subprocess
import sys
import pytest
from conftest import macs3_env
SCRIPT = r'''
from concurrent.futures import Future
import multiprocessing
import os
from pathlib import Path
import... |
0467f62a6f312ab99c3a9cebbc406ce0a75fafe5b755c8f84f5aac887c53c232 | Python | 13,851 | 292 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import seaborn as sns
import pandas as pd
import scipy.stats as sts
def plotViolin(ax, data1, data2, b_fin, colors, colors2, legend, plotSpec):
for i in range(data1.shape[1]):
d1 = data1.iloc[:,i]
v1 = ax.violi... |
b7d87c777f3fc761342745f5d4eb110a919a66b4b0ecab8ecd51c31e98749192 | Python | 13,854 | 297 | import numpy as np, matplotlib.pyplot as plt, sys
import pumpprobe as pp, wormdatamodel as wormdm
from scipy.optimize import curve_fit
from multipy import fdr
from scipy import stats
import cmasher as cmr
#this script is to makes the plots for the observation number, the variability in kernels and the fraction respond... |
041c86ab4757650fe85adc9f30f03fb50bd12d6c84cae0058900c88e618c3b31 | Python | 13,863 | 377 | import numpy as np
import logging
from . import conjugateGradient as cg
from . import bfgs
from .gridscalars import GridScalars, saveImage
from .diffeo import multilinInterp, multilinInterpGradient, multilinInterpGradientVectorField, jacobianDeterminant, \
multilinInterpDual, imageGradient, idMesh, multilinInterpVe... |
f2854089963b17d4e0a9e2731d2e95401281c93e9e36ac6a74b8a90b68ef0eef | Python | 13,867 | 340 | # 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... |
e81de387be70b99e27c18582f701cad246a223f537f6f33376093f5a6c99575d | Python | 13,874 | 364 | """This script creates figures 1."""
import os
from copy import deepcopy
import dill
import glmtools as glm
import matplotlib.pyplot as plt
import mne
import numpy as np
import osl
import sails
from anamnesis import obj_from_hdf5file
import lemon_plotting
from glm_config import cfg
from lemon_support import (get_eeg... |
5b38c1c07f8f4f4b34fe361aba403b20cd69f33a3cee22c1729c877de0e605db | Python | 13,875 | 395 | # 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... |
066e643bf73c56e3d45207e36a79687146e69d7991f2379a400ce845577c782a | Python | 13,882 | 411 | #
# File to train networks built from the hnn.py class.
#
# This file establishes the clebsch gordan coefficients, sets up an hnn with given parameters,
# loads holograms from .npy files, and then tests the network via a function call.
#
from argparse import ArgumentParser
import logging
import math
import os
import ... |
3ce3b8b7491e4d8f1040a99a382850098b2a7f849292e7218a70afbd343a5b4a | Python | 13,886 | 404 | import sys, re, argparse
sys.setrecursionlimit(1500)
## Command-line processing
argparser = argparse.ArgumentParser('''
Calculates various center-embedding fields on %.nopunc.tss.fromlinetree.semprocdecpars and outputs tokmeasures using tokenization provided by %.linetoks (stdin).
''')
argparser.add_argument('decpars'... |
f5a147524b5cbe02f5026571b072e7a38a98db828aa20aa2bf12af53f54f98b0 | Python | 13,888 | 366 | """PyTest fixtures for the data tests."""
from collections.abc import Callable
import pytest
import torch
from ismrmrd import xsd
from ismrmrd.serialization import ProtocolSerializer
from mrpro.data import Rotation, SpatialDimension
from mrpro.utils import RandomGenerator, unsqueeze_left
from tests.data import Dicom... |
31e39cd10b58bb9e83e678edc2ae8bd0f69e7f54f8311222770c435981cc0741 | Python | 13,894 | 400 | """Multiple comparisons correction methods."""
import inspect
import logging
from abc import ABCMeta, abstractproperty
import numpy as np
from pymare.stats import bonferroni, fdr
from nimare.results import MetaResult
from nimare.transforms import p_to_z
LGR = logging.getLogger(__name__)
class Corrector(metaclass=A... |
67a2aa6ce970c92d9d2fedca8b50af92ff9930ed1ed3325da39fda47147e802b | Python | 13,899 | 339 | # Copyright 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 agre... |
b973a2996392ae96c8c10c769730c728362e0d685bd2b077eded84e0dcbd92f7 | Python | 13,907 | 344 | """MR raw data / k-space data header dataclass."""
import dataclasses
import datetime as dt
import warnings
from collections.abc import Mapping
from dataclasses import field
from typing import TYPE_CHECKING
import ismrmrd.xsd.ismrmrdschema.ismrmrd as ismrmrdschema
import torch
from typing_extensions import Self
from... |
99407d4317de1978ae6a0c41566ab0bc177a89011ab0d88bc5c41e185a9c7b61 | Python | 13,910 | 334 | import pytest
import torch
from lightning_pose.data.cameras import project_3d_to_2d, project_camera_pairs_to_3d
# --------------------------------------------
# file-level fixtures from anipose-fly example
# 05272019_fly1_0_R1C24_rot-ccw-0.06_sec
# --------------------------------------------
@pytest.fixture
def po... |
18c3e497fdfa4cfbbc25773e76119a1b8b35e6dbeee33be98b3570094282ed0e | Python | 13,923 | 391 | import copy
import numpy as np
import pytest
from pcntoolkit.dataio.norm_data import NormData
from pcntoolkit.math_functions.likelihood import NormalLikelihood
from pcntoolkit.math_functions.prior import *
from pcntoolkit.normative_model import NormativeModel
from pcntoolkit.regression_model.blr import *
from pcntool... |
87f99d3f0dbd62f30ff10e8ece2fba89f09a3ee06aa311f8c60a106e1aea3601 | Python | 13,924 | 464 | """
Utilities for interpreting CSS from Stylers for formatting non-HTML outputs.
"""
from __future__ import annotations
import re
from typing import TYPE_CHECKING
import warnings
from pandas.errors import CSSWarning
from pandas.util._exceptions import find_stack_level
if TYPE_CHECKING:
from collections.abc impo... |
8777f208b0020dc0ff9c8241ddcfd83250e1acb55f9d6e156897d11106bbcb66 | Python | 13,925 | 445 | from __future__ import annotations
import numbers
from typing import (
TYPE_CHECKING,
ClassVar,
Self,
cast,
)
import warnings
import numpy as np
from pandas._libs import (
lib,
missing as libmissing,
)
from pandas.errors import Pandas4Warning
from pandas.util._decorators import set_module
fro... |
23eabf095e743b7fd3d12e3f95fda0f21fc64af3e52ea1292f0c3ff65e60d9b1 | Python | 13,931 | 354 | from . import surfaces
from .pointSets import *
from . import conjugateGradient as cg, kernelFunctions as kfun, pointEvolution as evol
from .affineBasis import *
## Parameter class for matching
# timeStep: time discretization
# KparDiff: object kernel: if not specified, use typeKernel with width sigmaKernel
... |
58f325bf6ac3f7bfbe9d9b10495195900ffd9d302cd2e76000e19ac6707c43c2 | Python | 13,933 | 347 | # -------------------------------------------------------------------------------------------------------------------------------------
# Following code curated for GCPNet (https://github.com/BioinfoMachineLearning/GCPNet):
# ----------------------------------------------------------------------------------------------... |
d5aca445ed7066ec7b39be546e4fc3fc451c17ab6aa5114e107267a23c782f14 | Python | 13,937 | 284 | import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from fastai.data.all import DataLoader
from gpmhc.data import dataset, tokenize
from gpmhc.gnn_parts import *
from gpmhc.learner import get_learner
from collections import OrderedDict
from abc import ABC, abstractmethod
NUM_WORKERS = 8
def los... |
64008049d2d8262a0d0de24423afa7342c7f1e467bb07bc4cd2752997ca5b3a6 | Python | 13,944 | 398 | import numpy as np
import logging
from .linesearch import line_search_wolfe
# Class running nonlinear conjugate gradient
# opt is an optimizable class that must provide the following functions:
# getVariable(): current value of the optimzed variable
# objectiveFun(): value of the objective function
# updateTry(d... |
03da5843fae2b016758496ed547b0d7b6c86e0721d4e80dde037cd3be717877d | Python | 13,947 | 280 | from tkinter.messagebox import NO
from Environment_ui import *
from PySide2.QtWidgets import QWidget, QFileDialog, QTextBrowser, QPushButton, QProgressBar, QMessageBox
from PySide2.QtUiTools import QUiLoader
from PySide2.QtCore import Signal, QObject
from threading import Thread
from concurrent.futures import ThreadPoo... |
186ac66353b361a6cafec86cc6ef331a040a2a7406e1722d36e7e47c8566f8d1 | Python | 13,950 | 412 | # Copyright 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 agre... |
5c07133b53d44c086f128b18cb1f67f98cb48c1f9e578f3fd8e03ae2012492d5 | Python | 13,957 | 325 | import numpy as np, matplotlib.pyplot as plt, sys
import pumpprobe as pp, wormdatamodel as wormdm
from scipy.optimize import curve_fit
import seaborn as sns
ds_list = "/projects/LEIFER/francesco/funatlas_list.txt"
ds_tags = None
ds_exclude_tags = "mutant"
ds_exclude_i = []
inclall_occ = "--inclall-occ" in sys.argv
sig... |
3544edbb64ac6f6cf12f546f8b9db403ff6a9d0b1c469790b672b69bb8f554e8 | Python | 13,958 | 439 | """
data hash pandas / numpy objects
"""
from __future__ import annotations
import itertools
from typing import TYPE_CHECKING
import numpy as np
from pandas._libs.hashing import hash_object_array
from pandas.core.dtypes.common import is_list_like
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas.c... |
168a83e8e4412d51e51112320920fe0b474cd821d7cac920e95218f4ef125b47 | Python | 13,966 | 423 | import multiprocessing
import shutil
import sys
from multiprocessing.synchronize import Barrier
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
from pcntoolkit.util.runner import Runner
from test.fixtures.test_model_fixtures import *
def cleanup(model, runner):
shutil.rmtree(os.pat... |
645ec1775e725e70799023ef59f06efe844d832eb66191a087f09a2379c9f0e4 | Python | 13,968 | 329 | """
Tests for the following offsets:
- BHalfYearBegin
- BHalfYearEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
assert_offset_equal,
)
from pandas.tseries.offsets import (
BHalfYearBegin,
... |
de36adfde550808c1a26d029602db5e2364b74150a48417c66a5ade00a085cb4 | Python | 13,971 | 357 | import os
import numpy as np
from scipy.interpolate import griddata
from figure_properties import *
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.gridspec as gridspec
def fetch_folder(csd_type='small'):
if csd_type == 'small':
all_folder = 'small_srcs_all_ele'
all_mi... |
4dbf2ce18231d00a58d9231a404afc957488b127ce26d5cccf0d6f04667bb9ce | Python | 13,974 | 285 | import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from fastai.data.all import DataLoader
from gpmhc.data import dataset, tokenize
from gpmhc.gnn_parts import *
from gpmhc.learner import get_learner
from collections import OrderedDict
from abc import ABC, abstractmethod
NUM_WORKERS = 8
def los... |
b767f2d4b1095d72ebebc49d0b540b75c12b2e0f61597bc3ce6dbf6d085f5a62 | Python | 13,978 | 430 | """Shared fixtures and builders for longitudinal tests."""
from __future__ import annotations
import os
from collections.abc import Callable
from typing import Any
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from pcntoolkit.dataio.norm_data import NormData
from pcntoolkit.longitudinal.c... |
9e8b94befd4edf0c8ac99c942475f02419eacae38fe200cb8c8f69ab5f502551 | Python | 13,985 | 341 | import copy
import importlib.resources
from PyQt6 import uic, QtCore, QtWidgets
import dclab
from ...pipeline import Filter
from ..widgets import RangeControl
from ... import idiom
class FilterPanel(QtWidgets.QWidget):
"""Filter panel widget
The filtering panel visualizes the properties of a
:class:`... |
9ccb452f9672ab970b59955637c74412bf4ce692582eb6a550bef70c3aad376f | Python | 13,992 | 384 | import itertools
from logging import Logger
from typing import Any, Iterable, Mapping, Optional, Sequence, Union, cast
import numpy as np
import pandas as pd
from deepglyco.chem.gpep.sort import GlycanComparer
from ..speclib.gpep.spec import GlycoPeptideMS2SpectrumProto
from ..util.math import jaccard, spectral_angle... |
82cbb079b8561697c9866d5dc8ecf3979484ae4e278fcc144b14bcdf235b10e2 | Python | 14,002 | 517 | import argparse
import os
import sys
import torch
from sklearn.model_selection import train_test_split as split
from roost.cgcnn.data import CrystalGraphData, collate_batch
from roost.cgcnn.model import CrystalGraphConvNet
from roost.utils import results_multitask, train_ensemble
def main(
data_path,
fea_pa... |
fefb52e01f5a1e4508ea4aea56bcf35b6010453ca2881290d67cc5fdde5fb535 | Python | 14,022 | 382 | import numpy as np
from .curves import Curve
def L2Norm0(fv1):
# return ((fv1.vertices**2).sum(axis=1)*fv1.diffArcLength()).sum()
return ((fv1.vertices ** 2).sum(axis=1)).sum()
def L2NormDef(fvDef, fv1):
# a1 = fv1.diffArcLength()
# aDef = fvDef.diffArcLength()
# return (-2*(fvDef.vertices*fv1.v... |
6bf7c4ba870ca1696580c013e6563a571c01740dfb91ca546c9c8c4cc044e44f | Python | 14,040 | 437 | # 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... |
de388c9e800d3f2507ead876335c87f687d53b2857cd2d7099a65646cd969163 | Python | 14,046 | 366 | # 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... |
e3931315f164a2ec58163243434bee6d920d7d90ad71a75392e912b929f3e2db | Python | 14,051 | 297 | # 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... |
fa856b991c1d72af4632e6545120f29a70d28432a8ca2b937392d363262cebed | Python | 14,059 | 472 | """
Module that contains many useful utilities
for validating data or function arguments
"""
from __future__ import annotations
from collections.abc import (
Iterable,
Sequence,
)
from typing import (
TYPE_CHECKING,
Any,
TypeVar,
overload,
)
import numpy as np
from pandas._libs import lib
fr... |
fe1269b125f3b685f833503f54268d39565e82d826ee8b94d9665c93c1e02d5d | Python | 14,062 | 365 | ''' This program will check sample IDs from a publishing database against sample IDs
from the publishedURL table (MongoDB neuronbridge). Any samples in the publishing
database but not neuronbridge will be reported, and files of these samples and
images requiring segmentations will be produced.
'''
__version... |
dd6ae01583072b90dacb214455dabd508550caacbad60728bd8d95790a571f54 | Python | 14,068 | 454 | """Generates connectivity results from preprocessed data."""
import os
import numpy as np
from coh_handle_files import (
generate_analysiswise_fpath,
generate_sessionwise_fpath,
load_file,
)
from coh_connectivity import (
ConnectivityCoherence,
ConnectivityGranger,
ConnectivityMultivariateCoh,
... |
c392979cb04bf95e655c8c131938d40bf8ffc52e63c035bbf5d051cd25269b88 | Python | 14,070 | 321 | #%%
import numpy as np
import math
import matplotlib.pyplot as plt
import sys,os
import pickle as pkl
sys.path.append('./')
from utils.model import *
from utils.utils import *
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.patches import Wedge
from matplotlib.colors import Liste... |
52a20756b3d067bb9863e4cd36fa2f1f4e628f88a6e6d31cba8532a478dd488f | Python | 14,074 | 336 | from . import conjugateGradient, loggingUtils
import numpy
import optparse
import os
import shutil
import logging
import multiprocessing
from . import fftHelper
from . import imageTimeSeriesConfig
#import tvtk
#import gradientDescent
import numexpr as ne
class ImageTimeSeries(object):
def __init__(self, output_di... |
7b32cb3abfd3ec5b2ccf3a8980f69052287b9efb68b130c838811793ac7fa4ab | Python | 14,076 | 396 | from tensorflow.keras.utils import Sequence
import cv2
import numpy as np
import random
from builtins import range
from batchgenerators.augmentations.utils import (
create_zero_centered_coordinate_mesh,
elastic_deform_coordinates,
interpolate_img,
rotate_coords_2d,
rotate_coords_3d,
scale_coords... |
e9b13d02d9a689e1911a57c0d54bf779f40e3a80bbf825212bd1779436743a41 | Python | 14,076 | 317 | import json
import numpy as np
import os
import yaml
from itertools import combinations, product, permutations
from scipy import spatial
from draw import draw_angle_stimulus
from image_preprocessor import ImagePreprocessor
from result_plotter import ResultPlotter
from utils import Observable, sigmoid, d2_to_d1, d1_to... |
d07b6ef47fbea7501bdb7fa4db23822e760691e2285df04dee9d9c91fbcfda0f | Python | 14,090 | 308 | #! /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... |
5f03aebf49a7e3ae326b8232ccd7dbdfcb8f84cbb597843f7a6cce576b990e42 | Python | 14,092 | 376 | # 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... |
1b9b34814c341bf7d9b0e8e34ebd1653caafe49f6e81aca9d6bb75dbe4d3a372 | Python | 14,094 | 353 | # -*- coding: utf-8 -*-
"""
DSC curve processing
"""
import logging
logger = logging.getLogger(__name__)
import os
import numpy as np
import nrrd
from scipy import signal
import matplotlib.pyplot as plt
from app.utils import end_execution
def listfolders(folder):
return [d for d in os.listdir(folder) if os.path... |
5fb7c5ab103aa0830795aa96d63f1ecf2affe54eb30b3135e7de3212cd611fed | Python | 14,125 | 405 | import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.dtypes import DatetimeTZDtype
import pandas as pd
import pandas._testing as tm
def test_get_level_number_integer(idx):
idx.names = [1, 0]
assert idx._get_level_number(1) == 0
assert idx._get_level_number(0... |
a56feda344b2fe8e0451c9ed71c7f970958cbc5372e8cf7311732896af2f83e6 | Python | 14,129 | 259 | import json, os, random
import torch
import numpy as np
import h5py
from torch.utils.data import Dataset
import dareblopy as db
import torch.utils
import torch.utils.data
cpu = torch.device('cpu')
class ECoGDataset(Dataset):
"""docstring for ECoGDataset"""
def __init__(self, cfg,ReqSubjDict, mode = 't... |
993f29f199bffa0ed93024811e72b212c1222e60518259bcb0d3883a2013f5a5 | Python | 14,141 | 353 | # function for measuring horizontal, vertical, rotation invariance and equivariance
# useful packages:
import torch
import torchvision.transforms as transforms
from torchvision import models
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.io as sio
from scipy.stats i... |
101d886ea4bbb489ac044b966e21dc44e40697c27aa0d896ffa06515c12fdfd2 | Python | 14,143 | 398 | import re
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tseries.offsets import BDay
@pytest.fixture
def four_level_index_dataframe():
arr = np.array(
[
[-0.5109, -2.3358, -0.4645, 0.05076, 0.364],
[0.4473, 1.4152, 0.2834, 1.00661, ... |
61aad824bcf10f14526a765de49deae8d1b4185035d681b705c37ddb0434060d | Python | 14,146 | 443 | import numpy as np
import pytest
from pandas.errors import (
DataError,
Pandas4Warning,
SpecificationError,
)
import pandas as pd
import pandas._testing as tm
def test_getitem(step):
frame = pd.DataFrame(np.random.default_rng(2).standard_normal((5, 5)))
r = frame.rolling(window=5, step=step)
... |
8c0c9503dff63a7e20617e5003ee88e85719a4c8b1abbf3d4137c31c6529b6a6 | Python | 14,155 | 437 | """test orc compat"""
import datetime
from decimal import Decimal
from io import BytesIO
import os
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
pytest.importorskip("pyarrow.orc")
import pyarrow as pa
@pytest.fixture
def dirpath(datapath):
return datapath("io", "data", "or... |
8e0c9da1584bfe8f4af1e1685fe8beca8cca654744de1cc196b150e16c01a358 | Python | 14,158 | 449 | import gzip
import io
import os
import subprocess
import sys
import tarfile
import textwrap
import zipfile
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas as pd
import pandas._testing as tm
import pandas.io.common as icom
@pytest.mark.parametrize(
"obj",
[
... |
9cecc4eb576fb3ab58312c6963302560226207a7f2274e6a9bd0ec2feabf19bd | Python | 14,160 | 406 | import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.dtypes import DatetimeTZDtype
import pandas as pd
import pandas._testing as tm
def test_get_level_number_integer(idx):
idx.names = [1, 0]
assert idx._get_level_number(1) == 0
assert idx._get_level_number(0... |
a317d3574620fe3d4437643764322eeb831328832ee1edd6bc764c6c161abc3e | Python | 14,162 | 462 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 14 20:43:48 2021
@author: reisertm
"""
import sys
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as npss
import tensorflow as tf
import math
from tensorflow.keras import Model
from tensorflow.keras import layers
... |
9c930009d94e5c31374401c27d16fd56ecceeb4fa2f590e844b11223531cd171 | Python | 14,163 | 459 | # -*- coding: utf-8 -*-
"""uniqueCosine.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1BwqFa-zx2wUHkdNiSekgHvM2Q2UOdadD
"""
# Commented out IPython magic to ensure Python compatibility.
from google.colab import drive
drive.mount('/content/drive... |
166eecc73b63b093be7d97c48d05985e84fe0ceccc728eaa47057a8400246255 | Python | 14,168 | 357 | #MIT License
#
#Copyright (c) 2019 Iñigo Prada Luengo
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge,... |
2e11aa32ea10fa24c6783a03f6e8373b6674f2fa2a9474bd0002a5b7a29e6e8d | Python | 14,172 | 375 | import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
@pytest.fixture(params=["quicksort", "mergesort", "heapsort", "stable"])
def sort_kind(request):
return request.param
class TestSeriesSortIndex:
def test_sort_index_name(self, datetim... |
e6345a5aa99ba935d12bb6985ede28e51e6a70e32b87053c75ae24dad6071779 | Python | 14,176 | 398 | # Copyright 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 agre... |
cfb1a2416bb2ecc7a65cea6ea9758540fcaa7e7d6e7dd4e50aa87cfc05867ab8 | Python | 14,180 | 383 | # Copyright 2022 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn
#
# 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... |
f0366818adf3650a1be89a0db31136a25ab86a9ef81bebbbbd646adb864919a4 | Python | 14,189 | 410 | import numpy as np
import pandas as pd
import unittest
from nose2.tools import params
import scipy.sparse as sp
import scipy.stats as ss
import scipy.signal as sig
import chromosight
import chromosight.utils
import chromosight.utils.detection as cud
import chromosight.utils.preprocessing as cup
import chromosight.utils... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.