sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
6c9ae4d811e25bf2fe05012fd01bc136355a51739c609d8aef3aa3e6a0f9370e | Python | 23,572 | 433 | # Ultralytics YOLO 🚀, GPL-3.0 license
import ast
import contextlib
import json
import platform
import zipfile
from collections import OrderedDict, namedtuple
from pathlib import Path
from urllib.parse import urlparse
import cv2
import numpy as np
import torch
import torch.nn as nn
from PIL import Image
from ultralyt... |
73e3de903245d840b3014a10442a5723298a39c5f301e0f84cffad20cc757294 | Python | 23,572 | 719 | """Tests for probabilistic.py"""
import copy
import pickle
import re
import numpy as np
import pytest
from sklearn.base import clone
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
import torch
from skorch._version import Version
from skorch.utils import is_torch_data_type
from... |
ab47446c808578ec48476815b9ce3b6ce8c3d338a91a34e95a9c801436031c75 | Python | 23,608 | 633 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... |
a9c50a43d11a3bcc71ebf2de6369ac55c26fb88f9c6c6bb44ab0c9501358a370 | Python | 23,615 | 657 | import json
import logging
import os
import random
from collections import Counter, defaultdict
import numpy as np
import pandas as pd
from scipy.stats import chisquare, ranksums
from sklearn.metrics import accuracy_score, f1_score
from sklearn.model_selection import StratifiedKFold, train_test_split
from . import pe... |
b1239e81746a6bd6d8b627e645e58fc87eccc3176513b8246068dd4facd5b14f | Python | 23,615 | 398 | import matplotlib.pyplot as plt
import pickle
import numpy as np
import os
from util import *
from sklearn.metrics import accuracy_score, confusion_matrix, roc_auc_score, roc_curve, precision_recall_curve, PrecisionRecallDisplay
def plot_scatter_plot(label_d, score_d, label_a, score_a, filename):
junc_prob = label... |
8118b1a3575aa179ac04e9144d2b96875b0fe9234e4f762849fe987600f358de | Python | 23,626 | 420 | import torch
import torch.nn as nn
import numpy as np
from tqdm import trange
class gru_Linear(nn.Module):
def __init__(self, input_size, hidden_size, output_size):
super(gru_Linear, self).__init__()
self.Fc1 = nn.Linear(in_features=input_size, out_features=hidden_size, bias=False)
self.F... |
bfb959f57bf33aedfe66fc5014a8f4dfea9ae62520b000482e94007b0f6ed178 | Python | 23,676 | 680 | import time
import itertools
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torchvision import models
from base import BaseModel, Autoencoder2D, ResConv2dBlock
from criteria import tp_binary_loss, tn_binary_loss, dsc_binary_loss
def norm_f(n_f):
return nn.GroupNorm(n_f... |
40e405c1856b8a772c2ef0e947f88411f3b486e1fbd1b4144213bdedef101ba7 | Python | 23,684 | 638 | from multicamera_acquisition.interfaces import get_camera
from multicamera_acquisition.video_io_ffmpeg import write_frame
from multicamera_acquisition.paths import ensure_dir
from multicamera_acquisition.interfaces.arduino import (
packIntAsLong,
wait_for_serial_confirmation,
find_serial_ports,
)
from multi... |
f8e739798124323c3c2f57b30116e2250184725cd1ae474887674b740edbccc0 | Python | 23,686 | 670 | # Copyright 2023 The HuggingFace Team. 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/LICENSE-2.0
#
# Unless required by applicabl... |
492c8aa68e6993b60d8040f0aeb7634af46502e97236eabecd04d0b502b164f5 | Python | 23,687 | 689 | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
3bb2215177c7233da5594b43f036e66933ca6c65e92cb6e345f2f91cddc767a6 | Python | 23,692 | 655 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" functions that creates image from a video file
Primarily intended for plotting, returns correlation images ( local or max )
See Also:
------------
@author andrea giovannucci
"""
from builtins import range
import cv2
import logging
import numpy as np
from scipy.ndim... |
44ca6145faa12b6af220d27e3e7a45a0a8a4c10e7750f4a441d235f3ad14d898 | Python | 23,696 | 600 | import random
import numbers
import math
import collections
import numpy as np
from PIL import ImageOps, Image
from joblib import Parallel, delayed
import torch
import torchvision
from torchvision import transforms
import torchvision.transforms.functional as F
class Padding:
def __init__(self, pad):
self.... |
1943f35cddf109964a8c796a3212382f4c5a2ef19d7e822c6cedbf80a9e0e082 | Python | 23,698 | 620 | """
Cell ordering and pseudotime assignment for monocle2_py.
Implements orderCells() — assigns pseudotime and state to each cell.
"""
import numpy as np
import pandas as pd
import igraph as ig
from scipy.spatial.distance import pdist, squareform
def _euclidean_mst_delaunay(pts, N_cells, _knn_k_start=50):
"""Com... |
0dbdc59e9bdcc3ddc055e6a6f071c00aa2d44362ecbceda907cf7011fe4d8369 | Python | 23,727 | 623 | import json
import logging
import os
import random
import time
from hashlib import md5, sha256
from pathlib import Path
from typing import Any, Callable
from uuid import UUID
from azure.common.credentials import get_cli_profile
from azure.core.exceptions import HttpResponseError, ResourceNotFoundError
from azure.ident... |
d3c74bfc7150bf318cbca2ad22310daecc9e99ec6fb93bec88708643f6569803 | Python | 23,742 | 611 | """Plot event-related averages per stimulus duration"""
import os
import glob
import nibabel as nb
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
ROOT = '/Users/sebastiandresbach/data/neurovascularCouplingVASO/Nifti'
SUBS = ['sub-05', 'sub-06', 'sub-07', 'sub-08', 'sub-0... |
916a7e7f10352f465d2f4881e17659f8b7f0f4a4f5158216cdd8bbffa38361d3 | Python | 23,747 | 685 | import os
import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader
import time
import traceback
import numpy as np
from anndata import AnnData
import scanpy as sc
from typing import List, Tuple, Dict, Optional
from .tokenizer import tokenize_and_pad_batch, random_mask_value
from .data_sampler... |
4835fde117347166e95dad8f976e69e6903d5ab8c19a1b5875167dda950c8119 | Python | 23,754 | 604 | # exhaustive search for M dilution matching M diffusion to get OEF - fixed PmitO2
import argparse
import nibabel as nib
import numpy as np
from scipy import interpolate, linalg, sparse
import os
import warnings
warnings.filterwarnings('ignore')
def parse_cmdln():
parser=argparse.ArgumentParser()
parser.add_ar... |
2198b47fe47a509fe6a9bf2e65546e551e7f95f84f0db1dbe43212482177e55a | Python | 23,765 | 514 | # taken from Github, yjkimnada/ns_decoding
# Original Author: Young Joon Kim
# Original License
'''
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTI... |
7ca5f65e8d210f3d1b9a10aa7a3645dbaf5d1c800952b971235fb8410bb6681d | Python | 23,782 | 746 | from __future__ import annotations
from dataclasses import dataclass
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
import torch
import flyvis
from flyvis.analysis.visualization import plots, plt_utils
from flyvis.datasets.datasets import StimulusDataset
from flyvis.datasets.sintel import ... |
0c9e07e3fec644703fb485ebb5518c8d16c57068201be0ee2e98ea9e1f9f8338 | Python | 23,783 | 496 | # Copyright 2023 Microsoft and The HuggingFace Team. 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/LICENSE-2.0
#
# Unless require... |
cdf01acd36a0b1bf1b6e27c3f9d8fc0950bb0acd5301df3e69109f5b83d546dc | Python | 23,804 | 670 | """
Extracting and plotting signal based on ME-GRE vessel segmentations
"""
import glob
import nibabel as nb
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.ndimage
import seaborn as sns
import sys
sys.path.append('./code/misc')
from findTr import *
plt.style.use('dark_background'... |
3678e49049db76d8d8a2547f9d69c91fa889d3dee2c74db75a578c57a4807d1d | Python | 23,818 | 587 | """Streaming dispatch and provider-specific streaming helpers for OmicVerseLLMBackend.
Internal module — import from ``omicverse.utils.agent_backend`` instead.
"""
from __future__ import annotations
import asyncio
import logging
from typing import TYPE_CHECKING
from .agent_backend_common import (
Usage,
_coe... |
e9af81e749548749a22abf1c16efeff1f017cca635cdb36ea4a980e7330c220e | Python | 23,819 | 460 | import inspect
from typing import Callable, List, Optional, Union
import numpy as np
import PIL
import torch
from transformers import CLIPImageProcessor, CLIPTokenizer
from ...configuration_utils import FrozenDict
from ...schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler
from ...utils import deprec... |
8e3020e36d1b42d48dbec522b5875625af683a693e884bea02c08e4e200ab74b | Python | 23,827 | 769 | #!usr/bin/python
# -------------------------------------------------------------
# Compute co-expression modules within python scanpy framework,
# Using data loader + modules + graph handlers
# Created: 06/16/21 // Updated: 08/10/21
# -------------------------------------------------------------
import sys
import re
im... |
ae87b6e9ab3a5cb66cc65aedf7d16bfa07dbe9de9d580ddaa4284fd167300393 | Python | 23,842 | 548 | import json
import multiprocessing
import os
from pathlib import Path
import sys
import cv2
import nibabel as nib
import glob
import pandas as pd
import pydicom
import numpy as np
import scipy.io
import time
import csv
from deepvoxnet2.components.mirc import Mirc, Dataset, Case, Record, NiftyFileModality
from dicomor... |
b9a9d8862eb7ac7380606109664467df50531021b3febfa5236102c42a6a5ca4 | Python | 23,863 | 629 | # harmonypy - A data alignment algorithm.
# Copyright (C) 2018 Ilya Korsunsky
# 2019 Kamil Slowikowski <kslowikowski@gmail.com>
#
# 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, ... |
c4aab6ce073675099138b35ce3091fe4e57453b5c16a15ea54e573c845e67e85 | Python | 23,873 | 597 | ####################################################################################################
# Copyright (c) 2021, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is free softw... |
e5b8b8b7adb4587d57ab2dcdb34b386348c13683a3788b1fd15051a463af6554 | Python | 23,879 | 664 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 10 15:22:40 2018
Calcium imaging tools.
@author: lohmann
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from skimage import data, measure, io, filters
import scipy as sp
from scipy import stats
import seaborn as sns
import os
def load_stack(pa... |
c4c83a0a5d54a625cc3f4503ca9bff02dc02f2939908a9d6efa14bf23a93b5bc | Python | 23,892 | 589 | import numpy as np
import torch
import torch.optim as optim
from typing import Callable, Tuple, List
from functools import reduce
from torch import autocast
from torch.cuda.amp import GradScaler
from convex_optim_base.prox_optim import ProxFISTASolverParams
class NewStyleSingleProxFISTAOptim(optim.Optimizer):
... |
1bf380e4668dd82a0ad7db96bd273750e094cfbb29e427a89b42aab7297011cc | Python | 23,903 | 608 | """Tools to collect and generate metrics."""
import logging
import os.path as op
import numpy as np
import pandas as pd
from tedana import io, utils
from tedana.metrics import dependence
from tedana.metrics._utils import dependency_resolver, determine_signs, flip_components
from tedana.stats import getfbounds
LGR = ... |
23f3a3125df3adf1ab639cb4f2060da8bcde11083a4f35b1488aaf743a4d4cb3 | Python | 23,906 | 642 | """End-to-end 16S amplicon pipeline orchestrator.
Chains the real tool wrappers in this package:
1. :func:`omicverse.alignment.cutadapt` (optional — primer trimming)
2. :func:`omicverse.alignment.vsearch.merge_pairs`
3. :func:`omicverse.alignment.vsearch.filter_quality`
4. :func:`omicverse.alignment.vs... |
d64c6ec37326ef68a61ad3ba5587369f8d672c30a17a410f8ed7e239b5ffc4aa | Python | 23,909 | 576 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 4 09:56:58 2016
@author: fwinkler
"""
import os
import re
import numpy as np
import subprocess
def cellmuncher(cel_file, output_file, attach_cel=None, attach_direction=None,
repeat=None, set_dwf=None, frozen_lattice=None, remove_close_atoms=None,
... |
d2a240a2e45255e8f05f1c0a6ebf57736934c367de1b559c578a65a974f1592f | Python | 23,922 | 675 | # Copyright (c) 2017-present, Facebook, 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... |
d6112a56f40fa7ee0a83bf1eba0ab81d61cdc8d85ef91621b3ebc57d964f9902 | Python | 23,933 | 499 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
from scipy.integrate import odeint
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
UseDoubleWell=1... |
b5b732eb507e30fc481185ef38b3f349394f5eba3852678d07e1749e5ec9fd7d | Python | 23,944 | 501 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
from scipy.integrate import odeint
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
UseDoubleWell=1... |
1e051cda2ea42763665e925480b64a822fd662c0894879025b7bb81f6393eecd | Python | 23,945 | 519 | import matplotlib.pyplot as plt
import pickle
import numpy as np
import os
from util import *
from sklearn.metrics import auc, accuracy_score, confusion_matrix, roc_auc_score, roc_curve, precision_recall_curve, PrecisionRecallDisplay
from sklearn import svm
def plot_pr_curve(true_y, y_prob, label, option):
"""
... |
a46af808076a34d4d0562b1456bfb538334b590eb27aadcc423f59033a548fdd | Python | 23,945 | 576 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import glob
import sys
import numpy as np
import pysam
import time
import os
from contextlib import closing
TAG_HAPLOTYPE = "ht"
TAG_CHUNK_ID = "mp"
PB_HAP1_READS = "pb_hap1"
PB_HAP2_READS = "pb_hap2"
PB_LENGTH = "pb_len"
PB_BLOCK_ID = "pb_b... |
3acce928812b1746115b42bc5c187a884f52221da89ec3e126cfac419ed49c2c | Python | 23,959 | 511 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
7da3304dfdfaaf7befbe23aff045f7a2cbaf4da303054c0123b55ddb8e3d1a46 | Python | 23,967 | 644 | import math
import numpy as np
import pandas as pd
from sklearn.cluster import DBSCAN
from scipy.stats import gaussian_kde
def dnorm(x, u=0, sig=1):
"""
Generate the gaussian kernel function.
"""
return np.exp(-((x - u) ** 2) / (2 * sig ** 2)) / (math.sqrt(2 * math.pi) * sig)
def bandwidth_nrd(x):
... |
2b7b0580e2d2ce9c92c1d55720ffb99a6aa7b4167eba5083817f2f630dc9da91 | Python | 24,011 | 587 | from PIL import Image
import numpy as np
from ctypes import *
import ctypes
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import cv2
import time
import pdb
import torchvision
import torchvision.transforms as transforms
import scipy
import scipy.ndimage
import P... |
c7866c2ec2c8b97eea283442c02f6005ccb1e15c91742422cb125710b556679a | Python | 24,011 | 576 | """Cross-species single-cell integration via one-to-one orthologs (Ensembl BioMart).
Answer to issue #856: bring cross-species integration + homologous-gene transfer
into omicverse. This module implements the *ortholog-based* route — the standard,
lightweight cross-species workflow — reusing omicverse's existing integ... |
001e590ed3a80be47f0ac6d9ef0a7dcbccea58257b86bb264ea650bd0d35e4fc | Python | 24,027 | 590 | import contextlib
import gc
import inspect
import io
import re
import tempfile
import unittest
from typing import Callable, Union
import numpy as np
import torch
import diffusers
from diffusers import DiffusionPipeline
from diffusers.utils import logging
from diffusers.utils.import_utils import is_accelerate_availabl... |
edebe3a0fba42a1895bc746046e250db71faae887f7abe68cf14bff4fc787e6a | Python | 24,030 | 524 | # TensorMap.py
#
# The TensorMap takes any kind of data stored in an hd5 file
# tags it with a semantic interpretation and converts it into a structured numpy tensor.
# TensorMaps can be used as inputs, outputs, or hidden layers of models made by the model factory.
# TensorMaps can perform any computation by providing ... |
09aa048770f5e06fdfcff4fffd86a193a016d7be564ea16eabc842c38eef968b | Python | 24,031 | 676 | # Copyright 2021 Google Research. 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/LICENSE-2.0
#
# Unless required by applicable law... |
7f13e56f06926c91b04b1d9e2c2b415bdd5b4f2753825ec94b33252157ff21be | Python | 24,055 | 665 | """
SuggestionEngine - Enhanced suggestion generation with workflow planning.
This module provides the SuggestionEngine class which generates comprehensive,
actionable suggestions to fix missing prerequisites and data requirements.
"""
from typing import Dict, List, Optional, Set, Tuple, Any
from dataclasses import d... |
87d708e927534a73cfb6b214f2fe92a33fbb9611cfbf4e0a6c9c9f6e4e5334d9 | Python | 24,056 | 615 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This library is fre... |
0af6642ff426a90c2fb12b8edb04d90331f1e0e1cb9fd9ddb4741a724b8806a5 | Python | 24,061 | 489 | import torch
import torch.nn as nn
import numpy as np
# --- Zone Module ---
class zone(nn.Module):
"""
Assume well-mixed condition, and we have: Q = cmΔTzone
In other words, ΔTzone = Q/cm, that can be learned by a simple linear layer
The input of this module is ∑q, each q is calculated by distinct modu... |
7b0dcb3d01ba6e711bbc6275391022689f7f5c85a7c5b2dd8ef6b33d193b7aba | Python | 24,076 | 531 | import argparse
import itertools
import pickle
from collections import namedtuple
from typing import Dict, List, Tuple
import numpy as np
import torch
import tqdm
import visionloader as vl
from torch import autocast
from whitenoise import RandomNoiseFrameGenerator
import lib.data_utils.data_util as du
import lib.data... |
633174e7d34c6b7921965c0df6d8e7bc9b0818fae987d0386b2b44e638052369 | Python | 24,091 | 516 | #!/usr/bin/env python3
"""
Longitudinal ECG inference — both models are Keras.
Two modes controlled by --mode:
encode → run the Keras encoder on every visit and save to parquet.
One row per ECG visit:
patient_id, timestamp, event_age, visit_index,
latent_0, latent_1, …, ... |
3f674bccc13e5fcb8ba3a17a125230ac0b2968a89042fd3ce1ce64fa24fc88d6 | Python | 24,102 | 540 | # Ultralytics YOLO 🚀, GPL-3.0 license
import contextlib
from copy import deepcopy
from pathlib import Path
import thop
import torch
import torch.nn as nn
from ultralytics.nn.modules import (C1, C2, C3, C3TR, SPP, SPPF, Bottleneck, BottleneckCSP, C2f, C3Ghost, C3x, Classify,
Conca... |
922bd8c25923cf9007e27182fc98d1f2139e50df7921ccb515e2e507073fab26 | Python | 24,108 | 640 | """
Purpose
=======
This script is now the main script for running everything necessary on a single sample. It is the script that is modified when more stages are added/removed/changed for the entirety of the pipeline.
Keep in mind that runsample simply requires all inputs that all stages provide that they do not prov... |
2a41598302755bd08a0a3eda2925fc81e292cd3acce9e861e5ef52c36bdf2c7d | Python | 24,121 | 682 | import anndata
import numpy as np
import pandas as pd
import warnings
from scipy.sparse import issparse, csr_matrix
from .knn import (
neighbors_and_weights,
neighbors_and_weights_from_distances,
tree_neighbors_and_weights,
make_weights_non_redundant,
)
from .local_stats import compute_hs
from .local_... |
c0ba10731f8fa04701fdeaf015298219f5c2b71bd587ff986534e7ebc1daa309 | Python | 24,123 | 648 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
4ef241612e24d23c7213e691dbccf8506abe878c8e71a9155c41830324df334f | Python | 24,125 | 589 | """Module providing encapsulation of SpatRio for spatial cell mapping."""
from typing import Any
import pandas as pd
import numpy as np
import scanpy as sc
from .._registry import register_function
def _get_spatrio_functions():
from ..external.spatrio.spatrio import assign_coord, ot_alignment
return ot_align... |
0d774941f97660a6fcc3774d6bb00765094edba1d7761941094f883505bfb69c | Python | 24,136 | 669 | # @license
# Copyright 2023 Google 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 in... |
0fec0faf9e1e6db45f13b24b24c842553cb140d16530efb29c84080aa9aab379 | Python | 24,151 | 534 | __author__ = 'tsungyi'
import numpy as np
import datetime
import time
from collections import defaultdict
from . import mask as maskUtils
import copy
class COCOeval:
# Interface for evaluating detection on the Microsoft COCO dataset.
#
# The usage for CocoEval is as follows:
# cocoGt=..., cocoDt=... ... |
044922f47ef379df1387c31effbbc044f15d2e8b78b9631cc548fae235899d72 | Python | 24,156 | 650 | # -*- coding: utf-8 -*-
"""
"""
import sys as _sys
import re as _re
import numpy as np
from collections.abc import Mapping
from vtkplotlib._get_vtk import vtk
vtkCommands = [
i for (i, j) in vars(vtk.vtkCommand).items() if isinstance(j, int)
]
def null_super_callback():
"""A placeholder ... |
5ad91b5eae436a8ebdf09b7a2fd77a3d098f680eb5b2b02e604a0d29e6da845c | Python | 24,158 | 579 | #!/usr/bin/env python
# exon skipping
import pandas as pd
import numpy as np
from collections import Counter
import sys
from prepare_and_parse import class_by_transcript_pd
from prepare_and_parse import class_by_transcript
from prepare_and_parse import generate_split_table
from prepare_and_parse import determine_ord... |
4410b0656d0334ad4f1a3cdae143227c2725f21e97fd55f03276aab26cf38451 | Python | 24,164 | 588 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 8 17:31:36 2023
@author: nlancaster
"""
#Figure 2A
import pandas as pd
RT = []
mz = []
order = []
RT.append(0)
mz.append(680)
order.append(1)
RT.append(10)
mz.append(381)
order.append(2)
last_ms1_rt = 0
last_mz = 381
last_rt = 10
while last_mz<980:
if last_rt-l... |
f4e62555b9ba7666e45c86398565b3c1b3d1acc729a3e467a934071215fd439a | Python | 24,166 | 818 | """skorch utilities.
Should not have any dependency on other skorch packages.
"""
from collections.abc import Mapping, Sequence
from contextlib import contextmanager
from enum import Enum
from functools import partial
import io
from itertools import tee
import pathlib
import pickle
import warnings
import numpy as n... |
97eb9eab6ba8cdb65f05c9fd1cb802682bc113fab3fc855483516b5e92ee142b | Python | 24,189 | 588 | from PIL import Image
import numpy as np
from ctypes import *
import ctypes
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import cv2
import time
import pdb
import socket
import pickle
import scipy
import scipy.ndimage
import PySpin
import matplotlib.pyplot as ... |
579ba9bd8988072ef13e5dd0a81ca00d47084420b31ad38c66c13bf72aaf137d | Python | 24,192 | 465 | # Copyright 2023 The HuggingFace Team. 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/LICENSE-2.0
#
# Unless required by applicabl... |
0c2c5e93e708c699e57867b95f3f2d60fdc5ce81bf30649a85e1b34a3a2b577b | Python | 24,194 | 603 | #%% This class is dataloader for the MRI data
import os
import random
import numpy as np
import numpy.ma as ma
import scipy
from scipy import ndimage
from skimage import measure
# The mean and variance normalization
def whitening_transformation(image, mask):
# make sure image is a monomodal volume
masked_i... |
2186f386c5e2f04aa3cfcaf0d2123d7a80586f62046d7816ed5ea5511db43d8a | Python | 24,194 | 571 | import numpy as np
import pytest
import copy
import warnings
from lgca import get_lgca
from tests.common_test import T_LGCA_Common
com = T_LGCA_Common
@pytest.fixture
def nodes_1d_rbound():
# fixtures for 1D boundary conditions
# right
nodes = np.zeros((com.xdim_1d, com.b_1d + 1))
nodes[-1, 0] = 1 #... |
749cbe31d4a2f37eaddc17c63082e62413cd09f873fa126a98db4a5f05253ca6 | Python | 24,199 | 722 | """Clonotype definition, distance and networks for single-cell AIRR data.
A clean, AnnData-native reimplementation of the core of scirpy's clonotype
machinery:
* :func:`ir_dist` — pairwise CDR3 sequence-distance matrices
(identity / hamming / levenshtein / alignment).
* :func:`define_clonotypes` — exact-identity cl... |
9ec1be3aeb47c2990e9c0935c417f4fcea34f03f52fdc3e5e5e32286027814ff | Python | 24,208 | 648 | # Copyright 2024 The bayesnf Authors.
#
# 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 in ... |
6a9b84f777209cb78cfd4cd424b73307b8c8b536dfaf7736675a84417de71c40 | Python | 24,241 | 501 | # Copyright 2023 The HuggingFace Team. 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/LICENSE-2.0
#
# Unless required by applicabl... |
bae242ad6473e41d57e598ce4b71c2562397c7097ef4601960a7c10f4cf54f4c | Python | 24,262 | 623 | '''!
@file transformation.py
Defines a Transformation class for point and image transformations.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
Kinect For Azure SDK.
'''
import ctypes as _ctypes
import numpy as _np
import copy as _copy
from .k4atypes import EStatus, ECalib... |
61e5f8572af85e3aa52e3227007f5758a03c3e4e4db650c72f96b3e5cdb3176f | Python | 24,269 | 651 | # built-in dependencies
import os
import re
import json
import uuid
import hashlib
import struct
from datetime import datetime, timezone
from urllib.parse import urlparse, unquote
from typing import Any, Dict, Optional, List, Tuple, Union, cast
# 3rd party dependencies
import numpy as np
# project dependencies
from d... |
afce1b2bdc71d3859cef7769bcf9301d7fe38df01ff7d0645222a885ada69238 | Python | 24,300 | 655 | __doc__ = "Iterative medoid clustering"
import random as _random
import numpy as _np
import torch as _torch
from collections import deque as _deque
from math import ceil as _ceil
from torch.functional import Tensor as _Tensor
import vamb.vambtools as _vambtools
from typing import TypeVar, Union, Optional, cast
_DEFAU... |
d312be8ccc40e42a6d2f17e4c29568d2fd488e05d999856798e538f2cd5e3c9b | Python | 24,315 | 463 | import inspect
from typing import Callable, List, Optional, Tuple, Union
import numpy as np
import PIL
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import DiffusionPipeline
from diffusers.configuration_utils import FrozenDict
from diffusers.models import Autoen... |
f4869f0725c45568609810f740cbd2d262eef3e06dffb4bfeac9c933c7b49d39 | Python | 24,324 | 609 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 4 17:20:42 2021
@author: irisstone
Functions for visualizing and plotting results related to glmhmm fitting code
"""
import matplotlib.pyplot as plt
import numpy as np
import warnings
from glmhmm.utils import find_best_fit, uniqueSessionIDs
from g... |
a1b0dac3fbdfa5ab2883699b0083f65ce2f7160ed8ee04d1b2e493c2e9aa6ce6 | Python | 24,342 | 534 | from tracemalloc import start
from urllib import response
import numpy as np
import pandas as pd
import os
from collections import Counter
from random import choice
WC_DIR = "../results_experiments/whole_cell/"
PRE_INPUT_FILE = "MNI pre tone period BFA edit.xlsx"
POST_INPUT_FILE = "MNI tone period BFA edit.xlsx"
SPIKE... |
38aa5e569b7a388666eec83f3772f0c342b2a9e81008554fd222aac173dbb586 | Python | 24,354 | 612 | import socket
import warnings
from typing import Callable, Dict, List, Optional, Tuple, Union
import samna
from .dynapcnn_network import DynapcnnNetwork
from .io import launch_visualizer
class DynapcnnVisualizer:
"""(tlx, tly, brx, bry)"""
# Default layouts
# (tlx, tly, brx, bry)
DEFAULT_LAYOUT_DS ... |
3b69cfd11e5bd868797d95361607d6e8874fd8b526d9cd44561ddf154cfad98c | Python | 24,354 | 518 | # Copyright 2023 The HuggingFace Team. 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/LICENSE-2.0
#
# Unless required by applicabl... |
66bef97c8718ae90fdc98cedb9c34aaacc7531305d5435a094414edd5b99e9d5 | Python | 24,365 | 673 | from multicamera_acquisition.interfaces import get_camera
from multicamera_acquisition.video_io import write_frame
from multicamera_acquisition.paths import ensure_dir
from multicamera_acquisition.interfaces.arduino import (
packIntAsLong,
wait_for_serial_confirmation,
)
from multicamera_acquisition.visualizati... |
d6504749326581a98ddfabaf1af46d07acb802ea41c9c94534ad1adfc868a9b0 | Python | 24,369 | 689 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import Dataset, DataLoader
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import argparse
import pdb
import os
import sys
import... |
70d0183d9860eb05a0a63c76e4b96ea0c57bfc6d71679156446fe44eccad43a0 | Python | 24,379 | 590 | #
# CEBRA: Consistent EmBeddings of high-dimensional Recordings using Auxiliary variables
# © Mackenzie W. Mathis & Steffen Schneider (v0.4.0+)
# Source code:
# https://github.com/AdaptiveMotorControlLab/CEBRA
#
# Please see LICENSE.md for the full license document:
# https://github.com/AdaptiveMotorControlLab/CEBRA/bl... |
629dea337d88688a8cae9f2c19c1690d5d362f6bedc857786d945bcab91e5751 | Python | 24,389 | 476 | import time
import math
from DataPrepare import DataCook
import Net
import matplotlib
from sklearn.metrics import mean_absolute_error, r2_score, mean_squared_error
matplotlib.use('TkAgg',force=True)
import matplotlib.dates as dates
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
impo... |
b0ad43c8ecdcc6e5e17362e9800c1fe7bfc63adef086837f3b656228d66054d0 | Python | 24,403 | 534 | # Copyright 2023 Kakao Brain and The HuggingFace Team. 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/LICENSE-2.0
#
# Unless requi... |
8c2c864107f3e194876772d8e1fc4e64db9e7c3b66a8b3575ab62519c4c8c6d6 | Python | 24,407 | 628 | """
JarvisSession and SessionManager — per-user state for the Telegram bot.
"""
from __future__ import annotations
import os
import re
import shlex
import subprocess
import sys
import importlib
import threading
import uuid
from dataclasses import dataclass, field
from datetime import datetime, timedelta
from pathlib i... |
8933cda72f4496dac28f8525707996f7aa8040eb553d6b193f7767a539c0198e | Python | 24,417 | 636 | import io
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal, interpolate
from numpy import mean, absolute, var
import math
from scipy.signal import find_peaks
import pandas as pd
from scipy.integrate import simpson
from scipy import stats
from scipy.ndimage import label
from PIL imp... |
83deeb296643bd44036373439d820f65874a57fd0a38bd4c81a4c37f8d4a2c97 | Python | 24,422 | 840 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import traceback
from contextlib import suppress
from typing import Any
import rq
from crum import get_current_request, get_current_user
from django.db import DatabaseError
from django.db.models import Model
from rest_framework import status
from re... |
ae5627657f8c70478bf4c5e42858200ba232e565c303d18f97ea95aeb7b69865 | Python | 24,433 | 501 | import sys
from matplotlib import pyplot as plt
import omegaconf.listconfig
import pandas as pd
from tqdm import tqdm
import math
import os
from typing import Callable, List, Tuple,Dict, Union
import torch
import torch.optim
import torch.nn as nn
import numpy as np
from einops import rearrange,repeat
from os.path impor... |
a420e9e0eba0e94c8b7aa68b041d9128410e40d9c9fc232f38e780857200e432 | Python | 24,447 | 692 | import logging
import os
import shutil
import sys
import tempfile
import time
from functools import partial
from pathlib import Path
import pytest
import pytest_asyncio
import yaml
import ray
from ray._common.network_utils import build_address
from ray._common.test_utils import async_wait_for_condition, wait_for_cond... |
a0ed5e044ef2484bee13ec597790da391683988bbc69f466c836de6fb3816c8a | Python | 24,455 | 797 | import abc
import asyncio
import datetime
import functools
import importlib
import json
import logging
import os
import pkgutil
from abc import ABCMeta, abstractmethod
from base64 import b64decode
from collections.abc import Mapping, Sequence
from dataclasses import dataclass
from enum import IntEnum
from typing import... |
7fe2966f9211df0d230145d1482dee7dc2cdafa07b36c8b8738a23b52216160b | Python | 24,465 | 485 | #Multiple stage model
from functools import reduce
from src.models.year import learned_ensemble
from src.data import TreeDataset
from src import utils
from pytorch_lightning import LightningModule
import pandas as pd
import math
import numpy as np
from torch.nn import Module
from torch.nn import functional as F
from t... |
1da2b599cbd2472039e7972d74baa37fb9ffa30713154acd0919f4444eb40c0c | Python | 24,472 | 830 | # a collection of functions necessary for running the SSN model
from numba import njit, jit
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import copy
from cycler import cycler
import model_data
import iminuit
import iminuit.cost
from scipy.stats import loguniform
import pickle
f... |
1f0ef99e0c1f8a0156c42ba3a49f1ee7f9bd44380c7ebc71cf02449786f261df | Python | 24,472 | 530 |
"""
__author__ = "Peizhuo Wang"
__email__ = "wangpeizhuo_37@163.com"
__citation__ = Wang, P., Wen, X., Li, H. et al. Deciphering driver regulators of cell fate decisions from single-cell transcriptomics data with CEFCON. Nat Commun 14, 8459 (2023). https://doi.org/10.1038/s41467-023-44103-3
"""
from os import fspath... |
eb268bcd5ac5e22e116428b71fd912be760fb5794d6f638cbdfc97427f71ed11 | Python | 24,482 | 502 | # ML4H is released under the following BSD 3-Clause License:
#
# Copyright (c) 2020, Broad Institute, Inc. and The General Hospital 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:
#
#... |
964df1a2ca9334493f7cb913b4330be0afbec8ad3a6cdb61d0ecc87ed369d94d | Python | 24,490 | 814 | # coding: utf-8
import copy
import logging
import pickle
import re
import signal
import sys
import time
import pytest
import ray
import ray._private
import ray.cluster_utils
from ray._common.test_utils import SignalActor
from ray._common.utils import (
get_or_create_event_loop,
)
from ray._private.test_utils impo... |
19479a2c806ccd5d35cda48ee86a3e7825a996a2a3f96ac60727f5dd02c31f83 | Python | 24,491 | 617 | """Display-independent HTML reports for surface maps."""
# Author: The BrainSpace developers
# License: BSD 3 clause
import json
import re
from html import escape
from pathlib import Path
import numpy as np
from .colormaps import colormaps
def _rgba255(color):
arr = np.asarray(color, dtype=float)
if arr.n... |
59aa1ece5357355f2e2f180f63ea9c32764eb6c915b10a3b4ef021ff32c6026f | Python | 24,578 | 436 | from argparse import ArgumentParser
import os
import os.path
import sys
import skimage
import skimage.segmentation
import sklearn.preprocessing
import sklearn.model_selection
import math
import shutil
import pathlib
import glob
import shutil
import uuid
import random
import platform
import torch
import torchvision
imp... |
987b87c94d5e3a22dc35ec2e4c4e57effee13e5f1952ad995aa86ec9658340cd | Python | 24,583 | 550 | # Copyright 2023 Alibaba DAMO-VILAB and The HuggingFace Team. All rights reserved.
# Copyright 2023 The ModelScope Team.
#
# 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.apa... |
c94be0408edc590b068553a196757f021b180836ccdd636a2dfd0f4ddf2fb51b | Python | 24,586 | 560 | #!/usr/bin/env python
""" compare how the elements behave
We create a folder ground truth that possess the same thing than the other
in a form of a dictionnary containing nparrays and other info.
the other files contains every test and the name is the date of the test
See Also
------------
Link
\image dev/kalfon/i... |
482bbde60d39867af57ee1c4c6b36345f68e45015d6afccd26d3f383a9f845a5 | Python | 24,595 | 298 | """Training data from runs with known glycans: the inputs CandyCrunch builds from a run (pooled spectra of MS1-refined precursors, one per candidate
composition), labelled from a mapping of the run's glycans (e.g. a GlycoPOST map), so that the model is trained on what it gets at inference.
On 24 runs with audited grou... |
86c2e36040ccea1aa87cb68424f414e241736751833189c8fd90bb2bf97b6443 | Python | 24,596 | 586 | # coding=utf-8
# Copyright 2023 HuggingFace 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 ag... |
bda7f60dae7ddedb3aeb4252c118c6bde1a2d936fe6dc8dfd107b6433f027b34 | Python | 24,596 | 649 | import os
from copy import deepcopy
from logging import Logger
from math import floor
from typing import Tuple, Union, List, Dict, Callable
import numpy as np
import pandas as pd
import torch
from ignite.engine import _prepare_batch
from ignite.utils import convert_tensor
from monai.data import Dataset, DataLoader, Di... |
0ae0d20cbcad20f550dd45d2914b4ac675e3353122d6ad99cf844748116b1436 | Python | 24,607 | 417 | r"""Synthetic biology for omicverse — ``ov.synbio``.
A self-contained, three-layer design-build stack that bridges **metabolism**,
**protein/enzyme engineering**, and **DNA**:
Layer A — metabolic networks (CPU, COBRApy)
``load_gem`` · ``fba`` · ``pfba`` · ``fva`` · ``single_gene_deletion`` ·
``double_gene_del... |
76dcf53cd4a3f45547bf412e99d980fc4e5289960ca1029a5de0069ccdd8955f | Python | 24,620 | 496 | """
modeled after the textual_inversion.py / train_dreambooth.py and the work
of justinpinkney here: https://github.com/justinpinkney/stable-diffusion/blob/main/notebooks/imagic.ipynb
"""
import inspect
import warnings
from typing import List, Optional, Union
import numpy as np
import PIL
import torch
import t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.