repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
rahuls02/Image-Noise-Reduction
[ "e2fecf2c84f83de812cc2b9cb391ccec1b4b3dc6" ]
[ "criteria/lpips/lpips.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom criteria.lpips.networks import get_network, LinLayers\nfrom criteria.lpips.utils import get_state_dict\n\n\nclass LPIPS(nn.Module):\n r\"\"\"Creates a criterion that measures\n Learned Perceptual Image Patch Similarity (LPIPS).\n Arguments:\n net_type (st...
[ [ "torch.cat" ] ]
PloxKevin/Weak-Supervision
[ "79bd8690309ec161c5e0d0a5715dfa61f7baf786" ]
[ "py_img_seg_eval/unit_tests.py" ]
[ "#!/usr/bin/python\n\n'''\nMartin Kersner, m.kersner@gmail.com\n2015/11/30\n\nUnit tests for eval_segm.py.\n'''\n\nimport numpy as np\nimport eval_segm as es\nimport unittest\n\nclass pixel_accuracy_UnitTests(unittest.TestCase):\n '''\n Wrong inputs\n '''\n def test1dInput(self):\n mat = np.array...
[ [ "numpy.array", "numpy.mean" ] ]
saturnaxis/CBP_stability
[ "435d5bdb3212d5696d5fbf7cc6737476a08c476c" ]
[ "plot_figures/plot_Fig1_2.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport os\nfrom scipy.interpolate import griddata\nimport matplotlib.colors as colors\nfrom matplotlib import ticker\nimport matplotlib.cm as cm\nimport sys\nfrom matplotlib import rcParams\n\nrcParams.update({'font.size': 22})\n\nfig_num = int(sys.argv[1])\n\nc...
[ [ "numpy.abs", "numpy.linspace", "numpy.min", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.colors.Normalize", "matplotlib.pyplot.savefig", "numpy.genfromtxt", "matplotlib.pyplot.colorbar", "numpy.log10", "matplotlib.cm.ScalarMappable", "matplotlib.rcParam...
wengzehang/keypoint_humanoids
[ "0630037b2d8063146728670643a96b73632643e8" ]
[ "models/kp_comp.py" ]
[ "# Ref: https://github.com/hansen7/OcCo\n# TODO: Reimplement chamfer distance in Torch and add completion/topo loss back; decoder\n\nfrom models.pcn_util import PCNEncoder\nimport torch, torch.nn as nn, torch.nn.functional as F\n\nclass View(nn.Module):\n def __init__(self, shape):\n super(View, self).__...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.cat", "torch.nn.functional.mse_loss", "torch.nn.Linear", "torch.rand", "torch.cuda.is_available", "torch.nn.Conv1d", "torch.nn.ReLU" ] ]
KentaKawamata/probreg
[ "ab29c01353f5ca490653172523d351cce26017c8" ]
[ "probreg/transformation.py" ]
[ "import abc\nimport six\nimport numpy as np\nimport open3d as o3\nfrom . import math_utils as mu\n\n\n@six.add_metaclass(abc.ABCMeta)\nclass Transformation():\n def __init__(self):\n pass\n\n def transform(self, points,\n array_type=o3.Vector3dVector):\n if isinstance(points, ar...
[ [ "numpy.dot", "numpy.linalg.svd", "numpy.asarray", "numpy.ones", "numpy.identity", "numpy.zeros" ] ]
Ayush8120/Improved-MR-DFS-PX4
[ "1f64db7b801cb97a2ccb26a7de95d1c92b0666f4" ]
[ "ayush/src/uav_city_4.py" ]
[ "#!/usr/bin/env python3\n\nimport rospy\nimport mavros\nfrom geometry_msgs.msg import PoseStamped\nfrom mavros_msgs.msg import *\nfrom mavros_msgs.srv import *\n\nimport pprint\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\...
[ [ "numpy.reshape", "matplotlib.pyplot.plot", "matplotlib.animation.FuncAnimation", "numpy.transpose", "numpy.array", "numpy.vstack", "matplotlib.pyplot.figure" ] ]
tgolubev/Drift-Diffusion_Python
[ "645650341c900410d59e61c150aab2516cabceba" ]
[ "photogeneration.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Oct 19, 2018\n\n@author: Timofey Golubev\n\nThis just contains the function for reading photogeneration rate from a generation rate data file.\n\"\"\"\n\nimport numpy as np\n\ndef get_photogeneration(params):\n '''\n Reads photogeneration rate from an input fi...
[ [ "numpy.max", "numpy.loadtxt" ] ]
sry002/avocado
[ "d89f4161e3236b65e57f0d8c7f4454ee44501fa3" ]
[ "avocado/model.py" ]
[ "# models.py\n# Contact: Jacob Schreiber <jmschr@cs.washington.edu>\n# William Noble <wnoble@uw.edu>\n\n\"\"\"\nAvocado is deep tensor factorization model for learning a latent representation\nof the human epigenome. This file has functions for building a deep tensor\nfactorization model.\n\"\"\"\n\nfrom...
[ [ "numpy.concatenate", "numpy.arange", "numpy.empty", "numpy.ones" ] ]
matthewygf/incubator-tvm
[ "348144cb8b0485adca37aead0dfef9269cd2300d" ]
[ "tests/python/frontend/onnx/test_forward.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.logical_xor", "numpy.expand_dims", "numpy.arctanh", "numpy.take", "numpy.sqrt", "numpy.arctan", "numpy.asarray", "numpy.dtype", "numpy.max", "numpy.mean", "numpy.argmin", "numpy.random.randn", "numpy.var", "numpy.exp", "numpy.where", "numpy.ra...
iDurugkar/adversarial-intrinsic-motivation
[ "e0ece991fe9b8278596c0ad9c68ccfc98a71e1e2" ]
[ "grid_world_experiments/main.py" ]
[ "\"\"\"\nGAIL file\n\"\"\"\nimport numpy as np\nimport torch\nfrom torch import nn\n# from torch.nn import utils\nimport torch.nn.functional as f\nimport random\nfrom policy import MlpNetwork, SoftQLearning\nfrom grid_mdp import GridMDP, MazeWorld, WindyMazeWorld, ToroidWorld\nfrom rnd import RND\nimport matplotlib...
[ [ "torch.mean", "matplotlib.pyplot.legend", "matplotlib.pyplot.imshow", "torch.abs", "torch.max", "torch.zeros", "torch.set_default_dtype", "torch.cat", "matplotlib.ticker.AutoMinorLocator", "numpy.asarray", "numpy.concatenate", "numpy.max", "matplotlib.pyplot.gca...
gstonge/gcm
[ "c5d1f0860f7e921ed191a96f7859b232547092d2" ]
[ "test/test_optimal_seeding.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nTest the initializaiton, insertion, sampling, etc. methods for samplable set\n\nAuthor: Guillaume St-Onge <guillaume.st-onge.4@ulaval.ca>\n\"\"\"\n\nimport pytest\nimport numpy as np\nfrom gcm import *\nfrom scipy.special import loggamma\n\n\ndef constraint_...
[ [ "numpy.log", "numpy.arange", "scipy.special.loggamma", "numpy.zeros", "numpy.sum", "numpy.isclose" ] ]
adrift00/cs231n-assignments-2019
[ "38ffc935fa1aa6e26ba5cc560269650db521d3c4" ]
[ "assignments/2019/assignment1/cs231n/gradient_check.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\nfrom random import randrange\n\ndef eval_numerical_gradient(f, x, verbose=True, h=0.00001):\n \"\"\"\n a naive implementation of numerical gradient of f at x\n - f should be a function that takes a single argument\n - x is the point (numpy ar...
[ [ "numpy.sum", "numpy.copy", "numpy.zeros_like", "numpy.nditer" ] ]
kaywuensche/clustering_images
[ "3e09d89f1b41c20d905f2959743ec3e7fd2ebe7b" ]
[ "src/main/utils.py" ]
[ "import os\r\nimport io\r\nimport shutil\r\nimport math\r\nimport random\r\nimport numpy as np\r\nimport requests\r\nimport urllib.request\r\nfrom PIL import Image, ImageDraw\r\nfrom bs4 import BeautifulSoup\r\nimport imghdr\r\nfrom sklearn.cluster import KMeans\r\nfrom sklearn.decomposition import PCA\r\nfrom kera...
[ [ "numpy.array", "sklearn.decomposition.PCA", "sklearn.cluster.KMeans", "matplotlib.pyplot.gcf" ] ]
dt99jay/League-Tables
[ "92c029957734841ded0e5ed9f783fe3ea57f07f3" ]
[ "Complete University Guide/Subjects/cug_subjects.py" ]
[ "import urllib\nimport requests\r\nimport pandas as pd\r\nfrom bs4 import BeautifulSoup\r\n\ndef get_cols(table):\n header = table.find_all(\"th\")\n cols = []\n for column in header:\n try:\n col = column.find(\"a\").get_text()\n except AttributeError:\n col = column.ge...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame", "pandas.to_numeric", "pandas.melt" ] ]
rmenegaux/fastDNA
[ "bc6469694daa69a18c458166ef4975b9fc1c308c" ]
[ "python/fastDNA/evaluate.py" ]
[ "from sklearn.metrics import accuracy_score\nimport numpy as np\nimport argparse\n\n\nparser = argparse.ArgumentParser(description=\n '''\n Compute average species-level recall and precision.\n ''')\n\nparser.add_argument(\"predictions\", nargs='+',\n help=\"predicted labels, text file w...
[ [ "sklearn.metrics.accuracy_score", "numpy.mean", "numpy.unique", "numpy.genfromtxt" ] ]
xtwentian3/BCQ
[ "e114f8c474c57a36d9af78c42a06f612831afda2" ]
[ "continuous_BCQ/main.py" ]
[ "import argparse\nimport gym\nimport numpy as np\nimport os\nimport torch\n\nimport BCQ\nimport DDPG\nimport utils\n\n\n# Handles interactions with the environment, i.e. train behavioral or generate buffer\ndef interact_with_environment(env, state_dim, action_dim, max_action, device, args):\n\t# For saving files\n\...
[ [ "numpy.random.seed", "torch.manual_seed", "numpy.save", "numpy.random.normal", "torch.cuda.is_available", "numpy.random.uniform", "numpy.array" ] ]
ze-lin/AudioCaption
[ "0d383c56350b57b3867a91578a11b332b1a29789" ]
[ "utils/bert/create_sent_embedding.py" ]
[ "import pickle\nimport fire\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\n\n\nclass EmbeddingExtractor(object):\n\n def extract_sentbert(self, caption_file: str, output: str, dev: bool=True, zh: bool=False):\n from sentence_transformers import SentenceTransformer\n lang2model = {...
[ [ "torch.cuda.is_available", "torch.no_grad", "pandas.read_json", "numpy.stack" ] ]
vasudevanv/OpenPNM
[ "51dbd5d9fb5210a67493ab839a91320d77ffd2d8" ]
[ "tests/unit/algorithms/metrics/RelativePermabilityTest.py" ]
[ "import openpnm as op\nimport numpy.testing as nt\nmgr = op.Workspace()\n\n\nclass RelativePermeabilityTest:\n\n def setup_class(self):\n self.net = op.network.Cubic(shape=[5, 5, 5], spacing=1)\n self.geo = op.geometry.GenericGeometry(network=self.net,\n ...
[ [ "numpy.testing.assert_allclose" ] ]
massquantity/DNN-implementation
[ "bca336749a2076fa2873f57d9c2b6f98ebf18a0d" ]
[ "data/cifar_data.py" ]
[ "import os\nimport shutil\nimport gzip, tarfile\nimport pickle\nimport subprocess\nimport urllib.request\nimport numpy as np\n\npardir = os.path.dirname(os.path.abspath(__file__))\nif not os.path.exists(pardir + \"/cifar_raw_data\"):\n os.makedirs(pardir + \"/cifar_raw_data\")\ndataset_dir = pardir + \"/cifar_ra...
[ [ "numpy.array", "numpy.std", "numpy.eye", "numpy.mean" ] ]
2018sjain/language-by-letters
[ "bd952db6a26562bf575ad3e0ef48ee8c9d0b216a" ]
[ "data_analysis.py" ]
[ "import numpy as np\n\ndef num(letter):\n\tletter = letter.lower()\n\tif letter == ' ': return 0\n\treturn ord(letter) - 96\n\ndef percents(vals):\n\ttotal = sum(vals)\n\tif total == 0: total = 1 \n\tpercents = [(var/total) for var in vals]\n\treturn percents\n\nfiles = [['ENGLISH/english_clean.txt', 'english'], ['...
[ [ "numpy.save" ] ]
maximilianKoeper/melp
[ "863d1c55a36adf29f3508e15ecd5ed0a77544f53" ]
[ "melp/taft/utils/cosmic.py" ]
[ "import warnings\n\nimport ROOT\nimport numpy as np\n\nfrom melp.libs.misc import index_finder\nfrom melp.taft.utils.mu3eDisplay_helper import Trajectory, generate_txt_event_file\n\n# ---------------------------------------------\n\"\"\"\ndef cosmic_correction_z(__detector__, **kwargs):\n print(\"analyzing cosmi...
[ [ "numpy.sqrt" ] ]
Happy-Virus-IkBeom/LTH_Tensorflow
[ "a032bd01c689823a208b8ca616d483187e1e471e" ]
[ "foundations/model_base.py" ]
[ "# Copyright (C) 2018 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# Unless required by applicable law or agreed ...
[ [ "tensorflow.get_variable", "tensorflow.multiply", "tensorflow.matmul", "tensorflow.nn.softmax", "tensorflow.zeros_initializer", "tensorflow.constant_initializer", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.argmax", "tensorflow.summary.scalar" ] ]
jinjieyu/RCLSTM
[ "0f70617966cf4f21c4459cf321cea06db5b5c7c2" ]
[ "RCLSTM/xml2csv.py" ]
[ "# encoding: utf-8\n\n\"\"\"\n@author: huayuxiu\n\nTransform xml files to csv files.\nThe original traffic data are from GEANT, https://totem.info.ucl.ac.be/dataset.html\nPlease refer to data.pdf for the description of the traffic data\n\"\"\"\n\nimport xml.etree.cElementTree as et\nimport numpy as np\nimport os\n\...
[ [ "numpy.zeros" ] ]
topher-lo/datathon-starter-abandoned
[ "94d33378c165842fcc149fc5ff83ca1e2f8eddf5" ]
[ "client/app.py" ]
[ "\"\"\"Runs the streamlit app.\nCall this file in the terminal (from the `datathon-starter` dir)\nvia `streamlit run app.py`.\n\"\"\"\n\nimport pandas as pd\nimport streamlit as st\nimport missingno as msno\nimport time\n\nfrom pandas_profiling import ProfileReport\nfrom streamlit_pandas_profiling import st_profile...
[ [ "pandas.notna", "pandas.read_csv" ] ]
VanGy-code/3D-House-Blender
[ "8a9d91b1f3cc3988c0dcd7079223f2e541f9ec71" ]
[ "Generator.py" ]
[ "import bpy\nimport os\nimport json\nimport numpy as np\nfrom decimal import Decimal\nfrom mathutils import Vector, Matrix\n\n\ndef clean():\n # setting\n bpy.context.scene.use_nodes = True\n tree = bpy.context.scene.node_tree\n links = tree.links\n # Clear default nodes\n for n in tree.nodes:\n ...
[ [ "numpy.reshape" ] ]
georgesbarron/qiskit-aqua
[ "b38ca9893c5f9509693a2de48680781bed300987" ]
[ "qiskit/aqua/utils/qp_solver.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2020.\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...
[ [ "numpy.sqrt", "numpy.asarray", "numpy.eye", "numpy.ones", "numpy.outer", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
smit2k14/text-to-text-transfer-transformer
[ "2a3bed10cb36120a3899acd70ee987a4369701bb" ]
[ "t5/models/mesh_transformer_main.py" ]
[ "# Copyright 2020 The T5 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 law or agr...
[ [ "tensorflow.compat.v1.io.gfile.exists", "tensorflow.compat.v1.io.gfile.makedirs", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.logging.set_verbosity", "tensorflow.compat.v1.io.gfile.GFile" ] ]
maxwelljohn/topic-sort
[ "212bbd8be6c4bcb32a414f236088eb523913b151" ]
[ "topic_sort.py" ]
[ "#!/usr/bin/env python -O\n\nimport argparse\nimport nltk\nimport numpy as np\nimport pytest\nimport re\n\nimport optimizers\nimport order_problem\n\nnltk.download('stopwords', quiet=True)\nnltk.download('punkt', quiet=True)\nnltk.download('wordnet', quiet=True)\n\nPASSAGE_SEPARATOR = \"\\n\\n\"\nSTOPWORDS = set(nl...
[ [ "numpy.log", "numpy.sum" ] ]
hfboyce/MCL-DSCI-571-machine-learning
[ "25757369491ac547daa94ff1143ca7389d433a6e" ]
[ "exercises/en/solution_06_17.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split, cross_validate\nfrom sklearn.preprocessing import OneHotEncoder, StandardScaler\nfrom sklearn.impute import SimpleImputer\nfrom sklearn.compose import ColumnTransformer, make_column_transformer\nfrom sklearn.pipeline imp...
[ [ "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder", "sklearn.impute.SimpleImputer", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.neighbors.KNeighborsRegressor", "sklearn.compose.make_column_transformer", "sklearn.model_selection.cross_validate", ...
Amartya32/Leap_and_Motion_Capture
[ "710aaf96068f50c84d6e9461460e2b304dbf5e24" ]
[ "code/leap_data_extraction_code/leapDataExtraction.py" ]
[ "\n################################################################################ \n# https://developer.leapmotion.com/sdk_agreement, or another agreement #\n# between Leap Motion and you, your company or other organization. #\n##################################################################...
[ [ "numpy.fromstring" ] ]
CrazyAlan/nextAI
[ "e871b4078e9d591121f9093f2ba022e1c9115f7b" ]
[ "src/models/network.py" ]
[ "\"\"\"Functions for building the face recognition network.\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software withou...
[ [ "tensorflow.convert_to_tensor", "tensorflow.control_dependencies", "tensorflow.nn.max_pool", "tensorflow.train.ExponentialMovingAverage", "tensorflow.nn.l2_loss", "tensorflow.nn.conv2d", "tensorflow.nn.moments", "tensorflow.truncated_normal_initializer", "tensorflow.name_scope"...
marses/tiltx
[ "99e25750f3db1c2fb54463a90753e032c572a8b2" ]
[ "tiltx/data_generator.py" ]
[ "import numpy\n\n\nclass DataGenerator(object):\n \"\"\"Generate data to work with the package.\"\"\"\n\n def __init__(self,):\n pass\n\n @staticmethod\n def example(i):\n \"\"\"Recreate the values from Example i.\n The data is stored in data/data_i.txt for i in {1,...,6}.\n ...
[ [ "numpy.errstate" ] ]
brosaplanella/liionpack
[ "4c3f61b6f28e1419974c8572669d70fc173a6959" ]
[ "liionpack/solver_utils.py" ]
[ "#\n# Solver utilities\n#\n\nimport casadi\nimport pybamm\nimport numpy as np\nimport time as ticker\nimport liionpack as lp\nfrom tqdm import tqdm\n\n\ndef _mapped_step(model, solutions, inputs_dict, integrator, variables, t_eval):\n \"\"\"\n Internal function to process the model for one timestep in a mappe...
[ [ "numpy.abs", "numpy.linspace", "numpy.asarray", "numpy.around", "numpy.any", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
FireBERT-author/FireBERT
[ "c9e977e2863a51d179dc1072b468040e419c82ca" ]
[ "firebert_fve.py" ]
[ "# coding=utf-8\n# Copyright 2020 FireBERT authors. All rights reserved.\n#\n# Licensed under the MIT license\n# See https://github.com/FireBERT-author/FireBERT/blob/master/LICENSE for details\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed o...
[ [ "torch.normal", "numpy.arange", "torch.cuda.is_available", "torch.cat" ] ]
takashi-matsushita/lab
[ "894e5762f58046c68e665d7463db3d7359c15fda" ]
[ "dnn/ddqn.py" ]
[ "import random\n\nimport collections\n\nimport numpy as np\n\nimport keras\nfrom keras import layers\nfrom keras.models import Model\nfrom keras import backend as K\nfrom keras import optimizers\n\nimport tensorflow as tf\n\n\n\"\"\" double-DQN \"\"\"\nclass DDQN:\n def huber_loss(y_true, y_pred, delta=1.0):\n ...
[ [ "numpy.expand_dims", "numpy.argmax", "numpy.mean", "tensorflow.where", "numpy.array", "numpy.exp" ] ]
KEVINYZY/plume
[ "dbd523861bfb9abad8a52b1de28de85c0f128807" ]
[ "plume/svm.py" ]
[ "\"\"\"\n利用数值优化算法实现的 SVM,在 toysvm.py 中有对应的\nSMO 算法实现。\n\"\"\"\n\nimport numpy as np\nimport math\nimport scipy.optimize as opt\nfrom functools import partial\nfrom numba import jit\n\n\nclass LinearSVC(object):\n def __init__(self, C: float = 1.0):\n \"\"\"\n :param C: float. Penalty parameters.\n ...
[ [ "numpy.vectorize", "numpy.zeros", "numpy.sum", "numpy.linalg.norm" ] ]
tiesanguaixia/gconv-pytorch-deeplab-xception
[ "009fad814b13622fd2027330df2f00d9a31d0594" ]
[ "modeling/gfunc/plot/plot_p4m.py" ]
[ "import matplotlib.pyplot as plt\r\nfrom matplotlib.lines import Line2D\r\nfrom matplotlib.patches import FancyArrowPatch\r\n\r\nfrom gfunc.plot.plot_z2 import plot_z2\r\n\r\n\r\n# Miniature plot:\r\n# plot_p4m(imf.reshape(2, 4, 7, 7), rlabels='cayley2', fontsize=10,\r\n# labelpad_factor_1= .2, labelpad_fa...
[ [ "matplotlib.lines.Line2D", "matplotlib.patches.FancyArrowPatch", "matplotlib.pyplot.figure" ] ]
ApeMocker/CSM-for-fetal-HC-measurement
[ "a354d2ebd46eee6a3df11bf3fd413a340432c5b4" ]
[ "code/ellip_fit.py" ]
[ "\"\"\"\r\nThis script is used for ellipse fitting from edge images.\r\nRequirement: postprocess.py has been executed so edge images exist.\r\n\"\"\"\r\nimport pandas as pd\r\nimport os\r\nimport cv2\r\nfrom modules import ellip_fit\r\nimport numpy as np\r\n\r\n# Postprocess results folder\r\nedge_folder = '../resu...
[ [ "pandas.DataFrame" ] ]
nqbinh17/memo_track
[ "4f6a749a1cca4368ef41b4cf70be6acdaa267b47" ]
[ "fairseq/custom_transformer/fnet.py" ]
[ "import torch.nn as nn\nimport torch\n\nclass FNet(nn.Module):\n def __init__(self):\n super().__init__()\n\n def forward(self, x):\n x = torch.fft.fft(torch.fft.fft(x, dim=-1), dim=-2).real\n return x" ]
[ [ "torch.fft.fft" ] ]
tattaka/ukiyoe
[ "4a1024ddf30737e68923dcdd6a50580d912e076d" ]
[ "src/cls_models/commons.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nclass Swish(nn.Module):\n def forward(self, x):\n return x * torch.sigmoid(x)\n \nclass MishFunction(torch.autograd.Function):\n @staticmethod\n def forward(ctx, x):\n ctx.save_for_backward(x)\n ...
[ [ "torch.nn.functional.normalize", "torch.nn.Sequential", "torch.sigmoid", "torch.nn.AdaptiveMaxPool2d", "torch.cat", "torch.nn.Conv2d", "torch.exp", "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.interpolate", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.fu...
ahmedhamdy90/Deep-Learning-Neural-Network
[ "4a015b385958c313310aa9e30f6482431b1b845b" ]
[ "Tensorflow Hello World/tensorflow_example.py" ]
[ "import tensorflow as tf\nhello = tf.constant('Hello, TensorFlow!')\nsession = tf.Session()\nprint(session.run(hello))\nsession.close()" ]
[ [ "tensorflow.constant", "tensorflow.Session" ] ]
X-kimna/Music2Dance
[ "f09932aeb7e5944902c82790dffca904d6e9dfab" ]
[ "PoseNet/converter/tfjs2python.py" ]
[ "import json\nimport struct\nimport tensorflow as tf\nimport cv2\nimport numpy as np\nimport os\nimport yaml\nimport sys\n\nf = open(\"config.yaml\", \"r+\")\ncfg = yaml.load(f)\ncheckpoints = cfg['checkpoints']\nimageSize = cfg['imageSize']\nchk = cfg['chk']\noutputStride = cfg['outputStride']\nchkpoint = checkpoi...
[ [ "tensorflow.nn.relu6", "tensorflow.Variable", "tensorflow.cast", "tensorflow.sigmoid", "tensorflow.placeholder", "tensorflow.reshape", "numpy.ndarray", "tensorflow.global_variables_initializer", "tensorflow.variable_scope", "numpy.mean", "tensorflow.Session", "tenso...
andrewwarrington/cost-optimal-particle-filter
[ "a6acb60ca90c7f7b984182891d39adeb7e05724f" ]
[ "inhomogenousPaths/boSolverInhomogenous.py" ]
[ "# MIT License\n#\n# Copyright (c) 2018, Andrew Warrington.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use,...
[ [ "matplotlib.pyplot.scatter", "numpy.squeeze", "numpy.argmax", "matplotlib.pyplot.axis", "matplotlib.pyplot.pause", "matplotlib.pyplot.figure" ] ]
Kilichbek/artemis-m2-transformer
[ "99f7e797965710bf2565283d6b5028a6fe32664c" ]
[ "data/field.py" ]
[ "# coding: utf8\nimport base64\nimport csv\nimport os\nimport pickle\nimport shutil\nimport sys\nimport warnings\nfrom collections import Counter, OrderedDict\nfrom itertools import chain\n\nimport numpy as np\nimport six\nimport torch\nfrom torch.utils.data.dataloader import default_collate\nfrom tqdm import tqdm\...
[ [ "torch.tensor", "numpy.frombuffer", "numpy.random.rand", "numpy.zeros", "torch.utils.data.dataloader.default_collate" ] ]
onkar-sima-ai/tvm
[ "2d321202fb2683edc5b18179ac564b5218e2fcbf" ]
[ "python/tvm/runtime/vm.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.array" ] ]
SmaugTheTerrible/cvtest
[ "ebca2da96d4d03d8ef5c5f64ae997de9a7e8dde0" ]
[ "cvtest.py" ]
[ "import cv2\nimport numpy\nimport pyautogui\nimport threading\n\n\ndef match(template, source=None, method=cv2.TM_CCOEFF_NORMED, threshold=0.95):\n if (source is None):\n source = screenshot()\n\n res = cv2.matchTemplate(source, template, method)\n loc = numpy.where(res >= threshold)\n return zip...
[ [ "numpy.array", "numpy.where" ] ]
trituenhantaoio/anfis-pytorch
[ "7a6bf123d69b550e46abeddd5b4a776243d43aa6" ]
[ "jang_pendulum_example.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n'''\n ANFIS in torch: Control examples from Jang's book, chapter 17.\n Section 17.6.2: Recurrent learning, inverted pendulum case study.\n or \"Self Learning of Fuzzy Controllers Based on Temporal Back Propagation\"\n IEEE Trans on Neural Network...
[ [ "torch.mean", "matplotlib.pyplot.legend", "torch.empty", "numpy.random.seed", "torch.zeros", "torch.cat", "torch.sin", "matplotlib.pyplot.hlines", "torch.sum", "torch.tensor", "torch.stack", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "torch.cos", ...
aryanmangal769/UGV-DTU_ROS_Stack
[ "6a00c83d076361bdf171c1ad4ef383ad262da4e6" ]
[ "Scripts/Prototypes/img_sub_lanes_pub.py" ]
[ "#!/usr/bin/env python\n\n# Python libs\nimport sys, time\n\n# numpy and scipy\nimport numpy as np\nimport math\nfrom scipy.ndimage import filters\n\n# OpenCV\nimport cv2\n\n# Ros libraries\nimport roslib\nimport rospy\n\n# Ros Messages\nfrom sensor_msgs.msg import CompressedImage\nfrom sensor_msgs.msg import Laser...
[ [ "numpy.fromstring", "numpy.zeros_like", "numpy.float32", "numpy.array", "numpy.zeros" ] ]
lkbr1808/DIF-Net
[ "538858c8c89e1b4f37c24533ebd6651ae8eb413b" ]
[ "modules.py" ]
[ "'''Define basic blocks\n'''\n\nimport torch\nfrom torch import nn\nfrom torchmeta.modules import (MetaModule, MetaSequential)\n# from torchmeta.modules.utils import get_subdict\nimport numpy as np\nfrom collections import OrderedDict\nimport math\nimport torch.nn.functional as F\n\n'''Adapted from the SIREN reposi...
[ [ "torch.nn.Linear.forward", "torch.nn.Softplus", "numpy.sqrt", "torch.sin", "torch.nn.ELU", "torch.nn.init.xavier_normal_", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.no_grad", "torch.nn.SELU", "torch.nn.init.zeros_", "torch.nn.ReLU", "torch.nn.init.kaiming_norm...
0x8b/HackerRank
[ "45e1a0e2be68950505c0a75218715bd3132a428b" ]
[ "aoc2016/03.py" ]
[ "#!/usr/bin/env python\n\nimport fileinput\n\nimport numpy as np\n\ndata = []\n\nfor line in fileinput.input():\n data.append(list(map(int, line.strip().split())))\n\n\ndef count(data):\n triangles = 0\n\n for a, b, c in data:\n if a + b > c and a + c > b and b + c > a:\n triangles += 1\n...
[ [ "numpy.array" ] ]
jzabl/mpdaf
[ "806baab8b793ba1cdbde4ce9ea13116f8ca327ee", "806baab8b793ba1cdbde4ce9ea13116f8ca327ee" ]
[ "lib/mpdaf/sdetect/tests/test_segmap.py", "lib/mpdaf/obj/image.py" ]
[ "\"\"\"\nCopyright (c) 2010-2018 CNRS / Centre de Recherche Astrophysique de Lyon\nCopyright (c) 2019 Simon Conseil <simon.conseil@univ-lyon1.fr>\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are...
[ [ "numpy.arange", "numpy.max", "numpy.unique" ], [ "numpy.dot", "scipy.ndimage.binary_erosion", "numpy.minimum", "numpy.radians", "numpy.sqrt", "numpy.asarray", "numpy.rad2deg", "numpy.arctan2", "numpy.max", "scipy.signal.correlate2d", "numpy.zeros_like", ...
CVC-TDA-ADRE/MonoDEVSNet
[ "25e2f7cd28909f933eb2f8dd7db9046dc7237635" ]
[ "datasets_EXT/vk_dataset.py" ]
[ "# Author: Akhil Gurram\n# Build on top of the monodepth2\n# (Automatically pulled from git repo, monodepth2 source code is not included in this repository)\n# This is the training script of the MonoDEVSNet framework.\n# MonoDEVSNet: Monocular Depth Estimation through Virtual-world Supervision and Real-world SfM Se...
[ [ "pandas.read_csv", "numpy.expand_dims", "numpy.logical_and", "numpy.eye", "torch.from_numpy", "numpy.ones", "numpy.linalg.pinv", "numpy.array", "numpy.zeros", "numpy.where" ] ]
AirWalk-Digital/o365-documentation
[ "81be385b813c28d0029c9d0973ba0a347551d271" ]
[ "run_flask.py" ]
[ "\"\"\"Flask-OAuthlib sample for Microsoft Graph\"\"\"\n# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.\n# See LICENSE in the project root for license information.\nimport uuid\n\nimport flask\nfrom flask_oauthlib.client import OAuth\nfrom flask import session, request, redirect\n\nf...
[ [ "numpy.delete", "numpy.empty", "pandas.DataFrame" ] ]
JieZheng-ShanghaiTech/HiCoEx
[ "1b3d4b80d3af9751cdd7a0cabda7af377d1c1253" ]
[ "src/link_prediction/utils_link_prediction.py" ]
[ "import itertools\nimport os\nimport pickle\nfrom collections import defaultdict\nfrom multiprocessing import Pool\nfrom time import time\n\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\nimport scipy.sparse as sps\nfrom bionev.utils import load_embedding\nfrom sklearn.ensemble import RandomForestC...
[ [ "sklearn.neural_network.MLPClassifier", "sklearn.metrics.roc_auc_score", "sklearn.metrics.confusion_matrix", "numpy.mean", "sklearn.metrics.f1_score", "numpy.random.randint", "numpy.hstack", "sklearn.ensemble.RandomForestClassifier", "numpy.unique", "numpy.arange", "skl...
python-recsys/mrec
[ "50c28a0384f2499bdc85afa3210eefed6b94011f" ]
[ "mrec/__init__.py" ]
[ "import numpy as np\nfrom scipy.sparse import coo_matrix, csr_matrix\nfrom scipy.io import mmread\ntry:\n import cPickle as pickle\nexcept ImportError:\n import pickle\n\nfrom sparse import fast_sparse_matrix, loadtxt, loadz\nfrom base_recommender import BaseRecommender\n\ndef load_fast_sparse_matrix(input_fo...
[ [ "scipy.io.mmread", "numpy.load", "scipy.sparse.coo_matrix", "numpy.savez" ] ]
jsbyysheng/captcha-recognition
[ "69340a5a83451c4780b7a34729b572582ed3544b" ]
[ "src/data.py" ]
[ "import os\nimport numpy as np\n\nfrom sklearn.model_selection import train_test_split\n\n\ndef get_data(path):\n \"\"\"\n Get images name in path\n :param path: the path to save images\n :return: image list filled with names and their labels.\n \"\"\"\n image_names = os.listdir(path)\n image_n...
[ [ "sklearn.model_selection.train_test_split", "numpy.save", "numpy.load", "numpy.array", "numpy.sum" ] ]
fred3m/astro_pypelines
[ "fbf62f2c4b8015fdb86192c7aed04e189cacf5a3" ]
[ "astro_pypelines/pypelines/interactive_plots/plots.py" ]
[ "from __future__ import division, print_function\nimport os\nimport numpy as np\nfrom astropy.table import Table\nfrom astropy.modeling import models, fitting\n\nfit_types = {\n 'linearLSQ': fitting.LinearLSQFitter(),\n 'levMarLSQ': fitting.LevMarLSQFitter(),\n 'SLSQPLSQ': fitting.SLSQPLSQFitter(),\n 's...
[ [ "numpy.amax", "numpy.sqrt", "numpy.amin", "numpy.isnan", "numpy.load", "numpy.array", "numpy.sum" ] ]
ahmhekal/Final_Project
[ "7d2137841c99239fe389754634c2185d9767a81f" ]
[ "ros/src/tl_detector/tl_detector.py" ]
[ "#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_classifier...
[ [ "scipy.spatial.KDTree" ] ]
fossabot/feast
[ "0c0b50927ce023315e25edba16b0f573431ef2d8" ]
[ "tests/e2e/redis/basic-ingest-redis-serving.py" ]
[ "import math\nimport os\nimport random\nimport tempfile\nimport time\nimport uuid\nfrom copy import copy\nfrom datetime import datetime, timedelta\n\nimport grpc\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport pytz\nfrom google.protobuf.duration_pb2 import Duration\n\nfrom feast.client import Client...
[ [ "pandas.concat", "numpy.int32", "pandas.DataFrame", "numpy.int64", "numpy.random.rand", "numpy.float64", "numpy.array", "numpy.float" ] ]
QuVil/mon-bot-le-dj
[ "e9320fc19b1665dbb023c5eac015a208ba612750", "e9320fc19b1665dbb023c5eac015a208ba612750" ]
[ "src/ach.py", "src/muzik.py" ]
[ "import time\n\nimport pandas as pd\nimport numpy as np\nfrom googleapiclient.discovery import build\nfrom google.oauth2.service_account import Credentials\n\nfrom src.util import create_cache_dir, cache\n\nCREDENTIALS_PATH_GOOGLE = 'google-credentials.json'\nSCOPES = ['https://www.googleapis.com/auth/spreadsheets'...
[ [ "pandas.DataFrame.from_records" ], [ "pandas.concat", "pandas.MultiIndex.from_frame", "pandas.Series", "pandas.DataFrame", "numpy.array_split", "pandas.read_pickle" ] ]
SimonTheVillain/ActiveStereoNet
[ "708bddce844998b366be1a1ec8a72a31ccd26f8c", "708bddce844998b366be1a1ec8a72a31ccd26f8c" ]
[ "Data/pfm_helper.py", "utils/cost_volume.py" ]
[ "import re\nimport numpy as np\n \nimport pdb\n\ndef read_pfm(file):\n \n file = open(file, 'rb')\n\n color = None\n width = None\n height = None\n scale = None\n endian = None\n\n header = file.readline().rstrip()\n header = str(header, 'utf-8')\n \n if header == 'PF':\n col...
[ [ "numpy.reshape", "numpy.fromfile", "numpy.flipud" ], [ "torch.stack", "numpy.zeros", "torch.from_numpy", "torch.cat" ] ]
CJWorkbench/arrow-tools
[ "1944e40853d82d7dad3d47a72958326cefff367a" ]
[ "tests/util.py" ]
[ "from contextlib import contextmanager, suppress\nimport pathlib\nimport os\nimport tempfile\nfrom typing import ContextManager\nimport unittest\nfrom pandas.testing import assert_series_equal\nimport pyarrow\n\n\ndef assert_table_equals(actual: pyarrow.Table, expected: pyarrow.Table) -> None:\n assertEqual = un...
[ [ "pandas.testing.assert_series_equal" ] ]
ZAKAUDD/-GEU-Net
[ "5251d329afb80c74328e72fd2fc21ff691ef3353" ]
[ "model/sparse_switchable_norm.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nfrom utils.ssn_utils import sparsestmax\r\n\r\n\r\nclass SSN2d(nn.Module):\r\n def __init__(self, num_features, eps=1e-5, momentum=0.997, using_moving_average=True, last_gamma=False):\r\n super(SSN2d, self).__init__()\r\n self.eps = eps\r\n self.mome...
[ [ "torch.LongTensor", "torch.ones", "torch.zeros", "torch.squeeze", "torch.autograd.Variable" ] ]
Byung-June/oil_future_forecasting
[ "c94368e93cb6df52d53bdb3feb32265b922a0cd7" ]
[ "data_preprocessing/ml_data_preprocessing/utils.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.utils import shuffle\n\n\ndef add_name(list_, name):\n list_ = list(list_)\n for i, elt in enumerate(list_):\n list_[i] = elt + name\n return list_\n\n\ndef make_lag(df, num_lags=10, fillna=True):\n concat = []\n if fillna:\n df = d...
[ [ "pandas.concat", "pandas.read_excel", "pandas.to_datetime", "sklearn.utils.shuffle", "pandas.ExcelFile" ] ]
tarpas/sktime
[ "a46596f6e7756d3ca5c0e617c0b61f561eacf280" ]
[ "sktime/classification/compose/_pipeline.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Pipeline with a classifier.\"\"\"\n# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\nimport numpy as np\nfrom sklearn.base import clone\n\nfrom sktime.base import _HeterogenousMetaEstimator\nfrom sktime.classification.base import BaseClassifier\nfrom sktime.tra...
[ [ "sklearn.base.clone" ] ]
tnakaicode/SimpleQmap-Win
[ "b533bef650f8f1388f2cbb99aef3d5e8f8aa2860" ]
[ "SimpleQmap/unittest/test_state.py" ]
[ "import unittest\nimport numpy as np\nimport SimpleQmap as S\n\n\nclass TestState(unittest.TestCase):\n def setUp(self):\n self.dim = int(np.random.randint(1,100)*2)\n xmax = np.random.random()\n xmin = -xmax\n ymax = np.random.random()\n ymin = -ymax\n self.domain = [[x...
[ [ "numpy.random.random", "numpy.conj", "numpy.linspace", "numpy.all", "numpy.random.randint" ] ]
AKI-maggie/adapted_deep_embeddings
[ "a93c5061c09fa1a42d54053cd82e71cef447e4b8" ]
[ "models/baseline_model.py" ]
[ "'''\nAdapted from https://danijar.com/structuring-your-tensorflow-models/\n'''\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom functools import partial\nimport os\nimport sys\nimport tensorflow as tf\n\nfrom .model import Model\nfrom .utils ...
[ [ "tensorflow.train.latest_checkpoint", "tensorflow.control_dependencies", "tensorflow.get_collection", "tensorflow.global_variables", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.contrib.layers.flatten", "tensorflow.one_hot", "tensorflow.train.AdamOptimizer" ] ]
shifaoh/dna2vec
[ "9ad055d8c772187261dad17d44ceee465c636ba9" ]
[ "scripts/train_dna2vec.py" ]
[ "#!/usr/bin/env python3\n\nimport sys\nsys.path.extend(['.', '..'])\n\nimport glob\nimport logbook\nfrom logbook.compat import redirect_logging\nimport configargparse\nimport numpy as np\nfrom Bio import SeqIO\nfrom attic_util.time_benchmark import Benchmark\nfrom attic_util import util\nfrom attic_util.tee import ...
[ [ "numpy.random.seed" ] ]
FazelYU/Adaptive-Navigation
[ "95d4aa7603fb416c5c4ebc4560724f85c93cee22" ]
[ "environments/sumo/Utils.py" ]
[ "import numpy\nimport torch\nimport json\nimport random\nimport traci\nfrom inspect import currentframe, getframeinfo\nimport networkx as nx\nimport pymorton as pm\nimport pandas as pd\nfrom sklearn.manifold import TSNE\nimport math\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport s...
[ [ "torch.autograd.set_detect_anomaly", "torch.zeros", "pandas.DataFrame", "torch.vstack", "numpy.max", "torch.no_grad", "numpy.histogram", "torch.eq", "torch.tensor", "matplotlib.pyplot.gcf", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplo...
adtamayop/Ejercicios_NN
[ "b5e9412ca03f6bb1f82ebe71a0c4ef16f80ec028" ]
[ "tensorflow_graph_in_jupyter.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\r\n\r\n# This module defines the show_graph() function to visualize a TensorFlow graph within Jupyter.\r\n\r\n# As far as I can tell, this code was originally written by Alex Mordvintsev at:\r\n# https://github.com/tensorflow/tensor...
[ [ "tensorflow.GraphDef", "numpy.random.rand" ] ]
dominiccarrano/backdoor-nn-geometry
[ "d1fa0754f1d57a9b303e2eb71edf0787a86529c8" ]
[ "trojai_runner.py" ]
[ "import numpy as np\nimport pandas as pd\nimport torch\nimport os\nimport argparse\nfrom torch.utils.data import DataLoader, sampler, TensorDataset, ConcatDataset\nfrom attack_functions import *\nfrom trojai_utils import *\nfrom boundary_geometry import *\n\nparser = argparse.ArgumentParser(description=\"TrojAI Rou...
[ [ "pandas.read_csv", "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader", "torch.utils.data.ConcatDataset", "torch.cuda.is_available", "torch.device" ] ]
KailongPeng/rt-cloud
[ "c19d524b9fa6f15966f1c0c4dd6fcbe55b386126" ]
[ "tests/test_bidsIncremental.py" ]
[ "from copy import deepcopy\nimport logging\nimport os\nimport pickle\n\nfrom bids.layout import BIDSImageFile\nfrom bids.layout.writing import build_path as bids_build_path\nimport nibabel as nib\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom rtCommon.bidsCommon import (\n BIDS_DIR_PATH_PATTERN,...
[ [ "numpy.array_equal", "numpy.where", "numpy.allclose", "pandas.DataFrame" ] ]
anonymouscodeeee/MBRL4FIN
[ "f7608b54e1a21be5f9e37ab9b249e825b872b35f" ]
[ "dynamic_model.py" ]
[ "import torch\nimport torch.nn as nn\nimport math\nimport copy\nfrom typing import Tuple, Optional, List, Callable\nimport abc\nimport random\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport pathlib\nimport numpy as np\n\nimport sys, os\n\nos.environ[\"PATH\"] = os.environ[\"PATH\"] + \":\" + os.p...
[ [ "torch.nn.Dropout", "torch.cat", "torch.zeros", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.nn.Linear", "torch.no_grad", "torch.nn.ReLU", "torch.nn.MSELoss" ] ]
tomwhite/covid-19-uk-data
[ "ca22568cea5a67863fe513eb6ad27aaf9ad58f48" ]
[ "tools/crawl_all.py" ]
[ "#!/usr/bin/env python\n\n# Crawls all the historical data in one go. This ensures that revisions of old data are accounted for.\n\nimport dateparser\nimport datetime\nimport json\nimport math\nimport numpy as np\nimport os\nimport pandas as pd\nimport requests\nimport sqlite3\nimport sys\nimport xmltodict\n\nfrom ...
[ [ "pandas.read_excel", "pandas.concat", "pandas.read_csv", "pandas.DataFrame.from_dict" ] ]
sitaber/pyDM404
[ "63e84cc3b82c6b1910846e388954d67f3fb05ade" ]
[ "app.py" ]
[ "# -----------------------------------------------------------------------------\n# pyDM404 - A cross platform Drum Sequencer\n# Author: Scott Taber\n# File: app.py - Nuts and bolts of application\n# Version: 1.2\n# Contains all functions and classes for drawing to screen, getting user input\n# loading and saving f...
[ [ "numpy.abs", "numpy.nonzero", "numpy.arange", "numpy.save", "numpy.floor", "numpy.load", "numpy.array", "numpy.zeros" ] ]
MageshDominator/data-science-py
[ "6dd98a16e72bda96cf5fa3db01c044e3f1b66c05" ]
[ "My_algorithms/Logistic_Regression/DataPreprocessing.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 4 21:04:05 2019\n\n@author: MAGESHWARAN\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score\nfrom LogReg import LogRegWithRegularization\n\ndata = pd.read_csv(\"ex2d...
[ [ "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.array", "numpy.zeros", "sklearn.metrics.accuracy_score" ] ]
bojigu/thoipapy
[ "cc571677bd7e25e73db07af9d5d3c2cc36682903", "cc571677bd7e25e73db07af9d5d3c2cc36682903" ]
[ "thoipapy/figs/create_BOcurve_files.py", "thoipapy/validation/precision_recall.py" ]
[ "import warnings\nfrom pathlib import Path\nfrom typing import Union\n\nwarnings.simplefilter(action='ignore', category=FutureWarning)\nimport pandas as pd\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport warnings\nfrom scipy.stats import linregress\nfrom thoipapy.utils import normalise_0_1, ...
[ [ "pandas.read_excel", "pandas.Series", "matplotlib.pyplot.subplots", "scipy.stats.linregress", "matplotlib.pyplot.close", "numpy.array", "numpy.trapz" ], [ "sklearn.metrics.auc", "matplotlib.pyplot.subplots", "sklearn.metrics.precision_recall_curve", "pandas.DataFram...
opz/pyti
[ "1ecc174195525bb3bdf401252244f80f02df04ef" ]
[ "pyti/relative_strength_index.py" ]
[ "from __future__ import absolute_import\nimport numpy as np\nfrom pyti import catch_errors\nfrom pyti.function_helper import fill_for_noncomputable_vals\nfrom six.moves import range\nfrom six.moves import zip\n\n\ndef relative_strength_index(data, period):\n \"\"\"\n Relative Strength Index.\n\n Formula:\n...
[ [ "numpy.mean" ] ]
mega002/DANN-MNLI
[ "bd27c5ec70d2b68453dd16f90a3b8d2f28f7a945" ]
[ "python/util/flip_gradient.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework import ops\n\n\nclass FlipGradientBuilder(object):\n def __init__(self):\n self.num_calls = 0\n\n def __call__(self, x, l=1.0):\n grad_name = \"FlipGradient%d\" % self.num_calls\n\n @ops.RegisterGradient(grad_name)\n def _f...
[ [ "tensorflow.negative", "tensorflow.get_default_graph", "tensorflow.identity", "tensorflow.python.framework.ops.RegisterGradient" ] ]
wall-ed-coder/ReAgent
[ "92f223a135b8fbc0942a217acb117ad0935897a3" ]
[ "reagent/training/ranking/seq2slate_attn_trainer.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\nimport logging\n\nimport reagent.types as rlt\nimport torch\nimport torch.nn as nn\nfrom reagent.core.dataclasses import field\nfrom reagent.core.tracker import observable\nfrom reagent.model_utils.seq2slate_utils impo...
[ [ "torch.nn.LogSoftmax", "torch.nn.KLDivLoss" ] ]
mjunix/arrow
[ "4144c1739ec2e58d5f076fa63a0b61653324dc02" ]
[ "python/pyarrow/tests/test_pandas.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.to_datetime", "pandas.testing.assert_series_equal", "pandas.Series", "numpy.linspace", "numpy.asarray", "pandas.RangeIndex", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.dtype", "numpy.random.random_sample", "pandas.testing.assert_frame_equal", ...
Tillsten/pyqtgraph
[ "0045863165fe526988c58cf4f8232ae2d261a5ee" ]
[ "pyqtgraph/graphicsItems/ScatterPlotItem.py" ]
[ "from ..Qt import QtGui, QtCore, USE_PYSIDE\nfrom ..Point import Point\nfrom .. import functions as fn\nfrom .GraphicsItem import GraphicsItem\nfrom .GraphicsObject import GraphicsObject\nfrom itertools import starmap, repeat\ntry:\n from itertools import imap\nexcept ImportError:\n imap = map\nimport numpy a...
[ [ "numpy.nanmax", "numpy.isfinite", "numpy.clip", "numpy.vstack", "numpy.nanmin", "numpy.percentile", "numpy.equal", "numpy.isscalar", "numpy.any", "numpy.zeros", "numpy.empty" ] ]
melhabr/edge-model-converter
[ "26d967d29413d2e8f4bacc8ab2e5809a1289eae0" ]
[ "converter_util.py" ]
[ "import queue\n\n\n# Returns a GraphCharacteristics object given a tensorflow graphdef, which has the following properties:\n# nodes_by_name: A dictionary that maps node names to node objects in the graph\n# node_outputs_by_name: A dictionary that maps node names to their respective output node objects\n# input_nod...
[ [ "tensorflow.graph_util.import_graph_def" ] ]
hshaban/epathermostat_nw
[ "6fec9402484e1ef7e4e59e2c679d9a8efee99ad6" ]
[ "tests/test_eeweather_wrapper.py" ]
[ "import pytest\nimport pandas as pd\nfrom thermostat_nw.eeweather_wrapper import get_indexed_temperatures_eeweather\nfrom .fixtures.single_stage import thermostat_type_1\n\n\ndef test_get_indexed_temperatures_eeweather_empty_index():\n empty_index = pd.DataFrame()\n results = get_indexed_temperatures_eeweathe...
[ [ "pandas.Timestamp", "pandas.DataFrame", "pandas.date_range" ] ]
grantseiter/OECD-Corporate-Tax-Burden-App
[ "bdf4029af7ee393814de72bb983bda37fe6c9d78" ]
[ "app.py" ]
[ "import os\nimport pandas as pd\nimport numpy as np\nimport plotly.io as pio\nimport plotly.graph_objects as go\nimport dash\nfrom dash import dcc\nfrom dash import html\nfrom dash import dash_table\nfrom dash.dependencies import Input, Output\nimport base64\n\nimage_filename = \"assets/aei_logo.png\"\nencoded_imag...
[ [ "pandas.Index", "pandas.read_csv", "pandas.melt", "numpy.average" ] ]
felixhjh/Serving
[ "3979a174f1a5c905b11545dbeb9db27b5a83243b" ]
[ "examples/Pipeline/PaddleOCR/ocr/web_service.py" ]
[ "# Copyright (c) 2020 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.concatenate", "numpy.frombuffer", "numpy.zeros" ] ]
airxiechao/gap
[ "1262bb7063da95011479839b4ccb4d9ed2e97020" ]
[ "models/gap/exec.py" ]
[ "import argparse\nimport csv\nimport logging\nimport os\nimport random\nimport sys\nimport shutil\nimport contextlib\n\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,\n TensorDataset)\nfrom torch.utils.d...
[ [ "torch.nn.CrossEntropyLoss", "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.utils.data.TensorDataset", "torch.utils.data.SequentialSampler", "torch.utils.data.RandomSampler", "torch.utils.data.DataLoader", "torch.tensor", "sklearn.metrics.log_loss", "num...
VGGVRobotics/doper
[ "d0ebb9bc8ad9c326deac0b457769d04a92066f11" ]
[ "doper/scenes/multiple_scenes.py" ]
[ "__all__ = [\"MultipleScenes\"]\n\nimport logging\nfrom glob import glob\n\nimport numpy as onp\n\nfrom doper.utils.assets import get_svg_scene\nfrom .single_scene import SingleScene\n\nlogger = logging.getLogger(__name__)\n\n\nclass MultipleScenes():\n def __init__(self, config: dict):\n self.config = co...
[ [ "numpy.random.choice" ] ]
coded5282/youtube-8m
[ "888354ff1b20de529e3270f4eeec320e692de935" ]
[ "ensemble.py" ]
[ "# Ensemble submission csv files together\n\nimport numpy as np\nimport pandas as pd\nimport itertools\n\nfns = [ # files for ensembling\n \"lstm.csv\"\n \"moe4_do.csv\"\n]\nfn0, fn1 = fns # getting each file to variable\n\noutfn=\"weighted_predictions.csv\" # output file\n\ndef parse_line(ln):\n id_, vals = ln...
[ [ "pandas.concat", "numpy.array", "pandas.DataFrame" ] ]
zigonk/CMPC-Refseg
[ "0d59c90e9968ed836c695976ff90081e1c24378a" ]
[ "generate_black.py" ]
[ "import numpy as np\nimport os\nimport json\nimport cv2\n\ncfg = {\n \"meta\": \"/mnt/MyPassport/Youtube-VOS/meta_expressions/meta_expressions/valid/meta_expressions.json\",\n \"visdir\": \"./Annotations_1channel\",\n}\n\n\n\nblack_img = np.zeros((720, 1280)).astype(np.uint8)\n\ncnt = 0\nmeta_expression = {}\...
[ [ "numpy.zeros" ] ]
lchorbadjiev/SCGV
[ "7b2fd1fbada7bea49166e37bcb82bd742617fe51" ]
[ "scgv/views/sample.py" ]
[ "'''\nCreated on Dec 14, 2016\n\n@author: lubo\n'''\nimport numpy as np\nfrom scgv.views.base import ViewerBase\n\n\nclass SamplesViewer(ViewerBase):\n\n def __init__(self, model):\n super(SamplesViewer, self).__init__(model)\n\n def calc_chrom_lines(self):\n return self.model.calc_chrom_lines()...
[ [ "numpy.sum" ] ]
qilei123/vision2
[ "e62f8cc0030b4d0943b818759c6bf99dae7f2694" ]
[ "torchvision/transforms/transforms.py" ]
[ "from __future__ import division\nimport torch\nimport math\nimport sys\nimport random\nfrom PIL import Image\ntry:\n import accimage\nexcept ImportError:\n accimage = None\nimport numpy as np\nimport numbers\nimport types\nimport collections\nimport warnings\n\nfrom . import functional as F\n\nif sys.version...
[ [ "torch.mm" ] ]
DaniloZZZ/ising_model
[ "e9282aec1a445058b9e0fd1c8b4788390a9beb69" ]
[ "syntesis/scripts/torch_ising.py" ]
[ "import torch as T\nimport numpy as np\nfrom itertools import product\nfrom torch.functional import F\nimport scripts.ising as ising\n\ndef get_nn_mask(J, mu):\n return np.array([\n [0, J, 0]\n ,[J, mu, J]\n ,[0, J, 0]\n ])\ndef get_funny_mask(J, mu):\n return np.array([\n [J*...
[ [ "numpy.ix_", "numpy.sqrt", "torch.rand_like", "numpy.arange", "torch.nn.Conv2d", "torch.functional.F.relu", "torch.from_numpy", "numpy.array", "numpy.random.randint" ] ]
uuefi/speech-to-text-benchmark
[ "214f0dedad888730944676be2f2876e8c48efed5" ]
[ "processing.py" ]
[ "import os\nimport wave\nfrom warnings import warn\n\nfrom pydub import AudioSegment\nfrom pydub.utils import mediainfo\nimport librosa\nimport numpy as np\nimport scipy\nimport soundfile as sf\n\n\n# helper to figure out the issue\ndef frame_rate_channel(audio_file_name, head):\n #x, _ = librosa.load(audio_file...
[ [ "numpy.abs", "numpy.iinfo" ] ]
ariecattan/s2e-coref
[ "2ebe126902f7a939f486a05e8ae036032a26a10a" ]
[ "run_coref.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport logging\nimport os\nimport shutil\nimport git\nimport torch\n\nfrom transformers import AutoConfig, AutoTokenizer, CONFIG_MAPPING, LongformerConfig, RobertaConfig\n\nfrom modeling import S2E\nfrom data import get_dataset\nfrom cli import pa...
[ [ "torch.distributed.init_process_group", "torch.cuda.set_device", "torch.distributed.barrier", "torch.cuda.is_available", "torch.device", "torch.distributed.get_rank", "torch.cuda.device_count" ] ]
jabae/detectEM
[ "2d1a5116164d0bed0a8ea767a227d05a8970a448" ]
[ "EMDetector/train/utils.py" ]
[ "from __future__ import print_function\nimport imp\nimport os\n\nimport numpy as np\n\nimport torch\nfrom torch.nn.parallel import data_parallel\nfrom torch.cuda import *\n\nfrom train.data import Data\nfrom train.model import Model\n\n\n\ndef load_model(opt):\n # Create a model.\n net = opt.net\n net.cuda...
[ [ "torch.nn.parallel.data_parallel" ] ]
liboyuty/Mutual-Cover
[ "b5589004e8ecc4858fe6bc50b1a13393a07a01ec" ]
[ "disclosure_mutual_diversity.py" ]
[ "import pandas as pd\r\nimport random\r\n\r\n\r\nrandom.seed(42)\r\n\r\n\r\nclass CheckDisclosure:\r\n def __init__(self):\r\n self.ori_path = \"./filter_data.csv\" # 原始数据路径\r\n self.mutual_path = \"./results/mutual_cover/diversity/mutual_\" ...
[ [ "pandas.read_csv" ] ]
bgoesswein/implementation_backend
[ "546018eb5dba79b823e3cfb20472271e02045789" ]
[ "services/jobs/jobs/dependencies/process.py" ]
[ "from ..models import Job\nimport numpy as np\nfrom datetime import datetime\ncoords = [(10.288696, 45.935871), (12.189331, 46.905246)]\n\nFACTOR_RESOLUTION = 1000\n\n\ndef reproject(latitude, longitude):\n \"\"\"Returns the x & y coordinates in meters using a sinusoidal projection\"\"\"\n from math import pi...
[ [ "numpy.fmax.reduce", "numpy.fmin.reduce", "numpy.ones" ] ]
HindsightInstructionFollowing/gym-minigrid
[ "e01c561634ae4c91717444ca86b338aba2ff4ac4" ]
[ "gym_minigrid/wrappers.py" ]
[ "import math\nimport operator\nfrom functools import reduce\n\nimport numpy as np\nimport gym\nfrom gym import error, spaces, utils\nfrom gym_minigrid.minigrid import OBJECT_TO_IDX, COLOR_TO_IDX, STATE_TO_IDX, \\\n SHADE_TO_IDX, SIZE_TO_IDX\nfrom gym_minigrid.minigrid import CELL_PIXELS\n\nimport json\nimport to...
[ [ "torch.LongTensor", "torch.Tensor", "torch.tensor", "numpy.concatenate", "torch.FloatTensor", "numpy.array", "numpy.zeros" ] ]
vsahil/influence-duplicate
[ "ae5bc77be6dcb7d69054a520733c373d833552da" ]
[ "benchmarks/german/facet_plots.py" ]
[ "\n\nfrom plotnine import *\n# from plotnine import ggplot, geom_point, geom_line, aes, stat_smooth, facet_wrap\n# from plotnine.data import mtcars\n# from plotnine import positions\n# from plotnine import xlab, ylab, ggtitle, geom_boxplot, geom_path, geom_ribbon, geom_arrow\nimport pandas as pd\n# df = pd.read_csv...
[ [ "pandas.read_csv" ] ]