sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
3a72a0b4a97143a89c5c126952c2ae4ea5e829e7952036af45682ca2e8d24046 | Python | 14,190 | 337 | """Models that produce heatmaps of keypoints from images."""
from typing import Any, Literal
import torch
from jaxtyping import Float
from omegaconf import DictConfig, ListConfig
from lightning_pose.data.bboxes import model_to_frame_batch
from lightning_pose.data.datatypes import (
HeatmapLabeledBatchDict,
M... |
7edc6d1282fa5c4c38e0dc1ca71d4d1e367ff80f6eb71b1950f497829b10d9b7 | Python | 14,192 | 387 | import gzip
import sys
import types
import numpy as np
import pytest
from MACS3.IO.BedGraphIO import bedGraphIO
from MACS3.Signal.BedGraph import bedGraphTrackI
# Provide lightweight Cython stubs so the module imports without compiled extensions.
cython_stub = sys.modules.get("cython")
if cython_stub is None:
c... |
54a071f9bb59c2e27b923b9f6be797283c626dce3e40a8d82bb50b14d7ddc909 | Python | 14,196 | 394 | # Copyright 2018-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... |
0391efcd926f58787bbffb8063eb3fab18c061f7142b59a6ad8934e113c40393 | Python | 14,201 | 385 | # -*- coding: utf-8 -*-
# @File name: shutter_functions.py
# @Author: Alicia Garrido-Peña
# @Date: 2023-08-09 19:39:03
# @Contact: alicia.garrido@uam.es
# "Copyright (c) 2023 Alicia Garrido-Peña. All Rights Reserved."
# Use of this source code is govern by GPL-3.0 license that
# can be found in the LICENSE file
# ... |
0641ae11d14e088ff391e7c0ca4c023b73d3e198ae31beef0eb1f31967a9df0d | Python | 14,201 | 406 | import torch
import numpy
import matplotlib.pyplot as plt
import bionetwork
import plotting
import pandas
from scipy.stats import pearsonr
import seaborn as sns
from scipy.stats import mannwhitneyu
from sklearn.linear_model import LinearRegression
#Load network
networkList, nodeNames, modeOfAction = bionetwork.loadNet... |
6f346b7401bd6cc289085724ba09d31c530b0fd8eab988f9f81b667b4b57c57d | Python | 14,209 | 446 | """
Tests that work on the Python, C and PyArrow engines but do not have a
specific classification into the other test modules.
"""
import codecs
import csv
from io import StringIO
from pathlib import Path
import pytest
from pandas.errors import (
EmptyDataError,
ParserError,
ParserWarning,
)
import pan... |
e0af34bd5f672b91b3da1dc989663990bebe41b691bd835cd4b48bced8a54357 | Python | 14,211 | 455 | 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... |
1a5250b49b1291747ba2a3d1a10c4ca8278f66fc0c041013830013e66db78255 | Python | 14,220 | 330 | import argparse
import os
import re
import pickle
import pandas as pd
pd.options.mode.chained_assignment = None
from cdr.kwargs import MODEL_INITIALIZATION_KWARGS
from cdr.config import Config
from cdr.io import read_tabular_data
from cdr.formula import Formula
from cdr.data import filter_invalid_responses, preproces... |
0f9590a5e94b69b0632e8edf0f20c60dae54b434f62d152bb18729b076541bdf | Python | 14,225 | 324 | import os, sys, gzip, subprocess
import csv
from csv import DictReader, DictWriter
from collections import defaultdict
from multiprocessing import Process
from Bio import SeqIO
import pysam
from bx.intervals.cluster import ClusterTree
import cupcake.io.BioReaders as BioReaders
csv.field_size_limit(100000000)
def co... |
47d6e02f5bcd6e12cf667a09ca0e979d0579715208d107b565b540b51b5f9fcc | Python | 14,225 | 446 | """
Tests that work on the Python, C and PyArrow engines but do not have a
specific classification into the other test modules.
"""
import codecs
import csv
from io import StringIO
from pathlib import Path
import pytest
from pandas.errors import (
EmptyDataError,
ParserError,
ParserWarning,
)
import pan... |
b70f5ccac158d566a3234b02bfea13400076b7bf42c0e21049a5755f3395bc00 | Python | 14,236 | 380 | """
Create summary statistics / plots for runs from
evcouplings app
Authors:
Thomas A. Hopf
"""
# chose backend for command-line usage
import matplotlib
matplotlib.use("Agg")
from collections import defaultdict
import filelock
import pandas as pd
import click
import matplotlib.pyplot as plt
from evcouplings.util... |
6d248b27228cb4ed67f2e3a5d66d56e8a90522daa30ba35aff54a0a713ee2811 | Python | 14,242 | 389 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
import pandas.core.common as com
class TestSample:
@pytest.fixture
def obj(self, frame_or_series):
if frame_or_series is pd.Series:
arr = np.random.default_rng(2).standard_normal(10)
else:
... |
0156892baf43154c7208ee8e263fa313c166a5381e9fec6855dc795af3a91919 | Python | 14,244 | 427 | import collections
from datetime import timedelta
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.base.common import allow_na_ops
def test_value_counts(index_or_series_obj):
obj = index_or_series_obj
obj = np.repeat(obj, range(1, len(obj) + 1))
result ... |
7c9e3abe7e036b1b51235d49d7bda40319500afe0036b0514c5df35f9d0f48f0 | Python | 14,244 | 427 | """Histogram view."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import logging
import numpy as np
from phylib.io.array import _clip
from phy.gui.widgets import view_settings_dialog
from p... |
bdb285393551d02332c41067ad986ec84ccf5bd128145209ce399316dc5411e1 | Python | 14,250 | 481 | """Plotly-native time-series diagnostics.
Functions:
- ``forecast`` — point predictions with optional confidence band against
the actuals.
- ``decomposition`` — additive/multiplicative trend / seasonal / residual
via statsmodels' ``seasonal_decompose``.
- ``residual_diagnostics`` — 4-panel: residuals over time, h... |
39b7ed5bdfa68a3a15f3ec42986a69538702d7b221850ecc41c9a0fe0cafb7e2 | Python | 14,259 | 256 | import fileinput
import re
import tree
#import model
import quants
#import argparse
import sys
import argparse
parser = argparse.ArgumentParser(description='Print eventuality (semantic) dependencies for GCG tree.')
parser.add_argument('-d', '--debug', default=False, required=False, action='store_true', help='print de... |
34c14e2165c28d464dd47bd1aad1b457901907d153f2ec0d650cc3b5a919147e | Python | 14,263 | 469 | # -*- coding: utf-8 -*-
"""
This script generates plots for Figure 2, and SI Figures 3 & 4. Note that panel
H is plotted in its own script, ode_mpc.py
Note that it uses microscopy images for some plots and can not be reproduced
from the zenodo archive data only.
Created on Tue Jul 12 16:16:25 2022
@author: jeanbapt... |
d92cfe4a38b339a1603a90440c0272ccf4ffe6757a04fb46ce4f5c60ba34d173 | Python | 14,264 | 349 | import os
import numpy as np
from scipy.integrate import simps
from numpy import exp, linspace
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import gridspec
from scipy.interpolate import griddata
from scipy.spatial import distance
from kcsd import csd_profile as CSD
from kcsd import KCSD3D
... |
cb188cd60f1ea1d26f8f3b03e0d9c2c997d478805f47041ea6db009942087abd | Python | 14,268 | 474 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
@pytest.fixture
def dummies_basic():
return pd.DataFrame(
{
"col1_a": [1, 0, 1],
"col1_b": [0, 1, 0],
"col2_a": [0, 1, 0],
"col2_b": [1, 0, 0],
"col2_c": [0, 0, 1]... |
e4eb4cbf55ae40cf8f99e92500745e64cc6cece675caa956cacbd7370a35bfc6 | Python | 14,277 | 328 | import sys
import numpy as np, matplotlib.pyplot as plt, networkx as nx, pickle, json, gzip
import pandas as pd
import itertools
import statistics as stats
#import seaborn as sns
import os
# INPUTS
CELL_BCS_PATH = str(sys.argv[1]) #input cell barcode whitelist from preprocessing
BAR_REF = str(sys.argv[2]) # input r... |
fcfa5ce66edab3c3c7bb6a4b4c7a3a91ccf53a5f50452dc3dd55e2954a6841c9 | Python | 14,278 | 454 | from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
from pandas._libs import (
algos as libalgos,
internals as libinternals,
lib,
)
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.cast import (
ensure_dtype_can_hold_na,
find_common_ty... |
91296a5240d7248d8e607b8671123705b50c68038e43fea3d0f7b1bed73f75ca | Python | 14,293 | 328 | r"""
SMPL/MANO/SMPLH parametric model. Modified from https://github.com/CalciferZh/SMPL.
"""
__all__ = ['ParametricModel']
import os
import pickle
import torch
import numpy as np
from model import math as M
class ParametricModel:
r"""
SMPL/MANO/SMPLH parametric model.
"""
def __init__(self, of... |
a123393a86e1862b36e5178df301d29e71c8282dd77b7c573194d75cdf25e558 | Python | 14,293 | 440 | """
Tests column conversion functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
from dateutil.parser import parse
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
def test_converters_type_must_be_dict(all_parsers):
parser = all_... |
b45da0b5d544abae10faa5d529a0786d023f093b654a8da621ef6653c91e38f8 | Python | 14,295 | 478 | # 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... |
bd80acdb3c8bbc27ca2cb2ab6d1daae6b6e6663681afd6c228615038ec90896a | Python | 14,308 | 265 | import numpy as np
import torch
import torch.utils.data as data_utils
from torchvision import transforms
import argparse
import torch.optim as optim
from torch.autograd import Variable
import os
import shutil
from pathlib import Path
from functions_PAPQMNIST import list_files_in_folder, create_save_dir, PAPQMNIST_Bags,... |
389d1754e0189f3dbb34af694665ec02af0d90f533d546433134c2389038e5dc | Python | 14,317 | 398 | """Visualize fiber photometry data."""
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from ..preprocess.fp_data import smooth_trial_data
from .fp_viz_utils import _make_ax, savefig, set_trialavg_aes, style_plot
# define color palette:
kp_pal: list... |
0abb788fc9bc0732688589a2965c6aab6c2ee030a91dcb58977e906b42d37d62 | Python | 14,325 | 288 | # 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... |
a85f05965563eb9e7aaddef39bd507a3605a6976073c8bd4c8b9a8d3ecae56f9 | Python | 14,338 | 374 | import os
import pandas as pd
import re
import numpy as np
from scipy.stats import ttest_rel, ttest_1samp
import statsmodels.api as sm
pd.set_option("display.max_colwidth", 10000)
class ResultsGenerator(object):
# Metrics to include in paper results tables
paper_metrics = ["Accuracy", "Balanced Accuracy", "A... |
ee15a2eabb3964d5ecc905986fcc7c1cd47347580783f6c694297e6c6ac080e7 | Python | 14,338 | 385 | # 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... |
4fe5fdc0d5b1b3b1a45c328ce189b97e4e9e9326d930788965b7a9371332ae8a | Python | 14,345 | 362 | # -*- coding: utf-8 -*-
'''
DBSCAN_WRANGLER_GUI
PYSIMPLEGUI BASED GUI TO PERFROM META ANALYSIS OF METRICS PRODUCED BY DBSCAN AND VORONOI CLUSTERING
Design and coding: Tristan Wallis and Sophie Hou
Queensland Brain Institute
The University of Queensland
Fred Meunier: f.meunier@uq.edu.au
REQUIRED:
Python 3.8... |
89b8588a36da8bef5252ea9afaba2a5d505c6ddeb21c0f0294cececdc494638a | Python | 14,345 | 455 | """Plotting interface."""
# ------------------------------------------------------------------------------
# Imports
# ------------------------------------------------------------------------------
import logging
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.ba... |
26ee33691311cf3333f039fcf1e96420ef56a770a0347d9505cbad349e6adb99 | Python | 14,354 | 363 | # -------------------------------------------------------------------------------------------------------------------------------------
# Following code curated for GCPNet (https://github.com/BioinfoMachineLearning/GCPNet):
# ----------------------------------------------------------------------------------------------... |
32b66dd7ec262013cfeb02089287908e57bc3db948045053b85eba7ec9b2e5c8 | Python | 14,356 | 405 | """Tests dealing with the NDFrame.allows_duplicates."""
import operator
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
not_implemented = pytest.mark.xfail(reason="Not implemented.")
# ----------------------------------------------------------------------------
# Preservation
cl... |
7e5d50ca64a900ef1cf0b25c2168b83a93394ea367b465b27fd92f0afe009cd8 | Python | 14,364 | 390 | # 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... |
b7e58a27a82428e181adf11b268c566f84dab63c1c3e20c179fffef224b66d6b | Python | 14,368 | 204 | import psycopg2
import pdb
from sqlalchemy import create_engine
import sqlalchemy.orm as orm
import os
import sys
import pandas as pd
import datetime
import numpy as np
import json
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(_... |
218ecbfb6c1b7d25a97dfbb9be3978c9238e49f812176dd653818738a847bbfa | Python | 14,374 | 395 | import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from glob import glob
from datetime import datetime
from tools.cnt2par import counts2mol
import pickle as pkl
root_folder = ''
data_path = root_folder + '/pickle/'
plot_path = root_folder + '/plots/'
pickle_files = glob(data_path + '*.pkl')
pi... |
58c799b6cb4e479ac5ed9150397715d49f708f3255fb691434159dff206bdeca | Python | 14,374 | 460 | """
@author: mkowalska
"""
import os
from os.path import expanduser
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from kcsd import csd_profile as CSD
from kcsd import ValidateKCSD1D, SpectralStructure
__abs_file__ = os.path.abspath(__file__)
def makemydir(directory):
"""
Cre... |
404278576c0704a7dbad8ad3e2711fd8ad3f8b95d50fca4fd4374175b03844c6 | Python | 14,392 | 276 | # 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, copy, modify, merge, ... |
3898a476fadcae3490e9aa7bcaf7738c3aaeb020011cd61294ed0e3dcb50089e | Python | 14,407 | 405 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-#
#
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... |
ae5931cc1d90c84bb54007df08e4e126a8be2b114e3fed49adeff716e2f9c0a2 | Python | 14,407 | 394 | """Decision logic for issue-assignment automation.
Every function here takes Python data and performs no GitHub I/O, so the rules
can be exercised directly in ``scripts/tests/test_issue_assignment.py``. The
``TypedDict`` classes below document the record shapes produced by
:mod:`client` and consumed here.
"""
from __... |
eb4bfb03f6f7eadc2c5cccce62548692ea3ebfd6168f4cca46d1478d47703b94 | Python | 14,415 | 450 | # 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... |
8b599d48ad103ec4f73030a3c58b9bea41726ce49aa2c56e60f336f3c4f87b2f | Python | 14,419 | 335 | import configargparse as cfargparse
import os
import torch
import onmt.opts as opts
from onmt.utils.logging import logger
from onmt.constants import CorpusName, ModelTask
from onmt.transforms import AVAILABLE_TRANSFORMS
class DataOptsCheckerMixin(object):
"""Checker with methods for validate data related options... |
559711bbcfc8f990282481b7a8b24d9f7172f63a33549c41e1cc48ecd11b5f27 | Python | 14,422 | 359 | ''' denormalize_s3.py
Denormalize an S3 bucket (with a Template/Library prefix).
Two files are written to the Template/Library prefix:
keys_denormalized.json: list of image files in Template/Library
counts_denormalized.json: count of image files in Template/Library
Two files are created in each ... |
73399c30e1349a1287c4f770af2a431ab5ade62a9d3fa5cc63210cc63c7b2206 | Python | 14,422 | 317 | import numpy as np
import pandas as pd
import open_ephys_IO
import PostSorting.parameters
import math
import gc
from scipy import stats
import os
import control_sorting_analysis
import PostSorting.vr_stop_analysis
import PostSorting.post_process_sorted_data_vr
import PostSorting.vr_make_plots
import PostSorting.vr_cued... |
8b91514d5796945239f2f377dbd6b572560c33c69175167c4988686e8bf3df2d | Python | 14,423 | 379 | # 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... |
6d27511c7ff81eec3f0225a1c14a89b75deaba9662e8234a5982a6283503bb9b | Python | 14,425 | 391 | import datetime as dt
from itertools import combinations
import dateutil
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
class TestAppend:
def test_append(self, sort, float_frame):
mixed_frame = float_frame.copy()
mixed_frame["foo"] = "bar"
begin_index ... |
3a2acf5de7dfb887f7fa582dbbb73d146047a1e8b6a9e5db48211aaaf0bf4d1e | Python | 14,431 | 447 | # 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... |
88441f2426dd2d3fb6bbe8a90fe9493b2fbb2edef6341e66dc3868eef1357978 | Python | 14,434 | 348 | import torch
from copy import deepcopy
from onmt.utils.misc import tile
class DecodeStrategy(object):
"""Base class for generation strategies.
Args:
pad (int): Magic integer in output vocab.
bos (int): Magic integer in output vocab.
eos (int): Magic integer in output vocab.
u... |
64b836dd89b4c781167a0f523b83f44f3d8412276fb7adc1cb98dc3227c56768 | Python | 14,436 | 430 | # 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... |
24741e46beeebd4cc582133d3cb188f1ca48ab03f89e1e7ca2e80d248d7a0b0e | Python | 14,445 | 323 | import matplotlib.pyplot as plt
import numpy as np
import pumpprobe as pp
import sys
import pandas as pd
import matplotlib.cm as cm
import wormdatamodel as wormdm
import wormbrain as wormb
from scipy import stats
import scipy as sp
import matplotlib.pylab as pl
from pumpprobe import provenance as prov
# List of datase... |
2cec4b3192cabf1c1f02cc76a722e1f834c6f0cff87ebbeee22d081fc83f5ca2 | Python | 14,462 | 365 | # 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... |
03715dcf6a4385d2b1adec358ce450836f7f4a1dd0ec3115eea17e3afafd4544 | Python | 14,477 | 389 | import itertools
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import NumpyEADtype
import pandas as pd
import pandas._testing as tm
from pandas.api.extensions import ExtensionArray
from pandas.core.internals.blocks import EABackedBlock
class BaseReshapingTests:
"""Tests for reshaping and conc... |
5c4c22224e55e91b95e7bbe2e718b729f0586ae3676c65c08e2b868f1e3bcd31 | Python | 14,477 | 353 | #!/usr/bin/env python
import re,sys,os,argparse
from argparse import RawTextHelpFormatter
###################################################
### 0. script description and parsing arguments ###
###################################################
synopsis1 = "\
from a summary of OrthNets or OrthoFinder clusters, or a... |
2cf244c8ecd6d360e9d9c178f6e10bfb1520454734cbb7e668864821a0858bc9 | Python | 14,478 | 371 | # 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... |
241992de2984906f3d282e3106e25ce37c974d828e683be74c4f01e954f62462 | Python | 14,482 | 433 | # Copyright 2018-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... |
4ccfdf7011d03c098384f5dd6613ce548da02cd3c6d107afe788ca4c350e0518 | Python | 14,482 | 407 | # 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... |
2b179b2a6d5eaf80f8df5e6674bb578f05c3321e768109e21fec2df6354e2822 | Python | 14,484 | 378 | """Test computation of emodulus"""
import pathlib
import tempfile
from PyQt6 import QtCore, QtWidgets
import dclab
import h5py
import numpy as np
from shapeout2.gui.main import ShapeOut2
from shapeout2 import session
import pytest
datapath = pathlib.Path(__file__).parent / "data"
def make_dataset(medium="CellCarri... |
8092d3b12af1a5bfbd49c21c81636b0406c6245b7be19380a580649c9a15148b | Python | 14,484 | 408 | """
Tests for statistical reductions of 2nd moment or higher: var, skew, kurt, ...
"""
from decimal import Decimal
import inspect
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
class TestDatetimeLikeStatReductions:
def test_dt64_mean(... |
de54ffd564494f7ebce3be6528652af0bc17ca4ffd83acbad8c9d8b4844dd0fe | Python | 14,486 | 321 | conda create -n xclone python=3.7
conda activate xclone
pip install git+https://github.com/single-cell-genetics/XClone
pip install requests
pip install importlib-metadata
### validate the xclone on TNBC
import xclone
import anndata as an
import pandas as pd
import numpy as np
import scipy
print("scipy", scipy.__versio... |
adc313c91498c9443a8667717e5c1606cd43ebda60a85ca96a40b8c5534f367c | Python | 14,489 | 351 | import sys
import os
import argparse
import pandas as pd
import numpy as np
# Thanks to SO user gbtimmon (https://stackoverflow.com/users/1158990/gbtimmon) for this wrapper to prevent modules from printing
def suppress_output(func):
def wrapper(*args, **kwargs):
with open(os.devnull,"w") as devNull:
... |
51681136408f8c7a024711b9fa1cfe2436ddaeb64fd347fc58a47adf73d49cda | Python | 14,493 | 381 | import numpy as np
import random
import glob
import pickle
from math import log, ceil
# ECS_MeDiv algorithm
def calculate_counters(data_sets, c_threshold=None, w_factor="fraction"):
"""Calculate 1-similarity, 0-similarity, and dissimilarity counters
Arguments
---------
data_sets : np.ndarray
... |
5bc1a0987512a0dca1fceb0ab4d3777a554b38116a663f31dffb0de782a1ad93 | Python | 14,494 | 392 | import pickle
import numpy as np
import pytest
from pandas._libs import (
Timedelta,
lib,
writers as libwriters,
)
from pandas.compat import IS64
import pandas as pd
import pandas._testing as tm
class TestMisc:
def test_max_len_string_array(self):
arr = a = np.array(["foo", "b", np.nan], dt... |
56a82ae565f44d3246e3888a3b2d55ea5a9a7a6a09e550e25b346bd2f9cb12da | Python | 14,508 | 418 | # 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... |
3a02f705ce0eaa6941619265d5e33bddfb58f3efaabcec4b9a772863daf304ef | Python | 14,511 | 411 | """Tests for VelocityModel and ZDiffScore."""
from __future__ import annotations
import numpy as np
import pandas as pd
import pytest
from pcntoolkit.dataio.norm_data import NormData
from pcntoolkit.longitudinal.correlation_matrix import CorrelationMatrix
from pcntoolkit.longitudinal.velocity_model import VelocityMo... |
cf38c18146631192ad1a4caf5a405895b89bbe7151cb48f2494775426c675755 | Python | 14,514 | 341 | # -------------------------------------------------------------------------------------------------------------------------------------
# Following code curated for GCPNet (https://github.com/BioinfoMachineLearning/GCPNet):
# ----------------------------------------------------------------------------------------------... |
24022146e541a5881bfce97b5d955fd10e91e56f88aff32b2d8c654c9424084d | Python | 14,517 | 327 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.txt" for terms and conditions of usage.
##
## If you use this work or... |
5b0969f0526ec77d55e6e947e96c45a9a4d56770e74e549c9fe485e3f567fb87 | Python | 14,519 | 490 | """
Also test support for datetime64[ns] in Series / DataFrame
"""
from datetime import (
datetime,
timedelta,
)
import re
from dateutil.tz import (
gettz,
tzutc,
)
import numpy as np
import pytest
from pandas._libs import index as libindex
import pandas as pd
import pandas._testing as tm
def test... |
3e812e34344705d9df9193be66f9fc6b529c6e092574bef1af8431df8e56d4ae | Python | 14,522 | 424 | # 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... |
c85e7f700cf60e874e87a969055aff7b3c11c2ee1ed3fa239fc5ffb6c8154245 | Python | 14,530 | 344 | __author__ = 'etseng@pacb.com'
"""
ex:
?CAACTTATTGTCCC 0 1 0 0
?CACCT?ATTGTCCC 0 1 0 0
?CA?CTTATTGTCCC 0 1 0 0
G?ACTGCGGAACTTT 0 1 0 0
GTAAT?CG?A?TTCT 0 1 0 0
GTAATGCG?AACTTT 0 2 0 0
we have:
1. list of haplotypes (ex: "AAT", "A?T", "ATG") and the weight of each haplotype
2. list o... |
212db69e25c502b617f2888ae6debe280bc2e0c8b012f3af4cb0748c92f310bd | Python | 14,551 | 473 | # 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... |
875f9a5f8e85fa014eb88322317271f9ef11ef1e23675f98c86978f38873cec3 | Python | 14,556 | 400 | """
Utility functions related to concat.
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
cast,
)
import numpy as np
from pandas._libs import lib
from pandas.util._decorators import set_module
from pandas.core.dtypes.astype import astype_array
from pandas.core.dtypes.cast import (... |
2d44ee518a969ae57dbaead1d5744616c5e731fca66bec76608dd01de314a29c | Python | 14,579 | 464 | # 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... |
31f3178f72719f37deb942b85e50d5046e8b7df7034d8e5be0308d3ddd5f086e | Python | 14,589 | 328 | import pysam
import random
import os
def allele_alter(sv_info):
type = random.choice(["denovo", "inherit"])
denovo_num = 0
if type == "denovo":
father_allele = 0.0
mother_allele = 0.0
else:
father_allele = 0.0
mother_allele = 0.0
while father_allele + mother_a... |
59a413023aabc523b15c26ae460d06baa2ca25c34e5af6c8f381c2903c46ae47 | Python | 14,597 | 442 | import io
import numpy as np
import pytest
from pandas._config import using_string_dtype
from pandas.compat import HAS_PYARROW
import pandas as pd
import pandas._testing as tm
from pandas.util import _test_decorators as td
from pandas.util.version import Version
@pytest.fixture
def fsspectest():
pytest.import... |
b5140bb92456c18dbb1081c20cc5fd8cfd5e7ef11c27632215a480ba1834f011 | Python | 14,603 | 454 | # Module: containers.models.clustering
# Author: Moez Ali <moez.ali@queensu.ca> and Antoni Baum (Yard1) <antoni.baum@protonmail.com>
# License: MIT
# The purpose of this module is to serve as a central repository of clustering models. The `clustering` module will
# call `get_all_model_containers()`, which will return ... |
7ac6a6160301fd1805d961221459e1a919141a5febd7fa3ea0556e128b112be0 | Python | 14,610 | 459 | # -*- coding: utf-8 -*-
"""
These are some useful functions used in sKCSD methods,
This was written by :
Michal Czerwinski, Chaitanya Chintaluri, Joanna Jędrzejewska-Szmek
Laboratory of Neuroinformatics,
Nencki Institute of Experimental Biology, Warsaw.
N-D Bresenham line algo Copyright 2012 Vikas Dhiman
Permission i... |
e9cf28d6662362d15447bf77362b52a0e18181195fe7b6f3959207ee209ee007 | Python | 14,610 | 302 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 19 10:31:16 2023
@author: lonya
"""
#%% preset
import tkinter as tk
import tkinter.filedialog as fd
import pickle
import os
import matplotlib.pyplot as plt
import pandas as pd
import my_funcs as mf
import seaborn as sns
#%% Load all single animal gaits
root ... |
f0dc924d1eabe663d0dcf976c8b86c8477b6019140057143a6c2620aecd40aa6 | Python | 14,623 | 418 | # 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... |
58fbed091b828072ff89be953fa9c0a544bd5211d6f464bb61f513942b8db9c1 | Python | 14,635 | 464 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 26 15:11:07 2017
@author: Joanna Jędrzejewska-Szmek, Jan Maka
"""
import os
import sys
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.widgets import Slider, Button
import kcsd.sKCSD_utils as sKCS... |
e311cbc547262aa7072abd6f5a99de00a0e41457951ec0e89808894f13cddf51 | Python | 14,637 | 417 | import pandas as pd
import numpy as np
from pathlib import Path
import pydicom
import os
import nrrd
# Images should be downloaded from Duke-Breast-Cancer-MRI Dataset on TCIA
# https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=70226903
# Download should be done using descriptive file path. There is an... |
82a29f87b5da6a2881e565e3f98b88600c839335d0585d27cd433d5b133ddf09 | Python | 14,642 | 393 | # -*- coding: utf-8 -*-
"""
Hunting Behavior Analysis Script
Main script for analyzing mouse hunting behavior from video pose tracking.
Processes video files, DeepLabCut tracking data, and generates comprehensive
behavioral analysis including approach detection, contact events, and spatial distributions.
Auth... |
2d45c24b3cd2eca97976425949cfdfe60650c345d54a1c073fdfaff129ca8994 | Python | 14,647 | 424 | # 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... |
0dc1be4eb82667cbeecc2286cc1fdac0590e1634b2870e5959f79492301498b1 | Python | 14,648 | 348 | #######################################################################
#
# Tests for utils.py functions
#
# RUN BY:
# python -m pytest -v tests/test_utils.py
#######################################################################
import os
import numpy as np
import nibabel as nib
from utils import fetch_subject_a... |
e24ffcd8c35866e7407916d999b50d75e38a6f0781481e22aa1a07ee532f2112 | Python | 14,648 | 385 | """
twixtools: provides reading and limited writing capability of Siemens MRI raw
data files (.dat).
@author: Philipp Ehses (philipp.ehses@dzne.de)
"""
import os
import re
import numpy as np
from tqdm import tqdm
import twixtools.twixprot as twixprot
import twixtools.helpers as helpers
import twixtools.md... |
f01d9de5f115e94d7d04593a0f8cf63e609ce09418258850c83902c3ea021605 | Python | 14,666 | 467 | #!/usr/bin/env python
from __future__ import print_function
try:
import numpy as np
except ImportError:
print("'numpy' is not installed. Use the command below to install it:")
print(" sudo apt-get install python-numpy")
try:
import scipy.io as scipy_io
except ImportError:
print("'scipy' is not... |
02db69f7856ac6eb63aeb53fdb788954060406f0f8f61b38e8f1af2ad02ecc71 | Python | 14,686 | 416 | # -------------------------------------------------------------------------------------------------------------------------------------
# Following code curated for GCPNet (https://github.com/BioinfoMachineLearning/GCPNet):
# ----------------------------------------------------------------------------------------------... |
c25862d601657a7e7baa3d1b7785e5a205036bd18b387d300f16e414d19e4ab7 | Python | 14,691 | 299 | #!/usr/bin/env python3
"""
Description:
This module fits KDE on Isoform Fraction (IF) distributions to search for separation between- case and control samples. P-value threshold is then used to select significant events out of all candidate DTU events.
Usage:
./dtu_detection.py -i <dominance_selected_ifs.txt> ... |
1b8f2621424ac63832a2ca40cda2a12622ddbb1792d31929f91ce2697d576b5b | Python | 14,693 | 386 | from collections.abc import Sequence
import torch
from mrpro.utils import RandomGenerator
def test_bool() -> None:
"""Test bool method for valid boolean return."""
rng = RandomGenerator(seed=42)
value: bool = rng.bool()
assert isinstance(value, bool)
def test_float32(low: float = 0.0, high: float =... |
edcbcfd74c98c649a2e45a872cb5e74666762c393c7ff9ac6cc63aab27541c46 | Python | 14,713 | 375 | import hashlib
import os
import re
import shutil
import subprocess
import sys
import tarfile
import tomllib
from pathlib import Path
import yaml
ROOT = Path(__file__).resolve().parents[1]
MAKEFILE = (ROOT / "Makefile").read_text(encoding="utf-8")
HF_README = ROOT / "clocks" / "huggingface" / "README.md"
GITIGNORE = (... |
0ea63f10715f45cacce53523e536df19f9c473d3c886e0ad498d30b13dd63205 | Python | 14,716 | 387 | """Cartesian Sampling Operator."""
import warnings
import torch
from einops import rearrange, repeat
from typing_extensions import Self
from mrpro.data.enums import TrajType
from mrpro.data.KTrajectory import KTrajectory
from mrpro.data.SpatialDimension import SpatialDimension
from mrpro.operators.LinearOperator imp... |
28d53af303d0e6f1213e73e7631e1ed54a6617d5e99e4028b1ec743c766b18d1 | Python | 14,719 | 465 | import gzip
import io
import os
from pathlib import Path
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.parametri... |
efc620f2a6038033fb01b233537a28f793d184b1d79b8b963f639459ab47dcf1 | Python | 14,720 | 455 | # --------------------------------------------------------
# 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
# --... |
83156c2fcd92ac83bb8c2c853f0c712be8fc60bbbd03f49d29fdf62da9b20534 | Python | 14,730 | 418 | # 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... |
217186e49ec6e3d085cfbd73cc60b8e500c41fdfd50290b83786ec8445043b7b | Python | 14,737 | 365 | from torch.utils.data import Dataset
import numpy as np
import os, cv2, time, math
from PIL import Image
from torchvision import transforms
from datasets.data_io import *
from datasets.utils import *
# the DTU dataset preprocessed by Yao Yao (only for training)
class MVSDataset(Dataset):
def __init__(self, datap... |
b6ae5d8cd80a21f7bc1c61ef80d1b19ef1e63ea27c6e4b6214a27b311e0d8976 | Python | 14,739 | 336 | from spycon.spycon_inference import SpikeConnectivityInference
import elephant
import neo
import quantities
import numpy
import multiprocessing
from itertools import repeat
from scipy.stats import norm
from tqdm import tqdm
class CoincidenceIndex(SpikeConnectivityInference):
"""
Coincidence index (CI) method ... |
a8082ff6857c91ed857b6f95ce1ee2deb9ca139915e3ab2cf099bad63407e834 | Python | 14,741 | 356 | from matplotlib import pyplot as plt
import pandas as pd
import os
import numpy as np
import scipy as sc
import pylab as pl
import seaborn as sns
def fmeasure_curve(f, p):
return f * p / (2 * p - f)
def plot_fmeasures(fstepsize=.05, stepsize=0.001):
"""Plots 10 fmeasure Curves into the current canvas."""
... |
9abb3647dd55f862ebcaff0d17c954311bd3fcb3855745f91e37c33f84ebcc4d | Python | 14,762 | 445 | # 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... |
125797c979e5762a4245e2037bd3be5ea1d9dbf3ca86ea07d455f171d7da0b6d | Python | 14,768 | 568 | """
Operator classes for eval.
"""
from __future__ import annotations
from datetime import datetime
from functools import partial
import operator
from typing import (
TYPE_CHECKING,
Literal,
)
import numpy as np
from pandas._libs.tslibs import Timestamp
from pandas.core.dtypes.common import (
is_list_l... |
f7c8c081808858099ab52869176d423d035ee185e7147940ded6e85ccd96db8b | Python | 14,782 | 401 | # 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... |
b37ca2e36b5ae31efe832b48b219a48df9ac4b1c958760c723e6b3d6f74a8250 | Python | 14,790 | 368 | from initialization.config import *
from initialization.initialization import *
from data_processing.data_wrangling import *
import numpy as np
import pandas as pd
import os
import scipy
import scipy.stats as st
import seaborn as sns
import matplotlib.pyplot as plt
import plotly
import plotly.graph_objects as go
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.