sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
dbadb617073b8207d65c31d40a73f8252d43c000e4efba9a5a7e0e376d58280e | Python | 24,368 | 667 | # 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... |
5f004d43fe9ead8e5ce7ea13ff57eeae9737ada0d987c32bbe82b42aa39d946c | Python | 24,369 | 677 | """Classes for representing datasets of images and/or coordinates."""
import copy
import inspect
import json
import logging
import os.path as op
import numpy as np
import pandas as pd
from nilearn._utils import load_niimg
from .base import NiMAREBase
from .utils import (
_dict_to_coordinates,
_dict_to_df,
... |
ce399fdb4d5f7f25230e5d99f20da96599c25415b87aa880080da597d7a9a7c0 | Python | 24,383 | 573 | ######################
### Import Library ###
######################
# my library
from molgraph.molgraph import *
from molgraph.substructurevocab import *
from molgraph.utilsmol import *
# standard
import os as os
import pandas as pd
import numpy as np
import pickle as pickle
import csv as csv
from tqdm import tqdm
# ... |
3f10d529767007dd1e307a14f5d37a7611888cbbacd1d8780e7b2194cb6a19a6 | Python | 24,425 | 698 | """
Quantilization functions and related stuff
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Literal,
cast,
)
import numpy as np
from pandas._libs import (
Timedelta,
Timestamp,
lib,
)
from pandas.util._decorators import set_module
from pandas.core.dtyp... |
837909a11120dcc3c5342294b9c34411584f0c4999ed998f18a4e738808e13cc | Python | 24,428 | 412 | #!/usr/bin/env python3
# MIT License
#
# Copyright 2024 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 u... |
652edaa876c9e4e4a69fe5b571d05566157468fe6b354a494e622ea3c6f520af | Python | 24,457 | 506 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Step S5 (CheckM branch): Deep-learning-based outlier bin removal.
CheckM-specific implementation of DL-based outlier removal using
CheckM quality reports in combination with learned models.
"""
from Bio import SeqIO
import os, copy, math, glob, gc
import numpy as np
... |
6d1cbc5a978e77d698451154e26050839e2cd71f2ca7a8e9853c97d19073cc11 | Python | 24,466 | 585 | import os
import numpy as np
import torch
import torchvision.transforms as trn
import torchvision.transforms.functional as trn_F
import cv2
from PIL import Image as PILImage
import skimage.color as skcolor
from skimage.util import random_noise
import numbers
from wand.image import Image as WandImage
from wand.api impor... |
65a1f3d84b415e3ee68ff05ef4657b436ca3dc29f9804615be5e9da1df23313e | Python | 24,489 | 620 | # 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... |
b23c0793492a63cb637350800287a4192830f7e1a5037e5db5201348590eb9ab | Python | 24,496 | 700 | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
---
This code borrows heavily from the DimeNet implementation as part of
pytorch-geometric: https://github.com/rusty1s/pytorch_geometric. Licens... |
02f1b03ed95232691ac6f7a7e2911281f335236e5b4d9d0678d5cd27e43c47c8 | Python | 24,503 | 836 | from __future__ import annotations
from abc import (
ABC,
abstractmethod,
)
from functools import cached_property
import sys
from typing import TYPE_CHECKING
from pandas._config.config import _global_config as config
from pandas.io.formats import format as fmt
from pandas.io.formats.printing import (
get... |
fffceba7633638e5dd3f71a84e71e9f19cbd1bdf37cac04db9afb12b1c94c21b | Python | 24,503 | 638 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.core.algorithms import safe_sort
@pytest.fixture(
params=[
pd.DataFrame([[2, 4], [1, 2], [5, 2], [8, 1]], columns=[1, 0]),
pd.DataFrame([[2, 4], [1, 2], [5, 2], [8, 1]], columns=[1, 1]),
pd.DataF... |
d2ef054878fdd660b6a3353c45ab54acfadb134b5c3e821d53b201aa94b6bfcd | Python | 24,519 | 638 | """Chromosight's contact_map submodule contains classes to keep track of the
different aspects of Hi-C data and automate standard pre-processing steps. The
ContactMap class holds the whole genome informations and metadata (chromosome
sizes, resolution, etc) without loading the actual contact map. Upon calling
its "make... |
9a5d6fefec3d54a4a45c8f534ee51a681aadf38719ab1cb27536db90aa6ac3cc | Python | 24,523 | 566 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Core routines for BASALT data feeding.
These functions merge external binsets with existing BASALT results,
recalculate coverage matrices and generate inputs for downstream
dereplication and refinement modules.
"""
from Bio import SeqIO
import sys
import os
import sh... |
f4f9aec1bb018131dcc05aefea668f6ff20b033e05915098e746a259c1e17e79 | Python | 24,572 | 790 | from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs.ccalendar import (
DAYS,
MONTHS,
)
from pandas._libs.tslibs.offsets import _get_offset
from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG
from pandas.compat import is_platform_windows
from ... |
cf851d5079eb1c58befe2a886743cb41b6108a742d851f56853b5d0e29f5356c | Python | 24,576 | 536 | ######################
### Import Library ###
######################
# my library
from statistics import harmonic_mean
from molgraph.dataset import *
from molgraph.attentivefp import *
# standard
import numpy as np
import copy as copy
# pytorch
import torch
import torch.nn as nn
import torch.nn.functional as F
from to... |
6fc60bccdc0c044fe5d953413f8cc9ce4633579aa3324dd16e56e3d30adb1afa | Python | 24,577 | 615 | # 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... |
506b52aaf9dee84aba35b4b18ec4617260b0364921bfb09a320717a939c03c05 | Python | 24,630 | 702 | # 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 agree... |
82582b7f666990b3c77fd02a456567b3e8b16137a9d3190c392ff2d88e614853 | Python | 24,631 | 468 | import numpy as np
import matplotlib.style as mplstyle
mplstyle.use('fast')
from matplotlib.backend_bases import MouseButton
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
import keras
import os
from aux_fcn import process_LFP,prediction_parser, get_predictions_index, middle_stamps,get_click_th, ... |
0ef311010d783e6589f422ec2ffacd98676e3fcefd5a65613b1dc0e23e722f13 | Python | 24,640 | 902 | import string
import warnings
import numpy as np
from pandas import (
NA,
DataFrame,
Index,
MultiIndex,
NaT,
Series,
date_range,
isnull,
period_range,
timedelta_range,
)
class AsType:
params = [
[
# from_dtype == to_dtype
("Float64", "Float... |
32ee4c17f46dfb07e6975e434146385d78d1199e8e59938512a8a0f241ec42dd | Python | 24,648 | 646 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: mbejtka, mczerwinski, dwojcik
"""
import scipy.spatial
import numpy as np
from numpy.linalg import LinAlgError
import h5py as h5
import matplotlib.pyplot as plt
# from mpl_toolkits.axes_grid.inset_locator import inset_axes
from mpl_toolkits.axes_grid1.inset_lo... |
8f9224b8fb3757d8ff43d3dc43bb86ec82431e5b94f0f3d26c480c5a68419a11 | Python | 24,663 | 772 | # -*- coding: utf-8 -*-
"""
This module implements a basic server to handle TCP/IP control requests from a
distant client.
I had to implement this because DeLTA and deepcellcontrol where fighting for
the GPU and performance was severely reduced. The microscope uses the
DistantServer object below to connect to the Sock... |
512841e9eb4eb24a1a7988153ab7d209c0d2164391af7bd4f99eb318f9831628 | Python | 24,671 | 607 | ''' dashboard.py
NeuronBridge precompute dashboard
'''
from operator import attrgetter
import inspect
import json
import re
import sys
import boto3
from boto3.dynamodb.conditions import Key
from flask import Flask, make_response, render_template, request
from flask_cors import CORS
import jrc_common.jrc_common as ... |
c7ddec13f8308d4e902299305783b00512812ae16b3974fc21b528144f6c141a | Python | 24,671 | 658 | """
Module for formatting output data in HTML.
"""
from __future__ import annotations
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Final,
cast,
)
from pandas._config.config import _global_config as config
from pandas._libs import lib
from pandas import (
MultiIndex,
... |
14295e1681bf4c036d35fd4ffa9f3915a6884ee6dfc6e67a64e4cfe295387e2d | Python | 24,680 | 756 | """
Pyperclip
A cross-platform clipboard module for Python,
with copy & paste functions for plain text.
By Al Sweigart al@inventwithpython.com
Licence at LICENSES/PYPERCLIP_LICENSE
Usage:
import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
spam = pyperclip.paste()
if not pyperclip.is_a... |
3d2f5b4371c49e06589805a6bac74d4f606c8f5e349d34388f17ef5116e00bb8 | Python | 24,683 | 618 | # 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... |
b7029f47e2c155ada8b6d5836a24b5aa4418c5e8be2f147405e8be3f1f249d3c | Python | 24,693 | 802 | # The following implementation is based on the techniques described in:
# "Object Landmark Discovery Through Unsupervised Adaptation" by Enrique Sanchez and Georgios Tzimiropoulos
# You can find the article here: http://papers.nips.cc/paper/9505-object-landmark-discovery-through-unsupervised-adaptation.pdf
#
# For more... |
2ad185d5ba48ab7110d69339ee086141a90034b9dc0374a9dd55c06bb5f964d0 | Python | 24,737 | 651 | #runfunc.py
import numpy as np
from placerg.funcs import *
from placerg.funcsrg import *
from placerg.objects import *
from placerg.funcsboot import *
import glob
def return_target_directory():
# target_dir = '/home/sede0018/sede0018/avalanche_project/data/'
# target_dir = '/Users/sederberglab/Dropbox/Projects... |
a18423888fbe0f278ab5ad8c13eb1f94ad94ca9b9af807d2c57c08723fc19b53 | Python | 24,740 | 583 | # 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... |
bda832cc9871a43826b401d9191edbbcf730141f65e39e49c4adb0f9501ff078 | Python | 24,740 | 511 | import numpy as np
from src.version import __version__
import pysam
import os
import logging
import datetime
def binomial_probability(k,n,p):
try:
#Binomial coef cancels out for likelihood ratios
#return binomial_coef(n,k) * (p**k) * ((1.0-p)**(n-k))
return (p**k) * ((1.0-p)**(n-k))
ex... |
e3d682ce574f2dcd188d38d000a8482ef3b6503d25482a0ef9ab1c97d4ea94e6 | Python | 24,760 | 648 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 3 00:51:46 2023
@author: s205272
"""
import numpy as np
def normalize_mi_ma(x, mi, ma, clip=False, eps=1e-20, dtype=np.float32):
if dtype is not None:
x = x.astype(dtype,copy=False)
mi = dtype(mi) if np.isscalar(mi) else mi... |
89b059dd6d5e8f4a197b1f94dc8090322004490e3896c912b9a64d7a59de9b19 | Python | 24,778 | 584 | # 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... |
3f932a0d90af612e1c0ef9da0cc2d589bc18b3c5c7c2a78479873eb075493d0b | Python | 24,779 | 570 | # 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... |
d00c13d4560e7b608f94d174c8a1576c13b0f036966f9fd9795943c385d6cfa3 | Python | 24,787 | 655 | ''' sample_status.py
This script is used to generate a report of the status of a sample, slide code, or body ID in
NeuronBridge precompute database tables (and AWS S3 and DynamoDB).
Examples:
python3 sample_status.py --sample 2489243463367786594
python3 sample_status.py --slide 20190816_62_G... |
95ed799a49aca6acc9a8632ca2d9d8c4271a685cf52f28448d4fd976d6efc971 | Python | 24,789 | 726 | """Actions and snippets."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import inspect
import logging
import re
import sys
import traceback
from functools import partial, wraps
from phylib.u... |
4468271b28ce154687b007214bab58023008e1e084a18c0d9055e28381d57f8e | Python | 24,792 | 763 | import datetime
import decimal
import zoneinfo
import numpy as np
from numpy import ma
import pytest
from pandas._config import using_string_dtype
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.api.extensions import reg... |
5fb97dc66be74fdff467df7bc1eea5a55a52a22fe65fdb5c6bf3d6e05a1ab973 | Python | 24,798 | 714 | from __future__ import annotations
import copy
from abc import ABC, abstractmethod
from typing import Any, Dict, Optional, Tuple, Union
import arviz as az # type: ignore
import numpy as np
import pymc as pm # type: ignore
import xarray as xr
from pymc import math
from pcntoolkit.math_functions.basis_function impor... |
a9441cd810299abd2aca6113b90ddad4dd80f31c19572dfea6cb137bb06ca0e3 | Python | 24,814 | 492 | import os.path
import pysam
from pybedtools import BedTool
def determine_mendelian_error(child_gt, mother_gt, father_gt):
if father_gt == "1/1" and mother_gt == "1/1" and child_gt != "1/1":
return "bad"
if father_gt == "0/0" and mother_gt == "0/0" and child_gt != "0/0":
return "bad"
if ... |
1edc8ca286f0fcb54bc84c896c2d78b4206044211d69a2db15bdbaa1a67ff769 | Python | 24,840 | 748 | """
Series.__getitem__ test classes are organized by the type of key passed.
"""
from datetime import (
date,
datetime,
time,
)
import numpy as np
import pytest
from pandas._libs.tslibs import (
conversion,
timezones,
)
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.common impo... |
5abc4d9c5be4fa992b9b537fbb3fdc8a2cfee03c6ea4cf7716a25055acaf1a67 | Python | 24,896 | 790 | from textwrap import dedent
import numpy as np
import pytest
from pandas.compat import is_platform_windows
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 test_frame():
return pd.DataFrame(
... |
27db3a7d96dc952cd85b48867df2fb316133418eea39436013b3031607173379 | Python | 24,897 | 505 | import os
from botocore.client import Config
import ibm_boto3
import sys
from pathlib import Path
from shutil import copyfile
from tqdm import tqdm
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(__file__),
... |
7908b77a2a979bce1b77f1f33a4821cb6f467844e85ae15dbf6300651b8ffad4 | Python | 24,899 | 692 | """Image-based meta-analysis estimators."""
from __future__ import division
import logging
import numpy as np
import pymare
from nilearn.input_data import NiftiMasker
from nilearn.mass_univariate import permuted_ols
from ..base import MetaEstimator
from ..transforms import p_to_z, t_to_z
from ..utils import _boolean... |
c325ec9c0b71f40c1e47d7479538ad32adc24cec5f004805b064c19311ea5435 | Python | 24,905 | 666 | from __future__ import annotations
import operator
import re
from typing import (
TYPE_CHECKING,
Any,
Self,
)
import numpy as np
from pandas._libs import (
lib,
missing as libmissing,
)
from pandas.compat import (
HAS_PYARROW,
PYARROW_MIN_VERSION,
)
from pandas.compat.numpy import functio... |
0552843a666a486d4cec000d11ed36239225a427b2edd93758e6b655c5268283 | Python | 24,919 | 573 | import numpy.linalg as la
import logging
from . import surfaces
#import pointEvolution_fort as evol_omp
from . import conjugateGradient as cg, kernelFunctions as kfun, pointEvolution as evol
from . import surfaceMatching
from .affineBasis import *
## Parameter class for matching
# timeStep: time discretization
#... |
3bf52edba95815aabfc356c535d47db1a1642263ec370bccf0cfc58eb3fa5faa | Python | 24,920 | 587 | """
Title: io_helper.py
Author: Matus Tomko
Mail: matus.tomko __at__ fmph.uniba.sk
"""
import glob
import gzip
import json
import multiprocessing
import os
import pickle
import numpy as np
def prepare_recording_vector(rec_vec, i):
"""
Prepares a recording vectors for saving.
Parameters
----------
... |
821583d27f74e0a36fc90bf79d9fe63d097d52dad780484616cd27568596c8d4 | Python | 24,921 | 739 | """manage PyTables query interface via Expressions"""
from __future__ import annotations
import ast
from decimal import (
Decimal,
InvalidOperation,
)
from functools import partial
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Self,
cast,
)
import numpy as np
from pandas._libs impor... |
35749f7f4434b06df8f8dba888ea684873ea1a3dd7f5b16969899f35f1aa2176 | Python | 24,945 | 511 | import os
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
os.environ['OPENBLAS_NUM_THREADS'] = '1'
os.environ['ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS'] = '1'
os.environ['TF_NUM_INTEROP_THREADS'] = '1'
os.environ['TF_NUM_INTRAOP_THREADS'] = '1'
os.environ['OMP_NUM_THREADS'] = '1'
from botocore.client import Config
impor... |
f8e7548541ac0c5899f2a839988b983d794d913da5594407faae49ed9b553f83 | Python | 24,961 | 668 | #!/usr/bin/env python
import h5py
import windseer.evaluation as eval
import windseer.utils as utils
import windseer.data as nn_data
import windseer.plotting as plotting
import numpy as np
import time
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from sklearn import metrics
import pandas as... |
d5d2433be62d76c5cf2a26fff5bde6b706849838db80b9c868d86cf776a5d35a | Python | 24,974 | 789 | # 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... |
12ae892199231a23ac07e8508e51b4ecddd1de526ffb5499acab0315f318b9a3 | Python | 24,979 | 671 | # 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... |
901ebcb873ca92802e21c54f5a341a677c808d39619a076cfb003348ec9a808c | Python | 24,982 | 652 | from typing import List, Any, Iterable
import random
import numpy as np
import torch
import torch.nn.functional as F
from sequence_models.utils import Tokenizer
from sequence_models.constants import PAD, GAP, START, STOP, MASK, MSA_PAD, PROTEIN_ALPHABET
from sequence_models.constants import ALL_AAS
from sequence_mode... |
090de0ab7124b96ed1c3e6c4c4775460a7db6222cbf62233ed0959c48e824f24 | Python | 24,988 | 750 | import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
def _assert_series_equal_both(a, b, **kwargs):
"""
Check that two Series equal.
This check is performed commutatively.
Parameters
----------
a : Series
The fir... |
4536846bdec2cdfdd07171abea92b1165df70e87dfcfa519c3f4e7c383929bc7 | Python | 25,033 | 702 | from datetime import (
UTC,
datetime,
)
import numpy as np
import pytest
from pandas._libs.tslibs import iNaT
from pandas.compat import is_platform_windows
from pandas.compat.pyarrow import pa_version_under22p0
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
from pan... |
05297ad2dfaa4ca5a08681fcfb8dd42941e4b943b5c9c1b0f94706edfea1b037 | Python | 25,035 | 705 | import re
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
def assert_equal(a, b):
assert a == b
class TestMultiIndexSetItem:
def check(self, target, indexers, value, compare_fn=assert_equal, expected=None):
target.loc[inde... |
6e19001c7251464f2fb1017a884f611c7027b7ea2acc24a818e4ef01e8927afb | Python | 25,065 | 632 | from initialization.config import *
from initialization.initialization import *
from data_processing.statistics 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 matplotlib # spidercilantro
import plotly
impo... |
4a80225d109410fa1b281ae88c48be711f6f15f1f27f178bfa733751403ed15d | Python | 25,105 | 673 | """Linear Operators."""
from __future__ import annotations
import functools
import operator
from abc import abstractmethod
from collections.abc import Callable, Sequence
from typing import cast, no_type_check
import torch
from typing_extensions import Any, Unpack, overload
import mrpro.operators
from mrpro.operator... |
d9f07e18da739bc2e93c6af91ef8443448d932af451c9560137a08680d62d45d | Python | 25,110 | 529 | #!/usr/bin/env python
__author__ = 'etseng@pacb.com'
import os, sys, glob, shutil
import pdb
from multiprocessing import Process
from csv import DictReader, DictWriter
from collections import defaultdict, OrderedDict
from Bio import SeqIO
from bx.intervals.cluster import ClusterTree
from cupcake.io import GFF
from cup... |
4f8a5cc1038d3bba35ebcdf9e0049b6ac914b17f180b545dfa54601ed74e7d2b | Python | 25,118 | 645 | from collections.abc import Iterator
from datetime import (
UTC,
datetime,
)
from decimal import Decimal
import numpy as np
import pytest
from pandas._config import using_string_dtype
from pandas.compat import is_platform_little_endian
from pandas.errors import Pandas4Warning
import pandas as pd
import pand... |
22cc04f4652eca71a727f1b6265bda0f0105f99c4209fe02e063fc05033bd3e4 | Python | 25,133 | 726 | # 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... |
4625a6a0f858ce8e6150cb335c73d465cf5bf4ae022d0266b239ab99dd4c7392 | Python | 25,142 | 734 | # 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... |
ab2a215f2c1ba05f93740d2af4d7c6ec688b9dd653b3063cd612d408a1a2da17 | Python | 25,150 | 659 | # The following implementation is based on the techniques described in:
# "Object Landmark Discovery Through Unsupervised Adaptation" by Enrique Sanchez and Georgios Tzimiropoulos
# You can find the article here: http://papers.nips.cc/paper/9505-object-landmark-discovery-through-unsupervised-adaptation.pdf
#
# For ... |
36cf7d02d2a5ff665219ac4a8cbd175884663a1031f7b6094b2b4cbd324dd2eb | Python | 25,170 | 838 | """
Tests that the file header is properly handled or inferred
during parsing for all of the parsers defined in parsers.py
"""
from collections import namedtuple
from io import StringIO
import numpy as np
import pytest
from pandas.errors import ParserError
import pandas as pd
import pandas._testing as tm
xfail_pya... |
9f5e9f327caf2bf5eba12b19e928c18d8534577d8e2d4ebe7e63f7cb243bbedf | Python | 25,183 | 691 | #dimensionality_reduction.py
from initialization.initialization import *
from initialization.config import *
from data_processing.clustering import *
from data_processing.data_wrangling import get_data_matrix
# from data_processing.pipelines import *
# from visualization.cluster_visualization import *
# from visuali... |
b4d0c25048c07cbadccd5cff3513418612435fbabc111c79f461004cffcfb786 | Python | 25,185 | 538 | import os
import numpy.linalg as LA
import scipy.ndimage as Img
import scipy.stats.mstats as stats
from . import gaussianDiffeons as gd
from . import conjugateGradient as cg, diffeo, kernelFunctions as kfun, pointEvolution as evol, bfgs
from .affineBasis import *
from PIL import Image
## Parameter class for matching
#... |
c575aa4662b4b66dd05ce16846dea64e90cb8193264d86f6285f554cf70bd0da | Python | 25,237 | 786 | from collections import (
Counter,
defaultdict,
)
from decimal import Decimal
import math
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
# The fixture it's mostly used in pandas/tests/apply,... |
ae3077d63e35507c0fa56dea25e91b8d1775340ec95d8c0557b8155a631f38c7 | Python | 25,242 | 660 | # 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... |
0f0ff24c1aa8cd363e05bf2ebe82b39f3b3cfceb68a03c760700a4d7c22f423c | Python | 25,262 | 409 | # Copyright (c) 2021-2023, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... |
f4d6623f01c1541f5fa0c5e46563c49204281faa505ace029ae9a8844aa3f005 | Python | 25,301 | 781 | # 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... |
24c2cf769c01f1c8bfe13cb81af7bf3899dd283995cdfaf0d33607a572bc775b | Python | 25,376 | 612 | import os
import sys
import random
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix, issparse
import anndata as ad
from anndata import AnnData
import scanpy as sc
import shutil
from tqdm import tqdm
import json
import matplotlib.pyplot as plt
class Simulate(object):
def __init__(self):
... |
64ef6af2d086bb04feebb53ae752f1188298279c36bbabd142dead8e1e7c8ad7 | Python | 25,389 | 746 | import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.tseries import offsets
@pytest.fixture
def regular():
return pd.DataFrame(
{"A": pd.date_range("20130101", periods=5, freq="s"), "B": range(5)}
).set_index("A")
... |
20d39abd4779920c9ecb8a920b16fd48ed6a4e0d8e7112f0a1eaeaf4816560df | Python | 25,390 | 764 | # 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... |
10afa574c889aaf1987dbee8e021832b5413f3afb2528675fd5dc6878ee0a2eb | Python | 25,394 | 632 | """Immutable, UI-independent selection state for curation workflows."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from numbers import Integral
from types import MappingProxyType
from phy.utils.selection import SelectionIntent, SelectionMutation
class WorkflowMode(En... |
a3604e544d8a75c5ab14ca0aa6b698e17ec5c4c4af779a0ab7d579578c9b2a35 | Python | 25,394 | 773 | from __future__ import annotations
import mmap
from typing import (
TYPE_CHECKING,
Any,
)
import numpy as np
from pandas.compat._optional import import_optional_dependency
from pandas.io.excel._base import (
BaseExcelReader,
ExcelWriter,
)
from pandas.io.excel._util import (
combine_kwargs,
... |
082cc2850b3a544bad92bc0c591d294b224655917ee7f66ea1e47336231a6a17 | Python | 25,405 | 613 | # 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... |
9cb042a38225a4ee61eeb10cb791f60091f6c92d68b23e0c5fa7fdad3d3de48e | Python | 25,409 | 613 | """Test the recommender module."""
import dataclasses
from pathlib import Path
import pytest
from PIL import Image
from lightning_pose.utils.recommender import (
DatasetAnalysis,
GpuInfo,
_apply_min_iterations_floor,
_derive_view_names,
_recommend_resize_dim,
_select_batch_size,
analyze_d... |
2b378fc59373e28079c2dee716dc1925b2935af3c034d5adca530d2bb6919c31 | Python | 25,461 | 687 | # 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... |
4f422359c6b47485e8abe10f4971072412f5073f4c96fbe6939a4d324b454d0b | Python | 25,473 | 682 | # 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... |
8efef92fba6b36ccb12e24a49db646b91be738a3f6d885f0d616df1cdcf26176 | Python | 25,476 | 775 | from __future__ import annotations
import mmap
from typing import (
TYPE_CHECKING,
Any,
)
import numpy as np
from pandas.compat._optional import import_optional_dependency
from pandas.io.excel._base import (
BaseExcelReader,
ExcelWriter,
)
from pandas.io.excel._util import (
combine_kwargs,
... |
9c745a8215f193d104ab649e9eacef2205e1aab06e55b5f0019a16a1932eaf76 | Python | 25,477 | 701 | from datetime import (
UTC,
datetime,
timedelta,
timezone,
)
import importlib.resources
import io
from pathlib import Path
import struct
import subprocess
import sys
import textwrap
import zoneinfo
import dateutil.tz
import numpy as np
import pytest
from pandas._libs.tslibs import (
conversion,
... |
4f3200a23754938aebc429b59cf47d2684c37c6a6a31e2a9a5d89ffd95e2c4c1 | Python | 25,480 | 541 | import numpy as np
import pandas as pd
import os
import pickle
import mne
import librosa
import scipy.io.wavfile as wavfile
from scipy import signal as sgn
import platform
from praatio import pitch_and_intensity
import opensmile
import Processing
import Funciones
import warnings
warnings.filterwarnings("i... |
2977ebe2c0cbbffbfa427c7496bdada4a2564fa7c9d9130e200a42358aa854a7 | Python | 25,489 | 733 | from __future__ import annotations
import copy
import os
from typing import Any, Dict, Optional
import arviz as az # type: ignore
import matplotlib.pyplot as plt
import numpy as np
import pymc as pm # type: ignore
import xarray as xr
from pcntoolkit.math_functions.factorize import *
from pcntoolkit.math_functions.... |
2b235e18a56824ee55736b8d974221bee5fd9d7d968b1176d7143b336f95f8e8 | Python | 25,525 | 616 | """
Keras implementation
Code was developed using the following GitHub repositories:
- Xifeng Guo's CapsNet code (https://github.com/XifengGuo/CapsNet-Keras)
- titu1994's DenseNet code (https://github.com/titu1994/DenseNet)
-Sai Samarth R Phay; Github: `https://github.com/ssrp/Multi-level-DCNet
... ...
Auth... |
4f957dbff9372a15c4b187e15ccadc0f1b518c2ebaa64361c3ac4c00c8456d27 | Python | 25,549 | 795 | from collections import (
Counter,
defaultdict,
)
from decimal import Decimal
import math
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
# The fixture it's mostly used in pandas/tests/apply,... |
9fe3e2abe9ffcf51d8cb5a7c142e95bd09e6cb57d1e677d11c415cd040e7fa31 | Python | 25,567 | 509 | import sys, configparser, torch, re, os, time
from collections import Counter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from scipy.sparse import csr_matrix
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def prepare_data():
data... |
5bf6e2aed39889e853863a9a2c6eb94685dc4f6df17bec2f82c82c46eb2b2349 | Python | 25,572 | 692 | ''' update_dynamodb_annotations.py
Given an Excel file, update the DynamoDB janelia-neuronbridge-custom-annotations table
and write a copy of the input file to S3.
The Excel file contains annotations for lines and cell types/body IDs.
The following columns are required:
Line Name: publishing name
... |
1ea1be361b00a9994d902a8df019e47e00ded499a1458bd7f7079fd38e9550fa | Python | 25,576 | 793 | # Module: internal.persistence
# Author: Moez Ali <moez.ali@queensu.ca> and Antoni Baum (Yard1) <antoni.baum@protonmail.com>
# License: MIT
import gc
import os
from typing import Dict, Optional
import joblib
from sklearn.pipeline import Pipeline
from pycaret.utils._dependencies import _check_soft_dependencies
from py... |
e94a39d7626cd9de6837dc4ab8f0261bbd8e62a95352bca119b807f267246011 | Python | 25,601 | 514 | #!/usr/bin/env python3
import numpy as np
import pandas as pd
import json
import csv
import time
import math
import pickle
import random
import scipy.optimize as spopt
from scipy import interpolate
import jax
jax.config.update("jax_enable_x64", True)
jax.config.update('jax_array', True)
from diffrax import diffeqsolv... |
1f6142342cd0b41f9c530a02a64b1ea79fc9b92aa84b0620171223a61bb5d401 | Python | 25,603 | 760 | # 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... |
7adcbf5a4ff5cb7a0c9442254f9ac56052c9dcb75c323fb8f28af4e8e1e43ce8 | Python | 25,624 | 720 | import os
import sys
import time
import csv
import json
import warnings
import numpy as np
import ase
import glob
from ase import io
from scipy.stats import rankdata
from scipy import interpolate
##torch imports
import torch
import torch.nn.functional as F
from torch_geometric.data import DataLoader, Dataset, Data, In... |
1c517a079a7ebf6ec12484c45956e91c8b26de91743e537b7669747365fdf9c9 | Python | 25,638 | 706 | import concurrent
import functools
import multiprocessing
import os
import struct
import sys
import time
from concurrent.futures import as_completed
from contextlib import contextmanager
from typing import Any, Dict, FrozenSet, Iterable, List, Optional, Tuple, Union
import anndata
import ngs_tools as ngs
import numpy ... |
7088d07e3c839bac1474c30fca5c45116c44f337643a2f89e4e3a85b0f8bd64c | Python | 25,673 | 611 | # Copyright 2026 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 agreed to i... |
3e8c7012476f4906ee9417b38b602a6a528119d896f4711006ae27a877da8e27 | Python | 25,686 | 698 | import numpy as np
import numpy.linalg as LA
import scipy.linalg as spLA
try:
from vtk import vtkQuadricClustering
gotVTK = True
except ImportError:
print('could not import VTK functions')
gotVTK = False
from . import surfaces
from .pointSets import epsilonNet
from . import conjugateGradient as cg, ke... |
a250de8194cdc20174a910e10fbdf9595a0eae716f0596b6f05e69dbd0d27958 | Python | 25,712 | 658 | from __future__ import annotations
from functools import partial
import re
from typing import (
TYPE_CHECKING,
Any,
Literal,
Self,
)
import unicodedata
import numpy as np
from pandas._libs import lib
from pandas.compat import (
HAS_PYARROW,
pa_version_under17p0,
pa_version_under21p0,
)
i... |
acf55cf673ad020bbc9f3d1776dbc98d6b8d25aa4e5ee44d2d4576159ef85de7 | Python | 25,712 | 724 | import os
import sys
import time
import csv
import json
import warnings
import numpy as np
import ase
import glob
from ase import io
from scipy.stats import rankdata
from scipy import interpolate
##torch imports
import torch
import torch.nn.functional as F
from torch_geometric.data import DataLoader, Dataset, Data, In... |
b95dd316614f1de2826cbc0a74a9d4f6e7478cabda471e99b9c15da4a4837ca7 | Python | 25,745 | 759 | # 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... |
c0dc731398f43948743399ab2f4c4e2d0ef8a23c7161eb0cce79459c85156a42 | Python | 25,755 | 500 | import io
import sys
import traceback
from glob import glob
import os
from scanometrics.GUI.Brain3D.Brain3D import aparc_code
from scanometrics.utils.logging import set_verbose
from scanometrics.utils.zenodo_api import list_normative_models
import pickle
set_verbose(2)
sys.path.append(os.path.dirname(os.path.dirname... |
8aa131f87195c08f293f10b4ebc80820ff56039c4868b726941c4b5945d620d7 | Python | 25,823 | 621 | from _warnings import warn
import matplotlib
from batchgenerators.utilities.file_and_folder_operations import *
from sklearn.model_selection import KFold
matplotlib.use("agg")
from time import time, sleep
import torch
import numpy as np
from torch.optim import lr_scheduler
import matplotlib.pyplot as plt
import sys
fro... |
eda44dcb9141007946789aa9411234ba720db6ea834e439762b9775c7f7b23ba | Python | 25,873 | 693 | """Path handling functions."""
from __future__ import annotations # python 3.8 compatibility for sphinx
import collections
import logging
import os
import re
from dataclasses import dataclass
from pathlib import Path
from typing import overload
import numpy as np
import pandas as pd
import torch
from jaxtyping impo... |
63f9432659a54e33b28590000dee04628e4eb5270d02b55f6781d50422e76501 | Python | 25,877 | 819 | # 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... |
d0716ca1610f1c1830c0ba36d1ae58ff3437b2a338f84e81f739d5977d45f640 | Python | 25,884 | 710 | # Created by G. Peter Lepage (Cornell University) in 12/2013.
# Copyright (c) 2013-14 G. Peter Lepage.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# an... |
4e9896127faaab2505f57a0e80d5f5d0aef074641e43ac9597b567533ea9e878 | Python | 25,892 | 646 | from datetime import (
UTC,
datetime,
timedelta,
timezone,
)
from io import BytesIO
import struct
from zoneinfo import ZoneInfo
import dateutil.tz
from dateutil.tz import gettz
import numpy as np
import pytest
from pandas.compat import WASM
from pandas.errors import (
OutOfBoundsDatetime,
Pand... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.