sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a76b0352cd54f2ff6cc7be3af8736703306ccda0e05774a07d117de3fde169a5
Python
7,414
182
#!/usr/bin/env python3 # # Copyright (c) 2019 Seoul National University # # 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...
fa2584a54733f0aca6d3b7b229595cd7f792f114507ecb47aa97959cf2241747
Python
7,416
252
import pytest import torch from ..rno_block import RNOBlock @pytest.mark.parametrize("n_dim", [1, 2, 3]) @pytest.mark.parametrize("complex_data", [False, True]) def test_RNOBlock_basic(n_dim, complex_data): """Test RNOBlock with basic functionality""" modes = (8, 8, 8) width = 16 size = [12] * n_dim ...
5a0415a3ea45f382530246029db5faf4f3a83f4d326f44b2efd5d5156fbc52a2
Python
7,418
191
''' - Convert rule to mesh (c, v, t) - Convert system to mesh (triangulation object) ''' import numpy as np import mesh.shapes as shapes from mesh import prepare_system ## Function to convert system to Triangulation def triangulate_system(*tria_generator_args, tria_generator=None, external_flow_field=None): ''' ...
5512dfd6172d9c368476dfebde21f8d6b2e81d72752aeaa9cbe64b01e5ef5948
Python
7,422
176
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
33c80fe65ca0b973085cc7045c6854351ed07c9224a276a07e51e9091a6e264f
Python
7,423
210
import torch import torch.nn as nn # from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler from ..builder import DETECTORS, build_backbone, build_head, build_neck from .base import BaseDetector @DETECTORS.register_module() class TwoStageDetector(BaseDetector): """Base class for two-stage de...
0e0f8e73c4f617d250170316e5b0cde88f04b09c3088b30b0325883e86462f5e
Python
7,424
209
#################################################################################################### # Copyright (c) 2016 - 2021, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis> # # This program is free ...
ff8417479efa1695c1bf9b8eb628f02f78dda1496ef46d929b2d14aadf5cc234
Python
7,426
191
# Copyright 2020 Google Research. 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 applicable law...
5f08c9824393ad312d166e4c1c03ad01f4f8f25bf16adcff3a1c5dc540813735
Python
7,428
136
# Copyright (c) 2016, Konstantinos Kamnitsas # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the BSD license. See the accompanying LICENSE file # or read the terms at https://opensource.org/licenses/BSD-3-Clause. from __future__ import absolute_im...
aa587b59e6aa77415865334c91cbe01b163849652ad8b991036dfa8d36159539
Python
7,430
192
#!/usr/bin/env python import argparse import joblib as jl import numpy as np # empirical value, in range from 0 to 1; # the higher, the more confident prediction will be # I recommend starting from 0.8 and increase threshold # if too many positive results are reported # -- V. Fishman THRESHOLD=0.8 # again, very ...
04fa3a1a18be35a6244e7e573c4cba369447ca0ff789840099c1bfee2fbe623b
Python
7,432
182
import argparse import os from os import path import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import ShuffleSplit, GridSearchCV from sklearn.metrics import (mean_absolute_error, mean_squared_erro...
40bfb6f39d8bdd48f83ae79fa61780b6c2ab39005b5050740638eec97bf7e131
Python
7,435
214
import tensorflow as tf import numpy as np import pandas as pd from scipy import interpolate from .Dataset import get_network_input_obs def linclip(i1, i2, v1, v2): """ Return function to calculate beta for clipped linear growth """ def beta(i): a = (v2 - v1)/(i2 - i1) b = (i2*v1 - ...
a59d9b64de700b4a1904651df03b02912a85269da42f8327a3a52940a8ac7e5b
Python
7,436
186
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
dd5c7a9c52df9b0cd303aeee31af57f34963796db7db89fc9f81074c0a55b69d
Python
7,436
178
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
9f80cbeaaa7ed799c17cf5fb4a8ce533b657adab583ce2ba5efd11c971f66809
Python
7,440
224
''' @author: Mahbub Ul Alam (mahbub@dsv.su.se) @version: 1.0+ @copyright: Copyright (c) Mahbub Ul Alam (mahbub@dsv.su.se) @license : MIT License ''' import numpy as np import pickle from torch.utils.data import WeightedRandomSampler, DataLoader, TensorDataset import pandas as pd import torch def load_data(time_windo...
b1693acef711eed164d932f9de682181d872249befd18d2b40a3ce780ebb7999
Python
7,442
231
import torch import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import torch.nn.functional as F __all__ = ['ResNet', 'resnet18_plain', 'resnet34_plain', 'resnet50_plain', 'resnet101_plain', 'resnet152_plain'] model_urls = { 'resnet18': 'https://download.pytorch.org/models/resn...
bbe1f7450c3e3196b3cb8f28dfa233b6c5bc2102e32adcc9a391ba8ed9206f03
Python
7,442
174
#!/usr/bin/env python2 import os import sys import operator def get_files_by_file_size(dirname, reverse=False): """ Return list of file paths in directory sorted by file size """ # Get list of files filepaths = [] for basename in os.listdir(dirname): filename = os.path.join(dirname, basename...
c723c769a01c1c8ee2dca7e32330eb056198ef83575afd1f8f5dee8a1fa04ac1
Python
7,446
279
import argparse from typing import Union def boolean_string(s: str) -> bool: """helper function, turns string into boolean variable Args: s (str): input string Raises: ValueError: if s neither False nor True Returns: bool: s turned into boolean """ if s not in {"Fals...
0cae958ea3c2942b168e157461acc8e4df12d5ef633a2738620965480e98bb7c
Python
7,447
207
""" This module provides the `ISMResult` class, which stores results for an *in silico* mutagenesis experiment. """ import numpy as np import pandas as pd from ..sequences import Genome class ISMResult(object): """ An object storing the results of an *in silico* mutagenesis experiment. Parameters ...
a9a82d0170cfa85c7252eb483c4f876fdfd1c97a959299ab732e6b5dd1fa4c47
Python
7,449
181
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import pickle from collections import OrderedDict import torch from maskrcnn_benchmark.utils.model_serialization import load_state_dict from maskrcnn_benchmark.utils.registry import Registry def _rename_basic_resnet_weights(layer...
5ed5754c8bf559b340ef186c1955f0b8b74506b1dd78af95d02b81866362aeff
Python
7,450
188
from dash import Patch from dash_extensions.enrich import Output, Input, State, callback, clientside_callback, no_update, ctx from dash.exceptions import PreventUpdate import numpy as np def register_segment_callbacks(): # Simulate click on left- and right-arrow buttons when left- and right-arrow keys are presse...
6846d51a82f36adbef8ebe2bf3735f2c9be2a8977df8534fcfcffae51e5a7798
Python
7,450
211
import logging from typing import Union import torch from anndata import AnnData from scvi.core.modules._base import FCLayers from scvi.data import transfer_anndata_setup from scvi.core.models._utils import ( _initialize_model, _load_saved_files, _validate_var_names, ) from .base import BaseModelClass l...
78e95b2126e67a1e3a037703baca9f19516026abcfee38483c59d1c831411429
Python
7,454
186
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
5c7116ef3289617734c216af462a23b5034c529fcd13a9bbacf9fdcedadd06a4
Python
7,460
290
__author__ = "Jianfeng Sun" __version__ = "v1.0" __copyright__ = "Copyright 2023" __license__ = "GPL v3.0" __email__ = "jianfeng.sunmt@gmail.com" __maintainer__ = "Jianfeng Sun" import linecache import os import re import subprocess import numpy as np from tmkit.interface import Topology from tmkit.sequence import F...
d405201437cf6c713f3427dff7591720397cbc297c633e8f3712e76727412d48
Python
7,464
211
import torch import torch.nn as nn # from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler from ..builder import DETECTORS, build_backbone, build_head, build_neck from .base import BaseDetector @DETECTORS.register_module() class TwoStageDetector(BaseDetector): """Base class for two-stage de...
c88188c1ee08fd32fb8608980e83b0ce5d180b6cc8164c69cacf8e87402d0a1f
Python
7,468
176
import tensorflow as tf import tensorlayer as tl import numpy as np import os import time from config import config from model import UNet_A, UNet_B from model.util.tf_pb import save_graph_as_pb from utils import * n_num = config.PSF.Nnum n_slices = config.PSF.n_slices label = config.label model_type = ...
952675e307ec553125d92039c897a88c4bed8c922b9843a47fc3fa487bc2fb72
Python
7,469
226
import torch import numpy as np; # Original implementation: # https://github.com/warmspringwinds/pytorch-segmentation-detection/blob/master/pytorch_segmentation_detection/utils/flops_benchmark.py # ---- Public functions def add_flops_counting_methods(net_main_module): """Adds flops counting functions to ...
1ad906b4565f6f2b9f9070ac762bbab929d5f881f81871fa540d1adef68d17e4
Python
7,472
190
import numpy as np import h5py import matplotlib.pyplot as plt from icecream import ic import warnings import pandas as pd import seaborn as sns warnings.filterwarnings("ignore") def read_h5(filepath, i, o, b=48, has_mask=True): mask = None with h5py.File(filepath, 'r') as hf: vx = np.asarray(hf...
31f8e470d35f3cf223d62337917979afbfe88f322220aac68475d4f05207dd43
Python
7,473
190
#!/usr/bin/env python3 # # Copyright (c) 2018 Institute for Basic Science # # 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 u...
e47afceb9cc9d227c60ebd53822ea096ae44d1306e15e468f772afa582d483c9
Python
7,477
239
import copy import random from functools import wraps import torch from torch import nn import torch.nn.functional as F import numpy as np from torchvision import transforms as T from torchvision import models from net.models.modeling import VisionTransformer, CONFIGS # helper functions def default(val, def_val): ...
512d229bf43a3d919e7318a9418c6f8e4ffa9de47a4be6ef9ccaa41463b27a93
Python
7,480
202
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from maskrcnn_benchmark.modeling.box_coder import BoxCoder from maskrcnn_benchmark.structures.bounding_box import BoxList from maskrcnn_benchmark.structures.boxlist_ops import cat_boxlist from maskrcnn_benchmark.structures.boxlist_ops...
8e48145e0e773a6d07c9e40cf64989050ca5ba5de9b21ac1c0784296689c86d8
Python
7,480
195
######################################################################################88 FREDHUTCH_HACKS = False # silly stuff Phil added for running on Hutch servers if FREDHUTCH_HACKS: import os from shutil import which os.environ['XLA_FLAGS']='--xla_gpu_force_compilation_parallelism=1' os.environ["T...
6763e260460823cb46c3231200b0ab62e3037d99d3aa108b9df41905a9a6f65e
Python
7,481
200
import torch import torch.nn as nn import torch.nn.functional as F from ..builder import LOSSES from .utils import weight_reduce_loss def cross_entropy(pred, label, weight=None, reduction='mean', avg_factor=None, class_weight=N...
fb1a02837f0fdb2ece22fcfc956bc57bc7a5d511724eddf8a252ed9e16214379
Python
7,481
203
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
ba424c1238aea3345c7161f123de904ab4c52a808813a9e257c17e57d2e2f67a
Python
7,483
187
from __future__ import absolute_import import sys import torch import torch.nn as nn import torch.nn.init as init from torch.autograd import Variable import numpy as np from pdb import set_trace as st from skimage import color from IPython import embed from . import pretrained_networks as pn import lpips as util de...
0c3df97fb28df569aa5ab5e650855289e3057c203bab94549f2ee5d3467e83a6
Python
7,488
177
""" File: cmd_line_arguments.py Created: 2020/06/29 Last Changed: 2020/11/22 Author: M.Vochteloo Copyright (C) 2020 M.Vochteloo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, eit...
9a8de4ee78422aac9f22eac5c563375f49d503462a36ae0cdedc9c6284e4ff8f
Python
7,488
225
#!/usr/bin/env python import os import subprocess import time from setuptools import find_packages, setup import torch from torch.utils.cpp_extension import (BuildExtension, CppExtension, CUDAExtension) def readme(): with open('README.md', encoding='utf-8') as f: co...
052291f93280b6ca649c3e6386e77c47e7711402aedc2bd8863fa46f1526495a
Python
7,492
223
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np import torchvision.models as models from model.utils.config import cfg from model.roi_crop.functions.roi_crop import RoICropFunction import cv2 import pdb import random def save_net(fname, net): ...
c16f4661f54c0ff49cf885b7bbc3ff53504c58e039ce6108ef8479cbfc1b91e9
Python
7,492
184
import logging from dataclasses import dataclass, field from typing import Iterable, Iterator, Tuple from oaklib import BasicOntologyInterface from oaklib.datamodels.validation_datamodel import SeverityOptions, ValidationResult from oaklib.datamodels.vocabulary import IS_A from oaklib.interfaces.obograph_interface imp...
6385130127cb88c897e21441d20d20cfc7b510ae47ea8167635eb07ac8762a50
Python
7,494
147
"""Exercise world.set_sky_light_map / clear_sky_light_map on a live server. python skymap_test.py --port 3300 --out /path/captures [--probe hyb_illum_7c2cf6cd.jpg] Spawns a car, looks at it from behind (so the car's left is the image's left), captures: a) default sky, b) synthetic map (blue top / orange bottom, ...
d91642a86d322aba447f39ff6aca7dee80d5d2a33c31b2f2dec6914582087ce5
Python
7,494
221
import argparse import ast import glob import os import sys import pandas as pd import pathlib import re import subprocess from collections import namedtuple """ Usage: python3 parse_GS_genomes.py -f <input_sample.tsv> -d <absolute path to create directories> Parses analyses request csv from Stager for exome re-anal...
84a19b896cdb6bc0ee57b7ef13829e532e5438e135e50c0a87404207dcb8b473
Python
7,495
202
from defaults.paths import paths from modules.parameters import ParameterSet, copy_dict import numpy as np import sys """ single_neuron_fI - simulate a single neuron, driven by direct current input and determine the neuron's fI curve - run with single_neuron_dcinput in computations - debug with run_single_neuron_dcinp...
ddec2d2aab76d5854aa1504e4c35e2c97dd7e2ee92b80d42bd6e85cad929f0a1
Python
7,497
177
''' Updated version: Now use tangent and normal vectors in input Use them when building the mesh, respecting flagellum material frame Also take into account rotations of flagellum normals when calculating the velocities. -> Works only for the case of planar beat! ''' import numpy as np from scipy.linalg import norm i...
56c8871fa2a680612a520bb42e243da3fc7ac43b3570e18102f9877c8ccdf89d
Python
7,498
173
"""The viewer's video export (``carla_cosmos.viewer``) — headless, on a tiny synthetic result. The point of the export is that it is *the viewer*, serialised: same compositor, same tiles, same labels. So the tests decode the produced mp4 with OpenCV and compare it against what :meth:`Composer.render` draws for the sa...
9ad43acfefa5eb15b9de863c1aedd96db8f0e2868c8afe1d2be326515551c91e
Python
7,499
182
""" Contains code for logging approximate FID scores during training. If you want to output ground-truth images from the training dataset, you can run this file as a script. """ import os import shutil import torch import copy import argparse from torch.utils.data import dataset from torchvision.utils import save_ima...
867f8419992c4e3b432247ad5d86d4649b98b6ba80a867cf84993c1f4d8d8f43
Python
7,501
191
import tqdm import ipdb import argparse, sys import random as rand import torch from metrics import * from graphxai.explainers import * from graphxai.datasets import load_ShapeGGen from graphxai.datasets.shape_graph import ShapeGGen from graphxai.gnn_models.node_classification.testing import GIN_3layer_basic def get...
515f61c9593ead35cef88edd240f8815388547760679a5ff7d853f325c337998
Python
7,507
177
__author__ = 'duarte' import copy from preset import * import numpy as np """ single_neuron_patterned_synaptic_input - main spike_input stimulus processing """ run = 'local' data_label = 'example2_patterned_synaptic_input' # ############################################################################################...
367a912dfb1b8a2355d86d41a6cc9f8dab02d12c5e2a2d1cda8135309385e167
Python
7,514
207
#!/usr/bin/env python3 """ File: add_gene_to_matrix.py Created: 2020/10/20 Last Changed: 2020/10/28 Author: M.Vochteloo Copyright (C) 2020 M.Vochteloo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ...
727ed4b068d5d4363aca995c757e41951f4350ac956f370a1510a0d70b40f598
Python
7,514
189
# Copyright 2020-2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
fa1fb008e2884b9c09c98d225d908d860b4e21103acd929cd2652efd5581576f
Python
7,515
222
#!/usr/bin/env python3 """ File: visualise_single_cell_expression.py Created: 2020/10/27 Last Changed: Author: M.Vochteloo Copyright (C) 2020 M.Vochteloo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fr...
af563e39f6dd7c1ad9f73c4be5785741dd7adc3656cf0272e0280a26ab8e295b
Python
7,518
198
import numpy as np import torch import cv2 from matplotlib import pyplot as plt from PIL import Image from sklearn.metrics import (confusion_matrix, f1_score, jaccard_similarity_score, precision_recall_curve, roc_auc_score, roc_curve) class AverageMeter(objec...
c4ec08edd527474e994feabadd7c584e36dc03eb1e6ff102a175bc8625d9261c
Python
7,519
225
"""Several dataclasses for storing all transcript related data. Statements are split into two varietes, embedded and speaker statements. Embedded statement appears as part of a speaker statement. Embedded statements contain only minimal amount of information while speaker statements can have more associated data. Sta...
a24985c4ab3afe8f1458cf9f5b29d55f7285ed8ea7c4bc934c26a40e10babaed
Python
7,520
189
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
44c234ce954c3dc1848680faffcc60e8e897aca0d089426f77ee2bf6fb7d2e73
Python
7,521
203
""" Shared code to run a sequence-like experiment where cells are driven by random background activity and one or more cells are forced to spike at fixed times. """ import logging import pandas as pd import numpy as np from tqdm.auto import tqdm as pbar from tctx.util.profiling import log_time from tctx.util import si...
242b745653be0ec77520ea0c5ba532122bad71c1bc3485584bfcc9f9e4cb0607
Python
7,523
210
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
ce889deb1b15b72d5b57fc347697debaeb892b83413fec9e1eb6a92ce5367321
Python
7,523
210
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
2e42f16040fa7f6126c0730e27225d673f4c94df69b72af2e4766b58bb95f356
Python
7,524
222
#//============================================================= #//Copyright (c) 2011 G. Gogoshin #//Distributed under MIT-style license. #//(see LICENSE.txt or visit http://opensource.org/licenses/MIT) #//============================================================= import numpy as np import csv import oflib def ...
96d43e966d5f931b3f777a2a18dd0075768c3f569782865800ab8d94ed85adbf
Python
7,524
225
import warnings import torch import torch.nn as nn from torchnlp.nn import Attention from blitz.modules import BayesianConv1d, BayesianLinear from blitz.utils import variational_estimator class LinearDropRelu(nn.Module): def __init__(self, in_features, out_features, dropout=0, bias=True): super(LinearDro...
7263088f1e3726a90c9e9e429857188242b562e8c1df6537c17e6ab4f5b3a10f
Python
7,525
227
from collections import defaultdict import pytorch_lightning as pl from torchmetrics import MeanAbsoluteError as MAE from torchmetrics.classification import MulticlassF1Score as F1 import torch.nn as nn import torch from functools import partial from ..layers.diverse import MLP, AlphaPredictor from ..layers.features_in...
26a4006194d85e82afb288693c827f60908ec44a456da47daedc4688cc5c0e16
Python
7,533
244
import os from typing import Iterable, List import numpy as np import torch from cgtasknet.tasks.reduce import ( CtxDMTaskParameters, DMTaskParameters, DMTaskRandomModParameters, GoDlTaskParameters, GoDlTaskRandomModParameters, GoRtTaskParameters, GoRtTaskRandomModParameters, GoTaskPara...
890d0c20740b90dcb6fd4799b5fe187b121ab4f5d4ed6c506de7e3e49c9ac031
Python
7,534
203
import os import torch import yaml from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from glob import glob from torchvision.transforms import Compose from torch.utils.data import DataLoader from timeit import default_timer as timer from dataset.SamplePadder import SamplePadder from dataset.SampleStan...
907984dfbcb918b07c119500ef485ead1e29942a9b929f51ebcb74f3b48cf288
Python
7,534
197
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
f5876d1dcca8d08787aea7d7a816792ec71874dce96adfad7a14c6dd427a3f6c
Python
7,534
247
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Variational Animal Motion Embedding 1.0-alpha Toolbox © K. Luxem & P. Bauer, Department of Cellular Neuroscience Leibniz Institute for Neurobiology, Magdeburg, Germany https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0 """ ...
f351f97b73537fbed8ca29b886b690f9f86a7d1e6f4aaf167a0f26549ef4fd47
Python
7,539
183
#################################################################################################### # Copyright (c) 2019, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis> # # This program is free softwar...
7ddfcc489adb57c1fce0586b085a71ba0a58c1c8406df3472723a437b9c6a3f9
Python
7,541
167
import os import numpy as np import sys import time import torch import torch.nn.functional as F from torchvision import transforms import torch.nn.init as init import random import pandas as pd from itertools import chain from skimage.io import imread, imshow, concatenate_images from skimage.transform import resize f...
f1b990e03acb1b39c1c2edd78bb89f7a16cd3e70779da38322c9e0152e9c4731
Python
7,541
259
# %% import os from pathlib import Path import colorcet as cc import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymaid import seaborn as sns from matplotlib.collections import LineCollection from matplotlib.lines import Line2D from sklearn.decomposition import PCA from umap import UMAP fro...
30afda1e5bc068310d8e92de804b1fec7ca25054b6e42bd4deddc08c09c558e7
Python
7,542
230
import os import time import logging import multiprocessing import pickle import gzip import bz2 from sklearn.decomposition import PCA from sklearn.manifold import TSNE import umap.umap_ as umap import numpy as np import pandas as pd from pathlib import Path from sklearn.model_selection import ...
684a218886fb3bc1857112d41dc7a5977266f4ec6cbf7cd73df94fbcd1e9e7fe
Python
7,542
218
import nibabel as nib import os.path as op import os import numpy as np import logging import pimms from AFQ.tasks.decorators import as_file from AFQ.tasks.utils import with_name, str_to_desc import AFQ.data.fetch as afd from AFQ.utils.path import drop_extension, write_json from AFQ.definitions.mapping import SynMap f...
fd54b2b5f1f0234fde35525d4b8191b5d9093612161d7e54cdf54a8c81136d1d
Python
7,543
182
#!/usr/bin/env python3 """ File: export_decon_to_excel.py Created: 2021/02/16 Last Changed: Author: M.Vochteloo Copyright (C) 2020 M.Vochteloo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software ...
1ebef4c602bc52db4bdecfdbfec773a72b04168a9b64170d5131d0c23d6d9a14
Python
7,544
216
# This script is part of navis (http://www.github.com/schlegelp/navis). # Copyright (C) 2018 Philipp Schlegel # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
9a1782c74684aa3e8137d02a681aa53a76c0b575b7fd93e53ea3e0c06d1f5c9d
Python
7,545
247
import os from typing import Iterable, List import numpy as np import torch from cgtasknet.tasks.reduce import ( CtxDMTaskParameters, DMTaskParameters, DMTaskRandomModParameters, GoDlTaskParameters, GoDlTaskRandomModParameters, GoRtTaskParameters, GoRtTaskRandomModParameters, GoTaskPara...
53e695e5007bd7dfdce73ee7f298269ff139cc9043bb71639274ed4e9d739fb7
Python
7,546
175
import logging import shutil import unittest from oaklib.datamodels import obograph from oaklib.datamodels.search_datamodel import SearchTermSyntax, SearchProperty from oaklib.implementations.ontobee.ontobee_implementation import OntobeeImplementation from oaklib.datamodels.vocabulary import IS_A, PART_OF from oaklib....
ee0b808e19a9948e34f247d1b1d368b24cc1b29181a9a7812539b0cf2b6b8ffd
Python
7,546
144
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
984ef965e5f9154daa7cc40df013d8cd427dd4e9f77f8e6168232a000b8a695c
Python
7,548
202
#!/usr/bin/env python3 """Accelerator coverage scan for LAMMPS pair styles. Lists every base pair style with the accelerator variants it has (OPENMP, GPU, KOKKOS, INTEL, OPT), how many force-style YAML references exercise it, how many example and benchmark inputs use it, the size of its implementation, and a few struc...
ab77eab3bd9c36e7d7a189b5e16f5afce55b05994e1950a2121bba9a2d3eedb7
Python
7,548
248
import os, time, random from numpy.core.fromnumeric import size from numpy.lib.type_check import imag from tqdm import tqdm from skimage.transform import resize # not using, highly inefficient from skimage.util import montage from sklearn.model_selection import KFold import nibabel as nib import numpy as np from tor...
ea34bb3fa2cc93c121ab04aa2d7e607c9113b0326292b8cdf7c2af6030377c0c
Python
7,550
247
import os from typing import Iterable, List import numpy as np import torch from cgtasknet.tasks.reduce import ( CtxDMTaskParameters, DMTaskParameters, DMTaskRandomModParameters, GoDlTaskParameters, GoDlTaskRandomModParameters, GoRtTaskParameters, GoRtTaskRandomModParameters, GoTaskPara...
17080ade9c9a0130739dc52fe09bb09fbce28ce4e77cf6ac86d6dc9e732845a9
Python
7,551
243
""" This file contains primitives for multi-gpu communication. This is useful when doing distributed training. """ import pickle import time import torch import torch.distributed as dist def get_world_size(): if not dist.is_available(): return 1 if not dist.is_initialized(): return 1 ret...
6224bb8a914958c2278b35ba20379f84708d9e953446faa0230ba68f149502da
Python
7,552
188
#!/usr/bin/env python # plot_tripseq_transcript.py # plot the indicated transcript or gene based input polysome sequencing (TrIPseq) data # Intended to be applied to fractionated polysome sequencing data (a la tripseq) but theoretically can work for any data involving transcript-specific distributions # Input form...
324e3c42267e95d375f101ffd124b0ce209e14a0efaeb16d03184f745b67e018
Python
7,561
132
__author__ = 'duarte' from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict from modules.input_architect import EncodingLayer from modules.net_architect import Network from modules.io import set_storage_locations from modules.signals import iterate_obj_list from modules.analysis import sin...
0d10d4c5b4b11416e6c0d3ae4c0551cc3d69d2ffb2cb680e57f52367fccaafa5
Python
7,566
155
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import argparse import torch from src.loader import load_images, DataSampler from src.utils import initialize_exp, b...
c7f5b1635dc8574e2895d817c6b94eab0d1186b63516cb26c3d01b52e4c0e848
Python
7,566
257
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> from itertools import chain from .._exceptions import DefinitionError from .._text import enumeration, plural from .._utils.parse import find_variables class CodeBase: _sep = ' ' def __init__( self, string: str, cod...
b982653fc1a2dcddbad457c60462fba833a368023f876d378f8cb1319f2214bd
Python
7,567
239
''' One-dimensional ring (`get_neighbours_list`) or chain (`get_neigbhours_list_non_periodic`) of oscillators. ''' import math import numpy as np from scipy.linalg import norm from carpet.various import mod2pi def get_domain_size(N, a): return N * a def get_nodes_and_ids(num_cilia, a, direction): direction ...
2ef190815ce18953c775048a624f3e66b9dc47ef4a8f58c5af10f36c48969631
Python
7,569
204
import glob import random import os import numpy as np import torch from torch.utils.data import Dataset from PIL import Image import torchvision.transforms as transforms import torchvision.transforms.functional as TF import random import albumentations as A import cv2 class an_BrainDataset(Dataset): def __init__...
caa0fefbc500957906afabf86ac26fc3ca5a58befe6b620ef4e649742812fe4f
Python
7,569
256
import math import torch import torch.nn as nn import torch.nn.functional as F from M2TR.utils.registries import MODEL_REGISTRY ''' MODEL: MODEL_NAME: Xception PRETRAINED: imagenet ESCAPE: '' ''' class SeparableConv2d(nn.Module): def __init__( self, in_channels, out_channels, ...
d929547d1a22abdbaca51ee51cafe0f94d202cb5d202a7ede98de44219111845
Python
7,569
209
import os, gc import scanpy as sc import anndata import numpy as np import pandas as pd ## Plots import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.colors as colors import seaborn as sns adata1 = anndata.read_h5ad('D30.h5') adata2 = anndata.read_h5ad('D52.h5') adata = anndata....
5814cf391d9faa972fbf34e0c71a8c01ed4b305259aa78343a0ac95110fff4ad
Python
7,572
199
import numpy as np import scipy.interpolate as sc from icecream import ic import time import os from random import shuffle import h5py import multi_slice_viewer as msv from scipy.spatial import Delaunay from scipy.spatial import KDTree from h5functions import save_to_h5 class CFDResult(): def __init__(self, filep...
7f91c14969144aa7e6d2c50f499a80f2f3b57611ff813a1cd872315938ff5840
Python
7,572
197
"""Eelbrain GUIs""" def run(block=False): """Hand over command to the GUI (quit the GUI to return to the terminal) Parameters ---------- block : bool Block the Terminal even if the GUI is capable of being run in parallel. Control returns to the Terminal when the user quits the GUI app...
35273053d12c10b4bd33f9c064d649b83d71d1a513123267c8a2fbe25d045821
Python
7,577
183
# Copyright 2020-2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
88ace4af08b9f818154b61026ccf42a4275dbbbf198a7e933458e7c0f9b29c81
Python
7,578
130
__author__ = 'duarte' from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict from modules.input_architect import EncodingLayer from modules.net_architect import Network from modules.io import set_storage_locations from modules.signals import iterate_obj_list from modules.analysis import sin...
afb690cf4ce07f26451ea8b8a90099e9db623c126a8622e014868093c1fdc17b
Python
7,578
206
from torchmetrics.functional import confusion_matrix from pytorch_lightning.callbacks import Callback from .network_tools import is_concerned from collections import defaultdict from tqdm import tqdm from ..data.datamodule import EMPTY_FIELD_VALUE import os, sys import torch import numpy as np import matplotlib.pyplot ...
b289552ad0894077c837a68e7b4f5a802ee4c9b37ebbf170cce4ac70080750d7
Python
7,578
268
import torch.nn as nn import torch import numpy as np from torch_geometric.nn import GlobalAttention, global_mean_pool from ..data.data_tools import edges_geom_causal from torch_sparse import SparseTensor from torch_geometric.data import Batch from torch.nn.utils import weight_norm ## Basic perceptron class ExpLayer...
7a37e1a1152790dc1687541396e2931761f403e8ea11814d4881edc982f40a7d
Python
7,579
214
import tqdm import networkx import numpy as np from rdkit import Chem, DataStructs from rdkit.Chem.Fraggle import FraggleSim from rdkit.Chem import Descriptors as rdFMCS from drugex.utils.fingerprints import get_fingerprint from drugex.training.scorers.interfaces import Scorer class TverskyFingerprintSimilarity(Sc...
4bd5e2a5424f87d3aba1bb7de5ad39a4d8e9eba88a9a94ab88733a75d628167e
Python
7,586
187
from ..transforms.data_processors import DefaultDataProcessor try: from einops import rearrange except ModuleNotFoundError: print( "Trying to import data processors for TheWell without required dependency\ ``einops``. Run ``pip install einops`` and try again." ) raise ModuleNotFoundEr...
7de74103801ab85e9f909dfe2386f3fcbc53a08a5b8466da147ab37be866c20d
Python
7,591
156
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
a3c9261cd5f0911b992d5103140e6159d06c34335d8d10fb29d3d93a0fe2ab4b
Python
7,595
218
''' https://github.com/akaraspt/deepsleepnet Copyright 2017 Akara Supratak and Hao Dong. All rights reserved. ''' import argparse import glob import math import ntpath import os import shutil from datetime import datetime import numpy as np import pandas as pd from mne.io import concatenate_raws...
ba77b63863c911a292083c2bc577d2987654678a187b5ca215db35d1486dd1a4
Python
7,595
227
''' @author: Mahbub Ul Alam (mahbub@dsv.su.se) @version: 1.0+ @copyright: Copyright (c) Mahbub Ul Alam (mahbub@dsv.su.se) @license : MIT License ''' import numpy as np import pandas as pd import torch def load_data(time_window, config, data_type, clinicalBERT, embedding_type): imputation = 'imputed' ...
dcd1d32e988fb71c3524c3b7c790ea7749d2599d7a305ed50701d63905c86b1a
Python
7,596
201
import logging from abc import ABC from enum import Enum from typing import Iterable, List, Optional from pydantic import BaseModel from oaklib.datamodels.vocabulary import IS_A from oaklib.interfaces import MappingProviderInterface, OboGraphInterface from oaklib.interfaces.association_provider_interface import Assoc...
6e89cf3401a04a7b470f7d37aafd2ccd98ac32a06382605bef6598bffa6b7e57
Python
7,597
214
# Modified from https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend # noqa import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.utils import _pair def normalize(grid): """Normalize input grid from [-1, 1] to [0, 1] Args: grid (Tensor): Th...
a920b88a603a14b3368cf2796b0940d182e21a75cb72ae32154240a6b0033548
Python
7,597
197
import torch from torch import nn from .conv_ws import ConvAWS2d from .registry import CONV_LAYERS import torch.nn.functional as F class Flatten(nn.Module): def forward(self, x): return x.view(x.size(0), -1) @CONV_LAYERS.register_module('MDConv') class MDconv(ConvAWS2d): def __init__(self, ...
a7daadfe46885b0941576c96abc9fe8633f62a4c124d4b715b4eba409940ff58
Python
7,600
160
import argparse import os.path as op from glob import glob import numpy as np import pandas as pd def _get_parser(): parser = argparse.ArgumentParser(description="Get subjects to download") parser.add_argument( "--dset", dest="dset", required=True, help="Path to BIDS directory...
4f0c7b184a694ea41d07a9a0d8e9d80eedc2f047def0b21d49d88b77e3a8384e
Python
7,604
171
# Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ) # # 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 #...