repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jorgemauricio/rainIndex | [
"02a095367a34edba6b8c8d4673baeef73fb3cfad"
] | [
"algoritmoYearMonthWithReferenceAgs_1.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jul 28 23:31:15 2017\n\n@author: jorge\n\"\"\"\n\n#%% libraries\nimport pandas as pd\nimport os\nimport numpy as np\nimport csv\nimport sys\nimport random\nfrom time import gmtime, strftime\nfrom os.path import expanduser\nimport math\n\n#%% Clear terminal\nos.system... | [
[
"pandas.read_csv",
"numpy.linspace",
"numpy.ones",
"numpy.random.gamma",
"numpy.zeros",
"numpy.sum",
"numpy.random.randint"
]
] |
kjetil-lye/iterative_surrogate_optimization | [
"f5de412daab1180612837f4c950203ad87d62f7e"
] | [
"ismo/bin/plot_iterations.py"
] | [
"\"\"\"\nRuns all configuration for analysis\n\"\"\"\nimport numpy as np\nimport matplotlib\n\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport sys\nimport os\nimport json\nimport plot_info\nimport collections\nimport logging\nimport scipy\nimport scipy.stats\nfrom ismo.ensemble import get_configurati... | [
[
"matplotlib.pyplot.legend",
"numpy.min",
"numpy.isnan",
"matplotlib.use",
"matplotlib.pyplot.yscale",
"numpy.percentile",
"numpy.max",
"numpy.std",
"numpy.mean",
"numpy.argmin",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"scipy.stats.sem",
"numpy... |
FanchenBao/streamlit_demo | [
"d6e898a85a2a38b6aa3c481f36394d70e30d7e80"
] | [
"rssi_relative_change_WPB/app.py"
] | [
"import json\nfrom datetime import timedelta, timezone\nfrom pathlib import Path\n\nimport altair as alt\nimport pandas as pd\nimport pydeck as pdk\nimport streamlit as st\nfrom pydeck.types import String\n\nst.set_page_config(layout=\"wide\")\n\n# DEFAULT\nSENSORS = [21, 25, 27, 28]\nTXPOWERS = [5, 10, 15, 20, 25,... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
TobiCode/SelfDrivinCarTobi | [
"c9ffd99ae983133a040a27f9233424346051af56"
] | [
"Server/Keras_NN_Py36/server.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nServer for AI Car Project\n\n\"\"\"\nimport time\nfrom http.server import BaseHTTPRequestHandler, HTTPServer\nimport json\nimport persisting\nimport learningNN\nimport numpy as np\n\n\nHOST_NAME = 'localhost' # !!!REMEMBER TO CHANGE THIS!!!\nPORT_NUMBER = 80 # Maybe set this to 900... | [
[
"numpy.random.seed"
]
] |
hamukazu/craft_regpolyhed | [
"ea37a09bfb62c5ea73c27321e143eb61bade20e1"
] | [
"icosahedron.py"
] | [
"#!/usr/bin/env python\nfrom functools import partial\nfrom reportlab.pdfgen import canvas\nfrom reportlab.lib.units import cm\nimport numpy as np\n\nfrom craftmath import rotation_matrix, margin\nfrom craftdraw import polyline\n\nEDGE_LENGTH = 5 * cm\nWITH_MARGIN = True\nMARGIN_SIZE = 1 * cm\nMARGIN_ANG = np.pi * ... | [
[
"numpy.dot",
"numpy.array",
"numpy.sqrt"
]
] |
NORCatUofC/rain | [
"44d13a691835a3f1da7672dbec37262061dbc7de"
] | [
"nexrad-etl/pyspark-nexrad-etl.py"
] | [
"import os, zlib, re, time, csv\nimport numpy as np\nfrom numpy import ma\nfrom io import BytesIO\nfrom datetime import datetime\nfrom boto.s3.connection import S3Connection\nfrom pyspark import SparkConf, SparkContext\nfrom pyspark.sql import SQLContext\nfrom pyspark.sql.types import *\n\nspark_conf = SparkConf().... | [
[
"numpy.ones_like",
"numpy.isnan",
"numpy.arange",
"numpy.dstack",
"numpy.transpose",
"numpy.ma.array",
"numpy.array",
"numpy.where"
]
] |
KimDoubleB/pandas | [
"f7d162b1890758e22c6bc3de3a8b0f6e09e3317e"
] | [
"pandas/core/series.py"
] | [
"\"\"\"\nData structure for 1-dimensional cross-sectional and time series data\n\"\"\"\nfrom collections import OrderedDict\nfrom io import StringIO\nfrom shutil import get_terminal_size\nfrom textwrap import dedent\nfrom typing import Any, Callable\nimport warnings\n\nimport numpy as np\n\nfrom pandas._config impo... | [
[
"pandas.core.nanops.nancov",
"pandas.util._validators.validate_bool_kwarg",
"pandas.core.dtypes.common.is_datetime64_dtype",
"pandas.core.common.standardize_mapping",
"pandas._libs.lib.map_infer",
"pandas.core.dtypes.common.is_iterator",
"pandas.core.algorithms.searchsorted",
"pand... |
Abluceli/Multi-agent-Reinforcement-Learning-Algorithms | [
"15810a559e2f2cf9e5fcb158c083f9e9dd6012fc"
] | [
"MAEnv/env_FindTreasure/env_FindTreasure.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.gridspec import GridSpec\nimport cv2\n\nclass EnvFindTreasure(object):\n def __init__(self, map_size):\n self.map_size = map_size\n if map_size<7:\n self.map_size = 7\n\n self.half_pos = int((self.map_size - 1)/... | [
[
"matplotlib.pyplot.yticks",
"numpy.ones",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
arifmudi/Advanced-Python-Programming-Second-Edition | [
"55e8fb16127873b5285980301f9a0331d135253c"
] | [
"Chapter08/test_tensorflow.py"
] | [
"import tensorflow.compat.v1 as tf\n\ntf.disable_v2_behavior()\nimport numpy as np\nimport time\nimport sys\n\nNUM_THREADS = int(sys.argv[1])\nN = 30000\n\nprint(\"Num threads\", NUM_THREADS)\nx_data = np.random.uniform(-1, 1, N)\ny_data = np.random.uniform(-1, 1, N)\n\nx = tf.placeholder(\"float64\", name=\"x\")\n... | [
[
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.placeholder",
"numpy.random.uniform",
"tensorflow.compat.v1.cast"
]
] |
leandrobmarinho/pointnet-copy | [
"f324e0e4c38a888a38e1bc49a9792e207851d519"
] | [
"evaluate.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport argparse\nimport socket\nimport importlib\nimport time\nimport os\nimport scipy.misc\nimport sys\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_DIR, 'models'))\nsys.path.append(os.path.join(BAS... | [
[
"tensorflow.Graph",
"numpy.squeeze",
"tensorflow.placeholder",
"tensorflow.ConfigProto",
"numpy.argmax",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
joanvelro/repo_B | [
"293c732268a6e48fbb8049102af115c40476cf5d"
] | [
"src/algorithms/ml_algorithms.py"
] | [
"import subprocess\nimport pandas as pd\nimport numpy as np\n\ndef minsait_model(program_path):\n \"\"\" Load and execute the minsait developed program to generate predictions\n\n Args:\n program_path (str): Path to the program\n Returns:\n bool: The return value. True for success, False othe... | [
[
"pandas.isnull"
]
] |
Haimzis/Skin_Lesion_Detective_deeplab | [
"b7a8f80832ce24d2c80baa1b7a08bc4b5c69af5c"
] | [
"datasets/data_generator_test.py"
] | [
"# Lint as: python2, python3\n# Copyright 2018 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/L... | [
[
"tensorflow.test.main"
]
] |
venaturum/staircase | [
"5f0c843992da12fe6892c772db7d5a1c5783cbde"
] | [
"staircase/core/stairs.py"
] | [
"\"\"\"\n\nstaircase\n==============\n\nstaircase is a MIT licensed library, written in pure-Python, for\nmodelling step functions. See :ref:`Getting Started <getting_started>` for more information.\n\"\"\"\n\n\nimport numpy as np\nimport pandas as pd\n\nfrom staircase import docstrings\nfrom staircase.constants im... | [
[
"pandas.IntervalIndex.from_arrays",
"pandas.notnull",
"pandas.Series",
"pandas.isnull",
"numpy.isnan",
"pandas.DataFrame",
"numpy.append",
"numpy.array",
"pandas.Index.union"
]
] |
kstawiski/DeepSurv | [
"27ad671447b12e2feb4279ae512553b5cc8dd528"
] | [
"experiments/scripts/deepsurv_run.py"
] | [
"import argparse\nfrom collections import defaultdict\n\nimport pandas as pd\nimport numpy as np\nimport h5py\nimport uuid\nimport copy\nimport json\n\nimport sys, os\nsys.path.append(\"/DeepSurv/deepsurv\")\nimport deep_surv\n\n\n# Force matplotlib to not use any Xwindows backend.\nimport matplotlib\nmatplotlib.us... | [
[
"matplotlib.use",
"numpy.unique"
]
] |
carperbr/vocal-remover-frame-transformer | [
"262e98b9bbc912a120d7ea2b4f0075c5d7af4673"
] | [
"lib/frame_transformer_discriminator.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom lib import spec_utils\nfrom lib.frame_transformer_common import FrameConv, FrameEncoder, FrameTransformerDecoder, FrameTransformerEncoder\n\nclass FrameTransformerDiscriminator(nn.Module):\n def __init__(self, in_channels=4, channels=4, d... | [
[
"torch.nn.ModuleList",
"torch.cat"
]
] |
SHITIANYU-hue/macad-gym | [
"38884ac4bc7fb2e91a865950cff4eeadeed02f60"
] | [
"src/macad_gym/carla/PythonAPI/manual_control.py"
] | [
"#!/usr/bin/env python\n\n# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de\n# Barcelona (UAB).\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\n# Allows controlling a vehicle with a keyboard. For a simpler an... | [
[
"numpy.reshape",
"numpy.dtype"
]
] |
GE-ZHANG/imagepy | [
"9e1af72bd2d2899c59190fcc9386aaf2be7a9979"
] | [
"sciwx/canvas/canvas.py"
] | [
"import wx, numpy as np\nfrom sciapp.util.imgutil import mix_img, cross, multiply, merge, lay, mat, like\nfrom .mark import drawmark\nfrom sciapp.object import Image, Shape, mark2shp, Layer, json2shp\nfrom sciapp.action import ImageTool, ShapeTool\nfrom time import time\n\nclass Canvas (wx.Panel):\n scales = [0.... | [
[
"numpy.array",
"numpy.zeros"
]
] |
intelligent-control-lab/Autoenv | [
"8d7697421ca14e317ea7de24b6acb694ecae5148",
"8d7697421ca14e317ea7de24b6acb694ecae5148"
] | [
"algorithms/dataset/CriticDataset.py",
"algorithms/policy/MLP.py"
] | [
"import copy\nimport numpy as np\n\nfrom algorithms.dataset.utils import pad_tensor, compute_n_batches\n\n\ndef select_batch_idxs(start_idx, batch_size, min_idx, max_idx):\n end_idx = start_idx + batch_size\n end_idx = min(end_idx, max_idx)\n idxs = np.arange(start_idx, end_idx, dtype=int)\n\n # if too ... | [
[
"numpy.hstack",
"numpy.reshape",
"numpy.arange",
"numpy.random.permutation",
"numpy.random.randn",
"numpy.random.uniform",
"numpy.random.randint"
],
[
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
akshaybhatia10/Reddit-Flair-Detection | [
"62a768917627c7f3b8a40f470a67d75be7a64b4f"
] | [
"app/app.py"
] | [
"import os\nfrom flask import jsonify, Flask, render_template, request, redirect, url_for, send_from_directory\nimport six.moves.urllib as urllib\nimport numpy as np\nimport requests\nimport urllib.request, json \nimport time\nfrom pytorch_pretrained_bert.tokenization import BertTokenizer\nfrom flask_cors import CO... | [
[
"torch.load"
]
] |
ocskier/python-scraper | [
"a76458d9960bc46b2b914fad5cfb95e37889bc08"
] | [
"main.py"
] | [
"\"\"\" This is the main module for scraping real estate local data\"\"\"\r\n\r\n# imports\r\n# import bokeh\r\nimport pandas\r\nimport requests\r\nfrom bs4 import BeautifulSoup\r\nfrom requests.exceptions import RequestException\r\nfrom time import sleep\r\n# from bokeh.plotting import figure, output_notebook, sho... | [
[
"pandas.DataFrame"
]
] |
Kartones/mindcamp-x-gym-retro | [
"a692f6205af8d748ab41c1a49c204020fca6fc56"
] | [
"alleway/agent_epsilon_greedy.py"
] | [
"from gym import Wrapper\nimport numpy\nimport retro\n\nimport config\n\nEPSILON = 0.005 # % of exploration. consider each level has thousands of steps\n\n\nclass EnvWithMemory(Wrapper):\n\n def __init__(self, env):\n super(EnvWithMemory, self).__init__(env)\n self.reset_history()\n\n def reset... | [
[
"numpy.random.random",
"numpy.random.randint"
]
] |
MAPS-Lab/OdomBydVision | [
"c97c884ddf1924a8da513a1a31a52de67bb0ad49"
] | [
"benchmark/milliEgo/eval/evaluate_std_rpe.py"
] | [
"# Evaluate RPE without SVD-based data association and scaling\n\nimport numpy\nimport argparse\nimport os\nfrom os.path import join, dirname\nimport inspect\nimport yaml\nimport associate\nimport csv\nimport math\nfrom eulerangles import mat2euler, euler2mat\nimport yaml\nfrom os.path import join, dirname\n\nSCALE... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.multiply",
"numpy.min",
"numpy.median",
"numpy.finfo",
"numpy.linalg.pinv",
"numpy.std",
"numpy.max",
"numpy.mean",
"numpy.insert",
"numpy.savetxt",
"numpy.outer",
"numpy.array"
]
] |
Gilles86/bias_project | [
"89016055b4c47a587e30c43bb165b1ea74e65134"
] | [
"src/registration/extract_timeseries.py"
] | [
"from nipype.interfaces import fsl\nfrom nipype.interfaces import io as nio\nimport nipype.pipeline.engine as pe\nimport os\nimport numpy as np\n\nproject_folder = '/home/gdholla1/projects/bias'\n\n\ntemplates = {'mask_epi':os.path.join(project_folder, 'data', 'derivatives', 'sub-{subject_id}', 'masks', 'epi_space'... | [
[
"numpy.arange"
]
] |
Huyuwei/dgl | [
"55e7796ac55d5fd5e44c9cf0afa083c8f55e66d3"
] | [
"tests/compute/test_heterograph.py"
] | [
"import dgl\nimport dgl.function as fn\nfrom collections import Counter\nimport numpy as np\nimport scipy.sparse as ssp\nimport itertools\nimport backend as F\nimport networkx as nx\nimport unittest, pytest\nfrom dgl import DGLError\nimport test_utils\nfrom test_utils import parametrize_dtype, get_cases\nfrom utils... | [
[
"scipy.sparse.coo_matrix",
"numpy.arange",
"scipy.sparse.rand",
"numpy.ones",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
pujianjian/Faster-RCNN-Keras | [
"d4afe05384e5634c9d3c6c6f686aa8a571f9f99c"
] | [
"get_dr_txt.py"
] | [
"from keras.layers import Input\r\nfrom frcnn import FRCNN\r\nfrom PIL import Image\r\nfrom keras.applications.imagenet_utils import preprocess_input\r\nfrom utils.anchors import get_anchors\r\nfrom utils.utils import BBoxUtility\r\nfrom nets.frcnn_training import get_new_img_size\r\nimport math\r\nimport copy\r\ni... | [
[
"numpy.expand_dims",
"numpy.round",
"numpy.max",
"numpy.delete",
"numpy.argmax",
"numpy.shape",
"numpy.array",
"numpy.zeros"
]
] |
puppriss/pytaxize | [
"32c03d52ee99da32007dfb1ab5ee1e6745e81dbe"
] | [
"pytaxize/taxo.py"
] | [
"import sys\nimport requests\nimport pandas as pd\nimport json\nimport time\nimport os\n\nclass NoResultException(Exception):\n pass\n\ndef taxo_datasources(todf=True):\n '''\n Get data sources for Taxosaurus.\n\n Retrieve data sources used in Global Names Index, see\n http://taxosaurus.org/ for i... | [
[
"pandas.DataFrame"
]
] |
DavidStahl97/Predictive-Analytics | [
"c607ef2a5fc2b6654122b0b5ef90cb1a23f88eb0"
] | [
"1_Einstieg/passengers/decompositionPanda.py"
] | [
"import pandas as pd\nfrom matplotlib import pyplot\n\n# read csv into a dataframe\nts = pd.read_csv(\"airline-passengers.csv\", header=0, index_col=0)\nrolling = ts.rolling(window=60)\nrolling_mean = rolling.mean()\nrolling_mean.plot()\n\nseasonal = ts[\"Passengers\"] - rolling_mean\n\npyplot.show()\n"
] | [
[
"pandas.read_csv",
"matplotlib.pyplot.show"
]
] |
taneta/patterns | [
"b00e5e3466e467992795f183f12b3a0101bd238b",
"b00e5e3466e467992795f183f12b3a0101bd238b"
] | [
"utils/data_to_char.py",
"utils/plot_helpers.py"
] | [
"import argparse\nimport os\nimport json\nimport numpy as np\nfrom collections import Counter\n\ndef create_char_dict(items):\n \"\"\"Create dictionary of characters item list\"\"\"\n n = len(items)\n if n > 90:\n raise AssertionError(\"Too many factors to code. Limit is 90.\")\n s = 'ABCDEFGHIJK... | [
[
"numpy.hstack",
"numpy.genfromtxt",
"numpy.unique"
],
[
"numpy.amax",
"matplotlib.pyplot.get_cmap",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.tight_layout",
"numpy.clip",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.sci",
"matplotlib.py... |
YacobBY/DFF | [
"d8b9175b8bc43176ce9cae29c92e921c6bd46051"
] | [
"pytorch-encoding/encoding/lib/__init__.py"
] | [
"import os\nimport torch\nfrom torch.utils.cpp_extension import load\n\ncwd = os.path.dirname(os.path.realpath(__file__))\ncpu_path = os.path.join(cwd, 'cpu')\ngpu_path = os.path.join(cwd, 'gpu')\n\ncpu = load('enclib_cpu', [\n os.path.join(cpu_path, 'operator.cpp'),\n os.path.join(cpu_path, 'encoding... | [
[
"torch.cuda.is_available"
]
] |
robinniesert/kaggle-champs | [
"4518f6ac12e9072190c88d5d9b164650ceeded99"
] | [
"preprocess.py"
] | [
"##\n# Many of my features are taken from or inspired by public kernels. The\n# following is a probably incomplete list of these kernels:\n# - https://www.kaggle.com/ggeo79/j-coupling-lightbgm-gpu-dihedral-angle for\n# the idea to use dihedral angles on 3J couplings.\n# - https://www.kaggle.com/titericz/giba-... | [
[
"numpy.dot",
"pandas.merge",
"pandas.Series",
"pandas.DataFrame",
"numpy.arctan2",
"numpy.concatenate",
"numpy.all",
"numpy.mean",
"numpy.cross",
"numpy.where",
"numpy.tril",
"pandas.read_csv",
"numpy.pad",
"numpy.std",
"numpy.repeat",
"numpy.zeros",... |
stachu86/dcase_util | [
"298b2db13a2ffce7791f4de9d374616793564816"
] | [
"dcase_util/datasets/tut.py"
] | [
"# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function, absolute_import\n\nimport collections\nimport hashlib\nimport os\nimport pickle\nimport sys\n\nimport numpy\nimport yaml\nfrom six import iteritems\n\nfrom dcase_util.datasets import SoundDataset, AcousticSceneDataset, Synthe... | [
[
"numpy.load",
"numpy.array",
"sklearn.model_selection.StratifiedShuffleSplit",
"numpy.save"
]
] |
darylperalta/DTC | [
"ecc168a5ed3e08a45344f883f4da5304feec05f4",
"ecc168a5ed3e08a45344f883f4da5304feec05f4"
] | [
"data/utils.py",
"imagenet_classif.py"
] | [
"import os\nimport os.path\nimport hashlib\nimport errno\nfrom tqdm import tqdm\nfrom PIL import Image\nimport numpy as np\nimport sys\n\nclass TransformTwice:\n def __init__(self, transform):\n self.transform = transform\n\n def __call__(self, inp):\n out1 = self.transform(inp)\n out2 = ... | [
[
"numpy.random.randint"
],
[
"torch.nn.CrossEntropyLoss",
"torch.cuda.is_available",
"torch.device",
"torch.nn.DataParallel",
"torch.optim.lr_scheduler.StepLR"
]
] |
zhgenli/Stock_Predict_with_LSTM | [
"1866034fb1c0a31a4b475b48083968c984a40b47"
] | [
"main.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2021/8/31 13:42\n# @FileName: main.py\n\n__author__ = 'Zhigen.li'\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport sys\nimport time\nimport logging\nfrom logging.handlers import RotatingFileHandler\nfrom collections import Counter\nfrom sklearn.model_selection impor... | [
[
"pandas.read_csv",
"numpy.random.seed",
"numpy.squeeze",
"sklearn.model_selection.train_test_split",
"numpy.std",
"numpy.mean",
"numpy.diff",
"numpy.array"
]
] |
gs-gupta01/Opencv-Project | [
"327aeabbbc4f5b8001f9707f90cb37512f28f3a6"
] | [
"hsv.py"
] | [
"\nimport cv2\nimport numpy as np\n\nimg = cv2.imread(\"2.jpeg\",1)\nhsvimg = cv2.cvtColor(img,cv2.COLOR_BGR2HSV)\n\ncv2.imshow(\"original\",img)\ncv2.imshow(\"HSV\",hsvimg)\n\nlb=np.array([110,50,50])\nub=np.array([130,255,255])\n\nmask = cv2.inRange(hsvimg,lb,ub)\ncv2.imshow(\"mask\",mask)\n\nresimg = cv2.bitwise... | [
[
"numpy.array"
]
] |
laure-tlm/HOXA9-regulatory-switch | [
"9a9d0988cdad38ef9198f49749f8c93115b6a0d2"
] | [
"Kaplan_Meier_HOXA9.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\nimport seaborn as sns\r\nimport matplotlib.pyplot as plt\r\nfrom numpy import mean, var\r\nfrom scipy import stats\r\nfrom matplotlib import rc\r\nfrom lifelines import KaplanMeierFitter\r\n\r\n# python program to plot the OS difference between young/old and high/low HO... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
mayankchauhan4/Custom_Named_Entity_Recognition | [
"04b69828638c54d2670209c1c64b38f27ed71946"
] | [
"Custom_NER.py"
] | [
"import pandas as pd\r\nimport json\r\nfrom nltk.stem import WordNetLemmatizer \r\nlemmatizer = WordNetLemmatizer() \r\nfrom nltk.stem import LancasterStemmer\r\nlancaster=LancasterStemmer()\r\nfrom nltk.tokenize import word_tokenize\r\n\r\n# Import NERFunctions.py\r\n# NERFunctions contains the preprocessing and s... | [
[
"pandas.read_csv"
]
] |
Seth-Park/MultimodalExplanations | [
"b58c09ac38a5e5d08541a94599410e59ec5cdec6"
] | [
"PJ-X-ACT/activity_data_provider_layer.py"
] | [
"import caffe\nimport numpy as np\nimport re, json, random\nimport config\n\nQID_KEY_SEPARATOR = '/'\n\nclass ActivityDataProvider:\n\n def __init__(self, batchsize=64,\n exp_max_length=config.MAX_WORDS_IN_EXP, mode='train'):\n self.batchsize = batchsize\n self.d_vocabulary = None\n... | [
[
"numpy.array",
"numpy.zeros",
"numpy.transpose"
]
] |
MatejBabis/AdventOfCode2k18 | [
"859044b132079a9bcc0cc6456c255dc3a70e1fbf"
] | [
"day11/part1.py"
] | [
"import numpy as np\n\nGRID_SIZE = 300\nINPUT = 9424\n\ndef rack_id(x, y):\n return x + 10\n\ndef get_power(x, y):\n power = rack_id(x, y) * y + INPUT\n power *= rack_id(x, y)\n return int(str(power)[-3]) - 5 if power > 99 else -5\n\n# takes x,y coordinate of the top-left corner\ndef fuelcell_power(grid... | [
[
"numpy.zeros",
"numpy.sum"
]
] |
ac2393921/pytorch_lesson | [
"456801c8a088110d926a0d4ec3229a802f5a6204"
] | [
"nn_lesson/model/cnn.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass CNN(nn.Module):\n \"\"\"\n CNNモデルクラス\n \"\"\"\n def __init__(self, num_classes=10, **kwargs):\n super(CNN, self).__init__()\n self.conv1 = nn.Conv2d(in_channels=1, out_channels=8, kernel_size=(3, 3), stride=(1, 1), padding=... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d"
]
] |
bismex/DomainBed | [
"27335e6ba24a946fedd2c52b13e39df132a89008"
] | [
"domainbed/prob_check.py"
] | [
"\nimport matplotlib.pyplot as plt\nimport math\nimport torch\n\nimport numpy as np\nimport scipy.stats as st\n\ndef normal_cdf(x, mu=0, sigma=1):\n return (1+math.erf((x-mu)/math.sqrt(2)*sigma))/2\n\nsmall_num = 5000\nnum = 250\nw_sigma = 1.0\nb_sigma = 1.0\nxs = np.arange(-3, 3, 0.02)\nx_all = []\nfor j in ran... | [
[
"numpy.arange",
"torch.randn",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.grid",
"torch.stack",
"matplotlib.pyplot.hist"
]
] |
zswimau/PyFluxPro | [
"1ecbecba2ef447a64529e1f4be77b128ac2cb896"
] | [
"scripts/qccpd.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Python modules\nimport ast\nfrom configobj import ConfigObj\nimport constants as c\nimport datetime as dt\nimport logging\nimport matplotlib.pyplot as plt\nimport matplotlib.mlab as mlab\nimport netCDF4\nimport numpy as np\nimport os\nimport pandas as pd\nfrom scipy import stats\nimpor... | [
[
"matplotlib.pyplot.legend",
"numpy.sqrt",
"numpy.linspace",
"numpy.vstack",
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.all",
"numpy.any",
"pandas.ExcelWriter",
"pandas.ols",
"numpy.where",
"matplotlib.pyplot.gca",
"... |
dishen12/ssd_aspp | [
"1243743ed2ed57a0cb8ee00776e891424fe006b9"
] | [
"model/ssd_aspp_b_3.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom layers import *\nfrom data import voc, coco\nimport os\n\"\"\"\nextra layer 中存在两个问题:\n1.每次conv后没有relu激活\n2.batchNormalation没有启用\n但是貌似跑benchmark的时候,都没有启用,之后刷指标可以考虑用下\n考虑RFBnet中dilate conv前边加的conv的作用\n\"\"... | [
[
"torch.nn.Softmax",
"torch.cat",
"torch.load",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
Colonel-Ada/AdversarialExamples | [
"6601eafd020c1771e2cf641f4ca4d8e037373bf8"
] | [
"attack/setup_inception.py"
] | [
"## Modified by Nicholas Carlini to match model structure for attack code.\n## Original copyright license follows.\n\n\n# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lic... | [
[
"tensorflow.import_graph_def",
"tensorflow.gfile.Exists",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.reshape",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.placeholder",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.Session",
"tensorflow.GraphDef",
... |
pavel3/recurrent-slds | [
"4deaa6a4e01d532aae7732c5fc6434b90a0962f2"
] | [
"rslds/transitions.py"
] | [
"import numpy as np\nfrom pypolyagamma import MultinomialRegression\nfrom rslds.util import psi_to_pi, one_hot\n\nclass InputHMMTransitions(MultinomialRegression):\n \"\"\"\n Model the transition probability as a multinomial\n regression whose inputs include the previous state\n as well as some covariat... | [
[
"sklearn.neural_network.MLPClassifier",
"numpy.dot",
"numpy.einsum",
"numpy.concatenate",
"numpy.exp",
"scipy.linalg.solve_triangular",
"numpy.hstack",
"numpy.eye",
"numpy.column_stack",
"numpy.ravel",
"numpy.outer",
"numpy.zeros",
"numpy.log",
"numpy.ascont... |
h3nrikoo/system_on_sheep | [
"703a9cea802fa15f105603e2c2ab53c399fb6eb3"
] | [
"measurements/initial_range_test/plot_height_profile.py"
] | [
"import geopy.distance\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\ndf1 = pd.read_csv('map_data/map_data_1km.csv')\n\nx1 = []\ny1 = []\n\nlength = df1.index.size - 1\n\nfor i in range(length, -1, -1):\n y1.append(df1.iloc[i,2])\n coords_1 = (df1.iloc[length,0... | [
[
"pandas.read_csv",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
]
] |
andreakiro/covid-what-if | [
"e284ef7d0d2359ef843a75d395827ed6eb3678e5"
] | [
"backend/modeling/unified.py"
] | [
"import yaml\nimport pandas as pd\nimport numpy as np\nimport datetime\nfrom numpy.random import seed as npseed\nimport pickle as pkl\nfrom modeling.hybrid import *\nimport os\nimport torch\nimport torch.nn as nn\nfrom tqdm import tqdm_notebook\nfrom modeling.model_data import get_label, normalize_but_country, get_... | [
[
"numpy.append",
"numpy.array",
"pandas.to_datetime"
]
] |
john-hu/oclGA | [
"9edf311341f2b99c14080427425be7705f2c8dd8"
] | [
"utils.py"
] | [
"import random\nfrom math import pi, sqrt, asin, cos, sin, pow\n\ndef get_testing_params():\n return 20, 200, 5000\n\ndef init_testing_rand_seed():\n random.seed(119)\n\ndef calc_linear_distance(x1, y1, x2, y2):\n return sqrt((x2 - x1)**2 + (y2 - y1)**2)\n\ndef calc_spherical_distance(x1, y1, x2, y2):\n ... | [
[
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.text",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
AbijahKaj/DONT | [
"f4f482a2cb275614e4cdab92f848b89a4a97e1a7"
] | [
"model/mobilenetv3.py"
] | [
"\"\"\"\nCreates a MobileNetV3 Model as defined in:\nAndrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, Hartwig Adam. (2019).\nSearching for MobileNetV3\narXiv preprint arXiv:1905.02244.\n\"\"\"\n\nimport torch.nn as nn... | [
[
"torch.nn.Sequential",
"torch.nn.BatchNorm1d",
"torch.nn.ReLU6",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
todd-cook/ML-You-Can-Use | [
"45c86d6f70b7d216c421ea005e022f5d6f5501cd"
] | [
"mlyoucanuse/gpt2_fun.py"
] | [
"# Copyright 2020 Todd Cook\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in... | [
[
"torch.topk",
"torch.nn.Softmax",
"torch.no_grad"
]
] |
davidlu89/pytf | [
"f2d63a2d97edcaa8b03a15b90970e6eca0763417"
] | [
"pytf/utilities/share_utilities.py"
] | [
"import numpy as np\nimport multiprocessing as mp\nimport ctypes\n# Authors : David C.C. Lu <davidlu89@gmail.com>\n#\n# License : BSD (3-clause)\n\ndef ndarray_base_to_np(base, shape, dtype=np.float32):\n shared_ndarray = np.ctypeslib.as_array(base.get_obj())\n return shared_ndarray.view(dtype).reshape(*shape... | [
[
"numpy.prod"
]
] |
binarybana/samcnet | [
"84f3ba8241d416115a8aa9ba5c659a9513175072"
] | [
"samcnet/tail.py"
] | [
"# A simple example of calculating predictive posteriors in a normal unknown\n# mean unknown variance case.\n\nfrom __future__ import division\nfrom lori import MHRun\n\nimport numpy as np\nimport pylab as p\nimport matplotlib as mpl\nimport random\nfrom math import log, exp, pi, lgamma\n\nimport scipy.stats as st\... | [
[
"numpy.linspace",
"matplotlib.pyplot.hold",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"numpy.exp",
"numpy.ones_like",
"scipy.stats.distributions.norm.pdf",
"scipy.stats.distributions.norm.rvs",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
... |
dimkart/discopy | [
"cf3d7bd86bb78271e5c99a1735890d35cc1d2b29"
] | [
"test/test_drawing.py"
] | [
"import os\nfrom pytest import raises\n\nfrom PIL import Image, ImageChops\nfrom matplotlib import pyplot as plt\nfrom matplotlib.testing.compare import compare_images\n\nfrom discopy import *\n\n\nIMG_FOLDER, TIKZ_FOLDER, TOL = 'test/imgs/', 'test/tikz/', 10\n\n\ndef draw_and_compare(file, folder=IMG_FOLDER, tol=T... | [
[
"matplotlib.testing.compare.compare_images"
]
] |
or1426/Cliford-T-estimator | [
"c460c143f25fc637aa18c2907e01afeea46112e0"
] | [
"util.py"
] | [
"import numpy as np\nimport constants\nimport gates\nimport random\n#import measurement\nimport itertools\n#import myModule\n\ndef a2str(a):\n \"\"\"\n formatting for 1 or 2 dimensional numpy arrays of booleans\n \"\"\"\n if len(a.shape) == 1:\n return \"\".join(map(str, a))\n elif len(a.shape... | [
[
"numpy.diag",
"numpy.sqrt",
"numpy.uint8",
"numpy.flatnonzero",
"numpy.copy",
"numpy.zeros_like",
"numpy.outer",
"numpy.array"
]
] |
quantastica/qiskit-toaster | [
"7143ef47b06403c364ec496d4399bbedc6e33131"
] | [
"tests/manual/test_qaoa.py"
] | [
"import unittest\nimport networkx as nx\nimport numpy as np\nfrom docplex.mp.model import Model\n\nfrom qiskit import BasicAer\nfrom qiskit.aqua import aqua_globals, QuantumInstance\nfrom qiskit.aqua.algorithms import QAOA\nfrom qiskit.aqua.components.optimizers import SPSA\nfrom qiskit.optimization.applications.is... | [
[
"numpy.zeros"
]
] |
akhairna/scri | [
"3b7f307d19ef303914cef2fa088ee750ef8533c2",
"3b7f307d19ef303914cef2fa088ee750ef8533c2"
] | [
"scri/asymptotic_bondi_data/__init__.py",
"tests/test_rotations.py"
] | [
"from math import sqrt, pi\nimport numpy as np\nfrom spherical_functions import LM_total_size\nfrom .. import ModesTimeSeries\n\n\nclass AsymptoticBondiData:\n \"\"\"Class to store asymptotic Bondi data\n\n This class stores time data, along with the corresponding values of psi0 through psi4 and sigma.\n F... | [
[
"numpy.ndim",
"numpy.zeros",
"numpy.empty"
],
[
"numpy.abs",
"numpy.random.uniform",
"numpy.allclose",
"numpy.array_equal"
]
] |
gitmarek/pyrat | [
"cbf918d5c23d5d39e62e00bb64b6d0596170c68b"
] | [
"pyrat/conv.py"
] | [
"import logging, sys\n\nimport numpy as np\nfrom scipy import signal\n\nfrom pyrat import logger\n\n\ndef start(args):\n\n infile= args.infile\n logger.info(f'Reading file: {infile.name}')\n sig = np.fromfile(infile, dtype=np.float32)\n\n if len(sig) == 0:\n logger.error(f'The file {infile.name} ... | [
[
"numpy.fromfile",
"numpy.abs",
"scipy.signal.fftconvolve"
]
] |
ahmetcelik158/Image-Classifier | [
"22d8251483b386549e1f0fd1ac381d33fb9d9f4d"
] | [
"ai_methods.py"
] | [
"#\n# AI METHODS\n# Created by: AHMET CELIK\n#\n\nimport numpy as np\n\nimport torch\nfrom torch import nn\nfrom torch import optim\nimport torch.nn.functional as F\nfrom torchvision import datasets, transforms, models\n\nfrom PIL import Image\n\ndef get_loader_and_classidx(data_dir):\n train_dir = data_dir + '/... | [
[
"torch.nn.NLLLoss",
"torch.nn.Dropout",
"torch.nn.LogSoftmax",
"torch.load",
"torch.utils.data.DataLoader",
"torch.exp",
"torch.nn.Linear",
"torch.FloatTensor",
"torch.no_grad",
"torch.nn.ReLU",
"numpy.array",
"torch.save"
]
] |
tachengxmu/QuantPipe | [
"5d75891dc8672284e90beab363d253ecf14e3775"
] | [
"tutorial files/spectrast2spectrast_irt.py"
] | [
"#!C:\\Anaconda3\\python.exe\n\"\"\"\nCopyright (c) 2012, ETH Zurich, Insitute of Molecular Systems Biology, \nGeorge Rosenberger\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n * Redistribu... | [
[
"matplotlib.use",
"matplotlib.pyplot.savefig",
"scipy.stats.linregress",
"scipy.poly1d",
"scipy.polyval",
"matplotlib.pyplot.figure"
]
] |
cltl/HDD_analysis | [
"f4b3d6c5e0b52a00536aa82dc5c5ee06fc6710ed"
] | [
"HDD_analysis_main.py"
] | [
"from .xml_utils import srl_id_frames, term_id_lemmas, determiner_id_info, compound_id_info, get_text_title, frame_info_dict, sentence_info\nfrom .fficf_utils import contrastive_analysis, output_tfidf_to_format, sample_corpus, delete_smallest_texts, output_tfidf_to_json, create_output_folder, compute_c_tf_idf_betwe... | [
[
"pandas.concat",
"pandas.read_pickle"
]
] |
KarthikKothareddy/Data-Science | [
"2c12128e29f5e3455882db6c83d1e1ffafa7126f"
] | [
"scikit/Chapter 2/figures/plot_rbf_svm_parameters.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom sklearn.svm import SVC\r\nfrom sklearn.datasets import make_blobs\r\nfrom sklearn.externals.joblib import Memory\r\nfrom .plot_2d_separator import plot_2d_separator\r\n\r\ndef make_handcrafted_dataset():\r\n # a carefully hand-designed dataset lol\r\... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.subplots",
"sklearn.svm.SVC",
"numpy.array",
"sklearn.datasets.make_blobs"
]
] |
Hongyang449/Ocelot | [
"73932383e6d3863fd9fa4aada12488550ce98b45"
] | [
"data_challenge/hg38/generate_dna_bigwig.py"
] | [
"import pyBigWig\nimport numpy as np\nimport os\nimport sys\n\n# 2hrs\n\npath1='./'\npath2='../signal_anchored_final/'\nos.system('mkdir -p ' + path2)\n\nchr_all=['chr1','chr2','chr3','chr4','chr5','chr6','chr7','chr8','chr9','chr10','chr11','chr12','chr13','chr14','chr15','chr16','chr17','chr18','chr19','chr20','c... | [
[
"numpy.concatenate",
"numpy.load",
"numpy.diff"
]
] |
fantasyRqg/mace | [
"6901d36099e533148952f8d403d28000fa240153",
"6901d36099e533148952f8d403d28000fa240153"
] | [
"tools/python/gen_opencl.py",
"tools/python/quantize/quantize_stat.py"
] | [
"# Copyright 2019 The MACE Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"numpy.array",
"numpy.fromfile"
],
[
"numpy.sort",
"numpy.percentile"
]
] |
VictorBeraldo/wave2vec-recognize-docker | [
"aec0c7d718c0c670c37fdef3d5ea40396e610881",
"aec0c7d718c0c670c37fdef3d5ea40396e610881"
] | [
"fairseq/fairseq/distributed_utils.py",
"fairseq/fairseq/modules/checkpoint_activations.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\r\n#\r\n# This source code is licensed under the MIT license found in the\r\n# LICENSE file in the root directory of this source tree.\r\n\r\nimport io\r\nimport logging\r\nimport os\r\nimport pickle\r\nimport random\r\nimport socket\r\nimport struct\r\nimport sub... | [
[
"torch.distributed.broadcast",
"torch.load",
"torch.zeros",
"torch.cuda.is_available",
"torch.device",
"torch.distributed.get_rank",
"torch.save",
"torch.distributed.init_process_group",
"torch.tensor",
"torch.empty_like",
"torch.cuda.ByteTensor",
"torch.distributed... |
Strabes/demos | [
"8d77eb2cc90d618f2b34c6d4a820efb677d45458"
] | [
"xgboost/utils.py"
] | [
"import numpy as np\nimport pandas as pd\n\ndef datetime_preprocess(df):\n df = df.copy()\n dt_cols = ['issue_d','earliest_cr_line']\n df.loc[:,dt_cols] = df.loc[:,dt_cols] \\\n .applymap(lambda x: np.nan if x in ['null','NULL',''] else x) \\\n .apply(lambda x: pd.to_datetime(x,format = \"%b-%Y\"... | [
[
"pandas.api.types.is_object_dtype",
"pandas.to_datetime"
]
] |
chihyaoma/cyclical-visual-captioning | [
"337eee17a8789e58d7bf687ad9ecf27c8da44f14"
] | [
"anet-video-captioning/misc/utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_functio... | [
[
"torch.mean",
"torch.max",
"torch.nn.functional.log_softmax",
"numpy.clip",
"torch.cat",
"torch.zeros",
"matplotlib.patches.Rectangle",
"torch.sum",
"numpy.round",
"numpy.random.rand",
"torch.gather"
]
] |
rchavan10/Multiple-Intersection-Traffic-Control-using-Reinforcement-Learning | [
"3663a1c7a89fe18974d13c9dc78ac7a99dac2300"
] | [
"agents/base.py"
] | [
"import random\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as func\n\nclass LocalStateEncoderBiLSTM(nn.Module):\n def __init__(self, input_size, hidden_size, num_layers, output_size, phase_size, device):\n super(LocalStateEncoderBiLSTM, self).__init__()\n se... | [
[
"torch.cat",
"torch.nn.LSTM",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
thazhemadam/OGCNN | [
"a0c5c307966d654fad6c1945aaa9b8d53318c776"
] | [
"data.py"
] | [
"import csv\nimport functools\nimport json\nimport os\nimport random\nimport warnings\n\nimport numpy as np\nimport torch\nfrom pymatgen.core.structure import Structure\nfrom torch.utils.data import Dataset, DataLoader\nfrom torch.utils.data.dataloader import default_collate\nfrom torch.utils.data.sampler import Su... | [
[
"torch.LongTensor",
"torch.Tensor",
"numpy.random.choice",
"numpy.asarray",
"numpy.arange",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.utils.data.sampler.SubsetRandomSampler",
"numpy.nan_to_num",
"numpy.matmul",
"numpy.concatenate",
"numpy.exp",
"torch.f... |
lapidshay/GenericAnomalousCommunitiesDetection | [
"eae7b58bb427828abb9baa64d097114089b80af5"
] | [
"Evaluation/Reddit/CommunitySizesGenerator.py"
] | [
"__author__ = 'Shay Lapid'\n__email__ = 'lapidshay@gmail.com'\n\n##################################\n# Imports\n##################################\n\nimport numpy as np\n\n\n##################################\n# CommunitySizesGenerator\n##################################\n\nclass CommunitySizesGenerator:\n\tdef __i... | [
[
"numpy.random.seed",
"numpy.min",
"numpy.random.choice",
"numpy.median",
"numpy.quantile",
"numpy.percentile",
"numpy.max",
"numpy.std",
"numpy.mean",
"numpy.random.randint"
]
] |
xiaoweih/AISafetyLectureNotes | [
"77f152db7cf6d76d510dd9d46ce7ddfe362eadde"
] | [
"Chapter-3/3.5.1_GaussianNB.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[3]:\n\n\nimport math\nimport copy\nimport numpy as np\nfrom sklearn import datasets\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.naive_bayes import GaussianNB\n\niris = datasets.load_iris()\nX_train, X_test, y_train, y_test = train_test_split(ir... | [
[
"numpy.diag",
"sklearn.naive_bayes.GaussianNB",
"numpy.sqrt",
"sklearn.datasets.load_iris",
"sklearn.model_selection.train_test_split",
"numpy.apply_along_axis",
"numpy.exp",
"numpy.zeros"
]
] |
Neuroglycerin/neukrill-net-work | [
"be1c0bc8583e57e4e2e004fa677fe7c8da431f48"
] | [
"test.py"
] | [
"#!/usr/bin/env python\n\nimport neukrill_net.utils as utils\nimport neukrill_net.image_processing as image_processing\nimport neukrill_net.augment as augment\nimport neukrill_net.dense_dataset\n\nimport csv\nimport pickle\nfrom sklearn.externals import joblib\nimport numpy as np\nimport glob\nimport os\nimport arg... | [
[
"sklearn.externals.joblib.load",
"numpy.zeros",
"numpy.mean",
"numpy.vstack"
]
] |
PFMassiani/gpytorch | [
"41a4f3536ef3813fcad351ff458e6b7fba4f5f9e"
] | [
"gpytorch/lazy/zero_lazy_tensor.py"
] | [
"#!/usr/bin/env python3\n\nimport torch\n\nfrom ..utils.broadcasting import _mul_broadcast_shape\nfrom ..utils.getitem import _compute_getitem_size\nfrom ..utils.memoize import cached\nfrom .lazy_tensor import LazyTensor\n\n\nclass ZeroLazyTensor(LazyTensor):\n \"\"\"\n Special LazyTensor representing zero.\n... | [
[
"torch.Size",
"torch.zeros",
"torch.is_tensor",
"torch.tensor",
"torch.device",
"torch.get_default_dtype"
]
] |
griffin-h/photutils | [
"9053b3f2dde0e3bbfa6786049722f49d8eff6706"
] | [
"photutils/utils/convolution.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport warnings\n\nimport numpy as np\nfrom astropy.convolution import Kernel2D\nfrom astropy.units import Quantity\nfrom astropy.utils.exceptions import AstropyUserWarning\n\n\n__all__ = ['filter_data']\n\n\ndef filter_data(data, kernel, mode='con... | [
[
"numpy.sum"
]
] |
jacksonloper/bardensr | [
"33aa3e5dbc8993d998808043c02eab8b67b45c6a"
] | [
"bardensr/spot_calling/barcodesfirst.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport pandas as pd\n\n\n@tf.function\ndef _build_evidence_tensor(Xshfl,codes,lowg):\n '''\n Input\n - Xshfl, N x M\n - codebook N x J\n\n Output[m,j] = <Xshfl[m] | codes[:,j]> / (||norm(Xshfl[m])|| + lowg)\n\n\n\n '''\n nrms=tf.math.sqrt(tf.reduce_... | [
[
"tensorflow.transpose",
"numpy.isnan",
"tensorflow.reduce_sum",
"tensorflow.identity",
"numpy.prod",
"numpy.require"
]
] |
jonaphin/facenet | [
"8f4fddb52f0d3a4d56194346034e993808392917"
] | [
"facenet/src/classifier.py"
] | [
"\"\"\"An example of how to use your own dataset to train a classifier that recognizes people.\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\")... | [
[
"tensorflow.Graph",
"numpy.random.seed",
"numpy.random.shuffle",
"numpy.argmax",
"numpy.equal",
"tensorflow.Session",
"sklearn.svm.SVC",
"tensorflow.get_default_graph",
"numpy.zeros"
]
] |
kocopelly/tensorflow | [
"5d68922c4db33227061d7de2dc81934b159bda88"
] | [
"tensorflow/python/keras/wrappers/scikit_learn.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.hstack",
"numpy.unique",
"numpy.arange",
"tensorflow.python.util.tf_export.keras_export",
"tensorflow.python.keras.losses.is_categorical_crossentropy",
"numpy.searchsorted",
"tensorflow.python.keras.utils.generic_utils.has_arg",
"tensorflow.python.keras.utils.np_utils.to_cat... |
Wenzhe-Liu/TinyNeuralNetwork | [
"6b01812bd397270ca1960d719eeba686da8e576d"
] | [
"tinynn/converter/base.py"
] | [
"import io\nimport typing\nimport torch\n\nimport numpy as np\n\nfrom .operators import CommonGraph, ExtendedOperator, GraphOptimizer\nfrom .operators.op_version import OPVersioner\nfrom .operators.tflite import Tensor\nfrom .operators.torch import OPERATOR_CONVERTER_DICT\nfrom .operators.torch.base import NoTrackO... | [
[
"torch.jit.save",
"torch._C._jit_pass_lower_all_tuples",
"torch.jit.load",
"torch._C._jit_try_infer_type",
"numpy.savez",
"torch.jit.trace",
"torch._C._jit_pass_inline_fork_wait",
"torch._C._jit_pass_canonicalize_graph_fuser_ops",
"torch._C._jit_pass_peephole",
"torch._C._j... |
AutumnSky/smart-drone | [
"d48ea8a7c6da5e0970f3e387ab7c0e6a152f9e5d"
] | [
"pathplan/pathcontroller.py"
] | [
"import json\nimport math\nimport os\nimport time\n\nimport cv2\nimport numpy as np\n\nfrom common.utils import get_distance\n\n\nclass PathController:\n\t\"Responsible to controle the drone based on loaded path plan\"\n\n\twp = []\n\tcurrent_point = -1\n\tway_points = []\n\tx = 0\n\ty = 0\n\taccumulated_angle = 0\... | [
[
"numpy.zeros"
]
] |
soulbyfeng/event_detection_vat | [
"e53e16a68c58652627a9082a8dc6e97c4484c2e0"
] | [
"utils.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\n\n\ndef kl_div_with_logit(q_logit, p_logit):\n\n q = F.softmax(q_logit, dim=1)\n logq = F.log_softmax(q_logit, dim=1)\n logp = F.log_softmax(p_logit, dim=1)\n\n qlogq = ( q *logq).sum(dim=1).mean(dim... | [
[
"torch.nn.functional.softmax",
"torch.nn.functional.log_softmax",
"torch.from_numpy",
"numpy.sum",
"torch.autograd.Variable"
]
] |
hitesh-hk/google-research | [
"88481d10a87947ffb9305dc7665682e008b27391",
"88481d10a87947ffb9305dc7665682e008b27391"
] | [
"behavior_regularized_offline_rl/brac/brac_primal_agent.py",
"video_structure/vision.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research 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 requ... | [
[
"tensorflow.compat.v1.stack",
"tensorflow.compat.v1.square",
"tensorflow.compat.v1.Variable",
"tensorflow.compat.v1.reduce_mean",
"tensorflow.compat.v1.equal",
"tensorflow.compat.v1.train.Checkpoint",
"tensorflow.compat.v1.add_n",
"tensorflow.compat.v1.GradientTape",
"tensorflo... |
gcambara/s3prl | [
"33284ebde3a903ed8604d6dae85669d0174ae1d3"
] | [
"s3prl/downstream/runner.py"
] | [
"import os\nimport sys\nimport math\nimport glob\nimport uuid\nimport shutil\nimport random\nimport tempfile\nimport importlib\nfrom pathlib import Path\n\nimport torch\nimport torchaudio\nimport numpy as np\nfrom tqdm import tqdm\nfrom tensorboardX import SummaryWriter\nfrom torch.utils.data import DistributedSamp... | [
[
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.distributed.is_initialized",
"torch.cuda.empty_cache",
"torch.distributed.barrier",
"torch.nn.utils.clip_grad_norm_",
"torch.no_grad",
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.cuda.manual_seed_... |
sogno-platform/proloaf | [
"2c9350a291056e7a56c115ccbda3aaa019f12bbe"
] | [
"source/interpreter.py"
] | [
"\"\"\"\nevaluates a trained Neural Network on its salient features regarding the time and feature dimension\ncreates a saliency heatmap\nmodel should be trained beforehand\n\"\"\"\nimport pandas\nimport pandas as pd\nimport torch\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import s... | [
[
"torch.mean",
"pandas.to_datetime",
"torch.autograd.set_detect_anomaly",
"torch.zeros",
"torch.cat",
"matplotlib.pyplot.rc",
"pandas.DataFrame",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"numpy.random.default_rng",
"torch.norm",
"torch.ones",
... |
Mr-Milk/SpatialTis | [
"bcdc6df5213b8b256cbe4c9a7c0f3b5e6d3c56b6"
] | [
"spatialtis/spatial/distribution.py"
] | [
"from typing import Optional\n\nimport numpy as np\nimport pandas as pd\nfrom anndata import AnnData\nfrom spatialtis_core import points_bbox, spatial_distribution_pattern\n\nfrom spatialtis.abc import AnalysisBase\nfrom spatialtis.typing import Number, Tuple\nfrom spatialtis.utils import doc, read_points\n\n\n@doc... | [
[
"pandas.DataFrame"
]
] |
god99me/RandomRoughForest | [
"99a75399e438a0afdfb5f7764e9142405912ad6d"
] | [
"test/test_base_rough_set.py"
] | [
"import unittest\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import load_iris\n\nimport core.BaseRoughSet as RS\nfrom core.Preprocessing import normalize\n\n\nclass TestBaseRoughSet(unittest.TestCase):\n\n def setUp(self):\n iris = load_iris()\n ... | [
[
"pandas.concat",
"pandas.Series",
"numpy.arange",
"sklearn.datasets.load_iris",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.show",
"numpy.where"
]
] |
kidozh/rnn_in_forecasting_tool_wear | [
"0413aecdb6b68499d1e6b7795bf97ddce82aec75"
] | [
"seq2seq_tool_wear/main_plot_paper.py"
] | [
"from seq2seq_tool_wear.model import *\nfrom data import RNNSeriesDataSet\nfrom keras.callbacks import TensorBoard,ModelCheckpoint\nimport os.path\nfrom keras.models import load_model\nimport matplotlib.pyplot as plt\n\n# ---- need func --\ndef get_loss_value(real,pred):\n from sklearn.metrics import mean_square... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.mean_absolute_error",
"matplotlib.pyplot.savefig",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"matp... |
aarora8/espnet | [
"66f0f8382b0e1195bed7c280c29711f8436b3db4"
] | [
"espnet/nets/pytorch_backend/e2e_asr_maskctc.py"
] | [
"# Copyright 2020 Johns Hopkins University (Shinji Watanabe)\n# Waseda University (Yosuke Higuchi)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"\nMask CTC based non-autoregressive speech recognition model (pytorch).\n\nSee https://arxiv.org/abs/2005.08700 for the detail.\n\n\... | [
[
"torch.topk",
"numpy.array",
"torch.nonzero"
]
] |
nipeone/histolab | [
"78854423df04c95c7168d03a95ae8665e3e957d8"
] | [
"histolab/util.py"
] | [
"# encoding: utf-8\n\n# ------------------------------------------------------------------------\n# Copyright 2020 All Histolab Contributors\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 Lic... | [
[
"numpy.asarray",
"numpy.tile",
"numpy.max",
"numpy.zeros",
"numpy.floor",
"numpy.array",
"numpy.where",
"numpy.vstack"
]
] |
canbooo/pyRDO | [
"f7143438aa30cc79587c9f35fc9ff6aa262fc4d3"
] | [
"duqo/proba/_integrator_base.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 30 16:05:41 2019\n\n@author: Bogoclu\n\"\"\"\nimport numpy as np\nfrom scipy.stats import norm\n\n\nclass GenericIntegrator:\n \"\"\" Base class for an integrator\n\n This is used for inheritance only\n\n Parameters\n ----------\n multivariate:... | [
[
"numpy.dot",
"scipy.stats.norm._ppf",
"numpy.ones",
"numpy.append",
"numpy.zeros",
"scipy.stats.norm._cdf",
"numpy.empty",
"numpy.isclose"
]
] |
USTCECG/ecg | [
"5b520c8698c0878b234a9ed1f126174b7338212a",
"5b520c8698c0878b234a9ed1f126174b7338212a"
] | [
"ECG_combine_leads.py",
"ECG_utils.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2019\n\n@author: Xiajun\n\n# CPSC_combine_leads.py: 组合各导联神经网络的输出概率\n\n\"\"\"\n\nimport os\nimport warnings\nimport numpy as np\nimport tensorflow as tf\nfrom keras import backend as bk\nfrom keras.models import load_model\nfrom keras.utils import to_categorical\nfrom skl... | [
[
"numpy.unique",
"sklearn.model_selection.train_test_split",
"numpy.save",
"numpy.concatenate",
"tensorflow.reset_default_graph",
"numpy.load",
"sklearn.preprocessing.scale"
],
[
"numpy.random.seed",
"numpy.unique",
"numpy.random.choice",
"numpy.ones",
"numpy.con... |
punitvara/pandas | [
"dec7d213fb27e9eafb61201f173c241d7105f772",
"dec7d213fb27e9eafb61201f173c241d7105f772"
] | [
"pandas/core/arrays/categorical.py",
"pandas/tests/apply/test_frame_apply.py"
] | [
"from __future__ import annotations\n\nfrom csv import QUOTE_NONNUMERIC\nfrom functools import partial\nimport operator\nfrom shutil import get_terminal_size\nfrom typing import (\n TYPE_CHECKING,\n Dict,\n Hashable,\n List,\n Optional,\n Sequence,\n Type,\n TypeVar,\n Union,\n cast,\n... | [
[
"pandas._libs.algos.ensure_platform_int",
"pandas.to_datetime",
"pandas.util._validators.validate_bool_kwarg",
"pandas.util._decorators.deprecate_kwarg",
"pandas.Series",
"pandas.core.dtypes.dtypes.CategoricalDtype._from_values_or_dtype",
"numpy.asarray",
"pandas.core.dtypes.common... |
Fresh-Z/SO-Net | [
"d798aaa8458b867a9bf6c38f2e0f0c8094a94143"
] | [
"models/networks.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.modules.batchnorm import _BatchNorm\nimport numpy as np\nimport math\nimport torch.utils.model_zoo as model_zoo\nimport time\n\nfrom util import som\nfrom . import operations\nfrom .layers import *\n\nimport matplotlib.pyplot as pl... | [
[
"torch.nn.Dropout",
"torch.max",
"torch.cat",
"torch.sum",
"torch.FloatTensor",
"torch.split",
"torch.nn.ZeroPad2d"
]
] |
xiyan524/fairseq | [
"810bf2e58aee1ea180874c12667740810166c7d2"
] | [
"fairseq_cli/generate.py"
] | [
"#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTranslate pre-processed data with a trained model.\n\"\"\"\n\nimport ast\nimport logging\nimport ma... | [
[
"torch.cuda.is_available",
"numpy.random.seed"
]
] |
DLWK/SegTrGAN | [
"b76f95a893dbb4461c5e3b050bc8778fc89e56b2"
] | [
"lib/VGG16bd.py"
] | [
"import logging\nimport math\nimport os\nimport numpy as np \n\nimport torch\nfrom torch import nn\nfrom torch.nn import CrossEntropyLoss, MSELoss\nfrom einops import rearrange\n# from SETR.transformer_model import TransModel2d, TransConfig\nfrom torchvision import models\nfrom SegTrGAN.wassp import VAMM1, PyramidP... | [
[
"torch.nn.Sequential",
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Upsample",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.functional.pad"
]
] |
Louis-udm/Word-Grounded-Graph-Convolutional-Network | [
"4c90bff0ec8bcdd8994154eead0efb5a3caefca7"
] | [
"train_tgcn.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Title: Train Traditional GCN / Text-GCN models\n\nDescription: \n\n\"\"\"\n\n# =======================================\n# @author Zhibin.Lu\n# @email zhibin.lu@umontreal.ca\n# =======================================\n\n\nfrom __future__ import division, print_f... | [
[
"torch.max",
"sklearn.metrics.precision_recall_fscore_support",
"torch.no_grad",
"numpy.mean",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"torch.device",
"sklearn.metrics.f1_score",
"sklearn.metrics.classification_report",
"torch.nn.CrossEntropyLoss",
"tor... |
NormanRH/UCLCHEM | [
"6c4cb60f54b86c339541616cb833ce61cfd1993f"
] | [
"scripts/offsolarplot.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 20 21:10:09 2020\n\n@author: norman\n\"\"\"\n#demonstration of plotfunctions. called from main UCLCHEM directory\n#it reads full UCLCHEM output and saves a plot of the abudances of select species \n\nimport numpy as np\nimport plotfunction... | [
[
"numpy.asarray",
"numpy.append"
]
] |
UFO-Pluto/district | [
"49cabbe377703e379375df2f38774f4a9830759b"
] | [
"read.py"
] | [
"import pandas as pd\nimport numpy as np\n\npd.set_option('display.width', 5000)\npd.set_option('display.max_columns', 500)\npd.set_option('display.max_rows', None)\npd.set_option('max_colwidth', 100)\n\ndf = pd.read_csv('data.csv',index_col='id')\ndf = df.replace(np.nan, '', regex=True)\n\nprint(df)\n\nfor index, ... | [
[
"pandas.set_option",
"pandas.read_csv"
]
] |
jeehyun100/biggan_torch | [
"1335aa6b377581133327206d18971f34a1d41e11"
] | [
"datasets.py"
] | [
"''' Datasets\r\n This file contains definitions for our CIFAR, ImageFolder, and HDF5 datasets\r\n'''\r\nimport os\r\nimport os.path\r\nimport sys\r\nfrom PIL import Image\r\nimport numpy as np\r\nfrom tqdm import tqdm, trange\r\n\r\nimport torchvision.datasets as dset\r\nimport torchvision.transforms as transfo... | [
[
"numpy.random.seed",
"numpy.asarray",
"torch.from_numpy",
"numpy.concatenate",
"numpy.savez_compressed",
"numpy.delete",
"numpy.shape",
"numpy.load"
]
] |
SSAW14/BeyondtheSpectrum | [
"0f3492e90d60fe956abc3bfd7ba008ddc5cfd9c2"
] | [
"models/customize.py"
] | [
"##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Hang Zhang\n## ECE Department, Rutgers University\n## Email: zhang.hang@rutgers.edu\n## Copyright (c) 2017\n##\n## This source code is licensed under the MIT-style license found in the\n## LICENSE file in the root directory... | [
[
"torch.nn.functional.normalize",
"torch.nn.functional.batch_norm",
"torch.Size",
"torch.ones",
"torch.zeros",
"torch.cat",
"torch.nn.Conv2d",
"torch.zeros_like",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.GroupNorm",
"torch.nn... |
kyleniemeyer/multimatch_gaze | [
"36fd53076b8e95897ed2e8650ecaa9d9c4de9bc0"
] | [
"data/code/create_videodata.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nshort script to transform remodnav\n(https://github.com/psychoinformatics-de/remodnav) outputs from naturalistic\nstimulation with hollywood movie forrest gump into fixation vectors\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom bisect import bisect_right\nimport os.path ... | [
[
"pandas.read_csv",
"numpy.logical_and",
"numpy.recfromcsv",
"numpy.logical_or",
"numpy.append",
"numpy.delete",
"numpy.savetxt",
"numpy.recarray",
"numpy.where"
]
] |
xiong-jie-y/tsukuyomichan-ai | [
"e51763974bb3aa5306bcecba4832bc81c7501a5b"
] | [
"onnx_sentence_transformers.py"
] | [
"\nfrom transformers import AutoTokenizer\nimport onnxruntime\n\nimport torch\n\nfrom utils.file import get_model_file_from_gdrive\n\n#Mean Pooling - Take attention mask into account for correct averaging\ndef mean_pooling(model_output, attention_mask):\n token_embeddings = model_output[0] #First element of mode... | [
[
"torch.sum",
"torch.tensor"
]
] |
randomprimate/aind-asl-recognizer | [
"75dab85ea3380b688c0f36b290edc8a191b5ba43"
] | [
"my_model_selectors.py"
] | [
"import math\nimport statistics\nimport warnings\n\nimport numpy as np\nfrom hmmlearn.hmm import GaussianHMM\nfrom sklearn.model_selection import KFold\nfrom asl_utils import combine_sequences\n\n\nclass ModelSelector(object):\n '''\n base class for model selection (strategy design pattern)\n '''\n\n de... | [
[
"numpy.mean",
"sklearn.model_selection.KFold"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.