sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
5cf2b1a5838113ef6cc425a1e31e4af24437f93ad4f30babe89b6499255f451a | Python | 19,877 | 430 | import typing as _T
import torch
import torch.nn as nn
from torch import Tensor
from torch.nn import functional as _F
from torchvision.transforms import functional_tensor as _FT
import numpy as np
class _ZoomNd(nn.Module):
def __init__(self, target_shape: _T.Sequence[int], interpolation_mode: str = "nearest", dev... |
c4d2e469d40d4c8bd722409f689873f7b2b67172c737cb45289768335471b825 | Python | 19,892 | 578 | # 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... |
5f490fbdc36d7f1b8174f3a3997da88a25edb2f47cbefbac9ebb1330710a75f6 | Python | 19,911 | 524 | from models.model import *
import numpy as np
import os
import time
import cv2
import sys
from PIL import Image
import pandas as pd
from scipy.ndimage.filters import gaussian_filter
from utilities.utilities import *
import tensorflow as tf
import csv
import json
import re
# Will need to be adjusted depending on the GP... |
4351e3466cac5362baa2a1f149fb531152ef9312f83d8de5e6a3201d84cc60ad | Python | 19,912 | 608 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 7 18:48:08 2023
@author: hklumpe
"""
import glob
import sys
import json
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
username='hklumpe'
dcc_repo_path = f"/projectnb/dunlop/{username}/deepcellcontrol/"
fig_path = dcc_re... |
c6edab7dacd238fe15afb91da8e64dc389274f9f8b7c8a102322a1b69a44548e | Python | 19,913 | 472 | # Copyright (c) 2012-2021, NECOTIS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and th... |
acaef32eb598a79097fb7f2ef8720699d9f05ecb7ce6bc35ab5d896f8efc333c | Python | 19,922 | 587 | import os
import argparse
import time
import csv
import sys
import json
import random
import numpy as np
import pprint
import yaml
import torch
import torch.multiprocessing as mp
import ray
from ray import tune
from matdeeplearn import models, process, training
######################################################... |
9443da043b790092e2bdd99f31f07782ae6b4440489ff3c94c9e961f27ba6577 | Python | 19,923 | 727 | """
Misc tools for implementing data structures
Note: pandas.core.common is *not* part of the public API.
"""
from __future__ import annotations
import builtins
from collections import (
abc,
defaultdict,
)
import contextlib
import dis
from functools import partial
import inspect
import sys
from typing impor... |
ff5cfc1d260489bcd1715f6d4c05dca8faab6dfece8c20d7a1848adad15ef63b | Python | 19,946 | 502 | # 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... |
e8ac2c0e837c0321460232568b7b0273b9d31a4025dfc86057b60ea578f53479 | Python | 19,951 | 455 | #! /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... |
58933d40c25ded1c0b2f10c37433d86e61963611407291fb8ed5d36615885c6c | Python | 19,963 | 535 | """CI-safe tests for the mjlab live-play module -- no mjlab required.
rl_games.envs.mjlab_play keeps all mjlab imports function-local or guarded,
so its pure logic (obs-group pick, command re-assert pattern, policy adapter)
is testable against stubs whether or not mjlab is installed. The two tests
that read the instal... |
b6aa17a045472357e5082d4bae946200958b1cdd6b853d6f8d619def770597b9 | Python | 19,963 | 481 | # 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... |
95ace3ff52f419aa3319d373fc857dc75757697619e52fa806b1f900485654ed | Python | 19,964 | 543 | # 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... |
c67bac5c851ac30dc8b13254ef664a2aed3525aea43130ad16b2ff6471a9a920 | Python | 19,966 | 445 | import torch
import numpy as np
import VINNA.utils.logging as logging_u
import SimpleITK as sitk
import os
from typing import List
import VINNA.data_processing.utils.data_utils as du
logger = logging_u.get_logger(__name__)
def iou_score(pred_cls, true_cls, nclass=79):
"""
compute the intersection-over-union... |
e68fbee1d736157a6b0ff4beb0e106e26467dc672dfcbdd0ffc9ee32e837b996 | Python | 19,970 | 563 | import operator
from pathlib import Path
import numpy as np
import pytest
from pandas.compat import HAS_PYARROW
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.core.construction import extract_array
def string_dtype_hig... |
63b1c00829fbaa803e360018e1196c663b17fd434aded581ed10f337f49a7a36 | Python | 19,979 | 616 | from __future__ import annotations
import ctypes
import re
from typing import (
Any,
overload,
)
import warnings
import numpy as np
from pandas._config import using_string_dtype
from pandas.compat._optional import import_optional_dependency
from pandas.errors import Pandas4Warning
from pandas.util._decorato... |
4d6462f54b4c10edd0b5b8ea61316c48377dd7fb091d140c2b9b6b88d47571c4 | Python | 19,980 | 613 | """Phase 4: Connection + Secret + Dataset + Lineage routes.
These are the new "data catalog" endpoints. Existing
``/workspaces/{ws}/data-sources`` keeps working — DataSource is now
optionally backed by a Connection for richer types, but CSV uploads
still operate without one.
Auth: every route is workspace-scoped and ... |
aa34fc682c0bfff93e7619fa03c9bc56717877e2b4a0ad16ed26f5acc06d7136 | Python | 19,992 | 609 | # 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... |
023ce6b7fba5bdb585424b87706e236eacc6cae27da36253a95f63361e26a316 | Python | 19,997 | 546 | # 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... |
632e494acdc8498d98ce507b1f0cefbe39bfefdf3ec5498ff5d20780417b4f48 | Python | 19,997 | 449 | import torch
from onmt.translate import penalties
from onmt.translate.decode_strategy import DecodeStrategy
import warnings
class BeamSearchBase(DecodeStrategy):
"""Generation beam search.
Note that the attributes list is not exhaustive. Rather, it highlights
tensors to document their shape. (Since the ... |
f0df679447cab27732e83b3a084dea54410bdf6263911491faa722d3a8a060bb | Python | 19,998 | 436 | # Time-stamp: <2025-07-24 12:10:27 Tao Liu>
"""Description: MACS 3 call peak main executable
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
# ------------------------------------
# python modules
# ---... |
a13d0f6e86e13121276c217135503fa3a17b3cd6e438ca2a3971eb023ee3330d | Python | 20,005 | 637 | # Only tests that raise an error and have no better location should go here.
# Tests for specific groupby methods should go in their respective
# test file.
import datetime
import re
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
from panda... |
48569daaeadd417adea3d0e2c88c8d5ca22de7a25ccfe117eb23399ee850ceaa | Python | 20,024 | 537 | from __future__ import annotations
from decimal import Decimal
import numpy as np
import pytest
from pandas._libs import lib
from pandas.compat import pa_version_under18p0
from pandas.core.dtypes.dtypes import (
ArrowDtype,
)
import pandas as pd
import pandas._testing as tm
from pandas.api.types import (
i... |
ff7800c70036f91dcff0f0074152c5574379a2d18088858f2d88dbae6b337850 | Python | 20,042 | 466 | # 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... |
031d6d5352dd130523c9555f90db48abacfc7a9cdabfd38fc34c23e9a237026e | Python | 20,052 | 571 | from collections import (
OrderedDict,
defaultdict,
)
from datetime import (
UTC,
datetime,
)
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
class TestDataFrameToDict:
def test_to_dict_timestamp(self):
# GH#11247
# split/records producing np.dat... |
e7c624c6c549a3afc07f18783ed3845c310ffe4ddca3de08a66b36146d9fd49b | Python | 20,053 | 732 | """
Misc tools for implementing data structures
Note: pandas.core.common is *not* part of the public API.
"""
from __future__ import annotations
import builtins
from collections import (
abc,
defaultdict,
)
import contextlib
import dis
from functools import partial
import inspect
import sys
from typing impor... |
c67c8b28c57c80626701867693d9e8503f7a3c500f3d987f2377ef1a5845eb9a | Python | 20,057 | 677 | import csv
import datetime
import h5py
import numpy as np
import os
import pyproj
import re
from scipy.io import loadmat
import zipfile
try:
from osgeo import gdal
except ImportError:
print("'pygdal' is not installed. Use the command below to install it:")
print(" pip3 install pygdal")
try:
import... |
f8f99402ca386fb847de01bcd2387a03cd29de0937bf6567f61080b274a5c75f | Python | 20,060 | 563 | #!/usr/bin/env python
"""Summarize the mapping results of trimmed versus untrimmed reads.
This requires that both input bams be name-sorted.
"""
import argparse
from collections import defaultdict
from common import *
import csv
from glob import glob
import os
# There is the option to compute edit distance between the... |
1a80a85ae374596d98dc4c0427d4241134df96e4b33b1ef3f119a5f3be4cd157 | Python | 20,062 | 489 | import torch
import numpy
import bionetwork
import plotting
import pandas
import saveSimulations
import matplotlib.pyplot as plt
import copy
import seaborn as sns
#Load network
networkList, nodeNames, modeOfAction = bionetwork.loadNetwork('data/KEGGnet-Model.tsv')
annotation = pandas.read_csv('data/KEGGnet-Annotation.... |
b85973fb1391b0bcc07ce7a7444fb0a1046155bc843b82aac41f3a3226c0f520 | Python | 20,062 | 470 | import os
import shutil
import threading
import time
import numpy as np
import torch
import copy
from os.path import basename
from typing import Optional
from rl_games.common import vecenv
from rl_games.common import env_configurations
from rl_games.algos_torch import model_builder
class BasePlayer(object):
def ... |
f5db3c4200130e1b975a0f563dee7b55cd7f8dca227647bb5f74e404c228aa7b | Python | 20,067 | 495 | import re
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays.categorical import recode_for_categories
class TestCategoricalAPI:
def test_ordered_api(self):
# GH 9347
cat1 = pd.Categorical(list("acb")... |
3545c67c0279e9d38ca44b6e3fc68dd33c0486fdf84be28c60c13866f479ffe4 | Python | 20,077 | 449 | #!/usr/bin/env python3
"""Paired SBF loss ablation on synthetic or saved ADNI coefficients.
This diagnostic deliberately bypasses dictionary learning. It imports the
frozen SBF model/loss implementation from the adaptive-ridge run and varies
only two factors: learned uncertainty weights and the prediction-weight
pena... |
227fa3f04ec2269cb0e49702f312069e3b067d5d30a195fe48ea85552d7f85da | Python | 20,083 | 585 | # -*- coding: utf-8 -*-
# @File name: analyze_and_plot_general_bar.py
# @Author: Alicia Garrido-Peña
# @Date: 2023-08-10 22:49:35
# @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 LICEN... |
3c250d8773f7f22bd50856d7f34fc32f639d20af54ce8b3b9ad6262ad8caab21 | Python | 20,091 | 489 | """Tools for cropping labeled frames and videos to bounding-box regions of interest."""
import json
import logging
import multiprocessing
from pathlib import Path
from typing import Any
import cv2
import numpy as np
import pandas as pd
import tqdm
from moviepy import VideoFileClip
from omegaconf import DictConfig
fro... |
e630f6ebfcd69a1d0f9e7823211cf7cec987bb3210a6bd5752749b7f0c92818d | Python | 20,109 | 631 | """
Printing tools.
"""
from __future__ import annotations
from collections.abc import (
Callable,
Iterable,
Mapping,
Sequence,
)
import sys
from typing import (
TYPE_CHECKING,
Any,
TypeAlias,
TypeVar,
)
from unicodedata import east_asian_width
import numpy as np
from pandas._config.... |
cf9c746499e9003a52ae4c57c559eafea083ee57ba969de97d989e236d45a1c9 | Python | 20,110 | 543 | import os
from typing import Any, Callable, Dict, Union
import anndata as an
import lightning.pytorch as pl
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import torch.utils.data
from pytorch_tabnet.tab_network import TabNet
from pytorch_tabnet.utils import create_explain_matrix, c... |
ecb9c91f9a5065e9490b93be6566f4846569db75efc8825495085e4f0fd4df14 | Python | 20,119 | 619 | from __future__ import annotations
import ctypes
import re
from typing import (
Any,
overload,
)
import warnings
import numpy as np
from pandas._config import using_string_dtype
from pandas.compat._optional import import_optional_dependency
from pandas.errors import Pandas4Warning
from pandas.util._decorato... |
9ea6a2e653878c69a58b30ed981f1ce3d123d3172422c8edb63a169c185924f8 | Python | 20,123 | 544 | """
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... |
94629e3f82d7893403f32aafd536ac702a472ccdeeb8e5f5bd29657fa55be543 | Python | 20,124 | 601 | """Phase 8: notebook CRUD + session lifecycle.
Endpoints:
- ``GET /projects/{project_id}/notebooks``
- ``POST /projects/{project_id}/notebooks``
- ``GET /notebooks/{id}``
- ``PATCH /notebooks/{id}`` rename, description, tags
- ``DELETE /notebooks/{id}``
- ``POST /notebooks/{id}/sessio... |
ade88489394cbccf4fda3ea631e2a625c47fbf83cec773d2892eac3fc3167c92 | Python | 20,132 | 552 | # 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... |
f360e9a7567f3f3e19dac8c1e6343cb4eac54bccd192c13e2d938395bde56883 | Python | 20,134 | 403 | #!/usr/bin/env python
import sys, os, math, argparse
from argparse import RawTextHelpFormatter
###################################################
### 0. script description and parsing arguments ###
###################################################
synopsis1 = "\
find OrthNets that are either exactly the same o... |
4d4dadb7345d749cfa83b416de7897c468653dcb4b2389c0974a61ca613cbe6b | Python | 20,135 | 413 | import pandas as pd
from functools import partial
import numpy as np
import os
import six
# import single_cell_parser as scp # moved to bottom to resolve import error
from model_data_base.utils import cache
def get_EPSP_measurement():
EPSP_mean = [0.49,0.49,0.35,0.47,0.46,0.44,0.44,0.571]
EPSP_med = [... |
ded024626c3b5f42510ee585f8eca1a14125f7027d16cde7da1a58c73bef40f0 | Python | 20,143 | 407 | import csv
import numpy as np
from time import time
from datetime import timedelta
from collections import OrderedDict
from typing import Union
from copy import deepcopy, copy
from msmfcode.core.config import *
from msmfcode.core.logging import log
from msmfcode.core.io import load_yaml
from msmfcode.execution.paralle... |
107df4f5629c721e0a06d1125a8c7e40f41063b8a99eaebe06a89e52bb0519a5 | Python | 20,144 | 591 | # 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... |
3c5e70a593571bdc9579f0b57b755edce9e63f528250b3087b2440603a2b1aff | Python | 20,153 | 587 | """Phase 1 worker entrypoint.
Long-running process. Polls Redis for queued Job ids; for each one,
looks the Job up in the DB, dispatches it to the matching handler,
heartbeats while it runs, then marks it terminal.
Launch with:
pycaret-server worker --queues default --worker-id my-host-1
Or run multiple workers... |
c4afd287564e22092c01f0032e75e885267118d1e221462654614497f2a69005 | Python | 20,159 | 524 | import time
from pathlib import Path
import numpy as np
import torch
from kilosort import (
preprocessing,
datashift,
template_matching,
clustering_qr,
clustering_qr,
io,
spikedetect,
CCG,
PROBE_DIR
)
from kilosort.parameters import DEFAULT_SETTINGS
def run_kilosort(settings, pro... |
5f5d72395fc17d5156795f57eca38236653fddb14e239202da7dc6189bd83058 | Python | 20,161 | 679 | """
test all other .agg behavior
"""
import datetime as dt
from functools import partial
import numpy as np
import pytest
from pandas.errors import (
Pandas4Warning,
SpecificationError,
)
import pandas as pd
import pandas._testing as tm
from pandas.io.formats.printing import pprint_thing
def test_agg_par... |
e6009e505867d0840020428963199ad983aaf9a21f5de2d9de42460b28eb659b | Python | 20,161 | 536 | """PyTest fixtures for the mrpro package."""
import tempfile
from collections.abc import Sequence
from typing import Any
import ismrmrd
import pytest
import torch
from ismrmrd import xsd
from mrpro.data import AcqIdx, AcqInfo, IHeader, KData, KHeader, KTrajectory, SpatialDimension
from mrpro.data.enums import AcqFlag... |
5015cd8968874f7f3c4cc1362f5a7135fd9006c32f50390f6a6f70d7cce206a2 | Python | 20,163 | 536 | # 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... |
bca4a3e1827320fbb4ddc7706e61e64390c3dfab31cc94a16a66d369bbe09b8b | Python | 20,165 | 538 | # 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... |
099be3db4b8c2dae00dd5f5df31e089a5a9f2c9dd37aa18a328cb96768def117 | Python | 20,166 | 532 | import operator
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
pytestmark = [pytest.mark.single_cpu]
def test_categorical(temp_hdfstore):
# Basic
s = pd.Series(
pd.Categorical(
["a", "b", "b", "a", "a", "c"],
categories=["a", "b", "c", "d"]... |
6aff75449f93fecb2ff0e0d536edabeab1a359113e3eb565e9595e5eb620769c | Python | 20,166 | 416 | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 20 17:02:31 2020
@author: Wladek
"""
import numpy as np
import matplotlib.pyplot as py
from matplotlib.colors import LogNorm
from figure_properties import *
import matplotlib.patches as mpatches
from scipy.signal import welch, argrelmin, butter, filtfilt, spectrogram, ... |
02b18a04f0b71ea9013bb48542d9de18febe9714b9960a587ed227a793cdff45 | Python | 20,168 | 413 | # 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... |
4d950213f6044e8b2f13266066df3a8eeff65513181ec0cc2d25b1a5560fc6a6 | Python | 20,173 | 504 | # -*- coding: utf-8 -*-
'''
NASTIC_CLI
COMMAND LINE (CLI) VERSION FOR SPATIOTEMPORAL INDEXING CLUSTERING OF MOLECULAR TRAJECTORY DATA
Design and coding: Tristan Wallis
Additional coding: Kyle Young, Alex McCann
Debugging: Sophie Huiyi Hou, Kye Kudo, Alex McCann
Queensland Brain Institute
The University of Queensland
F... |
e0658ffb13ea4369d73fd959762ebbcb8fef666106d99c63ed3c23b7b6a69655 | Python | 20,183 | 319 | from defs import *
from values import *
import flux
import electrochemical
import glucose
import NHE3
import ATPase
import NKCC
import KCC
import NCC
import ENaC
import Pendrin
import AE1
import NHE1
import NCX1
import TRPV5
import TRPM6
import NaMgX
solute = ['Na','K','Cl','HCO3','H2CO3','CO2','HPO4','H2PO4','urea... |
35979e5ffe2fb3dc305cf2b71bad78f88cc30c3df8190dc553e41e94ec7c557e | Python | 20,185 | 674 | import numpy as np
import pytest
from pandas.compat import PY315
import pandas as pd
import pandas._testing as tm
def gen_obj(klass, index):
if klass is pd.Series:
obj = pd.Series(np.arange(len(index)), index=index)
else:
obj = pd.DataFrame(
np.random.default_rng(2).standard_norm... |
0f407b1b553fac1887893526ee44594fcd3ef8556ecf209ce1edf91c6aac7032 | Python | 20,188 | 647 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 10 16:14:23 2020
@author: jeanbaptiste
"""
import os
import pandas
import numpy as np
from matplotlib.colors import ListedColormap
import matplotlib.pyplot as plt
import cv2
# Movies etc colormaps:
gfpmap = np.zeros(shape=(256,4))
gfpmap[:,3]= 1
g... |
718b7209c3fc785366b0afff8b7b5b58bd56daa5ef9abafb255a8f839b1d5f28 | Python | 20,188 | 508 | # import neccessary stuff
import os
import shutil
import json
import datetime
import torch
import torchmetrics
from collections import OrderedDict
from lightning.pytorch.loggers import TensorBoardLogger
import argparse
import numpy as np
import nibabel as nib
import lightning as L
import pandas as pd
from random ... |
ec7da5178f2102aada909ddace48edc9820f3c293c7be591cb30bb9920ce58d1 | Python | 20,199 | 473 | import numpy as np
import scipy.spatial.distance as ssd
from mne.cov import compute_whitener
from mne.epochs import Epochs, EpochsArray
from mne.evoked import Evoked, EvokedArray
from mne.forward import Forward
from mne.forward.forward import _select_orient_forward
from mne import channel_type
from mne import pick_type... |
7a8d40ac83ebb7c131f01cc63a0baa36659fe5c9a6afcc9991c0358be177f1a0 | Python | 20,219 | 557 | # 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... |
f1160a934f4df204a5a9da0a46f6c705612222bca3c8f988ea35cdc98f58600f | Python | 20,219 | 429 | # 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... |
95bcbf77da191bbdd5a87c4db760de64b45cf671f24fc49e46a26d01efa317bd | Python | 20,235 | 446 | #!/usr/bin/env python
__author__ = 'etseng@pacb.com'
"""
Identical to the collapse script provided in cDNA_primer (ToFU) GitHub.
Takes a SAM file and the input fasta/fastq used to produce the SAM file,
filter out alignments based on low coverage/identity and collapse/merge
any identical isoforms based on the aligned ... |
c8d7442ad5eca24367d68689d1ecc6735d391ac70e86189e5e4a51f37d824f09 | Python | 20,245 | 455 | # 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... |
6cb2ddf1751d184fa8d55adca4754476a900fe39b13e8c3651254a2a8e6c6333 | Python | 20,249 | 534 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This code is distributed under the terms and conditions
# from the Apache License, Version 2.0
#
# http://opensource.org/licenses/apache2.0.php
#
# This code was inspired by:
# * http://code.activestate.com/recipes/576638-draft-for-an-sqlite3-based-dbm/
# * http://cod... |
a686d216c3036cc8791a7ffa1be7a7f0c545b31b0ea1a80a0175a9ec17546fda | Python | 20,250 | 522 | """Softly gradient-coupled Resnets.
"""
import copy
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import pytorch_lightning as pl
import pytorch_lightning.metrics as metrics
import numpy as np
import pandas as pd
import functions.sgc_optim as sgc_optim
def float_interval(lower=No... |
da0ad830f6d1001ff8ff1cee7f5219823d0497af51ee1f08722f34bf29474d68 | Python | 20,254 | 569 | import operator
from pathlib import Path
import numpy as np
import pytest
from pandas.compat import HAS_PYARROW
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.core.construction import extract_array
def string_dtype_hig... |
55c3cb672344f15d6a2562bada93f182e00288a6c85ffbf4acb4366fa0a661f6 | Python | 20,258 | 369 | import os
import pickle
import numpy as np
from sklearn.model_selection import KFold
from datetime import datetime
import Load as Load
import Models
import Plot
import Processing
import Statistics
import matplotlib.pyplot as plt
startTime = datetime.now()
#----- Define Parameters -----#
# Save / Disp... |
632996b15e325b46d726b01380744846cc9724db2b24a797cda7c1ca35e91517 | Python | 20,262 | 696 | """
Wrappers for running external sequence alignment tools
Authors:
Thomas A. Hopf
Anna G. Green - run_hmmbuild, run_hmmsearch
Chan Kang - run_hmmbuild, run_hmmsearch
"""
from collections import namedtuple
import pandas as pd
from evcouplings.utils import TerminatedException
from evcouplings.utils.system impor... |
105e3551e9dea5d32ee0dfaa43d601a0d69ad789455a398883e3b9bb9963bccd | Python | 20,273 | 617 | # cython: language_level=3
# Time-stamp: <2025-11-14 16:55:58 Tao Liu>
"""Module for Region classe.
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
# ------------------------------------
# python module... |
b94fc58366828811f5860d8cbbecc0236f0a52aac3d1fa8da895eb180b707d58 | Python | 20,287 | 554 | #!/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
import os
from scipy.interpolate import... |
90c14995ae1a92e1fa522d122a0de18cebf02562f240a6247ebf590bad4486d8 | Python | 20,302 | 662 | """
Extend pandas with custom array types.
"""
from __future__ import annotations
import inspect
from typing import (
TYPE_CHECKING,
Any,
Self,
TypeVar,
cast,
overload,
)
import numpy as np
from pandas._libs import missing as libmissing
from pandas._libs.hashtable import object_hash
from pan... |
7f0ffab17991057c47b5e21a7d23a0fef42204d0e9f9c701c16255031ea17221 | Python | 20,330 | 395 | # 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... |
731189f8196efd9d5bd55e3982f1fb9c33665e895e177efdb00fef81bafe591e | Python | 20,345 | 584 | import contextlib
from pathlib import Path
import re
import uuid
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.io.excel import (
ExcelWriter,
_base as _excel_base,
_OpenpyxlWriter,
)
from pandas.io.excel._openpyxl import OpenpyxlReader
openpyxl = pytest.im... |
a93b99ef9148a07ce287cb4a3c8c7cb32e0e5a62b3f4bdcfd711b688aef7ae75 | Python | 20,352 | 686 |
import torch
import torch.nn as nn
from torch.autograd import Variable
from functools import reduce
class LambdaBase(nn.Sequential):
def __init__(self, fn, *args):
super(LambdaBase, self).__init__(*args)
self.lambda_func = fn
def forward_prepare(self, input):
output = []
for m... |
201aff054b39422c745eb175fd83babfbbec593d26c9d62353938e9d231391e6 | Python | 20,365 | 445 | from __future__ import division # Ramin
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.distributions.normal import Normal
######### Helper functions #########################
def Normsamp( sig, time, batch, numcell ):
dist = Normal(loc = 0, scale = ( sig... |
af50acfc8fab024d4c280c88c3233fb4d52e71478f6c4e465236bfa93b200882 | Python | 20,386 | 722 | # 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... |
4251795176cb5f414d8196eaf3b95f56fa0d13cf3d7d85904d68ba5e90f1dde1 | Python | 20,397 | 571 | # 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... |
73de693b0bdb717215f7ad10d5f0d820429c0841254cbab97e2051272beec215 | Python | 20,421 | 559 | """ Knowledge graph dataset for Relational-GCN
Code adapted from authors' implementation of Relational-GCN
https://github.com/tkipf/relational-gcn
https://github.com/MichSchli/RelationPrediction
"""
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import scipy.sparse as s... |
c11c6eabb281a2cc899164cd6d3a693398ec6611c6fbdaf7d96435d5a4547433 | Python | 20,422 | 687 | # %%
import torch
from typing import List, Literal, Optional
from torch import nn
class IntermediateFeatureExtractor(nn.Module):
def __init__(
self,
model: nn.Module,
layers: Optional[List[str]] = None,
target: Literal["input", "output", "both"] = "output",
):
super().... |
301d6e7ddcd8bad81d1843618e9944b7850328fccd67455309717d94733fb09b | Python | 20,472 | 494 | #######
# PMIpred was developed by Niek van Hilten, Nino Verwei, Jeroen Methorst, and Andrius Bernatavicius at Leiden University, The Netherlands (29 March 2023)
#
# This script is an offline version of the protein module in PMIpred at https://pmipred.fkt.physik.tu-dortmund.de/curvature-sensing-protein/
#
# When using ... |
38660abe4ef7cd448d34fed3db86847fe79bc70197beee349797caa9175b96ea | Python | 20,473 | 528 | #!/usr/bin/env python
from __future__ import print_function
import os
import re
import signal
from torch.utils.tensorboard import SummaryWriter
import time
import torch
from torch.nn.functional import mse_loss
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.optim.l... |
2908dda8b7d1643bde472af4e9e5470f1983d67cc6d228d8adeb8188edb83a1f | Python | 20,476 | 513 | # 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... |
3e325f4133a512fca2912e0788f273e9fd98382a4482934d9e9f7f5548a52aab | Python | 20,490 | 686 |
import torch
import torch.nn as nn
from torch.autograd import Variable
from functools import reduce
class LambdaBase(nn.Sequential):
def __init__(self, fn, *args):
super(LambdaBase, self).__init__(*args)
self.lambda_func = fn
def forward_prepare(self, input):
output = []
for m... |
88754bed0edd09b16912a648bd063cab7df5d35429fa32e5296518bf984cd9c6 | Python | 20,490 | 583 | import os
import subprocess
import sys
import textwrap
import numpy as np
import pytest
from pandas.compat import WASM
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.core.util.hashing import hash_tuples
from pandas.util import (
hash_array,
hash_pandas_... |
b1fabad54111a9973d7bf1b267431576e936b835a86939705a10b03ce1519139 | Python | 20,496 | 533 | # 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... |
8b4431aecbbed1d3b66b6249780109af760e6d58c0dc5ad9d97dc7aff2a12810 | Python | 20,537 | 532 |
# Copyright 2019 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
257e4d426a6fba6173d442d011a588df0bf3868fa3588370e6d75628b753f5a4 | Python | 20,542 | 535 | #! /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... |
9ee2cbcee4c5dda2bc108cb888e3b08aee6db2968a55a05da610ffa8046160b1 | Python | 20,543 | 565 | """
Generate eddie submission scripts for the
staging, analysis and destaging jobs
"""
from __future__ import print_function
import os
import sys
import textwrap
from datetime import datetime
import shutil
import subprocess
import re
import getpass
import shlex
try:
from scissorhands import script_generator
excep... |
f0002f7fbe830f5430c84847a1defac8c9e12a7181099222eb6e8f41e18495ef | Python | 20,553 | 634 | from datetime import datetime
import re
import zoneinfo
import numpy as np
import pytest
from pandas.errors import MergeError
import pandas as pd
import pandas._testing as tm
from pandas.core.reshape.concat import concat
@pytest.fixture
def left_no_dup():
return pd.DataFrame(
{"a": ["a", "b", "c", "d"]... |
9901306bed5f4b7b2d52c04db496770c5b504be390fa721a11d2d689bf2cff18 | Python | 20,557 | 419 | # 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... |
3868a670617f6b931ad09d5613bf372962a47d17c2de4f15ccaec28feb9fa479 | Python | 20,564 | 621 | # -*- coding: utf-8 -*-
import os
from PIL import Image
import os.path
import time
import torch
import torchvision.datasets as dset
import torchvision.transforms as trn
import torch.utils.data as data
import numpy as np
from PIL import Image
# /////////////// Data Loader ///////////////
IMG_EXTENSIONS = ['.jpg', '... |
bd515c0814bb8be11e48ab42eade70e2452943863c84a94219369db5e78124fc | Python | 20,565 | 475 | from spycon.spycon_inference import SpikeConnectivityInference
import elephant
import neo
import quantities
import numpy
from scipy.stats import poisson
import multiprocessing
from itertools import repeat
from tqdm import tqdm
class Smoothed_CCG(SpikeConnectivityInference):
"""Smoothed CCG method from
Englis... |
95602e6ef57c148143f682640e063eb27ded035d04a29fe5959de032177e6ca3 | Python | 20,579 | 669 | # 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... |
3f92f360e985fec9fff5953ed30a1eb41fbb19d35fc681afb7e4ee139feabda8 | Python | 20,620 | 644 | # 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... |
8003d1549d77036f275c34ef191b582d23ca92308acb3b72ef7153545d8d0dfc | Python | 20,639 | 568 | # 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... |
bc7fd9d545cf49afaf6e0135240335800de2594ca442c7b96c81afc4b5301f11 | Python | 20,684 | 491 | # 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... |
459be0137f973063fa35f82ebe84ec8cdc934b1f0110cd6587de83b3e188ae1f | Python | 20,685 | 618 | # 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... |
7777e279f7711f5b9f9d4267fc036b1cf433e4ca228a138bfeeea6f36a3d5105 | Python | 20,697 | 744 | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import List, Optional, Tuple
import numpy as np
from numpy.typing import NDArray
from scipy.stats import norm
from pcntoolkit.util.output import Errors, Output
"""Warping functions for transforming non-Gaussian to Gaussian distributi... |
0862a8b601092771ae4a5b948d6a61de9824e122ccd33ba75554e074784c0167 | Python | 20,703 | 389 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 19 10:31:16 2023
@author: lonya
"""
'''
########################################
preset
########################################
'''
import tkinter as tk
import tkinter.filedialog as fd
from tkinter import messagebox
import pickle
import pandas as pd
import scipy.io as s... |
732d61df518c060919705733a4867816dd8589f028d5abf5018e419587cee80a | Python | 20,705 | 564 | from __future__ import annotations
from collections import defaultdict
from typing import (
TYPE_CHECKING,
Any,
)
import warnings
import numpy as np
from pandas._libs import (
lib,
parsers,
)
from pandas.compat._optional import import_optional_dependency
from pandas.errors import DtypeWarning
from pa... |
92e33844e7e88fc7687d974cb55546c83f6fc3402771893737f325a24e539d1e | Python | 20,709 | 495 | from __future__ import division, print_function
import logging
import os
import time
import numpy as np
import pandas as pd
from keras import backend as K
from keras import metrics
from sklearn.metrics import r2_score, mean_squared_error
from keras.models import Sequential
from keras.layers import Activation, BatchN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.