sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b3ad79635bc64b8ac79c54a11cc396a0b2b81d7613378bac5746010ccf4a421c | Python | 19,765 | 536 | import dataclasses
import unittest
from uuid import uuid4
import requests
import requests_mock
from codecarbon.core.api_client import ApiClient
from codecarbon.core.schemas import ExperimentCreate, OrganizationCreate, ProjectCreate
from codecarbon.output import EmissionsData
conf = {
"os": "macOS-10.15.7-x86_64-... |
2ae88dafc275bec431996d9aa83419ffa50d10bb4c2859cfa746bdd3530c14f6 | Python | 19,773 | 533 | #!/usr/bin/env python
# coding: utf8
import numpy as np
import threshold,glm
import sys
import pdb
__doc__ = """This function defines the actual history model and allows to fit this model to data.
Copyright (C) 2014 Ingo Fründ
This code reproduces the analyses in the paper
Fründ, Wichmann, Macke (2014): Quanti... |
778737759dc9ff8fcd04922097226b6e2798ffdb2ecc73c0eed0054b076a1279 | Python | 19,775 | 573 | #!/usr/bin/env python3
"""
DeepST Pipeline Runner
Author: ChangXu
Description: Main pipeline for Deep Spatial Transcriptomics analysis
"""
import os
import time
import psutil
import numpy as np
import pandas as pd
import scanpy as sc
import torch
from pathlib import Path
from sklearn.metrics import cali... |
b9bc606edac2bee01dd538f14e5992d2ae161354dba0c18755426c31dbe74049 | Python | 19,785 | 476 | import os
import time
from types import ModuleType
from typing import Callable, Union
import anndata
import numpy as np
import scipy.io as sio
import torch
import torch.optim as optim
from anndata import AnnData
from numpy.random import normal
from torch import tensor
from .nn_losses import weighted_mse
torch.manual... |
e9eb136434e66bd368410c9fd043b3bd4102e93395be0ec14e61f6ca5f348d89 | Python | 19,804 | 456 | import graph_nets as gn
import sonnet as snt
import tensorflow as tf
import logging
tf.get_logger().setLevel(logging.ERROR)
import numpy as np
from sklearn.model_selection import KFold, StratifiedKFold
import matplotlib.pyplot as plt
import sklearn
from collections import Counter
#changed get_input_outputs() function ... |
12a1fa64bf222ec44e13b4a5a1c135fcbbea729cc2b470a090b00ebc3145bfb4 | Python | 19,807 | 558 | """
Sensory modules translating environmental input into neural activation.
Provides the sensor base class and the modality-specific implementations for
olfaction, touch, wind and temperature. Sensors report a perceived change in
their stimulus rather than its absolute level, and feed that signal to the
locomotory mod... |
0859409e8076b08c4f2cf24eb3eac830009cb810a313f5333355553b5ede0be0 | Python | 19,810 | 552 | """Stage 3 safe-load and sparse callable reattachment tests."""
from __future__ import annotations
import importlib
import json
from collections.abc import Iterator
from contextlib import contextmanager
from dataclasses import replace
from pathlib import Path
from typing import Any, cast
import pytest
import torch
f... |
c73b24ceb471f9fc905c42b96ca0e9e33c2a6db69cce3041ea9457c7112e874f | Python | 19,821 | 651 | """Define results objects."""
from copy import deepcopy
from itertools import repeat
import numpy as np
from specparam.bands.bands import check_bands
from specparam.modes.modes import Modes
from specparam.results.params import ModelParameters
from specparam.results.components import ModelComponents
from specparam.me... |
dac66e5d32902a075950f9a9ee4e60b96f69191d8d9fef3c64c570e36a2e0d8e | Python | 19,824 | 510 | from __future__ import print_function
import warnings
from copy import deepcopy
import numpy as np
from scipy.optimize import curve_fit, minimize
from sklearn.decomposition import FactorAnalysis
"""
Zero-inflated factor analysis (ZIFA). Performs dimensionality reduction on zero-inflated data.
Created by Emma Pierson... |
8ac59ef90671339bb3aa1db52f15939343d1d5ecd112f3b6d8d63983fd3c29dd | Python | 19,828 | 379 | """CenterNet Estimator"""
# pylint: disable=unused-variable,missing-function-docstring,abstract-method,logging-format-interpolation,arguments-differ,logging-not-lazy
import os
import math
import time
import warnings
from collections import OrderedDict
from PIL import Image
import pandas as pd
import numpy as np
import... |
5ee8af598d2a3ae31b0365075b5957b85604b74aa9170dfdcb5e7c979aa198f5 | Python | 19,835 | 480 | import pandas as pd
import tempfile
import numpy as np
import subprocess
import gzip
import sys
import threading
import queue
from pandas_plink import read_plink
gt_to_dosage_dict = {'0/0': 0, '0/1': 1, '1/1': 2, './.': np.NaN,
'0|0': 0, '0|1': 1, '1|0': 1, '1|1': 2, '.|.': np.NaN}
def _check_d... |
f7c191f8981271d6ba43c727aab0d943e8c47c4957f6c67cd673eb58cd46fc31 | Python | 19,837 | 432 | # Import libraries
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import pearsonr
input_annotation_file = 'data/pop_norms.csv'
df = pd.read_csv(input_annotation_file, header=0)
## this is code to match the ids of the abcd dataset with the ids of the popul... |
e7b446654d0188fd14bc24699663cba23e615feff5f9348cafe8a15240d91087 | Python | 19,838 | 424 | from typing import (
Any,
cast,
)
from urllib.parse import urlparse
from galaxy.exceptions import (
AuthenticationRequired,
MessageException,
ObjectNotFound,
)
from galaxy.files.models import (
AnyRemoteEntry,
Entry,
EntryData,
FilesSourceRuntimeContext,
RemoteDirectory,
Rem... |
fb3b1c6451feb4582f48d3a529107681d7ab8797896a4a8f77fbc36b746b9df5 | Python | 19,849 | 605 | """Run simple cell optimization"""
"""
Copyright (c) 2022 EPFL-BBP, All rights reserved.
THIS SOFTWARE IS PROVIDED BY THE BLUE BRAIN PROJECT ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN... |
a7d9d285d0041b01e640ae369714d8caacc7c2e87dbfa092a49d3b27e312e440 | Python | 19,867 | 571 | from typing import List, Optional, Tuple, Union
import anndata as ad
import numpy as np
import pandas as pd
from anndata import AnnData
from scipy.spatial import cKDTree
from spateo.logging import logger_manager as lm
####################
# Before Alignment #
####################
def _iteration(n: int, progress_na... |
8aab53ae93c60f93e0e39c32b0a3072c7800d84d97fbf85a391012c9742329d5 | Python | 19,875 | 538 | """Cross-process differential harness: mode-capture vs wrapper-capture.
Stage-1 safety-net oracle (dispatch verdict, converged staged plan): compare
what a ``TorchFunctionMode`` observes on PRISTINE torch against what the
TorchLens wrappers record for the same forward pass, op-for-op, with a 1:1
name mapping. This is ... |
ebf72752fdbd308b4cf35b6333d7a2212eed28145906948aaf34083c2e984cb6 | Python | 19,882 | 452 | """
This module defines containers for tabulated chemistry libraries and solution trajectories
"""
# Spitfire - a Python-C++ library for building tabulated chemistry models and solving differential equations
# Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
#
# You should have receiv... |
238b2494c4e3abdfd0fc55b2a7b4df4d178d0fcb571cc8c75af8d2ec338845d8 | Python | 19,886 | 644 | # encoding: utf8
"""Various input/output methods.
This module provides methods for loading and saving data from- and into
various formats.
"""
from os import path
import logging
import re
import json
import socket
import numpy as np
from scipy.io import loadmat
from wyrm.types import Data
import pdb
logging.b... |
d533f097bf9a31915139452de3ec59814c7d26af93d041748d2abe478b4373f4 | Python | 19,897 | 484 | """
This file contains classes used to fit a 3D subspace as well as find the best-fitting planes for a given dataset.
@author: emilia
"""
import numpy as np
from numpy.linalg import lstsq
from sklearn.decomposition import PCA
from scipy.spatial import ConvexHull
import src.vec_operations as vops
class SinglePlaneSub... |
d748b9d77f15a4575414d19eea7b8811d540c0982e695f75e822ed9b0f92e94e | Python | 19,902 | 658 | """
This module contain all simulator and generator code
"""
import scipy.stats as st
import numpy as np
from numpy.random import default_rng
from tqdm import tqdm
from functools import partial
import pathlib
from .tools import roll_pad
def clipped_lognormal(mu, sigma, size, low, high, rng=None, max_iter=100000):
... |
da1df2b3147ddb4e5e65a7ff8e00703f7f1e3161e24d8954e44795856765deee | Python | 19,911 | 600 | """PYTEST_DONT_REWRITE
Integration coverage for the Step 5 conditional 5a-5f pipeline.
"""
from __future__ import annotations
from collections import defaultdict
from itertools import chain
import pytest
import torch
import torch.nn as nn
from torchlens import trace as trace_fn
from torchlens.data_classes.op impor... |
5e95c9fbf1570757205fecc30e6d9eca082512bf88294529ff9e29c3f36937e1 | Python | 19,921 | 608 | """
Stide-cycle-related plotting
"""
from __future__ import annotations
from typing import Any, Optional, Sequence
import os
import numpy as np
from .. import plot, reg, util, funcs
from ..util import nam
__all__: list[str] = [
"plot_vel_during_strides",
"stride_cycle",
"stride_cycle_all_points",
"... |
21abc33d1751b46c8493618cb885166a5f8974b9dbb06a9620c380353149192e | Python | 19,924 | 497 | """Functions for building the features for the HelixFold-3 protmodel."""
import contextlib
from functools import partial
import tempfile
from typing import Tuple, Union, List, Optional
import numpy as np
import tempfile
from helixfold.common import residue_constants
from helixfold.data import parsers
from helixfold.d... |
2ada926c74d2019f75b371274e0104a6f5475f452fbc0368cd530dd53981df7a | Python | 19,943 | 469 | try:
from typing import Any, List, Literal, Tuple, Union
except ImportError:
from typing_extensions import Literal
import functools
import os
from pathlib import Path
from typing import List, Optional, Tuple, Union
import anndata as ad
import numpy as np
from anndata import AnnData
from spateo.alignment.meth... |
6b9d9e33185398a19b456b3c191e9d644062376f9327c360c4402ff2eab0974b | Python | 19,945 | 530 | """Blind acceptance tests for multi-pass (recurrent) replay fidelity of ``do()``.
Written as an independent oracle from the specification alone, on top of main,
without reading the fix branch. The specification under test:
- Internals operate on PASS-QUALIFIED op labels (``layer_label:pass``); an edit
addressed to ... |
b1303bf5fd35f0a8834d5b3263d847664eee9de481bed1aea3f3404409a08d08 | Python | 19,952 | 422 | #!/usr/bin/env python3
"""FA4 CI driver — runs inside an Apptainer SIF on a self-hosted GPU runner.
Requires FA4_SIF (path to the .sif image) to be set, either via env var or --sif.
"""
from __future__ import annotations
import argparse
import os
import re
import shlex
import subprocess
import time
from dataclasses ... |
d187e9e6b99681f282d39bd09df04ba4d150e489ae871aac5e2f9c61739cff8f | Python | 19,958 | 467 | # -*- coding: utf-8 -*-
"""
Created on Fri May 8 14:17:46 2020
@author: Caterina Brighi
"""
import pandas as pd
import numpy as np
import scipy.stats as stats
import matplotlib.patches as ptch
import matplotlib.pyplot as plt
import os
from pylab import plot, xlim, legend, setp
#%%Functions
# funct... |
7a1cb7407bfce4fe3efccc69056cb5c4d9ab5408f683545ca008a7cda4155323 | Python | 19,971 | 509 | """F09 CP1: costreport items 6-12 -- honesty rebuild, percent columns,
cost tree, flops_report, backward gating, position scaling.
Named memo rows exercised here: T-HONESTY (failing-first: it fails against
the pre-F09 null-check honesty()), T-ROOT (the 3.878x naive module sum is
the forbidden regression), T-GRAD (back... |
a75c48a336bacc516e6f17a93dce51e1a3b6f9b2e7bebff2f3eb0a3a3df9e485 | Python | 19,981 | 356 | import numpy as np
from gym import utils
from gym.envs.mujoco import MujocoEnv
from gym.spaces import Box
DEFAULT_CAMERA_CONFIG = {
"distance": 4.0,
}
class AntEnv(MujocoEnv, utils.EzPickle):
"""
### Description
This environment is based on the environment introduced by Schulman,
Moritz, Levine... |
596e42cb4e6bd6f49dbebdd383ba4dab68ab514da9386174be4f576d6a7a0c0e | Python | 19,990 | 602 | """Shared TorchLens exception types."""
from __future__ import annotations
from typing import Any, cast
from .errors._base import CaptureError, ConfigurationError, TorchLensWarning
#: Layer declaration (architecture memo build item 2, seeding the layer map
#: the C01 lint consumes): the exception vocabulary is home... |
d2e033a82acd4189870c8cf49bcc8e38814693b88ce526e1ae3be23ead292749 | Python | 19,996 | 497 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "scatter3d.marker"
_pat... |
8b00375c44c486165dae353ec3dd69bd56124a66ee5bfa40700d320faeb72df2 | Python | 19,998 | 474 | import logging, traceback
import os, sys, socket
import datetime as dt
from pyoperant import utils, components, local, hwio
from pyoperant import ComponentError, InterfaceError
from pyoperant.behavior import shape
import random
try:
import simplejson as json
except ImportError:
import json
def _log_except_hoo... |
de3674b4bd54668526034c9b5ca9c32e2e93cce0b70c11ddd75bd1b0c11ebecc | Python | 19,998 | 522 | """Tests of perievent for `pynapple` package."""
import numpy as np
import pytest
import pynapple as nap
# =============================================================================
# compute_perievent — discrete data (Ts input)
# =============================================================================
cla... |
893bf0dbffacae872864999ec798e8e301eb35342356e25a7bd30a4d1afe2a68 | Python | 20,002 | 396 | import os
import math
from decimal import Decimal
import time
import utility
import model
from data import common
import torch
import torch.nn.utils as utils
import torch.nn.functional as F
from tqdm import tqdm
class Trainer():
def __init__(self, args, loader, my_model, my_loss, ckp, ref_model=None):
se... |
4846ea0b01311db3a873cde50639c2bff748c85004c76b7a17a6c09dfc43e347 | Python | 20,018 | 573 | #!/usr/bin/env python3
"""
Ethoscope LED Daylight Controller Daemon.
Standalone service that controls a white LED via GPIO to simulate daylight
conditions during experiments. Reads a schedule config file written by the
device tracking server and toggles the LED accordingly.
Hardware: GPIO -> BS170 MOSFET -> LED -> 10... |
da186b4d8214d24b39b602bb7a6d66d8503cd92ba1b333dd10b06cde044e45fc | Python | 20,032 | 578 | from functools import partial
import warnings
import numpy as np
from scipy.stats import multivariate_normal
from sklearn.utils import check_random_state
from joblib import Parallel, delayed
from ..utils.base import sqrtm, expm
from ..utils.test import is_sym_pos_semi_def as is_spsd
def _pdf_r(r, sigma):
"""Pdf ... |
58aa469d123f98b47fc76bd7aee069d9f788a3d7027f4b35c83567b5ddede33e | Python | 20,033 | 440 | '''
any new class added here need to be added to web_utils/control_thread.py too
'''
__author__ = 'quentin'
from ethoscope.stimulators.stimulators import BaseStimulator, HasInteractedVariable
from ethoscope.hardware.interfaces.interfaces import DefaultInterface
from ethoscope.hardware.interfaces.sleep_depriver_int... |
30dbffb85905cbaafa88eb82bd18ffee595bb60200f513b37c75724d62d94765 | Python | 20,045 | 498 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "bar.marker"
_path_str ... |
28dec691efd562ba15a30dac2da5c4360f43adf2e9e7de7ddab5ab5afc8b7cd6 | Python | 20,057 | 498 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "splom.marker"
_path_st... |
3347b949fbefed6f6ab372ee6d53739f2f007ffd24b088175b4f95804efa7aac | Python | 20,061 | 513 | """Robustness sprint PR 4 — opaque-wrapper guards + limitations doc.
Covers:
- ``torch.compile`` / ``torch.jit.script`` / ``torch.jit.trace`` /
``torch.export.ExportedProgram`` models raise a clear error up front,
rather than running an empty or misleading forward pass.
- ``docs/LIMITATIONS.md`` ex... |
afaea4f98fd946fd6a732e4038148209653128990c03b427e4f4743db6fd9b9d | Python | 20,063 | 498 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "funnel.marker"
_path_s... |
5b7029582506ace68ed3f1bffc6f3e22def904c25d634cd82debb4b66d826fa9 | Python | 20,069 | 439 | #!/usr/bin/env python
# fix problems with pythons terrible import system
import sys
import os
file_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(file_dir, '../'))
sys.path.append(os.path.join(file_dir, '../../'))
# package import
import prob2020.python.permutation as pm
import prob2020... |
4fb311c0621276f13dce9b9a286aa1ffaedd44496803ac8ef714359f7f677cbd | Python | 20,075 | 498 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "barpolar.marker"
_path... |
fb81dbd833c129d2558822a4f724474e196a38142dae83678f1dfc829512cd5b | Python | 20,075 | 456 | import torch
from bioseq2seq.translate import penalties
from bioseq2seq.translate.decode_strategy import DecodeStrategy
import warnings
class BeamSearchBase(DecodeStrategy):
"""Generation beam search.
Note that the attributes list is not exhaustive. Rather, it highlights
tensors to document their shape.... |
3b318699c7d706aceb6bf07cca0e5b2619a6d8794beb706ecdf50035a8061ccd | Python | 20,081 | 498 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "scattergl.marker"
_pat... |
876dcaf58f2cc3bd6d6ef6ccd0e9aa164cb9e1788ed236e0547828e9f4144e11 | Python | 20,081 | 498 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "histogram.marker"
_pat... |
30ae4cd448761d6e33a90619a170f743a4d1916e8b303d5bfe0315ee8de4c0a1 | Python | 20,083 | 512 | """Rung-1 class-3 false validation failures, fixed by narrow proofs or a stronger probe.
Each fix has a positive test (the false failure now validates end to end) and a
negative test (the neighbouring case outside the proof still fails
``perturbation_insensitive`` when its edge is frozen, the armed-proof pattern
of ``... |
d195757ea3099497158c99e8d14ba13550e847de74705215964570bc5fd85883 | Python | 20,083 | 456 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import platform
from copy import deepcopy
from pathlib import Path
from typing import Any
import numpy as np
import torch
from torch import nn
from ultralytics.utils import LINUX, LOGGER, WINDOWS
from ultralytics.... |
d541f9a6822950dd7079dda8fff4f13cf4c7707576c5f4ab30be5122189dae24 | Python | 20,086 | 471 | """Funcol boundary capture + plane-W completion authority: gloo sims.
Merge-ranks C2 recording slice (design-merge-ranks-c v5 5.2 planes S/W; L8
census plan). Pins the closure of the wave-0 pinned gap -- funcol collectives
used to be INVISIBLE to the C1 python-wrap capture -- plus the fail-closed
edges: ACT never mate... |
0fa1568bb6fd3a7673c7090ba5f2c76921e977f1e79c5760f890e0e4eb523fef | Python | 20,090 | 497 | #!/usr/bin/env python3
"""
File: pre_process_expression_matrix.py
Created: 2021/10/22
Last Changed: 2022/03/17
Author: M.Vochteloo
Copyright (C) 2020 University Medical Center Groningen.
A copy of the BSD 3-Clause "New" or "Revised" License can be found in the
LICENSE file in the root directory of... |
4fa3a828f8768e4d9b759b7e964397a1fec00629d6e55eaf7bfbfed86a246884 | Python | 20,090 | 408 | #!/usr/bin/env python
# coding: utf-8
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.layers import Reshape, Input, Flatten, concatenate, Dense, BatchNormalization ,Conv1D,Conv2D,Conv3D,MaxPool1D, MaxPool2D,MaxPool3D, GlobalMaxPool2D, Dropout
from tensorflow.keras.optimizers import SGD
... |
07849fcc7fe9a6f80829cd030d2360e304d8f8801f05dba31cc5ae2597e96a40 | Python | 20,095 | 393 | ##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
## This file is par... |
2fb3e1ae53c554fd2603a5f549dc27ad4b9195ad2f4c1e7824e99723cb585683 | Python | 20,098 | 551 | from typing import Dict, Union
import torch
from torch_geometric.data import Data
from torch_cluster import radius_graph
from e3nn import o3
from e3nn.math import soft_one_hot_linspace
from e3nn.nn import Gate
from e3nn.nn.models.gate_points_2101 import Convolution, smooth_cutoff, tp_path_exists
import matplotlib.py... |
cd8068320ac7dc637804c40d99620bea0ab8a5eba73ddabb3e47df36bc1c0ac7 | Python | 20,098 | 501 | # Copyright (c) 2024 PaddleHelix Authors. All Rights Reserved.
#
# Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0
# International License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://creativecommo... |
ff6f54619453357015930d452f90c50826a546321240e5a2b5ad9790cd0719db | Python | 20,102 | 548 | import os
import numpy as np
import pytest
from absl.testing import parameterized
from tensorflow import data as tf_data
from keras.src import backend
from keras.src import layers
from keras.src import models
from keras.src import testing
from keras.src.backend.common import is_int_dtype
from keras.src.backend.common... |
b54c24a72a76960aaa4934d8022715798a968dc18dfb7600549ff0cbe6906ecf | Python | 20,103 | 643 | """An example collection of tasks."""
import numpy as np
from neurogym.core import TrialEnv, TrialWrapper
from neurogym.utils import scheduler, spaces
from neurogym.wrappers.block import ScheduleEnvs
def _get_dist(original_dist):
"""Get the distance in periodic boundary conditions."""
return np.minimum(abs(... |
bbadbd00eebb6d8b18a48570f696125213c70d02a25f9eeab267a48cf9ecb874 | Python | 20,109 | 495 | import socket
import uuid
from unittest.mock import Mock, patch
import pytest
from celery import chord, group, states
from celery._state import _task_stack
from celery.app.task import Context
from celery.backends.rpc import RPCBackend
class test_RPCResultConsumer:
def get_backend(self):
return RPCBacken... |
a5de375f812158d4a3f1c5d9ba59a7eebe2770f7ae473e9024c64c2baa417ed2 | Python | 20,111 | 498 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "scatterpolargl.marker"
... |
7cf413f37284154dad5ca9dc1789b66b38fb55c01ad0ae239e48b4cdacc51bae | Python | 20,116 | 637 | # bcixml.py -
# Copyright (C) 2007-2014 Bastian Venthur
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This prog... |
d3cf26ed6c52188372ba630fd94e66a70484a96007bf6cc67ea723339e59148a | Python | 20,116 | 416 | import copy
import time
from multiprocessing import Pool
from typing import List
import torch
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from torch.autograd import Variable
from torch.distributions import Normal
import math
from src.utils.conf_gen import gen_init_conf, get_t... |
4335ba2aa65601b7e1d23f75bec13ea7e8dc3d3c2beb722dac784564f6a22e2d | Python | 20,119 | 479 | # SPDX-License-Identifier: LGPL-2.1-or-later
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import sys
from datetime import date
from collections import OrderedDict
try:
basestring
except NameError:
basestring = str
import numpy as np
from .utils import BaseFunctions
from .SetupConfig import SetupCon... |
80b1cf6656226b9efcfd2f20a3d1a4296e96ec9af453adddd20828d6836790f7 | Python | 20,119 | 438 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 5 18:51:06 2021
This file contains functions implementing the analysis of model behaviour (i.e., choices).
@author: emilia
"""
import numpy as np
import torch
import warnings
import pickle
import pycircstat
import pandas as pd
from scipy.stats im... |
e79e46a97648c49e785e020c4ba0247049512be850c203e642bf737c8027eb27 | Python | 20,129 | 563 | """Stage 8 optional runnable activation-payload and numeric-attestation tests."""
from __future__ import annotations
import dataclasses
import json
import pickle
from pathlib import Path
from typing import Any
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens._io.runnable import ... |
9702f2c04454b7fa125def3e094e7367e844fdcaf6d5b540840d593f90629b0c | Python | 20,132 | 443 | """Transforms relate to tokenization/subword."""
from bioseq2seq.utils.logging import logger
from bioseq2seq.transforms import register_transform
from .transform import Transform, ObservableStats
class TokenizerTransform(Transform):
"""Tokenizer transform abstract class."""
def __init__(self, opts):
... |
124c7f5aa0e661adbc306a1d72d4927f7369992320c95c28c89b4e9e18ce5d31 | Python | 20,134 | 426 | # pylint: disable=wildcard-import, unused-wildcard-import, line-too-long
"""Model store which handles pretrained models from both
mxnet.gluon.model_zoo.vision and gluoncv.models
"""
from .alexnet import *
from .cifarresnet import *
from .cifarresnext import *
from .cifarwideresnet import *
from .deeplabv3 import *
from... |
1c135b12aa0faf696208c30ea38659b9f677a92c1c4c95dd0dbdaeabcd92018c | Python | 20,135 | 655 | """R0 family builders (testing MEMO 4.1 roster; build row A3).
Fourteen architecture families, each instantiated from its REAL upstream
class with its REAL vendored ``config.json`` (registry-pinned revision)
shrunk through explicit overrides, weights built from a fixed seed, ZERO
network. Plus the six structural fixtu... |
12485683a24cee5e93b0582803630904b6aefcb1d49c312a264e834409702c54 | Python | 20,161 | 608 | from itertools import product
from typing import Callable
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.colors import to_rgba
import numpy as np
import pandas as pd
import seaborn as sns
from bdpy.fig import box_off
def makeplots2(
df,
x, y,
x_list=No... |
dfad7b0fad642fb9807ddfc1ea5ae76d7cb6db69a553390cc82c196bdf2fb1f3 | Python | 20,171 | 398 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import hashlib
import os
import shutil
import sys
from functools import lru_cache
from pathlib import Path
import numpy as np
import torch
from ultralytics.utils import ARM64, LINUX, LOGGER, USER_CONFIG_DIR, WINDO... |
f0f11cdc3e0a529689778df6010d1a1a6a2216145c731a2f19a0fc010326970a | Python | 20,171 | 560 | # -*- coding: utf-8 -*-
"""
This process is repeated with Temp2-5
# Import Libraries
"""
import itertools
import os
import statistics
import matplotlib.pylab as plt
import numpy as np
import PIL
from google.colab import drive
import pandas as pd
from sklearn.utils import shuffle
import sklearn
import sklearn.model... |
41af144140a89aa2204ee3cd2f6acd69c33971a60237559f1c1ba84b31637c6c | Python | 20,178 | 515 | #!/usr/bin/env python3
"""
LEMON (MPI Leipzig Mind-Brain-Body) EEG — CAR + 5D Reprocessing
===============================================================
Dataset: MPI LEMON (FCP-INDI S3 mirror), 228 healthy adults, eyes-closed +
eyes-open resting state, BrainVision format, 2500 Hz, 62-channel ActiCap.
16 min recordin... |
37ec7702fc667ecefc1742a43d3069877845d0c272e47e65f25abb8ffd537531 | Python | 20,180 | 508 | from collections import OrderedDict
from typing import Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
import sys
from robustness.imagenet_models.custom_modules import SequentialWithArgs, FakeReLU
class Bottleneck(nn.Module):
expansion = 4
def __init__(self,... |
743ed15b5f83aa2df78be9229d984fcd98d2463be6b24f1bef1988ec85c9f263 | Python | 20,180 | 498 | from keras.src import backend
from keras.src import ops
from keras.src import tree
from keras.src.api_export import keras_export
from keras.src.layers.layer import Layer
from keras.src.layers.rnn.dropout_rnn_cell import DropoutRNNCell
from keras.src.layers.rnn.stacked_rnn_cells import StackedRNNCells
from keras.src.sav... |
f244aee8578383f99c53b8f68d347c2050309bdcc14aa3785df2e1e885f365c2 | Python | 20,189 | 474 | from src.utils import *
from src import convertAllenSpace as CAS
class NeuronMorphology:
def __init__(self, neuronDict = None, *, neuronFile = None, orientation = None):
if neuronFile is not None:
neuronDict = self._load_file(neuronFile)
if neuronDict is not None:
try:
self.met... |
eeca76b3eaef79ea8d0b91511fa5ddcb829809d4222fa2a8b686d7ba95a45194 | Python | 20,215 | 539 | # Copyright 2025 Google.
#
# 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, soft... |
742674f6dd9395cf7faf56fbaa5afba5ba6953ae67624167e32cb0556b9f52cc | Python | 20,217 | 571 | #!/usr/bin/env python
"""
Downloads and prepares (parts of) the "Spoken Wikipedia Corpora" for DeepSpeech.py
Use "python3 import_swc.py -h" for help
"""
import argparse
import csv
import os
import random
import re
import shutil
import sys
import tarfile
import unicodedata
import wave
import xml.etree.ElementTree as ET... |
57d5e70e68ab6dba0376062406b1c35112317008b504c556ea1386de764fa412 | Python | 20,220 | 695 | import warnings
warnings.filterwarnings(
"default", r"plotly\.graph_objs\.\w+ is deprecated", DeprecationWarning
)
class Data(list):
"""
plotly.graph_objs.Data is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.Scatter
- plotl... |
ea75e9d0efdc21f684bc7ccebcef31165945ba1f96aba9c37c5a7028fc46d21c | Python | 20,224 | 420 | """Train SSD"""
import argparse
import os
import logging
import warnings
import time
import numpy as np
import mxnet as mx
from mxnet import nd
from mxnet import gluon
from mxnet import autograd
import gluoncv as gcv
gcv.utils.check_version('0.6.0')
from gluoncv import data as gdata
from gluoncv import utils as gutils
... |
49f343051ac89b8ac3d546d4f9d70e04d5af4b53187e7ccb0029a72f8fcbece5 | Python | 20,225 | 503 | import os
import time
import gdist
import numpy as np
import pickle as pkl
import nibabel as nib
from os.path import join as pjoin
from scipy.stats import variation, sem
from matplotlib import pyplot as plt
from cxy_visual_dev.lib.predefine import proj_dir, get_rois,\
Atlas, s1200_midthickness_R, s1200_midthickness... |
febf1880894d365c5bd8e430f18d26e332599ec4c4b35daaedf6ede7ddc62dd1 | Python | 20,225 | 558 | import tensorflow as tf
from . import agc
# dynamically handle which Optimizer class to use dep on tf version
opt = tf.keras.optimizers.Optimizer
if int(tf.version.VERSION.split(".")[1]) > 10:
opt = tf.keras.optimizers.legacy.Optimizer
# https://stackoverflow.com/a/66524901
# https://keras.io/guides/customizing... |
5f3819d6d0b52147e3554c63a876b5348b01db9fbe9ce179df8a7fec260358c2 | Python | 20,230 | 480 | import json
import logging
from typing import (
Any,
)
log = logging.getLogger(__name__)
from pydantic_ai.messages import (
ModelMessage,
ModelRequest,
ModelResponse,
TextPart,
UserPromptPart,
)
from sqlalchemy import (
and_,
select,
)
from sqlalchemy.exc import (
MultipleResultsFo... |
75c8f56f3851c667e2c1009f0cd680b54155de30c1fab73035209f37eebeb1c7 | Python | 20,231 | 492 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Modules and functions to compute energies and gradients with OpenMM.
"""
# ====================================... |
c1727d21f90c52eb6f1e9432dcc8058080b1b8ef80fbcd084341aa3aedab784e | Python | 20,232 | 471 | import os
import re
import warnings
import numpy as np
from keras.src import backend
from keras.src.api_export import keras_export
from keras.src.callbacks.monitor_callback import MonitorCallback
from keras.src.utils import file_utils
from keras.src.utils import io_utils
@keras_export("keras.callbacks.ModelCheckpoi... |
67dd41fdb4de125bf50e32a93221c60b8048d44b5c8d300769a056719596e8f9 | Python | 20,233 | 613 | # pylint: disable=all
"""Pose related transformation functions
Adapted from https://github.com/Microsoft/human-pose-estimation.pytorch
---------------------------------------------
Copyright (c) Microsoft
Licensed under the MIT License.
Written by Bin Xiao (Bin.Xiao@microsoft.com)
------------------------------------... |
fe2a7a2e69c64a3f4e6cba280839b1acbe4cef41a8304d1155189b1cd63c2dd7 | Python | 20,234 | 522 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 26 15:17:27 2022
@author: LABadmin
"""
def PredictionPerformanceSpecificPopulation(dataDir = 'D:\\Figures\\OneFunction_raw\\',flat = False ,reps = 500,iterations = [],testStat = 5, controlStat = None,controlState = 0,ephys = False, tups=None,contrast=None, split=0.5,preS... |
436ba99b9efb149d130674b61031371888791d3199790a17e674044d0293f2a0 | Python | 20,240 | 524 | """WorkController can be used to instantiate in-process workers.
The command-line interface for the worker is in :mod:`celery.bin.worker`,
while the worker program is in :mod:`celery.apps.worker`.
The worker program is responsible for adding signal handlers,
setting up logging, etc. This is a bare-bones worker witho... |
eeb069fa480a9b847951e4b7108f231ebecfb1aaa32b26e5a061d99884cff156 | Python | 20,244 | 438 | """
The parsing functions for the argument input.
"""
import os
import pickle
from argparse import ArgumentParser, Namespace
from tempfile import TemporaryDirectory
import torch
from BatmanNet.data.molfeaturegenerator import get_available_features_generators
from BatmanNet.util.utils import makedirs
def add_common_... |
e1271f13b6f2aad4fba60702bb1fa7f0cab4d74e01485f0930cff765e4fd0a5a | Python | 20,247 | 503 | # Copyright 2025 Google.
#
# 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, soft... |
91ccbd2000e0ab4a9c038c689ee3edc3a64c50c40f5a10fc6d4d0815e4cb8256 | Python | 20,252 | 521 | """Value-based + statistical selection producers: acceptance and honesty gates.
Covers the producer-lane obligations: every producer returns a composable
``Selection`` (operator mixin via the algebra), masks are exact AS SETS and
verified against manually computed criteria, the provenance relations are
PINNED per prod... |
19ce129681b1bdc62a7c552e8f4561de11d7d2414d1d74701e8bcc56101e672d | Python | 20,253 | 608 | import os
import warnings
from unittest import mock
import pytest
from keras.src import callbacks
from keras.src import layers
from keras.src import metrics
from keras.src import models
from keras.src import saving
from keras.src import testing
from keras.src.models import Sequential
from keras.src.testing import tes... |
65cc78dfa4908278352bc9a98a3decec6d16abab6af8b891aebc53ea697b732e | Python | 20,255 | 477 | from src.utils import *
import src.convertAllenSpace as CAS
import numpy as np
class NeuronMorphology:
def __init__(self, neuronDict = None, *, neuronFile = None, orientation = None):
if neuronFile is not None:
neuronDict = self._load_file(neuronFile)
if neuronDict is not None:
try:
... |
d4fcc7893c3da9ebfecb2f92b58b1c59455ecb0c08d41e2d3834f7291c949114 | Python | 20,256 | 617 | # Copyright 2025 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
5554a81c2b1c3a01a42893004d5abca2e93e2f06b3b7a43f753e2ec69b83abf0 | Python | 20,264 | 664 | """
Unit tests for lib/model/modules/intermitter.py
Tests behavioral state machine (run/pause/feed), EEB decay,
bout generation, and stridechain logic.
Philosophy: Test the STATE TRANSITIONS, not the physics.
"""
import pytest
import numpy as np
from larvaworld.lib import util
from larvaworld.lib.model.modules.inte... |
0c21cf24d006d31746c7491e7e57ce6d3f79b1c6648e00cd2708dec340572eb8 | Python | 20,286 | 470 | '''
Copyright 2021 Twente Medical Systems international B.V., Oldenzaal The Netherlands
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 requir... |
43fae29690340cb320b65223b46a8e44ebf4262bba03e09b56e846ded2889147 | Python | 20,288 | 552 | # funkcija za ucitavanje vremenskih serija za multivariate
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
# Timeseries sequence generator
from keras.preprocessing.sequence import TimeseriesGenerator
# VMD
from vmdpy import VMD
import PyEMD
pd.options.mode.chained_assign... |
d85e498a18bcc1014498063110df2069601bd8fafeee2b2c58cdff4a401c7e09 | Python | 20,289 | 632 | """
Unit tests for plot.util module - utility plotting functions.
Tests REAL behavior based on ACTUAL code, not assumptions.
All tests validate actual API signatures, return values, and side effects.
"""
import pytest
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib.axes imp... |
3cb5a84d45570770cc94d3dea15591a2d642fde4dd773a7452ecad6c744c6dc3 | Python | 20,293 | 572 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
d970e47a50b675b355e60d47e77bb85aae5a59085071eee64fd83c40d56106f3 | Python | 20,299 | 503 | import json
import logging
import time
from datetime import datetime
from typing import (
TYPE_CHECKING,
)
from galaxy import model
from galaxy.jobs.runners import (
AsynchronousJobRunner,
AsynchronousJobState,
)
from galaxy.util import (
DEFAULT_SOCKET_TIMEOUT,
requests,
unicodify,
)
if TYPE_... |
cbf6ba3d8718d88313d209ee88569783cd9cf70db69a12d5724dce524278975c | Python | 20,301 | 390 | #==============================================================================#
# Author: Dominik Müller #
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, #
# University of Augsburg ... |
066c90f03644783021eef5cc99bb82a0b8795bd4281397190ca6182179060137 | Python | 20,303 | 703 | # This file was part of Flask-CLI and was modified under the terms of
# its Revised BSD License. Copyright © 2015 CERN.
import importlib.metadata
import os
import platform
import ssl
import sys
import types
from functools import partial
from pathlib import Path
import click
import pytest
from click.testing import CliR... |
70e8d3c7224d256c42fa09c8b2e9f6b2db6730aa5699157988fe7144ebde3db1 | Python | 20,326 | 598 | # Copyright 2022 Deepfold Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.