sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
25d07f519b274cdfcb38ff9632fc0f62328837b8a193e0ef8b74f5d57a86c6e4
Python
15,042
335
# Feature testing models import torch import numpy as np from torch.nn import functional as F from .resnet import * class DeepAccNet_no3D(torch.nn.Module): # Parameter initialization def __init__(self, onebody_size = 70, twobody_size = 33, protein_size ...
69daf4c6bf35d57b5f8d5a0a6be24ecc1b409b1996e865a7921d486a6070b26b
Python
15,050
320
"""Ground-truth preview maths. No CARLA, no clip on disk: a synthetic rig and a handful of points.""" import numpy as np import pytest from carla_cosmos.preview import ( BOX_EDGES, LAYERS, Box, FThetaCamera, Horizon, PreviewCamera, SceneGT, box_corners, box_edge_points, camera...
0e47fc7ccc7eee194feb162b84b3c87c109ca3a41b823b347bd18cb1fff34c62
Python
15,057
367
# 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...
59bbc728f4ee7e7cf3f99a97763882e2d7076036cd68513c53367174a285c396
Python
15,057
384
import functools import logging import math import unittest from urllib.error import HTTPError, URLError from oaklib.datamodels.search import SearchConfiguration from oaklib.datamodels.vocabulary import IS_A, PART_OF from oaklib.implementations import UbergraphImplementation from tests import ( CELL, CELLULAR_...
21a671e662dd6ead3a8343bab5341b466b1b6b473f601d490fd1f660df068b02
Python
15,064
357
from __future__ import print_function from __future__ import absolute_import __author__ = 'tylin' __version__ = '1.0.1' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that...
e2f655d5ccecaea1c9e273a438dfee64c18787ee2eb27fbc73128c4014b796e9
Python
15,065
424
from __future__ import annotations import logging from typing import Dict, List, Type, Union import os import pandas as pd import pandas as pd import dask.array as da import yaml from ..data_structure.acquisition import Acquisition from ..data_structure.experiment import Experiment from .steps import * class ImagePi...
1b64ae46a9bf6a99179dad59a7942b13b730066fbba62fb07d463a0ce6402e55
Python
15,067
351
#!/usr/bin/env python # Copyright 2013-2019 Lukas Burget, Mireia Diez (burget@fit.vutbr.cz, mireia@fit.vutbr.cz) # # 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/lic...
e6d9cbbac944835fe28c9ae2e7e93c5aa90063924eb87e65525440ebae9cc6e3
Python
15,071
326
import torch import torch.nn as nn from .basic_model import BasicModel from . import networks from . import losses from torch.nn import functional as F from sklearn import metrics class VaeMultitaskGNModel(BasicModel): """ This class implements the VAE multitasking model with GradNorm, using the VAE framework...
7fffd82cc2fa0fcbf2290cbffc78468960ac82e988d1c53cb399ab52f5a46833
Python
15,090
363
""" File: main.py Created: 2020/03/19 Last Changed: 2020/03/20 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, either version 3 ...
306b30bcae0e85f2db0a36327d0c83042f047ceec05756d34afcdd8773b6486a
Python
15,095
359
# 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...
3b19d9dde9438138ab376a2f4b707852dfb122712148d76357c67480e502cfd8
Python
15,104
373
# 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...
7c1e10fa6974400dd4d35bfd2e4704f51ad4c8ca334b4e4b577f082606ec9497
Python
15,114
487
# 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...
82abab2328348a4f44322d0a3a5f4110a93a731c2b619be677e52cda2acba085
Python
15,127
451
__author__ = "Jianfeng Sun" __version__ = "v1.0" __copyright__ = "Copyright 2023" __license__ = "GPL v3.0" __email__ = "jianfeng.sunmt@gmail.com" __maintainer__ = "Jianfeng Sun" from typing import List, Optional, Union import subprocess from tmkit.interface.Tool import Tool class MSA(Tool): """ This class ...
e2a9d0d6d0ca935f050069281f2ce8aeb9aa2d08468210a09c82c26e033633cf
Python
15,136
429
import nibabel as nib import logging import numpy as np import os import os.path as op from time import time import pandas as pd import pimms from dipy.align import resample from AFQ.tasks.utils import get_fname, with_name, str_to_desc import AFQ.utils.volume as auv from AFQ.viz.utils import Viz import AFQ.utils.str...
c42de01769fa068d4d82635998a5dae9ee28e804951f4a66b7026595c4753f19
Python
15,138
550
# %% [markdown] # # import itertools import os import time from itertools import chain import colorcet as cc import matplotlib as mpl import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd import seaborn as sns from anytree import LevelOrderGroupIter, Node, RenderTree from joblib ...
fc085c4de119285800555abd60c7e071dcb023782aae90f014e0473de16a2359
Python
15,147
587
# %% [markdown] # ## Imports import os import time from itertools import chain import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd import seaborn as sns from scipy.stats import rankdata from src.data import load_metagraph from src.graph import preprocess from src.io import sav...
8a4ac465cdcdbdbaa0d7b363f8770817fcd5038a20d74740657aa4d03d1bb978
Python
15,159
484
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """ Variant of the resnet module that takes cfg as an argument. Example usage. Strings may be specified in the config file. model = ResNet( "StemWithFixedBatchNorm", "BottleneckWithFixedBatchNorm", "ResNet50StagesTo4", ...
5affa3d48457acf50be981e96198abae909ffdb9e54dc51531641b14ea4d2eff
Python
15,165
548
# %% [markdown] # ## import os import warnings from itertools import chain import matplotlib as mpl import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import matplotlib.transforms as transforms import numpy as np import pandas as pd import seaborn as sns from joblib import Parallel, delayed from sc...
f3dc46c3b67f81d598f482b35eec06f1e70c474316315018e9b68a6cbba2e5cb
Python
15,169
374
import sys import os.path import itertools from PySide2 import QtCore, QtGui from PySide2.QtWidgets import QApplication, QMainWindow, QGridLayout, QWidget, QPushButton, QLayout, QDialog, QLabel, QRadioButton, QVBoxLayout, QFileDialog import numpy as np import pyqtgraph as pg import pandas as pd def sanitizeList(l): ...
08a31905bc89b7626f09139011ad6dd34ed44b030ab69f7ee5aeaeee72f68922
Python
15,195
381
import numpy as np import pandas as pd from pathlib import Path from utils.metrics import IoU from utils.sets import difference, intersection, union def evaluate_object_detection(df_detections, df_annotated_slices, print_confusion_matrix=False, print_scans=False): # Loop over predictions print('Found p...
65ba1c3a445d408ad2d1bc3eb307364a99d5bea6e74274e10803a226808d4882
Python
15,213
555
# %% [markdown] # ## import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import matplotlib as mpl import numpy as np import pandas as pd import seaborn as sns from src.data import load_metagraph from src.hierarchy import signal_flow from src.visualization import adjplot, CLASS_COLOR_DICT from src...
524af7a24eaf221e31adc17fd03ad63c3092d7ea2836929d06b3d15f921a524b
Python
15,224
455
#!/usr/bin/python #################################################################################################### # Copyright (c) 2021, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis> ...
cf9548f50a2e3d50aeb47ef23d3f9230b54734adf0793ff4be818fa024164ddb
Python
15,234
424
from __future__ import annotations import json import logging from glob import glob import secrets from subprocess import call import pandas as pd import os import json import matplotlib.pyplot as plt from typing import List import numpy as np from typing import TYPE_CHECKING from .acquisition import Acquisition cla...
36f81f420b0e295ad1936150720167253fdfabdeca6a1c236c95fdd986deab00
Python
15,253
442
import numpy as np import scipy.signal import matplotlib.pyplot as plt import matplotlib plt.switch_backend('agg') import sys import pandas as pd import os import pickle from multiprocessing import Pool from itertools import repeat import utils.EventDetection_utils as EventDetection_utils import utils.general_util...
24dd2707f13cc6215c2d9fc78a8127f3ca0f4877996abcde6a499c4fe7937575
Python
15,264
439
# 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...
dc1293c8676ceae03cc5128024317983b671bed594ed5d24c450514008e14d66
Python
15,265
436
import toml import datetime import platform import os.path as op from argparse import ArgumentParser from funcargparse import FuncArgParser from AFQ.definitions.image import * # interprets masks loaded from toml from AFQ.definitions.mapping import * # interprets mappings loaded from toml from AFQ.api.bundle_dict im...
cacf1afefadc8b5b710fb87fe05088e3d51b2a2e32dcddb4e6ea3ef76913a0bc
Python
15,271
561
#%% Imports and file loading import glob import json import pprint import sys from operator import itemgetter from os import listdir from pathlib import Path import networkx as nx import numpy as np import pandas as pd import pymaid from graspy.plot import gridplot from src.data import load_networkx from src.pymaid i...
606e0627afdc0f909d3ecb23b28f9cfcb2abe2661071578cbcfc983330085a6a
Python
15,275
392
import argparse import builtins import math import os import random import shutil import time import warnings import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim import torch.multiprocessing as mp import torch.utils.data i...
6be4fc3aa79ce2f2beee2acde6df708283bccb74c41dcc9b8233b7ca4e079e61
Python
15,275
456
# Copyright (c) Open-MMLab. All rights reserved. import numbers import cv2 import numpy as np from .io import imread_backend try: from PIL import Image except ImportError: Image = None def _scale_size(size, scale): """Rescale a size by a ratio. Args: size (tuple[int]): (w, h). scal...
cb193866df4b83b899fcaac54b013295bbf3a240350e3fee8d31b104c8d25b7f
Python
15,277
502
# %% [markdown] # ## import os import time import colorcet as cc import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from scipy.linalg import orthogonal_procrustes from tqdm import tqdm from graspy.cluster import GaussianCluster from graspy.embed import AdjacencySpectralEmbed ...
2f43850ec3c3b9ddd1116923cc20b05dbd015e4c83428b9f13e67e08706be2e6
Python
15,289
414
# Copyright (c) Open-MMLab. All rights reserved. import logging import os.path as osp import warnings from abc import ABCMeta, abstractmethod import torch from torch.optim import Optimizer import mmcv from ..parallel import is_module_wrapper from .checkpoint import load_checkpoint from .dist_utils import get_dist_inf...
1b21f76e8e4dfa933102dc6ebcbe43eeed09fc7b5251fe19fdf55ec0ea4bd8b2
Python
15,292
415
# Copyright (c) Open-MMLab. All rights reserved. from math import cos, pi from .hook import HOOKS, Hook class LrUpdaterHook(Hook): """LR Scheduler in MMCV. Args: by_epoch (bool): LR changes epoch by epoch warmup (string): Type of warmup used. It can be None(use no warmup), 'const...
f958e697acc1fbd84754f941d21527613868c7f893f3b5e5e3e654a5a6c9bd84
Python
15,299
452
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import logging import time import os import torch from tqdm import tqdm import numpy as np from maskrcnn_benchmark.config import cfg from maskrcnn_benchmark.data.datasets.evaluation import evaluate from ..utils.comm import is_main_process, get_wo...
d1968c7b80823631ec288ae48f267fe9074c27e7852460c5595a6b882c20276b
Python
15,310
383
""" To update previous RACCOON clustering runs with new data. F. Comitani @2021-2022 """ import os import sys import pickle import logging DEBUG_R = 15 import time import psutil import random import warnings warnings.filterwarnings("ignore", category=FutureWarning) from raccoon.clustering import IterativeClus...
beba070e517faa7f19bfe16778922c2dd3467fecdb04d9a9cea63ec15aec2767
Python
15,316
420
import nibabel as nib import numpy as np from time import time import logging import pimms import multiprocessing from AFQ.tasks.decorators import as_file, as_img from AFQ.tasks.utils import with_name from AFQ.definitions.utils import Definition import AFQ.tractography.tractography as aft from AFQ.tasks.utils import ...
4860e7883b95a26d1af877286426fda3f1539c13c38122ba26058e431a7c0f50
Python
15,319
387
#################################################################################################### # Copyright (c) 2019 - 2023, 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 ...
920af8c3e44e0af2dc63dde94242eae75228c795295bdeff7b3828888399f568
Python
15,326
425
# coding=utf-8 # Copyright 2020 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...
1b15fa3799bb682d66eac48dd0f6f7ab6e1469549228937c3a1e6482802a2e16
Python
15,331
407
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.model_zoo as model_zoo class DeepLabV3Plus(nn.Module): def __init__(self, classes=2, aux=True, os=16, pretrained=False, _print=False): if _print: print("Constructing DeepLabv3+ model...") ...
e26d80da95bed42e169d3fcbefed354d4ec2fa8dbdf888c20d8397d02dc6e209
Python
15,339
377
# 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...
83085bfc3cb08d21b38124abaf0d833b73f3290fa4c57ac597762ec75b1d5c3d
Python
15,355
522
# %% [markdown] # ## import os import warnings import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.transforms as transforms import numpy as np import pandas as pd import seaborn as sns from joblib import Parallel, delayed from scipy.stats import poisson from sklearn.exceptions import Convergence...
4875002ab1a15b26998c566b6d6dfdf04a436907d7beb4f247cf35432d6c6607
Python
15,362
290
#!/usr/bin/env python3.9 # -*- coding: utf-8 -*- """ Created on Wed Sep 1 14:51:53 2021 @author: paulmueller Calculates autocorrelation/crosscorrelation functions for a patient and writes them out for sws,aed,roi combinations. OUTFORMAT for each ROI (TOTAL,MT,LIP,LPFC,OFC,ACC) total,SWS,nonSWS,low_AED,high_AED,SWS_l...
8303c9be755898be8e4239aa244570554de2d22a2c828e0af5e25df7e9b407bb
Python
15,384
334
import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .assign_result import AssignResult from .base_assigner import BaseAssigner def scale_boxes(bboxes, scale): """Expand an array of boxes by a given scale. Args: bboxes (Tensor): Shape (m, 4) ...
9ff25003553e06c17eb02030cab54c8007a1e4cb66bf02cb776541ff7f3d2618
Python
15,386
449
''' @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 argparse import logging import os import sys import numpy as np import pandas as pd import torch from torch.utils.data import WeightedRandomSampler, DataLoader, T...
122f9da53a368dcbc1c80b13d351676d4a2481fe95ce6fddc9f85a365c9b9cc1
Python
15,391
417
""" Code for estimating retinotopic parameters with AFNIs circular population receptive field mapping and neuropythy to further refine these estimates and delineate retinotopic regions. Requires a preprocessed version of the dataset stored in bidsdata/derivatives/fmriprep. Further non-python dependencies: FSL, AFNI U...
ef59da0326433c412378c32b5810053488b34d7116c03021626ba524a4e999c3
Python
15,394
376
import logging, os from transformers.modeling_outputs import SequenceClassifierOutput from transformers.models.roberta.modeling_roberta import RobertaModel, RobertaPreTrainedModel, RobertaClassificationHead from torch.nn import MSELoss, CrossEntropyLoss from torch import mean, stack number_inputs = 8 class MultiInpu...
ba57c2e094e8b559a27e7dfeceaaa3373f129399c359a10862703e4b84f8c699
Python
15,405
376
import logging, os from transformers.modeling_outputs import SequenceClassifierOutput from transformers.models.roberta.modeling_roberta import RobertaModel, RobertaPreTrainedModel, RobertaClassificationHead from torch.nn import MSELoss, CrossEntropyLoss from torch import mean, stack number_inputs = 8 class MultiInpu...
d5c0e733d8eac54ed3e123e2a752ad88079ce70eb9d601818b341284b21791fb
Python
15,406
442
#!/usr/bin/env python3 """ Statistical module for phys2cvr. Attributes ---------- LGR : Logger """ import logging import os import numpy as np from numpy.lib.stride_tricks import sliding_window_view as swv from scipy.stats import zscore R2MODEL = ['full', 'partial', 'intercept', 'adj_full', 'adj_partial', 'adj_...
a74edaf2b2d7ed28f63f225b2fc2f7a5d21b87c213cfa2b0d164f2ee980773ad
Python
15,407
321
import torch import torch.nn as nn def get_dist_and_masks(embeddings, labels): n = embeddings.size(0) # L2 distance: dist = torch.norm(embeddings[:, None] - embeddings, dim=2, p=2) mask_pos = labels.expand(n, n).eq(labels.expand(n, n).t()) mask_neg = ~mask_pos mask_pos[torch.eye(n).bool()] =...
6cd364379e04a9b9e4d47eeb8af1b6ba61b674fbdfef8883e1a52de853bdaa11
Python
15,411
413
from __future__ import print_function, division import csv import functools import json #import you import random import warnings import math import numpy as np import torch import os from pymatgen.core.structure import Structure from torch.utils.data import Dataset, DataLoader from torch.utils.data.dataloader i...
61317bafb13bb5f9954d72ec68e330088a695fb1407297c52e30dd9695e03d9d
Python
15,420
419
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> from math import floor, log10 from os import makedirs from os.path import basename, dirname, exists, expanduser, isdir, join import matplotlib as mpl import numpy as np from . import fmtxt, plot, testnd from .plot._base import POINT from ._data_obj import combi...
d5f0315b6558625d644e3b490f22ec368abbcecccb20dece8dc2ad66d6ebe4e2
Python
15,425
372
#################################################################################################### # Copyright (c) 2019 - 2023, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis> # # This library is free ...
503fc940075e73e4af687ecc03b6ac814589084788c5b5985dd674ceec290594
Python
15,444
567
#%% Imports and file loading import glob import json import pprint import sys from operator import itemgetter from os import listdir from pathlib import Path import networkx as nx import numpy as np import pandas as pd import pymaid from graspy.plot import gridplot from src.data import load_networkx from src.pymaid i...
b9fab4f3582931359c246dc6d6faf5ad4dac6854317b67f18d4d7162495a8f23
Python
15,460
207
"""Reference-led wheel detail pass. Keeps the original Blender source untouched. Geometry is an artist reconstruction, not Michelin manufacturing CAD. Run with Blender --background --python <this file>. """ import bpy,bmesh,math,json,os import numpy as np from pathlib import Path from mathutils import Vector,Matrix,Qua...
2bf90581f82fd07b4f052970d99903586ff53f4b02b56bd82cc277cb68f4bd84
Python
15,466
508
import argparse import math import random import os import numpy as np import torch from torch import nn, autograd, optim from torch.nn import functional as F from torch.utils import data import torch.distributed as dist from torchvision import transforms, utils from tqdm import tqdm from dataset impo...
609b32daafd4eb2de2af17f859380f5fa250d4684301bb2649c3583bdaeee74f
Python
15,469
406
""" Copyright (c) 2019, National Institute of Informatics All rights reserved. Author: Huy H. Nguyen ----------------------------------------------------- Script for fine-tuning ClassNSeg (the proposed method) """ import os import random import torch import torch.backends.cudnn as cudnn import numpy as np ...
ec3e5a9a7622c7c69889f11dec280aa1a369a88d835f5e89fc88356006466d58
Python
15,471
328
import os, sys currentdir = os.path.dirname(os.path.realpath(__file__)) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) # PYTHON > 3.3 does not allow relative referencing PYCHARM_EXEC = os.getenv('PYCHARM_EXEC') == 'True' import tensorflow.keras.layers as kl import tensorflow as tf from tensorflo...
bbc19eab7917255714ca13d381a86299e1d6fd02e72edf7340755cb7d1f0e925
Python
15,480
478
import itk import numpy as np import pandas as pd from monai.transforms.transform import MapTransform, Transform import json from pathlib import Path # these are my custom monai style transforms class SaveITKImaged(object): def __init__(self, keys, output_filename=None, out_dir=None, output_postfix=None): ...
048b1629b186eab974a05a58bc83a180705e68d31e2fd6bc7dabda744a4b18a4
Python
15,490
299
# Author Romain Sala import numpy as np import scipy import scipy.stats from statsmodels import robust from tqdm import tqdm import matplotlib.pyplot as plt import matplotlib.patches as mpatches from statsmodels.stats.multitest import multipletests class RobustGaussianSurprise: """ Method to dectect bursts and pa...
19b97ea872ad2cae287ed9db85ad4ffb10c6b24eff68b354f781fd7038c915ce
Python
15,510
328
import argparse import sys import collections from pathlib import Path import csv import os import pandas as pd import numpy as np import torch import torch.nn.functional as F from tqdm import tqdm import data_loader.data_loaders as module_data import model.loss as module_loss import model.metric as module_metric fr...
6d3b9fc3857d8982056104312ac07733cf12e64ce8f35b0b175540ccb0b61f70
Python
15,515
444
import time from typing import Tuple import torch import pickle import pathlib import numpy as np import statsmodels.api as sm from scipy.stats import zscore from hebbcl.trainer import Optimiser from copy import deepcopy from utils.nnet import from_gpu from utils.eval import ( compute_accuracy, compute_relchan...
7045cac22f2375ce663499f54b3949a38598f8b66f7ba5f1933953b3214d392c
Python
15,533
385
import logging from collections import defaultdict from collections.abc import Iterator from copy import deepcopy from typing import Dict, Iterable, List, Optional, Tuple import networkx as nx from sssom import Mapping from oaklib.datamodels.cross_ontology_diff import ( DiffCategory, MappingCardinalityEnum, ...
7ceefb461f439cd4659a229356a3915a324ac2c4fc1d3d9dc0c25b5be2c8ea8a
Python
15,546
375
import os import math import numpy as np import pandas as pd import matplotlib.pyplot as plt from lmfit import Model import helper_functions as hfn import plotting_functions as plotfn from scipy import stats from lmfit.models import PowerLawModel from lmfit.models import LinearModel def expfunc(x, a, b): return a...
a587dd8454ecb4fa3b89896ec2885b4b36e193e95e0eaf2fab6e836584ad8c2a
Python
15,551
335
import numpy as np from .coupling import CouplingNode, PhaseStyle from .forward import ForwardMesh from ..typing import Callable, List, Optional, Tuple from ..utils import random_vector def _tree(indices: np.ndarray, n_rails: int, start: int = 0, column: int = 0, balanced: bool = True) -> List[CouplingNode...
e3e80ca6742c2a2520e4f0d8f82fdcc1c8b457358077d409ae84f3b89d05df73
Python
15,553
404
import torch from torch_geometric.nn import MessagePassing from torch_geometric.utils import add_self_loops, degree, softmax from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool, GlobalAttention, Set2Set import torch.nn.functional as F from torch_scatter import scatter_add from torch_geomet...
b714a8806fe22f510aa06247942c2f9f526927fcf5e7a11de60ba9bd4e65b277
Python
15,569
400
import sys from skimage import io import os, os.path import math import h5py import time import numpy as np import pandas as pd import pickle import more_itertools as mit import matplotlib.pyplot as plt plt.switch_backend('agg') import pandas as pd import utils.general_utils as general_utils import utils.plot_utils a...
f2a29cf36715e1d403796fab8e909843437214472bad5f8cdfba7993225256ae
Python
15,574
444
import logging from collections import defaultdict from copy import copy from dataclasses import dataclass from enum import Enum from pathlib import Path from typing import Dict, Iterator, List, Optional, TextIO, Tuple, Union import click import sssom_schema as sssom import yaml from linkml_renderer.style.model import...
a34281aa4a77f59f030390fe9a674ecd62f022e7b917b2b6dea24f1a3c143504
Python
15,576
359
#!/bin/bash # 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 ...
af8c57d8770fbef916b6919c6073d394b2a04832e915ff9fe289705bd568d637
Python
15,577
358
""" MODULE VERSION: Module that handles production simulations and energy calculation LJ+coul CHOL_Prot/(CHOL_Prot+POPC_Prot) """ import os import core.settings as CoreSettings import core.system as System import core.gromacs as Gromacs import core.gromacs_commands import user.usersettings as UserSettings ...
5d2dc5d33235c08fbe5556b013529eb0d086bfe7963023e90e11ae14f9aee8c8
Python
15,585
321
import os import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker as plticker from PIL import Image, ImageEnhance from scipy import ndimage import warnings warnings.simplefilter('ignore', Image.DecompressionBombWarning) def preprocess_histology(histology_folder): """ Purpose ---------...
3822659695ea6324dea578e26b0f01cd89c001763dc46c505501e2fcab07c1de
Python
15,588
519
import pickle import numpy as np from joblib import Parallel, delayed from scipy.optimize import curve_fit from scipy.io import loadmat from utils.eval import gen_behav_models from typing import List from scipy.optimize import minimize def softmax(x: np.array, T=1e-3) -> np.array: """softmax non-linearity Ar...
7e85a2b25c91198a0fef772cc9f077b5e5492eb3e4e11e9f5659ac1c6f343161
Python
15,594
407
# 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...
c17e243ffdae9cd4ca71c46608bd8f561ae41f23845a0b7780db8b5850992ebe
Python
15,594
466
""" Copyright 2020 - by Jerome Tubiana (jertubiana@gmail.com) All rights reserved Permission is granted for anyone to copy, use, or modify this software for any uncommercial purposes, provided this copyright notice is retained, and note is made of any changes that have been made. This softwar...
6522bba1e6e936de30b5f5edd9be49c7e4b4581f19bfb05ac4130a2d6c6062bf
Python
15,598
360
"""FastAPI application factory. Routes (all under ``/v1`` need ``Authorization: Bearer <token>`` except health): ===================================== ========================================================== ``GET /v1/health/live`` process is up ``GET /v1/health/ready`` 200 when every ...
c2d16a3644c4b9aebf1b19410ac6c2bc45fbd53ae8a462f0f6190da2f46d07ad
Python
15,603
381
# -*- coding: utf-8 -*- """Provides a set of semi-automatically generated interfaces for all the QUIT fitting commands. These all have to go in one file so pickling works correctly """ import json from copy import deepcopy from os import path, getcwd from nipype import logging from nipype.utils.filemanip import fn...
afe9574e23ef72057391c47aebd4a58602c46a74592019143735a1c39bfaa8a8
Python
15,606
397
#!/usr/bin/env python3 """ File: visualise_decon_eqtl.py Created: 2021/12/20 Last Changed: 2022/02/10 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...
57c56b99d09a34d199f7fb9fbd3afb10b976719b8f67b165693e6367d01821fa
Python
15,611
405
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from ..utils import kaiming_init from .registry import PLUGIN_LAYERS @PLUGIN_LAYERS.register_module() class GeneralizedAttention(nn.Module): """GeneralizedAttention module. See 'An Empirical Study of Spatial A...
9d58f4618f3765309b0e532f4db98d55291e82fa3fe72a44b17d6786965d8d27
Python
15,619
319
import operator from copy import deepcopy from distutils.version import StrictVersion from typing import Dict, Optional import allennlp import numpy as np import torch import torch.nn.functional as F from allennlp.common import Params from allennlp.data import Instance from allennlp.data import Vocabulary from allennl...
3c0489d7965bde753ca046a0e0ca24327aa5011a676279aad88b5aea265b40b5
Python
15,621
484
from typing import List, Optional, Union import torch from torch import nn from torch_harmonics import RealSHT, InverseRealSHT import tensorly as tl from tensorly.plugins import use_opt_einsum from tltorch.factorized_tensors.core import FactorizedTensor from neuralop.utils import validate_scaling_factor from .base_s...
894345c75c01952da4b4d02279ac54d27e7362b31b8c259a08b734b6eea1cec0
Python
15,656
388
from cmath import log import os import csv import yaml import shutil import sys import time import warnings import numpy as np import pandas as pd from random import sample from sklearn import metrics from datetime import datetime import argparse from model.utils import * import torch import torch.nn as nn import torc...
0aa17f88a16b22ef62ce0a6910f2633c88ad3f58a42dbf52f56182b0a529d5df
Python
15,658
377
# 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...
16b400d2bc5bd10063eefce69ab0b5ac54a5c7bcad416bf50cbf9270f903b2d2
Python
15,685
376
# Copyright 2020-2021 The Kubeflow 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 applicable law or agreed ...
04674bedbfefef8cebf1d8e5d7616af79b560632c195fcb5b7b698b5e9866326
Python
15,686
311
""" Script for training a model on a set of data Should be called form within a U-Time project directory, call 'ut init' first. All hyperparameters should be stored in the hparams.yaml file (generated by ut init). """ import logging import numpy as np import os import tables import tensorflow as tf from argparse impor...
4d0ac6d71bf5d461c1e5a3cff09dd59189a46f6f59443c3f44509466ceca6483
Python
15,687
528
#!/usr/bin/env python import sys, os import unetsl.data import numpy import skimage.morphology import skimage.draw import skimage.measure from skimage.feature import peak_local_max from skimage.morphology import watershed import scipy.ndimage.filters as filters from scipy.ndimage.morphology import distance_transfo...
c1b10f4551d81671e46803d48917cc4fa67efa47d1d5f5991993b08490c445c8
Python
15,688
489
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Implementation of nipype interfaces for QUIT MT module Requires that the QUIT tools are in your your system path """ from os import path from copy import deepcopy from nipype.interfaces.base import TraitedSpec, DynamicTraitedSpec, File, traits, isdefined from qipype....
f5e47ffcd61d6fe82d9fea2bace8e5992824137a8f72bda3849ec70ae6bb562a
Python
15,697
414
#################################################################################################### # Copyright (c) 2019 - 2023, 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 ...
85be1571fd9cf38cd0db9d7b87068a721d3ddcfae680a1e486bc88cb1bd2d5f6
Python
15,710
361
""" File: inter_eqtl_effect.py Created: 2020/03/16 Last Changed: 2020/06/19 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, eithe...
d147916fc30a74c68c9403b42f89d6682c07353909f432baaba51f4b9be3f361
Python
15,712
380
import numpy as np import os import sys import time import torch import torch.nn.functional as F from torchvision import transforms from torch.optim.lr_scheduler import ReduceLROnPlateau import torch.nn.init as init from model.dense_ed import DenseED import random import pandas as pd #import matplotlib.pyplot as plt im...
40e5beb63d5a11f2d7a7056293bc4a16242617b184122a012ea47f62a7e25f95
Python
15,722
404
#################################################################################################### # 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...
7a3321860dd1709dd82dff8a69ced404b7a0d162501473332336e9ef891290f3
Python
15,723
406
import logging import unittest from copy import deepcopy from kgcl_schema.datamodel import kgcl from oaklib.datamodels import obograph from oaklib.datamodels.search import SearchConfiguration from oaklib.datamodels.search_datamodel import SearchProperty, SearchTermSyntax from oaklib.datamodels.vocabulary import HAS_P...
62977557cb95f1375bf39edf396eafb54cffe0aca5687e6024239b219321edb7
Python
15,733
570
# %% [markdown] # # import itertools import os import time from itertools import chain import colorcet as cc import matplotlib as mpl import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd import seaborn as sns from anytree import LevelOrderGroupIter, Node, RenderTree from joblib ...
6b1023b3dbfc1aeb0c980ec70cb97e620376341fe40f0b3f91291d49eefe2831
Python
15,740
471
import os.path import pickle import sys import pandas as pd import numpy as np from tqdm import tqdm import behavelet import utils2p import utils2p.synchronization import flydf root_dir=os.path.abspath("../..")+'/' # print(root_dir) # root_dir="/mnt/data/CLC/" annotation_dir=root_dir+"Ascending_neuron_screen_analy...
8e2362097e7494fe5f7397388a5e201348339f7adf06572715042c245d0b1b70
Python
15,743
363
#!/usr/bin/env python3 """ File: sn_simple_eqtl_plot.py Created: 2020/11/27 Last Changed: 2020/12/02 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...
7d344958a3140d3c2bc9dedbf6e5fdcd1bde277e896c998c495ac1272fa7fcfa
Python
15,755
392
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> from copy import deepcopy from .._exceptions import DefinitionError from .._text import enumeration from .definitions import Definition, typed_arg def assemble_epochs(epoch_def, epoch_default): epochs = {} secondary_epochs = {} super_epochs = {} ...
9ae1f75649bb43b27b3e8aaba81f286e5233f367e9e3b85061045a2c864324a5
Python
15,766
404
""" File: inter_eqtl_effect_celltype.py Created: 2020/04/20 Last Changed: 2020/06/16 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 Foundati...
b487717efb8cf3e2d08cebd7fbcc035aef5a33dff176ab2d9a3d203d2a34f6f6
Python
15,767
387
#!/usr/bin/env python # Process a cigar string. # Note that this module includes a set of unit tests, which can be # executed by running this file directly from the command line. import os import sys import re # for regular expressions import math from tt_log import logger VERSION = '20150707....
1a89478f781e5e8b9041ca7d948452913e91dcf1eaca978d993c94b34cee9465
Python
15,776
503
# Auto generated from item_list.yaml by pythongen.py version: 0.9.0 # Generation date: 2023-04-13T19:34:47 # Schema: itemList # # id: https://w3id.org/oak/item-list # description: A data model for representing simple lists of entities such as genes. The data model is based on # the schema.org ItemList clas...
ba7ee397096f0e9766fd449759bf36282f70bc51fe2b0361aa9afa08a9ff8ef6
Python
15,780
347
import os, sys # currentdir = os.path.dirname(os.path.realpath(__file__)) # parentdir = os.path.dirname(currentdir) # sys.path.append(parentdir) # PYTHON > 3.3 does not allow relative referencing # # PYCHARM_EXEC = os.getenv('PYCHARM_EXEC') == 'True' import tensorflow.keras.layers as kl import tensorflow.keras.backe...
9f31de2de9e843e1fc1d452f9197502ea414e84b90a4fc2a8e6a89c1ff67f742
Python
15,783
414
""" tests Created by: Martin Sicho On: 31.05.22, 10:20 """ import os.path import tempfile from collections import OrderedDict from unittest import TestCase import pandas as pd from drugex.data.corpus.corpus import SequenceCorpus from drugex.data.corpus.vocabulary import VocSmiles, VocGraph, VocGPT from drugex.data.f...
533f071b52672d3217bc6af9c5fd44977ac82eef71a495e26393686141208f32
Python
15,810
448
# adapted from https://github.com/molecularsets/moses/blob/7b8f83b21a9b7ded493349ec8ef292384ce2bb52/moses/metrics/metrics.py import torch import warnings from multiprocessing import Pool import numpy as np from scipy.spatial.distance import cosine as cos_distance from scipy.stats import wasserstein_distance # scikit-...
3c70eb5a132aa6d31df5f8ee875ef56d5b01c32edb87199b7fc4b7adbc9f9197
Python
15,814
383
import os import pkgconfig import sys from copy import deepcopy from platform import system, uname from psutil import cpu_count from subprocess import check_call from pybind11.setup_helpers import Pybind11Extension, build_ext, WIN, MACOS from setuptools import find_packages, setup # Loop through command line arguments...