sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b5fa0cae3eadba393b1b8502da8c0be80ae00ee08a69b801c6e2511994a6a64a
Python
41,259
1,116
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys try: import ssl except ImportError: # pragma: no cover s...
7a0b4ed6acf4c5b25b2eee4365be70e9863d09dd2c9e2a6e3dd827f3a6be4427
Python
41,285
1,064
#!/usr/bin/env python3 # ****************************************** # # SHARC Program Suite # # Copyright (c) 2023 University of Vienna # # This file is part of SHARC. # # SHARC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
4fab448356821ddc63bddbaab5b8008b6cd4f3386b50d156c6bceea15a3f6af0
Python
41,488
1,069
import sys import argparse import cv2 import time import numpy as np from control._def import * import threading import control.toupcam as toupcam from control.toupcam_exceptions import hresult_checker def get_sn_by_model(model_name): try: device_list = toupcam.Toupcam.EnumV2() except: print...
1a06259a0d9eef221645e6d72220a162d5dd8d4ff8a4615af029523d7eff897d
Python
41,610
996
# Builtin/3rd party package imports from functools import reduce import numpy as np from numbers import Number # syncopy imports from syncopy.shared.parsers import array_parser, data_parser from syncopy.shared.errors import SPYTypeError, SPYValueError, SPYError from syncopy.shared.tools import best_match # local impo...
f138979f96219cf02157c293e6bac1cee91d26c9ae04d8e7438bffad3b5c2b28
Python
41,620
1,002
# set QT_API environment variable import os os.environ["QT_API"] = "pyqt5" import qtpy import numpy as np import time # qt libraries from qtpy.QtCore import * from qtpy.QtWidgets import * from qtpy.QtGui import * import pyqtgraph as pg #import pyqtgraph.ptime as ptime import pyqtgraph.dockarea as dock from pyqtgraph...
b6b0617e0b74bed5ddab664bee642a8097d88011fb71d6ac17a3a17ab12984db
Python
41,625
973
import datetime import logging import multiprocessing import os from functools import partial import deap import numpy as np import pandas as pd import pypet as pp from deap import base, creator, tools from ...utils import paths as paths from ...utils import pypetUtils as pu from ...utils.collections import BACKWARD_...
64168e893143e4d121b1248543c6ea94c435ee4e5e0ef81460eb66632c9476f7
Python
41,661
915
"""Find bad channels.""" # Authors: The PyPREP developers # SPDX-License-Identifier: MIT import logging import mne import numpy as np from mne.utils import check_random_state from scipy import signal from pyprep.ransac import find_bad_by_ransac from pyprep.removeTrend import removeTrend from pyprep.utils import _fi...
eeb0bcb3fa82765503edf96f92706326c3881af2ee21d0f94058552c3265cfea
Python
41,668
1,216
""" This python file includes: format_global format_func visualise_imfs_psd plot_psd_peaks scatter_ampl_freq_peaks dotplot_peaks_allP dot_plot_count plot_heatmap_psd scatter_ampl_freq_shade_avg barplot_count_subj plot_cycle_allP plot_cycle_allP_colP plot_outcom...
cb575d6aafe396cb016a3f4685b9bfd642c03f6e172c2e5dd49e8d4045964b16
Python
41,745
972
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
ebfd8018f3adada4c1f592b16e903cbef64c4e91e040c8c8bc91419486c0bc9f
Python
41,790
1,806
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 24 23:31:00 2020 @author: usingh """ """ available translation tables compiled from https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?chapter=cgencodes """ translation_tables_dict={ "source":"https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/w...
7f86c84757a41f24ffda06fedba20196e8014c57a62945bd320499400641df93
Python
41,853
881
''' import sys sys.path.append('/Users/anaconda/Desktop/Code/EC') import experiments_code_s2p as ec ''' f_data_path = '/Volumes/2TB_VIRUS/Data' # Path to data n_stimulations = 10 STIM_END_CONSTANT = 100 import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import ttest_rel, pearsonr ...
96a858d6051e168d57f5af4e76bbeb5cb89dae2db48f13e9c3d682d12e14324f
Python
41,856
1,157
from __future__ import annotations import argparse from pathlib import Path import pandas as pd import json from dataclasses import dataclass from typing import Any from itertools import cycle import numpy as np import re import matplotlib.pyplot as plt import dendritic_spine_args ntasks_pattern = re.compile("ntasks...
9b36909d6bf21e25ce9d0eb05ae2cd80f37446b561aa664c15f4e55a0bd06327
Python
41,881
1,245
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np from scipy.io import loadmat from scipy.stats import stats import scipy.linalg as linalg import scipy.signal as signal import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from numba import njit #### Additional funct...
ca94c5ea07d02936f208436f8c525af953e6bd69300fca135a1087be3066d2ad
Python
41,954
976
import warnings from contextlib import contextmanager from functools import partial from inspect import isfunction from typing import Any, Dict, List, Tuple import numpy as np import pytorch_lightning as pl import torch import torch.nn as nn import torchmetrics from torch.utils.data import DataLoader from torchmetrics...
ec77b6cbf552913b4358317446e86c9503da58bf8cc0d2e40b2a2569bb38d5d2
Python
42,047
1,137
""" Tools for updating and expanding lexicons, dealing with logical forms, etc. """ from collections import defaultdict, Counter from copy import copy, deepcopy from functools import reduce import itertools import logging import queue import re import sys from nltk.ccg import lexicon as ccg_lexicon from nltk.ccg.api ...
7164c4902446ccd7011837ac09d0019531053a23ead0aba59db2796a61d033ca
Python
42,095
879
""" This script is used to draw and overlay predictions on video, Run this file on the cluster instead of downloading pickle files and run locally """ import pickle as pkl import pandas as pd import numpy as np import cv2 from scipy.ndimage import gaussian_filter1d import os import matplotlib import sys sys.path.appe...
bf32ff9549b5ad3f8d824f0419d9cf9de18291bd99c3bfee42491c5f339e3c4c
Python
42,103
1,555
import math import glob import logging import os import re import smtplib import ssl import subprocess import time import copy import collections import json import matplotlib import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg import numpy as np import pandas as pd import requ...
e2fbc50471ef0c5e711ee13e87da0b4bb81d81e9f2535e120dfaa86380df52ec
Python
42,144
770
"""Validates HED annotations in tabular data in stopping stages.""" from __future__ import annotations import copy import math import re import warnings import pandas as pd from hed.errors.error_reporter import ROW_COUNT_KEY, ErrorHandler, check_for_any_errors, sort_issues from hed.errors.error_types import ErrorCo...
24c1c60b2ad5927b43ac5b7e3c2c6382a70422caadd9b4d2b54a2725f522b49b
Python
42,145
1,331
#!/usr/bin/env python '''prototype LFP simulation analysis''' import os import scipy.signal as ss from scipy.optimize import curve_fit from mpl_toolkits.axes_grid1 import make_axes_locatable from hybridLFPy import helperfun import numpy as np import h5py import LFPy import matplotlib from mesocircuit.analysis import st...
9d6273dd97ff7918a8e91ebc5551d45ad2a4563ce8907dcf57040525a99e8212
Python
42,200
986
import logging import warnings from contextlib import contextmanager from functools import partial from inspect import isfunction from typing import Any, Dict, List, Tuple import numpy as np import pytorch_lightning as pl import torch import torch.nn as nn import torchmetrics from torch.utils.data import DataLoader fr...
beef6c2daa1b56a24709d705d1cad97b099a787bf06896929b346e03054aa6f4
Python
42,228
1,051
""" Defines class Connections that holds data from one or more observations (experiments) divided (classified) in groups. The observations are expected to be generated by scripts celft.py, connectors.py, connections.py (depreciated) or classify_connections.py (depreciated). # Author: Vladan Lucic (Max Planck Ins...
9e2aa6586021e74840727121548804513a30e75c8373272a8e83e0b915873378
Python
42,245
998
#!/usr/bin/env python3 import argparse import os import shutil from pathlib import Path DEFAULT_DRIVE_ROOT = "/content/drive/MyDrive/research/projects" ENV_ROOT = "COLABMDA_ROOT" ENV_PROJECT = "COLABMDA_PROJECT_DIR" ROOT_HELP = "Override project root (defaults to current working directory)" def _normalize_equil_prot...
8843f1714c1e2902a33b43aa69984393c59099dab4ec26a814a4586910cca607
Python
42,299
1,070
"""Classes for rereferencing data in an MNE Raw object. CLASSES ------- Reref : abstract base class - Abstract class for rereferencing data in an MNE Raw object. RerefBipolar : subclass of Reref - Bipolar rereferences data in an MNE Raw object. RerefCommonAverage : subclass of Reref - Common-average rereferenc...
56fd7ba92510ebc8bdc0162a703733d7a4d108bb4689190d96f812cb82d3c7bd
Python
42,465
862
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import csv import os import matplotlib.pyplot as plt import numpy as np from sklearn import metrics from scipy.ndimage import gaussian_filter import pickle from DiscRisk_utilities import * from DiscRisk_models im...
741a4e606df81915fa48bf24fcb6d2f6bc593cc8cb8e8325819d373f3e479aa7
Python
42,498
2,382
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
291b8ef96aab66f58cea7043ff33eb68c267f712f9a425781bb1047264a0c137
Python
42,517
668
import os from warnings import warn import multiprocessing import numpy as np from matplotlib import pyplot as plt import pymp import pandas as pd from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader from vtkmodules.util import numpy_support as VN from io_functions import export_ensight_initialise_case, export...
13c1cc21e6758f04a139f7c7277468cf2fe422e118ad920a77ed435d4b74bd66
Python
42,553
1,207
""" Contains class Labels for general manipulations of an image that contains integer values (label field). # Author: Vladan Lucic (Max Planck Institute for Biochemistry) # $Id$ """ from __future__ import unicode_literals from __future__ import absolute_import from builtins import zip from builtins import range __ve...
27482f306ec3260acd6c9f352a7aea3574d1391e615a8231b102ddc18464b1c4
Python
42,587
1,001
""" Module to extract low-dimensional properties from npx dataset; plot population activity in pc space, both average and selected trials; plot cross-correlogram between avg whisking activity and each PC's; plot distribution cc peaks fo each PC's; plot loadings to compare distribution of information across neurons for ...
5b29d8083bf89cc00f0ec0172fd67d30ac37ff682ac729139ac849f019366ccc
Python
42,589
925
""" Script to compute and collect properties of different clusters. """ import os import sys if not ('data_analysis' in os.getcwd()): sys.path.append(os.path.join(os.getcwd(), 'data_analysis')) import itertools import pdb import align_fun from meta_data import load_meta from align_fun import align_spktrain, load_d...
9a8e8eca8bff2e4734b82cd9698146a41a890007e3f260db7dc89fa04c39142d
Python
42,639
1,036
""" chemical rules""" import copy import traceback import numpy as np import multiprocessing import rdkit import rdkit.Chem as Chem rdkit.RDLogger.DisableLog('rdApp.*') from SmilesPE.pretokenizer import atomwise_tokenizer from MolNexTR.abbrs import RGROUP_SYMBOLS, ABBREVIATIONS, VALENCES, FORMULA_REGEX,SUBSTITUTIONS im...
9ffbc0b179d5df4912b5ea7b8e6672e343c36dc061a8acf663773da079ebbd65
Python
42,647
1,376
# script to train and evaluate all the networks on AP10K and AP36K datasets ## For individual animals import ap36_train as a36 import glob import re from reuse import * import cv2 ap36 = False if ap36: im_dir = '/groups/branson/bransonlab/datasets/APT-36K/data' json_files = glob.glob('/groups/branson/branso...
314bf646822970b26d7a617d7df4fcb8110b76a2074553fa1e9b75f232e30930
Python
42,699
1,790
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..file_utils import requires_backends class TensorFlowBenchmarkArguments: def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) class TensorFlowBenchmark: def __init__(self, *args, **kwargs): requ...
621d9e57727c45b88eab269711459222cd6e5c5d3cc3800a2e6a8f10afeb18a2
Python
42,799
1,045
""" Feature creation based on burst rate modulation for bursts with distinct shapes. """ import numpy as np from help_funcs import dict_bycondition from time_res_features import significant_components from plot_burst_features import features_modulation, features_modulation_nd from plot_tf_features import chars_modula...
ce79c25eb2f19e5a7fcbb735ef92161b1f085a4f66c284ee047a11e56a88f74a
Python
42,821
962
"""Training-free entropy-guided GrabCut tissue masking. The most accurate masker in this project: **0.9817 mean Dice / 0.9373 worst over 33 ground-truth cases across 11 intensity sources** - three Nissl builds, serial two-photon, light-sheet fluorescence, three MRI contrasts, MERFISH, CCF average template and Waxh...
073f96579d85e0b114cde0f2357e97ae2f26aa33ef0085736f058fcadaedd7e3
Python
42,979
1,058
import abc import numba import numpy as np from neurolib.control.optimal_control import cost_functions from neurolib.utils.model_utils import computeDelayMatrix, adjustArrayShape import logging import copy from numba.core import types from numba.typed import Dict def getdefaultweights(): weights = Dict.empty( ...
3e77cf20dd5e6c9f6f2bae1c40fe51e0405fef1f745fe4da28ff82dc9fcffe9b
Python
43,056
1,173
"""Tests for StringQueryHandler, parse_hed_string, and string_search. Most test cases are directly ported from test_query_handler.py, replacing HedString-based assertions with raw-string assertions. Because StringNode leaf nodes set ``tag_terms = (text,)`` for single-component tags (e.g. ``"a"`` → ``("a",)``), the li...
dd0583cbc148fad6f821e1b05da22953223c29adc42c0bd83c86730446fea617
Python
43,077
969
from typing import Dict, Union import torch import numpy as np from sklearn.decomposition import PCA from torch.fft import fft, ifft from torch.nn.functional import pad from ..base_transform import EEGTransform class RandomEEGTransform(EEGTransform): def __init__(self, p: float = 0.5, apply_to_baseline: bool = ...
20041aeb8b8699db58b228024e9752c689b0f7489c5a42019a9132f68e6c2475
Python
43,131
1,214
#!/usr/bin/env python3 # ****************************************** # # SHARC Program Suite # # Copyright (c) 2023 University of Vienna # # This file is part of SHARC. # # SHARC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
28986d913dd08db363b03633b694b19ab66a0cc4b4ff2340e6c6881ff620e3fb
Python
43,181
1,052
# 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...
1e4db5d677282379fe11e6e5b0ac2710375275ec7c32546a648561e94d09a2fc
Python
43,285
1,083
# coding=utf-8 # Copyright 2020 The SqueezeBert 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 # # U...
4d2b290a9f1d731139334b908ca7637e9fc6365ba9e41aeec4b253e6771b5f57
Python
43,305
1,039
from abc import abstractmethod import numpy as np import uuid import cv2 from skimage import measure from typing import List from typing import Tuple from typing import Dict from shapely import geometry import h5py import merlin import pandas import networkx as nx import rtree from scipy.spatial import cKDTree import g...
d402e8eae929e0079ee031499d35a7063dcf1b29e65a1be223f36c3a6c8df8aa
Python
43,392
1,018
# coding=utf-8 # Copyright 2021 The Eleuther AI and HuggingFace Inc. team. 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-...
642c1537213a5743bc4d4161fda6b752e0ff72f4d09cbb74ca69cc6683808853
Python
43,414
1,494
# 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...
db36fd2ad729e348935c84140c68153f6188fb63c8cbfb6237ec191332a7b8a5
Python
43,424
1,042
#!/usr/bin/python3 import os import numpy as np import tensorflow as tf from osgeo import gdal from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras import layers as k_layers from tensorflow.keras.layers import Layer, Conv2D, BatchNormalization, \ Activation, Dropout, Add, Ave...
625790c305cb71635f27c48019c6e988474155e1822e15043485afb4c8e14275
Python
43,444
1,067
from __future__ import annotations import warnings from typing import Any import numpy as np from matplotlib import pyplot as plt from scipy.integrate import simpson, trapezoid from SurvivalEVAL.evaluations.calibration import ( coverage_ic, d_cal_ic, ksd_cal_ic, one_cal_ic, ) from SurvivalEVAL.evalua...
8c3f7f7f8338f78f31324f3626767f8d6b89bb1f9328b51cf45272b56a994f4c
Python
43,444
1,240
""" A collection of routines for use in topology optimization comprising convolution filters (kernels), projection operators, and morphological transforms. """ import sys from typing import List, Tuple, Union import numpy as np from autograd import numpy as npa from scipy import signal, special ArrayLikeType = Union...
7d79a464269ff4e03498e0f8a7f91b982a0d10772f71eee12064e8c508ed3b57
Python
43,510
1,233
#!/usr/bin/env python # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides all atomic scenario behaviors that reflect trigger conditions to either activate another behavior, or to sto...
6bd1c41d32824726c0bf95295ab88998eb8b70678b34abdfb75daf7a6a77f1fd
Python
43,604
848
# Copyright 2020 The HuggingFace Team. 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 applicabl...
c9256db8eabd35a233df6e73cd05b72ab372c71c362a3183eaaaa0cdeca16e71
Python
43,605
927
""" Figure galleries and per-section thumbnails for the registration report. Collects figure images (JPG/PNG) under a run's output directory, renders them as an embedded-image gallery, and picks a single representative thumbnail for a batch-2D section. Stdlib only; never raises. """ import json import os fr...
76cc9a10586853303779798def0416e9dd7bd85cc314a08cc61e4d5707bbaf60
Python
43,668
1,327
from math import ceil import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import pytorch_lightning as pl from seq2exp.layers import ( ConvBlock, GELU, Residual, AttentionPool, RELU0_17, Attention, SoftmaxPool, mixup_augmentati...
2e6ad344c5c1f8a9e90b0d0812ea4e50a2f3f92febe92da346dc1e49076e94eb
Python
43,731
652
import multiprocessing import os import sys from warnings import warn import matplotlib.pyplot as plt import numpy as np import pandas as pd from datetime import datetime if __name__ == '__main__': anatomy_subject_name_list = ['UKB_1097970']# ['UKB_1000268', 'UKB_1002772', 'UKB_1010096', 'UKB_1005678', 'UKB_10081...
dc08cd6fee3a0344f8086ea59547d962b57034e7b578ae5c8d13a171d3077635
Python
43,739
1,084
import torch from utils.complex_utils import complex_utils as Z from utils.loaders import load_h5_dataset import torch.nn as nn import torch.nn.functional as F import math class led_input_device(torch.nn.Module): def __init__(self,config,isfloat=True): super().__init__() self.num_ch...
cd83f7bb6b6f750801704fbbdf9c3d3b77451ca8e8378567b36389662c7e8811
Python
43,863
726
import os import time from warnings import warn import numpy as np from matplotlib import pyplot as plt import multiprocessing from adapter_theta_params import AdapterThetaParams, RoundTheta from cellular_models import CellularModelBiomarkerDictionary, MitchellSchaefferAPDdictionary from conduction_system import Empty...
460aaceb9f15b09dd1dbce39ab09d90fc5d0af25760b35b0da6821c0bbf1c6c2
Python
43,898
1,082
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2020 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime from email import message_from_file import hashlib i...
299d2a964b355b4ab56c7350d7b859adf59768ce1135eb3f7cf140d0beef8f0e
Python
43,942
1,204
""" Unified Data I/O Module ======================= Auto-detects input format (NIfTI, NRRD, DICOM, TIFF), loads data into a common ``VolumeData`` container with metadata (spacing, affine, orientation), and validates format compatibility per-module. Supported formats ----------------- - NIfTI (.nii, .nii.gz...
1793e2a6cc2e2400480ccc49f1f100ace968685fba2d5de3a9f9b754e360b97f
Python
43,969
1,051
import argparse import collections import gzip import math import os import random import shutil import subprocess import sys import time import numpy as np import pandas as pd import tensorflow as tf import pybedtools as pybt import tabix as tb from datetime import datetime from tensorflow import strings as tfs from...
33c60e84e9bc5dede02d9a30744f9d0130ab612e3855ca895e0129d1331b9374
Python
44,026
1,003
""" PyQt5 GUI for Cellpose-SAM cell detection and segmentation. Launches detection in a separate terminal window with ANSI color output, matching the pattern used by the stitching GUI. Structure --------- - ``launch_helpers.py`` - pure-Python model discovery / CLI-arg helpers (no Qt) - ``dialogs.py`` ...
94f4c2b22cf96a9dc38190bd979427708f2caebebe315d0e5a87735ccba2c2b8
Python
44,102
675
# this lib, together with the preprocess_mice_trials script # is used to process the raw excel files that have the tracking # of the mouse in the arena looking for the hidden food # # the experiments were originally performed by Kelly Xu from Len Maler lab # # the original excel files are not going to be included in th...
0077869718349835d834e801f666133271cb8ef7423cd8bfb92c492a073692e0
Python
44,150
1,085
""" Defines class Vesicles that holds data from one or more observations (experiments) divided (classified) in groups. The observations are expected to be generated by scripts/vesicles.py. # Author: Vladan Lucic (Max Planck Institute for Biochemistry) # $Id$ """ from __future__ import unicode_literals from __futur...
dd30e5a47272abd11bbfb280dc37af27a50086b03290c9c156492480671f9823
Python
44,166
1,160
import numpy as np from enum import Enum from client_tcp import ClientTCP import reram_register import globals.global_func as gf MAX_PACKET_LEN = 0xFFFF CMD_HEAD = 0x3A RESPONSE_HEAD = 0x3B PACKET_HEAD_LEN = 0x07 CMD_NULL = 0xFF CMD_COMMON_START = 0x80 CMD_DEBUG = 0x01 + CMD_COMMON_START CMD_WRITE_R...
7b23b89f491eff9285f6ab8239320023b24120620b7953da89fe9dcab8b99527
Python
44,177
1,105
import numpy as np import matplotlib.pyplot as plt # Plot boundaries for different updating e_hat = np.argmax(sem_model.results.post, axis=1) frame_boundaries = np.concatenate([[0], e_hat[1:] != e_hat[:-1]]) e_hat = np.argmax(sem_model.results.post_pe, axis=1) frame_boundaries_pe = np.concatenate([[0], e_hat[1:] != e_...
dd915f632eebeb7e9a1ba413ab72f9ba0405f0738ef2731867914c2bdad6050c
Python
44,211
934
# Copyright 2022 HYBRID Team INCIA, UMR5287, CNRS, Université de Bordeaux # 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 b...
477752dbdf8698a3a9076dbc765c660fe57c86d10536b8be81f3c109303577d4
Python
44,257
915
# coding: utf-8 # In[ ]: import tensorflow as tf from tensorflow.python.ops import control_flow_ops from tensorflow.contrib.framework.python.ops import variables from tensorflow.contrib.layers.python.layers import utils from tensorflow.python.framework import ops from tensorflow.python.layers import normalization a...
43c04cefe143c42eb5bc28351a13acf725619b20410b8edf13e6058cd74bf488
Python
44,309
918
options = dict( verbose=True, model_extensions=[ 'h2o.model.extensions.ScoringHistoryTrees', 'h2o.model.extensions.VariableImportance', 'h2o.model.extensions.FeatureInteraction', 'h2o.model.extensions.Trees', 'h2o.model.extensions.SupervisedTrees', 'h2o.model.exte...
e5be3ce6d13a590e690a4a96b833eae9c38a1feb00a7a354f8bb53d31c03b789
Python
44,360
1,083
import math import warnings from copy import copy from collections.abc import Sequence from matplotlib import pyplot as plt from rdkit import Chem from rdkit.Chem.Scaffolds import MurckoScaffold import torch from torch_scatter import scatter_add, scatter_min from torchdrug import utils from torchdrug.data import cons...
5363d482064ef959be85c34a14636ef3e7fabe6d2aa9e9319536d036ea01f55a
Python
44,362
847
import os import math import numpy as np import json import scipy.io import pandas as pd import pymp, multiprocessing from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader from vtkmodules.util import numpy_support as VN from warnings import warn from ecg_functions import resample_ecg from utils import initiali...
c548ea2aa88957c1e8fd7cc1a40b6fe4916854f4aea4af92517bed8f28141eac
Python
44,375
2,151
# This file is automatically generated by tools/idna-data __version__ = '15.0.0' scripts = { 'Greek': ( 0x37000000374, 0x37500000378, 0x37a0000037e, 0x37f00000380, 0x38400000385, 0x38600000387, 0x3880000038b, 0x38c0000038d, 0x38e000003a2, ...
6a96a18e6ba4288bd5ca995b654a9b08f9151e0258224cff5e282df28e02fcaf
Python
44,379
1,267
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import math import numbers import random import numpy as np import PIL import torch import torchvision import torchvision.transforms.functional as F from PIL import Image from torchvision import transforms from . import fu...
1bc6703e5418fc5dcbad8e089e56852c7c404f9998c278f8f318cd0944c9f122
Python
44,427
837
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 16 08:00:51 2020 @author: daltonm """ #%matplotlib notebook import numpy as np import pandas as pd import matplotlib.pyplot as plt import pickle import dill import os import time import glob import math import seaborn as sns from sklearn.decomposi...
2a5c9a178dbd810cb69d38096cbbbc86c2359ef1c2f791025fe630194e86da9b
Python
44,427
1,133
# -*- coding: utf-8 -*- # # Definition of the respective ComputationalRoutines # for the `freqanalysis` frontend. The *method*_cF function # definitions serve as middleware connecting the pure # backend methods to the ComputationalRoutines. The # 1st argument always is the data, and the last argument # `method_kwargs` ...
8bb2da17eed0a5f2d33b56fe48d6d3453e7525d35766c24daf6357d04ce62b3a
Python
44,491
1,577
#!/usr/bin/env python3 # ****************************************** # # SHARC Program Suite # # Copyright (c) 2023 University of Vienna # Copyright (c) 2023 University of Minnesota # Copyright (c) 2024 University of Chicago # # This file is part of SHARC. # # SHARC is free software: you can redistrib...
d69d73192ef0d551d910a4a1f1450c274fa5eca93ec222a3bc2111af1666ab7d
Python
44,539
1,163
from __future__ import division from __future__ import print_function from builtins import str from builtins import range from builtins import object import tensorflow as tf import os import PoseTools import multiResData from enum import Enum import numpy as np import re import pickle import sys import math from past....
31ef6c2d69fe3aa4c01c320971a4d13d37e22a79b72e0eb164efb5051338c25f
Python
44,542
987
""" Find columns on synapse tomograms (ListTomograms) and measure their statistics. Files for columns visualization in VTK format. Input: - 3 STAR files (layers) with the ListTomoParticles pickles Output: - Plots by tomograms and globally: + Number of columns + Column...
87b5691e55774b75259f0ba73eac3e25402fa1f1706629d9dbd9b422e8448516
Python
44,562
1,354
#!/usr/bin/env python3 # ****************************************** # # SHARC Program Suite # # Copyright (c) 2023 University of Vienna # # This file is part of SHARC. # # SHARC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
4ff0f10f42e4e6f7dbc9994b030ee0bc2ca05b60c4b0ec4eefe43f739354aa33
Python
44,713
729
""" Authored by: Neel Kanwal (neel.kanwal0@gmail.com)""" # This file provides training code for SOTA DCNNs models mentioned in the paper. # Update paths to processed datasets if __name__ == "__main__": import warnings warnings.simplefilter(action='ignore', category=FutureWarning) warnings.simp...
10ab90db000311eaa88def71d347ba978604cfcfd9debf7df978ba68e4d243ea
Python
44,741
743
"""Single frozen transformer, two independent chats, and measured reservoir activity. The engine is owned by one worker. Its lock also serializes direct API calls; only Telemetry.snapshot and a cancellation Event need to be accessed from the UI. """ from __future__ import annotations import json import time import uu...
c8fcd934cc681e1b4fdecd1c3fba97e38ba01f57040a2a54cb81aca8f0e5e5c2
Python
44,778
1,134
""" Class Morphology for calculation of morphological quantities of a segmented image(label field). # Author: Vladan Lucic # $Id$ """ from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division from builtins import str from builtins import zip from builtins import ran...
2aeaad5077af1eec1e8690282a869c5cdd278f8e1d3a802714dac0fb2b309017
Python
44,859
1,308
#!/usr/bin/env python3 # ****************************************** # # SHARC Program Suite # # Copyright (c) 2023 University of Vienna # # This file is part of SHARC. # # SHARC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
eb0efec1bc619a0164539b24938c9c4855c1d80ebb8c7e3f3d9333ffe770c2e1
Python
44,890
845
# 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...
f30d03372efd73dbb42d222773d1f6e007b3c6c68a9de39653b16b938ecb1a1f
Python
44,898
1,092
from math import fsum, sqrt from copy import copy from traceHandler import sizeError import efel import numpy as np import modelHandler import time import random import threading import matplotlib.pyplot as plt import threading try: import copyreg except: import copyreg from types import MethodType import os ...
adebfba02c8c08ea78cc93933b2d1b3b2d6be2e6ab5fe731c5571211f8cc5a69
Python
44,916
1,003
""" This file provides more general implementations of Python methods used to create surrogate models for various loads of an office cell with attached overhang with respect to overhang depth and height. Besides originally intended purpose, these methods allow interested researchers to use them independently in order t...
f2324c0687e1dec37e98ad8a677a97ba8d56ad874f6976baa9e4e662852ab997
Python
45,054
1,137
# 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...
3dfc3aec79b55ecb93fd09d548859586caeb5aa97288513a2f34e22fdbaa719c
Python
45,141
1,214
# This file is meant primarily for people who want to see an example # of how to use part of the OpenBabel API, with a secondary use as a # set of quick unit tests to make sure there's no strange but obvious # problem with your OpenBabel setup. # Regression tests, coverage tests, stress tests, performance tests, # etc...
9318bad6f05bd9b6b09235e50eabd5d24a8fc2be7bad1e8b3ae6215fc2b4a956
Python
45,186
938
"""Per-region plaque segmentation statistics for warped label volumes. Called from the Apply Transforms pipeline when ``--is_segmentation`` is set and the direction is data->template. The warped segmentation lands in atlas (Allen CCF 25 µm) space, so the annotation volume aligns natively - no atlas warping is ne...
39ef87f9b1cebf613cf9c7284242d897994402ce6af772390a9ad59dccb6d46a
Python
45,213
747
# the implementation for CG MAML-based regression framework import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import warnings warnings.simplefilter("ignore") import json import util import time import tqdm import torch import pprint import random import numpy as np import ...
a026cd5cf869e55260b4eb1073860483612055613c1394566d6526135a71f83c
Python
45,258
893
################################################################################ # Import, Set up MPI Variables, Load Necessary Files ################################################################################ import os from os.path import join import sys import matplotlib import matplotlib.pyplot as plt from matp...
cb9c672a77ef2478fa4cbb5bdbc14f66e625aec4e899c3c0ad4b08de671345c3
Python
45,338
1,044
""" GUI tab for creating NIfTI volumes from TIFF image data. """ import os import subprocess import sys import time import numpy as np from natsort import natsorted from PySide6.QtWidgets import ( QWidget, QVBoxLayout, QHBoxLayout, QLabel, QFileDialog, QCheckBox, QPushB...
2935e8b1e3eaebfce51dfa2ee81001218490d143e94ce804455de56049d6582d
Python
45,350
987
""" Assembly detection related plots author: András Ecker, last update: 07.2023 """ import numpy as np from scipy.cluster.hierarchy import dendrogram, set_link_color_palette from assemblyfire.utils import group_clusters_by_patterns, count_clusters_by_patterns_across_seeds import matplotlib matplotlib.use("Agg") import...
ffc2419526aed1cdb3f0434e64c8b5849eccd59198e34f04e3e8578c7cb28350
Python
45,525
1,307
import re from functools import partial, reduce from math import gcd from operator import itemgetter from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union, ) from ._loop import loop_last from ._pick import pick_bool from ._wr...
779cd4cf9b8b5fd92265f3b1fdc805686aae4fb741803921625fa68cf5df6274
Python
45,598
837
# 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...
e3dd506dd12cee551b554b61dd699d68e9df42b3692630c90a0ff057a190e265
Python
45,611
1,064
# -*- coding: utf-8 -*- # # Syncopy spectral estimation methods # # Builtin/3rd party package imports import numpy as np # Syncopy imports from syncopy.shared.parsers import data_parser, scalar_parser, array_parser from syncopy.shared.tools import get_defaults, get_frontend_cfg from syncopy.datatype import SpectralDa...
ee1ae0b42741720ecfe19a6bfaf51eb938625f019e71707534d7e6d18e32a7b4
Python
45,621
1,225
# This module is a slow Qt/matplotlib-based implementation of BQA. # BUT! It is obsolete, untested and might not work: use qmod.py instead. import sys import os import webbrowser import time import matplotlib as mpl import numpy as np import scipy as sp import scipy.stats as stats from matplotlib.backends.backend_qt4a...
081d2aac28b92a509a6f98ea88ef81a7c3ab87c877320ca16362764efb9e0898
Python
45,657
923
################################################################################ # Import, Set up MPI Variables, Load Necessary Files ################################################################################ import os from os.path import join import sys import matplotlib import matplotlib.pyplot as plt from matp...
2b73cdc41e6266579540b3adf24a2a0df3d271c14a936cedb26c1126fba2038f
Python
45,668
856
import os import multiprocessing import random import numpy as np os.environ['TF_ENABLE_EAGER_CLIENT_STREAMING_ENQUEUE']='False' import tensorflow as tf from tensorflow import strings as tfs import src.metrics as metrics import src.utils from src.losses import poisson_multinomial tf.keras.backend.set_floatx('float3...
501e527ddd92d7193a73db9077e859bedb51b6ad31fe468590ae6ec94e33fe6a
Python
45,672
1,188
from __future__ import division import sys import os import logging import cv2 import copy import numpy as np import tensorflow vv = [int(v) for v in tensorflow.__version__.split('.')] if (vv[0]==1 and vv[1]>12) or vv[0]==2: tf = tensorflow.compat.v1 else: tf = tensorflow from itertools import islice import t...
978254a1a9e19b7bf651f136620f9da7f498ed5888195efb4c77128b6cd568d8
Python
45,706
650
import copy import math import random import numpy as np class Train_FewshotBatchSampler: def __init__(self, subset, dataset, K_shot, K_query, query_min, batch_size, seed, **kwargs): self.subset = subset # selected subset for meta-training self.dataset = dataset # complete pytorch Datas...
be1c8286c7c8bf473abe00538fefa300a307893e9a9912702fc938c0617c0085
Python
45,720
953
"""Base translation model with different variations""" import os import shutil from abc import ABC, abstractmethod import numpy as np import tensorflow as tf class BaseModel(ABC): """ This is the base class for the translation model. Child class defines encode and decode architecture. Attr...
1fdadab063a8b77e1c8e7c0f93e6a169b9f6df9cec7db183905700c77a064a91
Python
45,745
1,374
# 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...
bff2ba7841bc9c38d9d683b938863be5f851210f3d47d0ddb888d076c26a3002
Python
45,859
1,082
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
c32793fd6fea7e1235c58e63d9a75c5d0a26b9f992da4abe41b4e2f2945acde3
Python
45,903
1,063
# If using multiprocessing, this module will be imported dynamically import logging # no need to set handler here, since we already set handler in root logger (utils.py), this child logger inherit that. logger = logging.getLogger(__name__) logger.info('Import event_models.py') import numpy as np import tensorflow as...