sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
93d9cf41eb228c649dfe7b5994cc10dc371bb40db264d7e94502e4124057fa8b
Python
10,450
275
""" Object Context Network for Scene Parsing""" import torch import torch.nn as nn import torch.nn.functional as F from models.baselines.segbase import SegBaseModel __all__ = ['OCNet'] class OCNet(SegBaseModel): def __init__(self, classes=2, aux=True, backbone='resnet50', oc_arch='base', pretrained_base=True): ...
1f5097d3d965c7012823dfb00fd80d1cf7724f488c87163d29bede859858fd1d
Python
10,455
255
# 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...
118d094dc8277a8aa7e5038180308e6b9de9404a649dc448817bd696b55d9746
Python
10,460
338
#!/usr/bin/env python3 """ Signal analysis module for phys2cvr. Attributes ---------- LGR : Logger """ import logging from pathlib import Path, PosixPath import numpy as np import scipy.interpolate as spint import scipy.stats as sct from scipy.signal import butter, sosfiltfilt LGR = logging.getLogger(__name__) ...
465947b39f18497b157f36066cc4cb23e5140b0609a06b65d156b43efa704bc6
Python
10,475
315
import os import math import numpy as np import pandas as pd from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import train_test_split from sklearn.preprocessing import scale from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA import pickl...
2edd6765ff2e02daa717e10478c04c3e886766e4c7ac966125896e7d136ce6d4
Python
10,477
256
import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import xavier_init from mmdet.core import (build_anchor_generator, build_assigner, build_bbox_coder, build_sampler, multi_apply) from ..builder import HEADS from ..losses import smooth_l1_loss from .anchor_head imp...
de7842405389c01d24cd599ac23da9bf430fdac65ed5bc45fdcd4e7ceae2a468
Python
10,479
261
""" This class is the abstract base class for all handlers, i.e. objects that "handle" model predictions. Specifically, handlers should store the model predictions or scores derived from those predictions and eventually output them according to a user-specified output format. """ import os from abc import ABCMeta, abst...
57b86fa34457884b283fe7fd69f3ba76259f52df2d0bc3f5a402031a2924ce1a
Python
10,492
233
# -*- coding: utf-8 -*- """Preview Code for 'Inf-Net: Automatic COVID-19 Lung Infection Segmentation from CT Scans' submit to Transactions on Medical Imaging, 2020. First Version: Created on 2020-05-13 (@author: Ge-Peng Ji) """ # ---- base lib ----- import os import argparse from datetime import datetime import cv2 ...
702447b0654d904d521c9eadd208fc95eaec8e8b5dc748d3878a1ebb6ccaa0ea
Python
10,496
268
import os import sys import subprocess import shlex import configparser import argparse import re import pysam import yaml def argument_parser(): parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', default='config.yml') args = vars(parser.parse_args()) config = args['config'] ...
2d02814d858d49b16c81dc5e62f0b2e82eb9acfb149d097b0b76948cb4dc9429
Python
10,499
265
# 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...
7ef244ecfa7e99bdf72deb012f3434b66a8615daf94b8341b29061853b417dba
Python
10,502
233
import warnings from functools import reduce from utils.helpers import * from utils.plotting import plot_dataframe from constants.enumerates import StatMeasures STATISTIC_MEASURES = { StatMeasures.MEAN: pd_mean, StatMeasures.MEDIAN: pd_median, StatMeasures.STANDARD_DEVIATION: pd_std, StatMeasures.MINIM...
974404558349443ebe42c20786dfa6e1b465fcc19d93fdcd988c7a64aaeb5bd4
Python
10,507
233
# 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...
86da25b297ab2ac94b29eda7bfa48d17abb24cb6bc47373582e6e656a22e0840
Python
10,516
272
# 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...
5e86548b6acba79479247fc1fcf6360f5d3290da938ce22c91e4be7bc09187d4
Python
10,517
241
# -*- coding: utf-8 -*- """Preview Code for 'Inf-Net: Automatic COVID-19 Lung Infection Segmentation from CT Scans' submit to Transactions on Medical Imaging, 2020. First Version: Created on 2020-05-05 (@author: Ge-Peng Ji) Second Version: Fix some bugs and edit some parameters on 2020-05-15. (@author: Ge-Peng Ji) ""...
c51227978918f388ff76dfca91d4302e14e3f09349d87cc4308ee0f7bcd679b3
Python
10,517
356
import os import sys import multiprocessing as mp import numpy as np import ndsvae as ndsv from balloon_windkessel import balloon_windkessel def normalize(w): w = w/np.max(w) return w def tavg(x, window_len): y = np.zeros((x.shape[0], x.shape[1], x.shape[2] // window_len)) for i in range(y.shape...
36e8d4d0345294c9e8aea38622b6070b0bf3b727ab90bd1cb954704d876ad0e8
Python
10,522
241
"""Mask-out classes: name resolution, class recovery through the codec, dilation, masked control videos and what the submit path does with them. The fixtures are synthetic clips: a two-class semantic frame (road + car) encoded with the real control encoder, so the tests exercise the actual palette recovery rather than...
8ebce88ca7ffee46cc74fc5595b90bdcf908d492504f3242e1105d2b5dcf6e26
Python
10,524
269
import os import sys import shutil import json, csv, glob from tqdm import tqdm from sklearn.model_selection import StratifiedShuffleSplit import numpy as np import random, re sys.path.append("..") def create_base_directory(): """ The crawled folder has files divided by labels and dataset and all individual c...
d0f3796e0f22123b2e9de545deba6b775565241933355f70b3080ddf0fd27086
Python
10,527
241
# -*- coding: utf-8 -*- """Preview Code for 'Inf-Net: Automatic COVID-19 Lung Infection Segmentation from CT Scans' submit to Transactions on Medical Imaging, 2020. First Version: Created on 2020-05-05 (@author: Ge-Peng Ji) Second Version: Fix some bugs and edit some parameters on 2020-05-15. (@author: Ge-Peng Ji) ""...
183e4933b1e7e7756b11f247c3405395a68302ebf177ecb651cb871c6ffe8f3a
Python
10,529
315
import types import typing as tp import pytest from backend import training from backend.app import App class FakeModel: def __init__(self, result:tp.Any=training.TrainingResult('completed')): self.result = result self.calls = [] self.cpu_calls = 0 self.stop_calls = 0 def st...
50cedf96bb8e3e14ce06035050bd37dca90620889dca31edbfccf100a0d3dd33
Python
10,529
288
## Plots import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd import anndata def plot_expressions_multiple(adata=None, X=None, obs=None, var=None, logdir="", plot_tf=True,plot_target=True,**kwargs...
e6cab0d13cf1f1b17b3b7489c82566a99b49c574c903d90dbe8bf07ee8e1fc88
Python
10,532
318
import os import math import numpy as np import pandas as pd from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import train_test_split from sklearn.preprocessing import scale from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA import pickl...
157d36ade46f9cd62e697cd0443270fbc66bc86e0ce80d0c740fdb02efad33f2
Python
10,539
254
#!/usr/bin/env python3 """ File: correlate_genes_with_cell_fractions.py Created: 2022/05/03 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 ...
a19cf8d9c3aa3d1201b37d379235bcb840fa424ff050414e95e2d7dc1cd6bac5
Python
10,542
286
#!/usr/bin/env python # Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """Open3D Lidar visualization example for CARLA""" import sys import argpars...
946d80b501c45eee3b667af135fa3175ad2e799fc22a985bc3066d0b9b7d64c6
Python
10,544
254
import paddle import paddle.nn as nn class FaceSwap(nn.Layer): def __init__(self, use_gpu=True): super().__init__() self.swap_model = UNet() def set_model_param(self, id_emb, id_feature_map, model_weight=None): predict_model = BuildFaceSwap() if model_weight is not None: ...
bcc1ac5920277f4f8f9bb537dc8552eac140f46b348aa68dd6efa110285ddc6a
Python
10,548
328
# 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...
08104c43743e8259476e687a2fa48bf3656f9ace141cd9c14b1f31bbfb29fc88
Python
10,553
329
# Libraries import yaml import time import json import shutil import numpy as np import pandas as pd from pathlib import Path from types import MethodType # Specific libraries from sklearn.metrics import make_scorer #from sklearn.impute import SimpleImputer #from sklearn.impute import IterativeImputer from sklearn.pr...
6421e0270e99fc130b7340e55521b7cd19cab53585c8d4ad6f3c591dbd8f3f9f
Python
10,554
251
""" 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...
21678bfb97cdc2f47c64273de72cf96e116e887939b047c9ded526979a53b1ae
Python
10,558
222
"""CosmosClient / Job / Result against a real mock server (uvicorn subprocess). Needs the ``carla-cosmos-server`` package importable (installed from ``../server``); skipped otherwise. """ import importlib.util import json import pytest from carla_cosmos import Clip, ControlInput, CosmosClient from carla_cosmos.clie...
770d3dc4dac1aa163a203e2e93e81535c034fd05a05aad3ec71ab6b71e7cc673
Python
10,560
274
#!/usr/bin/env python3 """ File: plot_cell_fraction_per_disease_state.py Created: 2021/11/29 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 th...
0aba11a69591009534e331cc545992937d33ea66373d2784068613a041c0bcaa
Python
10,565
283
import pydicom import SimpleITK as sitk import sys import numpy as np import cv2 import matplotlib.pyplot as plt import os import scipy.stats as sci import pickle from tqdm import tqdm def read_sitk(data_directory, CT_type): # Read the original series. First obtain the reg file directory, then series file names u...
24a2281dd389d9980df12fe363bd216bb27b74327b49181791c969fee1abc208
Python
10,570
224
"""Populate the image's Hugging Face cache from ``artifacts.lock`` (build stage). python prefetch.py --image nano --dest /models/hf [--from-cache /mnt/hf-cache]... [--no-hash] python prefetch.py --image nano --plan --max-layer-gb 40 # shard plan for tools/bake_weights.sh For every file of every artifact ...
3749bd76ad366f96c5b4fc4a5645fcb19772e29f63369a82746ba8d0f7195feb
Python
10,570
298
import itertools import pandas as pd import numpy as np from utils import maskPeaks def histogramFitParams(conditions, pColumns=None): if pColumns == None: #default columns pColumns = ['ROI', 'id', 'N', 'Pr/mu', 'Stat', 'statistic', 'P', 'type'] _a = [conditions, pColumns] ...
2541c67c9bc46cafba2cce1093d349a5250a61af7600013733153a5142631a64
Python
10,571
294
import re import torch import numpy as np import matplotlib.pyplot as plt from torch.nn import functional as F class Plot: """ Plot object. This class contains functions for reading, processing, and plotting results of the meta-training. """ def __init__(self, res_dir, meta_param_size, ...
6384aacadb1c92df2fd395e4c36c7ac93473454dd2c41cebcbd2c670ecea8323
Python
10,574
366
import statsmodels.nonparametric.kernel_regression from KDEpy import FFTKDE from multiprocessing import Pool, Manager from scipy import stats import numpy as np import os import pandas as pd import statsmodels.discrete.discrete_model from anndata import AnnData import scipy as sp _EPS = np.finfo(float).eps def robus...
31277782e05f30357ca78936dcdd5d73f600bf5b10023f991d6b8f635973a6a8
Python
10,577
338
# coding: utf-8 # In[50]: from __future__ import print_function feature_count = 39 predict_column = -4 #column_vector = [1] * feature_count #target_cluster = 1 def train_model(column_vector = [1] * feature_count, target_cluster = 0): plot = False import tensorflow as tf import keras from pandas i...
b9907a8ebfc5c39c0700cd314e9e97d2bc138ec1ddd668bda44b494fa178efa4
Python
10,579
285
import torch import torch.nn.functional as F from torch.autograd import grad from .differentiation import FiniteDiff # Set warning filter to show each warning only once import warnings warnings.filterwarnings("once", category=UserWarning) class BurgersEqnLoss(object): """ Computes loss for Burgers' equati...
3faf6a603240a5146567dc826ad07657b5e05adab174e2a472a7980cee2c1d17
Python
10,584
237
import tqdm import ipdb import argparse, sys; sys.path.append('../..') 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.utils.performance.load_exp import exp_exists f...
7efcc06185b4c71e749cf5aa462e578deb046a4c59ad59fa0815f38e548ed440
Python
10,584
248
import torch.nn as nn import torch.nn.functional as F from .CapNet import CapsNet from mmcv.cnn import ConvModule, xavier_init from mmdet.core import auto_fp16 from ..builder import NECKS @NECKS.register_module() class Caps_FPN(nn.Module): r"""Feature Pyramid Network. This is an implementation of paper `Fe...
61b957a87e1aed6f911a3d979eff3cd590012cce1175c94b40baa4ff33d7f0ea
Python
10,595
278
import sys import numpy as np import torch from torch.onnx.symbolic_opset9 import select, squeeze, unsqueeze from mmcv.utils import deprecated_api_warning from ..utils import ext_loader ext_module = ext_loader.load_ext('_ext', ['nms', 'softnms', 'nms_match']) # This function is modified from: https://github.com/py...
48ba04f1d84142096b305950431d45b14dbb7b42540e7f5a5dbe012fcfd388bc
Python
10,598
323
# Eelbrain documentation build configuration file, created by # sphinx-quickstart on Tue Mar 29 23:16:11 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values hav...
61edf1a1cc889cef2338c2ccc33aa07b054992f00604b8746b00cf02691fe404
Python
10,600
276
# Copyright 2021-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...
5f9694c9fad50ba3266c3b92544a6374a26c90d959117223916b06d343500387
Python
10,605
256
"""Loss Functions. In this code, normalize loss by only dimension of units for gradient caliculation, but normalize loss by dimension, num of sequence and sequence length when saving loss due to comparing other conditions. In Reza-san's code, normalize loss by dimension and sequence length when saving. """ import to...
c201769c739675fcaff25b1ff85bb69ae21d6cfb21ceeef76056e221fcf90e6f
Python
10,607
283
#!/usr/bin/python # -*- encoding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F import torchvision from parsing_model.resnet import Resnet18 # from modules.bn import InPlaceABNSync as BatchNorm2d class ConvBNReLU(nn.Module): def __init__(self, in_chan, out_chan, ks=3, stride=1, p...
dead317bcc47375bc2c3c411b2993f95e435eb7e176eca11425dbf526c0f7bce
Python
10,610
207
import os, time, json, sys, gc import numpy as np import nltk, pandas import torch from sklearn.metrics import f1_score, recall_score, precision_score, accuracy_score, classification_report from scipy.sparse import csr_matrix, lil_matrix, save_npz, load_npz from torch_geometric.data import Data, DataLoader, GraphSAINTR...
6dfc6ead20bb6162f23bc43933dce44aa214488f670bb283b9e7495f884fd351
Python
10,612
238
# 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...
0d34c73032bdc369348598bce45122a6ee3074f0a2470df9b93475a136c0a1a8
Python
10,620
303
#################################################################################################### # Copyright (c) 2019 - 2022, 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 ...
d4cee0b09ce7d957463709942caefff5b7d75824ed4634d6e656945bebd57d88
Python
10,622
200
import argparse, time, datetime, shutil import sys, os, glob, json, re from pprint import pprint import warnings warnings.filterwarnings("ignore") # from torchsummary import summary import numpy as np import pandas import torch import torchtext from torch.utils.tensorboard import SummaryWriter # from tensorboardX im...
6ae1c58688d9ad92aba1b4de268ed6ada7b2b350f2d84ed1f1f32469ff92aa30
Python
10,623
263
#!/usr/bin/env python3 """Install the CARLA Python client (`carla`) into a chosen interpreter. Commands: detect what is installed, what sources exist, what matches install [--source auto|local|pypi|egg] [--version X.Y.Z] [--dry-run] install the client and veri...
f9bea78d819f919d7d7127d4d95250957a0c1b362f0c34d1f2b365f97cfa22e4
Python
10,623
300
#!/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 """ ...
771f309b706d3ceb569cea68282a5808e4ec57f421bb3279a9b67ed47c84ddd5
Python
10,624
214
import streamlit as st import pandas as pad import numpy as np from joblib import dump, load from PIL import Image import sklearn import tensorflow as tf from tensorflow import keras import time ## TO DO ####### ## PCA and TSNE representation def main(): """ fonction principale de prédiction de c...
bcff14f04bece7cc89e58d3fbef26634fefe6868cdca5ee40255bc8567d92026
Python
10,624
291
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 exome_reanalysis.py -f <input_sample.tsv> -d <absolute path to create directories> Parses analyses request csv from Stager for exome re-anal...
b9ede85a66ad360f1e819b48943828847c8029d195d7018f9186d3b6e3fa373a
Python
10,627
237
''' collection of chemisorption models. newns_anderson: ''' import torch import numpy as np class Chemisorption: def __init__(self, model_name, **kwargs): # Initialize the class if model_name == 'gnn': self.model_num_input = 1 if model_name == 'newns_anderson_semi': ...
d8e3866f08e6010dfcf4b9a0ebe4e46411b9fe1146f515c2d3c52f235c078601
Python
10,629
297
import logging import unittest from copy import deepcopy import yaml from linkml.utils.schema_builder import SchemaBuilder from linkml_runtime.dumpers import yaml_dumper from linkml_runtime.linkml_model import SlotDefinition from linkml_runtime.utils.introspection import package_schemaview import oaklib.datamodels.on...
bafa7f9a57afdb7f0549d0defa3e2c7cf9cc8ca7c30612c30ae118b7218c0e90
Python
10,633
281
#!/usr/bin/python # -*- encoding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F from .resnet import Resnet18 # from modules.bn import InPlaceABNSync as BatchNorm2d class ConvBNReLU(nn.Module): def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1, *args, **kwargs): ...
1efc0c2346b33200f3c5a3ca183523bb71449ecf2cc603773b22161f68323ef6
Python
10,640
283
import os import os.path as osp import cv2 import numpy as np import time from tqdm import tqdm import torch import torch.nn.functional as F import torch.multiprocessing as mp from engine.logger import get_logger from utils.pyt_utils import load_model, link_file, ensure_dir from utils.img_utils import pad_image_to_sh...
12109b5b4c82d51b75d1938cba70b68cf52f8b42fbbda1ba00a66fa3be332716
Python
10,646
263
import numpy as np import math import os import random import cv2 import matplotlib.pyplot as plt import torch import torch.nn.functional as F import torchvision.utils as vutils import pathlib def gradient_loss_abs(gt, pd, ch=4): filter1x = torch.tensor([[1., 2., 1.], [0., 0., 0.], [-1., -2., -1.]]) filter1y =...
6e4992529e8b63b58b7349258e6bfc936492dc5b480bae982bf82ac0264d4502
Python
10,646
316
import re import tqdm import numpy as np from typing import List from rdkit import Chem from rdkit.Chem.QED import qed from rdkit.Chem.GraphDescriptors import BertzCT from rdkit.Chem.Fraggle import FraggleSim from rdkit.Chem import Descriptors as desc, Crippen, AllChem, Lipinski from drugex.training.scorers.interfac...
056ad7260f06c36bb9b2241b064609bec731e098155200d78ed1cd1c669d7b67
Python
10,650
300
import torch import torch.nn as nn import torch.nn.functional as F from networks import EqualLinear, ConvLayer, ResBlock import math class Bottleneck(nn.Module): expansion = 4 def __init__(self, in_planes, planes, stride=1): super(Bottleneck, self).__init__() self.conv1 = nn.Conv2d(in_plan...
7c1de45062f9078cc02d61fe691990936e2c840823c0e703d4ed577d413949ea
Python
10,656
319
#%% [markdown] ## Modeling the distribution of neural networks # > An attempt to characterize the distribution of neural network parameters that are learned on the same task # - toc: true # - badges: true # - categories: [pedigo, graspologic] # - hide: false # - search_exclude: false #%% # collapse import os import m...
4abbb4bbb3e7d9d09eecab77661643298f7476faf9d7eb5e134b837038894386
Python
10,658
286
import os from unittest import mock import threading from sync import get_settings_from_env, server_factory import json import pytest import requests # Data sets passed to server DATA_INCORRECT_CHILDREN = { "parent": { "metadata": { "labels": { "pipelines.kubeflow.org/enabled":...
24d3b571a12d651dc619f5a9791afaafde2ff1788268962d1c6af81e93b1bac1
Python
10,659
490
# %% [markdown] # # THE MIND OF A MAGGOT # %% [markdown] # ## Imports import os import time import warnings import colorcet as cc 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 anytree import LevelOr...
75a0777e0420ff9f8fbb0d11466c9f9c9aa27be8ed54ddaff4ea9ef77ae1dd22
Python
10,662
261
# 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...
8fac7be60ba28aa77e591ce35efe2009f4cb1ff5ae807485bdb6c9f6164f064d
Python
10,665
304
# # Deep Knowledge Tracing (DKT) Implementation # Mohammad M H Khajah <mohammad.khajah@colorado.edu> # Copyright (c) 2016 all rights reserved. # # How to use: # python dkt.py dataset.txt dataset_split.txt # # Script saves 3 files: # dataset.txt.model_weights trained model weights # dataset.t...
da061814e397363066c4efbd048b3e5127bc9670646761a68db3bf6ce4fdb9a1
Python
10,673
233
"""Live check that the path-traced lens sensors show freshly spawned actors completely from the FIRST delivered frame, in synchronous mode. Regression test for the "actors appear several ticks late" defect: the renderer compiles a new ray tracing material pipeline in the background whenever an actor with materials it ...
12d0acd1c8a62b097b981ae681b104901bfa914794ad36f44864f8905f4d0eea
Python
10,677
190
import ship_pairing_analysis import collections import pandas as pd import inspect import re import os import numpy as np import itertools import tqdm import AIS_interp import functions_basic_sak as funsak from sklearn.cluster import DBSCAN from scipy.interpolate import interp1d import AIS_infer_mmsi ...
65a92fa42dcdf87ccb3e59e519f0cefc7142985a8e27083a447f2c45bc2a42c9
Python
10,677
254
# 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 a...
3e05329211b21425f6e4e3227ad7c82c5de9d7d7353eed66047ad19000356a18
Python
10,678
286
import os from unittest import mock import threading from sync import get_settings_from_env, server_factory import json import pytest import requests # Data sets passed to server DATA_INCORRECT_CHILDREN = { "parent": { "metadata": { "labels": { "pipelines.kubeflow.org/enabled":...
0cdc0b4c671a84e4bb633f9f8c99d8e02854451b480b7a8c96b1eb5971895004
Python
10,679
286
import os from unittest import mock import threading from sync import get_settings_from_env, server_factory import json import pytest import requests # Data sets passed to server DATA_INCORRECT_CHILDREN = { "parent": { "metadata": { "labels": { "pipelines.kubeflow.org/enabled":...
541582eadaf017cacb1c150aa76d7ca236eb60ea19437d3b01f2340170f9100e
Python
10,680
264
"""A module for querying the Finnish parliament open data API.""" import re from typing import Any from typing import Dict from typing import List from typing import Optional from typing import Tuple import requests from lxml import etree class Query: """Query template for fetching data from the API.""" def...
c329c1feb0a5010f431e71072930d9c5e9710949976ceaee341eb722f0199215
Python
10,681
343
# %% import time import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from mpl_toolkits.axes_grid1 import make_axes_locatable from giskard.utils import powerset from src.data import load_maggot_graph from src.io import savefig from src.visualization import set_theme from graspol...
6898ff2cf14ff14a1d0b888c003834fc983a7db1eafd1744cf4a90ba8f37fa5d
Python
10,682
322
import torch_geometric.transforms as Transforms from torch_geometric.data import Dataset import numpy as np from ..simulation.diffusion_models import generators, params_sampler from ..simulation.traj_tools import * from ..data.data import TrajData import matplotlib.pyplot as plt import numpy as np from scipy.stats impo...
7dce04647df25aea2eeeb3eac7ec52ed9e75b4da688f17f48839269bb662d940
Python
10,684
281
from nibabel import load import os import numpy as np import scipy import csv import math import scipy.stats import glob from scipy import ndimage import copy import random #Function to get the indices of target value within given list def findInd(List,Value): return [i for i, x in enumerate(List) if x == Value] ...
f0df27b45182e2bf3b44a7840bc8c1525574291738cd5767670055fe59e7992c
Python
10,694
373
import logging from collections import ChainMap from collections.abc import Callable from pathlib import Path from typing import Any import numpy as np from tqdm import tqdm # type: ignore[import-untyped] from ppqm import chembridge, constants, units from ppqm.calculator import BaseCalculator from ppqm.chembridge im...
705e92a3685ffd523bd556d7bc50348ceeccad5d006ad25a0e388ef6c4a12440
Python
10,700
249
# %% import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from pymaid_creds import url, name, password, token from data_settings import data_date, pairs_path import pymaid rm = pymaid.CatmaidInstance(url, token, name, password) from contools import Celltype, Celltype_Analyzer, P...
3f4a279126b447e26c953c89148e82f08e910552a2acee1ffc090ed97fb77a8e
Python
10,701
284
# 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...
8054edda94b30c0653ef2b5616cb46d84df751abe6c0e7636719a34c3d81dd5f
Python
10,704
321
# -*- coding: utf-8 -*- """ Created on Wed Jul 7 18:47:46 2021 @author: Sleepymouse """ import glob import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as ticker import sys import os from scipy import signal import csv import math import statistics #mac #path = glob.glob...
c1c105b7e5c2fa5883516bf2bc05b588da5f45939d37f3fe281abca4579e7616
Python
10,707
268
# 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...
283fb61f0555913bf91043f3e4f372ecb47bfa3f8094f0fed830140c07e8a75d
Python
10,708
224
import core.settings as CoreSettings import user.usersettings as UserSettings def gmx(bQuiet, bNocopyright, bNobackup): command = "gmx" if bQuiet: command += " -quiet" if bNocopyright: command += " -nocopyright" if bNobackup: command += " -nobackup" return command def appe...
abaaeae2480b67df0cf69876de26f4534583f61e0525229a7d94ac9da8497007
Python
10,710
255
#!/usr/bin/env python3 """Move the CARLA spectator camera, frame an actor, or follow one. Commands: actors [--filter PATTERN] list actors (basis for "the ego" etc.) move --at X,Y,Z [--pitch P --yaw Y --roll R] set the spectator transform look --view chase|first|top|front <selector...
c588544f773b985bcd01f143c77c5a60b6131a3f1c0ab380bf760bbbbab8bb7e
Python
10,713
301
import argparse import ast import glob import os import sys import pandas as pd import pathlib import re import subprocess from collections import namedtuple from itertools import chain """ Usage: python3 genome_reanalysis.py -f <input_sample.tsv> -d <absolute path to create directories> Parses analyses request csv ...
15e45f371175619e151943446fcd52cd9ff142aacd657b58eb8f099224bdf2a6
Python
10,719
254
#%% from pymaid_creds import url, name, password, token from data_settings import data_date, pairs_path import pymaid import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd import networkx as nx from contools import Promat, Prograph # allows text to be editable in Illustrator plt...
c4fd83a6822bc9643fc0911bf02f7dd782fa132b8bf86a08dfa0103c86e2a0bf
Python
10,723
322
# 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...
48df16b215e819d472327c23086655722cfe7ede5fd3c3f5e1eedb3f70659343
Python
10,727
283
from logging import Logger import os import pickle from typing import Dict, List, Union from pprint import pformat import numpy as np from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.svm import SVC, SVR from tqdm import trange, tqdm from chemprop.args import SklearnTrainArgs fro...
901238916f4937b346d249b8d1496b1e07e2747e1e8493a06c3ad117be610ecb
Python
10,728
249
# 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...
ede16e330dca089c8376c779f2df007088a10b3f96367875d111845a669dba27
Python
10,728
363
# %% import os import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from graspy.cluster import AutoGMMCluster, GaussianCluster from graspy.embed import AdjacencySpectralEmbed from graspy.plot import pairplot from graspy.utils import pass_to_ranks from sk...
3124533d1d85af322dda1a79d3589877ca86a3c2fdbd54a00f6b09772d1a3931
Python
10,734
357
#%% [markdown] # # Density test # Here, we compare the two unmatched networks by treating each as an Erdos-Renyi network # and simply compare their estimated densities. #%% [markdown] # ## The Erdos-Renyi (ER) model # The [**Erdos-Renyi (ER) model** # ](https://en.wikipedia.org/wiki/Erd%C5%91s%E2%80%93R%C3%A9nyi_model...
385edf4c3a44622cff7615cab8c2fe3507867d6fd03fe9a915ccc9cc798a0c5d
Python
10,744
305
"""Different custom layers""" import torch import torch.nn as nn import torch.nn.functional as F from maskrcnn_benchmark.layers.dcn_v2 import DCN def conv3x3(in_planes, out_planes, stride=1, groups=1, bias=False, dilation=1): "3x3 convolution with padding" return nn.Conv2d(in_planes, out_planes, kernel_size=3...
2a944dcf8e955efcfbd85a0a47dde7908b38fe396d6b938ef32371f9aa864540
Python
10,749
266
#!/usr/bin/python3 from numpy import asarray import numpy as np from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score from sklearn.metrics import precision_score from sklearn.metrics import recall_score from sklearn.tree import ex...
53fffda6a19ae476fe4563b2a1317309cf0adda53a8de9fd120079fc5b1bae69
Python
10,753
400
__author__ = "Jianfeng Sun" __version__ = "v1.0" __copyright__ = "Copyright 2023" __license__ = "GPL v3.0" __email__ = "jianfeng.sunmt@gmail.com" __maintainer__ = "Jianfeng Sun" from typing import Any, Dict, List, Tuple, Union import gzip import os import re import shutil import urllib.request def chainid( prot...
a7b960fa9b40b77f293b26e0f6c2957d49aa674454ef3e243bfb6c8d8ec74e46
Python
10,758
307
""" Class for managing our data. """ import csv import numpy as np import random import glob import os.path import sys import operator import threading from processor import process_image,process_image_aug from keras.utils import to_categorical import tensorflow as tf from keras_preprocessing import image import random...
ff1c666671e62959dd11ca1ca325b6be490bcea278654fc9d1a06e8709ea066c
Python
10,760
275
""" File: main.py Created: 2020/10/08 Last Changed: 2020/10/27 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 ...
79bc92f5bd1dcb8a568e1285df9d09b869c549784931851bcc78f47daba10c3c
Python
10,763
250
from typing import List, Literal, Optional, Callable import torch from torch import nn import torch.nn.functional as F from .channel_mlp import LinearChannelMLP from .integral_transform import IntegralTransform from .neighbor_search import NeighborSearch from .embeddings import SinusoidalEmbedding class GNOBlock(nn...
3bea4f39f663685fb3d4982ebd761d7ab2fc0d43387cc1d9b3cca147a053771b
Python
10,770
286
# 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...
63baaa506c7bc7af28b2a6a7949358f9cc9987e320d375ad99ecde64864d17ef
Python
10,773
309
"""Cells for MTRNN. """ import torch import torch.nn as nn import torch.nn.functional as F torch.set_printoptions(threshold=10000) class MaskMaker(object): @classmethod def make_mask_matrix(cls, h_dim, mode='', z_dim=0, ...
15b4456873ce3bc39d69d501362f2b5ee7cb07fe341d0de5b643953d4a40fba8
Python
10,775
276
from __future__ import division from builtins import range from distutils.version import LooseVersion import numpy as np from scipy import ndimage from scipy.ndimage import measurements # skimage renamed the 'filter' module to 'filters' in 0.11 and will remove # 'filter' in 0.13 # Currently (August 2016) 0.13 dev buil...
3cf37893e12f71d9aa0aed807012b154cb245ab5496b07e78421010ba9aab5ba
Python
10,783
273
#%% from pymaid_creds import url, name, password, token import pymaid import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd from contools import Promat, Celltype, Celltype_Analyzer import navis # allows text to be editable in Illustrator plt.rcParams['pdf.fonttype'] = 42 plt.rc...
7ac3b2f1b9d93f9164257a9eb813bd50288ca3428defca533522eb64e025a4f9
Python
10,792
258
from mmdet.datasets import PIPELINES import copy import cv2 import mmcv import numpy as np from ..builder import PIPELINES from .compose import Compose _MAX_LEVEL = 10 def level_to_value(level, max_value): """Map from level to values based on max_value.""" return (level / _MAX_LEVEL) * max_value def enh...
1a040556f32d8054c9af5094b271eb4ba7f3f92a8740deaae870054c02ef4615
Python
10,799
168
# Form implementation generated from reading ui file 'picachooserTemplate.ui' # # Created by: PyQt6 UI code generator 6.6.0 # # WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. from PyQt6 import QtCore, QtGui, QtWidgets ...
68b11a87940935eaa9bcb57c0105c29a383b91702b47535dcc7835aa386ce957
Python
10,799
404
import torch import networkx as nx from torch_geometric.data import Data from torch_geometric.utils import k_hop_subgraph, subgraph from torch_geometric.utils.convert import to_networkx # MUTAG notation: [C, N, O, ...] # MUTAG notation: # 0 C # 1 O # 2 Cl # 3 H # 4 N # 5 F # 6 Br # 7 S # 8 P # 9 I # 10 Na # 11 K # 1...
a52c256c5f707c57f961c967b35b9a2d4b403b82a23b7dde6540fa4d906f45d8
Python
10,802
252
import math import torch import torch.nn as nn import torch.nn.functional as F class DilatedParallelConvBlockD2(nn.Module): def __init__(self, in_planes, out_planes): super(DilatedParallelConvBlockD2, self).__init__() self.conv0 = nn.Conv2d(in_planes, out_planes, 1, stride=1, padding=0, dilation=1...
4ef4c990d74663a445ac7132c07ccf25dbee4d8fd25eb589d8551006907d7dd2
Python
10,804
280
# 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...