sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b8ba49cdfb5d4936578d26754e7f5d9efb3326b2c996b3fa375ac20aee6c80f7 | Python | 21,799 | 565 | # Document from the official NIR repository: https://github.com/neuromorphs/NIR/blob/main/paper/nir_to_lava.py#L67
# Modifications made by Alex G. Gener for dynamic neuron allocation. See line 408
"""
Sharp edges:
- in lava-dl, the current and voltage state is not automatically reset. must do this manually after every ... |
6e7be5a38a7a5f8c929bbe73e4ab2b22e375374504c154e58d819c7844a40e4a | Python | 21,804 | 647 | """
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 math
import os
import pickle
from collections import defaultdict
from typing import TYPE_CHECKIN... |
5ae82fdaa0361afb0f1646aba1f8abfeb89870c6747ccdd968d5f88eda3ab82c | Python | 21,822 | 620 | """
The parameters that the networks can be initialized with. Each parameter is a
type on its own, because different parameters are shared differently. These
types handle the initialization of indices to perform gather and scatter opera-
tions. Parameter types can be initialized from a range of initial distribution
typ... |
7d247495d216048ec9e8646861822f600b26d25f1e1193a7cf049a9a2948bcf0 | Python | 21,823 | 569 | # Copyright (C) 2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import json
import operator
from collections.abc import Iterable, Iterator
from functools import reduce
from textwrap import dedent
from typing import Any, TypeAlias
from django.db import models
from django.db.... |
2d0ebbd9e737f97ce906b81ec97102af5f3a7677e5e05fa3709f6bdb873c866b | Python | 21,847 | 544 | # coding=utf-8
# Copyright 2023 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
55a1cc85c87ae67df44469b1374763594197ded2b9bb43fc14fdb63963f39242 | Python | 21,847 | 641 | import time
import os
import json
import numpy as np
from tqdm import tqdm
import logging
import torch
import torch.nn as nn
import torch.optim as optim
from torch_geometric.data import DataLoader
from torch_geometric.nn import global_mean_pool
import torch_geometric.transforms as T
from config import args
from data... |
f655b258831bb30ffc125581cdd2aa40840863a6be0f8432ec8a43871de36a33 | Python | 21,848 | 504 | import argparse
import itertools
import pickle
from collections import namedtuple
from typing import Dict, List, Tuple, Callable
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_da... |
4001abd8e7c947fa67cb02f1e726418b890fb659ad8473e10f2211da3be7cb16 | Python | 21,870 | 682 | import numpy as np
import pandas as pd
import os
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_geometric.data import Data, DataLoader
from matplotlib import pyplot as plt
import matplotlib as mpl
mpl.use(... |
a77df029c1f1f52dfc96cae0ffeb8ee2821aa885f929ab36bb02811f045655d2 | Python | 21,884 | 596 | #!/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... |
b4113fd905185f350f925b60463fbf2b629c07286d824c92aa96779d219425c6 | Python | 21,885 | 464 | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import glob
import sys
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import pysam
import collections
import numpy as np
import os
import seaborn as sns
import pandas
import math
from scipy.stats import pearsonr
plt.style.... |
ebecb1d55097a371e768744c99157b3265bc7b1d6c05069dba031e0ebeffcb73 | Python | 21,894 | 597 | # -*- 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.
#... |
a9cbd28d56b95b4f3e9eb93728c4a8cdee33b48a51c143a19e7554753d1a202f | Python | 21,896 | 535 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 17 17:30:00 2020
@author: ju-bar
Polar image transformation
This code is part of the 'emilys' repository
https://github.com/ju-bar/emilys
published under the GNU General Publishing License, version 3
"""
#
import numba # include compilation support
import numpy as np # ... |
165ba1b1a864542924aa95c1cbbefc95ee0364b919e328b72308a1dfd1a540f2 | Python | 21,903 | 712 | import os
import sys
import pydot
import pytest
import ray
from ray.dag import InputNode, MultiOutputNode
from ray.tests.conftest import * # noqa
@pytest.fixture
def cleanup_files():
"""Clean up files generated during the test."""
def _cleanup_files(filename: str):
for ext in ["", ".png", ".pdf", ... |
3ce0f0962bba960a1205b1cd670e3f3074871d6c1fdb359106e547d145b004de | Python | 21,917 | 431 | import numpy as np
import warnings
from matplotlib import pyplot as plt
from skimage import draw
from skimage import transform as sktr
from scipy.ndimage.morphology import binary_fill_holes
from scipy.spatial.distance import cdist
from pysted import utils
def degrees_to_radians(angle_deg):
return angle_deg * np.p... |
97b6c6a56ecbfbc26400c3fd9f6f26df494e9a49ed73ccd8649b1e81b601d4c7 | Python | 21,931 | 530 | # 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, ... |
109ec05cbeaf553a4e4ff51e35732ca983a8a0f1ebb66f9cc3ebee111e99888b | Python | 21,935 | 549 | """Guide to PHARMACOLOGY data collector."""
import logging
from typing import Any, Dict, List, Optional
from src.api.gtopdb import GtoPdbClient
from src.models.genomic import Gene
from src.models.protein import Protein
from src.models.disease import Disease
from .base import BaseCollector
from config.config import se... |
3c8819858dcbf149bfc5d84406229d1c17836503125621bbc4638796b88606d4 | Python | 21,937 | 443 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
from scipy.integrate import odeint
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
UseDoubleWell=1... |
a63e54bd1662d67268dd545317970a28bf38d41602415708cc84cb0698bf2bba | Python | 21,940 | 545 | # 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, ... |
1e817b7bca187e885c4474fe444405d9f913ef328c57241b0eb95e7f5ce310cb | Python | 21,948 | 560 | import decimal
import json
import logging
import time
from itertools import chain
from typing import Any, Dict, Optional
import requests
from ray._private.label_utils import (
validate_node_label_syntax,
)
from ray.autoscaler._private.constants import (
DISABLE_LAUNCH_CONFIG_CHECK_KEY,
DISABLE_NODE_UPDATE... |
9cef8e05890a2b5aa4a1fb68423d60944c21ecb443a0863c4d3da41c3ac81156 | Python | 21,959 | 599 | ####################################################################################################
# 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... |
57ca49d6ce57310cddc608c97e529c741d52376c88fa83d976047a83f7f10235 | Python | 21,972 | 633 | # Copyright 2024 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, ... |
7ceaaeefaf2dabcae87cfc4d37665de0d16ad6d699c12b1364d2a516f1fe0b1d | Python | 21,972 | 469 | import logging
import os
import threading
import time
from collections import defaultdict
from typing import Callable, List, Optional
from urllib.parse import unquote
from opentelemetry import metrics
from opentelemetry.exporter.prometheus import PrometheusMetricReader
from opentelemetry.metrics import Observation
fro... |
c7fbbaea9670417f4b18aed5ecb5718db0845883d6f54aefbf74f9b16a667888 | Python | 21,975 | 678 | from typing import Sequence, Dict
from statistics import mean
import functools
from collections import deque
from six import iteritems
from allensdk.core.simple_tree import SimpleTree
import neuron_morphology.validation as validation
from neuron_morphology.validation.result import InvalidMorphology
from neuron_morpholo... |
50d09d69aa7ad7d0f3d89d7defa8c63c0320bfa08de131be3689485f40fbe869 | Python | 21,978 | 607 | # coding: utf-8
import os
import sys
from typing import Dict
import pytest # noqa
from google.protobuf.json_format import ParseDict
from ray.autoscaler.v2.schema import (
ClusterConstraintDemand,
ClusterStatus,
LaunchRequest,
NodeInfo,
NodeUsage,
PlacementGroupResourceDemand,
RayTaskActor... |
07f5e781beb9886be5e1b729e157f04c82338fb6c949990d1c17c1cc6b550eda | Python | 21,982 | 604 | import torch
import numpy as np
from scipy import sparse
from scipy.spatial import distance_matrix
from scipy.special import wrightomega
import matplotlib.pyplot as plt
try:
from tqdm import tqdm
HAS_TQDM = True
except ImportError:
HAS_TQDM = False
# Fallback progress bar class
class tqdm:
... |
62a65cfcea06da7aa1bb7bc76b87a526c680049eaacaddb2de69a8d1cd31407a | Python | 21,988 | 666 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
ded0349be8968356095b9a224651d3d7f9bbb6304140e9df64ee97ce574064af | Python | 22,012 | 578 |
import copy
import gc
from typing import Dict,Union
from enum import Enum, auto
from datetime import datetime
import numpy as np
import torch
from torch import cuda
from torch_geometric.data import DataLoader, Data
from e3nn.nn.models.v2106.gate_points_networks import SimpleNetwork
from aptnn.parameters import Mod... |
49207a2477aa8937f423099dcd9ed459332d20217ca9a2e7447e14175d8741fb | Python | 22,046 | 513 | #!/usr/bin/env python
import sys # just for sys.stdout.flush
import os
import psutil # used for getting process number only:
import tempfile
import string
import dill
import random
import numpy
from tqdm.auto import tqdm as tqdm
from tqdm import TqdmWarning
# noinspection PyUnresolvedReferences
import multiprocessin... |
50962e483c1b481942aceddcef2f549eda2af8f0d026ccf5e1f9a637e96c0d50 | Python | 22,072 | 481 | r"""Gating-ML 2.0 interchange.
Gating-ML is the ISAC Recommendation for exchanging a gating strategy between
tools. It is the only vendor-neutral way to hand a hierarchy to someone who does
not use omicverse, which makes it the difference between a reproducible analysis
and a screenshot.
WHY THIS IS WRITTEN HERE RATH... |
f821f115ce47696f69405f87d7b4521b24cfbd38fbc1ba7c0ce4202f7b571fd2 | Python | 22,072 | 532 | # Copyright (c) DP Technology.
# 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 absolute_import, division, print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from .transformers import Trans... |
bbca57af974d386c4d0f9482202406730a609a337fe340c132798baac0bd92d2 | Python | 22,079 | 612 | from typing import Iterable, List, Literal, Optional, Union
import numpy as np
import pandas as pd
from anndata import AnnData
from .._registry import register_function
try:
from ..external.pyensembl import EnsemblRelease
except Exception: # pragma: no cover
EnsemblRelease = None
def _infer_species_and_re... |
7a67e4c6779f059d022bfdd20e0b09a96522150395e13958411d7a4ca588b61b | Python | 22,098 | 570 | #!/usr/bin/env python3
"""
Demonstration script for OmicVerse DataCollect usage.
This script shows practical examples of how to use the DataCollect
external module within OmicVerse for real bioinformatics workflows.
Usage:
python demo_ov_datacollect_usage.py [--demo DEMO_NAME]
Available demos:
- basic: Basic... |
00f4aa57ef4c8570826d070737a750513493a9ea748c10a3d3a955c7869f94ad | Python | 22,107 | 670 | """
Integration tests for "real" data
"""
import glob
import json
import logging
import os
import os.path as op
import re
import shutil
import subprocess
import tarfile
from datetime import datetime
from gzip import GzipFile
from io import BytesIO
import pandas as pd
import pytest
import requests
from pkg_resources i... |
8e638be63e5fdaf441a78442ea31e85f97d8a34bca066cf56bb529ef875f6323 | Python | 22,111 | 625 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import Dataset, DataLoader
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import argparse
import pdb
import os
import sys
import... |
53b9246806ebbcce4d4de128b2bffa5b22bd0e936a845ec95c58ef573fc24df1 | Python | 22,114 | 398 | import matplotlib.pyplot as plt
import pickle
import numpy as np
import os
from util import *
from sklearn.metrics import accuracy_score, confusion_matrix, roc_auc_score, roc_curve, precision_recall_curve, PrecisionRecallDisplay
def plot_scatter_plot(label_d, score_d, label_a, score_a, filename):
junc_prob = label... |
f460b91f1e14c1496a0f2d8cb87631f91c135d602604582dead96982cc66eddf | Python | 22,117 | 521 | """Live web search-backed VectorStore.
This module provides a `WebRetrieverStore` that conforms to the
`VectorStore` protocol used by `ResearchAgent`. It performs a web
search and optional page fetching to return lightweight document
objects with `id`, `text`, and `metadata` fields.
Backends supported:
- "tavily": U... |
47107ceeb69ff15bafbc149a2c0c0113b26474bed3c2130829de41f74a2b4fbc | Python | 22,134 | 497 | import matplotlib.pyplot as plt
import pickle
import numpy as np
import os
from util import *
from sklearn.metrics import auc, accuracy_score, confusion_matrix, roc_auc_score, roc_curve, precision_recall_curve, PrecisionRecallDisplay
from sklearn import svm
def plot_pr_curve(true_y, y_prob, label, option):
"""
... |
d09d9c307680a3f3dc0d4503af1434be7dac458689aac337ebf1b53a4459028e | Python | 22,138 | 502 | # 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, ... |
33bd032dd27b380e81bf6c6913f6fbcfaffc3707e9a8311a89f0e999534251dc | Python | 22,145 | 543 |
import os
import anndata
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from typing import List, Dict, Tuple, Optional, Union
from .._registry import register_function
_CLINICAL_COLUMN_ALIASES = {
"case_submitter_id": (
"case_submitter_id",
"cases.submitter_id",
... |
013829b599c2438315be77fab109fb0efdd813ee0a13f191cde899092d72839f | Python | 22,156 | 341 | from neuron_morphology.constants import *
from neuron_morphology.validation import radius_validation as rv
from neuron_morphology.validation.result import InvalidMorphology
from tests.objects import test_node, test_tree
from tests.validation.validation_test_case import ValidationTestCase
import unittest
from mock impor... |
fa27738e8fa84f056b61bcea119e45ec583599d6de664d7a7b93e03b0608b5e4 | Python | 22,156 | 525 | import math
import numpy as np
import torch
import torch.nn.functional as F
from torch_scatter import scatter_add, scatter_mean
import utils
from equivariant_diffusion.en_diffusion import EnVariationalDiffusion
class ConditionalDDPM(EnVariationalDiffusion):
"""
Conditional Diffusion Module.
"""
def ... |
eef580505886656e7dd8e4fbc57e83f6c2b6aaaab03ddcef467adb2dd6f7db3e | Python | 22,177 | 635 | #!/usr/bin/env python3
"""
Download stock videos from Pexels and upload to S3 (async version).
Videos are normalized to consistent specs before upload for predictable performance.
Usage:
python scripts/download_stock_videos.py --api-key YOUR_KEY --bucket YOUR_BUCKET
"""
import argparse
import asyncio
import json... |
e8eb5a7405a20f0f0d545e1bcfc7d855601e1e82c19e8dea8bc63fbc4e8219d3 | Python | 22,193 | 572 | import pandas as pd
import pytest
from siapy.core.exceptions import InvalidInputError
from siapy.datasets.schemas import (
ClassificationTarget,
RegressionTarget,
TabularDatasetData,
)
from siapy.entities import Pixels, Signatures
from siapy.entities.signatures import Signals
def test_classification_targ... |
06110e1f90bb61d84dfcdc88f58e4540b6077dc7542780ff9871524eeb240aea | Python | 22,201 | 555 | # Copyright 2024 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, ... |
6d1b69e92c5f70d31fc279e0b0b9cec1cc13f618903c102b32e2ef28458e371c | Python | 22,213 | 505 | import asyncio
import json
import logging
import os
import signal
import subprocess
import sys
import traceback
from asyncio.tasks import FIRST_COMPLETED
from typing import Any, Dict, List, Optional
import ray
import ray._private.ray_constants as ray_constants
from ray._common.filters import CoreContextFilter
from ray... |
99ece56303639329487eae7c808bea2de64796b230902c6013c5859502b6a831 | Python | 22,215 | 414 | # 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... |
f39c96a4f00d67e3ae631a86f225e0f34f4b08d0f8c962600e0db23e835e1584 | Python | 22,216 | 633 | 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
from scipy.sparse impo... |
176c84f3ecb1799c215e5ca35827af85df547e6196a72edfc23adcd52af2d514 | Python | 22,230 | 568 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
from utils import parseparam
plt.rcParams['font.family'] = 'serif'
plt.rcParams['font.serif'] = ['Times New Roman'] + plt.rcParams['font.serif']
plt.rcParams.update({'font.size': 15})
def stat(arr):
return f"\tsize:{arr.shape} \tmin... |
a37d2f528de758ddda1ce32d5e597f28a25ab4763bc177064ad48b3e9c8f16eb | Python | 22,249 | 631 | # %%
from enum import Enum, auto
from pathlib import Path
from typing import Optional
import h5py
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from fastai.vision.learner import load_learner
from matplotlib.patches import Patch
from PIL import Image
from scipy import interpolate... |
c5551dd0109ee4af4611e4dabec45ff4a7856a5109250c4855e6e092fcd463a6 | Python | 22,261 | 563 | """
Self-contained HTML QC reports.
A report is a single HTML file with no external assets: figures are embedded
as inline SVG (with colours mapped to CSS variables, so they follow the light
or dark theme) or as base64 PNG. Typical use:
report = QCReport("Source/sink terminals", entities={"subject": "001"})
r... |
fe2c72967fae35526ecf09b1e5d387675092189fc2b23a015ae00f71ef6685cc | Python | 22,272 | 780 | """Logic for alerting the user on possibly problematic patterns in the data (e.g. high number of zeros , constant
values, high correlations)."""
from enum import Enum, auto, unique
from typing import Dict, List, Optional, Set
import numpy as np
import pandas as pd
from data_profiling.config import Settings
from data... |
2157c28492b10a744edda8b1c497fa555ebb462a0cb499caa0af974bd52b3413 | Python | 22,283 | 475 | import torch
import random
import yaml
import argparse
import pandas as pd
import os
from os import cpu_count
import cv2
import numpy as np
import math
from transforms.albu import IsotropicResize
from multiprocessing import Manager
from multiprocessing.pool import Pool
from progress.bar import Bar
from tqdm import tqdm... |
53debf77c667188c9e8ad425aa749c4477a49835e43b06712bb8472841babded | Python | 22,283 | 581 | from typing import Optional, List, Dict, Tuple, Union
import os
import logging
from tqdm import tqdm
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from numba import njit
import scipy.sparse as sp
from sklearn.metrics import accuracy_score
def flatten(arr: Union[pd.Series, sp.csr_matrix,... |
08e8fd2ecf7a7c9860aa8a9a3791526fef8d42e35bc4da4bcd102b40b5bc84a1 | Python | 22,287 | 631 | """
WorkflowEscalator - Intelligent workflow complexity analysis and escalation.
This module provides complexity analysis for prerequisite workflows and
intelligently escalates complex workflows to high-level functions instead
of suggesting many small steps.
Main Components:
WorkflowEscalator: Complexity analyzer... |
cf587e168a90de1b6f2d02fe3003ac1dc465c7628526f9bcedd0a5f7ae6f55f4 | Python | 22,298 | 878 | import numpy as np
from numba import jit, njit
from tqdm import tqdm
import pandas as pd
import multiprocessing
import itertools
from . import danb_model
from . import bernoulli_model
from . import normal_model
from . import none_model
from .local_stats import compute_local_cov_max
from .knn import compute_node_degree... |
836e31c005c3049aa62e91c7e46a2948bdbfc4343f480901914647f5ff1c4971 | Python | 22,303 | 502 | __author__ = "Simon Andermatt"
__copyright__ = "Copyright (C) 2017 Simon Andermatt"
import copy
import logging
import os
import pickle
import time
from abc import abstractmethod
import numpy as np
from mdgru.helper import argget, compile_arguments, generate_defaults_info
class SupervisedEvaluation(object):
_d... |
540f43e92f3117a3b1dfb5c314a5aba8f39ea5498f7feff6c8f78ae2e4c7950d | Python | 22,308 | 622 | # 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... |
d02fd3c5d99281aa708271023966fc3c7274672a8319155fa373856f54706c95 | Python | 22,314 | 682 | """
Claude-style tool catalog and loading helpers for OVAgent harness sessions.
"""
from __future__ import annotations
import re
from dataclasses import asdict, dataclass, field
from functools import lru_cache
from typing import Any, Iterable, Literal, Optional
ToolClassification = Literal["core", "deferred"]
def... |
caa613cd5b4fd83b26736fe4f7ceac8e037590fc010916575eed6fb6763b994a | Python | 22,317 | 484 | # -*- coding: utf-8 -*-
"""
A script for implementation of heterogeneous neighbor contrastive graph attention network for metabolite-protein interaction prediction in plant.
@author: xzhou
"""
import torch
from torch import nn
from torch.nn import functional as F
import numpy as np
from scipy import sparse
fr... |
f0718072979f35c06bb85f0440bb66877c2380b230565e49c69097ce1f04f15a | Python | 22,336 | 573 | import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from typing import Callable, Tuple, List
from functools import reduce
from torch import autocast
from torch.cuda.amp import GradScaler
from convex_optim_base.unconstrained_optim import FistaSolverParams
def _single_backtrack_search(e... |
781cb0b82ce1f99b3d340931fa273c89f6e36fe8478a13b02c1bb1f04304bce8 | Python | 22,340 | 562 | """
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 itertools import product
from typing import TYPE_CHECKING
import numpy... |
c9562dd020bdcc34e1adf8b512804c8beef67649b7edda80a89f33529f0b40b5 | Python | 22,341 | 579 | import os
from copy import deepcopy
from logging import Logger
from typing import Dict, Tuple, Sequence, List
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from torch.utils.data.sampler import WeightedRandomSampler
from ignite.utils import convert_tensor
from monai.data import Dat... |
00171c35fbf554c299dfaae1e661a89cd208c45338a569ec601039582f6ecdf2 | Python | 22,350 | 551 | """
Functions that include workflows to identify and label
TE-dependent and TE-independent components.
"""
import inspect
import logging
import os.path as op
from numpy import asarray
from tedana.io import load_json
from tedana.selection import selection_nodes
from tedana.selection.selection_utils import (
clean_... |
395d7552579f3676342e541771e775d223ad9d89da70dd9a26dbbf41bb989def | Python | 22,354 | 549 | from PIL import Image
import numpy as np
from ctypes import *
import ctypes
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import cv2
import time
import pdb
import socket
import pickle
import scipy
import scipy.ndimage
import PySpin
import matplotlib.pyplot as ... |
4254786d498422c4ad4229168f29c1061454e2d7099bd486b74e5ab074dc5b23 | Python | 22,367 | 624 | 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
from scipy.sparse impo... |
c51ea73542c3d72d1b1b42d615afaf3a25ff097bb5acc59ded708dec72809d9e | Python | 22,375 | 485 | # -*- coding: utf-8 -*-
import logging
import os
import pickle
import re
import tempfile
from functools import partial
from math import ceil
# Using multiprocessing using dill package for pickling to avoid strange bugs.
from multiprocessing import cpu_count
from operator import concat
from typing import Callable, Seq... |
374130d2f74bc5e1af4ebabbf4dbe001c330d98536a22a72e44514e23421f050 | Python | 22,379 | 459 | from setup import *
def get_last_day_difficulty(df):
"""
This function gets the last day of each difficulty for each LD Probe block. Since each block is 4 days by default,
this function will return every 2nd and 4th day. If there are multiple blocks being passed in, the function will
accurately... |
12d6fcfabffd7b4232ecac8bd70e4b7c52f8dac1037870c42b3d613618d80dfc | Python | 22,380 | 696 | #!/usr/bin/env python3
# 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 ... |
20937e76bdd3179d01b1570a03001ebeed5a1a3dffb6d060aeb52478adc80eda | Python | 22,380 | 624 | 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
from scipy.sparse impo... |
aea9836fd5f7f3e0bd51d443312dfd58113d54d8c0c217a559d556f8726af6df | Python | 22,386 | 607 | # Copyright 2021 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
7766775c5070168b528033d1f448823e683fef825cc691bfc16d3a8d375e21a5 | Python | 22,422 | 547 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy2 Experiment Builder (v1.82.02), Sat Jan 9 02:16:18 2016
If you publish work using this script please cite the relevant PsychoPy publications
Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neurosci... |
30e81dbda4ec6bb56120de1424ab268c5e94e48e19eb3f3796a3f1c99208e162 | Python | 22,438 | 418 | from argparse import ArgumentParser
import numpy as np
import time
from pathlib import Path
import os, sys, csv
import subprocess
import pandas as pd
# TODO: REMOVE THIS EVENTUALLY
# import tracemalloc
#
# tracemalloc.start()
from ..bonsai.bonsai_helpers import Run_Configs, remove_tree_folders, find_latest_tree_fold... |
a3e436ce7d2c1f474a69e91189dc7ee98e857e7ec9c32f2499cdd6c091d5628f | Python | 22,442 | 534 | import torch as th
import torch.nn as nn
from dgl.batch import unbatch
from dgl.transforms import shortest_dist
from torch_geometric.nn import EGConv
from torch_geometric.utils import to_undirected
from torch_sparse import SparseTensor
from param import *
from dgl import function as fn
from utils import *
imp... |
adec7333addfdcaeb1ac1af578c7251ffe035b4f2b690637367883a45d4e6ec9 | Python | 22,442 | 490 | #
# 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... |
83ebd6e7ec515a6baab539edb014b29a59ef4849f06ad1b014dd26a3810b4236 | Python | 22,444 | 535 | import torch as th
import torch.nn as nn
from dgl.batch import unbatch
from dgl.transforms import shortest_dist
from torch_geometric.nn import EGConv
from torch_geometric.utils import to_undirected
from torch_sparse import SparseTensor
from param import *
from dgl import function as fn
from utils import *
imp... |
d281d9d1ac61f6f07c763e4b1c838f4fdf91f2f3058e095104b4d508294bf951 | Python | 22,460 | 709 | """
Methods for feeding randomly sampled spectrogram data to the shotgun VAE.
Meant to be used with `ava.models.vae.VAE`.
TO DO
-----
- replace `affinewarp` with `ava.preprocessing.warping`
"""
__date__ = "August 2019 - November 2020"
from affinewarp import PiecewiseWarping
import h5py
import numpy as np
import os... |
366d24f673028b3a9a81f31cb62d1f63c89f8da49c1b621c9e808ca200c9c7a1 | Python | 22,462 | 535 | import torch as th
import torch.nn as nn
from dgl.batch import unbatch
from dgl.transforms import shortest_dist
from torch_geometric.nn import EGConv
from torch_geometric.utils import to_undirected
from torch_sparse import SparseTensor
from param import *
from dgl import function as fn
from utils import *
imp... |
9e4a3cb0af7eaa8cca72078b526fd7825dca4d2394bc9b62fb7ee0411a3297d2 | Python | 22,481 | 454 | # Copyright (c) DP Technology.
# 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 absolute_import, division, print_function
import os
import numpy as np
import torch
from torch.utils.data import DataLoader as TorchDataLoad... |
241ed2e886c3dc5adbe618a01cae5ac31f663ec8585b267521af320ceab7995a | Python | 22,501 | 510 | r"""Biosecurity screening for designed sequences.
Screening a construct before it is ordered or shared has moved from best
practice toward a hard requirement — the international frameworks (the
NTI/IBBIS *Common Mechanism*, SecureDNA) and a growing number of national rules
expect a provider of design services to have ... |
19951cc105357fa99f639aa7a4c14123f3aa579a650adc8f1a7dd16c7a62c298 | Python | 22,506 | 592 | """Tests for Ray utility functions.
This module contains pytest-based tests for utility functions in ray._common.utils.
Test utility classes (SignalActor, Semaphore) are in ray._common.test_utils to
ensure they're included in the Ray package distribution.
"""
import asyncio
import os
import sys
import tempfile
import... |
36aaee93dd6f03a7b5dca6b3841e35a29fd491b692c6b2be8914a486d4f71107 | Python | 22,507 | 628 | r"""Multi-factor designs for metabolomics — ASCA + linear mixed models.
Most metabolomics studies are not two-group comparisons. Typical designs:
- ``treatment × time`` — paired pre/post or dose-response
- ``patient × visit`` — repeated measures
- ``batch × treatment`` — nuisance + effect of interest
Two complementa... |
3aef60a97925ea4eb2e3faa2971fe70b0a05dafd68635540818b24d33faf9523 | Python | 22,514 | 726 | # Copyright 2024 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, ... |
eec04ccf6f88eeff7fb1c7d418dd7c7f770bf789cb80a65cae1867c36975f1bd | Python | 22,518 | 530 | import time
import uuid
from typing import Dict, List, Optional, Set
from ray._private.ray_constants import env_integer
from ray.core.generated.instance_manager_pb2 import Instance, InstanceUpdateEvent
# Upper bound on retained status-history entries per instance. The history is
# append-only and read only for the mo... |
0dd3e5bd3faeca102cea568e1e213e5f516bb23cc9efc2f5c463703262ca3d19 | Python | 22,526 | 572 | # 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... |
e3cfc468fa6b3484eb30664d556a434eb9ceacd1c0bcc1e4a2f61924b8f97bbe | Python | 22,541 | 618 | from typing import Union, Optional, List, Dict
import numpy as np
import pandas as pd
import pickle
import time
import importlib.util
import sys
from collections import OrderedDict
from sklearn.preprocessing import StandardScaler
import scanpy as sc
from anndata import AnnData
from . import config
from .validation i... |
86e9a30ee6a4f51e2a4b423107f781ffc038101b7fbf0e4fa0f8b0679647aaba | Python | 22,543 | 612 | # -*- coding: utf-8 -*-
import logging
import math
import traceback
from functools import partial, reduce
from itertools import chain, repeat
from typing import Optional, Sequence, Type
import numpy as np
import pandas as pd
#from ctxcore.genesig import Regulon
#from ctxcore.recovery import leading_edge4row, recover... |
919bed14081a47eb7aa44a4cdc664a49831379a04a40177714362ab850605fd8 | Python | 22,557 | 485 | # Copyright 2023 FLAIR Lab and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
65c06893f741939b2242a20536651ab86b8717d92555051fa7cebe334ecad5f4 | Python | 22,562 | 550 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy2 Experiment Builder (v1.82.02), Sat Jan 9 02:16:18 2016
If you publish work using this script please cite the relevant PsychoPy publications
Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neurosci... |
4a6ca3da4cfa3bf05364b7c88c0a2ab8e6de7cb00ad848a601e82030e51541d1 | Python | 22,565 | 656 | """
Differential expression analysis for monocle2_py.
Implements differentialGeneTest, BEAM, fitModel, genSmoothCurves.
Uses GLM with natural splines as a pure Python replacement for VGAM.
"""
import numpy as np
import pandas as pd
from scipy import sparse, stats
from scipy.interpolate import BSpline
import warnings
... |
917e370b21f0bf9b3f9fad5d1a9de3aefde9442b04ffb458c3ede240203f0ba9 | Python | 22,573 | 494 | """
For each train-test experiment, perform cross-validation to determine the best set of training parameters
@author: Haowen Zhou and Siyu (Steven) Lin, Oct 17, 2023
"""
# In[0] Dependencies and Library Configurations
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.op... |
9b9f3f15afc3da7c05177238433c47cf6103dcf442691acc7e69e09ab1d157c8 | Python | 22,579 | 624 | #!/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... |
0aa7e144de44b71a55f07962f3ea1f0e826b473318b447d7ab5576a2ee32ff19 | Python | 22,580 | 523 | import argparse
import pickle
from collections import namedtuple
from enum import Enum
from typing import Dict, List, Tuple, Callable, Union
import numpy as np
import torch
import torch.multiprocessing as mp
import tqdm
import visionloader as vl
from whitenoise import RandomNoiseFrameGenerator
import lib.data_utils.d... |
4b8818e3d45508ab903686c79967fde6e4a36296ae5fa1d435b55b4c550d951c | Python | 22,589 | 689 | import logging
from pathlib import Path
import numpy as np
import pytest
from stl.mesh import Mesh
from stl import stl
tolerance = 1e-5
@pytest.mark.parametrize('density', [None, 0.7, 2.3])
@pytest.mark.parametrize(
'offset', [(0, 0, 0), (1000, -2000, 3000), (1e6, 1e6, 1e6)]
)
def test_translated_cuboid_mass_p... |
8e0d55e8d6b42f526e8ac6826bd4939fd0c18009220f2ec0d1ee101c516ab36f | Python | 22,600 | 594 | """Tests for wandb integration.
Note: These tests use a set of mocked APIs:
- _MockWandbAPI: Mocks wandb API calls (ex: wandb.init).
- _MockWandbLoggingActor: The same as the regular _WandbLoggingActor,
except using the mocked wandb API
- WandbTestExperimentLogger: Thin subclass of `WandbLoggerCallback` to use for... |
37b00487b2804e42e4d996b976c715c16d4ccd8f4baf051e872dcb864095aa53 | Python | 22,601 | 606 | """
Sharp edges:
- in lava-dl, the current and voltage state is not automatically reset. must do this manually after every forward pass.
"""
import nir
import nirtorch
import numpy as np
from dataclasses import dataclass
from functools import partial
from enum import Enum
# from lava.proc.embedded_io.spike import PyTo... |
46e9bbc716829b52fd1006da30cad52f9c5a7bff10b338efd545b3ab3b54a838 | Python | 22,602 | 456 | from copy import deepcopy
from typing import Literal, Tuple, Union, List
import torch
from batchgenerators.utilities.file_and_folder_operations import isfile
from dynamic_network_architectures.architectures.abstract_arch import AbstractDynamicNetworkArchitectures
from torch._dynamo import OptimizedModule
from nnunetv2... |
f0299a3743a0d18e017a71553acd3c567921b5f172872417dac2fe8197d074e1 | Python | 22,608 | 439 | __author__ = "Simon Andermatt"
__copyright__ = "Copyright (C) 2017 Simon Andermatt"
import inspect
import itertools
import logging
import os
import re
import shutil
import signal
import sys
import time as time
import datetime
import csv
from threading import Thread
import numpy as np
from mdgru.helper import argget,... |
297fabab79db1d3bdd6cbb53f7fade70227c255b8ee6fa0596c8a19cf840852a | Python | 22,616 | 542 | from __future__ import annotations
import functools
import inspect
import warnings
from contextlib import contextmanager
from typing import TYPE_CHECKING
from datetime import datetime
import numpy as np
from sklearn.utils import check_array, check_random_state
from scanpy import settings
from ._compat import old_pos... |
b8528a739c7254736af1174eaa36a58cc6908b30c11117b36e703e3b55592544 | Python | 22,620 | 558 | import collections
import time
from contextlib import contextmanager, nullcontext
from typing import Any, Callable, Dict, Iterator, List, Optional
import ray
from ray._common.utils import env_integer
from ray.data._internal.block_batching.interfaces import (
Batch,
BlockPrefetcher,
FinalizedBatch,
Fina... |
f0602b74e26b5bb93645772951c06c52c9130fbbc779a7e08b6069ba56bfff41 | Python | 22,637 | 595 | #
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.