repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ambimanus/appsim
[ "8f60b3a736af8aa7f03435c28aef2685a3dbfbe3" ]
[ "stats-slp.py" ]
[ "import sys\nimport os\nfrom datetime import timedelta\n\nimport numpy as np\n\nimport scenario_factory\nfrom analyze import _read_slp, norm\n\n\n# http://www.javascripter.net/faq/hextorgb.htm\nPRIMA = (148/256, 164/256, 182/256)\nPRIMB = (101/256, 129/256, 164/256)\nPRIM = ( 31/256, 74/256, 125/256)\nPRIMC = ( 4...
[ [ "numpy.abs", "numpy.ma.array", "numpy.load", "matplotlib.ticker.FixedLocator", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
DaisukeMiyamoto/evaluate_hh_method
[ "9c0d9e439cfae1cf3fc8407848dbf0d2caa1b8a1" ]
[ "evaluate_hh/multi_hh.py" ]
[ "import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport neuron\n\n\ndef calc_hh(dt = 25, method='cnexp', show_plot=False, type=0):\n \"\"\"\n dt = (int) [micro sec]\n method = cnexp | impl | euler | runge\n show_plot = True | False\n \"\"\"\n\n filename_template = './multi_result/...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
atutej/UCD
[ "ba399757605edee33e2d2cc8cdba885af0add284" ]
[ "run_ucd.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" Run the UCD model.\n\nUsage: python run_ucd.py\nInput data files: ./data/instagram.pickle, ./data/user_friend_follower.csv, ./data/source_target.csv\nTime: 30M\n\"\"\"\n\nimport sys, os, pickle\nimport numpy as np\nimport pandas as pd\nimport networkx as nx\...
[ [ "sklearn.metrics.roc_auc_score", "tensorflow.sparse_placeholder", "tensorflow.concat", "numpy.asarray", "tensorflow.cast", "sklearn.metrics.precision_recall_fscore_support", "numpy.mean", "tensorflow.train.AdamOptimizer", "numpy.where", "pandas.read_csv", "tensorflow.pl...
mohantym/probability
[ "f64b28f5545b6ffef0a8d0540c877a847a42d34d" ]
[ "tensorflow_probability/python/internal/auto_composite_tensor.py" ]
[ "# Copyright 2020 The TensorFlow Probability 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 a...
[ [ "tensorflow.compat.v2.nest.map_structure", "tensorflow.compat.v2.get_static_value", "tensorflow.compat.v2.is_tensor", "tensorflow.compat.v2.nest.is_nested", "tensorflow.python.framework.type_spec.register", "tensorflow.python.util.tf_inspect.signature", "tensorflow.python.framework.typ...
joosephook/maddpg
[ "1a2d07e43c8b61ee734836cbec132d857437fe86" ]
[ "experiments/train.py" ]
[ "import argparse\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport time\nimport pickle\n\nimport maddpg.common.tf_util as U\nfrom maddpg.trainer.maddpg import MADDPGAgentTrainer\nimport tensorflow.contrib.layers as layers\n\ndef parse_args():\n parser = argparse.ArgumentParser(\"Reinforcement L...
[ [ "tensorflow.multiply", "numpy.random.seed", "tensorflow.contrib.layers.fully_connected", "tensorflow.variable_scope", "numpy.mean", "tensorflow.set_random_seed", "tensorflow.train.Saver" ] ]
kjappelbaum/aiida-phonopy
[ "b10136a94a1d884135ce0787694797e1db6a34c7" ]
[ "aiida_phonopy/data/nac.py" ]
[ "from aiida.orm.data.array import ArrayData\nfrom aiida.orm.data.structure import StructureData\n\nimport numpy\n\n\nclass NacData(ArrayData):\n \"\"\"\n Store the force constants on disk as a numpy array. It requires numpy to be installed.\n \"\"\"\n\n def __init__(self, *args, **kwargs):\n supe...
[ [ "numpy.dot", "numpy.linalg.inv", "numpy.linalg.det", "numpy.identity", "numpy.array" ] ]
aiwizzard/text2text
[ "850dba85487518a2a1dabd7baacda97875313768" ]
[ "model/bert_encoder.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.modules.sparse import Embedding\nfrom transformers.models.bert.modeling_bert import BertModel\n\n\nclass BertEncoder(BertModel):\n def freeze(self):\n for p in self.parameters():\n p.requires_grad = False\n\n def forward(\n self,\n ...
[ [ "torch.ones", "torch.zeros" ] ]
lukmaz/training
[ "7d000a2acc75cf6d800576a869112ac40f175098", "7d000a2acc75cf6d800576a869112ac40f175098" ]
[ "rnn_translator/pytorch/seq2seq/models/gnmt.py", "reinforcement/tensorflow/minigo/loop_train_eval.py" ]
[ "import torch.nn as nn\n\nfrom mlperf_compliance import mlperf_log\n\nimport seq2seq.data.config as config\nfrom .seq2seq_base import Seq2Seq\nfrom .decoder import ResidualRecurrentDecoder\nfrom .encoder import ResidualRecurrentEncoder\n\n\nclass GNMT(Seq2Seq):\n def __init__(self, vocab_size, hidden_size=512, n...
[ [ "torch.nn.Embedding" ], [ "tensorflow.set_random_seed", "numpy.random.seed" ] ]
evanlissoos/Digital-Image-Processing-Project
[ "dea98bbc64dd9423e744215d809433e8198e4f95" ]
[ "helpers.py" ]
[ "import os\nimport torch\nimport torch.nn.functional as F\nimport torchvision.transforms.functional as TF\nfrom torchvision.utils import save_image\nfrom math import ceil\nfrom skimage.io import imread\nimport cv2\nfrom glob import glob\nimport re\nimport numpy as np\n\nfrom utils import warp\nfrom model import SBM...
[ [ "torch.nn.functional.l1_loss", "torch.no_grad", "torch.nn.functional.interpolate", "torch.cat" ] ]
shermanluo/personalDriving
[ "5e80bb7248f8d91703050acde43b71291b8fa704" ]
[ "trajectory.py" ]
[ "import pdb\n\nimport theano as th\nimport theano.tensor as tt\nimport numpy as np\n\nimport constants\nimport feature\nimport lane\nimport utils\nimport torch\n\n\nclass Trajectory(object):\n def __init__(self, x0, dyn, dt, horizon):\n self.dyn = dyn\n self.dt = dt\n self.horizon = horizon\...
[ [ "torch.zeros", "torch.tensor", "numpy.array", "numpy.zeros", "numpy.isclose" ] ]
rlefkowitz/ellcurverefbuilder
[ "a60053f765629d2ed2bd40cebc724a0846ba4a38" ]
[ "ellcurverefbuilder.py" ]
[ "from src.builder import EllCurveRefBuilder\nfrom src.curve.curve import Curve\nfrom typing import List\nimport numpy as np\n\n\ndef makeCurves() -> List[Curve]:\n points = [\n [-16., 0., 0.], [-5.333333, 0., 0.], [5.333333, 0., 0.], [16., 0., 0.]\n ]\n curve = CreateCurveShape([np.identity(4)], [np...
[ [ "numpy.array", "numpy.identity" ] ]
flowtide/five-minute-midas
[ "fd9d065b147607ef3bc4889f3f00daa4f1307b9c" ]
[ "1_get_raw_data.py" ]
[ "import os\nimport json\nimport winsound\nimport datetime\nimport numpy as np\nimport pandas as pd\nimport yfinance as yf\nfrom tqdm import tqdm\nfrom configparser import ConfigParser\nfrom src.db import DataBase\nfrom src.utils_beeps import beeps\nfrom src.utils_date import add_days\nfrom src.utils_stocks import g...
[ [ "pandas.read_sql", "pandas.concat", "pandas.DataFrame" ] ]
apple/ml-cvnets
[ "84d992f413e52c0468f86d23196efd9dad885e6f", "84d992f413e52c0468f86d23196efd9dad885e6f" ]
[ "cvnets/layers/conv_layer.py", "data/sampler/variable_batch_sampler.py" ]
[ "#\n# For licensing see accompanying LICENSE file.\n# Copyright (C) 2022 Apple Inc. All Rights Reserved.\n#\n\nimport torch\nfrom torch import nn, Tensor\nfrom typing import Optional, Union, Tuple\nimport argparse\n\nfrom utils import logger\n\nfrom .base_layer import BaseLayer\nfrom .normalization_layers import ge...
[ [ "torch.nn.Sequential", "torch.nn.Conv3d", "torch.nn.ConvTranspose2d", "torch.zeros" ], [ "numpy.repeat" ] ]
deepset-ai/haystack
[ "9de140110f523d8fa5d2adbf3ab35039d0189a95" ]
[ "test/test_generator.py" ]
[ "from typing import List\n\nimport numpy as np\nimport pytest\n\nfrom haystack import Document\nfrom haystack.generator.transformers import Seq2SeqGenerator\nfrom haystack.pipeline import TranslationWrapperPipeline, GenerativeQAPipeline\n\n\nDOCS_WITH_EMBEDDINGS = [\n Document(\n content=\"\"\"The capital...
[ [ "numpy.array" ] ]
ikhovryak/PyTorchHackathon
[ "7a75edeccaee15ff142f9561c1c98fe49ca81e8c" ]
[ "testing.py" ]
[ "import torch\nimport torchvision\n\nprint(torch.cuda.is_available)\nprint(torch.cuda.get_device_properties(0))\nprint(torch.cuda.get_device_capability(0))\n\n" ]
[ [ "torch.cuda.get_device_properties", "torch.cuda.get_device_capability" ] ]
mikey-yang/boilertorch
[ "dba5446d66b7d93c2e52632fd14a1517ec8d48f2" ]
[ "data.py" ]
[ "\"\"\"\nCopyright 2020 Michael Yang\n\nThe MIT License(MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\nrights to use, copy, mo...
[ [ "torch.nn.utils.rnn.pad_sequence", "torch.tensor" ] ]
the16thpythonist/ufotest
[ "8c94e4227180328e6c29d6700c9a5f4aaecab3d2" ]
[ "ufotest/cli.py" ]
[ "\"\"\"\nModule containing all the actual console scripts of the project.\n\"\"\"\nimport sys\nimport os\nimport json\nfrom multiprocessing import Process\nfrom pprint import pprint\n\nimport click\nimport matplotlib\nimport numpy as np\nimport shutil\n\nfrom ufotest.config import PATH, get_config_path, Config\nfro...
[ [ "matplotlib.use", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show" ] ]
CORE-Robotics-Lab/Personalized_Neural_Trees
[ "3e8dd12fe4fc850be65c96c847eb143ef3bcdc2e", "3e8dd12fe4fc850be65c96c847eb143ef3bcdc2e" ]
[ "taxi_domain/taxi_sim.py", "taxi_domain/methods/hsiao.py" ]
[ "\"\"\"\nCreated by Rohan Paleja on January 8, 2020\nPurpose:\n\"\"\"\nimport numpy as np\nfrom utils.global_utils import save_pickle\nimport os\n# first data seed unknown, second tr:50, test: 100, third 100\nnp.random.seed(100)\n\ndef tree_policy(feature, mturkcode):\n at_airport = feature[0]\n at_village = ...
[ [ "numpy.random.choice", "numpy.random.seed", "numpy.random.randint" ], [ "torch.nn.Softmax", "torch.zeros", "numpy.asarray", "numpy.max", "numpy.mean", "torch.cuda.is_available", "torch.device", "torch.nn.CrossEntropyLoss", "torch.eye", "numpy.std", "nump...
eherr/motion_preprocessing_tool
[ "aeb6716f282f8ef99d06630063d43e53564c2229" ]
[ "tool/core/animation_directory_explorer.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright 2019 DFKI GmbH.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy...
[ [ "numpy.eye" ] ]
shijy16/quadqopter
[ "54f0f351c35e2856ad55ae86ad6aabdd885880c4" ]
[ "quadcopter.py" ]
[ "import numpy as np\nimport vrep\nimport ctypes\nimport math\nimport sys\nimport time\n\nsim_dt = 0.01 \ndt = 0.001\n\nSYNC = True\nvrep_mode = vrep.simx_opmode_oneshot\n\ndef b( num ):\n \"\"\" forces magnitude to be 1 or less \"\"\"\n if abs( num ) > 1.0:\n return math.copysign( 1.0, num )\n else:\n retu...
[ [ "numpy.matrix", "numpy.zeros" ] ]
matthigger/arba
[ "c6c4a236e814acce02611dab57c1c8511e982729", "c6c4a236e814acce02611dab57c1c8511e982729" ]
[ "arba/effect/get_r2.py", "arba/effect/effect_regress.py" ]
[ "import numpy as np\n\n\ndef get_r2(x, y, beta=None, y_pool_cov=None, contrast=None, sample_scale=1):\n \"\"\" computes r2\n\n Args:\n beta (np.array): (dim_x, dim_y) linear mapping, defaults to max r2 map\n x (np.array): (num_obs, dim_x) features in the mapping's domain\n y (np.array): (...
[ [ "numpy.logical_not", "numpy.atleast_2d", "numpy.linalg.pinv", "numpy.cov", "numpy.array", "numpy.trace" ], [ "numpy.linalg.pinv", "scipy.optimize.minimize_scalar", "numpy.zeros" ] ]
williamshen-nz/predicators
[ "6a6b3444108a6d2da3ec3c7d85bbe60ae3b113b9" ]
[ "predicators/src/envs/painting.py" ]
[ "\"\"\"Painting domain, which allows for two different grasps on an object (side or\ntop).\n\nSide grasping allows for placing into the shelf, and top grasping allows\nfor placing into the box. The box has a lid which may need to be opened;\nthis lid is NOT modeled by any of the given predicates.\n\"\"\"\n\nfrom ty...
[ [ "matplotlib.pyplot.Rectangle", "numpy.clip", "matplotlib.patches.Rectangle", "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.array", "matplotlib.pyplot.suptitle" ] ]
ypuzikov/OKR
[ "8a72f453b52a2ddd10d980baaed307f1a6b775d0" ]
[ "src/baseline_system/eval_predicate_coref.py" ]
[ "\"\"\"\r\nReceives a test set and evaluates performance of predicate coreference.\r\nWe cluster the mentions based on simple lexical similarity metrics (e.g., lemma matching and Levenshtein distance)\r\n\r\nAuthor: Shyam Upadhyay\r\n\"\"\"\r\n\r\nimport sys\r\nsys.path.append('../common')\r\n\r\nimport numpy as np...
[ [ "numpy.array", "numpy.mean", "numpy.argmin" ] ]
Ayushsunny/TIGRE
[ "bde3d952bbc63586928dd5f29e4fa1be30aed573" ]
[ "Python/tigre/utilities/plotproj.py" ]
[ "from __future__ import print_function\r\n\r\nimport matplotlib.animation as animation\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\r\n\r\n\r\nclass plotProj:\r\n # NOTE: type help(plotImg) after importing in order to get a readable manual.\r...
[ [ "numpy.amax", "numpy.amin", "numpy.squeeze", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Anis-Bensaid/BossPrediction
[ "40633c76b1149be4ca3e38c31c305d8648d367e7" ]
[ "src/BossPrediction.py" ]
[ "import pandas as pd\nimport pickle\nimport numpy as np\nimport time\nfrom nltk.stem.porter import PorterStemmer\nfrom nltk.corpus import stopwords\n# from fuzzywuzzy import fuzz\nimport textdistance\n\ntry:\n stopwords.words('english')\nexcept LookupError:\n import nltk\n\n nltk.download('stopwords')\n\n\...
[ [ "pandas.read_csv", "numpy.ma.average" ] ]
nvitucci/pennylane
[ "567e76c73a8d050a3e225c4c0cc4968858de839e" ]
[ "tests/circuit_graph/test_qasm.py" ]
[ "# Copyright 2018-2020 Xanadu Quantum Technologies Inc.\r\n\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n# Unles...
[ [ "numpy.array", "numpy.sqrt" ] ]
frco9/karl-segmentation
[ "84758aa42a8b3d7890ac6a58fa608753fdde0b92" ]
[ "api/app.py" ]
[ "from __future__ import print_function\n#api/app.py\nimport os\nimport requests\nfrom flask import Flask, current_app, Response, json, jsonify, request\nfrom flask_cors import CORS\nimport pandas as pd\nimport argparse\nfrom datetime import datetime\nimport os\nimport sys\nimport time\nimport scipy.misc\nimport cv2...
[ [ "tensorflow.local_variables_initializer", "tensorflow.unstack", "tensorflow.shape", "tensorflow.stack", "tensorflow.train.Coordinator", "tensorflow.global_variables", "tensorflow.expand_dims", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow....
arvindmuralie77/lightning-bolts
[ "9044ed143c7f1e20164de12208f451c7a8d9718f" ]
[ "pl_bolts/models/autoencoders/basic_ae/basic_ae_module.py" ]
[ "import os\nfrom argparse import ArgumentParser\n\nimport pytorch_lightning as pl\nimport torch\nfrom torch import nn as nn\nfrom torch.nn import functional as F\n\nfrom pl_bolts import _HTTPS_AWS_HUB\nfrom pl_bolts.models.autoencoders.components import (\n resnet18_decoder,\n resnet18_encoder,\n resnet50_...
[ [ "torch.nn.functional.mse_loss", "torch.nn.Linear" ] ]
SunQpark/DeepPainterlyHarmonization
[ "3446efcd3fc46c4fcec8f182fc8a071a6805be74" ]
[ "main.py" ]
[ "import sys, os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import transforms\nfrom torchvision.utils import save_image\nfrom tqdm import tqdm\nfrom PIL import Image\n\nfrom src.model import...
[ [ "torch.ones", "torch.cat", "torch.sum", "torch.zeros_like", "torch.tensor", "torch.optim.LBFGS", "torch.no_grad", "torch.cuda.is_available", "torch.unbind", "torch.masked_select", "torch.nn.functional.pad", "torch.argmax" ] ]
lxuechen/opacus
[ "a5dd636f03675fbad67bc41808dd57637ac95d87" ]
[ "opacus/supported_layers_grad_samplers.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nr\"\"\"\nThis module is a collection of grad samplers - methods to calculate per sample gradients\nfor a layer given two tensors: activations (module inputs) and\nbackpropagations (gradient values propagated from down...
[ [ "torch.Size", "torch.cat", "torch.zeros", "torch.einsum", "torch.functional.F.instance_norm", "torch.sum", "torch.functional.F.layer_norm", "numpy.prod", "torch.nn.functional.unfold", "torch.functional.F.group_norm" ] ]
vince-wu/CompositionalDrift
[ "96f0cca2197d8398128f49b394b36f6d8b5bdc04" ]
[ "modules/structures.py" ]
[ "import modules.errors\nimport numpy as np\nimport random\nimport math\nimport numbers\nimport time\n\nclass Polymer(list):\n def __init__(self, polymer_list, model, rate_constants):\n list.__init__(self, polymer_list)\n self.rate_constants = rate_constants\n self.model = model\n\n def la...
[ [ "numpy.append", "numpy.shape", "numpy.random.rand", "numpy.random.uniform", "numpy.array", "numpy.empty", "numpy.random.randint" ] ]
antonior92/oe-multiple-shooting
[ "49479d13fbb618097a3f881bb01b1a6d61d8c3db", "49479d13fbb618097a3f881bb01b1a6d61d8c3db" ]
[ "oeshoot/narx/test/test_polynomial.py", "oeshoot/narx/simulate.py" ]
[ "from __future__ import division, print_function, absolute_import\nimport numpy as np\nfrom oeshoot.narx import Polynomial, Monomial\nfrom numpy.testing import (TestCase, assert_array_almost_equal,\n assert_array_equal, assert_array_less,\n assert_raises, assert_e...
[ [ "numpy.reshape", "numpy.testing.assert_equal", "numpy.testing.assert_raises", "numpy.testing.assert_array_almost_equal" ], [ "numpy.dot", "numpy.atleast_1d", "numpy.atleast_2d", "numpy.tensordot", "numpy.zeros" ] ]
shinebobo/ImVisible
[ "ac557ea21137d02ea1e53d0b1bcc9b337ca351c7" ]
[ "Model/loss.py" ]
[ "import torch.nn as nn\nimport torch\n\n\ndef reg_loss(left_pred, left_gt, right_pred, right_gt):\n # pred is an array of predicted coordinates\n # gt is an array of ground truth coordinates\n # use MSE loss for each line\n \n MSE1 = nn.MSELoss()\n MSE2 = nn.MSELoss()\n MSEl = MSE1(left_pred, l...
[ [ "torch.nn.MSELoss", "torch.nn.BCELoss" ] ]
SsnL/S2V
[ "acbed7c65929e814e555315bcffb3b88733fee7c" ]
[ "src/eval.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.flags.DEFINE_boolean", "tensorflow.flags.DEFINE_string", "tensorflow.ConfigProto", "tensorflow.contrib.slim.evaluation.evaluation_loop", "tensorflow.gfile.MakeDirs", "tensorflow.summary.merge_all", "tensorflow.logging.info", "tensorflow.flags.DEFINE_float", "tensorf...
yongseok1298/yolov3_pytorch_ros
[ "0aa4a59203ed635269eab7b1fe350a499a6ade2d" ]
[ "src/yolov3_pytorch_ros/detector.py" ]
[ "#!/usr/bin/env python3\n\nfrom __future__ import division\n\n#ModuleNotFoundError: No module named 'models'\nimport sys\nsys.path.insert(0, \"/home/kys/catkin_ws/src/yolov3_pytorch_ros/src/yolov3_pytorch_ros/\")\n\n\n# Python imports\nimport numpy as np\nimport scipy.io as sio\nimport os, sys, cv2, time\nfrom skim...
[ [ "numpy.ascontiguousarray", "torch.from_numpy", "torch.no_grad", "torch.cuda.is_available", "numpy.transpose", "numpy.random.randint" ] ]
mirthbottle/ghg
[ "956f5001dec7e4b56d5c16dbedf0384d1db77d7e" ]
[ "climatewatch_datamosh.py" ]
[ "'''\nFor data using the climatewatchdata api\n\n'''\n\nimport pandas as pd\nimport requests\nimport traceback\n\ndef get_cw_data(payload):\n r = requests.get(\"https://www.climatewatchdata.org/api/v1/data/historical_emissions\", params=payload)\n last_page = round(int(r.headers[\"Total\"])/50)+1\n\n print...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
yukoga/python-for-data-analysis-review
[ "de3bdd953d6eaac7c76b53e84cc3b601ce0236fd" ]
[ "chap2-2-usa-gov-data.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 3 01:56:40 2016\n\n@author: yutaka\n\"\"\"\n\nfrom pandas import DataFrame as df, Series as se\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport json\n\npath = './usagov_bitly_data2012-03-16-1331923249.txt'\nrecords = [json.loads(...
[ [ "matplotlib.pyplot.barh", "matplotlib.pyplot.yticks", "matplotlib.pyplot.show", "pandas.DataFrame" ] ]
proteanblank/pyquake
[ "26818b92bf648d897975993a3c40a78d7a5c1a9e", "26818b92bf648d897975993a3c40a78d7a5c1a9e" ]
[ "pyquake/ray.py", "pyquake/blendmat.py" ]
[ "# Copyright (c) 2020 Matthew Earl\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, copy, modify, merge, pu...
[ [ "numpy.matrix", "numpy.dot", "numpy.random.random", "numpy.abs", "numpy.array_equal", "numpy.linalg.norm", "numpy.stack", "numpy.all", "numpy.max", "numpy.copy", "numpy.fromstring", "numpy.flip", "numpy.array", "numpy.zeros", "numpy.sum" ], [ "nu...
trangvu/bert
[ "001fce0550cae29e43c175d146d1a33980870ac8" ]
[ "legacy/run_squad.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.logging.warning", "tensorflow.FixedLenFeature", "tensorflow.nn.log_softmax", "tensorflow.gfile.GFile", "tensorflow.reduce_sum", "tensorflow.train.init_from_checkpoint", "tensorflow.gfile.MakeDirs", "tensorflo...
alvinwan/fooling-neural-network
[ "27fbeed8c8f2bbb52ae063f4264675b22702437f" ]
[ "step_3_adversarial.py" ]
[ "\"\"\"Use adversarial perturbation to generate adversarial example\"\"\"\n\nfrom PIL import Image\nimport torchvision.transforms as transforms\nimport torch\nimport numpy as np\nimport os\nimport sys\n\nfrom step_2_pretrained import get_idx_to_label, get_image_transform, predict, load_image\n\n\ndef get_inverse_tr...
[ [ "numpy.load", "numpy.clip" ] ]
ackness/clifford_algebra_pytorch
[ "ddf06799226de727beea6f7e2f9e3faa6351babc" ]
[ "mv.py" ]
[ "import functools\nfrom numbers import Number\n\nimport numpy as np\nimport torch\n\nHANDLED_FUNCTIONS = {}\n\n\n# def implements(torch_function):\n# \"\"\"Register a torch function override for ScalarTensor\"\"\"\n#\n# @functools.wraps(torch_function)\n# def decorator(func):\n# HANDLED_FUNCTION...
[ [ "torch.ones", "torch.zeros", "torch.eq", "torch.sqrt", "torch.tensor", "torch.arange", "torch.device" ] ]
bgrimstad/relu-opt-public
[ "eb8df77b10f1622620c2d67f9eb279b22954d817" ]
[ "prodopt/nn_models.py" ]
[ "\"\"\"\nCreated 29 September 2020\nBjarne Grimstad, bjarne.grimstad@gmail.no\n\"\"\"\n\nimport tensorflow as tf\n\n\ndef build_model(hidden_units, reg=1e-10):\n \"\"\"\n Build Neural network\n :param hidden_units:\n :param reg:\n :return:\n \"\"\"\n layers = []\n\n for units in hidden_units...
[ [ "tensorflow.keras.regularizers.l2", "tensorflow.keras.initializers.constant", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.initializers.he_normal", "tensorflow.keras.models.Sequential" ] ]
harrydrippin/beam
[ "4b413bbb5f8807b0f7a284fd818f2772f036fe55" ]
[ "sdks/python/apache_beam/runners/interactive/interactive_runner_test.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.testing.assert_frame_equal", "pandas.DataFrame" ] ]
vishnu2kmohan/tensorflow-dcos-docker
[ "7f6ab62be531700842f2332c3025601a08286a42" ]
[ "distributed-minst-save-model/distributed_mnist_save_model.py" ]
[ "# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.FixedLenFeature", "tensorflow.zeros", "tensorflow.cast", "tensorflow.app.flags.DEFINE_string", "tensorflow.to_int64", "tensorflow.app.flags.DEFINE_integer", "tensorflow.nn.top_k", "tensorflow.Session", "tensorflow.argmax", "tensorflow.examples.tutorials.mnist.in...
CLARIN-PL/personalized-nlp
[ "340294300f93d12cabc59b055ff2548df8f4081a" ]
[ "personalized_nlp/utils/data_splitting.py" ]
[ "import numpy as np\nimport pandas as pd\n\n\ndef split_texts(df, sizes):\n present_ratio, past_ratio, future1_ratio, future2_ratio = sizes\n\n present_idx = int(present_ratio * len(df.index))\n past_idx = int(past_ratio * len(df.index)) + present_idx\n future1_idx = int(future1_ratio * len(df.index)) +...
[ [ "numpy.random.shuffle" ] ]
clearholder2001/PanNet-Landsat
[ "6f42fcf4eb00e4cd0e7f72b2c206f96347130ef6" ]
[ "utils/misc.py" ]
[ "from glob import glob\nimport os\nimport os.path as osp\nimport requests\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport rasterio\nfrom rasterio.windows import Window\n\n\ndef download(url, file_name):\n if not osp.exists(file_name):\n with open(file_name, 'wb') as file:\n print...
[ [ "pandas.concat", "pandas.Series", "numpy.random.choice", "numpy.setdiff1d", "pandas.DataFrame", "numpy.zeros" ] ]
Magnetic-Matter-Aarhus/Reel
[ "1340dfe68ac53208badda2dcba04d3646fe6efca" ]
[ "Reel1.0/_lib/ReelPlotWidgets.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nLast update: 30/11/2021\nFrederik H. Gjørup\n\"\"\"\nimport os\ntry:\n from PyQt5 import QtCore, QtGui\n import pyqtgraph as pg\n import numpy as np\n from matplotlib import cm\n\nexcept ModuleNotFoundError as error:\n if error.name in ('PyQt5', 'pyqtgraph', 'numpy',...
[ [ "numpy.rot90", "numpy.fromfile", "numpy.abs", "numpy.linspace", "numpy.isnan", "matplotlib.cm.get_cmap" ] ]
hertzmann/vislab
[ "9bb0e2b332797d7a6deb2b8d6b6e98d3c692cee6" ]
[ "vislab/util.py" ]
[ "import os\nimport pandas as pd\nimport pymongo\nimport redis\nimport socket\nimport tempfile\nimport cPickle\nimport subprocess\nimport shutil\nimport vislab\n\n\ndef zero_results(collection, query):\n return collection.find(query).limit(1).count() == 0\n\n\ndef exclude_ids_in_collection(image_ids, collection):...
[ [ "pandas.read_hdf" ] ]
jinghzhu/mlcc-exercises
[ "f0551116b00ef91f09f72dfeab7623c6326a127a" ]
[ "mlcc/validation.py" ]
[ "# 1. Use multiple features, instead of a single feature, to further improve the effectiveness of a model.\n# 2. Debug issues in model input data.\n# 3. Use a test data set to check if a model is overfitting the validation data.\nfrom __future__ import print_function\nimport math\nfrom matplotlib import pyplot as p...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "tensorflow.python.data.Dataset.from_tensor_slices", "pandas.DataFrame", "tensorflow.contrib.estimator.clip_gradients_by_norm", "matplotlib.pyplot.plot", "sklearn.metrics...
rockg/pandas
[ "5b5b2fe8bb58f96127f65176e4282feb24660950", "5b5b2fe8bb58f96127f65176e4282feb24660950" ]
[ "pandas/tests/frame/test_indexing.py", "pandas/io/gbq.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nfrom datetime import datetime, date, timedelta, time\n\nfrom pandas.compat import map, zip, range, lrange, lzip, long\nfrom pandas import compat\n\nfrom numpy import nan\nfrom numpy.random import randn\nimport numpy as np\n\nimport pandas.core.com...
[ [ "pandas.util.testing.assertIsInstance", "pandas.Series", "pandas.util.testing.assert_produces_warning", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.dtype", "pandas.util.testing.assert_frame_equal", "pandas.compat.range", "pandas.compat.map", "numpy.random.ra...
gabrielcbenedito/IGMC
[ "9a10fd7f1ebe665bea9666e30e3197017349ed66" ]
[ "test/indexers.py" ]
[ "import numpy as np\nimport scipy.sparse as ssp\nimport warnings\nwarnings.simplefilter('ignore', ssp.SparseEfficiencyWarning)\n\n\nclass SparseRowIndexer:\n def __init__(self, csr_matrix):\n data = []\n indices = []\n indptr = []\n\n for row_start, row_end in zip(csr_matrix.indptr[:-...
[ [ "scipy.sparse.csc_matrix", "numpy.cumsum", "scipy.sparse.csr_matrix", "numpy.concatenate", "numpy.array" ] ]
zhangjhboy/Nature-inspiredAlgorithm
[ "101f0df86cb5f29bcafe088e3ca42391e166115f" ]
[ "ma_CPSO-Sk.py" ]
[ "\"\"\"\nMayfly algorithm 结合 CPSO-Sk\n\nNote: 可以尝试把雌性更新部分与 CPSO-Sk 进行结合。\n\nDate: 2021.10.28\nAuthor: Jiahao Zhang\n\"\"\"\n\nimport random\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport benchmark_function\n\n\nclass Mayfly:\n \"\"\"\n 蜉蝣实体类\n \"\"\"\n def __init__(self, dim, ...
[ [ "numpy.random.randn" ] ]
axki/srzoo
[ "305c5b29d6b82f1d0e5edd39cd9f36650212dca2" ]
[ "utils/image_utils.py" ]
[ "import numpy as np\n#import tensorflow as tf\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\n\nclass ImageReader:\n\n def __init__(self):\n # image reading graph\n self.tf_graph = tf.Graph()\n with self.tf_graph.as_default():\n self.tf_image_path = tf.placeholder(tf.string, [])\n ...
[ [ "tensorflow.compat.v1.write_file", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.read_file", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.Graph", "numpy.zeros_l...
oriolcolomefont/librosa
[ "76029d35ce4c76a7475f07aab67fe2df3f73c25c" ]
[ "librosa/core/constantq.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Constant-Q transforms\"\"\"\nimport warnings\nimport numpy as np\nfrom numba import jit\n\nfrom . import audio\nfrom .fft import get_fftlib\nfrom .convert import cqt_frequencies, note_to_hz\nfrom .spectrum import stft, istft\nfrom .pitch import estimate_tuning\...
[ [ "numpy.log2", "numpy.sqrt", "numpy.abs", "numpy.min", "numpy.einsum", "numpy.asarray", "numpy.max", "numpy.random.RandomState", "numpy.sum", "numpy.empty" ] ]
82Leonard/GLUE-bert4keras
[ "2ce5bd3d47746db5a30396d4e0751f3f5b32fe24" ]
[ "QQP.py" ]
[ "#! -*- coding:utf-8 -*-\n# https://github.com/nishiwen1214/GLUE-bert4keras\n# 句子对分类任务,QQP数据集\n# val_acc: 88.7071, test_acc: 87.0320\n\nfrom bert4keras.backend import keras, set_gelu, K\nfrom bert4keras.tokenizers import Tokenizer\nfrom bert4keras.models import build_transformer_model\nfrom bert4keras.optimizers im...
[ [ "sklearn.metrics.f1_score", "numpy.array", "numpy.append" ] ]
asherguedalia/WhatsApp-Scraping
[ "a3d739586ea9aab02fb3fe4f6743a563429e5267" ]
[ "src/ride_adder.py" ]
[ "import pandas as pd\nimport datetime\nimport requests\nimport json\n\nEMPTY_ID_TOKEN = 'eyJhbGciOiJIUzUxMiIsImlhdCI6MTYzNDEyNjE0NCwiZXhwIjo1MjM0MTI2MTQ0fQ.eyJpZCI6InRlc3RlciJ9.9qYZEb-NUwbv3jGclcG7QLhhjqhtlOcRGgW3Ixk2U2cCe390Jdu7os94dVPzDirkpuEhBhM7pidhAVwIEG5JWg'\nJERUSALEM = 'Jerusalem'\nBEIT_SHEMESH = 'Beit Shem...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
rbossie/rasa-0.14.6
[ "823ac63ad7a17ead631d353f193cc48b9ba0aee0" ]
[ "rasa_nlu/classifiers/sklearn_intent_classifier.py" ]
[ "from __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\n\nimport logging\nimport typing\nfrom builtins import zip\nimport os\nimport io\nfrom future.utils import PY3\nfrom typing import Any, Optional\nfrom typing impor...
[ [ "numpy.ravel", "numpy.bincount", "sklearn.svm.SVC", "numpy.argsort", "sklearn.preprocessing.LabelEncoder" ] ]
iasawseen/MultiServerRL
[ "8460b162eb33eeae35eb01818ac6a5c26fedce0c", "8460b162eb33eeae35eb01818ac6a5c26fedce0c" ]
[ "simple_virtual_env/client.py", "multiple_virtual_envs/workers/exploration_worker.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nReinforcement Learning (DQN) Tutorial\n=====================================\n**Author**: `Adam Paszke <https://github.com/apaszke>`_\n\n\nThis tutorial shows how to use PyTorch to train a Deep Q Learning (DQN) agent\non the CartPole-v0 task from the `OpenAI Gym <https://gym.openai...
[ [ "torch.cat", "torch.zeros", "torch.no_grad", "torch.cuda.is_available", "torch.from_numpy", "torch.tensor", "matplotlib.pyplot.gcf", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "numpy.ascontiguousarray", "torch.nn.Conv2d", "matplotlib.get_backend", "t...
asleshapokhrel/GraN-DAG
[ "c000b29e98b272b022a9479287fb120b2e6c6d81" ]
[ "gran_dag/models/learnables.py" ]
[ "# coding=utf-8\n\"\"\"\nGraN-DAG\n\nCopyright © 2019 Authors of Gradient-Based Neural DAG Learning\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without ...
[ [ "numpy.log", "torch.cat", "numpy.random.shuffle", "numpy.ones", "torch.exp", "torch.nn.ParameterList", "torch.unbind", "torch.distributions.normal.Normal" ] ]
Ascend-Huawei/ece491-group30
[ "acf94d3005003a48b895594cc489db7b0a049d09" ]
[ "atlas_utils/acl_image.py" ]
[ "# Copyright 2021 Huawei Technologies Co., Ltd.\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 applica...
[ [ "numpy.fromfile" ] ]
SuperShinyEyes/redner
[ "ded310a2409870cf86c57e0d5d8e1c53ad0e2d25" ]
[ "pyredner/camera.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport pyredner.transform as transform\n\nclass Camera:\n \"\"\"\n redner supports a perspective camera and a fisheye camera.\n Both of them employ a look at transform.\n\n Note:\n Currently we assume all the camera variables are store...
[ [ "tensorflow.linalg.inv", "tensorflow.concat", "tensorflow.ones", "tensorflow.diag" ] ]
eldrickm/wakey_wakey
[ "0d09570e1aa42dc209a428727e09a46fd411aa3b" ]
[ "rtl/aco/power_spectrum/test_power_spectrum.py" ]
[ "# This file is public domain, it can be freely copied without restrictions.\n# SPDX-License-Identifier: CC0-1.0\n\nimport numpy as np\n\nimport cocotb\nfrom cocotb.clock import Clock\nfrom cocotb.triggers import FallingEdge, Timer\nfrom cocotb.binary import BinaryValue\n\ndef np2bv(int_arr, n_bits=8):\n \"\"\" ...
[ [ "numpy.zeros", "numpy.random.randint" ] ]
EasyTry/Graphonomy
[ "fdffb9a4c6891497e35da33ae5a160982cdf097e" ]
[ "networks/deeplab_xception_transfer.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\nfrom torch.nn.parameter import Parameter\nimport numpy as np\nfrom collections import OrderedDict\nfrom torch.nn import Parameter\nfrom . import deeplab_xception,gcn, deeplab_xception_synBN...
[ [ "torch.nn.functional.normalize", "torch.nn.functional.softmax", "torch.cat", "torch.nn.Conv2d", "torch.matmul", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
ming71/Cascade-Rotated-RetinaNet
[ "d5d271e5d910ca38b6f13313d140362b328f9d4f", "328be90f48b1f3b2ae745b3f22b7f58c1e7d1d31" ]
[ "datasets/dota_dataset.py", "models/model.py" ]
[ "import os\nimport cv2\nimport sys\nimport numpy as np\nimport torch\nimport torch.utils.data as data\n\nfrom utils.augment import *\nfrom utils.utils import plot_gt\nfrom utils.bbox import quad_2_rbox \n\nclass DOTADataset(data.Dataset):\n\n def __init__(self,\n dataset= None, \n ...
[ [ "numpy.array", "numpy.where" ], [ "torch.max", "torch.zeros", "torch.cat", "torch.stack", "numpy.array" ] ]
zacqoo/tpu
[ "764256b26f28eeff9ac4da04cfef1b8b8d5ef0dd" ]
[ "models/experimental/mask_rcnn/mask_rcnn_model.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.contrib.tpu.bfloat16_scope", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.cast", "tensorflow.train.init_from_checkpoint", "tensorflow.contrib.tpu.CrossShardOptimizer", "tensorflow.nn.l2_loss", "tensorflow.contrib.summary.always_record_summaries", ...
Hugo1568/Real-time-facial-recognition-MTCNN
[ "cba9b483e87b84af6414d01cb91a0024ed882e0d" ]
[ "reconocimiento.py" ]
[ "# importing libraries\n\nfrom facenet_pytorch import MTCNN, InceptionResnetV1\nimport torch\nfrom torchvision import datasets\nfrom torch.utils.data import DataLoader\nfrom PIL import Image\nimport cv2\nimport time\nimport os\n\n# initializing MTCNN and InceptionResnetV1\nprint('1')\nmtcnn0 = MTCNN(image_size=240,...
[ [ "torch.utils.data.DataLoader", "torch.save" ] ]
KnowEnG/Network_Prepper
[ "7a73f2999693d3baf015363c44ec624f499f056e" ]
[ "src/utils/io_util.py" ]
[ "import os\nimport pandas\nimport utils.log_util as logger\n\nclass IOUtil:\n @staticmethod\n def load_data_file_wo_empty_line(file_path):\n \"\"\"\n Loads data file as a DataFrame object and removes empty line by a given file path. \n\n Args:\n file_path: input file, which is ...
[ [ "pandas.read_csv" ] ]
bthyreau/pandas
[ "b0468aa45f3912d6f8823d1cd418af34ffdcd2b1" ]
[ "pandas/tests/reshape/test_concat.py" ]
[ "from collections import OrderedDict, abc, deque\nimport datetime as dt\nfrom datetime import datetime\nfrom decimal import Decimal\nfrom io import StringIO\nfrom itertools import combinations\nfrom warnings import catch_warnings\n\nimport dateutil\nimport numpy as np\nfrom numpy.random import randn\nimport pytest\...
[ [ "pandas._testing.assert_almost_equal", "pandas.Series", "pandas.PeriodIndex", "pandas.RangeIndex", "pandas.tests.extension.decimal.to_decimal", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.concatenate", "pandas.core.indexes.datetimes.date_range", "numpy.rando...
rafaelvizu/Estudos
[ "eef5e3e3706ff99959226c51b9907b6af4377bfe" ]
[ "Linguagens/Python/Estudos/Data_science/1_Visualizando_Dados/matplotlib/grafico_barra/grafico_barra.py" ]
[ "from matplotlib import pyplot as plt\n\nmovies = [\"Annie Hall\", \"Ben-Hur\", \"Casablanca\", \"Gandhi\", \"West Side Story\"]\nnum_oscars = [5, 11, 3, 8, 10]\n\n# barras possuem o tamanho padrão de 0.8, então adicionaremos 0.1 às\n# coordenadas à esquerda para que cada barra seja centralizada\nxs = [i + 0.5 f...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.title", "matplotlib.pyplot.bar", "matplotlib.pyplot.ylabel" ] ]
tipputa/CCG-Browser
[ "ad5bbfdaca1453808f9c2c848b1b9873fea3d706" ]
[ "scripts/Parse_sonicParanoid_output.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 20 20:30:53 2019\n\n@author: tipputa\n\"\"\"\n\nimport os, csv, sys\nimport pandas as pd\nfrom Bio import SeqIO \n\ndef getGenBankInfoAsBuffer(gbFile, buffer):\n record = SeqIO.read(gbFile, \"genbank\") \n for feature in record.features:\n if feat...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
gianscarpe/pytorch-lightning
[ "261ea90822e2bf1cfa5d56171ab1f95a81d5c571" ]
[ "pytorch_lightning/lite/wrappers.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.get_default_dtype", "torch.is_floating_point" ] ]
JMoraza/TodayILearned
[ "b65c6ad5046f76cd3fa0e611bce8e03b4881aff7" ]
[ "Machine Learning A-Z/Part 2 - Regression/Section 5 - Multiple Linear Regression/Python/multiple_linear_regression_jm.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jan 17 19:39:09 2021\n\n@author: joannamoraza\n\"\"\"\n\n#Importing libraries\n\nimport numpy as np \nimport pandas as pd \nimport matplotlib.pyplot as plt \n\n\n#Importing the dataset\n\ndataset = pd.read_csv('50_Startups.csv')\nx = dataset...
[ [ "pandas.read_csv", "numpy.set_printoptions", "sklearn.preprocessing.OneHotEncoder", "sklearn.model_selection.train_test_split", "sklearn.linear_model.LinearRegression" ] ]
anlthms/mlsp-2013
[ "5fd7cdf41c8027c97517ba1cc08a1d2fd6b8ccd3" ]
[ "codebook.py" ]
[ "import numpy as np\nfrom sklearn import cluster\nfrom scipy.cluster.vq import whiten \n\nk = 50 \nkextra = 10 \nnrecs = 645\nrseed = 0\n\nsegfile = open('mlsp_contest_dataset2/supplemental_data/segment_features.txt',\n 'r')\nline = segfile.readline()\nline = segfile.readline()\nindex = 0\nwhile line ...
[ [ "scipy.cluster.vq.whiten", "numpy.vstack", "numpy.zeros", "sklearn.cluster.KMeans" ] ]
jackliusr/REFIT
[ "222802118937fba42567ea7f600523870a9265ba" ]
[ "helpers/utils.py" ]
[ "\n\"\"\"Some helper functions for PyTorch, including:\n - get_mean_and_std: calculate the mean and std value of dataset.\n - msr_init: net parameter initialization.\n - progress_bar: progress bar mimic xlua.progress.\n\"\"\"\n\nimport os\nimport sys\nimport time\n\nimport torch\nimport torch.nn as nn\nimp...
[ [ "torch.nn.init.kaiming_normal", "torch.zeros", "torch.utils.data.DataLoader", "torch.nn.Linear", "torch.nn.init.constant", "torch.nn.init.normal" ] ]
draplater/empty-parser
[ "05eb8c596c4e5ba26b5c954161e52bb1490ee402" ]
[ "nn.py" ]
[ "from __future__ import unicode_literals\n\nimport abc\nimport gzip\nimport pickle\nfrom io import open\n\nimport os\nimport six\nimport sys\nfrom six.moves import range\n\nimport dynet as dn\nimport numpy as np\n\nfrom vocab_utils import Dictionary\n\nalpha = 1.6732632423543772848170429916717\nscale = 1.0507009873...
[ [ "numpy.power", "numpy.arange", "numpy.cos", "numpy.sin", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
stadlmax/pyblaze
[ "45c93d66249d679b78d8a8a16611bcf4a73b5cd6" ]
[ "pyblaze/nn/engine/base.py" ]
[ "from abc import ABC, abstractmethod\nfrom collections import defaultdict\nimport torch\nimport torch.nn as nn\nimport torch.cuda as cuda\nimport pyblaze.multiprocessing as xmp\nfrom pyblaze.nn.callbacks import TrainingCallback, PredictionCallback, CallbackException, \\\n ValueTrainingCallback\nimport pyblaze.nn...
[ [ "torch.cuda.device_count", "torch.no_grad", "torch.cat" ] ]
tyohei/chainer
[ "bb7efb16972c3373ae340c139b2710a83b5384b1" ]
[ "tests/chainer_tests/functions_tests/connection_tests/test_dilated_convolution_2d.py" ]
[ "import unittest\n\nimport numpy\n\nimport chainer\nfrom chainer.backends import cuda\nimport chainer.functions as F\nfrom chainer import gradient_check\nfrom chainer import testing\nfrom chainer.testing import attr\n\n\n@testing.parameterize(*(testing.product({\n 'c_contiguous': [True],\n 'cover_all': [True,...
[ [ "numpy.random.uniform", "numpy.sqrt" ] ]
nalyd88/modeling-and-simulation
[ "96e5fc3994ded8782229425e43ed9237966c9567" ]
[ "random/minimal.py" ]
[ "# This script defines and tests a function for generating a sequence of\n# uniformly distributed random numbers using the Minimal Standard generator\n# developed by Park and Miller.\n#\n# Ref. 1: Numerical Recipes in C 2nd ed.\n#\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef min_rand(seed=0):\n ...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.histogram", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel" ] ]
Bryce-HJ/Faster-R-CNN-by-pytorch
[ "dff95987dd1a726be338c26ed3610726b0e34034" ]
[ "nets/rpn.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom utils.anchors import generate_anchor_base, _enumerate_shifted_anchor\nfrom utils.utils import nms, loc2bbox\nimport numpy as np\n\n\nclass ProposalCreator():\n def __init__(self,\n mode,\n nms_thresh=0...
[ [ "torch.nn.functional.softmax", "torch.Tensor", "torch.nn.Conv2d", "numpy.concatenate", "numpy.array", "numpy.where" ] ]
samaid/sdc
[ "bcc377f430d58c2f167e09754c65abfedde263f6", "bcc377f430d58c2f167e09754c65abfedde263f6" ]
[ "hpat/datatypes/hpat_pandas_series_functions.py", "hpat/hiframes/join.py" ]
[ "# *****************************************************************************\n# Copyright (c) 2019, Intel Corporation All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistribut...
[ [ "numpy.nanmax", "numpy.nanmedian", "pandas.Series", "numpy.nancumsum", "numpy.nanmin", "pandas.core.groupby.SeriesGroupBy", "numpy.argmin", "numpy.any", "numpy.nanmean", "numpy.unique", "numpy.empty_like", "numpy.nanvar", "numpy.nansum", "numpy.argmax", ...
magdalenafuentes/soundata
[ "4d2dde8e9ef61483bc202bf94d6a0ccc1601c52b" ]
[ "tests/test_otmm_makam.py" ]
[ "import numpy as np\nfrom soundata import annotations\nfrom soundata.datasets import compmusic_otmm_makam\nfrom tests.test_utils import run_track_tests\n\n\ndef test_track():\n data_home = \"tests/resources/mir_datasets/compmusic_otmm_makam\"\n track_id = \"cafcdeaf-e966-4ff0-84fb-f660d2b68365\"\n\n datase...
[ [ "numpy.array" ] ]
jaromiru/NetworkAttackSimulator
[ "e92a73918622c6c3e7cd61b697a8221cbdbe82eb" ]
[ "nasim/scenarios/generator.py" ]
[ "\"\"\"This module contains functionality for generating scenarios.\n\nSpecifically, it generates network configurations and action space\nconfigurations based on number of hosts and services in network using standard\nformula.\n\"\"\"\nimport math\nimport numpy as np\n\nimport nasim.scenarios.utils as u\nfrom nasi...
[ [ "numpy.random.seed", "numpy.random.choice", "numpy.random.random_sample", "numpy.random.poisson", "numpy.random.rand", "numpy.zeros", "numpy.random.randint" ] ]
haoyfan/Dual-SVDAE
[ "1fcb61960606d743438f33b740cb434dbfcfd727" ]
[ "networks/SVDD.py" ]
[ "\"\"\"GCN using DGL nn package\n\nReferences:\n- Semi-Supervised Classification with Graph Convolutional Networks\n- Paper: https://arxiv.org/abs/1609.02907\n- Code: https://github.com/tkipf/gcn\n\"\"\"\n\nimport torch.nn as nn\n\nclass SVDD_Attr(nn.Module):\n def __init__(self, g,\n in_feats,\n...
[ [ "torch.nn.Dropout", "torch.nn.Linear", "torch.nn.ModuleList", "torch.nn.ReLU" ] ]
Ann-Holmes/CellO
[ "bc2192a2d27e0859f6df885a6fc246e26e54a7b0" ]
[ "cello/cello.py" ]
[ "\"\"\"\nThe CellO API\n\nAuthors: Matthew Bernstein <mbernstein@morgridge.org>\n\"\"\"\n\nfrom optparse import OptionParser\nfrom os.path import join\nimport pandas as pd\nfrom anndata import AnnData\nimport h5py\nimport dill\nfrom scipy.io import mmread\nimport numpy as np\nimport json\nfrom collections import de...
[ [ "numpy.log", "pandas.read_csv", "numpy.expand_dims", "pandas.DataFrame", "numpy.exp", "numpy.array", "numpy.sum" ] ]
KriSun95/sunxspex_examples_kris
[ "068c9eed8af63c427a8578ee15863092b2e4bc93" ]
[ "sunxspex/sunxspex/thermal_spectrum.py" ]
[ "import os.path\nimport copy\n\nimport numpy as np\nimport astropy.units as u\nfrom astropy.table import Table\nimport scipy.interpolate\nimport sunpy.coordinates\n\nfrom sunxspex.io import chianti_kev_line_common_load_light, load_xray_abundances\nfrom sunxspex.utils import get_reverse_indices\n\n__all__ = ['Chiant...
[ [ "numpy.absolute", "numpy.sum", "numpy.histogram", "numpy.arange", "numpy.ones", "numpy.concatenate", "numpy.all", "numpy.log10", "numpy.argsort", "numpy.digitize", "numpy.array", "numpy.zeros", "numpy.where" ] ]
dl-bl4ck/unmasker
[ "811b52d48313385070811a5a1779b1b9562dda84" ]
[ "predict.py" ]
[ "import os\nimport argparse\nimport json\nimport torch\nimport torchvision.transforms as transforms\nfrom torchvision.utils import save_image\nimport numpy as np\nfrom PIL import Image\nfrom models import CompletionNetwork\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--model')\nparser.add_argument('-...
[ [ "torch.no_grad", "torch.unsqueeze", "torch.load" ] ]
horaceheaven/Kalman-and-Bayesian-Filters-in-Python
[ "55d73b21de01ee4278cef1ab5b32405917f96287" ]
[ "code/pf_internal.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Copyright 2015 Roger R Labbe Jr.\n\n\nCode supporting the book\n\nKalman and Bayesian Filters in Python\nhttps://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python\n\n\nThis is licensed under an MIT license. See the LICENSE.txt file\nfor more information.\n\"\"\"\n\nfrom __fut...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.xkcd", "matplotlib.colors.BoundaryNorm", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "numpy.random.multivariate_normal", "numpy.cumsum", "matplotlib.pyplot.plot", "matplotlib.pyplot.axes", "numpy.random.randn", "nu...
vlollier/oligator
[ "5e9ee77f7087eed274f9ffff27d5c695bfc14231" ]
[ "src/GlycanQt5.py" ]
[ "#-*-coding:Utf-8-*-\n__author__ =\"Virginie Lollier\"\n__version__ = \"1.0.1\"\n__license__ = \"BSD\"\n\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtGui import QPen, QColor,QDoubleValidator, QIntValidator,QFont,QPixmap,QCursor,QPen\nfrom PyQt5.QtCore import Qt, pyqtSignal,QAbstractTableModel, QVariant, pyqtSlot, ...
[ [ "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "numpy.array", "numpy.where", "matplotlib.figure.Figure" ] ]
sherryue123/Labber-Drivers
[ "90fc217db4158857f650122cd780f18fcf6d9a78" ]
[ "Painter_MultiQubit_PulseGenerator/cliffords.py" ]
[ "import numpy as np\nfrom numpy import matmul as mul\nfrom numpy.linalg import inv as inv\nfrom numpy.linalg import eig as eig\nfrom numpy import tensordot as tensor\nfrom numpy import dot\nimport pickle\n\nimport itertools\nimport sequence_rb\nfrom gates import Gate\n\n\n# list of Paulis in string representation\n...
[ [ "numpy.matrix", "numpy.dot", "numpy.sqrt", "numpy.matmul", "numpy.kron", "numpy.identity" ] ]
QinghuanZhou/pointer-generator
[ "2970ed2fe7501cd298c3db6ed771c0f2a977fb62" ]
[ "beam_search.py" ]
[ "\"\"\"This file contains code to run beam search decoding\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\nimport data\n\nFLAGS = tf.app.flags.FLAGS\n\nclass Hypothesis(object):\n \"\"\"Class to represent a hypothesis during beam search. Holds all the information needed for the hypothesis.\"\"\"\n\n def __i...
[ [ "numpy.zeros" ] ]
HigorAnjos/Fundamentos-VI
[ "e0aa3cb37e4c54d24ac7123ea3bd8038196e0edb" ]
[ "auxilia/newton_raphson.py" ]
[ "import numpy as np\nfrom sympy import *\nfrom math import *\nimport matplotlib.pyplot as pl\nimport sympy as sp\n\nfrom sympy.plotting import *\nimport matplotlib.pyplot as plt\n\n\n\n# sinbolo x\nx = Symbol('x')\n\n# Dinifina a funcao\nf = x**4-12*x**3+47*x**2-60*x\nfx = lambdify(x, f, modules=['numpy'])\n\n# ...
[ [ "numpy.array", "numpy.linspace" ] ]
morswin22/anpr
[ "b9c50ad3c1309f35415ff60067d0cb4bbac57e24" ]
[ "utils.py" ]
[ "import json\n\nimport numpy as np\n\nwith open('assets/map.json', 'r') as file:\n mapped = json.load(file)\n\ndef encoder(label):\n result = np.zeros((207))\n offset = 0\n for i, letter in enumerate(label):\n result[offset + mapped[i].index(letter)] = 1\n offset += len(mapped[i])\n return result\n\ndef ...
[ [ "numpy.zeros" ] ]
Ray2020BD/Paddle
[ "994087188816575d456c2f9c2a6c90aad83b4e71" ]
[ "python/paddle/hapi/model.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.array", "numpy.vstack" ] ]
area42/Weltanschauung-
[ "85694740f149aa741f69a67bf234b447ba11fb22" ]
[ "Weltantschauung/Weltantschauung.py" ]
[ "import torch\n\nclass Weltantschauung:\n \"\"\"\n Weltantschauung implements a worldview (wv) and can use the world view\n to react to statements and to learn from replies to its own worldview\n \"\"\"\n # dimension of input and output vector\n default_wv_dimension = 16\n device = torch.device...
[ [ "torch.randn", "torch.nn.Linear", "torch.no_grad", "torch.device", "torch.nn.ReLU", "torch.nn.L1Loss" ] ]
Mr8ND/ACORE-LFI
[ "68da2ab37ee54b5ac60d73b2ac64b9072a0e56cc" ]
[ "acore/classifier_cov_pow_toy.py" ]
[ "from warnings import simplefilter\nsimplefilter(action='ignore', category=FutureWarning)\n\nimport numpy as np\nimport argparse\nimport pandas as pd\nfrom tqdm.auto import tqdm\nfrom datetime import datetime\nfrom sklearn.metrics import log_loss\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nfrom utils...
[ [ "matplotlib.pyplot.legend", "numpy.hstack", "matplotlib.pyplot.tight_layout", "numpy.log", "numpy.random.seed", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "sklearn.metrics.log_loss", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "matplotlib.pyplot...
aretas2/High-throughput-molecular-docking
[ "7752826a0cda955b09573ebbcbbcf093ffaed5d7" ]
[ "bst_scr_nrm.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Mar 28 22:40:41 2017\n\n@author: Aretas\n\"\"\"\n#The script outputs up to 3 PNG histograms and 3 TXT files with ligand\n#affinity distribution\n#Two types of normalisation are performed: top score division by the number of carbons;\n#Division...
[ [ "numpy.arange", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
aborisova1/se-ee-mkta-ua-gas-demand
[ "a23c381d19e6efcba7a364f11d254170c31b0993" ]
[ "ukr_dem_fcst.py" ]
[ "import requests\r\nimport pandas as pd\r\nimport os\r\nimport json\r\nimport datetime\r\nfrom datetime import datetime, timedelta, date\r\nfrom dotenv import load_dotenv\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nload_dotenv()\r\n\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\n\r\n#f...
[ [ "pandas.concat", "pandas.read_csv", "pandas.to_datetime", "pandas.merge", "pandas.DataFrame.from_records", "matplotlib.pyplot.show" ] ]
MLH-Fellowship/0.1.1-Teacher-s-Pet
[ "3e4e94abd98888f879283c93dbdb057a537e1005" ]
[ "src/combined_with_gaze.py" ]
[ "#gaze tracking https://github.com/antoinelame/GazeTracking\n\n\nimport numpy as np\nimport argparse\nimport matplotlib.pyplot as plt\nimport cv2\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense, Dropout, Flatten\nfrom tensorflow.keras.layers import Conv2D\nfrom tensorflow....
[ [ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "matplotlib.pyplot.subplots", "numpy.ones", "tensorflow.keras.layers.MaxPooling2D", "numpy.argmax", "numpy.zeros", "tensorflow.keras.layers.Dropout", ...
foamliu/WaveGlow
[ "34e7489fb56d258f9d4228270491bf6524942cf0" ]
[ "utils.py" ]
[ "import argparse\nimport logging\n\nimport librosa\nimport numpy as np\nimport torch\n\n\ndef clip_gradient(optimizer, grad_clip):\n \"\"\"\n Clips gradients computed during backpropagation to avoid explosion of gradients.\n :param optimizer: optimizer with the gradients to be clipped\n :param grad_clip...
[ [ "numpy.log", "numpy.swapaxes", "numpy.save", "numpy.concatenate", "torch.save" ] ]
symuhammad/openpilot
[ "96072fe69bc10f6ac5a92e2353e1ca0e649694dc" ]
[ "selfdrive/controls/lib/driver_monitor.py" ]
[ "import numpy as np\nfrom common.realtime import DT_CTRL, DT_DMON\nfrom selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET\nfrom common.filter_simple import FirstOrderFilter\nfrom common.stat_live import RunningStatFilter\n\n_AWARENESS_TIME = 300. # 1.6 minutes limit without user touching s...
[ [ "numpy.arctan2", "numpy.array", "numpy.sqrt", "numpy.interp" ] ]