repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
quangr/tianshou
[ "110114e134bc0b7cf17973882e6383842e48dab3" ]
[ "examples/atari/atari_dqn.py" ]
[ "import argparse\nimport datetime\nimport os\nimport pprint\n\nimport numpy as np\nimport torch\nfrom atari_network import DQN\nfrom atari_wrapper import make_atari_env\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom tianshou.data import Collector, VectorReplayBuffer\nfrom tianshou.policy import DQNPolic...
[ [ "numpy.random.seed", "torch.manual_seed", "numpy.prod", "torch.cuda.is_available", "torch.load", "torch.utils.tensorboard.SummaryWriter" ] ]
ZhihaoZheng176/SLTP
[ "4ef5f958691fdb94b73318ed111318398e58a83f" ]
[ "model/gui.py" ]
[ "import cv2\nimport numpy as np\nfrom random import randint\n\ndef drawInferences(values, names=['', '', '', '', '', '']):\n nb_classes = len(values)\n left_margin = 150\n margin = 50\n thickness = 40\n\n font = cv2.FONT_HERSH...
[ [ "numpy.zeros" ] ]
achop/QuantEcon.py
[ "3dde0bb3e78cf9e790efca6bcbbc110ae4afea68" ]
[ "quantecon/tests/test_lss.py" ]
[ "\"\"\"\nTests for lss.py\n\n\"\"\"\nimport sys\nimport unittest\nimport numpy as np\nfrom numpy.testing import assert_allclose\nfrom quantecon.lss import LinearStateSpace\n\n\nclass TestLinearStateSpace(unittest.TestCase):\n\n def setUp(self):\n # Initial Values\n A = .95\n C = .05\n ...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.mean" ] ]
hawkrobe/fish
[ "ff491639954f0652d6b4b2a318477bb54c38fadf", "ff491639954f0652d6b4b2a318477bb54c38fadf" ]
[ "simulations/utils/make_images.py", "simulations/player_model/environment.py" ]
[ "# python scripts/make_images.py output/predictions-emergent/spot-1-asocial-1-simulation.csv output/predictions-emergent/spot-1-asocial-1-bg.csv output/movies\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pylab\nimport os\nimport sys\nimport matplotlib.patheffects as PathEffects\...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "pandas.io.parsers.read_csv", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.scatter", "matplotlib.pyplot.clf", "pandas.read_csv", "matplotlib.pyplot.cm.g...
ilastik/hytra
[ "3a9ebe921133a56ae6bf314700571cbde24f18ca", "3a9ebe921133a56ae6bf314700571cbde24f18ca" ]
[ "hytra/multitrack_ilastik10.py", "hytra/core/random_forest_classifier.py" ]
[ "import sys\nimport os\nimport os.path as path\nimport getpass\nimport glob\nimport optparse\nimport socket\nimport time\nimport numpy as np\nimport h5py\nimport itertools\nimport copy\nimport pgmlink as track\n\nsys.path.append(path.join(path.dirname(__file__), path.pardir))\nsys.path.append(path.dirname(__file__)...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.where", "numpy.arange", "numpy.asscalar", "numpy.unique", "numpy.flatnonzero" ], [ "numpy.hstack", "numpy.asarray", "numpy.expand_dims" ] ]
lucasdavid/convolutional-cuda
[ "2d1ef9121b49a70f71724d904a2bd53cb2fb658a" ]
[ "convolutional/operators/_vectorized.py" ]
[ "import numpy as np\n\n\ndef hadamard(a, b, out=None):\n if out:\n out[:] = a * b\n else:\n out = a * b\n return out\n\n\ndef scale(alpha, a, out=None):\n return hadamard(alpha, a, out=out)\n\n\ndef add_bias(a, bias, out=None):\n n_kernels = a.shape[-1]\n bias = bias.ravel()\n ass...
[ [ "numpy.array", "numpy.empty" ] ]
inmaugarc/DataScience_Disaster_Response_Pipeline
[ "b83ae016db1931ad9f3ae48ed7c904891d073e02" ]
[ "models/train_classifier.py" ]
[ "\"\"\"\nThis script:\n1. Loads data from a SQLite database\n2. Splits the dataset into training and test sets\n3. Builds a text processing & a machine learning pipeline\n4. Trains and tunes a model (optimizing the hyperparameters) using the GridSearchCV method\n5. Outputs results on the test set\n6. Exports the fi...
[ [ "sklearn.model_selection.train_test_split", "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.model_selection.GridSearchCV", "sklearn.feature_extraction.text....
JianmingGuo/SJTUsousou
[ "a7ffb3921c241d2074f2da5f74abfb9a03b0311d" ]
[ "SJTUsoso/blog/renew_tfidf.py" ]
[ "#coding:utf-8\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom sklearn.feature_extraction.text import CountVectorizer\nimport jieba\nimport codecs\nimport json\nimport pymysql\n\ndef cal(dict1,dict2):\n sum=0\n for key in dict1.keys():\n if key in dict2.keys():\n sum+=dic...
[ [ "sklearn.feature_extraction.text.TfidfTransformer", "sklearn.feature_extraction.text.CountVectorizer" ] ]
priceal/generalized-method-of-moments
[ "7232d84a1c1804d6daddc4d4c732cee38c6e9914" ]
[ "sim_20180425.py" ]
[ "######################################################\n#######################################################\n# \n# functions and simulations for returning samples from\n# dwell time distributions that represent single molecule\n# reactions. \n#\n########################################################\n######...
[ [ "numpy.array", "numpy.zeros" ] ]
itselavia/edge-computing-platform-for-deep-learning-apps
[ "43f0737d5635296b83be0eeba52d1a5d430df08f" ]
[ "infra/terraform/modules/tflite_converter_function/function_code/main.py" ]
[ "import tensorflow as tf\nfrom google.cloud import storage\nfrom flask import abort\nimport os\nfrom pathlib import Path\n\ndef model_converter(request):\n\n saved_model_dir_gcs = \"\"\n saved_model_dir_local = \"/tmp\"\n project_name = \"\"\n email = \"\"\n\n if request.method == 'POST':\n request_json = r...
[ [ "tensorflow.lite.TFLiteConverter.from_saved_model" ] ]
danielmiodovnik/FrontDoorDataCollaboration
[ "1a89143e64b329838bae76616ae147b6143d8557" ]
[ "fddc/annex_a/cleaner.py" ]
[ "import logging\nimport re\nimport os\nimport yaml\nimport pandas as pd\nfrom fddc.regex import parse_regex\nfrom openpyxl import Workbook\nfrom openpyxl.utils.dataframe import dataframe_to_rows\nfrom openpyxl.utils.cell import get_column_letter\n\nlogger = logging.getLogger('spreadsheetcleaner')\n\n\n# Functions t...
[ [ "pandas.ExcelWriter", "pandas.DataFrame", "pandas.read_excel", "pandas.concat", "pandas.Series" ] ]
liuqk3/GSM
[ "188965b3a11f9cdbe166d79cac7cd2e9fb4c1785" ]
[ "lib/models/detection/frcnn_fpn.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom collections import OrderedDict\nfrom torchvision.models.detection import FasterRCNN\nfrom torchvision.models.detection.backbone_utils import resnet_fpn_backbone\nfrom torchvision.models.detection.transform import resize_boxes\n\n\nclass FRCNN_FPN(FasterRCNN):\n\n...
[ [ "torch.nn.functional.softmax" ] ]
love-searcher/AMCF
[ "60cc2869174c2e49bad6fb3aea3a9016aedfea0e" ]
[ "utils.py" ]
[ "import numpy as np\n\ndef get_train_instances(train, num_negatives, num_items, num_neg):\n num = train.nnz * (num_neg + 1) # 对每个正样例,增加num_neg个负样例\n user_input, item_input, labels = np.zeros(num), np.zeros(num), np.zeros(num)\n idx = 0\n for (u, i) in train.keys():\n # positive instance\n ...
[ [ "numpy.random.randint", "numpy.zeros" ] ]
zhyoung24/LPCNet
[ "2159b4f85d9839d9627f1843a1cb5ea298c63159" ]
[ "training_tf2/dataloader.py" ]
[ "import numpy as np\nfrom tensorflow.keras.utils import Sequence\nfrom ulaw import lin2ulaw\n\ndef lpc2rc(lpc):\n #print(\"shape is = \", lpc.shape)\n order = lpc.shape[-1]\n rc = 0*lpc\n for i in range(order, 0, -1):\n rc[:,:,i-1] = lpc[:,:,-1]\n ki = rc[:,:,i-1:i].repeat(i-1, axis=2)\n ...
[ [ "numpy.arange", "numpy.random.shuffle", "numpy.minimum" ] ]
Purg/xaitk-saliency
[ "8f5283b2dcccd6d4c4c8a881c8ef7f248a316655" ]
[ "xaitk_saliency/utils/masking.py" ]
[ "import itertools\nimport time\nfrom typing import Generator, Iterable, Optional, Sequence, Tuple, Union\n\nimport numpy as np\nfrom smqtk_descriptors.utils import parallel_map\n\n\n# Lowest volume to convert `1` value.\nUINT8_ONE = np.uint8(1)\n\n\ndef occlude_image_batch(\n ref_image: np.ndarray,\n masks: n...
[ [ "numpy.uint8", "numpy.add", "numpy.random.rand", "numpy.ones", "numpy.multiply", "numpy.transpose", "numpy.empty_like" ] ]
salt-die/pdcj8-robust-reindeer
[ "8baffd90a124c4464d317b61881e914a6e055b8d" ]
[ "cube.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport logging\nimport time\nfrom enum import IntEnum\nfrom pathlib import Path\nfrom typing import Callable, List\n\nimport numpy as np\nfrom asciimatics.event import KeyboardEvent, MouseEvent\nfrom asciimatics.exceptions import StopApplication\nfrom asciimatics.scene imp...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.cos", "numpy.inner" ] ]
ceesem/table-bridge
[ "60955939fe4c3cbb9082f7c8555aba97675ccfd0" ]
[ "tablebridge/comparison.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom .utils import row_differs\n\n__all__ = [\"fill_column_from_above\", \"convert_dataframe\", \"AnnotationComparison\"]\n\n\ndef fill_column_from_above(df, columns, starting_value=None, inplace=False):\n \"\"\"Fill in a column in order with the last non-NAN value\n\n ...
[ [ "numpy.concatenate", "pandas.isna", "numpy.isin" ] ]
shubham1637/pyprophet
[ "4befd9ba3fcca2cc4e411dd3760cb1695045b09a" ]
[ "tests/test_pyprophet_score.py" ]
[ "from __future__ import print_function\n\nimport os\nimport subprocess\nimport shutil\nimport sys\n\nimport pandas as pd\nimport sqlite3\n\nimport pytest\n\nfrom pyprophet.ipf import read_pyp_peakgroup_precursor\n\npd.options.display.expand_frame_repr = False\npd.options.display.precision = 4\npd.options.display.ma...
[ [ "pandas.read_csv", "pandas.read_sql_query" ] ]
StatCan/kubeflow-mlops
[ "e9f04d2d1e113e8180e8bc626c8494e97906df92" ]
[ "containers/tensorflow-training/train.py" ]
[ "from __future__ import absolute_import, division, print_function\nimport os\nimport math\nimport hmac\nimport json\nimport hashlib\nimport argparse\nfrom random import shuffle, random\nfrom pathlib2 import Path\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.data import Dataset\nfrom tensorflow.pytho...
[ [ "numpy.array", "tensorflow.io.read_file", "tensorflow.data.experimental.ignore_errors", "tensorflow.keras.layers.Dense", "tensorflow.keras.applications.MobileNetV2", "tensorflow.python.lib.io.file_io.FileIO", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.image.resiz...
nitish-awasthi/Network-Analysis-Made-Simple
[ "1829f63d9814c7893a1e008b8b1717da95a54ae7" ]
[ "nams/solutions/hubs.py" ]
[ "\"\"\"Solutions to Hubs chapter.\"\"\"\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport pandas as pd\nfrom nxviz import CircosPlot\n\nfrom nams import ecdf\n\n\ndef rank_ordered_neighbors(G):\n \"\"\"\n Uses a pandas Series to help with sorting.\n \"\"\"\n s = pd.Series({n: len(list(G....
[ [ "matplotlib.pyplot.scatter", "pandas.Series", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ] ]
uyplayer/Sentiment-Analysis
[ "24edf6253fbc7c90de6890370dc4eebfdf3c5c1a" ]
[ "src/FastText_tweets.py" ]
[ "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n# @Time : 2020/12/14 11:03\r\n# @Author : uyplayer\r\n# @Site : uyplayer.pw\r\n# @File : FastText_tweets.py\r\n# @Software: PyCharm\r\n\r\n'''\r\nfastText for sentiment analysis\r\npaper : https://arxiv.org/pdf/1607.01759.pdf\r\nhttps://zhuanlan.zhihu.c...
[ [ "torch.nn.Linear", "torch.device", "sklearn.preprocessing.LabelEncoder", "numpy.ones", "numpy.min", "numpy.mean", "torch.cuda.device_count", "torch.cuda.current_device", "torch.from_numpy", "torch.nn.SmoothL1Loss", "torch.cuda.is_available", "torch.utils.data.DataLo...
yangzijia/keras-yolo3
[ "0afe660dd8767e226c1a2af467fee6145303d1c6" ]
[ "yolo3/utils.py" ]
[ "\"\"\"Miscellaneous utility functions.\"\"\"\n\nfrom functools import reduce\n\nfrom PIL import Image\nimport numpy as np\nimport cv2\nfrom matplotlib.colors import rgb_to_hsv, hsv_to_rgb\n\ndef compose(*funcs):\n \"\"\"Compose arbitrarily many functions, evaluated left to right.\n\n Reference: https://mathi...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "matplotlib.colors.hsv_to_rgb", "numpy.random.shuffle", "numpy.logical_and" ] ]
Vinanddrinks/prjtpython
[ "725656146c0376a533f3d7da28196297cf50f4be" ]
[ "read/playpartition.py" ]
[ "#!/usr/bin/python\n# authors : Vincent Labouret, Giuliano Riccardi\n# This folder is in the project to contain all the functions needed to play a function and manipulate strings from\n# given to make them readable by the play() function and it does not take into account markov because it does not create\n# new par...
[ [ "numpy.multiply", "numpy.sin", "numpy.arange", "numpy.abs" ] ]
gangigammo/deep-learning-2
[ "6bce355261d8ad5135c104fca32946aa13dc0ba4" ]
[ "ch02/test2.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport sys\nsys.path.append('..')\nfrom common.util import preprocess\n\ndef preprocess(text):\n text = text.lower()\n text = text.replace('.',' .')\n words = text.split(' ')\n\n word_to_id = {}\n id_to_word = {}\n\n for word in words:\n ...
[ [ "numpy.zeros_like", "numpy.array", "numpy.dot", "numpy.zeros", "numpy.sum", "numpy.log2" ] ]
RedMellon/ROAR
[ "117b78cc1dae65a4d2da006a218b884dabce8abb" ]
[ "runner_competition_evaluator.py" ]
[ "import logging, warnings\nimport numpy as np\nfrom ROAR_Sim.configurations.configuration import Configuration as CarlaConfig\nfrom ROAR.configurations.configuration import Configuration as AgentConfig\nfrom pathlib import Path\nfrom ROAR.agent_module.pure_pursuit_agent \\\n import PurePursuitAgent\nfrom ROAR_Si...
[ [ "numpy.set_printoptions" ] ]
streamer-AP/Chinese_poetry_gen
[ "785252c3383abdeb7054d151160d6e43ca53f536" ]
[ "bert/seq2seq/seq2seq_model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom bert.seq2seq.tokenizer import Tokenizer, load_chinese_base_vocab\nfrom bert.seq2seq.config import max_length\nimport time\nfrom bert.seq2seq.config import yayun_list\n\n\nclass Seq2SeqModel(nn.Module):\n \"\"\"\n \"\"\"\n\n def _...
[ [ "torch.zeros", "torch.cat", "torch.log_softmax", "torch.max", "torch.ones", "torch.tensor", "torch.ones_like", "torch.nn.CrossEntropyLoss", "torch.topk" ] ]
alanblake/object_detection_demo
[ "34b4cb226de3e8c27b2024b696d56e43939afa08" ]
[ "generate_tfrecord.py" ]
[ "\"\"\"\nUsage:\n\n# Create train data:\npython generate_tfrecord.py --label=<LABEL> --csv_input=<PATH_TO_ANNOTATIONS_FOLDER>/train_labels.csv --output_path=<PATH_TO_ANNOTATIONS_FOLDER>/train.record <PATH_TO_ANNOTATIONS_FOLDER>/label_map.pbtxt\n\n# Create test data:\npython generate_tfrecord.py --label=<LABEL> --c...
[ [ "pandas.read_csv", "tensorflow.compat.v1.python_io.TFRecordWriter", "tensorflow.compat.v1.app.run" ] ]
whirldata/segnet
[ "8270f4b88bce66d46b4fe8c49d7c44482750eb69" ]
[ "model_dropout.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.framework import dtypes\n\nimport cv2\n\n\n\nimport scipy\nimport os, sys\nimport numpy as np\nimport math\nfrom datetime import datetime\nimport time\nfrom PIL import Image\nfrom math import ceil\nfrom tensorflow.python.o...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.train.start_queue_runners", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.nn.lrn", "tensorflow.reshape", "numpy.nanmean", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.one...
ianhi/pycro-manager
[ "5a6a52421c4ba99bed456af174307fd21a31bccc" ]
[ "pycromanager/data.py" ]
[ "\"\"\"\nLibrary for reading multiresolution micro-magellan\n\"\"\"\nimport os\nimport mmap\nimport numpy as np\nimport sys\nimport json\nimport platform\nimport dask.array as da\nimport dask\nimport warnings\nfrom pycromanager.zmq import Bridge\nimport struct\nfrom pycromanager.legacy_data import Legacy_NDTiff_Dat...
[ [ "numpy.array", "numpy.memmap", "numpy.zeros" ] ]
Mehdishishehbor/gpytorch
[ "432e537b3f6679ea4ab3acf33b14626b7e161c92" ]
[ "test/lazy/test_kronecker_product_added_diag_lazy_tensor.py" ]
[ "#!/usr/bin/env python3\n\nimport unittest\nfrom unittest import mock\n\nimport torch\n\nfrom Lgpytorch import settings\nfrom Lgpytorch.lazy import (\n ConstantDiagLazyTensor,\n DiagLazyTensor,\n KroneckerProductAddedDiagLazyTensor,\n KroneckerProductDiagLazyTensor,\n KroneckerProductLazyTensor,\n ...
[ [ "torch.rand", "torch.tensor" ] ]
tonysy/cvpods
[ "e322d7842ca0e34b1ef6237ea6d350633efc793a" ]
[ "cvpods/modeling/meta_arch/retinanet.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# Modified by BaseDetection, Inc. and its affiliates.\n\nimport logging\nimport math\nfrom typing import List\n\nimport torch\nfrom torch import nn\n\nfrom cvpods.layers import ShapeSpec, cat, generalized_batched_nms\nfrom cvpods.modeling.basenet import basenet\n...
[ [ "torch.device", "torch.stack", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.no_grad", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.init.normal_", "torch.zeros_like", "torch.Tensor" ] ]
jackashore/NLP_Toolkit
[ "e5bd8bcfad87f4906c45e66351adf93bd5c2727f" ]
[ "nlptoolkit/translation/models/Transformer/py_Transformer.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 13 13:01:15 2019\n\n@author: WT\n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\n### create masks for src & trg sequences\ndef create_masks(src, trg):\n src_mask = (src == 1).unsqueeze(-2).bool()\n if trg is not None:\n trg_mask = (trg == 1).unsquee...
[ [ "torch.nn.Linear", "torch.nn.Transformer", "torch.save", "torch.load", "torch.nn.Embedding" ] ]
TUDelft-CITG/OpenTISim
[ "443b20572eb2aae2f1909a8a01e95e31be53b675" ]
[ "opentisim/liquidbulk/hydrogen_system.py" ]
[ "\n# coding: utf-8\n\n# In[ ]:\n\n\n# coding: utf-8\n\n# In[ ]:\n\n\n# package(s) for data handling\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom .hydrogen_defaults import *\nfrom .hydrogen_objects import *\nimport opentisim\n\n\n# todo: consider renaming this class to Terminal (...
[ [ "numpy.max", "numpy.array", "numpy.ceil", "numpy.isnan", "numpy.testing.assert_equal", "numpy.sum", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "numpy.nonzero", "numpy.where" ] ]
stjordanis/MONeT-1
[ "98a5c7d149ca19c8c64069dbd8f27ce7f97bf3af" ]
[ "gist/gist_graph.py" ]
[ "import torch\nfrom functools import lru_cache\n\n\nclass Node:\n def __init__(self, shape):\n self.shape = shape\n\n\nclass Input(Node):\n def __repr__(self):\n return '<Input %s>' % str(list(self.shape))\n\n\nclass Param(Node):\n def __repr__(self):\n return '<Param %s>' % str(list(s...
[ [ "torch._C._jit_pass_lint", "torch.jit._get_trace_graph", "torch.jit._unique_state_dict", "torch.ones", "torch._C._jit_pass_inline", "torch._C._jit_pass_dce", "torch._C._jit_pass_constant_propagation" ] ]
lasserfox/rekognition
[ "cf01b863b360b770730472919b4477e486e14449" ]
[ "etiquetarDorsal.py" ]
[ "######## Image Object Detection Using Tensorflow-trained Classifier #########\n#\n# Author: Evan Juras\n# Date: 1/15/18\n# Description:\n# This program uses a TensorFlow-trained classifier to perform object detection.\n# It loads the classifier uses it to perform object detection on an image.\n# It draws boxes and...
[ [ "numpy.array", "tensorflow.Graph", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "numpy.squeeze", "numpy.expand_dims" ] ]
ForestFighters/colour-detection
[ "c18ffd5ae15c8b905cb78022b0ff2d4479849a5e" ]
[ "colourdetection/__init__.py" ]
[ "import cv2\nimport numpy as np\nimport logging\n\n\nLOGGER = logging.getLogger(__name__)\nLOGGER.setLevel(logging.DEBUG)\n\n\ndef test(img_path, colours):\n img = cv2.imread(img_path, 1)\n\n hues = calibrate(img, colours)\n for colour in colours:\n ball = detect(img, hues[colour][0], hues[colour][1...
[ [ "numpy.array" ] ]
psxz/reinforcement-learning-an-introduction
[ "cc839b647a3ae54f07b2cae17a602cd8d25436fe" ]
[ "chapter03/grid_world.py" ]
[ "#######################################################################\n# Copyright (C) #\n# 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# 2016 Kenta Shimada(hyperkentakun@gmail.com) #\n# Permission given to m...
[ [ "matplotlib.use", "numpy.max", "numpy.array", "numpy.ndenumerate", "numpy.zeros", "numpy.round", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.abs", "matplotlib.table.Table" ] ]
MikkelGroenning/social_graph
[ "6df842d9fa982dfc18c17d9a816baa14caa237de" ]
[ "src/data/trump_tweet_ids.py" ]
[ "# importing the module \nimport pandas as pd\n\n \ndef get_trump_tweet_ids(df_trump, filepath):\n \"\"\"\n Extract the tweet id from a dataframe downloaded at trump twitter archive.\n \"\"\"\n # Remove rows with missing values\n df_trump = df_trump[~df_trump.isna().any(axis=1)]\n\n # Extract the...
[ [ "pandas.read_csv", "pandas.concat" ] ]
dins/jukola-xml-model
[ "0fc1a7a4d87cb0dd169fbf974ee114ef6f6cded7", "0fc1a7a4d87cb0dd169fbf974ee114ef6f6cded7" ]
[ "estimate_personal_coefficients.py", "ideal_paces_cleanup.py" ]
[ "import csv\nimport json\nimport logging\nimport time\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\n\nimport shared\n\n# time pipenv run python estimate_personal_coefficients.py\n\nrace_type = shared.race_type()\nyear = shared.forecast_year()\nstartTime = time.time()...
[ [ "numpy.array", "sklearn.linear_model.LinearRegression", "pandas.merge", "numpy.log", "pandas.read_csv" ], [ "numpy.log", "pandas.read_csv", "pandas.merge" ] ]
tvercaut/MONAI
[ "390fe7f4d2fb1352d051220ed62e30afd6975b21" ]
[ "monai/handlers/utils.py" ]
[ "# Copyright 2020 - 2021 MONAI Consortium\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://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre...
[ [ "numpy.isnan", "numpy.nanpercentile", "numpy.nanmin", "numpy.nanmean", "numpy.transpose", "numpy.nanmax", "numpy.nanmedian", "numpy.nanstd" ] ]
phamthuonghai/tensor2tensor
[ "8e5cb262b1f62a84eb948816ad43521c8975ecdb", "8e5cb262b1f62a84eb948816ad43521c8975ecdb" ]
[ "tensor2tensor/trax/layers/attention.py", "tensor2tensor/models/research/neural_stack_test.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Tensor2Tensor 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 requir...
[ [ "numpy.sin", "numpy.zeros", "numpy.log", "numpy.ones", "numpy.arange", "numpy.cos" ], [ "numpy.array", "tensorflow.zeros", "tensorflow.constant_initializer", "tensorflow.ones", "tensorflow.reshape", "tensorflow.constant", "tensorflow.test.main", "tensorf...
yuishihara/researchutils
[ "bb3ec467386d43a1e2282ec6d024216ce4dae841" ]
[ "tests/chainer/links/connection/test_grad_clip_lstm.py" ]
[ "import pytest\nimport numpy\n\nimport chainer\nfrom chainer.backends import cuda\nfrom chainer import functions\n\nfrom researchutils.chainer import links\n\n\nclass TestGradClipLSTM(object):\n\n \"\"\" GradClipLSTM link test.\n These test were almost same as original chainer's links.LSTM tests\n \"\"\"\n...
[ [ "numpy.random.uniform" ] ]
archiki/ASR-Accent-Analysis
[ "da1dcb8e3a4476c392e01ed410cc47691d693882", "da1dcb8e3a4476c392e01ed410cc47691d693882" ]
[ "AccentProbe/run.py", "DeepSpeech/model_modified.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom torch.utils.data import DataLoader\nfrom torch.autograd import Variable\nfrom model import AccentNet\nfrom data_loader import AccentDataset\nimport argparse\nimport os\nimport pdb\nimport time\nfrom tqdm import tqdm\nfrom torch.nn.parallel i...
[ [ "torch.max", "torch.autograd.Variable", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel" ], [ "torch.nn.Linear", "torch.nn.functional.softmax", "torch.nn.Conv1d", "torch....
breakds/alf
[ "15fd71896eac5ad0987dbe14a9f630b32e0e131f", "15fd71896eac5ad0987dbe14a9f630b32e0e131f" ]
[ "alf/utils/math_ops.py", "alf/algorithms/muzero_algorithm.py" ]
[ "# Copyright (c) 2019 Horizon Robotics. 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 requi...
[ [ "torch.nonzero", "torch.sigmoid", "torch.mul", "torch.unique", "torch.nn.functional.softplus", "torch.randperm", "torch.clamp", "torch.all", "torch.tensor", "torch.exp", "torch.cumsum", "torch.pow" ], [ "torch.cuda.amp.autocast" ] ]
nens/threedigrid
[ "7bff5f9efa5edb8335a8ed601b9a096f85e19711", "7bff5f9efa5edb8335a8ed601b9a096f85e19711" ]
[ "threedigrid/admin/serializers.py", "threedigrid/admin/prepare.py" ]
[ "import json\nimport logging\nfrom collections import OrderedDict\n\nimport numpy as np\n\nfrom threedigrid.admin import constants\nfrom threedigrid.geo_utils import transform_bbox, raise_import_exception\nfrom threedigrid.orm.base.encoder import NumpyEncoder\nfrom threedigrid.orm.base.models import Model\n\ntry:\n...
[ [ "numpy.round", "numpy.any", "numpy.where", "numpy.isfinite", "numpy.issubdtype" ], [ "numpy.string_" ] ]
bluemonk482/tdlstm
[ "29032c3d116866e3d30b29fdf1a0af605c054d93" ]
[ "models/lstm_classifier.py" ]
[ "import sys\nsys.path.insert(0, r'../')\nimport data.util\nimport tensorflow as tf\nimport numpy as np\n\n\nclass LSTMClassifier:\n\n\tdef __init__(self, args, embedding_init):\n\t\tself.learning_rate = args.learning_rate\n\t\tself.num_hidden = args.num_hidden\n\t\tself.num_classes = args.num_classes\n\t\tself.drop...
[ [ "tensorflow.constant_initializer", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.matmul", "tensorflow.gradients", "tensorflow.reshape", "tensorflow.nn.embedding_lookup", "tensorflow.cast", "tensorflow.trainable_variables", "tensorflow.shape", "tensorflow.argma...
kliegr/pyIDS
[ "83e12503dc7b2680b35bfb377bc13521a54237bc" ]
[ "scripts/use_case/coordinate_ascent_optimization.py" ]
[ "import pandas as pd\n\nfrom pyarc.qcba.data_structures import QuantitativeDataFrame\n\nfrom pyids.ids_classifier import IDS, mine_IDS_ruleset\nfrom pyids.ids_ruleset import IDSRuleSet\nfrom pyids.rule_mining import RuleMiner\nfrom pyids.model_selection import CoordinateAscentOptimizer, train_test_split_pd\n\n\ndf ...
[ [ "pandas.read_csv" ] ]
jevandezande/elongation
[ "824db56724067ad1b6aa4e1b05e1fdafcd5812e9" ]
[ "tests/test_tools.py" ]
[ "import sys\nimport numpy as np\n\nfrom datetime import datetime\n\nsys.path.insert(0, '..')\n\nfrom elongation.tools import compare_dictionaries\n\n\ndef test_compare_dictionaries():\n cd = compare_dictionaries\n a = {}\n a2 = {}\n b = {1: 1}\n c = {1: 'a'}\n d = {2: 1}\n e = {1: 1, 2: 1}\n ...
[ [ "numpy.array" ] ]
vagechirkov/mne-python
[ "8714cda45d0f0269c15026323a9ac689b47722f8", "8714cda45d0f0269c15026323a9ac689b47722f8", "8714cda45d0f0269c15026323a9ac689b47722f8", "8714cda45d0f0269c15026323a9ac689b47722f8", "8714cda45d0f0269c15026323a9ac689b47722f8", "8714cda45d0f0269c15026323a9ac689b47722f8", "8714cda45d0f0269c15026323a9ac689b47722f...
[ "examples/inverse/mne_cov_power.py", "mne/viz/tests/test_3d.py", "mne/tests/test_event.py", "mne/cuda.py", "mne/viz/backends/_qt.py", "mne/preprocessing/nirs/nirs.py", "mne/io/egi/tests/test_egi.py", "mne/time_frequency/multitaper.py" ]
[ "\"\"\"\n===================================================================\nCompute source power estimate by projecting the covariance with MNE\n===================================================================\n\nWe can apply the MNE inverse operator to a covariance matrix to obtain\nan estimate of source powe...
[ [ "numpy.linspace" ], [ "numpy.testing.assert_allclose", "numpy.array", "numpy.empty", "numpy.random.rand", "numpy.zeros", "numpy.random.RandomState", "numpy.sum", "numpy.testing.assert_array_equal", "numpy.ones", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.s...
fernandezpab/Cleaning-databases-using-pandas-in-python
[ "7f9731029a8f4b68094232ae35b04cafbb368a6e" ]
[ "Files py/example_cleaning_databases_5.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jul 25 12:26:34 2021\n\n@author: PC\n\"\"\"\n\nimport requests\nimport pandas as pd\nfrom zipfile import ZipFile\n\nlocal_path = \"your_local_path\"\n\ndef get_data(url, ZipFilename, CSVfilename): \n r = requests.get(url)\n open(ZipFilename, \"wb\").write(r....
[ [ "pandas.to_datetime", "pandas.read_excel" ] ]
nate-sime/meshio
[ "792dfdd6296a8858e365a005a87afa605834ce66" ]
[ "meshio/med/_med.py" ]
[ "\"\"\"\nI/O for MED/Salome, cf.\n<https://docs.salome-platform.org/latest/dev/MEDCoupling/developer/med-file.html>.\n\"\"\"\nimport numpy\n\nfrom .._common import num_nodes_per_cell\nfrom .._exceptions import ReadError, WriteError\nfrom .._helpers import register\nfrom .._mesh import Mesh\n\n# https://docs.salome-...
[ [ "numpy.full", "numpy.unique", "numpy.string_" ] ]
luk-f-a/numba
[ "3a682bd827e416335e3574bc7b10f0ec69adb701", "3a682bd827e416335e3574bc7b10f0ec69adb701", "3a682bd827e416335e3574bc7b10f0ec69adb701", "3a682bd827e416335e3574bc7b10f0ec69adb701" ]
[ "numba/cpython/randomimpl.py", "numba/tests/test_slices.py", "numba/cuda/tests/cudapy/test_multigpu.py", "numba/tests/test_hashing.py" ]
[ "\"\"\"\nImplement the random and np.random module functions.\n\"\"\"\n\n\nimport math\nimport os\nimport random\n\nimport numpy as np\n\nfrom llvmlite import ir\n\nfrom numba.core.extending import overload, register_jitable\nfrom numba.core.imputils import (Registry, impl_ret_untracked,\n ...
[ [ "numpy.random.standard_gamma", "numpy.random.standard_normal", "numpy.empty", "numpy.random.binomial", "numpy.random.chisquare", "numpy.random.permutation", "numpy.copy", "numpy.random.standard_exponential", "numpy.random.shuffle", "numpy.arange", "numpy.random.randint"...
wx-b/imitation-learning
[ "21d0663d4f350e7dd01a7843386965fd52e40a23" ]
[ "evaluation.py" ]
[ "import torch\r\n\r\nfrom environments import PendulumEnv, D4RLEnv\r\n\r\n\r\n# Evaluate agent with deterministic policy π\r\ndef evaluate_agent(agent, num_episodes, env_type=PendulumEnv, env_name='', seed=1, return_trajectories=False, render=False):\r\n env = env_type(env_name)\r\n env.seed(seed)\r\n\r\n return...
[ [ "torch.cat", "torch.inference_mode", "torch.tensor", "torch.ones" ] ]
HarshShah03325/Emotion_Recognition
[ "d1760bbdedc55014896f0e1c7db47ee5e5a19dae" ]
[ "MRI Segmentation/metrics.py" ]
[ "import numpy as np\nimport pandas as pd\nimport tensorflow as tf\n\ndef compute_class_sens_spec(pred, label, class_num):\n \"\"\"\n Compute sensitivity and specificity for a particular example\n for a given class.\n\n Args:\n pred (np.array): binary arrary of predictions, shape is\n ...
[ [ "numpy.sum", "tensorflow.keras.utils.to_categorical", "numpy.moveaxis", "pandas.DataFrame" ] ]
andrewcpotter/holopy
[ "e7eed9e2bdb0de61610c4d8c3455fcd00b76d896" ]
[ "cirq_HoloVQE_Sample.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 7 22:12:41 2020\n\n@author: acpotter\n\"\"\"\n\nimport numpy as np\nimport cirq\nimport sympy \n\nimport mps\nimport holovqa as holopy\nimport tenpy\n\n#%% Hyperparameters\nJ=1.0\ng=1.0\n\n#%% Setup qubits\nnphys = 1\nnbond = 1\nqp = [cir...
[ [ "numpy.swapaxes", "numpy.ones" ] ]
jonasnm/geometric-certificates
[ "8730abaf2ab0c8972a2d40168d5fe64c8670fc62" ]
[ "mister_ed/st_sandbox.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torchvision\n\nfrom torch.autograd import Variable\nimport numpy as np\n\n\n# Universal import block\n# Block to get the relative imports working\nimport os\nimport sys\nmodule_path = os.path.abspath(os.path.j...
[ [ "torch.cuda.is_available" ] ]
ScilifelabDataCentre/Annual-report-2021
[ "6a5d9ca0320ee6cba39245e81e2bd61f1a6822e1" ]
[ "benchmarking.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom collections import Counter\nimport plotly.express as px\nimport plotly.graph_objects as go\nimport os\n\n# The benchmark values come separately from KTH\n\nbenchmark = pd.read_excel(\n \"Data/SciLifeLab_swe_benchmark.xlsx\",\n sheet_name=\"SciLifeLab_swe_benchmar...
[ [ "pandas.read_excel", "pandas.merge" ] ]
nilakshdas/bmed8813rob-sp21-team1-r2drink2
[ "aec632bbfd39760d6600109cb5ec64836f2ff6e5" ]
[ "r2drink2/setup/rooms.py" ]
[ "from dataclasses import dataclass\nfrom enum import Enum\nfrom typing import List\n\nimport numpy as np\nimport pybullet as p\n\nfrom assistive_gym.envs.agents.agent import Agent\nfrom assistive_gym.envs.env import AssistiveEnv\n\n\n@dataclass\nclass PointXY:\n x: float\n y: float\n\n\nclass ROOM_OPENINGS:\n...
[ [ "numpy.zeros" ] ]
guochengqian/deeplearning_coding_handbook
[ "9fc8c4a18d61a834247988bcc27ddb59f6441c20" ]
[ "torch_lib/gcn_lib/dense/torch_edge.py" ]
[ "import torch\nfrom torch import nn\nfrom torch_cluster import knn_graph\n\n\nclass DenseDilated(nn.Module):\n \"\"\"\n Find dilated neighbor from neighbor list\n\n edge_index: (2, batch_size, num_points, k)\n \"\"\"\n def __init__(self, k=9, dilation=1, stochastic=False, epsilon=0.0):\n super...
[ [ "torch.rand", "torch.mul", "torch.stack", "torch.arange", "torch.randperm" ] ]
Yilin1010/DeleteKnowledge
[ "49b7e0e3a2247e482ba8876762719e4adb3074c6" ]
[ "toolbox/util/visualize.py" ]
[ "'''\r\nCreated on Sep 24, 2016\r\n\r\n@author: Wajih-PC\r\n'''\r\nimport numpy as np\r\nfrom util.scaledimage import scaledimage\r\ndef visualize(X, mm, s1, s2):\r\n \r\n if mm is None:\r\n mm = [np.min(X[:]), np.max(X[:])]\r\n \r\n if s1 is None:\r\n s1 = 0;\r\n if s2 is None:...
[ [ "numpy.max", "numpy.reshape", "numpy.ones", "numpy.min", "numpy.sqrt", "numpy.floor" ] ]
RuchitDoshi/DisasterResponses
[ "f6033f2afed2a3ef9064c7fd345836d7672549ff" ]
[ "models/train_classifier.py" ]
[ "import sys\nimport sqlalchemy\nfrom sqlalchemy import create_engine\nimport pickle\nimport pandas as pd\nimport numpy as np\nfrom nltk.tokenize import word_tokenize\nfrom nltk.stem import WordNetLemmatizer\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.model_selection import train_test_split,GridSearchCV\nfr...
[ [ "numpy.array", "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier", "sklearn.feature_extraction.text.TfidfTransformer", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "sklearn.feature_extraction.text.CountVectorizer", "sk...
Varun221/NERDA
[ "a39900fd29c65465ac22f1a002c2eafef568258e" ]
[ "src/NERDA/models.py" ]
[ "\"\"\"\nThis section covers the interface for `NERDA` models, that is \nimplemented as its own Python class [NERDA.models.NERDA][].\n\nThe interface enables you to easily \n\n- specify your own [NERDA.models.NERDA][] model\n- train it\n- evaluate it\n- use it to predict entities in new texts.\n\"\"\"\nfrom .datase...
[ [ "pandas.DataFrame", "torch.cuda.is_available", "torch.device" ] ]
Purnajith/sentiment-analysis
[ "85df9e541b1708e9d5c981177cdbe04efd8a6b4f" ]
[ "prearrange/main.py" ]
[ "import base64\nimport firebase_admin\nfrom firebase_admin import firestore\nfrom datetime import datetime, timedelta\nfrom textblob import TextBlob\nimport pandas as pd \nimport time\n\n\ndef Average(lst): \n return sum(lst) / len(lst) \n\ndef getDocumentWithData(db, collection, ID):\n doc_ref = db.collectio...
[ [ "pandas.DataFrame" ] ]
haejung83/tensorflow_object_detection_test_suite
[ "34b468ee2c1caef45a78e16581c0ad9a6efe8ccc" ]
[ "python/test_session.py" ]
[ "\nfrom PyQt5 import QtCore\n\nimport tensorflow as tf\nimport numpy as np\nimport cv2\nimport os\nfrom PIL import Image\n\nfrom config import Config\nfrom config import CONFIG_KEY_RESULT_CUTOFF_THRESHOLD\n\n# Constants for status of this session\nSESSION_STATUS_LOAD_FAILED = 0\nSESSION_STATUS_LOAD_SUCCESS = 1\nSES...
[ [ "tensorflow.get_default_graph", "tensorflow.Graph", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.image.encode_jpeg", "tensorflow.ConfigProto", "tensorflow.saved_model.loader.load", "tensorflow.image.encode_png" ] ]
tiagocri/ecg-transfer-learning-master
[ "ce27589f87c09a3df8b4abf1644eede579378725" ]
[ "finetuning/datasets.py" ]
[ "import functools\n\nimport numpy as np\n\nfrom transplant.datasets import physionet\nfrom transplant.utils import pad_sequences\n\n\ndef get_challenge17_data(db_dir, fs=None, pad=None, normalize=False, verbose=False):\n records, labels = physionet.read_challenge17_data(db_dir, verbose=verbose)\n if normalize...
[ [ "numpy.array" ] ]
Xinzzz/Value-based-RL-Algorithms
[ "fac6aadcbbf2a58de864c0a0c0843f85d7b6cac4" ]
[ "algos/DQN.py" ]
[ "import os\nfrom typing import Dict, List, Tuple\nimport sys\nsys.path.append(os.path.abspath(os.path.dirname(__file__)+'/'+'..'))\n\nimport gym\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom common.PER import PrioritizedReplayBuffer\nf...
[ [ "torch.nn.functional.smooth_l1_loss", "torch.FloatTensor", "torch.cuda.is_available", "numpy.random.random", "torch.mean" ] ]
JosephCatrambone/BlenderTopoTag
[ "e879586c01aac731bb89b4753a7cde601fd0a49a" ]
[ "debug.py" ]
[ "import numpy\n\nfrom fiducial import TopoTag\n\n\ndef save_plain_ppm(img, filename: str):\n\t\"\"\"Save a matrix (floats) as a PPM image.\"\"\"\n\twith open(filename, 'wt') as fout:\n\t\tfout.write(\"P3\\n\")\n\t\tfout.write(f\"{img.shape[1]} {img.shape[0]}\\n\")\n\t\tfout.write(\"255\\n\")\n\t\tidx = 0\n\t\tfor y...
[ [ "numpy.asarray" ] ]
yunx-z/soln-ml
[ "f97c991c2ad287e8d295d3058b4a9b1fd50d847b" ]
[ "solnml/base_estimator.py" ]
[ "import os\nfrom solnml.automl import AutoML\nfrom solnml.components.metrics.metric import get_metric\nfrom solnml.components.feature_engineering.transformation_graph import DataNode\nimport numpy as np\nimport pandas as pd\n\n\nclass BaseEstimator(object):\n def __init__(\n self,\n dataset...
[ [ "numpy.corrcoef", "pandas.DataFrame", "numpy.zeros" ] ]
thomashirtz/chinese-shadowing
[ "3b78bb5dcab308549308b291df38f8ca214c0fa9" ]
[ "chinese_shadowing/preprocessing.py" ]
[ "import re\nimport pandas as pd\nfrom shutil import copyfile\nfrom chinese_shadowing.config import path_data\nfrom chinese_shadowing.config import path_temporary\n\n\nif __name__ == '__main__':\n folder_name = 'HSK 1-6 2012'\n media_location = path_temporary / folder_name\n path_notes = path_temporary.join...
[ [ "pandas.read_csv" ] ]
m-albert/MVRegFus
[ "dc55537bdf87a60a0a023644a042f1a398db7c9c" ]
[ "mvregfus/imaris.py" ]
[ "\"\"\"\nfile taken and modified from https://github.com/tlambert03/imarispy/blob/master/imarispy\n(added functions from utils.py for easy single file import)\n\"\"\"\n\n# from .util import h5str, make_thumbnail, subsample_data\nimport logging\nimport os\nimport re\n\nimport h5py\nimport numpy as np\n\nlogger = log...
[ [ "numpy.max", "numpy.ndindex", "numpy.array", "numpy.pad", "numpy.histogram", "numpy.zeros", "numpy.min", "numpy.random.randint", "numpy.squeeze" ] ]
ShengyuH/PredateOverlap
[ "770c3063399f08b3836935212ab4c84d355b4704", "770c3063399f08b3836935212ab4c84d355b4704" ]
[ "lib/utils.py", "common/math_torch/se3.py" ]
[ "\"\"\"\nGeneral utility functions\n\nAuthor: Shengyu Huang\nLast modified: 30.11.2020\n\"\"\"\n\nimport os,re,sys,json,yaml,random, argparse, torch, pickle\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport numpy as np\nfrom scipy.spatial.transform import Rotation\n\nfrom ...
[ [ "torch.cuda.manual_seed_all", "torch.isnan", "numpy.random.seed", "torch.clamp", "torch.manual_seed", "torch.isinf", "torch.sum" ], [ "torch.cat", "torch.eye" ] ]
hschwane/offline_production
[ "e14a6493782f613b8bbe64217559765d5213dc1e", "e14a6493782f613b8bbe64217559765d5213dc1e" ]
[ "clsim/resources/scripts/compareToPPCredux/generateTestingGeometry.py", "clsim/resources/plots/flasher_time_distributions.py" ]
[ "#!/usr/bin/env python\n\nfrom optparse import OptionParser\n\nusage = \"usage: %prog [options]\"\nparser = OptionParser(usage)\nparser.add_option(\"-x\", \"--xpos\", type=\"float\", default=0.,\n dest=\"XPOS\", help=\"The x coordinate in meters\")\nparser.add_option(\"-y\", \"--ypos\", type=\"floa...
[ [ "numpy.concatenate", "numpy.sum", "numpy.array" ], [ "matplotlib.use", "numpy.max", "numpy.array", "scipy.histogram", "numpy.exp", "matplotlib.rc", "matplotlib.rcParams.update", "numpy.sqrt", "numpy.linspace" ] ]
chenyichun/DetectHatefulMemes
[ "bb321f1d5bef80255591f52a2d8f06f68d67bac8" ]
[ "refcoco/data/datasets/refcoco.py" ]
[ "import os\nimport json\nimport _pickle as cPickle\nfrom PIL import Image\nimport base64\nimport numpy as np\nimport time\nimport logging\n\nimport torch\nfrom torch.utils.data import Dataset\nfrom external.pytorch_pretrained_bert import BertTokenizer\n\nfrom common.utils.zipreader import ZipReader\nfrom common.uti...
[ [ "torch.as_tensor", "torch.cat" ] ]
yfor1008/Augmentor
[ "ad24da8dadbafe1befa5bd7599a82197bfa45331" ]
[ "Augmentor/Operations.py" ]
[ "# Operations.py\n# Author: Marcus D. Bloice <https://github.com/mdbloice> and contributors\n# Licensed under the terms of the MIT Licence.\n\"\"\"\nThe Operations module contains classes for all operations used by Augmentor.\n\nThe classes contained in this module are not called or instantiated directly\nby the us...
[ [ "numpy.random.normal", "numpy.array", "numpy.matrix", "numpy.random.rand", "numpy.asarray", "numpy.vectorize", "numpy.round", "numpy.linalg.pinv", "numpy.random.beta", "numpy.random.uniform", "numpy.amax", "numpy.amin", "numpy.linspace", "numpy.meshgrid" ]...
FilippoAleotti/Dwarf-Tensorflow
[ "3b44d3a791b75e93f8d1cabded736440ce84bca0" ]
[ "sceneflow/dwarf.py" ]
[ "'''\nDwarf network\n\nAuthor: Filippo Aleotti\nMail: filippo.aleotti2@unibo.it\n'''\n\nimport tensorflow as tf\nfrom modules.dwarf import DwarfDecoder as Decoder\nfrom modules.pwc import Encoder\nfrom main_utils.ops import regularization_term, l1_loss\nfrom main_utils.flow_utils import flow_to_color\nfrom main_uti...
[ [ "tensorflow.image.resize_bilinear", "tensorflow.summary.image", "tensorflow.summary.scalar", "tensorflow.expand_dims", "tensorflow.ones", "tensorflow.variable_scope", "tensorflow.squeeze", "tensorflow.slice", "tensorflow.cast" ] ]
yueyongjiao/openNMT-10-baiduyun
[ "5f7af2f995cbb6816b52029173e6219d555ddeed", "5f7af2f995cbb6816b52029173e6219d555ddeed" ]
[ "tools/embeddings_to_torch.py", "onmt/modules/StackedRNN.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nfrom __future__ import division\nimport six\nimport sys\nimport numpy as np\nimport argparse\nimport torch\n\n\ndef get_vocabs(dict_file):\n vocabs = torch.load(dict_file)\n\n enc_vocab, dec_vocab = None, None\n\n # the...
[ [ "torch.save", "torch.Tensor", "torch.load" ], [ "torch.nn.Dropout", "torch.nn.LSTMCell", "torch.stack", "torch.nn.ModuleList", "torch.nn.GRUCell" ] ]
CupOfNormal/tensorflow
[ "ac5bde122fff9cc12efbc0a38dd7098c9ff3b1c6", "ac5bde122fff9cc12efbc0a38dd7098c9ff3b1c6" ]
[ "tensorflow/contrib/distributions/python/ops/transformed_distribution.py", "tensorflow/contrib/imperative/imperative_test.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.math_ops.equal", "numpy.array_equal", "tensorflow.python.ops.array_ops.where", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.ops.array_ops.ones_like", "tensorflow.python.ops.math_ops.logical_not", "tensorflow.python.ops.math_ops.reduce_prod", ...
joeatbayes/StockCSVAndSMAPerformanceComparison
[ "9a4989e640a367de84896c0ba10f65494d1be9ab" ]
[ "read_file_line_by_line_num.py" ]
[ "# Doesn't work need to finish so can test\n# but it took over 2 minutes to load the CSV\n# compared to the simple load which wass only 13 seconds\n# would be interesting to see how they new python compilers fare with \n# speeding up the loop.\n# http://stackoverflow.com/questions/4315506/load-csv-into-2d-matrix-wi...
[ [ "numpy.repeat", "numpy.genfromtxt", "numpy.convolve" ] ]
cisaacstern/xarray
[ "c5ee050f5faf09bb047528cca07ab57051282894" ]
[ "xarray/tests/test_dataarray.py" ]
[ "import pickle\nimport sys\nimport warnings\nfrom copy import deepcopy\nfrom textwrap import dedent\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom pandas.core.computation.ops import UndefinedVariableError\nfrom pandas.tseries.frequencies import to_offset\n\nimport xarray as xr\nfrom xarray import (...
[ [ "numpy.repeat", "numpy.testing.assert_allclose", "numpy.random.rand", "numpy.random.choice", "numpy.tile", "numpy.exp", "numpy.mean", "numpy.tensordot", "numpy.random.random", "numpy.issubdtype", "numpy.full", "numpy.sin", "pandas.DataFrame", "numpy.flipud",...
btsai-dev/FoodSeg103-Benchmark-v1
[ "dbbe733e624f4d714a575dc4cfcb571d0f5b9af5" ]
[ "tests/test_model.py" ]
[ "import torch\n\npthfile = r'/SEG/mmsegmentation/pretrained_model/recipe1MP_R50.pth'\n\n\nnet=torch.load(pthfile)\n\nfor k in net.keys():\n print(k)" ]
[ [ "torch.load" ] ]
BHarold-Ling/Precipitation_pub
[ "8386286c8137c008ed4c268f63486b9d06eb98d7" ]
[ "load/db_load.py" ]
[ "\"\"\"\nLoad DB files from text files and other sources\n\"\"\"\n\nfrom datetime import date, timedelta\n\nfrom load.PrecipLine import PrecipLine\nfrom load.StationLine import StationLine\nimport sqlite3\nimport pandas as pd\n\n\ndef import_precip_file(fname, conn: sqlite3.Connection):\n \"\"\"\n Import a si...
[ [ "pandas.DataFrame" ] ]
aidotse/Team-rahma.ai
[ "66857731e1ca2472e0783e37ba472b55a7ac9cd4" ]
[ "CellProfiler/tests/modules/test_resizeobjects.py" ]
[ "import numpy\nimport numpy.testing\nimport pytest\n\nimport cellprofiler_core.image\nimport cellprofiler_core.measurement\nfrom cellprofiler_core.constants.measurement import FF_CHILDREN_COUNT, FF_PARENT\n\nimport cellprofiler.modules.resizeobjects\nimport cellprofiler_core.object\n\ninstance = cellprofiler.module...
[ [ "numpy.zeros" ] ]
lff5985/share-from-zhao
[ "b1a6e3513db10e6da18ed6884d4fab9fb68e51b4" ]
[ "SatPlot/plot.py" ]
[ "#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n'''Plot GPS Satellite Track\n\nUsage:\n plot --prn <prn> --type <type>\n\nOptions:\n --prn <prn> PRN number\n --type <type> Plot type\n\nExample:\n plot --prn ' 4' --type 'ECEF'\n\n'''\n\n\nimport math\nimport numpy as np\nfrom mpl_toolkits.basemap impo...
[ [ "numpy.sin", "matplotlib.pyplot.figure", "numpy.arange", "numpy.cos", "matplotlib.pyplot.show" ] ]
chrislarson1/checkers.ai
[ "cbd7014d1d7bedc512026366d821f321b8863db3" ]
[ "checkers_ai/pretrain.py" ]
[ "import tqdm\nimport tensorflow as tf\nfrom checkers_ai.config import *\nfrom checkers_ai.parser import parse\nfrom checkers_ai.model import Policy\n\n\ndef train():\n global lr, epoch, ACC, LOSS, PASS_ANNEAL_RATE, FAIL_ANNEAL_RATE\n print(\"Building Graph...\")\n TF_CONFIG = tf.ConfigProto(allow_soft_plac...
[ [ "tensorflow.trainable_variables", "tensorflow.Session", "tensorflow.ConfigProto", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.report_uninitialized_variables" ] ]
sanjeevmk/GLASS
[ "91c0954eab87d25d4866fea5c338f79fbca4f79e" ]
[ "Src/latentSpaceExplore_Hessian.py" ]
[ "import torch\ntorch.manual_seed(10)\ntorch.cuda.manual_seed_all(10)\nimport os\nimport numpy as np\nfrom sklearn.metrics.pairwise import cosine_similarity as cs\n\nimport Energies\nimport Leapfrog\nimport Hessian \nfrom Utils import writer,Off,Obj,Pts,rect_remesh\nimport header \nfrom torch.autograd import Variabl...
[ [ "torch.zeros", "numpy.concatenate", "numpy.array", "torch.cat", "torch.cuda.manual_seed_all", "numpy.reshape", "numpy.zeros", "numpy.delete", "numpy.random.permutation", "numpy.mean", "torch.from_numpy", "torch.manual_seed", "numpy.arange", "numpy.argmax", ...
BartBruininks/MDVoxelSegmentation
[ "6312940f1a50e43d2f7196543a6b43d650a382c1" ]
[ "src/mdvoxelsegmentation/leaflets.py" ]
[ "# coding: utf-8\nimport os\nimport time\nimport sys\nimport numpy as np\nimport multiprocessing as mp\n#from functools import partial\nimport MDAnalysis as mda\nimport matplotlib.pyplot as plt\nfrom . import clustering as seg\nfrom mpl_toolkits.mplot3d import Axes3D\n\n\nmda.core.periodic = True\n\n### Only for te...
[ [ "numpy.logical_or", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.any", "matplotlib.pyplot.show", "numpy.unique" ] ]
charles-stan/learn_python_Stanier
[ "740a7104fcbd739663d703d3770f9e31509300f8" ]
[ "E4_solve_nonlin_equation.py" ]
[ "\"\"\"\r\nSolve a Single Nonlinear Equation\r\nLearning Example for Dr. Stanier's classes\r\nFile: E4_solve_nonlin_equation.py\r\n\r\nAuthor: Charles Stanier, charles-stanier@uiowa.edu\r\nDate: August 9, 2019\r\nWritten/Tested In: Python 3.7.3\r\n\r\nProgram Objective: Solve the equation y = f(x) = x**1.5 + ln(x)...
[ [ "numpy.linspace", "numpy.ones", "scipy.optimize.minimize_scalar" ] ]
jfozard/HEI10
[ "4d04563e59ff1c462fb72dcad085677c524d53ab" ]
[ "source_data_scripts/data_table_plots.py" ]
[ "\n## Code to generate the majority of the data analysis plots\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport pickle\n\nimport statsmodels.api as sm\n\nimport matplotlib as mpl\n\nimport json\n\nfrom matplotlib.colors import to_rgba_array\n\nfrom statsmodels.stats.wei...
[ [ "matplotlib.pyplot.xlim", "numpy.minimum", "numpy.min", "numpy.mean", "pandas.read_csv", "matplotlib.pyplot.bar", "numpy.max", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.gca", "matplotlib.lines.Line...
PSFC-HEDP/Orion
[ "37535c788112df346bb9d3a13255f58f2479d4bc" ]
[ "orion/primitives/tadgan.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport logging\nimport math\nimport tempfile\nfrom functools import partial\n\nimport keras\nimport numpy as np\nimport pandas as pd\nfrom keras import backend as K\nfrom keras.layers import Input\nfrom keras.layers.merge import _Merge\nfrom keras.models import Model\nfrom mlprimitives.a...
[ [ "scipy.stats.zscore", "numpy.quantile", "numpy.array", "numpy.random.normal", "numpy.asarray", "numpy.median", "numpy.ones", "numpy.mean", "numpy.logical_and", "numpy.multiply", "numpy.std", "numpy.random.shuffle", "scipy.stats.gaussian_kde", "numpy.arange",...
shigeyukioba/matchernet
[ "d7d47a1c152dfcb8d1a3093083d53f19cc4922d6" ]
[ "demo/vrep_control/abr_control/controllers/joint.py" ]
[ "import numpy as np\n\nfrom .controller import Controller\n\n\nclass Joint(Controller):\n \"\"\" Implements a joint space controller\n\n Moves the arm joints to a set of specified target angles\n\n Parameters\n ----------\n robot_config : class instance\n contains all relevant information abou...
[ [ "numpy.copy", "numpy.dot", "numpy.sqrt", "numpy.zeros" ] ]
notmahi/disk
[ "8b0704fd6159c341dabba11172e8ceb11293a2d5", "8b0704fd6159c341dabba11172e8ceb11293a2d5" ]
[ "agent/incremental_agent.py", "utilities/logger.py" ]
[ "import hydra\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport utilities as utils\nimport wandb\n\nfrom agent import Agent\n\nLOG_FREQ = 100\n\n\nclass IncrementalAgent(Agent):\n \"\"\"Incremental skill learning algorithm.\"\"\"\n\n def __init__(\n self,\n obs_dim,\n ...
[ [ "torch.device", "torch.min", "numpy.log", "torch.optim.Adam", "torch.nn.functional.mse_loss", "torch.as_tensor", "torch.jit.script" ], [ "numpy.array", "torch.utils.tensorboard.SummaryWriter" ] ]
GillianGrayson/dnamvae
[ "3956a019f0e9aab5732fa215c5e28448b556de47" ]
[ "src/models/fcmlp_model.py" ]
[ "from typing import Any, List\nfrom pytorch_lightning import LightningModule\nfrom src.models.fcvae_model_v1 import FCVAEModelV1\nfrom src.models.fcvae_model_v2 import FCVAEModelV2\nfrom src.models.fcae_model import FCAEModel\nfrom torch import nn\nimport torch\nfrom torchmetrics.classification.accuracy import Accu...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.MSELoss", "torch.nn.Sequential", "torch.nn.CrossEntropyLoss", "torch.nn.LeakyReLU", "torch.softmax", "torch.nn.L1Loss", "torch.argmax" ] ]
rajahaseeb147/PCD_Registration_ReAgent
[ "6dd09e07f0aad79fd3ef4f4ae4f7fc801eb02e4d" ]
[ "utility/visualization_open3d_nonblocking.py" ]
[ "import numpy as np\nimport time\nimport matplotlib.pyplot as plt\nfrom drawnow import drawnow\nimport cv2 as cv\nimport torch\nfrom tqdm import tqdm\nimport copy\nimport open3d as o3d\n\nimport config as cfg\n\nimport os\nimport sys\n\nimport plotly\nimport plotly.graph_objs as go\n\nclass CloudVisualizer:\n\n ...
[ [ "matplotlib.pyplot.savefig" ] ]
airplasmaK/CS489_Project
[ "c1da285841aab9fe809be9b3120d5b3621b18ac7" ]
[ "final/final/new_backend.py" ]
[ "import numpy as np \r\nimport pandas as pd \r\n\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\nimport os\r\nimport re\r\n\r\nfrom urllib.parse import urlparse\r\nfrom tld import get_tld\r\n\r\nimport tensorflow as tf\r\nfrom keras.models import Sequential\r\nimport keras.optimizers\r\nfrom keras.la...
[ [ "sklearn.model_selection.train_test_split", "pandas.DataFrame", "pandas.read_csv", "tensorflow.keras.optimizers.Adam" ] ]
Intelligent-Computing-Lab-Yale/DetectX
[ "618f86a7ed7e4d75c9fd83d6192f4429b36fba46" ]
[ "adv_attacks.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport time\nimport torch\nimport torch.optim as optim\nfrom torch.autograd import Variable\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport copy\nfrom torch.autograd import Variable\n\n\ndef fgsm_attack(image, epsilon, data_grad):\n # Collect the eleme...
[ [ "torch.autograd.Variable", "torch.nn.functional.cross_entropy", "torch.sign", "torch.clamp" ] ]
laket/teflon
[ "430652424e925b7abb01fefadd3aa03d26e9f0b7" ]
[ "simulator/env_ops.py" ]
[ "# Copyright 2018 Oiki Tomoaki. 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 by ap...
[ [ "numpy.random.normal", "tensorflow.py_func", "numpy.sum", "tensorflow.Session", "tensorflow.constant", "tensorflow.variable_scope", "numpy.stack", "numpy.all" ] ]
takeyan/bmx_tensorflow
[ "79517578deb4ea2a8dea641f1a8fa4363c13f76b" ]
[ "tensorflow/python/eager/context.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.pywrap_tensorflow.TF_DeleteSessionOptions", "tensorflow.python.pywrap_tensorflow.TFE_DeleteContext", "tensorflow.python.framework.device.DeviceSpec.from_string", "tensorflow.python.pywrap_tensorflow.TF_DeviceListCount", "tensorflow.python.platform.app.run", "tensorflow.p...
sunnyakaxd/latte
[ "de74065122a1f858bd75f8e1a36fca3b23981f4c" ]
[ "latte/latte_core/report/executed_background_jobs/executed_background_jobs.py" ]
[ "# Copyright (c) 2013, ElasticRun and contributors\n# For license information, please see license.txt\n\nfrom __future__ import unicode_literals\nimport frappe\nfrom croniter import croniter\nfrom datetime import datetime\nimport pandas as pd\nfrom datetime import timedelta\nimport pytz\n\ndef execute(filters=None,...
[ [ "pandas.DataFrame.from_records" ] ]
CharlieCurry/AutoMCL
[ "4cb54eb7bd2284de36d3b802bd53a9a33e00f5f4" ]
[ "UserTest/e2e/FCNNs/build_net/infer.py" ]
[ "# -*- coding:utf8 -*\nimport tensorflow as tf\nimport numpy as np\nimport sys\nimport time\n\ndef build_layer5_net(batch_size, l1_size, l2_size, l3_size, l4_size, out_size):\n keep_prob = tf.placeholder(tf.float32, name='keep_prob')\n xs = tf.placeholder(tf.float32, [None, l1_size], name='xs')\n ys = tf.p...
[ [ "tensorflow.losses.huber_loss", "tensorflow.zeros", "tensorflow.train.latest_checkpoint", "tensorflow.get_default_graph", "tensorflow.train.import_meta_graph", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.matmul", "tensorflow.train.RMSPropOptimizer", "numpy.r...
pwllr/IDA-3D
[ "f5c8acbcf90a7c351499249a24754ad311da375e" ]
[ "maskrcnn_benchmark/modeling/roi_heads/td_box_head_v3/td_box_head_v3.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nfrom torch import nn\n\nfrom .roi_box_feature_extractors import make_roi_box_feature_extractor\nfrom .roi_box_predictors import make_roi_box_predictor\nfrom .inference import make_roi_box_post_processor\nfrom .loss import make_r...
[ [ "torch.no_grad" ] ]