sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
492ad98cb0302dbd93abcb160713f7e30486e0f8b8f531d5a1444c4cfdb26f05 | Python | 32,293 | 881 | import numpy as np
from keras.src import backend
from keras.src import layers
from keras.src import tree
from keras.src.api_export import keras_export
from keras.src.backend.common import standardize_dtype
from keras.src.layers.layer import Layer
from keras.src.layers.preprocessing.data_layer import DataLayer
from ker... |
5017d06411117997d18f0f6f2f2fa185f08e0ed9a686e71ea5cba1a08d4ba38c | Python | 32,302 | 784 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from itertools import product
import pickle
import logging
import pytest
import sys
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
import eelbrain
from eelbrain import Dataset, NDVar, Categorial, Scalar, UTS, Sensor, configure,... |
a2781c141fb830a61b7def53864855d0dc1d1e2722ada7e0968dbd36560bb444 | Python | 32,348 | 869 | from collections import OrderedDict
from collections import namedtuple
from keras.src import backend
from keras.src import losses as losses_module
from keras.src import metrics as metrics_module
from keras.src import tree
from keras.src.backend.common.keras_tensor import KerasTensor
from keras.src.losses import loss a... |
1d46c8ee948f3b64ed3f85843765ae9b5849d6c61537dd4baa2254148295e437 | Python | 32,360 | 902 | # --- 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 Sankey(_BaseTraceType):
_parent_path_str = ""
_path_str = "sankey"
_valid_props = {
... |
dce1509535e4aebab08439fcef0160e5403e377bfb0c6098d366b0c86f027889 | Python | 32,374 | 729 | """
File: main.py
Created: 2020/11/16
Last Changed: 2023/08/21
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.
"""
# Standard imports.
from ... |
f82e3cf56ca83f6c9d9dd6c9d7a72284433f334dd4a27b1e27deeb38c56127f7 | Python | 32,403 | 805 | import os.path
import hashlib
import numpy as np
from typing import Any, Self
from pydicom import dcmread
from warnings import warn
from copy import deepcopy
from datetime import datetime
from mirp._data_import.generic_file import ImageFile, MaskFile
from mirp._data_import.utilities import supported_image_modalities... |
a97309b0a5d3427c9ff939d7712d8452279712ad250534ee01bc9c2715da5490 | Python | 32,419 | 778 | """Legacy tensor constructors capture as logged ops and validate.
2017-2019 model code builds tensors with ``torch.<dtype>Tensor(...)`` (directly,
or through a module attribute bound at init such as ``self.FloatTensor =
torch.FloatTensor``) and wraps tensors in ``torch.autograd.Variable``. Their C
constructors used to... |
4fec20c34872777e99d1fce1ef49d5e29bb89fa98310dbb1e5fa26fde80df9a9 | Python | 32,433 | 963 | import sys
import warnings
import pytest
from shapely.geometry import box
from pyrosm import get_data
from pyrosm.config import Conf
def _ulanbator_pbf():
"""Path to the UlanBator test network, a pinned snapshot hosted on a gist.
The data must stay uncropped: the export tests assert ``ecount == 2 * n_edges``... |
d462ad35eaa5ffab9fbee520472cac0887f6ddf24b8e4633df843074d68723c2 | Python | 32,436 | 678 | from cuteSV.cuteSV_genotype import cal_CIPOS, overlap_cover, assign_gt_fc
from multiprocessing import Pool
from pysam import VariantFile
import math
import time
import logging
import numpy as np
import pickle
from sklearn.cluster import KMeans
def parse_svtype(sv_type):
if 'DEL' in sv_type:
return 'DEL'
... |
05cd2ebab30f989e88812b4d821a1f76b2865dda3c8f61d1d01868209e405d53 | Python | 32,445 | 743 | """Output reconstruction and post-execution contracts."""
from __future__ import annotations
from collections.abc import Mapping, Sequence
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, cast
import torch
from .errors import (
RunPreconditionError,
)
from .runnable import (
Contract... |
892d2e81ddfe9824b8d00a86472223cbb9b6816f48003e7bdb58c41223350f8d | Python | 32,450 | 810 | """In-place ops on a prepared ``nn.Parameter`` inside ``forward`` are captured.
MIX-HIC's ``with torch.no_grad(): self.temp.clamp_(0.001, 0.5)`` on
``self.temp = nn.Parameter(...)`` used to vanish from the graph: the op returns the
Parameter itself, and Parameter outputs were never logged, so the completeness
tripwire... |
f890287260711374d92d292690e06dfcebeb6a1bb8dd0860849ae3401d4b6a4b | Python | 32,458 | 646 | """Classification Estimator"""
# pylint: disable=unused-variable,bad-whitespace,missing-function-docstring,logging-format-interpolation,arguments-differ,logging-not-lazy
import time
import os
import math
import copy
from PIL import Image
import pandas as pd
import numpy as np
import mxnet as mx
from mxnet import gluon... |
bf5c7334df9eebb3762f238ca3daac5ad85f6e4908f6fb0fa46244727cab05c9 | Python | 32,539 | 656 | from data_fun_torch import *
from utils import *
import random
import numpy as np
import datetime
import time
import traceback
from tensorboardX import SummaryWriter
torch.autograd.set_detect_anomaly(True) # Derivative anomaly detection
# logging setting
class Trainer():
def __init__(self, arg_set... |
9cd3c8bd7047f03ac5e5e6ec5715ed1cb44492208ac75f0078502eb14dc10f0e | Python | 32,546 | 802 | """Characterization matrix for the public selector/predicate surface.
This is the behavioral oracle for the ONE-predicate-interpreter consolidation:
every public selector spelling is evaluated through each user-reachable
lifecycle (capture-time ``save=``, post-hoc ``find_sites``, live hook matching,
live backward matc... |
3e36e246f709826e40feb913f17481d3f8d623a46b42c4ab31729d7f6bdbcf5c | Python | 32,549 | 898 | #!python
#import gc # trying to make it work on windows
import wx
import matplotlib as mpl
mpl.use('WXAgg')
from scipy import stats, signal, ndimage
#from functools import partial # curry-like function
import numpy as np
from imfun import fseq, lib, atrous
from imfun import filt
from imfun import ui as ifui
from im... |
ece1b626c5110411380c9572defd9ba85c65037b50f3de729bf592b614506f0e | Python | 32,556 | 1,130 | """Distances between SPD/HPD matrices."""
from array_api_compat import (
array_namespace as get_namespace,
device as xpd,
is_numpy_namespace,
)
from sklearn.metrics import euclidean_distances
from ._backend import diag_indices, torch, tril_indices
from ._check import check_function, check_matrix_pair
from... |
1a44b93fac8e820010820e6cbe9a7efd5c35bc506bd1444cbe65884b7451e7e1 | Python | 32,583 | 618 | #!/usr/bin/env python3
"""Журнал наблюдений: пересчёт статистики по всему накопленному и сборка страницы.
Читает замороженный датасет отчёта (runs/compare.jsonl, 12 seed'ов) плюс всё,
что накопил суточный прогон (runs/daily/compare_ext.jsonl), применяет те же
критерии годности и тот же двойной критерий подтверждения, ... |
28f275cb192518a576b82590c4e32758c09bf24e96b583da1108078299d0bc28 | Python | 32,625 | 980 | # -*- coding: utf-8 -*-
# data_stream
from collections import UserList
import numpy
import re
import struct
import time
from skimage.measure._find_contours import find_contours
from numba import jit
from .amira_header import AmiraHeader
# type of data to find in the stream
FIND = {
'decimal': '\d', # [0-9]
... |
72634293ad79ed847f7809df0d2b6c3f22ef166adb146d4cfd12b3b1080deede | Python | 32,653 | 589 |
'''
Main PyMicroCT functions (run_analysis, vertebral_profiles and vertebral_angles) are here.
'''
# Python modules:
import os, cv2, pydicom, time, pickle, sys, glob
import numpy as np
from datetime import date
from scipy.interpolate import interp1d
import pandas as pd
import matplotlib.pyplot as plt
# Custom module... |
e01feae637c75618e4a58efb401fdf317966250a596aed50e6ad71250c8d8dbe | Python | 32,701 | 616 | import numpy as np
import glob
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pickle as pckl
import os
from collections import OrderedDict
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
# Import the info for each of the models
from mod... |
7b41cdf318a2a549b770578816fed35f12bb37f3f85937c77888d75954618def | Python | 32,702 | 781 | import pandas as pd
from ..utils import constants, plot, utils
import numpy as np
from warnings import warn
from shapely.geometry import Polygon, Point
import geopandas as gpd
from .flowdataframe import FlowDataFrame
# from skmob.preprocessing import routing
class TrajSeries(pd.Series):
@property
def _constr... |
ea1df5400590c938e61120109c33a2808572ec9b633e9f4b3acbcf4ac9e93533 | Python | 32,706 | 1,065 | """
Stored configurations for multi-experiment essays.
An essay groups several related experiments into one study -- rover versus
sitter, the double-patch assay, chemotaxis -- together with the analysis that
compares their results.
"""
from __future__ import annotations
from typing import Any, Optional
import shutil... |
03dad6c36e1d5587563df0d26d772f10e26a38a02a3e3b9f625ca86f421981cc | Python | 32,710 | 790 | """ Model creation / weight loading / state_dict helpers
Hacked together by / Copyright 2020 Ross Wightman
"""
import collections.abc
import logging
import math
import os
import re
from collections import OrderedDict, defaultdict
from copy import deepcopy
from itertools import chain
from typing import Any, Callable, O... |
b4173b96db6a002d08c844fa6eb9f99f61161e6754472ae35f0cdd28dbd80a9d | Python | 32,710 | 830 | import hashlib
import os
import tarfile
import urllib
import urllib.parse
import urllib.request
import zipfile
from unittest.mock import patch
from absl.testing import parameterized
from keras.src.testing import test_case
from keras.src.utils import file_utils
from keras.src.utils.module_utils import LazyModule
cla... |
f5006011a1f0e86b87a7e807759b3da038802a41ed0b17452fac4400b2f842db | Python | 32,723 | 849 | """SM100 SwapAB decode: end-to-end checks of the shared forward path against an fp32 oracle.
Two-pass capable: under FLASH_ATTENTION_FAKE_TENSOR=1 every test issues all of its kernel
variants and returns before the first data-dependent check.
"""
import os
from functools import partial
import cutlass
from cutlass im... |
517e91782d3c8aeefd8cb59e96fe3c606f7a579fca85f28c837ee854dee647c3 | Python | 32,724 | 1,036 | import numpy as np
import scipy
import brian2.only as br
from tqdm import tqdm
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import network
import analysis
import fig2
from functools import partial
from multiprocessing import Manager, Pool
import sys... |
85e7dd30d2c6e33232922964f2957b3de91be928e59f2032500bcb3e5be6e789 | Python | 32,782 | 961 | import functools
import jax
import jax.numpy as jnp
from keras.src import backend
from keras.src.backend.common import is_float_dtype
from keras.src.backend.common import standardize_dtype
from keras.src.backend.jax.ops.core import convert_to_tensor
from keras.src.random.seed_generator import draw_seed
RESIZE_INTERP... |
b841567b29018989d7ade39e7ce9493223db01337f44f13b4ab3b9fa556ca46b | Python | 32,851 | 821 | ##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
## This file is par... |
a1c6f412a28b59f99a5874da2ab2d8c4bddd39fa58ded490d5b5b20d600894cb | Python | 32,879 | 905 | """Tests for save_new_outs — the fast-path out re-extraction.
Covers: successful re-extraction on simple models, multiple sequential calls,
out value correctness, and the known failure mode on models with
identity-propagated operations.
"""
import warnings
import pytest
import torch
import torch.nn as nn
import tor... |
11ec0e6accd1d7a7078aba06302d7daca4901ab9a6709bb03f906539db04af91 | Python | 32,895 | 951 | # -*- coding: utf-8 -*-
"""
IPython (0.11) extension for physical quantity input.
See README.txt for usage examples.
Author: Georg Brandl <georg@python.org>.
This file has been placed in the public domain.
"""
import re
import sys
from math import pi
import numpy as np
from functools import reduce
# allow uncertain... |
26d7bc14c91d274c93eb841e9bc88bc2b20d2ddcba07dc99bd35abf5b570232c | Python | 32,895 | 909 | import copy
import inspect
import itertools
import warnings
from collections import UserDict
from functools import wraps
from numbers import Number
from typing import Union
import numpy as np
import pandas as pd
from tabulate import tabulate
from .utils import _convert_iter_to_str, _get_terminal_size
def add_meta_d... |
2dbf52d4b0e8d76581f25b3b52799a80c171455be7117a7b501b1cf8fedc404c | Python | 32,923 | 741 | """03. Monodepth2 training on KITTI dataset
==================================================
This is a tutorial of training MonoDepth2 on the KITTI dataset using Gluon CV toolkit.
The readers should have basic knowledge of deep learning and should be familiar with Gluon API.
New users may first go through `A 60-minu... |
991ea2c17ad0bf1e78a9d0e8bde59b032e9d24bf3be2546f747396418acbd1bd | Python | 32,952 | 914 | import os
import numpy as np
import pytest
import tensorflow as tf
from tensorflow import data as tf_data
from keras.src import backend
from keras.src import layers
from keras.src import models
from keras.src import ops
from keras.src import testing
from keras.src.saving import saving_api
from keras.src.trainers.data... |
edffd7f0fd2ad1f11d86d05e3a84437ebf67a127c685414ad12cc99db55ba82c | Python | 32,976 | 961 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
02ebea883c0b17400a7544a8580b69475777418dd40bc4f83892531854986107 | Python | 32,983 | 714 | # pylint: disable=missing-function-docstring, missing-class-docstring, unused-argument, line-too-long
"""
PyTorch implementation of the I3D model.
Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset
CVPR 2017, https://arxiv.org/abs/1705.07750
"""
import torch
import torch.nn as nn
from torch.nn import B... |
d5207911c8b0f073f0c969358b0b3f7da082b5c9cb600f66ad637d09bfdcaee2 | Python | 33,025 | 876 | from math import ceil, floor
import os
from pathlib import Path
import re
from typing import Union, List
import warnings
import numpy as np
import scipy as sp
from scipy.spatial.distance import cdist
import mne
from mne.label import Label, BiHemiLabel
from mne.utils import get_subjects_dir
from nibabel.freesurfer imp... |
86f7d9d311693d4b63f99c96d72928cfed340a5439b171ca047d6d0fed36182c | Python | 33,051 | 819 | """Tests for Phase 10 export surfaces.
Governance adjudication (b10 R78 round-3): the two export goldens under
``tests/fixtures/exports/`` are ENVIRONMENT-INDEPENDENT semantic contracts
and deliberately NOT routed through the ``tests/_oracle_env.py``
env-fingerprint resolver. The payloads are normalized structural JSO... |
02f61c3db150481f29e3af12be770bef4cb7cfeb3de74c2d7a008e392f063319 | Python | 33,068 | 606 | import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.distributions.categorical import Categorical
import os
import sys
import argparse
import numpy as np
import math
from copy import deepcopy
from model import BIML, describe_model
import datasets as dat
from train_lib import s... |
50b0cfed917515537a19573156b36b8a7a9811f7ddea1320e77644a9bdb26f37 | Python | 33,070 | 819 | # Copyright (c) 2025, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao.
import math
import itertools
import os
import pytest
import torch
from einops import rearrange, repeat
try:
from flash_attn.layers.rotary import apply_rotary_emb
except ImportError:
apply_rotary_emb = None
... |
b0d49c0c8b36c81b83ff58ee063666c6cc7486a17b0c64d7a13b18ef914480f0 | Python | 33,094 | 941 | import numpy as np
import pytest
from absl.testing import parameterized
from keras.src import backend
from keras.src import ops
from keras.src import testing
from keras.src.backend.common import standardize_dtype
from keras.src.backend.common.keras_tensor import KerasTensor
from keras.src.ops import linalg
from keras.... |
55a92b4bdcb6c2637ebc91687a5dfedd300ffaaded2cdd9abe5cf4b07a06954d | Python | 33,096 | 736 | """
Core logic for spinal cord detection and bounding box computation.
Public API (pure — no file I/O):
detect(img_path, ...) → bbox dict — detect SC bbox
crop(img, bbox) → NIfTI — crop any volume with the same bbox
detect_and_crop(img_path, ...) → (NIfTI, bb... |
dfe8a3c728179515930bf98523a41709bafbbf81d0abbbd0837959439a44f66b | Python | 33,104 | 1,094 | """Smoke tests for intervention Phase 3 hook contracts and helpers."""
from __future__ import annotations
from pathlib import Path
from types import MappingProxyType
from typing import Any
import pytest
import torch
import torchlens as tl
from torchlens.intervention import runtime as intervention_runtime
from torch... |
e7801af53014ffe67485dec082b8a69ba9f8fe6ec801ed090b5e4d7d0c8e149b | Python | 33,160 | 1,517 | """
Wrapper for the popular R library ggplot2.
With rpy2, the most convenient general way to
import packages is to use `importr()`, for example
with ggplot2::
from rpy2.robjects.packages import importr
ggplot2 = importr('ggplot2')
This module is an supplementary layer in which an attempt
at modelling the pac... |
33ea6965ec06c3e80b59b1bdcbba909e66ccef1730f462f00004060aa1bdde96 | Python | 33,174 | 882 | # -*- coding: utf-8 -*-
# adapted from https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/transforms/augmentation.py
import sys
import inspect
import random
import numpy as np
import pprint
from abc import ABCMeta, abstractmethod
from typing import List, Optional, Tuple, Union
from PIL import Im... |
cb4b88ecaa056668e9d90b0c7d2037cf066257cfbb2e4da202f6657f0b564952 | Python | 33,198 | 1,133 | # 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... |
74c33af8f8fcd78a6041db0a92093083f82b359eec9ccda3b92828501d7847b4 | Python | 33,232 | 764 | # Copyright (c) 2022, Tri Dao.
# This BERT implementation is based on our MLPerf 2.0 and MLPerf 2.1 BERT implementation.
# https://github.com/mlcommons/training_results_v2.0/blob/main/HazyResearch/benchmarks/bert/implementations/pytorch/modeling.py
# https://github.com/mlcommons/training_results_v2.1/blob/main/Azure-Ha... |
cf6ca018347845eab1fde74de18217416212ce022ae76d5f98b2b33009de65c4 | Python | 33,262 | 1,053 | from collections import Counter, defaultdict
import csv
import os
import re
import attr
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import torch
import tqdm.auto as tqdm
import scipy.stats
from permacache import permacache, stable_hash
from modular_splicing.data_pipeline.create_datafil... |
3c18edb1fe19acc4a86f1795f3e02f54576471d2ad190abdaeab87535677cba4 | Python | 33,269 | 868 | """Save-budget refusal: bound retained bytes honestly instead of OOM-killing.
``tl.trace(model, x)`` retains every operation's output by default, which at
frontier shapes means a first-time user gets an OOM kill or an allocator error
from deep inside torch rather than an explanation. These tests pin the honest
replace... |
49d1e45c7779aa33a74aa09f3158887d905fd496b764d4b19bce352ee8b7642f | Python | 33,273 | 857 | import os.path
import pydicom
import numpy as np
from typing import Any, Self, Generator
from mirp._images.generic_image import GenericImage
from mirp._data_import.dicom_file import ImageDicomFile
from mirp._data_import.utilities import get_pydicom_meta_tag, has_pydicom_meta_tag, flatten_list
class ImageDicomMultiF... |
5d1950158800f4f5ba5202f9ccaf4de89c9ccc76b98c46d53102584658b812ec | Python | 33,274 | 684 | #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Written by Yuichiro Yada
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
################################################
# A code for Fig. 2b-f, Supplementary Figure 1, 2
################################################
import numpy as np
import pandas as pd
impo... |
021c384a6d0cb350e069224473f5177af1e4014c53bc1e33dcefb0faea69b135 | Python | 33,287 | 927 | import collections
import json
import math
import os.path
import pprint
import zipfile
import numpy as np
import rich.console
from keras.src import backend
from keras.src.api_export import keras_export
from keras.src.saving import saving_lib
from keras.src.saving.saving_lib import H5IOStore
from keras.src.utils impor... |
7391e48a6ab7f5e25d67a0cdd3fd1eb632b8dfed1ae422bf5bfdec54ba87f3b8 | Python | 33,300 | 921 | from __future__ import absolute_import
import cgi
import email.utils
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
from pip._vendor import requests, six, urllib3
from pip._vendor.cachecontrol import CacheControlAdapter
from pip._vendor.cachecon... |
2d314c6d55422544414d6d09959ee8f476cc52270b3a6502f088335d4cc70e60 | Python | 33,320 | 895 | """
Functions to compute n-dimensional tuning curves.
"""
import inspect
import warnings
from collections.abc import Iterable
from functools import wraps
import numpy as np
import pandas as pd
from .. import core as nap
def compute_tuning_curves(
data,
features,
bins=10,
range=None,
epochs=None... |
9c8035f1281f78623bd63c483aabbc0047f3b83b4e85e78bceca642f966d9296 | Python | 33,331 | 875 | """Model definitions."""
from typing import Dict, Union, Optional, Sequence
import re
from functools import reduce
import torch
import torch.nn as nn
def layer_map(net: str) -> Dict[str, str]:
"""Get layer map for a given network.
Parameters
----------
net : str
Network name. Currently, '... |
7a2039f42196820bd2784f10374e1b0555483213bc59f934712effe4a111d3f5 | Python | 33,385 | 956 | import os
import copy
import subprocess
from math import pi, sqrt
import pathlib
from typing import Union, Optional, List, Set, Dict, Any
import warnings
import numpy as np
from ase.cell import Cell
from ase.outputs import Properties, all_outputs
from ase.utils import jsonable
from ase.calculators.abc import GetPrope... |
d6152fa6505e6993e3d84e3874fc6f0fa056c0a3dbca2ad2d56fbbab14d7ae73 | Python | 33,398 | 920 | from itertools import count
import preprocessing.reader as reader
import preprocessing.filter as filter
import os
import numpy as np
from utils import helper as helper
import json
import multiprocessing
from functools import partial
from datastructure.tile import Tile as Tile
from progress.bar import IncrementalB... |
6dd36122dbf0844748894342521ac8ab92902664616783a4b28833ee5528300f | Python | 33,420 | 882 | import json
import shutil
import tempfile
from pathlib import Path
import numpy as np
from absl.testing import parameterized
from keras.src import backend
from keras.src import ops
from keras.src import tree
from keras.src import utils
from keras.src.backend.common import is_float_dtype
from keras.src.backend.common ... |
03afd657f0e634f5e8daf8745c32daa7e8e3f125f71bab646489dfdaa890a786 | Python | 33,436 | 881 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = "Bjoern Gruening"
__version__ = "0.1"
__date__ = ""
__license__ = "GLP3+"
"""
These script converts a Blast XML Output to the NCBI Feature Table format,
required for submission of Serquence data.
http://www.ncbi.nlm.nih.gov/WebSub/index.cgi?tool=genbank
TODO:... |
4bf5955ca4bf3015f125429366babd71a6eb011df4bdea52b8193f4a459605f3 | Python | 33,442 | 675 | """
Execute an external process to set_meta() on a provided list of pickled datasets.
This was formerly scripts/set_metadata.py and expects these arguments:
%prog datatypes_conf.xml job_metadata_file metadata_kwds,metadata_out,metadata_results_code,output_filename_override,metadata_override... max_metadata_value_... |
38403a9cd03e420d1967017c0467c86cc46a772871725d938ef1f7eab83907a8 | Python | 33,475 | 798 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Transformer modules."""
from __future__ import annotations
import math
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn.init import constant_, xavier_uniform_
from ultralytics.utils.torch_utils import TORCH_1_11
f... |
50d0c97341388b2c6403d8ce45a6d64578d3e6e532c774565606c12e86a5fe68 | Python | 33,492 | 889 | # --- 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 Parcats(_BaseTraceType):
_parent_path_str = ""
_path_str = "parcats"
_valid_props = {
... |
5e8b861ac47504e19fdf877b059e0841096f7f2d57434708c9e29e0072dcb1c2 | Python | 33,516 | 873 | """The out-of-core readers (one per layer), internals of the engine behind ``OSM``
(see :mod:`pyrosm.engine`). Each indexes the file's blobs, decodes them
into shards selecting the layer's elements (and, for point layers, the matching
nodes), then collects and assembles (or streams to GeoParquet) the requested layer. A... |
219df1061b2e7bdc711d91f81e2fea95576c3e5a22f46b43a211fa22e3982116 | Python | 33,531 | 669 | from __future__ import division
import datetime
import os
import random
import time
import matplotlib.pyplot as plt
import numpy as np
import torch
from scipy.interpolate import make_interp_spline
from torch import nn, optim
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
from dataload i... |
6aa7bb6743c7adfbf958be7e115b95ae3cf8c6eeccb57486bbd76cbbc3301a8f | Python | 33,553 | 783 | """Round-61 hon_1 + corr_1 immunizers -- gc inert-reachability completeness.
r60 hon_1: ``np.ndarray`` / ``np.generic`` / ``torch.Tensor`` were HARD expansion leaves of
the gc-referent fallback (the r45/r55 numeric-leaf posture), so a live RNG generator stashed
on a tensor / ``nn.Parameter`` / ndarray-subclass INSTANC... |
b7d2838fa485d2391252c8dd26a72168c8f25d4ba852afe4cfa6dacf12804c26 | Python | 33,557 | 785 | import ftplib
import logging
import math
import operator
import os
import re
import time
from typing import Optional, Tuple
import joblib
import numpy as np
import pandas as pd
import pyteomics.mass.unimod as unimod
import scipy.signal as ssignal
import tqdm
import config
logger = logging.getLogger('suspect_list')
... |
d1088f67506badd052219e91d3e8ae21a7690e5354c8b615e963c84525b4618f | Python | 33,587 | 721 | # importing numpy, pandas, and matplotlib
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
# importing sklearn
from sklearn.model_selection import train_test_split
from sklearn.model_selection import StratifiedKFold
from sklearn.decomposition import PCA
fro... |
2e9d8ce2fdc981c5e380f2b619eda7ebd12c3219230046d0d0631daa7f1a97c5 | Python | 33,640 | 846 | """Workflows for concatenating postprocessed data."""
from nipype.interfaces import utility as niu
from nipype.pipeline import engine as pe
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
from xcp_d import config
from xcp_d.config import dismiss_hash
from xcp_d.interfaces.bids import BIDSURI, Ad... |
fc4837ff83756114bdc808b8171f015d582a7656dcb050c81b0b688cad1f2da1 | Python | 33,642 | 1,025 | # --- 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 Geo(_BaseLayoutHierarchyType):
_parent_path_str = "layout"
_path_str = ... |
41f57bf3ad8c491f49792d60b37499ee6d221275a4c6ae963c9a15830422bee7 | Python | 33,645 | 844 | """
Unit tests for Node API endpoints.
Tests node system management including information retrieval, daemon control,
configuration management, and system actions.
"""
import datetime
import os
import subprocess
import unittest
from unittest.mock import MagicMock, Mock, mock_open, patch
from ethoscope_node.api.node_a... |
2353b1617ca0c4f5b4d5d0898e2367d309646594e6ba672ef984bd43c1c2ed5c | Python | 33,650 | 645 | #==============================================================================#
# Author: Dominik Müller #
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, #
# University of Augsburg ... |
f0a62fd2a493872787faeb674f5c308248834459ae0364b69630652b85a1d935 | Python | 33,663 | 785 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Modules and functions to compute energies and gradients with GROMACS.
The code interfaces with the molecular dyn... |
27d87b9a7cc3fd158126e5703129135ca68e0cf480d330f691c834f695373098 | Python | 33,666 | 803 | """
Unit tests for Device API endpoints.
Tests device discovery, management, control, information retrieval,
image/video operations, and batch endpoints.
"""
import io
import json
import os
import tempfile
import unittest
from unittest.mock import Mock, call, mock_open, patch
import bottle
from ethoscope_node.api.d... |
f86f1b6b01154334cded6fc6509212456a16a68cff744d43f341b6a8b018d35c | Python | 33,697 | 782 | import numpy as np
import pandas as pd
import networkx as nx
from sklearn.cluster import KMeans
from sklearn.metrics import mutual_info_score, normalized_mutual_info_score, adjusted_mutual_info_score, adjusted_rand_score
from scipy.linalg import fractional_matrix_power
from scipy.sparse.linalg import eigs
import math
... |
59806ec4233399d13fbbf0d9d403c7680aa5c7cd90acf2bbb671edc8a8d7fb74 | Python | 33,698 | 986 | '''
The translation dict containing all the app translations.
'''
TRANSLATIONS_DICT = {
#### APP HEADER ####
## TOP HEADER AND NAVIGATION BAR
"Green Algorithms calculator": {
"en": "Green Algorithms calculator",
"fr": "Calculateur Green Algorithms",
},
"Subtitle": {
"en"... |
5595227e1357a202b1d33eb3a91dd20c58be9bbe8c0fdd3c6eed889362610c0a | Python | 33,709 | 1,093 | """
This is mostly functionality from IBL's IO sglx module.
Taken from: https://int-brain-lab.github.io/iblenv/_modules/ibllib/io/spikeglx.htm
and adapted by Ethan Richman to remove some unneeded functionality.
Neuropixel geometry functions adapted from:
https://int-brain-lab.github.io/iblenv/_modules/ibllib/ephys/ne... |
97b6e601ced3e6537010a194f630abe6bfa32844eb943b90a41ffbb668ff473b | Python | 33,722 | 744 | from typing import Generator, Iterable, Any
import logging, copy, sys
from mirp._data_import.generic_file import ImageFile
from mirp.settings.generic import SettingsClass
from mirp.utilities.parallel import (
start_parallel_cluster, parse_parallel_backend, message_parallel_process, cluster_exists, shutdown_cluster... |
1d36589693d2d8186f5b68a9db3abb22dd2a5aad87d66924b34357582d92883d | Python | 33,757 | 609 | #!/usr/bin/env python3
import os
os.system('date')
"""run_wafer_solver.py
Top level command-line interface for the wafer ordering solving and for
computing the affine transformations of the rough alignment.
Copyright (C) 2018-2026 Max Planck Institute for Neurobiology of Behavior
This program is free software: yo... |
9e7274b7020b245d82a1524fde01fb241b05a4c804c574106a373f19f91752df | Python | 33,771 | 686 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import os
import re
import shutil
import subprocess
import tarfile
import time
import zlib
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from urllib import parse
f... |
210b0fbf698595e687a57dca0bdeb3ea7a063c2658b90868800c5b9a05bc91d9 | Python | 33,785 | 889 | """Tests for Param, ParamAccessor, and param-related visualization."""
import os
from os.path import join as opj
from pathlib import Path
import example_models
import pytest
import torch
import torch.nn as nn
import torchlens as tl
from torchlens import trace as trace_fn
from torchlens._errors import AmbiguousOpLook... |
9896961eb359080c3e2b22835991a20afa7eddf96aaeec7c086934e1f7995d3d | Python | 33,803 | 820 | import numpy as np
from mitochondria import Mito
from gates import get_ros, ros_inf
from utils import Recorder, Q_nak
from steady_state import get_steady_state
import figure_properties as fp
import matplotlib.pyplot as plt
from matplotlib import gridspec, patches, colors, colorbar
import matplotlib.font_manager as fm... |
c9c2a32b9841ddae696e237892aabe712e9c75f2959b5cf992ef5446d1e44882 | Python | 33,812 | 1,022 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""General linear model
References
----------
Fox, J. (2008). Applied regression analysis and generalized linear models.
2nd ed. Sage, Los Angeles.
Hopkins, K. D. (1976). A Simplified Method for Determining Expected Mean
Squares and Error Terms in the An... |
0fdbdb0f7801ad45ac128b9aa91abcc340f24cd20ee92ad50fe5189b5a46b8df | Python | 33,830 | 860 | """
Library for loading datasets.
Current classes:
* ZebrafishDataset
author: obanmarcos
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pathlib
from PIL import Image
import re
import torch
import os
from tqdm import tqdm
from QBI_radon import Radon, SARTReconstructor
from skim... |
e1d17f9e1996146f7b6646c622395cace0a2933ed81c9769951682fc0bf8952e | Python | 33,844 | 804 | # Copyright 2017 The TensorFlow 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 applica... |
06c8429f1e71f69379926b746811a3a5137f740d8bae42b75e186ec8c71c49c9 | Python | 33,866 | 805 | #!/usr/bin/env python
"""
run_roi_analysis.py
This script runs ROI trace analyses using a Session object with 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 argparse
import cop... |
402d3427e127754154aab47f12444d16e8066604ff20e84aaceeb9f07b5d7d44 | Python | 33,925 | 858 | """Byte-exact parity of the raw ``primitive_block_decoder`` against the protobuf path.
Every node/way/relation field the raw decoder emits must equal what protobuf decodes
from the same ``PrimitiveBlock`` bytes, on the bundled extracts.
"""
import zlib
from struct import unpack
import numpy as np
import pytest
from... |
a5ee496458779c3c2e76ec515a20c2b8ed42860f25462005ee8c37c43e47dce2 | Python | 33,933 | 587 | """Ruff ratchet governance: the family ratchet and deferral ledger get TEETH.
R70 (round 3+4): the ``[tool.ruff.lint]`` block SELLS a monotone family
ratchet and an honest per-code deferral ledger, but both were prose — no test
pinned ``select``'s contents (a commit narrowing it passed every gate) and
every ledgered s... |
63e05a93d122a4d4db0dd4931b9976363c6c6a6ed5d4fe9a578fd5f1244166b5 | Python | 33,938 | 814 | """
Gregory Way 2017
PanCancer Classifier
scripts/pancancer_classifier.py
Usage: Run in command line with required command argument:
python pancancer_classifier.py --genes $GENES
Where GENES is a comma separated string. There are also optional arguments:
--diseases comma separated string of dis... |
958f08447a8e5f244d35e048f49fefe1fc8b36c919b7d79700cfdbfa413b2697 | Python | 33,951 | 941 | from __future__ import annotations
import logging
import warnings
from typing import Dict, List, Literal, Optional, Sequence, Tuple, 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
try:
from torch_geom... |
a2500cf97250836dadd06237f31241d6d7ab858cbf0284c4b035bc0635c5d053 | Python | 33,974 | 555 | import argparse, time, logging, os, sys, math
import numpy as np
import mxnet as mx
import gluoncv as gcv
gcv.utils.check_version('0.6.0')
from mxnet import gluon, nd, init, context
from mxnet import autograd as ag
from mxnet.gluon import nn
from mxnet.gluon.data.vision import transforms
from mxboard import SummaryWri... |
1a76dd225e252fb83b72fa79ffda6d15910b9fce1c5c71ff55ea872816a8e087 | Python | 33,976 | 930 | #!/usr/env/python
'''
py-iCSD toolbox!
Translation of the core functionality of the CSDplotter MATLAB package
to python.
The method themselves are implemented as callable subclasses of the base
CSD class object, which incorporate the initialization of some variables,
and a basic function for calculating the iCSD, and ... |
d30e5fe75ef01274e32011520e6578ac1295f679319d9c108f459a7e76af41c1 | Python | 33,977 | 922 | """Regression tests for registered-buffer version capture."""
from __future__ import annotations
import gc
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
import torchlens as tl
from torchlens.back... |
98cc23d7863391e00766cd3f7c9dd9a2014ec2c5d3749c7e241cc25b04b2603e | Python | 33,978 | 814 | import numpy as np
import torch
from torch.nn.functional import interpolate
from ovseg.utils.label_utils import remove_small_connected_components_from_batch, reduce_classes, \
remove_small_connected_components
from ovseg.utils.label_utils import remove_connected_components_by_volume_from_batch, \
remove_connect... |
ad2e97f4d56ff8148c9a4b7b469fc27bda564bf8d64487776410c29fb4c96ce1 | Python | 33,981 | 944 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Workflows for collecting and saving functional outputs."""
from nipype.interfaces import utility as niu
from nipype.pipeline import engine as pe
from niworkflows.engine.workflows import LiterateWorkflow... |
fb31f94c00ec0791ddd0301e597d6c746e132a074856ef673d0cbe145f8422ea | Python | 34,007 | 678 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
40_calibration.py — 校准层 + 重测信度 + PAC 启用
================================================================================
补上前两条线留下的三个空白:
空白 1 没有「预测年龄 vs 实际年龄」的校准 → 无法判断"Δ = −4.5 年"的测量学含义
空白 2 PAC (Kuo 2024) 因三套公开数据集都缺个体年龄而无法启用
空白 3 纵向位移是否高于噪声,没有基线(无重测信度 ⇒ 无法定义最... |
df245e193cd28878490322c4454a1429a0dc8c025ca930e708ab63760a46bfa0 | Python | 34,020 | 848 | # --- 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 = "splom"
_path_str = "... |
74c94e59d18119cc7198195a36d4cab3c67209191b878d816460568c9f835b7d | Python | 34,024 | 854 | # 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... |
af2d51b4d34279f0c70277f711e18ca5e6bef690ba624d6e1f33f4439a76527d | Python | 34,046 | 860 | from __future__ import absolute_import
import logging
import os
import shutil
import sys
import sysconfig
import zipfile
from distutils.util import change_root
from pip._vendor import pkg_resources, six
from pip._vendor.packaging.requirements import Requirement
from pip._vendor.packaging.utils import canonicalize_nam... |
2a4fde2e5990e9574c6c66ba235279656a5c3cc3065fb6bb9dd9036aab848c35 | Python | 34,048 | 809 | #!/usr/bin/env python
"""
run_acr_sess_analysis.py
This script runs across session analyses using a Session object with data
generated by the Allen Institute OpenScope experiments for the Credit
Assignment Project.
Authors: Colleen Gillon
Date: October, 2019
Note: this code uses python 3.7.
"""
import argparse... |
2fdbbb917b83beaf8410c5fc9c59d15bc7347c133a1ce4ca3f661899003755fb | Python | 34,088 | 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 = "scattergl"
_path_str... |
c128402e7fb0618c1654eb5484123ce635a00ede60157e8c5db1ca5661c283e8 | Python | 34,095 | 805 | from __future__ import annotations
import logging
import warnings
from typing import TYPE_CHECKING, Dict, Optional
import numpy as np
import torch
from scipy.sparse import coo_matrix
# Import libraries needed for spatial graph processing
from scipy.spatial import Delaunay
from scvi import REGISTRY_KEYS, settings
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.