sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
c4611242e729b28eb246c5911c849ffb41bc4d263ee5db11d3586d70354c1435 | Perl | 617 | 27 | #!/usr/bin/env perl
use strict;
use warnings;
die("Usage: qualfa2fq.pl <in.fasta> <in.qual>\n") if (@ARGV != 2);
my ($fhs, $fhq, $q);
open($fhs, ($ARGV[0] =~ /\.gz$/)? "gzip -dc $ARGV[0] |" : $ARGV[0]) || die;
open($fhq, ($ARGV[1] =~ /\.gz$/)? "gzip -dc $ARGV[1] |" : $ARGV[1]) || die;
$/ = ">"; <$fhs>; <$fhq>; $/ =... |
c20f422be86c449878464bfb7912839a8d03925799ffd421c4cae05558ecf5f7 | Perl | 787 | 27 | #!/usr/bin/env perl
use strict;
use warnings;
while (<>) {
if (/\tXA:Z:(\S+)/) {
my $l = $1;
print;
my @t = split("\t");
while ($l =~ /([^,;]+),([-+]\d+),([^,]+),(\d+);/g) {
my $mchr = ($t[6] eq '=') ? $t[2] : $t[6];
my $mchr_ = ($mchr eq $1) ? '=' : $mchr;
# FIXME: TLEN/ISIZE is not calculated!
... |
e460a0ec869e26c690c24659afe3eb6c43a6814ad46853bd4cb3043b42d99d0f | Python | 13 | 1 | # to be added |
9de4570f3f0f6b65c3cd78511eeb70ffa4c28a49ae30ac20765c865c55d4b820 | Python | 14 | 1 | """Scripts"""
|
64a66f8b9a7783945c0538300f01eac361dadf1f2e8b36c9c1ea470ae6059a91 | Python | 17 | 1 | """Generators"""
|
b881fe3448d14653afafbae882b3b5a5e83861b5ae84c286054d1d62636b3f2b | Python | 22 | 1 | from .ndtest import *
|
dff41d18ba6e93f48363b93d3e935c1e94938e53dd85a74f884805f36c3392a9 | Python | 23 | 1 | __version__ = "0.1.26"
|
4749818a8123275806a009971aabdb308993cf2e379a0c4b91b5c4eec6390c11 | Python | 36 | 1 | from cloudfiles.compression import * |
843ac26c38a41abae578250bc0f9419194b320a0f67327d941037a4268f6cfe7 | Python | 38 | 3 | from setuptools import setup
setup()
|
2a4697733ef788f811e7d1d1a701dbb75f81d28591502140f1001dcbd6ed81cb | Python | 42 | 3 | """Init package"""
__version__ = "6.2.1"
|
f640ba28620bfb8751d83b7736a8e6e3cab5d46afd2b0996a700bdb41112424b | Python | 48 | 1 | from src.losses.losses import fourier_space_loss |
70840cbbfd770be1a24d7e05ffa0ac5da424bc272132ae8dbab065bdea1d91fa | Python | 65 | 3 | from ._version_git import __version__
__all__ = ["__version__"]
|
ef7b23c3468c8130483cd7578c14e977b39b372fd088f0e163b47be196d1291e | Python | 69 | 4 | from setuptools import setup
if __name__ == "__main__":
setup()
|
2780411520811eaca7c2894a7cd40cab1c7414534f964308c91b0a14b4807cd4 | Python | 86 | 2 | from osteoid import Skeleton
PrecomputedSkeleton = Skeleton # backwards compatibility
|
1e507f1be75efbd1e032efa5efedda164d5b816ef9fae18542711213df9aa062 | Python | 89 | 2 | from .precomputed import CloudVolumePrecomputed
from .graphene import CloudVolumeGraphene |
8eaf47ec252f261b7ac3ac86c352df0fb81efe94226d89a1dd4fa471a972ca5a | Python | 122 | 7 | __version__ = "0.1.1"
from brunoise.main import main
from sys import argv
if __name__ == "__main__":
main(argv[1:])
|
d736d7851380dae5fcafb86dc79da805fa16cd3f658ed56c2cf9cd1efaefb509 | Python | 130 | 3 | # Import main functions so they are available at the top level
from .sectioning_utils import *
from .spatchcocking_utils import *
|
c14e1e7b58c0cd290781296fdd23037c4407c0d0fd67426dd90f3fde8aea7163 | Python | 134 | 10 | """Process names"""
from enum import Enum
class AtlasName(str, Enum):
"""Atlas names"""
CCF = "CCF"
CUSTOM = "CUSTOM"
|
521cee61e386b1a1ab6456dd36410466e1b4d51d7c4406cf1f57b48fe13c6c4c | Python | 146 | 7 | """Testing library"""
import re
from pydantic import __version__ as pyd_version
PYD_VERSION = re.match(r"(\d+.\d+).\d+", pyd_version).group(1)
|
c5285176f825f3257c7582d5ffe9db20c454cfee7101d5cdfeb5af7f1a8f7e23 | Python | 153 | 10 | from taskqueue import totask
import igneous.tasks
task_timeout = 300
def process_task(msg):
task = totask(msg)
task.execute()
return None
|
002b8e64d39ebacd28deea29cea1ce889d4b2baf7be0f39bc82be062fa1c6726 | Python | 167 | 8 | """Update the harp type CSV file"""
from aind_data_schema_models._generators.dev_utils import update_harp_types
if __name__ == "__main__":
update_harp_types()
|
335c9474e256c4960ac4434ec102cca47a8bb91d19ee871ad74431423ee81326 | Python | 172 | 10 | """Module for definition of software and data licenses"""
from enum import Enum
class License(str, Enum):
"""Licenses"""
MIT = "MIT"
CC_BY_40 = "CC-BY-4.0"
|
9c82cf99a9639dbd7492713fc7e4bc523a697e64c134c871aa3e9c621121fd9b | Python | 175 | 10 | """Stimulus modalities"""
from enum import Enum
class Slap2AcquisitionType(str, Enum):
"""Stimulus modalities"""
INTEGRATION = "integration"
RASTER = "raster"
|
435c0038f953aea71c02a8a5a25a31a99e9a8b302e366c9e66205f7df8b7e087 | Python | 206 | 11 | import unittest
from sigpy import version
if __name__ == "__main__":
unittest.main()
class TestVersion(unittest.TestCase):
def test_version(self):
assert version.__version__ == "0.1.25"
|
296027ba803198672099e86e6092e3d6e353c037bdb8be4e09e50b43912da5e3 | Python | 207 | 8 | import unittest
from airflow import settings
from airflow.models import DagBag
class TestCompileDags(unittest.TestCase):
def test_dags_should_compile(self):
assert DagBag(settings.DAGS_FOLDER)
|
d16a0c4350301c5dac9b0187fd86ce188a58a628623a4ce08756f1042814cc9f | Python | 241 | 10 | import os
import sys
import pathlib
def run():
script=pathlib.Path(sys.argv[0]).name
here = pathlib.Path(__file__).parent.resolve()
cmd='{}/../{}.sh {}'.format(here, script, ' '.join(sys.argv[1:]))
sys.exit(os.system(cmd))
|
00fecb54ae23aec19caf932c03d8ce9b55a9491b6fd935656e85b20a23c2e510 | Python | 278 | 17 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: joerndiedrichsen
"""
import SUITPy as suit
import nilearn.image as ni
import nibabel as nb
if __name__ == "__main__":
# test other functions if needed
A = nb.load('avg_t1_raw.nii')
aff = np.eye(4) |
45daf7781d21b13624b131e2fd5cb578eeb17bf7a6044fe74b0e671eaa2b2cfe | Python | 283 | 12 | from PyQt5.QtWidgets import QApplication
import qdarkstyle
from brunoise.gui import TwopViewer
import click
@click.command()
def main():
app = QApplication([])
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
viewer = TwopViewer()
viewer.show()
app.exec_()
|
9868985fb7e021267ba44c57f608cf52296385f0e342cd9af710bb52682fc53e | Python | 306 | 10 | """Generalized data dimensions for multi-purpose MRI image reconstruction.
"""
DIM_X = -1
DIM_Y = -2
DIM_Z = -3
DIM_COIL = -4
DIM_ECHO = -5
DIM_SEGMENT = -6 # For diffusion MRI, it stores the shots per DWI
DIM_TIME = -7 # For diffusion MRI, it stores the diffusion encodings
|
484f6eb3d6098b8754710523c3ed807256858d03af6e3b74d2263c1b14a0d567 | Python | 341 | 13 | from ...precomputed.mesh import PrecomputedMeshMetadata
class GrapheneMeshMetadata(PrecomputedMeshMetadata):
def sharding(self, layer_id):
return self.info['sharding'][str(layer_id)]
@property
def sharded_mesh_dir(self):
return "initial"
@property
def unsharded_mesh_dir(self):
return self.met... |
e687b75581d143aebdba8b990568dae22dbac6e721cf0128583c9a3f013b2ab4 | Python | 347 | 18 | """Test device_enums"""
import unittest
from aind_data_schema_models.devices import BinMode
class UnitsTests(unittest.TestCase):
"""Class for testing device_enums"""
def test_units(self):
"""Tests creation of a BinMode object"""
self.assertIsNotNone(BinMode.ADDITIVE)
if __name__ == "__ma... |
48eb70ea928e39ca0663520449dc04665fe2e48378a6760d95ee9b61e3123d88 | Python | 349 | 18 | """Test licenses"""
import unittest
from aind_data_schema_models.licenses import License
class UnitsTests(unittest.TestCase):
"""Unit tests for the License class"""
def test_licenses(self):
"""Tests creation of a License object"""
self.assertIsNotNone(License.CC_BY_40)
if __name__ == "__... |
0e62df436bbfb7a29922efb5da47cc9cbb62d33df52e97ab603ecc5335c4579a | Python | 354 | 18 | """Test coordinate_enums"""
import unittest
from aind_data_schema_models.coordinates import AxisName
class UnitsTests(unittest.TestCase):
"""Class for testing coordinate_enums"""
def test_units(self):
"""Tests creation of a SizeVal object"""
self.assertIsNotNone(AxisName.X)
if __name__ =... |
39fedbfe81ff2e773e3dbab146f356a48f160a31c2873bdddad03ee95bd56dd5 | Python | 358 | 16 | import sys
from airflow.models import Variable
from cloudvolume.server import view
local_path = sys.argv[1]
if not local_path.endswith("/"):
local_path += "/"
ng_subs = {
"old": local_path,
"new": "http://localhost:8080/"
}
Variable.set("ng_subs", ng_subs, serialize_json=True)
... |
0ee9d9e45cb3f7a1436c832d5b46d59f5dda6e95d2f0d559c12bda9af423f82a | Python | 369 | 16 | """Stimulus modalities"""
from enum import Enum
class StimulusModality(str, Enum):
"""Stimulus modalities"""
AUDITORY = "Auditory"
FREE_MOVING = "Free moving"
NO_STIMULUS = "No stimulus"
OLFACTORY = "Olfactory"
OPTOGENETICS = "Optogenetics"
VIRTUAL_REALITY = "Virtual reality"
VISUAL ... |
84c4e560fc32deb675146e97fd7382601da08a67e3e8348373b98faa57d91a29 | Python | 370 | 18 | """Test reagent enums"""
import unittest
from aind_data_schema_models.reagent import FluorophoreType
class UnitsTests(unittest.TestCase):
"""Class for testing reagent enums"""
def test_units(self):
"""Tests creation of a FluorophoreType object"""
self.assertIsNotNone(FluorophoreType.ALEXA)... |
8ff1da1f2cf015040e0caae0f896817238c98e46e8c0afd148603c1095079c6a | Python | 379 | 11 | import streamlit as st
def show_about():
st.sidebar.markdown("## About")
st.sidebar.write("""
This app predicts bioactivity class using two models:
- **Multi-tasking Neural Network** (Predicts IC50 values)
- **Decision Tree** (Predicts bioactivity class)
It helps researchers analyze chemic... |
4fb607003d7447537ce38a47d598e44466d9136f8411e868d0bc45d60acd13ce | Python | 386 | 16 | from airflow.models import Variable
import subprocess
import sys
def install_package(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
Variable.setdefault("python_packages","")
packages = Variable.get("python_packages")
if packages:
for l in packages.splitlines():
try... |
8211f8fbb6e7aabf0964475de9a5d6075857462c72055092783435e1e69df747 | Python | 387 | 17 | from typing import Union, Optional, List, Tuple
CompressType = Optional[Union[str,bool]]
ParallelType = Union[int,bool]
CacheType = Union[bool,str]
SecretsType = Optional[Union[str,dict]]
MipType = Union[int, List[int]]
ShapeType = Tuple[int,int,int]
ProgressType = Union[bool,str]
try:
from enum import StrEnum
exce... |
51a8bbdc38d69a719f526abc31c7d09f3b5dda56045601784f33dc68be097d85 | Python | 393 | 19 | # test flatmap
"""
test for isolation module
@author: jdiedrichsen
"""
import SUITPy as suit
def test_isolate():
T1_file = 'docs/source/tutorials/sub-ex_T1w.nii.gz'
suit.isolation(T1_file,save_cropped_files=False)
pass
if __name__ == '__main__':
# make_shapes()
test_isolate()
# test_plot_labe... |
8c029c99d4a6a666c6b06a028d105d001ac0964d33c14ea1a93a90847adf0a93 | Python | 395 | 18 | """Tests classes in atlas module"""
import unittest
from aind_data_schema_models.atlas import AtlasName
class TestAtlasName(unittest.TestCase):
"""Tests methods in AtlasName class"""
def test_class_construction(self):
"""Tests enum can be instantiated via string"""
self.assertEqual(AtlasNa... |
ef8b61f60d2d4f9169c0634d3696d496842d34f0a25a99e2e46ea2a65b4ab64f | Python | 395 | 14 | from multiprocessing import Queue
from collections import namedtuple
from time import time_ns
SequenceElement = namedtuple("SequenceElement", "source t event")
class SequenceDiagram:
def __init__(self, queue: Queue, source: str):
self.queue = queue
self.source = source
def put(self, message)... |
f79c3b351856eb3d43d10b8c423fc7089290714561aedacbc4f8c7c58910a8cb | Python | 408 | 18 | """Tests classes in registries module"""
import unittest
from aind_data_schema_models.registries import Registry
class TestRegistry(unittest.TestCase):
"""Tests methods in Registry class"""
def test_class_construction(self):
"""Tests enum can be instantiated via string"""
self.assertEqual(... |
9463244e92e012e072c30e70f9a16a75397ff1d3aa78ac38c80e81e491fb2a70 | Python | 414 | 13 | # type: ignore
import glob
import importlib.util
from setuptools import setup
# Import <package>._version_git.py without importing <package>
path = glob.glob(__file__.replace("setup.py", "*/*/_version_git.py"))[0]
spec = importlib.util.spec_from_file_location("_version_git", path)
vg = importlib.util.module_from_spec... |
8bb357bbe837b3f7f4ac45da0cfc26247fd5a44afb5bbcf2bd72d78983c26953 | Python | 427 | 12 | import os
from airflow.models import Variable
directory = '/run/secrets'
print('Searching %s' % directory)
if os.path.isdir(directory):
for key in os.listdir(directory):
with open(os.path.join(directory, key), 'r') as f:
value = f.read()
Variable.set(key, value)
print('Setting k... |
7045505e29d7abe2cd6f64608a5bee406419e23f4d99c69c539eb1a88a5435a0 | Python | 428 | 22 | """
# Utilities
"""
import jax
import jax.numpy as jnp
# ------------------------- Typing imports ------------------------- #
from jax.typing import DTypeLike
def default_floating_dtype() -> DTypeLike:
"""Returns the default dtype for floating point operations.
Returns:
DTypeLike: default data typ... |
2830e8f462d8aceea3bef78827439e155ccc699bd85604ef2b3a9929c19b4ed7 | Python | 429 | 12 | """
sectioning_utils.py
Image segmentation and TIFF preprocessing utilities.
The full segmentation workflow (Fiji preprocessing, 3D Slicer volumetric
segmentation, napari visualization) is documented in docs/segmentation.md
and requires software outside this package (napari, 3D Slicer).
The standalone TIFF post-proc... |
43992a1e7ad2d22b96f3baeabe8003cd6791fceb50e629a12ec8f334c6eee1ae | Python | 437 | 18 | """Tests classes in process_names module"""
import unittest
from aind_data_schema_models.process_names import ProcessName
class TestProcessName(unittest.TestCase):
"""Tests methods in ProcessName class"""
def test_class_construction(self):
"""Tests enum can be instantiated via string"""
se... |
487ef9103396dabe1a7579b99bfa03cd9311ea7245ab096c6456b6022a07280b | Python | 444 | 10 | from __future__ import absolute_import, print_function
# TODO: rethink naming for 2D/3D functions
from .geom2d import star_dist, relabel_image_stardist, ray_angles, dist_to_coord, polygons_to_label, polygons_to_label_coord
from .geom3d import star_dist3D, polyhedron_to_label, relabel_image_stardist3D, dist_to_coord3D... |
7505337a1f9ca2e2721f226fc775e07158fd518d70f033341762591e863656c8 | Python | 444 | 22 | """Test utils.units"""
import unittest
from decimal import Decimal
from typing import TypeVar
from aind_data_schema_models.units import SizeUnit
ScalarType = TypeVar("ScalarType", Decimal, int)
class UnitsTests(unittest.TestCase):
"""Class for testing Utils.Units"""
def test_units(self):
"""Tests ... |
a215e17b54126b578e9f183e0c172ff2a9771b5c2342351bb92385967deae273 | Python | 448 | 20 | from cloudfiles import CloudFiles
from ..zarr2 import create_zarr2
from ..zarr3 import create_zarr3
from ...cloudvolume import register_plugin
def create_zarr(
cloudpath:str, *args, **kwargs
):
cf = CloudFiles(cloudpath)
is_zarr3 = cf.exists("zarr.json")
if is_zarr3:
return create_zarr3(cloudpath, *arg... |
7856a9a879ceded7154d8735528b4ea141dc6827d3b747455e1572da5db11bb5 | Python | 470 | 18 | """Tests classes in stimulus_modality module"""
import unittest
from aind_data_schema_models.stimulus_modality import StimulusModality
class TestStimulusModality(unittest.TestCase):
"""Tests methods in StimulusModality class"""
def test_class_construction(self):
"""Tests enum can be instantiated vi... |
64451d87b920e62361aec2a5ebcb68616fadde614178b13d9acad5decd24c958 | Python | 474 | 18 | import numpy as np
def apply_transform(vertices, transform):
"""
Scales mesh vertices from stored coordinate
space to physical coordinates.
vertices: a Nx3 array of X,Y,Z floats
transform: a 4x4 affine transform matrix
from stored to physical coordinates.
"""
if (transform == np.eye(4)).all():
... |
a92cbf11e08661dbc58dbb04fb1694ba6a1fbbc74c960ff2649dd20181e58422 | Python | 493 | 24 | """Enums for reagents used in imaging experiments"""
from enum import Enum
class StainType(str, Enum):
"""Stain types for probes describing what is being labeled"""
CYTOSKELETON = "Cytoskeleton"
FILL = "Fill"
RNA = "RNA"
PROTEIN = "Protein"
NUCLEAR = "Nuclear"
VASCULATURE = "Vasculature"... |
fcff07134feacf19f2722d2910c17426f2352422418d8e76e7da10dd83d4b938 | Python | 500 | 18 | """Tests classes in slap2_acquisition_type module"""
import unittest
from aind_data_schema_models.slap2_acquisition_type import Slap2AcquisitionType
class TestSlap2AcquisitionType(unittest.TestCase):
"""Tests methods in Slap2AcquisitionType class"""
def test_class_construction(self):
"""Tests enum ... |
aa6a7557c16433dd66d5bb003bdb53bcdc23f9d49dc75334042273157f929575 | Python | 512 | 10 | # -------------------------------------------------------------
# Subgrid Optimization
# Copyright (c) 2026
# Dirk Keller, Nick Ramsey's Lab, University Medical Center Utrecht, University Utrecht
# Licensed under the MIT License [see LICENSE for detail]
# ----------------------------------------------------------... |
6fe383002a18a282fb3268b7778792cee7673fc46312e1564077c5f5320f65d6 | Python | 514 | 18 | """Testing script for the SpecimenProcedureTypes enum"""
import unittest
from aind_data_schema_models.specimen_procedure_types import SpecimenProcedureType
class TestSpecimenProcedureTypes(unittest.TestCase):
"""Tests methods in SpecimenProcedureType class"""
def test_class_construction(self):
"""T... |
39a7a7a0616170d7b84631e6a447cdb76c43ca2f47108b2a62736b9a54d7be5c | Python | 516 | 14 | """
# UIDD package
This package implements the basic routines for building and training
(with or without model reduction/closure modelling)
UIDD and variants.
## Main Modules
- `UIDD.dynamics`: Dynamic models, including SDEs, UIDD, and variants
- `UIDD.transformations`: Transformations for dimensionality reduction an... |
41801508976c033a8324b562153b8421fe6e0e3718c5f2525bc61de99c249a0f | Python | 519 | 15 | from ..precomputed.sharding import ShardingSpecification, ShardReader
class GrapheneShardReader(ShardReader):
def __init__(self, meta, *args, **kwargs):
self.meta = meta
super().__init__(*args, *kwargs)
def compute_shard_location(self, label):
shard_loc = self.spec.compute_shard_location(label)
ch... |
758378310621635f45f38d1c10c3bfba9998ce738e62a7b2cd965a0ce25e47aa | Python | 524 | 22 | import unittest
import numpy as np
import numpy.testing as npt
from sigpy import util, coord
if __name__ == '__main__':
unittest.main()
class TestCoord(unittest.TestCase):
def test_normal(self):
x = util.randn((10, 1))
y = util.randn((10, 1))
z = util.randn((10, 1))
r, theta... |
6ff74de77bf3379707d47b2eff3a20f2764ca3a14b0cba464ac3a6fa96388198 | Python | 525 | 23 | from setuptools import find_packages, setup
with open("README.md") as readme:
long_description = readme.read()
install_requirements = [
"biopython",
"certifi",
"numpy",
"pandas",
"pod5==0.3.39",
"distro",
]
setup(
name="ont-tetra",
description="Oxford Nanopore Technologies regress... |
5187d69b1e9816be9d34e36bc6bcd26df4f850e09e9a5bf4ef3b4878ed8e36f6 | Python | 527 | 24 | from airflow.models import Variable
import subprocess
import sys
def install_package(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
packages = None
try:
packages = Variable.get("python_packages")
except:
pass
if packages:
for l in packages.splitlines():
try... |
e96099f36abbe43035a2c1ed17a52bb45b906f3ca9299408ea85e831ef7092c4 | Python | 566 | 19 | from os import environ
import slack_sdk as slack
def get_botid():
try:
client = slack.WebClient(token=slack_token)
auth_info = client.auth_test()
return f'<@{auth_info["user_id"]}>'
except Exception:
return ""
slack_token = environ.get("SLACK_TOKEN", None)
slack_app_token = e... |
3ad4012cd00d53cece2bbe950aa33a2b793659188fab298f0ccbae078e6c1017 | Python | 568 | 25 | import unittest
import numpy as np
import numpy.testing as npt
from sigpy.learn import util
if __name__ == "__main__":
unittest.main()
class TestUtil(unittest.TestCase):
def test_labels_to_scores(self):
labels = np.array([0, 1, 2])
scores = util.labels_to_scores(labels)
npt.assert... |
227322c6138eb0db34e1a0d2bd4c6d7a8b7b2b2a052125fde7164019454a3aa7 | Python | 603 | 28 | import nox
import os
python = os.environ.get("TRAVIS_PYTHON_VERSION")
lint_dependencies = ["black", "flake8"]
nox.options.reuse_existing_virtualenvs = True
@nox.session(python=python)
def tests(session):
session.install("pytest")
session.install("pytest-cov")
session.install("-r", "requirements.txt")
... |
9010f4b69462cdec55365411656865586009340052282193fb8c07deb1fb5878 | Python | 609 | 23 | """
Print the maximum recording duration in minutes.
"""
from pathlib import Path
import json
import numpy as np
results_folder = Path("../results")
if __name__ == "__main__":
json_job_files = [p for p in results_folder.iterdir() if p.suffix == ".json" and "job" in p.name]
durations = []
for json_file ... |
454faa34a0ac874e449338b654c75237c43c02e0c03d4d8d12a8a6f0d6009aca | Python | 626 | 16 | """Testing script for system architecture classes"""
import unittest
from aind_data_schema_models.system_architecture import OperatingSystem, CPUArchitecture
class TestSystemArchitecture(unittest.TestCase):
"""Class for testing Utils.Units"""
def test_class_construction(self):
"""Tests that Operatin... |
ec5154b4c6451bcf13ed202ed033e671f5e9ff32cf81f398d55aa403185e6dfa | Python | 634 | 30 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 19 12:57:40 2025
@author: vashkani, jdiedrichsen
"""
from SUITPy.atlas import summarize_data
import os
base_dir = '/Users/jdiedrichsen/Python/SUITPy'
def test_roi_summarize():
image_file = os.path.join(base_dir,'docs','source','tutorials','MDT... |
90c298120dc4a87401b6324f5aca0a9c10765b9d9b54a6ed735ee7f0bf080087 | Python | 659 | 28 | # -*- coding: utf-8 -*-
"""Methods for Coordinate Conversion
Reference:
https://math.libretexts.org/Bookshelves/Calculus/Book%3A_Calculus_(OpenStax)/12%3A_Vectors_in_Space/12.07%3A_Cylindrical_and_Spherical_Coordinates#:~:text=To%20convert%20a%20point%20from,y2%2Bz2).
Author: Zhengguo Tan <zhengguo.tan@gmail.com>... |
ab9f7cef3916e4789b9e63624d1aa1c2ff083f950223f53c34757a1ca0d9e480 | Python | 682 | 31 | SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
import streamlit as streamlit
import streamlit.web.cli as stcli
import os, sys
# Import the other libraries you need here
import streamlit_extras as streamlit_extras
import pandas as pandas
import opensoundscape as opensoundscape
import plotly as plotly
import r... |
099c2126e3c2af8932048a854714ea115bc957ce712d5069b8cc5175bed72736 | Python | 690 | 21 | """The module contains functions and classes for MRI reconstruction.
It provides convenient simulation and sampling functions,
such as the poisson-disc sampling function. It also
provides functions to compute preconditioners,
and density compensation factors.
"""
from sigpy.mri import app, dcf, linop, precond, samp, ... |
8d9f0e2d52a7f283346d331cde6f61797b993b29b9b3e46b6c8646a622f72d2f | Python | 695 | 25 | """Specimen procedure types"""
from enum import Enum
class SpecimenProcedureType(str, Enum):
"""Specimen procedures"""
BARSEQ = "BARSeq"
CLEARING = "Clearing"
DELIPIDATION = "Delipidation"
EMBEDDING = "Embedding"
EXPANSION = "Expansion"
FIXATION = "Fixation"
FIXATION_AND_PERMEABILIZA... |
09a7906667eff2946ea331d008c307afa86d4a5a6c1ecf3eb23d84bb6c2255e5 | Python | 699 | 26 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: joerndiedrichsen
"""
import SUITPy as suit
def test_atlas_dir():
dirs1 = suit.utils.get_atlas_dirs()
dirs2 = suit.utils.get_atlas_dirs('~/data/cerebellar_atlases')
pass
def test_find_atlas():
dirs1 = suit.utils._get_atlas_dir('Buckner_2011',... |
f362c3412bbcae33dc63f511e60bc9ae6786e302976a206d2f17dbb614ec55b2 | Python | 706 | 15 | # This script is part of mousebrains (http://www.github.com/schlegelp/navis-mousebrains).
# Copyright (C) 2024 Philipp Schlegel
#
# 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, e... |
87450ff27fc886cb66b179097269372c93cbfc0939373b1ae1467032e98caab3 | Python | 710 | 23 | """Tests classes in pid_names"""
import unittest
from aind_data_schema_models.pid_names import PIDName
from aind_data_schema_models.registries import Registry
class TestPidNames(unittest.TestCase):
"""Tests classes in pid_names module"""
def test_instantiate(self):
"""Tests that both classes can be... |
8618bce92c528985bf83c110b8c23cd4448a2159245872224a9aef4719269c67 | Python | 743 | 28 | """Tests classes in organizations module"""
import unittest
from aind_data_schema_models.organizations import Organization
class TestOrganization(unittest.TestCase):
"""Tests methods in Organization class"""
def test_name_map(self):
"""Tests Organization name_map property"""
self.assertEqu... |
96638e6da9b2bff0332e748a17c9e284437e7680516ecd7e24a6f8a574fecbd4 | Python | 755 | 29 | import unittest
import numpy as np
import numpy.testing as npt
from sigpy import wavelet
if __name__ == "__main__":
unittest.main()
class TestWavelet(unittest.TestCase):
def test_fwt(self):
n = 8
input = np.zeros(n, dtype=np.float32)
input[0] = 1
npt.assert_allclose(
... |
7ca7da1272e6f37d236c99267e3588b87ca1cf254e48cf783412365404bb98de | Python | 765 | 23 | import pandas as pd
from rdkit import Chem
from rdkit.Chem import AllChem, Descriptors
import joblib
import tensorflow as tf
from keras.layers import TFSMLayer
# Load models and preprocessing steps
nn_model = TFSMLayer('multi_tasking_model_converted', call_endpoint='serving_default')
scaler = joblib.load('sca... |
4e8496306c008511fdd8823d8c8bc1226ac4ab81d95ebc6b250c0459001b93c4 | Python | 775 | 22 | """Registries"""
from enum import Enum
class Registry(str, Enum):
"""Registries"""
ADDGENE = "Addgene (ADDGENE)"
WBLS = "C. elegans Development Ontology (WBLS)"
DOI = "Digital Object Identifier (DOI)"
FBDV = "Drosophila Development (FBDV)"
EMAPA = "Edinburgh Mouse Atlas Project (EMAPA)"
... |
c1a0fbad7ab351f3d063f4a38924bd7c6625e7483096cddae76e51834968c01a | Python | 778 | 18 | from seuronbot import SeuronBot
from bot_utils import replyto, extract_command
from airflow_api import set_is_paused
@SeuronBot.on_message(["enable heartbeat check", "disable heartbeat check"],
description="Enable/disable heartbeat check, workers not sending heartbeats will be shutdown if heartb... |
f0f1ad18ce62e70df30330f0a165de6d96d1216df0a2ee73bf541b6c30906853 | Python | 781 | 33 | """
Methods for Diffusion MRI.
Author: Zhengguo Tan <zhengguo.tan@gmail.com>
"""
# %%
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# %% Convert Cartesian coordinates to polar coordinates
def cartes2polar(x, y, z):
r = np.sqrt(x**2 + y**2 + z**2)
theta = np.arccos... |
ff2f13e7596504724259561a72d5a120d286e997aa7ec4fb4fa011a07f080acf | Python | 792 | 28 | import unittest
import numpy as np
import numpy.testing as npt
import sigpy as sp
from sigpy.mri import dcf, samp
if __name__ == "__main__":
unittest.main()
class TestApp(unittest.TestCase):
def shepp_logan_setup(self):
img_shape = [16, 16]
coord_shape = [int(16 * np.pi), 16, 2]
im... |
24097011da77051006da8809069215575e71492764bfbc7e631cf00c164b4ab7 | Python | 801 | 26 | """
Helper functions to download NeuroImaging datasets
"""
import gzip
__version__ = '2.1.2'
from .atlas import (fetch_atlas,summarize_data)
from .flatmap import (vol_to_surf,
save_colorbar,
plot)
from .reslice import (reslice_image,
reslice_img)
from .... |
ea0e3f746adc70a27ec47a4f72f203fba942c4fad115d2dfb5195cd723f19dfa | Python | 813 | 25 | """Module for pidname definitions"""
from typing import Optional, Union
from pydantic import BaseModel, ConfigDict, Field
from aind_data_schema_models.registries import Registry
class BaseName(BaseModel):
"""A simple model associating a name with an abbreviation"""
model_config = ConfigDict(extra="forbid",... |
ff6295e4d6b8e98dae3a92913dd546863b51518e078b829c1e367f77fafe4461 | Python | 820 | 24 | from seuronbot import SeuronBot
from bot_utils import replyto, download_file
from bot_info import broker_url
from kombu_helper import drain_messages
from airflow_api import set_variable, run_dag
@SeuronBot.on_message(["run igneous task", "run igneous tasks"],
description="Run igneous tasks define... |
80812d7df30ee157b18e67122b42e17bf189c4241e5f5e290726b1d9acfccbd0 | Python | 836 | 26 | """Integration test for GenBank data retrieval and parsing."""
import sys
from aind_data_schema_models.gene import Gene
def main():
"""Main function to test GenBank integration"""
accession_id = "LN515608"
try:
nucleotide = Gene.from_genbank_accession_id(accession_id)
except Exception as e:
... |
0d0d8394d3c207701c39eb8f01f8ad59d03acd77dfa1a435fff04ec73181fe24 | Python | 846 | 41 | # -*- coding: utf-8 -*-
"""MRI RF utilities.
"""
import numpy as np
__all__ = ["dinf"]
def dinf(d1=0.01, d2=0.01):
"""Calculate D infinity for a linear phase filter.
Args:
d1 (float): passband ripple level in M0**-1.
d2 (float): stopband ripple level in M0**-1.
Returns:
float: ... |
a7b05b2714d35b384f70028c7ed4709a458ff38e7493df4d1e9b43033483a878 | Python | 857 | 34 | """Validate a params JSON file against a params JSON schema."""
import argparse
import json
from pathlib import Path
import jsonschema
here = Path(__file__).parent.parent / "pipeline"
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--params",
type=Path,
default=here / "defaul... |
f38bc30ba3e29ea07dee50aec10de3c0df03b9b44a8a2b7f3c7afd2dd154e7ab | Python | 857 | 34 | import unittest
import numpy as np
import numpy.testing as npt
import sigpy.mri.rf as rf
if __name__ == "__main__":
unittest.main()
class TestSim(unittest.TestCase):
def test_abrm(self):
# also provides testing of SLR excitation. Check ex profile sim.
tb = 8
N = 128
d1 = 0.... |
b251603f964fc9478b2ae80fb00c6d67439dd9d2b3dcc1206e0ce1411a34c0fa | Python | 858 | 27 | """
MkDocs build hook — copies .ipynb files into docs/notebooks/ before each build.
Uses absolute paths derived from mkdocs.yml location so it works in CI too.
docs/notebooks/ is gitignored (build artefact).
"""
import shutil
import os
import glob
def on_pre_build(config):
# Base directory = folder containing mkd... |
b4ab527b200ae85b2a0903c7f588b2406c02d5690b6d503c1b6fdfdf5fb4f202 | Python | 861 | 28 | """Script was used to update the test data in test_extract.rs
"""
import os
import shutil
import pandas as pd
if __name__ == '__main__':
files = [
"tests/resources/bc_anchored_10_reads.sorted.methylprofile_ignoreh.tsv",
"tests/resources/bc_anchored_10_reads.sorted.methylprofile.tsv",
"test... |
d9a2e3feedfa82f4a2ddf3388880b96ccc4ae5d3cf28f8b88f01bd459731ccee | Python | 881 | 26 | """Integration test for MouseAnatomy model EMAPA lookup."""
import sys
from aind_data_schema_models.mouse_anatomy import MouseAnatomy
def main():
"""Main function to test MouseAnatomy integration"""
try:
# This will trigger a real call to the EMAPA database
heart = MouseAnatomy.HEART
... |
e56067d155cf466000bfe6b84f348c6495f9045001d4384755a707bcd56bbc1f | Python | 900 | 37 | import unittest
import numpy as np
import numpy.testing as npt
from sigpy.mri import sim
if __name__ == '__main__':
unittest.main()
class TestSim(unittest.TestCase):
def test_multi_gradient_echoes(self):
# echo time
TE0 = 1.70
ESP = 1.52
N_eco = 35
TE = (TE0 + np.ar... |
802c150d294f3418a67e2cbd2ddf01caceb0e2b20d1f5c749931b9399ec661f8 | Python | 908 | 35 | """
Storage is a multithreaded key-value object
management client that supports GET, PUT, DELETE,
and LIST operations.
It can support any key-value storage system and
currently supports local filesystem, Google Cloud Storage,
and Amazon S3 interfaces.
Single threaded, Python (preemptive) threads and
green (cooperat... |
93af5a8cb9b5ce734b0b59108653d042c338fef95edb27b0cf9f75377a7fb9d5 | Python | 910 | 25 | from setuptools import setup
with open('README.md', 'r') as fp:
long_description = fp.read()
setup(
name='ndtest',
version='0.1',
description='Multi-dimensional statistical tests with python, including the 2D Kolmogorov–Smirnov test and energy distance statistics.',
long_description=long_descripti... |
b68f1545c13d9bec347c5c3c37f1e582b64f573c26ac86bfa66adb8d0bb39f6e | Python | 919 | 29 | # test flatmap
"""
test for normalization module
@author: jdiedrichsen
"""
import SUITPy as suit
import nibabel as nb
def test_normalize():
T1_file = 'docs/source/tutorials/sub-ex_T1w.nii.gz'
mask_file = 'docs/source/tutorials/sub-ex_T1w_cerebellum_dseg.nii.gz'
suit.normalize(T1_file,mask_file,space='MNIS... |
12418d0c4bffab94bc2a37446ebb8c5febfbeee99788ed66d19ac13d5bd5ab67 | Python | 925 | 35 | #!/usr/bin/env python3
"""Launch the AIND Ephys Pipeline Parameter Editor webapp.
Can be run from anywhere — it automatically serves from the repository root.
Works on all platforms (Linux, macOS, Windows).
Usage:
python params_app/serve.py [PORT]
"""
import http.server
import os
import sys
import webbrowser
PO... |
dca562453f3ab4807b407c0e51bb6e5a8417553a651fc3f77efc8fda35c5c1ed | Python | 929 | 37 | import pytest
import os
import numpy as np
import cloudvolume
@pytest.fixture
def asrc():
test_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.join(test_dir, "test_precomputed_annotation")
return cloudvolume.from_cloudpath("file://" + test_dir)
def test_annotation(asrc):
assert asrc.met... |
36d55791931c7bec118280e6a1b90ea3668717163dfffc5bd21be99d94ee4d2d | Python | 935 | 29 | from distutils.core import setup
from setuptools import find_packages
with open("requirements.txt") as f:
requirements = f.read().splitlines()
setup(
name="bruoise",
version="0.1.1",
author="Vilim Stih, Emanuele Paoli, Diego Asua, You Kure Wu, Nathan van Beelen @ Portugueslab",
author_email="vilim... |
3edba65aa84e5dda20b33d1b3f978229442644d9b350703a2993bc2631957104 | Python | 937 | 27 | """Tests classes in protocols module"""
import unittest
from aind_data_schema_models.protocols import Protocols
class TestProtocols(unittest.TestCase):
"""Tests methods in Protocols class"""
def test_from_doi(self):
"""Tests protocol can be constructed from DOI"""
# Use a known DOI from the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.