sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
eebf48519fe8fe76d844558f63fdbe55f0bbf8d8abd8599c710e540e5f686828
Python
20,034
490
import os import sys import base64 import struct from collections import defaultdict import argparse import h5py import xmltodict import numpy as np import pandas as pd from tensorflow.keras.models import load_model from ml4h.TensorMap import TensorMap, Interpretation from ml4h.defines import ECG_REST_AMP_LEADS from m...
6868ba1a13a0bb3c7b3d7c09993ae97b6d2461afb249a2213ccaec3d5227923f
Python
20,037
545
""" 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 copy import logging from abc import ABCMeta, abstractmethod from collections import defaultdict ...
f271c8e8266788921ac4a480bf35c10d50cdb8a526db4b6413afea68287c22ad
Python
20,060
567
# 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...
83bb6f0795ddd6147c9a1507bcc3059cbfff6aa4b75300094c562cffec3d1929
Python
20,078
623
""" Step-by-step processing functions for memory-efficient single-cell analysis. This allows users to run each step individually and save results between steps. """ import os import anndata import numpy as np import scanpy as sc from .._settings import add_reference, settings from ..pp import ( mde, neighbor...
f300c0ab27797671f4858c042116e6640e63a0e3812e87c1ae06d52c7786c363
Python
20,081
450
import argparse import pickle from collections import namedtuple from typing import List 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_utils.dynamic_data_util as dd...
ce435cb66dab7d60323ab604c5d768738e6dd54af120959e434ed48f94b578bc
Python
20,086
474
"""ToolRuntime — tool dispatch hub and runtime facade. Extracted from ``smart_agent.py`` to keep tool handling in one place. Concrete handler implementations live in dedicated handler modules: - ``tool_runtime_exec`` — execute_code / run_snippet / bash / agent / inspect / search / finish - ``tool_runtime_io`` ...
6196348ab272f2765c6d6db378b14df208c34165c705490de495b9fa26874132
Python
20,097
507
import pandas as pd import numpy as np # non-motor def UPDRS1(dataframe, seq_data, feature_map, visit): target_vars = ['updrs1', 'hallucination', 'Apathy', 'Pain', 'Fatigue'] updrs1_idxs = [feature_map[ft] for ft in ['NP1COG', 'NP1HALL', 'NP1DPRS', 'NP1ANXS', 'NP1APAT', 'NP1DDS', 'NP1SLPN', 'NP1SLPD', 'NP1PAIN...
b746b038fa3ae39572dc98726390b342e571d2944f344d649d3c732565da450b
Python
20,115
419
import torch import torch.nn as nn from torch.optim import Optimizer, AdamW from torch.optim.lr_scheduler import LambdaLR import numpy as np from tqdm import tqdm import os import platform from sklearn.model_selection import KFold from splam_utils import * from splam_dataset_Chromsome import * from SPLAM import * impor...
35b3f334f6547fd9183dd28e4ddfc239e773a471880c978a7bd79d8904b510fe
Python
20,129
604
"""Test utilities for Ray. This module contains test utility classes that are distributed with the Ray package and can be used by external libraries and tests. These utilities must remain in _common/ (not in tests/) to be accessible in the Ray package distribution. """ import asyncio import inspect import logging imp...
325a4d6b2d836212dfb14347d33c3f6e9311aaffc2f3ad9111fa1db2843b7ebb
Python
20,134
588
# 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...
19e490ce4b49ca73918639940c64d17be76d5b117c6b178ecb4a8417649240bb
Python
20,147
546
import torch import torch.nn as nn from typing import List, Union, Sequence, Tuple, Dict from monai.networks.blocks import ResidualUnit, MaxAvgPool, UpSample, Convolution from monai.utils.enums import UpsampleMode from src.networks.vqvae.vqvae import VQVAEBase from src.layers.vector_quantization import VectorQuantiz...
11a4d93a46e8522eb002e1a1c81a059e5944c6d75167fce93c9bbf0ad794f2d7
Python
20,167
493
from typing import List, Optional, Union import matplotlib.pyplot as plt import numpy as np import pandas as pd import scanpy import torch from anndata import AnnData from pyro import clear_param_store from pyro.infer import Trace_ELBO, TraceEnum_ELBO from pyro.nn import PyroModule from scvi import REGISTRY_KEYS from ...
691c3d04c568d7ff679ad19f97f58ac9a942c73e587913c625bd33330e5b98d5
Python
20,171
383
"""PCA -> fixed+adaptive Gabor -> sign hashing -> sparse block histograms.""" import logging from pathlib import Path import numpy as np from scipy import sparse import torch from torch import nn from torch.nn import functional as F from .config import PalmConfig from .gabor import fixed_gabor_bank, search_orientations...
0698d59106476202f6f63ba616c32073b6daea8aa530425baa2f4d6a6fc27f81
Python
20,182
436
from sklearn.preprocessing import MinMaxScaler from torch.utils.data import DataLoader, Dataset, random_split import pandas as pd import numpy as np import os import torch import pickle def _get_ModNN_input(start_time, timestep_minutes, occupancy=None, hvac=None, temp_amb=None, solar=None, te...
581504c7525e9d447a7998a5a60fc3cfaa1d2e190564af8fd8cd2ef0a207d048
Python
20,199
593
# -*- coding: utf-8 -*- from vtkplotlib._get_vtk import vtk import numpy as np from pathlib import Path from vtkplotlib.plots.BasePlot import ConstructedPlot from vtkplotlib.plots.Lines import Lines try: from stl.mesh import Mesh as NumpyMesh NUMPY_STL_AVAILABLE = True except ImportError: NumpyMesh = Non...
ed07fac3dda3c5846f808c37cedb338114dce1a09e908b0973e1195c47653508
Python
20,199
568
import copy import json import warnings from importlib.metadata import version as package_version from pathlib import Path from typing import Any, Optional, Union from data_profiling.utils.backend import is_pyspark_installed if not is_pyspark_installed(): from typing import TypeVar sDataFrame = TypeVar("sDat...
37cdfeeadbb3aa526ede6f6a885b58adf052593f81ef1c2aeffaadd269a9eddc
Python
20,200
505
r"""Let the ``AnnData``-shaped plots in ``ov.pl`` accept a plain table. Most plotting functions in ``ov.pl`` only ever touch five things on an ``AnnData``: ``.obs``, ``.var_names``, the expression matrix (``.X`` / ``.layers`` / ``.raw``), ``.obsm``, and ``.uns`` for stored colours. Requiring the whole container for th...
35ee4101016ca5bb99472e307df33cdfc34f1e8f80d5c2fc6d38dc18b959a762
Python
20,201
511
"""10x Xenium In Situ reader for OmicVerse spatial I/O.""" from __future__ import annotations import json import warnings from pathlib import Path from typing import Any, Optional, Union import numpy as np import pandas as pd from anndata import AnnData from ..._registry import register_function from ..single impor...
6771f9a6f36926eb1876237074ca6974be9b77a62a659479509c64d7ff39ca43
Python
20,206
480
import argparse, os, sys from os import listdir from os.path import isfile, join from ipywidgets import widgets import pickle import math import collections import time import numpy as np import pandas as pd import scanpy as sc import warnings from .._registry import register_function warnings.filterwarnings('ignore'...
9c7a6b44a7806e4c62e90c5f071c6d6ee53c2ca5b2ac00e7337fc6d0ce3c3e7d
Python
20,207
437
import scanpy as sc import numpy as np import matplotlib.pyplot as plt from collections.abc import Collection from sklearn.feature_selection import mutual_info_classif import pandas as pd from scipy.sparse import hstack, issparse def moe_correct_ridge(Z_orig, Z_cos, Z_corr, R, W, K, Phi_Rk, Phi_moe, lamb): Z_corr ...
b175cfe2ca6ad1679487dc7f9d88c0e3f385c6f90b676018653f7566defb2581
Python
20,218
524
import logging import re from collections import defaultdict from typing import AsyncIterable, Awaitable, Callable, Dict, List, Optional, Tuple from ray import ActorID, NodeID, WorkerID from ray._common.pydantic_compat import BaseModel from ray.core.generated.gcs_pb2 import ActorTableData from ray.dashboard.modules.jo...
34ad0fd7f169168c7cc3aa6e98e7fcad8fe6a0a9284a403b99d0133c88456ced
Python
20,226
496
from collections import Counter from dataclasses import dataclass, field from typing import Any, Dict, Optional import numpy as np from .conv import Conv1d, Conv2d from .flatten import Flatten from .node import NIRNode from .pooling import AvgPool2d, SumPool2d from .typing import Edges, Nodes, Types from .utils impor...
044b8c0e289a4663f33db761d10bfb74db49563c9234e70eea70ba04ba458a96
Python
20,228
448
from typing import Any, Dict, List, Optional import numpy as np import pandas as pd from anndata import AnnData try: from typing import Literal except ImportError: from typing_extensions import Literal from .color import assign_color from .distance import spatial_distance from .logging import logger_manager ...
2f0e20ad83c44a335833b4bc0a295a6e0beecd4d2174cf62d5035772ed2cd0e0
Python
20,263
504
import asyncio import errno import ipaddress import logging import os import pathlib import posixpath import sys import time from math import floor from typing import List import multidict from packaging.version import Version import ray import ray.dashboard.optional_utils as dashboard_optional_utils import ray.dashb...
b54c73e4e79fa6c6831167f82f8067f2d5cb7fdb07b04d1e0ecc1b726d7f9c9f
Python
20,265
520
# # 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...
d58723a93088fd7bd5cd42c677399731c658066531de8f0b567434fda8788eed
Python
20,279
503
""" Core functional building blocks, composed in a Dask graph for distributed computation. """ import numpy as np import pandas as pd import logging import scipy from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor, ExtraTreesRegressor from dask import delayed from dask.dataframe import from_...
4e74903ba9952b7c9d621fbeef95a31b393feb1f06609a11fad6c20678e8a44e
Python
20,307
458
#################################################################################################### # 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...
6112da7cf78443f3bcb6f520e1b153721871a35fd6532a66e73cc8cae0008677
Python
20,327
532
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np eps = 1e-8 def tmscore_torch(coords1, true_coords, dcut=15.0): N, L, _ = coords1.shape coords2 = torch.tile(true_coords[None, :, :], (N, 1, 1)) center1 = torch.mean(coords1, dim=1, keepdim=True) center...
4804b190e42a01e23e1e902777e3f09f523239bc6ac943bd646125711d770664
Python
20,328
642
# This file is part of the INTREPPPID programme. # Copyright (c) 2023 Joseph Szymborski. # # This programme is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, version 3. # # This programme is distributed i...
8616ad9808abc8d84bd6a7e4cab80d38e90cc701d18122e96cd1fc9b5ad9e134
Python
20,329
511
#!/usr/bin/env python3.7 """Defines Waveform class. The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ import csv import ma...
e138cf0da021c4944baca8aeb05bd493c367a769ff0d629b85dd78cf8eddc659
Python
20,332
395
""" This scripts implements a hacky solution to measure a some metrics on the STR expansion loci. These metrics could be ideally extracted from the STR expansion caller, ExpansionHunter; but the tool is not currently maintained. Hence, this script leverages parsing SVG images that render a locus to measure the metrics....
cba6478b74108522f484f12bd571fe564fa0edbfa88785f992d26dc15752d519
Python
20,352
415
# --- START OF FILE paper_checker_mode.py --- import streamlit as st import ast import os from google import genai from google.genai import types from token_counter import count_tokens_decorator from logger_setup import logger from rag_system import RAGSystem, PackageConfig # NOTE: For production, set your GEMINI_API_...
2108bd3cb78f42d625c82765fd94a85e96922625c6d3a24f0e7908f12fb6cfe3
Python
20,353
473
import numpy as np import pandas as pd from utils import get_survey_items_order # ********************************* # helper functions # ********************************* def get_drop_columns(df, columns=None, use_default=True): """ defines columns to drop when converting from _clean to _event files each ev...
0bd225c5bf2481d90b704c5043528d2011adea12b360255ff72739ac49bcd48c
Python
20,370
525
# 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...
e622cf4cfb965295fa74be558f254290cd1b84113371114f970e1e92f434f96d
Python
20,372
429
import numpy import os import time import yaml import platform import copy import datetime import matplotlib import h5py import random import multiprocessing from copy import deepcopy from matplotlib import pyplot from shutil import copyfile from collections import defaultdict from functools import partial from pyst...
8d06752daa3e0e8568ddd5fd4d18b1f32f058440ef6f468f0cdb5549c24f8a99
Python
20,377
684
r""" Genomics operations Copy from scglue: https://github.com/gao-lab/GLUE/ """ import collections import os import re from ast import literal_eval from functools import reduce from itertools import chain, product from operator import add from typing import Any, Callable, List, Mapping, Optional, Union import network...
f41207f4b575db586f6dc5d175615c4fc4b73cfbfc9d0e5ce3a268c91027695c
Python
20,383
479
# ------------------------------------------------------------------------------------------------------------------------------------- # Following code curated for Bio-Diffusion (https://github.com/BioinfoMachineLearning/bio-diffusion): # --------------------------------------------------------------------------------...
fbdc6a5faab4960c70ca802e81f471fe61f2ba138fcb1856eae4af5e4a0c619a
Python
20,393
641
#!/usr/bin/env python """ Copyright (C) 2017 Allen Institute for Brain Science This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation on 29 June 2007. This program is distributed WITHOUT WARRANTY OF...
443e2a9245c39407db2ed3c8f68996c5f85d9ef52e95a5316ded99463496863f
Python
20,395
506
#################################################################################################### # 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...
229a8448430c852e151404ce96988a734bb9883ca37c0e367fe3ed302e5823d6
Python
20,404
439
import argparse import pickle from typing import Dict, List import numpy as np import torch import tqdm import visionloader as vl from whitenoise import RandomNoiseFrameGenerator import lib.data_utils.data_util as du import lib.data_utils.dynamic_data_util as ddu import lib.dataset_config_parser.dataset_config_parser...
e45cc3a2cf92330e0bd2c1b027ce4130c505a631e957e5545ba3c1a88457480e
Python
20,417
433
from __future__ import annotations import logging from concurrent.futures import Future, ThreadPoolExecutor, as_completed from dataclasses import dataclass from typing import TYPE_CHECKING, AbstractSet, Iterable, Iterator, NamedTuple, Tuple import pyarrow as pa import pyarrow.dataset as pds import pyarrow.fs as pafs ...
c137faa04a18ec22f6479a9b2d7b648aecef029159c5942637a8ee64c68b9e27
Python
20,453
375
class Reservoir: def __init__(self,Utotal,hyperparameters): ''' Initialize the reservoir, input the training set, initialize some parameters, and input hyperparameters ''' # Input layer u=Utotal[0] self.NumBifurPara=np.shape(Utotal)[0] sel...
106f3fedc760168e62bc397f983828a73b798d87aa62fbf0134b7057c60f5f3b
Python
20,456
612
import torch import torch.nn as nn 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 scipy.io import mat73 import ma...
c0ef7dfa599ab4d6b81105b554cf52f9b6c8244134e3fdedeae833d35f2a7635
Python
20,461
591
import os import pytest import numpy as np import tensorflow as tf from itertools import cycle from collections import defaultdict from typing import List, Optional, Dict, Tuple, Iterator from ml4h.TensorMap import TensorMap from ml4h.models.model_factory import make_multimodal_multitask_model from ml4h.models.train i...
019febb73054791e1c05e1849959953168d3998cb1d4e4020e5476fabbd584a5
Python
20,474
516
# utility function for loading files etc import numpy as np import pandas as pd import os import matplotlib.pyplot as plt def load_tsv(path): """ Loads a tsv, as a numpy array with the headers removed. """ df = pd.read_csv(path, sep='\t', skiprows = 0) return df.values def get_session_number(unit...
8b0b4c0459c142fa0b6c4a28d5f21c8ccca520011d920e0c9f178fe88190056c
Python
20,483
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. Post-Relaxation Structure Filtering, Deduplication, and Ranking Module This module provides comprehensive functionality for processing ML-rela...
a9aea8af1a6cecd883f480d73437fa95066576479937af55e50e1ef21e9ee3db
Python
20,493
663
"""A collection of utilities used by snap polygons to manipulate shapely objects. """ from typing import ( Optional, Dict, Union, Sequence, Callable, Iterable, Iterator ) import collections import math from functools import partial import sys import itertools as it import shapely.ops from shapely.geometry.base imp...
b570755ac12905ba49659440a7030e135311411ecb1d13edf115806fc4c2e3b4
Python
20,496
495
from typing import List, Optional, Callable, Dict, Tuple, Union import numpy as np import torch import tqdm from lib.data_utils.dynamic_data_util import _JitterReconstructionBrownianMovieBlock from lib.data_utils import dynamic_data_util as ddu from lib.data_utils.matched_cells_struct import OrderedMatchedCellsStruct...
dfd1a1385ee16973e058be62b0f542cd52ccc639bff215cbe3acbc1f60a17984
Python
20,500
568
""" Classes for creating patient objects compatible with TWSTRS. """ import logging import networkx as nx import numpy as np import pandas as pd import scipy as sc import simdkalman from scipy import signal, ndimage from .structural_features import compute_distances from .utils import pre_high_pass_filter, pre_low_pas...
cb60df99594167f06fa33bd5f41db2f5669a362ae44934022482c32da2077523
Python
20,506
508
import os import math import numpy as np import scipy.sparse from enum import Enum import struct import spinnaker2 APP_BASE_PATH = os.path.abspath(os.path.join( os.path.dirname(os.path.realpath(__file__)), "../../../s2-sim2lab-app/chip/app-pe/s2app")) APP_BASE_PATH_FPGA = os.path.join( os.path.dirname(os....
916b2a81c5c3f165da72a28ad62ec76d974c9817d7c6fddb696c0517a03e82cc
Python
20,507
450
"""Build-time fetch and Sphinx wiring for external Anyscale example templates. Everything here exists because the docs build pulls example templates from ``templates.ci.ray.io`` at build time (via sphinx-collections) and then renders the fetched ``_collections/`` content. It is kept out of ``conf.py`` so that changes ...
a369492592c904c40ed340a08dea7bbb665ed7ddbeaeeb553a3ff48fc7933796
Python
20,525
352
import cloudpickle import queue import os import projectmetis.python.utils.proto_messages_factory as proto_factory from pebble import ProcessPool from projectmetis.python.logging.metis_logger import MetisLogger from projectmetis.python.models.model_dataset import ModelDataset, ModelDatasetClassification, ModelDatase...
5dc1342117d02aa367545c1e750812d1526458bafb8a6b77fbf44a81762aff4c
Python
20,531
694
# coding: utf-8 # # Table of Contents # # 1. [Import & Set Up](#import_everything) # 2. [Load in data](#load_files) # 3. [Center of Mass](#c_o_m) # 1. [distance apart](#distance_apart) # 2. [error by overlap](#error_by_overlap) # 4. [Face Associate Task](#face_task) # # Import Stuff # <a id='import_everythi...
dd7231d5e6ec2465bbf5e9991ded58566384cc635e3d6a85820aafe032cc1de7
Python
20,537
427
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 ...
87866843ca23701fbac3c7ccd16723b48679dcd86fbbbc2060cce90d84feb5c0
Python
20,544
708
import torch import numpy as np import torch.nn as nn import shutil, os from m2snn.spikes import * from m2snn.surrogate import spike_fn from PIL import Image import matplotlib.pyplot as plt from copy import deepcopy class SNN(nn.Sequential): def __init__(self, *modules): super(SNN, self).__init__(*module...
3136938cce31bd64359f332302852ec24169713c95dab30eb1fae769e483574f
Python
20,546
432
import networkx as nx import numpy as np import pandas as pd import scipy, random import scanpy as sc from tqdm import tqdm import matplotlib.pyplot as plt from sklearn.metrics import pairwise_distances_chunked, pairwise_distances from .visualize import link_plot def coords2adjacentmat(coords,output_mode = 'adjacent',...
1e08a356ec7f411cf9ba641c1685cced06cb05aa4837b6604bce2e8312b62ad8
Python
20,553
668
import numpy as np import pandas as pd from sklearn.linear_model import Lasso from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_model import LinearRegression from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler import scipy.stats as stat import math import os im...
94e50526690ba45e3076ff048b1550642461fcd5b1b88250349dfa2529b543ff
Python
20,568
606
import tqdm import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation, writers from matplotlib.collections import LineCollection from sklearn.neighbors import NearestNeighbors from scipy.stats import norm as normal from .._registry import register_function class Streamlines(obj...
5756e713591d963b00939563ece122c82dbe3d95755e84ce8357c77bf6e57c24
Python
20,569
592
#################################################################################################### # 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...
ebf3cc6707577e4696801eddaaee7089aa37db71c748c352d66353d61f3b4081
Python
20,575
625
"""Evolution example: STO surface with NNFF""" import copy import pathlib from typing import Callable, NamedTuple, Tuple import numpy as np import numpy.typing as npt import torch from mace import data from mace.calculators import MACECalculator from mace.tools import torch_geometric, torch_tools, utils from surface_...
05fe559c2cc7aa0260a643cc79c345f4ba6679643ea62f10f690f811e47e6a87
Python
20,578
410
""" Cache final choice decoding models for all recording sites. Original analysis ran parallelized on David lab compute cluster. Reproduced here running all analyses in series. Could take a little while. """ # STEP 1: Import modules and set up queue job import os rdir = os.path.dirname(os.path.dirname(__file__)) imp...
7426cb938703bf11dddf871d030eca03c75b380874dda4c7bc7b272e642284b7
Python
20,582
541
""" LLMFormatter - Format validation results for LLM consumption. This module provides the LLMFormatter class which formats validation results into natural language and LLM-friendly formats with prompt templates. """ from typing import Dict, List, Optional, Any, Literal from dataclasses import dataclass from enum imp...
7604b6b5bfebe0aaf37a708d25e6f4b7072cb66730b8822a798fc418d1b2c8ea
Python
20,594
416
from attention import pHLA_attns_draw_save import numpy as np import pandas as pd import matplotlib.pyplot as plt from tqdm import tqdm, trange from copy import deepcopy import matplotlib as mpl import seaborn as sns import difflib from collections import OrderedDict def pHLA_attns_keyaatype_keyaacontrib(data, attns, ...
1c8e2e96f83e697a9bf697c09d73b6f1135168572d00c046e00d36f0794ae0bc
Python
20,609
509
# -*- coding: utf-8 -*- """Base model class""" import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.optimize import linear_sum_assignment from ...plt.plot_heatmap import clustermap # base model class - defining shared methods but not the model itself class BaseModel: ...
1233464321577d37348566e672d4e590e3c185bddf6379a0c345cd416ab4fd65
Python
20,613
568
# 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...
f5d8881770e286d6434c8030af93a2ba86c9567bfbfc48583df6eda633422691
Python
20,617
332
"""Windows/Linux command-line runner.""" import argparse import csv import json import logging from pathlib import Path import sys import time from dataclasses import replace import numpy as np from PIL import Image from scipy import sparse import torch from .config import PalmConfig from .data import Record, balance, ...
b22c786d23e2b4435524c9e97d0e2418e7dceb91c4bcba6ef9a244720afefa73
Python
20,633
558
from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Any, Iterable, Optional import pandas as pd from pydantic import BaseModel, ConfigDict from siapy.core.exceptions import InvalidInputError from siapy.entities import Signatures from .helpers import generate_classification_target...
4d9c5fa09d28009a7ce1a822be0bd1c00d1a3c38008609a3421f7021ca03b5c5
Python
20,638
520
import os, easydict, time import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt # moviepy is only needed for the region-video helpers, and its import path changed between # 1.x ('moviepy.editor') and 2.x ('moviepy'). Import it defensively so that simply importing # motionmapperpy never fails just be...
8b3cc621e13e8801cfe9ac9415644f1626ed520cf9d0b868c060110b9e8169d8
Python
20,649
391
""" The files "data_preparation.py" and "thresholding.py" need to be executed before this script! This script will create a mask for the image, in which both markers (ch2 and ch3, i.e. CHCHD2 and TOM20) are present. This will be used as the intersection mask for further analyzations. The mean intensity per cell line an...
a6d94229bada68c5a333060e30cdee91c5825f1b6d5fa2964f9ab086caeef6df
Python
20,659
488
r"""Group comparisons and the brackets that report them. ``ov.pl.add_palue`` can draw a significance bracket, but the caller has to supply the coordinates *and* run the test. That is where hand-annotated figures go wrong: the bracket ends up over the wrong pair, or the P value is uncorrected, or the test does not matc...
061b32e8eb7d0355f2bd4dfd492dc404b5dc603cccac5b8aa79659e5fe697427
Python
20,679
593
""" 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 itertools import json import logging import os import re import socket import subprocess import ...
fe28cc7f69f1268cf569b34e7a5ca69cade0dda4ae8b812c974743b2f6ab23b5
Python
20,690
605
import h5py import nibabel import numpy as np from tensorflow.keras.utils import to_categorical from ml4h.normalizer import ZeroMeanStd1 from ml4h.metrics import weighted_crossentropy from ml4h.TensorMap import TensorMap, Interpretation from ml4h.tensormap.general import get_tensor_at_first_date, normalized_first_date...
a930cfbd232688c45f9bcc858f87da65407bc0c33634b14af319a80a4fceacee
Python
20,698
549
# Copyright (c) 2021 Qualcomm Technologies, Inc. # All Rights Reserved. # pylint: skip-file # type: ignore import copy from collections import namedtuple from enum import Enum import numpy as np import torch from scipy.optimize import minimize_scalar from torch import nn from torch.nn import functional as F from ai...
a607d8383170d63e5d189ba507cca12eb201918d58d2db37644dee16e71cfae7
Python
20,714
547
# coding: utf-8 """ Test recovery behavior for the ALLOCATION_TIMEOUT scenario. Verifies that when an instance reaches ALLOCATION_TIMEOUT, the autoscaler can: 1. Terminate the timed-out old instance. 2. Launch a replacement instance. 3. Avoid a QUEUED->REQUESTED->QUEUED loop. Test design principles: - Pure Python, mo...
33a729953cc231e4c2647d078b43d1f2084671174a5e5612bc3f0a27169b5b49
Python
20,722
417
import argparse import collections import json import logging import os import pathlib import re import numpy as np import pandas as pd from combine_json_to_tsv import get_sample_id_column_index logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s: %(message)s") ALREADY_WARNED_ABOUT = set() # u...
5453660057d716d0226ff991369d04ae66e8c0c20483090a621f0779a4ba90f7
Python
20,735
497
# -------------------------------------------------------- # Swin Transformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze Liu # -------------------------------------------------------- import torch import torch.nn as nn import torch.nn.functional a...
c4f3bd1eca8fc28c193434d8c515a24919d8b43ff10ee3a3364b149ee1d999d8
Python
20,738
464
import xml.etree.ElementTree as ET import json import csv import copy import logging from difflib import SequenceMatcher from agent.data.entities.config import ROOT_LOGGER_ID from agent.data.sql.sql_mgmt import select_fields_where, update_text_field, update_non_text_field from agent.data.entities.config import METAMA...
7df58a8935926a4824d1cf841b03f344fcd2d4ad02b5a49f3a2f599037e79f43
Python
20,761
471
#################################################################################################### # 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...
221ecb283c85479c257b2eb3c847ffe0d08c36d05cae692fa947972269f78974
Python
20,762
467
# 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...
0388d8865ae28833bbed10a3fccf7cf9cfdc59dbe7aa9442253ecc1d97a8a4de
Python
20,763
517
# Copyright 2025 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, ...
a6992e413a3fdc58425e0e222bff1a0a821c98eb5329c40e6b651806ed4fd5a0
Python
20,775
517
import math import sys import pandas as pd import numpy as np from scipy.stats import fisher_exact import matplotlib.pyplot as plt import pickle import seaborn as sns import networkx as nx from matplotlib import cm from matplotlib.colors import ListedColormap from matplotlib.lines import Line2D # bcolors HEADER = "\...
c2e99a81383980137ff38f8a45c8eee283118313547e829d08beac64ba71a91d
Python
20,795
561
import tempfile import os from os.path import * import shutil from glob import glob import fnmatch import re import json from StringIO import StringIO import tempfile import mock import unittest from nose.plugins.attrib import attr from .. import ion_sync FILE = mock.Mock() seqrec = '@read\nATGC\n+\n!!!!\n' class B...
6e3116f64ec52547d6fea500ccc2616e8f62389b2cfdb5ee1ed390a3de75a9c8
Python
20,811
692
# 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...
4ad716bc62ad2f0c6f2a4accd49e974ab20193f849771ea355f0178038b99b47
Python
20,812
425
import os rdir = os.path.dirname(__file__) import sys sys.path.append(rdir) from nems.tools import recording from settings import RESULTS_DIR import preprocessing as preproc import tin_helpers as thelp import numpy as np import pandas as pd import pickle import logging log = logging.getLogger(__name__) db = pd.rea...
fb0eff0659a6c3c6bd2af78acca0c087f763e9bf39c5ce2377520c175ef2f044
Python
20,814
522
""" DDRTree: Discriminative Dimensionality Reduction via Learning a Tree. Pure Python/NumPy/SciPy implementation of the DDRTree algorithm, faithfully ported from the R/C++ DDRTree package. """ import numpy as np from scipy import sparse as _sparse from scipy.sparse import csr_matrix from scipy.sparse.linalg import ei...
f53a71ec6128fb4adb5800ec765da6eb01da0f84cf7c59697b09d0eedf22ba61
Python
20,815
494
"""Defines Model class. The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ import os from copy import deepcopy import numpy ...
c5b7215e1099226ce31814e74bd0a82e442539d0bf1a0c95dd01ba726085a86d
Python
20,831
482
import numpy as np import networkx as nx import os.path import matplotlib.pyplot as plt from scipy import signal import time import math import gc gc.collect() import warnings from filterpy.kalman import KalmanFilter warnings.filterwarnings('ignore') import os os.system('cls' if os.name == 'nt' else 'clear...
6e0d984d5617c734f84286e012012101e12c7c1fe06d0c997472f3aa1432e2dc
Python
20,843
523
import copy import json import logging import os import subprocess import tempfile import time from typing import Dict, Optional import yaml import ray import ray._private.services from ray._private import ray_constants from ray._private.authentication.authentication_token_setup import ( AUTH_MODE_ENV_VAR, en...
fb1898e20fda3a5991c2e3a94af331f6d63b436b775278c396577573fe9a93aa
Python
20,888
456
from dataclasses import dataclass, field import os import json import mlflow from torch import nn from torch import tensor from torch.nn import CrossEntropyLoss, MSELoss from torch.nn.parallel import DataParallel from torch.utils.data.sampler import RandomSampler, Sampler from torch.utils.data.dataset import Dataset, I...
fc1ad1d247808355d9c7fd5bfcd7fb18c988bc5ea615bb2f4a133f0323f06bfb
Python
20,899
646
import copy import numpy as np import pandas as pd from scipy.sparse import csr_matrix, save_npz from tqdm import tqdm from . import build_graph class SEACellsCPUDense: """Fast kernel archetypal analysis. Finds archetypes and weights given annotated data matrix. Modifies annotated data matrix in place...
08a4426f301b6e41182312a61096f4540b80f60cd564dc66c7ad40e88f93836d
Python
20,906
572
""" End-to-End Verifier - Phase 5 Tests the complete workflow: notebook → task extraction → LLM selection → verification. Generates comprehensive reports on skill selection accuracy. """ import asyncio from pathlib import Path from typing import List, Dict, Optional, Tuple, Any from dataclasses import dataclass, fiel...
b1cc393669f59eff54ea2e8bb64e3f5b3be23ea5284d863c71710a9ab4936c33
Python
20,917
533
import logging import time import math import numpy as np import torch import torch.nn as nn from pyexpat.model import XML_CQUANT_OPT from ocpmodels.common.registry import registry from ocpmodels.common.utils import conditional_grad from ocpmodels.models.base import BaseModel from ocpmodels.models.scn.sampling import ...
54882dc922903a37800500d89c2bfe59e85508f5ab3f890522b7fadb24ca0be4
Python
20,933
554
"""Quality control for single-extracellular-vesicle (single-EV) proteomics. These functions operate on the shared ``ov.single.ev`` AnnData schema (see :mod:`omicverse.single.ev.io`): an EV x protein matrix with the raw values in ``layers['counts']`` and the value type recorded in ``uns['ev']``. Single-EV QC differs f...
d6f2245b5bc9c6aeb04d538525fa5b937308fe5f68e320e1b3254e3c484e9fa1
Python
20,933
421
import torch,random from tqdm import tqdm import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy.sparse import csr_matrix from sklearn.metrics import pairwise_distances,pairwise_distances_chunked,confusion_matrix import scanpy as sc from scipy.sparse import csr_matrix as...
de712941b006d3f3fb5a3354ba3e3e6df82edcd6f967f3e7b178b4790388bad7
Python
20,938
611
from typing import Optional, IO, Union from pathlib import Path import vamb.vambtools as _vambtools from torch.utils.data.dataset import TensorDataset as _TensorDataset from torch.utils.data import DataLoader as _DataLoader from torch.nn.functional import softmax as _softmax from torch.optim import Adam as _Adam from t...
199ce281494f1f73d9c8a479bcd814db637eca96723fd81974671df75a84b2df
Python
20,949
571
import cv2 import numpy as np import pyqtgraph as pg import scipy from pyqtgraph import FileDialog from pyqtgraph.Qt import QtGui from pyqtgraph.parametertree import Parameter, ParameterTree import caiman as cm from caiman.source_extraction.cnmf.cnmf import load_CNMF from caiman.source_extraction.cnmf.params import CN...
14aebe1572878d3267250ffb488d77faf14f653b67c8bc7315c481904481331c
Python
20,976
634
""" 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 dataclasses import replace from enum import Enum from typing import TYPE_CHECKING import torch f...
b97ce1a879a29da5e9c2ba4a36517edcea346286bb50f791886bbea29f11c9d9
Python
20,996
488
import argparse import itertools import pickle from collections import namedtuple from typing import Dict, List, Tuple, Callable import h5py import numpy as np import torch import tqdm import visionloader as vl from whitenoise import RandomNoiseFrameGenerator import lib.data_utils.data_util as du import lib.data_util...
5968df9b195997ab715995a4d72ad8be670b05cbb7e1c315a3ce884c5a0d11a0
Python
21,002
581
import torch from torch_geometric.data import Data class BatchMasking(Data): """A plain old python object modeling a batch of graphs as one big (disconnected) graph. With :class:`torch_geometric.data.Data` being the base class, all its methods can also be used here. In addition, single graphs can be r...
131697f41214c67904c4ba64770e08b12a888742bb70ca0a6dcb94c504cb60dc
Python
21,006
510
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Fri Aug 25 14:49:36 2017 """ import cv2 try: cv2.setNumThreads(1) except: print('Open CV is naturally single threaded') try: if __IPYTHON__: print(1) # this is used for debugging purposes only. allows to reload classes ...