sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a3b8512b33a4952d482b17261dcd606936e52077a28168cad76f46acead4da5b | Python | 16,827 | 477 | import dataclasses
import importlib
import json
import logging
import os
import ssl
import tempfile
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import packaging.version
import yaml
import ray
from ray._private.authentication.http_token_authentication import (
format_authentication... |
810dd0f186e5bf6ed08c6e5f476bd93b9fc3c1b95eb9d1a02a6c79b17801362d | Python | 16,831 | 433 | """Differential abundance testing for microbiome AnnData.
Supported backends:
- 'wilcoxon' — Mann-Whitney U per feature (fast, non-parametric, no R)
- 'deseq2' — negative-binomial GLM via pydeseq2 (count-based, reuses
ov.bulk.pyDEG's backend)
- 'ancombc' — ANCOM-BC2 via ``skbio.stats.composit... |
d8049ae95d14d166b327293cd0da81ea62bd39300745cc4ad2a1ca79d47f594c | Python | 16,851 | 453 | # built-in dependencies
import os
import json
import hashlib
import struct
from urllib.parse import urlparse, unquote
from typing import Any, Dict, Optional, List, Union, cast
# 3rd party dependencies
import numpy as np
# project dependencies
from deepface.modules.database.types import Database
from deepface.modules.... |
4ddcb3039c29e714d53e89d6fb933e4cdbaff157a25af7c50036ec403cb56123 | Python | 16,859 | 439 | from __future__ import annotations
from typing import Callable, Optional, Tuple, Union, Sequence, BinaryIO
from numpy.typing import ArrayLike
from jaxtyping import PyTree
from pathlib import Path
from warnings import warn
from functools import partial
import numpy as np
import math
import jax
import jax.numpy as jnp
i... |
368d417edf515e73ef930b602d6968be17658b37a5f7d1a8d8643ddb6b72b65c | Python | 16,860 | 432 | ####################################################################################################
# Copyright (c) 2020, 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... |
4784e07cccc51b8d7ffeedce036c2797121ad9bc2acc7ca89200f4e932c2550d | Python | 16,871 | 420 | import numpy as np
import pandas as pd
from tqdm import tqdm
import scipy.sparse as sp
from .mnn_utils import create_dictionary_mnn
from .STALIGNER import STAligner
import torch
import torch.backends.cudnn as cudnn
cudnn.deterministic = True
cudnn.benchmark = True
import torch.nn.functional as F
from torch_geometric... |
551b45c683795b1bae3f8cbebfdf711cac0c9d717a809af66a5b9a80faaee37d | Python | 16,872 | 366 | import numpy as np
from spinnaker2.neuron_models.application import BaseApplication
from spinnaker2 import mapper
from spinnaker2.mapper import SynapseWordSpec, SynapseWordSize
from spinnaker2.configuration import PEConfig, MemoryRegion
from spinnaker2.neuron_models.common import (add_log_memory_region,
N_WORD... |
b193269fa77151e4ec0efb210d2b01fb679fd30ad6be4a5f08b9a056e82f52da | Python | 16,872 | 358 | import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
import torch
class Noise2NoiseUNet3D(nn.Module):
"""
Residual 3DUnet model implementation based on https://arxiv.org/pdf/1706.00120.pdf and https://www.nature.com/articles/s41592-021-01225-0.
Uses ExtResNetBlock instead of Doub... |
30293e285dd5ce57f975bdff3daca2275d6ce30765c5eb8e0db380e61fe5258d | Python | 16,874 | 355 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
aa6939a930257d738b6ab055add62276d36c155ac7e6e74541a05e3c49fca5c5 | Python | 16,874 | 355 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
0f8b81960098fc8d3479a7f98991b442b477f936230e7ae959455fd4792920b3 | Python | 16,878 | 355 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
3eb021dac50ffb2b6c8dffde7502294b80108f61febd1624856cfdf985e1a2f4 | Python | 16,878 | 497 | # coding: utf-8
import logging
import os
import sys
from typing import TYPE_CHECKING, Callable, List, Optional, Tuple
import pytest
import ray
import ray.experimental.collective as collective
from ray.dag import InputNode, MultiOutputNode
from ray.experimental.channel import CPUCommunicator
from ray.experimental.coll... |
7f6d69a024ea6e355aee0774a21cb4609c3eb4c7c56d16acac0b382bd65e2146 | Python | 16,878 | 355 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
83dfdc927fcd436f4b10673e795ffc73f573e7c2b58072d30d34bc1f4e3d8aea | Python | 16,878 | 355 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
b93462f16c11d12b58a51aeb3be6db7b1918968253327404c85608a48d093869 | Python | 16,878 | 355 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
4c7a5e4c98f126c6a8c4ae8c1ec76aa105a054672fc673b6cb622f83929c2509 | Python | 16,882 | 388 | """Concrete ``DataSourceV2`` for Parquet files.
Wires the V2 listing (`NonSamplingFileIndexer`, driven by the upstream
`ListFiles` op), scanning (`ParquetScanner`), and reading
(`ParquetFileReader`) components against a user-supplied path set.
Constructed from `read_api.read_parquet` when
`DataContext.use_datasource_v... |
111ea88bfcf20a539093e155d48f3a995c9299f12a25b995d82244659eef65be | Python | 16,883 | 481 | #### trust game task ####
# ebeard
# 5/30/18
# edited by Dominic Fareri, 6/2018
### specs ###
# add task description here
### timing ###
# add timing info here
#import modules
from psychopy import visual, core, event, gui, data, sound, logging
import os
import sys
import csv
import datetime
import random
#maind... |
06a4ad011e5ae7200e4d1cc5989d76d15cffd3823b657999434098453349e00b | Python | 16,886 | 446 | #!/usr/bin/env python2.7
# parse_property.py Reads property string and prses a requested value.
# Write request to stdout and verbose info to stderr. This allows easy use in dx app scripts.
# imports needed for Settings class:
import os, sys, string, argparse, json
import dxpy
def env_get_current... |
ed87c8d61317564f87b27edb00b86e9af64efb858e8e542e9d8269c1d881808d | Python | 16,889 | 402 | """
This script creates a single table of sample QC & batching metrics from EvidenceQC.
"""
import argparse
import pandas as pd
from collections import Counter
from functools import reduce
from pathlib import Path
import numpy as np
ID_COL = "sample_id"
EMPTY_OUTLIERS = "EMPTY_ROWS_DROP"
def read_ploidy(filename: s... |
1589ba0c1f45d6666b4a8619b3bc8a71877ab565f4c68e5ba1d39241b06461bf | Python | 16,895 | 526 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Build synthetic datasets representing a T2 mapping series (10 evenly spaced TEs) using
imagenet images as the true T2 and S0 maps
S(TE) = S0 * exp(-TE/T2)
@author: pbolan
"""
import numpy as np
import matplotlib.pyplot as plt
from os import path, getcwd, makedirs... |
73a3f17cd9d21716d5469f763629b5ad034bdba66b5f084471a59393f3fb6d46 | Python | 16,899 | 451 | import argparse
import os.path as op
from os import getcwd
from pathlib import Path
from fsub_extractor.functions.extractor import extractor
# Add input arguments
def get_parser():
parser = argparse.ArgumentParser(
description="Functionally segments a tract file based on intersections with prespecified RO... |
ce0f1d0ed02a91dc659f5bddc37e99ab2d0c9cbaff51bbae2b8fbc2b1be07068 | Python | 16,900 | 443 | import pandas as pd
import numpy as np
import scanpy as sc
from anndata import AnnData
from typing import Optional, List, Tuple, Dict, Union
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import silhouette_score, adjusted_rand_score
from sklearn.cluster import KMeans
import warnings
def op... |
fecd8cf3737e0551243c96edc02e4f9ca546a64437dbddd6bea98a8950ef0bf0 | Python | 16,902 | 453 | """
AgentBridge — wraps ov.Agent.stream_async() and harvests matplotlib figures.
"""
from __future__ import annotations
import asyncio
import base64
import hashlib
import time
from pathlib import Path
from dataclasses import dataclass, field
from typing import Any, Callable, Coroutine, List, Optional, Set
def _conte... |
3dcc3314101a6052a37030f4a743bfd57471564b32468c4629cb39a9a15157c9 | Python | 16,907 | 346 | #!/usr/bin/env python
"""CandyCrunch coding-standard checker (glycowork's .github/scripts/check_style.py, same rules).
Rules enforced (beyond the pycodestyle subset below):
GW1 no blank line inside a function body (a blank line bracketing a nested def/class is fine)
GW2 keyword arguments are written with spaces ... |
dbcf60a333208926ebbd29d6e751fee16402c1de51f06871e94c288ddccd49dc | Python | 16,912 | 321 | #!/usr/bin/env python
import sys
import os
import argparse
import json
from typing import List, Text, Mapping, Iterable, Optional, Dict, Union, Collection
from types import MappingProxyType
import numpy
import pandas
from sv_utils import genomics_io, interval_overlaps
Numeric = Union[int, float, numpy.integer, nump... |
a7fe1c02c247131b81aa975c8980e930b688df04da18d3f1e44ee877c6988fe2 | Python | 16,915 | 434 | ####################################################################################################
# Copyright (c) 2020, 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... |
a0aa3d8c8b7c714714cdae71ea94cb52f00a3316dfdeefbc505c12ec1b728e4c | Python | 16,925 | 321 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
# creating a dictionary of required ITEM_ID's, to extract features from the database files.
lab_items = {'CHARTEVENTS': [6, 51, 184, 211, 442, 454, 455, 490, 618, 646, 72... |
9f53d50cd29b7f958981f76ebe26f9c9bbc315c9320b9b48c5776c6ec69cf4a3 | Python | 16,927 | 408 | import pandas as pd
import numpy as np
import scipy.sparse as sp
from scipy.ndimage import gaussian_filter
import scanpy as sc
from tqdm import trange, tqdm
import multiprocessing as mp
from .utils import pre_process, make_image, gene_img_flatten, minmax_normalize, gau_filter_for_single_gene
def prepare_for_PI(ada... |
601c96d625da74004cf9708f089b15c438585dae879969cbe9329ed64f7533e8 | Python | 16,928 | 325 | # ruff: noqa: E501
"""Ray Data LLM Dashboard panels for vLLM metrics visualization.
This dashboard provides visibility into vLLM engine metrics when using Ray Data LLM,
including latency metrics (TTFT, TPOT, E2E), throughput, cache utilization,
prefix cache hit rate, and scheduler state.
"""
from ray.dashboard.module... |
9a50429ad872cc0ba782c45ce0cbe347460be454155ac4bc458e0223a5bc42fe | Python | 16,929 | 408 | # 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 a... |
7880398c7188df464c9d8ba757be84274b7321811612f1c527e1d052f35c4365 | Python | 16,940 | 508 | import os
import numpy as np
import torch
from matplotlib import pyplot as plt
import umap
from IPython import display
import time
import pandas as pd
from sklearn.metrics import silhouette_score
from scipy.spatial.distance import pdist
from scipy.spatial.distance import squareform
import seaborn as sns
from sklearn.de... |
4c8dd1fa2b622443777ca9de5ad0b3d2e3e12d98de1231b23079403ea27c0043 | Python | 16,943 | 480 | """
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
from typing import TYPE_CHECKING
import pytest
import torch
from ase.build import bulk, molecule
pyte... |
d98405c47ac7cbe1c8b61f6caaf26360c5399b64df7efcc781a475864b05baf1 | Python | 16,951 | 401 | import argparse
import os
import pickle
from typing import List, Callable
import numpy as np
import matplotlib.pyplot as plt
import torch
from torch.utils.tensorboard import SummaryWriter
import torch.nn as nn
import torch.optim as torch_optim
import torch.utils.data as torch_data
from lib.data_utils.matched_cells_s... |
3c50a25eb2d7887c3ed34adbb6ab5608ccded0c034b1dd8017ed0087ec426904 | Python | 16,954 | 479 | """Tests for the tedana.selection.selection_utils module."""
import os
import numpy as np
import pandas as pd
import pytest
from tedana.selection import selection_utils
from tedana.selection.component_selector import ComponentSelector
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
def sample_component_table... |
1ac0d3445ee53bf774fce03eaad599ac086d365cf83c8214531cc30a1bd38da6 | Python | 16,955 | 311 | import torch
import torch.nn as nn
import numpy as np
from tqdm import trange
class gru_prepare(nn.Module):
def __init__(self, input_size, hidden_size, output_size, num_layers=1):
super(gru_prepare, self).__init__()
self.input_size = input_size
self.output_size = output_size
... |
75b157f45696439e88da10add7974b8626e82c4f8569d788c1de7531f05059db | Python | 16,956 | 475 | """Credential resolution, model normalization, and API key management.
Extracted from ``OmicVerseAgent.__init__`` so that auth and backend
selection logic lives in one focused module. All functions are
side-effect-free except for ``temporary_api_keys`` which temporarily
mutates ``os.environ``.
The main entry point i... |
67477692dba6977d7d8c48caf8d0af1ee520f152d577147762b7652142e3c093 | Python | 16,958 | 428 | # MIT License
#
# Copyright (c) 2020 Mehran Maghoumi
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... |
f8749929f6cc5c9a4de4e6190e38144ed65c2d48b280ce47da9d15d752c5ea30 | Python | 16,959 | 476 | """Tests for classifier.py
Only contains tests that are specific for classifier subclasses.
"""
from unittest.mock import Mock
import numpy as np
import pytest
import torch
from scipy.special import expit
from sklearn.base import clone
from torch import nn
from skorch.tests.conftest import INFERENCE_METHODS
clas... |
4a3fb68b21e7c83dd8c5654f04db58185a1b32747eae6a32fcad0d16ba67ce7f | Python | 16,962 | 403 | ####################################################################################################
# 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... |
6b490e08fa5064025636ff0af3a9a20ffa981ecf02a33a460a4920ab5b7d106a | Python | 16,962 | 561 | """gnomAD API client."""
import logging
from typing import Any, Dict, List, Optional
import json
import time
import requests
from ..base import BaseAPIClient
from ...config import settings
logger = logging.getLogger(__name__)
class GnomADClient(BaseAPIClient):
"""Client for gnomAD GraphQL API.
gnomAD... |
2df383420a9f330af7e649cf476c67b4a7e647be6e3088201b577109eca0780c | Python | 16,969 | 488 | import inspect
import logging
import os
import random
import re
import tempfile
import unittest
import urllib.parse
from distutils.util import strtobool
from io import BytesIO, StringIO
from pathlib import Path
from typing import List, Optional, Union
import numpy as np
import PIL.Image
import PIL.ImageOps
import requ... |
3ef0cbcf72f38e078bb3e2d44b12a211b5955c4e0dd7d40ce0cd17561ab883ea | Python | 16,971 | 441 | from __future__ import annotations
import warnings
from functools import partial
from math import sqrt
from typing import TYPE_CHECKING
import numba as nb
import numpy as np
import pandas as pd
import scipy.sparse as sp_sparse
from anndata import AnnData
from numba import njit
from ..._settings import EMOJI, Colors... |
d89431936e6d203b90357e5037fa9c2be1e4bbc3f7e6c3933865e10cd37197e9 | Python | 16,973 | 454 | import torch
import numpy as np
from monai.data import MetaTensor
from typing import Union, Optional
from monai.utils import MetricReduction
from monai.metrics import CumulativeIterationMetric
from monai.metrics.utils import do_metric_reduction, ignore_background
from monai.metrics.regression import compute_mean_erro... |
cbcb7e263e3073b630d27f4b4f85a3c11ed6f5136b3a9a97ae1b84dbd32e1121 | Python | 16,974 | 462 | import os
import tempfile
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix, issparse
from ..._registry import register_function
class _PlainColors:
HEADER = ""
BOLD = ""
CYAN = ""
BLUE = ""
WARNING = ""
GREEN = ""
ENDC = ""
Colors = _PlainColors()
@register_... |
3dec561b69220f680db76a6b44833e4b0692ad3baa7fba37f3ebc03de6613c10 | Python | 16,980 | 510 | #!/usr/bin/env python3
"""
OmicVerse Analytics Sender
独立的analytics数据发送工具,不依赖HTML报告生成
模拟lzy_tt.html中成功的发送格式
"""
import requests
import platform
import hashlib
import os
from datetime import datetime
from urllib.parse import urlencode
import uuid
def get_geolocation():
"""获取完整的地理位置信息"""
try:
response =... |
2f8d247c6eaca33b557e145b76fc3537ace1f45128eff1ff1ce697b4f7cb01b2 | Python | 16,981 | 356 | #!/usr/bin/env python3
################################################################################
# -- Preprocessing and analysis of the simulation results
################################################################################
import numpy as np; import pylab as pl; import os, pickle
import matplotlib... |
99619c76707e9dfb4078a8211fbfccf08f8eeefc456ac8bec8e77c69f6a70766 | Python | 16,981 | 458 | import os
from collections import namedtuple
from collections.abc import Callable
from unittest import TestCase, mock
from unittest.mock import Mock
import numpy as np
from datumaro import AnnotationType, Bbox, LabelCategories
from datumaro.components import media
from datumaro.components.dataset import StreamDataset
... |
6474e4b0cfb4def885f90d3ad752d2c592b415c0f22702a20b68d9163fbfd00d | Python | 16,990 | 318 | 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... |
5eac7fe465cc4b71a57f5f86d1c0fe0c0bf59a2a06e9e5b3851f4d0c0ab88afa | Python | 16,991 | 410 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
def plot_convergence(array, n_trials_list, ax, k=2):
"""
Plots convergence of the correlation matrix
array: np.array, matrix of correlations, shape len(n_trials_list) x n_repetitions,
n... |
251ca129c1d43883d384f1efbe703e9a0e6e3c494d6e541ddb64884aae929de8 | Python | 17,013 | 386 | import scanpy as sc
import pandas as pd
import numpy as np
import anndata as ad
import scipy
from sklearn.preprocessing import LabelEncoder
import torch
from torch.utils.data import Dataset
import json
import os
import warnings
from typing import List
import torch.nn.functional as F
from scipy.sparse import csr_matrix
... |
8068134e8fd99ce1c650d89e643b30596afb71f11c63b841cdc8a8d817d03e0f | Python | 17,018 | 473 | import flammkuchen as fl
import numpy as np
from pathlib import Path
import json
from numba import jit
from luminance_analysis.loading import load_into_hdf5_python
from math import ceil
from scipy.ndimage.measurements import center_of_mass
from scipy.interpolate import interp1d
from luminance_analysis.roi_display impor... |
d589d05c492fcf0bab8e5c770c5331576211b1097f006b88951ca616b1ea01fe | Python | 17,035 | 450 | """
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 for graph generation methods on non-PBC (non-periodic boundary condition) systems.
Validates both pymatgen-based and internal graph gener... |
a566de38b18471c564a877b0c9c38a66ec9969d3ed807bc0e1fc0abf3a27e33e | Python | 17,040 | 578 | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# 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
#
# U... |
91866edfaaf2fd7fc13becc4356d3085f14ad41caf175e6cd7dbe925a67878b0 | Python | 17,044 | 588 | """
This script calculates the hexasymmetry when using trajectories from rat
trajectories (Sargolini et al., 2006) and human trajectories (Kunz et al. 2015,
2021). All three hypotheses (conjunctive grid by head-direction cell
hypothesis, repetition-suppression hypothesis, and structure-function mapping
hypothesis) are ... |
4b29253d5da8c7392baa833459fcf67ebbe50c38a10ffaf1706f665d713a88ee | Python | 17,069 | 449 | # 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... |
a65a75df7558a2b0b9143da8a6ca43051f5bd912d37bb7299033feb2046ce734 | Python | 17,075 | 423 | # ruff: noqa: E501
from ray.dashboard.modules.metrics.dashboards.common import (
DashboardConfig,
GridPos,
Panel,
Target,
)
SERVE_GRAFANA_PANELS = [
Panel(
id=5,
title="Cluster Utilization",
description="Aggregated utilization of all physical resources (CPU, GPU, memory, di... |
da40da44f2cd2c4ef0bb997c57d1a5e54cff4d1e2c7fddb4b725bb4a28b4b21f | Python | 17,083 | 440 | """
Dimension reduction for monocle2_py.
Implements reduceDimension() with DDRTree, ICA, and tSNE methods.
"""
import numpy as np
from patsy import PatsyError, dmatrix
from scipy import sparse
from scipy.sparse import csr_matrix
from scipy.spatial.distance import pdist, squareform
from scipy.sparse.csgraph import min... |
634961b65712da9b00c3a7af9af2c67489a19593e22429b90bc46f3d10b17b55 | Python | 17,086 | 440 | ####################################################################################################
# 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... |
aaa84eff6445a2f7763accf4f22e9aa43cebc791abe64eda7d234d616beeabf6 | Python | 17,090 | 416 | """Importable wrapper around SATURN's ``train-saturn.py`` CLI script.
This module exposes :func:`run_saturn`, an in-memory orchestration of the
SATURN training pipeline (macrogene pretraining + metric learning). It reuses
the algorithm functions defined in the vendored ``_train_saturn`` module
(``pretrain_saturn``, ``... |
4cfe21906713e8fea3dd3620c74acf417feebd46d3375aebf9da3706492e8471 | Python | 17,096 | 471 | # 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... |
a156763a3c3fc48d77f2c378ee0b40385121e2a77f1916d8bdc24fe5d1f5124c | Python | 17,097 | 481 | import h5py as h5
import os
import configparser
import numpy as np
from scipy import sparse
from lisa.core.utils import indices_list_to_sparse_array
from lisa.core import gene_selection
from lisa.core import genome_tools
from lisa._version import __file__ as version_file
from lisa._version import __version__
from lis... |
e90bd2104836b85a59cad41b496ed1561ef617b17a61426fc5a76115db8cd60d | Python | 17,099 | 445 | import numpy as np
import scipy
import time
from datetime import datetime, timedelta
import multiprocessing
from itertools import repeat
import tqdm
import pandas as pd
#from pybayesprism import references
from .references import RefPhi, RefTumor
from .joint_post import JointPost
from .theta_post import ThetaPost
#... |
c3baf48c44e71fef8508356b02602b371f4a72aae98e13358b0937ea881b78b2 | Python | 17,101 | 392 | import numpy as np
import pandas as pd
import anndata
import scanpy as sc
from sklearn.model_selection import train_test_split
def dynamical_analysis(sc_object,sc_object_aggr, n_states = None, n_states_seq = None,
weight_connectivities=0.2, n_components=20, thresh_ms_gene = 0,
... |
d03c2066500d6d6d0ba445f844ef230ef487e40d2dca68611187d4129cf5b4ce | Python | 17,104 | 385 | import argparse
import pickle
from typing import List, Tuple, Optional, Callable, Union
import numpy as np
import torch
import tqdm
import gaussian_denoiser.denoiser_wrappers as denoiser_wrappers
import lib.data_utils.data_util as du
import lib.data_utils.dynamic_data_util as ddu
import lib.dataset_config_parser.data... |
d86d161288983647ac47fc97fe9c739351a62aab989eaa7f5c56f08da0030f33 | Python | 17,104 | 445 | from __future__ import annotations
from typing import Callable, Optional, Tuple, Union, Sequence, BinaryIO
from numpy.typing import ArrayLike
from jaxtyping import PyTree
from pathlib import Path
from warnings import warn
from functools import partial
import numpy as np
import math
import jax
import jax.numpy as jnp
i... |
6c351be12ead174c6de8e21e3a8f393e65eaa0b81a295daeccd07511129e87bf | Python | 17,108 | 377 | """Classes that pass arguements to networks for training and easy saving and retrieval"""
from tap import Tap
from typing_extensions import Literal
from typing import List
import os.path as osp
class EncoderArgs(Tap):
"""Class used to store the arguments used for input to the message passing NN encoder."""
... |
a34b539232f03f494411bb458673a2de8a6626e2a9f0435a6c42a2f6ec7b638b | Python | 17,114 | 459 | """Eeg class to manipulate EEG data and associated metadata. The class interfaces with EDF files."""
import datetime
import enum
import os
import re
from typing import TypedDict
import numpy as np
import pandas as pd
import pyedflib
import resampy
class FileFormat(str, enum.Enum):
CSV = "csv"
CSV_GZIP = "cs... |
1e978f6b7627f333eb1e52167ae5a230feaf11f2ed9b702a758581b8e4bf4da8 | Python | 17,115 | 359 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
4af07b532178d4b61ea7b97c9a16b6a2e2440c8bf4b043eff30854ade1fe316b | Python | 17,115 | 359 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
5d449debc7a050977ed2e690dc410040d223b3bba40e36fa42ddd86471e21f88 | Python | 17,119 | 359 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
ba3586e3fa5b49987c837e1045b7c8b02c7768abca38e4b1a4bafff47348f371 | Python | 17,119 | 359 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
cd0dc1beee84447965ee0c22eb4dce2f642d248f7bfcb01dc55ad06febb19877 | Python | 17,119 | 359 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
ea7ccdd56a6966c897ed2c26cdf43019c0d628b90229d01b48f504b5435eb0f9 | Python | 17,119 | 359 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import PredefinedSplit, GridSearchCV, train_test_split
from sklearn.linear_model import LogisticRegression, Lasso
from imblear... |
2770cbb8066b5f97d8d385da96bde33942493bb0a698480e3e9f9c3d3fcf5a07 | Python | 17,123 | 472 | r"""Module providing encapsulation of STT for spatial transition tensor analysis."""
from typing import Any
import scanpy as sc
import numpy as np
import pandas as pd
from .._settings import add_reference
from .._registry import register_function
def _get_stt_modules():
from ..external.STT import pl, tl
retu... |
b9b7c64714c7b433a48637c72b3318f71092dc75d2e93439ff9c7f528bf1f189 | Python | 17,126 | 465 | from __future__ import print_function, unicode_literals, absolute_import, division
from six.moves import range, zip, map, reduce, filter
from tqdm import tqdm
from ..utils import _raise, consume, move_channel_for_backend, backend_channels_last, axes_check_and_normalize, axes_dict
import warnings
import numpy as np
... |
4f57d118caa05f500ac083fc56d04a08f0418b930d72b11b74f7dd7969939e24 | Python | 17,129 | 522 | from attr import dataclass
import ray
import torch
from data_assimilation.numpy.PDE_models import PipeflowEquations
import numpy as np
import matplotlib.pyplot as plt
import pdb
from scipy.stats import (
gaussian_kde,
wasserstein_distance
)
from matplotlib.animation import FuncAnimation
from data_assimilation.n... |
6ea48d45fd3f64ff0fdb607b21c46c98dbdaf78c64283bdbca486864fe1acdb5 | Python | 17,130 | 429 | #
# 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... |
50a87f947ff21c865a60438d5ac00e0a1ac3faf05d49ac01c5105e0c7952bfce | Python | 17,138 | 462 | import time
from typing import Dict, List, Tuple, Union
from warnings import warn
import numpy as np
import samna
import torch.nn as nn
from samna.specksim.nodes import SpecksimConvolutionalFilterNode as ConvFilter
from samna.specksim.nodes import SpecksimIAFFilterNode as IAFFilter
from samna.specksim.nodes import Spe... |
cd89f7472946213a12823670f35aa2a72be6d9b1ba6913bfbbdb25f03afea750 | Python | 17,150 | 564 | from collections import Counter
import numpy as np
from sklearn.preprocessing import normalize
from sklearn.metrics.pairwise import pairwise_distances
import sys
from .kmeanspp import kmeanspp
from .utils import log
def gs(X, N, **kwargs):
"""Geometric sketching.
Wrapper around `gs_gap()`, see parameter do... |
81e7bdd741c97b1d86ca0048c64a0e4f60e29b61d6583808e2ae6436368dc5cb | Python | 17,152 | 477 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 8 11:46:44 2022
@author: pbolan
"""
import numpy as np
from os import path, makedirs
import glob
import nibabel as nib
import torch
import time
import warnings
# Suppress the pkg_resources deprecation warning
warnings.filterwarnings("ignore", mess... |
ba67e3532fad493a535fa9a501c7a6c15cea9555d29bad138bd5811fac47071c | Python | 17,155 | 321 | import logging
import tensorflow as tf
from tensorflow.keras.layers import Conv2D, Input, Dense, MaxPool2D, Flatten, Dropout, BatchNormalization
from tensorflow.keras.models import Model
from utils import *
tf.keras.backend.set_floatx('float64')
class SpikingDense(tf.keras.layers.Layer):
def __init__(self, units,... |
e2340380739e0f8b9d98857a5151218ea2a210de92e9abdc9ddd4b0afb9a6902 | Python | 17,168 | 473 | # Copyright 2026 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, ... |
60e955933cde6b31656c4e9e3c25f678d6b70ad2d5ab22f712c5f845c6d7df11 | Python | 17,169 | 531 | """
Notebook Task Extractor - Phase 4
Extracts task descriptions from Jupyter notebooks (.ipynb files).
Maps tasks to skills based on code analysis and manual ground truth.
"""
import re
import json
from pathlib import Path
from typing import List, Dict, Optional, Tuple, Set
from dataclasses import dataclass
try:
... |
354da3a2bd161eb8023c534571369c835c15187cdc4aed5c8427f4507af2c751 | Python | 17,176 | 502 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Tests for linear layer."""
from unittest import SkipTest
from numpy.testing import assert_array_almost_equal
from torch import Tensor, manual_seed
from torc... |
103b7873da2609ab2f09cbe1498025c0d897bf9decd352514b97efc18ae2fcb4 | Python | 17,186 | 561 | import sys
import pytest
from ray._raylet import JobID, TaskID
from ray.core.generated import gcs_pb2, gcs_service_pb2
from ray.core.generated.common_pb2 import TaskAttempt, TaskStatus, TaskType
from ray.dashboard.modules.task_events import task_event_query as q
from ray.dashboard.modules.task_events.task_event_stora... |
22f843150b1b12c9b6c64d3c532329c3e4dedc0a95e625eb01000c12c36b88f4 | Python | 17,192 | 488 | # -*- 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.
#... |
f39331c31c3cdb52a42ef3628d515a7f1ed8d72a294a5ab5e908eb1142c2947a | Python | 17,193 | 431 | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# 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
#
# U... |
e438a1e72c0149b1620bc1df3d80d9ba63e369f2c71fcb29f07d2c61a01d5f61 | Python | 17,202 | 491 | """
Adapter for class-backed tools (Phase 2).
Dispatches to registered ``ClassWrapperSpec`` actions. Each class tool
exposes a fixed action set (create/run/results/destroy) — no generic
method dispatch is ever allowed.
"""
from __future__ import annotations
import importlib
import json
import logging
from typing im... |
d6cfce9e073070b56b343763013da46170a184527f6044f99eaef60db02779a9 | Python | 17,204 | 373 | import argparse
import datetime
import random
import numpy as np
import time
import torch
import torch.backends.cudnn as cudnn
import json
import clip
from pathlib import Path
from torch.utils.data import dataset
import torchvision.transforms as transforms
from timm.models import create_model
from timm.loss import Lab... |
837db0f8cb51bfb8be318123eb9ab123a23e694ff8743e570b44cab4182f3611 | Python | 17,207 | 436 | ####################################################################################################
# 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... |
0d054c0b8e6450d898c1fc08c44ab15ed4354fa5270c1e814c985b3211323365 | Python | 17,211 | 546 | from functools import partial
import torch, random, scipy, math
import torch.nn as nn
import torch.nn.functional as F
import pandas as pd
import numpy as np
from timm.models.vision_transformer import LayerScale
import torch.utils.checkpoint as checkpoint
from timm.models.layers import DropPath
_NUM_ATOM_TYPES = 9
_e... |
4716fadb829ac5454f3079d0c793a5ee55291f8113c008620262a05f68e6f60f | Python | 17,211 | 389 | r"""RNA design — inverse folding, siRNA and antisense-oligo design.
Where :mod:`_rna` *analyses* a given RNA, this module *designs* one:
* :func:`rna_inverse_design` — the inverse-folding problem: find a sequence
that folds into a **target** secondary structure (ViennaRNA ``inverse_fold``;
the Eterna/RNAinverse t... |
704638cfb1a5a4872d238dfe85bb54a93f464920fe15441c948586bbccdac2dc | Python | 17,215 | 472 | from collections import defaultdict
import nibabel as nib
import numpy as np
import pyvista as pv
from nibabel.gifti.gifti import intent_codes
def read_surface_from_gifti(surf_gii):
"""Load a surface mesh from a GIFTI file."""
surf = nib.load(surf_gii)
vertices = surf.agg_data("NIFTI_INTENT_POINTSET")
... |
17d7d051b84a6714c46e7e509c4270f8a2f8fc49e02bd6a9da40b568f5d3f8f3 | Python | 17,220 | 367 | import argparse
import itertools
import pickle
from collections import namedtuple
from typing import List, Callable, Sequence, Optional, Union
import numpy as np
import torch
import tqdm
import gaussian_denoiser.denoiser_wrappers as denoiser_wrappers
import lib.data_utils.data_util as du
import lib.data_utils.dynamic... |
9a4880fc6340a3740c7fbb015e3da3ec4b4c388cbedbd73e9ccc9e52349b1b9a | Python | 17,222 | 581 | """PLY (Polygon File Format) reader.
Supports ASCII, binary little-endian, and binary big-endian
PLY files. Binary formats raise ``ValueError`` until the
binary reader is implemented (Task 3).
"""
from __future__ import annotations
import struct
from typing import IO, Any
import numpy as np
# Mapping from PLY type... |
4b01f5dbe460570305fe9a164bea86f044b5609a6de5100b409f2570a2bf2aab | Python | 17,226 | 421 | import copy
import sys
#sys.path.append('/scratch/weilenmc/repos')
#sys.path.append('/usr/scratch/santis/weilenmc/repos')
import numpy as np
from typing import Dict, List, Union, Optional
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.models.torch.misc import SlimFC
from ray.rllib.models.torch.torch_mod... |
d5c1cba24f209a580d32c19522f8cb2649262307ecd8c538649f8fc091226321 | Python | 17,226 | 402 | # Ultralytics YOLO 🚀, GPL-3.0 license
"""
Image augmentation functions
"""
import math
import random
import cv2
import numpy as np
import torch
import torchvision.transforms as T
import torchvision.transforms.functional as TF
from ultralytics.yolo.utils import LOGGER, colorstr
from ultralytics.yolo.utils.checks imp... |
4c5e6457e0f27b8e782867575288f57277f340d75cbc06ca3fae44d60ad2f5aa | Python | 17,228 | 369 | ################################################################################
# -- Simulating Exc-Inh spiking networks in response to inhibitory perturbation
################################################################################
import numpy as np; import pylab as pl; import time, os, sys, pickle
from sci... |
70b6d926753b9a528a61ee98df7e53ae22b8f0b0f6a979d1eaef14708d256554 | Python | 17,239 | 419 | import logging
import warnings
from collections import defaultdict
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional
from ray._common.retry import call_with_retry
from ray._private.utils import INT32_MAX
from ray.data._internal.arrow_ops.transform_pyarrow import (... |
b20f71876bc14aaf54dc003beb93e41e1e99ee6c31ea4a2f8c022bd8e2ba2701 | Python | 17,243 | 455 | import importlib
import numpy as np
import torch
from skimage import measure
from skimage.metrics import adapted_rand_error, peak_signal_noise_ratio, mean_squared_error
from pytorch3dunet.unet3d.losses import compute_per_channel_dice
from pytorch3dunet.unet3d.seg_metrics import AveragePrecision, Accuracy
from pytorch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.