repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
karhunenloeve/AjinReeses | [
"8f09f65b9f74442137212f98839948a842a115c1"
] | [
"persistenceStatistics.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\n\nfrom multiprocessing import Pool\nfrom sklearn.neighbors import KDTree\nfrom typing import *\n\ndef hausd_interval(\n data: np.ndarray,\n confidenceLevel: float = 0.95,\n subsampleSize: int = -1,\n subsampleNumber: int = 1000,\n pairwiseDist: bool = Fal... | [
[
"numpy.quantile",
"numpy.random.choice",
"numpy.log",
"numpy.min",
"numpy.arange",
"numpy.size",
"sklearn.neighbors.KDTree"
]
] |
JacobARose/project-fossils | [
"a0fe21a29d21bb7a1fdb969d819ce4d4243ae8cd"
] | [
"leavesdb/models/inception_v3.py"
] | [
"\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras.applications.inception_v3 import InceptionV3, preprocess_input\nfrom tensorflow.keras.layers import Dense, Activation\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.optimizers import SGD\n\n\n\nimg_shape = (299,299)\npreprocess... | [
[
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.applications.inception_v3.InceptionV3",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense"
]
] |
c200chromebook/numba | [
"4d43e13fdefe59e1dcc27d7bddbd32a6b9c98af7"
] | [
"numba/cuda/api.py"
] | [
"\"\"\"\nAPI that are reported to numba.cuda\n\"\"\"\n\n\nimport contextlib\n\nimport numpy as np\n\nfrom .cudadrv import devicearray, devices, driver\n\n\n# NDarray device helper\n\nrequire_context = devices.require_context\ncurrent_context = devices.get_context\ngpus = devices.gpus\n\n\n@require_context\ndef from... | [
[
"numpy.ndarray.view",
"numpy.ndarray",
"numpy.prod",
"numpy.dtype"
]
] |
zhaoliuUT/tuning | [
"1f1a9b1d66b994196de076f08f74a48c60dd7141"
] | [
"src/tuning/functions_for_analysis.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n#========= Generate hierachical binary tuning curves =========\ndef gen_binary_hierachical_curves(numNeuro, fp = 1, fm = 0):\n x_ = np.array([0, 1]).reshape((1, 2))\n curr_dim = 1\n\n while curr_dim < numNeuro:\n if len(x_.shape) ==1:\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros_like",
"numpy.lexsort",
"numpy.zeros",
"numpy.sum",
"numpy.roll",
"numpy.min",
"numpy.diff",
"numpy.where",
"numpy.sign",
"numpy.fabs",
"numpy.argsort",
"numpy.flip"
]
] |
georgi/MusicTransformer-pytorch | [
"fe1af43fa5f38703c41b2887673eadbfb2db761a"
] | [
"data.py"
] | [
"import random\nimport torch\nimport os\nfrom random import randrange, uniform\nfrom torch.utils.data import DataLoader\nfrom note_seq.sequences_lib import (\n stretch_note_sequence,\n transpose_note_sequence,\n NegativeTimeError\n)\nfrom note_seq.protobuf import music_pb2\nfrom utils import find_files_by_... | [
[
"torch.full",
"torch.utils.data.DataLoader"
]
] |
mediacatch/semantic-segmentation | [
"a4131f3b56bfbb0b02f50bcbd73aebb6f6b372e9"
] | [
"semseg/datasets/stadiums.py"
] | [
"import torch \nfrom torch import Tensor\nfrom torch.utils.data import Dataset\nfrom torchvision import io\nfrom pathlib import Path\nfrom typing import Tuple\n\n\nclass Stadiums(Dataset):\n CLASSES = ['background', 'tribune', 'grass', 'floor']\n\n PALETTE = torch.tensor([[0, 0, 0], [250, 50, 83], [102, 255, ... | [
[
"torch.zeros",
"torch.all",
"torch.tensor",
"torch.eq"
]
] |
ismarou/vtkplotter-examples | [
"1eefcc026be169ab7a77a5bce6dec8044c33b554"
] | [
"vtkplotter_examples/other/dolfin/stokes.py"
] | [
"\"\"\"\nThis demo solves the Stokes equations, using quadratic elements for\nthe velocity and first degree elements for the pressure (Taylor-Hood elements).\n\"\"\"\n# Credits:\n# https://github.com/pf4d/fenics_scripts/blob/master/cbc_block/stokes.py\nfrom dolfin import *\nimport numpy as np\nfrom vtkplotter.dolfi... | [
[
"numpy.zeros_like",
"numpy.linspace",
"numpy.ones_like"
]
] |
tareqdandachi/qiskit-terra | [
"5221fe330adba5529bfa22dc25262ac8e6291aaf"
] | [
"test/python/quantum_info/test_quaternions.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"scipy.linalg.det",
"numpy.identity",
"numpy.outer",
"scipy.linalg.norm",
"numpy.diag"
]
] |
synabreu/addons | [
"a8316c74854350d112a4784da8fd5db65d0ec0e0"
] | [
"tensorflow_addons/image/utils.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.rank",
"tensorflow.shape",
"tensorflow.debugging.assert_rank",
"tensorflow.equal",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.squeeze",
"tensorflow.less_equal",
"tensorflow.debugging.assert_rank_in"
]
] |
gmiaslab/DifferentialNetworks | [
"beaaef02e109bf4f4c78ff21147eae8b3108e889"
] | [
"heatmaps.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 22 14:15:31 2021\nThis script plots heatmaps. \n\n@author: Shuyue Xue\n\"\"\"\nimport os, matplotlib\nimport pandas as pd, matplotlib.pyplot as plt, seaborn as sns\nfrom preprocess_raw_data import configure_SLV_dataframe, configure_Bcell_datasets\nimport dir_conf... | [
[
"sklearn.preprocessing.Normalizer",
"matplotlib.pyplot.savefig",
"pandas.read_excel",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"pandas.ExcelFile",
"pandas.ExcelWriter",
"pandas.read_csv",
"matplotlib.colors.LinearSegmentedColormap.from_list"
]
] |
vcucu/wimblepong | [
"4c9353230c64e17ab38b6b46fc6e242f636e55ef"
] | [
"train_dqn_gigiano.py"
] | [
"import argparse\nimport sys\nimport gym\nimport time\nimport numpy as np\nimport wimblepong\nimport torch\nimport matplotlib.pyplot as plt\n\n\ndef parse_args(args=sys.argv[1:]):\n # TODO [nice-to-have] lag continue training taking a file of weights already pretrained\n parser = argparse.ArgumentParser()\n ... | [
[
"torch.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ioff",
"torch.tensor",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.pa... |
jsmz97/pennylane | [
"de7b7c0b452c8d59867d11f84b9c332a36e08ab1"
] | [
"pennylane/optimize/rotoselect.py"
] | [
"# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by ap... | [
[
"numpy.arctan2"
]
] |
andrewlstewart/CS231n-Convolutional-Neural-Networks- | [
"3a6066d790bd654d5fe3ad670c2308e8b2c05d93"
] | [
"Assignment_03/test_saliency_pytorch.py"
] | [
"import torch\nimport torchvision\nimport torchvision.transforms as T\nimport random\nimport numpy as np\nfrom scipy.ndimage.filters import gaussian_filter1d\nimport matplotlib.pyplot as plt\nfrom cs231n.image_utils import SQUEEZENET_MEAN, SQUEEZENET_STD\nfrom PIL import Image\n\ndef preprocess(img, size=224):\n ... | [
[
"torch.cat",
"torch.argmax",
"numpy.asarray",
"torch.norm",
"matplotlib.pyplot.title",
"torch.LongTensor",
"scipy.ndimage.filters.gaussian_filter1d",
"numpy.random.randint",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"torch.Tensor... |
JokerYan/ZOO-Attack | [
"f81ca0d7611e697f7d5e937da8a64c4b80ad5dbc"
] | [
"l0_attack.py"
] | [
"## l0_attack.py -- attack a network optimizing for l_0 distance\n##\n## Copyright (C) IBM Corp, 2017-2018\n## Copyright (C) 2016, Nicholas Carlini <nicholas@carlini.com>.\n##\n## This program is licenced under the BSD 2-Clause licence,\n## contained in the LICENCE file in this directory.\n\nimport sys\nimport tens... | [
[
"numpy.copy",
"tensorflow.gradients",
"tensorflow.tanh",
"tensorflow.global_variables",
"numpy.tanh",
"numpy.array",
"tensorflow.train.AdamOptimizer",
"numpy.reshape",
"numpy.zeros",
"tensorflow.placeholder",
"tensorflow.reduce_sum",
"numpy.argsort",
"tensorflow... |
BoscoHan/ECE493 | [
"ce02e7c1366575c6a2f2192a86f51166d732473e"
] | [
"training_scripts/train_ga_selfplay.py"
] | [
"# Trains an agent from scratch (no existing AI) using evolution\n# GA with no cross-over, just mutation, and random tournament selection\n# Not optimized for speed, and just uses a single CPU (mainly for simplicity)\n\nimport os\nimport json\nimport numpy as np\nimport gym\nimport slimevolleygym\nimport slimevolle... | [
[
"numpy.random.normal",
"numpy.random.choice",
"numpy.minimum",
"numpy.random.seed",
"numpy.mean",
"numpy.std",
"numpy.argmax"
]
] |
YANHAOsTHINGSdb/QUANTAXIS | [
"791e7d6d368ab2581b6c32f5ad9918f44cd4065f"
] | [
"QUANTAXIS/QAARP/QARisk.py"
] | [
"# coding:utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2017 yutiansut/QUANTAXIS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including withou... | [
[
"numpy.std",
"numpy.cov"
]
] |
ZDisket/TensorflowTTS | [
"ca5032422b1436320ac2954fee0eae82c1a4218d"
] | [
"examples/multiband_melgan/train_multiband_melgan.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2020 Minh Nguyen (@dathudeptrai)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.ones_like",
"tensorflow.reshape",
"tensorflow.shape",
"matplotlib.pyplot.savefig",
"tensorflow.transpose",
"tensorflow.constant",
"tensorflow.squeeze",
"matplotlib.pyplot.tight_layout",
"tensorflow.keras.optimizers.Adam",
"matplotlib.pyplot.subplot",
"tensor... |
enricopisoni/SHERPA-training | [
"f27ef7b0b69d45e3e637061023c3932c8cfff296"
] | [
"sherpa/read_scenarios/computeDistanceRatio.py"
] | [
"import geopy.distance as gpd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef computeDistanceRatio(conf):\n if conf.distance == 1:\n #compute step for lat and lon\n lat = np.unique(conf.y)\n lon = np.unique(conf.x)\n step_lat = lat[1] - lat[0]\n step_lon = lon[1] - ... | [
[
"numpy.array",
"numpy.size",
"numpy.polyfit",
"numpy.unique"
]
] |
SijanC147/Msc | [
"08a6ae6c8755a9a2392d441d8b84cfbb83bee0bf"
] | [
"tsaplay/scripts/client.py"
] | [
"from argparse import ArgumentParser\nfrom csv import DictReader\nfrom grpc import insecure_channel\n\nfrom tensorflow import string as tf_string\nfrom tensorflow.contrib.util import make_tensor_proto # pylint: disable=E0611\nfrom tensorflow.train import Example, Features, Feature, BytesList\nfrom tensorflow_servi... | [
[
"tensorflow.train.Example",
"tensorflow.train.BytesList"
]
] |
MontrealAI/recsim | [
"55e50e4be736d222ffe8c2477ed1981b40f91605",
"55e50e4be736d222ffe8c2477ed1981b40f91605"
] | [
"recsim/agents/random_agent_test.py",
"recsim/choice_model_test.py"
] | [
"# coding=utf-8\n# coding=utf-8\n# Copyright 2019 The RecSim Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle... | [
[
"numpy.ones",
"tensorflow.compat.v1.test.main"
],
[
"numpy.array",
"numpy.random.seed",
"numpy.ones",
"tensorflow.compat.v1.test.main",
"numpy.arange"
]
] |
poldrack/psych10.github.io | [
"113a4fa96998383951f94829d53227ce0fdf7ba5"
] | [
"syllabus/mk_syllabus.py"
] | [
"\"\"\"\ngenerate markdown version of syllabus\n\"\"\"\n\nimport os\nimport collections\nimport re\nimport time\nimport pandas\n\nfrom get_syllabus2 import get_syllabus\n\n\ndef replacemany(adict, astring):\n # from https://stackoverflow.com/questions/2392623/replace-multiple-string-in-a-file # noqa\n pat = '... | [
[
"pandas.DataFrame"
]
] |
hustvl/DGCN | [
"1baa977e27aa71992923861113f5cea9bb1fb98a"
] | [
"dsrg_cues.py"
] | [
"import numpy as np\r\nimport os, sys\r\nimport os.path as osp\r\nimport pylab\r\nimport matplotlib.pyplot as plt\r\nfrom scipy.ndimage import zoom\r\nimport argparse\r\nimport cPickle\r\n# import pyDRFI\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.autograd import Variable\r\nimport cv2\r\n\r\n# from mode... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.where"
]
] |
transientlunatic/heron | [
"6b4951af3a74e69f0adaf1a339a1d4c460c6fae9"
] | [
"tests/test_tests.py"
] | [
"\"\"\"\nTests for the science testing code.\n\"\"\"\n\nimport unittest\nimport numpy as np\n\nfrom heron import testing\nfrom elk.waveform import NRWaveform, Timeseries\nfrom elk.catalogue import NRCatalogue\n\nfrom heron.models.georgebased import HeronHodlr\n\nclass MockWaveform(NRWaveform):\n def timeseries(s... | [
[
"numpy.linspace",
"numpy.random.randn"
]
] |
NVIDIA/transformer-ls | [
"9badc4b6a611abb73f4d1a4e9708fc56ba7c5924"
] | [
"autoregressive/model_lib/layer.py"
] | [
"# Copyright (c) 2021 NVIDIA CORPORATION. Licensed under the MIT license.\n\nimport math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.checkpoint as cp\n\nfrom fairseq.modules.layer_norm import LayerNorm\n\nimport pdb\n\n\nclass ChunkedLSAttention(nn.Module):\n def _... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat",
"torch.FloatTensor",
"torch.nn.Module.__init__",
"torch.utils.checkpoint.checkpoint",
"torch.nn.functional.pad",
"torch.nn.init.zeros_",
"torch.nn.init.xavier_normal_",
"torch.matmul"
]
] |
GavinatorK/pssummitwkshp | [
"5244364e74e11e535b023691e3f38696b3b342c3"
] | [
"tensorflow/tfModelCode.py"
] | [
"print(\"starting imports\")\nimport tensorflow as tf\nimport json\nimport numpy as np\nimport os\nfrom tensorflow.keras.callbacks import ReduceLROnPlateau\n# new additions\nfrom smdebug.tensorflow import KerasHook\nimport time\n\nprint(\"done with imports\")\nprint(tf.__version__)\n\nINPUT_TENSOR_NAME = \"input_16... | [
[
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.applications.efficientnet.EfficientNetB7",
"tensorflow.keras.layers.experimental.preprocessing.RandomFlip",
"tensorflow.keras.preprocessing.image_dataset_from_directory",
"tensorflow.keras.layers.experimental.preprocessing.RandomRotation",
... |
prateekstark/openai-gym-games | [
"7b25938cf7bb59f1e9197e8a040893a7011687ff"
] | [
"Bipedal Walker/bipedal_walker_gradient_monte_carlo.py"
] | [
"import gym\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\n\n# Gradient Monte Carlo Algorithm Implementation\n\ndef epsilon_greedy_action(Q, state, e):\n\tif(np.random.uniform(0, 1) < e):\n\t\taction = env.action_space.sample()\n\telse:\n\t\taction = np.argmax(Q[state, :])\n\treturn action\n\nde... | [
[
"numpy.random.uniform",
"numpy.argmax",
"numpy.zeros"
]
] |
TopGun666/FlowVO | [
"382bf31e9acc49dcb448713cb8e7e79eb4ae9e8b"
] | [
"FlowNet2_src/flownet_sd/flownet_sd.py"
] | [
"from ..net import Net, Mode\nfrom ..utils import LeakyReLU, average_endpoint_error, pad, antipad, crop_features\nfrom ..downsample import downsample\nimport math\nimport tensorflow as tf\nslim = tf.contrib.slim\n\n\n# (Yuliang) Replace antipad() with crop_features()\nclass FlowNetSD(Net):\n\n def __init__(self,... | [
[
"tensorflow.losses.compute_weighted_loss",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.losses.get_total_loss",
"tensorflow.variable_scope",
"tensorflow.stack"
]
] |
British-Oceanographic-Data-Centre/NEMO-ENTRUST | [
"41ed278e56428404ab8ec41d74a9a3a761e308ae"
] | [
"unit_testing/test_eof_methods.py"
] | [
"\"\"\"\n\n\"\"\"\n\n# IMPORT modules. Must have unittest, and probably coast.\nimport coast\nimport unittest\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport unit_test_files as files\nimport datetime\n\n\nclass test_eof_methods(unittest.TestCase):\n def test_compute_regular_eof(self):\n nemo_... | [
[
"numpy.allclose",
"numpy.isclose",
"numpy.radians"
]
] |
danaraujocr/trendfitter | [
"b91f0c4fb0be8479d6a1a385b65196cf537fcad5"
] | [
"trendfitter/models/MLSMB_PLS.py"
] | [
"from numpy import array, isnan, nansum, nan_to_num, multiply, sum, sqrt, append, zeros, place, nan, concatenate, mean, nanvar, std, unique, where, nanmean, identity\nfrom numpy.linalg import norm, pinv\nfrom sklearn.model_selection import KFold\nfrom pandas import DataFrame, Series\nfrom trendfitter.auxiliary.tf_a... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.nan_to_num",
"numpy.isnan",
"numpy.zeros",
"numpy.sum",
"numpy.nansum",
"numpy.mean",
"numpy.nanvar",
"numpy.nanmean",
"numpy.append",
"sklearn.model_selection.KFold",
"numpy.unique"
]
] |
atiroms/chainerrl | [
"02c15c55e7994e69468270fcddf0c08837806d64"
] | [
"chainerrl/policies/gaussian_policy.py"
] | [
"from __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom builtins import * # NOQA\nfrom future import standard_library\nstandard_library.install_aliases()\n\nfrom abc import abstractmethod\nfrom logging import get... | [
[
"numpy.full",
"numpy.isscalar"
]
] |
electricitymap/electricitymap-contrib | [
"6572b12d1cef72c734b80273598e156ebe3c22ea"
] | [
"parsers/DO.py"
] | [
"#!/usr/bin/env python3\n\nimport logging\nfrom collections import defaultdict\nfrom math import isnan\nfrom operator import itemgetter\n\nimport arrow\nimport numpy as np\nimport pandas as pd\nimport requests\nfrom bs4 import BeautifulSoup\n\n# This parser gets hourly electricity generation data from oc.org.do for... | [
[
"pandas.DataFrame"
]
] |
Laurae2/pygbm | [
"69e96fb76e62024df96f2b71ad7f0b5b669e9017"
] | [
"pygbm/histogram.py"
] | [
"import numpy as np\nfrom numba import njit\n\nHISTOGRAM_DTYPE = np.dtype([\n ('sum_gradients', np.float32),\n ('sum_hessians', np.float32),\n ('count', np.uint32),\n])\n\n\n@njit\ndef _build_histogram_naive(n_bins, sample_indices, binned_feature,\n ordered_gradients, ordered_hess... | [
[
"numpy.dtype",
"numpy.zeros"
]
] |
huylenguyen806/vnasrg | [
"caee2e79d0eb9d1a997f5df8e2ba3ee7f0a1bcae"
] | [
"tensorflow_asr/losses/rnnt_loss.py"
] | [
"# Copyright 2020 Huy Le Nguyen (@usimarit) and M. Yusuf Sarıgöz (@monatis)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n... | [
[
"tensorflow.exp",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.scatter_nd",
"tensorflow.reverse",
"tensorflow.zeros_like",
"tensorflow.python.ops.gen_array_ops.matrix_diag_part_v2",
"tensorflow.stack",
"tensorflow.tile",
"tensorflow.one_hot",
"tensorflow.cast",
... |
imagineagents/qmt | [
"5e8a7001cc020979636e492448abcfd894396038"
] | [
"qmt/geometry/freecad/objectConstruction.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"Functions that perform composite executions.\"\"\"\n\nimport numpy as np\nfrom six import iteritems, text_type\n\nimport logging\n# ~ logging.getLogger().setLevel(logging.DEBUG) # toggle debug logging for this ... | [
[
"numpy.array",
"numpy.sin",
"numpy.float",
"numpy.sum",
"numpy.tan",
"numpy.cos"
]
] |
dotCirill/captcha_sh | [
"0b38464b114c35d4588f9672f7fc04686632bba5"
] | [
"captcha_analysis/img2text/method_CNN.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\n\nmodel = keras.models.load_model('./NN/normal_model.h5')\n# same with model(!)\n# characters = ['f', 'q', '0', '9', 'e', 'm', 'd', 'a', '4', 'z', '8', 'n', 's', '5', 'g', 'k', 'x', 'u', '7', 'l', 'b', '... | [
[
"numpy.array",
"tensorflow.image.convert_image_dtype",
"tensorflow.io.read_file",
"numpy.ones",
"tensorflow.transpose",
"tensorflow.keras.models.load_model",
"tensorflow.image.resize",
"tensorflow.io.decode_png",
"tensorflow.keras.backend.ctc_decode"
]
] |
probcomp/cgpm2 | [
"280ab5bf3dd0d7c61196deaff7cb590692fc412a"
] | [
"tests/test_cc_ensemble_dependencies.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright (c) 2018 MIT Probabilistic Computing Project.\n# Released under Apache 2.0; refer to LICENSE.txt.\n\nimport itertools\n\nimport numpy as np\nimport pytest\n\nfrom cgpm.utils.general import get_prng\n\nfrom cgpm2.crosscat_ensemble import CrossCatEnsemble\nfrom cgpm2.transition... | [
[
"numpy.repeat",
"numpy.column_stack",
"numpy.shape"
]
] |
Frikster/Mesoscale-Brain-Explorer | [
"269d8f18162e2b9dca4619561e73a6beb8ba810c"
] | [
"src/plugins/trim.py"
] | [
"#!/usr/bin/env python3\n\nimport functools\nimport os\n\nimport numpy as np\nfrom PyQt4.QtCore import *\nfrom PyQt4.QtGui import *\n\nfrom .util import file_io\nfrom .util import project_functions as pfs\nfrom .util.plugin import PluginDefault\nfrom .util.plugin import WidgetDefault\n\n\nclass Widget(QWidget, Widg... | [
[
"numpy.load"
]
] |
clawpack/geoclaw_1d | [
"2272459a81f253720feaa3561094764433e7115a"
] | [
"examples/okada_fault/setrun.py"
] | [
"\"\"\"\nModule to set up run time parameters for geoclaw 1d_nonuniform code\n\nThe values set in the function setrun are then written out to data files\nthat will be read in by the Fortran code.\n\n\"\"\"\n\nimport os, sys\nimport numpy as np\nfrom mapc2p import make_mapc2p\n\n\n# Read in nonuniform computational ... | [
[
"numpy.where",
"numpy.linspace"
]
] |
LionKiss/tensorflow_template_application-master | [
"d7a553001f24521bc85689eeef2761179748682e"
] | [
"distributed/dense_classifier.py"
] | [
"#!/usr/bin/env python\n\nimport tensorflow as tf\nimport math\nimport os\nimport numpy as np\n\n# Define parameters\nflags = tf.app.flags\nFLAGS = flags.FLAGS\nflags.DEFINE_float('learning_rate', 0.01, 'Initial learning rate.')\nflags.DEFINE_integer('epoch_number', None, 'Number of epochs to run trainer.')\nflags.... | [
[
"tensorflow.train.start_queue_runners",
"tensorflow.contrib.metrics.streaming_auc",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.stack",
"tensorflow.nn.softmax",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.train.GradientDescentOptimizer",... |
Enigmatisms/Maevit | [
"f0520c8ba708aa6cb178e6e7bdb21fe7b5c0ca70"
] | [
"py/LECosineAnnealing.py"
] | [
"#-*-coding:utf-8-*-\n\"\"\"\n Linear Exponential Cosine Annealing Smooth Warm Restart Learning Rate for lr_scheduler.LambdaLR\n @author (Enigmatisms) HQY\n @date 2021.11.30\n @copyright Enigmatisms\n\"\"\"\n\nfrom math import cos\nimport math\n\n\nclass LECosineAnnealingSmoothRestart:\n \"\"\"\n ... | [
[
"numpy.array",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"torch.nn.Conv2d",
"torch.optim.lr_scheduler.LambdaLR",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
nishidayoshikatsu/Gasyori100knock | [
"f7fe35bca772eda2961a0790274c4934119b3fc2"
] | [
"Question_41_50/answers/answer_48.py"
] | [
"import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Read image\nimg = cv2.imread(\"imori.jpg\").astype(np.float32)\nH, W, C = img.shape\n\n# Otsu binary\n## Grayscale\nout = 0.2126 * img[..., 2] + 0.7152 * img[..., 1] + 0.0722 * img[..., 0]\nout = out.astype(np.uint8)\n\n## Determine threshold of ... | [
[
"numpy.pad",
"numpy.array",
"numpy.sum",
"numpy.mean",
"numpy.where"
]
] |
VHeusinkveld/neural-chessboard | [
"452054d974d00331871292992a1357a65529fb9d"
] | [
"slid.py"
] | [
"import utils, debug\nfrom config import *\n\nimport math\nimport cv2, numpy as np\nimport collections\nna = np.array\n\n\"\"\"\nNC_SLID_CLAHE = [[3, (2, 6), 5], # @1\n\t\t [3, (6, 2), 5], # @2\n\t\t\t\t [0, (0, 0), 0]] # EE\n\"\"\"\n\n\"\"\"\nNC_SLID_CLAHE = [[4, (2, 5), 5], # @1\n\t\t ... | [
[
"numpy.median",
"numpy.ones",
"numpy.reshape"
]
] |
r-beer/FINE | [
"a11078baff99a543437ab1646751e30df34ad5f3"
] | [
"FINE/subclasses/lopf.py"
] | [
"from FINE.transmission import Transmission, TransmissionModel\nfrom FINE import utils\nimport pyomo.environ as pyomo\nimport pandas as pd\n\n\nclass LinearOptimalPowerFlow(Transmission):\n \"\"\"\n A LinearOptimalPowerFlow component shows the behavior of a Transmission component but additionally models a\n ... | [
[
"pandas.Series"
]
] |
yijiaozhang/hypercompare | [
"13459caf53d9eebecbc2ad8196ee7a20a15c3b77"
] | [
"code/workflow/merge_results.py"
] | [
"\"\"\"\nThis script merges all the input tables\n\"\"\"\nimport sys\nimport pandas as pd\nimport hypercomparison.utils\n\nlogger = hypercomparison.utils.get_logger(__name__)\n\n\ninput_lists = sys.argv[1:-1]\nout_path = sys.argv[-1]\n\nlogger.info(\"Start to load files...\")\n\ndfs = []\nfor input_list in input_li... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
RashulChutani/ivy | [
"fd9e7c63c0f2bb7eb4c01681c90818efb2c12ca6"
] | [
"ivy/functional/backends/tensorflow/layers.py"
] | [
"\"\"\"Collection of TensorFlow network layers, wrapped to fit Ivy syntax and\nsignature.\"\"\"\n\n# global\nimport tensorflow as tf\n\nfrom tensorflow.python.types.core import Tensor\n\n\ndef conv1d(\n x: Tensor,\n filters: Tensor,\n strides: int,\n padding: str,\n data_format: str = \"NWC\",\n d... | [
[
"tensorflow.nn.conv3d",
"tensorflow.nn.conv2d",
"tensorflow.expand_dims",
"tensorflow.nn.conv1d",
"tensorflow.nn.conv3d_transpose",
"tensorflow.transpose",
"tensorflow.nn.depthwise_conv2d",
"tensorflow.nn.conv2d_transpose",
"tensorflow.nn.conv1d_transpose"
]
] |
paskett/advanceddeeplearning | [
"a11b1327b640183159f29cf08dbf6341b65cf290"
] | [
"INN_VAE/INN_autoencoder_example/functionalities/gpu.py"
] | [
"import torch\n\ndef get_device(dev_idx=0):\n \"\"\"\n Check if GPU is available and select GPU base on provided device index.\n\n :param dev_idx: index of the GPU device to use (if your PC has multiple GPU's). Default: 0\n :return: device variable used for further training on the GPU\n \"\"\"\n\n ... | [
[
"torch.cuda.set_device",
"torch.cuda.is_available"
]
] |
flover4/oci-designer-toolkit | [
"37b93648264022c4913ad8728f940b4d966d0bbd"
] | [
"visualiser/model/bom.py"
] | [
"\n# Copyright (c) 2020, 2021, Oracle and/or its affiliates.\n# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.\n\n\"\"\"Provide Module Description\n\"\"\"\n\nimport requests\nimport pandas as pd\n\n\npd.options.mode.chained_assignment = None # default='warn'\... | [
[
"pandas.DataFrame",
"pandas.set_option"
]
] |
trh0ly/Derivate | [
"d7aa46d95e4a0999b7d81c35eb987f9bab8f3419"
] | [
"part 2/sn_random_numbers.py"
] | [
"#\r\n# DX Package\r\n#\r\n# Frame -- Random Number Generation\r\n#\r\n# sn_random_numbers.py\r\n#\r\n# Python for Finance, 2nd ed.\r\n# (c) Dr. Yves J. Hilpisch\r\n#\r\nimport numpy as np\r\n\r\n\r\ndef sn_random_numbers(shape, antithetic=True, moment_matching=True,\r\n fixed_seed=False):\r\n ... | [
[
"numpy.concatenate",
"numpy.random.standard_normal",
"numpy.random.seed",
"numpy.mean",
"numpy.std"
]
] |
BookOps-CAT/babel | [
"47c8102bfbad8466185cd0e70501a931dd79ef29"
] | [
"babel/data/transactions_carts.py"
] | [
"# datastore transactions of CartsView\n\nfrom datetime import datetime, date\nimport logging\nimport os\nimport sys\n\nfrom pandas import read_sql\n# from sqlalchemy.sql.expression import between\n\n\nfrom data.datastore import (session_scope, Audn, Branch, Cart, Fund, Order,\n Lang, Lib... | [
[
"pandas.read_sql"
]
] |
Bodo-inc/numba | [
"4469f04e0f4916d2541e15b38d71d10268fca73f"
] | [
"numba/tests/test_withlifting.py"
] | [
"import copy\nimport warnings\nimport numpy as np\n\nimport numba\nfrom numba.core.transforms import find_setupwiths, with_lifting\nfrom numba.core.withcontexts import bypass_context, call_context, objmode_context\nfrom numba.core.bytecode import FunctionIdentity, ByteCode\nfrom numba.core.interpreter import Interp... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"numpy.ones",
"numpy.arange",
"numpy.int64",
"scipy.sparse.csr_matrix"
]
] |
napsterstiffler/faceoff | [
"af0c92e3803e74bfd5922ac980457728427d2605"
] | [
"experimental/ObjectPrediction/DeepPredict.py"
] | [
"import numpy as np\n# import argparse\nimport time\nimport cv2\nfrom imutils.video import VideoStream\n\n\n# load the input image from disk\n# image = cv2.imread('images/doggo.jpeg')\nvs = VideoStream(src=0).start()\n\n# load the class labels from disk\nrows = open('synset_words.txt').read().strip().split(\"\\n\")... | [
[
"numpy.argsort"
]
] |
jbhurat/GamestonkTerminal | [
"419c3691db220c467d2979b19ca308b3b800c0bd"
] | [
"gamestonk_terminal/options/tradier_model.py"
] | [
"\"\"\"Tradier options model\"\"\"\n__docformat__ = \"numpy\"\n\nimport requests\nimport pandas as pd\n\nfrom gamestonk_terminal import config_terminal as cfg\n\noption_columns = [\n \"symbol\",\n \"bid\",\n \"ask\",\n \"strike\",\n \"bidsize\",\n \"asksize\",\n \"volume\",\n \"open_interest... | [
[
"pandas.DataFrame"
]
] |
saarimrahman/UMAPs-true-loss | [
"d761cff16daadd02d7003a5fb5a5177666b5cd53"
] | [
"umap/my_utils.py"
] | [
"import numpy as np\nimport numba\nimport scipy.sparse\nfrom pykeops.torch import LazyTensor\nimport torch\nimport umap\nfrom sklearn.metrics import pairwise_distances\nfrom scipy.stats import pearsonr, spearmanr\n\n\n# Contains utility function, including for computing similarities and losses\n\n\ndef corr_pdist_s... | [
[
"numpy.random.normal",
"numpy.sin",
"numpy.ones_like",
"numpy.minimum",
"numpy.random.seed",
"scipy.stats.spearmanr",
"numpy.exp",
"scipy.stats.pearsonr",
"sklearn.metrics.pairwise_distances",
"numpy.random.uniform",
"torch.tensor",
"numpy.arange",
"numpy.cos",
... |
karasevb/legion | [
"f3f4e7d987768598b554ffca65d730f697956dc8"
] | [
"bindings/python/examples/partition_by_restriction.py"
] | [
"#!/usr/bin/env python\n\n# Copyright 2020 Stanford University\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.array_equal"
]
] |
MetaExp/backend | [
"9e37257ed40a1c90ffb7212d3f756a8da201e3bd"
] | [
"active_learning/evaluation.py"
] | [
"from active_learning.rating import *\nfrom active_learning.active_learner import *\nfrom active_learning.oracles import *\nfrom util.meta_path_loader_dispatcher import MetaPathLoaderDispatcher\n\nimport logging\nimport pandas as pd\nimport util.tensor_logging as tf_log\nimport embeddings.meta2vec\n\n# Set up loggi... | [
[
"pandas.DataFrame.from_records"
]
] |
jarokaz/ucaip-labs | [
"8db85d65a22ad3ffac8a25efea975207f6276049"
] | [
"src/model_training/model.py"
] | [
"# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.keras.layers.Input",
"tensorflow.expand_dims",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"tensorflow.keras.layers.experimental.preprocessing.CategoryEncoding",
"tensorflow.keras.layers.Concatenate"
]
] |
knaaptime/proplot | [
"b2376f0c477689b57e399105b67a8061aac62f7a"
] | [
"docs/axis.py"
] | [
"# -*- coding: utf-8 -*-\n# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.11.3\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n# %% [ra... | [
[
"numpy.sin",
"numpy.random.RandomState",
"numpy.tanh",
"numpy.arange",
"numpy.cos",
"numpy.linspace",
"numpy.datetime64"
]
] |
jirifilip/CBA | [
"59168ef6fb4c9e319475f9a7498446ba5ff306e1"
] | [
"pyarc/qcba/transforms/extend.py"
] | [
"import pandas\nimport numpy as np\nimport math\n\nfrom ..data_structures import QuantitativeDataFrame, Interval\n\nclass RuleExtender:\n \n def __init__(self, dataframe):\n \n if type(dataframe) != QuantitativeDataFrame:\n raise Exception(\n \"type of dataset must be panda... | [
[
"numpy.where"
]
] |
olgatsiouri1996/biomisc | [
"b4fdaf3dd49816b7ca9da1d200ab4443455ab784"
] | [
"fasta_manipulation/tab_to_singlefastas.py"
] | [
"# python3\nimport itertools\nimport argparse\nfrom Bio import SeqIO\nfrom Bio.Seq import Seq\nfrom Bio.SeqRecord import SeqRecord\nimport pandas as pd\n# input arguments\nap = argparse.ArgumentParser(description=\"convert each row of a tabular file with the fasta headers and sequences in each row in single-fasta f... | [
[
"pandas.read_csv"
]
] |
robbinc91/MeshSegNet | [
"b2ce6818c31170fa0cfb0951a4574a05613097b2"
] | [
"step2_get_list.py"
] | [
"import numpy as np\nimport os\nfrom sklearn.model_selection import KFold\nfrom sklearn.model_selection import train_test_split\nimport pandas as pd\n\nif __name__ == '__main__':\n\n data_path = './augmentation_vtk_data/'\n output_path = './'\n num_augmentations = 20\n train_size = 0.8\n with_flip = ... | [
[
"sklearn.model_selection.KFold",
"pandas.DataFrame",
"numpy.asarray",
"sklearn.model_selection.train_test_split"
]
] |
bopopescu/classic_diff_geom | [
"2b1d88becbc8cb30962e0995cc78e429e0f5589f"
] | [
"src/sage/plot/graphics.py"
] | [
"# -*- encoding: utf-8 -*-\nr\"\"\"\nGraphics objects\n\nThis file contains the definition of the classes :class:`Graphics` and\n:class:`GraphicsArray`. Usually, you don't create these classes directly\n(although you can do it), you would use :func:`plot` or\n:func:`graphics_array` instead.\n\nAUTHORS:\n\n- Jeroen... | [
[
"matplotlib.ticker.FixedFormatter",
"matplotlib.ticker.MaxNLocator",
"matplotlib.ticker.AutoMinorLocator",
"matplotlib.ticker.FixedLocator",
"matplotlib.ticker.LogLocator",
"matplotlib.ticker.OldScalarFormatter",
"matplotlib.transforms.offset_copy",
"matplotlib.ticker.LogFormatterM... |
luoshengyue/License-plate-recognition | [
"ea1a3e48bf7f4d77bcc32029f4808ae27494167e"
] | [
"debug.py"
] | [
"# -*- coding: utf-8 -*-\n__author__ = '樱花落舞'\nimport cv2\nimport numpy as np\n\n#用于中间环节对处理图像的输出\n\ndef img_show(filename):\n if filename.dtype == \"float32\":\n filename = filename.astype(np.uint8)\n cv2.imshow(\"img_show\", filename)\n cv2.waitKey(0)\n\n\ndef img_contours(oldimg, box):\n box = ... | [
[
"numpy.int0"
]
] |
sunggg/tvm | [
"636463d16c8f1713a3d93793b60d21dde9b6a6f7"
] | [
"python/tvm/relay/frontend/onnx.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.asarray",
"numpy.zeros",
"numpy.prod",
"numpy.random.randint",
"numpy.sqrt",
"numpy.iinfo",
"numpy.dtype"
]
] |
selflein/manifold-flow | [
"2cc91c7acf61c8b4df07a940f0311ee93c39f0c7"
] | [
"experiments/evaluation/mmd.py"
] | [
"import itertools\nimport numpy as np\n\n\ndef sq_maximum_mean_discrepancy(xs, ys, wxs=None, wys=None, scale=None, return_scale=False):\n \"\"\"\n Finite sample estimate of square maximum mean discrepancy. Uses a gaussian kernel.\n :param xs: first sample\n :param ys: second sample\n :param wxs: weig... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.asarray",
"numpy.median",
"numpy.sum",
"numpy.exp"
]
] |
Basvanstein/nasbench301 | [
"2984dec45c760d47762f50efe39b71e9d1ac22e0"
] | [
"nasbench301/surrogate_models/gnn/models/gincnn.py"
] | [
"import torch\nfrom torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool, GlobalAttention, Set2Set\n\nfrom nasbench301.surrogate_models.gnn.gnn_utils import NODE_PRIMITIVES\nfrom nasbench301.surrogate_models.gnn.models.conv import GNN_node_Virtualnode, GNN_node\n\n\nclass NodeEncoder(torch.n... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.nn.Embedding"
]
] |
anurag-gandhi/pandas-profiling | [
"2373f3a299264f7b312dbe4b92edc14d36e8140e"
] | [
"src/pandas_profiling/model/messages.py"
] | [
"\"\"\"Logic for alerting the user on possibly problematic patterns in the data (e.g. high number of zeros , constant\nvalues, high correlations).\"\"\"\nfrom enum import Enum, auto, unique\nfrom typing import List, Union\n\nimport numpy as np\n\nfrom pandas_profiling.config import config\nfrom pandas_profiling.mod... | [
[
"numpy.isnan"
]
] |
hsiehpinghan/ALBERT-TF2.0 | [
"1df5f735f7e9c4247644931f8de4412da72ccb79"
] | [
"input_pipeline.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.data.Dataset.list_files",
"tensorflow.data.TFRecordDataset",
"tensorflow.io.gfile.glob",
"tensorflow.io.FixedLenFeature",
"tensorflow.io.parse_single_example",
"tensorflow.data.Options",
"tensorflow.cast"
]
] |
lbdvriesGT/cardio | [
"da6c478739bd254ccc04ee0ba327fd1610d07a42",
"da6c478739bd254ccc04ee0ba327fd1610d07a42"
] | [
"cardio/dataset/dataset/models/tf/inception_v1.py",
"cardio/dataset/dataset/models/torch/base.py"
] | [
"\"\"\" Szegedy C. et al \"`Going Deeper with Convolutions\n<https://arxiv.org/abs/1409.4842>`_\"\n\"\"\"\nimport tensorflow.compat.v1 as tf\n\nfrom .inception_base import Inception\nfrom .layers import conv_block\n\n\n_DEFAULT_V1_ARCH = {\n 'b': {'filters': [\n [64, 96, 128, 16, 32, 32],\n [128, 1... | [
[
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.variable_scope"
],
[
"numpy.concatenate",
"torch.device",
"torch.nn.functional.sigmoid",
"torch.cuda.amp.autocast",
"torch.nn.functional.softplus",
"numpy.zeros",
"pandas.DataFrame",
"torch.autograd.profiler.profile",... |
victor-estrade/datawarehouse | [
"9ae342bf6f9c3622eb841c2ee770519b12cde1c3"
] | [
"datawarehouse/mnist.py"
] | [
"# -*- coding: utf-8 -*-\nimport sys\nimport os\nimport gzip\n\nimport pandas as pd\nimport numpy as np\n\nfrom .download import maybe_download\nfrom .download import get_data_dir\n\ndef _load_mnist_images(filename):\n # Read the inputs in Yann LeCun's binary format.\n with gzip.open(filename, 'rb') as f:\n ... | [
[
"numpy.concatenate",
"numpy.float32"
]
] |
deadphilosopher/Artificial-Intelligence-By-Example | [
"47bed1a88db2c9577c492f950069f58353375cfe",
"47bed1a88db2c9577c492f950069f58353375cfe"
] | [
"Chapter16/math.py",
"Chapter07/k-means_clustering_minibatch.py"
] | [
"import numpy as np\nimport statistics\n\ndata1 = [1, 2, 3, 4]\nM1=statistics.mean(data1)\nprint(\"Mean data1\",M1)\n\n\n\ndata2 = [1, 2, 3, 5]\nM2=statistics.mean(data2)\nprint(\"Mean data2\",M2)\n\n#var = mean(abs(x - x.mean())**2).\nprint(\"Variance 1\", np.var(data1))\nprint(\"Variance 2\", np.var(data2))\n\n\n... | [
[
"numpy.linalg.eigh",
"numpy.array",
"numpy.cov",
"numpy.var"
],
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplo... |
jhnnsrs/arbeider | [
"4c5637913331c998a262ae0deca516b236845200"
] | [
"elements/models.py"
] | [
"from django.contrib.auth import get_user_model\nfrom django.contrib.auth.models import User\nfrom django.core import serializers\nfrom django.db import models\n# Create your models here.\nfrom pandas import HDFStore\n\nfrom elements.managers import (DelayedRepresentationManager,\n Del... | [
[
"pandas.HDFStore"
]
] |
wang9702/bert_pytorch | [
"7b3d5c3287dbf4e98bb9f8b55ab6646ee2c6bb35"
] | [
"test_bert.py"
] | [
"import argparse\n\nfrom torch.utils.data import DataLoader\n\nfrom bert_pytorch.model import BERT\nfrom bert_pytorch.trainer import BERTTrainer\nfrom bert_pytorch.dataset import BERTDataset, WordVocab\n\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n\n parser.add_argument(\"-c\", \"--t... | [
[
"torch.utils.data.DataLoader"
]
] |
pryo/openNMT | [
"204609435639603022b1068bf915144e36b11f76"
] | [
"tools/vid_feature_extractor.py"
] | [
"import argparse\nimport os\n\nimport tqdm\nfrom multiprocessing import Manager\nimport numpy as np\nimport cv2\nimport torch\nimport torch.nn as nn\nfrom PIL import Image\nimport pretrainedmodels\nfrom pretrainedmodels.utils import TransformImage\n\n\nQ_FIN = \"finished\" # end-of-queue flag\n\n\ndef read_to_imgs... | [
[
"torch.device",
"torch.cat",
"torch.stack",
"torch.is_tensor",
"torch.no_grad",
"torch.multiprocessing.get_context",
"torch.cuda.is_available"
]
] |
neolixcn/nutonomy_pointpillars | [
"03f46f6de97c0c97d7bc98d7af3daee215d81a30",
"03f46f6de97c0c97d7bc98d7af3daee215d81a30"
] | [
"second/kittiviewer/viewer.py",
"second/pytorch/train_pruned_model.py"
] | [
"import io as sysio\nimport json\nimport os\nimport pickle\nimport sys\nimport time\nfrom functools import partial\nfrom pathlib import Path\nimport datetime\nimport fire\nimport matplotlib.pyplot as plt\nimport numba\nimport numpy as np\nimport OpenGL.GL as pygl\nimport pyqtgraph.opengl as gl\nimport skimage\nfrom... | [
[
"numpy.concatenate",
"numpy.logical_not",
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"numpy.sum",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__",
"numpy.ones",
"numpy.round",
"numpy.logical_and",
"matplotlib.backends.backend_qt5agg.NavigationToo... |
yolande-prog/pytorch-for-information-extraction | [
"caa3c4d9b3f3a0ddc329819c5638826810c717ec"
] | [
"code/modules/extraction/coordinates.py"
] | [
"import math\nimport os\n\nimport numpy as np\n\nimport utils\n\n\ndef denormalise_point(normalised_point, lengh):\n if math.floor(normalised_point * lengh) <= 0:\n return math.ceil(normalised_point * lengh)\n if math.ceil(normalised_point * lengh) >= lengh:\n return math.floor(normalised_point ... | [
[
"numpy.average"
]
] |
DVA-Project-Sp22/dva-project | [
"5c3aeb5306e78b3cdd96759a25c3f4096673e289"
] | [
"api/api-generateplaylist/lambda_function.py"
] | [
"import json\nimport awswrangler as wr\nimport numpy as np\n\n\ndef lambda_handler(event, context):\n # TODO implement\n\n def song_recommender(user_input, rec_count=10):\n t = tuple(user_input)\n query = f\"select distinct cluster_id from clusteredsongs where track_id IN {t}\"\n\n user_i... | [
[
"numpy.array",
"numpy.argpartition"
]
] |
NeilGirdhar/tikzify | [
"5de296c118188e532788234971de387f9fe1416e"
] | [
"tikzify/node_graph/constraints.py"
] | [
"from __future__ import annotations\n\nimport itertools as it\nfrom typing import Any, Iterable, List, Optional, Reversible, Sequence, Tuple, Union\n\nimport numpy as np\n\n__all__ = ['Constraints']\n\n\nclass Constraints:\n \"\"\"\n This class transforms a set of constraints into two-dimensional positions\n ... | [
[
"numpy.zeros",
"numpy.linalg.lstsq",
"numpy.hstack",
"numpy.around",
"numpy.signbit"
]
] |
dbstein/pybie2d | [
"1c2d6c05f6dbb4f1ab4476d3824f4dde20f90d58"
] | [
"pybie2d/kernels/high_level/stokes.py"
] | [
"\"\"\"\nThis submodule provides higher-level wrappers for the Stokes Kernel Functions\n\"\"\"\n\nimport numpy as np\nimport numexpr as ne\nimport numba\nimport warnings\n\nfrom ...backend_defaults import get_backend\nfrom ... import have_fmm\nif have_fmm:\n from ... import FMM\n\nfrom ..low_level.stokes import ... | [
[
"numpy.fill_diagonal",
"numpy.zeros"
]
] |
gngdb/aistplusplus_api | [
"26935370d8e719d2e2fe49bd6b46463efd22c573"
] | [
"aist_plusplus/utils.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Google AI Perception Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# U... | [
[
"numpy.frombuffer"
]
] |
yutiansut/xalpha | [
"d5f161cc3c7ef648c93f111a80dea988d593a167"
] | [
"xalpha/trade.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nmodule for trade class\n\"\"\"\nimport datetime as dt\n\nimport pandas as pd\nfrom pyecharts.charts import Line, Bar\nfrom pyecharts.options import AxisOpts, DataZoomOpts\n\nimport xalpha.remain as rm\nfrom xalpha.cons import convert_date, xirr, myround, yesterdayobj, line_opts\nfr... | [
[
"pandas.DataFrame",
"pandas.Timedelta"
]
] |
luyuliu/congestion_detector | [
"46f2bfb37d8c52a9803645625e5249b18b322cd6"
] | [
"scr/training.py"
] | [
"from keras.models import Sequential\nfrom keras.layers import Dense, Activation, normalization,core\nfrom keras import optimizers,callbacks\nimport numpy as np\nimport csv\n\n\ninput_shape = 211\nepochs = 500\ntimestamp = 1511398860\ndata_size = 9850\nbatch_size = 100\n\nclass LossHistory(callbacks.Callback):\n ... | [
[
"numpy.savetxt",
"numpy.vstack"
]
] |
katiezzzzz/PyBaMM | [
"0b0fc47125c0f078da99a58f497e0700eb25225a"
] | [
"pybamm/expression_tree/unary_operators.py"
] | [
"#\n# Unary operator classes and methods\n#\nimport numpy as np\nimport pybamm\nfrom scipy.sparse import issparse, csr_matrix\n\n\nclass UnaryOperator(pybamm.Symbol):\n \"\"\"A node in the expression tree representing a unary operator\n (e.g. '-', grad, div)\n\n Derived classes will specify the particular ... | [
[
"scipy.sparse.issparse",
"numpy.ceil",
"scipy.sparse.csr_matrix.sign",
"numpy.sign",
"numpy.abs",
"numpy.outer",
"scipy.sparse.csr_matrix",
"numpy.floor"
]
] |
synoptic/MetPy | [
"79abf129fe3c7c9df1d17684cbd36672b7628cf4"
] | [
"tests/io/test_metar.py"
] | [
"# Copyright (c) 2008,2015,2016,2017,2018,2019 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Test various METARs.\"\"\"\nfrom datetime import datetime\n\nimport numpy as np\nfrom numpy.testing import assert_almost_equal\nimport pytest\n... | [
[
"numpy.testing.assert_almost_equal"
]
] |
lirnish/US-Salary-Prediction | [
"a3a90016a0f0dd15578a70546ef42144229936e6"
] | [
"src/compare_models.py"
] | [
"# author: Andy Yang\n# date: 2021-11-27\n\n\"\"\"This script imports preprocessed test data and fitted Ridge and RandomForestRegressor models. \nIt then evaluates them on the test set and outputs evaluation metrics to the output directory.\n\nUsage: fit_model.py --source_data=<filepath> --output_dir=<filepath>\n\n... | [
[
"sklearn.metrics.mean_squared_error",
"pandas.merge",
"pandas.DataFrame.sparse.from_spmatrix",
"pandas.DataFrame",
"sklearn.metrics.r2_score",
"pandas.read_csv"
]
] |
CREVIOS/YHSA-Comp-18 | [
"e0ba41d596c820730eead396364df5854c4774c8",
"e0ba41d596c820730eead396364df5854c4774c8"
] | [
"sentence_similarity_graph/graph_1.0_adv_sen_sim.py",
"sentence_similarity_graph/graph_1.0_norm_sen_sim.py"
] | [
"#from nltk.tokenize import sent_tokenize,word_tokenize\r\nfrom __future__ import division\r\nimport nltk\r\nfrom nltk.tokenize import sent_tokenize,word_tokenize\r\nfrom heapq import nlargest\r\n\r\nfrom nltk.corpus import wordnet as wn\r\nfrom nltk.corpus import brown\r\nimport math\r\nimport numpy as np\r\nimpor... | [
[
"numpy.dot",
"numpy.linalg.norm"
],
[
"numpy.dot",
"numpy.linalg.norm"
]
] |
sean-bailey/Real-Time-Voice-Cloning | [
"c8f22ee1251d27d51f7d668100b6822e36a7d519"
] | [
"rtvc/synthesizer/inference.py"
] | [
"import torch\nfrom rtvc.synthesizer import audio\nfrom rtvc.synthesizer.hparams import hparams\nfrom rtvc.synthesizer.models.tacotron import Tacotron\nfrom rtvc.synthesizer.utils.symbols import symbols\nfrom rtvc.synthesizer.utils.text import text_to_sequence\nfrom rtvc.vocoder.display import simple_table\nfrom pa... | [
[
"numpy.max",
"torch.device",
"torch.cuda.is_available",
"torch.tensor",
"numpy.stack",
"numpy.abs"
]
] |
crazyavi/Hive | [
"d24e2eec21b2c4bc96c0e008510155827398ee32"
] | [
"Example3_EvolveAPainting.py"
] | [
"#!/usr/bin/env python\n\n# ---- MODULE DOCSTRING\n\n__doc__ = \"\"\"\n\n(C) Hive, Romain Wuilbercq, 2017\n _\n /_/_ .'''.\n =O(_)))) ...' `.\n \\_\\ `. .'''X\n `..'\n.---. .---..-./`) ,---. ,---. .-''-.\n| | |_ _|\\ .-.')| / | | .'_ _ \\\n| |... | [
[
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.collections.PathCollection"
]
] |
kajal5888/syncopy | [
"f7d49808a09ff65eec64cda1cfb4c87a012e0c2b"
] | [
"syncopy/specest/_norm_spec.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Helper routines to normalize Fourier spectra\n#\n\nimport numpy as np\n\n\ndef _norm_spec(ftr, nSamples, fs):\n\n \"\"\"\n Normalizes the complex Fourier transform to\n power spectral density units.\n \"\"\"\n\n # frequency bins\n delta_f = fs / nSamples\n ftr *= ... | [
[
"numpy.sqrt"
]
] |
SimonCSelg/yt-sselg | [
"3d5ab92540ae33d8ed0b9694f0ecf82166ba0aea"
] | [
"yt/data_objects/data_containers.py"
] | [
"\"\"\"\nVarious non-grid data containers.\n\n\n\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2013, yt Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with th... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.ones_like",
"numpy.empty",
"numpy.zeros",
"pandas.DataFrame",
"numpy.min",
"numpy.log10",
"numpy.linspace",
"numpy.unique"
]
] |
MauroLuzzatto/algorithmic-explanations | [
"4a362ae9576cc68ecf4b61dd6bad2105ff62bf57"
] | [
"src/model/ModelClass.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Nov 24 21:29:13 2020\n\n@author: mauro\n\"\"\"\n\n\nimport datetime\nimport json\nimport os\nimport pickle\nimport random\n\nimport matplotlib.pyplot as plt # type: ignore\nimport pandas as pd # type: ignore\nimport sklearn # type: ignore\nfrom LoggerClass import ... | [
[
"sklearn.datasets.load_diabetes",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.xlabel",
"pandas.DataFrame",
"sklearn.base.is_regressor",
"sklearn.model_selection.RandomizedSearchCV",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",... |
tkys/text-detection-ctpn | [
"b3f20a4255a871512e9bd59a97bb761f05d9be39"
] | [
"utils/text_connector/text_proposal_connector_oriented.py"
] | [
"# coding:utf-8\nimport numpy as np\n\nfrom utils.text_connector.text_proposal_graph_builder import TextProposalGraphBuilder\n\n\nclass TextProposalConnector:\n \"\"\"\n Connect text proposals into text lines\n \"\"\"\n\n def __init__(self):\n self.graph_builder = TextProposalGraphBuilder()\n... | [
[
"numpy.max",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.fabs",
"numpy.polyfit",
"numpy.sqrt"
]
] |
assistent-cat/catotron-cpu | [
"a247b4197b14b7e173018c292fa07114792a4422"
] | [
"waveglow/denoiser.py"
] | [
"#import sys\n#sys.path.append('tacotron2')\n\nimport torch\n#from waveglow.tacotron2.layers import STFT\nfrom layers import STFT\n\n\nclass Denoiser(torch.nn.Module):\n \"\"\" Removes model bias from audio produced with waveglow \"\"\"\n\n def __init__(self, waveglow, filter_length=1024, n_overlap=4,\n ... | [
[
"torch.zeros",
"torch.no_grad",
"torch.randn",
"torch.clamp"
]
] |
tchayintr/bilstm-crf-topk-wordseg | [
"eeaa8efa50643d610203ea87e51221c70f0ba4c7"
] | [
"src/models/util.py"
] | [
"from enum import Enum, auto\nimport numpy as np\nimport sys\nimport torch\nimport torch.nn as nn\n\nfrom models.common import Embedding, GRU, RNNTanh, LSTM\n\n\nclass ModelUsage(Enum):\n NONE = auto()\n ADD = auto()\n CONCAT = auto()\n INIT = auto()\n\n def get_instance(key):\n if key.lower()... | [
[
"torch.zeros",
"numpy.random.normal",
"torch.cat",
"torch.stack",
"numpy.zeros",
"torch.nn.Parameter",
"torch.tensor",
"torch.nn.Embedding",
"numpy.empty_like"
]
] |
dlitvak/sdcnd-term1-proj3-behavioral-cloning | [
"b57c0a8f18af4ac484cf95d1e73d9e2c889ebfaa"
] | [
"utils.py"
] | [
"import csv\nimport os\nfrom PIL import Image\nimport numpy as np\nimport matplotlib.image as mpimg\n\n\ndef read_data(dir=\"data\", csv_file=\"driving_log.csv\", field_names=(\"center\",\"left\",\"right\",\"steering\")):\n \"\"\"Read data from csv_file per field_names columns. Obtain the image size.\"\"\"\n ... | [
[
"numpy.array",
"numpy.asarray"
]
] |
kishwarshafin/signalAlign | [
"c9b7b9232ef6fb76aa427670981c969b887f4860",
"c9b7b9232ef6fb76aa427670981c969b887f4860"
] | [
"src/signalalign/visualization/compare_trained_models.py",
"src/signalalign/fast5.py"
] | [
"#!/usr/bin/env python\n\"\"\"Compare multiple hdp and ont trained models\"\"\"\n########################################################################\n# File: compare_trained_models.py\n# executable: compare_trained_models.py\n#\n# Author: Andrew Bailey\n# History: 01/24/18 Created\n###########################... | [
[
"matplotlib.use",
"scipy.stats.norm.pdf",
"numpy.array_equal",
"numpy.asarray",
"matplotlib.ticker.AutoMinorLocator",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.savefig",
"scipy.stats.entropy",
"matplotlib.ticker.AutoLocator",
"numpy.exp",
"numpy.mean",
"matplotlib... |
bispmri/Ultra-low-field-MRI-scanner | [
"a3b5b09d7301bde2f6c9b74216f4f00169c3cc00"
] | [
"Deep Learning based EMI Elimination Codes and Data/EMIPrediction_test.py"
] | [
"import numpy as np\nimport pandas as pd\nimport datetime\nimport time\nfrom model import Net1\nimport torch.optim as optim\nfrom scipy import io\nimport argparse\nimport os # nn.BatchNorm2d(2,affine=False),\nimport torch\nfrom torch import nn\nfrom torch.utils.data import Dataset, DataLoader\nim... | [
[
"numpy.empty",
"torch.nn.MSELoss",
"torch.cuda.synchronize",
"torch.no_grad",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
dmsquare/CalendarGNN | [
"dc071b2a901d25909d8ef7bcf467dda58fb22c3c"
] | [
"data_manager.py"
] | [
"\"\"\"\nManage dataset\n\"\"\"\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\n\n\ndef prepare_dataset(dataset, lb, _top=0):\n assert lb in {'gender', 'age', 'income'}\n ''' Load dataset file(s) '''\n uids, uid2u = dataset['uids'], dataset['uid2u']\n # sids, sid2s... | [
[
"numpy.sum",
"numpy.random.permutation",
"torch.tensor",
"torch.utils.data.DataLoader"
]
] |
colleenjg/OpenScope_CA_Analysis | [
"a429f212068040729614d29d90aaac3d8d90e813"
] | [
"plot_fcts/glm_plots.py"
] | [
"\"\"\"\nglm_plots.py\n\nThis script contains functions to plot results of GLM analyses (glm.py) from \ndictionaries.\n\nAuthors: Colleen Gillon\n\nDate: October, 2019\n\nNote: this code uses python 3.7.\n\n\"\"\"\n\nimport copy\nimport logging\nimport os\nimport warnings\n\nfrom matplotlib import pyplot as plt\nim... | [
[
"numpy.asarray",
"matplotlib.pyplot.close"
]
] |
PEM-Humboldt/caracterizacion_paisajes_sonoros_ppii | [
"2b99a69faeb5cc094e582a2b6929ef18bd4a3c4e"
] | [
"aguas_bajas/preprocessing/audio_to_spectro_image.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nLoad data from pickle files and save images of spectrogram\nThe pipeline includes:\n - A low Butterworth pass filter\n - Spectrogram computation\n - A gaussian smoothing of the spectrogram\n - Nomalization of the spectrogram accoring to vmin, vma... | [
[
"numpy.concatenate",
"numpy.flip"
]
] |
Sowul/fc | [
"bc4f42a555a3db78fb733761bf9443108e88f32a"
] | [
"tests/test_ga.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom collections import Counter\nfrom copy import deepcopy\nfrom filecmp import cmp\nfrom operator import attrgetter\nfrom os import remove\n\nimport numpy as np\nimport pytest\nfrom sklearn.datasets import load_iris\nfrom sklearn.ensemble import RandomForestClassi... | [
[
"numpy.random.random_integers",
"numpy.asarray",
"numpy.zeros",
"numpy.reshape",
"numpy.random.seed",
"sklearn.ensemble.RandomForestClassifier",
"numpy.array_equal",
"numpy.logical_and",
"numpy.std",
"sklearn.datasets.load_iris"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.