sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
91cb77f2207814128a3efca4626a40d0964aa0a398ee90cb12b427ca192882a3
Python
33,927
773
"""Tests for bbox coordinate transformation utilities.""" import numpy as np import pandas as pd import pytest import torch from lightning_pose.data.bboxes import ( as_bbox_df_list, crop_and_resize_frames, crop_views, frame_to_model, frame_to_model_batch, frame_to_norm, full_frame_bbox, ...
9875a8d2f37c5225bc6f65b11443deb1e1642116706a23ac3b58ca1349f965c6
Python
33,956
987
# 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...
80984a5eb806e005cedf9338c761453d573909879adbefe6556c52420f730e88
Python
34,000
852
import math from typing import Optional import numpy as np import pandas as pd import pytorch_lightning as pl import SimpleITK as sitk import torch import torch.nn as nn import torchmetrics from .landmark_localizer import CombinedLandmarkLocalizer from .utils import ( TABULAR_NAMES, MEASUREMENT_NAMES, Inv...
f8a7af5de356c4dab3efcab159b96f2ed37b269b6fe44944eff4fc1d2f257abd
Python
34,015
828
import numpy as np import pandas as pd class TestCategoricalReprWithFactor: def test_print(self, using_infer_string): factor = pd.Categorical(["a", "b", "b", "a", "a", "c", "c", "c"], ordered=True) dtype = "str" if using_infer_string else "object" expected = [ "['a', 'b', 'b',...
09000b912c2ad0119cce954b83ecd2cabb247989aa5e84e976bed34c59a04c63
Python
34,016
1,031
#panel_apps.py from initialization.config import * from initialization.initialization import * import numpy as np import pandas as pd import os # matplotlib imports import matplotlib.pyplot as plt plt.rcParams.update({ "figure.facecolor": (1.0, 1.0, 1.0, 1.0), "axes.facecolor": (1.0, 1.0, 1.0, 1.0), ...
a40a5da9b9a495cd08c5b3645bceb86ea8ba1e385d8f2cd7db492e7b7e1f5f9a
Python
34,030
926
import torch from torch.nn import Module import windseer.utils as utils import sys import warnings import re import copy class CombinedLoss(Module): ''' Loss which can combine all of the different loss functions into one using learnable homoscedastic uncertainty factors. Based on Geometric Loss Functions ...
13011aa0966f2694c4f12d72301e42d923b527ea9843e83615868419ad59ed99
Python
34,047
948
import numpy as np import pytest from pandas.errors import Pandas4Warning import pandas as pd import pandas._testing as tm class TestDataFrameSortValues: @pytest.mark.parametrize("dtype", [np.uint8, bool]) def test_sort_values_sparse_no_warning(self, dtype): # GH#45618 ser = pd.Series(pd.Cat...
b0e7e029fe2c3a81774b7a5436e7edf183852850e55c95d083fc699a5ee772c8
Python
34,073
867
import numpy as np from numba import jit from . import diffeo import logging from pykeops.numpy import LazyTensor import pykeops from . import kernelFunctions_util as ku def haussdorffDist(fv1, fv2): dst = ((fv1.vertices[:, np.newaxis, :] - fv2.vertices[np.newaxis, :, :] )**2).sum(axis=2) res = np.amin(dst, ax...
f863811cdde1c88cbb6c7a21cd72c2c0fe44487cc01af887d8e747ae5ab17808
Python
34,074
1,039
import pathlib from textwrap import ( dedent, indent, ) import numpy as np import pytest import pandas as pd jinja2 = pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def env(): project_dir = pathlib.Path(__file__).parent.parent.parent.parent.parent.resolve() ...
97c28c3238a672a24890127e2f49f84b6a27135d390ba0917944f6e8b1585836
Python
34,075
1,037
""" Tests dtype specification during parsing for all of the parsers defined in parsers.py """ from collections import defaultdict from io import StringIO import numpy as np import pytest from pandas._libs import lib from pandas.compat.pyarrow import pa_version_under25p0 from pandas.errors import ( EmptyDataError...
85e4ce242ff101cf612f508d6d73829c54665177403a17d418da42594fa71dec
Python
34,081
942
# coding: utf-8 """Routines for printing a text report. This is the legacy code for generating text-based reports. This will eventually be deprecated in favor of the Jinja2 and MultiQC reports. """ from abc import ABCMeta, abstractmethod import math import textwrap from atropos.io import open_output from atropos.util ...
36d93a2ab8cf7f44462ad41127a1826deb8b5f41d828cf1d1b956b2c14caaf71
Python
34,114
672
#! /usr/bin/env python # gen-inclusions.py : generate .tex inclusions for user guide # # usage: gen-inclusions.py # or: gen-inclusions.py <top_builddir> <top_srcdir> # # Runs the tutorial examples in the user guide and extracts output # snippets for inclusion in .tex files. This saves having to manually # updat...
07295abc667a8a2b38fc80bd400a0863a7e0a1c5a6bd11b16fdbf30a34db42d6
Python
34,122
879
import os import pysam import multiprocessing import collections def convert_benchmark_vcf_into_vapor_bed(vcf_path): index = 1 for record in pysam.VariantFile(vcf_path): sv_chrom = record.contig sv_start = record.start + 1 sv_type = record.info["SVTYPE"] sv_length = record...
eafa08ec1e989bda797532891883763dd3406512ac36228d80a1c62c905db9a1
Python
34,134
927
# -------------------------------------------------------- # Based on BEiT, timm, DINO and DeiT code bases # https://github.com/microsoft/unilm/tree/master/beit # https://github.com/rwightman/pytorch-image-models/tree/master/timm # https://github.com/facebookresearch/deit # https://github.com/facebookresearch/dino # --...
6b46d4d18b3da98cbd3c7a3c06965730e403c549eec318ac8ff56fe45eb953da
Python
34,152
1,027
# 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...
931755d70fe4a9f79139f9fd2741a7104664cf8d7e0cb0cff659584344c33e09
Python
34,161
926
#!/usr/bin/env python """REST Translation server.""" import codecs import sys import os import time import json import threading import re import traceback import importlib import torch import onmt.opts from itertools import islice, zip_longest from copy import deepcopy from collections import defaultdict from argpars...
b58a1ab0ad816a297fdb2c5feaf6699c5b099f18b92cd5557f7d38dfd007e502
Python
34,189
732
"""Data pipelines based on efficient video reading by nvidia dali package. Import warning -------------- ``nvidia-dali-cuda110`` is not installed on CPU-only machines (macOS, GPU-less Linux), so importing this module at the top level of any other module will raise ``ImportError`` on those platforms and break ``import ...
dd656b25e3c68605f97753720e5293b88501935eb39fc5a0cb9894e13a2bd7f2
Python
34,223
814
""" From https://github.com/mouthful/ClofNet/blob/master/newtonian """ import numpy as np import matplotlib.pyplot as plt import time class SpringSim(object): def __init__(self, n_balls=5, box_size=5., loc_std=.5, vel_norm=.5, interaction_strength=.1, noise_var=0.): self.n_balls = n_ball...
657732d17d63943999e00860ac4a0c2245b21595b7fac5fff40df26fd539a3c8
Python
34,253
995
"""test the scalar Timestamp""" import calendar from datetime import ( UTC, datetime, timedelta, ) import locale import re import time import unicodedata import zoneinfo from dateutil.tz import ( tzlocal, tzutc, ) import numpy as np import pytest from pandas._libs.tslibs.dtypes import NpyDatetime...
acecfe93a4aec675906641a556fa6989c76cea5659c86f90842a645d5ad263bf
Python
34,274
997
# 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...
c18371554698039ec518d2c707f9e6ce1669923ff90d34b52f22221780411ae4
Python
34,285
1,102
from datetime import datetime import re import numpy as np import pytest from pandas._libs import lib from pandas._libs.tslibs import Day from pandas.errors import Pandas4Warning import pandas as pd import pandas._testing as tm from pandas.core.indexes.datetimes import date_range @pytest.fixture def dti(): ret...
8913adb4d92973f512095ba69df06a4b9282285aa691b02d7372717153f0571f
Python
34,316
896
# 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...
77a3d1ed06bbcc22ac6eae0c425aa0f924d526d8098e9b7f520acb05bd95addb
Python
34,324
813
# 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...
1d697324fe7ef8c940d20ec555d20a1cf3681616952d3cc747cb3768be311bc2
Python
34,328
969
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): ...
261d1c420dd971208d107aa76da7fa23228f5df49e8d66f06a695b8900c99de4
Python
34,363
940
import numpy as np import pytest import pandas as pd import pandas._testing as tm @pytest.fixture( params=[["linear", "single"], ["nearest", "table"]], ids=lambda x: "-".join(x) ) def interp_method(request): """(interpolation, method) arguments for quantile""" return request.param class TestDataFrameQu...
84c1ba0a6075b5f0cd8e7e2a8ba326508a328033eafdcdb4d6b32d2ee77147cd
Python
34,373
784
# 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...
1d525fbdd8dc54b76ac775395ac904fd6f3690bb78aa4d83a594425c66f29c17
Python
34,380
627
# 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...
81ef67aa463f30d86b3742d64e39ad18c3bf2edbeb00a5d71edb5c2623d7a945
Python
34,571
890
# 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...
2a562693e96779d82fe4efe0f073687eca53f36e0de6d0eb147f88caaea06dbd
Python
34,574
961
# 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...
0a8cab855730450c93418d8bf82c35d1a933611725e572205471c1487a05bdc8
Python
34,598
674
# We begin by importing all necessary libraries. import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as sts from matplotlib.cm import register_cmap from random import choices from collections import Counter from scipy.linalg import norm as nrm from sklearn.dec...
1109016062f2965701952d019e2ee92f3b2e793a7f9d1d750e5c05246356df03
Python
34,603
889
from datetime import ( datetime, timedelta, ) from importlib import reload import re import string import sys import warnings import numpy as np import pytest from pandas._libs.tslibs import iNaT from pandas.errors import ( OutOfBoundsDatetime, OutOfBoundsTimedelta, Pandas4Warning, ) import pandas...
4b03b1e6950d288d2caca2d49577a31a3a1a78460f76373bae48aafb3b3790ad
Python
34,604
787
import sys, os import multiprocessing import math import time import numpy as np from pathlib import Path ROOT_DIR = Path(__file__).parent import tensorflow as tf from tensorflow import keras from tensorflow.keras import backend as K #tf.config.run_functions_eagerly(True) #eager tf is dummy slow from apnet.keras_pai...
e97e9129eeca55cb44f51aa7c8beb786538c0d578f85452fb8787b71684f08a1
Python
34,632
839
"""Dataset analysis and config recommendation logic backing ``litpose recommend``. Given a directory (or single CSV file) of DLC-format labeled frames, this module inspects the dataset and available hardware to recommend a starting-point lightning-pose config: model type, backbone, image resize dimensions, batch size,...
ef0570b16cc4dd68c45b352bb0d98c28e0b7f6593096cd72023613b3a7a13127
Python
34,759
860
# 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...
ac3bcdb769c6240fda40430f273a5c305e84bbae47c2e47b3d6b2221522c91cf
Python
34,764
757
# 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...
11adc12774c1214eb7cf7d9325d3f9b7bd6f1fd4903536e0c9838e34155f7d02
Python
34,803
772
import cv2 import numpy as np import os import h5py import RSL as RSL_File import matplotlib import tensorflow.python.keras as keras import matplotlib.pyplot as plt from scipy import stats from tensorflow.python.keras.models import model_from_json from ImSetNorm import Normalize import warnings import copy ...
1f7ad4901f0f0fe5e1dfe59549f93d9acc3a4ecce9508c7e69fed31417a344aa
Python
34,827
961
"""Test cases for misc plot functions""" 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.tests.plotting.common import ( _check_colors, _check_legend_labels, _check_plot_works, _check_text_labels, _c...
c8b14011b9cea12e35646c77cd33a7338a47926190d12f15303cd7d2999f037b
Python
34,877
811
"""PCA class to assist with computing PCA losses.""" import logging import warnings from typing import Any, Literal, cast import numpy as np import torch from jaxtyping import Float from omegaconf import ListConfig from sklearn.decomposition import PCA from sklearn.decomposition._pca import _infer_dimension from skle...
b4f066d8cbfcba25e5faad1a15849290902fc1df81c88dd5b2bacd7a1e16c613
Python
34,892
1,021
# 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...
d8c58aab76e580ecc05c01b3b23acbfc08397a5aba8e09b604ccfe03e5d94a70
Python
34,927
947
import matplotlib.pyplot as plt import numpy as np import neuron from neuron import h, gui, load_mechanisms from CA1_plasticity.model.utils import RecordingVector from CA1_plasticity.model.utils import Synapse import sys class CA1: def __init__(self, hoc_model, path_mods, setting, ttx=False): self.settin...
1acaf521b977c16763c652c2f174c5a1e171f19f229bfca47da8db9f3ad394a2
Python
34,975
907
"""Functions and classes for computing nearest neighbors.""" from __future__ import annotations import contextlib import sys from inspect import signature from textwrap import indent from typing import TYPE_CHECKING if sys.version_info < (3, 15): from types import MappingProxyType as frozendict # noqa: N813 im...
9e26a5bd51f4c92aa384c292c6ae8b5b8b7174da6f8084b7c77020c3ad22d615
Python
34,981
906
import json from pathlib import Path from typing import Tuple, Union import os, shutil import warnings from concurrent.futures import ThreadPoolExecutor import time from scipy.io import loadmat import numpy as np import torch from torch.fft import fft, ifft, fftshift from kilosort import CCG from kilosort.preprocessi...
96c6f2ac82cf6db9c9cd579df567c6c169de096bdab5bed40a6cc04315ea6322
Python
34,997
1,043
""" Tools for interfacing with AQuA datasets from uncaging experiments Designed to accompany the paper "Network-level encoding of local neurotransmitters in cortical astrocytes" (DOI: TODO) """ ## ------------------------------------------------------------------------ ## ## Imports ## ------------------------------...
f9b0a42cbb14421f67b0dccc2976d9252cf0df69aefc5f3a8ba3b7542374a23f
Python
35,002
879
# 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...
551322a8170cb6183b0fa1dba17bd010aa6c100003bf1ffda96e5c9956439507
Python
35,060
1,070
# import modules from __future__ import print_function import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from sequence_models.constants import DIST_BINS, THETA_BINS, PHI_BINS, OMEGA_BINS from sequence_models.structure import Attention1d from sequence_models.layers import Positiona...
f1fb1e7e35c47b58025a441d71bd795fb361ceb97c79267288e0202eaa329015
Python
35,088
485
############################################################################### ## ## ## This file is part of ModelBlocks. Copyright 2009, ModelBlocks developers. ## ## ## ...
119c9cbb4047a5a7c4b14042778340385b5539f9d2ace8c83bbc1ab24f9092e0
Python
35,122
876
"""CBMA methods from the ALE and MKDA families.""" import logging from abc import abstractmethod from hashlib import md5 import nibabel as nib import numpy as np import pandas as pd from joblib import Parallel, delayed from scipy import ndimage from tqdm.auto import tqdm from nimare.base import Estimator from nimare....
eefbac8fb8c2dbbd52ff85b2d03f2230682619d5b2080f4c7ac2ffeaa6039751
Python
35,122
900
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", ...
72700e7983955bbdfa165e133e7557996376fe1f80adbfa317d8c352a9565022
Python
35,161
911
from datetime import datetime import re import numpy as np import pytest from pandas.errors import OutOfBoundsDatetime import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm from pandas.core.arrays import IntervalArray class TestSeriesReplace: def test_replace_explicit_none(...
923ec5fc0bc09fed607df689cc3168b7a86537ecb74f2da0ae799b435f676a10
Python
35,196
905
# cython: language_level=3 # Time-stamp: <2024-10-22 16:26:57 Tao Liu> """Module for ReadAlignment collection Copyright (c) 2024 Tao Liu This code is free software; you can redistribute it and/or modify it under the terms of the BSD License (see the file COPYING included with the distribution). @status: experiment...
aa595f719b4e699b3da81d33b833f204dbbcee82d211ac30afd9cc26e5b15d90
Python
35,204
996
import time import itertools from functools import partial from copy import deepcopy import numpy as np import torch from torch import nn import torch.nn.functional as F from utils import time_to_string, to_torch_var from criterions import dsc_binary_loss, tp_binary_loss, tn_binary_loss from criterions import focal_los...
2a8483963f809181b51b0b7b3089d242ac913bba6b4cfd8a18b704b22f065d7e
Python
35,213
855
# 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...
8107b6b020f978278bde4051785c4b6d8a1e0758a563082ecc33e62f06553ea3
Python
35,224
984
# 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...
3ddae299fddcc8d0ef1451f509e0b9b27816d885d8179b836d798b0b14aef828
Python
35,228
1,065
import pathlib from textwrap import ( dedent, indent, ) import numpy as np import pytest import pandas as pd jinja2 = pytest.importorskip("jinja2") from pandas.io.formats import style_render from pandas.io.formats.style import Styler @pytest.fixture def env(): project_dir = pathlib.Path(__file__).paren...
16ebe55993534b72ae1dc9bed2b9529fce29b5dc4fec5d8e06bf19d9d34a2683
Python
35,232
959
# 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...
8b4c8c3c49f5639c64e0c353e760a87c68bff262a5d2ab461d569dab635cf5be
Python
35,234
1,043
""" The tests in this package are to ensure the proper resultant dtypes of set operations. """ from datetime import datetime import operator import numpy as np import pytest from pandas._config import using_string_dtype from pandas._libs import lib import pandas.util._test_decorators as td from pandas.core.dtypes....
c965db097f72c370b2234edf8d237abe25ce3f5fa33b09f4cb20cc626667e0ed
Python
35,258
944
# 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...
6588a0e8f840e376786b67833866fa45ac9790beead2c8809bf8d19f501a701d
Python
35,297
1,137
""" 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...
892793a7aec5a7c5334f4c0c9da2df33b2de82b15513a7e10638f8b322b1671d
Python
35,307
742
__author__ = 'etseng@pacb.com' import pdb from collections import defaultdict, namedtuple, Counter from csv import DictReader import vcf import pysam from Bio.Seq import Seq from Bio import SeqIO from cupcake.io.BioReaders import GMAPSAMReader from .coordinate_mapper import get_base_to_base_mapping_from_sam __VCF_EX...
056c32d7cceb83b4ea51fda862e92bad3c392f5c3eca5bb204c3115162137527
Python
35,315
1,088
""" 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._...
b1e6ffda6ae02b24496b1b42a20646ebb250f7b89f513a12a4730bf31422431e
Python
35,371
840
"""Test loss classes.""" import math from typing import Literal import numpy as np import pytest import torch from kornia.geometry.subpix import spatial_softmax2d from lightning_pose.data.heatmaps import generate_heatmaps from lightning_pose.losses.losses import ( HeatmapJSLoss, HeatmapKLLoss, HeatmapMSE...
c587fe4a38c32240e9907173d93eb2f01cc6f50c4b763388420944d2e2b06bc5
Python
35,377
912
# 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...
c673469fdb1cfb6b652b129e3cc3e22127dd9bb52311dda1d5c768ee834f6408
Python
35,389
773
# this is to set the parameters for the pregnancy model for the rat # note that diabetes and unx has not been characterized so then there are no diabetes/unx options in this file import re from defs import * from values import * import time # pick out compartment IDs. E.g. given label=Area_Lumen_Cell, it would return ...
c2d7c25bf3ab03f8bab2edf7a848499b9747addf16489f64fb4c641464e85bfd
Python
35,460
764
# 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...
a68f5b4783c7bf5a8ec758e1855c66fbf3d1c395dea81d6a897d454b6a0c9622
Python
35,495
800
"""Model execution-backend logic: eager checkpoint loading, ``torch.compile()``, and ONNX/TensorRT export and runtime attachment. `_RuntimeMixin` is mixed into `lightning_pose.api.model.Model`. It owns every method that changes *how* a loaded model executes -- eager weight loading, compilation, and export/attachment o...
e46093df74490c5e445919ee097810814dd87362d052d262c8c19d2b7d01b29f
Python
35,499
953
# 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...
e79544749638c848e6a9ceb0265845a79959e76949c5498dfdbecfd3f66adae8
Python
35,590
979
"""Test cases for misc plot functions""" import os import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.tests.plotting.common import ( _check_colors, _check_legend_labels, _check_plot_works, _check_text_labels, _check_ticks_props, ) mpl = pytest.importors...
8fc2c80d471ee5c1eff42db92382c3f8d4f5e60a728a433ae493c57a6c53e93a
Python
35,592
1,023
""" 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...
482848c472cc1c5ce224a3384e825625e6df7682ae07cb6882aebabc5354c912
Python
35,607
846
# 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...
adaef54bb8ed620e31b4ba5c2c783bf2f102ddd452c0f9ba4e5076a8ffedc658
Python
35,610
1,107
""" Expose public exceptions & warnings """ from __future__ import annotations import abc import ctypes from pandas._config.config import OptionError from pandas._libs.tslibs import ( IncompatibleFrequency, OutOfBoundsDatetime, OutOfBoundsTimedelta, ) from pandas.util.version import InvalidVersion cl...
23b59bc52051acd4df3ec68902d093f6038e95cf00651003ed4dd5b346553245
Python
35,631
1,108
""" Expose public exceptions & warnings """ from __future__ import annotations import abc import ctypes from pandas._config.config import OptionError from pandas._libs.tslibs import ( IncompatibleFrequency, OutOfBoundsDatetime, OutOfBoundsTimedelta, ) from pandas.util.version import InvalidVersion cl...
155325629b5bf6ce2daff36a831654bd44f368836d4c08b68cd8b535e4930aaf
Python
35,643
897
import re import numpy as np import pytest from pandas._libs.tslibs.period import IncompatibleFrequency from pandas.errors import ( OutOfBoundsDatetime, Pandas4Warning, ) from pandas.core.dtypes.dtypes import PeriodDtype import pandas as pd import pandas._testing as tm from pandas.core.arrays import PeriodA...
f3241b1a7ef4fa62830450c183e3c6cb7fb82ce070da0417ca2d9af7e646023f
Python
35,669
550
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse from sdna.coordinator import SDNA class SDNAArgs: def __init__(self): """ Class is used to correctly parse the arguments for the tool. """ self.parser = argparse.ArgumentParser( prog="sDNA", de...
22a8c8f90e63d2c9e7af4c6155ca5ea451e1576dddbe90edb9c95cfe7372a52d
Python
35,690
704
#! /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...
15a43d6ea706eac00af8712862fe3759781c52f9c5ab2ad6d6250ec5deb1f145
Python
35,703
999
#Pytorch import torch from torch import nn from torch.nn import functional as F import torchvision.models as models from torch import Tensor from typing import Type, Any, Callable, Union, List, Optional class AdaptiveConcatPool2d(nn.Module): "Layer that concats `AdaptiveAvgPool2d` and `AdaptiveMaxPool2d`." # fro...
1e9ff55217352fdf233e5017037bbf6c58e7b95329ea465673883535c9d59b5b
Python
35,704
1,073
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):...
39d7f3c24885802c8036b061eb0bc478726b603e2b08ab7becdd779b15d8466f
Python
35,712
759
# We begin by importing all necessary libraries. import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as sts from matplotlib.lines import Line2D import matplotlib.patches as mpatches from matplotlib.cm import register_cmap from random import ...
b5b896f61bfa27968f4bf11e6a10deb3865ea8257efcb87d0489562683db9e71
Python
35,756
1,372
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...
33325c8fdde6e26b7a01a09cd1df085eed36f9e015b2d81a1dc9c13c3e9c70cd
Python
35,772
974
# 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...
6db74c299560b244b482699d7a6019936e3d1fe420eea5d6227c3a520e067b7f
Python
35,775
907
# 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...
3fc89534aa7a8dfabf724daf79f83c92e173427625cd662086b8e1d603dd8792
Python
35,808
910
from __future__ import print_function from itertools import chain import json import os import vtk, qt, ctk, slicer, logging import numpy from slicer.i18n import tr as _ from slicer.i18n import translate from slicer.ScriptedLoadableModule import * import SimpleITK as sitk import sitkUtils import traceback # # Slicer...
ff2ff573fbf3ca23f2f3addcf873c47829654a35dfb534335db81052c16d83d1
Python
35,831
819
""" Apache-2.0 license Copyright (c) 2023 Quentin Uhl, Ileana O. Jelescu Please cite my latest NEXI paper or ISMRM abstract if not yet available. """ # Implementation of the Neurite Exchange Imaging model in scipy import numpy as np import scipy.integrate # utilitary functions for jacobian, hessian and MSE jacobia...
9496408d7c2a50c90b7784d0d3980b2efc4c4328e870fc3c6fd5808308a3d287
Python
35,833
989
# 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...
d4fff3e1922daaaa691f6e3d94b95efe62509957c80e4206c1abacfcf3abed95
Python
35,876
236
""" # # # # # # STEP: germline python SVision-pro.py --target_path /data/DATA/Human_genomes/reference_based_analysis/aligned_reads/GIAB/HG002/GIAB.HG002.GRCh37.HiFi.minimap2.bam --access_path ./src/pre_process/hg19.access.10M.bed --model_path /data/home/songbo/workspace/svision-pro/sim_train_ccs/models/model_liteune...
a5081fa80b5297b40de2588be17c698756b58a2c6a74c7416d6c9d8baab1a79a
Python
35,887
896
# 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...
6ddae0f655d28573d5a31359b7325d7ce9e4f7f0a42e2cd8a772c8abef4da290
Python
35,917
869
import copy import importlib.util import json from pathlib import Path from types import SimpleNamespace import pytest import torch from pyaging.utils import resolve_feature_ranges ROOT = Path(__file__).resolve().parents[1] CLOCKS_DIR = Path(__file__).resolve().parents[1] / "clocks" METADATA_DIR = ROOT / "clocks" / ...
a56d6fc9f686e366aeec37664beaec80d2e39c503e1e440dc1846234b80db011
Python
35,919
911
# 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...
e1251956bf51e9f3338f176b2911b71a04d88667c15c7e4531035462351f34a9
Python
35,922
771
# 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...
74f4bab25aaab680263965a66750df821f88d85067cd48fc84fb4f70b8ca89b6
Python
35,928
876
from defs import * from values import * from set_params import set_torq_params import math import flux import copy import numpy as np # parameters dx = 1e-3 PI = 3.14159265 cell = membrane() celln = membrane() count=0 def conservation_init (my_cell0, my_cell1,my_celln, my_dx): # global parameters global dx...
0677266065ea25354418d916b1bdcdf4df63de03940a6420a1e9bc67781a7fd8
Python
35,975
798
import cv2 import numpy as np import os import h5py import matplotlib import tensorflow.python.keras as keras import matplotlib.pyplot as plt from scipy import stats from tensorflow.python.keras.models import model_from_json from ImSetNorm import Normalize import warnings warnings.filterwarnings("ignore", ...
a9b667a79da2493f6c780c92d88902cb5c9815f342b6a400bdab0ac4a729d4e8
Python
35,976
1,038
""" Provide user facing operators for doing the split part of the split-apply-combine paradigm. """ from __future__ import annotations from itertools import pairwise from typing import ( TYPE_CHECKING, final, ) import warnings import numpy as np from pandas._libs import ( algos as libalgos, ) from panda...
4daef017c483914752a3948d3eee6f47bdf12370b6398f97f02d37dbf3fe22e3
Python
36,013
881
import numpy as np import logging import pyfftw from numba import prange, jit, int64 from multiprocessing import cpu_count c_ = np.array([[1,0,0,0,0], [1,1,0,0,0], [1,1,1/3,0,0], [1,1,0.4,1/15,0], [1,1,3/7,2/21,1/105]]) c1_ = np.array([[0,0,0,0], ...
37a2692fef89cbe7cb761f798535142e39d4cd8f5f96fbf33e2ede9f8ecef238
Python
36,068
947
# Copyright 2020-2023 Xupeng Chen, Ran Wang # # 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 agreed to ...
dba6ab57c26d707a5ba938f13ef760a0ba5d7f7f7c639f4d8188f2c767c607b7
Python
36,115
1,004
""" test with the TimeGrouper / grouping with datetimes """ from datetime import ( UTC, datetime, timedelta, ) import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm from pandas.core.groupby.grouper import Grouper from pandas.core.grou...
777afb70c2c232b1e76a09bd30379dab6a900696acd2ea8fe84aca272d2a350e
Python
36,137
913
import re import numpy as np import pytest from pandas._libs.tslibs.period import IncompatibleFrequency from pandas.errors import ( OutOfBoundsDatetime, Pandas4Warning, ) from pandas.core.dtypes.dtypes import PeriodDtype import pandas as pd import pandas._testing as tm from pandas.core.arrays import PeriodA...
0276272f48f61d205a25bd0a43fd062fc1414d41c0af0f54577882aeb37ff104
Python
36,168
985
"""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, ...
3b8997d7a053e9c20d12106587d7081d3871305304528aaf40cb0b5ca84ebaf9
Python
36,234
940
from itertools import permutations import re import numpy as np import pytest import pandas as pd import pandas._testing as tm import pandas.core.common as com class TestIntervalIndex: index = pd.IntervalIndex.from_arrays([0, 1], [1, 2]) def create_index(self, closed="right"): return pd.IntervalInd...
e20a97f0e73e9181cc87a0c0f5dc8264b55df34b90437f05d379b425fa35811b
Python
36,239
995
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Created by Roberto Preste from sqlalchemy import Column, String, Integer, Float, ForeignKey from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship Base = declarative_base() class Main(Base): __tablename__ = "Main" id = ...
72245759c1446ac081cd0eac6191fb29130320d9d812d26ff59630222d265b2e
Python
36,258
1,158
from datetime import datetime import re import numpy as np import pytest from pandas._libs import lib from pandas._libs.tslibs import Day from pandas.errors import Pandas4Warning import pandas as pd import pandas._testing as tm from pandas.core.indexes.datetimes import date_range @pytest.fixture def dti(): ret...
c3d150756704a0354ba86dd459ebf451b35ded9c7497f7585d13da4dc1a09742
Python
36,260
978
# 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...