repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
hugoFranco21/draft-qb-backend | [
"b290f825a8cfcbafed29ec25ff7810d2f9d47932"
] | [
"algorithms/expected_rookies.py"
] | [
"import pandas as pd\nfrom sklearn import linear_model\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom sklearn.preprocessing import MinMaxScaler\nimport matplotlib.pyplot as plt\n\nrenamed = {\n 'Heisman': 'Heisman',\n 'Pct': 'Completion Pe... | [
[
"pandas.read_excel",
"sklearn.metrics.r2_score",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.savefig",
"sklearn.metrics.mean_squared_error",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.MinMaxScaler"
]
] |
evo3cx/arcface-tf2 | [
"b5bcdba1ddd6aba879d58793fdc8e84c461c48ab"
] | [
"modules/evaluations.py"
] | [
"\"\"\"\nThis script was modified from https://github.com/ZhaoJ9014/face.evoLVe.PyTorch\n\"\"\"\nimport os\nimport cv2\nimport bcolz\nimport numpy as np\nimport tqdm\nfrom sklearn.model_selection import KFold\n\nfrom .utils import l2_norm\n\n\ndef get_val_pair(path, name):\n carray = bcolz.carray(rootdir=os.path... | [
[
"numpy.square",
"numpy.logical_not",
"numpy.asarray",
"numpy.less",
"numpy.arange",
"numpy.subtract",
"sklearn.model_selection.KFold",
"numpy.argmax",
"numpy.mean",
"numpy.transpose",
"numpy.logical_and",
"numpy.zeros"
]
] |
Umesh-01/NavigateMe | [
"8085baa2eed50b2318cf9c84bb9df841988bfdc0"
] | [
"test_utilities.py"
] | [
"import utilities\nimport pytest\n\n\nclass TestClass:\n test_input = \"The quick brown fox jumps over the lazy dog.\"\n clf = utilities.classify_model()\n\n def test_setup_nltk(self):\n result = utilities.setup_nltk()\n assert result\n\n @pytest.mark.skip(reason=\"No way of currently test... | [
[
"numpy.array"
]
] |
tinyclues/ipython | [
"a924f50c0f7b84127391f1c396326258c2b303e2"
] | [
"IPython/utils/newserialized.py"
] | [
"# encoding: utf-8\n# -*- test-case-name: IPython.kernel.test.test_newserialized -*-\n\n\"\"\"Refactored serialization classes and interfaces.\"\"\"\n\n__docformat__ = \"restructuredtext en\"\n\n# Tell nose to skip this module\n__test__ = {}\n\n#----------------------------------------------------------------------... | [
[
"numpy.ascontiguousarray",
"numpy.frombuffer"
]
] |
XJTUexperiment/tensorlayer | [
"690766535a591367ad86907835b39730f4aa1dea"
] | [
"tensorlayer/layers/recurrent.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\nfrom tensorflow.python.ops import array_ops\nfrom tensorflow.python.util.tf_inspect import getfullargspec\nfrom tensorflow.contrib.rnn import stack_bidirectional_dynamic_rnn\nfrom tensorflow.python.ops.rnn_cell import LSTMStateTuple\n\nfrom ... | [
[
"tensorflow.get_variable",
"tensorflow.nn.dynamic_rnn",
"tensorflow.concat",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.zeros",
"tensorflow.python.util.tf_inspect.getfullargspec",
"tensorflow.reduce_sum",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.nn.bidir... |
leeseedong/book-cryptocurrency | [
"58c0bb3f5a80f8cc73ba47c4839be3bd33c9d67c"
] | [
"ch07/07_09.py"
] | [
"import pybithumb\nimport numpy as np\n\ndf = pybithumb.get_ohlcv(\"BTC\")\ndf = df['2018']\n\ndf['range'] = (df['high'] - df['low']) * 0.5\ndf['target'] = df['open'] + df['range'].shift(1)\n\ndf['ror'] = np.where(df['high'] > df['target'],\n df['close'] / df['target'],\n 1)\... | [
[
"numpy.where"
]
] |
WenZhihao666/MI-GNN | [
"0edb0b1b8874efdca52788fa1039380bff8caee6"
] | [
"learner_1.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nclass Learner_1(nn.Module):\n def __init__(self, config):\n super(Learner_1, self).__init__()\n self.config = config\n self.vars = nn.ParameterList()\n\n for i, (name, param) in enumerate(self.config):\n ... | [
[
"torch.mean",
"torch.ones",
"torch.zeros",
"torch.no_grad",
"torch.nn.ParameterList",
"torch.stack",
"torch.nn.functional.linear",
"torch.nn.init.kaiming_normal_"
]
] |
AhmedAbouzaid1/Medical-Question-Answering-System | [
"4006b52adc8434d762e69342e21e4f7d98b67a6d"
] | [
"fetch_bilstm.py"
] | [
"import operator\n\nfrom nltk import tokenize\nfrom operator import itemgetter\nimport math\nimport nltk\nfrom nltk.corpus import stopwords\nfrom nltk.tokenize import word_tokenize\nstop_words = set(stopwords.words('english'))\nfrom nltk.corpus import wordnet as guru\nfrom nltk.corpus import wordnet\nimport pandas ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.stack",
"numpy.set_printoptions",
"pandas.read_csv"
]
] |
NEBYUzekarias/five-video-classification-methods | [
"57b0c62d7452240e9b68abbb27754c5e22c2c805"
] | [
"demo1.py"
] | [
"from data import DataSet\n\nimport time\nimport cv2\n \n\n\n\nfrom extractor import Extractor\nfrom keras.models import Model, load_model\nfrom keras.layers import Input\nimport numpy as np\n\n\n\n\ndef show_webcam(mirror=False): \n\n \n # initialize the video stream and pointer to output video file, then\n... | [
[
"numpy.size",
"numpy.squeeze",
"numpy.expand_dims",
"numpy.shape"
]
] |
WeiHao97/tiny-imagenet-tfds | [
"f5faa6fd7c39c4f04cc83b792cbfa0a8f62873cd"
] | [
"tiny_imagenet/_imagenet.py"
] | [
"import os\nfrom enum import Enum\n\nimport tensorflow as tf\nimport tensorflow_datasets.public_api as tfds\n\n_URL = \"http://cs231n.stanford.edu/tiny-imagenet-200.zip\"\n_EXTRACTED_FOLDER_NAME = \"tiny-imagenet-200\"\n\nSUPPORTED_IMAGE_FORMAT = (\".jpg\", \".jpeg\", \".png\")\n\nchecksum_dir = os.path.join(os.pat... | [
[
"tensorflow.io.gfile.listdir"
]
] |
TidalPaladin/combustion | [
"69b9a2b9baf90b81ed9098b4f0391f5c15efaee7"
] | [
"tests/test_combustion/test_vision/test_points_to_anchors.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport pytest\nimport torch\nfrom torch.distributions import Binomial\n\nfrom combustion.testing import cuda_or_skip\nfrom combustion.vision import PointsToAnchors\n\n\n@pytest.fixture(params=[None, 1, 2])\ndef batch_size(request):\n return request.param\n\n\n@p... | [
[
"torch.ones",
"torch.cat",
"torch.zeros",
"torch.random.manual_seed",
"torch.tensor",
"torch.rand",
"torch.where",
"torch.allclose"
]
] |
shawntan/lexical | [
"d407642676fe60b7087825748d1585518af8dd2a"
] | [
"src/kirchhoff.py"
] | [
"import torch\nfrom torch import nn as nn\nfrom torch.nn import functional as F\n\nDEBUG = False\n\nEPS = torch.finfo(torch.float32).tiny\n\nclass KirchhoffNormalisation(nn.Module):\n def __init__(self, dropout, plus_one=False, smoothing_eps=5e-4,\n tril=False):\n super(KirchhoffNormalisat... | [
[
"torch.enable_grad",
"torch.rand_like",
"torch.amax",
"torch.einsum",
"torch.sum",
"torch.tril",
"torch.tensor",
"torch.exp",
"torch.logdet",
"torch.isfinite",
"torch.finfo",
"torch.logsumexp",
"torch.nn.functional.pad"
]
] |
DataCircles/FortuneCookie | [
"e43ad6a3bdffffa5e426b11f7999593249a6da3f"
] | [
"gpt2.py"
] | [
"import gpt_2_simple as gpt2\nimport tensorflow as tf\nimport pandas as pd\n\nfrom library.common import _random_prefix\n\ngpt2.download_gpt2(model_name=\"124M\")\nfile_name = \"training_data/data.txt\"\n\ndef gpt2_finetune(data, steps, run_name):\n\n tf.reset_default_graph()\n sess = gpt2.start_tf_sess()\n\n... | [
[
"tensorflow.reset_default_graph",
"pandas.read_csv"
]
] |
ashishs-til/learn-tf | [
"6b7f01df63ec59bfc6c54ad90cd3e0fbb8edb7a4"
] | [
"hello3.py"
] | [
"import tensorflow as tf\n\nsess = tf.Session()\n\nW = tf.Variable([.3], tf.float32)\nb = tf.Variable([-.3], tf.float32)\nx = tf.placeholder(tf.float32)\nlinear_model = W * x + b\n\ninit = tf.global_variables_initializer()\nsess.run(init)\n\nprint(sess.run([W,b]))\nprint(sess.run(linear_model, {x:[10,2,3,4]}))\n\ny... | [
[
"tensorflow.Variable",
"tensorflow.reduce_sum",
"tensorflow.assign",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.square",
"tensorflow.Session"
]
] |
protoget/espnet | [
"a52bdebb08558b63df23564d6e67dfcba8a41d78"
] | [
"tools/check_install.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright 2018 Nagoya University (Tomoki Hayashi)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nimport argparse\nimport importlib\nimport logging\nimport sys\n\n\ndef main(args):\n parser = argparse.ArgumentParser()\n parser.add_argument('--no-cupy', action='stor... | [
[
"torch.cuda.device_count",
"torch.backends.cudnn.is_available",
"torch.cuda.is_available"
]
] |
sumacm/fairattr | [
"72b56d718a6fbe695093d24715c75b9b485ab6b8"
] | [
"aif360/metrics/mdss/MDSS.py"
] | [
"from aif360.metrics.mdss.ScoringFunctions.ScoringFunction import ScoringFunction\nfrom aif360.metrics.mdss.generator import get_entire_subset, get_random_subset\n\nimport pandas as pd\nimport numpy as np\n\n\nclass MDSS(object):\n\n def __init__(self, scoring_function: ScoringFunction):\n self.scoring_fu... | [
[
"numpy.asarray",
"pandas.concat",
"numpy.random.rand",
"numpy.random.seed"
]
] |
tlmakinen/deep21 | [
"fb51d7e76f6059d5e9cd1ce5d19148a1375e23d3"
] | [
"train.py"
] | [
"\n# code for a UNet architecture for learning how to remove \n# the foreground from a 21ccm signal\n\nfrom __future__ import absolute_import, division, print_function\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow_addons as tfa\nfrom tensorflow import keras\nfrom tensorflow.keras.callbacks import ... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.python.client.device_lib.list_local_devices",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"tensorflow.distribute.experimental.MultiWorkerMirroredStrategy",
"tensorflow.keras.backend.square",
"tensorflow.keras.backend.std",
"... |
vincentchen003/tvm | [
"b3e832a1f1eb73153fd71aa4842fc1938d728b52"
] | [
"tests/python/relay/aot/aot_test_utils.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.ndindex",
"numpy.zeros"
]
] |
stw666/oneflow | [
"186a7c5e9c99626b03861ab61ee93eb723aa3d92"
] | [
"python/oneflow/test/modules/test_activation.py"
] | [
"\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap... | [
[
"numpy.reshape",
"numpy.random.randn",
"numpy.zeros_like",
"numpy.exp",
"numpy.array"
]
] |
ayansiddiqui007/jina | [
"2a764410de47cc11e53c8f652ea1095d5dab5435"
] | [
"jina/executors/indexers/keyvalue.py"
] | [
"__copyright__ = \"Copyright (c) 2020 Jina AI Limited. All rights reserved.\"\n__license__ = \"Apache-2.0\"\n\nimport mmap\nfrom typing import Iterator, Optional\n\nimport numpy as np\n\nfrom . import BaseKVIndexer\nfrom ...proto import jina_pb2, uid\n\n\nclass BinaryPbIndexer(BaseKVIndexer):\n class WriteHandle... | [
[
"numpy.array"
]
] |
zouhairm/plotly.py | [
"e53e626d59495d440341751f60aeff73ff365c28"
] | [
"packages/python/plotly/plotly/matplotlylib/mplexporter/tests/test_basic.py"
] | [
"import matplotlib\nimport numpy as np\nfrom distutils.version import LooseVersion\nfrom nose.plugins.skip import SkipTest\nfrom numpy.testing import assert_warns\n\nfrom ..exporter import Exporter\nfrom ..renderers import FakeRenderer, FullFakeRenderer\nfrom . import plt\n\n\ndef fake_renderer_output(fig, Renderer... | [
[
"numpy.random.random",
"numpy.random.seed"
]
] |
ramism16/opencv-image-processing | [
"544734571797e578bc66fca509893c41ca537f30"
] | [
"RamisMustafa_224248_DIPLab11/ramismustafa_224248_diplab11_task1.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"RamisMustafa_224248_DIPLab11.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1mzul1vb4ktOngYvV9pJ5yzGEMB1hgYr0\n\n Importing modules (and mounting drive)\n\"\"\"\n\nimport cv2\nimport numpy as np\n#from ... | [
[
"numpy.array"
]
] |
JiaruiFeng/pyG-GNN-framework | [
"03651de475251dc1e58a34b8576dfc8f615a2afe"
] | [
"utils.py"
] | [
"\"\"\"\nJiarui Feng\nThis file contains util functions\n\"\"\"\n\nimport networkx as nx\nimport ujson as json\nimport numpy as np\nimport torch\nimport os\nimport queue\nimport shutil\nimport logging\nimport tqdm\nfrom sklearn.metrics import roc_curve,auc\nimport torch.utils.data as data\nfrom torch_geometric.data... | [
[
"torch.cuda.set_device",
"torch.load",
"sklearn.metrics.auc",
"torch.cat",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.roc_curve",
"numpy.ones",
"numpy.concatenate",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.where",
"torch.device",
"... |
Melykuti/COVID-19 | [
"385e12574f5b8c40f540a743cda9e861bc0e0bd7"
] | [
"code/DEU.py"
] | [
"'''\nexec(open('DEU.py').read())\n15/3/2020-12/6/2021\n'''\n\nimport os, datetime\nimport numpy as np\nimport pandas as pd\nfrom bs4 import BeautifulSoup\nfrom importlib import reload\nimport utils\n\nallowed_values = \\\n ['Baden-Württemberg', 'Bayern', 'Berlin', 'Brandenburg', 'Bremen',\n 'Hamburg', 'Hesse... | [
[
"pandas.concat",
"pandas.to_datetime",
"pandas.Series",
"pandas.DataFrame"
]
] |
fonnesbeck/ngcm_pandas_2016 | [
"5a2a6aacbb850543c264e1f87eedc3955526b8c3"
] | [
"notebooks/solutions/nfs_replace.py"
] | [
"import pandas as pd\n\ndef read_desc(file_name):\n fname = \"../data/NationalFoodSurvey/{}\".format(file_name)\n return pd.read_csv(fname, sep=\"\\t\")\n\nfood_groups = read_desc(\"Ref_ food groups.txt\")\n\n# get the replacement dictionary\n# a mapping of key to value with which to replace it\nto_replace = ... | [
[
"pandas.read_csv"
]
] |
bwprice/butterfly-wings | [
"18b138e7a907e372029b9c8e927bd06882bac964"
] | [
"butterfly/measurement.py"
] | [
"import numpy as np\nfrom joblib import Memory\n\nlocation = './cachedir'\nmemory = Memory(location, verbose=0)\n\n\n@memory.cache()\ndef main(points_interest, T_space, axes=None):\n ''' Calculates the length and draws the lines for length\n of the butterfly wings.\n\n Parameters\n ----------\n ax: a... | [
[
"numpy.array",
"numpy.linalg.norm"
]
] |
trottomv/mymaze | [
"198720d18b78f4d713121e33d597314fed6d4874"
] | [
"app/solve.py"
] | [
"import networkx as nx\nimport numpy as np\nimport time\n\nclass Maze:\n MOVESARR = []\n SOLARR = []\n\n with open('txt/maze.txt', 'r') as f:\n lines = (line.rstrip(\"\\r\\n\") for line in f)\n maze = np.array([list(line) for line in lines])\n\n G = nx.Graph()\n\n def mazesolve():\n ... | [
[
"numpy.asarray"
]
] |
theastropath/turbot | [
"c623cd9af73876efdd315f3d7dd09448a06d3331"
] | [
"src/turnips/plots.py"
] | [
"#!/usr/bin/env python3\n\nfrom collections import Counter\nimport io\nfrom typing import Iterable, Sequence\n\nimport matplotlib.pyplot as plt\n\nfrom turnips.meta import MetaModel\nfrom turnips.model import TRIPLE, SPIKE, DECAY, BUMP, Model, ModelEnum\nfrom turnips.multi import MultiModel\nfrom turnips.ttime impo... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show"
]
] |
amz-hjinfeng/ctpn-sagemaker | [
"576844b7762922a3fcf4a5097cee1ffd2c5ae07e"
] | [
"ctpn/text_detect.py"
] | [
"import os\nimport sys\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nfrom lib.utils.timer import Timer\nfrom lib.fast_rcnn.config import cfg\nfrom lib.fast_rcnn.test import test_ctpn\nfrom lib.networks.factory import get_network\nfrom lib.text_connector.detectors import TextDetector\nfrom lib.text_conn... | [
[
"tensorflow.train.get_checkpoint_state",
"numpy.linalg.norm",
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"tensorflow.Session",
"tensorflow.train.Saver"
]
] |
Pooya448/MultiGarmentNetwork | [
"81484ab1068d450d01f8148992126412ba4b4fe4"
] | [
"utils/smpl_paths.py"
] | [
"import os\nimport numpy as np\nfrom psbody.mesh import Mesh\nfrom os.path import join\nimport cPickle as pkl\nfrom lib.serialization import backwards_compatibility_replacements, load_model\nfrom utils.geometry import get_hres\nimport scipy.sparse as sp\n\n## Set your paths here\nSMPL_PATH = '/BS/RVH/work/data/smpl... | [
[
"numpy.expand_dims",
"scipy.sparse.csr_matrix",
"numpy.ones"
]
] |
renatoviolin/GAN-image-inpainting | [
"6ba7ccd4ae55b185ee89844e846d4c469f4fa65f"
] | [
"generative_inpainting/predict.py"
] | [
"import cv2\nimport numpy as np\nimport tensorflow as tf\nimport neuralgym as ng\n\nfrom .inpaint_model import InpaintCAModel\n\n\ncheckpoint_dir = 'generative_inpainting/models'\nFLAGS = ng.Config('generative_inpainting/inpaint.yml')\n\n\ndef run_fill(file_test, file_mask):\n model = InpaintCAModel()\n image... | [
[
"tensorflow.reverse",
"numpy.expand_dims",
"tensorflow.constant",
"tensorflow.get_collection",
"tensorflow.assign",
"numpy.concatenate",
"tensorflow.ConfigProto",
"tensorflow.reset_default_graph",
"tensorflow.contrib.framework.load_variable",
"tensorflow.Session",
"tens... |
GordonShinozaki/iust_deep_fuzz | [
"191e7bdf31840bd7d5052885029189bb6ffb262d"
] | [
"metadata_neural_fuzz_pdf_obj.py"
] | [
"\"\"\"\nPDF OBJ 9\n- New in version 9\n-- Create test data for format fuzzing (i.e p_t = 0.90) and prefix not update.\n-- Date: 1397-04-17\n- New in version 8\n-- Fuzzing back to generate_and_fuzz method.\n-- Perplexity and cross entropy add to metrics list.\n-- Use some Keras backend to reset model graph and stat... | [
[
"numpy.log",
"numpy.asarray",
"numpy.random.multinomial",
"numpy.argmax",
"numpy.argmin",
"numpy.exp",
"numpy.sum"
]
] |
rbktech/netket | [
"847e120cad48f9c92d394e2078370e452f268a3d"
] | [
"netket/logging/json_log.py"
] | [
"# Copyright 2021 The NetKet 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 required... | [
[
"numpy.issubdtype",
"numpy.array"
]
] |
aframires/freesound-loop-annotator | [
"a24e0c23bfc671e41e8627150e7b9fcae5c8cb13"
] | [
"data_analysis/audiocommons_ffont/ac_utils/plotting.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn\nseaborn.set(style=\"dark\")\n\n\ndef plot_waveform(audio, sample_rate=44100, show=True, title=None):\n plt.figure()\n if title is not None:\n plt.title(title)\n time = np.linspace(0, len(audio)/sample_rate, num=len(audio))\n pl... | [
[
"matplotlib.pyplot.vlines",
"matplotlib.pyplot.title",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.angle",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
Komal-99/Hand_gesture_mouse-keyboard | [
"c96ea29f2e7907bf670283d5fe089ff1e4213fe3"
] | [
"mouse_gesture.py"
] | [
"\r\nimport cv2 as cv\r\nimport mediapipe as mp\r\nimport numpy as np\r\nimport time\r\nimport pyautogui as p\r\nimport keyboard\r\nimport tkinter as tk\r\nfrom pynput.mouse import Button, Controller\r\n\r\nmouse = Controller()\r\nmp_drawing = mp.solutions.drawing_utils\r\nmp_hands = mp.solutions.hands\r\nroot=tk.T... | [
[
"numpy.abs",
"numpy.array",
"numpy.linalg.norm"
]
] |
quantumiracle/DQN_traffic_light_-control | [
"464c17ba25ebcb49f78d6cdcc96d7fe3764d7508"
] | [
"8.ddpg_for_grid/ddpg/models.py"
] | [
"import tensorflow as tf\nfrom common.models import get_network_builder\n\n\nclass Model(object):\n def __init__(self, name, network='mlp', **network_kwargs):\n self.name = name\n self.network_builder = get_network_builder(network)(**network_kwargs)\n\n @property\n def vars(self):\n re... | [
[
"tensorflow.concat",
"tensorflow.nn.sigmoid",
"tensorflow.random_uniform_initializer",
"tensorflow.get_collection",
"tensorflow.nn.tanh",
"tensorflow.variable_scope"
]
] |
BassyKuo/MicrosoftLearning-Azure-DP100 | [
"c57230e4a98f55308f8f533b26df3da50a4a3ffb"
] | [
"diabetes_pipeline/train_diabetes.py"
] | [
"# Import libraries\nfrom azureml.core import Run\nimport argparse\nimport pandas as pd\nimport numpy as np\nimport joblib\nimport os\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.metrics import roc_cur... | [
[
"sklearn.metrics.roc_auc_score",
"matplotlib.pyplot.title",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"sklearn.tree.DecisionTreeClassifier",
"numpy.float",
"matplotlib.pyplot.xlabel",
"nump... |
hikvisionresearch/opera | [
"0fb345a7ad0046c6fd674959c0ae19a65adeeacf"
] | [
"opera/models/dense_heads/petr_head.py"
] | [
"# Copyright (c) Hikvision Research Institute. All rights reserved.\nimport copy\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import (Linear, bias_init_with_prob, constant_init, normal_init,\n build_activation_layer)\nfrom mmcv.runner ... | [
[
"torch.nn.Sequential",
"torch.nn.functional.softmax",
"torch.floor",
"torch.cat",
"torch.nn.init.constant_",
"torch.zeros_like",
"torch.nn.Embedding",
"torch.nn.functional.interpolate",
"torch.stack",
"torch.nn.ReLU",
"torch.ones_like"
]
] |
varshini2305/orbitdeterminator | [
"b9c6bfb0553af3ee683da665cbb3764bd8bc5235"
] | [
"orbitdeterminator/kep_determination/ellipse_fit.py"
] | [
"\"\"\"Finds out the ellipse that best fits to a set of data points and calculates\n its keplerian elements.\n\"\"\"\n\nimport math\nimport argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom scipy.optimize import minimize\nfrom functools import partial\n\n... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.arctan2",
"numpy.max",
"numpy.argmin",
"numpy.cross",
"numpy.divide",
"numpy.matmul",
"numpy.sin",
"numpy.std",
"numpy.column_stack",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.linalg.inv",
"scipy.optimize.mini... |
InesPessoa/Capstone | [
"36dfd5941d638cbb75176b573645caff900dd4ee"
] | [
"code_1/model_with_autorization_code_regularized_amplitude.py"
] | [
"from features_creation import *\nfrom sklearn.metrics import classification_report, confusion_matrix\nfrom imblearn.over_sampling import SMOTE\nfrom sklearn.ensemble import AdaBoostClassifier\n\n\nif __name__ == \"__main__\":\n\n\n tresholds = [0, 20, 70]\n\n powers = [1, 2]\n\n for treshold in tresholds:... | [
[
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.metrics.classification_report",
"sklearn.metrics.confusion_matrix"
]
] |
filipi/cleftTracker | [
"a79989308a2bdd0c3a10e21d9df185bfb82c0864"
] | [
"more_tests/tracker.py"
] | [
"#!/usr/bin/env python\n\n#https://docs.opencv.org/3.3.1/d7/d8b/tutorial_py_lucas_kanade.html\nimport numpy as np\nimport cv2\nimport sys\n\nfeature_params = dict( maxCorners = 100, #100, # params for ShiTomasi corner detection\n qualityLevel = 0.2, #0.3,,#0.2,\n minDista... | [
[
"numpy.bitwise_and",
"numpy.zeros_like",
"numpy.ndarray",
"numpy.random.randint"
]
] |
JTiger0431/bert-as-service | [
"4bd981cacdde706d51e5e8828a4a496ab62648bb"
] | [
"server/bert_serving/server/__init__.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io>\nimport multiprocessing\nimport os\nimport random\nimport sys\nimport threading\nimport time\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom itertools import chain\nfrom multiproces... | [
[
"numpy.ascontiguousarray",
"tensorflow.python.estimator.run_config.RunConfig",
"numpy.zeros",
"tensorflow.python.estimator.model_fn.EstimatorSpec"
]
] |
jangenoe/InteractieveCursus | [
"8348c4f64f0c2a2ddca915814897483ff551b782"
] | [
"ToegepasteAnalogeElektronica/cursus.py"
] | [
"import matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nfrom matplotlib import patches\nimport scipy.signal as signal\n#import pandas as pd # nakijken of nog nodig\nimport numpy as np\nfrom PySpice.Probe.Plot import plot\nfrom PySpice.Spice.Parser import SpiceParser\nfrom PySpice.Spice.Netlist impor... | [
[
"scipy.signal.freqs",
"matplotlib.patches.Ellipse",
"numpy.abs",
"numpy.logspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.setp",
"numpy.angle",
"matplotlib.pyplot.show"
]
] |
EfratShimron/sigpy | [
"d140abf0fe7268851aec3be74d238a5ba8d2dd28"
] | [
"sigpy/linop.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"This module contains an abstraction class Linop for linear operators,\nand provides commonly used linear operators, including signal transforms\nsuch as FFT, NUFFT, and wavelet, and array manipulation operators,\nsuch as reshape, transpose, and resize.\n\"\"\"\nimport numpy as np\n\n... | [
[
"numpy.argsort",
"numpy.isscalar"
]
] |
Easonyesheng/BrainMRIProcess | [
"d58f8edbb3591a8bb506187778a275b18e76ca0b"
] | [
"De_bone.py"
] | [
"'''\nget rid of skull\n 1. use the original DICOM pixel array -- make the highest to 0\n 2. use conditional dilation\n'''\n\nimport cv2\nimport numpy as np \nfrom Imread import DicomIn \nfrom DilateAndErosion import *\nfrom PIL import Image,ImageQt\nimport time\n\n\nTempPath='/Users/zhangyesheng/Desktop/temp... | [
[
"numpy.argwhere",
"numpy.ones",
"numpy.where",
"numpy.zeros",
"numpy.sum"
]
] |
hoon0528/testpage | [
"08b5d5b18678fbd8c7526849c7dec69c09ccd230"
] | [
"tutorials/nengo/newsome_model.py"
] | [
"import nengo\nimport numpy as np\nfrom nengo.dists import Uniform\n\n\n# following are required for computing \n# the conditioned avg response\ncond_colour = []\ncond_motion = []\n\n\n#Monkey A inputs\nclass Experiment(object):\n def __init__(self, seed=None, interval=0.75, delay=0.75, blk_length=36):\n ... | [
[
"numpy.random.RandomState"
]
] |
Bobobert/RL_notebooks | [
"408430acca96d223a95210ca0b33297d6188ce95"
] | [
"A2Cv02/a2c_atari.py"
] | [
"from A2C import Agent, Learner, envMaker, config, ray\nfrom A2C.nets import AC_AtariHalf\nfrom A2C.functions import seeder, trainSync, graphResults\nfrom A2C.functions import NCPUS, expDir, saveConfig, Saver\nfrom torch.utils.tensorboard import SummaryWriter\nfrom math import ceil\n\nEXP = \"a2c\"\nNAME = \"Seaque... | [
[
"torch.utils.tensorboard.SummaryWriter"
]
] |
yuqiao1120/eightPuzzle | [
"f8a353756810ed832f9e15513f9dbd5ad895cd47"
] | [
"PK/ai7.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2020/10/9 16:48\n# @Author : Breeze\n# @Email : 578450426@qq.com\n# 初始状态\nimport numpy as np\n\n\"\"\"\n 由于 0 是空格,因此我们在考虑状态的逆序对问题的时候,就不需要考虑 0 对逆序对数量的影响。\n 也就是说我们只需要考虑:把整个3*3矩阵去掉 0 之后写成一个序列,这个序列逆序对的数量,以及两个状态的逆序对奇偶性是否相同。\n 如果两个状态的奇偶性相同,则这两个状态的奇偶性相互可达;否则相互不可达。\n\n 其次,我们再考虑移动数字... | [
[
"numpy.array"
]
] |
PeterJaq/optical_film_toolbox | [
"0e2d2bfa5f1f93d405a2f25ee50e51771be777a5"
] | [
"old_research/model/policy_gridient_softmax.py"
] | [
"import numpy as np\r\nimport tensorflow as tf\r\n\r\n# reproducible\r\nnp.random.seed(1)\r\ntf.set_random_seed(1)\r\n\r\n\r\nclass PolicyGradient:\r\n def __init__(\r\n self,\r\n n_actions,\r\n n_features,\r\n learning_rate=0.01,\r\n reward_decay=0.95,\r\n ... | [
[
"numpy.array",
"tensorflow.nn.softmax",
"tensorflow.summary.FileWriter",
"numpy.random.seed",
"tensorflow.reduce_mean",
"tensorflow.placeholder",
"tensorflow.constant_initializer",
"tensorflow.global_variables_initializer",
"numpy.std",
"numpy.zeros_like",
"numpy.mean",... |
aniruddhak1998/pytorch_RVAE | [
"b60a1d7d4453f76331e4b8460406558c92ea6b18"
] | [
"train.py"
] | [
"import argparse\nimport os\n\nimport numpy as np\nimport torch as t\nfrom torch.optim import Adam\n\nfrom utils.batch_loader import BatchLoader\nfrom utils.parameters import Parameters\nfrom model.rvae import RVAE\n\nif __name__ == \"__main__\":\n\n if not os.path.exists('data/word_embeddings.npy'):\n ra... | [
[
"numpy.random.normal",
"numpy.array",
"torch.load"
]
] |
biosustain/AnalyticsTools | [
"11eca81f0a504766cb68d4f77b688b41bd258650"
] | [
"tests/test_data/MFA_sampling/generate_visualization_test_data.py"
] | [
"# generate test_data\n# Last date : 27.05.2021\n# By : Matthias Mattanovich (matmat@biosustain.dtu.dk)\n# This script is intended to generate sample data and save them into the\n# test_data file. The saved objects will then be used to test the\n# MFA_visualization functions using unit testing.\nimport pickle\nimpo... | [
[
"pandas.set_option",
"pandas.read_csv"
]
] |
edding/socal-2019-nlp-complete | [
"d3b5c2d57da06b6682dd6aeec3d4070bf9c1f257"
] | [
"tf_models/utils.py"
] | [
"from typing import Any, List, BinaryIO\nimport os\nimport pickle\nimport logging\nfrom typing import Tuple\n\nfrom tensorflow.keras.models import model_from_json\nfrom tensorflow.keras.layers import Dense, Input, Dropout\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.feature_extraction.text im... | [
[
"matplotlib.pyplot.legend",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.plot",
"tensorflow.keras.layers.Dropout",
"sklearn.feature_extraction.text.TfidfVectorizer",
"tensorflow.keras.layers.Input... |
Querela/trump-biden-linguistic-style-analysis | [
"71d18fd42fecce652445db29b0344514d53b2529"
] | [
"process_tweets_nlp_counters.py"
] | [
"from collections import Counter\nfrom warnings import simplefilter\n\nimport pandas as pd\nfrom tqdm import tqdm\n\nsimplefilter(action=\"ignore\", category=FutureWarning)\ntqdm.pandas()\n\nFN_TWEETS_IN = \"data/Tweets_R_TrumpBiden_out.xlsx\"\nFN_TWEETS_OUT = \"data/Tweets_R_TrumpBiden_counters.xlsx\"\n\n\ndef cou... | [
[
"pandas.read_excel",
"pandas.ExcelWriter"
]
] |
Knowledge-Precipitation-Tribe/Deep-Learning | [
"7fdb9c3553af44c890c85702330244adbbcb418d"
] | [
"code/nn/model/DataReader.py"
] | [
"# -*- coding: utf-8 -*-#\n'''\n# Name: DataLoader\n# Description: \n# Author: super\n# Date: 2020/11/25\n'''\nimport numpy as np\nfrom pathlib import Path\n\nfrom model.Initialize import *\n\nclass DataReader(object):\n def __init__(self, train_file, test_file):\n self.train_file_n... | [
[
"numpy.random.seed",
"numpy.min",
"numpy.unique",
"numpy.max",
"numpy.random.permutation",
"numpy.zeros_like",
"numpy.load",
"numpy.zeros",
"numpy.vstack",
"numpy.random.randint"
]
] |
Dagu9/Reinforcement-learning-SGD | [
"a689fa1177cd34f32dd4d30a5a6140fb721855bf"
] | [
"usersimulator/ConfusionModel.py"
] | [
"###############################################################################\n# PyDial: Multi-domain Statistical Spoken Dialogue System Software\n###############################################################################\n#\n# Copyright 2015 - 2019\n# Cambridge University Engineering Department Dialogue Sy... | [
[
"numpy.delete",
"numpy.argsort",
"numpy.array",
"numpy.where",
"numpy.sum"
]
] |
lseventeen/PHTrans | [
"6152758bce653b723c5c1cc9a5ec203046bc6f88"
] | [
"PHTrans/phtrans/inference/metrics.py"
] | [
"import glob\r\nimport os\r\nimport SimpleITK as sitk\r\nimport numpy as np\r\nfrom batchgenerators.utilities.file_and_folder_operations import *\r\nfrom nnunet.utilities.task_name_id_conversion import convert_id_to_task_name\r\nfrom batchgenerators.utilities.file_and_folder_operations import join, isdir\r\nfrom me... | [
[
"numpy.hstack",
"numpy.array",
"numpy.mean",
"pandas.DataFrame"
]
] |
akshay9/DDPG-Continous-Control | [
"fcd7c031613a5d0f03cd1cf8d2bb807922a53989"
] | [
"model.py"
] | [
"import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\ndef hidden_init(layer):\n fan_in = layer.weight.data.size()[0]\n lim = 1. / np.sqrt(fan_in)\n return (-lim, lim)\n\nclass Actor(nn.Module):\n \"\"\"Actor (Policy) Model.\"\"\"\n\n def __init__(self, state_s... | [
[
"torch.nn.BatchNorm1d",
"numpy.sqrt",
"torch.cat",
"torch.manual_seed",
"torch.nn.Linear",
"torch.nn.functional.relu"
]
] |
mihaipx/SHIPcal | [
"45d108c82ca845546ef854c4624ac2d4f981cf0a"
] | [
"General_modules/func_General.py"
] | [
"\r\n#Miguel Frasquet\r\n\r\nimport numpy as np\r\nimport math\r\n#from matplotlib import pyplot as plt\r\n\r\ndef bar_MPa(pres):\r\n pres=pres/10\r\n return pres\r\ndef MPa_bar(pres):\r\n pres=pres*10\r\n return pres\r\ndef C_K(temp):\r\n temp=temp+273\r\n return temp\r\ndef K_C(temp):\r\n tem... | [
[
"numpy.amax",
"numpy.radians",
"numpy.mean",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.loadtxt"
]
] |
FrancescoFarinola/Anemia-Web-App | [
"4c33331fc985b6c645293837d3a9578621558470"
] | [
"model.py"
] | [
"import pandas as pd\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.ensemble import GradientBoostingClassifier\nimport cv2\nimport pickle\n\n\ndef predizione():\n scaler = StandardScaler() # scaler per normalizzare i dati\n data = pd.read_csv(\n \"train/unico_smote.csv\") # lettura d... | [
[
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"sklearn.ensemble.GradientBoostingClassifier"
]
] |
eschnett/asdf-cxx | [
"0d0fd304e32145c666abd6845999a5d659e49aa9"
] | [
"asdf-demo-external-python.py"
] | [
"#! /usr/bin/env python\n\nfrom __future__ import print_function\nimport numpy as np\n\nfrom asdf import *\n\n\n\ndef write_external():\n print(\"Writing external file...\")\n\n # The actual dataset\n alpha = ndarray.create_int64(\n np.array([1, 2, 3], np.int64), block_format_t_inline_array,\n ... | [
[
"numpy.array"
]
] |
trondkr/xESMF | [
"27952e1ab2f1b7b23c443953b9d1e079376efb08"
] | [
"xesmf/tests/test_backend.py"
] | [
"import os\nimport numpy as np\nimport ESMF\nimport xesmf as xe\nfrom xesmf.backend import (warn_f_contiguous, warn_lat_range,\n esmf_grid, add_corner, esmf_locstream,\n esmf_regrid_build, esmf_regrid_apply,\n esmf_regrid_finalize)\nfrom ... | [
[
"numpy.testing.assert_equal",
"numpy.abs",
"numpy.meshgrid",
"numpy.arange",
"numpy.round",
"numpy.array",
"numpy.zeros"
]
] |
Floou/python-adv | [
"9e2c518ab48eb4e9744c405470525f8931702525"
] | [
"210222/step_3.py"
] | [
"from random import randint\nfrom time import perf_counter\n\nimport numpy as np\nfrom random import randint\nfrom time import perf_counter\n\nimport numpy as np\n\nnums = [randint(1, 1000) for _ in range(10 ** 5)]\n\nnums_by_7 = [num for num in nums]\nstart = perf_counter()\nprint(sum(nums_by_7), perf_counter() - ... | [
[
"numpy.array"
]
] |
mrwu-mac/DIFNet | [
"a952d7c92b7577bed4767d97400ce470e95116b6"
] | [
"models/transformer/attention.py"
] | [
"import numpy as np\nimport torch\nfrom torch import nn\nfrom models.containers import Module\n\nfrom middle import TensorRecorder\n\nrecorder = TensorRecorder()\n\n\nclass ScaledDotProductAttention(nn.Module):\n '''\n Scaled dot-product attention\n '''\n\n def __init__(self, d_model, d_k, d_v, h, dropo... | [
[
"torch.nn.Dropout",
"torch.softmax",
"numpy.sqrt",
"torch.cat",
"torch.nn.init.constant_",
"torch.zeros",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.matmul",
"torch.relu",
"torch.nn.init.normal_",
"torch.FloatTensor",
"torch.nn.init.xavier_uniform_"
]
] |
cameronaaron/conversationai-moderator-reddit | [
"1c6528485aa3dc031d880210efdbbd5951ff0734"
] | [
"perspective_reddit_bot/compute_bot_metrics_test.py"
] | [
"# Copyright 2018 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 t... | [
[
"pandas.testing.assert_frame_equal",
"pandas.DataFrame"
]
] |
datadesk/census-data-aggregator | [
"a6eadcb65652b1fa1107087d5f413064e5cff9d6"
] | [
"census_data_aggregator/__init__.py"
] | [
"#! /usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import division\nimport math\nimport numpy\nimport warnings\nfrom .exceptions import DataError, SamplingPercentageWarning\n\n\ndef approximate_sum(*pairs):\n \"\"\"\n Sum estimates from the U.S. Census Bureau and approximate the combined margin... | [
[
"numpy.log",
"numpy.random.pareto",
"numpy.quantile",
"numpy.random.normal",
"numpy.mean",
"numpy.random.uniform"
]
] |
valley-joker/zvt | [
"7147725c6350adda54b95c3c40f5e70ce459e08a"
] | [
"zvt/recorders/joinquant/meta/stock_trade_day_recorder.py"
] | [
"# -*- coding: utf-8 -*-\nimport pandas as pd\nfrom jqdatapy.api import get_trade_days\n\nfrom zvt.contract.api import df_to_db\nfrom zvt.contract.recorder import TimeSeriesDataRecorder\nfrom zvt.domain import StockTradeDay, Stock\nfrom zvt.utils.time_utils import to_time_str\n\n\nclass StockTradeDayRecorder(TimeSe... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
MithellScott/Dyse-Robotics | [
"625787f97845c4cd883617b3cc32c2419dd88a73"
] | [
"src/dyse-robots/arman_control/scripts/Arm.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom Transformer import Transformer\nfrom mpl_toolkits.mplot3d import Axes3D\n\nclass Arm:\n\tdef __init__(self, init_joint_poses=None, motor_spin=[1,1,-1,-1,1], restrictions=None, default_joint_angles=[90, 135, 45, 0, 90]):\n\t\tif init_joint_poses is None:\n\t... | [
[
"numpy.radians",
"matplotlib.pyplot.subplot",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show"
]
] |
houseofleft/Processing | [
"13e65c9ef5918c153ed83dcb44c4b53277f8bdd6"
] | [
"visuals/2021-python/outline_delaunay.py"
] | [
"import shades\nfrom random import randint\nfrom scipy.spatial import Delaunay\n\ncanvas = shades.Canvas(1000, 1000)\nink = shades.NoiseGradient(\n noise_fields=[shades.NoiseField(scale=0.002) for i in range(3)],\n color=(100,150,200)\n)\n\npoints = [(randint(50, canvas.width-50), randint(50, canvas.height-50... | [
[
"scipy.spatial.Delaunay"
]
] |
evcu/meta-dataset | [
"bca9dd3964c908b607e8ff64628d5f1afa43386c"
] | [
"meta_dataset/analysis/select_best_model.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Meta-Dataset 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 require... | [
[
"tensorflow.gfile.ListDirectory",
"tensorflow.gfile.Open",
"tensorflow.flags.DEFINE_string",
"tensorflow.gfile.Exists",
"numpy.argmax",
"tensorflow.train.summary_iterator",
"tensorflow.logging.set_verbosity",
"tensorflow.flags.DEFINE_enum",
"tensorflow.app.run"
]
] |
jdye64/cudf | [
"a02f888badcd9cf7f81a0e32605f51d51085311f"
] | [
"python/cudf/cudf/core/column/timedelta.py"
] | [
"# Copyright (c) 2020-2021, NVIDIA CORPORATION.\n\nfrom __future__ import annotations\n\nimport datetime as dt\nfrom numbers import Number\nfrom typing import Any, Sequence, Tuple, Union, cast\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\n\nimport cudf\nfrom cudf import _lib as libcudf\nfrom cud... | [
[
"numpy.datetime_data",
"pandas.api.types.is_datetime64_dtype",
"numpy.isnat",
"numpy.dtype",
"pandas.Timedelta",
"numpy.timedelta64",
"numpy.isscalar",
"pandas.api.types.is_timedelta64_dtype"
]
] |
fAndreuzzi/GRAPE | [
"19eeb4447a2a1a3fd09dbb78ae22c78625b0f7e1"
] | [
"grape/general_graph.py"
] | [
"\"\"\"GeneralGraph for directed graphs (DiGraph) module\"\"\"\n\nfrom multiprocessing import Queue\nimport multiprocessing as mp\nfrom multiprocessing.sharedctypes import RawArray\nimport numpy as np\nimport sys\nimport csv\nimport ctypes\nimport logging\nimport warnings\nfrom itertools import chain\nimport copy\n... | [
[
"numpy.add.outer",
"numpy.tile",
"numpy.frombuffer",
"numpy.equal",
"numpy.fill_diagonal"
]
] |
nivosco/pycls | [
"e8b4ea18db0a15ca0c9c815c4ce791d2e88bc1f2"
] | [
"pycls/models/blocks.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"Common model blocks.\"\"\"\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom pycls.co... | [
[
"numpy.sqrt",
"torch.sum",
"torch.repeat_interleave",
"torch.from_numpy",
"torch.nn.Sigmoid",
"torch.sigmoid",
"torch.empty",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.Conv1d",
"torch.nn.BatchNorm2d",
"torch.nn.SiLU",
"numpy.cos",... |
paripooranan/Qiskit-India-Challenge | [
"7c016f85c9169c52f33c3d0a7a2f200477d2415d"
] | [
"answer_zz_2249.py"
] | [
"# the write_and_run function writes the content in this cell into the file \"feature_map.py\"\n\n### WRITE YOUR CODE BETWEEN THESE LINES - START\n \n# import libraries that are used in the function below.\nfrom qiskit import QuantumCircuit\nfrom qiskit.circuit import ParameterVector\nfrom qiskit.circuit.library... | [
[
"numpy.array"
]
] |
tianmingl/maincode | [
"724c60d5281ba3911ca065d9e144bb1b09e8257f"
] | [
"BiLstm_CNN_CRF_CWS/fenci_server.py"
] | [
"#coding:utf-8\n# py3.5+tensorflow-1.0.1+keras-2.0.6\n# seq2seq bilstm+cnn+crf\nimport os,re\nimport codecs \nimport pickle\nimport time\n\nimport bottle\nimport jieba\njieba.initialize()\n\nimport gc\nimport numpy as np\nnp.random.seed(1111)\n\nimport gensim\nimport random\n\nimport keras\n# keras.backend.clear_se... | [
[
"numpy.random.uniform",
"numpy.array",
"numpy.argmax",
"numpy.random.seed"
]
] |
NasaSpaceGrantRobotics/ASUR2019Drivetrain | [
"56c160a88008b558e87d8aac45f571c39e5fbafd"
] | [
"release/simpledrivetrain/simpledrivetrain/simple_drivetrain.py"
] | [
"import numpy as np\nfrom motor import Motor\nimport vectorutils as vutils\nfrom lxml import etree\n\n\nclass SimpleDrivetrain(object):\n def __init__(self, orientation=(0.0, 0.0, np.pi / 2.0)):\n self.__motors = None\n self.orientation = orientation\n\n def load_drivetrain_from_file(self, filep... | [
[
"numpy.dot",
"numpy.array",
"numpy.cos",
"numpy.sin"
]
] |
ssitaru/bodypart-id | [
"b46b0e18b041697dc27a029b978e27d911c9dca9"
] | [
"test.py"
] | [
"#!/usr/bin/python\n# This script predicts body part in test dataset\nimport os\n\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"PCI_BUS_ID\"\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\n\nimport numpy as np\nimport tensorflow\nfrom tensorflow import keras\nfrom keras import optimizers\nfrom keras.models import load_mode... | [
[
"numpy.expand_dims",
"numpy.vstack"
]
] |
abidsikder/mit_crushes_analysis | [
"ef793af9644e55d20f89bc97b2a4e7edec176596"
] | [
"in_out_degree.py"
] | [
"import pandas as pd\n\ndata = pd.read_csv(\"anonymized_crushes.csv\")\n\n# indegree\nkerb_in = {}\n# outdegree\nkerb_out = {}\n\nfor row in range(0, data.shape[0]):\n # filter out all the NaNs\n person_info = list(filter(lambda x: not (pd.isna(x)), data.iloc[row]))\n kerb = person_info[0]\n crushes = l... | [
[
"pandas.isna",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
Nishitha77/interfacegan | [
"20be1b1861a0a71dfad44ad61d517a8bef73bddc"
] | [
"models/stylegan_tf_official/metrics/perceptual_path_length.py"
] | [
"# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.\r\n#\r\n# This work is licensed under the Creative Commons Attribution-NonCommercial\r\n# 4.0 International License. To view a copy of this license, visit\r\n# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to\r\n# Creative Commons, PO... | [
[
"tensorflow.device",
"tensorflow.math.cos",
"tensorflow.control_dependencies",
"tensorflow.reduce_mean",
"tensorflow.reduce_sum",
"tensorflow.stack",
"tensorflow.reshape",
"numpy.percentile",
"numpy.concatenate",
"tensorflow.math.sin",
"numpy.mean",
"tensorflow.squa... |
james-alvey-42/BoostedDM | [
"72ff9c707657f95806bea759cb819c2a8e90b23c",
"72ff9c707657f95806bea759cb819c2a8e90b23c"
] | [
"Code/Python/limits.py",
"Code/Python/atmos_dm_flux.py"
] | [
"# File: limits.py\n\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport sys\nimport scipy.stats\n\nfrom atmos_dm_flux import kdemultifit\nfrom mean_free_path import TzMin\n\ndef get_kernel(particle):\n r\"\"\"\n Obtains the kernel and the normalisation f... | [
[
"matplotlib.pyplot.legend",
"numpy.sqrt",
"matplotlib.pyplot.plot",
"numpy.histogram",
"matplotlib.pyplot.gca",
"pandas.read_csv",
"numpy.arange",
"numpy.sin",
"matplotlib.pyplot.axis",
"numpy.load",
"matplotlib.pyplot.figure",
"numpy.power",
"numpy.logspace",
... |
chudur-budur/models | [
"bb3aab1606aa1b207a1d05f4dadc298c6f8fd4cc"
] | [
"research/object_detection/dataset_tools/create_coco_tf_record.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... | [
[
"numpy.amax",
"tensorflow.compat.v1.gfile.MakeDirs",
"tensorflow.compat.v1.flags.DEFINE_string",
"tensorflow.compat.v1.gfile.IsDirectory",
"tensorflow.compat.v1.gfile.GFile",
"tensorflow.compat.v1.flags.DEFINE_boolean",
"tensorflow.compat.v1.get_logger",
"tensorflow.compat.v1.train... |
BaoWentz/AdvancedEAST-PyTorch | [
"a835c8cedce4ada1bc9580754245183d9f4aaa17"
] | [
"nms.py"
] | [
"# coding=utf-8\nimport numpy as np\n\nimport cfg\n\n\ndef should_merge(region, i, j):\n neighbor = {(i, j - 1)}\n return not region.isdisjoint(neighbor)\n\n\ndef region_neighbor(region_set):\n region_pixels = np.array(list(region_set))\n j_min = np.amin(region_pixels, axis=0)[1] - 1\n j_max = np.ama... | [
[
"numpy.amax",
"numpy.amin",
"numpy.around",
"numpy.reshape",
"numpy.zeros"
]
] |
kakul/Article-Extraction | [
"a8a9a432fe86dd94a6108b08a64cb749b5db1df6"
] | [
"Image detection/imgtag.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mp\nfrom skimage.filter.rank import entropy,otsu\nfrom skimage.filter import threshold_otsu\nfrom skimage.morphology import square,rectangle,label,closing,disk,binary_erosion,opening\nfrom skimage.color import label2rgb,rgb2gray\nfro... | [
[
"numpy.logical_xor",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.subplots"
]
] |
kangdh/hdmf | [
"680b68a1bbc9377590862574daea83579a3d52bc"
] | [
"src/hdmf/common/resources.py"
] | [
"import pandas as pd\nimport re\nfrom . import register_class, EXP_NAMESPACE\nfrom . import get_type_map\nfrom ..container import Table, Row, Container, AbstractContainer\nfrom ..utils import docval, popargs\nfrom ..build import TypeMap\n\n\nclass KeyTable(Table):\n \"\"\"\n A table for storing keys used to r... | [
[
"pandas.concat",
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame"
]
] |
luomingshuang/speechbrain | [
"f9d8f643e7ce56cd7dd20fd93be0acb15da3c499"
] | [
"recipes/LibriSpeech/ASR/inference-with-k2/utils/lm_rescore.py"
] | [
"# Copyright (c) 2021 Xiaomi Corporation (authors: Fangjun Kuang)\n\nfrom typing import Dict\nfrom typing import List\nfrom typing import Optional\n\nimport math\n\nimport k2\nimport torch\n\n\ndef _intersect_device(a_fsas: k2.Fsa, b_fsas: k2.Fsa, b_to_a_map: torch.Tensor,\n sorted_match_a: b... | [
[
"torch.zeros_like",
"torch.no_grad",
"torch.arange",
"torch.zeros"
]
] |
CarstenWalther/space-tyckiting | [
"8398f080332c78c7f246289947fdda49558e0f12"
] | [
"clients/python/tyckiting_client/ai/strategies/escaping.py"
] | [
"import random\nimport logging\n\nimport numpy as np\n\nfrom tyckiting_client import hexagon\nfrom tyckiting_client.messages import Pos\n\nfrom tyckiting_client.notifications import defaultNotificationCenter\nfrom tyckiting_client.notifications import ID_START_ROUND_NOTIFICATION\nfrom tyckiting_client.gameField imp... | [
[
"numpy.array"
]
] |
shaytexel/python-pesq | [
"f591b77a25f35e58a11db3bccc2d082b2e15155f"
] | [
"tests/test.py"
] | [
"\nfrom scipy.io import wavfile\nfrom pathlib import Path\nfrom pesq import pesq\n\n\nfrom scipy.io import wavfile\nfrom pesq import pesq\n\nrate, deg = wavfile.read(\"./dgaudio/dgu_af1s01.wav\")\nrate, ref = wavfile.read(\"./audio/u_af1s01.wav\")\n\nprint(pesq(8000, ref, deg, 'wb'))"
] | [
[
"scipy.io.wavfile.read"
]
] |
Oneflow-Inc/tvm | [
"81cc89b59085164f5c83a73a7010fd72a2d60c69"
] | [
"tests/python/frontend/oneflow/test_forward.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.random.randn",
"numpy.random.rand"
]
] |
tiberiuichim/nlp-service | [
"6bb641de532afb8c001d40bf30caadcbd227a91d"
] | [
"app/api/questiongeneration/lib/questiongeneration.py"
] | [
"# Code from https://github.com/AMontgomerie/question_generator\n\nimport json\nimport random\nimport re\n\nimport en_core_web_trf\nimport numpy as np\nimport torch\nfrom transformers import (AutoModelForSeq2SeqLM,\n AutoModelForSequenceClassification, AutoTokenizer)\n\n\nclass QuestionGene... | [
[
"torch.no_grad",
"numpy.where",
"torch.cuda.is_available"
]
] |
jonghun-jeong/pytorch_VDSR | [
"514b021044018baf909e79f48392783daa592888"
] | [
"vdsr.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nfrom math import sqrt\r\n\r\nclass Conv_ReLU_Block(nn.Module):\r\n def __init__(self):\r\n super(Conv_ReLU_Block, self).__init__()\r\n self.conv = nn.Conv2d(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=False)\r\n self.rel... | [
[
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.add"
]
] |
Kolyan-1/MSc-Thesis-Code | [
"c651805b82a9e1087c1e18f80839c977a3ba2352"
] | [
"TF/dev_profilingTF2.py"
] | [
"import tensorflow as tf\nimport numpy as np\nx = tf.get_variable('a',initializer=tf.constant(np.array([[1.,2.,3.],[4.,5.,6.]])))\ny = tf.get_variable('b',initializer=tf.constant(np.array([[1],[4]])))\n\n\n\n\nsess = tf.Session()\n\nsess.run(tf.global_variables_initializer())\na = tf.reduce_mean(x, axis=0, keep_dim... | [
[
"tensorflow.global_variables_initializer",
"numpy.array",
"tensorflow.Session",
"tensorflow.reduce_mean"
]
] |
xin-alice/cs159_safe_learning | [
"44761774c38cec36f156b2978b5eb5ec1ca712e9"
] | [
"safe_learning/tests/test_functions.py"
] | [
"\"\"\"Unit tests for the functions file.\"\"\"\n\nfrom __future__ import division, print_function, absolute_import\n\nfrom numpy.testing import assert_equal, assert_allclose\nimport pytest\nimport numpy as np\nfrom scipy.optimize import check_grad\nimport tensorflow as tf\n\nfrom safe_learning.functions import (_T... | [
[
"tensorflow.variables_initializer",
"numpy.math.factorial",
"numpy.all",
"numpy.testing.assert_equal",
"numpy.hstack",
"tensorflow.Graph",
"tensorflow.Variable",
"numpy.arange",
"tensorflow.gradients",
"tensorflow.Session",
"numpy.zeros",
"tensorflow.placeholder",
... |
felixriese/susi | [
"fa405e683eda30850900c14d214e732862ef4180"
] | [
"susi/SOMClustering.py"
] | [
"\"\"\"SOMClustering class.\n\nCopyright (c) 2019-2021 Felix M. Riese.\nAll rights reserved.\n\n\"\"\"\n\nimport itertools\nfrom typing import List, Optional, Sequence, Tuple\n\nimport numpy as np\nimport scipy.spatial.distance as dist\nfrom joblib import Parallel, delayed, effective_n_jobs\nfrom sklearn.decomposit... | [
[
"numpy.dot",
"numpy.linspace",
"numpy.cumsum",
"numpy.max",
"scipy.spatial.distance.cityblock",
"numpy.mean",
"numpy.random.randint",
"numpy.subtract",
"numpy.stack",
"numpy.full",
"numpy.copy",
"scipy.spatial.distance.mahalanobis",
"numpy.zeros",
"numpy.mul... |
TSummersLab/Risk_Bounded_Nonlinear_Robot_Motion_Planning | [
"717b9f07f4ed625ee33ab8ec22ce78dc2907d759"
] | [
"Unicycle Simulation/scripts/tracking_controller.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nChangelog:\nNew in version 1_0:\n- Create script to run and test functions in `lqr.py`\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAuthor:\nBen Gravell\nEmail:\nbenjamin.gravell@utdallas.edu\nGithub:\... | [
[
"numpy.diag",
"numpy.hstack",
"numpy.dot",
"numpy.clip",
"numpy.arange",
"numpy.eye",
"numpy.cos",
"numpy.sin",
"numpy.copy",
"numpy.block",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.zeros"
]
] |
dingcheng0107/rnn_cnn_text_classify | [
"bc31651e050ea45264a32da51f756b789a2a33ad"
] | [
"cnn_model.py"
] | [
"# coding: utf-8\n\nimport tensorflow as tf\n\n\nclass TCNNConfig(object):\n \"\"\"CNN配置参数\"\"\"\n\n embedding_dim = 64 # 词向量维度,相当于图片的3通道数\n seq_length = 600 # 序列长度,句子的长度\n num_classes = 2 # 类别数\n num_filters = 256 # 卷积核数目\n kernel_size = 6 # 卷积核尺寸\n vocab_size = 5000 # 词汇表达小\n\n hidde... | [
[
"tensorflow.layers.conv1d",
"tensorflow.nn.relu",
"tensorflow.device",
"tensorflow.get_variable",
"tensorflow.reduce_max",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.softmax",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tensorflow.placeholder",
... |
rahulatrkm/Hippocampal-Volume-Quantification-in-Alzheimer-s-Progression | [
"21d78cbbda9edb0c215bcbb4cc9551f1734e08c0"
] | [
"section3/src/inference_dcm.py"
] | [
"\"\"\"\nHere we do inference on a DICOM volume, constructing the volume first, and then sending it to the\nclinical archive\n\nThis code will do the following:\n 1. Identify the series to run HippoCrop.AI algorithm on from a folder containing multiple studies\n 2. Construct a NumPy volume from a set of DICOM... | [
[
"numpy.max",
"numpy.array",
"numpy.flip",
"numpy.stack"
]
] |
airicbear/calculus-homework | [
"a765d3ba35b2b3794b9b2cce038152682eeb2cb8"
] | [
"2019-05/figures/595_25.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n# Plot the function\nf = lambda x: x ** 3 - 3 * x + 1\nxp = np.linspace(-2, 2, 100)\nplt.plot(xp, f(xp))\nplt.xlabel('x')\nplt.ylabel('f(x)')\n\n# Plot extrema and points of inflection\nx = np.array([-1, 0, 1])\ny = np.array([f(i) for i in x])\nplt.scatter(x, ... | [
[
"matplotlib.pyplot.scatter",
"numpy.linspace",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
saketkattu/Handwritting-to-Text-Converter | [
"854203eec564f4620aa9d8870d7e4bcd449c45c1"
] | [
"text-convertor/text_recoginzer/models/transformer_util.py"
] | [
"\"\"\"Position Encoding and other utilities for Tranformers\"\"\"\nimport math\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\n\n\n\n\nclass PositionalEncoding(torch.nn.Module):\n \"\"\"Classic Attention-is-all-you-need positional encoding.\"\"\"\n\n def __init__(self, d_model: int, dropout: ... | [
[
"torch.nn.Dropout",
"torch.ones",
"torch.sin",
"torch.zeros",
"torch.arange",
"torch.cos"
]
] |
imnotk/Octave-convolution-sonnet | [
"fe040ae8752a6cbba27300ef44d6a8d8195ee4a3"
] | [
"resnet.py"
] | [
"import tensorflow as tf \nimport sonnet as snt \n\nfrom octave_conv import OctaveUnit2d\nfrom octave_conv import unit2d\n\nclass basicblock(snt.AbstractModule):\n\n expansion = 1\n def __init__(self,depth=64,stride=(1,1),ratio=0.5, is_first = False,name='bottleneck'):\n super(basicblock,self).__init__... | [
[
"tensorflow.nn.relu",
"tensorflow.nn.max_pool",
"tensorflow.global_variables",
"tensorflow.placeholder",
"tensorflow.squeeze",
"tensorflow.nn.avg_pool",
"tensorflow.variable_scope"
]
] |
diazona/pandas | [
"af7bdd3883c8d61e9d9388d3aa699930eee7fff8"
] | [
"pandas/tools/tests/test_util.py"
] | [
"import os\nimport locale\nimport codecs\nimport nose\n\nimport numpy as np\nfrom numpy.testing import assert_equal\n\nimport pandas as pd\nfrom pandas import date_range, Index\nimport pandas.util.testing as tm\nfrom pandas.tools.util import cartesian_product, to_numeric\n\nCURRENT_LOCALE = locale.getlocale()\nLOCA... | [
[
"pandas.util.testing._can_set_locale",
"pandas.Series",
"pandas.util.testing._skip_if_windows",
"pandas.DataFrame",
"pandas.util.testing.set_locale",
"pandas.util.testing.assert_index_equal",
"numpy.testing.assert_equal",
"pandas.util.testing.get_locales",
"pandas.util.testing.... |
mtar/heat | [
"35aac8c0aaafa2dcb350ad86514e61da9ee05a50"
] | [
"heat/core/tests/test_tiling.py"
] | [
"import torch\n\nimport heat as ht\nfrom .test_suites.basic_test import TestCase\n\n\nclass TestSplitTiles(TestCase):\n # most of the cases are covered by the resplit tests\n def test_raises(self):\n length = torch.tensor([i + 20 for i in range(2)], device=self.device.torch_device)\n test = torc... | [
[
"torch.all",
"torch.Size",
"torch.ones",
"torch.equal",
"torch.tensor",
"torch.prod"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.