repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Timothy-W-Hilton/STEMPyTools
[ "17fbabb7206e0a80d9e2d01c6535ac718fcddbb2" ]
[ "stem_pytools/plot_x_y_verify.py" ]
[ "\"\"\"\nshort module to produce contour plots of STEM grid X values and STEM\ngrid Y values. These are useful to make sure that data are being read\nand plotted with the correct orientation. The minimum X and Y values\nshould be in the southeast corner of the domain.\n\"\"\"\n\nimport os.path\nimport argparse\ni...
[ [ "matplotlib.pyplot.show", "numpy.arange" ] ]
Lee-W/great_expectations
[ "bd9cb27d1caa752364d298f5057e85b6b604b622" ]
[ "great_expectations/core/util.py" ]
[ "import logging\nfrom collections.abc import Mapping\n\n# Updated from the stack overflow version below to concatenate lists\n# https://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth\nfrom IPython import get_ipython\n\nfrom great_expectations.core.run_identifier import RunI...
[ [ "pandas.isna" ] ]
nstarman/trackstream
[ "0d22f5eb95a6ccdfd6c50e3aa879b62583ad6efb", "0d22f5eb95a6ccdfd6c50e3aa879b62583ad6efb" ]
[ "trackstream/example_data/tests/data.py", "trackstream/preprocess/rotated_frame.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Example Data.\n\n.. todo::\n\n Use the pytest fixtures method for multi-module data.\n\n\"\"\"\n\n# __all__ = [\n# ]\n\n\n##############################################################################\n# IMPORTS\n\n# THIRD PARTY\nimport astropy.coordinates as coord\nimport astro...
[ [ "numpy.linspace", "numpy.ones", "numpy.zeros" ], [ "numpy.dot", "numpy.median", "numpy.sum", "matplotlib.pyplot.ylim", "numpy.shape", "numpy.abs", "numpy.argsort", "numpy.average", "matplotlib.pyplot.scatter", "scipy.optimize.minimize", "scipy.optimize.l...
hb-ye/rcexp
[ "266e676de9a5fd93b44b89d204a98abfceae3f85" ]
[ "mysite/cal_time.py" ]
[ "import numpy as np\nimport random\nfrom mysite.rcexp.models import Network_Structure, Exp_Info\nimport json\n\ndef travel_time_function(link_flow, free_flow_time,link_capacity):\n\tt=free_flow_time*(1+0.15*(link_flow/link_capacity)**4)\n\treturn t\n\n# od_demand=5;\n# link_path_matrix=np.array([[1, 0, 0], [0, 1, 1...
[ [ "numpy.array", "numpy.dot" ] ]
SunTzunami/pymoo-doc
[ "f82d8908fe60792d49a7684c4bfba4a6c1339daf" ]
[ "examples/problem.py" ]
[ "# --------------------------------------------------------------------------------------------\n# Single\n# --------------------------------------------------------------------------------------------\n\n# START ackley\nimport numpy as np\n\nfrom pymoo.factory import get_problem\nfrom pymoo.util.plotting import pl...
[ [ "numpy.sum", "numpy.array", "numpy.random.rand" ] ]
chiukin/lsc-cnn
[ "73bde817bc01a7fe65ba1acd6cd3e9338c32cf8c" ]
[ "main.py" ]
[ "\"\"\"\nmain.py: Main code to drive LSC-CNN \nAuthors : svp & dbs\n\"\"\"\n\nimport argparse\nimport random\nfrom data_reader import DataReader\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport cv2\nimport numpy as np\nimport os\nimport random, string\nimport math\nimport pickle\nfrom collecti...
[ [ "torch.cuda.manual_seed", "numpy.argmin", "numpy.minimum", "numpy.load", "numpy.where", "torch.cuda.is_available", "torch.cuda.FloatTensor", "torch.nn.CrossEntropyLoss", "torch.sum", "numpy.max", "numpy.count_nonzero", "torch.nn.functional.avg_pool2d", "torch.Fl...
massgh/pivotpy
[ "0475ee41ea5a9b4ac6b469a676e5034f735d84f1" ]
[ "pivotpy/widgets.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: Widgets.ipynb (unless otherwise specified).\n\n__all__ = ['css_style', 'dark_colors', 'light_colors', 'simple_colors', 'default_colors', 'get_files_gui', 'InputGui',\n 'generate_summary', 'VasprunApp', 'KPathApp']\n\n# Cell\nimport os, textwrap\nimport json\nfr...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.round", "pandas.DataFrame", "numpy.random.randint" ] ]
3starblaze/cellular-automata
[ "0d16aab6a2e03b8575c47967fe7dc9cd41fe2d34" ]
[ "src/test_Controller.py" ]
[ "import copy\n\nimport pytest\nimport numpy as np\n\nfrom Controller import Controller\n\n\ndef GAME_OF_LIFE_RULESET(cell, values):\n if cell:\n return sum(values) >= 2 and sum(values) <= 3\n else:\n return sum(values) == 3\n\n\nGAME_OF_LIFE_INDICES = [\n (-1, 1),\n (0, 1),\n (1, 1),\n ...
[ [ "numpy.array_equal" ] ]
fbleite/LandryMachineSensor
[ "2ae3e903e9b20cea955189aa07ecd64a8bced960" ]
[ "RaspberryPi/AudioProcessing.py" ]
[ "import pyaudio\nimport numpy as np\nimport logging\n\nclass AudioProcessing :\n def __init__(self, chunk, rate):\n self.chunk = chunk\n self.rate = rate\n self.format = pyaudio.paInt16\n self.channels = 1\n self.timebox = 15 #In seconds\n self.player = pyaudio.PyAudio()...
[ [ "numpy.fromstring", "numpy.absolute" ] ]
CraigWang1/automl
[ "6dfc360b1a78d2d973b0d126acc76b1897ea9cc8" ]
[ "efficientdet/anchors.py" ]
[ "# Copyright 2020 Google Research. 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...
[ [ "numpy.minimum", "numpy.exp", "tensorflow.compat.v1.convert_to_tensor", "numpy.where", "numpy.concatenate", "tensorflow.compat.v1.not_equal", "numpy.swapaxes", "numpy.arange", "numpy.column_stack", "tensorflow.compat.v1.range", "numpy.expand_dims", "numpy.vstack", ...
kkothari2001/uproot4
[ "e184ff5ca75d95953e94e4c2e7928d725b46de7e" ]
[ "src/uproot/compression.py" ]
[ "# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE\n\n\"\"\"\nThis module defines an interface to compression algorithms used by ROOT, as well\nas functions for compressing and decompressing a :doc:`uproot.source.chunk.Chunk`.\n\"\"\"\n\n\nimport struct\n\nimport numpy\n\nimport up...
[ [ "numpy.empty", "numpy.frombuffer" ] ]
xiaofengqing/DFCN-for-segmentation
[ "da99daff5599f9823ac0ce177f50c01b03bf0296" ]
[ "data_loader/Potsdam_loader.py" ]
[ "#encoding:utf-8\nimport os\nimport collections\nimport json\nimport torch\nimport torchvision\nimport numpy as np\nimport scipy.misc as m\nimport scipy.io as io\nimport matplotlib.pyplot as plt\nfrom DFCN.uitls import recursive_glob\nfrom tqdm import tqdm\nfrom torch.utils import data\nimport tifffile as tiff\n\n\...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "scipy.misc.imresize", "numpy.mean", "scipy.misc.imread", "numpy.std", "torch.from_numpy", "numpy.transpose", "torch.utils.data.DataLoader", "scipy.misc.imsave", "numpy.all", "matplotlib.pyplot.show", "matplotli...
mittalgovind/fifty
[ "0d309084aea78ec1fe66ef3f03fb27d6c8d1032b" ]
[ "fifty/commands/train.py" ]
[ "# fifty/commands/train.py\n\n# from .base import Base\nimport numpy as np\nimport os\nimport random\nimport pandas as pd\nimport tensorflow as tf\ntf.logging.set_verbosity(tf.logging.ERROR)\n# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nfrom keras.models import Sequential, load_model\nfrom keras.layers import Dens...
[ [ "numpy.concatenate", "pandas.DataFrame", "tensorflow.logging.set_verbosity", "numpy.empty" ] ]
nsavinov/SPTM
[ "4d984cf1e84153e65fe1bf3e9121580eddc075cb" ]
[ "src/common/util.py" ]
[ "#!/usr/bin/env python\nimport cPickle\nimport cv2\nimport numpy as np\nimport h5py\nfrom vizdoom import *\nimport math\nimport os\nimport os.path\nimport sys\nimport random\nimport scipy.misc\n\nfrom constants import *\nfrom video_writer import *\n\nimport cv2\nimport os\nimport cPickle\nimport numpy as np\nnp.ran...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros_like", "numpy.zeros", "numpy.random.seed", "numpy.argmax" ] ]
axkoenig/grasp_refinement
[ "f06bac8c6a243a971726a17b2c2235db8b996c50" ]
[ "agent/src/plots/vis_train.py" ]
[ "import os\nfrom argparse import ArgumentParser\n\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport pickle\nfrom tensorboard.backend.event_processing.event_accumulator import EventAccumulator\n\nfrom vis_thesis_tests import get_framework_name\n\n\nseven_tab10_c...
[ [ "pandas.DataFrame", "numpy.ones", "numpy.unique", "matplotlib.pyplot.figure" ] ]
srikrishnapriyad/youtube-8m
[ "463f9abb926db956ed5191ab26d56fa6f3b15030" ]
[ "video_level_models.py" ]
[ "# Copyright 2016 Google Inc. 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 app...
[ [ "tensorflow.reduce_sum", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.flags.DEFINE_integer", "tensorflow.reshape" ] ]
s-bear/UVTV
[ "eea18af656a2f7e803badf3a7d4457464221d19a" ]
[ "software/scripts/pixel_stats.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 7 16:07:07 2020\n\n@author: uqspowe6\n\"\"\"\n\nimport os\nimport numpy as np\nimport imageio as iio\nfrom skimage.filters import median\nfrom skimage.measure import moments, regionprops\nfrom skimage.segmentation import flood\nfrom skimage.draw import circle\n\...
[ [ "numpy.dot", "numpy.nanmean", "numpy.linalg.lstsq", "numpy.max", "numpy.concatenate", "matplotlib.pyplot.subplots", "numpy.nanmin", "numpy.unravel_index", "numpy.hypot", "numpy.nanmax", "numpy.empty_like", "numpy.nanstd", "numpy.array", "numpy.zeros", "n...
anatu/ML_working
[ "e2de26ab07de0c55862de8045e48cfb904a76b5a" ]
[ "decision_tree_regression.py" ]
[ "# DECISION TREE REGRESSION\r\n# NOTE: The decision tree will produce outputs according to the average value between\r\n# the sub-intervals that it chooses, i.e. the value outputted by a predictor between\r\n# any two real observations CANNOT be continuously increasing/decreasing,\r\n# since it is always computing ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "sklearn.tree.DecisionTreeRegressor", "matplotlib.pyplot.scatter", "pandas.read_csv" ] ]
rjn1497/Sankshep
[ "a405fa1a17421674eb8e532251c75e3f9f16ee0c" ]
[ "incomp. abstactive text suumarizer/train.py" ]
[ "import os\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\" #Set cuda device\n\nimport time\n\nimport torch as T\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom model import Model\n\nfrom data_util import config, data\nfrom data_util.batcher import Batcher\nfrom data_util.data import Vocab\nfrom train...
[ [ "torch.distributions.Categorical", "torch.cuda.manual_seed_all", "torch.stack", "torch.max", "numpy.random.seed", "torch.FloatTensor", "torch.manual_seed", "torch.multinomial", "torch.autograd.no_grad", "torch.cuda.is_available", "torch.load", "torch.nn.functional.n...
Samanwaya1301/tidal-heating-bilby
[ "9109f980e1e315ccc3ebf172a39f55e04408e118" ]
[ "bilby/core/utils.py" ]
[ "from __future__ import division\n\nfrom distutils.spawn import find_executable\nimport logging\nimport os\nimport shutil\nimport sys\nfrom math import fmod\nimport argparse\nimport inspect\nimport functools\nimport types\nimport subprocess\nimport multiprocessing\nfrom importlib import import_module\nimport json\n...
[ [ "numpy.quantile", "numpy.median", "numpy.copy", "numpy.mean", "numpy.cos", "numpy.fft.irfft", "numpy.sin", "scipy.special.logsumexp", "numpy.log", "pandas.DataFrame", "numpy.transpose", "numpy.isfinite", "numpy.mod", "numpy.array", "numpy.round", "nu...
PyAnomaly/SUPERVISED-ANOMALY-DETECTION
[ "558207deb583b4ec818b17b89badfeea69804242" ]
[ "Utils/Loss.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 19 16:19:27 2019\n\n@author: kenneth\n\"\"\"\n\nimport numpy as np\n\nclass loss:\n def __init__(self):\n return\n \n @staticmethod\n def sigmoid(X, beta):\n '''\n Also known as the logistic loss,\n ...
[ [ "numpy.dot" ] ]
miraep8/rendseq
[ "d323cf152d1d1e54d08243209c4aaf76158cd8c8" ]
[ "rendseq/zscores.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Functions needed for z-score transforming raw rendSeq data.\"\"\"\nimport argparse\nimport sys\nimport warnings\nfrom os.path import abspath\n\nfrom numpy import mean, std, zeros\n\nfrom rendseq.file_funcs import make_new_dir, open_wig, validate_reads, write_wig\n\n\ndef _adjust_down...
[ [ "numpy.std", "numpy.mean" ] ]
mszhanyi/audio
[ "60a85b50ded95598f06e6aeac70bde86b6bd1dc6" ]
[ "test/torchaudio_unittest/prototype/rnnt_decoder_cpu_test.py" ]
[ "import torch\nfrom torchaudio_unittest.prototype.rnnt_decoder_test_impl import RNNTBeamSearchTestImpl\nfrom torchaudio_unittest.common_utils import PytorchTestCase\n\n\nclass RNNTBeamSearchFloat32CPUTest(RNNTBeamSearchTestImpl, PytorchTestCase):\n dtype = torch.float32\n device = torch.device(\"cpu\")\n\n\nc...
[ [ "torch.device" ] ]
chinassx/tensorflow
[ "2a6c3059289071f109943fed4bce01beadc0fa2d" ]
[ "tensorflow/python/keras/engine/training_v2.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.keras.engine.training_utils.unpack_validation_data", "tensorflow.python.keras.engine.data_adapter.select_data_adapter", "tensorflow.python.keras.engine.training_utils.OutputsAggregator", "tensorflow.python.keras.engine.training_utils.get_progbar", "tensorflow.python.keras.di...
ml-titans/titan5-codes
[ "1753d0434da9dc57a251bf1b704bb7aecf9354b6" ]
[ "tim/Bootstrap.py" ]
[ "# -*- coding: utf-8 -*-\n# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.13.6\n# kernelspec:\n# display_name: Python 3 (ipykernel)\n# language: python\n# name: python3\n# ---\n...
[ [ "numpy.array", "numpy.random.seed", "numpy.set_printoptions", "pandas.DataFrame", "numpy.random.uniform" ] ]
KunyFox/MxFace-Verify
[ "4102e0ce33da7c92ba92cf182a28cbea16d12b3a" ]
[ "tools/train_vggface2.py" ]
[ "import argparse, time, logging, os, math\n\nimport numpy as np\nimport mxnet as mx\nimport gluoncv as gcv\nfrom mxnet import gluon, nd\nfrom mxnet import autograd as ag\nfrom mxnet.gluon.data.vision import transforms\nfrom models import get_resnet, ClsLogits\nimport gluoncv as gcv\ngcv.utils.check_version('0.6.0')...
[ [ "numpy.random.beta" ] ]
schregardusc/dishtiny
[ "b0b1841a457a955fa4c22f36a050d91f12484f9e" ]
[ "old/script/MetabolismAsymmetryPrep.py" ]
[ "# usage:\n# num_files h5_filenames updates\nimport numpy as np\nimport h5py\nimport sys\nimport os\nfrom tqdm import tqdm\nimport pandas as pd\nfrom keyname import keyname as kn\nfrom fileshash import fileshash as fsh\nimport re\nfrom collections import Counter, defaultdict\nfrom joblib import delayed, Parallel\ni...
[ [ "numpy.random.normal", "numpy.array" ] ]
yt7589/iching
[ "6673da38f4c80e7fd297c86fedc5616aee8ac09b" ]
[ "biz/dmrl/iqtt/aks_ds.py" ]
[ "#\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset\nimport akshare as ak\n\nclass AksDs(Dataset):\n DS_MODE_FULL = 0\n DS_MODE_TRAIN = 1\n DS_MODE_VAL = 2\n DS_MODE_TEST = 3\n\n def __init__(self, stock_symbol, seq_length=10, embedding_s...
[ [ "numpy.loadtxt" ] ]
alexnikulkov/ReAgent
[ "e404c5772ea4118105c2eb136ca96ad5ca8e01db", "e404c5772ea4118105c2eb136ca96ad5ca8e01db" ]
[ "reagent/training/utils.py", "reagent/training/td3_trainer.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nfrom typing import Union\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\n\nEPS = np.finfo(float).eps.item()\n\n\ndef rescale_actions(\n actions: torch.Tensor,\n new_min: torch.Tensor,\n ...
[ [ "torch.nn.functional.one_hot", "torch.arange", "numpy.finfo", "torch.all", "torch.tensor" ], [ "torch.randn_like", "torch.no_grad" ] ]
winedarksea/AutoTS
[ "97176c3ab7cc9c930b1a76dc877f8a8138abae27" ]
[ "tests/test_autots.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Overall testing.\"\"\"\nimport unittest\nimport json\nimport pandas as pd\nfrom autots.datasets import (\n load_daily\n)\nfrom autots import AutoTS\nfrom autots.evaluator.auto_ts import fake_regressor\nfrom autots.models.model_list import default as default_model_list\n\n\nclass A...
[ [ "pandas.date_range", "pandas.DatetimeIndex" ] ]
Williams-OBGC-Lab/OCG_Saildrone
[ "68ee128c9c62525dbc789700a0e12cfc2253c325" ]
[ "OCG_Saildrone_Lesson_Notebook.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py:light\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.11.3\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n# # ...
[ [ "matplotlib.pyplot.xlim", "numpy.exp", "numpy.cos", "pandas.read_csv", "matplotlib.pyplot.colorbar", "numpy.sin", "numpy.log", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.log10", "matplotlib.pyplot.subplot", "matplotlib.pypl...
SYangChen/DIP_Practice
[ "ad08250aafe868985364b2bf7bf21b92e11cea20" ]
[ "DIP_Practice_3/hw3.py" ]
[ "from PIL import Image, ImageTk\nfrom tkinter import messagebox\nimport tkinter as tk\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport cv2 as cv\n#from tkinter import ttk\n\nwindow = tk.Tk()\t\t\t\t\t# create window\nwindow.title( 'B063040061 hw3' )\t# name title\n\nflagOpen = False\t\t\t\t\t# file open...
[ [ "numpy.uint8", "numpy.fft.ifft2", "numpy.array", "numpy.fft.fft2", "numpy.zeros", "numpy.ones", "matplotlib.pyplot.title", "numpy.exp", "matplotlib.pyplot.yticks", "numpy.real", "numpy.sqrt", "numpy.fft.fftshift", "matplotlib.pyplot.show", "matplotlib.pyplot...
timwuu/deep-learning-from-scratch-3
[ "6f18dee8c1d764e16275ed68f90966bc85f0ae66" ]
[ "steps/step18.py" ]
[ "import weakref\nimport numpy as np\nimport contextlib\n\n\nclass Config:\n enable_backprop = True\n\n\n@contextlib.contextmanager\ndef using_config(name, value):\n old_value = getattr(Config, name)\n setattr(Config, name, value)\n try:\n yield\n finally:\n setattr(Config, name, old_val...
[ [ "numpy.array", "numpy.ones_like", "numpy.isscalar" ] ]
Young1993/PaddleOCR
[ "e7e30c8258f4625dca2a0e981a530db706bd9bbe" ]
[ "ppocr/data/imaug/make_shrink_map.py" ]
[ "# -*- coding:utf-8 -*- \n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\nimport cv2\nfrom shapely.geometry import Polygon\nimport pyclipper\n\n__all__ = ['MakeShrinkMap']\n\n\nclass Make...
[ [ "numpy.clip", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.arange", "numpy.power", "numpy.append" ] ]
f-arruza/bigdata4
[ "2cf4e7e1c6a98adc0348659c7d7112fbba69f0d4" ]
[ "dashboard/classify_tweets.py" ]
[ "from pymongo import MongoClient\nimport os\nimport re\nimport pickle\nimport nltk\nfrom nltk.corpus import stopwords\nfrom sklearn.feature_extraction.text import CountVectorizer\n\n\nclass Classification():\n\n # vocabulary in spanish\n filename_vocabulary = os.path.join(os.path.dirname(os.path.realpath(__fi...
[ [ "sklearn.feature_extraction.text.CountVectorizer" ] ]
tflovorn/anomtrans
[ "eb6081c17dd4edf56445c239c133ce01ad4b7eba" ]
[ "pyanomtrans/plot_wsm_mu5.py" ]
[ "import argparse\nimport os.path\nimport json\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom pyanomtrans.plot_Rashba import get_interpolated_mus\n\ndef plot_series(prefix, fdata):\n mu5s = fdata['mu5s']\n\n interp_per_point = 10\n interpolated_mu5s = get_interpolated_mus(mu5s, inte...
[ [ "matplotlib.pyplot.axhline", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf" ] ]
lj-ecjtu/Cascade_FPN_Tensorflow-master
[ "40fcd2c10f057b3f015ca1380d7db102e967391f", "2f7571ec315b62d915bbf78fdbb8877fbcbaabfc" ]
[ "tools/eval_coco_pyramid.py", "libs/box_utils/boxes_utils.py" ]
[ "# -*- coding:utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport os, sys\nimport tensorflow as tf\nimport time\nimport cv2\nimport pickle\nimport numpy as np\nimport json\nsys.path.append(\"../\")\n\nfrom data.io.image_preprocess imp...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "tensorflow.expand_dims", "tensorflow.Session", "tensorflow.ConfigProto", "tensorflow.constant", "numpy.stack", "tensorflow.placeholder", "numpy.where", "tensorflow.local_variables_initializer", "tensorflow.global_v...
wynshiter/nlp_demo
[ "be3b613f5c2bcde29603c207f620d68e0d571aba" ]
[ "src/Chatbot/A Comprehensive Chat Robot Based on Seq2seq and Attention Mechanism/data_utils.py" ]
[ "# -*- coding:utf-8 -*-\n\nimport random\nimport numpy as np\nfrom tensorflow.python.client import device_lib\nfrom word_sequence import WordSequence\n\n'''\n定义工具类\n'''\n\nVOCAB_SIZE_THRESHOLD_CPU = 50000\n\n\ndef _get_available_gpus():\n local_device_protos = device_lib.list_local_devices()\n return [x.name...
[ [ "numpy.array", "numpy.random.choice", "numpy.asarray", "numpy.sum", "tensorflow.python.client.device_lib.list_local_devices", "numpy.linspace" ] ]
vitalwarley/pyopls
[ "26c0cd28e5fa4d2918edd1c7115bdbbb691102ea" ]
[ "pyopls/kernel_density.py" ]
[ "import numpy as np\nfrom joblib import Parallel, delayed\nfrom sklearn.model_selection import GridSearchCV, KFold, LeaveOneOut\nfrom sklearn.neighbors import KernelDensity\n\n\nclass OPLSKernelDensity:\n @staticmethod\n def _estimate_bandwidth(vals, grid_search_num, cv, n_jobs, verbose, pre_dispatch):\n ...
[ [ "sklearn.model_selection.LeaveOneOut", "numpy.hsplit", "numpy.linspace", "sklearn.neighbors.KernelDensity", "sklearn.model_selection.KFold", "numpy.hstack", "numpy.column_stack" ] ]
aarati-K/one-access
[ "928788a8729770c665cb94db6891dfaf4f32d1fc" ]
[ "benchmarks/hogwild/plots/plot_convergence.py" ]
[ "from pathlib import Path\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pylab\n\noa = [\n 2.310431718826294, 2.3044593334198, 2.2999351024627686, 2.302645206451416,\n 2.305140256881714, 2.304278612136841, 2.305345058441162, 2.305643081665039,\n 2.2953379154205322, 2.294596195220...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.yticks", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplots" ] ]
ACampero/rllab-curriculum
[ "2189f73fa338d7833c76736b25f7302a9e6392ce" ]
[ "curriculum/envs/arm3d/arm3d_disc_env.py" ]
[ "import random\n\nimport numpy as np\n\nfrom rllab.core.serializable import Serializable\nfrom rllab.envs.base import Step\nfrom rllab.envs.mujoco.mujoco_env import MujocoEnv\nfrom rllab.misc import autoargs\nfrom rllab.misc import logger\nfrom rllab.spaces.box import Box\nfrom rllab.misc.overrides import overrides...
[ [ "numpy.concatenate", "numpy.copy", "numpy.linalg.norm" ] ]
LaudateCorpus1/chex
[ "5f3102fe1baeb22d1e697e1815d0b92c9f299913" ]
[ "chex/_src/asserts.py" ]
[ "# Copyright 2020 DeepMind Technologies Limited. 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# Unle...
[ [ "numpy.asarray" ] ]
kuochuanpan/yt
[ "bfc029095e7a701cfc58de38628ff2ec08c169c6" ]
[ "yt/frontends/artio/data_structures.py" ]
[ "import os\nimport weakref\nfrom collections import defaultdict\n\nimport numpy as np\n\nfrom yt.data_objects.field_data import YTFieldData\nfrom yt.data_objects.index_subobjects.octree_subset import OctreeSubset\nfrom yt.data_objects.particle_unions import ParticleUnion\nfrom yt.data_objects.static_output import D...
[ [ "numpy.array", "numpy.ones", "numpy.asfortranarray", "numpy.zeros" ] ]
Elliot-Coupe/qiskit-terra
[ "8a604e156ba4c2fa099b1c24cd941f59b9408398" ]
[ "qiskit/circuit/library/standard_gates/p.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ...
[ [ "numpy.array", "numpy.exp" ] ]
techkang/SynthText_Python3
[ "4cd18e9d47c9c0cbe4af432db63428f95ca2479d" ]
[ "synthgen.py" ]
[ "# Author: Ankush Gupta\n# Date: 2015\n\n\"\"\"\nMain script for synthetic text rendering.\n\"\"\"\n\nfrom __future__ import division\nimport copy\nimport cv2\nimport h5py\nfrom PIL import Image\nimport numpy as np \n#import mayavi.mlab as mym\nimport matplotlib.pyplot as plt \nimport os.path as osp\nimport scipy.n...
[ [ "numpy.random.choice", "numpy.random.rand", "numpy.argmin", "numpy.median", "numpy.min", "numpy.mean", "numpy.where", "numpy.dsplit", "numpy.concatenate", "numpy.max", "numpy.zeros_like", "numpy.linalg.norm", "numpy.transpose", "numpy.arange", "numpy.isf...
layumi/U_turn
[ "311be355f538a0640a13c2ef63cb365e7df13744" ]
[ "Cuisine-retrieval/test.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function, division\n\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\nfrom torch.autograd import Variable\nimport torch.backends.cudnn as cudnn\nimport numpy as np\nimport torchvision\nf...
[ [ "torch.cat", "torch.nn.Sequential", "torch.norm", "torch.FloatTensor", "torch.no_grad", "torch.nn.functional.interpolate", "torch.cuda.set_device", "torch.cuda.is_available", "torch.LongTensor", "torch.utils.data.DataLoader", "numpy.sqrt" ] ]
yamachu/python-soundfile
[ "57c17abe75a8af4a6426a7126fd6516f4ff67f24" ]
[ "soundfile.py" ]
[ "\"\"\"python-soundfile is an audio library based on libsndfile, CFFI and NumPy.\n\nSound files can be read or written directly using the functions\n`read()` and `write()`.\nTo read a sound file in a block-wise fashion, use `blocks()`.\nAlternatively, sound files can be opened as `SoundFile` objects.\n\nFor further...
[ [ "numpy.ascontiguousarray", "numpy.copy", "numpy.empty", "numpy.asarray" ] ]
allenbai01/cp-gen
[ "27f56e274fac9b41a7bc639490868c3ae7d627dc" ]
[ "cqr/get_meps_data/main_clean_and_save_to_csv.py" ]
[ "\n# Code based on IBM's AIF360 software package, suggesting a simple modification\n# that accumulates the medical utilization variables without binarization\n\n# Load packages\nfrom meps_dataset_panel19_fy2015_reg import MEPSDataset19Reg\nfrom meps_dataset_panel20_fy2015_reg import MEPSDataset20Reg\nfrom meps_data...
[ [ "pandas.read_csv" ] ]
Seonwhee-Genome/detr
[ "7ba7d0cd3eb3c50f349c4edcde0b5e4153b5491e" ]
[ "main.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport argparse\nimport datetime\nimport json\nimport random\nimport time\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader, DistributedSampler\n\nimport datasets\nimport util.misc as utils\...
[ [ "torch.device", "torch.optim.AdamW", "torch.optim.lr_scheduler.StepLR", "torch.utils.data.RandomSampler", "numpy.random.seed", "torch.utils.data.DistributedSampler", "torch.save", "torch.utils.data.SequentialSampler", "torch.nn.parallel.DistributedDataParallel", "torch.manu...
Miffka/Object-Detection-Metrics
[ "c0c6874781762920ec9563085a5292c92832686c" ]
[ "map_calculator/Evaluator.py" ]
[ "###########################################################################################\n# #\n# Evaluator class: Implements the most popular metrics for object detection #\n# ...
[ [ "numpy.divide", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "numpy.sum", "matplotlib.pyplot.pause", "matplotlib.pyplot.ylabel", "numpy.cumsum", "matplotlib.pypl...
chalmersteknologkonsulter/keras-yolo3
[ "23a6bfe5b408b72d3393d9ebcad651550c63021c" ]
[ "train_bottleneck.py" ]
[ "\"\"\"\nRetrain the YOLO model for your own dataset.\n\"\"\"\nimport os\nimport numpy as np\nimport keras.backend as K\nfrom keras.layers import Input, Lambda\nfrom keras.models import Model\nfrom keras.optimizers import Adam\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStoppi...
[ [ "numpy.array", "numpy.zeros", "numpy.random.seed", "numpy.load", "numpy.random.shuffle", "numpy.savez" ] ]
elahekhodaie/PixelCnnPP
[ "ab1e245ed8c24009364b1f891288eb1a526b0121" ]
[ "pcnnpp/layers.py" ]
[ "from pcnnpp.utils.functions import *\nimport torch\nimport torch.nn as nn\nfrom torch.nn.utils import weight_norm as wn\n\n\nclass nin(nn.Module):\n def __init__(self, dim_in, dim_out):\n super(nin, self).__init__()\n self.lin_a = wn(nn.Linear(dim_in, dim_out))\n self.dim_out = dim_out\n\n ...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.Conv2d", "torch.nn.ZeroPad2d", "torch.nn.utils.weight_norm", "torch.nn.Dropout2d", "torch.chunk" ] ]
forkkr/Numerical-Methods
[ "65d366633258da3c575b29724e814ce7550311d2" ]
[ "Bracketing Methods/FalsePositionMethods.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as mpl\n\n\nclass CurrentState:\n def __init__(self , x_n , x_p , x_m , f_xm ,err):\n self.x_n = x_n\n self.x_p = x_p\n self.x_m = x_m\n self.f_xm = f_xm\n self.err = err\n\n\nclass FalsePositionMethod:\n def __init__(self, x0, x...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
Exawind/iddes
[ "200ddd4a20587c38f4103a32c0001ad5c8d33f22" ]
[ "mcalister/utilities/plot_span_forces.py" ]
[ "#!/usr/bin/env python3\n\n# ========================================================================\n#\n# Imports\n#\n# ========================================================================\nimport argparse\nimport os\nimport glob as glob\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.ba...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.plot", "numpy.sum", "matplotlib.pyplot.figure", "matplotlib.pyplot.rc", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel"...
sunshiding/M3DNS
[ "363301b6f95f7a144a94ecf6f88a3efe378cd562" ]
[ "model/model.py" ]
[ "import os\nimport torch\nfrom torch import nn\nfrom torchvision import models\n\nclass ImageNet(nn.Module):\n def __init__(self, label_num):\n super(ImageNet, self).__init__()\n self.feature = models.resnet18(pretrained=True)\n self.feature.fc = nn.Linear(512, 128)\n self.encoder = m...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.load" ] ]
UWPRG/Nance_Enzyme_Encap_MD
[ "52d536f7a2bf8b45195f2bc46f36755c792710fd" ]
[ "Prot_poly_analysis/polymer_MD_analysis_02_31_2020.py" ]
[ "# write function to average across frames to give ensembled averaged cosine theta values at each N - 1 value\nimport MDAnalysis as mda\nimport statsmodels as stats\nimport math\nimport numpy as np \nimport pandas\nimport sklearn\nimport scipy as scipy\nimport warnings \n# Use sklearn to do fitting\nfrom sklearn.li...
[ [ "numpy.array", "numpy.linalg.norm", "sklearn.metrics.mean_squared_error", "numpy.sin", "numpy.zeros", "numpy.log", "sklearn.linear_model.LinearRegression", "numpy.sum", "numpy.dot", "numpy.exp", "numpy.mean", "numpy.std", "numpy.arange", "numpy.sqrt", "s...
XKitiaraX/TensorFG
[ "68c33b143ebaa8d0eea9338f67a6bec402a658ac", "30ac8e4da66f6adfb0f49806a81bedf52221d74b" ]
[ "tensorflow/lite/python/tflite_convert_test.py", "tensorflow/python/keras/optimizer_v2/adagrad_test.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.training.tracking.tracking.AutoTrackable", "tensorflow.python.keras.models.save_model", "numpy.array", "tensorflow.python.framework.ops.Graph", "tensorflow.python.saved_model.save.save", "tensorflow.python.platform.gfile.Open", "tensorflow.python.saved_model.saved_mo...
sourav-roni/rl-rc-car
[ "4833ec6bf40b971caeec9bf0eb85a14138f91de4" ]
[ "rl-rc-car/driving.py" ]
[ "\"\"\"\nThis is the real-world equivalent of the simulation's learning.py. It's run\nfrom a computer, calling sensor data from the car's Pi and then sending\nactions for the remote control Pi to do.\n\"\"\"\nfrom becho import becho, bechonet\nfrom sensor_client import SensorClient\nfrom rccar_client import RCCarCl...
[ [ "numpy.array" ] ]
domeckert/astromodels
[ "541e589c55969ce710bcc6eca583a1736b03c7d8" ]
[ "astromodels/sources/particle_source.py" ]
[ "from __future__ import division\nfrom past.utils import old_div\n__author__ = 'giacomov'\n\nimport collections\n\nimport numpy\n\nfrom astromodels.core.spectral_component import SpectralComponent\nfrom astromodels.core.tree import Node\nfrom astromodels.core.units import get_units\nfrom astromodels.sources.source ...
[ [ "numpy.sum" ] ]
alwaysai/facial_landmarks_with_dlib
[ "1eb3a4384cc3304c53fe705fc06cba31972ed4e8" ]
[ "face_part_detection/facial_landmarks.py" ]
[ "import dlib\nimport edgeiq\nimport numpy as np\nimport cv2\n\n\nclass Dlib_FLM(object):\n def __init__(self, shape_predictor, landmark_range=68):\n self.shape_predictor = shape_predictor\n self.landmark_range = landmark_range\n # http://dlib.net/python/index.html#dlib.get_frontal_face_detec...
[ [ "numpy.zeros" ] ]
tzouvanas/bio-informatics
[ "f21d1786759fcdd03481f8ee8044130cf354ad7c" ]
[ "matrices/PositionWeightMatrix.py" ]
[ "import numpy as np\n\nclass PositionWeightMatrix:\n\n def __init__(self):\n self.m = None\n self.position_frequency_matrix = []\n self.position_probability_matrix = []\n self.position_weight_matrix = []\n\n def __nucleotide_to_index(self, nucleotide):\n \n if nucleot...
[ [ "numpy.divide", "numpy.transpose", "numpy.log", "numpy.round" ] ]
raghuramshankar/kalman-filter-localization
[ "9bd657b2de9527a9d01df1a5a9f94c7ddfbc6674", "9bd657b2de9527a9d01df1a5a9f94c7ddfbc6674", "9bd657b2de9527a9d01df1a5a9f94c7ddfbc6674" ]
[ "deprecated/KF_CA_amz.py", "gen-results/KF_CA_save_gif.py", "gen-results/CKF_CTRV_save_gif.py" ]
[ "# implementation of linear kalman filter using 2D constant acceleration model\r\n\r\n# state matrix: 2D x-y position, velocity and acceleration in x and y axis (6 x 1)\r\n# input matrix: --None--\r\n# measurement matrix: 2D x-y position and imu acceleration in x and y axis (4 x 1)\r\n...
[ [ "numpy.array", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "numpy.linalg.pinv", "numpy.hstack", "numpy.linspace", "matplotlib.pyplot.figure", "scipy.linalg.sqrtm", "numpy.transpose", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "pandas.read_csv", ...
RTIInternational/SMART
[ "c95eaa088df33bac95aababdc560c10422eed6e3" ]
[ "backend/django/core/utils/util.py" ]
[ "import hashlib\nimport os\nfrom io import StringIO\nfrom itertools import combinations\n\nimport numpy as np\nimport pandas as pd\nfrom celery import chord\nfrom django.conf import settings\nfrom django.contrib.auth import get_user_model\nfrom django.db import connection, transaction\nfrom django.utils import time...
[ [ "numpy.equal", "pandas.DataFrame", "pandas.isnull" ] ]
Toloka/crowd-kit
[ "126942242781073235ca292aed9f496b614e9516" ]
[ "src/aggregation/embeddings/hrrasa.py" ]
[ "__all__ = [\n 'glue_similarity',\n 'HRRASA',\n]\nfrom typing import Any, Iterator, Tuple\n\nfrom functools import partial\nimport nltk.translate.gleu_score as gleu\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as sps\nfrom scipy.spatial import distance\nimport attr\n\nfrom ..annotations import...
[ [ "pandas.DataFrame", "numpy.sum", "pandas.MultiIndex.from_tuples", "numpy.exp", "scipy.spatial.distance.cosine", "pandas.Series" ] ]
murez/mobile-semantic-segmentation
[ "0f6cb62c6a1f68f68a53c50612c5636cfe339aa6" ]
[ "src/mylib/lgb/metrics.py" ]
[ "import lightgbm as lgb\nimport numpy as np\nfrom sklearn.metrics import mean_squared_log_error\n\n\ndef lgb_rmsle_score(preds: np.ndarray, dval: lgb.Dataset):\n label = dval.get_label()\n y_true = np.exp(label)\n y_pred = np.exp(preds)\n\n return 'rmsle', np.sqrt(mean_squared_log_error(y_true, y_pred))...
[ [ "sklearn.metrics.mean_squared_log_error", "numpy.exp" ] ]
weiwenlan/LaTeX-OCR
[ "e69bba5bed75d38cfe6f1550d393d4fa25d832e9" ]
[ "pix2tex.py" ]
[ "from dataset.dataset import test_transform\nimport cv2\nimport pandas as pd\nfrom PIL import ImageGrab\nfrom PIL import Image\nimport os\nimport sys\nimport argparse\nimport logging\nimport yaml\n\nimport numpy as np\nimport torch\nfrom torchvision import transforms\nfrom munch import Munch\nfrom transformers impo...
[ [ "numpy.array", "pandas.DataFrame", "torch.no_grad", "torch.cuda.is_available", "torch.LongTensor", "torch.load" ] ]
wimglenn/advent-of-code-wim
[ "6308c3fa5d29b318680419f877fd5b8ac1359b5d" ]
[ "aoc_wim/aoc2015/q06.py" ]
[ "\"\"\"\n--- Day 6: Probably a Fire Hazard ---\nhttps://adventofcode.com/2015/day/6\n\"\"\"\nimport numpy as np\nfrom aocd import data\n\n\nA = np.zeros((1000, 1000), dtype=bool)\nB = np.zeros((1000, 1000), dtype=int)\n\nfor line in data.splitlines():\n action, p1, _, p2 = line.rsplit(None, 3)\n x1, y1 = [int...
[ [ "numpy.zeros" ] ]
srsummerson/bmi_python
[ "7eca891f078ce15b2b9cf85f1309346d6fb9fccb" ]
[ "features/arduino_features.py" ]
[ "'''\nFeatures to include when using the Arduino board to remotely start neural \nrecording for Plexon/Blackrock/TDT systems and also synchronize data between the task and the neural recordings\n'''\nimport time\nimport tempfile\nimport random\nimport traceback\nimport numpy as np\nimport fnmatch\nimport os\nimport...
[ [ "numpy.iterable", "numpy.nonzero", "numpy.unique" ] ]
FaisalAhmed0/Deep-RL-for-Cart-and-pole-
[ "db5179f637e20fb48af28aca79c1efb1dfde3a47" ]
[ "DQN/rlUtils.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport gym \nimport collections\nimport preproccessing\n\n\nclass ReplayBuffer():\n def __init__(self, length):\n self.length = length\n self.buffer = collections.deque(maxlen=length)\n def sample(self, s...
[ [ "numpy.random.normal", "numpy.array", "numpy.clip", "numpy.empty", "torch.nn.functional.softmax", "torch.max", "torch.FloatTensor", "torch.no_grad", "numpy.random.randn", "torch.multinomial", "numpy.random.randint", "torch.tensor", "numpy.sqrt", "numpy.appen...
hugochan/K-Competitive-Autoencoder-for-Text-Analytics
[ "5433de649028a4e021b8ad17cd0ec5da8c726031" ]
[ "financial_insights.py" ]
[ "'''\nCreated on Apr, 2017\n\n@author: hugo\n\n'''\n\nimport numpy as np\n\ndef calc_ranks(x):\n \"\"\"Given a list of items, return a list(in ndarray type) of ranks.\n \"\"\"\n n = len(x)\n index = list(zip(*sorted(list(enumerate(x)), key=lambda d:d[1], reverse=True))[0])\n rank = np.zeros(n)\n r...
[ [ "numpy.mean", "numpy.random.randn", "numpy.zeros" ] ]
anonmyous-author/anonymous-code
[ "3032e1b3fd41c57db6ca91ab86f39aebdf39bda8", "3032e1b3fd41c57db6ca91ab86f39aebdf39bda8" ]
[ "braincode/data.py", "paper/scripts/plots.py" ]
[ "import os\nimport pickle as pkl\nimport typing\nfrom abc import abstractmethod\nfrom functools import lru_cache, partial\nfrom pathlib import Path\n\nimport numpy as np\nfrom scipy.io import loadmat\nfrom sklearn.preprocessing import LabelEncoder, StandardScaler\n\nfrom braincode.abstract import Object\nfrom brain...
[ [ "numpy.concatenate", "numpy.array", "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.StandardScaler", "scipy.io.loadmat", "numpy.ones", "numpy.prod", "numpy.arange", "numpy.flatnonzero" ], [ "numpy.divide", "numpy.array", "matplotlib.pyplot.annotate"...
ealonso-mfa/flowsa
[ "d3ccc98a39bacdf23c4bbf090041626286fd7116" ]
[ "scripts/FlowByActivity_Datasets/write_FBA_BEA_Detail_GrossOutput.py" ]
[ "# write_FBA_BEA_Detail_GrossOutput.py (flowsa)\n# !/usr/bin/env python3\n# coding=utf-8\n\n\"\"\"\nGeneration of BEA Gross Output data as FBA\n\"\"\"\n\nfrom flowsa.common import *\nimport pandas as pd\nfrom flowsa.flowbyactivity import store_flowbyactivity\nfrom flowsa.flowbyfunctions import add_missing_flow_by_f...
[ [ "pandas.read_csv" ] ]
HectorFranc/tweet-analysis
[ "8c9b59826ad3ea1b61af66f56e593234eb0f0a79" ]
[ "tweet_analysis/utils/__init__.py" ]
[ "import os\nimport matplotlib.pyplot as plt\n\nPROJECT_ROOT_DIR = \".\"\nIMAGES_PATH = os.path.join(PROJECT_ROOT_DIR, \"images\")\nos.makedirs(IMAGES_PATH, exist_ok=True)\n\ndef save_plt_fig(fig_id, tight_layout=True, fig_extension=\"png\", resolution=300):\n path = os.path.join(IMAGES_PATH, fig_id + \".\" + fig...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.tight_layout" ] ]
RerRayne/learn3d
[ "83e4ac657c6538fb4cbed6e00b2e3ed6cbf43555" ]
[ "models/masknet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .pointnet import PointNet\nfrom .pooling import Pooling\n\nclass PointNetMask(nn.Module):\n\tdef __init__(self, template_feature_size=1024, source_feature_size=1024, feature_model=PointNet()):\n\t\tsuper().__init__()\n\t\tself.feature_model...
[ [ "torch.nonzero", "torch.cat", "torch.rand", "torch.arange", "torch.nn.Conv1d", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.topk" ] ]
jelena-markovic/compare-selection
[ "22c0ba0683d96c807cf363a622de39049459b756" ]
[ "instances.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom traitlets import (HasTraits, \n Integer, \n Unicode, \n Float, \n Integer, \n Instance, \n Dict, \n default, \n ...
[ [ "numpy.random.standard_normal", "numpy.random.binomial", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.random.shuffle", "numpy.identity", "numpy.arange", "numpy.sqrt", "numpy.vstack" ] ]
lxasqjc/Foveation-Segmentation
[ "557ad1c88343c05d7dfc765b5fa4cbe6fb237d74" ]
[ "models/seg_hrnet.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Ke Sun (sunk@mail.ustc.edu.cn)\n# ------------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\nfr...
[ [ "torch.cat", "torch.nn.functional.upsample", "torch.nn.ModuleList", "torch.nn.Sequential", "numpy.sum", "torch.nn.init.constant_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.init.normal_", "torch.load" ] ]
gianlucaleone/Spike_Sorting
[ "dd88eb7c9f91bc1caf44b6936bd2264611a032fd" ]
[ "scripts/run_collection.py" ]
[ "# Spike Sorter collection of run methods\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.colors as colors\r\n\r\ndef run_normal(self):\r\n\r\n self.LoadRawData(dir='C_Easy1_noise005',type = 'mat')\r\n self.Filter(f_s=24000,f1=300,f2=3400,order=63, CH=1)\r\n self.Detection(ist...
[ [ "numpy.array", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.copy", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.where", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot" ] ]
themousepotato/ewah_bool_utils
[ "eb1bc18e62d02a715a441a6731cf29a38aad158d" ]
[ "tests/test_ewah_bool_utils.py" ]
[ "#!/usr/bin/env python\n#\n# Concept taken from https://pytestguide.readthedocs.io/en/latest/pytestGuide/#testing-cython-code\n\n\"\"\"Tests for `ewah_bool_utils` package.\"\"\"\n\nimport numpy as np\nimport os\nimport pyximport\nimport time\nfrom pathlib import Path\n\nROOT = str(Path(__file__).parents[1].resolve(...
[ [ "numpy.array", "numpy.random.rand", "numpy.asarray", "numpy.random.seed", "numpy.all", "numpy.get_include" ] ]
SaiSakethAluru/DE-LIMIT
[ "dafb16e86e3b7d777afb73bf94dd5c6b7f69a627", "dafb16e86e3b7d777afb73bf94dd5c6b7f69a627" ]
[ "CNN_GRU/Models/attentionLayer.py", "CNN_GRU/bert_codes/utils.py" ]
[ "import torch\nimport torch.nn as nn\n\ndebug=False\n# Custom Layers\nclass Attention(nn.Module):\n def __init__(self, feature_dim, step_dim, bias=True, **kwargs):\n super(Attention, self).__init__(**kwargs)\n \n self.supports_masking = True\n\n self.bias = bias\n self.feature_...
[ [ "torch.zeros", "torch.nn.Sigmoid", "torch.nn.init.xavier_uniform_", "torch.mm", "torch.nn.Parameter", "torch.unsqueeze", "torch.tanh", "torch.exp", "torch.sum" ], [ "numpy.concatenate", "sklearn.preprocessing.LabelEncoder", "torch.cuda.manual_seed_all", "num...
jinzhang21/mlflow
[ "e926be917795fd945ea347e02cf31214008d3f1e" ]
[ "tests/models/test_cli.py" ]
[ "import json\nimport os\nimport subprocess\nimport sys\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport re\nimport sklearn\nimport sklearn.datasets\nimport sklearn.neighbors\n\nfrom unittest import mock\n\ntry:\n from StringIO import StringIO\nexcept ImportError:\n from io import StringIO\n\n...
[ [ "pandas.DataFrame", "sklearn.neighbors.KNeighborsClassifier", "pandas.read_json", "sklearn.datasets.load_iris" ] ]
CWHer/CS410-AI-project
[ "53dd52d2f119232999cbc0f3c696663590f14931" ]
[ "agent/defense_dqn/defense.py" ]
[ "import random\nimport numpy as np\n\n\nclass Info:\n def __init__(self, idx=-1, step=-1) -> None:\n self.idx = idx\n self.step = step\n\n def empty(self):\n return self.idx == -1\n\n def nextStep(self):\n return Info(self.idx, self.step + 1)\n\n\nclass DefensiveBoard:\n acti...
[ [ "numpy.array", "numpy.abs", "numpy.clip" ] ]
spillai/pybot
[ "df6989d90860e88de42a3183d3af6c4c1c06336a", "df6989d90860e88de42a3183d3af6c4c1c06336a" ]
[ "pybot/vision/geom_utils.py", "pybot/externals/ros/bag_utils.py" ]
[ "# Author: Sudeep Pillai <spillai@csail.mit.edu>\n# License: MIT\n\nimport cv2\nimport numpy as np\n\ndef convex_hull(pts, ccw=True): \n \"\"\"\n Returns the convex hull of points, ordering them in ccw/cw fashion\n\n Note: Since the orientation of the coordinate system is x-right,\n y-up, ccw is interpr...
[ [ "numpy.max", "numpy.minimum", "numpy.min", "numpy.float32", "numpy.bitwise_and", "numpy.vstack", "numpy.maximum" ], [ "numpy.array", "numpy.sin", "numpy.zeros", "numpy.float64", "numpy.cos", "numpy.hstack" ] ]
delemottelab/Informing_NMR_experiments_w_MD
[ "9ce2bb3433d4b9e4df0ba2be3415c88acef6bdf4" ]
[ "src/spc_utils/spc_analysis.py" ]
[ "'''\nThis module contains many scripts to do analysis on trajectories. \n'''\ndef mda_janin_with_CSTV(u,selection):\n '''\n Takes in a MDAnalysis universe and a selection of that universe that contains\n one or several aminoacids sharing resid and resname. It calculates the regular\n Janin angles but i...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.subplots", "numpy.split", "numpy.linspace", "matplotlib.pyplot.FuncFormatter", "numpy.unique" ] ]
GunnarHorve-ibm/assistant-dialog-skill-analysis
[ "f48a5ea8dad7779f1a3ba0d785af4dc27fbfef95" ]
[ "tests/data_analysis/test_similarity_analyzer.py" ]
[ "import unittest\nimport json\nimport pandas as pd\nimport numpy as np\n\nfrom assistant_dialog_skill_analysis.data_analysis import similarity_analyzer\nfrom assistant_dialog_skill_analysis.utils import skills_util\n\nTOLERANCE = .0000001\n\nclass TestSimilarityAnalzyer(unittest.TestCase):\n \"\"\"Test for Simil...
[ [ "numpy.array", "pandas.DataFrame", "numpy.intersect1d", "numpy.abs", "numpy.diag" ] ]
rtobar/sketches-py
[ "f33620af526eac25e832d1fe2df2abb0997369ab" ]
[ "tests/gkarray_test.py" ]
[ "# Unless explicitly stated otherwise all files in this repository are licensed\n# under the Apache License 2.0.\n# This product includes software developed at Datadog (https://www.datadoghq.com/).\n# Copyright 2018 Datadog, Inc.\n\nfrom collections import defaultdict, namedtuple\n\nimport numpy as np\n\nfrom datas...
[ [ "numpy.testing.assert_almost_equal", "numpy.random.random", "numpy.random.randint", "numpy.testing.assert_equal" ] ]
Kenneth-T-Moore/dymos
[ "0ae11aab9cb69ac9dd1d784616d1dfe35a6e5b11" ]
[ "dymos/transcriptions/pseudospectral/components/test/test_control_endpoint_defect_comp.py" ]
[ "import unittest\n\nimport numpy as np\n\nimport openmdao.api as om\nfrom openmdao.utils.assert_utils import assert_check_partials, assert_rel_error\n\nfrom dymos.transcriptions.pseudospectral.components import ControlEndpointDefectComp\nfrom dymos.transcriptions.grid_data import GridData\n\n\nclass TestControlEndp...
[ [ "numpy.array", "numpy.zeros", "numpy.ravel", "numpy.polyfit", "numpy.random.random" ] ]
YingshuLu/self-driving-formula-racing
[ "0c45030c9f761a1e38abf7fc3957244389bb1165" ]
[ "auto_drive/rule_drive/train.py" ]
[ "### Importing packages. \nimport os\nimport math\nimport base64\nimport itertools\nimport pickle\nimport cv2\nimport json\n\nimport pandas as pd\nimport numpy as np\n\nfrom lightgbm import LGBMClassifier\nfrom sklearn.metrics import log_loss, accuracy_score\n\nfrom PIL import Image\nfrom io import BytesIO\n\n\nnp....
[ [ "numpy.array", "numpy.random.seed", "pandas.DataFrame", "numpy.argmax", "sklearn.metrics.log_loss" ] ]
rojo2010/SegMitos_mitosis_detection
[ "2d0085ff30563926b657f08bc896f8eb9372a687" ]
[ "SegMitos_train/mitos_layers_ring.py" ]
[ "import caffe\n\nimport numpy as np\nfrom PIL import Image\n\nimport random\n\nclass MitosDataLayer(caffe.Layer):\n \"\"\"\n Load (input image, label image) pairs from PASCAL VOC\n one-at-a-time while reshaping the net to preserve dimensions.\n\n Use this to feed data to a fully convolutional network.\n...
[ [ "numpy.array" ] ]
LBJ-Wade/NX01
[ "e562bbcc2e935bd89f0237948a3adbeeb7bb5a66" ]
[ "setup-cython.py" ]
[ "# setup script to compile jitter module; \n# written by M. Vallisneri (2015)\n#\n# use python setup.py build_ext --inplace to test\n\nimport distutils.core as D\nimport numpy as N\n\nfrom distutils.core import setup, Extension\nfrom distutils import sysconfig\n\ntry:\n numpy_include = N.get_include()\nexce...
[ [ "numpy.get_numpy_include", "numpy.get_include" ] ]
eozd/ODIN
[ "70a97ae95daab3ece8ae6ede1c08e0388d1044c8" ]
[ "odin/core/risk_minimization.py" ]
[ "\"\"\"\nMain implementation of the ODIN algorithm.\n\nGabriele Abbati, Machine Learning Research Group, University of Oxford\nFebruary 2019\n\"\"\"\n\n\n# Libraries\nfrom odin.utils.trainable_models import TrainableModel\nfrom odin.utils.gaussian_processes import GaussianProcess\nfrom odin.utils.tensorflow_optimiz...
[ [ "tensorflow.exp", "numpy.copy", "tensorflow.ones", "numpy.tile", "numpy.mean", "tensorflow.global_variables_initializer", "tensorflow.trainable_variables", "numpy.log", "tensorflow.Variable", "tensorflow.math.log", "tensorflow.constant", "tensorflow.linalg.solve", ...
zhaoliangzhang/habitat-api
[ "ab10a2531e4cf03e784a34ebfdea57c092d8380c" ]
[ "habitat_baselines/rl/ppo/ppo_trainer.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport time\nfrom collections import deque\nfrom typing import Dict, List\n\nimport numpy as np\ni...
[ [ "torch.zeros", "torch.device", "torch.no_grad", "torch.tensor", "torch.load" ] ]
AidenLong/PJ_NLP
[ "58dacf5ec61030ced725f9200851c57ff8c5a3af" ]
[ "pj4_ner_word/model.py" ]
[ "from __future__ import print_function, division\nimport torch.nn as nn\nimport pj4_ner_word.config as conf\nimport torch\nfrom torch.autograd import Variable\n\n\ndef log_sum_exp(vec, m_size):\n _, idx = torch.max(vec, 1) # B * 1 * M\n max_score = torch.gather(vec, 1, idx.view(-1, 1, m_size)).view(-1, 1, m_...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.LSTM", "torch.max", "torch.autograd.Variable", "torch.no_grad", "torch.cuda.LongTensor", "torch.nn.Parameter", "torch.nn.Conv2d", "torch.nn.Embedding" ] ]
dfhahn/freeenergyframework
[ "b4f00784bca1d321564388dedb6030c88571264c" ]
[ "freeenergyframework/wrangle.py" ]
[ "import networkx as nx\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom freeenergyframework import stats\nimport pandas as pd\n\n\nclass Result(object):\n def __init__(self, ligandA, ligandB,\n exp_DDG, exp_dDDG,\n calc_DDG, mbar_error, other_error):\n self.ligand...
[ [ "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "numpy.diagonal", "matplotlib.pyplot.figure", "matplotlib.pyplot.show" ] ]
tkhkaeio/PyTorch-GAN
[ "565c67cae168a42c6822c787562a1f7a5b35a2ab" ]
[ "implementations/data_aug_gan/dcgan.py" ]
[ "import argparse\nimport os\nimport numpy as np\nimport math\n\nimport torchvision.transforms as transforms\nfrom torchvision.utils import save_image\n\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets\nfrom torch.autograd import Variable\n\nimport torch.nn as nn\nimport torch.nn.functional...
[ [ "torch.nn.Linear", "numpy.random.normal", "torch.nn.init.constant_", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.Upsample", "torch.nn.init.normal_", "torch.cuda.is_available", "torch.nn.Conv2d", "torch.utils.data.Data...
iht/ml-in-prod-2022
[ "e65be45bbfe1718bc43fbb6c4b1720bcf0add2a8", "e65be45bbfe1718bc43fbb6c4b1720bcf0add2a8" ]
[ "trainer/task.py", "pipeline/preprocess_pipeline.py" ]
[ "\"\"\"A simple main file to showcase the template.\"\"\"\n\nimport logging\nimport os\nimport sys\nfrom typing import List, Dict, Union\nfrom urllib.parse import urlparse\n\nimport tensorflow as tf\nimport tensorflow_transform as tft\nfrom google.cloud import storage\nfrom google.cloud.storage import Blob\nfrom hy...
[ [ "tensorflow.io.parse_single_example", "tensorflow.data.TFRecordDataset" ], [ "tensorflow.one_hot", "tensorflow.io.FixedLenFeature", "tensorflow.strings.split" ] ]
alexchungio/Intelligent-analysis-of-ecological-assets-compitetion-2021
[ "f7d37b4316f5092773a7dd1e6387614c783ca1e0" ]
[ "dataset/RSCDataset.py" ]
[ "\nimport os\nimport cv2\nimport logging\nimport numpy as np\nfrom glob import glob\nfrom torch.utils.data import Dataset\n\nfrom dataset import train_transform, val_transform\n\n\nclass RSCDataset(Dataset):\n def __init__(self, imgs_dir, masks_dir, transform=None):\n self.imgs_dir = imgs_dir\n sel...
[ [ "numpy.array", "numpy.expand_dims" ] ]
ChristopherKotthoff/Aphros-with-GraphContraction
[ "18af982a50e350a8bf6979ae5bd25b2ef4d3792a" ]
[ "deploy/scripts/aphros/vtk.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\nimport re\nimport sys\nimport inspect\nimport os\n\n\ndef printerr(m):\n sys.stderr.write(str(m) + \"\\n\")\n\ndef ReadVtkPoly(f, verbose=False):\n \"\"\"\n Reads vtk points, polygons and fields from legacy VTK file.\n f: `str` or file-like\n Path to...
[ [ "numpy.empty", "numpy.dtype", "numpy.fromfile", "numpy.frombuffer" ] ]
GrohLab/GLMCC
[ "3f919b07a9aef84e0f02ca05a45b9cf041f1442c" ]
[ "glmcc.py" ]
[ "#Author: Junichi Haruna\n# coding: utf-8\n\"\"\"\nFunctions for fitting a GLM to the Cross correlation.\nRefer to docstring for explanation of each function.\nIn addition, the following functions can be used from the command.\n\n* make cross correlogram\n* output a result by fitting GLM to cross correlation\n* out...
[ [ "numpy.array", "numpy.delete", "matplotlib.pyplot.xlim", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.linalg.inv", "numpy.ones", "matplotlib.pyplot.plot", "numpy.exp", "matplotlib.pyplot.title", "numpy.eye", "matplotlib.pyplot.legend", "matplotlib.pyplot.c...
peitaozhao/ml-agents
[ "d11229820f3d7f090341c76edea7bad83fc0eeec" ]
[ "ml-agents/mlagents/trainers/learn.py" ]
[ "# # Unity ML-Agents Toolkit\n\nimport logging\n\nfrom multiprocessing import Process, Queue\nimport os\nimport glob\nimport shutil\nimport numpy as np\nimport yaml\nfrom docopt import docopt\nfrom typing import Any, Callable, Dict, Optional\n\n\nfrom mlagents.trainers.trainer_controller import TrainerController\nf...
[ [ "numpy.random.randint" ] ]
ZhengKeli/BraAndKet
[ "f47cdbdb4c5040dd071815378138ac376c205f14" ]
[ "braandket/tensor/numpy.py" ]
[ "from typing import Iterable, Tuple, Union\n\nimport numpy as np\n\nfrom .formal import FormalQTensor\nfrom ..space import Space, HSpace, NumSpace, BraSpace, KetSpace\n\n\nclass NumpyQTensor(FormalQTensor):\n\n # basic\n\n def __init__(self, spaces: Iterable[Space], values):\n super().__init__(spaces)\...
[ [ "scipy.sparse.coo_matrix", "numpy.trace", "numpy.reshape", "numpy.asarray", "numpy.shape", "numpy.tensordot", "numpy.prod", "numpy.transpose", "numpy.conjugate" ] ]