sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
492eb98ede2b908d1e2dd52d97f80cd55e0b4bded7a083bb4cb59ae0e95833dd
Python
38,417
934
# Copyright (c) MONAI Consortium # 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, so...
f2fcd0e65ad8805029992ded7f3d79cbd8ca167c9ef2434fad7e4c04f5e5d055
Python
38,426
974
# --- 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 Marker(_BaseTraceHierarchyType): _parent_path_str = "scatterternary" _pat...
d39896572e64f90d2f688cbeb37f26f8a141c2056970f422d0121f27e5e35a3c
Python
38,428
910
""" Volume Class creation Courtesy of Timothé Boutelier. """ import nibabel as nib import pydicom import numpy as np import warnings import logging from slice import Slice import os # create the logger of this module logger = logging.getLogger(__name__) # redirect warnings to the logging system logging.captureWarning...
87830bd2e527e52af4a9ef5864d7cd456424f5a9471177e095209b429c46ed3e
Python
38,431
737
import torch import numpy as np import pandas as pd import scipy.stats as stats import sys import os import time from collections import OrderedDict sys.path.insert(1, os.path.dirname(__file__)) import genotypeio, eigenmt from core import * def calculate_cis_nominal(genotypes_t, phenotype_t, residualizer=None): ...
50e7be9f1d0f4ddd3dab9b24fba3e049d1eff83ed7a9b8594a7e41a62df68d6e
Python
38,436
748
import numpy as np from scipy import stats import itertools from utils_mutual_info import shuffle_activity import matplotlib.pyplot as plt import os from matplotlib.backends.backend_pdf import PdfPages from tqdm import tqdm import sklearn import scikit_posthocs as sp import utils_linclab_plot from utils_analysis import...
6e9d3c19ce1c96f9c9dbe679e3e781fc6f0a533e581e7f0290ad98ff57ebb5e0
Python
38,461
1,144
"""Projection and Prediction Heads for Self-supervised Learning""" # Copyright (c) 2021. Lightly AG and its affiliates. # All Rights Reserved from typing import List, Optional, Sequence, Tuple, Union import torch import torch.nn as nn from torch import Tensor from lightly.models import utils class ProjectionHead(...
2cc2455dc35a1a45b5c6e34ff17f9bfb62ee9d2a97d453f80024577c292f1398
Python
38,470
862
import numpy as np import pandas as pd import time """ This modules defines both Session/MultiSession and Analysis/MultiAnalysis classes, which handle combined fiber photometry and behavioral data analysis. """ import os import matplotlib.pyplot as plt from scipy import integrate, stats import seaborn as sns from typi...
30055dbdb18b67fa92f612948f1c07922a1d0c4603d9e69ea2f2e05493db581e
Python
38,544
853
import os from mirp.extract_features_and_images import extract_features from mirp.settings.generic import SettingsClass from mirp.settings.transformation_parameters import ImageTransformationSettingsClass from mirp.settings.feature_parameters import FeatureExtractionSettingsClass from mirp.settings.resegmentation_para...
9ca7dc49e6bae97b2a79bb82c46fa48404fe00090056426bc802b809cc3395de
Python
38,576
1,016
""" File format detector """ import bz2 import gzip import io import logging import os import re import shutil import struct import tempfile import zipfile from collections.abc import ( Callable, Iterable, Iterator, ) from functools import partial from typing import ( IO, NamedTuple, TYPE_CHECK...
81cf18053abb20734f35317c7c02f52483a3104bee83fcd7bb4d8f94d46dc948
Python
38,605
1,101
# adapted from https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/transforms/transform.py import inspect import pprint import sys from abc import ABCMeta, abstractmethod from typing import Any, Callable, List, Optional, TypeVar import numpy as np from PIL import Image import torch import torch...
ce993a45912d4b2711b1ec26c572d82ece902138d34026175e4f8b0ac957289d
Python
38,637
945
"""r71 A -- the witness-strip class, closed comprehensively (machine-checked immunizer). The agreed r71 invariant (deletion-closure): Every replay-structure item that can affect a faithfulness verdict creates a typed, independently derived OBLIGATION, anchored to structure the replay itself consumes. Each...
e28a4e58c5610359005b761bc0dbdfc9009403766bae2907f399a2e53e3e471d
Python
38,684
904
# ----------------------------------------------------------------------------------- # SwinIR: Image Restoration Using Swin Transformer, https://arxiv.org/abs/2108.10257 # Originally Written by Ze Liu, Modified by Jingyun Liang. # ----------------------------------------------------------------------------------- # p...
6363abeb36e60fe6cb9230251fa4fdaf15014df4a80b5967fc775f7a6ef79247
Python
38,687
985
""" logreg_plots.py This script contains functions to create plots for logistic regression analyses and results (logreg.py) from dictionaries, dataframes and stored models. Authors: Colleen Gillon Date: October, 2018 Note: this code uses python 3.7. """ import warnings from pathlib import Path import numpy as np...
6849c0624a50f243dbf42bb85a457ae0fe2a2137c323ddd8dfc45ae7e0ebdaad
Python
38,709
786
# 2022/2023 Josue Page Vizcaino pv.josue@gmail.com # Third party libraries imports import matplotlib.pyplot as plt import numpy as np import torch from torch.functional import split import torch.nn as nn import torch.nn.functional as F import pathlib, glob, re import FrEIA.framework as Ff import FrEIA.modules as Fm fro...
7702586d98f8758f4cbca088f927cae3251ab6a56aefbb95c8f91cc56e0a1bf2
Python
38,710
1,050
import datetime import json from collections.abc import Callable from concurrent.futures import TimeoutError from functools import lru_cache from pathlib import Path from typing import ( Any, ) from urllib.parse import urlparse from celery import current_task from sqlalchemy import ( and_, create_engine, ...
73a90536c2299c4597a499ea580b61d0df130558304064e85c1f5e7c40ce3bde
Python
38,718
985
"""M4: standalone unit suite for the _trace_core substrate. Zero production consumers yet — these tests prove the substrate honors the converged semantic contracts (docs/reference/trace_core_design.md section 3.2/3.5) before the M5 Op seam, including executable prototypes of every hard seam: pool injectivity, parallel...
35b121dcecf8e01c5aefc39ade076c34790ecd2f9ab15cf5765cb939153ff9d8
Python
38,721
1,184
# coding=utf-8 """ Contains an abstract base class that supports data transformations. """ from __future__ import division from __future__ import unicode_literals import os import numpy as np import scipy import scipy.ndimage import time import dcCustom as dc import tensorflow as tf from dcCustom.data import NumpyDat...
5348e54ba647c4c4412eb41319a1775f24a90d34ea2edf405298bd167c440015
Python
38,724
1,015
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> """Pre-processing operations based on NDVars""" import warnings from copy import deepcopy import fnmatch from itertools import chain import logging from os import makedirs, remove from os.path import basename, dirname, exists, getmtime, join, splitext from typing...
3282f3f1ee9bf673e38a7a00a2b812218864a8b5023238e3b60b63bf3a6b0316
Python
38,745
821
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
21a86fd0b96a86584b248671fef546bd0e96d764de0cb7ae73b587809a126365
Python
38,750
986
# SOURCE: vendored from kevinzakka/recurrent-visual-attention @ master (model.py, modules.py) # SOURCE: vendored from mperezcarrasco/PyTorch-DAGMM @ master (model.py) # SOURCE: vendored from RomainSabathe/dagmm @ master # (model.py, compression_networks.py, estimation_networks.py, gmm.py) # SOURCE: vendored from Dmitry...
b4dce888e3e982410c82e06a3e5408efa3732bf7021eefba2d47982d28003a09
Python
38,750
603
import os import subprocess from subprocess import PIPE from random import randint import numpy as np def run_langevin1D(simulation_steps, analytical_function = "7*x^4-23*x^2", periodic= "NO", initial_position=0.0, temperature=1, time_step=0.005, grid_min=-3.0,...
45663ab1afec6c4be7bede0567f24fc60f8696b3e945096fd3fa1a7c42b7ed03
Python
38,779
790
import copy import dataclasses import functools import json import os import re import shutil import struct import sys import textwrap import threading import types from datetime import datetime, timezone from pathlib import Path import geopandas as gpd import pandas as pd from geopandas.testing import assert_geodataf...
9e54fa02ff17effb0d0b7e65a814010abc64dc04e1ae3e2e9a775870f5ee6a65
Python
38,787
1,245
# SOURCE: vendored from KalmanNet/KalmanNet_TSP @ main (KNet/KalmanNet_nn.py); # vendored from nicofarr/brainnetcnnVis_pytorch @ master (BrainNetCnnGoldMSI.py); # vendored from CBICA/BrainMaGe @ master (BrainMaGe/models/networks.py, # BrainMaGe/models/seg_modules.py); # vendored from nabeelre/BTSbot @ main (btsbot/arch...
4d10b50db18225fd9f77c913a5c5c6b772ce402e73f7e556aa2651bced70d6b6
Python
38,817
1,079
import builtins import contextlib import functools import os import ml_dtypes import numpy as np import torch from torch.distributed.tensor import DTensor from torch.distributed.tensor import Replicate from keras.src import tree from keras.src.backend.common import KerasVariable from keras.src.backend.common import g...
8ccf1e0ebc40cb1432e646c185177394f209a2961c3d7dc58954401c817902a7
Python
38,821
1,043
# Copyright (c) 2022 PaddlePaddle Authors. 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 app...
c08525843a8215cfa63793bb2ebf6836eabec38adb2b64a11b593b080fdd4bc1
Python
38,865
824
''' 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...
705aeeadb458d8e4f6cc16f3711ae3d4c203ce65262ffccf9e63328184b5f5cd
Python
38,888
871
"""SSD predefined models.""" from __future__ import absolute_import import warnings from .ssd import get_ssd from .anchor import LiteAnchorGenerator from .vgg_atrous import vgg16_atrous_300, vgg16_atrous_512 from ...data import VOCDetection __all__ = ['ssd_300_vgg16_atrous_voc', 'ssd_300_vgg16_atrous_coco'...
60aac31e4c3a10e4f41fbb1884acd10fa9e57a5da0eb0a67616f9e959be6b16f
Python
38,904
872
"""SSD predefined models.""" from __future__ import absolute_import import warnings from gluoncv.data import VOCDetection from .ssd import get_ssd from ..ssd.anchor import LiteAnchorGenerator from ..ssd.vgg_atrous import vgg16_atrous_300, vgg16_atrous_512 __all__ = ['ssd_300_vgg16_atrous_voc', 'ssd_300_vg...
480f157191f7f5977afcc76e9b801fa3fc6c6c1158748ca0905a74ec647169fa
Python
38,936
1,028
import os import warnings import numpy as np import pytest from absl.testing import parameterized from keras.src import applications from keras.src import backend from keras.src import layers from keras.src import ops from keras.src import saving from keras.src import testing from keras.src.backend.common import stan...
17eff24b60c8ff428801d1dab205f13d414161087dd29dadcedec2573be38148
Python
38,943
833
__version__ = '0.7.2' from typing import List, Optional, Tuple import torch import torch.nn as nn # FROM https://github.com/JeppeHallgren/pytorch-crf/blob/master/torchcrf/__init__.py class CRF(nn.Module): """Conditional random field. This module implements a conditional random field [LMP01]_. The forward co...
04b6498688db99046b5d2a150251f43e6c52421e0d1bb1d67886252e60baaed1
Python
38,972
900
from plot_utils_AUD import * np.random.seed(0) random.seed(0) ### Directories ### date = datetime.datetime.now().strftime("%m%d%Y") DATADIR = (Path(os.getcwd()) / '..' / '..' / 'data').resolve() RESULTDIR_LOCAL = (Path(os.getcwd()) / '..' / '..' / 'results').resolve() PLOTSURFDIR = Path(f'{ROOT}/results/PLOTS_SURF_acr...
c71c6ff06167c9a2d6e0ac7c65f9d03c0335baff681b9d5c0e6f1bfad8a34642
Python
38,998
866
# Copyright (c) 2023, Tri Dao. import sys import functools import importlib.util import warnings import os import re import ast import glob import shutil import tempfile from pathlib import Path from typing import Literal, Optional from packaging.version import parse, Version import platform from setuptools import se...
8e6e872f9a79a1b9428b5673d83201d370fcf82b31d5b9aef0e780be6ef6bc3e
Python
39,020
994
"""Unit tests for internal algorithms and invariants. Tests here cover internal implementation details that aren't exercised through the public API integration tests: field ordering, data structure invariants, algorithm correctness, etc. """ from collections import defaultdict import pytest import torch import torch...
86bc93b0bbd64a625a9e511a74ddfbb6c752cc4761db078121cbaf171c9701e9
Python
39,035
886
from typing import Optional, Union import numpy as np import pandas as pd from anndata import AnnData from pyvista import MultiBlock, PolyData, UnstructuredGrid from ....tdr import add_model_labels, collect_models from .three_dims_plots import three_d_multi_plot, three_d_plot try: from typing import Literal exce...
e447b8966fdbf4a42b382a9f6b3f92f38a7971be0f9e2b8a201ad95db9d01005
Python
39,068
826
import math from matplotlib import cm from matplotlib.colorbar import ColorbarBase from matplotlib.colors import Normalize from mpl_toolkits.axes_grid1 import make_axes_locatable from mpl_toolkits.mplot3d import Axes3D import argparse import glob import os from collections import defaultdict from platform import machi...
e3d9e67d1ec2bc61e4dec5591b46072f1b86ca7a185bd5dac7ec5e3cdce0933a
Python
39,103
842
# Copyright (c) 2024, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao. import sys import warnings import os import stat import re import shutil import ast from pathlib import Path from packaging.version import parse, Version import platform import sysconfig import tarfile import itertool...
84c5dd0b7010e9d2f64e925369ac3cb8e55ac65cee4f1079fabfb3f67663518b
Python
39,108
858
#!/usr/bin/env python3 """ File: fast_interaction_mapper.py Created: 2021/11/16 Last Changed: 2022/03/22 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 this ...
90e50ed5346b927d7265e5a991e2d58b8c42935eef0f76484c70dfffab941198
Python
39,125
998
import io from unittest import mock import os from carbontracker import exceptions from pyfakefs import fake_filesystem_unittest from carbontracker import parser from carbontracker.parser import ( extract_measurements, parse_logs, print_aggregate, get_stats, parse_equivalents, ) class TestParser(...
b02794c65d2375b96cdfe9c0fc90979ea8b94c19059698f47742f4be7c4f21a6
Python
39,139
1,057
"""Tests for representation-geometry numeric helpers.""" from __future__ import annotations import importlib import re import subprocess import sys import warnings from pathlib import Path from typing import Any import numpy as np import pytest import torch from PIL import Image, ImageDraw from torch import nn impo...
78a230a7c0c4414c3a64ca4b88fe0ff42fe9c5b1a4ac5230f272484959792d64
Python
39,150
1,038
"""Streaming bundle writer used during forward-pass out capture. This module implements the strict streaming writer behind ``trace(storage=tl.to_disk(...))``. It writes one safetensors blob per saved out into a temporary bundle during the forward pass, then finalizes ``manifest.json`` and ``metadata.pkl`` at postproce...
f3e95e2dcb9af2932b73ef23a0501f938051b858eaf9f5af2a484dbe931b416a
Python
39,156
1,209
import errno import os import re import signal import subprocess import sys import tempfile import time from unittest.mock import Mock, call, patch import pytest import t.skip from celery import _find_option_with_arg, platforms from celery.exceptions import SecurityError, SecurityWarning from celery.platforms import ...
82fa87d6e5b398abfac163ee1efb745305da251ce70d4ae9c5450a0d123d58d6
Python
39,164
1,149
""" corr_analys.py This script contains functions for USI correlation analysis. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import copy import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression import scipy.ndimage as scind from util import gen_...
a45d500eba88507a54483bf6b43e91fddfed273f7ad01469f3210b68264fd490
Python
39,197
948
# 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...
dd8fe797228cdb1ff2f29e7e017bdf427de894ca8f2d371e8b246cf39452ba34
Python
39,200
824
#!/usr/bin/env python3 """plot_aggregation.py Top level command-line interface for generating plots related to the aggregation, i.e., applying the LSS to rough / fine alignments. Copyright (C) 2018-2026 Max Planck Institute for Neurobiology of Behavior This program is free software: you can redistribute it and/or ...
b84b4e5f5fd926456cd00710ddcd7100e35054825dd9ae2e30b2e8e6b5053726
Python
39,265
1,148
############################################# # This file contains scripts to perform the # # Convolutional Oligo Kernel Network # # experiments. # # # # Author: Jonas Ditz # ############################################...
c2ce835eb719dd12a900a58e1823e1fd8c54358803bc9c32b6f8bfc861ef9217
Python
39,277
836
__version__ = '0.7.2' from typing import List, Optional, Tuple import torch import torch.nn as nn # FROM https://github.com/JeppeHallgren/pytorch-crf/blob/master/torchcrf/__init__.py class CRF(nn.Module): """Conditional random field. This module implements a conditional random field [LMP01]_. The forward co...
49e4194936f2f3bbf22251a5e5c529702eb35f2cd69092fe99b7480f6cc1843b
Python
39,293
998
import os import time import math import numpy as np import pandas as pd import pickle as pkl import nibabel as nib from os.path import join as pjoin from scipy.stats import pearsonr, permutation_test from scipy.optimize import curve_fit from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_s...
4dee42308724e3a87e67daf58382cc988876cff4d443eba4b08e7563419094d7
Python
39,302
1,001
import copy import inspect import typing import warnings from keras.src import backend from keras.src import ops from keras.src import tree from keras.src.backend.common import get_keras_mask from keras.src.backend.common import global_state from keras.src.backend.common import set_keras_mask from keras.src.layers.cor...
b32bb9247ab029bad1f9798a06d65d8a4b55b0cba1a8b5e18462bbb169af6cd4
Python
39,306
912
""" quant_analys.py This module contains functions to run quantile analyses on data generated by the Allen Institute OpenScope experiments for the Credit Assignment Project. Authors: Colleen Gillon Date: October, 2018 Note: this code uses python 3.7. """ import copy import warnings import numpy as np import pan...
0b5aba529ab933cd18b748ddcd0cfbec84577f7f442b6afff1eeacf583a61bf3
Python
39,382
869
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import math from collections import Counter, defaultdict from functools import lru_cache from typing import Any import cv2 import numpy as np import torch from ultralytics import YOLO from ultralytics.solutions.co...
eb24161c3db36f345e888110f5ee16db520b8399497a17853e8241722d940265
Python
39,398
1,001
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 7 22:07:39 2021 @author: emilia """ import random import numpy as np import torch from torch import nn, optim import pickle import os from scipy.ndimage import gaussian_filter1d from scipy.io import savemat from src.generate_data_von_mises import c...
7344b808aa4eb6ebc5c48ab821485e32feea1397a14a540433191e08895d9c33
Python
39,401
1,090
# Copyright (c) 2025, Tri Dao. import math import hashlib import inspect import os from functools import partial from typing import Type, Callable, Optional, Tuple, overload, NamedTuple import cutlass import cutlass.cute as cute from cutlass import Float32, Int32, const_expr from cutlass.cute import FastDivmodDiviso...
62586a5f09971186280cb9b65abe04508dec46714387193bc4fb61f7a4e155eb
Python
39,402
936
""" Galaxy FilesSource implementation for eLabFTW. This module implements a FilesSource that interacts with an eLabFTW [1] instance. eLabFTW revolves around the concepts of *experiment* [2] and *resource* [3]. Experiments and resources can have files attached to them. To get a quick overview, try out the live demo [4]...
610436c692e9dac58e7fca36657c1821715acdab8d01992c1a38b23fcd6ae408
Python
39,428
754
from typing import Any from dataclasses import dataclass from mirp.settings.utilities import setting_def @dataclass class FeatureExtractionSettingsClass: """ Parameters related to feature computation. Many are conditional on the type of features that will be computed ( ``base_feature_families``). Features...
5a633e1e14af0efb666cd802a14d4be418413723dccc74d7b696f25e23316421
Python
39,432
1,029
import gc import logging import platform import time from datetime import datetime, timedelta, timezone from uuid import uuid4 import billiard as multiprocessing import pytest import celery from celery import chain, chord, group from celery.canvas import StampingVisitor from celery.signals import before_task_publish,...
6c0d43430827b6ec0516bc98a14d64f71feb0ffa5535fb46298d9befe3bc31c6
Python
39,471
1,026
#!/usr/bin/env python import os import sys import pandas as pd import argparse import configparser import multiprocessing import time import datetime from sqlalchemy import create_engine from sqlalchemy.pool import NullPool import tqdm import statsmodels.stats.multitest as multitest import snps import genes import int...
d76370138c855e8587ad6ae7d84dbeee08c30950322b346a573f212ed2966f9d
Python
39,476
1,135
#!/usr/bin/env python3 import argparse import matplotlib import matplotlib.pyplot as plt import scipy import scipy.stats import numpy as np import pandas as pd import math import os import pints import pints.plot import regex as re import uuid from numba import njit import subprocess import sys import datetime import ...
0e85798f381ee7ab3f3aa7a6acdfe8326a048ff6c342eb0e03191d2127d119b7
Python
39,484
1,168
""" roi_plots.py This script contains functions for plotting ROI masks and projections. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import itertools import numpy as np import matplotlib as mpl import matplotlib.patches as mpatches from util import gen_util, logger_util, plot_u...
cd2993572f715157422d2cb40e3139fd57d0bf07b1ddbabd51ec152f2f6c796c
Python
39,533
827
''' 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...
cf5df9f2972be7cad9878df7ea321804617d769f47823984abbe0a9b1cbc460b
Python
39,534
1,014
from __future__ import annotations import collections.abc as cabc import logging import os import sys import typing as t from datetime import timedelta from itertools import chain from werkzeug.exceptions import Aborter from werkzeug.exceptions import BadRequest from werkzeug.exceptions import BadRequestKeyError from...
dab89f724fb9d53e9bed776426e1cf48bb7661a9f2c9a6a8548d9cc11757c476
Python
39,556
876
""" The AI page is just a different view of the calculator. It relies on the same modules. The page itself is defined as a `DashBlueprint` that encompasses both layout and callbacks. Contrary to the Home page, the AI page requires more intermediate processing to obtain the metrics. These are due to the continuous inf...
2281f90fdacd47968aa92ef37416f5638294cceb0e1e7741ac68448ce3a766eb
Python
39,557
1,056
"""Rescue-rerun mechanism tests (stage-2 safety net). The outcome corpus (``test_detached_reference_capture_outcomes.py``) pins per-escape-class outcomes; THIS module pins the driver mechanics: the net is never armed on a clean primary capture, ineligible captures skip the rescue, RNG is restored to capture entry so s...
ffa9e4955cf91dbf795c4379d30b10c2f95959f216669f0adabb83551b6a57c8
Python
39,562
971
import torch from torch import Tensor import torch.nn.functional as F from torch.nn import Sequential, Linear, ReLU, BatchNorm1d import torch_geometric from torch_geometric.nn import ( Set2Set, global_mean_pool, global_add_pool, global_max_pool, MetaLayer, GCNConv, CGConv, ) from torch_scatt...
05c27d7c227ec47a4a3395ff5afa80120dd4aaca64861ef5f4b578b0e42e49c2
Python
39,640
946
"""Job control via the HTCondor DRM using the htcondor2 Python API. See the Galaxy cluster documentation (doc/source/admin/cluster.md) for configuration, architecture details, and testing instructions. """ import json import logging import os import select import shlex import subprocess import sys import threading fr...
5ee0930dccaceeab5671eb9f34533b8ebb49129586d0d23fe1cf9b54574169a3
Python
39,644
1,313
# -*- coding: utf-8 -*- """ Created on Thu Oct 26 11:22:48 2023 @author: LABadmin """ import numpy as np from matplotlib import pyplot as plt import matplotlib as mpl import random import sklearn import scipy as sp import matplotlib.ticker as mtick import matplotlib as mpl from matplotlib.colors import L...
2aecb339b88eae0c17d78ea6ecf7c13ba0b10c5ab52727a12af98d6490784a15
Python
39,660
927
"""CenterNet object detector: Objects as Points, https://arxiv.org/abs/1904.07850""" from __future__ import absolute_import import os import warnings from collections import OrderedDict import mxnet as mx from mxnet.gluon import nn from mxnet import autograd from ...nn.coder import CenterNetDecoder __all__ = ['Cente...
43eb5f33c7a7836904beac50dec06adc19d2c503b43f43f639483ce92eac06b1
Python
39,713
1,165
""" The dataset manager app. Lists the datasets in the workspace and drives their processing, annotation and deletion. """ from __future__ import annotations from html import escape from pathlib import Path import pandas as pd import panel as pn from larvaworld.lib.process.dataset import LarvaDataset from larvawor...
108dd9632a00f5e7bfac11a04944102dee7cdd85c148f80a18d18596a9bb7fb7
Python
39,743
947
"""Worker Consumer Blueprint. This module contains the components responsible for consuming messages from the broker, processing the messages and keeping the broker connections up and running. """ import errno import logging import os import warnings from collections import defaultdict, deque from time import sleep f...
a95eb3eb1c59b6d4e48e093c22a5cedccdff1521854be6159f176eb1bf8679bd
Python
39,782
1,108
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Legend(_BaseLayoutHierarchyType): _parent_path_str = "layout" _path_str...
a6412791d0fda01e2315eda74fd721667c72784fc7ab1b7dde65380aaf1f617f
Python
39,808
997
import math import string import numpy as np from keras.src import backend from keras.src import constraints from keras.src import initializers from keras.src import regularizers from keras.src.api_export import keras_export from keras.src.backend.common import get_keras_mask from keras.src.backend.common import set_...
f0d3c9d2a77e66d4e43a47684ae309be8a0aeec6bea3bfbe9fb47558cd3bf84f
Python
39,843
1,170
"""Tests for Phase 11 unified ``.tlspec`` writer and reader behavior.""" from __future__ import annotations import json import re import warnings from collections.abc import Callable from pathlib import Path from types import SimpleNamespace from typing import Any import pytest import torch from torch import nn imp...
74daadf8bbf23c70e28371b0f73d821e8ef8213d1474263dd6a53216ba2e8acc
Python
39,849
854
#!/usr/bin/env python3 import os os.system('date') """run_tear_convert.py Convert a downloaded webknossos tear annotation file into stored dills. and preprocess tear annotations into format required for the tear fixing. Copyright (C) 2018-2026 Max Planck Institute for Neurobiology of Behavior This program is free...
33b969040d63002d11d059006c0e0be4979fb4e344ffaccbb53f578f7b8b1255
Python
39,884
1,110
""" seq_plots.py This script contains functions for plotting sequence analyses. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import numpy as np from util import gen_util, logger_util, plot_util, math_util from sess_util import sess_plot_util from analysis import misc_analys fro...
d528a586dd39e1dd0e18dcda62c94bf87b56f0410447e9c75046268015f040ab
Python
39,897
696
import numpy as np from typing import Any from dataclasses import dataclass from mirp.settings.utilities import setting_def @dataclass class ImagePostProcessingClass: """ Parameters related to image processing. Note that parameters concerning image perturbation / augmentation and resampling are set separ...
1e69308a8d1491858dd9cbc23498615465c913faad358e04d037e2c9ec7348de
Python
39,957
1,172
"""Base definitions for R objects.""" import abc import collections.abc from collections import OrderedDict import enum import itertools import typing from rpy2.rinterface_lib import embedded from rpy2.rinterface_lib import memorymanagement from rpy2.rinterface_lib import openrlib import rpy2.rinterface_lib._rinterfac...
15ca908580815879011c05f6b9bb0d00967a2e5caecbde79bbbf830a5d4a5ad3
Python
39,962
1,135
''' Tools for aligning spatial transcriptomics data The LDDMM fits (LDDMM, LDDMM_3D_to_slice, and align_cells for two sets of cells), rasterization and the transforms of fitted mappings are implemented in private modules next to this file (_lddmm*.py, _cells.py, _raster.py, _transforms.py) and exposed here. The LDDMM...
6da425130652e7b59b8ac0f520f1e070ce0ac1cccbd59f210c605816a6b512cd
Python
39,986
1,181
"""Task results/state and results for groups of tasks.""" import datetime import time import types from collections import deque from contextlib import contextmanager from weakref import proxy from dateutil.parser import isoparse from kombu.utils.objects import cached_property from vine import Thenable, barrier, prom...
a7c9e9b2f7a80f0c6145bc7fefdcecd04d2167f31bd29e353c52868f57201e25
Python
40,036
801
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 23 17:58:34 2021 @author: emilia This file contains all decoding analysis functions, including: 1) decoding of uncued stimulus colour in the post-cue delay 2) cross-temporal decoding 3) comparison of maintenance mechanisms between mode...
da5e22a12094c87bca8ddeed82d955443cbd3d6a5de068be7c185824cb9eb957
Python
40,041
1,170
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import math # import cv2 import random import numpy as np import torch import torchvision as tv import torchvision.transforms.functional as F from PIL import Image, ImageFilter from scipy.ndimage import gaus...
ad82dbeb1f7bed76b037391778eb1a040004e2e9ddb4341c4b29c05e03b6df47
Python
40,198
1,077
# --- 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 Axis(_BaseTraceHierarchyType): _parent_path_str = "indicator.gauge" _path...
d035446dcc10afe7b3b88a1278653f888c3866d56ff229bf32aaebf3d08a965e
Python
40,206
928
"""Module implementing representational similarity analysis (RSA) at the sensor level. Kriegeskorte, N., Mur, M., & Bandettini, P. A. (2008). Representational similarity analysis - connecting the branches of systems neuroscience. Frontiers in Systems Neuroscience, 2(November), 4. https://doi.org/10.3389/neuro.06.004.2...
cf4b869a12f22a52118f6d758bba340689574882dba33ea3d2c563ea04c4926d
Python
40,216
933
import glob import matplotlib.pyplot as plt import numpy as np import pickle import random from numba import jit, njit def load_HILLS(hills_name="HILLS"): """Load 1-dimensional hills data (includes time, position_x, position_y, hills_parameters Args: hills_name (str, optional): Name of hills file. D...
b93b3fd9af16a4ceb81382862af78b6217be6aa4bbfad22cfb6e7be0522bd2d8
Python
40,244
932
# Copyright (c) 2022 PaddlePaddle Authors. 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 app...
7013aa658d8b826f4719fb5ef28c10d4f27a2714f85fa00120126241280e17e5
Python
40,384
1,123
"""Unified ``.tlspec`` manifest writer helpers.""" from __future__ import annotations import contextlib import json import os import shutil import sys import uuid from collections.abc import Iterable from datetime import datetime, timezone from hashlib import sha256 from pathlib import Path from typing import Any, Li...
5df7960fdb4ef060c64f49e4b61b855752e790dcae55a69d54f11ac9e3ce7074
Python
40,482
993
#!/usr/bin/env python """ Unit tests for the unified notification manager. """ import datetime from unittest.mock import MagicMock, Mock, patch import pytest from ethoscope_node.notifications.manager import NotificationManager class TestNotificationManager: """Test cases for NotificationManager class.""" ...
4096b3ecd7a226669108082efc0e9e3ce0264d94354b33a56b833c19478a44f5
Python
40,542
1,076
from __future__ import annotations import logging import warnings from typing import Dict, List, Literal, Optional, Sequence, Union import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Distribution, Normal, kl_divergence # Import GATv2Conv with fallbac...
4fa077fb4e6e7289ecddf22cf86749183a2ebc32e550cf25e15e8bd9c6fb23bb
Python
40,575
940
""" This script implements miscellaneous functions and global variables used at page loading or when a csv is uploaded. """ import os import copy import base64 import io import yaml import pandas as pd from types import SimpleNamespace from utils.utils import check_CIcountries_df, unlist, put_value_first from bluep...
df7cdaa2dc3595906ee21727e42cf5ec1d7595a6ec8c20c0bfe8336b25946944
Python
40,583
925
# 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...
6cccd4ca7f534980927d77ad4f49cecd6e5082074fb3e38c1f408ff07cec927b
Python
40,594
949
''' tbd. ''' import sys import pickle sys.path.append('..') import gzip import os, io import numpy as np from functools import reduce import re from typing import Any, Dict, Mapping, Optional, Sequence, Tuple, List from Bio.PDB import PDBParser import helixfold.data.mmcif_parsing_paddle as mmcif_parsing from helixfold...
cee2f69ce7c462cb12a7dcef9f6ce395ad0c016e4e9bfd1a6db079cca1fbda1e
Python
40,594
1,136
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib import itertools import warnings from functools import wraps from setuptools.extern import six from setuptools.extern.six.moves import urllib, http_client, configparser, map import setupto...
7a859b14a993a78bb9049e419fadc76b21bdc29c8b542683f64e10d6ca9f0cad
Python
40,609
1,023
""" MySQL Backup Module - Low-level Database Operations This module handles the core database operations for backing up MySQL data to SQLite files. It provides the fundamental database connectivity, schema management, and data transfer functionality that powers the ethoscope backup system. Key Responsibilities: =====...
6e6eeb5e90917bd7522c46da2ab7d9327f0d3e26da47705f37fdafadcbd4d5a7
Python
40,622
894
from logging import info import os import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix from sklearn.model_selection import KFold import matplotl...
1bf8bbf204618a60458b45a857189051b97d8b4e6527a97e0dc62d48793b7ee9
Python
40,744
1,026
""" Tests for independence_tests.py. """ from __future__ import print_function import numpy as np import pytest from scipy import stats from tigramite.independence_tests.parcorr import ParCorr from tigramite.independence_tests.robust_parcorr import RobustParCorr from tigramite.independence_tests.parcorr_wls import Par...
1605333d14f5cb1b16bec9e299aaf2f07bf10ec0f076c89ff814ca7219bb86fa
Python
40,768
897
# for one people import math import ipdb import torch.nn as nn import torch import torch.optim as optim from tqdm import tqdm import matplotlib.pyplot as plt import os import argparse import datetime import numpy as np from torch.optim.lr_scheduler import StepLR from torch.utils.tensorboard import SummaryWriter from o...
93d41497e53f01a10926a1b54f4708479e8920a01eb03d9d2420915ef450d729
Python
40,776
909
from pybedtools import BedTool, Interval from pybedtools.featurefuncs import midpoint from sklearn.model_selection import train_test_split from sklearn.cluster import KMeans import torch from torch.utils.data import Dataset, TensorDataset import os import glob import subprocess import sys import pandas as pd import num...
4c3b51dbd1c3baf25eb8dda8eb3506b4a6f31da3c2038ff2fd02ea50d7ee5797
Python
40,820
1,026
# Copyright (c) 2022 PaddlePaddle Authors. 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 app...
bae445699ce326de45bf7666c8a514b8bb63c75dbff06f5120b8a019e7388ab2
Python
40,838
1,301
""" Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0...
3651153ea84a9e35cad29a48f41531d341d4a980a2c7e73985562704c305c461
Python
40,851
1,148
"""Honest detection of distributed (DTensor / device-mesh / TP / PP) model state. TorchLens captures a *rank-local eager* forward pass. Several distributed execution modes leave the model looking like an ordinary ``nn.Module`` while replacing its parameters with tensor subclasses whose real work happens under ``__torc...
75097fd54e489723275d765737b9a8872a79ac99653345c84eed5656a13b9bf6
Python
40,851
730
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Written by Yuichiro Yada #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ################################################ # The notation is different from that in the paper. # paper, this code # alpha, beta # beta, gamma # gamma, q # z, mu_Z...
f584b6a3d01802802989bbd1174039d8eb709308ca00183e527380c8a8e30ba7
Python
40,870
1,106
"""Test functions in xcp_d.utils.utils.""" import numpy as np import pandas as pd import pytest from scipy import signal, stats from xcp_d.utils import utils def test_estimate_brain_radius(ds001419_data): """Ensure that the brain radius estimation function returns the right value.""" bold_mask = ds001419_da...