sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
50a683a731d12ca2b7248f9c4c77fa1993ec6af5874f15d5ee78a9fb5f248ad9
Python
8,356
246
import tensorflow as tf import numpy as np from tensorflow.python.framework import ops from tensorflow.python.training import moving_averages def _create_variable(name, shape, initializer): var = tf.compat.v1.get_variable(name, shape, initializer=initializer) return var def variable_with_weight_decay(name,...
e963dc446914b0b8c15e2de22773c4fe9bb6ffa4e45d10a5fef0e722d1a7b462
Python
8,358
233
# Copyright (c) Open-MMLab. All rights reserved. import io import os.path as osp from pathlib import Path import cv2 import numpy as np from cv2 import IMREAD_COLOR, IMREAD_GRAYSCALE, IMREAD_UNCHANGED from mmcv.utils import check_file_exist, is_str, mkdir_or_exist try: from turbojpeg import TJCS_RGB, TJPF_BGR, T...
7e447354208977e301880c2cf6f0daa9c348a37ad61ce1d4fd5161f794b15fbd
Python
8,360
158
"""Environment maps for CARLA's sky light (`world.set_sky_light_map`). CARLA panorama convention (what the server expects) --------------------------------------------------- Equirectangular, CARLA world frame (Unreal: X forward, Y right, Z up, left-handed), float32 linear RGB, shape (H, W, 3), row 0 = zenith: co...
6e30d298a1fa548ac016f482d2c3f324a296b835579c654315ce8dd28cbb22f3
Python
8,361
200
import os import time from datetime import datetime import cv2 import torch import numpy as np import torch.backends.cudnn as cudnn import torch.nn as nn import torchvision.transforms.functional as TF from loguru import logger from torch.utils import tensorboard from tqdm import tqdm from utils.helpers import dir_exist...
ce77566bdb0d4927ccab7447f72b18793ab7b769870d3b22aca9d06f6aa0d19a
Python
8,363
191
import os import sys import json import datetime import pandas as pd import numpy as np import math def check_if_highlighted(s, threshold): if s == -1: return "<td style='color:red;'> Prediction Error </td>\n" elif s == -2: return "<td> Plan Mis-Match </td>\n" elif s == -3: return "...
0deede0828419ac8cc9fd750b73b846baa4ec74bbcae11162a2e805c97417dfa
Python
8,364
265
# 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...
5f87ad1df886f7e8a2712da562e9250a6e684e8ed05772bbca8cb377ba3794ac
Python
8,364
192
import sys import os from multiprocessing import Pool import math import argparse import copy import itertools from Logger import Logger from util import print_table, files_in_dir from SummaryCreator import SummaryCreator from ArticleDataSample import ArticleDataSample from HmmArticle import HmmArticle, HmmArticleConf...
fc5d3f00b7b041ca3ee89f0fa0ee18fdf082388461c3dccd0d32c4a1341f38af
Python
8,364
191
# 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...
4d6338451ead30ce530ec03adc557cb0fcc8476b2b77c5daae0fa3d4fadee6da
Python
8,365
233
__author__ = "Jianfeng Sun" __version__ = "v1.0" __copyright__ = "Copyright 2023" __license__ = "GPL v3.0" __email__ = "jianfeng.sunmt@gmail.com" __maintainer__ = "Jianfeng Sun" from typing import Dict, List import numpy as np import pandas as pd from tmkit.chain.Collate import Collate from tmkit.db.construct.Networ...
feb6dc2f50ed8300b9e6fcc71c9efba1ad3798a8cba3caf534ac2304b86c4218
Python
8,368
197
''' 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': ...
81f36688819c2d1277ad186aebe9bf368182f3db10a62ea998bffd0cf73e8c92
Python
8,372
170
#!/usr/bin/env python ####################################################################### ####################################################################### ## Created on June 29th 2018 to annotate merged peaks ####################################################################### ###########################...
ee19a2711844d5b21736ff588ec59f2f70cd8986540ffa913c14768a9df88b16
Python
8,373
222
""" Description: This script is used to compile the DeepSEA dataset of 919 genomic features. Usage: process_chromatin_profiles.py <features> <ENCODE-DNase> <ENCODE-TF> <Roadmap> <output-dir> process_chromatin_profiles.py -h | --help Options: ...
ebc069061efa5bb4716f7623a55938fa10b3981872105e46bb68b82a93c38304
Python
8,376
210
# 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...
4c264f9228549fc0d59a8748542bc9bd706576f2c68d0c269d5aa4d7bd645a7e
Python
8,378
209
import os, tqdm import ipdb import argparse, sys; sys.path.append('../..') import random as rand import numpy as np import torch from metrics import graph_exp_cf_fairness, graph_exp_group_fairness from graphxai.explainers import * from graphxai.datasets import load_ShapeGGen from graphxai.datasets.shape_graph import S...
9b4d86c51423e4d90a3b207d14dc2d798e420df0c2574f16dc1eff44b16390d1
Python
8,379
244
''' ANN model trained on the PB embeddings ''' # libraries import pandas as pd import numpy as np from sklearn import preprocessing import math import pickle import tensorflow as tf from tensorflow.keras.models import Model, load_model from tensorflow.keras import optimizers, regularizers from tensorflow.keras.layer...
cebbf3596c959671ae85d9343fcc69b4e9125c3aa4b6753889505ccddd1157d9
Python
8,379
251
# 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...
904bf9a49500ef00690fdf91737e5dd43b2ab11c38236f658ccfca926e96cc3d
Python
8,383
297
#!/usr/bin/env python3 """ Utils functions for phys2cvr. Attributes ---------- LGR : Logger """ import datetime import logging import os import sys from pathlib import Path import numpy as np LGR = logging.getLogger(__name__) LGR.setLevel(logging.INFO) def if_declared_force_type(var, dtype, varname='an input ...
8c565e8e702d95837e1e142092a196eb833f9858ba7a471cc16be6d359f695f6
Python
8,385
177
# 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...
c72c8880de60098692028156d45eaf7701abcb15198941fe8e3c12d6c42903d8
Python
8,388
254
# -*- coding: utf-8 -*- """ Created on Tue Nov 7 21:51:03 2023 @author: H.Yokoyama """ fdir = __file__ from IPython import get_ipython from copy import deepcopy, copy get_ipython().magic('reset -sf') #get_ipython().magic('cls') import os current_path = os.path.dirname(__file__) os.chdir(current_path) current_p...
12ed5a945135ced0a590fc9633fe692fd759cc4550b438884b17af752a8988de
Python
8,389
200
"""Targeted point adding attack.""" import os from tqdm import tqdm import argparse import numpy as np import torch import torch.backends.cudnn as cudnn import torch.distributed as dist from torch.utils.data import DataLoader from torch.utils.data.distributed import DistributedSampler from torch.nn.parallel import Di...
8efc2132db45ee1bb672cc3eff60e356d18bd09c2eee63aa3d7bb3c076cc2bca
Python
8,390
211
#!/usr/bin/env python3 """ File: find_opposite_effects.py Created: 2020/10/22 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...
c6a22739aa72397dba88bfd22cc2511e0e7e66fcbeb927694e809968675a7990
Python
8,390
152
import pandas as pd import inspect import os import numpy as np import tqdm import AIS_parameters import AIS_description import AIS_geopandas_tagging import AIS_interp import datetime import functions_basic_sak as funsak fname = os.path.split(inspect.getfile(inspect.currentframe()))[1] def get_df_old( d...
15c21bcf43368b5f7907e2dbcceecb35aa7ff5d50b340dc9c5948c6c060d0536
Python
8,392
242
""" Some classes to pre-process big connectivity data and speed up the processing. """ import numpy as np import pandas as pd import numba import collections class PresortedGroupBy: """using a connections dataframe directly is very costly if you want to do lots of groupby operations specially for big-ish...
87c21e4e6471083fbd3abe8b96c8fd0fb46d0bc489622ee182599eba2729a232
Python
8,395
215
# 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...
d5d7a2d95bde3120b71dbd38bd531836c2fe506c82c00c8d945ef869717e3ec3
Python
8,397
161
import os, sys import shutil import matplotlib.pyplot as plt 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 import tensorflow as tf # tf.enable_eager_execution(config=config) import nump...
1d0a75aeb9e52cce36dbc43fa29187db9c1961cbcaf20d2915fd329d97b1307b
Python
8,400
209
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Centralized catalog of paths.""" import os class DatasetCatalog(object): DATA_DIR = "datasets" DATASETS = { "panoptic_train": { "img_dir": "coco/train2017", "target_root": "coco/annotations/panoptic_tra...
61dae5b40c82549928e8e7141e715857b90d06c89c623cda8a47268200dae7bf
Python
8,401
149
import os import graph_nets as gn import numpy as np import sonnet as snt import tensorflow as tf from GraphBuilder import GraphBuilder def mila(x, beta=-1): return x * tf.math.tanh(tf.math.softplus(beta + x)) class IPA(tf.keras.Model): def __init__(self, cutoff=10.0, l1=0.0, l2=0.0, activation=mila, num_...
cf9b421b13c2730fa5bf7e760572c068cda31d99ba9a0938fcf2ac98a3f381cf
Python
8,402
209
""" ========================== AFQ with HCP data ========================== This example demonstrates how to use the AFQ API to analyze HCP data. For this example to run properly, you will need to gain access to the HCP data. This can be done by following this instructions on the webpage `here <https://wiki.humanconnec...
bd11876cddae315c9a6d38a3378a5915febc8fe56e3abecdfbb848687de5ff63
Python
8,403
211
#!/usr/bin/env python3 """ File: find_opposite_effects.py Created: 2020/10/22 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 Fr...
3af8a21f074190b391b4bdde37f017f62bdad70c7834da1e68ec5148bb7b6650
Python
8,410
246
# libraries import pandas as pd import numpy as np from sklearn import preprocessing import math import pickle import tensorflow as tf from tensorflow.keras.models import Model, load_model from tensorflow.keras import optimizers, regularizers from tensorflow.keras.layers import Dense, Dropout, BatchNormalization, Con...
bb20b2df5296029448be0e499f22c9e0cc5940ebb2168dca772ac3b78de5f986
Python
8,411
172
from validate import test from pathlib import Path from .heatmap_eval import BaseXAIevaluator from .heatmap_utlis import postprocess_heatmaps, heatmap_to_binary import numpy as np import logging import pickle, os, glob import csv from sklearn.metrics import jaccard_score from tqdm import tqdm def tumorsyn_get_test_perf...
122893bce8b64caf74816b37afe3157f638f0b6b6f8553a1488227ffa420809d
Python
8,412
221
# 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...
1a9fb4afd3e2e2fef95176a1bb20b520343a41c3dc3e20cbf23eca396988aee7
Python
8,414
243
#!/usr/bin/env python3 """ File: create_decon_upsetplot.py Created: 2020/11/24 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...
3898cc9005083f09cf7ed71a736b1ceecc61264da9e711e05edfcaf76f23e5aa
Python
8,415
214
from __future__ import print_function # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import datasets import datasets.i...
46a5b25c5653caa93b2cdfcb6b546ab1ce93472aedd3320938f14ad4b8cf1ac8
Python
8,418
200
import itertools from scipy import stats from .motif_counts import * def intersection1d(lst1, lst2): return list(set(lst1) & set(lst2)) def get_cnr_stats(g_): g = g_.to_undirected() cn_counts = np.zeros(10) scn_counts = np.zeros(10) pcn_counts = np.zeros(10) ccn_counts = np.zeros(10) ...
28f55cfdc57bb5c917108568f0415cf96ff6f520e646821fff67d08a5d96e5ec
Python
8,423
195
# 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...
ec019616a0c7f2db1de89075dacaf04ecced80538df06a0877086cae5724b169
Python
8,426
222
import sys import autograd.numpy as anp from autograd import elementwise_grad, jacobian from autograd.scipy import stats from alive_progress import alive_bar # Lower constraint def _lower_constraint(lower): def fun(x): return lower + anp.exp(x) return fun # Interval constraint def _interval_constraint...
39c2e2098dc6392e2140f66b7181cf37825600faafa220e4d4197d9796513004
Python
8,428
184
import numpy as np import pandas as pd import scanpy as sc # import bbknn import os import pickle import sys MARKER = "/home/rkawaguc/ipython/BICCN/script/Catactor/analysis/191219_meta/rank_analysis/190214_all_data_three_types/marker_name_list.csv" def read_markers(): df = pd.read_csv(MARKER) markers = [x.spl...
384a41a15c9d6dcfefa3dc47142f3310f7d50a7b41f0f983873b4e4d4b23e491
Python
8,434
232
''' Author: Naiyuan liu Github: https://github.com/NNNNAI Date: 2021-11-23 16:55:48 LastEditors: Naiyuan liu LastEditTime: 2021-11-24 16:58:06 Description: ''' """ Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/...
6f0b5fc9ffcdd10b7b7979b72a9b73cff216a42d92363894aea83b7540e5ccc5
Python
8,434
208
"""Configuration objects for CROPro.""" from __future__ import annotations from dataclasses import asdict, dataclass from pathlib import Path from typing import Any, Literal CropMethod = Literal["center", "random", "stride"] PatientStatus = Literal["negative", "positive", "unknown"] SequenceType = Literal["T2W", "bp...
e46f668240d1be8695ea9998490d75cd4f22ade268847532e3124171ca0d2e43
Python
8,434
292
import os import pickle import argparse import warnings import pandas as pd from grr.Tools import gagProcess # PARSE COMMANDLINE ARGUMENTS parser = argparse.ArgumentParser() parser.add_argument( 'experiments', type=str, help='Pickled list of Experiment objects' ) parser.add_argument( 'models', type=str...
bcf44cac31e6132c958fa4d6e5345f0d44b5482b12c74a11be3467ee63b8c480
Python
8,436
234
import pandas as pd import numpy as np import networkx as nx from networkx.algorithms import bipartite import itertools from functools import reduce from networkx.utils import py_random_state def grow_bipartite_random(ntarg, p, numspines): # p : probability of adding a new input edge G = nx.MultiDiGraph() # mu...
eda41eacc758a2cd5ea94601af72ce3c6b8ccf42012cc384c0b565bae6290891
Python
8,438
264
# 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...
9f16bab81dae5618bc5cada9abbbb581986cc4d251dbadf75e8097b0f6d60775
Python
8,444
241
import random import numpy as np import torch from torch.utils.data import TensorDataset def generate_recog_data(T=2000, d=50, R=1, P=0.5, interleave=True, multiRep=False, xDataVals='+-', softLabels=False): """Generates "image recognition dataset" sequence of (x,y) tuples. x[t] is a d-dimensi...
a5b1d30bd60eef5759aee6459d47c63c96ea908f7150b0d5dc8d166385755618
Python
8,444
221
import numpy as np import os import matplotlib.pyplot as plt import matplotlib.animation as animation from sklearn.manifold import TSNE from tqdm import tqdm from scripts import dl_utils # Sentinel 2 band descriptions band_descriptions = { 'B1': 'Aerosols, 442nm', 'B2': 'Blue, 492nm', 'B3': 'Green, 559nm',...
1651e1973844924fbbc5d2ce100dcb6985532ecdf67f02adefff80555f1a3b8f
Python
8,445
199
#!/usr/bin/env python import time from copy import deepcopy import numpy as np import torch from drugex import DEFAULT_DEVICE, DEFAULT_GPUS, utils from drugex.logs import logger from drugex.training.explorers.interfaces import Explorer from drugex.training.generators.utils import unique from drugex.training.monitors i...
29eb980b04b9f893245a7d64dc6634d832e5eb319888ff736ca85c81a34e6ccd
Python
8,447
282
from typing import Any import numpy as np from scipy.signal import convolve2d from skimage.morphology import square from skimage.feature import peak_local_max from scipy.ndimage import convolve1d from dask_image.ndfilters import percentile_filter import pandas as pd from math import factorial import warnings import log...
602873a95c4c7707d25f02aa11db96a2500197a773c10252f7ca1ddbb367915f
Python
8,455
357
# %% [markdown] # ## import os import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib.patches import Circle from mpl_toolkits.axes_grid1 import make_axes_locatable from mpl_toolkits.mplot3d.art3d import Poly3DCollection from scipy.integrate...
15f02111a38ef367ecebceff0011396225c56293068bfc09a8a675fdbbd66397
Python
8,458
273
# Auto generated from value_set_configuration.yaml by pythongen.py version: 0.9.0 # Generation date: 2022-11-27T17:19:16 # Schema: value-set-configuration # # id: https://w3id.org/linkml/value-set-configuration # description: A datamodel for configuring value sets and value set expabsions # license: https://creativecom...
807b85398436a6c90e67519ec59803f15c10f1391e9b1a1a636d57e4266f1715
Python
8,461
159
# 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...
fb1c6a7e0cfb76ca90b7ab4095ca6c39b52ef727c1e68566d6b0670374f4220c
Python
8,461
206
# 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...
df7496603d9055cdbeb1d24dfafef6fbaf8f250b83e13670d82ef959bd36c30c
Python
8,462
187
"""Structural tests for the skill library and the MCP surface. These guard the invariants a published package must not break: every skill is discoverable, its frontmatter is complete, its group matches where it lives, its in-repo links resolve, and its scripts parse. Run with `pytest -q`. Deliberately no CARLA/UE4 re...
34d6745d8fdd8b9ed3014584f9e8080f7a8c3f8b2b62ca626007969eb2b3674d
Python
8,465
212
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Variational Animal Motion Embedding 0.1 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 """ import...
77dfc293c3d7ee51550ab5b4d2c9020eb62908b0f724f2dc4aebbf1458854aee
Python
8,466
209
#!/usr/bin/env python3 # Copyright 2017 Chun Chieh Chang # 2017 Ashish Arora # 2017 Yiwen Shao # 2018 Hossein Hadian # 2018 Desh Raj """ This script converts images to Kaldi-format feature matrices. The input to this script is the path to a dat...
f254eb1272f2f519e00a5dfa1d1d42ef852d161d0f8c918cfa2c627e38d56579
Python
8,466
166
r""" Custom integrators to use with polychrom ---------------------------------------- Here, we develop Brownian integrators capable of integrating the overdamped Langevin equation for a polymer driven by correlated active forces. The forces can vary in magnitude along the chain, such that each monomer has a different...
a0310dffb18acc5f3fdb4d0cd138c2e6a5e0832b858e763264d84e10d4eef40a
Python
8,471
195
# 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...
073efba7d2256c5896ee415ac9ef1b9031e2263a3d818e97c4f85f3e74f0219f
Python
8,473
286
import re import math import pandas as pd import numpy as np # _/_/_/ Basic Functions _/_/_/ class CONFIG: img_out_dir = './' log_out_fname = img_out_dir + 'plotlog.txt' summary = {} category_name = 'ctgry_border' def set_out_dir(filepath='./'): CONFIG.img_out_dir = filepath CONFIG.log_out...
1ca94d317f860bb4c0f4c426460a8ed5b7b703b8d0fa9be6e6f463c44eafa4ee
Python
8,477
212
""" Vowel Cooling: Format data for analysis / plotting Here we do some general housekeeping to get the columns into a common format, create columns to make the statistics in R more straightforward and bring together some columns containing redundant information. We also filter the data for conditions such as correc...
8e0318b18f26eb536198b666fa3487fa16c95bdc84ac6a876f8064f07079e3ea
Python
8,477
193
#!/usr/bin/env python3 """Prove an imported walker really works, on a running CARLA server. python3 verify_walker.py --id 0053 python3 verify_walker.py --id 0053 --keep # leave it walking Assets on disk prove nothing, and neither does a factory entry: a walker whose SkeletalMesh failed to load still LISTS...
b428bd267e5e9119913039a259a1d7d22ce38671f9af3b4ccd69081d30cc088e
Python
8,477
110
"""Prepare the CC BY Tesla 2018 Model 3 candidate for fidelity review (Blender). Source: Ameer Studio, Sketchfab 5ef9b845aaf44203b6d04e2c677e444f. Source retrieved from the public Objaverse collection; attribution retained. This is a derived asset, not a model authored from scratch. """ import bpy,bmesh,math,json from ...
ab656dc4ccfd07e1e6bf945124c0ef2c97f706e4b29b80b80b8e0cd9f8393008
Python
8,481
276
import matplotlib as mpl import numpy as np import seaborn as sns from matplotlib.colors import ListedColormap from matplotlib.patheffects import Normal, Stroke from matplotlib.transforms import Bbox import matplotlib.pyplot as plt from matplotlib.collections import LineCollection def shrink_axis(ax, scale=0.7, shift...
964af97cd0bec25a7385301131c8630e80c36427884cf1abb8d2a8204e1da8e8
Python
8,482
234
#!/usr/bin/env python3 """ File: filter_interaction_eqtls.py Created: 2020/09/25 Last Changed: 2020/09/29 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 ...
ba405822cadee98801a4e0f475419cceff6088e11eab2089d76c748c99b45552
Python
8,484
165
# 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...
e766bfe56a4c1e20a19044c930dcf89016d82bbf49c04c8b2683abb302b4d796
Python
8,484
234
#!/usr/bin/env python3 """ File: filter_interaction_eqtls.py Created: 2020/09/25 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 ...
759f691ab13a19a2697669510f317e8a510e560be1b59e515e4023bbc877f939
Python
8,490
248
# 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...
dd85fcfa49aeeccbc589af576b1c33d222577cee8788a48e5d503dc957c7aff0
Python
8,494
213
#!/usr/bin/env python3 """ File: correlate_expression_profiles.py Created: 2021/10/19 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 ...
a8daf0f765368b00a0dd0a1cf53c05e4bc37bbbba7f906968ef5f12f609e6129
Python
8,496
198
"""Public API/CLI regressions for #810 (part of #757).""" import json from pathlib import Path import struct import subprocess import sys import pytest from conftest import macs3_env, no_core_dumps from test_Parser_bam_truncation import write_bam HEADER = (b'BAM\1' + struct.pack('<ii', 0, 1) + struct.pack('<i', 5)...
82ed6fc74176ba6143d22f3eb80c771e2e23c3abd2caf3ddf7717a1bba853261
Python
8,499
209
import os from os.path import join import collections import numpy as np import pandas as pd from itertools import chain from sklearn.model_selection import train_test_split from sklearn.impute import SimpleImputer, MissingIndicator from sklearn.pipeline import make_union, Pipeline from sklearn.ensemble import RandomF...
4ff0aba62a54c86b99deebcf44f00df8cf1dcbb7d6f0d9688f7ba62eaf32c634
Python
8,501
323
""" https://stackoverflow.com/questions/67456368/pytorch-getting-runtimeerror-found-dtype-double-but-expected-float """ import pandas as pd import numpy as np # Libraries import torch import torch.nn as nn import torch.nn.functional as F from skorch import NeuralNet from torch.utils.data import DataLoader from sk...
abe462295430cc40da34d81fe11825350efa61451276ea5c917d48f7a0bc339e
Python
8,501
212
import os from os.path import join import collections import numpy as np import pandas as pd from itertools import chain from sklearn.model_selection import train_test_split from sklearn.impute import SimpleImputer, MissingIndicator from sklearn.pipeline import make_union, Pipeline from sklearn.ensemble import RandomF...
b3760dc7182bc56e768a29d02299581f1ace37625a351cc0175b2ff7e7272dbf
Python
8,501
220
import logging import time from dataclasses import dataclass from typing import Any, Dict, Iterable, Iterator, List, Optional import requests_cache from oaklib.datamodels import obograph from oaklib.datamodels.association import Association, NegatedAssociation, PropertyValue from oaklib.datamodels.search import Searc...
f31114640d5e5cd53fa43df3a1cdaae92ea24f4505538838fb1efe3856e6e22f
Python
8,501
183
# basic imports import os import numpy as np import pickle import pyqtgraph as qg # framework imports from cobel.agents.sfma import SFMAAgent from cobel.interfaces.gridworld import InterfaceGridworld from cobel.analysis.rl_monitoring.rl_performance_monitors import RewardMonitor, EscapeLatencyMonitor from cobel.misc.gri...
64532e272f2a8d8b597942f2f105596c8ab6444c822698fbd81936f2cbb5e9f1
Python
8,510
348
# %% [markdown] # ## import os import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from mpl_toolkits.mplot3d.art3d import Poly3DCollection from scipy.integrate import tplquad from scipy.stats import gaussian_kde import pymaid from src.data import load...
155f45ac18ca7d082042d8f43c05663ea965c7c7914a25e68828baf61c6dd8f7
Python
8,511
338
# %% [markdown] # # import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.manifold import TSNE from sklearn.model_selection import ParameterGrid from tqdm import tqdm from graspy.embed import AdjacencySpectralEmbed, selectSVD, OmnibusEmbed from graspy.util...
01f6d6851c90fa2f8f78138f1abae693a55f6d517c20c79dfffbbbcc732a9bda
Python
8,512
337
import numpy as np _,ar,_,_,_=np.random.get_state() seed=1528155142#ar[1] #1669768389 #3519291485 #2147483648 #22506088 #2413843216 #2311804307 #1200295143 #2032192475 Best: 10(1528155142, 3978893405) 2147483648 np.random.seed(seed) import tensorflow as tf tf.random.set_seed(seed) import torch.nn.functional as fn imp...
500b59973197b48aca64170a30e7ae5c1aa8ba0cb207e6fdd6f36cf0dab38f22
Python
8,513
239
import os import shutil import pickle import torch import numpy as np import scipy from scipy import stats import pandas as pd class ContModelScore: def __init__(self, best_epoch_indx, spearman_corr, pearson_corr): self.best_epoch_indx = best_epoch_indx self.spearman_corr = spearman_corr se...
e8ba6a698f235b4bb1081a1907dac6c62c57d9822176809c825b9cd3514a1c2c
Python
8,514
230
import spacy import os import glob import gzip import pickle import random import collections import tensorflow as tf import struct import six import numbers import re from itertools import chain random.seed(200) CHUNK_SIZE = 2000 VOCAB_SIZE = 50000 dm_single_close_quote = u'\u2019' # unicode dm_double_close_quote...
a528b1a2d67199c64ea9233731e82863916023cb9b9c5690ecb97a96dfcb4b13
Python
8,515
212
import os from os.path import join import collections import numpy as np import pandas as pd from itertools import chain from sklearn.model_selection import train_test_split from sklearn.impute import SimpleImputer, MissingIndicator from sklearn.pipeline import make_union, Pipeline from sklearn.ensemble import RandomF...
af3f2458f0d730375b9666d22bcfa555beade57f3523ede39da28146a962fb39
Python
8,515
166
# 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...
db723f59b02541b5c59e0832caa37ec15d70e16a74903b054c4d20195bab3393
Python
8,518
264
import argparse import yaml from model.dataloader import TripletData from model.model import PairModel, TripletModel, TripletGraphModel import os import torch.utils.data as Data import torch import random import numpy as np import pandas as pd from tqdm import tqdm def build_dataset(cfg, train=1): if train == 1:...
23464d4deaf9a7d28af1b2dd96dd18fbb5b2ffc10913857c614cee96837dfec9
Python
8,519
189
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.backend as K i...
d6b5e2ab5154703fa62674b50dbbbaf2e99d0e05fa2abd154699ebc6b2541c7b
Python
8,524
239
# 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...
28993acf3681f2e76b59738b2a71bc9a7724077edcdaaf654612e71449bde7dc
Python
8,525
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...
fc54eebbf82924d012fc5130742868056734db47b898aa59fd81603e27f38d68
Python
8,532
213
""" This file is called by routine which creates mesh from nested dictionaries (convert.py). """ import numpy as np import mesh.orient as orient import mesh.triangulate2D as tri from mesh.shapes.Regions2D import RefinementCircle, RefinementMany def triangulate_sides(width, coords_upper, coords_l...
497662414ec112c506388f683cee658dbd734d2233772e49d38c6961bd85da08
Python
8,535
165
import os import sys import json import time import pydicom import datetime import pandas as pd from dicom_scp_class import Retriever_SCP from dicom_scu_class import Retriever_SCU def inspect_regs(day): infofile = "setup_information.json" f = open(infofile) info = json.load(f) f.close() tx_ct_file...
c4e6a4e2fada055aeb25d2a3c21c85a8ae51c0d41006b093a9141ab290aee5c0
Python
8,539
214
# 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...
3be1c3bd07028b29794515f32f698bd03851c8c8b48767955472435aa78b970f
Python
8,541
207
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Centralized catalog of paths.""" import os class DatasetCatalog(object): DATA_DIR = "datasets" DATASETS = { "coco_2017_train": { "img_dir": "coco/train2017", "ann_file": "coco/annotations/instances_trai...
9e711fa71163521a3a0acfcff612cd77243fec7bf8f53c9c66f4d984c59730a1
Python
8,541
180
#%% from pymaid_creds import url, name, password, token from data_settings import pairs_path, data_date_A1_brain import pymaid import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from datetime import date from contools import Promat, Celltype, Celltype_Analyzer # allows text t...
c89a40e63d341141405fb827abf16bf9480da56b20646c2625637519b1d3a01f
Python
8,542
240
from keras.models import Sequential from keras.layers import Dense, Conv2D, Flatten, Reshape, Input, Dropout, UpSampling2D, MaxPooling2D, Conv1D from keras.losses import mse from tensorflow.keras.optimizers import Adam from tensorflow.keras import backend as K import tensorflow as tf import keras import tensorfl...
de928a77d992ba90788b6e8f208705b81676a4e2bb19091625fc46599dd7cdf9
Python
8,543
213
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch import torch.nn.functional as F from torch import nn class FPN(nn.Module): """ Module that adds FPN on top of a list of feature maps. The feature maps are currently supposed to be in increasing depth order, and must b...
0314e8f295ac0624390ec88aaff335bbe1b47336e285ccc83f0e16822c8c2354
Python
8,546
164
import argparse import os import subprocess import moxing as mox _CACHE_DATA_URL = "./cache/data" _CACHE_TRAIN_URL = "./cache/train" def _parse_args(): parser = argparse.ArgumentParser('mindspore maskrcnn_mobilenetv1 training') parser.add_argument('--train_url', type=str, default='obs://neu-base/maskrcnn_1/m...
2de30661340f4bedcd117377edb66dd8f067b0fb1b86dc164b1b8ff9137b9183
Python
8,548
244
"""Test queries to the parliament open data API.""" from typing import Callable from unittest.mock import MagicMock import pytest from pytest_mock.plugin import MockerFixture # type: ignore from fi_parliament_tools.parsing.query import Query from fi_parliament_tools.parsing.query import SessionQuery from fi_parliame...
7b3cfccda075387460cdd45b218bd9df51798d1a12cb341fb5a63e439de1c4c7
Python
8,550
237
# This script is used to calculate seasonal cycle for SMAP SM and SMOS TB data # input files: smap_smos_overlap_3dm.pkl, smos_3dm.pkl # output files: smap_smos_overlap_3dm_seas_c.pkl, smap_smos_overlap_3dm_seas_c_no_std.pkl, smos_3dm_seas_c.pkl, smos_3dm_seas_c_no_std.pkl, sm_seas_cycle.pkl import pandas as pd imp...
6c8a75dea59469bdb7af394690df00c285296d4defea1983a24a89d26918b851
Python
8,555
148
import os, time, json, sys, gc import numpy as np import nltk, pandas import torch from scipy.sparse import csr_matrix, lil_matrix, save_npz, load_npz from torch_geometric.data import Data, DataLoader, GraphSAINTRandomWalkSampler, GraphSAINTNodeSampler, GraphSAINTEdgeSampler from torch_geometric.data.cluster import Clu...
c10689f5a90fbae4702920c2aa5c61f444c66940046d64ffe8528950f5e26722
Python
8,562
235
# 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 a...
5f285811b22bd3dac7d6668c198c43354f7bbe3849c6f7a1711b89122d0758be
Python
8,564
245
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> import numpy as np from numpy.testing import assert_array_equal, assert_allclose import pytest from scipy import signal from eelbrain import ( NDVar, Case, Scalar, UTS, datasets, concatenate, convolve, correlation_coefficient, cross_correlation, cwt_...
763e34976e7b2e4d8352b67907bf28e46dfc101197291d515a9674ab409fccd5
Python
8,566
261
import abc import re from copy import deepcopy import numpy as np from .SpikingModel import SpikingModel from .Filter import constructMedianFilter from . import Tools class ThresholdModel(SpikingModel): """ Abstract class to define a threshold model. A threshold model is a model that explicitly describ...
c87178e55e3f3d1e33158f6b484ac5d16bc1c84f4b3f689a62cffbec81068aab
Python
8,566
193
# 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...
f7c5b762c972e10c8844e32c36aed8b5c63bc02a509f7ea9f6d1a550fad738d0
Python
8,573
208
#################################################################################################### # Copyright (c) 2019 - 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 ...
0f8d5a720f388288b9cacc00c021118d6515ef764be81dfaf6d2d367904aba8c
Python
8,574
192
""" A randomly sampling batch sequence object Performs class-balanced sampling across uniformly randomly selected SleepStudy objects. """ import logging import numpy as np from utime.sequences import BatchSequence logger = logging.getLogger(__name__) class BalancedRandomBatchSequence(BatchSequence): """ Bat...