sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
82cfb85bbe786b72726cb876753c221b341ba7946654ed14cf5089becb275b0c | Python | 6,147 | 144 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from typing import *
from models.model import Model
from models.kan_layers import KAN
class Hu1DCNN_KAN_Net(nn.Module):
"""
Deep Convolutional Neural Networks for Hyperspectral Image Classification
Wei ... |
c5587c7cd4cd03293a63f46865c898d3b5ad858f182793d5457d0337d30798ec | Python | 6,147 | 184 | # ----------------------------------------------------------------------
# Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/... |
853ad2e8363f0010d5d64ab794680c055638fc0f26dfdd2b755ed82b12a55ca0 | Python | 6,148 | 99 | """Spatial Dopamine Field Prototype (SHADOW MODE: nothing is fed back into the reservoir).
1. Audits the CX512 anatomy actually present (data_availability.json).
2. Obtains per-token reservoir states: a short Continuous Generation run (optionally with the
existing DA-neuron cue) or an existing run directory saved w... |
b83a6b6902918f76c08fba6e8205772a75a555695f7a0311a2129ed7e49f0444 | Python | 6,148 | 184 | """Module to convert from electrode to sources using linear matrices
"""
from copy import deepcopy
from functools import partial
from logging import getLogger
from multiprocessing import Pool
from numpy import (arange, asarray, atleast_2d, empty, exp, isnan, nan,
nansum)
from numpy.linalg import no... |
050d6cd62bf681430dceddccab25a23b1d0bde4d5ebc142e942fc8830dafe563 | Python | 6,150 | 175 | """"""
"""
Prosper_nn provides implementations for specialized time series forecasting
neural networks and related utility functions.
Copyright (C) 2022 Nico Beck, Julia Schemm, Henning Frechen, Jacob Fidorra,
Denni Schmidt, Sai Kiran Srivatsav Gollapalli
This file is part of Propser_nn.
Propser_nn is free softw... |
290d3755517ba968fbb044e832f063257b57d6c59f04dfd8807ea743e1b23c01 | Python | 6,151 | 197 | # coding=utf-8
# Copyright 2026 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... |
cddb3ac058b65640b82d55001f017e3c03a6073bac3abb20bb207cd518e35b15 | Python | 6,151 | 130 | import lightning.pytorch as pl
import torch
import torchmetrics
from utils.runner.metric import youden_j, c_index
import shap
class LitFullModel(pl.LightningModule):
def __init__(self, models: dict[str, torch.nn.Module], optimizers: dict[str, torch.optim.Optimizer], config: dict):
super().__init__()
... |
76cf34caede8022fa705b1e3147ad7ca5de951bf4420d81c172e9cf4e7ee5dbd | Python | 6,152 | 198 | from os import listdir
from os.path import isfile, join
import pandas as pd
import librosa
import numpy as np
from sklearn.model_selection import train_test_split
from timeit import default_timer as timer
from sklearn.metrics import classification_report, confusion_matrix
#import seaborn as sn
import matplotlib
matplo... |
d5fc95378acef6f67b325113474509619fc5e2092fbd4371c260b5e4f33144b7 | Python | 6,152 | 135 | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
import os
import sys
import io
import tensorflow as tf
import matplotlib.pylab as plt
from tensorflow.keras import layers
from tensorflow.keras import models
import numpy as np
from PIL import Image
import ... |
0348899744fb79c5374b75962d649b47948283db46a84d97c50afc76b1bdc08f | Python | 6,154 | 164 | #!/usr/bin/env python
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Non-signalized junctions: crossing negotiation:
The hero vehicle is passing through a junction without traffic lights
And encounters another vehicle passing across the junc... |
1a1989c794a523ead780360cb3f1f57d2c695257ad08178faeca4c91f6855333 | Python | 6,154 | 145 | """Validator for HED ID consistency across schema versions."""
from semantic_version import Version
from hed.errors.error_reporter import ErrorHandler
from hed.errors.error_types import SchemaAttributeErrors
from hed.schema.hed_cache import get_available_hed_versions, get_hed_versions, get_library_data
from hed.schem... |
68825c14be37587e5597de78173f5519da1d78ca038162ab057b13aca50ae3fe | Python | 6,154 | 183 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
74ad54c40a472368030645839955053871f48587cacf51321399aa5eb7bfb9f2 | Python | 6,155 | 199 | from __future__ import division
# coding: utf-8
# In[ ]:
from builtins import range
from past.utils import old_div
import numpy as np
import scipy
import math
import caffe
import pawData
import pawconfig as conf
from scipy import misc
from scipy import ndimage
import tensorflow as tf
def scalepatches(patch,scale,nu... |
872a963e797f5104f1739122373a0d9c95ba0a438ecbff3aeda936c95dbae979 | Python | 6,155 | 136 | """
Rerun single cells in BGLibPy (for extra reporting and access to parameters to be modified)
authors: András Ecker, Sirio Bolaños Puchet; last update: 01.2023
"""
import os
import gc
import time
import logging
import numpy as np
import pandas as pd
import bglibpy
from assemblyfire.config import Config
import asse... |
e05fe6dea6a2d7f05bbddcadec67c53e5d6671955821dfbe7686e4b07c660f10 | Python | 6,155 | 195 | """Widget to redefine the labels.
"""
from logging import getLogger
from pathlib import Path
from re import split
from PyQt5.QtCore import Qt
from PyQt5.QtGui import (QColor,
)
from PyQt5.QtWidgets import (QAbstractItemView,
QFileDialog,
... |
97a242fc674791fb4a190111e32376e3759c58c91eb985fc239b2dcdb05d5a04 | Python | 6,157 | 168 | # -*- coding: utf-8 -*-
"""
Created on Wednesday July 13th 2022
@author: Pablo Maceira Elvira
This script is meant to find the best model to predict the day when a person will reach an accuracy plateau, based on
initial parameters of speed and accuracy. The estimation of the plateau was done using the script
... |
d224bd899931fde60940564a8d1a41169f230acd5cff51f3d245aae820672558 | Python | 6,158 | 186 | from __future__ import annotations
# built-in
from difflib import SequenceMatcher as _SequenceMatcher
from typing import Any
# app
from ..utils import find_ngrams
from .base import BaseSimilarity as _BaseSimilarity
from .types import TestFunc
try:
# external
import numpy
except ImportError:
# built-in
... |
0b0a993e0dd843a73fc7c1ff42f690ad3c3641c1eacabf29bf32e145627c041a | Python | 6,159 | 178 | ### Load packages
########################################
print("----- Loading packages -----")
# General
import numpy as np
import pandas as pd
import os
import csv
# Computing
import scipy.io
from scipy import stats
from heapq import nlargest # gives you the largest values of a list
# Visualization
import matpl... |
06665d5b36142fbedeafedbd6a9701f59d9ef98f828b4aef7047dfe7bd19420c | Python | 6,161 | 193 | # -*- coding: utf-8 -*-
"""settings.dtype (YAML) and calculator default_dtype (constructor)."""
import os
import tempfile
import pytest
import tensorflow as tf
import yaml
from tensorflow.python.lib.io.file_io import FileIO
from pinn.calculator import PiNN_calc
from pinn.models.base import (
apply_dtype, dtype_fr... |
4ca270187f6c5b8109fb89e9d7bb637f29b65302e1f277107d585aba9f3ee819 | Python | 6,163 | 177 | # coding=utf-8
# Copyright 2026 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... |
62abb72898f84bd254064ab5f8fedf84629dc53291e6895ed6e3dcd1f7b30199 | Python | 6,163 | 173 | """Shared probability transforms, spline bases, and calibration-curve diagnostics."""
from __future__ import annotations
import numpy as np
from matplotlib import pyplot as plt
from patsy import dmatrix
from SurvivalEVAL.evaluations.util import fit_least_squares
from SurvivalEVAL.evaluations.util_plots import pp_plo... |
7d57992a4da54a3ddd67dbfc6134dcd63f68cbe8c46b7af338817b17e0a92513 | Python | 6,163 | 145 | """
Standalone napari launcher scripts written into a registration run's output
folder, so the user can double-click to open napari with the run's data
loaded - no GUI required.
Two launchers, each a single ``.bat`` file that is *also* a valid Python
script (a polyglot). Line 1 is a batch command that re-invokes... |
6f2f01fe331414321067b7f0257e21ce07a45106714c1eb0b082e419faedb5d4 | Python | 6,164 | 181 | from __future__ import division
import argparse, os
import pandas as pd
import joblib
import pybedtools
import numpy as np
def __is_valid_file(arg):
if not os.path.isfile(arg):
parser.error('The file {} does not exist!'.format(arg))
else:
# File exists so return the filename
return arg... |
845ab71e0519982f3426a600cedced48e15289f0a13cb187ba2462e647ed51f7 | Python | 6,164 | 135 | """
VOCAB_DETERMINACY.py (pilot, written 2026-09-07)
THE QUESTION. Eckstein's own conclusion names two reasons for transmitter
misprediction: co-transmission, and "expression of transmitters outside of our
training set". He states it qualitatively, from examining known cases. He does not
ask whether his own confiden... |
868f997de3f2e5c4eba4d87dc3e2f31b0ea332237d6405c04ff972bb64a02f94 | Python | 6,164 | 186 | import torch
import numpy as np
from .base import RadialLayer, CutoffLayer
from torch import nn
from typing import List, Callable, Optional
__all__ = ["ChebyshevPoly", "SpinChebyshevPoly", "BesselPoly", "MLPPoly", "BehlerG2"]
class ChebyshevPoly(RadialLayer):
"""
Atomic cluster expansion for accurate and tr... |
7468c8fe7fe6ea1eef787bcb3ffec58dbfe200311b6cc350ff6762d5137d0321 | Python | 6,165 | 159 | import numpy as np
from config import DATA_DIR
import os
import csv
from skimage.io import imsave
import shutil
import preprocess
RANDOM = np.random.RandomState(42)
class BatchIds:
def __init__(self, n, random = True, reset = True):
self._n = n
self._random = random
self._reset = reset
... |
0f6073536b955d357d09c316d2828882a3480265f1261f706ad014ef8dba82ec | Python | 6,166 | 132 | import os
import re
import tarfile
input_file = '/staging/sfeng77/dataset/suzukii_WGS/input_list.txt'
metrics_table_sample = '/home/sfeng77/jobs/test_pipeline/quality_metrics_sample.txt'
metrics_table_run = '/home/sfeng77/jobs/test_pipeline/quality_metrics_run.txt'
outdir_staging = '/staging/sfeng77/test_pipeline/out... |
19226ef4cabe801ffa5ca4b40150d358025d5b13c43fc3c59b1c2135d50e3c2c | Python | 6,168 | 167 | import os
import pdb
import torch
import numpy as np
from torch import nn
from scipy import stats
from scipy import sparse
from .VAE_vae import VAE_vae
from torch.distributions import Normal
from torch.distributions import kl_divergence as kl
class VAE(nn.Module):
def __init__(self, opt):
supe... |
73bef526446e2c92947ec1f9d7c90a175ca999eab22706b131a1d4eeb91436ab | Python | 6,168 | 167 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2024 Clinic for Diagnositic and Interventional Radiology, University Hospital Bonn, Germany
#
# 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 ... |
e5d47699851b183eb484442ba51759fcc46fa44cfbbf124c9f1f1d56108a8275 | Python | 6,171 | 145 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from typing import *
from models.model import Model
from models.kan_layers import KAN, FastKANConv1DLayer
class M1DCNN_FULL_KAN_Net(nn.Module):
@staticmethod
def weight_init(m):
if isinstance(m, nn.Linear) ... |
2257b6e964017c489e810f2178627a27caefccaf0b4c10a0904b2f51a4233134 | Python | 6,175 | 167 | # Node-group asset "Edge Info" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump.
from typing import TYPE_CHECKING
fro... |
8bc0442cd471f00c1ce2f7d4aa14e31baf54567bdfbc5f97e7eb7437186702c0 | Python | 6,176 | 127 |
import os
import json
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace
# inspired by the NVIDIA nnU-Net GitHub repository available at:
# https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Segmentation/nnUNet
# inspired by
# Bianconi, Andrea, et al. "Deep learning-based a... |
15a81559c26293628de173577af3da4e127729850a10e75d6b84468436d4015a | Python | 6,177 | 111 | """Run personalisation on the full 12-lead ECG beat recording"""
import sys
import multiprocessing
import os
# import time
from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from datetime import datetime
from src.cellular_models import MitchellSchaefferAPDdictionary
# imp... |
03b94907c478e1efb933c9ce7cb81594bdda976e5a3676086ffc7cd4b21731fe | Python | 6,178 | 206 | from __future__ import print_function
import os
import sys
from skimage.transform import resize
from skimage.io import imsave
import numpy as np
from keras.models import Model
from keras.layers import Input, concatenate, Conv1D, MaxPooling1D, Conv2DTranspose,Lambda
from keras.optimizers import Adam
from keras.callbacks... |
61038ac0c4f0b4605bb18e1d2f91d84efc1378ff70210adae4cbcf35d769c59b | Python | 6,181 | 180 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeErro... |
6bd6a7304b24504b7515ce90d17600adbb0e11256b4daf397ce1a0bccc40fb6c | Python | 6,181 | 99 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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
#
# ht... |
b7731d04166bba43b9bb87cbcb6360558ed7c39bdea5dbd0af437d32bcc70559 | Python | 6,183 | 164 | import pandas
import rtree
import networkx
import numpy as np
import cv2
from skimage.measure import regionprops
from merlin.core import analysistask
from merlin.util import imagefilters
class SumSignal(analysistask.ParallelAnalysisTask):
"""
An analysis task that calculates the signal intensity within the ... |
b1e36c99c721f4e1075d88ab87c3a897bc3cc4385f3536cb8f9ac7002fa073fa | Python | 6,184 | 213 | """
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
node = self
... |
600fe0ed0120b130b40ded9e810a352de21c1315c7533fdf327735eb1928408d | Python | 6,185 | 177 | # coding=utf-8
# Copyright 2026 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... |
ae8f65a234412d4d6de3a0f705a8be93441d30da62c7d19064d90b3223298275 | Python | 6,186 | 165 | import torch
from torch import nn
from torch.nn import functional as F
from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule
from elasticai.creator.nn.integer.math_operations import MathOperations
from elasticai.creator.nn.integer.MPQ.avgpooling1dflatten.design import (
AVGPooling1dFla... |
0801a7bfd329e4dc67c3e14b005936aff815e5a6cf5853617a70e9b5b9ff7eba | Python | 6,189 | 95 | """LINEAGE_SPIKES.py 2026-10-08. Pre-registration: 04-NOTES/PREREG-2026-10-08a-LINEAGE-SPIKES.md
Out-of-sample test of the inequality on new sign sets. Four whole-brain lineage worlds on Shiu et al.'s official v783 file:
every neuron FlyWire leaves uncalled (votes, no call) takes a sign drawn from its hemilineage's sha... |
f111d2d2b1ec0a34e939d9bd0e17a81fea9d7f03291391229d43b3414ddca896 | Python | 6,189 | 104 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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
#
# ht... |
1d29c229294dddd08aa1865e4f5494452ae184cb1cb021e432b0706132546527 | Python | 6,191 | 158 | # -*- coding: utf-8 -*-
"""
Created on Apr 16 2023
@author: Jonas A. Thiele
"""
### Get results of prediction models trained in the main sample
### (610 subjects of the HCP) with FC of different numbers of most
### relevant links (edges) determined via stepwise LRP
#%% Imports
import numpy as np
impor... |
6abbef2c798e1b7420372b4500214f7c716ce88b6cc8909f185e183ea7ec9cbb | Python | 6,192 | 198 | # coding=utf-8
# Copyright 2026 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... |
039ba7c9216d900cf0d4cd604e5703b9e2fd4c81c073ff3f0f00050be72ba5b2 | Python | 6,193 | 207 | from typing import Any
from pytest import fixture
from elasticai.creator import ir
from elasticai.creator.ir2vhdl import (
DataGraph,
Instance,
LogicSignal,
LogicVectorSignal,
NullDefinedLogicSignal,
PortMap,
Shape,
Signal,
factory,
)
from elasticai.creator.ir2vhdl.ir2vhdl import I... |
8cd07295eeda91887e8caf4784005d2c0e0239ca5bc302f41a8a2306e3d498e7 | Python | 6,193 | 138 | # regtools/registration/gui/batch_2d_model.py
"""Pure-data model for the Batch 2D registration tab (no Qt imports).
``BatchRow`` is one image's full registration config; ``BatchConfig`` is the
whole batch (shared defaults + points mode + ordered rows + template). Both
serialize to/from plain dicts so the settings... |
31621c9c416c89b68fdc9002525d103882015cfb1ef152b5c4be84cc96adac52 | Python | 6,194 | 175 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 14 13:14:25 2020
@author: adele
"""
from os.path import join as joinP
import pickle as pk
from collections import Counter
import numpy as np
import matplotlib.pyplot as plt
import torch
from sklearn.metrics import r2_score
import torch.nn as nn
imp... |
fce8b02badd59946eddbe05cc0f3529f8373bd69e68be57c33d88635427f837a | Python | 6,194 | 199 | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import os
import pathlib
from argparse import ArgumentParser
import pytorch_lightning as pl
import sys
import torch
from fastmri.data.mri_da... |
1a59d99c3dc370b347d8cd183254dbe28a81feb77c6cf895065ffa1b35e9690c | Python | 6,198 | 188 | # coding=utf-8
# Copyright 2026 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... |
7da474acda73cbdc967b056e0fd2c8150dfed311cbaff4ac52ff17d6d95cdd68 | Python | 6,198 | 156 | from collections import namedtuple, defaultdict
from itertools import count
from pddlstream.language.constants import get_parameter_name
#from pddlstream.language.conversion import values_from_objects
from pddlstream.utils import str_from_object, is_hashable
USE_HASH = True
USE_OBJ_STR = True
USE_OPT_STR = True
OPT_PR... |
64a974264b1d35982f2c27628355a50e9a1927efd7db21dd7f8683215fc8cd80 | Python | 6,199 | 187 | # coding=utf-8
# Copyright 2026 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... |
41bb1f2f0fdfec2c989b396e86f734b89f34fb12aec436baf154d36bf7945fcc | Python | 6,200 | 191 | from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
import numpy as np
import math as m
from mpl_toolkits.mplot3d import Axes3D
import torch
import torch.optim as optim
from Rosenbrock import Rosenbrock_func
from Quadratic import Quadratic_func
from Rastrigin import Rastrigin_func
def ... |
c0f408085bd6da8aea65ef0beaaf3689f84b3c5b419802e67b52387b45c9a48c | Python | 6,200 | 140 | #%%
import pyrootutils
pyrootutils.setup_root(search_from='/work/cniel/sw/BrainAge_torch/project/', indicator=".project-root", pythonpath=True)
#%%
import torch.nn as nn
from types import SimpleNamespace
import tltorch
# from coral_pytorch.layers import CoralLayer
from src.models.components.resnetblock import R... |
1e628823082b9a3aef16adc99fb3ce25beeb950280953f9d23c8e7f0953736f9 | Python | 6,202 | 166 | import torch
from elasticai.creator.nn.integer.quant_utils.Observers import GlobalMinMaxObserver
from elasticai.creator.nn.integer.quant_utils.QParams import (
AsymmetricSignedQParams,
AsymmetricUnsignedQParams,
SymmetricSignedQParams,
SymmetricUnsignedQParams,
)
def test_AsymmetricSignedQParams():
... |
508a665d63904c525e2a7066da8bcf0479f7c91ac05f39ac80005f7b3fd1328e | Python | 6,202 | 204 | import pytest
from elasticai.creator_plugins.lutron_filter import make_split_conv_rule
from elasticai.creator_plugins.lutron_filter.rules import _ir as ir
from elasticai.creator_plugins.lutron_filter.rules._ir import (
FilterDecorator,
)
from pytest import Subtests
from elasticai.creator_plugins.grouped_filter imp... |
0ae9864340a32f300b23f839e7de72d0032ad6b9c14db5a87994643d9db46b13 | Python | 6,203 | 154 | #!/usr/bin/env python
from __future__ import print_function
import os
import re
import subprocess
import sys
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
from setuptools.command.sdist import sdist
from setuptools.command.build ... |
76e4d402b5a404e76431d5ef9263cdfe989e6ed37be6d67dc5b8f5b2bc5d2589 | Python | 6,203 | 208 | import glob
import os
import platform
import subprocess
import sys
from typing import Iterable
from setuptools import Extension, find_packages, setup
try:
# at the second run for install we already have numpy installed as denpendency
from numpy import get_include
numpy_include = get_include()
del get... |
b0921b3042f7dc7ce3c2ee0528ddf08a79dcdbbe2d4402aff6f2801607436ca9 | Python | 6,207 | 204 | def configs_optimal_core():
return {
# A*
"astar_blind": [
"--search",
"astar(blind)"],
"astar_h2": [
"--search",
"astar(hm(2))"],
"astar_ipdb": [
"--search",
"astar(ipdb)"],
"astar_lmcount_lm_merged_rhw_... |
05315d39073bf9b00a24a07e0c94998532999aba0bbc5b1e214dee7715c972cf | Python | 6,208 | 181 | import sys, os
sys.path.append(os.path.abspath("."))
os.environ["KMP_DUPLICATE_LIB_OK"] = "True"
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import torch
import torch.nn as nn
from examples.fuzzy_example.dummy_data import createModelData_T
from prosper_nn.models.fuzzy.membership_functions... |
816b32bf61613c739588b874ce193124baf8f7d083b2b29278fc51256fbe5fe5 | Python | 6,208 | 140 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from typing import *
from models.model import Model
from models.kan_layers import KAN, FastKANConv1DLayer
class Hu1DCNN_KAN_Net(nn.Module):
@staticmethod
def weight_init(m):
# [All the trainable parameters ... |
f3c63122ada7d6051715e706d8abb57cca1b1ddfe471f85872736f9ff33b006b | Python | 6,208 | 194 | # coding=utf-8
# Copyright 2026 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... |
089ba7629552c98aa9dccbb746e3e995cbd79f6d903d112a002924d0c0d441c8 | Python | 6,211 | 190 | """ Cross-correlation function
------------------------------
"""
###############################################################################
# Import the necessary modules.
import os
import sys
import numpy as np
import time
import h5py
import subprocess
import mesocircuit
import mesocircuit.mesocircuit_framew... |
9ebc7d0bcb32926629fc4e6fc92bbb224d6b86135772e7c065498a0c8d35706a | Python | 6,212 | 174 | from simtk import openmm, unit
from simtk.openmm import app
from simtk.openmm import XmlSerializer
from analyse import *
import time
import os
import sys
from argparse import ArgumentParser
import random
parser = ArgumentParser()
parser.add_argument('--name',nargs='?',const='', type=str)
parser.add_argument('--replica... |
edfb44034604325f48d80376c254de9cf399876b74c63aa68501a86b5c8bb9d3 | Python | 6,213 | 131 | import os
import mne
from scipy.signal import hilbert
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from Functions.invert import invert
from scipy.stats import sem
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
from matplotlib.ticker import StrMethodFormatter
p... |
04951b3085a4f942ace8210383714d3c98a424a526ae6c5381bc54b1ad49c419 | Python | 6,214 | 139 | import torch.nn as nn
import torch
import timm
import torch.nn.functional as F
from timm.models.layers import trunc_normal_
from .baevit import RSNA_BAEViT
from timm.models.registry import register_model
@register_model
def rsna_baevit(pretrained=False, num_classes=1000, drop_path_rate=0.2, layer_lr_decay=1.0):
r... |
313fed141e7a7911616b7fc3e1564dafa17433c82bbfdf0398174658838e6c54 | Python | 6,214 | 164 | # pylint: disable=invalid-name, too-many-branches, line-too-long
"""Models for experiments and functions for setting them up"""
from importlib import import_module
import os
from omegaconf import OmegaConf, DictConfig, open_dict
from src.settings import LOGS_ROOT
def model_config_factory(cfg: DictConfig, k=None):
... |
e35337bad372779ce0750709f51959352fc4bc31fd1dcb98c23ecebaec127fcd | Python | 6,214 | 194 | # -*- coding: utf-8 -*-
#
# Ensure synthetic data generator functions used in tests work as expected.
#
# Builtin/3rd party package imports
import numpy as np
import pytest
from syncopy import AnalogData
from syncopy.shared.tools import StructDict
from syncopy.synthdata import collect_trials
from syncopy.synthdata im... |
71ff55ffa71333e92e5e3cf44bb91fb1e5acdebbb370192d2d4ad704d6e0cfb6 | Python | 6,215 | 160 | #!/bin/usr/python3
# Use example: python preprocessing.py /home/melanie/BIDS_data_test /home/melanie/BIDS_data/test/preprocessed /home/melanie/BIDS_data_test/transforms
## Import libraries
import os
import shutil
import tempfile
from glob import glob
import argparse
import numpy as np
import pandas as pd
import torc... |
43900217c8f3c2be071b9efcc970a767a6cde167d0398808ab8a17aacaf6c6a0 | Python | 6,216 | 171 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2023 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : preprocess.py
# Author : Yufeng Liu
# Date : 2023-01-17
# Description :
#
#====================... |
b26005d43e60d055dbadc391ac6337f7da2966cfa3599477cd25d6545b168b14 | Python | 6,217 | 202 | #!/usr/bin/env python
import sys
import getopt
import string
from optparse import OptionParser
import re
def extractSplitsFromBwaMem(inFile,numSplits,includeDups,minNonOverlap):
if inFile == "stdin":
data = sys.stdin
else:
data = open(inFile, 'r')
for line in data:
split = 0
if line[0] == '@':
print(lin... |
8f2bd198a1fd6484aa48838f9d6f5f19ec24216293a634be9b958674a2f5997d | Python | 6,221 | 138 | """Canonical point-orientation transforms shared by the preview and the run.
When the registration GUI reorients the moving image/volume before registration
(2D: tissuecyte -> rotate -> flip_h -> flip_v; 3D: axis permutation -> flips),
the cell/input points must travel through the SAME transform or they land on th... |
5292b956ca67a26770262722e2692f662f618eb6b7d9517246d43308b28ff890 | Python | 6,222 | 162 | #! /usr/bin/env python
"""Python bindings for the flagser C++ library."""
import os
import codecs
import re
import sys
import platform
import subprocess
from pkg_resources.extern.packaging import version
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
PACKAG... |
f9fff9c6c19f07ef8d867c87112c868ec36a79c26090aba486f4402276cf7646 | Python | 6,222 | 206 | """Base jobs for espresso."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ase.atoms import Atoms
from ase.io.espresso import Namelist
from ase.io.espresso_namelist.keys import ALL_KEYS
from quacc.calculators.espresso.espresso import (
Espresso,
EspressoProfile,
EspressoTempl... |
0d9f19e0ce8e0c299bf090401a87643d6ce200523cfecda30a3e72d78d5cc5dd | Python | 6,223 | 148 | """Tests for regtools.config_menu.status."""
import os
import pytest
class TestEnvironmentStatus:
def test_returns_dataclass_with_expected_fields(self):
from regtools.config_menu.status import get_environment_status
s = get_environment_status()
# Must have every field, even wh... |
daf2fa02805c998a56e2ecea33681d37388112a275b286b7274fc8867b834e76 | Python | 6,223 | 176 | import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
# for i in physical_devices:
# tf.config.experimental.set_memory_growth(i, True)
# export CUDA_VISIBLE_DEVICES="0"
import pandas as pd
import numpy as np
import sonnet as snt
from tqdm import tqdm
import time
import os
import enformer5
i... |
1e813cdff17ac2fe5d17843683a63ede418a981e87b15f5c1c2270d360a7ec4f | Python | 6,224 | 210 | from logging import getLogger
from numpy import (asarray,
c_,
dot,
nanmean,
nanmedian,
moveaxis,
where,
zeros,
)
from numpy.linalg import norm, lstsq
from ..attr impo... |
99f2bc46954d31a59cd2c2ce5a4a2ea7c8c7e13aaf4b2ea195f374f1e84e8c6f | Python | 6,224 | 195 | # coding=utf-8
# Copyright 2026 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... |
1234489d7ee348a94335f9578eb01a94d33bc05ce51b0b670b53e8634f2f02f1 | Python | 6,227 | 168 | # -*- coding: utf-8 -*-
"""
script for computing the quantities required by the cascade-based spike rate
models (LNexp, LNdos), i.e., steady-state spike rate and mean membrane voltage
of an exponential/leaky integrate-and-fire neuron subject to white noise input
as well as quantities derived from the first order ra... |
ba88609fb713cd9b7bd92e583754436fe0c4d737799200ca83dc8822eab8a84c | Python | 6,227 | 164 | import itertools
from os.path import dirname, join, realpath
import biotite.structure.io.pdb as biotite_pdb
import biotite.structure.io.pdbx as biotite_cif
import numpy as np
import pytest
import molecularnodes as mn
import molecularnodes.entities.molecule.pdb as pdb
import molecularnodes.entities.molecule.pdbx as pdbx... |
3dcad54722f16db168a0cb384eca7489ae93e35645bcd0c7b99d332c662970e2 | Python | 6,230 | 123 | """Which Laplacian correspondence sources may use the new masking, and which may not.
The boundary is deliberate and narrow:
* ``foreground_boundary_edges`` - the ``'exterior'`` source, outer silhouette only -
**uses** the new masking (percentile-normalized Multi-Otsu-4, components above a floor).
* ``getCont... |
85d3e395f3173885ae24f7a5cd5bb8615b73f4b52a17662b0c70f9c9e6929a49 | Python | 6,233 | 159 | import pandas as pd
import numpy as np
import torch
from torch_geometric.data import Data
from torch_geometric.transforms import RandomLinkSplit
from torch_geometric.nn import SAGEConv
import torch.nn.functional as F
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import accuracy_score, f1_score
i... |
052377a8dfbfb1fff19a4b30807008c5108fd0a90054c8d986cc95e098a35cd2 | Python | 6,238 | 179 | # coding=utf-8
# Copyright 2026 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... |
05e3d6abbe0131b83147e17ee295e1e8b21b44d3ab3e84dfcdc8c7d65927df9a | Python | 6,238 | 191 | # coding=utf-8
# Copyright 2026 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... |
83b21a8ec5d911f23e6619e7c2aa69a2328945ac944291cb2a73e4449c1cce81 | Python | 6,239 | 164 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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
#
# ht... |
8ee51dd61cec5e6920a161c7371e92b31c90c3b47968c5723431d84307ab3387 | Python | 6,239 | 155 | from typing import Callable, List, Union
import numpy as np
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
Molecule = Union[str, Chem.Mol]
FeaturesGenerator = Callable[[Molecule], np.ndarray]
FEATURES_GENERATOR_REGISTRY = {}
# define a decorator
def register_features_generator(features_generat... |
95e5bfe21a81266d0fea647d0caa60a595da66ccc0f72c4bfd493eb30cd9222c | Python | 6,240 | 188 | """
The class used to define an adjoint source for use in the adjoint
(i.e., reverse-mode) simulation.
"""
from meep import CustomSource
import numpy as np
from scipy import linalg, signal
class FilteredSource(CustomSource):
def __init__(
self,
center_frequency: float,
frequencies: np.ndar... |
f62eee176a0dfc38918c00ca246adebd4071e24c868016fc92d369761f1cea2c | Python | 6,240 | 165 | import torch
import torch.nn as nn
from elasticai.creator.nn.integer.design_creator_module import DesignCreatorModule
from elasticai.creator.nn.integer.quant_utils import (
AsymmetricSignedQParams,
GlobalMinMaxObserver,
)
from elasticai.creator.nn.integer.rnnlayer import RNNLayer
from elasticai.creator.nn.inte... |
bd902583d2a4ea512827b3d6fbcae9ce591ddda7e7847d4d65b393f8c4145ee7 | Python | 6,241 | 160 | """
Global variables and classes for the package
"""
__author__ = 'martinez'
import numpy as np
STR_PEAK_ID = 'peak_id'
MS_CLST_LABELS = 'ms_clst_lables'
# Structs
PK_COORDS = 'pk_coords'
###########################################################################################
# Classes
###################... |
448628389aa5749ca90f9c30953b6993cce1f8b32bd063c5149cbe8704c49b88 | Python | 6,242 | 127 | from pytorch_lightning.utilities.types import STEP_OUTPUT
import torch
import torchmetrics
from typing import Any, List, Optional, Tuple
import pytorch_lightning as pl
class AutoEncoder(pl.LightningModule):
"""
Trains several layers via an autoencoder objective. In addition,
trains a linear layer for class... |
613998300c833810c8de509f0b64d1ab2237e34dc7fd856fd28d4284ab084d38 | Python | 6,242 | 177 | # coding=utf-8
# Copyright 2026 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... |
85266d24cd721b8534d4ebfa26b6232383c41d2ae4f86d4e51f48986c1b85534 | Python | 6,243 | 142 | import numpy as np
from pathlib import Path
import scipy
from torch import is_tensor
from wsilearn.dataconf import TrainType
from wsilearn.wsi.wsd_image import ImageReader, PixelSpacingLevelError
from wsilearn.utils.asap_links import make_asap_link, make_link
from wsilearn.utils.cool_utils import ensure_dir_exists, ... |
faab3fd6f99b30a9bc8895f74002365b5d99660a6aaaa219293f37840b276de5 | Python | 6,243 | 172 | # -*- coding: utf-8 -*-
#
# Backend functions for calculating cross spectral densities
#
#
# Builtin/3rd party package imports
import numpy as np
# syncopy imports
from syncopy.specest.mtmfft import mtmfft
from syncopy.shared.errors import SPYValueError
from syncopy.shared.const_def import spectralConversions
def c... |
6ab81cc2302274d392964ab93e2c824b27932a7ce2a7f93da792264f74d727a9 | Python | 6,244 | 162 | import argparse
import logging
import numpy as np
import pandas as pd
import sleeplab_format as slf
from datetime import datetime, timedelta
from functools import partial
from pathlib import Path
from pyedflib import highlevel
from typing import Any
logger = logging.getLogger(__name__)
def parse_hypnogram(ann_head... |
d21b15c7c189d9f30c37d94fd1d4b66a5fc99832fa12b61934a2defbc52f3ed1 | Python | 6,246 | 175 | # coding=utf-8
# Copyright 2026 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... |
5a64d3cf41d51f8e0626927a869a6caed536815e26fe7c07c740cdf6e284df1a | Python | 6,248 | 163 | # coding=utf-8
# Copyright 2026 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... |
c1ff1b30cfea1f8d49d5a962ede5e47d6c7f815585a136311474ece74eaa51b8 | Python | 6,248 | 166 | import argparse
import numpy as np
import os
import pandas as pd
import random
import sys
from tabulate import tabulate
import torch
from old_code.dataloaders.dataloader_item_classification import get_item_classification_dataloader_eval
from src.inference.model_initialization import get_classifiers_checkpoints
from s... |
04ff0102367d3197ff0e8c9160e01919495787bf2d83b9ff1387b7725e7eab0e | Python | 6,249 | 139 | import argparse
import sys
import numpy as np
import os
import pandas as pd
import json
import random
import torch
from constants import *
from src.dataloaders.rocf_dataloader import get_dataloader
from src.training.train_utils import directory_setup, Logger, train_val_split
from src.models import get_regressor, get_... |
2301ec3f39bf16ebb8bb893b8ae1cf1edc73faf2baac0a6925303da35a102686 | Python | 6,249 | 175 | import bct
import math
import numpy as np
import networkx as nx
from sklearn.utils import check_random_state
def strength_preserving_rand_rs_dir(A, rewiring_iter = 10, sort_freq = 1,
R = None, connected = None,
seed = None):
"""
Degree- an... |
86f97b64aeab3edf77dc52c07f4e92be80e0d6cd6ca6e24e797c71b0a33db945 | Python | 6,251 | 138 | import os
import warnings
import argparse
import pandas as pd
import numpy as np
from glob import glob
from nilearn.image import new_img_like
from nilearn.glm.second_level import SecondLevelModel
warnings.filterwarnings("ignore")
def nifti_tstat_to_cohensd(tstat_img, n):
"""
function converts NIfTI t-statisti... |
bb441e45d916a72cae195cd7804ecf423f00b38f58f72d86ef640cadaf260ddb | Python | 6,252 | 235 | from glob2 import glob
import tifffile
import os
import numpy as np
import matplotlib.pyplot as plt
from skimage import exposure
from imgaug import augmenters as iaa
import cv2
import tensorflow as tf
from tensorflow.keras.preprocessing import image
def normalize99(X):
"""normalize image so 0.0 is 0.01st percentil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.