sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
bea4e8e0a089e61a4ca98d9c8e408544e09b84a14afccb5b80661176722ed168
Python
12,122
329
# # MIT License # # Copyright (c) 2022 GT4SD team # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
d6bee1dbf1ac03f43816404c6e43952414fcd038bd666f512453eb6cbe36ab58
Python
12,123
292
"""""" """ 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...
1f83a12c6a73991fb8dd535cf2f5f51192ac7019d6f3d0f70b76b4bdf4bf10af
Python
12,125
386
# 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...
0d5136d783344e6f2178f390eb5090bf67bc856a19e85f6dd5abaafcf9c1856f
Python
12,128
281
#!/usr/bin/python3 import os import argparse import numpy as np import tensorflow as tf from tensorflow.python.keras.callbacks import TensorBoard, ModelCheckpoint, \ EarlyStopping # imports from this package import utils from cnn_lib import AugmentGenerator from architectures import create_model from visualiza...
91ed109b7aaf7fb4eb708e1ef8c923b7390a36006921742bcc541b152c9f3071
Python
12,128
220
# SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL # # SPDX-License-Identifier: AGPL-3.0-or-later # Function to read several connectomes and generate from these a ConnectivityMatrix object using conntility # The code is taken from: # https://github.com/BlueBrain/ConnectomeUtilities/blob/main/examples import con...
8f92848b93bf550e464b9f47e3d97ed7483350e9162b197019e54c9463b630c9
Python
12,130
362
""" pygments.lexers ~~~~~~~~~~~~~~~ Pygments lexers. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import types import fnmatch from os.path import basename from pip._vendor.pygments.lexers._mapping import LEXER...
9108c7b4c2f1bb198e8e2ffc2ab9ee198b47b053a7c6597f9b65ef37a8664285
Python
12,133
397
# 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...
b071e1921e8ccc4a8a072031d5dca3c8b69f4dd7ce72f3fc16bc526a728d2810
Python
12,134
382
# 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...
426da5f6096feb3d264a79c4812250fdda36e11ec20ee4011cdc65bd5e7e77fd
Python
12,135
314
import numpy as np import pandas as pd import pytest import scanpy as sc from anndata import AnnData from scipy import sparse import pertpy as pt from pertpy._types import cast_frame @pytest.fixture def dummy_adata(): n_obs = 10 n_vars = 5 rng = np.random.default_rng() X = rng.random((n_obs, n_vars))...
b95933228bd758bf635e10e6303a27e591900a1949da02dc73c0d19f6c88cd35
Python
12,136
293
from .LibFwdBwd import FwdBwdAlg_cpp from scipy.special import psi import numpy as np # ################################################################ # Compress - Expand Methods def log_expand(pi, tmat, states, n, k, likelihood=None, obs1=None, obs2=None): # ###################################################...
dcea29b2d1bcebd80ebddb70b832b7841e7cfb2955a76513deac3bc111ec8c1c
Python
12,143
346
# ------------------------------------------------------------------------ # Copyright (c) 2022 megvii-model. All Rights Reserved. # ------------------------------------------------------------------------ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class AvgPool2d(nn.Module)...
5521ad0898c7ac2446ebc7f2f6bce41a3a2f873fe37f7dec3c346735b80ad09c
Python
12,144
329
#!/usr/bin/env python3 """" ------------------------------------------------------- reproduceReentry.py Reproduce reentries in a 3D atrial geometry with a given .par and .roe state files. Reentries were induced following the P...
832042328221ee521744640a1caefc8c9cc44bab60e3d6329da0b44af9ed275f
Python
12,149
253
# set QT_API environment variable import os import sys os.environ["QT_API"] = "pyqt5" import qtpy # qt libraries from qtpy.QtCore import * from qtpy.QtWidgets import * from qtpy.QtGui import * # app specific libraries import control.widgets as widgets import control.camera_toupcam as camera import control.core as co...
f181c4af8b26a6481ff83d550da0b5d5792602ab34f428c699a7ecd8f82db7d0
Python
12,149
408
import torch import torch.nn as nn import torch.nn.functional as F import dgl.function as fn from dgl.nn.pytorch import SAGEConv """ GraphSAGE: William L. Hamilton, Rex Ying, Jure Leskovec, Inductive Representation Learning on Large Graphs (NeurIPS 2017) https://cs.stanford.edu/people/jure/pubs/graphsage...
70bb62d543f7850b01e168315a14388b860829aff06d5467186de8129309b868
Python
12,151
260
''' Script to track offline from python without having to load an APT project into front-end. ''' import sys import os import shutil os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import argparse from tarfile import TarFile import tempfile import glob from pathlib import Path from datetime import datetime import APT_interf...
cac7edf79bca502ebe3921332d890078874496bf15912991119f64ade8b1d2e8
Python
12,151
256
import os import pickle as pkl from typing import Callable, Dict, Tuple, Union import numpy as np from ....utils import get_random_dir_path from ..base_dataset import BaseDataset class SEEDVFeatureDataset(BaseDataset): r''' The SEED-V dataset provided by the BCMI laboratory, which is led by Prof. Bao-Liang ...
3876ddf1f719b1800418b8b3821350b9c524428b36fdd1aeafa05fa93f15677c
Python
12,153
311
import os import logging import json import pickle import numpy as np import torch from typing import List, Optional from torch.utils.data import Dataset, DataLoader from lightning.pytorch import LightningDataModule from cellmincer.models import \ get_temporal_order_from_config, \ get_window_padding_from_co...
9ee52e6fc294596bf85a6c7a14112d63100e0b5432073d2c1f907320e546c577
Python
12,153
384
""" Utilities for converting Open Images format CSV datasets to/from FiftyOne Dataset representation. | Copyright 2017-2022, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | """ import glob import os import numpy as np import pandas as pd import fiftyone.core.dataset as fod import fiftyone.core.labels as fol ...
362b8b6fd25b2c097233c7f9277cf9bdb4974560f4acb3c4a0e23c44812f9676
Python
12,156
256
# coding=utf-8 # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. 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 # # ...
251e02ef74b9a382ecfd861a6a5c217db5abf8dca5c8f0eb4f21e80eb256550c
Python
12,158
286
#! /usr/bin/env python # ============================================================================== # Copyright (c) 2021, Ko Sugawara # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Re...
34fd64ffdf9138a0715a855b1625e157c496e69a80ad37a29e90a520c694a58d
Python
12,159
261
"""Abstract base class for loading HED schema files into HedSchema objects.""" from abc import ABC, abstractmethod from hed.errors.exceptions import HedExceptions, HedFileError from hed.schema import hed_schema_constants, hed_schema_constants as constants, schema_header_util from hed.schema.hed_schema import HedSchem...
4cafdc8e968e34db79a9aa954104e44a6bc6d22f1a3068c35c2df3350a4cf194
Python
12,161
291
""" Script for comparing statistics from different profiles Only slices which are compatible can be compared Input: - Path to the input profiles for comparing Output: - Plot graphs with the statistical comprison - Store a FuncComparer object in pickle file """ __author__ = 'Antonio Mar...
c1d88d49d66011b792749fbd3eb8af151996ca7b19021618a3df760f1f32bfe2
Python
12,167
415
class UnificationFailure(Exception): pass class Occurs(UnificationFailure): pass ARROW = "->" class Type(object): def __str__(self): return self.show(True) def __repr__(self): return str(self) @staticmethod def fromjson(j): if "index" in j: return TypeVariable(j["index"]) i...
880fa2697cd225e595fbbbf1b17f1954216f87dd9ff85f20c11ad6c83629a539
Python
12,168
334
import os import cv2 import time import random import re import string import numpy as np import pandas as pd import torch import torch.nn.functional as F from torch.utils.data import DataLoader, Dataset from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence import albumentations as A from albumentations.pyt...
55f2211cf51e7d96c19156591450c34416490a7f3e442a91a51419f0e9815fb5
Python
12,172
337
import pickle import bpy import MDAnalysis as mda import numpy as np import pytest from MDAnalysis.analysis.hydrogenbonds import HydrogenBondAnalysis from nodebpy import geometry as g import molecularnodes as mn from molecularnodes.nodes.geometry import FindHBonds, StyleHBonds from .constants import data_dir pytestmar...
c150ec3e23e716f36be5909e475ce94e0fd2bb577625db936de41b3bc281eb18
Python
12,172
305
""" CLI stitching pipeline script. Usage: python -m regtools.stitching.pipeline --input_dir /path/to/tiles --output_dir /path/to/output python -m regtools.stitching.pipeline --input_dir /path/to/tiles --output_dir /path/to/output --section 5 python -m regtools.stitching.pipeline --input_dir /path/to/...
02ac97a40d854050fb93e6ee06dcbfee2b461189219956bc5f4f4d2d1ba5dd03
Python
12,176
261
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
3f4ec646d2c6c27337f56ba3c965274de3fc43220c5c7d2b3dfa2e33e7357fae
Python
12,178
373
"""Implementation of CLI render command.""" import numpy as np from treem import Morph, SWC from treem.utils.geom import rotation # pylint: disable=wildcard-import # pylint: disable=unused-wildcard-import # pylint: disable=redefined-builtin from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * ...
7cb16323f824f41d02e0103be43d362c6cb7484e06eb24107004af216edd2c96
Python
12,183
338
"""""" import time import statistics import logging from pupil_recording_interface.decorators import device from pupil_recording_interface.device.video import BaseVideoDevice from pupil_recording_interface.utils import monotonic from pupil_recording_interface.errors import DeviceNotConnected, IllegalSetting logger = ...
9273867a9ee808625909e9d84f9845ee1d7082e57f22e8f52a7decdba67f5373
Python
12,183
303
from typing import TYPE_CHECKING, List, Optional, Union import numpy as np from ..file_utils import add_end_docstrings, is_tf_available, is_torch_available from ..modelcard import ModelCard from ..models.bert.tokenization_bert import BasicTokenizer from ..tokenization_utils import PreTrainedTokenizer from .base impor...
d96531bc144c98d4409fb46d3fbb3bd7c1ee7108e5818f50875d498f32ff7b37
Python
12,183
295
"""Allows output of HedSchema objects as .tsv format""" import pandas as pd import hed.schema.schema_io.df_constants as constants from hed.schema.hed_schema_constants import HedKey, HedSectionKey from hed.schema.hed_schema_entry import HedTagEntry from hed.schema.schema_io.df_util import ( create_empty_dataframes...
cd997e78dee5693d2a8a355ecf719eaddad055525c7cf86ff4857c0b0b7fdf0c
Python
12,184
322
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from core.region_loss import RegionLoss from cfg.yolo_cfg import * #from layers.batchnorm.bn import BN2d class MaxPoolStride1(nn.Module): def __init__(self): super(MaxPoolStride1, self).__init__() def forward(self, x...
d28168dde88076c2ebdd6be037735b4d0b6ba1f18638b97c8199953d4f194c95
Python
12,185
281
"""EEG/MEG BIDS data format reading. This module provides functions for reading BIDS data format """ import re from copy import deepcopy from typing import Callable, Optional import mne_bids import numpy as np from mne import events_from_annotations, set_log_level from mne.channels import DigMontage from mne_bids.co...
6fd66c64fe35a851c17698d2592777ed87cb28def1c6b50b5a8038ea423cc895
Python
12,188
233
# 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...
24b1b24d49ef5b2854c7c1bdf4b9c125318ae16a41ece8da7cf690f79f9ce729
Python
12,192
348
# -*- coding: utf-8 -*- """MultimodalModel Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/15pdn81YOduRd53j_2K8yN4mf4RRuv5PL # Mount the drive """ from google.colab import drive drive.mount('/content/drive') """# Setting features""" import pandas as...
3bdb5a52d7e167e5b7777fdd47c4e7d1723a6319feac3b1ba4eb4a3ace1cf538
Python
12,194
312
# %% [markdown] # # Segmentation and Region Properties Extraction for Enteric Neurons and Macrophages # # **Author(s):** Piyush Amitabh # # **Description:** # This script processes downsampled images to segment Enteric Neurons and macrophages, and extracts their region properties. The extracted properties are saved to ...
acd395fc8e88e5bc47a98ec7cf71602563c64e8ac5602065bb471d1ae6c41970
Python
12,205
360
""" Contains class Density for the calculation of densities of gray images along segments. # Author: Vladan Lucic (MPI for Biochemistry) # $Id$ """ from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division from builtins import zip from builtins import range #from p...
50fab941d8a972f10de0dadb2e9bbb5c98c4456a1423552e783d8bf6ee0344b6
Python
12,207
337
from abc import abstractmethod from collections import defaultdict from pathlib import Path import pandas as pd import numpy as np import torch from copy import deepcopy import torch.nn.functional as F from torch import autocast from torch.cuda.amp import GradScaler from wsilearn.utils.cool_utils import is_dict, is_it...
cac1d54763dbc0b2632e12b2a79c4ccba22fe599f0d11152814713a2c64af7d2
Python
12,207
132
"""BUILD_ATLAS_PAGE.py 2026-10-09. Writes REPORT/atlas_page.html: the sign atlas as one self-contained page (data embedded from 06-OUTPUT/release/SIGN_ATLAS.csv and SIGN_PROBABILITIES.csv, figures F19 and F20). Descriptive; every number is read from an output. usage: python BUILD_ATLAS_PAGE.py""" import os, json, ba...
b28bee19c474ccec3a5e84e3d94b31e6d9b5a66be78cb868e6884350c35b5a39
Python
12,209
349
import inspect import warnings from collections.abc import Sequence import torch from torch import nn from torch.nn import functional as F from torch_scatter import scatter_mean from torchdrug.layers import functional class MultiLayerPerceptron(nn.Module): """ Multi-layer Perceptron. Note there is no ba...
0d09f52a12fa63060338021fed9668ef95292b423fb8d80edea9b5d7515b077c
Python
12,211
370
import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.validation import check_X_y, check_array, check_is_fitted from sklearn.utils.multiclass import unique_labels from sklearn.metrics import euclidean_distances from sklearn.linear_model import LogisticRegression from sklearn.svm ...
4814c54b34dfe401fb0b414d1fe59f3fdf68f39d9b257e23e338759be655eeaa
Python
12,211
386
"""Large and simple widget to indicate settings/Settings. """ from logging import getLogger from PyQt5.QtCore import QSettings, Qt from PyQt5.QtWidgets import (QDialogButtonBox, QDialog, QFormLayout, QGroupBox, ...
313401a533659876c98c21c3075548c7ee40a052efad55c6cbbf6d643b5a91c8
Python
12,212
323
""" General Classes for the package # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 15.09.15 """ __author__ = 'martinez' from pyseg.globals import * import graph_tool.all as gt from .variables import * import matplotlib.pyplot as plt from matplotlib.pyplot import cm try: impor...
281d994649683e0c3edaf9a194e93568a984b11b4dddbe592f0bb08a56b67784
Python
12,215
326
# 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...
0f2d5b5a1932770da4f76f3961fb1d635231f6121dc471ad49d2cd806f73ef15
Python
12,216
296
from __future__ import print_function, division import numpy as np import time from collections import Counter from pybullet_tools.utils import elapsed_time from learn_tools.active_learner import ActiveLearner, format_x, THRESHOLD, tail_confidence from learn_tools.learner import rescale, DEFAULT_INTERVAL, TRANSFER_W...
aba4acd523b6c964d138dfe1887ddc870098e698ee401dfec96fa2d94676d1f9
Python
12,216
405
import argparse import logging import os import pathlib from typing import Any import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import tqdm from matplotlib.axes import Axes from sklearn import metrics from sklearn.base import BaseEstimator from sklearn.ensemble import RandomFor...
b8459ca0297a9033d92105fa58cabbcb00b49f66ad06f12e83be682351f8bd4c
Python
12,223
395
"""Functions for handling and inspecting data """ import os import pickle import mne import numpy as np import pandas as pd from scipy import spatial def _get_device_fids(raw, include_origin=False): """Get fiducials in the M/EEG device space. Parameters ---------- raw : mne.io.Raw An MNE...
22aac8ecf1450bf28a0d8275b0c3bc5b8a1a3c8cebeb2ae7b42003261c1e79a3
Python
12,224
248
# SPDX-FileCopyrightText: 2024 Blue Brain Project / EPFL # # SPDX-License-Identifier: AGPL-3.0-or-later """ Plotting oracle score (kind of reliability) against simplex dim (and position within simplex) for MICrONS author: András Ecker, last update: 02.2024 """ import os import numpy as np import pandas as pd from sci...
8d9edfb8a0ecf2d14c477353e9f23c4248a6d6f7f5715c7145b8338bc01a6828
Python
12,227
322
# 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...
7923feb3248439bc95f116cfe975a05ab6abac5c88b25cc12dfd91800e337179
Python
12,228
358
# 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...
01e661f5e9ec28b148e455698274d1e8ff389bbfdcccd78ee762f33d9f0db889
Python
12,229
319
import datetime import json import logging import os import re import sys import urllib.parse from pathlib import Path from typing import Callable, List, Tuple from urllib.parse import urlparse, unquote import boto3 import requests from requests.adapters import HTTPAdapter, Retry from tqdm.contrib.concurrent import th...
a1658de11d38889311c3a3d045475f172199a2c1feee6df70501b2be52f5b2f8
Python
12,230
290
#!/usr/bin/env python from __future__ import print_function import argparse import cProfile import pstats import numpy as np from examples.pybullet.namo.stream import BASE_LINK, get_base_joints, set_base_conf, get_custom_limits, \ get_test_cfree_conf_pose, get_test_cfree_traj_pose, get_grasp_generator, get_ik_f...
91535137db6de885eb8431405f437e16760047b7d7f0277e2bbf36a5b2cd52f3
Python
12,231
360
"""Implementation of CLI render command.""" import numpy as np import OpenGL.GL as GL import OpenGL.GLU as GLU import OpenGL.GLUT as GLUT from PIL import Image, ImageOps from treem import SWC, Morph from treem.utils.geom import rotation _HELP = """ interactive commands: mouse left drag rotate mouse r...
93271a714764f275921ad5b2dd12d923c2337df94ee79c329d19373b525b7057
Python
12,240
305
# -*- coding: utf-8 -*- """ Created on Aug 8 2022 @author: Jonas A. Thiele """ import pandas as pd import numpy as np from scipy.stats import kurtosis, skew from random import randint import matplotlib.pyplot as plt #%% Functions #Compute total number of subjects def get_sample_size(families_all...
1d945cac37d99224cad85e8f11b86a5011c879e1891f7cb373a4e44609c6e5d5
Python
12,242
277
""" Authored by: Neel Kanwal (neel.kanwal0@gmail.com)""" # This is the main file provides ENSEMBLE of binary CNN and ViT models for end-to-end solution for what is mentioned in the paper. # Update paths to processed datasets # All libraries if __name__ == '__main__': import warnings warnings.simplef...
11a7c4e085b834d37a06079f49df2b51e1d59fa2de9dee3406961eb9326701d2
Python
12,248
309
""" Script for extracting an analyzing a GraphMCF with a segmented membrane Input: - A STAR file with a list of (sub-)tomograms to process: + Density map tomogram + Segmentation tomogram - Graph input parameters Output: - A STAR file with the (sub-)tomograms and their co...
3aad7d091e976f9cf94043b7bc3a873806bca8fa66932c72bcb86a6beea4c5f8
Python
12,250
340
import os from typing import Dict, Union, List import ase import numpy as np import torch from schnetpack.transform import MatScipyNeighborList from spainn.interface import NacCalculator from spainn.properties import SPAINN __all__ = ["SPaiNNulator"] class SPaiNNulatorError(Exception): """ SpaiNNulator err...
9e24dcb05aec5f3284d9052522d0a0e54ab5c8ef1bc03ce107ba175fa58b141d
Python
12,254
406
""" (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2019 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. ------------------------------------...
fadb8b21f22dac902d6b12aa95467e06fae6372261a6921d151ea614dd58a2cc
Python
12,259
310
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2023/7/21 14:05 # @Author : piaoyang cao # @File : run_class.py import argparse import torch from torch_geometric.loader import DataLoader from torch.optim.lr_scheduler import StepLR import numpy as np import torch.optim as optim from tqdm import tqdm ...
ae9a1fb5c5be97a04172830942c5c8b279e34020a18b5fe34eadafac00271b17
Python
12,261
290
# 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...
36b3e24c1c715ed997e645955c77fd2337792c52cfa1ed85f9bdf11eea86424b
Python
12,265
294
from __future__ import print_function import os import numpy as np import datetime import random #from ast import literal_eval from learn_tools.collect_simulation import SKILL_COLLECTORS from learn_tools.learner import DEFAULT_INTERVAL, rescale, sample_parameter, x_from_context_sample, SKILL, FEATURE, \ PARAMETE...
fc377fee153b74bc4ea75a1209de1ef51e348b5b4afe532a0b9ba07572dd8d17
Python
12,270
287
import linecache import os import sys sys.path.append(os.path.dirname(__file__)) import time import copy import numpy as np import csv import apps import arrayexp import arrayparams import reram_register # ARRAY info # POSITIVE_READ = 0 # NEGATIVE_READ = 1 class ARRAY4K: ID = 1#SDK.ARRAY1 R...
0f844316d0432cd511eb4356ecbe7273c0aa32d7f6730800c4b2708d4439fee1
Python
12,272
287
import os import argparse import lxml.etree as ET import math import carla from utils import ALL_TOWNS, \ parse_annotations_file, interpolate_trajectory, scan_route_for_scenarios ID_START = 0 MAX_LEN = 380 def main(args): route_id = ID_START road_type = args.road_type root = ET.Element('routes...
117866bf09fb1ea33bbe68780517ea05a4483e438a78d1e48514f1a86912b91a
Python
12,276
326
# basic import os, math import numpy as np # pytorch import torch import torch.nn.functional as F from torch import nn, Tensor from torch.autograd import Variable, Function class WaveNetModel(nn.Module): ''' A Complete Wavenet Model Args: layers (Int): Number of layers in each ...
258192dabd899f15fe79b4f3183e1f0487cded151392b42aa1cd2bd6c2d3d957
Python
12,277
327
import os import sys import torch import numpy as np import cv2 import matplotlib.pyplot as plt from PIL import Image from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow, QFileDialog, QVBoxLayout, QWidget, QPushButton from PyQt5.QtGui import QImage, QPixmap, QPainter, QColor from PyQt5.QtCore import ...
7ff8b6868d6c5648d20886fc0409197a0fe3326b4a976bb70aeab14bdf5afadf
Python
12,280
291
""" Authored by: Neel Kanwal (neel.kanwal0@gmail.com)""" # This file provides inference code for multiclass DCNN and ViT models mentioned in the paper. # Update paths to processed datasets if __name__ == "__main__": import warnings warnings.simplefilter(action='ignore', category=FutureWarning) ...
a5978d3b5bef4ab93c2dffc0ada47f339bae939377cee273963004ff7480562b
Python
12,280
310
""" 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 software: yo...
1aacbf3633a8c92ffad6eee5d12140668f95a6b6fd46772b3c84608a36c76dbb
Python
12,281
263
# -*- coding: utf-8 -*- import torch import torch.nn as nn from supar.config import Config from supar.models.dep.biaffine.model import BiaffineDependencyModel from supar.models.dep.biaffine.transform import CoNLL from supar.modules import MLP, Biaffine, Triaffine from supar.structs import Dependency2oCRF, MatrixTree f...
f472c998c64324d24c5d9edc2f48e608c248d790ee9f33f21fb71079f68f23cd
Python
12,281
290
import abc import copy from typing import Optional, Tuple, Union import numpy as np from meep.timing_measurements import MeepTimingMeasurements import meep as mp from meep import binary_partition_utils as bpu class AbstractChunkBalancer(abc.ABC): """Abstract chunk balancer for adaptive chunk layouts in Meep sim...
e78eea81c68537fd0748afdd79289f4bd689385cb5ea185e6893d4f861ae89ef
Python
12,286
341
import copy import functools import os import blobfile as bf import torch as th import torch.distributed as dist from torch.nn.parallel.distributed import DistributedDataParallel as DDP from torch.optim import AdamW from . import dist_util, logger from .fp16_util import MixedPrecisionTrainer from .nn import update_em...
719e2d80e50e90ae0b738dfe2284e3e301cc1ef1dba1c04130b212770ef40f8f
Python
12,287
358
# 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...
556b4fa93fd7c84e961e8c48342b5596616c4274fb1c005a4853296e283a007f
Python
12,292
346
import os import numpy as np import nvidia.dali.fn as fn import nvidia.dali.math as math import nvidia.dali.ops as ops import nvidia.dali.types as types from nvidia.dali.pipeline import Pipeline from nvidia.dali.plugin.pytorch import DALIGenericIterator # inspired by the NVIDIA nnU-Net GitHub repository available a...
39e43bd1d1358e5f4538db23484de31cc6655c2c4d919ed4acac613f1ac935f2
Python
12,295
307
import os import shutil import time from datetime import datetime import numpy as np import torch import torch.backends.cudnn as cudnn from torch.autograd import Variable from src.training.tdrg_utils import AverageMeter, AveragePrecisionMeter class Trainer(object): def __init__(self, model, criterion, train_loa...
6a9b3d676bfc9348c6d6efc7f9fbbc3236486df31b227b41208823d15120d2e4
Python
12,295
260
from warnings import filterwarnings filterwarnings('ignore') import os, sys, argparse # analysis module imports from model_opts import * from brain_data import * from ridge_gcv_mod import RidgeCVMod from sklearn import preprocessing def get_splithalf_xy(feature_map, response_data, scale = True): data_splits = {...
fa5e53a53b766f1bac1211a8b86d83f9a37f602c80483199235ccf41a821c20c
Python
12,302
266
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 21 22:39:05 2018 @author: Carlos A Ariza, PhD """ #import pickle as pkl import pandas as pd from itertools import combinations #import matplotlib import matplotlib import matplotlib.pyplot as plt import numpy as np import seaborn #feat_df = pd.read...
12a42b9359f0b46c70b2a3d22c35e38c6a763b83d3fa1f852d9952f99019758c
Python
12,304
255
#!/bin/env python3 """ Properties of pulses -------------------- This submodule contains tools to compute properties of the impulses propagating across the medium. In cardiology, these are for instance *action potential duration* (APD) and *conduction velocity* (CV). """ import numpy as np from typing import List, T...
ca03352b41430666fabc1adcfd23615d9e7c7ad41e514e47908a4e5f3b2f841e
Python
12,306
377
import pandas as pd import numpy as np import os import h5torch import ast import argparse from maldi_nn.utils.metrics import * from maldi_nn.spectrum import PeakFilter from maldi_nn.models import AMRModel, MaldiTransformer from lightning.pytorch import Trainer from maldi_nn.utils.data import DRIAMSAMRDataModule from m...
2c6152f4f6e312f8dd14cd8704df6aaf35bb6395447361e679e79ae958b60d01
Python
12,309
252
# Load packages import pandas as pd import numpy as np from subprocess import call import subprocess import concurrent.futures as cf import os import sys import json import networkx as nx from scipy.sparse import load_npz import scipy import pickle from pyflagsercontain import compute_cell_count config_address = sys.a...
b75968f716b812d306fa4cace5f9f951c17f4c2abfb601dc6efc0e5a4505a735
Python
12,313
332
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Modular prediction of off-target effects @author: Wei He @E-mail: whe3@mdanderson.org @Date: 05/31/2021 """ #################### Import all the packages ##################### from __future__ import division import pandas as pd import math,json,os,pkg_r...
8c80fe5ee1f628cc055639672fa619742e90ad37ba76b832312299905c8f2fb9
Python
12,314
343
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu. """ import h5py import numpy as np import os from pathlib import Path import matplotlib.pyplot as plt from scipy.io import loadmat from scipy.ndimage import uniform_filter from scipy.interpolate import interp1d from ...
8b279433aa913398f9fde37137d42ba41218c2dfbbcd5eefca19b1b086a6654a
Python
12,320
234
import numpy as np from scipy.spatial import KDTree from scipy.sparse import csr_matrix from .. import config as CFG from ..utils.misc import index_traverse, mytqdm, Timer from ..utils.mpi import is_master, comm, distrib_vec, mpi_sum_csr from ..matao.mataocsr import MatAOCSR t1 = Timer('OrbProd') t2 = Timer('OrbPairT...
2b4c723bd43b2d37f604a201c2d0b1e0d017cccef4dbdb831934bdee415d6c25
Python
12,321
312
from __future__ import annotations import json import os import pathlib import random from typing import List import matplotlib.pyplot as plt import parse import torch from google.protobuf.json_format import ParseDict, MessageToDict from loguru import logger from matplotlib.patches import Rectangle from ord_schema.pr...
c8a755ddd477907a2b75b9e546f769f4e9cd41255b008d864cc1c48548b984cf
Python
12,326
320
import torch from typing import List import logging import os import Models.model_func as Model_Func import pickle from tqdm import tqdm import yaml class Univariate_Model(torch.nn.Module): def __init__(self, device:torch.device): super().__init__() assert isinstance(device, torch.device), "devic...
d6e85dbf97be089a67fab1f0b5a446cd70e96627fa93585e6e76585e5513abb8
Python
12,328
376
# -*- coding: utf-8 -*- # # Auxiliaries used across all of Syncopy # # Builtin/3rd party package imports import numpy as np from numbers import Number from copy import deepcopy import inspect import json # Local imports from syncopy.shared.errors import SPYValueError, SPYWarning, SPYTypeError, SPYError from syncopy.s...
fa6246c0e9ba41634d681b9eb06de323510fb8ab54e297393ef9639229cf1d1f
Python
12,330
255
import argparse import logging import random import traceback import NDATools from NDATools import authenticate from NDATools import exit_error from NDATools.Configuration import ClientConfiguration from NDATools.Utils import get_non_blank_input, get_int_input from NDATools.upload.submission.api import CollectionApi f...
a98341022655c3642acf7bccaaa100beedd756d6dc7cb23b9fe247baf6ddd41a
Python
12,331
385
# 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...
f409776e1313fab982657899de43a17ed5c23779c7d9abd28ee93c0d6dc8595f
Python
12,332
308
""" Script for extracting an analyzing a GraphMCF with a segmented membrane Input: - A STAR file with a list of (sub-)tomograms to process: + Density map tomogram + Segmentation tomogram - Graph input parameters Output: - A STAR file with the (sub-)tomograms and their co...
07f4c44554943f92aec24fe46e435988217cebfd0f99552bc6b518d4c8ef14dc
Python
12,333
352
""" Created on 10/08/2017 @author: Niklas Pallast Neuroimaging & Neuroengineering Department of Neurology University Hospital Cologne """ from __future__ import print_function import os,sys import numpy as np from dict2xml import createXML # from string import split def parsePV(filename): """ Parser fo...
cd5551b6f4b39d3d0edb4b94ad4da85d189b3a467ff7a3ca22da3eeb6de568de
Python
12,333
309
""" Script for extracting an analyzing a GraphMCF with a segmented membrane Input: - A STAR file with a list of (sub-)tomograms to process: + Density map tomogram + Segmentation tomogram - Graph input parameters Output: - A STAR file with the (sub-)tomograms and their co...
96c4abba8601afd920acaf62be419f6928ce22661904e796517c7b6af3b1fc35
Python
12,342
213
# set QT_API environment variable import os os.environ["QT_API"] = "pyqt5" import qtpy # qt libraries from qtpy.QtCore import * from qtpy.QtWidgets import * from qtpy.QtGui import * # app specific libraries import control.widgets as widgets import control.camera as camera import control.core as core import control.m...
af893b07796f943e3345fef4a5cb8c3df208a1e032508c0388dd0f82a98d5ac0
Python
12,345
409
import os import torch from torch.hub import load_state_dict_from_url from torchvision.datasets.folder import default_loader from pathlib import Path from torchvision import transforms from .alexnet_gn import * from .resnet import * url_root = "https://visionlab-pretrainedmodels.s3.amazonaws.com" def build_alexnet_...
d72d812bc515dfcd8846fbcc38bfdc8096081921089f96b0bbbed981cd08b2e1
Python
12,349
257
""" Script to run "add cancer" experiments. The general idea is to add cancers in a particular order (either random or determined by cancer type similarity). The prediction goal is the same as in 02_cancer_type_classification experiments; that is, predicting presence/absence of a given mutation in a particular cancer ...
72075da40404fdfec378ec70550ef2ae18e4ccbbe4e80f259e499002b744962f
Python
12,352
325
"""Classes representing parsed query expressions.""" from hed.models.query_util import SearchResult class Expression: """Base class for parsed query expressions.""" MATCH_TERM = 0 # Bare term: ancestor search via tag_terms MATCH_EXACT = 1 # Slash-path or quoted: exact tag match MATCH_WILDCARD = 2 ...
c5953b9bedf1bdee31701437b2b6167defce93614c686edc836a1b7bbbab5029
Python
12,352
291
# Some of the code is referenced from below Github files: # https://github.com/YudengLin/memristorBDNN, which includes `BDNN_Model.py` and `memristor_model.py` from __future__ import division, print_function import platform_4k import torch import torch.nn as nn import numpy as np class operation_paras(): ...
077603ef22eae0e070fa34d6449df3ec38211233b59c40d894e3df25c694bd1a
Python
12,354
344
"""Schemas for VASP.""" from __future__ import annotations import logging import os from pathlib import Path from typing import TYPE_CHECKING from ase.io import read from emmet.core.tasks import TaskDoc from monty.os.path import zpath from pymatgen.command_line.bader_caller import bader_analysis_from_path from pymat...
0d22cb9b1f35d4743fc9bd8e405881c83dacbec565b72346f67f5fbc0a83d576
Python
12,354
289
from collections import defaultdict import numpy as np import scipy from pathlib import Path from scipy.special import expit from wsilearn.utils.asap_links import make_asap_link, make_link from wsilearn.utils.cool_utils import Timer, is_iterable, mkdir, showim from wsilearn.dataconf import DataConf, TrainType from w...
1f10c9fdd755d218f09b532d5d817140371afc98bdfc6801c9b30c5907def791
Python
12,354
270
import copy import os import torch import sys sys.path.append('..') from torch.utils.data import DataLoader import data_utils import utils import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler import torchvision.transforms as transforms import torchvision import model_h_vector_embed_mean import nu...
eac4927b60be2c2080d9115f93fc37216b8706ccc0cf0753a05301c5ef138a19
Python
12,358
376
from bokeh.models import Div from bokeh.layouts import row, column from bokeh.plotting import figure, show, output_file, save import matplotlib.pyplot as plt import numpy as np from PIL import Image import pandas as pd def offset_pos(dataframe, n_policies=None): if n_policies is None: n_policies = dataf...
4afec706307cc3cb16431dfdd570a740bd71f0840748f4c78c75b046a93051e4
Python
12,359
323
""" General Classes for the package # Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry) # Date: 15.09.15 """ __author__ = 'martinez' from pyorg.globals import * # import graph_tool.all as gt from .variables import * import matplotlib.pyplot as plt from matplotlib.pyplot import cm try: imp...
9e7f548c134265bbafc1a474074fbae51169c67a6fbe73e8a0522ef67767026c
Python
12,360
338
"""Module for agreement and consensus analysis between raters""" from numpy import (arange, argmax, asarray, concatenate, diff, invert, logical_and, maximum, mean, minimum, newaxis, ones, repeat, sum, vstack, where, zeros) from .. import Graphoelement class MatchedEvents: ...