repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ryokbys/nap | [
"ddd0b5a5a956f7c335a22adb4f8e00f1d38a7804"
] | [
"nappy/vasp/make_random_deform_POSCARs.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nMake randomly deformed POSCAR files from the non-deformed POSCAR file.\n\nUsage:\n make_random_deform_POSCARs.py [options] POSCAR\n\nOptions:\n -h, --help Show this help message and exit.\n -n NUM Number of output POSCARs to be created. [default: 100]\n --deform-range=DEFOR... | [
[
"numpy.sin",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.zeros",
"numpy.cos",
"numpy.cross"
]
] |
ngodber/discretize | [
"2329c9e9552b5c05f40ebf62f0bb207267bd2f92"
] | [
"tests/tree/test_tree_utils.py"
] | [
"import numpy as np\nimport unittest\nfrom discretize.utils import mesh_builder_xyz, refine_tree_xyz\n\nTOL = 1e-8\nnp.random.seed(12)\n\n\nclass TestRefineOcTree(unittest.TestCase):\n def test_radial(self):\n dx = 0.25\n rad = 10\n mesh = mesh_builder_xyz(\n np.c_[0.01, 0.01, 0.0... | [
[
"numpy.ceil",
"numpy.random.seed",
"numpy.sum",
"numpy.testing.assert_array_equal",
"numpy.arange",
"numpy.ravel",
"numpy.abs",
"numpy.meshgrid",
"numpy.unique"
]
] |
tzcskys/Attention-Gated-Networks | [
"186cc2d054acc2a1938acc3450f0efaa7a167382"
] | [
"models/layers/nonlocal_layer.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom models.networks_other import init_weights\n\n\nclass _NonLocalBlockND(nn.Module):\n def __init__(self, in_channels, inter_channels=None, dimension=3, mode='embedded_gaussian',\n sub_sample_factor=4, bn_layer=True):\n ... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.nn.init.constant",
"torch.nn.Conv2d",
"torch.nn.functional.softmax",
"torch.nn.functional.relu",
"torch.matmul"
]
] |
nalbarr/kubeflow-tutorial | [
"80ad975b60517f2d25f38ef455373c43a0a788d3"
] | [
"4_WORKING_DIRX/web-ui/hello_tf.py"
] | [
"# NAA. \n# - below uses Tensorflow 2.0 in backward compatibility mode\n\n#import tensorflow.compat.v1 as tf\n#from tensorflow.examples.tutorials.mnist import input_data\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport tensorflow as tf\n\n#sess = tf.Session()\n#print(ses... | [
[
"tensorflow.keras.layers.Flatten",
"tensorflow.constant",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense"
]
] |
christophertbrown/bioscripts | [
"c8c657b7895681b539bdfd8c78f786f9b99ab230"
] | [
"ctbBio/genome_coverage.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nscript for calculating genome coverage\n\"\"\"\n\nimport os\nimport sys\nimport argparse\nimport pandas as pd\nfrom ctbBio.fasta import iterate_fasta as parse_fasta\n\ndef parse_cov(cov_table, scaffold2genome):\n \"\"\"\n calculate genome coverage from scaffold coverage tabl... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
scottstanie/RAiDER | [
"7cf0299f045b13b00b416f31bf3f8d9f1bd825b2",
"7cf0299f045b13b00b416f31bf3f8d9f1bd825b2"
] | [
"tools/RAiDER/prepFromAria.py",
"test/test_checkArgs.py"
] | [
"#!/usr/bin/env python3\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n#\n# Author: Jeremy Maurer\n# Copyright 2020, by the California Institute of Technology. ALL RIGHTS\n# RESERVED. United States Government Sponsorship acknowledged.\n#\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | [
[
"numpy.meshgrid",
"numpy.isnan",
"numpy.arange",
"numpy.shape"
],
[
"numpy.allclose",
"pandas.read_csv"
]
] |
rtpsw/ibis | [
"14b9baf3e1021e8698e7f0ae3c0ae5747543431c"
] | [
"ibis/backends/pandas/execution/arrays.py"
] | [
"import operator\nfrom typing import Any, Collection\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.core.groupby import SeriesGroupBy\n\nimport ibis.expr.operations as ops\nfrom ibis.backends.pandas.dispatch import execute_node\n\n\n@execute_node.register(ops.ArrayColumn, list)\ndef execute_array_column(op... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.tile",
"pandas.concat"
]
] |
dustinvanstee/pytorch-retinanet | [
"d55564fa5aa490d32b659772865bcecf8e1d4c6d"
] | [
"coco_eval.py"
] | [
"from __future__ import print_function\n\nfrom pycocotools.coco import COCO\nfrom pycocotools.cocoeval import COCOeval\n\nimport numpy as np\nimport json\nimport os\n\nimport torch\n\ndef evaluate_coco(dataset, model, threshold=0.05, num_images=5000):\n \n model.eval()\n if(len(dataset) < num_images) :\n ... | [
[
"torch.no_grad"
]
] |
MahmoudMirMohammadRezaei/newsvendor | [
"3470eedc27c72c17d986a9e7e09d764d73446130"
] | [
"data/generator/uniform/nw-simulation-1-class.py"
] | [
"import scipy.io as sio\nimport numpy as np\nimport os\n\nimport sys\nimport h5py\nimport shutil\nimport tempfile\n\nimport sklearn\nimport sklearn.datasets\nimport sklearn.linear_model\n\nimport scipy.stats as stso\nnp.random.seed(seed=4)\n\nimport sys\na = int(sys.argv[0].split('-')[2])\n\n\nif a == 1:\n clust... | [
[
"numpy.random.seed",
"scipy.io.savemat",
"numpy.identity",
"numpy.random.randint",
"sklearn.cross_validation.train_test_split"
]
] |
takafreak/tensorflow | [
"b85cb440e257a367fb70f8321ddaa669d1bd9fae"
] | [
"tensorflow/python/autograph/utils/ag_logging.py"
] | [
"# Copyright 2017 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.python.platform.tf_logging.info",
"tensorflow.python.platform.tf_logging.log_first_n",
"tensorflow.python.platform.tf_logging.error",
"tensorflow.python.util.tf_export.tf_export",
"tensorflow.python.platform.tf_logging.warn"
]
] |
jbaviation/dfs_golf | [
"0c59962441f4f2db99a1534361170e6b8378e06b"
] | [
"pga_data/scrape.py"
] | [
"import pandas as pd\nimport numpy as np\nimport datetime as dt\nimport pga_data.mapping as mapping\n\nclass stat:\n def __init__(self, stat='', from_id=False, season=dt.datetime.now().year, tournament=None, just_tournament=False):\n \"\"\"This class is setup to provide a means for someone to request a pa... | [
[
"pandas.read_html"
]
] |
szmybs/GOES-R-2017-HurricaneExtraction | [
"2bacc7e035183d89448835e30947f639cff2776c"
] | [
"scale.py"
] | [
"import numpy as np\nimport os\nfrom hurricane_generator import HurricaneGenerator\nfrom extract import HurricaneExtraction\n\nclass FixedScale(object):\n def __init__(self):\n pass\n \n @classmethod\n def goes_conv2d(self, x, kernel_size):\n if (x.shape[0] != x.shape[1]) or x.shape[0] % k... | [
[
"numpy.sum",
"numpy.save",
"numpy.asarray",
"numpy.zeros"
]
] |
hvhue/pymor | [
"0815d74514fa5c4e0ad6f379f29abdd7d067cedd",
"0815d74514fa5c4e0ad6f379f29abdd7d067cedd"
] | [
"src/pymor/reductors/residual.py",
"src/pymor/algorithms/eigs.py"
] | [
"# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n\nimport numpy as np\n\nfrom pymor.algorithms.image import estimate_image_hierarchical\nfro... | [
[
"numpy.nan_to_num"
],
[
"numpy.pad",
"numpy.count_nonzero",
"numpy.zeros",
"scipy.linalg.eig",
"numpy.argsort",
"numpy.abs",
"numpy.all"
]
] |
siej88/FuzzyACO | [
"989a58049c8417cd023cfc312fb99d2649333ca7"
] | [
"FuzzyMachine.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nUNIVERSIDAD DE CONCEPCION\r\nDepartamento de Ingenieria Informatica y\r\nCiencias de la Computacion\r\n\r\nMemoria de Titulo Ingenieria Civil Informatica\r\nDETECCION DE BORDES EN IMAGENES DGGE USANDO UN\r\nSISTEMA HIBRIDO ACO CON LOGICA DIFUSA\r\n\r\nAutor: Sebastian Ignacio E... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.copy",
"numpy.where"
]
] |
ftshijt/Muskits | [
"f85ce2a0b35881c2f9d9072217a54121a25b935d"
] | [
"muskit/fileio/utils.py"
] | [
"import miditoolkit\nimport numpy as np\n\n\ndef get_tick_to_time_mapping(ticks_per_beat, tempo_changes, max_tick=np.int32(1e6)):\n \"\"\"\n Get mapping from ticks to seconds with tempo information\n \"\"\"\n tick_to_time = np.zeros(max_tick + 1)\n num_tempi = len(tempo_changes)\n\n fianl_tick = m... | [
[
"numpy.searchsorted",
"numpy.int32",
"numpy.arange",
"numpy.zeros"
]
] |
gicheonkang/DAN-VisDial | [
"a40422367f349b185c9f3abf5e99c7504eebdc81"
] | [
"encoders/modules.py"
] | [
"\"\"\"\nDual Attention Networks for Visual Reference Resolution in Visual Dialog\nGi-Cheon Kang, Jaeseo Lim, Byoung-Tak Zhang\nhttps://arxiv.org/abs/1902.09368\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torch.nn.utils.weight_norm import ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.functional.softmax"
]
] |
Mo-Saif/sktime | [
"63e7839e80ca6d5fe5fc4f33389ec3bcacd8aa59"
] | [
"sktime/classifiers/compose/tests/test_TimeSeriesForestClassifier.py"
] | [
"from sktime.classifiers.compose.ensemble import TimeSeriesForestClassifier\nfrom sktime.utils.testing import generate_df_from_array\nimport pandas as pd\nimport numpy as np\nfrom sktime.transformers.compose import RowwiseTransformer\nfrom sktime.datasets import load_gunpoint\nfrom sktime.pipeline import FeatureUni... | [
[
"numpy.random.normal",
"numpy.array_equal",
"sklearn.preprocessing.FunctionTransformer",
"numpy.sum",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.arange",
"sklearn.tree.DecisionTreeClassifier"
]
] |
kaist-dmlab/COVID-EENet | [
"ee18e61027278d3386b22a2efaf1c749aaf8ce20"
] | [
"models/TCN/TCN/copy_memory/.ipynb_checkpoints/copymem_test-checkpoint.py"
] | [
"import argparse\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd import Variable\nimport numpy as np\nimport sys\nsys.path.append(\"../../\")\nfrom TCN.copy_memory.utils import data_generator\nfrom TCN.copy_memory.model import TCN\nimport time\n\n\nparser = argparse.ArgumentPa... | [
[
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss"
]
] |
markvdw/RobustGP | [
"cfab7a9e7f56755bc7a6241f13a6f6ac29562107"
] | [
"robustgp/init_methods/rls.py"
] | [
"import numpy as np\nimport scipy\nfrom typing import Callable, Optional\nfrom .methods import InducingPointInitializer\n\n\nclass RLS(InducingPointInitializer):\n \"\"\"\n Implements a modified version of the \"fixed size\" variant of the (approximate)\n RLS algorithm given in Musco and Musco 2017\n @i... | [
[
"numpy.square",
"numpy.append",
"numpy.clip",
"numpy.ones_like",
"numpy.random.choice",
"numpy.log",
"numpy.sum",
"numpy.where",
"numpy.arange",
"numpy.sqrt",
"numpy.linalg.cholesky",
"scipy.linalg.solve_triangular",
"numpy.diag",
"numpy.maximum"
]
] |
afterloe/opencv-practice | [
"83d76132d004ebbc96d99d34a0fd3fc37a044f9f"
] | [
"tf_aip_workshops/3-section/img_to_dataset.py"
] | [
"#!/usr/bin/env python3\n# -*- coding=utf-8 -*-\n\nimport tensorflow as tf\nfrom nets.nasnet import nasnet\nfrom preprocessing import preprocessing_factory\nfrom imutils.paths import list_images\nimport os\nimport logging\n\nslim = tf.contrib.slim\n\n\"\"\"\n处理图像数据集\n\"\"\"\n\nnum_workers = 8 # 定义并行处理数据的线程数量\nimag... | [
[
"tensorflow.read_file",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.image.decode_jpeg"
]
] |
rhugonnet/scikit-gstat | [
"a142ca13aa3b048c46613d1247396c80c32a8145"
] | [
"skgstat/tests/test_variogram.py"
] | [
"import unittest\nimport os\nimport pickle\n\nimport numpy as np\nimport pandas as pd\nfrom numpy.testing import assert_array_almost_equal\nimport matplotlib.pyplot as plt\n\ntry:\n import plotly.graph_objects as go\n PLOTLY_FOUND = True\nexcept ImportError:\n print('No plotly installed. Skip plot tests')\... | [
[
"numpy.max",
"numpy.random.normal",
"numpy.array",
"numpy.isnan",
"numpy.asarray",
"numpy.random.seed",
"numpy.random.gamma",
"numpy.random.sample",
"matplotlib.pyplot.subplots",
"numpy.testing.assert_array_almost_equal",
"numpy.arange",
"numpy.sqrt",
"numpy.lin... |
NeonJarbas/OVOS-workshop | [
"f309a4ae30cebf5376e92af2b59f65e49187bf8e"
] | [
"ovos_workshop/frameworks/canvas/opencv_backend.py"
] | [
"from ovos_utils.messagebus import Message\nfrom ovos_workshop.frameworks.canvas.base import AbstractCanvas\nimport imutils\nimport cv2\nimport numpy as np\n\n\n# TODO move to opm\nclass OpenCVService(AbstractCanvas):\n \"\"\"\n Display backend for opencv package.\n \"\"\"\n def __init__(self, bus, ... | [
[
"numpy.zeros"
]
] |
fvillena/referral_classifier | [
"57a7d63f91a95a4a1301f9a25b2eee22fd6c870c"
] | [
"src/models/ges_classifier.py"
] | [
"import sklearn.linear_model\nimport sklearn.svm\nimport sklearn.ensemble\nimport sklearn.neural_network\nimport sklearn.model_selection\nimport numpy as np\nimport json\nimport joblib\n\nmodels = [\n (\n sklearn.linear_model.LogisticRegression(),\n {\n \"C\":np.logspace(-5,5,11),\n ... | [
[
"numpy.concatenate",
"numpy.savetxt",
"numpy.asarray",
"numpy.random.seed",
"numpy.load",
"numpy.column_stack",
"numpy.logspace"
]
] |
chunbo777/letr-sol-koFISH | [
"293916aec4d77fd5f5158bb5957701cb61dab815"
] | [
"transfer.py"
] | [
"from tqdm import tqdm\nimport torch\nimport sys\nsys.path.insert(0, \"/home/tf-dev-01/workspace_sol/style-transfer/NLP_text-style-transfer_yc/\")\nfrom bert_pretrained import bert_tokenizer\nfrom bert_pretrained import get_bert_word_embedding\nfrom model import Encoder, Generator\nfrom options import args\n\n\ndef... | [
[
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.load"
]
] |
michaelcolman/Sub_cellular_heterogeneity_TOOLKIT | [
"24c90150429a39159e3ebed654d7ef43260a5aff"
] | [
"Het Toolkit/HetKit_BETA_June_2020/lib/Config_Functions.py"
] | [
"import sys\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtWidgets import *\nimport webbrowser\nfrom PIL import Image\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.figure import Figure\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas\nfr... | [
[
"numpy.asarray"
]
] |
dtsukiyama/SageMaker | [
"962c5ce4e060b59e0042bee2eaac87cd4c18425c"
] | [
"notebooks/custom_estimator.py"
] | [
"\nimport numpy as np\nimport os\nimport tensorflow as tf\nfrom tensorflow.python.estimator.export.export import build_raw_serving_input_receiver_fn\nfrom tensorflow.python.estimator.export.export_output import PredictOutput\n\n\nINPUT_TENSOR_NAME = \"inputs\"\nSIGNATURE_NAME = \"serving_default\"\nLEARNING_RATE = ... | [
[
"numpy.array",
"tensorflow.estimator.EstimatorSpec",
"tensorflow.argmax",
"tensorflow.keras.layers.Dense",
"tensorflow.estimator.export.ServingInputReceiver",
"tensorflow.python.estimator.export.export_output.PredictOutput",
"tensorflow.metrics.accuracy",
"tensorflow.placeholder",
... |
dham/randomgen | [
"27bd211682775964e6ef87f7d3191a24fe8a88dc"
] | [
"benchmark.py"
] | [
"import os\nimport struct\nimport timeit\n\nimport numpy as np\nimport pandas as pd\nfrom numpy.random import RandomState\n\nrs = RandomState()\n\nSETUP = '''\nimport numpy as np\nif '{brng}' == 'numpy':\n import numpy.random\n rg = numpy.random.RandomState()\nelse:\n from randomgen import RandomGenerator,... | [
[
"numpy.iinfo",
"pandas.Series",
"numpy.random.RandomState"
]
] |
Alex05101997/morpheus | [
"9215e6f5ca498f1cdace6faaef41bc646225cf68"
] | [
"svm.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 24 00:06:11 2019\n\n@author: Alex\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.svm import SVC\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import classification_report, confusion_matrix\n\ndf = pd.read_excel(\"fe... | [
[
"sklearn.metrics.confusion_matrix",
"pandas.read_excel",
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"sklearn.model_selection.train_test_split"
]
] |
steinermg/ion-functions | [
"cea532ad9af51e86768572c8deb48547d99567c5"
] | [
"ion_functions/data/test/test_met_functions.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n@package ion_functions.test.met_functions\n@file ion_functions/test/met_functions.py\n@author Russell Desiderio, Chris Wingard\n@brief Unit tests for met_functions module\n\"\"\"\n\nfrom nose.plugins.attrib import attr\nfrom ion_functions.test.base_test import BaseUnitTestCase\n\nimp... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.isnan",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.copy",
"numpy.ones",
"numpy.tile",
"numpy.testing.assert_array_almost_equal",
"numpy.sqrt",
"numpy.hstack"
]
] |
PanteraCapital/catalyst | [
"90d9e4e2def79b49c32607ce7da349598a117021"
] | [
"catalyst/__main__.py"
] | [
"import errno\nimport os\nfrom functools import wraps\nimport re\n\nimport click\nimport sys\nimport logbook\nimport pandas as pd\nfrom catalyst.marketplace.marketplace import Marketplace\nfrom six import text_type\n\nfrom catalyst.data import bundles as bundles_module\nfrom catalyst.exchange.exchange_bundle import... | [
[
"pandas.Timestamp.utcnow"
]
] |
piyushg9794/lux | [
"f5be470f5a4837db2746c950bebe2694665c25dc"
] | [
"tests/test_compiler.py"
] | [
"# Copyright 2019-2020 The Lux 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# Unless required by applicabl... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
AlexGabourie/thermo | [
"6df7a1b119d09c76f37e86dc2935f12931a5d71b"
] | [
"thermo/lammps/calc.py"
] | [
"import numpy as np\nimport os\nfrom scipy import integrate\nfrom math import floor\nimport scipy.io as sio\nfrom thermo.math.correlate import autocorr\n\n__author__ = \"Alexander Gabourie\"\n__email__ = \"gabourie@stanford.edu\"\n\n\ndef __metal_to_SI(vol, T):\n \"\"\"\n Converts LAMMPS metal units to SI uni... | [
[
"numpy.zeros",
"scipy.io.loadmat",
"scipy.integrate.cumtrapz",
"scipy.io.savemat",
"numpy.linspace",
"numpy.squeeze"
]
] |
prosello/rllab | [
"8677356874d41eb9354785500b554eaf635ece2e"
] | [
"rllab/spaces/product.py"
] | [
"from rllab.spaces.base import Space\nimport numpy as np\nfrom rllab.misc import ext\n\n\nclass Product(Space):\n\n def __init__(self, *components):\n if isinstance(components[0], (list, tuple)):\n assert len(components) == 1\n components = components[0]\n self._components = t... | [
[
"numpy.concatenate",
"numpy.core.numerictypes.find_common_type",
"numpy.sum",
"numpy.cumsum"
]
] |
Pratik325/seaborn | [
"f123d9b9f46caea4942f392e8f8d1805c121fe01"
] | [
"seaborn/tests/test_palettes.py"
] | [
"import colorsys\nimport numpy as np\nimport matplotlib as mpl\n\nimport pytest\nimport nose.tools as nt\nimport numpy.testing as npt\n\nfrom .. import palettes, utils, rcmod\nfrom ..external import husl\nfrom ..colors import xkcd_rgb, crayons\n\n\nclass TestColorPalettes(object):\n\n def test_current_palette(se... | [
[
"numpy.array",
"matplotlib.cm.get_cmap",
"numpy.testing.assert_array_equal",
"matplotlib.colors.rgb2hex",
"matplotlib.colors.colorConverter.to_rgb",
"numpy.testing.assert_array_almost_equal",
"numpy.allclose",
"matplotlib.colors.to_rgb",
"numpy.linspace",
"matplotlib.cm.cub... |
zfar-/baselines | [
"a565e28b4d12f18f6784e3db402e0f27f5e09fd6"
] | [
"baselines/common/distributions.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport baselines.common.tf_util as U\nfrom baselines.a2c.utils import fc, fcNoisy\nfrom tensorflow.python.ops import math_ops\n\nclass Pd(object):\n \"\"\"\n A particular probability distribution\n \"\"\"\n def flatparam(self):\n raise NotImplementedE... | [
[
"tensorflow.exp",
"tensorflow.get_default_session",
"tensorflow.python.ops.math_ops.less",
"tensorflow.to_float",
"tensorflow.nn.softmax",
"tensorflow.nn.softmax_cross_entropy_with_logits_v2",
"tensorflow.shape",
"tensorflow.concat",
"numpy.log",
"tensorflow.sigmoid",
"... |
JDBumgardner/stone_ground_hearth_battles | [
"9fe095651fab60e8ddbf563f0b9b7f3e723d5f4f"
] | [
"hearthstone/training/pytorch/networks/feedforward_net.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom hearthstone.training.pytorch.encoding.default_encoder import EncodedActionSet\nfrom hearthstone.training.common.state_encoding import State, Encoder\n\n\nclass HearthstoneFFNet(nn.Module):\n def __init__(self, encoding: Encoder, hidden_... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.init.constant_",
"torch.tanh",
"torch.nn.functional.gelu",
"torch.nn.functional.relu",
"torch.nn.functional.log_softmax",
"torch.nn.init.orthogonal_"
]
] |
UCI-CubeSat/pyLMS7002Soapy | [
"4f828eb9282c302dc6b187d91df5e77c8a6f2d61"
] | [
"examples/calculateVNA.py"
] | [
"import numpy\nimport os, sys\n\nif len(sys.argv) != 2 and len(sys.argv) != 3:\n print(\"Usage: python calculateVNA_900M.py measurementName [plotFigures]\")\n print(\"plotFigures is optional and can have values plot for plotting figures or save to plot and save the figures\")\n exit(1)\n\nstartFreq = 2.3e9... | [
[
"numpy.array",
"numpy.exp",
"numpy.real",
"numpy.power",
"numpy.abs",
"numpy.imag",
"numpy.log10"
]
] |
thepalbi/codeql | [
"a0b5e1c87c3fcca4c60ecf051238981d2e7dd594"
] | [
"constraintsolving/solver/solve-test.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport tensorflow_constrained_optimization as tfco\nfrom six.moves import xrange\nimport math\nfrom MyConstraintedProblem import MyConstraintedProblem\n\n# Create a simulated 10-dimensional training dataset consisting of 1000 labeled\n# examples, of which 800 are labele... | [
[
"numpy.random.normal",
"tensorflow.zeros",
"numpy.random.choice",
"numpy.matmul",
"tensorflow.tensordot",
"numpy.sum",
"tensorflow.Variable",
"tensorflow.constant",
"tensorflow.keras.optimizers.Adagrad",
"numpy.maximum"
]
] |
Kipok/OpenSeq2Seq | [
"cb48d2552e157c88f005c2a7364548a658e4cdf1"
] | [
"open_seq2seq/utils/hooks.py"
] | [
"# Copyright (c) 2017 NVIDIA Corporation\nfrom __future__ import absolute_import, division, print_function\nfrom __future__ import unicode_literals\nfrom six.moves import range\n\nimport tensorflow as tf\nimport time\nimport os\n\n\nfrom open_seq2seq.utils.utils import deco_print, log_summaries_from_dict, \\\n ... | [
[
"tensorflow.get_default_graph",
"tensorflow.group",
"tensorflow.train.Saver",
"tensorflow.global_variables",
"tensorflow.train.SecondOrStepTimer",
"tensorflow.device",
"tensorflow.train.get_global_step",
"tensorflow.cast",
"tensorflow.train.SessionRunArgs"
]
] |
qilei123/BboxToolkit | [
"97f61ae97449009c7952f648be57a28d35c2f39b"
] | [
"BboxToolkit/datasets/DOTAio.py"
] | [
"import re\nimport os\nimport time\nimport zipfile\n\nimport os.path as osp\nimport numpy as np\n\nfrom PIL import Image\nfrom functools import reduce, partial\nfrom multiprocessing import Pool\nfrom collections import defaultdict\n\nfrom .io import load_imgs\nfrom .misc import get_classes, img_exts\nfrom ..utils i... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros"
]
] |
wufanyou/Traffic4Cast-2020-TLab | [
"5226bb1d2db40badb33c6b0ffe659fc6e9dca544"
] | [
"utils/hrnet/seg_hrnet.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Ke Sun (sunk@mail.ustc.edu.cn)\n# ------------------------------------------------------------------------------\n# modified by fw\n\nfrom __future__ import a... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"numpy.sum",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.functional.mse_loss",
"torch.... |
VirtualRoyalty/TextGenESN | [
"27cbabf55c6aaa5deb6d6846c4358559b2addbed"
] | [
"utils/train.py"
] | [
"import numpy as np\nfrom random import sample\nimport torch, torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport matplotlib.pyplot as plt\nfrom torch.autograd import Variable\nfrom IPython.display import clear_output\n\n\ndef trainESN(net,\n data,\n tokens,\... | [
[
"torch.device",
"torch.stack",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"torch.nn.functional.cross_entropy",
"numpy.transpose",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"t... |
Zeitsperre/flyingpigeon | [
"678370bf428af7ffe11ee79be3b8a89c73215e5e"
] | [
"flyingpigeon/ocgisDissimilarity.py"
] | [
"import dissimilarity as dd\nimport numpy as np\nfrom ocgis.util.helpers import iter_array\nfrom ocgis.calc.base import AbstractParameterizedFunction, AbstractFieldFunction\nfrom ocgis.collection.field import Field\nfrom ocgis.constants import NAME_DIMENSION_TEMPORAL\n\nmetrics = dd.__all__\n\n# NOTE: This code bui... | [
[
"numpy.ma.masked_invalid"
]
] |
gvvynplaine/dgl | [
"6294677f8acc6bc040baf922910473e1c82995ba"
] | [
"examples/mxnet/rgcn/entity_classify.py"
] | [
"\"\"\"\nModeling Relational Data with Graph Convolutional Networks\nPaper: https://arxiv.org/abs/1703.06103\nCode: https://github.com/tkipf/relational-gcn\n\nDifference compared to tkipf/relation-gcn\n* l2norm applied to all weights\n* remove nodes that won't be touched\n\"\"\"\n\nimport argparse\nimport numpy as ... | [
[
"numpy.ones",
"numpy.unique"
]
] |
sushinoya/ggpy | [
"455f75edaa55b2f9bce7f24cddf81096be5362d5"
] | [
"ggplot/geoms/geom_bar.py"
] | [
"from .geom import geom\nimport pandas as pd\nimport matplotlib.patches as patches\n\n\nclass geom_bar(geom):\n \"\"\"\n Bar chart\n\n Parameters\n ----------\n x:\n x values for bins/categories\n color:\n color of the outer line\n alpha:\n transparency of fill\n size:\n... | [
[
"matplotlib.patches.Rectangle",
"pandas.merge"
]
] |
jtomori/houdini2vr | [
"b2fe65cfee0bea14abe20275c0c21f6e917cda48"
] | [
"scripts/python/hou2vr.py"
] | [
"\"\"\"\nPreview your Houdini VR renders in HMD\n\"\"\"\n\nimport os\nimport hou\nimport time\nimport base64\nimport inspect\nimport logging\nimport urllib2\nimport webbrowser\nimport numpy as np\nimport SocketServer\nfrom PIL import Image\nimport SimpleHTTPServer\nfrom pathlib2 import Path\nfrom threading import T... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.flipud",
"numpy.clip",
"matplotlib.pyplot.show",
"numpy.flip",
"matplotlib.pyplot.imshow"
]
] |
fleeb24/foundation | [
"62ac096e6c53e12f2e29480506687c652c399d50"
] | [
"omnilearn/community/ssim.py"
] | [
"\n\nimport numpy as np\nfrom scipy import signal\nfrom scipy.ndimage.filters import convolve\nfrom PIL import Image\n\n\n\ndef _FSpecialGauss(size, sigma):\n \"\"\"Function to mimic the 'fspecial' gaussian MATLAB function.\"\"\"\n radius = size // 2\n offset = 0.0\n start, stop = -radius, radius + 1\n ... | [
[
"numpy.square",
"numpy.array",
"scipy.ndimage.filters.convolve",
"scipy.signal.fftconvolve",
"numpy.ones",
"numpy.exp",
"numpy.mean",
"numpy.prod",
"numpy.append",
"numpy.log10"
]
] |
okumakito/dnb-tsod | [
"26789adf38bd4947887fad53ea462af3af6c9573"
] | [
"scripts/preprocess_GSE112653.py"
] | [
"import numpy as np\nimport pandas as pd\n\ndef preprocess_GSE112653():\n\n # NOTE: the mapping relations between probe names and gene symbols\n # were extracted from 028005_D_GeneList_20171030.txt obtained at:\n # https://earray.chem.agilent.com/earray/catalogGeneLists.do?action=displaylist\n # It was the late... | [
[
"pandas.read_csv"
]
] |
geinarm/cmsc818_gudjon | [
"e48638bcc96b865f2daf749bd22dc75dda35aed8"
] | [
"arm/obstacle.py"
] | [
"import shapely\nimport numpy as np\nfrom matplotlib.patches import Polygon\nfrom matplotlib.collections import PatchCollection\n\nclass Obstacle(object):\n def __init__(self, frame, width, height):\n self.frame = frame\n self.width = width\n self.height = height\n\n self.shape = np.a... | [
[
"numpy.array",
"matplotlib.collections.PatchCollection"
]
] |
Zeyu-Shen/differential-privacy-library | [
"4047b6a55ee108f87ad9d18c14359c5158637a65"
] | [
"diffprivlib/models/forest.py"
] | [
"\n# MIT License\n#\n# Copyright (C) IBM Corporation 2021\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy... | [
[
"numpy.max",
"numpy.array",
"numpy.random.choice",
"numpy.random.seed",
"sklearn.utils.fixes._joblib_parallel_args",
"numpy.min",
"numpy.where",
"numpy.random.uniform",
"sklearn.utils.check_array",
"numpy.unique"
]
] |
jayroxis/quadratic-residual-networks | [
"eeb9b0a449b6ac8cd55f4bb2d11ce1d3071d975d"
] | [
"QRes/main/discrete_time_identification (KdV)/KdV.py"
] | [
"\"\"\"\n@author: Maziar Raissi\n\"\"\"\n\nimport sys\nsys.path.insert(0, '../../Utilities/')\n\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport time\nimport scipy.io\nfrom plotting import newfig, savefig\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.gridspec as gr... | [
[
"tensorflow.exp",
"numpy.random.choice",
"tensorflow.matmul",
"tensorflow.gradients",
"numpy.finfo",
"tensorflow.global_variables_initializer",
"tensorflow.set_random_seed",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.Variable",
"numpy.save",
"tensorflow.Con... |
yahanda/automl-image-prediction-with-onnx-on-edge | [
"d3cd47cb90d76123793dd92f9aa6a8bf12b32ef7"
] | [
"onnxruntime/python/tools/tensorrt/perf/post.py"
] | [
"import argparse\nimport sys\nimport os\nimport pandas as pd\nimport time\nfrom datetime import datetime, timedelta\nfrom azure.kusto.data import KustoConnectionStringBuilder\nfrom azure.kusto.data.helpers import dataframe_from_result_table \nfrom azure.kusto.ingest import (\n IngestionProperties,\n DataForma... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
haxdds/vectorbt | [
"96a8e24ba64dfadcecffa20ee0d596d4f17240c2",
"96a8e24ba64dfadcecffa20ee0d596d4f17240c2"
] | [
"tests/test_labels.py",
"vectorbt/utils/colors.py"
] | [
"from datetime import datetime\n\nimport numpy as np\nimport pandas as pd\n\nimport vectorbt as vbt\n\nclose_ts = pd.DataFrame({\n 'a': [1, 2, 1, 2, 3, 2],\n 'b': [3, 2, 3, 2, 1, 2]\n}, index=pd.Index([\n datetime(2020, 1, 1),\n datetime(2020, 1, 2),\n datetime(2020, 1, 3),\n datetime(2020, 1, 4),... | [
[
"numpy.array",
"pandas.MultiIndex.from_tuples"
],
[
"matplotlib.colors.to_rgb",
"matplotlib.pyplot.get_cmap"
]
] |
tzom/yHydra | [
"094714069302d0f5ce1913346d8cde8e24c7a59c"
] | [
"search_score.py"
] | [
"import multiprocessing, sys, os\nimport tensorflow as tf\nfrom load_config import CONFIG\nOUTPUT_DIR = CONFIG['RESULTS_DIR']\n\nimport pandas as pd\nimport numpy as np\nfrom score_utils import calc_ions, scoring\nfrom tqdm import tqdm\nfrom utils import batched_list,unbatched_list\nfrom proteomics_utils import nor... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.reshape",
"pandas.DataFrame",
"numpy.argsort",
"numpy.repeat"
]
] |
devmessias/edgeseraser | [
"86b0517db6a13f90ceb7f4a6cca41d051fc80e09"
] | [
"tests/test_noise_score.py"
] | [
"import igraph as ig\nimport networkx as nx\nimport numpy as np\nfrom edgeseraser import noise_score\n\n\ndef test_nx_filter():\n g = nx.circulant_graph(10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n noise_score.filter_nx_graph(g)\n bb = nx.edge_betweenness_centrality(g, normalized=False)\n nx.set_edge_attribut... | [
[
"numpy.array"
]
] |
HSouch/TBRIDGE | [
"1f266c64d905eca48749092687376708bcf09d48"
] | [
"tbridge/medians.py"
] | [
"from numpy import arange, nan, inf, sort, median, floor, max, nanmedian, transpose, asarray, std\nfrom numpy.random import choice, randint\nfrom scipy.interpolate import interp1d\n\nimport multiprocessing as mp\n\nfrom astropy.io import fits\nfrom astropy.table import Table\n\nimport tbridge\nimport os\nimport shu... | [
[
"numpy.max",
"scipy.interpolate.interp1d",
"numpy.asarray",
"numpy.median",
"numpy.arange",
"numpy.transpose",
"numpy.random.randint",
"numpy.nanmedian"
]
] |
Kai-46/opencv | [
"e82e672a933c8bd713ff53ac9ca553ede169b566"
] | [
"samples/python/dis_opt_flow.py"
] | [
"#!/usr/bin/env python\n\n'''\nexample to show optical flow estimation using DISOpticalFlow\n\nUSAGE: dis_opt_flow.py [<video_source>]\n\nKeys:\n 1 - toggle HSV flow visualization\n 2 - toggle glitch\n 3 - toggle spatial propagation of flow vectors\n 4 - toggle temporal propagation of flow vectors\nESC - exit\n... | [
[
"numpy.zeros",
"numpy.minimum",
"numpy.arange",
"numpy.arctan2",
"numpy.sqrt",
"numpy.int32",
"numpy.vstack"
]
] |
huy-ha/garage | [
"259b6faf7134314e2db738c4f0357d7883699773"
] | [
"src/garage/tf/policies/discrete_qf_derived_policy.py"
] | [
"\"\"\"A Discrete QFunction-derived policy.\n\nThis policy chooses the action that yields to the largest Q-value.\n\"\"\"\nimport akro\nimport numpy as np\nimport tensorflow as tf\n\nfrom garage.misc.overrides import overrides\nfrom garage.tf.policies import Policy\n\n\nclass DiscreteQfDerivedPolicy(Policy):\n \... | [
[
"tensorflow.compat.v1.get_default_session",
"numpy.argmax"
]
] |
vss888/statsmodels | [
"e56c4046ff8807c3c16d6a9293b5cb5dfe6f0cd0"
] | [
"statsmodels/examples/ex_kde_normalreference.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nAuthor: Padarn Wilson\n\nPerformance of normal reference plug-in estimator vs silverman. Sample is drawn\nfrom a mixture of gaussians. Distribution has been chosen to be reasoanbly close\nto normal.\n\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nfrom scipy im... | [
[
"numpy.random.seed",
"matplotlib.pyplot.show",
"scipy.stats.norm.pdf",
"matplotlib.pyplot.figure"
]
] |
Sunethan/APD-analyser | [
"30a190c763017017ce16e171b5bf641fda62a4b0"
] | [
"plugin/GenerationRate/BandToBandTunneling.py"
] | [
"import numpy as np\nimport physics as phys\nimport utils\n\nq = 1.6e-19 # [C]\nme = 9.11e-31 # [kg]\nhbar = 1.054e-34 # [J-s]\neps_InP = 12.5 * 8.85e-14 # [F/cm]\neps_InGaAs = 13.9 * 8.85e-14 # [F/cm] In 0.53 Ga 0.47 As\nEg_InP = 1.35 * q # [J]\nEg_InGaAs = 0.742 * q # [J] # TCAD 應該是 0.7428\n\n\ndef Jt_E_I... | [
[
"numpy.asarray",
"numpy.exp"
]
] |
liyufan/recapture | [
"52ecf446ba6438275256d59cadd5a17de08d591c"
] | [
"LBP_WS.py"
] | [
"import argparse\nimport os\nimport pickle as pkl\nfrom pathlib import Path\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport pywt\nimport skimage\nimport skimage.io\nfrom skimage import feature\nfrom sklearn import svm, metrics\nfrom sklearn.model_selection import GridSearchCV, train_test_split\nfrom ... | [
[
"numpy.concatenate",
"numpy.array",
"sklearn.utils.Bunch",
"sklearn.model_selection.GridSearchCV",
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"numpy.arange",
"pandas.Series",
"sklearn.model_selection.train_test_split",
"numpy.logspace"
]
] |
nmningmei/METASEMA_encoding_model | [
"ce4b9b0935e5a1b04de77174236905f7d8d267f8"
] | [
"scripts/compare word2vec and image2vec 15_roi voxel wise.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 5 10:49:55 2020\n\n@author: nmei\n\"\"\"\n\n\nimport pandas as pd\nimport numpy as np\nfrom glob import glob\nfrom tqdm import tqdm\nimport os\nfrom scipy import stats\nimport statsmodels.api as sm\nfrom statsmodels.formula.api import ols... | [
[
"pandas.DataFrame",
"numpy.sum",
"numpy.load",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.rc"
]
] |
samuelefiorini/vrpy | [
"ad3232b9e9ee9276c9c799d16b4a4a8c2b41eef1"
] | [
"examples/cvrp_drop.py"
] | [
"from networkx import from_numpy_matrix, set_node_attributes, relabel_nodes, DiGraph\nfrom numpy import array\n\nfrom examples.data import DISTANCES, DEMANDS_DROP\n\nfrom vrpy import VehicleRoutingProblem\n\n# Transform distance matrix to DiGraph\nA = array(DISTANCES, dtype=[(\"cost\", int)])\nG = from_numpy_matrix... | [
[
"numpy.array"
]
] |
davidackerman/CNNectome | [
"bde8528ed5adc0a4aefca3b19ecc4c2144f2cbcc"
] | [
"CNNectome/postprocessing/partner_annotations/slicefilter.py"
] | [
"import zarr\nimport numcodecs\nimport os\nimport numpy as np\nimport scipy.ndimage\nfrom CNNectome.utils import config_loader\n\nBG_VAL1 = 0xFFFFFFFFFFFFFFFD\nBG_VAL2 = 0\n\n\ndef slicefilter(\n filename_src, dataset_src, filename_tgt, dataset_tgt, thr, dat_file=None\n):\n\n srcf = zarr.open(filename_src, mo... | [
[
"numpy.array",
"numpy.unique",
"numpy.isin"
]
] |
JochenHinz/nutils | [
"ac18dd6825b107e2e4c186ebb1598dbf0fff0f77"
] | [
"tests/test_topology.py"
] | [
"from nutils import *\nfrom nutils.testing import *\nimport numpy, copy, sys, pickle, subprocess, base64, itertools, os\n\ngrid = numpy.linspace(0., 1., 4)\n\ndef verify_connectivity(structure, geom):\n (e00,e01), (e10,e11) = structure\n\n a0 = geom.eval(_transforms=[e00.transform], _points=numpy.array([[0,1]]))\... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.zeros_like",
"numpy.ones",
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_array_less",
"numpy.linspace"
]
] |
lmenou/py-pde | [
"3899cba0481657ea7b3d5c05e318d0b851bbe8cd"
] | [
"pde/grids/boundaries/tests/test_axes_boundaries.py"
] | [
"\"\"\"\n.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>\n\"\"\"\n\nimport itertools\n\nimport numpy as np\nimport pytest\n\nfrom pde import ScalarField, UnitGrid\nfrom pde.grids.boundaries.axes import Boundaries\nfrom pde.grids.boundaries.axis import BoundaryPair, BoundaryPeriodic, get_boundary_axis\n\n\nd... | [
[
"numpy.random.random",
"numpy.arange"
]
] |
tachyonicClock/avalanche | [
"6c3b84b4b9e3123c838092433f29590d955bfdf2"
] | [
"avalanche/training/strategies/base_strategy.py"
] | [
"################################################################################\n# Copyright (c) 2021 ContinualAI. #\n# Copyrights licensed under the MIT License. #\n# See the accompanying LICENSE file for terms. ... | [
[
"torch.no_grad",
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader"
]
] |
DmitryGolovin-azur/article-processing-big-numeric-arrays-in-python | [
"10eb4d4a9ada0037a589183b179caa4c55f41a50"
] | [
"src/e10_calc_ema_naive_improved.py"
] | [
"import xarray as xr\nimport numpy as np\nimport time\n\ndata = xr.open_dataarray('../data.nc', decode_times=True).compute()\n\ndef calc_ema_list(prices, n):\n k = 2.0 / (1 + n)\n _k = 1 - k\n ema = []\n pe = np.nan\n for e in prices:\n if not np.isnan(pe):\n if np.isnan(e):\n ... | [
[
"numpy.isnan"
]
] |
zer0onetwothree/openpilot | [
"b8c7502d7e0e626e84bee95f3c3cd04a45a02f9f"
] | [
"selfdrive/car/honda/interface.py"
] | [
"#!/usr/bin/env python3\nimport numpy as np\nfrom cereal import car\nfrom common.numpy_fast import clip, interp\nfrom common.realtime import DT_CTRL\nfrom selfdrive.swaglog import cloudlog\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.controls.lib.events import ET\nfrom selfdrive.car.honda.values ... | [
[
"numpy.array",
"numpy.dot",
"numpy.maximum"
]
] |
cosminacho/Helmet.AI | [
"f3aee1c8ffc2fd01094218524870d41c9761e7f8"
] | [
"src/utils/tfrecords/create_helmet_tfrecord.py"
] | [
"import os\n\nimport lxml.etree\n\nimport tensorflow as tf\nimport numpy as np\nimport cv2\n\n\ndef parse_xml(xml):\n if not len(xml):\n return {xml.tag: xml.text}\n result = {}\n for child in xml:\n child_result = parse_xml(child)\n if child.tag != 'object':\n result[child.... | [
[
"tensorflow.train.BytesList",
"tensorflow.train.FloatList",
"tensorflow.train.Int64List",
"numpy.random.shuffle",
"tensorflow.io.TFRecordWriter"
]
] |
ishaan27chaturvedi/Frozen-Lake | [
"7664ad8474fe502e8313b90333036fae2475b53e"
] | [
"Environment.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport numpy as np\nimport random\nfrom itertools import product\nimport contextlib\n\n\n# ### Defining Print Options\n\n# In[2]:\n\n\n# Configures numpy print options\n@contextlib.contextmanager\ndef _printoptions(*args, **kwargs):\n original = np.get_pri... | [
[
"numpy.full",
"numpy.array",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.set_printoptions",
"numpy.get_printoptions",
"numpy.where"
]
] |
gcunhase/tensorflow-onnx | [
"8a61c99fbc39c36d70781f95e2c7c582f46ba2db",
"8a61c99fbc39c36d70781f95e2c7c582f46ba2db"
] | [
"tf2onnx/tflite_utils.py",
"tf2onnx/tflite_handlers/tfl_math.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n\n\n\"\"\"\ntf2onnx.tflite_utils - utilities for parsing tflite files into onnx graph\n\"\"\"\n\nimport collections\nimport importlib\nimport logging\nimport struct\n\nfrom onnx import helper, onnx_pb, numpy_helper\nfrom tensorflow.core.framework import types_pb2, tensor_pb2,... | [
[
"tensorflow.core.framework.tensor_pb2.TensorProto",
"numpy.array",
"tensorflow.lite.Interpreter",
"tensorflow.python.framework.tensor_util.MakeNdarray",
"tensorflow.core.framework.node_def_pb2.NodeDef"
],
[
"numpy.array"
]
] |
mayankpadhi/AI_Codes | [
"8631f18cd9d1bba9ffc142b1ede0197b512157e2"
] | [
"Week 6/storing_values_in_CSV.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport csv\nlist=[]\n\nmean =[0,0]\ncov=[[1 ,0.7 ],[0.7, 1]]\nx, y = np.random.multivariate_normal(mean, cov,40).T\nlist=[]\nprint(x,y)\nfor i in range(0,40):\n list.append([x[i],y[i]])\n\nprint(list)\n\n\nmean =[4,4]\ncov=[[1 ,0.25 ],[0.25, 0.5]]\nx1, y1 = n... | [
[
"numpy.random.multivariate_normal"
]
] |
ziyan0302/Multiverse | [
"3b2f590a7d99758b6a8795070ca25a9698b767a9"
] | [
"forking_paths_dataset/code/plot_traj_carla.py"
] | [
"# coding=utf-8\n# plot world traj on the carla ground\nimport argparse\nimport glob\nimport math\nimport os\nimport sys\n\nscript_path = os.path.dirname(os.path.realpath(__file__))\nsys.path.append(glob.glob(\"%s/carla*.egg\" % script_path)[0])\n\nimport carla\n\nimport numpy as np\nfrom visualize_real_data import... | [
[
"numpy.array",
"numpy.unique",
"numpy.isin"
]
] |
abdulazizali77/tensorflow | [
"f7d07f5d9683a7d5ce91b108c6c31a47e1372eaa"
] | [
"tensorflow/python/ops/data_flow_ops.py"
] | [
"# Copyright 2015 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.python.ops.gen_data_flow_ops.sparse_accumulator_take_gradient",
"tensorflow.python.ops.gen_data_flow_ops._padding_fifo_queue_v2",
"tensorflow.python.ops.gen_data_flow_ops._barrier_close",
"tensorflow.python.ops.gen_data_flow_ops._priority_queue_v2",
"tensorflow.python.ops.gen_data_... |
ZhenLiuBuaa/wDAE_GNN_FewShot | [
"6db1e4b1fe99821ffa116be009b5765f47932400"
] | [
"low_shot_learning/datasets/mini_imagenet_dataset.py"
] | [
"from __future__ import print_function\n\nimport os\nimport os.path\nimport random\n\nimport h5py\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nfrom PIL import Image\n\nimport low_shot_learning.utils as utils\n\n# Set the appropriate paths of the da... | [
[
"numpy.concatenate",
"torch.Tensor",
"numpy.asarray"
]
] |
javabean68/alaricus | [
"116f57aacff2cd32e6d1406700a609e3cbc6030e"
] | [
"code/Euromillions/neural_network_2.py"
] | [
"# Create your first MLP in Keras\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Activation\n\n\n\nimport dataset as ds\nimport numpy as np\nfrom display import *\nfrom keras import backend as K\nimport download\n\ndef my_loss(y_true, y_pred):\n return (1 - K.sum(y_true * y_pred, ... | [
[
"numpy.random.seed",
"numpy.ravel",
"numpy.reshape",
"sklearn.model_selection.train_test_split"
]
] |
NzLeuphana/QuantEcon.py | [
"1db07f1c49c5ff4810c6e3e84b00eb3ab28c8da5"
] | [
"quantecon/markov/tests/test_approximation.py"
] | [
"\"\"\"\nTests for approximation.py file (i.e. tauchen)\n\n\"\"\"\nimport sys\nimport unittest\nimport numpy as np\nfrom quantecon.markov import tauchen, rouwenhorst\n#from quantecon.markov.approximation import rouwenhorst\n\n\nclass TestTauchen(unittest.TestCase):\n\n def setUp(self):\n self.rho, self.si... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.random.random_integers",
"numpy.sum",
"numpy.random.uniform",
"numpy.sqrt",
"numpy.all"
]
] |
KyivAIGroup/iterative-winners-take-all | [
"8d5dec074d440c99206d89aac22c736d1a5bc413"
] | [
"fig2.py"
] | [
"\"\"\"\r\nHow weight sparsity changes the encoding sparsity.\r\n\"\"\"\r\n\r\nimport matplotlib as mpl\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom pathlib import Path\r\n\r\nfrom kwta import iWTA\r\n\r\n# mpl.rcParams['grid.color'] = 'k'\r\n# mpl.rcParams['grid.linestyle'] = ':'\r\n# mpl.rcPar... | [
[
"matplotlib.pyplot.xlim",
"numpy.random.choice",
"numpy.zeros",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.std",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
1715labs/baal | [
"ee61f89c78353f7d50d4a3b3285ee52aab09dd12"
] | [
"src/baal/utils/pytorch_lightning.py"
] | [
"import sys\nimport types\nfrom abc import ABC\nfrom collections.abc import Sequence\nfrom typing import Dict, Any, Optional\n\nimport numpy as np\nimport structlog\nimport torch\nfrom baal.active import ActiveLearningDataset\nfrom baal.active.heuristics import heuristics\nfrom baal.modelwrapper import mc_inference... | [
[
"torch.utils.data.DataLoader",
"numpy.vstack"
]
] |
TobiasM95/TicTacToeZero | [
"ab85e67b6e1d47268b3e2796d2991e4d10ee5d76"
] | [
"src/MCTS.py"
] | [
"#!/usr/bin/env python3\nimport numpy as np\nfrom scipy.special import softmax\n\nNUMBER_SIMULATIONS = 100 #agz is 800\nMCTS_TEMPERATURE = 1.0\n\n#states are convnet states\n#actions are cnn output action vectors hot state\nclass Node():\n\n def __init__(self, state=None, action=None, prior=1.0):\n #root ... | [
[
"numpy.array",
"scipy.special.softmax",
"numpy.random.choice",
"numpy.zeros",
"numpy.where",
"numpy.power",
"numpy.sqrt"
]
] |
JeremyXSC/MCN-MT | [
"df62689e5ab3ac3c40a9e793425036594c903cbc"
] | [
"selftrainingMCN_5model_meannet.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function, absolute_import\nimport argparse\nimport time\nimport os.path as osp\nimport os\nimport sys\nimport numpy as np\nimport torch\nimport csv\nimport codecs\nfrom torch import nn\nfrom torch.nn import init\nfrom torch.backends im... | [
[
"torch.nn.functional.normalize",
"numpy.asarray",
"numpy.random.seed",
"numpy.round",
"numpy.triu",
"torch.from_numpy",
"torch.manual_seed",
"numpy.nonzero",
"sklearn.cluster.DBSCAN",
"numpy.sort",
"torch.nn.DataParallel",
"torch.pow"
]
] |
cogsci2/android-demo-app | [
"16da120c1db5b2be3fdeb08034760607f6fbbba6"
] | [
"ImageSegmentation/deeplabv3.py"
] | [
"import torch\n\nmodel = torch.hub.load('pytorch/vision:v0.7.0', 'deeplabv3_resnet50', pretrained=True)\nmodel.eval()\n\nscriptedm = torch.jit.script(model)\ntorch.jit.save(scriptedm, \"deeplabv3_scripted.pt\")\n\n"
] | [
[
"torch.jit.script",
"torch.jit.save",
"torch.hub.load"
]
] |
hugobb/sgda | [
"69dcda47bb2c5b76d46ead32eb46ab5fb5e5e6d3"
] | [
"gamesopt/games/base.py"
] | [
"from abc import ABC, abstractmethod\nfrom pathlib import Path\nimport torch.autograd as autograd\nimport torch\nfrom typing import List, Optional\nimport copy\nimport torch.distributed as dist\n\n\nclass Game(ABC):\n def __init__(self, players: List[torch.Tensor], num_samples: int, rank: Optional[int] = None, i... | [
[
"torch.distributed.reduce",
"torch.distributed.broadcast",
"torch.autograd.grad",
"torch.ones"
]
] |
alanpeixinho/NiftyNet | [
"9a17022a71985974f9e5ca992c765d55860fdd7d",
"9a17022a71985974f9e5ca992c765d55860fdd7d"
] | [
"niftynet/contrib/csv_reader/sampler_resize_v2_csv.py",
"tests/gn_test.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nResize input image as output window.\n\"\"\"\nfrom __future__ import absolute_import, print_function, division\n\nimport numpy as np\nimport scipy.ndimage\nimport tensorflow as tf\n\nfrom niftynet.contrib.csv_reader.sampler_csv_rows import ImageWindowDatasetCSV\nfrom niftynet.engin... | [
[
"numpy.concatenate",
"tensorflow.compat.v1.logging.info"
],
[
"tensorflow.keras.regularizers.L2",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.ones",
"tensorflow.test.main"
]
] |
python-bookworm/mmdetection-new | [
"add3ab512b98f9d0996ad26b5b9e5737bcde9fde"
] | [
"mmdet/datasets/coco.py"
] | [
"import numpy as np\nfrom pycocotools.coco import COCO\n\nfrom .custom import CustomDataset\nfrom .registry import DATASETS\n\n\n@DATASETS.register_module\nclass CocoDataset(CustomDataset):\n\n # CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',\n # 'train', 'truck', 'boat', '... | [
[
"numpy.array",
"numpy.zeros"
]
] |
sliderSun/bert | [
"c9e16d652f85398fbb6ca6aea72f11f82166c672"
] | [
"bert_tsim/similarity.py"
] | [
"import os\nimport random\nfrom queue import Queue\nfrom threading import Thread\n\nimport pandas as pd\nimport tensorflow as tf\nimport collections\nimport args\nimport tokenization\nimport modeling\nimport optimization\n\n\n# os.environ['CUDA_VISIBLE_DEVICES'] = '1'\n\n\nclass InputExample(object):\n \"\"\"A s... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.train.Features",
"tensorflow.metrics.auc",
"tensorflow.matmul",
"tensorflow.metrics.mean",
"tensorflow.nn.softmax",
"tensorflow.one_hot",
"pandas.read_csv",
"tensorflow.parse_single_example",
"tensorflow.trainable_variables",
... |
bhadreshpsavani/TAPER-EHR | [
"ab938749756fcaaef52a7002a074421f483e3562"
] | [
"model/bert_things/pytorch_pretrained_bert/modeling.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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... | [
[
"torch.nn.Linear",
"torch.ones",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss",
"torch.sigmoid",
"torch.sqrt",
"torch.nn.Softmax",
"tensorflow.train.list_variables",
"numpy.transpose",
"torch.zeros_like",
"torch.zeros",
"tensorflow.train.load_variable",
... |
LOVEChen/raspberry-pilot | [
"4f01dcad4629577bcb268118375fae7473103a53"
] | [
"selfdrive/controls/lib/pid.py"
] | [
"import numpy as np\r\nfrom common.numpy_fast import clip, interp\r\n\r\ndef apply_deadzone(error, deadzone):\r\n if error > deadzone:\r\n error -= deadzone\r\n elif error < - deadzone:\r\n error += deadzone\r\n else:\r\n error = 0.\r\n return error\r\n\r\nclass PIController(object):\r\n def __init__(... | [
[
"numpy.sign"
]
] |
kamilszewc/smoothie | [
"bc19eb1c296b102370d4a44dc870a14aa3fabf8b"
] | [
"cSPH2d/Postproc/PostProc/Field.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# All right reserved by Kamil Szewc, Gdansk 2009 \n\n\nimport numpy as np\nfrom Point import Point\ntry:\n from multiprocessing import Process, Queue, cpu_count\n class Multi(Process):\n pass\nexcept ImportError:\n from threading import Thread\n fr... | [
[
"numpy.meshgrid"
]
] |
rzats/3DDFA | [
"5c90675ac02c90edfd964f7324cc997b16ebd6c8"
] | [
"utils/inference.py"
] | [
"#!/usr/bin/env python3\n# coding: utf-8\n__author__ = 'cleardusk'\n\nimport numpy as np\nfrom math import sqrt\nimport scipy.io as sio\nimport matplotlib.pyplot as plt\nfrom .ddfa import reconstruct_vertex\n\n\ndef get_suffix(filename):\n \"\"\"a.jpg -> jpg\"\"\"\n pos = filename.rfind('.')\n if pos == -1... | [
[
"matplotlib.pyplot.text",
"numpy.zeros",
"numpy.round",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"scipy.io.savemat",
"numpy.maximum",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.axis",
"... |
MatthewAbugeja/agw | [
"51c3d549e3cb8cecfd21e7b73af81b73d8996357"
] | [
"video-reid-AWG/models/non_local.py"
] | [
"# encoding: utf-8\n\nimport torch\nfrom torch import nn\n\n\nclass Non_local(nn.Module):\n def __init__(self, in_channels, reduc_ratio=2):\n super(Non_local, self).__init__()\n\n self.in_channels = in_channels\n self.inter_channels = reduc_ratio // reduc_ratio\n\n self.g = nn.Conv2d(... | [
[
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.matmul",
"torch.nn.init.constant_"
]
] |
huangjun12/Paddle | [
"780140599f7b4621bd29066a8ced1be120862a89"
] | [
"python/paddle/fluid/layers/loss.py"
] | [
"# Copyright (c) 2019 PaddlePaddle 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 re... | [
[
"numpy.array"
]
] |
lionheartStark/GCN-graduate-design | [
"a0da3bda3eaf2e9b447915dbc968dc21cfe07639"
] | [
"log/new_data/qy_Elliptic_dataset_EGCN.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# <a href=\"https://colab.research.google.com/github/JungWoo-Chae/GCN_Elliptic_dataset/blob/main/Elliptic_dataset_GCN.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n\n# # Bitcoin Fraud Detection... | [
[
"numpy.array",
"torch.cat",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"pandas.DataFrame",
"matplotlib.pyplot.legend",
"sklearn.metrics.precision_score",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.tensor",
"pa... |
favitor/im2avatar | [
"d5f0fc181b8594cd443f63a6aeb0d9731b491265"
] | [
"train_shape.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport os\nimport sys\nsys.path.append('./utils')\nsys.path.append('./models')\n\nimport dataset as dataset\nimport model_shape as model\n\nFLAGS = tf.app.flags.FLAGS\ntf.app.flags.DEFINE_string('train_dir', './train_shape',\n \"\"\"Directory w... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.flags._global_parser.parse_args",
"tensorflow.global_variables_initializer",
"tensorflow.Variable",
"tensorflow.train.Saver",
"tensorflow.ConfigProto",
"numpy.prod",
"tensorflow.minimum",
"tensorflow.train.AdamOptimizer",
... |
JPlin/semantic-segmentation-pytorch | [
"c435f02cf1225e0c4a948c4e040d23bbfd5d336a"
] | [
"dataset.py"
] | [
"import os\nimport json\nimport torch\nfrom torchvision import transforms\nimport numpy as np\nfrom PIL import Image\nimport random\n\n\ndef imresize(im, size, interp='bilinear'):\n if interp == 'nearest':\n resample = Image.NEAREST\n elif interp == 'bilinear':\n resample = Image.BILINEAR\n e... | [
[
"numpy.max",
"torch.zeros",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.shuffle",
"torch.unsqueeze",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.show"
]
] |
killerSwitch/autogluon | [
"11ab6aab35196ef148fb5a8308e92585d9de618a"
] | [
"core/src/autogluon/core/models/ensemble/fold_fitting_strategy.py"
] | [
"import copy\nimport logging\nimport os\nimport time\nimport pandas as pd\nimport pickle\nimport psutil\nimport math\nfrom abc import abstractmethod\n\nfrom numpy import ndarray\nfrom pandas import DataFrame, Series\n\nfrom autogluon.common.utils.pandas_utils import get_approximate_df_mem_usage\n\nfrom ...utils.exc... | [
[
"pandas.concat"
]
] |
TontonTremblay/nerf_pl | [
"686e09b7c642778e226cdf83b70f47a6abeda73a"
] | [
"eval.py"
] | [
"import torch\nimport os\nimport numpy as np\nfrom collections import defaultdict\nfrom tqdm import tqdm\nimport imageio\nfrom argparse import ArgumentParser\n\nfrom models.rendering import render_rays\nfrom models.nerf import *\n\nfrom utils import load_ckpt\nimport metrics\n\nfrom datasets import dataset_dict\nfr... | [
[
"torch.no_grad",
"torch.cat",
"numpy.nan_to_num",
"numpy.mean"
]
] |
woithook/LIO | [
"8ec884ab7134a1ab7d8dd8922d4935e74f607446"
] | [
"social_dilemmas/envs/cleanup.py"
] | [
"import numpy as np\nimport random\n\nfrom social_dilemmas.constants import CLEANUP_MAP\nfrom social_dilemmas.envs.map_env import MapEnv, ACTIONS\nfrom social_dilemmas.envs.agent import CleanupAgent # CLEANUP_VIEW_SIZE\n\n# Add custom actions to the agent\nACTIONS['FIRE'] = 5 # length of firing beam\nACTIONS['CLE... | [
[
"numpy.isclose",
"numpy.random.rand",
"numpy.unique"
]
] |
willhyper/dnn | [
"244f04fdb91eeb3f27cca1a5132c9a486bbf788a"
] | [
"randomized_svd.py"
] | [
"import numpy as np\n\ndef randomized_svd(M, k):\n m, n = M.shape\n transpose = False\n if m < n:\n transpose = True\n M = M.T\n\n rand_matrix = np.random.normal(size=(M.shape[1], k)) # short side by k\n Q, _ = np.linalg.qr(M @ rand_matrix, mode='reduced') # long side by k\n smalle... | [
[
"numpy.linalg.qr",
"numpy.random.normal",
"numpy.linalg.svd"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.