repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
IRASatUC/two_loggers
[ "c5c99868a9c896aa2fdb940f2f7b7173abed9e00" ]
[ "loggers_control/scripts/envs/solo_escape_task_env.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nTask environment for single logger escaping from the walled cell\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\nfrom numpy import pi\nfrom numpy import random\nimport time\n\nimport rospy\nimport tf\nfrom std_srvs.srv import Empty\n...
[ [ "numpy.random.uniform", "numpy.absolute", "numpy.zeros" ] ]
ArielMAJ/Data-Science-and-Machine-Learning_Bootcamp
[ "afae685c96d9fc8af0b2ee1be4d817df505c6c8d" ]
[ "Section_05/01_Boston/load.py" ]
[ "import urllib\nimport numpy as np\nimport pandas as pd\n\ndef boston():\n\tdata_url = \"http://lib.stat.cmu.edu/datasets/boston\"\n\n\traw_df = pd.read_csv(data_url, sep=\"\\s+\", skiprows=22, header=None)\n\tdata = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])\n\ttarget = raw_df.values[1::2, 2]\n\n\...
[ [ "numpy.hstack", "pandas.read_csv", "pandas.DataFrame" ] ]
nielsleadholm/DelayLineObjectCoding
[ "f0fc07476db6bceb0c69060a9fe0411611708967" ]
[ "analyse_sim_results.py" ]
[ "from brian2 import *\nimport copy\nimport json\nimport numpy as np\nimport os\nimport yaml\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\nimport scipy\n\ndef exclude_indices(input_array, excluding_indices):\n\t\n\tinput_array = np.ma.array(input_array, mask=False)\n\tinput_array.mask...
[ [ "numpy.take_along_axis", "numpy.amax", "matplotlib.pyplot.legend", "numpy.asarray", "numpy.all", "numpy.mean", "numpy.ma.array", "scipy.stats.spearmanr", "numpy.var", "pandas.melt", "numpy.divide", "numpy.clip", "numpy.arange", "numpy.std", "numpy.insert...
marydlawyer/beneficiary-fhir-data
[ "3e28017ed2bff6e03028da2f41bc368cab946c62" ]
[ "ops/ccs-ops-misc/synthetic-data/scripts/outpatient/convert_outpatient_claims_csv_file_to_rif.py" ]
[ "import csv\nimport sys\nfrom numpy.random import choice\n\n\n'''\nThis tool was used for remapping and formatting the files provided for\nsynthetic outpatient data in the keybase directory:\n\n /keybase/team/oeda_bfs/team/synthetic-data/outpatient-claims\n\n The following command line is accepted:\n\n $1 ...
[ [ "numpy.random.choice" ] ]
GobySoft/pyifcb
[ "f465329e720c826069cdd02b55e35d780f24a3d5" ]
[ "ifcb/data/identifiers.py" ]
[ "\"\"\"\nSupport for parsing IFCB permanent identifiers (a.k.a., pids).\n\"\"\"\n\nimport re\n\nfrom functools import lru_cache\nimport pandas as pd\n\n### parsing\n\n# supports time-like regexes e.g., IFCB9_yyyy_YYY_HHMMSS\n@lru_cache()\ndef timestamp2regex(pattern):\n \"\"\"\n Convert a special \"timestamp\...
[ [ "pandas.to_datetime" ] ]
dangpzanco/pytorch-lightning
[ "d70ac99f8cc05f3504cad596440b2670926b01e5" ]
[ "pytorch_lightning/trainer/evaluation_loop.py" ]
[ "\"\"\"\nValidation loop\n===============\n\nThe lightning validation loop handles everything except the actual computations of your model.\nTo decide what will happen in your validation loop, define the `validation_step` function.\nBelow are all the things lightning automates for you in the validation loop.\n\n.. ...
[ [ "torch.set_grad_enabled" ] ]
jtpils/optimesh
[ "24a8276235b1f4e86f2fb92cf814bf81e7fdbc48" ]
[ "test/test_cpt.py" ]
[ "import numpy\nimport pytest\n\nfrom meshes import pacman, simple0, simple1, simple2, simple3\nfrom optimesh import cpt\n\n\n@pytest.mark.parametrize(\n \"mesh, ref\",\n [(simple0, 5.0 / 18.0), (simple1, 17.0 / 60.0), (pacman, 7.320400634147646)],\n)\ndef test_energy(mesh, ref):\n X, cells = mesh()\n en...
[ [ "numpy.linalg.norm" ] ]
galyalina/mmdetection
[ "6906a7afccb569831099df4dc1b1568e184b5ba4" ]
[ "mmdet/models/backbones/mobilenet_v2.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport warnings\n\nimport torch.nn as nn\nfrom mmcv.cnn import ConvModule\nfrom mmcv.runner import BaseModule\nfrom torch.nn.modules.batchnorm import _BatchNorm\n\nfrom ..builder import BACKBONES\nfrom ..utils import InvertedResidual, make_divisible\n\n\n@BACKBONES....
[ [ "torch.nn.Sequential" ] ]
HeshamMeneisi/AnnaPacman
[ "8055b56efb12a16c2dc3694e59760815bcecb970" ]
[ "env_test.py" ]
[ "import numpy as np\nimport time\nimport sys\n\nprint(\"## Checking Keras\\n\\n\")\nimport keras.backend as K\nbackend = K.backend()\n\nvlen = 10 * 30 * 768\niters = 1000\nv = np.random.rand(vlen)\ntv = np.exp(v)\n\n\nif backend == 'theano':\n print(\"\\n\\n## Checking Theano\\n\\n\")\n import theano\n fro...
[ [ "tensorflow.device", "tensorflow.constant", "tensorflow.python.client.device_lib.list_local_devices", "numpy.asarray", "tensorflow.exp", "tensorflow.ConfigProto", "numpy.random.rand", "numpy.exp" ] ]
nitinagarwal/style_clustering
[ "b9f2b00df37c11111313ce27246b065b0e22b069" ]
[ "utils/data_prep_util.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport sys\nimport math\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.init import xavier_normal, xavier_uniform\n\nfrom plyfile import (PlyData, PlyElement)\n\n# ----------------...
[ [ "numpy.dot", "numpy.min", "torch.nn.init.xavier_normal", "numpy.cos", "numpy.stack", "numpy.sin", "numpy.max", "numpy.mean", "numpy.shape", "numpy.random.randn", "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
dany-nonstop/haystack
[ "5ef59b1901da6d51bfa085683321a243228d4fc9" ]
[ "haystack/database/elasticsearch.py" ]
[ "import json\nimport logging\nimport time\nfrom string import Template\nfrom typing import List, Optional, Union, Dict, Any\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch.helpers import bulk, scan\nimport numpy as np\n\nfrom haystack.database.base import BaseDocumentStore, Document, Label\nfrom haysta...
[ [ "numpy.median", "numpy.mean" ] ]
AndreCNF/Deep_Q_Learning_Flappy_Compass
[ "47992d770bd81a6e3be18f76ab4c4558b5e23333" ]
[ "train.py" ]
[ "import argparse # Allows parsing arguments in the command line\nimport os # os handles directory/workspace changes\nfrom random import random, randint, sample # Handles random operations\nfrom comet_ml import Experim...
[ [ "torch.max", "torch.cuda.manual_seed", "torch.cat", "torch.manual_seed", "torch.argmax", "torch.sum", "torch.from_numpy", "torch.cuda.is_available", "numpy.array", "torch.nn.MSELoss", "torch.save" ] ]
dido1998/CausalMBRL
[ "2c595988b06b3d568fdde53213029e97841acb03" ]
[ "eval.py" ]
[ " \nimport argparse\nimport torch\nimport pickle\nfrom pathlib import Path\n\nfrom torch.utils import data\nimport numpy as np\n\nfrom cswm import utils\nfrom cswm.models.modules import CausalTransitionModel, CausalTransitionModelLSTM\nfrom cswm.utils import OneHot\n\ntorch.backends.cudnn.deterministic = True\n\npa...
[ [ "numpy.random.seed", "torch.cuda.manual_seed", "torch.load", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.cuda.is_available", "torch.device" ] ]
daifengwanglab/deepalignomics
[ "e644b565d5d295769f246420a90eff18fd3f15d6" ]
[ "deepManReg/viz.py" ]
[ "''' adapted from https://github.com/all-umass/ManifoldWarping '''\n\nfrom matplotlib import pyplot\n\n\n# def show_alignment(X,Y,title=None,marker='o-',legend=True):\n# '''plot two data sets on the same figure'''\n# dim = X.shape[1]\n# assert dim == Y.shape[1], 'dimensionality must match'\n# assert dim in ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.gca", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot" ] ]
qiskit-community/lindbladmpo
[ "e5d07fc2ce226b19e831d06334e33afb8d131e33" ]
[ "lindbladmpo/examples/simulation_building/operators.py" ]
[ "# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or derivative works of this code must retain this\n# copyright notic...
[ [ "numpy.identity", "numpy.kron", "numpy.zeros" ] ]
sharanry/UncertaintyQuantification
[ "dab4e6176798451edbbe8f2e681b45a2d00709e3" ]
[ "asymptotic_analysis.py" ]
[ "import os\n\nimport argparse\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as onp\nimport jax.numpy as np\nimport jax.random as random\nfrom jax import vmap\nfrom jax.config import config as jax_config\nimport numpyro.distributions as dist\nfrom numpyro.handlers import seed, substitute, trace\n...
[ [ "sklearn.utils.shuffle", "matplotlib.pyplot.cla", "numpy.arange", "numpy.percentile", "matplotlib.pyplot.clf", "matplotlib.pyplot.setp", "matplotlib.pyplot.close" ] ]
kathyatskiv/Background-remover-Back-end
[ "cb9c2273594c158c604e2fc08f0954b866dadf9c" ]
[ "model/u2net.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass REBNCONV(nn.Module):\n def __init__(self,in_ch=3,out_ch=3,dirate=1):\n super(REBNCONV,self).__init__()\n\n self.conv_s1 = nn.Conv2d(in_ch,out_ch,3,padding=1*dirate,dilation=1*dirate)\n self.bn_s1 = nn.BatchNorm2d(...
[ [ "torch.nn.functional.upsample", "torch.cat", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.functional.sigmoid", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
Denesh1998/pytorch-a2c-ppo-acktr-gail
[ "fc187845a4c562cbf9b2b2b3afb19b4fdda07a90" ]
[ "a2c_ppo_acktr/arguments.py" ]
[ "import argparse\n\nimport torch\n\n\ndef get_args():\n parser = argparse.ArgumentParser(description='RL')\n parser.add_argument(\n '--algo', default='a2c', help='algorithm to use: a2c | ppo | acktr')\n parser.add_argument(\n '--gail',\n action='store_true',\n default=False,\n ...
[ [ "torch.cuda.is_available" ] ]
gchhablani/code-soup
[ "eec666b6cd76bad9c7133a185bb85021b4a390f0" ]
[ "code_soup/common/vision/models/simple_cnn_classifier.py" ]
[ "\"\"\"Implements a simple CNN Classifier model\"\"\"\n\nimport torch.nn as nn\n\n\nclass SimpleCnnClassifier(nn.Module):\n def __init__(self, input_shape=(1, 28, 28), num_labels=10):\n super().__init__()\n self.num_channels = input_shape[0]\n self.image_size = input_shape[1:]\n self....
[ [ "torch.nn.Conv2d", "torch.nn.Flatten", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.ReLU" ] ]
dpetrovykh/FIAR
[ "45bca950184ea87399f4630bb601b2fccf8795f9" ]
[ "FIAR_Analyzer.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Feb 7 12:26:54 2021\n\n@author: dpetrovykh\n\"\"\"\n\nimport matplotlib.pyplot as plt\nplt.ion()\n## TODO\n## Make sure that ion() and ioff() when neccessary.\nimport numpy as np\nimport pandas as pd\nfrom collections import namedtuple\nimpor...
[ [ "numpy.dot", "pandas.concat", "pandas.DataFrame", "numpy.ones", "numpy.array", "matplotlib.pyplot.ion" ] ]
Aoi-hosizora/UNet-pytorch
[ "96951d5d1fdc6c6266a11e1bd97fbf72010bc87d" ]
[ "unet.py" ]
[ "import argparse\nimport time\nimport os\nimport json\nfrom PIL import Image\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\n\nfrom model import UNet, loss_fn\nfrom dat...
[ [ "matplotlib.pyplot.imsave", "torch.load", "torch.utils.data.DataLoader", "matplotlib.pyplot.plot", "torch.cuda.is_available", "numpy.zeros" ] ]
poppin-mice/ShiftAddNet
[ "a17369a50da5bba6250fdeac7c065bd00f293f3c" ]
[ "models/wideres_shift.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nimport sys\nimport numpy as np\nfrom adder import adder\n# from models import adder\n\n__all__ = ['wideres_shift']\n\ndef conv3x3(in_planes, out_planes, stride=1, quantize=Fals...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "numpy.sqrt", "torch.nn.init.constant_", "torch.randn", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.BatchNorm2d" ] ]
ps789/torchkit
[ "7bbe19c1b0f709097417bd4277f7b7f1e7fb79a3" ]
[ "torchkit/gradient_estimator.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Nov 4 21:41:42 2018\n\n@author: chin-weihuang\n\"\"\"\n\n\nimport torch\nfrom torch.autograd import backward\n\n\n\n\ndef reinforce(reward, log_prob, retain_graph=False, iib=None, idb=None):\n reward = reward.detach()\n if idb is not No...
[ [ "torch.zeros_like", "numpy.zeros", "torch.zeros" ] ]
Andrewwango/femda
[ "c072a065687ab32805bdfa48d34c75e05ffd959e" ]
[ "femda/_fem.py" ]
[ "import numpy as np\nimport random\nimport pandas as pd\n\n# MATH and STATS:\nimport math\nfrom scipy.stats import multivariate_normal\nfrom scipy.stats import chi2\nfrom scipy.stats._multivariate import _PSD \n\n# for initialization of cluster's centers:\nfrom sklearn.cluster import KMeans\nfrom scipy.spatial imp...
[ [ "numpy.dot", "numpy.amax", "sklearn.cluster.KMeans", "numpy.random.random_sample", "numpy.mean", "numpy.exp", "numpy.where", "scipy.spatial.cKDTree", "numpy.trace", "numpy.reshape", "numpy.eye", "numpy.copy", "numpy.argmax", "numpy.count_nonzero", "numpy...
jayaram-r/adversarial-detection
[ "0173b19a7352a2ec769f24a89d4e2cf8f4423514" ]
[ "expts/nets/svhn.py" ]
[ "from __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nfrom torch.optim.lr_scheduler import StepLR\n\n\nclass SVHN(nn.Module):\n def __init__(self):\n super(SV...
[ [ "torch.nn.Dropout2d", "torch.nn.functional.log_softmax", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.functional.relu", "torch.flatten", "torch.nn.functional.max_pool2d" ] ]
redb0/gotpy
[ "b3f2e12aff429e0bff0faa079a3694378293c974" ]
[ "algorithm/algabc.py" ]
[ "# TODO: добавить типы\nimport itertools\n\nimport numpy as np\n\nimport support\n\n\nclass Options:\n _alias_map = {\n 'number_points': ['n', 'np'],\n 'number_iter': ['ni', 'iter'],\n 'k_noise': ['kn']\n }\n _required_keys = ('number_points', 'number_iter')\n\n def __init__(self, *...
[ [ "numpy.zeros" ] ]
dainis-boumber/AA_CNN
[ "649612215c7e290ede1c51625268ad9fd7b46228" ]
[ "networks/input_components/TwoEmbChannel.py" ]
[ "import tensorflow as tf\n\n\nclass TwoEmbChannel:\n def __init__(self, sequence_length, num_classes, word_vocab_size, embedding_size,\n init_embedding_glv=None, init_embedding_w2v=None):\n # Placeholders for input, output and dropout, First None is batch size.\n self.input_x = tf.p...
[ [ "tensorflow.concat", "tensorflow.Variable", "tensorflow.expand_dims", "tensorflow.placeholder", "tensorflow.variable_scope", "tensorflow.nn.embedding_lookup" ] ]
gstoica27/google-research
[ "90df0f47ebb79e0c316edba80e75bc4f3736c771" ]
[ "enas_lm/src/child.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.device", "tensorflow.get_variable", "tensorflow.concat", "tensorflow.layers.dropout", "tensorflow.stack", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.tanh", "tensorflow.add_n", "tensorflow.while_loop", "tensorflow.data.Iterator.from_string_handle...
kibernetika-ai/Image-Denoising-with-Deep-CNNs
[ "c081b85fee0fb72e74b0bf4beae90f0bb8bb0a6a" ]
[ "src/inference.py" ]
[ "import argparse\nimport time\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.quantization.quantize_fx as quantize_fx\nfrom torch.quantization.fuse_modules import fuse_known_modules\n\nimport model\n\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument('-D', default=6,...
[ [ "numpy.hstack", "torch.quantization.prepare", "torch.quantization.fuse_modules.fuse_known_modules", "torch.quantization.quantize_fx.convert_fx", "torch.quantization.get_default_qconfig", "torch.quantization.quantize_dynamic", "torch.no_grad", "torch.FloatTensor", "torch.quantiz...
jianwen-xie/Spatial-Temporal-CoopNets
[ "3aeae2bb78c90ad027387d602a94839d83439f3a" ]
[ "src/util.py" ]
[ "from __future__ import division\n\n\nimport os\nimport numpy as np\nimport math\nfrom PIL import Image\nimport scipy.misc\nimport subprocess\n\ndef loadVideoToFrames(data_path, syn_path, ffmpeg_loglevel = 'quiet'):\n videos = [f for f in os.listdir(data_path) if f.endswith(\".avi\") or f.endswith(\".mp4\")]\n ...
[ [ "numpy.minimum", "numpy.squeeze", "numpy.concatenate", "numpy.round", "numpy.zeros" ] ]
hasanari/sane
[ "4ee8d7295d3d13beb3171e29bf5b757acaa11137" ]
[ "app/models.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom __future__ import division\nimport numpy as np\nfrom sklearn.metrics import pairwise_distances\n\ndef range_overlap(\n a_min,\n a_max,\n b_min,\n b_max,\n ):\n '''Neither range is completely greater than the other\n....'''\n\n return a_min <= b_...
[ [ "numpy.diag", "sklearn.metrics.pairwise_distances", "numpy.abs", "numpy.min", "numpy.amin", "numpy.eye", "numpy.matmul", "numpy.cos", "numpy.sin", "numpy.max", "numpy.intersect1d", "numpy.copy", "numpy.delete", "numpy.transpose", "numpy.array", "nump...
Maaitrayo/3D-reconstruction-from-Stereo-image
[ "7bafc6c7d88f317738c48ccbc2202163b0dc444f" ]
[ "3D_reconstruction_V1.py" ]
[ "import cv2 \nimport numpy as np\nimport open3d as o3d\n\nleft_img_path = '/home/maaitrayo/Autonomous Vehicle/data_odometry_gray/dataset/sequences/21/image_0/000000.png'\nright_img_path = '/home/maaitrayo/Autonomous Vehicle/data_odometry_gray/dataset/sequences/21/image_1/000000.png'\n\nimg_left = cv2.imread(left_im...
[ [ "numpy.dot", "numpy.zeros", "numpy.float32", "numpy.ones" ] ]
frankkloster/dogs-vs-cats
[ "4dc060fd860c73d4a2716eb5f4202211376745c3" ]
[ "keras_trainer/task.py" ]
[ "from keras.applications import VGG16\nimport os\nimport numpy as np\nfrom keras.preprocessing.image import ImageDataGenerator\n\nfrom keras import models\nfrom keras import layers\nfrom keras import optimizers\n\nbase_dir = 'data/'\n\nconv_base = VGG16(weights='imagenet',\n include_top=False,\n ...
[ [ "numpy.reshape", "numpy.zeros" ] ]
titulebolide/variometer
[ "7e5fbacdb9c403d11dd01abc6f5e20db4b922756" ]
[ "test/models/model10.py" ]
[ "import numpy as np\n\ndef model(td,dt):\n alpha = 100/8\n beta = 1\n\n f = lambda X,U : np.array([\n [X[0,0] + dt*(U[0,0]-X[3,0])],\n [X[1,0] + dt*beta*(X[2,0] - X[1,0])],\n [X[2,0] - dt*alpha*X[0,0]],\n [X[3,0]]\n ])\n F = lambda X,U : np.array([\n [1, 0, 0, -dt],...
[ [ "numpy.array" ] ]
jvictor42/astropy
[ "37a441d1f1f80d147e9e71bdcc93bfaac1d58b3c" ]
[ "astropy/cosmology/tests/test_cosmology.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom io import StringIO\n\nimport pytest\n\nimport numpy as np\n\nimport astropy.constants as const\nimport astropy.units as u\nfrom astropy.cosmology import Cosmology, flrw, funcs\nfrom astropy.cosmology.realizations import Planck13, Planck18, def...
[ [ "numpy.ones_like", "numpy.sqrt", "numpy.linspace", "numpy.ones", "numpy.broadcast", "scipy.integrate.quad", "numpy.array", "numpy.zeros" ] ]
venkat1110/Face_emotion
[ "fab432d77dd5136151385e0cd7e77d688dd80c25" ]
[ "src/app.py" ]
[ "from flask import Flask,render_template,Response,request,redirect,jsonify\r\nimport numpy as np\r\nimport argparse\r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\nfrom psycopg2 import sql\r\nfrom tensorflow.keras.models import Sequential\r\nfrom tensorflow.keras.layers import Dense, Dropout, Flatten\r\nfrom te...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "numpy.argmax", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Flatten" ] ]
gabrieledamone/DE3-ROB1-CHESS
[ "19ec74f10317d27683817989e729cacd6fe55a3f" ]
[ "perception/Old/shiThomasiCorner.py" ]
[ "import cv2\nimport numpy as np\nimport copy\n\nimg = cv2.imread('emptyBoard.jpg')\nimg_orig = copy.copy(img)\ngrayimg = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n\ncorners = cv2.goodFeaturesToTrack(grayimg, 83, 0.05, 25)\ncorners = np.float32(corners)\n\nfor item in corners:\n x, y = item[0]\n cv2.circle(img, (...
[ [ "numpy.float32" ] ]
tiagovla/Chaos
[ "2355b9d2a9de16d3cc4a74165ab26c8190e6056b" ]
[ "logistic_zoom.py" ]
[ "\"\"\"\r\n Written by Jonny Hyman, 2020\r\n www.jonnyhyman.com\r\n www.github.com/jonnyhyman\r\n\r\n MIT License\r\n\r\nThis code renders the logistic map and zooms in to show its fractal nature.\r\nThere is also infrastructure to plot rulers and labels where each bifurcation\r\noccurs; to hint...
[ [ "numpy.linspace", "numpy.cos", "numpy.modf", "numpy.log10", "numpy.interp", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
javiunzu/python-games
[ "38757cf2a5f8a1d6777cce9471046f83b42630cb" ]
[ "connect_four/connect_four.py" ]
[ "import numpy\nimport pygame\nimport random\n\n\nclass Board:\n \"\"\"\n The board is represented by a matrix. The values of that matrix represent the following states:\n 0: Free cell.\n 1: First player's token.\n -1: Second player's token.\n \"\"\"\n cell_size = 80\n turn = 1\n game_over...
[ [ "numpy.nonzero", "numpy.fliplr", "numpy.all", "numpy.count_nonzero", "numpy.zeros" ] ]
Spinch/CarND-Advanced-Lane-Lines
[ "618d19b4fc3394809c6d6bfa6872527e129d856f" ]
[ "ChooseThresholdsUI.py" ]
[ "\nimport sys\nimport os\nimport cv2\nimport numpy as np\nfrom PyQt4.QtCore import pyqtSignal, pyqtSlot, QObject, SIGNAL, Qt\nfrom PyQt4.QtGui import QApplication, QVBoxLayout, QHBoxLayout, QPushButton, QLineEdit, QWidget, QMainWindow, QLabel, \\\n QCheckBox, QSlider, QFileDialog, QImage, QPixmap, QSpinBox, QCom...
[ [ "numpy.zeros", "numpy.ones_like", "numpy.zeros_like", "numpy.dstack" ] ]
techthiyanes/DeepPavlov
[ "d73f45733d6b23347871aa293309730303b64450" ]
[ "deeppavlov/models/torch_bert/torch_transformers_sequence_tagger.py" ]
[ "# Copyright 2019 Neural Networks and Deep Learning lab, MIPT\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "torch.nn.functional.softmax", "torch.max", "torch.zeros", "torch.eq", "torch.load", "torch.sum", "torch.from_numpy", "torch.tensor", "numpy.argmax", "torch.no_grad", "torch.nonzero", "torch.arange", "torch.nn.functional.one_hot", "numpy.array", "torch.c...
vodnalasricharan/Face-Recognistion-using-custom-datasetopenCV
[ "5049f2d4924bfdc60858b21fe63e6440161920fd" ]
[ "faces-train.py" ]
[ "import torch\nimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functions\nimport torch.optim as optim # For all Optimization algorithms, SGD, Adam, etc.\nimport torchvision.transforms as transforms # Transformations we can perform on our dataset\nimport torchvision\nimpo...
[ [ "torch.nn.CrossEntropyLoss", "pandas.read_csv", "torch.utils.data.DataLoader" ] ]
shahidmuzaffar98/Deep-Image-Processing
[ "ba9b402950fcf78aa7a19228b12d3f3350f02219" ]
[ "data.py" ]
[ "from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport os\r\nimport math\r\nimport random\r\nimport cv2\r\nimport numpy as np\r\nfrom queue import Queue\r\nfrom threading import Thread as Process\r\n#from multiprocessing import Process,Queue...
[ [ "numpy.asarray", "numpy.fliplr", "numpy.random.randint" ] ]
santosh-d3vpl3x/data-validation
[ "b4809803be2d1a0490546f2d21dd4cb7244e6323" ]
[ "tensorflow_data_validation/statistics/generators/image_stats_generator.py" ]
[ "# Copyright 2018 Google LLC\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 ...
[ [ "numpy.max", "numpy.vectorize", "pandas.isnull", "numpy.unique" ] ]
SunSki/neural_sp
[ "4e4aca9b4cda1c7d95a1774d22f4d3298ad4ba4b" ]
[ "neural_sp/models/seq2seq/speech2text.py" ]
[ "# Copyright 2018 Kyoto University (Hirofumi Inaguma)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"Speech to text sequence-to-sequence model.\"\"\"\n\nimport copy\nimport logging\nimport numpy as np\nimport random\nimport torch\nimport torch.nn as nn\n\nfrom neural_sp.bin.train_utils import...
[ [ "torch.nn.Dropout", "torch.zeros", "torch.cat", "torch.nn.Embedding", "numpy.stack", "torch.no_grad", "torch.log", "numpy.fromiter", "numpy.array" ] ]
kundajelab/kerasAC
[ "6aa6573f5f07659bfd68deca37de77e47612020e" ]
[ "kerasAC/vis/plot_letters.py" ]
[ "import re\n\nimport matplotlib\nmatplotlib.use('pdf')\nfrom matplotlib import pyplot\nfrom matplotlib.patches import PathPatch\nfrom matplotlib.path import Path\n\nfrom shapely.wkt import loads as load_wkt\nfrom shapely import affinity\n\nimport numpy as np\nfrom pkg_resources import resource_filename\n\n#########...
[ [ "numpy.asarray", "matplotlib.use", "numpy.squeeze", "matplotlib.path.Path", "numpy.arange", "numpy.ones", "numpy.copy", "matplotlib.pyplot.figure" ] ]
WenmuZhou/PaddleDetection
[ "d9187ad5d054bc8a4333b9a8ba686569be91a8c6" ]
[ "ppdet/modeling/necks/centernet_fpn.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 re...
[ [ "numpy.log2", "numpy.array" ] ]
ArnaudTurn/competition_project
[ "76c7f11e97c90c0be9e3a9a89bff5b022f66e98a" ]
[ "data_science_test_AT/preprocess.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n###############################################################################\n# #\n# preprocess methods #\n# Developed using Python...
[ [ "pandas.get_dummies" ] ]
Princeton-LSI-ResearchComputing/sprite-pipeline
[ "5e11a588df9a70a98d167956af471880669a18f5" ]
[ "scripts/python/contact.py" ]
[ "from enum import Enum\nfrom itertools import combinations\nfrom random import random\nimport assembly\nimport numpy as np\nimport subprocess\n\n__author__ = \"Noah Ollikainen, Charlotte A Lai\"\n\nclass Downweighting(Enum):\n \"\"\"An enumeration of downweighting schemes.\n\n NONE -- No downweighting. Each c...
[ [ "numpy.savetxt", "numpy.median", "numpy.zeros" ] ]
orchardbirds/skorecard-1
[ "0f5375a6c159bb35f4b62c5be75a742bf50885e2" ]
[ "skorecard/bucket_mapping.py" ]
[ "\"\"\"Classes to store features mapping for bucketing.\n\"\"\"\nimport dataclasses\nfrom dataclasses import dataclass, field\nfrom typing import List, Union, Dict\n\nimport pandas as pd\nimport numpy as np\n\n\n@dataclass\nclass BucketMapping:\n \"\"\"Stores all the info to be able to bucket a feature.\n\n `...
[ [ "numpy.hstack", "numpy.digitize", "pandas.Series", "numpy.unique" ] ]
pprp/yolo_deep_sort_pytorch
[ "7317058134b656177ef714f169c25fc76a3e1f2a" ]
[ "train.py" ]
[ "import argparse\nimport os\n\nimport torch.distributed as dist\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\n\nimport test # import test.py to get mAP after each epoch\nfrom models import *\nfrom utils.datasets import *\nfrom utils.utils import *\n\nos.environ[\"CUDA_VISIBLE_DEVIC...
[ [ "torch.optim.Adam", "torch.distributed.init_process_group", "torch.utils.tensorboard.SummaryWriter", "torch.distributed.destroy_process_group", "torch.optim.SGD" ] ]
littleocub/python_practice
[ "c71b514ea1dcc071e83f279d9a08ec68c863d154" ]
[ "bj_tmp_matplotlib/beijing_2016.py" ]
[ "# beijing_2016\nimport csv\nimport matplotlib.dates\nfrom datetime import datetime\nfrom matplotlib import pyplot as plt\n\n\ndef date_to_list(data_index):\n \"\"\" save date to a list \"\"\"\n results = []\n for row in data:\n results.append(datetime.strptime(row[data_index], '%Y-%m-%d'))\n ret...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.margins", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.show", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.yl...
jpapadakis/gdal
[ "f07aa15fd65af36b04291303cc6834c87f662814" ]
[ "gdal/swig/python/samples/rel.py" ]
[ "#!/usr/bin/env python3\n###############################################################################\n# $Id$\n#\n# Project: GDAL Python samples\n# Purpose: Script to produce a shaded relief image from elevation data\n# Author: Andrey Kiselev, dron@remotesensing.org\n#\n######################################...
[ [ "numpy.sqrt", "numpy.empty", "numpy.clip" ] ]
HPAI-BSC/neural_patterns_abstractions
[ "9829e086abab4e8aef0e7327d442c1e354b976c4" ]
[ "plots_and_analysis/on_step4/interest_weight_analyisis.py" ]
[ "\"\"\"\nIn this file i will put the basic methods to represent the embedding graph.\n\ndef: Interest node: A feature s.t. has majority of images with value 1. \n\nThe main work in this file is: \n- Extract the interest weights (weights that connect two interest nodes) of a given synset. \n- Extract the mixed weigh...
[ [ "matplotlib.pyplot.legend", "numpy.savez", "matplotlib.pyplot.title", "matplotlib.pyplot.style.use", "numpy.reshape", "matplotlib.pyplot.savefig", "numpy.setdiff1d", "numpy.append", "numpy.load", "numpy.array", "matplotlib.pyplot.hist", "matplotlib.pyplot.figure" ...
handsomezebra/ToD-BERT
[ "c4fddd7471758aa93e327f0bdd2326bcf6c9a559" ]
[ "utils/loss_function/masked_cross_entropy.py" ]
[ "import torch\nfrom torch.nn import functional\nfrom torch.autograd import Variable\nfrom utils.config import *\nimport torch.nn as nn\nimport numpy as np\n\ndef sequence_mask(sequence_length, max_len=None):\n if max_len is None:\n max_len = sequence_length.data.max()\n batch_size = sequence_length.siz...
[ [ "torch.LongTensor", "torch.nn.functional.log_softmax", "torch.min", "torch.gather", "torch.nn.BCEWithLogitsLoss", "torch.log", "torch.arange", "torch.stack", "torch.autograd.Variable" ] ]
lukeberry99/pycryptobot
[ "8e064acf0917e23b9683fd90c370174fa69794fe" ]
[ "pycryptobot.py" ]
[ "\"\"\"Python Crypto Bot consuming Coinbase Pro or Binance APIs\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta\nimport logging, os, random, sched, sys, time\n\nfrom models.PyCryptoBot import PyCryptoBot\nfrom models.AppState import AppState\nfrom models.Trading import Tec...
[ [ "numpy.subtract", "pandas.DataFrame" ] ]
JAOP1/pyristic
[ "ae3c1151640d05e144535c6c95c286c5c6a9a817" ]
[ "pyristic/heuristic/EvolutionStrategy_search.py" ]
[ "from pyristic.utils.operators import selection, mutation, crossover\nfrom pyristic.utils.helpers import function_type, ContinuosFixer, EvolutionStrategyConfig\nfrom tqdm import tqdm\nimport numpy as np\n\n__all__= ['EvolutionStrategy']\n\n\nclass EvolutionStrategy:\n def __init__(self, function: function_type,...
[ [ "numpy.maximum", "numpy.apply_along_axis", "numpy.argmin", "numpy.random.uniform", "numpy.array", "numpy.random.randint" ] ]
HowardHu97/ZOOpt
[ "01568e8e6b0e65ac310d362af2da5245ac375e53" ]
[ "example/simple_functions/simple_function.py" ]
[ "\"\"\"\nObjective functions can be implemented in this file.\n\nAuthor:\n Yu-Ren Liu\n\"\"\"\n\nfrom random import Random\nfrom zoopt.dimension import Dimension\nimport numpy as np\n\n\nclass SetCover:\n \"\"\"\n set cover problem for discrete optimization\n this problem has some extra initialization t...
[ [ "numpy.random.normal", "numpy.exp", "numpy.cos", "numpy.sqrt" ] ]
muhammadtarek/excelify
[ "9f9a5b367df5a2714bd64ffa7c0e83a3a721b405" ]
[ "api/Code/ModelVerifier.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom keras.utils import np_utils\nfrom keras.models import load_model\n\nfrom api.Code.ModelProcessing import ModelProcessing\n\n\nclass ModelVerifier(ModelProcessing):\n def __init__(self):\n super(ModelVerifier,self).__init__()\n...
[ [ "pandas.read_csv", "numpy.argmax", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ] ]
skn123/psoCNN
[ "a29a0424dd3d38f297ac95bcf2b30ea990b3e051" ]
[ "psoCNN.py" ]
[ "import keras\r\nfrom keras.datasets import mnist\r\nfrom keras.datasets import fashion_mnist\r\nfrom keras.datasets import cifar10\r\nimport keras.backend\r\n\r\nfrom population import Population\r\n\r\nimport numpy as np\r\n\r\nfrom copy import deepcopy\r\n\r\nclass psoCNN:\r\n def __init__(self, dataset, n_it...
[ [ "numpy.reshape", "numpy.zeros", "numpy.loadtxt" ] ]
lyqun/FPConv
[ "9fc3a71258550101bec671330c5e97b45725291c" ]
[ "datasets/s3dis_dataset.py" ]
[ "import os\nimport numpy as np\nimport sys\nfrom torch.utils.data import Dataset\n\n\nclass S3DIS(Dataset):\n def __init__(self, split='train', data_root='trainval_fullarea', num_point=4096, test_area=5, block_size=1.0, sample_rate=1.0, transform=None, if_normal=True):\n super().__init__()\n print(...
[ [ "numpy.amax", "numpy.random.seed", "numpy.random.choice", "numpy.amin", "torch.manual_seed", "torch.utils.data.DataLoader", "numpy.random.shuffle", "numpy.where", "torch.cuda.manual_seed_all", "numpy.load", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
labelshift/labelshift
[ "d5d6a06ef435a7fca96be7bbef415e52fb5235b4" ]
[ "labelshift/algorithms/expectation_maximization.py" ]
[ "\"\"\"Expectation Maximization algorithm.\"\"\"\nimport warnings\nfrom typing import Optional\nimport numpy as np\nfrom numpy.typing import ArrayLike\n\nimport labelshift.probability as prob\nimport labelshift.recalibrate as recalib\n\n\ndef expectation_maximization(\n predictions: ArrayLike,\n training_prev...
[ [ "numpy.asarray", "numpy.sum", "numpy.allclose" ] ]
liyang-huang/PSMNet
[ "0449dc290324ed1cd05e6b4668c56d81c800ec77" ]
[ "Test_img.py" ]
[ "from __future__ import print_function\nimport argparse\nimport os\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport s...
[ [ "numpy.lib.pad", "numpy.nanmax", "numpy.fromfile", "numpy.abs", "torch.cuda.manual_seed", "torch.load", "numpy.reshape", "torch.manual_seed", "numpy.nanmin", "numpy.flipud", "torch.no_grad", "torch.FloatTensor", "torch.cuda.is_available", "torch.nn.DataParal...
Ackey-code/3d-artefacts-nca
[ "b13228d5dd30519ad885d2400061be2adf6cfc3c" ]
[ "artefact_nca/base/base_torch_dataset.py" ]
[ "import abc\nfrom typing import Any, Dict\n\nimport torch\nfrom torch.utils.data import Dataset\n\n\nclass BaseTorchDataset(Dataset, metaclass=abc.ABCMeta):\n\n _config_group_ = \"trainer/dataset\"\n _config_name_ = \"default\"\n\n def sample(self, batch_size: int) -> Dict[str, Any]:\n \"\"\"Random ...
[ [ "torch.randint" ] ]
Troyliu777/VideoSuperResolution
[ "a844687aa3ee0f4db59e704f707532f2ab6dc1c0" ]
[ "UTest/motion_test.py" ]
[ "\"\"\"\nunit test for VSR.Framework.Motion package\n\"\"\"\n\nfrom VSR.Framework import Motion as M\n\nimport tensorflow as tf\nimport numpy as np\nfrom PIL import Image\n\nTEST_FLO_FILE = './data/flying_chair/0-gt.flo'\nTEST_PNG16_FILE = './data/kitti_car/f_01.png'\n\n\ndef test_open_flo():\n X = M.open_flo(TE...
[ [ "numpy.expand_dims", "numpy.stack", "numpy.all", "numpy.random.rand", "tensorflow.Session" ] ]
Tengelma/CapstonePlayground
[ "03ff9aaa2adf9f6eca5c059082667b1d894ea6bb" ]
[ "server/test_server.py" ]
[ "import os\nimport tempfile\nimport pytest\nimport re\nimport server\nfrom server import get_x, get_y, create_fig, serialize_fig\nimport numpy as np\n\n@pytest.fixture\ndef client():\n server.app.config['TESTING'] = True\n with server.app.test_client() as client:\n yield client\n\ndef test_get_x():\n ...
[ [ "numpy.array" ] ]
swapithorat/obj-det-using-ml
[ "9ac8ece4f67820076b794d577391ec77a92b4ca0" ]
[ "object_detection_app/app.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# Copyright 2017 Google 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# ...
[ [ "tensorflow.Graph", "numpy.expand_dims", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "tensorflow.Session", "tensorflow.GraphDef" ] ]
jopapo/financial-demo
[ "15f72198756edaef4887e97b91d007cc0d120e8a" ]
[ "actions/profile_db.py" ]
[ "import os\nimport sqlalchemy as sa\nfrom sqlalchemy import Column, Integer, String, DateTime, REAL\nfrom sqlalchemy.orm import Session, sessionmaker\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.engine.base import Engine\nfrom typing import Dict, Text, List, Union, Optional\n\nfrom rand...
[ [ "numpy.arange" ] ]
SheldonTsui/SepStereo_ECCV2020
[ "1ae44dc6ace71c164fefe0fd430078552e3b3f1f" ]
[ "demo_stereo.py" ]
[ "import os\nimport os.path as osp\nimport sys\nimport pdb\nimport argparse\nimport librosa\nimport numpy as np\nfrom tqdm import tqdm\nimport h5py\nfrom PIL import Image\nimport subprocess\nfrom options.test_options import TestOptions\nimport torchvision.transforms as transforms\nimport torch\nimport torchvision\nf...
[ [ "numpy.expand_dims", "torch.load", "numpy.mean", "torch.device", "numpy.zeros", "numpy.divide" ] ]
erego/anomalydetection
[ "838a5c39c3350b2f9d7b8988d877372c07d9e56f" ]
[ "pyande/data/draw.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mptches\nimport seaborn as sns\nimport scipy.stats as sts\n\n\ndef draw_correlation_matrix(sigma, data):\n\n # Get correlation matrix and draw it\n corr_matrix = np.corrcoef(sigma)\n features = data.columns.values.tolist()\n...
[ [ "matplotlib.pyplot.legend", "matplotlib.patches.Patch", "matplotlib.pyplot.title", "scipy.stats.norm.pdf", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "numpy.cov", "numpy.mean", "numpy.corrcoef", "matplotlib.pyplot.xlabel", "matplotlib.pypl...
mr-c/cogent3
[ "5c4dbd9e3a970004e88fab636ba1dc330280c1a9" ]
[ "src/cogent3/evolve/models.py" ]
[ "#! /usr/bin/env python\n\"\"\"A collection of pre-defined models. These are provided for convenience so that\nusers do not need to keep reconstructing the standard models. We encourage users\nto think about the assumptions in these models and consider if their problem could\nbenefit from a user defined model.\nN...
[ [ "numpy.array" ] ]
jrcai/BagofTricks-LT
[ "d75b195367e3d535d316d134ec4bbef4bb7fcbdd" ]
[ "lib/core/function.py" ]
[ "import _init_paths\r\nfrom core.evaluate import accuracy, AverageMeter, FusionMatrix\r\n\r\nimport numpy as np\r\nimport torch\r\nimport torch.distributed as dist\r\nimport time\r\nfrom tqdm import tqdm\r\nfrom apex.parallel import DistributedDataParallel as DDP\r\nfrom apex.fp16_utils import *\r\nfrom apex import...
[ [ "torch.nn.Softmax", "torch.nn.Sigmoid", "torch.no_grad", "numpy.array", "torch.distributed.all_reduce", "torch.argmax" ] ]
Muhammad4hmed/Amazon-Web-Services-Hackathon
[ "8dda149af1c7f9ccc18706477b7363ed8e08f3e5" ]
[ "chatscript.py" ]
[ "import nltk\nfrom nltk.stem.lancaster import LancasterStemmer\nstemmer=LancasterStemmer()\nimport pickle\nimport numpy\nimport tflearn\nimport tensorflow\nimport random\nimport json\nimport pyttsx3\n\ndef tts(txt):\n\tengine=pyttsx3.init()\n\tengine.say(txt)\n\tengine.runAndWait()\n\n\ntry:\n\twith open('data.pick...
[ [ "numpy.array", "tensorflow.reset_default_graph", "numpy.argmax" ] ]
raulf2012/PROJ_IrOx_OER
[ "56883d6f5b62e67703fe40899e2e68b3f5de143b" ]
[ "dft_workflow/dft_scripts/slab_dft.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"Run VASP job on slab.\n\nAuthor(s): Michal Badich, Raul A. Flores\n\"\"\"\n\n# | - Import Modules\nimport os\nprint(os.getcwd())\nimport sys\n\nimport json\nimport subprocess\nimport time\nt0 = time.time()\n\nimport numpy as np\n\nimport ase.calculators.vasp as vasp_calculator\nfrom ...
[ [ "numpy.abs" ] ]
skmendez/LightShow
[ "d47989da39c45ad34933dbb37ed7d85986997d21" ]
[ "gen_demo.py" ]
[ "import ffmpeg\nimport numpy as np\nfrom videoprocess import process_video\nfrom youtube_dl import YoutubeDL\nimport os\n\nclass MyLogger(object):\n def debug(self, msg):\n pass\n\n def warning(self, msg):\n pass\n\n def error(self, msg):\n print(msg)\n\nydl_opts = {\n 'format': \"1...
[ [ "numpy.frombuffer" ] ]
hugofloresgarcia/torchopenl3
[ "4fecb2dae04b52b58b3eb700cb1b6db4037e31f6" ]
[ "tests/test_model.py" ]
[ "import pytest\nimport numpy as np\nimport torch\nimport torchopenl3\n\n###############################################################################\n# Test model\n###############################################################################\n\n@pytest.mark.parametrize(\"model\", [m for m in torchopenl3.all_mo...
[ [ "torch.from_numpy", "numpy.random.rand" ] ]
zoeqwq/gs-quant
[ "2ee3ffe5ed918845f5f56f006755efd04774abd6" ]
[ "gs_quant/timeseries/measures_reports.py" ]
[ "\"\"\"\nCopyright 2020 Goldman Sachs.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in wr...
[ [ "pandas.DataFrame.from_records", "pandas.to_datetime", "pandas.Series", "pandas.DataFrame" ] ]
kevinbdsouza/Hi-C-LSTM
[ "c8e5d23b7e69878b8b5d7c537a3f33b3cdf9907d" ]
[ "src/analyses/classification/run_class.py" ]
[ "from analyses.classification.rna_seq import GeneExp\nfrom training.config import Config\nimport pandas as pd\nimport time\nfrom torch.utils.tensorboard import SummaryWriter\nfrom analyses.classification.downstream_helper import DownstreamHelper\nfrom analyses.classification.fires import Fires\nfrom analyses.classi...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available" ] ]
sirno/pypetting
[ "c0c7b7a53ef10eeb89e6a8ee46a6bbfa3752fd29" ]
[ "pypetting/liha.py" ]
[ "\"\"\"Pipetting functions.\"\"\"\n\nimport numpy as np\n\nfrom numpy.typing import ArrayLike\n\nfrom .base import GridSite, Labware\nfrom .labware import labwares\nfrom .utils import bin_to_dec, volumes_to_string\n\n__all__ = [\n \"aspirate\",\n \"dispense\",\n \"mix\",\n \"wash\",\n \"move_liha\",\...
[ [ "numpy.array" ] ]
SpangleLabs/advent-of-code
[ "9692f533c30f22e59f7055ca12253128ca8dac0a" ]
[ "2021/19_matrices.py" ]
[ "from abc import ABC, abstractmethod\nimport dataclasses\nimport datetime\nimport itertools\nfrom functools import cached_property\nfrom typing import List, Tuple, Set, Optional\nimport numpy\n\nfrom utils.coords3d import Coords3D\nfrom utils.input import load_input\n\n\nclass Transformation3D(ABC):\n\n @propert...
[ [ "numpy.array", "numpy.identity", "numpy.matmul" ] ]
luojy95/FBGEMM
[ "95985145b0060cdd5acd4fa0eb65347b60ef060a" ]
[ "fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops.py" ]
[ "#!/usr/bin/env python3\n\n# pyre-ignore-all-errors[56]\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport enum\nimport logging\nfrom dataclasses i...
[ [ "torch.cuda.get_device_properties", "torch.randint", "torch.zeros", "torch.cat", "torch.sum", "numpy.cumsum", "torch.ops.fb.dense_embedding_codegen_lookup_function", "torch.unique", "torch.where", "torch.device", "torch.ops.fb.lru_cache_populate", "torch.cuda.memory...
navjothbn/new_spatial
[ "4113c29fe81facbf79ccb4f160cc4a252aa6f745" ]
[ "apps/xy.py" ]
[ "import leafmap.foliumap as leafmap\nimport pandas as pd\nimport streamlit as st\n\n\ndef app():\n\n st.title(\"Add Points from XY\")\n\n sample_url = \"https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/world_cities.csv\"\n url = st.text_input(\"Enter URL:\", sample_url)\n m = leafma...
[ [ "pandas.read_csv" ] ]
mleszczy/emmental
[ "879902626ed9e97f43fa42fe471275cbfad52f90" ]
[ "tests/schedulers/test_round_robin_scheduler.py" ]
[ "\"\"\"Emmental round robin scheduler unit tests.\"\"\"\nimport logging\n\nimport numpy as np\nimport torch\n\nimport emmental\nfrom emmental.data import EmmentalDataLoader, EmmentalDataset\nfrom emmental.schedulers.round_robin_scheduler import RoundRobinScheduler\nfrom emmental.utils.utils import set_random_seed\n...
[ [ "numpy.random.rand" ] ]
uhseon/Deep-Repulsive-Clustering-of-Ordered-Data-Based-on-Order-Identity-Decomposition
[ "436aee7ade293a0a404b2e1a2965571864efb676" ]
[ "test/test_morph_kCH_attr.py" ]
[ "from datetime import datetime\nimport os\nimport sys\n\nimport numpy as np\nimport pandas as pd\nimport pickle as pkl\nfrom sklearn.preprocessing import normalize\nimport tensorflow as tf\nimport tensorflow.keras as keras\n\n\nsys.path.append('..')\nfrom configs.cfg_morph_estimation_kCH_setting_A import ConfigMorp...
[ [ "tensorflow.concat", "numpy.concatenate", "numpy.zeros_like", "numpy.mean", "pandas.read_csv", "tensorflow.keras.Input", "tensorflow.config.experimental.set_memory_growth", "numpy.ceil", "numpy.argmax", "numpy.load", "numpy.zeros", "numpy.log", "tensorflow.confi...
wbbhcb/Firm-Characteristics-and-Chinese-Stock-Market
[ "5d2d4858b9e2292987eb38f660fbc9457c0d9595" ]
[ "fc.py" ]
[ "\r\n\"\"\"\r\n由于并未达到原文中的数值,所以之后会重新检查,看看算式能否进一步提升,因此,并未写出很集成的模块。\r\n\"\"\"\r\nimport pandas as pd\r\nimport numpy as np\r\nimport statsmodels.api as sm\r\nfrom scipy import stats\r\n\r\nfrom factor_test_monthly import compute_num_months, compute_factor_return_series, compute_return_T_test, compute_5_factor_model\r\...
[ [ "pandas.read_csv", "numpy.ones", "scipy.stats.linregress", "numpy.sum", "numpy.vstack" ] ]
fengrussell/tensor2tensor-hvd
[ "d24de4756da1d990863d78086aa6eadf95960f10" ]
[ "tensor2tensor/data_generators/imagenet.py" ]
[ "# coding=utf-8\n# Copyright 2017 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.logging.warning", "tensorflow.constant", "tensorflow.image.random_flip_left_right", "tensorflow.control_dependencies", "tensorflow.shape", "tensorflow.greater", "tensorflow.stack", "tensorflow.slice", "tensorflow.equal", "tensorflow.reshape", "tensorflow.cas...
samf1986/matching
[ "c1ed91127ef73e22702c66d88a4c53464625b7a8" ]
[ "docs/tutorials/hospital_resident/data.py" ]
[ "\"\"\" A script to create the dummy data used in `main.ipynb`. \"\"\"\n\nfrom collections import defaultdict\n\nimport numpy as np\nimport yaml\n\nNUM_RESIDENTS = 200\nCAPACITY = 30\nSEED = 0\n\nresident_names = [f\"{i:03d}\" for i in range(NUM_RESIDENTS)]\nhospital_names = [\n \"Dewi Sant\",\n \"Prince Char...
[ [ "numpy.array", "numpy.random.seed" ] ]
andreamad8/EntNet
[ "b8398db96d8167d7db6855bf960d59b9afc38548" ]
[ "CNN/src/memories/DMC_simple.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\nimport numpy as np\nimport tensorflow as tf\nimport functools\n\n\ndef prelu_func(features, initializer=None, scope=None):\n \"\"\"\n Implementation of [Parametric ReLU](https://arxiv.org/abs/1502....
[ [ "tensorflow.nn.relu", "tensorflow.matmul", "tensorflow.nn.sigmoid", "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.expand_dims", "tensorflow.constant_initializer", "tensorflow.variable_scope", "tensorflow.split", "tensorflow.random_normal_...
abhiramr/mlflow
[ "2bbdc20f2d90d551fb7d40f982f2f799da9feca8" ]
[ "examples/pytorch/CaptumExample/Titanic_Captum_Interpret.py" ]
[ "\"\"\"\nGetting started with Captum - Titanic Data Analysis\n\"\"\"\n# Initial imports\nimport numpy as np\nimport torch\nfrom captum.attr import IntegratedGradients\nfrom captum.attr import LayerConductance\nfrom captum.attr import NeuronConductance\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom scip...
[ [ "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "pandas.read_csv", "torch.load", "torch.manual_seed", "matplotlib.pyplot.subplots", "sklearn.model_selection.train_test_split", "torch.nn.Sigmoid", "torch.from_numpy", "torch.nn.Linear", "numpy.argmax", "numpy.mean", ...
airium/pytorch-lightning
[ "c7292b4db40cbd94196999dd93903ff4907ad40b" ]
[ "tests/base/deterministic_model.py" ]
[ "import torch\nfrom pytorch_lightning.core.lightning import LightningModule\nfrom torch.utils.data import Dataset, DataLoader\nimport numpy as np\n\n\nclass DeterministicModel(LightningModule):\n\n def __init__(self, weights=None):\n super().__init__()\n\n self.training_step_called = False\n ...
[ [ "torch.all", "numpy.array", "torch.nn.Parameter", "torch.tensor" ] ]
mljar/automlbenchmark
[ "d72dbc5b9cc14e0b02179348be7d5c01d4c13da2" ]
[ "frameworks/shared/caller.py" ]
[ "import io\nimport logging\nimport os\nimport re\nfrom typing import Union\nimport uuid\n\nimport numpy as np\n\nfrom amlb.benchmark import TaskConfig\nfrom amlb.data import Dataset\nfrom amlb.resources import config as rconfig\nfrom amlb.results import NoResultError, save_predictions\nfrom amlb.utils import Namesp...
[ [ "numpy.load", "numpy.save" ] ]
karelvaculik/altair-flask-demo
[ "04c54c057720b44b8ba8c78f9b86221d399889ea" ]
[ "altair_flask_demo/main.py" ]
[ "from flask import Flask\nfrom flask import render_template\nfrom flask import request\n\nimport altair as alt\nimport numpy as np\nimport pandas as pd\n\napp = Flask(__name__)\n\n\n@app.route(\"/\")\ndef index():\n return render_template(f\"index.html\")\n\n\n@app.route(\"/build_plot\", methods=[\"POST\"])\ndef...
[ [ "numpy.random.normal" ] ]
chrieke/rio-tiler
[ "ccf6aa002fc0c3525c9889cffbb9ca26689ba0b9" ]
[ "tests/test_mosaic.py" ]
[ "\"\"\"tests ard_tiler.mosaic.\"\"\"\n\nimport os\nfrom typing import Tuple\nfrom unittest.mock import patch\n\nimport numpy\nimport pytest\nimport rasterio\nfrom rasterio.warp import transform_bounds\n\nfrom rio_tiler import mosaic\nfrom rio_tiler.constants import WEB_MERCATOR_TMS, WGS84_CRS\nfrom rio_tiler.errors...
[ [ "numpy.testing.assert_array_equal", "numpy.std" ] ]
AlparslanErol/Course_Related
[ "9a59eb2857c525769b046b7b2a7706ec4a1cdba8" ]
[ "Nonparametric_Regression/regressogram.py" ]
[ "# IMPORT LIBRARIES\n# =============================================================================\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport warnings\n# =============================================================================\n\n\n# VERSION CHECK...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "pandas.set_option", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", ...
Palzer/pytorch-lightning
[ "886702a1af442f33625693a9ba33c669f9fe9535", "4018237c309b7d9d6978da73132003615341e04a" ]
[ "tests/trainer/test_dataloaders.py", "pytorch_lightning/metrics/functional/ssim.py" ]
[ "# Copyright The PyTorch Lightning team.\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...
[ [ "torch.nn.ReLU", "torch.cuda.device_count", "torch.utils.data.dataloader.DataLoader", "torch.utils.data.distributed.DistributedSampler" ], [ "torch.nn.functional.conv2d", "torch.arange", "torch.cat" ] ]
shaandesai1/VIGN_
[ "7687f1ecd1912a033136b75563868ce749c76336" ]
[ "models_long.py" ]
[ "\"\"\"\nAuthor: ****\ncode to build graph based models for VIGN\n\nSome aspects adopted from: https://github.com/steindoringi/Variational_Integrator_Networks/blob/master/models.py\n\"\"\"\nfrom graph_nets import modules\nfrom graph_nets import utils_tf\nimport sonnet as snt\nimport tensorflow as tf\nfrom utils imp...
[ [ "matplotlib.pyplot.legend", "tensorflow.keras.backend.floatx", "tensorflow.concat", "tensorflow.reduce_sum", "sklearn.metrics.mean_squared_error", "tensorflow.train.AdamOptimizer", "tensorflow.Variable", "numpy.arange", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig...
junbinhuang/mofem
[ "6ed2ea5b7a8fbb1f8f0954636f6326c706da302c" ]
[ "linearSolvers/traditionalElement.py" ]
[ "import numpy as np \nimport scipy\n# from sksparse.cholmod import cholesky # It works (from Terminal).\nfrom scipy.sparse.linalg import spsolve\nimport time\nimport sys, os\nsys.path.append(os.path.dirname(sys.path[0]))\nfrom elementLibrary import stiffnessMatrix, shapeFunction\nfrom otherFunctions import numerica...
[ [ "numpy.delete", "numpy.array", "numpy.zeros", "scipy.sparse.linalg.spsolve" ] ]
Nvpiao/PhD-Work
[ "cb257d1e2fe828b837634a9b113df57eb3c44065" ]
[ "30-11-2021/finetune_gpt2/src/gpt2model/dataset.py" ]
[ "import random\n\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\n\n\nclass AmazonDataset(Dataset):\n def __init__(self, data, tokenizer, max_length, special_tokens, randomize=True):\n \"\"\"\n create dataset\n :param data: data frame\n :param tokenizer:\n :para...
[ [ "torch.utils.data.random_split", "torch.utils.data.DataLoader", "torch.tensor" ] ]
komour/diploma
[ "545af6481f488cfeea9d543fb5fcde66c9c35664" ]
[ "gradcam/utils.py" ]
[ "import cv2\nimport torch\n\nlayer_finders = {}\n\n\ndef register_layer_finder(model_type):\n def register(func):\n layer_finders[model_type] = func\n return func\n\n return register\n\n\ndef visualize_cam(mask, img, alpha=1.0):\n \"\"\"Make heatmap from mask and synthesize GradCAM result ima...
[ [ "torch.FloatTensor", "torch.from_numpy", "torch.cat" ] ]
mfranco/pymir
[ "f6d86bfdec942156ae95984f1ef8182d8983181f" ]
[ "code/python/pymir/dsp/waveform.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport librosa\nfrom librosa.core import load\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef main():\n y, sr = load('/data/audio/autum_leaves_take1.wav', duration=10)\n plt.figure()\n plt.subplot(1, 1, 1)\n librosa.display.waveplot(y, sr=sr)\n p...
[ [ "matplotlib.pyplot.title", "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplot", "matplotlib.pyplot.figure" ] ]