sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6b097e4edf9a8c95317f09ac297a973a7fa9227edbb6468092213e3ed7b35a61
Python
34,099
934
"""Honest distributed detection: compat rows plus a typed capture refusal. Before this guard, a tensor-parallel model traced "successfully" while reporting ``0 total modules`` and ``0 params total; 0 B`` -- the ``linear`` op replaced by bare ``viewas`` nodes -- and ``tl.compat.report`` reported all-pass for the same m...
327c230252d88f291c5dbdb7bf62e66b07f69061b349a59739dcb4bb17a93499
Python
34,101
866
"""Parse GFF files into features attached to Biopython SeqRecord objects. This deals with GFF3 formatted files, a tab delimited format for storing sequence features and annotations: http://www.sequenceontology.org/gff3.shtml It will also deal with older GFF versions (GTF/GFF2): http://www.sanger.ac.uk/Software/form...
d3366f32f1f73edc24788dfd6b44eb8daf5b8fec70fd72ed3875b01e82d16c88
Python
34,110
962
# ---------------------------------------------------------------------------- # Copyright (c) 2015, The Deblur Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # --------------------------------------------------...
3499914f9ac8c0424735e49a04a5caae89e078deef1764e33e2915e643604bcd
Python
34,111
659
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Written by Yuichiro Yada #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ################################################ # A code for Fig. 2g ################################################ import numpy as np import pandas as pd import seaborn as sns import os ...
a793998b696b8abd4534ddc2ef3ab65949319b48f7d78a89d95a1db30424ae51
Python
34,150
1,068
# %% import os, glob import numpy as np import pandas as pd from tqdm import tqdm import benepar from spacy.symbols import ORTH from nltk.corpus import wordnet as wn from sklearn.dummy import DummyClassifier from sklearn.linear_model import RidgeClassifier from sklearn.model_selection import ( StratifiedGroupKFold...
0632b05c41c725d627597b352d0d6eba704dcb3ea14c30c83ddd5e55bc422442
Python
34,156
738
# Copyright (c) 2025, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao. # A reimplementation of https://github.com/Dao-AILab/flash-attention/blob/main/hopper/flash_fwd_combine_kernel.h # from Cutlass C++ to Cute-DSL. import math from typing import Callable, Type, Optional from functools im...
a33d70e336729fc03a3c2e0dc1dcacea0095e535490c4273e29445649c59968b
Python
34,162
849
# --- 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 = "scatterpolargl" _pat...
1c979a2a2bd0bc2ca5d7f65eb579ced1a6af053df642fb43fcc0b3266111a241
Python
34,173
927
import errno import socket from queue import Empty from unittest.mock import Mock import pytest from kombu.asynchronous import ERR, READ, WRITE, Hub from kombu.asynchronous.timer import Timer from kombu.exceptions import DecodeError from celery.bootsteps import CLOSE, RUN from celery.exceptions import InvalidTaskErro...
5a625cff7a023b93bbc7bf50aa030415f983c5ad2c368e3e6fa48f9b82f28313
Python
34,174
768
"""Code allowing tools to define extra files associated with an output datset.""" import abc import logging import operator import os import re from collections.abc import Callable from decimal import Decimal from tempfile import NamedTemporaryFile from typing import ( Any, Optional, TYPE_CHECKING, ) from...
05e64775d486050dc620fe07c1b35a4a63c4b5503e84f71e9e2a5f520bfe356b
Python
34,198
1,078
# LICENSE # # _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._ # # BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License"); # # - you may not use this software except in complian...
25aef1aa1deadb0089417756746de5ffcc7f2b16454186226d265a0e18fab810
Python
34,218
668
"""Train Faster-RCNN end to end.""" import argparse import os # disable autotune os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' os.environ['MXNET_GPU_MEM_POOL_TYPE'] = 'Round' os.environ['MXNET_GPU_MEM_POOL_ROUND_LINEAR_CUTOFF'] = '26' os.environ['MXNET_EXEC_BULK_EXEC_MAX_NODE_TRAIN_FWD'] = '999' os.environ['MXNET_E...
3b42fd5bcc94a999c91ede3a99350c6199cbe9cd9844f36175a367e1c02e6066
Python
34,232
798
import torch import torch.nn as nn from torch.nn import init import functools from torch.optim import lr_scheduler ############################################################################### # Helper functions ############################################################################### def init_weights(net, i...
ec32f87527dd0280cdac622fa37507103b810614821ba313223c1eb6266175d8
Python
34,239
817
#!/usr/bin/env python3 """ File: bryois_pic_replication.py Created: 2022/10/18 Last Changed: 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 source tree....
c9d20b283655836607f367975c1234440a95f611b568835013947c2dd06f01f5
Python
34,244
667
"""Train Doublehead-RCNN end to end.""" import argparse import os # disable autotune os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' os.environ['MXNET_GPU_MEM_POOL_TYPE'] = 'Round' os.environ['MXNET_GPU_MEM_POOL_ROUND_LINEAR_CUTOFF'] = '26' os.environ['MXNET_EXEC_BULK_EXEC_MAX_NODE_TRAIN_FWD'] = '999' os.environ['MXN...
43d15e39fda7d7b990572e134902e0878a2e8d3b746e202dd150483117239410
Python
34,257
896
from __future__ import absolute_import, division from tqdm.auto import tqdm import torch from torch.autograd import Variable, grad from torch.nn import Parameter import torch.nn.functional as F import numpy as np import pandas as pd import sys import random import os import math def reset(nn): def _reset(item): ...
52ffb08b0a49603dd70b43dfeb3fec05ac094b3372f9d40a44642a3f225175a2
Python
34,260
1,080
""" seq_figs.py This script contains functions defining sequence figure panel analyses. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ from util import logger_util from analysis import seq_analys, misc_analys from paper_fig_util import helper_fcts logger = logger_util.get_module...
b248e7db77bd41dfdaeebae470438773c5ff22955649ea89f97bd826cf2d2afc
Python
34,292
1,131
try: import llspy except ImportError: import os import sys thisDirectory = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(thisDirectory, os.pardir, os.pardir)) import llspy import logging import os import shutil import sys import click import voluptuous from llspy im...
be3faf7d0e2e9b8719e2e0472c501fbd90118b15be422b92632a1a1b5765b55c
Python
34,336
1,068
"""Clustering.""" from math import floor import warnings from joblib import Parallel, delayed import numpy as np from sklearn.base import BaseEstimator from sklearn.cluster import KMeans as sklearnKMeans from sklearn.utils.validation import check_random_state from .classification import MDM from .datasets import samp...
60afed5a0f53b9a65d3d5a3c697c348cac1a490f8dd22874734105ae3e5b67f2
Python
34,364
807
import math import os import csv import random import torch from torch.utils import data import numpy as np from dateutil import parser import contigs from util import * from kinematics import * import pandas as pd import sys import torch.nn as nn from icecream import ic def write_pdb(filename, seq, atoms, Bfacts=None,...
7fe2cdb12a3524d85284234b2227379a6d9d11a149498cfc69fe5eae54dc29b6
Python
34,364
807
import math import os import csv import random import torch from torch.utils import data import numpy as np from dateutil import parser import contigs from util import * from kinematics import * import pandas as pd import sys import torch.nn as nn from icecream import ic def write_pdb(filename, seq, atoms, Bfacts=None,...
769a15fa8c35a77eae18e4b46e7aad95acf74273366496e03869da343350a0d1
Python
34,365
709
# dependencies import itertools as it import copy import numpy as np from scipy.stats.mstats import sem import matplotlib as mpl import matplotlib.pyplot as plt from ssm.plots import white_to_color_cmap from matplotlib import cm import pandas as pd import seaborn as sns from mpl_toolkits.axes_grid1 import make_axes_loc...
8966a541176a5eab65e4c7e2e20c5458fc7d3e68c7e6a7e4ffccbb907ee70a32
Python
34,440
634
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 50_figures.py — 生成投稿用图(研究设计 + 校准 + 重测信度 + 综合判读) ================================================================================ 输入:out/aifi_calibration_metrics.csv out/aifi_retest_reliability.csv out/aifi_imm_predicted_ages.csv out/aifi_sound_predicte...
b568c33a3f162e00f171117e5635479e0d70c9396a47ea0697be80e145f2156b
Python
34,441
705
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Written by Yuichiro Yada #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ################################################ # A code for Fig. 4 ################################################ import numpy as np import pandas as pd import seaborn as sns import os i...
303384e4f3e95b4a70f74bb11d13fb93ef8ef3ed9207323ce141b6780144782d
Python
34,457
929
#!/usr/bin/env python """REST Translation server.""" import codecs import sys import os import time import json import threading import re import traceback import importlib import torch import bioseq2seq.opts from itertools import islice, zip_longest from copy import deepcopy from collections import defaultdict from a...
4e0bf360aaa59a1ebd88fec8866ca1cbbdd0a47dcd9936d3288d75798766e3e4
Python
34,458
950
""" decoding_analys.py This script contains functions for decoding analysis. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import itertools import numpy as np import pandas as pd import scipy.stats as scist from util import gen_util, logger_util, logreg_util, math_util, rand_ut...
164d402de0631f02f9f5ec452bcc9657909054cfb44b9e14ef8309c26118fae6
Python
34,574
1,147
"""Phase-0 render identity oracle for the visualization refactor. This intentionally characterizes the current Graphviz implementation. The records are a tripwire: do not update them except for an explicitly approved rendering change. """ from __future__ import annotations import hashlib import json import re impor...
5242ec5474ab4e5c80582354efed12586b6adb3ec0e5a88acd44e31c87952156
Python
34,596
903
from __future__ import absolute_import, division from tqdm.auto import tqdm import torch from torch.autograd import Variable, grad from torch.nn import Parameter import torch.nn.functional as F import numpy as np import pandas as pd import sys import random import os import math class Encoder(torch.nn.Module): def...
4958d1b5c18061040735432ddc1ac8bb2e826cb31e7fdb94ea8131eb512c5454
Python
34,604
794
"""Transactional execution providers for the unified :meth:`Trace.run` surface.""" # ruff: noqa: F401 from __future__ import annotations import dataclasses import math import struct import sys from collections.abc import Callable, Iterable, Mapping, Sequence, Set as AbstractSet from contextlib import contextmanager,...
9df0914b759953bce753fe5303a2434c72a4f481933410d5611b64113110abe6
Python
34,637
656
#==============================================================================# # Author: Dominik Müller # # Copyright: 2024 IT-Infrastructure for Translational Medical Research, # # University of Augsburg ...
8649cf5c06ecb359dbc8f26f715bd05bf3825036e05d030eb2e872e8fcf78b97
Python
34,661
1,066
import sys import itertools import csv import pprint from pathlib import Path import numpy as np import torch from torch import optim from sklearn.manifold import TSNE from sklearn.metrics import ( confusion_matrix, ConfusionMatrixDisplay, silhouette_samples, ) from mpl_toolkits.mplot3d import Axes3D from ...
38457ae3c72d70b9ebb6a7225e05c513a18cac07e2880a2f7dbfb5cbfc357138
Python
34,667
816
"""Module that contains functions used to interpret a trained CMKN model. Authors: Jonas C. Ditz: jonas.ditz@uni-tuebingen.de """ import math import os import numpy as np import torch from .data_utils import ALPHABETS def seq2ppm(seq, alphabet="DNA_FULL"): """Converts sequences into a position probability...
4711eccaa3dc8b1b45982f2db3a56dc7c34ffe381c25ed924990821eb65df41a
Python
34,704
712
import pandas as pd import scipy.io as sio import scipy.interpolate import numpy as np import scipy.sparse import scipy import gzip import subprocess import collections from collections import defaultdict, Counter import scipy.sparse as sp_sparse import warnings import pickle import os #warnings.filterwarnings('ignore'...
1d9eec631585a793ab814cb5e3d4b13d4062654c116542881f2b689a1ec47acc
Python
34,715
914
F""" This code started out as a PyTorch port of Ho et al's diffusion models: https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/diffusion_utils_2.py Docstrings have been added, as well as DDIM sampling and a new collection of beta schedules. """ import enum import mat...
44f131f6fa0396a25084bfb9e31ff49c7d0555f19c0b44cf59990bc73df43a44
Python
34,717
873
"""Parse GFF files into features attached to Biopython SeqRecord objects. This deals with GFF3 formatted files, a tab delimited format for storing sequence features and annotations: http://www.sequenceontology.org/gff3.shtml It will also deal with older GFF versions (GTF/GFF2): http://www.sanger.ac.uk/Software/form...
978cebdd04eabd07528df82856e3ac7f04afc540b36b74b569a08dfeea8c1343
Python
34,723
839
""" Neural Network implementation for image segmentation For more information about autotune: https://www.tensorflow.org/guide/data_performance#prefetching Copyright (c) 2022 Giansalvo Gusinu <profgusinu@gmail.com> Copyright (c) 2021 Emil Zakirov and others Copyright (c) 2020 Yann LE GUILLY ...
5290e9a8d5209b63c4db049332419fb8906d6bddb01d73fa6a0b398323a21fd6
Python
34,734
865
import contextlib import email.utils import enum import glob import hashlib import http.client import json import logging import math import os import re import secrets import shutil import ssl import tempfile import time import urllib.parse import urllib.request from datetime import datetime, timezone from pathlib imp...
10b4804fa0d7d423abf61e90992ed56ddecba1fdc8d42217a43a2c17194b2eff
Python
34,753
482
#!/usr/bin/env python # Created on: July 10, 2013 __author__ = "Sven Kreiss, Kyle Cranmer" __version__ = "0.1" import optparse parser = optparse.OptionParser(version=__version__) parser.add_option("-q", "--quiet", dest="verbose", action="store_false", default=True, help="Quiet output.") options,args = parser.parse...
2b860591389d12581d1ef3d05f7f25933217beef64135d6262cec1e866a81c61
Python
34,763
1,045
# --- THIS FILE IS AUTO-GENERATED --- # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseTraceType as _BaseTraceType import copy as _copy class Carpet(_BaseTraceType): _parent_path_str = "" _path_str = "carpet" _valid_props = { ...
7b8d217d70a1ced3852e97c4524fc475ddfcb412a2be0730bc1ed74080e6dfe4
Python
34,783
720
# -*- coding: utf-8 -*- """ Tier 2: instantiate each pyoperant/behavior/*.py Behavior class from its real example_configs/*.json and step it through some real usage, with hardware replaced by tests/fixtures.py's FakePanel. Catches logic-level bugs Tier 0 (syntax) and Tier 1 (import) can't -- e.g. file modes, signature ...
15403b20884d730db098dd534258be0cd433649446a8ac1cc0a11c5bc2b52929
Python
34,791
899
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import cgi import itertools import logging import mimetypes import os import posixpath import re import sys from collections import namedtuple from pip._vendor import html5lib, requests, six from pip._vendor.distlib.compat import unescape ...
68af92e5847d66e5adab0a9872b282610a2720d32f5f4bc166ca329395070011
Python
34,796
840
import numpy as np import keras as keras from keras import backend as kb from keras.utils.conv_utils import normalize_tuple import warnings import collections from csbdeep.utils import axes_dict import pywt import random # Contains code for data loading and generation before # being passed into the network. class Dat...
8f45c0b45220da352fa033f5c21aeafc6f81d5d37ba7a6ec560fbeb792b0f1d2
Python
34,802
900
import os import pandas as pd import requests from collections import Counter from rdkit import Chem from rdkit.Chem.MolStandardize import rdMolStandardize from rdkit.Chem import Mol from tqdm import tqdm from Bio.PDB import PDBParser from typing import Union, List, Tuple, Dict, Set from rdkit.Chem.AllChem import Assi...
3eb47c23dd56f33a0b06ff69478834c35f9f2ceda913c572a32ab69f030a2554
Python
34,808
1,065
"""Explore - the zero-configuration entry point to Larvaworld. Three states in one page: a gallery of curated scenarios, a live run, and a result view. The promise is one click and no decisions between arriving and watching virtual larvae behave. Everything here is display-only: runs are capped, nothing is written to...
43ed3da46139717c8887a0cab36a162b813245cfe30b8ed5bd927af41a11db9d
Python
34,832
978
import time 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 zscore from scipy.spatial.distance import cdist from scipy.signal import detrend from scipy.fft import fft, fftfreq from sklearn.decomposition import PCA, FactorAnalysi...
6742fe59e0162a028a7e111497c2f3114b51b859daa092851f5cbcee394eebae
Python
34,845
759
# pylint: disable=line-too-long,too-many-lines,missing-docstring,arguments-differ,unused-argument import mxnet as mx from mxnet import init from mxnet.gluon import nn from mxnet.gluon.nn import HybridBlock from ..resnetv1b import resnet18_v1b, resnet34_v1b, resnet50_v1b, resnet101_v1b, resnet152_v1b __all__ = ['resnet...
57765a766db60a2fa0546a6d5e420b0ed0fa5cd1d0154082b1fe4c28dc5e9942
Python
34,848
896
import functools import inspect import itertools import string import numpy as np from keras.src import backend from keras.src import tree from keras.src.api_export import keras_export from keras.src.backend.common import is_float_dtype from keras.src.backend.common.variables import standardize_dtype from keras.src.l...
0116c8a160d24480d44841f825c3981bb1332e756abfe56e91caad8447c3bc90
Python
34,861
794
""" This module creates the craniosynostosis distance maps. """ import warnings import numpy import vtk import vtk.util.numpy_support def define_shape_model_landmarks(): """ Defines the 10 landmarks on the shape model data, as defined on our publicly available statistical shape model. Indices start at...
0cdb4987ff645b9596376603bebd8b21bc9953ef7f2fcc54afe175ad69c86f8f
Python
34,864
953
""" The general utility functions. """ import csv import logging import os import pickle import random from argparse import Namespace from collections import defaultdict from logging import Logger from typing import List, Set, Tuple, Union, Dict import numpy as np import torch from rdkit import Chem from rdkit.Chem.Sc...
dc45070323d0799fe479a796bbb736011627bb24d2102970e9dc7975635cbcb6
Python
34,882
842
# 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...
3d7ce0e89ca2f1862e0882a40478340fd3b2517e342951cb7ee83372ae59d7c5
Python
34,889
663
""" Functions processing segmentation data Copyright (c) 2019 Polytechnique Montreal <www.neuro.polymtl.ca> License: see the file LICENSE """ import math import platform import numpy as np from skimage import measure, transform import skimage from scipy.ndimage import map_coordinates, gaussian_filter1d, zoom import l...
052eee3e73e9903ec5fdcfc7ee683fcfb869a85ea1cc33e775c78e78d72c59da
Python
34,897
594
# create a script from a matrix and a vector of labels - plot connectome import pandas as pd import matplotlib.pyplot as plt import scipy.io import mne import numpy as np #%% ## functions def isSquare (m): return all (len (row) == len (m) for row in m) def regions_bst_to_lobes( argument ): ''' gather bra...
0fb9f9f9bd749c08463d794b1775c91ed99bc123fb8cabc73985102e5ae179e4
Python
34,950
1,105
""" any new class added here need to be added to web_utils/control_thread.py too """ __author__ = "quentin" import logging import random from ethoscope.hardware.interfaces.interfaces import DefaultInterface from ethoscope.hardware.interfaces.optomotor import OptoMotor from ethoscope.hardware.interfaces.sleep_depriv...
5504fdb70d07050e0ed3cb0fe06e291bc4f45203b854ee0385f53a199a3e6153
Python
35,000
897
# 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...
63564182872ad0f250ef6ee06f552f4592569b3636568b52a5c78c49479a3e73
Python
35,013
822
"""Tensor-variant detection and pre-flight guards for ``trace``. TorchLens was designed around standard dense ``torch.Tensor`` / ``torch.nn.Parameter`` objects on real (CPU/CUDA/MPS) devices. A number of tensor variants break the logging pipeline in different ways: ================ =================================...
db32ddb86e99c1a10901b5b04870933dba8528a2cce5afa723e021e09d863eec
Python
35,020
883
""" Auxiliary functions to aid in the interpretation functions for the spatial and spatially-lagged regression models. """ from typing import Callable, List, Optional, Union from joblib import Parallel, delayed try: from typing import Literal except ImportError: from typing_extensions import Literal import n...
598849db25c44f9c2d0a8c0ae64296855dee54cceda5155120710cf53e4e15d8
Python
35,038
925
"""Object config serialization and deserialization logic.""" import importlib import inspect import types import warnings import numpy as np from keras.src import api_export from keras.src import backend from keras.src.api_export import keras_export from keras.src.backend.common import global_state from keras.src.ba...
c7f1a888cdc6f8ce022d6d861b11288688755cb3d481d249b23946485b9912fa
Python
35,055
874
# coding=utf-8 ######################################################################################### # This code provides SCT integration into FSLeyes for the following tools: # # - sct_propseg # - sct_deepseg_gm # - sct_deepseg_sc # - sct_label_vertebrae # - sct_register_to_template # - sct_proce...
f9cf837f4fe8f59ae674202c23eb6ca4dd0fcaca309c354bcc4417b046b350c3
Python
35,063
934
""" sess_load_util.py This module contains functions for loading data from files generated by the Allen Institute OpenScope experiments for the Credit Assignment Project. Authors: Colleen Gillon Date: August, 2018 Note: this code uses python 3.7. """ import copy from pathlib import Path import warnings import c...
b2a5d3f729442ed643481deb41dabf71179a07e5e4446cc887f4bf36988fba25
Python
35,073
866
'''Utilities for fmriprep.''' import csv import glob import itertools import os import re import json import warnings from collections import OrderedDict import numpy as np import nipy import nibabel import pandas as pd import bdpy class FmriprepData(object): '''FMRIPREP data class.''' def __init__(self,...
d22ddb458a162ea678a97f29afaf3aeda9242c22bd4f98f4bb22650e9aab43a4
Python
35,073
727
import numpy as np import pandas as pd from src.subspace import Geometry import pickle import importlib import matplotlib.pyplot as plt import src.plotting_funcs as plotter import src.plane_angles_analysis as angles import src.vec_operations as vops import src.preprocess_rep_geom_data as ppc import src.stats as stats ...
3cea8dbdf9c8e2a4b81716295aea521a7188f3a06b78822502c0067f449ebd1f
Python
35,091
1,022
"""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...
c01685a57f1add12139be5a5d81d7bbdaf1b49089e21652cbe2db6b40fadc019
Python
35,100
665
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from __future__ import annotations import torch from torch import nn from . import LOGGER from .metrics import bbox_iou, probiou from .ops import crop_mask, xywh2xyxy, xywhr2xyxyxyxy, xyxy2xywh from .torch_utils import TORCH_1_11, autocast class T...
7e9a40828d14ae37568854071e1c7131ab7440b4dbb495c8961a3a9d5c5a75a7
Python
35,251
911
"""r-b4 R27-1: capture-entry input walkers are depth-bounded and cycle-guarded. The four input-boundary walkers (``walk_input_boundary``, ``snapshot_input_boundary``, ``backends.default_specs._simple_leaves``, ``utils.arg_handling.copy_arg_tree``) share ONE nesting ceiling (``INPUT_TREE_MAX_DEPTH``) and refuse deep or...
190ebae8a36ab25a3a296c4979d4957c5e7d104b8a8b9a4baa57311f27dde31c
Python
35,330
703
#!/usr/bin/env python # # This command-line tool is the interface for the deepseg API that performs # segmentation using deep learning from the ivadomed package. # # Copyright (c) 2020 Polytechnique Montreal <www.neuro.polymtl.ca> # License: see the file LICENSE # TODO: Add link to example image so users can decide wet...
9a677f4aa4ee81d23a11de0cc72890d9f039e6139727738bd7994287f4b8c587
Python
35,345
758
import matplotlib.pyplot as plt import seaborn as sns import random from scipy.special import softmax from sklearn.linear_model import LinearRegression, Ridge from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.model_selection import KFold from sklearn.linear_model import...
e763f01b6c01cbc3a1a64072c3d9196abfd909575e53d3bb3da72ed3c1bd8935
Python
35,356
744
"""Frame and video visualization: overlay points/text on images and write videos. ``FrameVisualizer`` wraps OpenCV's video writer and draw primitives; helper functions play back buffered readers with overlaid trajectories and produce interactive image stacks for Jupyter contexts. """ from typing import Union, Tuple, ...
3a16d454e500228f7e2306fd7c0d7e046462f4955a908c56930a92e3f40b46c4
Python
35,358
947
""" Script that uses the movingpandas and geopandas libraries to facilitate spatial data processing. Analysis starts from scratch meaning it only uses the primary tracked xy coordinates of the midline and contour. The data used for this illustration is loaded from a stored reference dataset under the RefID. Only the re...
f86fadcf08a075273bcd721d57faa48a38f64747ea81d9f92a9159e4b93dc290
Python
35,359
634
""" Functions dealing with spinal cord straightening Copyright (c) 2019 Polytechnique Montreal <www.neuro.polymtl.ca> License: see the file LICENSE """ # TODO: only input Image instead of file names import os import time import logging import bisect import numpy as np from spinalcordtoolbox.types import Centerline...
71e012867281b111f37c8e4c7e507a7e72ef8536987b17d86cf4b40e4edbce6a
Python
35,381
942
import email.utils import urllib.request import io import warnings from datetime import datetime, timedelta, timezone from pathlib import Path from urllib.error import HTTPError import pytest from pyrosm import get_data # The folders of the download logs and host locks, before each test gets its own (see # conftest.p...
ef6eb4e22069ee5b0d58fcd34fa9fc89f1d5c3eaeeeb8c1a1272d89eeba08ec5
Python
35,403
1,125
""" sess_str_util.py This module contains basic functions for getting strings to print or save files for Allen Institute OpenScope experiments for the Credit Assignment Project. Authors: Colleen Gillon Date: October, 2018 Note: this code uses python 3.7. """ from sess_util import sess_gen_util from util import g...
2b90a53aedd722c91a05bc6c4e6012a8fed34434199021fb176df4d21697c91a
Python
35,409
855
""" Neural Network implementation for image segmentation For more information about autotune: https://www.tensorflow.org/guide/data_performance#prefetching Copyright (c) 2022 Giansalvo Gusinu <profgusinu@gmail.com> Copyright (c) 2021 Emil Zakirov and others Copyright (c) 2020 Yann LE GUILLY ...
05c91e7bd8717608ca5abe4fe4a50afccf6918a2e185df54c03045632e8fb040
Python
35,436
1,115
""" This module includes the main class that handles the data generation from the Metal PDB files. PDB/CSD Record Format COLUMNS DATA TYPE FIELD DEFINITION ------------------------------------------------------------------------------------- ...
7543b11dedf0d823476578c777a9c844fb86a1a83dff71665eb280e93dec7f6f
Python
35,448
1,156
# Copyright 2023 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
7f462bda6954c7f7bd79c80b7a953948d2acab52186452847a6cec89d7b6a46a
Python
35,449
791
import copy import logging import sys import warnings from typing import Generator, Any import numpy as np import pandas as pd from mirp.settings.generic import SettingsClass from mirp._workflows.baseWorkflow import BaseWorkflow from mirp._data_import.read_data import read_image_and_masks_generator from mirp._images...
52211dfbc6009933c7946e6c44396e3252267ed6d1a7a24707b55bf413e7fbfc
Python
35,451
936
"""Schedules define the intervals at which periodic tasks run.""" from __future__ import annotations import re from bisect import bisect, bisect_left from collections import namedtuple from datetime import datetime, timedelta, tzinfo from typing import Any, Callable, Iterable, Mapping, Sequence, Union from kombu.util...
b8edce129428930dc47cead2330057af15c0a89923cf2dc675f33bffdb97149f
Python
35,530
714
import numpy as np import random from gym import spaces ''' Trial-Unique, Delayed Nonmatch-to-Location (TUNL) task in a triangular arena. Including the no-memory verion. ''' class Tunl(object): def __init__(self, len_delay, len_edge, rwd, inc_rwd, step_rwd, poke_rwd, rng_seed=1234): """ :param l...
9e04b7f5be277cf7747c2c53b3f3a1d51f8970931c182f14c0dbb06c3beedc2a
Python
35,543
876
"""Dataset implementation for specific task(s)""" # pylint: disable=consider-using-generator import logging import os from pathlib import Path import warnings import numpy as np import pandas as pd import matplotlib.pyplot as plt from PIL import Image import cv2 from ..data import is_url, url_data from ...utils.filesys...
6d448b646f77d65c2661f45038c7f0abb21d1ebcf027ba25a2ea4bce6ec65327
Python
35,568
994
from __future__ import annotations from html import unescape from pathlib import Path from types import SimpleNamespace from bokeh.document import Document import panel as pn import pytest from larvaworld import DATA_DIR from larvaworld.portal.datasets import import_datasets_app from larvaworld.portal.datasets.disco...
cba69aeb19abb06b9d716a1f1aca7557a3f8d717ef4bbd806b2e98554097241f
Python
35,568
1,038
"""Regression tests for loop-rolling and module-rolling reconciliation.""" from __future__ import annotations import os import re from pathlib import Path import pytest import torch from torch import nn import torchlens as tl from torchlens.options import CaptureOptions from torchlens.visualization._render_nodes im...
4feba3c58f1134e0a804b68c5ddbf521677d4492057dfcb989c9baf7bd97d99d
Python
35,569
484
import os import pandas as pd import numpy as np from joblib import Memory import pdb import random from scipy import stats from os.path import join meta_path = '/home/abraun/meg_data' fig_folder = '/home/abraun/meg_data/sr_labeled/figures' memory = Memory(cachedir=os.environ['PYMEG_CACHE_DIR'], verbose=0) path = '/hom...
6abab6a19140c11b975d00f63671f6e1543115d6c442bee65a3dd4ac56a115e3
Python
35,587
1,008
from copy import deepcopy import pathlib from traitlets import List, Dict, observe, Integer from plotly.io._renderers import display_jupyter_version_warnings from .basedatatypes import BaseFigure, BasePlotlyType from .callbacks import BoxSelector, LassoSelector, InputDeviceState, Points from .serializers import custom...
d1234198bafcb71bbb94a0b0e33b034e01ef76c8c8250fad68f65abb9eb3558f
Python
35,595
828
import logging from typing import ( Any, cast, Literal, ) from urllib.parse import urlsplit from uuid import uuid4 from pydantic import ( BaseModel, Field, UUID4, ValidationError, ) from galaxy.exceptions import ( Conflict, InternalServerError, ItemOwnershipException, Messa...
de9b6cbf9d436951c007b380119214061ded9baa354a6d8589604af896d41e05
Python
35,658
889
"""Completeness lint for portable scrub policy coverage.""" from __future__ import annotations import functools import inspect import pickle from pathlib import Path from typing import Any import pytest import torch from torch import nn import torchlens as tl from torchlens import trace as trace_fn from torchlens._...
32c408ee558f6732069a2edda8d33c35ed2567a843c9942c9a7a3a8312f70023
Python
35,673
988
# -*- coding: utf-8 -*- """ Created on Mon Nov 29 23:59:48 2021 @author: yihaoy """ import matplotlib.pyplot as plt from scipy.spatial import distance from scipy import signal import numpy as np import jsonpickle import json from Neuro2Nets import Neuro2Nets #%% test random map 4 sites net = Neuro2Nets...
78e60715c6a9c20ad391822482f258d233013cb2b046c2298d862a00d1f14616
Python
35,692
990
""" usi_plots.py This script contains functions for plotting USI analyses. Authors: Colleen Gillon Date: January, 2021 Note: this code uses python 3.7. """ import copy 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_an...
96aaa1280b80efd59994e42ea5aca6503e1d1e8f6efdcc56ba24ddd7fb9bd726
Python
35,764
1,201
"""Estimation of SPD matrices.""" import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from sklearn.covariance import shrunk_covariance from sklearn.metrics.pairwise import pairwise_kernels from .geometry.covariance import ( covariances, covariances_EP, cross_spectrum, coherence,...
87af0ab81dbf9e5657a1834abac8ba2b5230fb716fbe174ac51c11d5e38db6b8
Python
35,811
904
from absl.testing import parameterized from keras.src import dtype_policies from keras.src.dtype_policies import deserialize from keras.src.dtype_policies import get from keras.src.dtype_policies import serialize from keras.src.dtype_policies.dtype_policy import AWQDTypePolicy from keras.src.dtype_policies.dtype_polic...
929978c75f1f7a2abceea57a2e669ddb93ebfb14dd4b7c288366469d1f5f40a7
Python
35,833
857
"""The validation tripwire's own exemption ledger (grind r2 row 19 / matrix R08). ``CLAUDE.md`` -> "Validation Integrity (LOCKED PRINCIPLE)": the ``validation/`` pipeline is a TRIPWIRE, and the ONLY legitimate exemption is behavior that is *correct by design and provably outside the check's contract*, scoped narrowly ...
a13b5b9bf2acf073ef1e5485d9f6ad8ecbaa03205cf798f6391a08b25e1e8c0c
Python
35,859
1,051
from functools import wraps import warnings from array_api_compat import array_namespace as get_namespace, device as xpd from scipy.stats import chi2 from ._backend import ( apply_xp_cov, diag_indices, hann_window, fast_mcd, ledoit_wolf, oas, ) from ._check import check_function, check_init, c...
890d8edf180a225626fbe59a5bdbbc40b1491b5be01c15d0814e76c5ec2c5f9c
Python
35,861
923
""" This code started out as a PyTorch port of Ho et al's diffusion models: https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/diffusion_utils_2.py Docstrings have been added, as well as DDIM sampling and a new collection of beta schedules. """ import enum import math...
a0e954a7a800f210689825b98896ec77537c6b15da2f587f96eca031ee1a64d9
Python
35,885
1,043
"""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...
e478a2de2b07dd26e75cbdcf6f0922e84590952a753861e75469bc35476bfb24
Python
35,898
903
"""Trace task execution. This module defines how the task execution is traced: errors are recorded, handlers are applied and so on. """ import logging import os import sys import time from collections import namedtuple from warnings import warn from billiard.einfo import ExceptionInfo, ExceptionWithTraceback from kom...
afca0603c456457010f8dfd93235a67968c570002506f66b34f5269d145f2a3e
Python
35,909
918
# 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 writin...
24688a2b2e92c5b0bd92fe053f7777b26a9fab62222891331367452efa24c807
Python
35,919
734
import warnings warnings.simplefilter("ignore") import torch import numpy as np from os import environ, makedirs, listdir from os.path import join, basename, exists import matplotlib.pyplot as plt try: from tqdm import tqdm except ModuleNotFoundError: tqdm = lambda x: x from time import sleep from skimage.measu...
11587012277790f637d60fc10750e70ff013650fa423a38588c1f123a7bb80ba
Python
35,929
980
"""Miscellaneous utility functions for xcp_d.""" import itertools import multiprocessing import nibabel as nb import numpy as np from nipype import logging from xcp_d.utils.doc import fill_doc LOGGER = logging.getLogger('nipype.utils') def _get_template_transform(template, from_space, cohort=None): """Get a T...
8f72aa007090a7957984ef127175e358fdd999afe144056f207d7a904a9ea016
Python
35,935
839
""" Code here provides direct access to the header and signal data of ABF files. Efforts are invested to ensure ABF1 and ABF2 files are supported identically. This file is LIMITED TO THE MANAGEMENT OF HEADER AND DATA information. Analysis routines are not written in the ABF class itself. If useful, they are to be writ...
91a0005d9b0b179681f64d0cc48d0f38eded16e7df4f204e0036b1ef18f133c7
Python
35,964
989
""" Evolutionary optimization of model parameters. Runs a genetic algorithm over the model search space, scoring each generation against a reference dataset and breeding the best genomes into the next. """ from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Optional if TYPE_CHECKING: ...
3c5f6972a72d10b44f2928aa2b4e91b27b962ca7a8650891c8e901b7bb97210c
Python
35,969
795
""" Functions for finding nearest neighbors, the distances between them and the spatial weighting between points in spatial transcriptomics data. """ import os import sys from functools import partial from typing import Optional, Tuple, Union import anndata import numpy as np import pandas as pd import scipy from annd...
406bb58eb4f8e3ea1c7d37c9ca0bfa2c01631291f40b73751eb52cce174339de
Python
35,984
777
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ BAM file will be input use pysam and each line in BAM file will be looped to find the possible missed small exons, with the threshold: small_exon_size <= 100 (default) and abs(delta_ratio) <= 0.5 (default). The realign region will only be aligned to the exon seque...
98af0938e1945367f73fafff2928fb97ef7e43a9dccce50ed1affa4caf82dbeb
Python
36,025
861
"""Functions for building the input features (reference ccd features) for the HelixFold model.""" import collections import os import time from functools import partial from typing import Any, KeysView, Mapping, MutableMapping, Optional, Tuple, Sequence, Union, List from absl import logging import numpy as np from rd...