repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
george200150/Licenta | [
"9c3f7d86abf3cc5d90204db0acc956eb8bee26dc"
] | [
"Processor/tsne.py"
] | [
"import argparse\nfrom tqdm import tqdm\nimport cv2\nimport torch\nimport random\nimport numpy as np\nfrom sklearn.manifold import TSNE\nimport matplotlib.pyplot as plt\n\nfrom ResNeSt.encoding.models.backbone import resnet101, resnest101, resnest200\nfrom animals10 import AnimalsDataset, collate_skip_empty, colors... | [
[
"matplotlib.pyplot.imshow",
"numpy.take",
"numpy.random.seed",
"numpy.min",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"numpy.ones",
"numpy.concatenate",
"numpy.max",
"sklearn.manifold.TSNE",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.array",
... |
fwtan/tensorflow | [
"5e6479904941624cf7ce58ab3d236375c8012ef4",
"5e6479904941624cf7ce58ab3d236375c8012ef4"
] | [
"tensorflow/python/client/session_test.py",
"tensorflow/python/autograph/operators/control_flow_test.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.core.protobuf.config_pb2.RunMetadata",
"numpy.asarray",
"tensorflow.python.ops.state_ops.assign_add",
"tensorflow.core.protobuf.config_pb2.GraphOptions",
"tensorflow.python.ops.control_flow_ops.while_loop",
"tensorflow.core.protobuf.config_pb2.RunOptions",
"tensorflow.pytho... |
lukassnoek/3DDFA_V2 | [
"4a37541cb1d21480aa4a70c82416fcfdc95eacd9"
] | [
"tddfa/utils/uv.py"
] | [
"# coding: utf-8\n\n__author__ = 'cleardusk'\n\nimport cv2\nimport numpy as np\nimport os.path as osp\nimport scipy.io as sio\n\nfrom ..Sim3DR import rasterize\nfrom .functions import plot_image\nfrom .io import _load\nfrom .tddfa_util import _to_ctype\n\nmake_abs_path = lambda fn: osp.join(osp.dirname(osp.realpath... | [
[
"numpy.maximum",
"numpy.clip",
"scipy.io.loadmat",
"numpy.concatenate",
"numpy.round",
"numpy.floor",
"numpy.zeros"
]
] |
sdpython/pyensae | [
"ada4dbb0b9901bf481eff2ea239e74ed964d93b0"
] | [
"_unittests/ut_sql/test_database_df.py"
] | [
"\"\"\"\n@brief test log(time=10s)\n\nYou should indicate a time in seconds. The program ``run_unittests.py``\nwill sort all test files by increasing time and run them.\n\"\"\"\nimport os\nimport unittest\nimport pandas\nfrom pyquickhelper.loghelper import fLOG\nfrom pyensae.sql.database_main import Database\n... | [
[
"pandas.DataFrame"
]
] |
DanielKotik/Optical-beams-MEEP | [
"ca145119e5bd0f0804d846ea42e35e4c3daa91de"
] | [
"optbeam/_3d/helpers.py"
] | [
"\nimport sys\n\ntry:\n import cython\n cython_imported = True\nexcept ModuleNotFoundError:\n cython_imported = False\n\nif cython_imported:\n if cython.compiled:\n from scipy import LowLevelCallable\n else:\n print(\"\\nPlease consider compiling `%s.py` via Cython: \"\n \"... | [
[
"scipy.LowLevelCallable.from_cython",
"scipy.integrate.dblquad"
]
] |
t3hseus/ariadne | [
"b4471a37741000e22281c4d6ff647d65ab9e1914",
"b4471a37741000e22281c4d6ff647d65ab9e1914"
] | [
"ariadne/tracknet_v2/processor.py",
"ariadne_v2/data_chunk.py"
] | [
"import logging\nimport os\nfrom typing import List, Tuple, Optional, Iterable\n\nimport gin\nimport pandas as pd\nimport numpy as np\n\nfrom ariadne.preprocessing import (\n BaseTransformer,\n DataProcessor,\n DataChunk,\n ProcessedDataChunk,\n ProcessedData\n)\n\nLOGGER = logging.getLogger('ariadne... | [
[
"numpy.savez",
"numpy.save",
"numpy.stack",
"numpy.concatenate",
"numpy.load",
"numpy.array"
],
[
"pandas.DataFrame.from_dict"
]
] |
lllcho/tensorlayer | [
"87591b4945a6a67dfb4ea797a575efae997fd9d2",
"87591b4945a6a67dfb4ea797a575efae997fd9d2"
] | [
"tests/test_layers_basic.py",
"tensorlayer/layers/convolution.py"
] | [
"import tensorflow as tf\nimport tensorlayer as tl\n\nx = tf.placeholder(tf.float32, [None, 100])\nn = tl.layers.InputLayer(x, name='in')\nn = tl.layers.DenseLayer(n, 80, name='d1')\nn = tl.layers.DenseLayer(n, 80, name='d2')\nprint(n)\nn.print_layers()\nn.print_params(False)\nprint(n.count_params())\n\nif n.count_... | [
[
"tensorflow.placeholder"
],
[
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.nn.conv2d_transpose",
"tensorflow.nn.atrous_conv2d",
"tensorflow.nn.depthwise_conv2d",
"tensorflow.n... |
steffanschlein/cythonwrapper | [
"ef30a3bc1a24024b9845dad4aa8a42e05219bd91"
] | [
"test/test_type_conversions.py"
] | [
"import numpy as np\nfrom pywrap.testing import cython_extension_from\nfrom nose.tools import assert_equal, assert_raises\n\n\ndef test_bool_in_bool_out():\n with cython_extension_from(\"boolinboolout.hpp\"):\n from boolinboolout import A\n a = A()\n b = False\n assert_equal(not b, a.... | [
[
"numpy.array"
]
] |
DiNOV-Tokyo/uied-d | [
"c15d7e003dda13c24cfd0c17b4efb058dcc3b292"
] | [
"train_ResNet152.py"
] | [
"# https://qiita.com/daichimizuno/items/d1a255fa56960302bcc5\nfrom PIL import Image\nimport numpy as np\nimport glob\nimport os\nfrom keras.utils import np_utils\nfrom keras.models import Sequential, Model\nfrom keras.layers import Flatten, Dense, Input, Dropout\nfrom sklearn.model_selection import train_test_split... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.asarray",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"numpy.array",
"tensorflow.keras.optimizers.SGD"... |
iliya-s/pyscf | [
"81774efc036b721f7ab9963e21b1bd01e7472de0"
] | [
"pyscf/solvent/ddcosmo.py"
] | [
"#!/usr/bin/env python\n# Copyright 2014-2019 The PySCF Developers. 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/LIC... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.einsum",
"numpy.asarray",
"numpy.arange",
"numpy.ndarray",
"numpy.zeros_like",
"numpy.count_nonzero",
"numpy.zeros",
"numpy.where",
"numpy.empty"
]
] |
MyWhiteCastle/datasets | [
"e75a54948bb8aaf9cf45933a538502d2f66c41a6"
] | [
"tensorflow_datasets/image/open_images.py"
] | [
"# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets 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 ... | [
[
"tensorflow.io.gfile.GFile",
"numpy.sqrt"
]
] |
nevinadalal/intro-to-ds | [
"5ae7bd0f0f998961cc49552fc2fc79577603f514"
] | [
"Introduction-to-Data-Science/code.py"
] | [
"# --------------\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n# Read the data\ndata = pd.read_csv(path)\n# print the first 5 rows of the dataset\nprint(data.head())\n\n# Split the data into independent and target variable\nX = data.drop(['G3'],1)\ny = data.G3\n# Split the data into... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.accuracy_score"
]
] |
SriMethan/python-tictactoe | [
"40dcd64c7a42c1e4a94eb40d54e985f7165f46c2"
] | [
"tictactoe/__init__.py"
] | [
"import itertools\r\nimport numpy\r\n\r\nX = 1\r\nO = 2\r\n\r\n\r\nclass Board:\r\n def __init__(self, dimensions=(3, 3), x_in_a_row=3):\r\n self.dimensions = dimensions\r\n self.x_in_a_row = x_in_a_row\r\n self.board = self.create_board()\r\n self._directions = self.find_directions()... | [
[
"numpy.zeros",
"numpy.multiply",
"numpy.argwhere"
]
] |
txsing/RobustNet | [
"e5bc6f3234f2140a265279999d7ba91e6cd7011f"
] | [
"datasets/kitti.py"
] | [
"\"\"\"\r\nKITTI Dataset Loader\r\n\"\"\"\r\n\r\nimport os\r\nimport sys\r\nimport numpy as np\r\nfrom PIL import Image\r\nfrom torch.utils import data\r\nimport logging\r\nimport datasets.uniform as uniform\r\nimport datasets.cityscapes_labels as cityscapes_labels\r\nimport json\r\nfrom config import cfg\r\n\r\n\r... | [
[
"numpy.array"
]
] |
TomasTrnkaPLC/TrainYourOwnYOLO | [
"9c831d0c14046fe436378a7407a62dd247a3ef82"
] | [
"2_Training/Train_YOLO.py"
] | [
"\n\nimport os\nimport sys\nimport argparse\nimport time\nimport datetime\ndef get_parent_dir(n=1):\n \"\"\" returns the n-th parent dicrectory of the current\n working directory \"\"\"\n current_path = os.path.dirname(os.path.abspath(__file__))\n for k in range(n):\n current_path = os.path.dirna... | [
[
"tensorflow.compat.v1.ConfigProto",
"numpy.random.seed",
"numpy.random.shuffle",
"tensorflow.compat.v1.Session",
"numpy.array",
"tensorflow.__version__.startswith"
]
] |
kuc2477/pytorch-wgan-gp | [
"0a1e8bd719577ffd7061059fcf26bc61fe2bd076"
] | [
"train.py"
] | [
"from torch import optim\nfrom torch.autograd import Variable\nfrom tqdm import tqdm\nimport utils\nimport visual\n\n\ndef train(model, dataset, collate_fn=None,\n lr=1e-04, weight_decay=1e-04, beta1=0.5, beta2=.999, lamda=10.,\n batch_size=32, sample_size=32, epochs=10,\n d_trains_per_g_... | [
[
"torch.autograd.Variable"
]
] |
Amdis23/Tapestry_Intial | [
"7924380692df59fed3c3b982a2de0558cac3a419"
] | [
"algos/clustered_sbl.py"
] | [
"# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=8\n\n# Imports the precise variant of SBL using clustering method instead of\n# thresholding\n\nfrom inbuilt_algos import sbl\n\nimport numpy as np\n\n# Use thresholding method 'cluster' for SBL to get very precise results\ndef clustered_sbl(params):\n A = param... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
damirmardanov/figure-generator | [
"1ed7ee6d423f2d7392e95529336b8f2d35ea65fd"
] | [
"Plotter.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy.random as rnd\n\n\nclass Plotter:\n @staticmethod\n def plot(figure=None, figures=None, filename='output.png', height=27, width=27):\n fig = plt.figure(0, figsize=(height / 102, width / 102), dpi=102)\n ax = fig.add_subplot(111, aspect='equal')\n ... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"numpy.random.rand",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
]
] |
pdooner/azure-cosmos-db-mongo-migration | [
"35e0e2f606c27fdd681c57095aac1038f12ce88e"
] | [
"m2c/mongoexport_pk_analyze.py"
] | [
"\n\"\"\"\nUsage:\n python mongoexport_analyze.py hello_matplotlib\n ---\n source env.sh\n export infile=$M2C_APP_DATA_DIR/mongoexports/openflights/openflights__routes.json\n python mongoexport_pk_analyze.py pk_analysis $infile\n\"\"\"\n\n\n\n__author__ = 'Chris Joakim'\n__email__ = \"chjoakim@mic... | [
[
"numpy.linspace",
"numpy.cos",
"matplotlib.pyplot.savefig",
"numpy.sin",
"pandas.read_json",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use"
]
] |
gbalke/bldc-controller | [
"99e4e71d5bdc0c7c7901d886aa7709c66db8b718"
] | [
"tools/dev/characterize.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import division\nfrom comms import *\nimport serial\nimport sys\nimport time\nimport pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import curve_fit\nfrom scipy.integrate import odeint\n\nPWM_DUTY_CYCLE = 0.3\n\nif len(sys.argv) >= 3:\n # ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.arange",
"scipy.integrate.odeint",
"matplotlib.pyplot.plot",
"numpy.max",
"matplotlib.pyplot.ylabel",
"numpy.std",
"numpy.exp",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"scipy.optimize.curve_... |
brandontan99/MVSNet | [
"18bfe23cfa54f8bfe1ac160aadef8a811b9dd94b"
] | [
"mvsnet/test.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nCopyright 2019, Yao Yao, HKUST.\nTest script.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport time\nimport sys\nimport math\nimport argparse\nimport numpy as np\n\nimport cv2\nimport tensorflow as tf\ntf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR... | [
[
"numpy.squeeze",
"tensorflow.global_variables",
"tensorflow.cast",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.data.Dataset.from_generator",
"tensorflow.app.flags.DEFINE_boolean",
"tensorflow.app.flags.DEFINE_integer",
"numpy.stack",
"tensorflow.ConfigProto",
"numpy.c... |
TedrosGitHub/TSA-yatsm | [
"8e328f366c8fd94d5cc57cd2cc42080c43d1f391"
] | [
"yatsm/masking.py"
] | [
"from __future__ import division\n\nimport numpy as np\n\nfrom .accel import try_jit\nfrom .regression import robust_fit as rlm\n\nndays = 365.25\n\n\n@try_jit() # np.array prevents nopython\ndef multitemp_mask(x, Y, n_year, crit=400,\n green=1, swir1=4,\n maxiter=10):\n \"\"... | [
[
"numpy.ones_like",
"numpy.isnan",
"numpy.cos",
"numpy.sin",
"numpy.ceil"
]
] |
harrow/computational_QM | [
"d8a2060bee6a55c4b8bf937ad96feed10227373b"
] | [
"2_tensor_networks/a_mps.py"
] | [
"\"\"\"Toy code implementing a matrix product state.\"\"\"\n\nimport numpy as np\nfrom scipy.linalg import svd\n\n\nclass MPS:\n \"\"\"Class for a matrix product state.\n\n We index sites with `i` from 0 to L-1; bond `i` is left of site `i`.\n We *assume* that the state is in right-canonical form.\n\n P... | [
[
"numpy.diag",
"numpy.real_if_close",
"numpy.log",
"scipy.linalg.svd",
"numpy.reshape",
"numpy.linalg.norm",
"numpy.ones",
"numpy.tensordot",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
CMLPlatform/pysuttoio | [
"4d0c2de6c7d6d90e9caf4b5b361e5046828bf113"
] | [
"pySUTtoIO/transformation_model_b.py"
] | [
"import math\nimport numpy as np\nimport os.path\nimport pySUTtoIO.tools as tl\nimport pySUTtoIO.sut as st\nfrom pySUTtoIO.secondary_flows import make_secondary as ms\n\n\nclass TransformationModelB:\n \"\"\"A supply-use table to input-output table transformation object.\n From the supply-use table a product-... | [
[
"numpy.dot",
"numpy.nditer",
"numpy.linalg.inv",
"numpy.nan_to_num",
"numpy.ones",
"numpy.transpose",
"numpy.sum"
]
] |
7starsea/shark | [
"5030f576da6f5998728d80170480e68a3debfe79"
] | [
"shark/trainer/trainer_base.py"
] | [
"# coding=utf-8\nimport os.path\nimport torch\nimport numpy as np\nfrom abc import ABC, abstractmethod\n\nfrom torch.utils.tensorboard import SummaryWriter\nfrom shark.replay import ReplayBufferBase, SimpleReplayBuffer\n\n\nclass RLConfig(object):\n def __init__(self, batch_size=256):\n self.batch_size = ... | [
[
"torch.no_grad",
"torch.where"
]
] |
kemfic/SimpleVO | [
"4dffad27c47ca8a20bbc4dea75128b0f45c94d61"
] | [
"utils.py"
] | [
"# Utility functions\nimport cv2\nimport numpy as np\nimport quaternion\nfrom params import param\n\ndef bgr2gray(img):\n return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n\ndef getCorners(img, params=param.get(\"gftt\")):\n \"\"\"\n - Example from: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_... | [
[
"numpy.int0",
"numpy.dot",
"numpy.sqrt",
"numpy.eye",
"numpy.subtract",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"numpy.arctan2",
"numpy.identity",
"numpy.transpose",
"numpy.array"
]
] |
rmarcacini/cc-meli2019 | [
"57139212b0afce5ada550c903516e5b919347b7b"
] | [
"meli/sampling.py"
] | [
"from tqdm import tqdm\nimport pandas as pd\n\n\ndef balanced_sampling(df, num_instances=500):\n\n\n L = []\n counter = 1\n categories = df['category'].unique()\n for category in tqdm(categories):\n sample = df[df.category==category]\n try:\n sample_reliable = sample[sample.labe... | [
[
"pandas.concat"
]
] |
cheonbok94/Pytorch-Latent-Constraints-Learning-to-Generate-Conditionally-from-Unconditional-Generative-Models | [
"0dbd182b294e0c6d3ad0deda3be1dd855fd57617"
] | [
"main.py"
] | [
"import argparse \r\nimport numpy \r\nfrom model.trainer import Trainer,AC_Trainer \r\nfrom model.loss import loss_function,celeba_loss\r\n\r\n\r\nfrom model.vae import Mnist_VAE,Celeba_VAE\r\nfrom utils.get_data import MNIST_DATA ,Celeba_DATA\r\nfrom model.model import Actor,Critic\r\nimport torch\r\n\r\ndef main(... | [
[
"torch.cuda.set_device"
]
] |
ericosmic/2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement | [
"54417d43d71af37588f3a8141aa34d151e5b7884"
] | [
"recognize_process/tools/mytest_crnn.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 19-11-19 23:45\n# @Author : Miao Wenqiang\n# @Reference : https://github.com/MaybeShewill-CV/CRNN_Tensorflow\n# https://github.com/bai-shang/crnn_ctc_ocr.Tensorflow\n# @File : test_crnn.py\n# @IDE : P... | [
[
"tensorflow.nn.ctc_beam_search_decoder",
"tensorflow.placeholder",
"numpy.ones",
"tensorflow.ConfigProto",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.array"
]
] |
ZiningWang/Inferring-Spatial-Uncertainty-in-Object-Detection | [
"3fc7c8d78e538805d928ba084c1c4570f795babc"
] | [
"utils/probability_utils.py"
] | [
"import numpy as np\r\nimport os\r\nimport sys\r\nfrom tqdm import tqdm\r\nfrom utils.kitti_utils import boxes3d_to_corners3d\r\n\r\n\r\nclass cov_interp:\r\n\t#interpterlate covariance matrix of Var[X(w)] = cov[\\Phi(Y)ww^T\\Phi(Y)^T] where w is n*1 and Y is m*n (Var[X] is m*m)\r\n\t#Y is a fixed random variable m... | [
[
"numpy.diag",
"numpy.abs",
"numpy.triu_indices",
"numpy.matmul",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
jss367/detectron2 | [
"085fda47bc49f2cdd9c05a895580b2b31fcdb6c3"
] | [
"projects/DensePose/densepose/engine/trainer.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport logging\nimport os\nfrom collections import OrderedDict\nfrom typing import List, Optional, Union\nimport torch\nfrom torch import nn\n\nfrom detectron2.checkpoint import DetectionCheckpointer\nfrom detectron2.config import CfgNode\nf... | [
[
"torch.optim.SGD"
]
] |
mctouch/dlrm_for_pytorch | [
"a6572655053bbca0461af87c5ce30042950282bc"
] | [
"preproc/split_dataset.py"
] | [
"# Copyright (c) 2020 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 obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.iinfo"
]
] |
Artelys/Safer-Roads | [
"ba9eb4b2c0f02c40142caa612ed7998c7ee01155",
"ba9eb4b2c0f02c40142caa612ed7998c7ee01155"
] | [
"flask/harmonisation/corporel.py",
"flask/training_corporel.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 31 12:54:46 2020\n\n@author: aboutet\n\"\"\"\nimport pandas as pd\nimport sys\nimport os\nimport Get_Location as gl\nfrom datetime import datetime, timedelta\n\nsys.path.append( \"/home/begood/flask/cluster/\")\nfrom functions import list_directory, getContext, f... | [
[
"pandas.read_csv"
],
[
"sklearn.metrics.roc_auc_score",
"pandas.read_csv",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.confusion_matrix",
"pandas.DataFrame",
"sklearn.preprocessing.StandardScaler",
"sklearn.metrics.recall_score",
"sklearn.metrics.accuracy_sc... |
paolodidio/flatland-bologna | [
"3a493e686ae5c38f59b9f8230ce541cd0d0f4a9d"
] | [
"src/observations.py"
] | [
"\"\"\"\nCollection of environment-specific ObservationBuilder.\n\"\"\"\nimport collections\nfrom typing import Optional, List, Dict, Tuple\nfrom networkx.classes import graph\nfrom networkx.drawing.nx_pylab import draw\n\nimport numpy as np\n\nfrom flatland.core.env import Environment\n\nfrom flatland.core.env_obs... | [
[
"numpy.array_equal",
"numpy.max",
"numpy.delete",
"numpy.argmax",
"numpy.identity",
"numpy.count_nonzero",
"numpy.reciprocal",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
qrsforever/torchcv | [
"e2e17f730497fb838237357a1df4bf6ca278f107",
"e2e17f730497fb838237357a1df4bf6ca278f107"
] | [
"model/det/layers/rpn_detection_layer.py",
"model/cls/loss/agent_center_loss.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You(youansheng@gmail.com)\n\n\nimport torch\nimport torch.nn as nn\n\n\nclass RPNDetectionLayer(nn.Module):\n def __init__(self, configer):\n super(RPNDetectionLayer, self).__init__()\n self.configer = configer\n self.num_anchor... | [
[
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.cat"
],
[
"torch.nn.functional.normalize",
"torch.randn",
"torch.zeros_like"
]
] |
Nikunj-Gupta/voi | [
"ba7e3f887e92ccb97b11172831bdda33b57dbb13"
] | [
"utils/agent.py"
] | [
"import torch\n\nimport utils\nfrom .other import device\nfrom value import VoI\n\n\nclass Agent:\n \"\"\"An agent.\n\n It is able:\n - to choose an action given an observation,\n - to analyze the feedback (i.e. reward and done state) of its action.\"\"\"\n\n def __init__(self, obs_space, action_spac... | [
[
"torch.tensor",
"torch.no_grad",
"torch.zeros"
]
] |
ucfnlp/summarization-sing-pair-mix | [
"994f6246431255bb2cabbfd515d07c84cf94e870"
] | [
"decode.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n# Modifications Copyright 2017 Abigail See\n# Modifications made 2018 by Logan Lebanoff\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... | [
[
"tensorflow.train.Saver"
]
] |
nibrunie/thegameia | [
"e320aef799da44d61087099527c57dc3a518e6bd"
] | [
"strategy/nn_utils.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\n\n\ndef value_to_one_hot(value):\n \"\"\" covert index @p value to a one-hot vector of size 60 (card state)\n encoding index \"\"\"\n vector = new_empty_vector()\n vector[value-1] = 1\n return vector\n\ndef new_empty_vector():\n return np.zeros(6... | [
[
"numpy.zeros"
]
] |
odidev/mpld3 | [
"7bb37b9a9e6d1c90dd9f83075d1987541bb087d5",
"7bb37b9a9e6d1c90dd9f83075d1987541bb087d5"
] | [
"mpld3/test_plots/test_mouse_events.py",
"examples/linked_brush.py"
] | [
"\"\"\"Plot to test mouse events\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport mpld3, mpld3.plugins as plugins\n\nrandom_x = [0.037984906849671374, 0.5880357008425118, 0.47736125281329767, 0.010304252492200239, 0.35796828706754447, 0.23109561146897417, 0.8631302372372742, 0.13444834717909937, 0... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close"
],
[
"matplotlib.pyplot.NullFormatter",
"numpy.random.random",
"sklearn.datasets.load_iris",
"matplotlib.pyplot.subplots"
]
] |
MRXLT/PaddleHub | [
"f92d0edd18057044ef248d7f2c42d8f347b62fbf"
] | [
"demo/senta/predict.py"
] | [
"#coding:utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport ast\nimport numpy as np\nimport os\nimport time\n\nimport paddle\nimport paddle.fluid as fluid\nimport paddlehub as hub\n\n# yapf: disable\nparser = argparse.Argu... | [
[
"numpy.argmax"
]
] |
DarkContact/m.css | [
"a56227e89de90d0ea5751d0ebfa96734a5e55b96"
] | [
"plugins/m/plots.py"
] | [
"#\n# This file is part of m.css.\n#\n# Copyright © 2017, 2018, 2019 Vladimír Vondruš <mosra@centrum.cz>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restrict... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close"
]
] |
qianpeisheng/SRFBN_CVPR19 | [
"6ace659b743cea7ae1fc20ba4a505ee2fd7c75f9"
] | [
"networks/edsr_arch.py"
] | [
"# Enhanced Deep Residual Networks for Single Image Super-Resolution\n# https://arxiv.org/abs/1707.02921\n\nimport math\n\nimport torch\nimport torch.nn as nn\n\ndef default_conv(in_channels, out_channels, kernel_size, bias=True):\n return nn.Conv2d(\n in_channels, out_channels, kernel_size,\n padd... | [
[
"torch.nn.Sequential",
"torch.Tensor",
"torch.nn.PReLU",
"torch.nn.Conv2d",
"torch.eye",
"torch.nn.PixelShuffle",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
gabrielesartor/td_learning_maze | [
"c7b561c88b68eee3f87aa723ab182c592ebc440a"
] | [
"td_learning_maze.py"
] | [
"import sys\nimport numpy as np\nimport math\nimport random\nimport time\nimport matplotlib.pyplot as plt\nimport pickle\n\nimport gym\nimport gym_maze\n\n\"\"\"\nImplementation of TD methods for the maze environment.\n(you can find the environment here: https://github.com/MattChanTK/gym-maze)\n\"\"\"\n\n#Simulatio... | [
[
"numpy.max",
"numpy.argmax",
"numpy.mean",
"numpy.random.rand",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.pause"
]
] |
LBNL-UCB-STI/activitysim | [
"7d88cf34c833d68068987bf8bf6af48a6ad706ec"
] | [
"activitysim/abm/models/trip_mode_choice.py"
] | [
"# ActivitySim\n# See full license in LICENSE.txt.\nfrom builtins import zip\nfrom builtins import range\n\nimport logging\n\nimport pandas as pd\n\nfrom activitysim.core import simulate\nfrom activitysim.core import tracing\nfrom activitysim.core import config\nfrom activitysim.core import inject\nfrom activitysim... | [
[
"pandas.merge",
"pandas.concat",
"pandas.Series"
]
] |
HumanCompatibleAI/evaluating_rewards | [
"7b99ec9b415d805bd77041f2f7807d112dec9802"
] | [
"src/evaluating_rewards/analysis/distances/transformations.py"
] | [
"# Copyright 2019, 2020 DeepMind Technologies Limited, Adam Gleave\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# ... | [
[
"pandas.concat",
"pandas.MultiIndex.from_frame"
]
] |
dssg/mlpolicylab_fall20_schools3_public | [
"f8eff4c56e9bada1eb81ddaca03686d7ef53c2c4"
] | [
"schools3/data/explorers/labels_explorer.py"
] | [
"import pandas as pd\nfrom schools3.data.explorers.explorer import Explorer\nfrom schools3.data import common_queries\n\n\nclass LabelsExplorer(Explorer):\n def __init__(self, debug=False):\n super(LabelsExplorer, self).__init__(debug)\n self.labels_df = pd.DataFrame(columns=[\n 'label',... | [
[
"pandas.Series",
"pandas.DataFrame"
]
] |
mlvc-lab/AIChallenge_4th_Round1 | [
"2a7cd64254540a5779bc3d9accdb21ddaa38aa51"
] | [
"quantization/lsq/iqnn.py"
] | [
"import math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.parameter import Parameter\n\nfrom .quantizer import LSQ\n\n\nclass QuantConv2d(nn.Conv2d):\n def __init__(self, in_channels, out_channels, kernel_size, stride=1,\n padding=0, dilation=1, groups=1,... | [
[
"torch.nn.functional.linear",
"torch.Tensor"
]
] |
neerajwagh/eeg-self-supervision | [
"fb0a1bf357b0e553aab9c4ccfc2973156dc8a9e7"
] | [
"evaluation/ablation_models_eval.py"
] | [
"import argparse\nimport parser\nimport sys\n\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom sklearn.metrics import (balanced_accuracy_score, classification_report,\n f1_score, precision_score, recall_score,\n roc_auc_score, roc_curve)\nfrom torc... | [
[
"sklearn.metrics.roc_auc_score",
"torch.nn.functional.softmax",
"torch.max",
"torch.load",
"torch.cat",
"torch.utils.data.DataLoader",
"pandas.DataFrame",
"torch.no_grad",
"numpy.mean",
"torch.cuda.is_available",
"sklearn.metrics.f1_score",
"sklearn.metrics.classifi... |
Faudil/sound-encoding-neural-network | [
"daadaddd53881f656b097398b48eac90340132f1"
] | [
"src/classifiers/digit/mlp.py"
] | [
"import keras\nimport numpy as np\nfrom keras_preprocessing.sequence import pad_sequences\nfrom keras.layers import Dense, Dropout, Conv1D, Activation, Flatten, MaxPooling1D, BatchNormalization, LSTM\nfrom keras.models import Sequential\nfrom python_speech_features import mfcc\n\nfrom src.sound.SoundTransformer imp... | [
[
"numpy.mean"
]
] |
ScottyLectronica/kubric | [
"31930b4a8517d1fc5987bb1502e47f130209505a"
] | [
"kubric/simulator/pybullet.py"
] | [
"# Copyright 2022 The Kubric Authors.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by a... | [
[
"tensorflow.io.gfile.copy"
]
] |
tuantran1810/advanced-nlp | [
"35b4f156f6e3c3efaaf0014b101aa33bdc519c6b"
] | [
"models/text_generator.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nclass TextGeneratorModel(nn.Module):\n def __init__(self, vocab_size, emb_size, hidden_lstm, string_length = 250, hidden_fc = 200, lstm_layers = 2, batch_size = 32):\n super(TextGeneratorModel, sel... | [
[
"torch.nn.functional.softmax",
"torch.nn.LSTM",
"torch.zeros",
"torch.randn",
"torch.nn.Embedding",
"torch.tanh",
"torch.nn.Linear",
"torch.matmul"
]
] |
KDriesen/slippy | [
"816723fe6ab9f5ed26b14b4fe0f66423649b85e6"
] | [
"slippy/contact/quasi_static_step.py"
] | [
"import numpy as np\nfrom numbers import Number\nimport typing\nimport warnings\n\nfrom .steps import _ModelStep\nfrom ._model_utils import get_gap_from_model\nfrom ._step_utils import HeightOptimisationFunction, make_interpolation_func\n\n__all__ = ['QuasiStaticStep']\n\n\nclass QuasiStaticStep(_ModelStep):\n \... | [
[
"numpy.abs",
"numpy.linspace",
"numpy.max",
"numpy.array",
"numpy.isinf"
]
] |
WeidongLi-KG/KBGAN_Pytorch-v0.4.1 | [
"26f545ecf305ee1fc428901313a45b9766280433"
] | [
"trans_d.py"
] | [
"import os\nimport logging\nimport numpy as np\nimport torch as t\nimport torch.nn as nn\nimport torch.nn.functional as f\nfrom config import config\nfrom torch.optim import Adam, SGD, Adagrad\nfrom torch.autograd import Variable\nfrom data_utils import batch_by_num\nfrom base_model import BaseModel, BaseModule\n\n... | [
[
"torch.randperm",
"torch.from_numpy",
"torch.nn.Embedding",
"torch.autograd.Variable"
]
] |
DanielWinklehner/py_rfq_helper | [
"98a471f529c9418f822c7c711bcbd8dd50bbb0ff"
] | [
"py_rfq_helper/plotbunchdata.py"
] | [
"import matplotlib.pyplot as plt\nimport pickle\nimport numpy as np\n\nbunch = pickle.load(open(\"bunch_particles.2.dump\", \"rb\"))\n\nz = bunch[\"z\"]\nvz = bunch[\"vz\"]\ny = bunch[\"y\"]\nx = bunch[\"x\"]\nxp = bunch[\"xp\"]\nyp = bunch[\"yp\"]\nidx = np.where(vz > 2.5e6)\n#idx = np.where(vz > 0)\n\nplt.scatter... | [
[
"matplotlib.pyplot.title",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.where",
"matplotlib.pyplot.ylabel"
]
] |
andreamust/TPSD | [
"aa2bd70fb0439c9bea6cac949bb2fc555b187245"
] | [
"src/tpsd.py"
] | [
"# pylint: disable=line-too-long\n\"\"\"\nThis script contains a Python 3 re-implementation of the Tonal Pith Space Distance (TPSD) algorithm as presented in:\n\nDe Haas, W.B., Veltkamp, R.C., Wiering, F.: Tonal pitch step distance: a similarity measure for chord progressions.\nIn: ISMIR. pp. 51–56 (2008)\n\nAuthor... | [
[
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
louis-pre/NewsBlur | [
"b4e9a56041ff187ef77b38dfd0778daf41b53f4f"
] | [
"apps/rss_feeds/icon_importer.py"
] | [
"import urllib.request\nimport urllib.error\nimport urllib.parse\nimport lxml.html\nimport numpy\nimport scipy\nimport scipy.misc\nimport scipy.cluster\nimport struct\nimport operator\nimport gzip\nimport datetime\nimport requests\nimport base64\nimport http.client\nfrom PIL import BmpImagePlugin, PngImagePlugin, I... | [
[
"scipy.cluster.vq.kmeans",
"scipy.argmax",
"scipy.product",
"scipy.array",
"numpy.array",
"scipy.cluster.vq.vq"
]
] |
prog-autom/hidden-demo | [
"26912cc2abe9984f204b9d5e0b1defb49a59d326"
] | [
"src/experiment.py"
] | [
"from sklearn import datasets\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport seaborn as sb\n\nfrom sklearn.linear_model import RidgeCV\nfrom sklearn.ensemble import GradientBoostingRegressor\nfrom sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error\nfrom sklearn import model_... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.barh",
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.mean_squared_error",
"numpy.concatenate",
"sklearn.datasets.load_boston",
"numpy.exp",
"numpy.arange",
"sklearn.ensemble.GradientBoostin... |
ashrefm/dt-grade-prediction | [
"6600f5fed8ccb44ba5493694ba57185742e6c898"
] | [
"app.py"
] | [
"# MIT License\n#\n# Copyright (c) 2019 Mohamed-Achref MAIZA\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, c... | [
[
"numpy.concatenate",
"numpy.append",
"numpy.array",
"numpy.linalg.norm"
]
] |
shoefer/ball_catching | [
"46b2e95894659347b563123c1c23742437755993"
] | [
"ball_catching/dynamics/world.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jun 16 11:24:25 2016\n\n@author: shoefer\n\"\"\"\n\nimport numpy as np\nimport os\nimport pandas as pd\n\nfrom ball_catching.utils.cont2discrete import cont2discrete\n\n# -----\n# state dim\n# 0 -> xb\n# 1 -> xb'\n# 2 -> xb''\n# 3 -> yb\n# 4 -> yb'\n# 5 -... | [
[
"numpy.dot",
"pandas.read_pickle",
"numpy.sqrt",
"numpy.abs",
"numpy.arcsin",
"numpy.isnan",
"numpy.asarray",
"numpy.linalg.norm",
"numpy.nan_to_num",
"numpy.arctan2",
"numpy.all",
"numpy.ceil",
"numpy.random.normal",
"numpy.random.randn",
"numpy.any",
... |
Tastalian/avp-rrt-rss-2013 | [
"d3d9b50bb582c23a4ee83408b26bcede4d84469e"
] | [
"rrtcmp/misc.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2013 Stephane Caron <stephane.caron@normalesup.org>\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# http:/... | [
[
"numpy.fmod"
]
] |
Project-Fare/quantum_computation | [
"fc182007d0cf7cca170efdbcb442576fde5927ff"
] | [
"TFQ/qosf/gates.py"
] | [
"import numpy as np\r\nimport math\r\n\r\nouter_00 = np.array([[1, 0], [0, 0]])\r\nouter_11 = np.array([[0, 0], [0, 1]])\r\n\r\nclass X(object):\r\n def __init__(self, qubit=None) -> None:\r\n super().__init__()\r\n self.op = np.array([\r\n [0, 1],\r\n [1, 0]\r\n ])\r\n... | [
[
"numpy.exp",
"numpy.array"
]
] |
ryankirkland/voice-of-the-customer | [
"0214af45cc6aa76bfce64065f07c3f4781ee045e"
] | [
"dashboard/app/reviewmodel.py"
] | [
"from sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.decomposition import LatentDirichletAllocation\n\n\nclass ReviewLDA():\n\n def __init__(self, n_components=5, learning_decay=0.7):\n self.lda = LatentDirichletAllocation(n_component... | [
[
"sklearn.decomposition.LatentDirichletAllocation",
"sklearn.model_selection.GridSearchCV",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
hjwdzh/FrameNet | [
"fe5cc45148f210ad9a2520a576ad92f5f282ca71"
] | [
"src/demo/AttachTexture.py"
] | [
"import cv2\nimport skimage.io as sio\nimport sys\nimport numpy as np\nfrom visualizer import app\nfrom direction import *\nimport scipy.misc as misc\nimport argparse\n\nparser = argparse.ArgumentParser(description='Process saome integers.')\nparser.add_argument('--input', type=str, default='selected/0000')\nparser... | [
[
"numpy.ascontiguousarray",
"scipy.misc.imresize",
"numpy.array",
"numpy.min"
]
] |
timothymillar/cyvcf2 | [
"acde4eab6e441f01f25cca48afc921343a810fa3"
] | [
"cyvcf2/tests/test_reader.py"
] | [
"from __future__ import print_function\nfrom ..cyvcf2 import VCF, Variant, Writer\nimport numpy as np\nimport os.path\nfrom nose.tools import assert_raises\nimport tempfile\nimport sys\nimport os\nimport atexit\ntry:\n from pathlib import Path\nexcept ImportError:\n from pathlib2 import Path # python 2 backport\... | [
[
"numpy.array",
"numpy.int32"
]
] |
jay-z007/neumann-optimizer | [
"c931631346a1097d198983684d7c68d91ae82d39"
] | [
"NeumannOptimizerNumpy.py"
] | [
"import numpy as np\nimport time\nfrom math import exp\nimport matplotlib.pyplot as plt\n\ndef gradient_descent( func, initial_x, eps=1e-5, maximum_iterations=65536, learning_rate=1e-2 ):\n \"\"\"\n Gradient Descent\n func: the function to optimize It is called as \"value, gradient = func( x,... | [
[
"numpy.matrix",
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.legend",
"numpy.arange",
"numpy.linalg.norm",
"matplotlib.pyplot.draw",
"numpy.asmatrix",
"matplotlib.pyplot.plot",
"numpy.mean",
"matplotlib.pyplot.contour",
"matplotlib.pyplot.ion",
"numpy.double",
... |
nrjl/GPN | [
"c7bd98d69e075ef05bcb2a443c02a71a916a71f4"
] | [
"GPy_regression_demo.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Polygon\n#from matplotlib.collections import PatchCollection\nimport nice_plot_colors as npc\nimport GPy\nplt.rc('font',**{'family':'serif','sans-serif':['Computer Modern Roman']})\nplt.rc('text', usetex=True)\n\n\nnp.random.seed(1... | [
[
"numpy.random.random",
"numpy.sqrt",
"numpy.random.seed",
"numpy.linspace",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.subplots",
"numpy.sin",
"numpy.append",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.zeros"
]
] |
cylance/rogers | [
"a2300ed518fa01e0f2fcb77f1c10f7124ea7f49a"
] | [
"src/rogers/__main__.py"
] | [
"\"\"\" Entry points for Rogers malware similarity tool\n\"\"\"\nfrom . import config\nfrom . import store\nfrom .index import Index\nfrom .generated import Feature\nfrom .sample import pe\nfrom . import logger as l\nfrom . import api\n\nimport argparse\nimport pandas as pd\n\n\nlog = l.get_logger('rogers')\n\n\nIN... | [
[
"pandas.read_csv"
]
] |
paocarvajal1912/VIXM-Algorithmic-Strategy | [
"acc8fa7cc735638f1605cd7a8785e01b499f5d58"
] | [
"vixcoin_functions/feature_functions.py"
] | [
"# Vixm Feature Functions\n\nimport pandas as pd\nfrom arch import arch_model\nimport yfinance as yf\nfrom datetime import datetime\nimport numpy as np\n\n\ndef garch_fit_and_predict(series, ticker, horizon=1, p=1, q=1, o=1, print_series_name=False):\n #p=1,q=1, o=1 \n #series=returns_df['spy']\n #horizon=... | [
[
"pandas.DataFrame"
]
] |
doudoupo/ray | [
"9aa0b4e89e240efe2d5c7ec17b6f2cd48ea2e021"
] | [
"python/ray/tests/test_object_spilling_3.py"
] | [
"import json\nimport re\nimport platform\nimport sys\nimport zlib\nimport shutil\nimport time\nfrom collections import defaultdict\nimport random\n\nimport numpy as np\nimport pytest\nimport ray\nfrom ray._private.test_utils import wait_for_condition\nfrom ray.tests.test_object_spilling import is_dir_empty, assert_... | [
[
"numpy.array_equal",
"numpy.ones",
"numpy.random.rand",
"numpy.zeros",
"numpy.empty"
]
] |
andreroche/Project2018 | [
"d110e1c0c06368644b7212b6872d61551011dbfc"
] | [
"Project_Rev9.py"
] | [
"# André Roche 27-Apr-2018 Project Final - Programming and Scripting, Fisher's IRIS Data Set.\r\n# The program / script was developed in blocks or segments as learning and investigation continued. \r\n# This includes learning of python as a tool in addition to the investigation of the dataset.\r\n# For ease of rev... | [
[
"scipy.stats.f_oneway",
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"scipy.stats.normaltest",
"numpy.min",
"numpy.median",
"sklearn.datasets.load_iris",
"numpy.genfromtxt",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.max",
"numpy.std",
"pandas... |
ancientmooner/mmsegmentation | [
"1af2ad6a9f0a69e848c3cf8c307f75120c7f99b6"
] | [
"mmseg/models/decode_heads/decode_head.py"
] | [
"from abc import ABCMeta, abstractmethod\n\nimport torch\nimport torch.nn as nn\nfrom mmcv.cnn import normal_init\n\nfrom mmseg.core import build_pixel_sampler\nfrom mmseg.ops import resize\nfrom ..builder import build_loss\nfrom ..losses import accuracy\n\n\nclass BaseDecodeHead(nn.Module, metaclass=ABCMeta):\n ... | [
[
"torch.nn.Conv2d",
"torch.nn.Dropout2d",
"torch.cat"
]
] |
danlamanna/ShapeWorks | [
"58ffac86cbea1e7f0b4ede9ff6ded167bd5dfc14"
] | [
"Python/DataAugmentationUtilsPackage/DataAugmentationUtils/Visualize.py"
] | [
"import csv\nimport re\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport pandas as pd \nfrom bokeh.document import Document\nfrom bokeh.embed import file_html\nfrom bokeh.layouts import gridplot\nfrom bokeh.models import (BasicTicker, Circle, ColumnDataSourc... | [
[
"numpy.array",
"matplotlib.pyplot.savefig",
"pandas.DataFrame"
]
] |
qw85639229/Car_License_SVM | [
"c5b0062e84e5000c7940b1d90cc7c63e52afed21"
] | [
"recog_car_license_reshapevideo.py"
] | [
"#coding=UTF-8\nimport argparse\nimport logging\nimport os\n\nimport cv2\nimport numpy as np\nimport torch\nfrom PIL import Image, ImageDraw, ImageFont\nfrom torchvision import transforms\n\nfrom OCR_For_Car_License.cnn import ConvNet_Car_License\nfrom detect_car_license import detect_car_license\n# import caffe\n#... | [
[
"numpy.hstack",
"numpy.hsplit",
"numpy.max",
"numpy.array",
"numpy.where",
"numpy.sum"
]
] |
bgallag6/specFit | [
"60dc329b8a7f15c219245ecb2296aee8787cae93"
] | [
"specVis_old.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 5 21:05:07 2018\n\n@author: Brendan\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.optimize import curve_fit as Fit\nimport sunpy\nimport sunpy.cm\nfrom scipy import fftpack\nfrom matplotlib import cm\nfrom mpl_toolkits.axes_grid1 imp... | [
[
"matplotlib.pyplot.axes",
"numpy.zeros_like",
"numpy.exp",
"numpy.where",
"matplotlib.pyplot.subplot2grid",
"scipy.optimize.curve_fit",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"numpy.reshape",
"numpy.arange",
"numpy.copy",
"numpy.load",
"matpl... |
macarl08/esc180_coursework | [
"16f2adda1f35875b91020e72cb4180d2e45690ce"
] | [
"misc/script/civ_midspan_deflection.py"
] | [
"# civ_midspan_deflection.py\n# CIV102 Bridge Project\n\n# Fall 2021\n# Group 403\n# Group Members:\n# - Carl Ma\n# - Abdullah Fawzy\n# - Albert Zhang\n\n\n# ------------------------------ IMPORT MODULES ------------------------------ #\n\nimport math\nimport numpy as np\n\n# ------------------------------ CONST... | [
[
"numpy.trapz"
]
] |
patrjon/pyigra2 | [
"437ee3c17caa9393a3464aeac0559b6323382d3c"
] | [
"pyigra2/derived.py"
] | [
"# STD-lib\n# 3rd-party\nimport numpy as np\n\n# Local\nfrom pyigra2.base import IGRABase\n\n\nclass Derived(IGRABase):\n def __init__(self, filename):\n # Init parent class\n super().__init__(filename)\n\n # Set file specific headers and parameters\n # OBS! These index values are exa... | [
[
"numpy.char.replace",
"numpy.array"
]
] |
adiso75/mlrun | [
"0da2e72a1e2aa189074bd2ec059f2bc452f349cf"
] | [
"tests/system/feature_store/test_feature_store.py"
] | [
"import os\nimport random\nimport string\nimport uuid\nfrom datetime import datetime\n\nimport fsspec\nimport pandas as pd\nimport pyarrow.parquet as pq\nimport pytest\nfrom storey import EmitAfterMaxEvent, MapClass\n\nimport mlrun\nimport mlrun.feature_store as fs\nfrom mlrun.data_types.data_types import ValueType... | [
[
"pandas.read_csv",
"pandas.Categorical",
"pandas.Timedelta",
"pandas.DataFrame",
"pandas.read_parquet",
"pandas.Timestamp.now",
"pandas.Timestamp"
]
] |
spectre-team/spectre-divik | [
"8e5cec5bc0040eb01cf6621bfb0753886f58524b"
] | [
"test/kmeans/__init__.py"
] | [
"import numpy as np\n\ndata = np.array([\n [1, 1, 1, 1],\n [2, 4, 2, 2],\n [1.9, 4.2, 1.9, 1.9],\n [2, 2, 2, 2],\n [1.1, 0.8, 1.1, 1.1],\n [1000, 490231, -412342, -7012]\n])\n"
] | [
[
"numpy.array"
]
] |
cash/dworp | [
"b7b0280183d4fa54b65bf5a3d4008bf64b7434dc"
] | [
"examples/axelrod_aurora_test1.py"
] | [
"__author__ = 'schmiac1'\n\n\"\"\"\nAurora's Attempt to quickly implement Axelrod model of...\n\nThe Dissemination of Culture: A Model with Local Convergence and Global Polarization\nRobert Axelrod\nJournal of Conflict Resolution\nVol 41, Issue 2, pp. 203 - 226\nApril 1, 1997\nhttp://journals.sagepub.com/doi/10.117... | [
[
"numpy.random.RandomState",
"numpy.random.seed",
"numpy.random.randint"
]
] |
arled-papa/marc | [
"cb94636d786e215195e914b37131277f835bcf52"
] | [
"plot_functions/mem_plot_heatmap.py"
] | [
"#!/usr/bin/env python3\n#\n# Copyright (c) 2021 Arled Papa\n# Author: Arled Papa <arled.papa@tum.de>\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/... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.ylabel",
"numpy.add",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"numpy.meshgrid",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.show",
"matplotlib.pypl... |
VinulaUthsara/FYP-PrototypeV2 | [
"e7b629c30c10e6042b8ff2bd68fd6c7df3d46d4b"
] | [
"test.py"
] | [
"# -*- coding: utf-8 -*-\n# @Date : 2019-07-25\n# @Author : Xinyu Gong (xy_gong@tamu.edu)\n# @Link : None\n# @Version : 0.0\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport cfg\nimport models\nfrom functions import validate\nfrom util... | [
[
"numpy.random.normal",
"torch.cuda.manual_seed",
"torch.load"
]
] |
bytedance/raylink | [
"cd83a4377fede1ac645037df567010f2ddac5a69"
] | [
"raylink/algorithms/demo/policy.py"
] | [
"from .model import Model\nimport numpy as np\nimport time\n\n\ndef softmax(x):\n r\"\"\"Compute softmax values for each sets of scores in $x$.\n\n Args:\n x (numpy.ndarray): Input vector to compute softmax\n\n Returns:\n numpy.ndarray: softmax(x)\n \"\"\"\n e_x = np.exp(x - np.max(x))\... | [
[
"numpy.max",
"numpy.random.randn",
"numpy.transpose",
"numpy.random.choice"
]
] |
dylanturpin/client | [
"fe84c4a3aed292c96912c5239e4cf1c9e4fec009"
] | [
"wandb/sklearn/__init__.py"
] | [
"from __future__ import absolute_import, division, print_function, unicode_literals\nimport wandb\nimport time\nimport itertools\nimport sklearn\nimport numpy as np\nimport scipy as sp\nfrom wandb.sklearn.utils import *\nfrom sklearn.base import clone\nfrom joblib import Parallel, delayed\nfrom sklearn import model... | [
[
"numpy.dot",
"sklearn.datasets.make_classification",
"numpy.linalg.matrix_rank",
"numpy.linspace",
"sklearn.metrics.silhouette_score",
"numpy.asarray",
"sklearn.metrics.silhouette_samples",
"numpy.around",
"numpy.in1d",
"numpy.sqrt",
"sklearn.metrics.confusion_matrix",
... |
matkovic/Wi-Mind | [
"86e1e3c365776665fc1c647bbf19294dffe60e55"
] | [
"FeatureExtractionModule/src/datareader.py"
] | [
"import scipy\nimport re\nimport os\nfrom datetime import datetime\nimport numpy as np\nimport pandas as pd\nfrom _bisect import bisect\nfrom itertools import groupby\n\n\nclass DataReader:\n \"\"\"Provides functions to read raw data acquired during the cognitive load study\n i.e. tasks information and wirele... | [
[
"numpy.array",
"numpy.unwrap",
"pandas.read_csv"
]
] |
jle3/pandas | [
"c322b2436cdbb447a430bb9eb1aff965d07e7e4e"
] | [
"pandas/core/indexes/interval.py"
] | [
"\"\"\" define the IntervalIndex \"\"\"\nfrom __future__ import annotations\n\nfrom functools import wraps\nfrom operator import le, lt\nimport textwrap\nfrom typing import TYPE_CHECKING, Any, Hashable, List, Optional, Tuple, Union, cast\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas.... | [
[
"numpy.linspace",
"pandas.core.dtypes.common.is_dtype_equal",
"pandas.core.dtypes.cast.maybe_box_datetimelike",
"pandas.core.dtypes.common.is_datetime64tz_dtype",
"pandas._libs.interval.IntervalTree",
"pandas.core.indexes.base.Index",
"numpy.concatenate",
"numpy.dtype",
"pandas... |
adamkudrnaty/Sudoku-solver | [
"df9b8be16c21e56125ff9ddbf7b1ec2821f803f8"
] | [
"sudoku-solver.py"
] | [
"import pygame\r\nimport numpy as np\r\n\r\n# Drawing the sudoku grid\r\ndef draw_the_grid():\r\n for row in range(9):\r\n for column in range(9):\r\n color = BLACK\r\n for numbers in range(1,10):\r\n if grid[row][column] == numbers:\r\n number[row][... | [
[
"numpy.delete"
]
] |
SamuelSchmidgall/RodentNavigation | [
"2ec49c5f43aa456ba648d1117a1b76241ad7a946"
] | [
"gym/gym/envs/mujoco/half_cheetah_hierarchy.py"
] | [
"import numpy as np\nfrom gym import utils\nfrom gym import spaces\nfrom copy import deepcopy\nfrom gym.envs.mujoco import mujoco_env\n\nclass HalfCheetahHierEnv(mujoco_env.MujocoEnv, utils.EzPickle):\n def __init__(self, layer=1, ll_agent=None):\n self.timestep = 0\n self.layer = layer\n se... | [
[
"numpy.square",
"numpy.abs",
"numpy.concatenate",
"numpy.random.uniform",
"numpy.array"
]
] |
kuldeepbrd1/dopamine | [
"1cbed6c7c35163e73b0ee2f2d2bf032b057570dd"
] | [
"tests/dopamine/jax/agents/rainbow/rainbow_agent_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Dopamine 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 b... | [
[
"numpy.array_equal",
"numpy.arange",
"numpy.ones",
"numpy.full",
"numpy.testing.assert_allclose",
"numpy.zeros"
]
] |
kantologist/multiagent-sac | [
"212e04b19f2becf2e37d9270242b1c59542d8d9f"
] | [
"agents/dqn_agent.py"
] | [
"\"\"\" Packaged MASAC\"\"\"\nfrom typing import Dict, List, Tuple\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom unityagents import UnityEnvironment\nfrom buffers.buffer import ReplayBuffer\nfrom models.network import Network... | [
[
"torch.LongTensor",
"numpy.random.random",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot",
"numpy.random.random_integers",
"numpy.mean",
"torch.nn.functional.smooth_l1_loss",
"torch.cuda.is_available",
"torc... |
kun-1010/1 | [
"c7f251bd254c29e3cb53bb915e69f4e00f00cb30"
] | [
"CNN/trained_model_test.py"
] | [
"import torch\nfrom torchvision import transforms\nfrom torch.utils.data import DataLoader\nfrom model import CNN\nfrom my_dataset import MyMnistDataset\n\ntransform = transforms.Compose([\n transforms.Resize([28, 28]),\n transforms.ToTensor(),\n transforms.Normalize((0.1307,), (0.3081,))\n])\n\n# 载入自己的数据集... | [
[
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.max",
"torch.load"
]
] |
AvivSham/SRGAN-Keras_Implementation | [
"f4a9dc15d34575245e28b693ac5db9faf7b6aa08"
] | [
"models/SRGAN.py"
] | [
"from tqdm import tqdm as tqdm\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom keras.models import Input, Model\nfrom keras.layers import BatchNormalization, LeakyReLU, Conv2D, Dense, \\\n Flatten, Add, PReLU, Conv2DTranspose, Lambda, UpSampling2D\nfrom keras.optimizers import Adam\nfrom keras.applica... | [
[
"tensorflow.depth_to_space",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.ones",
"numpy.add",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.random.randint"
]
] |
huguesdevimeux/trytravis-manim | [
"40498759efc089246b6c46717223e55757488d03"
] | [
"manim/scene/scene.py"
] | [
"import inspect\nimport random\nimport warnings\nimport platform\n\nfrom tqdm import tqdm as ProgressDisplay\nimport numpy as np\n\nfrom ..animation.animation import Animation\nfrom ..animation.transform import MoveToTarget, ApplyMethod\nfrom ..camera.camera import Camera\nfrom ..constants import *\nfrom ..config i... | [
[
"numpy.max",
"numpy.arange",
"numpy.random.seed"
]
] |
VijayReddy119/small_obstacle_discovery | [
"0f1324c7591e433a7ffc69832c4421f4cc9a77ad"
] | [
"normalization_metrics.py"
] | [
"import sys\nimport numpy as np\nfrom tqdm import tqdm\nfrom torch.utils.data import DataLoader\nimport utils.helpers as HLP\nfrom mypath import Path\n\ndataset = 'lnf'\ntrain_imgs, train_disp, train_labels = HLP.get_ImagesAndLabels_mergenet(Path.db_root_dir(dataset))\ntest_imgs, test_disp, test_labels = HLP.get_Im... | [
[
"numpy.asarray",
"numpy.std",
"numpy.mean"
]
] |
tzhern/COMP30027-Project-2 | [
"c8a9a1d216dae6b7b7b30bb8e53a2a084db73b36"
] | [
"test/load_data.py"
] | [
"import pandas as pd\nimport scipy\nimport pickle\n\n# load csv files\n\"\"\"\nname, n_steps, n_ingredients, steps, ingredients\n\"\"\"\ndf_train = pd.read_csv(\"datasets/recipe_train.csv\")\ndf_test = pd.read_csv(\"datasets/recipe_test.csv\")\n\n\"\"\"\n# load CountVectorizer (pkl) files\n\"\"\"\n#This file contai... | [
[
"pandas.read_csv"
]
] |
jacekplocharczyk/a3c-pytorch | [
"bec7dc5ffb9081d79080e77e3cbdd1ad9380d72f"
] | [
"a3c_pytorch/common/basic_memory.py"
] | [
"from typing import Union\n\nimport torch\n\n\nclass Memory:\n def __init__(self, gamma: float, batch_size: int = 64):\n self.actions = []\n self.action_logprobs = []\n self.state_values = []\n self.returns = None\n\n self.rewards = None\n self.is_terminals = None\n ... | [
[
"torch.cat",
"torch.unsqueeze",
"torch.tensor"
]
] |
e2000y/eden | [
"d2751e0a2f8f859275212e55c2b101646cb2d8c2"
] | [
"modules/s3db/vulnerability.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\" Sahana Eden Vulnerability Model\n\n @copyright: 2012-2021 (c) Sahana Software Foundation\n @license: MIT\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation\n files (the \"Software\"), to d... | [
[
"numpy.median"
]
] |
nahanoo/black_queen_hypothesis | [
"3b358457a0ea068b0f75c1bfb91b29be7aa59758"
] | [
"scripts/trajectories.py"
] | [
"import vcfpy\nfrom samples import Samples\nfrom os.path import join, exists\nimport pandas as pd\nimport plotly.express as px\nimport plotly.graph_objects as go\nfrom Bio import SeqIO\nfrom colour import Color\n\ns = Samples()\n\n\nclass SNPs:\n def __init__(self, filter=20, parse=False):\n if parse:\n ... | [
[
"pandas.DataFrame"
]
] |
danyfang/SourceCode | [
"8168f6058648f2a330a7354daf3a73a4d8a4e730"
] | [
"ml/morvan/sklearn/sk8_cross_validation.py"
] | [
"# View more python learning tutorial on my Youtube and Youku channel!!!\n\n# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg\n# Youku video tutorial: http://i.youku.com/pythontutorial\n\n\"\"\"\nPlease note, this code is only for python 3+. If you are using python 2+, please modify... | [
[
"sklearn.model_selection.cross_val_score",
"sklearn.datasets.load_iris",
"sklearn.model_selection.train_test_split",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
ihmeuw/vivarium_gates_child_iv_iron | [
"dd89b2161c636e4d03669bd91ba49824dad27a1d"
] | [
"src/vivarium_gates_child_iv_iron/data/builder.py"
] | [
"\"\"\"Modularized functions for building project data artifacts.\n\nThis module is an abstraction around the load portion of our artifact building ETL pipeline.\nThe intent is to be declarative so it's easy to see what is put into the artifact and how.\nSome degree of verbosity/boilerplate is fine in the interest ... | [
[
"pandas.HDFStore"
]
] |
hailusong/mrc-for-flat-nested-ner | [
"8e6f023c0d099f689f001817cf0644978c3ed22d"
] | [
"layers/loss_funcs.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*- \n\n\n\n# Author: Xiaoy LI \n# Last update: 2019.03.23 \n# First create: 2019.03.23 \n# Description:\n# loss_funcs_examples.py\n\n\n\nimport os \nimport sys \nimport numpy as np \n\n\n\nroot_path = \"/\".join(os.path.realpath(__file__).split(\"/\")[:-2])\nif root_pat... | [
[
"torch.nn.CrossEntropyLoss",
"torch.empty",
"torch.randn",
"torch.tensor",
"torch.nn.BCEWithLogitsLoss"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.