repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
earlisreal/eJournal
[ "177052bfffc15105eae14ac9842918fb1a6c2513" ]
[ "python/scripts/intraday-plot.py" ]
[ "import json\nimport sys\nfrom datetime import datetime\n\nimport mplfinance\nimport numpy\nimport pandas\n\n\ndef make_plot(markers, color):\n return mplfinance.make_addplot(markers, type=\"scatter\", alpha=0.8, marker=\"D\", markersize=40, color=color)\n\n\ndef main():\n print(\"Starting Intraday Plotting\"...
[ [ "pandas.read_csv" ] ]
bocai1011/zipline
[ "355fe742c78b0292e1ac7ea2c6215fa20ec5404a" ]
[ "zipline/data/bcolz_daily_bars.py" ]
[ "# Copyright 2015 Quantopian, Inc.\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 ag...
[ [ "pandas.Timestamp", "numpy.nan_to_num", "pandas.DatetimeIndex", "numpy.full", "numpy.iinfo", "numpy.array" ] ]
3lv27/Facial_keypoints_detector
[ "4aa9ea6396ddbcee6d90e03b9cdfd994e2ae52f3" ]
[ "helpers.py" ]
[ "import torch\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# test the model on a batch of test images\ndef netSampleOutput(net, test_loader):\n \n # iterate through the test dataset\n for i, sample in enumerate(test_loader):\n \n # get sample data: images and ground truth keypoints...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.scatter", "numpy.squeeze", "matplotlib.pyplot.subplot", "numpy.transpose", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
KonstantinosAng/KinectPython
[ "cb2c7822dd9ef959230d9488aaa3de8ec1816e08" ]
[ "Gripper/ros_handler.py" ]
[ "\"\"\"\nAuthor: Konstantinos Angelopoulos\nDate: 04/02/2020\nAll rights reserved.\nFeel free to use and modify and if you like it give it a star.\n\nHandles the communication between the ROS API and the Clients.\n\"\"\"\n\n#!/usr/bin/env python\nimport os\n# Import ROS libraries only on Linux\nif os.name == 'nt':\...
[ [ "numpy.arccos", "numpy.cos" ] ]
leo712822/Teng
[ "37166bfa425b0b27fd96c03e0ee635d4b9d7c118" ]
[ "can_interface_add3D.py" ]
[ "\r\nimport sys\r\nfrom PyQt5.QtWidgets import QApplication, QMainWindow,QDialog\r\nfrom PyQt5.QtWidgets import QMessageBox\r\nfrom qwidget import paramui\r\nfrom PyQt5 import QtCore\r\nfrom PyQt5.QtCore import QTimer\r\nfrom qwidget import msgui,paramui\r\nimport re\r\nimport numpy as np\r\nfrom ctypes import *\r\...
[ [ "numpy.minimum", "numpy.sqrt", "numpy.arctan", "matplotlib.pyplot.plot", "numpy.hypot", "numpy.random.randint", "numpy.save", "numpy.sin", "numpy.copy", "matplotlib.pyplot.axis", "numpy.zeros", "numpy.min", "matplotlib.pyplot.ylim", "numpy.fromiter", "nu...
mmckerns/enaml
[ "ebf417b4dce9132bffa038a588ad90436a59d37e" ]
[ "examples/old/chaco/custom_canvas/lotka_volterra.py" ]
[ "#------------------------------------------------------------------------------\n# Copyright (c) 2011, Enthought, Inc.\n# All rights reserved.\n#------------------------------------------------------------------------------\n\"\"\" A Lotka-Volterra model. \n\nThis example plots a non-trivial system and allows th...
[ [ "numpy.arange", "numpy.empty" ] ]
sulabhkatiyar/IC_SCA
[ "b3889711d541b1d2c83ca785643f8392c5026b06" ]
[ "train.py" ]
[ "import time\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nimport torch.utils.data\nimport torchvision.transforms as transforms\nfrom torch import nn\nfrom torch.nn.utils.rnn import pack_padded_sequence\nfrom models import Encoder, DecoderWithAttention_choice\nfrom datasets import *\nfrom utils import ...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.utils.rnn.pack_padded_sequence" ] ]
aby03/Geometric-Reconstruction
[ "aea05fec0332530ecb2986201223b05f3d91633e" ]
[ "Train_Object_Detection/generate_tfrecord.py" ]
[ "\"\"\"\nUsage:\n # From tensorflow/models/\n # Create train data:\n python generate_tfrecord.py --csv_input=data/labels.csv --output_path=train.record --label_map=label.pbtxt --image_path=Database/1_A/labelled_images\n\n # Create test data:\n python generate_tfrecord.py --csv_input=data/labels.csv --output_...
[ [ "tensorflow.app.run", "pandas.read_csv", "tensorflow.python_io.TFRecordWriter" ] ]
mmxsrup/fuzzingbook
[ "a57d1ac940c6bec78ba70f2e1ed04fd87aeeb49e" ]
[ "docs/code/GrammarCoverageFuzzer.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# This material is part of \"The Fuzzing Book\".\n# Web site: https://www.fuzzingbook.org/html/GrammarCoverageFuzzer.html\n# Last change: 2019-12-21 22:21:21+01:00\n#\n#!/\n# Copyright (c) 2018-2020 CISPA, Saarland University, authors, and contributors\n#\n# Permi...
[ [ "matplotlib.ticker.PercentFormatter", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "scipy.stats.spearmanr", "matplotlib.pyplot.axes", "numpy.corrcoef", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
hugobb/Stochastic-Extragradient
[ "69f75f3f47cb2b30cd81db617c994a13b0b5302c", "68e27b1625ed0abec1992c9ab7f15a5313f51856" ]
[ "gamesopt/algorithms/extragradient.py", "gamesopt/games/utils.py" ]
[ "from .algorithm import Algorithm\nfrom .lr_scheduler import BaseLR, LRScheduler\nimport torch\n\n\nclass SEG(Algorithm):\n # The recommended learning rate is 1/L\n def __init__(self, game, lr_e=None, same_sample=False, batch_size=1, full_batch=False, *args, **kwargs):\n super().__init__(game, *args, *...
[ [ "torch.clone" ], [ "torch.svd", "torch.zeros", "torch.randn", "torch.diag_embed", "torch.tensor", "torch.qr", "torch.randint_like", "torch.rand", "scipy.stats.ortho_group.rvs" ] ]
PoschR/simple_dqn_tensorflow
[ "bbaf2b2981dbf57e50def4f761b432ed3d741420" ]
[ "src/deepqnetwork.py" ]
[ "import deep_q_graph as dqg\nimport utils as ut\n\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport logging\nimport mem_top\n\nlogger = logging.getLogger(__name__)\n\nclass DeepQNetwork:\n def __init__(self, num_actions, args):\n # remember parameters\n self.num_actions = num_actions\n self....
[ [ "tensorflow.clip_by_value", "numpy.amax", "tensorflow.InteractiveSession", "tensorflow.train.RMSPropOptimizer", "numpy.clip", "tensorflow.placeholder", "tensorflow.train.AdadeltaOptimizer", "tensorflow.nn.l2_loss", "tensorflow.to_float", "tensorflow.train.AdamOptimizer", ...
nickgerend/EyeintheSky
[ "ed4866925f23ed32a0a6d7bc45d08a5feb6b1ddd" ]
[ "side_link.py" ]
[ "# Written by: Nick Gerend, @dataoutsider\n# Viz: \"Eye in the Sky\", enjoy!\n\nimport pandas as pd\nimport os\n\ndef rescale(x, xmin, xmax, newmin, newmax):\n rescaled = (newmax-newmin)*((x-xmin)/(xmax-xmin))+newmin\n return rescaled\n\ndf_c = pd.read_csv(os.path.dirname(__file__) + '/center_linear.csv')\ndf...
[ [ "pandas.concat" ] ]
Aaronzinhoo/LIP_JPPNet
[ "d0bf9fd3344acb49362b06748a6cbfc953a14bfc" ]
[ "utils/lip_reader.py" ]
[ "import os\n\nimport numpy as np\nimport tensorflow as tf\nimport random\n\nIGNORE_LABEL = 255\nNUM_POSE = 16\nIMG_MEAN = np.array((104.00698793,116.66876762,122.67891434), dtype=np.float32)\n\ndef image_scaling(img, label, heatmap):\n \"\"\"\n Randomly scales the images between 0.5 to 1.5 times the original ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.stack", "tensorflow.image.decode_png", "tensorflow.cast", "tensorflow.train.batch", "tensorflow.to_int32", "tensorflow.boolean_mask", "tensorflow.read_file", "tensorflow.squeeze", "tensorflow.to_float", ...
HackRice8/ADrop
[ "c2487ec0ae7acf39dd50f28e5aaba8f4193ec016" ]
[ "mysite/adrop_main/views.py" ]
[ "from django.shortcuts import render\nfrom django.conf import settings\nfrom django.http import JsonResponse\nfrom django.http import HttpResponse\nfrom pymongo import MongoClient\n\nfrom keras.models import Model, Sequential\nfrom keras.layers import Convolution2D, ZeroPadding2D, MaxPooling2D, Flatten, Dense, Drop...
[ [ "numpy.expand_dims", "numpy.sqrt", "numpy.multiply", "numpy.transpose" ] ]
ChriPiv/qiskit-aer
[ "6225be368addb3ca8c8530d2b625ce9db64a5af5" ]
[ "test/terra/openpulse/test_system_models.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2019.\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 modificatio...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
Moti-H/neuropod
[ "6f3e5862230cecf8b0d0b463eb145f187a398e64", "6f3e5862230cecf8b0d0b463eb145f187a398e64" ]
[ "source/python/neuropod/backends/tensorflow/test/custom_ops/test_tensorflow_custom_ops.py", "source/python/neuropod/tests/utils.py" ]
[ "# Copyright (c) 2020 The Neuropod Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
[ [ "tensorflow.Graph", "tensorflow.sysconfig.get_link_flags", "tensorflow.placeholder", "tensorflow.name_scope", "tensorflow.sysconfig.get_compile_flags", "tensorflow.load_op_library" ], [ "numpy.arange", "numpy.array", "numpy.zeros" ] ]
xtyinzz/curvis
[ "4cb1bc9581e605d5f1054b2dcf4473d592e4fcff" ]
[ "pycurvis/util/utils.py" ]
[ "import gc, sys, psutil, os\r\nfrom torch import is_tensor\r\nimport torch.cuda as tcuda\r\n\r\ndef report_gpumem(device=0):\r\n toGb = 1024*1024*1024\r\n totalm = tcuda.get_device_properties(0).total_memory / toGb\r\n max_alloc = tcuda.max_memory_allocated() / toGb\r\n max_rsv = tcuda.max_memory_reserved() / t...
[ [ "torch.cuda.get_device_properties", "torch.cuda.max_memory_allocated", "torch.is_tensor", "torch.cuda.max_memory_reserved" ] ]
thomasshupeng/CNTK
[ "5226c2c946684fe1a082656aca3de708b4aca7be" ]
[ "Examples/Image/Detection/utils/plot_helpers.py" ]
[ "# Copyright (c) Microsoft. All rights reserved.\n\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\nfrom __future__ import print_function\nfrom builtins import str\nimport ...
[ [ "numpy.round", "numpy.array" ] ]
hz-ants/Pix2Pose
[ "40e0126430a157470f5ef58c8b855969e2bc0676" ]
[ "pix2pose_util/common_util.py" ]
[ "import numpy as np\ndef get_bbox_from_mask(mask):\n vu = np.where(mask)\n if(len(vu[0])>0):\n return np.array([np.min(vu[0]),np.min(vu[1]),np.max(vu[0]),np.max(vu[1])],np.int)\n else:\n return np.zeros((4),np.int)\n" ]
[ [ "numpy.max", "numpy.where", "numpy.zeros", "numpy.min" ] ]
NREL/MPRL
[ "a4c031232a2cbf69a6f9c02b4759714b8a119074" ]
[ "mprl/actiontypes.py" ]
[ "# ========================================================================\n#\n# Imports\n#\n# ========================================================================\nimport sys\nimport numpy as np\nfrom abc import ABC, abstractmethod\nfrom gym import spaces\n\n\n# ===============================================...
[ [ "numpy.array", "numpy.iinfo", "numpy.finfo" ] ]
spatala/gbpy
[ "0250673f42ba2dc31337d08bb668edf8f6b78b7f" ]
[ "gbpy/byxtal/tests/enumerate_sig_rots.py" ]
[ "import byxtal.lattice as gbl;\nimport byxtal.csl_utility_functions as cuf;\nimport numpy as np;\nfrom sympy.matrices import Matrix, eye, zeros;\n\n########################################################\n#### Input Parameters\nfsave = False\nnum = 10\n########################################################\n\n# ...
[ [ "numpy.arange", "numpy.size" ] ]
Karmantez/Titanic_Survivor_Prediction
[ "1dc49f9e27009e09cb2d4a7f2f5cf86a287dd45c" ]
[ "preprocessing.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import LabelEncoder\n\n\n# In[2]:\n\n\ndef process_null_data(df):\n df['Age'].fillna(df['Age'].mean(), inplace=True)\n df['Cabin'].fillna('N', inplace=True)\n df['Embarked'].fillna('...
[ [ "sklearn.preprocessing.LabelEncoder" ] ]
gustavkkk/emotionID
[ "051441345693319f6357b0045141fd19cbfa8fb3" ]
[ "ffnn.py" ]
[ "import numpy as np\r\nimport neurolab as nl\r\nimport config as cfg\r\nimport os\r\nimport os.path\r\n#import math\r\nimport util as utl\r\n#import cv2\r\n\r\nclass FFNN(object):\r\n def __init__(self, traindir='./train/',mode='REAL'):\r\n self.traindir = traindir\r\n self.netname = 'ffnn'\r\n ...
[ [ "numpy.amax", "numpy.fromfile", "numpy.linspace", "numpy.min", "numpy.amin", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
ul1994/dqn-tensorflow-python3
[ "5d2069f80c06dabc30cbb61acac0d74a5f40f20a" ]
[ "dqn/replay_memory.py" ]
[ "\"\"\"Code from https://github.com/tambetm/simple_dqn/blob/master/src/replay_memory.py\"\"\"\n\nimport os\nimport random\nimport logging\nimport numpy as np\n\nfrom .utils import save_npy, load_npy\n\nclass ReplayMemory:\n def __init__(self, config, model_dir):\n self.model_dir = model_dir\n\n self.cnn_form...
[ [ "numpy.empty", "numpy.transpose" ] ]
ArunGautham-Soundarrajan/Semantic_segmentation
[ "8a545668c76308e8d91db84c2c3372c554d7fb8b" ]
[ "inference.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 12 13:08:40 2021\n\n@author: Arun Gautham Soundarrajan\n\"\"\"\n\nimport os\nimport torch\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nfrom evaluation_metrics import *\nfrom models import *\n\ndef inference(model, dataset, num_classes, store = False):...
[ [ "matplotlib.pyplot.gca", "torch.cuda.synchronize", "torch.cuda.Event", "matplotlib.pyplot.subplot", "torch.no_grad", "torch.cuda.is_available", "matplotlib.pyplot.axis", "torch.argmax" ] ]
robertocalandra/the-feeling-of-success
[ "7bb895897e369ae9f5fcaeed61d401e019a9cdf1" ]
[ "manu_sawyer/src/process_data.py" ]
[ "# Compatibility Python 2/3\nfrom __future__ import division, print_function, absolute_import\nfrom builtins import range\n# ----------------------------------------------------------------------------------------------------------------------\n\nfrom dotmap import DotMap\nimport matplotlib.pyplot as plt\nimport nu...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
viktorfa/F033583-project
[ "15cbafd86f97c28847db76e44e3739a8118722b1" ]
[ "indexer/weighing.py" ]
[ "import math\nimport re\nfrom scipy import sparse\nimport numpy as np\n\n\ndef get_weighted_document_matrix(index):\n print(\"Starting to create matrix for index {}\".format(index.get_fields()))\n meta_information = index.get_meta_information()\n result = []\n N = meta_information['num_documents']\n ...
[ [ "numpy.array", "scipy.sparse.csr_matrix" ] ]
gregstarr/ttools
[ "fc8dcbf094370e9885311126724697830167d931" ]
[ "scripts/experiments/mlon_bounds.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom ttools import io, config\n\nplt.style.use('ggplot')\n\nstart_date = np.datetime64(\"2010-01\")\ndate = start_date\nend_date = np.datetime64(\"2020-01\")\ndt = np.timedelta64(6, 'M')\nmlt = config.mlt_grid\nbins = np.arange(-1, 360, 2)\n\nhist_totals = np....
[ [ "numpy.isfinite", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.datetime64", "numpy.timedelta64", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.style.use" ] ]
5hv5hvnk/pymc
[ "c26878f0e262f42bd440d6ff7e42a2e4dd39dfa7" ]
[ "pymc/backends/ndarray.py" ]
[ "# Copyright 2020 The PyMC Developers\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 appli...
[ [ "numpy.concatenate", "numpy.zeros" ] ]
atsu-naga/Carrier-Owl
[ "fd82dcb6a90c893c58b9530ea5b518f27826d4fc" ]
[ "src/carrier-owl.py" ]
[ "import chromedriver_binary # これは必ず入れる\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\nimport os\nimport time\nimport yaml\nimport datetime\nimport numpy as np\nimport textwrap\nfrom bs4 import BeautifulSoup\nimport requests\nfrom fastprogress import progress_bar\nimport sl...
[ [ "numpy.argsort" ] ]
zack-insitro/comptic
[ "95270d350779150f09e78e0f95bfaed7a4c2bbf4", "95270d350779150f09e78e0f95bfaed7a4c2bbf4" ]
[ "comptic/registration.py", "comptic/operators/operators.py" ]
[ "\nimport skimage\nimport skimage.feature\nimport numpy as np\nimport llops as yp\nimport llops.operators as ops\nimport llops.filter as filters\nimport scipy as sp\n\n# Feature-based registration imports\nfrom skimage.feature import ORB, match_descriptors, plot_matches\nfrom skimage.measure import ransac\nfrom ski...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.title", "numpy.invert", "numpy.asarray", "scipy.fftpack.next_fast_len", "numpy.fliplr", "numpy.linalg.norm", "numpy.round", "matplotlib.pyplot.subplot", "numpy.mean", "matplotlib.pyplot.axis", "numpy.fix", "numpy.array...
gigatskhondia/Engineering_Design_by_Artificial_Intelligence
[ "e6001a85491d6fe2cfd9f762a69596ec65c91241" ]
[ "design_by_reinforcement_learning_and_finite_element_analysis/Bionic_partition_MCTS/game.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n@author: Junxiao Song\n\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nfrom utils import match_lines_to_coordinates, checkpoints_visit,has_at_least_two_neighbors,\\\nweight_and_strength_did_not_deteriorate, draw\n\n\nclass Board(object):\n \"\"\"board for th...
[ [ "numpy.array" ] ]
sayakpaul/Distributed-Training-in-TensorFlow-2-with-AI-Platform
[ "1393c01e1e1f9b871e21ef49ea5957b6e18482ec" ]
[ "trainer/tfr_utils.py" ]
[ "from tqdm import tqdm\nimport tensorflow as tf\nimport config\nimport os\n\n\ndef augment(image):\n image = tf.image.random_flip_left_right(image)\n image = tf.image.random_flip_up_down(image)\n\n if tf.random.uniform([], minval=0, maxval=1) < 0.5:\n image = tf.image.rot90(image)\n return image\...
[ [ "tensorflow.io.TFRecordWriter", "tensorflow.image.random_flip_left_right", "tensorflow.cast", "tensorflow.random.uniform", "tensorflow.image.rot90", "tensorflow.image.resize", "tensorflow.train.BytesList", "tensorflow.image.random_flip_up_down", "tensorflow.image.encode_jpeg", ...
azhou125/yfinance
[ "7274e5600e6c8ace1403218b0ecaeb114d2bd671" ]
[ "yfinance/ticker.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Yahoo! Finance market data downloader (+fix for Pandas Datareader)\n# https://github.com/ranaroussi/yfinance\n#\n# Copyright 2017-2019 Ran Aroussi\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in comp...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
YBZh/AuxSelfTrain
[ "6cae3949dbf013f4aa3937861cf437c19de519b0" ]
[ "solver/solver_cc_da.py" ]
[ "import torch\nimport os\nimport math\nimport torch.nn as nn\nimport time\nimport numpy as np\nfrom .base_solver import BaseSolver\nimport torch.nn.functional as F\nfrom utils.utils import AverageMeter, to_cuda, accuracy, weight_ema, to_onehot, EMA_fixmatch, LabelGuessor, fix_bn, \\\n release_bn, get_labels_from...
[ [ "torch.BoolTensor", "torch.max", "torch.cat", "torch.randperm", "torch.load", "torch.no_grad", "torch.FloatTensor", "torch.topk", "torch.nn.CrossEntropyLoss", "torch.norm", "torch.softmax", "numpy.zeros", "torch.LongTensor", "numpy.logspace", "torch.unsq...
TLouf/multiling-twitter
[ "9a39b5b70da53ca717cb74480697f3756a95b8e4" ]
[ "src/data/metrics.py" ]
[ "from scipy.stats import chisquare\nimport numpy as np\nimport pandas as pd\nfrom sklearn.cluster import KMeans\nimport ot\nimport src.visualization.helpers as helpers_viz\nimport src.utils.geometry as geo\n\ndef kl_div(obs, pred):\n '''\n Computes -obs*log(pred/obs), the elements over which one sums to get t...
[ [ "numpy.log", "numpy.sqrt", "numpy.abs", "sklearn.cluster.KMeans", "numpy.broadcast_to", "numpy.flip", "scipy.stats.chisquare", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
microsoft/ExperimentTools
[ "ea9c15899dc787d8fbaf87dc4e9849ec4b28aadc" ]
[ "tests/test_run.py" ]
[ "import os\nimport re\nimport ast\nimport json\nimport time\nimport shutil\nimport datetime\nimport numpy as np\nimport zipfile \n\nimport test_base\nfrom xtlib import pc_utils\nfrom xtlib import utils\nfrom xtlib import errors\nfrom xtlib import console\nfrom xtlib import file_utils\nfrom xtlib.storage.store impor...
[ [ "numpy.random.seed", "numpy.random.choice" ] ]
steeled/solar-tk
[ "2142c8049dd24899932c47ece4de920623e6a42b" ]
[ "solartk/sunpos.py" ]
[ "import datetime\nimport pandas as pd \nfrom helpers import granularity_to_freq\nimport time\nimport numpy as np \n\nrad = np.pi/180\ndEarthMeanRadius = 6371.01\ndAstronomicalUnit = 149597890\n\ndef get_sun_position(start_time=None, end_time=None, granularity=None, latitude=None, longitude=None, sun_position_method...
[ [ "numpy.radians", "numpy.cos", "numpy.sin", "numpy.arctan2", "numpy.tan" ] ]
dariocurreri/bdm
[ "04f1bf9e6f100d0952c5d1c5734976158f04cc1f" ]
[ "script/popolamento_database/fill_personale.py" ]
[ "import numpy as np\nimport pandas as pd\nimport datetime\nimport random\nfrom database_connection import database_connection\nfrom codicefiscale import codicefiscale\n\n\ndef data_random(anno_min, anno_max):\n start_date = datetime.date(anno_min, 1, 1)\n end_date = datetime.date(anno_max, 12, 31)\n time_b...
[ [ "pandas.read_csv", "numpy.random.randint" ] ]
HyeongminMoon/FlowNetPytorch
[ "815a3057313b373956ec68a260dfd3c0453ab3bc" ]
[ "run_inference.py" ]
[ "import argparse\nfrom path import Path\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.functional as F\nimport models\nfrom tqdm import tqdm\n\nimport torchvision.transforms as transforms\nimport flow_transforms\nfrom imageio import imread, imwrite\nimport numpy as np\nfrom util import flow2...
[ [ "torch.cat", "torch.load", "numpy.save", "torch.no_grad", "torch.cuda.is_available", "torch.device" ] ]
TTdeveloping/text_classification
[ "b8e5ae22de6441479151efcd79a8d4899a1b1fd5" ]
[ "DataUtils/Embed.py" ]
[ "# @Author : bamtercelboo\n# @Datetime : 2018/8/27 15:34\n# @File : Embed.py\n# @Last Modify Time : 2018/8/27 15:34\n# @Contact : bamtercelboo@{gmail.com, 163.com}\n\n\"\"\"\n FILE : Embed.py\n FUNCTION : None\n\"\"\"\n\nimport os\nimport sys\nimport time\nimport tqdm\nimport numpy as np\nimport torch\nimpor...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.from_numpy", "numpy.round", "numpy.array", "numpy.sum", "torch.nn.init.xavier_uniform" ] ]
brunoamaia94/Quarentena_Dados
[ "9402ec6223dc15146906f659db05eb1c0b41de97" ]
[ "Aula 02.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd # Imortar a biblioteca \"pandas\"\nimport seaborn as sns # biblioteca para trabalhar com os gráficos\n\n\n### Importar o nome dos filmes ###\nfilmes = pd.read_csv(\"B:\\Programação\\Quarentena_Dados\\dados\\movies.csv\") # Existem outros read: read_pdf,...
[ [ "pandas.read_csv", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
SDRAST/Astronomy
[ "e6ff5e9e4b56c4eda5351d4447ff9dd60d6e5637" ]
[ "orbits3D.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSet of functions using matplotlib to produce 3-dimensional plots of orbits,\nmeridia, radial vectors, annotations, etc.\n\nHeliographic coordinates are the latitude and longitude of a feature on the \nSun's surface. Heliographic latitude is an object's angular distance north or\nso...
[ [ "matplotlib.pyplot.figure" ] ]
microsoft/nxs
[ "b271c0637576084b36bd0bd397a673fb348913b3" ]
[ "apps/vehicle_counting/models/preprocessing/siammask_tracker_nostate_preproc.py" ]
[ "from typing import Dict, Tuple\nimport numpy as np\nimport math\nimport cv2\nfrom nxs_types.model import NxsModel\n\n\nclass AttrDict(dict):\n __getattr__ = dict.__getitem__\n __setattr__ = dict.__setitem__\n\n\nclass Config:\n search_size = 255\n exemplar_size = 127\n base_size = 8\n stride = 8\...
[ [ "numpy.sqrt", "numpy.array_equal", "numpy.tile", "numpy.stack", "numpy.mean", "numpy.hanning", "numpy.array", "numpy.zeros" ] ]
0shelter0/pingpong_action_temporal_generation_based_pytorch
[ "8528aee903fbc770c26ad6509ed0930f21a3cf26" ]
[ "models.py" ]
[ "# -*- coding: utf-8 -*-\nimport math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom encoder import Encoder\n\nclass BMN(nn.Module):\n def __init__(self, opt):\n super(BMN, self).__init__()\n self.tscale = opt[\"temporal_scale\"]\n self.prop_b...
[ [ "torch.Tensor", "torch.randn", "torch.nn.Conv2d", "numpy.stack", "torch.nn.Sigmoid", "torch.matmul", "torch.nn.Conv3d", "torch.nn.Conv1d", "torch.nn.ReLU", "numpy.zeros" ] ]
shayantaherian/Object_Detection_Carla
[ "b6c221f8ddff9c12bf150a6a37652deeba36a432" ]
[ "Object_Detection.py" ]
[ "\r\n# This work is licensed under the terms of the MIT license.\r\n# For a copy, see <https://opensource.org/licenses/MIT>.\r\n\r\n# Allows controlling a vehicle with a keyboard. For a simpler and more\r\n# documented example, please take a look at tutorial.py\r\nfrom __future__ import print_function\r\n\r\n# ====...
[ [ "numpy.reshape", "numpy.dtype", "numpy.argmax", "numpy.array", "numpy.zeros", "numpy.fabs" ] ]
mikesmithlab/Video
[ "7b8b67fde3715b5cbe80d26ff5f6dfbaa04702ca" ]
[ "video/opencv_io.py" ]
[ "import os\nimport cv2\nimport numpy as np\nfrom slicerator import Slicerator\n\nfrom Video import filedialogs as fd\nfrom Video.video.crop_box import crop_box\n\n\n__all__ = [\"WriteVideo\", \"ReadVideo\", \"ReadCropVideo\",]\n\nclass WriteVideo:\n '''\n Class is designed to make writing to video files easy....
[ [ "numpy.uint8", "numpy.size", "numpy.shape" ] ]
zkneupper/fairseq
[ "a2314b4e8a2a769eca073e87cef9e52f0e01ec08" ]
[ "fairseq/distributed/fully_sharded_data_parallel.py" ]
[ "# 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\nimport contextlib\nfrom typing import Optional\n\nimport torch\nfrom fairseq.dataclass.configs import DistributedTrainingConfig\nfro...
[ [ "torch.device" ] ]
TLMichael/Delusive-Adversary
[ "8f033e000d85f93c34ed4a55f020952b240da235" ]
[ "utils.py" ]
[ "import torch\nfrom torchvision import transforms\nimport numpy as np\nimport os\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\nfrom models.vgg import VGG16, VGG19\nfrom models.resnet import ResNet18, ResNet34, ResNet50\nfrom models.densenet import DenseNet121\n\n\ndef set_seed(seed):\n np.random.see...
[ [ "torch.sigmoid", "torch.cuda.manual_seed", "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.round", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "torch.no_grad", "torch.nn.DataParallel", "matplotlib.pyplot.show" ] ]
tanyunshi/gnocchi
[ "ca28902e2dcb295505770d40be45abc5a839f77b" ]
[ "gnocchi/storage/__init__.py" ]
[ "# -*- encoding: utf-8 -*-\n#\n# Copyright © 2016-2018 Red Hat, Inc.\n# Copyright © 2014-2015 eNovance\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.o...
[ [ "numpy.sort" ] ]
zfzackfrost/tfk_scaffold
[ "6c960e76d5993d92b66dad3293b760fc27c10247" ]
[ "tfk_scaffold/datvis/common.py" ]
[ "from typing import Protocol, Optional, Tuple, Any, cast, Union, List\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.figure import Figure\nfrom matplotlib.axes import Axes\n\nimport pandas as pd\nimport numpy as np\n\n\nclass PlotFunctionT(Protocol):\n def __call__(\n self,\n data: Union[pd.Da...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.figure" ] ]
Riley16/vis1d
[ "c39c82aa7c12c602ab1b7e1d393aabace6ec239b" ]
[ "train.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torch.distributions import normal\nNormal = normal.Normal\nfrom torch.distributions import uniform\nUniform = uniform.Uniform\nimport numpy as np\nimport math\nimport os\n\nimport matplotlib.pyplot as plt\n\nfrom models.pre...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.pause", "torch.Tensor", "numpy.linspace", "matplotlib.pyplot.clf", "torch.utils.tensorboard.SummaryWriter", "matplotlib.pyplot.close", "matplotlib.pyplot.show", "torch.nn.MSELoss" ] ]
DeepWolf90/DLSTM
[ "d4f879aa3dc5d12ea5ff6e15648564a25729b06b" ]
[ "case_study_2(indian oil)/DLSTM/oil_static.py" ]
[ "from numpy.random import seed\nseed(1)\n\n\nfrom pandas import DataFrame\nfrom pandas import Series\nfrom pandas import concat\nfrom pandas import read_csv\nfrom pandas import datetime\nfrom sklearn.metrics import mean_squared_error\nfrom sklearn.preprocessing import MinMaxScaler\nfrom keras.models import Sequenti...
[ [ "pandas.read_csv", "pandas.Series", "numpy.random.seed", "numpy.reshape", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.concatenate", "pandas.datetime.strptime", "numpy.insert", "numpy.array", "sklearn.preprocessing.MinMaxScaler" ] ]
keflavich/specutils
[ "ec4fe50c6c032fc421c2cd0ee0dda11fd0f856cb" ]
[ "specutils/io/asdf/tags/spectra.py" ]
[ "\"\"\"\nContains classes that serialize spectral data types into ASDF representations.\n\"\"\"\n\nfrom numpy.testing import assert_allclose\nfrom astropy.units import allclose\nimport astropy.nddata\nfrom asdf.yamlutil import (custom_tree_to_tagged_tree,\n tagged_tree_to_custom_tree)\n\nf...
[ [ "numpy.testing.assert_allclose" ] ]
magluva/INF368
[ "f5010bc0decdb57c6c673f5eaee359adbe8c53fc" ]
[ "LeNet-5/comparison.py" ]
[ "import matplotlib.pyplot as plt\r\nfrom simple import load_training_data as simple_h\r\nfrom LeNet import load_training_data as LeNet_h\r\n\r\n\r\ndef comparison_plot(simple_history, lenet_history):\r\n \"\"\"\r\n :param simple_history: training data (dict)\r\n :param lenet_history: training data (dict)\r...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show" ] ]
sakurusurya2000/OCR
[ "0e9178f64f0a049cb70f6644b265b4d8f372ae9f" ]
[ "handwriting_ocr/ocr/words.py" ]
[ "# Copyright 2020 Břetislav Hájek <info@bretahajek.com>\n# Licensed under the MIT License. See LICENSE for details.\n\"\"\"Detecting bounding boxes of words in the page.\"\"\"\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom handwriting_ocr.ocr.helpers import *\n\n\ndef detection(image, jo...
[ [ "numpy.unique", "numpy.uint8", "numpy.ones", "numpy.copy", "numpy.array", "numpy.zeros", "numpy.hypot" ] ]
knil-sama/pandas
[ "b0f9a104f323d687a56ea878ff78ff005f37b42d" ]
[ "pandas/tests/extension/test_categorical.py" ]
[ "\"\"\"\nThis file contains a minimal set of tests for compliance with the extension\narray interface test suite, and should contain no other tests.\nThe test suite for the full functionality of the array is located in\n`pandas/tests/arrays/`.\n\nThe tests in this file are inherited from the BaseExtensionTests, and...
[ [ "pandas.Categorical", "pandas.api.types.CategoricalDtype", "pandas.Series" ] ]
ssimonc/NeoRL
[ "098c58c8e4c3e43e67803f6384619d3bfe7fce5d", "098c58c8e4c3e43e67803f6384619d3bfe7fce5d" ]
[ "benchmark/d3pe/scripts/eval_ope.py", "benchmark/OfflineRL/offlinerl/config/algo/plas_config.py" ]
[ "import os\nimport json\nimport argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import pearsonr\n\nfrom d3pe.metric.score import RC_score, TopK_score, get_policy_mean\n\nBenchmarkFolder = 'benchmarks'\n \nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n pars...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.figure" ], [ "torch.cuda.is_available" ] ]
pimdh/lie-vae
[ "0e0cc4d533c064fcfc405e8a75449f8b2f6cf8cf" ]
[ "lie_vae/experiments/datasets.py" ]
[ "import re\n\nimport numpy as np\nimport os.path\nfrom glob import glob\n\nimport torch\nfrom PIL import Image\nfrom torch.utils.data import Dataset, TensorDataset\n\nfrom lie_learn.groups.SO3 import change_coordinates as SO3_coordinates\nfrom lie_vae.lie_tools import block_wigner_matrix_multiply, random_quaternion...
[ [ "numpy.random.get_state", "torch.cuda.manual_seed", "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.randn", "numpy.arange", "torch.cat", "torch.tensor", "numpy.random.set_state", "numpy.random.permutation", "torch.stack", "numpy.array", "torch...
TaekedeHaan/skan
[ "36467bda0ddd814a603f3b089031a21b11d7f7b3", "36467bda0ddd814a603f3b089031a21b11d7f7b3" ]
[ "skan/test/test_csr.py", "skan/gui.py" ]
[ "import os, sys\nimport numpy as np\nfrom numpy.testing import assert_equal, assert_almost_equal\nfrom skan import csr\n\nrundir = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(rundir)\n\nfrom skan._testdata import (tinycycle, tinyline, skeleton0, skeleton1,\n skeleton2, ske...
[ [ "numpy.testing.assert_equal", "numpy.random.random", "numpy.sqrt", "numpy.unique", "numpy.testing.assert_almost_equal", "numpy.mean", "numpy.bincount", "numpy.ravel", "numpy.array" ], [ "matplotlib.figure.Figure", "matplotlib.use", "matplotlib.pyplot.figure", ...
JulienFr/h2o-3
[ "1b02cede40a2e445f9a3e588bcba4a4571a55050" ]
[ "h2o-py/h2o/model/model_base.py" ]
[ "# -*- encoding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nimport traceback\n\nimport h2o\nfrom h2o.base import Keyed\nfrom h2o.exceptions import H2OValueError\nfrom h2o.job import H2OJob\nfrom h2o.utils.metaclass import BackwardsCompatible, Deprecat...
[ [ "matplotlib.use", "matplotlib.gridspec.GridSpec", "pandas.DataFrame" ] ]
Napam/INF399-Master-DeepLearning
[ "2f97eae4750ea9766bcad60c26dee9f9a14fafa4" ]
[ "volume/detrbros/fishdetr3d_splitfc.py" ]
[ "import sys \nsys.path.append(\"..\")\n\nfrom typing import Callable, Dict, Iterable, List, Optional, Sequence, Tuple\nimport numpy as np\nimport pandas as pd \nfrom itertools import chain\nfrom numpy.typing import ArrayLike\nfrom torchvision.models import resnet50\nimport torch\nimport torch.nn as nn\nimport torch...
[ [ "torch.cat", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.Linear", "torch.no_grad", "torch.nn.BatchNorm2d", "torch.hub.set_dir" ] ]
planck-npipe/toast-npipe
[ "ca3e92ea3a81a6146e246ec1d0c5bdcaea3b49f2" ]
[ "transfer_function/qml/planck_util.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\nimport healpy as hp\nimport healpy.projaxes as projaxes\nimport healpy.visufunc as visufunc\nimport healpy.rotator as rotator\nimport numpy as np\nimport pylab\nimport os\n\ntry:\n import pyfits\nexcept:\n import astropy.io.fits as pyfit...
[ [ "numpy.logical_not", "numpy.log", "numpy.sqrt", "numpy.arange", "numpy.median", "numpy.tile", "numpy.cos", "numpy.sin", "numpy.setdiff1d", "numpy.append", "numpy.where", "numpy.any", "numpy.digitize", "numpy.zeros", "numpy.sum", "numpy.isclose" ] ]
vidklopcic/NeMo
[ "77f30c5047ef137e97d2cdab090a242419f0f77c" ]
[ "nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "torch.LongTensor", "torch.utils.data.SequentialSampler", "torch.utils.data.RandomSampler", "torch.FloatTensor", "torch.no_grad", "numpy.mean", "numpy.not_equal" ] ]
MeqdadDev/teachable-machine-lite
[ "86cf1a39cb5d0aff2d5e3038cc9ecb67e8637356" ]
[ "teachable-machine-lite/teachable_machine_lite.py" ]
[ "import numpy as np\n\n\nclass TeachableMachineLite(object):\n '''\n Create your TeachableMachineLite object to run your exported AI models using TFLite.\n '''\n __supported_types = ('tflite', 'tensorflowlite', 'TensorFlowLite')\n\n def __init__(self, model_path='model.tflite', labels_file_path='labe...
[ [ "numpy.argpartition" ] ]
gterren/cloud_segmentation
[ "c01558f4488e96f95225a2d010c28b6b43ef8d10" ]
[ "GPC-MPI_segm.py" ]
[ "import pickle, glob, sys, csv, warnings\n\nfrom sklearn.preprocessing import PolynomialFeatures, StandardScaler\nfrom sklearn.metrics import accuracy_score, confusion_matrix, auc, roc_curve\n\nfrom feature_extraction_utils import _load_file, _save_file, _get_node_info\nfrom scipy.stats import multivariate_normal\n...
[ [ "numpy.log", "numpy.sqrt", "numpy.linspace", "numpy.logspace", "numpy.isnan", "numpy.linalg.inv", "numpy.eye", "numpy.linalg.det", "numpy.delete", "scipy.optimize.minimize", "numpy.argmin", "scipy.stats.multivariate_normal", "numpy.exp", "numpy.array", "...
marianotepper/hough-anscombe
[ "282921ecc5b2bc9654b0b9dfd733aa1d5c5e2947", "282921ecc5b2bc9654b0b9dfd733aa1d5c5e2947" ]
[ "houghvst/estimation/estimation.py", "houghvst/tests/test_estimation.py" ]
[ "from collections import namedtuple\nimport sklearn.linear_model as lm\nimport numpy as np\nfrom houghvst.estimation import gat, regions\n\n\ndef compute_score(sigmas, tol):\n x = (sigmas - 1) / tol\n weights = np.exp(-(x ** 2))\n score = np.sum(weights)\n if score > 0:\n sigma_est = np.sum(sigma...
[ [ "sklearn.linear_model.HuberRegressor", "numpy.abs", "numpy.linspace", "numpy.std", "numpy.argmax", "numpy.mean", "numpy.var", "numpy.exp", "numpy.unravel_index", "numpy.sum", "numpy.vstack" ], [ "numpy.array", "numpy.maximum", "numpy.linspace", "matp...
atonderski/patchnet
[ "dd88834a93fe8be380516cdb52f8e9fd634df4c8" ]
[ "lib/models/patchnet.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom einops import rearrange\n\nfrom lib.backbones.plainnet import PlainNet\nfrom lib.backbones.senet import senet18_patchnet as senet\nfrom lib.backbones.resnet import resnet18_patchnet as resnet\nfrom lib.backbones.resnext ...
[ [ "torch.nn.BatchNorm1d", "torch.nn.AdaptiveMaxPool2d", "torch.nn.Dropout", "torch.nn.MultiheadAttention", "torch.Tensor", "torch.cat", "torch.zeros", "torch.zeros_like", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.rand", "torch.where", "torch.nn.ReLU", "t...
zpyzl/adversarial
[ "2a0376e5691c00ff39f5dd3fb496e544c39cb0e8" ]
[ "models/TextCNN_PGD.py" ]
[ "# coding: UTF-8\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom utils import clamp, add_perturbed_labels\n\n\nclass Config(object):\n\n \"\"\"配置参数\"\"\"\n def __init__(self, dataset, embedding):\n self.model_name = 'TextCNN'\n self.train_path = da...
[ [ "torch.nn.Dropout", "torch.nn.functional.cross_entropy", "torch.nn.Conv2d", "torch.nn.Embedding", "torch.nn.Embedding.from_pretrained", "torch.cuda.is_available", "numpy.load" ] ]
DaerusX/jupyterlab-data-visualization
[ "474f915790c4422c3301d3f1e857562f986c77ba" ]
[ "jupyterlab-data-validator/datavalidator/rules/process/number_process_rules.py" ]
[ "# Copyright 2017 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 appl...
[ [ "numpy.asscalar", "numpy.isfinite", "numpy.min", "numpy.isnan", "numpy.median", "numpy.isposinf", "numpy.isneginf", "numpy.max", "numpy.std", "numpy.mean", "numpy.count_nonzero", "numpy.array", "numpy.histogram" ] ]
LFhase/Learning_CS224N
[ "21af6dd4f7b9dcb3f34aac9c2cebf4a02a17176f" ]
[ "Homework/a2/word2vec.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport random\n\nfrom utils.gradcheck import gradcheck_naive\nfrom utils.utils import normalizeRows, softmax\n\n\ndef sigmoid(x):\n \"\"\"\n Compute the sigmoid function for the input here.\n Arguments:\n x -- A scalar or numpy array.\n Return:\n s -- ...
[ [ "numpy.log", "numpy.random.seed", "numpy.matmul", "numpy.random.randn", "numpy.exp", "numpy.zeros" ] ]
rbertran/eraser
[ "ae9f51496fe05294a044b9860b5179c3bedad26a" ]
[ "serminer/src/gen_ser_stressmark_riscv.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport sys\nimport csv\nimport numpy as np\nimport string\nimport random\nimport os\nimport os.path\nimport subprocess as sp\nfrom collections import defaultdict\nimport pdb \nfrom num...
[ [ "numpy.zeros", "numpy.sum" ] ]
bu-vip/UROP_SinglePixelLocalization
[ "f65f9ab8627efa7e2a717b0c8696938e5efabbaf" ]
[ "src/main/python/tensorflow/nn.py" ]
[ "from __future__ import print_function\n\nimport random\n\nimport tensorflow as tf\nimport numpy as np\n\n\nclass Regressor():\n def __init__(self, input_dim, out_dim, hidden_layers, learning_rate=0.01):\n self.graph = tf.Graph()\n self.learning_rate = learning_rate\n self.input_dim = input_...
[ [ "tensorflow.nn.relu", "tensorflow.Graph", "tensorflow.matmul", "tensorflow.reduce_mean", "tensorflow.pow", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.square", "tensorflow.set_random_seed", "tensorflow.train.Ada...
paulozk/Airbnb
[ "f4b4d9c952728085b2afa01679fe8d0595ba7b9a" ]
[ "preprocessing/data_preprocessing.py" ]
[ "import pandas as pd\nimport pdpipe as pdp\nimport numpy as np\nimport sys\nimport time\nfrom scipy.stats import mode\nfrom sklearn.decomposition import PCA\n\n# define a custom adhocstage subclass that allows for easy argument passing to transform function\nclass AdHogStageArg(pdp.AdHocStage):\n \"\"\"An ad-hoc...
[ [ "pandas.concat", "pandas.read_csv", "numpy.where", "sklearn.decomposition.PCA", "pandas.get_dummies" ] ]
etri-city-traffic-brain/visual-analytics-system
[ "feb63f3fcae2ca52acb720e7ebf74340709702d9" ]
[ "traj_predict/fmm/traj_recover.py" ]
[ "import os\r\nimport json\r\nfrom datetime import datetime\r\nimport pandas as pd\r\nimport geopandas as gpd\r\nfrom shapely.geometry import Point\r\nfrom shapely.geometry.polygon import Polygon\r\n\r\ntimestamp_step = 3600\r\n\r\nedge_shape = gpd.read_file(\"./network-new/edges.shp\")\r\nnode_shape = gpd.read_file...
[ [ "pandas.HDFStore", "pandas.DataFrame" ] ]
GuillaumeAI/gia-pytorch-CycleGAN-and-pix2pix
[ "cc3378aefde1e296d6827a48ed62711bf2eef47b" ]
[ "scripts/eval_cityscapes/evaluate.py" ]
[ "import os\r\nimport caffe\r\nimport argparse\r\nimport numpy as np\r\nimport scipy.misc\r\nfrom PIL import Image\r\nfrom util import segrun, fast_hist, get_scores\r\nfrom cityscapes import cityscapes\r\n\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument(\"--cityscapes_dir\", type=str, required=True, hel...
[ [ "numpy.zeros" ] ]
zackdilan/crypto-sentiment-index
[ "e647be730f982465dfbf77b42be1b9fb204c0c90" ]
[ "src/data/others.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Getting Dataseries of Other Features\n\nThis module defines the functions that download the dataseries of: crypto\ndaily (global, market-aggregated) trading volume, Google Trends, Financial\nTimes headlines related to cryptocurrencies.\n\"\"\"\n# Get trading volume\nimport pandas as p...
[ [ "pandas.Timestamp", "pandas.read_csv", "pandas.DataFrame" ] ]
ZJUCAGD/GTS-CNN
[ "a329f314b795f0dea0f46db623ac955a47619e7d" ]
[ "data/shapenet.py" ]
[ "import os\nimport json\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nfrom utils.augmentation import *\n\n\nclass ShapeNetDataset(data.Dataset):\n def __init__(self,\n root,\n point_nums=2048,\n split='train',\n argumentation=T...
[ [ "numpy.random.choice", "numpy.random.shuffle", "torch.tensor", "numpy.load", "numpy.array", "numpy.loadtxt" ] ]
cauliyang/tools-compare
[ "d03b0bb73ffd876338553b0863990751028acf61", "d03b0bb73ffd876338553b0863990751028acf61" ]
[ "workflow/scripts/es_stat.py", "workflow/scripts/spladder.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Yangyangli\n@contact: li002252@umn.edu\n@version: 0.0.1\n@license: MIT Licence\n@file: es_stat.py\n@time: 03/08/2021 21:20\n\"\"\"\nimport pandas as pd\nimport sys\nfrom pathlib import Path\n\n\ndef find_genes(dir, file_name=\"event_annotation.tsv...
[ [ "pandas.read_table", "pandas.concat", "pandas.DataFrame" ], [ "pandas.read_csv" ] ]
gandersen101/spaCy
[ "109849bd311490f17a29b320cb032e43d153f36f" ]
[ "spacy/tests/lang/en/test_noun_chunks.py" ]
[ "# coding: utf-8\nfrom __future__ import unicode_literals\n\nimport numpy\nfrom spacy.attrs import HEAD, DEP\nfrom spacy.symbols import nsubj, dobj, amod, nmod, conj, cc, root\nfrom spacy.lang.en.syntax_iterators import SYNTAX_ITERATORS\n\nimport pytest\n\n\nfrom ...util import get_doc\n\n\ndef test_noun_chunks_is_...
[ [ "numpy.asarray" ] ]
tbbharaj/pywt
[ "9a72143be347481e2276371efb41ae0266b9c808" ]
[ "demo/wp_2d.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom pywt import WaveletPacket2D\nimport pywt.data\n\n\narr = pywt.data.aero()\n\nwp2 = WaveletPacket2D(arr, 'db2', 'symmetric', maxlevel=2)\n\n# Show original figure\nplt.imshow(arr, interpolation=\"nearest\",...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.figure" ] ]
sosia-dev/sosia
[ "d4d2d5edb0cd1d085b5a457eb6d19bf8e9fea7f5" ]
[ "sosia/establishing/tests/test_fields_sources.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Tests for establishing.fields_sources module.\"\"\"\n\nfrom os import remove\n\nimport pandas as pd\nfrom nose.tools import assert_equal, assert_true\n\nfrom sosia.establishing.constants import FIELDS_SOURCES_LIST, SOURCES_NAMES_LIST\nfrom sosia.establishing.fields_sources import cre...
[ [ "pandas.read_csv" ] ]
trassir/GANsNRoses
[ "4f82df671d6244eac6902e72a4f981953f28cf88" ]
[ "model.py" ]
[ "import torchvision\nimport math\nimport random\nimport functools\nimport operator\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.autograd import Function\n\nfrom op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d\nn_latent = 11\n\n\nchannels = {\n 4: 512,\n 8: 512,...
[ [ "torch.nn.functional.conv_transpose2d", "torch.nn.Sequential", "torch.mean", "torch.Tensor", "torch.cat", "torch.zeros", "torch.randn", "torch.nn.functional.conv2d", "torch.nn.ModuleList", "torch.nn.Flatten", "torch.tensor", "torch.nn.functional.leaky_relu", "to...
limash/python_snippets
[ "25acf6d918c1d45666877b16c8e5286cf1672e6b" ]
[ "models_and_layers/multihead_attention.py" ]
[ "import numpy as np\nfrom tensorflow import keras\n\nK = keras.backend\n\n\nclass MultiHeadAttention(keras.layers.Layer):\n def __init__(self, n_heads, causal=False, use_scale=False, **kwargs):\n self.n_heads = n_heads\n self.causal = causal\n self.use_scale = use_scale\n super().__in...
[ [ "tensorflow.keras.layers.Conv1D", "numpy.random.rand", "tensorflow.keras.layers.Attention" ] ]
ne1199/RobustAutoencoder
[ "01de32f5d670280ca8f8f9a6f6d704930fc266b4", "01de32f5d670280ca8f8f9a6f6d704930fc266b4", "01de32f5d670280ca8f8f9a6f6d704930fc266b4" ]
[ "model/SparseModels/RobustKLSparseAutoencoder.py", "model/SparseModels/Robustl1SparseAutoencoder.py", "data/ImShow.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport KLSparseAutoencoder as sdae\nimport sys\nsys.path.append(\"../\")\nfrom shrink import l21shrink as SHR\n\nclass Robust_KL_SparseAutoencder():\n \"\"\"\n @author: Chong Zhou\n modified: 02/12/2018\n Des:\n X = L + S\n L is a non-linearly ...
[ [ "numpy.load", "numpy.array", "numpy.zeros", "tensorflow.Session" ], [ "numpy.load", "numpy.array", "numpy.zeros", "tensorflow.Session" ], [ "numpy.zeros" ] ]
CodeCrawl/deep_learning
[ "3f9c208bba5ee17b4b68be74dc10e43839b4f6d0" ]
[ "models/LeNet_5/model.py" ]
[ "##\n## A Modern implementatio of Yann Lecun's LeNet-5 Convolutional Network\n## The overall architecture here is the same, but we've made some changes \n## to make LeNet-5 follow modern practices a little more closely:\n##\n## 1. Activation functions immediately follow conv layers, not pooling layers. \n## 2. Our ...
[ [ "tensorflow.layers.conv2d", "tensorflow.nn.softmax", "tensorflow.reshape", "tensorflow.cast", "tensorflow.layers.dense", "tensorflow.losses.softmax_cross_entropy", "tensorflow.summary.merge_all", "tensorflow.train.AdamOptimizer", "tensorflow.layers.average_pooling2d", "tens...
jolks/tfx
[ "76d8731cb54be3451e10d270d8bcb0589401135f" ]
[ "tfx/extensions/google_cloud_ai_platform/trainer/executor_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\...
[ [ "tensorflow.test.main" ] ]
dw-dengwei/ALBEF
[ "a0130d769a30b8ec200aa887a49ea1b2fcda95d6" ]
[ "dataset/__init__.py" ]
[ "import torch\nfrom torch.utils.data import DataLoader\nfrom torchvision import transforms\nfrom PIL import Image\n\nfrom dataset.caption_dataset import re_train_dataset, re_eval_dataset, pretrain_dataset\nfrom dataset.nlvr_dataset import nlvr_dataset\nfrom dataset.ve_dataset import ve_dataset\nfrom dataset.vqa_dat...
[ [ "torch.stack", "torch.utils.data.DataLoader", "torch.utils.data.DistributedSampler", "torch.Tensor" ] ]
cdeafit/ds-squads
[ "7419bc65ce7925834f6d9693fe3600b90c63eb63" ]
[ "backend/career/backend/views.py" ]
[ "# from django.shortcuts import render\nfrom rest_framework.response import Response\nfrom azure.ai.formrecognizer import FormRecognizerClient\nfrom azure.core.credentials import AzureKeyCredential\n# import json\nfrom rest_framework import viewsets, status, generics\nimport tensorflow as tf\nfrom tensorflow.contri...
[ [ "tensorflow.contrib.predictor.from_saved_model", "tensorflow.train.FloatList", "tensorflow.train.Features" ] ]
sgttwld/BMA
[ "1c0c5fdf148570314ca394e56bfda230c32bb58b" ]
[ "modules/BMA_support.py" ]
[ "import numpy as np\nfrom BMA_sysconfig import *\n\ntry:\n import networkx as nx\n import matplotlib.pyplot as plt\nexcept:\n print(\"could not import networkx and/or/ mpl\")\n\n\nclass Dist(object):\n\n def __init__(self,val=0,r=[]):\n self.val = val\n self.r = r\n\n def initialize(sel...
[ [ "numpy.log", "numpy.einsum", "matplotlib.pyplot.subplots", "matplotlib.pyplot.get_cmap", "numpy.shape", "numpy.random.rand", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "numpy.unravel_index" ] ]
Yuran-Zhao/THUMT
[ "10f0433c1f2fe3f992d26ccb6f4f8dec457ce695", "10f0433c1f2fe3f992d26ccb6f4f8dec457ce695", "10f0433c1f2fe3f992d26ccb6f4f8dec457ce695" ]
[ "thumt/scripts/convert_checkpoint.py", "thumt/scripts/average_checkpoints.py", "thumt/modules/recurrent.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright 2017-2020 The THUMT Authors\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport sys\n\nimport numpy as np\nimport tensorflow as tf\nimport torch\n\n\ndef convert_te...
[ [ "numpy.split", "torch.tensor", "tensorflow.train.list_variables", "tensorflow.train.load_checkpoint", "torch.save" ], [ "torch.load" ], [ "torch.sigmoid", "torch.nn.init.uniform_", "torch.cat", "torch.nn.init.constant_", "torch.zeros", "torch.reshape", "...
Eduardof0nt/Miniproyecto-Sistemas-de-Vision
[ "2947334328b4049aebc328a3015a613f55c5613f" ]
[ "miniproyecto.py" ]
[ "import tkinter as tk\nfrom tkinter import *\nimport tkinter.filedialog\n\nimport matplotlib\nfrom matplotlib.pyplot import imshow\nimport matplotlib.pyplot as plt\n\nimport numpy as np\n\nfrom skimage import io\nfrom skimage.color import rgb2grey\nfrom skimage.filters import gaussian\nimport skimage.feature\n\nfro...
[ [ "numpy.abs", "numpy.power", "matplotlib.pyplot.subplots", "numpy.zeros_like", "matplotlib.pyplot.close", "numpy.array", "numpy.sum", "matplotlib.pyplot.show" ] ]
DVRodri8/pysd
[ "e445d5e636f8793067a501f12a3c45ff858d9a67" ]
[ "pysd/py_backend/functions.py" ]
[ "\"\"\"\nfunctions.py\n\nThese are supports for functions that are included in modeling software but have no\nstraightforward equivalent in python.\n\n\"\"\"\n\nfrom __future__ import division, absolute_import\nfrom functools import wraps\n\nimport pandas as pd\n\nimport pandas as _pd\nimport numpy as np\nfrom . im...
[ [ "numpy.log", "numpy.arange", "pandas.DataFrame", "numpy.random.normal", "numpy.append", "numpy.interp", "numpy.random.uniform", "numpy.roll", "numpy.array", "numpy.where", "scipy.stats.truncnorm.rvs" ] ]
agave233/PaddleHelix
[ "6e082f89b8090c3c360593d40a08bffc884165dd" ]
[ "apps/drug_target_interaction/moltrans_dti/util_function.py" ]
[ "# Copyright (c) 2021 PaddlePaddle 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 ...
[ [ "pandas.concat", "pandas.read_csv", "numpy.asarray", "numpy.isnan", "numpy.log10", "numpy.array", "numpy.where" ] ]
martinsadw/evolutionary-computation
[ "2127aa67d287ec8d26e6d26e1528a0db1f320a61", "2127aa67d287ec8d26e6d26e1528a0db1f320a61" ]
[ "process/extremes.py", "experiments/001_dominance_comparison.py" ]
[ "import numpy as np\n\nfrom acs.objective import reduce_objectives\nfrom utils.multiobjective import sort_nondominated\nfrom read.algorithm import open_results, get_results_name, get_results_best_all_objectives\n\n\n'''\nGerar o ponto de referencia para o hipervolume\n Para cada (instancia, estudante)\n Pior ...
[ [ "numpy.concatenate", "numpy.amax", "numpy.apply_along_axis", "numpy.maximum" ], [ "numpy.array", "numpy.zeros" ] ]
akrherz/pyIEM
[ "ec0acdc4c6b507b0d558ce216d4bbdbcb9b2f364" ]
[ "src/pyiem/nws/products/ero.py" ]
[ "\"\"\"\nEh, I am able to parse the SPC PTS now, so why not add more pain.\n\nWeather Prediction Center Excessive Rainfall Outlook.\n\"\"\"\nimport re\nimport datetime\nimport tempfile\nimport math\n\nfrom shapely.geometry import (\n MultiPolygon,\n)\n\nfrom metpy.units import units\n\n# Local\nfrom pyiem.refere...
[ [ "matplotlib.pyplot.close", "matplotlib.pyplot.figure" ] ]
cloudbopper/feature-importance-analysis
[ "7f03e4413d1e42e9265d790cb64c41f34dbea5ab" ]
[ "mihifepe/master.py" ]
[ "\"\"\"\nmihifepe master pipeline\nGiven test samples, a trained model and a feature hierarchy,\ncomputes the effect on the model's output loss after perturbing the features/feature groups\nin the hierarchy.\n\"\"\"\n\nimport argparse\nimport csv\nimport os\nimport sys\nfrom unittest.mock import patch\n\nimport any...
[ [ "numpy.random.RandomState", "numpy.mean" ] ]
pooya-mohammadi/deep_utils
[ "b589d8ab0a8d63f3d3b90c3bc0d4b1b648b8be37", "b589d8ab0a8d63f3d3b90c3bc0d4b1b648b8be37" ]
[ "deep_utils/utils/dir_utils/main.py", "deep_utils/vision/object_detection/yolo/v5/torch/utils_/datasets.py" ]
[ "import os\nfrom pathlib import Path\nimport shutil\nfrom os.path import join\nfrom typing import Tuple, List, Dict, Union\nfrom deep_utils.utils.utils.logging_ import value_error_log, log_print\nfrom deep_utils.utils.os_utils.os_path import split_extension\n\n\ndef transfer_directory_items(in_dir, out_dir, transfe...
[ [ "sklearn.model_selection.train_test_split" ], [ "torch.zeros", "torch.cat", "numpy.flipud", "numpy.concatenate", "numpy.all", "torch.utils.data.distributed.DistributedSampler", "numpy.clip", "numpy.fliplr", "numpy.arange", "numpy.unique", "torch.from_numpy", ...
Rickard-Martensson/gpt2-2
[ "eb28f215af835cafdd946e3072547843ab5cdd23" ]
[ "src/generate_longinput_samples.py" ]
[ "#!/usr/bin/env python3\n\nimport fire\nimport json\nimport os\nimport numpy as np\nimport tensorflow as tf\n\nimport model\nimport sample\nimport encoder\n\nraw_text = \"\"\"Kommentar: My son does not know his way around the house. He really needs his face transforming.\nKommentar: Got it , we have to transform h...
[ [ "tensorflow.Graph", "numpy.random.seed", "tensorflow.placeholder", "tensorflow.set_random_seed", "tensorflow.train.Saver" ] ]
tfroehlich82/Ryven
[ "a11e361528d982a9dd3c489dd536f8b05ffd56e1" ]
[ "Ryven/packages/linalg/matrix_widget.py" ]
[ "from NWENV import *\n\nfrom qtpy.QtWidgets import QTextEdit\n# from qtpy.QtCore import ...\nfrom qtpy.QtGui import QFontMetrics, QFont\n\nimport numpy as np\n\n\nclass MatrixWidget(QTextEdit, MWB):\n def __init__(self, params, base_width=50, base_height=50):\n MWB.__init__(self, params)\n QTextEdi...
[ [ "numpy.around" ] ]