sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
42836710f9e0ac605b946c959bbf6d8dae36bd1dfe1da2f8911f90cd42b63139
Python
54,543
1,143
import inspect import re from typing import Callable, List, Optional, Union import numpy as np import PIL import torch from packaging import version from transformers import CLIPImageProcessor, CLIPTokenizer import diffusers from diffusers import OnnxRuntimeModel, OnnxStableDiffusionPipeline, SchedulerMixin from diff...
1d85831d689c0b836db64d7acb20846160871b88e999f01bbb08c46674b1f87b
Python
54,613
1,232
# coding: utf-8 import os import sys from typing import Dict, List, Tuple import pytest from ray.actor import ActorHandle from ray.dag import ClassMethodNode, InputNode, MultiOutputNode from ray.dag.compiled_dag_node import CompiledTask from ray.dag.dag_node_operation import ( _add_edge, _build_dag_node_opera...
5532d9c4ae9b5141b3258dfd1596c389d65f63a2b9e40ac2c1c6bede52472d25
Python
54,648
1,173
#!/usr/bin/env python import argparse import gzip import logging import sys from collections import Counter from statistics import median from typing import List, Text, Dict, Optional, Set from pysam import VariantFile from intervaltree import IntervalTree # Parameters MIN_SIZE = 1000 MIN_DIFF = 0.4 MIN_SIZE_IDEL =...
91f7f4ea788dfe34c7e4eef69e2c68a9f6810fc1aa849c5e2afc485bb1fb4de9
Python
54,723
1,331
# ------------------------------------------------------------------------------------------------------------------------------------- # Following code curated for Bio-Diffusion (https://github.com/BioinfoMachineLearning/bio-diffusion): # --------------------------------------------------------------------------------...
fd78fe42cfa745af4b6fc6975e301cc503af9f247a9a2c0c2ee2b48f8db72271
Python
54,845
1,140
import os from pathlib import Path from collections import OrderedDict from random import sample from typing import Optional, List, Iterable import fire import humanize import numpy as np from rich.console import Console from rich.table import Table from rich.progress import Progress import tables as tb from textdista...
6dfc3b522bca744a9865b7292b1f094f44ddad76a6c3cc4cccc1b6cf9c550cef
Python
54,976
1,721
import pytest import sys import fastremap import cc3d import numpy as np INT_TYPES = [ np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64, ] TEST_TYPES = INT_TYPES + [ np.float16, np.float32, np.float64 ] OUT_TYPES = [ np.uint16, np.uint32, np.uint64 ] def gt_c2f(gt): f_gt = np....
35987462f58c212dbcff65b885b5e0fb2ca82eb09a1517ac7261ab9035bb7a65
Python
55,064
1,121
# Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/ import inspect from typing import Any, Callable, Dict, List, Optional, Union import numpy as np import PIL.Image import torch import torch.nn.functional as F from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from diffusers...
d73ae1e24f1c7111dd24e1f178b118ff76ed4b9706a34a782706578f10268c2d
Python
55,075
1,276
import os import argparse from sklearn.model_selection import train_test_split from check_params import * from read_input import * from process_input import * from plot_images import * from data_generation import DataGenerator import gpustat import itertools import PIL.Image as Image from matplotlib import pyplot as pl...
a8e7a443f9087df99bd0670a28ed3010ebd837cc05c7eb54e0d7da5cd497d553
Python
55,167
1,192
import pandas import numpy import warnings from typing \ import Optional, Callable, Any, Union, Mapping, List, Tuple, Iterator, Collection, Text, Dict, TypeVar, Iterable from types import MappingProxyType from tqdm.auto import tqdm with warnings.catch_warnings(): # pympler has some deprecated matrix stuff, I do...
05edccf7010398a1feecfc77f650ef401b44c2c7e92169ad70d958c9e66f02d5
Python
55,327
1,467
""" Feishu webhook channel for OmicVerse Jarvis (feature-parity focused). Capabilities: - URL verification handshake - Websocket long-connection event subscription - Deterministic session routing by chat/thread - Streaming draft updates (edit message) - Send images/files from analysis artifacts - Receive .h5ad file me...
9c5b08fe5b1644859741a8cf0810ca067a96d1bad415198c99c6c2a0decab7ed
Python
55,456
1,412
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. # pylint: disable=too-many-lines, disable=possibly-used-before-assignment # mypy: disable-error-code=attr-defined """Base tile with added periphery and common u...
6276d2e71879d3fa05a559ce630a2a6f9716a6ef93461ad54884df0b4d1f77b2
Python
55,519
1,562
import contextlib import enum import itertools import logging import math from collections import abc from typing import ( TYPE_CHECKING, Any, ClassVar, Final, Literal as L, # noqa: N817 SupportsIndex, TypeAlias, TypeVar, cast, overload, ) import numpy as np import numpy.typing...
d2254f1428c0d4c953a309fbc5517ce29bace796fdbf5af2f92e85ad3820ca15
Python
55,559
907
# -*- coding: utf-8 -*- """ Module containing vision specific analysis. """ import mozaik import numpy import scipy import quantities as qt from .analysis import Analysis from mozaik.tools.mozaik_parametrized import colapse, colapse_to_dictionary, MozaikParametrized from mozaik.analysis.data_structures import PerNeuron...
7261e60096fc1474d1da838f891306a5cc2e4f92e41374d2b422a36ec1bd7221
Python
55,604
1,235
r"""Tuning a construct rather than just building one. Five gaps that are individually small and collectively the difference between a design that works and one that works *at the level you wanted*. * :func:`tai` — the tRNA adaptation index. ``cai`` measures how closely a gene's codons match the *codon usage* of hig...
b8166a31551f655bc9f8f8ec3588860bd6c514edcf481449f8896083b74ecee0
Python
55,607
1,313
""" Module to write a Ray Dataset into an iceberg table, by using the Ray Datasink API. """ import logging from dataclasses import dataclass, field from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Union, ) import ray from ray._common.retry im...
0df298c92f45fbcbe5f0ae460687fdd038563cef798de7ffcafd4404f417224c
Python
55,872
1,211
import numpy as np import scipy.sparse as _sp import scanpy as sc import warnings from ..pp import preprocess from .._settings import add_reference from .._registry import register_function def _select_significant_svg_names(qvals, *, n_svgs, qval_threshold): """Return at most ``n_svgs`` finite q-values below the ...
5cddc32a43803fd64d9d90a9fcbf82f01a3b2a5eb227b5837f29e7a5771f8ee6
Python
56,018
1,325
import io import subprocess import sys import tempfile import unittest from pathlib import Path from typing import Optional from unittest.mock import patch import pytest import runfiles from click.testing import CliRunner from networkx import topological_sort from ci.raydepsets.cli import ( DEFAULT_UV_FLAGS, ...
ba1be7cfebf6ef225c5f8bbeb74633d14005904593467da14ef47eda9f3f9148
Python
56,039
1,516
r""" See :mod:`mozaik.visualization` for more general documentation. """ import mozaik.visualization.helper_functions as phf import pylab import numpy import math import mozaik import mozaik.tools.units import quantities as pq from matplotlib.colors import * from matplotlib.ticker import MultipleLocator, AutoMinorLocat...
07b2058b9a573b09d0d824427aa90a3c5195c161e3bc82518dd59f8b5e5f4dd8
Python
56,235
1,414
import numpy as np import pandas as pd import scanpy as sc import anndata as ad from joblib import Parallel, delayed from scipy.sparse import coo_matrix, csr_matrix from scipy.stats import mode from collections import Counter import matplotlib.pyplot as plt import seaborn as sns from typing import Dict, List, Tuple, O...
726afb7504004ff37becb867227fe322cfb5134c9f10fc20f0797a50725216c2
Python
56,375
997
import numpy as np; np.set_printoptions(precision=2) import torch; torch.set_printoptions(precision=2) import torch.nn as nn import time import sys import itertools import random; random.seed(0) import datetime import copy import scipy import matplotlib.pyplot as plt # This is added by VScode class BioRNN_working(to...
67cd749e4cf6a16e242e8f7993228e1958b7fd70328809a7161e95fe5f8d1c0c
Python
56,376
1,601
""" Function Registry System for OmicVerse This module provides a decorator-based function registration system that allows users to discover functions using natural language queries, aliases, and semantic search. """ from typing import Dict, List, Optional, Callable, Any, Union, Tuple from functools import wraps from...
0af92d4a6bc707d7c5ac39492435eba9cfaf18e2ab6836c3a059eb85d88eb970
Python
56,490
1,076
"""Unified cell-cell communication entry point: ``ov.single.run_ccc(method=...)``. Every backend is reduced to one *long table* with the columns in :data:`LONG_COLUMNS` (one row per sender, receiver and ligand-receptor pair). The long table is what the consensus, the method comparison and the ``ov.pl.ccc_*`` communica...
89a7df499acf807f745d11df33e7379e84cfa55c21dfd552957b8c0e576b6314
Python
56,527
1,295
# built-in dependencies import os from typing import Any, Dict, IO, List, Tuple, Union, Optional, cast, TYPE_CHECKING import uuid import time import math import tempfile from concurrent.futures import ThreadPoolExecutor # 3rd party dependencies import numpy as np from numpy.typing import NDArray # project dependencie...
e48f8594d09411adcc1d3443996c375b802f534e0855daa6264cae55690f605c
Python
56,574
1,663
# Copyright (C) 2019-2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import io import itertools import os import shutil import stat import tempfile import zipfile from abc import ABC, abstractmethod from bisect import bisect from collectio...
42e2ff9e4792e2157daacc744b158fe46257181c7aa3e36e16ed2db772187c3f
Python
56,716
1,062
# -*- coding: utf-8 -*- """ Module containing lfp specific analysis. """ import mozaik import numpy import scipy import quantities as qt from .analysis import Analysis from mozaik.tools.mozaik_parametrized import colapse, colapse_to_dictionary, MozaikParametrized from mozaik.analysis.data_structures import AnalogSignal...
ac0426cf2983a569280603edc9163978aa26167cb7a8a1513b77d32433ffa529
Python
57,201
1,150
import inspect import re from typing import Callable, List, Optional, Union import numpy as np import PIL import torch from packaging import version from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer import diffusers from diffusers import SchedulerMixin, StableDiffusionPipeline from diffusers.m...
d4a3177c75e0e82d15fe246df693b4422b20dbd951ce1f9e781f6e95ed0004f8
Python
57,685
1,355
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
105d2901cebf4bfadbe93ce1703a81f2c71f162c325975608daa243a8dcda3e9
Python
57,728
1,495
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import textwrap from collections.abc import Iterable, Iterator, Mapping from enum import Enum from typing import Any from django.conf import settings as django_settings from django.db import models as django_models from django.db import transaction ...
81e2100140817341b056ff75db8eb60e58a7156ea8803ae45bdb523293a56947
Python
57,751
1,353
from typing import Callable, List, Iterator, Tuple, Union from abc import ABCMeta, abstractmethod import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from movie_upsampling import batch_compute_interval_overlaps, TimeUpsampleTransposeFlat, JitterFrame from convex_optim_base.optim_base...
4a3b23b90397a7a5161b28e7e6daee07814c4f016690760552b148a2c542eda8
Python
57,874
1,142
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # pylint: disable=broad-except # pylint: disable=invalid-name # pylint: disable=line-too-long # pylint: disable=multiple-statements # pylint: disable=too-many-lines #------------------------------------------------------------------------------- ''' This file contains th...
86bc2ef0484cbce9b59c66f2b2eb09bb05bb5634d81691d7c467c1da6eab7a28
Python
58,114
1,208
import torch import numpy as np import time def dist2bins(mat): """ This function is for label bins definition: left open, right close. Because cutoff 8 definition: d<=8 two kinds of bin length: 0.5,1.0 bins:3.0],(3.0,3.5],(3.5,4.0],...,(21.5,22],(22,23],(23,24],...,(29,30],(30, Nbi...
2bf3349236f40cef0f4bffd027d9f502dfa2e010344dfaa9dcaf685710832eba
Python
58,258
1,481
''' test_device_azurekinect.py Tests for the Device class for Azure Kinect device. Copyright (C) Microsoft Corporation. All rights reserved. ''' import unittest import copy from time import sleep import numpy as np import k4a import test_config def k4a_device_set_and_get_color_control( device:k4a.Device, ...
91394e1a59bbbf4f09482f92d6247cd14c06ca69b6b9b1ae4686e6b55831a235
Python
58,325
1,683
""" Copyright (c) Meta Platforms, Inc. and affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Tests: radius-graph construction — fcc/molecular/water-box structure helpers, partition utilities, multi-radius PBC graph builders ...
6676ee91d7862190e180b3bddea0b63804ec8b265f5aea41bc6a5c94a1c29f55
Python
58,441
1,599
import base64 import json import sys import uuid from typing import Optional from unittest.mock import MagicMock import pytest from google.protobuf.timestamp_pb2 import Timestamp import ray.dashboard.consts as dashboard_consts from ray._common.network_utils import find_free_port from ray._common.test_utils import wai...
5f3e97070c87165f45fcd4cccc2f7520bf448c332ecf641dd7ee4d5113c2465f
Python
58,610
1,210
import copy import itertools as it import logging import math import os import random import sys from statistics import median import numpy as np import pandas as pd import torch import torch.utils.data import torch_geometric.transforms as T from rdkit import Chem from torch.distributions.uniform import...
aee6d4338f3dd41b2f277661a38176f58dfbec58856f997da433bdf892d105c7
Python
58,774
1,718
import sys import math as python_lib_Math import math as Math import inspect as python_lib_Inspect import sys as python_lib_Sys import builtins as python_lib_Builtins import functools as python_lib_Functools import re as python_lib_Re import traceback as python_lib_Traceback from io import StringIO as python_lib_io_St...
9d94e10e7183e8dfd3cfd6367ff3ab3d1fb1bb90b2bf4ab6c77e0e0d195b6fd6
Python
58,808
1,492
""" Copyright (c) Meta Platforms, Inc. and affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ from __future__ import annotations import io import json import logging import math import time from collections import OrderedDict, defau...
902aaa7301f34ba42f64806e38873a3e6abb91b8af6f198e0f2711b620ae4c6d
Python
58,829
1,633
# Copyright (C) 2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations from collections.abc import Sequence from enum import StrEnum from typing import TYPE_CHECKING, Any, cast from django.conf import settings from django.shortcuts import get_ob...
29c2c0fee031a762ae3096fdbda4d5bdeec52c5510bbb998903ddd0ac7317917
Python
58,874
1,552
"""Pickler class to extend the standard pickle.Pickler functionality The main objective is to make it natural to perform distributed computing on clusters (such as PySpark, Dask, Ray...) with interactively defined code (functions, classes, ...) written in notebooks or console. In particular this pickler adds the foll...
0fc13774e8254acbbd0804d89627e7763bd2859917dfb24f2e1ed7c7a3970e65
Python
59,027
1,261
import torch import numpy as np import os, time import scipy import pandas as pd import Loss def dist2bins(mat): """ This function is for label bins definition: left open, right close. Because cutoff 8 definition: d<=8 two kinds of bin length: 0.5,1.0 bins:3.0],(3.0,3.5],(3.5,4.0],......
e9168c549284cdf23f1d2f136bbf8f0b671d14eaf9388a398f13651cea57fad1
Python
59,183
1,402
import time import sys import argparse from itertools import cycle import threading import os import numpy as np from collections import deque from bisect import insort, bisect_left from itertools import islice import matplotlib.pyplot as plt class Evt(object): def __init__(self,id,direction,starti,endi,ampi,X,Y...
4f7489abe0f69fc1486e10e7239dfe1c4c7c4d091c6939b96c003e8b475474ea
Python
59,184
1,402
import time import sys import argparse from itertools import cycle import threading import os import numpy as np from collections import deque from bisect import insort, bisect_left from itertools import islice import matplotlib.pyplot as plt class Evt(object): def __init__(self,id,direction,starti,endi,ampi,X,Y...
1f3e8b5c12595ee1482d020afdbaf3ce16a6c19a4b7800b9eb04d5131fb41727
Python
59,378
1,563
# __init__.py # # Copyright 2018 Chichau Miau <zmiao@ebi.ac.uk> # # 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 2 of the License, or # (at your option) any later version. ...
6d648dacb8fee7938f74dc19118e3e0a8f11ae8e9f8b39291f66ff8f189a5d66
Python
59,514
2,104
BROWNIAN_CELL_MATCHES = { ('2018-08-07-5', 'data011'): '''#ON parasol 12:data009,307;data010,808 1046:data009,637;data010,632 359:data009,119;data010,814 364:data009,884;data010,947 33:data009,335;data010,838 1052:data009,943;data010,927 369:data009,1138;data010,651 370:data009,856;data010,1099 373:data009,...
3dec761218f9474b1ae57603965d59128be040f720431ecf96a132bdafc07fa3
Python
59,725
1,254
# Copyright 2023 Pix2Pix Zero Authors 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 # # Unl...
ddedf675d05c756660d4d3124cb68abcee1908d4148b0f01c4f604710420d004
Python
59,726
1,712
import asyncio import json import os import secrets import signal import sys import tempfile import time import urllib.request from unittest.mock import patch from uuid import uuid4 import pytest # RayConfig reads the auth mode once at import, so set the mode before importing # ray. A per-process random token, inheri...
b6d67e60c7ad62116366825d7251cee76cfe503e596e1ef7b9cbd9b12b75e56b
Python
59,805
1,415
import time import sys import argparse from itertools import cycle import threading import os import numpy as np from collections import deque from bisect import insort, bisect_left from itertools import islice import matplotlib.pyplot as plt class Evt(object): def __init__(self,id,direction,starti,endi,ampi,X,Y...
7638d9302e7c2d0962a522077b035854259d61cd8527e99b6099a0481f99e39e
Python
59,806
1,415
import time import sys import argparse from itertools import cycle import threading import os import numpy as np from collections import deque from bisect import insort, bisect_left from itertools import islice import matplotlib.pyplot as plt class Evt(object): def __init__(self,id,direction,starti,endi,ampi,X,Y...
02f456cf3d2b957574e94a2268c3978f353d1d74a2491680b6d1a8597844b46c
Python
59,950
1,614
# # 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...
775f6c6be795112802179ea2e7faf76e677573a264019dd426b4a37b7960d4a0
Python
60,125
1,591
from typing import Tuple, Optional, Union, List try: from typing import Literal except ImportError: from typing_extensions import Literal import logging from tqdm import tqdm import numpy as np import pandas as pd import scipy.sparse as sp from pandas.api.types import is_numeric_dtype, is_categorical_dtype fro...
a80f4d91f2724d3f850685cf796ed94a1c247f8a95bef620ff2de35889548615
Python
60,179
1,667
import json import os import pathlib import sys import threading import time from dataclasses import asdict from http.server import BaseHTTPRequestHandler, HTTPServer from pathlib import Path from unittest.mock import Mock, patch import pytest import requests from jsonschema import validate import ray import ray._com...
a061c37c7dddb882962c972814aae94e1c0f0a564e5cfb9021591d333fbcf01b
Python
60,328
1,514
""" QQ Bot channel for OmicVerse Jarvis. Capabilities: - C2C private chat messages - Group AT messages (group chat where @bot is mentioned) - Guild (channel) AT messages - Long-connection WebSocket event subscription (no public URL needed) - Streaming status updates during analysis - Send images from analysis artifact...
6fa79b9f1763686df7e5b3dc81da8fd73865d1b60186a28efeed40d9955d573e
Python
60,496
1,886
# Copyright (C) 2018-2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import datetime import re import shutil import uuid from abc import ABCMeta, abstractmethod from collections.abc import Collection, Iterable, Sequence from enum import En...
bd18fe1f2f5808025c14d9a9614a548a845088516835f5c350fbac027f5ee533
Python
60,574
1,429
import numpy import copy import random import json import os import datetime import h5py import glob import uuid from functools import partial from scipy import optimize, interpolate from matplotlib import pyplot from collections import defaultdict from skimage import filters, transform from abberior import microsco...
ae53c3f0d83765e2380f9b9e183b6737c9391e3cee29edc03819bc67874ef27e
Python
60,595
1,108
import sys from typing import List, Tuple, Dict, Optional, Union from dataclasses import dataclass import numpy as np from rawmovie import RawMovieReader2 from lib.dataset_config_parser.dataset_config_parser import LookupKey from lib.dataset_specific_ttl_corrections.ttl_interval_constants import NS_BROWNIAN_N_FRAMES_...
0fe1b22b28f394aef0ef11bb9fbfa84b87aecb8cb8f0b892fe163b65eb8027a6
Python
60,885
1,551
# Copyright (C) 2021-2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import io import itertools import mimetypes import os import re import shutil import stat from abc import ABCMeta, abstractmethod from collections import deque from collections.abc import Collection, Iterab...
9568f8dbcf8e38a4538299f506ddb8a085df2c6c115b5eafad0ede04a9c31fc8
Python
60,975
1,636
import itertools import json import os import re import sys import threading import time from typing import Any, Callable, Dict, List, Optional import pandas as pd import requests from anndata import AnnData import scanpy as sc from ..datasets import download_data from .._registry import register_function from ..repo...
08725e73d5d2303133e2f9bf09968fb63dc9a81a914d0c8abc230653598129e8
Python
60,981
1,576
# internal python imports import os import csv import functools import torch from torchvision.utils import make_grid from tensorboardX import SummaryWriter import sys from itertools import permutations, combinations # third party imports import numpy as np import scipy from skimage import measure import glob from date...
5e215b552b8d6ef23beee733b2b72681a84ad77b8f31a53e139552565980a3d8
Python
61,214
1,481
"""OpenAI-compatible and Responses API provider helpers for OmicVerseLLMBackend. Internal module — import from ``omicverse.utils.agent_backend`` instead. """ from __future__ import annotations import base64 import json import logging import os import platform import re import ssl import warnings from typing import An...
353de05dd80242df34e68267de39ae3f6f8a23de480170fad238b2960a759d9a
Python
61,241
1,549
r"""Plotting helpers for in-silico gene-perturbation results. Targets the dictionary returned by :meth:`omicverse.llm.SCLLMManager.perturb_genes` (see also :meth:`omicverse.llm.geneformer_model.GeneformerModel.perturb_genes`), which has the schema: { "cosine_similarities": DataFrame (cell × gene), ...
845db10f272851cd9b96fd1eedf32cd3d7ae106a4439d40a3bb5fc9ad0cee11d
Python
61,335
1,709
# built-in dependencies from typing import Any, List, Union # 3rd party dependencies from numpy.typing import NDArray # project dependencies from deepface.commons import package_utils, weight_utils from deepface.models.FacialRecognition import FacialRecognition from deepface.commons.logger import Logger logger = Log...
21c33ce90af50f8d5dd6c99c55a4940d68fb5b39fcddc1b4683124533c267de9
Python
61,396
1,089
import torch import numpy as np from sklearn.metrics import roc_auc_score import torch.nn.functional as F from sklearn.manifold import TSNE import matplotlib.pyplot as plt from scipy import stats from scipy.special import softmax from lifelines import KaplanMeierFitter, CoxPHFitter, AalenJohansenFitter from lifelines.s...
add9340ff20b75a8e3a2fd8a2e04574a2c7affe753c8a00e374cf27c32da7ef4
Python
61,496
1,449
''' CINNAMON-GUI Convolutional Neural Network And Multimodal Learning with Graphic User Interface for Digital Pathology Lunan Foldomics, Copyright(c) 2024 ''' import subprocess import os import sys import io import re import shutil import pandas as pd import numpy as np import json import tensorflow as tf from PIL imp...
eeac400127bea666d45ca4b57728e19ce33ae0ae75676e27239bf01ca8ed1bf0
Python
61,796
1,267
#!/usr/bin/env python from __future__ import print_function import argparse import glob import gzip import math import pickle import sys import time import matplotlib.pyplot as plt import numpy as np import os # file names FP_NAME = "fp.vcf.gz" FN_NAME = "fn.vcf.gz" TP_NAME = "tp.vcf.gz" # vcf tags MPI_TAG = "MPI" ...
86c5573e1b599cea4777fb4e263103ba51d4a8f31ca44e1438ee51e78358908c
Python
61,899
1,479
"""TurnController — agentic orchestration loop + follow-up gate. Extracted from ``smart_agent.py``. The TurnController owns the main turn-by-turn loop (LLM call → tool dispatch → result append → repeat) including stall detection, cancellation, and conversation logging. Policy helpers (FollowUpGate, ConvergenceMonito...
af12bc52d7aff8394fedc1140e3983973cf83eff05242927abc9c911f88b5b8e
Python
62,080
1,538
#!/usr/bin/env python ''' Find potential de novo variants in a given VCF. de_novo_finder_3.py is a major update to the original caller. The main purpose is to identify events that appear to be de novo in a specified VCF file that contains sequence information from trios. Due to the nature of this variation, parents ar...
3dadedc8a4f8926a14f83513a891bf989930fc98fe046660746b085f6ba38215
Python
62,193
1,137
import os import time from subprocess import call import numpy as np import pandas as pd import seaborn as sns from scipy import stats import seaborn as sns import matplotlib.pyplot as plt import scipy as sc from matplotlib.colors import ListedColormap import scipy.sparse as sparse import importlib import copy import ...
a7e8b013098b321c1a2758a1651ad45b450cc9db6946dbde0fc834d576d7992a
Python
62,613
1,622
# -*- coding: utf-8 -*- # (C) Copyright 2026 IBM. All Rights Reserved. # # Licensed under the MIT license. See LICENSE file in the project root for details. # pylint: disable=too-many-lines """RPU configurations presets for resistive processing units.""" from dataclasses import dataclass, field from aihwkit.simula...
57f02efc5e37933f90350b29862655cbbc4a9af024b833dcd6783f618b590cb4
Python
62,837
873
"""Readers for mzML, mzXML, mzData, mgf, Thermo .raw, Agilent MassHunter .d and SCIEX .wiff spectra files, on the standard library and numpy""" import base64 import heapq import itertools import os import re import struct import zlib import xml.etree.ElementTree as ET import numpy as np # Thermo .raw trailer extra fiel...
db8bdb22029752869bd9f9033434a88dc3b424d56c10e9b0d24966ae0d46f75f
Python
62,856
1,769
import copy import datetime import hashlib import json import logging import os import random import shutil import subprocess import sys import tempfile import time from concurrent.futures import ThreadPoolExecutor from types import ModuleType from typing import Any, Dict, List, Optional, Tuple, Union import click imp...
3bc39a4c6fb16883965921f92cb7b782caf3b012b0745dcfe7a4a29eec9e1726
Python
62,894
1,300
import h5py import numpy as np import scipy import logging import biosppy from typing import List, Tuple, Dict from tensorflow.keras.utils import to_categorical from ml4h.tensormap.ukb.demographics import age_in_years_tensor from ml4h.normalizer import ZeroMeanStd1, Standardize, RandomStandardize from ml4h.metrics im...
487388e02218f34aca5aca61c98c8399f939e7542f60c4d92da789157878495c
Python
62,933
1,603
import sklearn.utils.sparsefuncs as sf from . import q, ut, pd, sp, np, warnings, sc from .utils import to_vo, to_vn, substr, df_to_dict, sparse_knn, prepend_var_prefix from .samalg import SAM from scipy.stats import rankdata import networkx as nx def _log_factorial(n): return np.log(np.arange(1,n+1)).sum() def _l...
99ac290d093c939bc5b68b0702fb840784cad575b58edadba96b87dfbf5ed5a5
Python
62,957
1,628
# -*- coding: utf-8 -*- # (C) Copyright 2020, 2021, 2022 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. # # Any modif...
bc720d8d1db2a42a7b60db71447b371967fccbff6383c3c70879988c1caf16d4
Python
63,042
1,196
from argparse import ArgumentParser import os import numpy as np import pandas as pd import sys from .get_cluster_helpers import Cluster_Tree, entropy_non_norm from ..bonsai.bonsai_helpers import mp_print from itertools import combinations import random from collections import defaultdict import csv import time from sc...
eb67c24b456c58d15e794aafb63257e5b13797beaf624b7e66498c7f52db4739
Python
63,067
1,582
"""Models, author: Ting-Ting Gao""" import numpy as np import torch from torch import nn from torch.functional import F from torch.optim import Adam from torch_geometric.nn import MetaLayer, MessagePassing from torch.nn import Sequential as Seq, Linear as Lin, ReLU, Softplus, Sigmoid, Softmax from torch.autograd im...
73ff69ad5e2119a0f5a9c7f98687009f3d320104f86ae08d460f46afd0052688
Python
63,131
1,660
# ruff: noqa: E501 from ray.dashboard.modules.metrics.dashboards.common import ( DashboardConfig, Panel, PanelTemplate, Row, Target, TargetTemplate, ) # When adding a new panels for an OpRuntimeMetric, follow this format: # Panel( # title=title, # description=metric.metadata.get("descr...
90f64b1edb2e56d1b3b77fbc012a765e94e7321e3128517d8991f81cc1e4cd3c
Python
63,391
1,677
import ntpath import os from pathlib import Path from typing import Optional from urllib.request import urlretrieve import requests from typing import Optional from tqdm import tqdm import pandas as pd import numpy as np from anndata import AnnData, read_h5ad, read_loom import warnings from .._registry import registe...
62c9579483a1b43fa7ae463aae0a8b16796300e1bded36e5f57ec4704dd72e9d
Python
63,524
1,342
# tensor_writer_ukbb.py # # UK Biobank-specific tensor writing, SQL querying, data munging goes here # # Imports import os import re import csv import glob import time import shutil import logging import datetime import operator import tempfile import traceback from functools import partial from itertools import produ...
0247cd3c0facbeb2c00979f17054cf4befbd7b4253f9c0106a2661605c74060f
Python
63,650
1,421
# legacy_models.py # This file defines model factories. # Model factories connect input TensorMaps to output TensorMaps with computational graphs. # Imports import os import logging import numpy as np from enum import Enum, auto from collections import defaultdict, Counter from typing import Dict, List, Tuple, Union, ...
b16fa650485791dbf34e5a4b5cbce147f73e2c91378e25006347afe80bc7219b
Python
63,872
1,886
from scipy.stats import binned_statistic import sklearn.utils.sparsefuncs as sf import typing from numba import njit, prange import os from os import path import gc from .samalg import SAM import time from sklearn.preprocessing import StandardScaler from . import q, ut, pd, sp, np, warnings, sc from .analysis import _...
300fe776d3027c827e225eae3e1bde6b72f4aff02ba7acc71da502317088b660
Python
64,058
1,184
import torch import torch.nn.functional as F import math class NoiseScheduleVP: def __init__( self, schedule='discrete', betas=None, alphas_cumprod=None, continuous_beta_0=0.1, continuous_beta_1=20., ): """Create a wrapper cla...
e215d86a08b0ab310231766d10ff9f7d852042f94f2e3eed34cadb61ecbba969
Python
64,167
1,805
import copy import itertools import logging import math import pickle import os import sys from pathlib import Path from pprint import pprint from typing import Dict, List, Optional, Tuple import click import numpy as np import pandas as pd import pyranges as pr import torch import torch.nn as nn import statsmodels.ap...
47b67e722ae2b7a8e8d8a478aeda32cdff3e315c7e69a281b06265e6726b77d9
Python
64,239
1,507
from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np import torch import torch.nn as nn from ...configuration_utils import ConfigMixin, register_to_config from ...models import ModelMixin from ...models.attention import Attention from ...models.attention_processor import AttentionProcessor, A...
0e241dd2300e9508e7cd6f3ca5ce295f4bdf5f30e69169b8ea53cdac4f6aaec5
Python
64,568
1,511
from typing import Optional import gc import sys import anndata import numpy as np import pandas as pd import scanpy as sc from matplotlib import cm import matplotlib.pyplot as plt import plotly from scipy import sparse from scipy.spatial import distance_matrix from scipy.stats import spearmanr, pearsonr from sklearn.p...
3e4841837e6e7794f411c52d25d4f2ba8a6a356fb0fc49a31e4ff79d797af5bd
Python
64,673
1,779
import contextlib import importlib import json import logging import multiprocessing import os import platform import re import signal import subprocess import sys import threading import time from collections import defaultdict from pathlib import Path from subprocess import list2cmdline from typing import ( TYPE_...
e9d6c2e60c62cd1f27ece87ab1bc6de75791819884e08a1b702e1753c4a47376
Python
64,754
1,529
import numpy import copy import random import json import os import datetime import h5py import glob import uuid import tifffile from functools import partial from scipy import optimize, interpolate from matplotlib import pyplot from collections import defaultdict from skimage import filters, transform, measure from...
2bba8c5f4726a90e21796de74f5649d1d72992338d97ae6445d70045c6b46614
Python
64,868
1,470
"""Classes and methods for array-based spatial transcriptomics analysis.""" import itertools from typing import Iterable, Iterator, Sequence, cast from multiprocessing import Process, Queue from multiprocessing.shared_memory import SharedMemory import threading from warnings import simplefilter import numpy as np imp...
b583d07b83c083ac404df06f783583a4965a52d161e210b739bf5107eeb05ab0
Python
64,894
1,681
# Copyright 2023 Google LLC # 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
201e562cbbb990997e29e966c5d9240d7cab2aee244992d50dbedb3e3e35f271
Python
65,126
1,548
import numpy as np import anndata as ad import pandas as pd from .._registry import register_function from .._optional import build_optional_dependency_error @register_function( aliases=[ 'grn', 'GRN', 'infer_grn', 'GRNBoost2 prior', 'GENIE3 prior', 'TF-target netw...
90b24899e0e47abb739b0c1720f9b75b43fd5699bf1695ad4ae2e03d5b9be2a6
Python
65,661
1,111
import inspect import itertools import warnings import multiprocessing import os from copy import deepcopy from queue import Queue from threading import Thread from time import sleep from typing import Tuple, Union, List, Optional import numpy as np import torch from acvl_utils.cropping_and_padding.padding import pad_...
5ca6efb210299fdd17933ab9418fff356483e1fb11e9df35f67295583356223a
Python
65,895
1,494
import tifffile as tiff import cv2 import numpy as np from skimage import io import math from sklearn.decomposition import NMF from sklearn.cluster import KMeans import math import torch import time import datetime import os import scipy.io as scio import multiprocessing as mp import random from DWonder.MN.ConnectedC...
2340dbbe226f710db0fcd70ddb815029997f4fbfb5931e93537fb4023b310129
Python
66,178
1,378
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # Copyright (c) 2022, NVIDIA CORPORATION. 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.a...
ab7187788f82cae246a40250d96abca89e269d064ecb95943ac6f6595b53fa67
Python
66,419
1,539
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 12 11:11:45 2018 @author: epnevmatikakis """ import logging import matplotlib.pyplot as plt import numpy as np import scipy.sparse from typing import List import time import os import caiman from .utilities import detrend_df_f from .spatial import...
24bc4c29cea85f8af23cacad868ffa9ce0535ede643cdbbac9dffbb83a8a3c22
Python
66,521
1,593
""" Geneformer classifier. **Input data:** | Cell state classifier: | Single-cell transcriptomes as Geneformer rank value encodings with cell state labels in Geneformer .dataset format (generated from single-cell RNAseq data by tokenizer.py) | Gene classifier: | Dictionary in format {Gene_label: list(genes)} for gen...
60808442698c46472963e000a17e0f9933e4808bb2ca7df24bc4b30602a3a9ee
Python
66,598
1,745
import logging import math import os from dataclasses import dataclass from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Literal, Optional, Tuple, Union, ) import numpy as np from packaging.version import parse as parse_version import ray fr...
7b207c96472e0bd384a02c302ba519d58858cd09e227a3fabda97f8f58c502f6
Python
66,759
1,715
import itertools import logging from collections import defaultdict from functools import lru_cache from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union import numpy as np import pyarrow from packaging.version import parse as parse_version from ray._common.utils import env_integer from ...
7b71f30501c7eca0e19462b07d171f7ac5e1f1c8454306501054029a67960a5c
Python
66,807
1,838
import gc import numpy as np from anndata import AnnData import anndata import scipy.sparse as sp import time from sklearn.preprocessing import Normalizer, StandardScaler import pickle import pandas as pd from . import utilities as ut import sklearn.manifold as man import sklearn.utils.sparsefuncs as sf from packaging ...
62be3690795ad71b04e3cd7b0d8aef9d0bacdbce546d14bc5848eb06d20791b3
Python
66,967
1,872
"""Functions that will be used as steps in a decision tree.""" import logging import numpy as np import pandas as pd from scipy.stats import scoreatpercentile from tedana.docs import fill_doc from tedana.metrics.dependence import generate_decision_table_score from tedana.selection.selection_utils import ( change_...
0a394db91eabcbd3ca108a49e43aee5ab0369894aaf268693d19cb2b3e770134
Python
66,972
1,839
""" Model factory for creating and managing different scLLM models. """ from typing import Dict, Any, Optional, Union, List from pathlib import Path import numpy as np from .._registry import register_function from .base import SCLLMBase class ModelFactory: """ Factory class for creating different single-c...
2989d71cb52fd8fc3b4556dd9d729f3b2b213618327d728cab6de1470596b46e
Python
67,038
1,468
""" CellPLM model implementation with simplified interface. """ import copy import json import os import time import warnings from pathlib import Path from typing import Dict, Any, Optional, Union, List, Tuple from tqdm import tqdm import numpy as np import pandas as pd import torch import torch.nn as nn from torch.u...