repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
muammar/chemprop
[ "c46e511eaa9d07da319571ce6c44bb19effa7c5b" ]
[ "chemprop/utils.py" ]
[ "from argparse import Namespace\nimport csv\nfrom datetime import timedelta\nfrom functools import wraps\nimport logging\nimport math\nimport os\nimport pickle\nimport re\nfrom time import time\nfrom typing import Any, Callable, List, Tuple, Union\nimport collections\n\nfrom sklearn.metrics import auc, mean_absolut...
[ [ "torch.optim.Adam", "torch.nn.CrossEntropyLoss", "torch.Tensor", "torch.load", "sklearn.metrics.accuracy_score", "sklearn.metrics.precision_recall_curve", "torch.nn.BCELoss", "sklearn.metrics.mean_squared_error", "torch.nn.BCEWithLogitsLoss", "sklearn.metrics.auc", "tor...
nihlen/bf2-auto-spectator
[ "21a50b39f2525bc8bdc3a25071f5bf61637dd5f2" ]
[ "src/gameinstancemanager.py" ]
[ "import logging\nimport re\nimport time\n\nimport cv2\nimport numpy as np\nimport pyautogui\nimport win32com.client\nimport win32con\nimport win32gui\n\nfrom exceptions import UnsupportedMapException\nfrom gameinstancestate import GameInstanceState\nfrom helpers import Window, find_window_by_title, get_resolution_w...
[ [ "numpy.average" ] ]
Krytic/Takahe
[ "6d6bdf234ae7e3cfe8ef40e48d4621dc9a9a2f6c" ]
[ "takahe/histogram.py" ]
[ "\"\"\"\n\nHistogram classes to contain event rate data and allow for easy plotting\n\nOriginal author: Max Briel (https://github.com/maxbriel)\nModified by: Sean Richards (https://github.com/Krytic)\n\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pickle\nfrom scipy.stats import iqr\nfrom s...
[ [ "numpy.matrix", "numpy.sqrt", "numpy.linspace", "numpy.min", "scipy.stats.iqr", "numpy.append", "numpy.log10", "numpy.max", "scipy.stats.multivariate_normal", "numpy.where", "numpy.var", "numpy.array", "numpy.meshgrid", "numpy.zeros", "matplotlib.pyplot....
zqwei/pyslds
[ "058be6e2db4f1361eb8c6b89ce02978ca624fe88" ]
[ "examples/simple_demo.py" ]
[ "import numpy as np\nimport numpy.random as npr\nimport matplotlib.pyplot as plt\nfrom matplotlib.gridspec import GridSpec\n\n# Fancy plotting\ntry:\n import seaborn as sns\n from hips.plotting.colormaps import gradient_cmap\n sns.set_style(\"white\")\n sns.set_context(\"paper\")\n\n color_names = [\...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "numpy.random.seed", "matplotlib.pyplot.title", "numpy.arange", "numpy.eye", "matplotlib.pyplot.savefig", "numpy.ones", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylabel", "num...
kingdavid72/pymol-OpenSource
[ "8192e75bf3d4c1072d6bd399b7dacd065bf78a06" ]
[ "modules/chempy/brick.py" ]
[ "#A* -------------------------------------------------------------------\n#B* This file contains source code for the PyMOL computer program\n#C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific. \n#D* -------------------------------------------------------------------\n#E* It is unlawful to modify o...
[ [ "numpy.asfarray", "numpy.zeros" ] ]
Eadon999/DeepMatch
[ "b37c04f1a6ff687b884dd0935ed0b4de2bdf4a7a" ]
[ "examples/preprocess.py" ]
[ "import random\nimport numpy as np\nfrom tqdm import tqdm\nfrom tensorflow.python.keras.preprocessing.sequence import pad_sequences\n\n\ndef gen_data_set(data, negsample=0):\n data.sort_values(\"timestamp\", inplace=True)\n item_ids = data['movie_id'].unique()\n\n train_set = []\n test_set = []\n for...
[ [ "numpy.array", "tensorflow.python.keras.preprocessing.sequence.pad_sequences" ] ]
iremkp/Saber_tmvp4_m4
[ "e96c4a3983535122f95455e9cf900ea3fce9200a" ]
[ "benchmarks-saber.py" ]
[ "#!/usr/bin/env python3\r\nimport serial\r\nimport sys\r\nimport os\r\nimport subprocess\r\nimport hashlib\r\nimport datetime\r\nimport time\r\nimport numpy as np\r\ndev = serial.Serial(\"/dev/ttyUSB0\", 115200,timeout=10)\r\n\r\ndef benchmarkBinary(binary):\r\n print(\"Flashing {}..\".format(binary))\r\n sub...
[ [ "numpy.mean" ] ]
thiagotei/opentuner
[ "a3cd9db06e493302bb89202d4f9513f637f4acb6" ]
[ "opentuner/search/manipulator.py" ]
[ "from __future__ import division\n# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab autoindent smarttab\nfrom builtins import str\nfrom builtins import map\nfrom builtins import range\nfrom past.utils import old_div\nfrom builtins import object\nimport abc\nimport collections\nimport copy\nimport hashlib\nimpor...
[ [ "numpy.concatenate", "numpy.array", "numpy.random.rand", "numpy.exp" ] ]
sharinka0715/AISafety
[ "1e210dd448a01069aeaba9fa637b68505ad43332" ]
[ "EvalBox/Attack/attack_eval.py" ]
[ "# !/usr/bin/env python\n# coding=UTF-8\n\"\"\"\n@Author: WEN Hao\n@LastEditors: WEN Hao\n@Description:\n@Date: 2021-08-23\n@LastEditTime: 2022-04-16\n\n对抗攻击的类,\n主要基于TextAttack的Attacker类进行实现,同时参考了OpenAttack的类AttackEval\n\n\"\"\"\n\nimport collections\nimport logging\nimport multiprocessing as mp\nimport os\nimport ...
[ [ "torch.multiprocessing.set_start_method", "torch.multiprocessing.current_process", "torch.multiprocessing.Queue", "torch.cuda.set_device", "tensorflow.config.experimental.set_memory_growth", "tensorflow.config.experimental.list_physical_devices", "torch.cuda.empty_cache", "numpy.ii...
JanzenLiu/Elastic-and-Parallel-Rec-System-pipeline
[ "3a7be2ffbe423d6421d722141d6ae882422f5c30" ]
[ "offline/embedding/embedding.py" ]
[ "from os.path import *\nfrom pyspark.sql import SparkSession, Row\nfrom pyspark import SparkConf\nfrom pyspark.sql.functions import *\nfrom pyspark.sql.types import *\nfrom pyspark.mllib.feature import Word2Vec, Word2VecModel\nfrom pyspark.ml.feature import BucketedRandomProjectionLSH\nfrom pyspark.ml.linalg import...
[ [ "numpy.copy", "numpy.zeros" ] ]
laserson/numba
[ "35546517b27764a9120f6dfcd82eba7f4dd858cb" ]
[ "numba/cuda/tests/cudapy/test_multigpu.py" ]
[ "from numba import cuda\nimport numpy as np\nfrom numba import unittest_support as unittest\nimport threading\n\n\nclass TestMultiGPUContext(unittest.TestCase):\n def test_multigpu_context(self):\n @cuda.jit(\"void(float64[:], float64[:])\")\n def copy_plus_1(inp, out):\n i = cuda.grid(1...
[ [ "numpy.arange", "numpy.testing.assert_equal" ] ]
YuyangXueEd/MRI_Recon_Tutorial
[ "5c235e0831e30528611f492668987caa0f183f80" ]
[ "Models/unet/pretrained.py" ]
[ "import argparse\nimport time\nfrom collections import defaultdict\nfrom pathlib import Path\nfrom tqdm import tqdm\n\nimport numpy as np\nimport requests\nimport torch\n\nimport fastmri\nimport fastmri.data.transforms as T\nfrom fastmri.data import SliceDataset\nfrom unet import Unet\n\nUNET_FOLDER = \"https://dl....
[ [ "torch.device", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load" ] ]
taegoobot/models
[ "2c54560546b17d3766a12f248e5a57f5e65995a8" ]
[ "research/object_detection/utils/object_detection_evaluation.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...
[ [ "numpy.isin", "numpy.ones", "numpy.concatenate", "numpy.argwhere", "numpy.append", "numpy.nanmean", "numpy.any", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.empty" ] ]
berkmancenter/odie_analysis
[ "940a1bfad95403cfdc060c786707114efe6ab879" ]
[ "app/cohort_analysis.py" ]
[ "import pickle\nimport logging\nfrom pathlib import Path\nfrom collections import defaultdict, Counter\n\nimport pandas as pd\nimport numpy as np\n\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch_dsl import Search\nfrom tqdm import tqdm\nfrom datasketch import MinHash, MinHashLSH\nfrom scattertext.term...
[ [ "numpy.array", "pandas.read_pickle", "pandas.DataFrame" ] ]
Rnhondova/garage
[ "0ff40022a1da0287a45af86c7b8fc9c604c13dd5" ]
[ "tests/garage/torch/policies/test_categorical_cnn_policy.py" ]
[ "\"\"\"Test categoricalCNNPolicy in PyTorch.\"\"\"\nimport cloudpickle\nimport pytest\nimport torch\n\nfrom garage.envs import GymEnv\nfrom garage.torch import TransposeImage\nfrom garage.torch.policies import CategoricalCNNPolicy\n\nfrom tests.fixtures.envs.dummy import DummyDictEnv, DummyDiscretePixelEnv\n\n\ncla...
[ [ "torch.Tensor" ] ]
tommy19970714/FullSubNetWithASR
[ "fbe6b8f1ae83d23b685bb3dae457b58941ee3644" ]
[ "audio_zen/model/base_model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nfrom torch.nn import functional\nfrom audio_zen.constant import EPSILON\n\n\nclass BaseModel(nn.Module):\n def __init__(self):\n super(BaseModel, self).__init__()\n\n @staticmethod\n def unfold(input, num_neighbor):\n \"\"\"\...
[ [ "torch.mean", "torch.cat", "torch.sqrt", "torch.nn.init.constant_", "torch.sum", "torch.nn.init.xavier_normal_", "torch.tensor", "torch.std", "torch.square", "torch.nn.init.normal_", "torch.nn.init.orthogonal_", "torch.arange", "torch.stack", "torch.nn.funct...
Wilson-G/QUANTAXIS
[ "f98d09df834dc0c559ca1cac7a091cf2f26d6ad7" ]
[ "QUANTAXIS/QAIndicator/base.py" ]
[ "# coding:utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2019 yutiansut/QUANTAXIS\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 withou...
[ [ "pandas.Series.rolling", "pandas.Series", "numpy.isnan", "pandas.DataFrame", "numpy.logical_or", "pandas.Series.ewm", "numpy.sign", "numpy.logical_and", "numpy.where" ] ]
ppwadhwa/napari
[ "25756da88a2ee09e8f6723994685e0aa6fbbb5af" ]
[ "napari/components/viewer_model.py" ]
[ "from __future__ import annotations\n\nimport inspect\nimport itertools\nimport os\nimport warnings\nfrom functools import lru_cache\nfrom pathlib import Path\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Dict,\n List,\n Optional,\n Sequence,\n Set,\n Tuple,\n Union,\n)\n\nimport numpy ...
[ [ "numpy.multiply", "numpy.min", "numpy.round", "numpy.max", "numpy.repeat", "numpy.array", "numpy.zeros", "numpy.divide" ] ]
ashish-hacker/klar-EDA
[ "32a45854854c92e8e1f642ac31276d6f08daf778" ]
[ "klar_eda/preprocess/csv_preprocess.py" ]
[ "# get mean, median, mode, null\r\n# https://scikit-learn.org/stable/modules/preprocessing.html\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom .constants import VIZ_ROOT, NUNIQUE_THRESHOLD\r\nfrom sklearn.preprocessing import OneHotEncoder\r\nfrom scipy import stats\r\nfrom sklearn import preprocessing\r\nimp...
[ [ "pandas.concat", "pandas.read_csv", "numpy.abs", "sklearn.preprocessing.OneHotEncoder", "scipy.stats.zscore", "sklearn.preprocessing.LabelEncoder" ] ]
adrianschlatter/tanuna
[ "c94ecb7d5670a90b1d1058b757c65718dfe55496" ]
[ "tests/tools.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nStuff that is useful for unittesting.\n\n@author: Adrian Schlatter\n\"\"\"\n\nimport numpy as np\n\n\ndef almostEqual(x, y, tol=1e-10):\n \"\"\"\n Compare 2 array-like objects x and y for \"almost equalness\". This is\n useful for testing numerical computation where you ca...
[ [ "numpy.array", "numpy.abs" ] ]
case547/acconeer-python-exploration
[ "e92de2c3bc8b60939276128e1ddca47486cdfb54" ]
[ "gui/ml/keras_processing_tf2.py" ]
[ "import os\nimport traceback\n\nimport numpy as np\nimport tensorflow as tf\nfrom keras.utils.layer_utils import count_params\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.utils import class_weight\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras import optimizers as Opt\nfrom...
[ [ "tensorflow.keras.models.load_model", "numpy.expand_dims", "tensorflow.keras.models.save_model", "tensorflow.compat.v1.enable_eager_execution", "tensorflow.keras.backend.clear_session", "numpy.unique", "tensorflow.keras.optimizers.RMSprop", "tensorflow.keras.optimizers.Adadelta", ...
yufeiwang63/bullet3
[ "8e5faf69e96e293c0773e24358b9b70ae6a58a9a" ]
[ "Buggy_cloth_contact/helper.py" ]
[ "import numpy as np\nimport pybullet as p\n\ndef create_spheres(id, radius=0.01, mass=0.0, batch_positions=[[0, 0, 0]], visual=True, collision=True, rgba=[0, 1, 1, 1]):\n sphere_collision = p.createCollisionShape(shapeType=p.GEOM_SPHERE, radius=radius, physicsClientId=id) if collision else -1\n sphere_visual ...
[ [ "numpy.array" ] ]
Aaronearlerichardson/Cogan_BIDS
[ "612087ff103566ddf7fc1ebc6a494a0650d2b974" ]
[ "BIDS_converter/data2bids.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\nimport argparse\nimport csv\nimport datetime\nimport gc\nimport gzip\nimport json\nimport subprocess\nimport sys\nfrom typing import Union, List\n\nimport nibabel as nib\nimport pandas as pd\nimport pydicom as dicom\nfrom bids import layout\nfrom matgrab import ...
[ [ "pandas.concat", "pandas.read_csv", "pandas.api.types.is_float_dtype", "pandas.DataFrame", "pandas.read_table", "pandas.ExcelFile", "pandas.api.types.is_integer_dtype", "pandas.to_numeric", "scipy.io.wavfile.read" ] ]
NunoEdgarGFlowHub/bsuite
[ "a4bfe48721d8ce1136c4913d2f16015439161362" ]
[ "bsuite/experiments/cartpole/cartpole.py" ]
[ "# pylint: disable=g-bad-file-header\n# Copyright 2019 DeepMind Technologies Limited. 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...
[ [ "numpy.abs", "numpy.cos", "numpy.sin", "numpy.remainder", "numpy.random.RandomState", "numpy.zeros" ] ]
AAbercrombie0492/gdelt_distributed_architecture
[ "fd6ab943cbe2e82748c9f74e86d80d4f25498021" ]
[ "src/data/get_gdelt.py" ]
[ "#!/usr/bin/python\n'''\nSript to ingest historical gdelt data and save to s3.\n'''\n# pickle.dump(gkg_columns, open('~/gdelt_distributed_architecture/data/interim/gkg_columns.pkl', 'wb'))\n\n\n# Import Dependencies\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nimport os\nimport...
[ [ "pandas.read_csv" ] ]
PaParaZz1/DI-engine
[ "b38144117c1ebc6eb860d8637ec8866dfbcdf2de" ]
[ "ding/league/player.py" ]
[ "from typing import Callable, Optional, List\nfrom collections import namedtuple\nimport numpy as np\nfrom easydict import EasyDict\n\nfrom ding.utils import import_module, PLAYER_REGISTRY\nfrom .algorithm import pfsp\n\n\nclass Player:\n \"\"\"\n Overview:\n Base player class, player is the basic memb...
[ [ "numpy.random.uniform" ] ]
bpptkg/bpptkg-meteo
[ "8b554c58ffa5bc41377e8bdde7434abaaae49c27" ]
[ "examples/vaisala/app.py" ]
[ "import argparse\nimport csv\nimport datetime\nimport io\nimport logging\nimport logging.config\nimport os\nimport sys\nimport tempfile\nfrom urllib.error import URLError\nfrom urllib.parse import urlencode\nfrom urllib.request import urlopen\n\nimport numpy as np\nimport pandas as pd\nimport pytz\nimport sentry_sd...
[ [ "pandas.isna", "pandas.notnull", "pandas.read_csv" ] ]
ll0pez10/transmissao-energia-eletrica
[ "56b9616ff1ab39c34aa5af8c44e7b3ffd1a2f82f" ]
[ "Trabfinal.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nfrom linha_transmissao import Linha_transmissao\nfrom metodos_linhas import raio_eq, Pnat, derivacao, quadlinha, compenslinha\nfrom numpy import savetxt\n\nfrom numpy import sqrt\nimport numpy as np\nfrom numpy.linalg import inv\nimport matplotlib.pyplot as plt\n\nnp.set_p...
[ [ "numpy.conj", "matplotlib.pyplot.title", "numpy.sqrt", "numpy.linalg.inv", "matplotlib.pyplot.figure", "numpy.set_printoptions", "numpy.concatenate", "matplotlib.pyplot.plot", "numpy.deg2rad", "numpy.savetxt", "matplotlib.pyplot.xlabel", "numpy.angle", "numpy.ar...
taodav/generalization-rl
[ "9aab3147ef93471fb262d65b75a0688ed083d111" ]
[ "grl/sampling.py" ]
[ "import json\nfrom pathlib import Path\nimport numpy as np\nfrom typing import List\n\nfrom definitions import ROOT_DIR\n\nP_OFFSET_MAX = 1.0\nP_OFFSET_MIN = -1.0\nV_OFFSET_MAX = 1.0\nV_OFFSET_MIN = -1.0\n\ndef sample_mountaincar_env(seed: int, n: int) -> List[dict]:\n \"\"\"\n Sample n mountain car environme...
[ [ "numpy.random.RandomState" ] ]
aliabdelkader/vkitti3D-dataset
[ "f92f86bcb83e376f5ea0d1e978a0469d8ebc9add" ]
[ "tools/convert_npy_to_csv.py" ]
[ "import numpy as np\nfrom tqdm import tqdm\nfrom pathlib import Path\nfrom concurrent.futures import ProcessPoolExecutor\nimport argparse\n\n\ndef covert_to_csv(infile):\n\n print(str(infile))\n point_cloud = np.load(str(infile)).reshape(-1, channels)\n file_name = infile.stem\n outfile = output_path / ...
[ [ "numpy.savetxt" ] ]
PoCFrance/UberPoC
[ "0c99403e47cd2ea7b07029821ac1997363354b61" ]
[ "RCNN/training/train.py" ]
[ "#!/usr/bin/env python3\n\nfrom pyimagesearch import config\nfrom imutils import paths\nimport numpy as np\nimport pickle\nimport os\nfrom keras.applications import MobileNetV2\nfrom keras.models import Sequential\nfrom keras.models import Model\nfrom keras.layers import AveragePooling2D\nfrom keras.layers import D...
[ [ "matplotlib.pyplot.legend", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "matplotlib.pyplot.title", "numpy.arange", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "numpy.argmax", "sklearn.preprocessing.LabelBin...
bronevet-abc/NLPython
[ "edb2f2c558215df556449c0fafb717d3442cfd9b" ]
[ "ch9/make_neural_net/threelayersANN.py" ]
[ "#The credits for this code go to Ludo Bouan.\n# I've merely created a wrapper to get people started.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport numpy as np\nfrom six.moves import range\nnp.seterr(over='ignore')\n\nclass NeuralNetwork():...
[ [ "numpy.dot", "numpy.random.random", "numpy.random.seed", "numpy.power", "numpy.asarray", "numpy.seterr", "numpy.mean", "numpy.exp", "numpy.zeros" ] ]
mexxexx/stumpy
[ "dcfa14b98aee375da4239363c1d2a6520fb54e80" ]
[ "stumpy/mpdist.py" ]
[ "# STUMPY\n# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.\n# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.\n\nimport numpy as np\nimport math\n\nfrom . import stump, stumped, core\nfrom .core import _mass_distance_matrix\nfrom .aampdist import aa...
[ [ "numpy.nanmin", "numpy.isfinite", "numpy.empty", "numpy.full" ] ]
SungbinChoi/w4c_st1
[ "5acdedf3c6278cd7239a6beb605c3e16821f7c86" ]
[ "test/v2_1/test1.py" ]
[ "import random\nfrom random import shuffle\nimport numpy as np\nfrom datetime import datetime\nimport time\nimport queue\nimport threading\nimport logging\nfrom PIL import Image\nimport itertools\nimport re\nimport os\nimport glob\nimport shutil\nimport sys\nimport copy\nimport h5py\nfrom netCDF4 import Dataset\nim...
[ [ "torch.cat", "torch.load", "torch.nn.ELU", "numpy.dtype", "numpy.concatenate", "torch.no_grad", "torch.cuda.manual_seed_all", "numpy.moveaxis", "numpy.arange", "torch.reshape", "torch.backends.cudnn.version", "torch.from_numpy", "torch.nn.GroupNorm", "numpy....
IBM/dse-do-dashboard
[ "30348da5414ef03890e6f3b92a36afc77757a021" ]
[ "test/pharma/supply_chain/pharma/pharmaplotlymanager.py" ]
[ "from typing import List, Dict, Tuple, Optional\nimport pandas as pd\n\nfrom supply_chain.pharma.pharmadatamanager import PharmaDataManager\nfrom supply_chain.scnfo.scnfoplotlymanager import ScnfoPlotlyManager\n\nimport plotly.express as px\nimport plotly.graph_objs as go\nimport numpy as np\n\nfrom dse_do_dashboar...
[ [ "pandas.concat", "pandas.Series", "pandas.isnull", "pandas.DataFrame", "numpy.round", "numpy.where" ] ]
kinlead/Haasoscope
[ "9eefa1df383f24ed844bc113bb5e52d963dc34b5" ]
[ "software/HaasoscopeLibQt.py" ]
[ "# -*- coding: utf-8 -*-\nimport sys\n\n#print(\"Loading HaasoscopeLibQt.py\")\n\n# You might adjust these, just override them before calling construct()\nnum_board = 1 # Number of Haasoscope boards to read out\nmax_ram_width = 13 # max size of the buffer rams (2*13=8096 bytes)\nmax_slowadc_ram_width = 11 # max siz...
[ [ "numpy.sqrt", "numpy.dtype", "numpy.concatenate", "numpy.max", "numpy.arctan2", "numpy.mean", "numpy.roll", "numpy.arange", "numpy.sin", "numpy.frombuffer", "numpy.std", "numpy.argmax", "numpy.zeros", "numpy.multiply", "numpy.array", "numpy.sum", ...
cnlab/cnlab_pipeline
[ "979e2fcdfe9113deec1bc9bad17c2624c1e516bb" ]
[ "archive/first_level.py" ]
[ "\n# coding: utf-8\n\n# # Building first level models using `nipype` and `SPM` with parametric modulation\n# \n# ## Parametric modulator setup from BIDS events tsv for _megameta_ tasks\n# \n# ### Multiple run task setup (testing on P1 Image Task)\n# \n# -------\n# #### History\n# \n# * 1/21/19 mbod - modify notebo...
[ [ "pandas.read_csv", "scipy.io.loadmat" ] ]
yeongjoonJu/Occlusion-Robust-3D-Face-CFR-GAN
[ "1966faf9bfe8d8afd6bc2cea88e5400ce3be54d5" ]
[ "renderer.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\nfrom ctypes import ArgumentError\nimport os ; import sys \nos.chdir( os.path.split( os.path.realpath( sys.argv[0] ) )[0] ) \n\nfrom mmRegressor.network.resnet50_task import *\nfrom mmRegressor.preprocess_img import Preprocess\nfrom mmRegressor.load_data import *\nfrom ...
[ [ "torch.mean", "numpy.hstack", "numpy.expand_dims", "torch.Tensor", "torch.cat", "numpy.reshape", "torch.load", "numpy.clip", "torch.sum", "torch.zeros_like", "torch.from_numpy", "torch.square", "torch.FloatTensor", "torch.device", "torch.clamp", "num...
ericauuu/get_the_foodies
[ "2abfae6a0f69a264866f10b8e9177e5b45681222" ]
[ "app.py" ]
[ "from waitress import serve\n\nimport matplotlib\nmatplotlib.use('Agg')\nfrom flask import Flask, render_template, request\nimport matplotlib.pyplot as plt\nfrom python.functions import result_f1scr, result_table\n\napp = Flask(__name__, static_url_path=\"/static\")\n\n@app.route(\"/\")\ndef index():\n \"\"\"Re...
[ [ "matplotlib.use" ] ]
GuilinZ/PF-Net-Point-Fractal-Network
[ "80322cc2fb330c9820eb8540de75ca28e3fe64c4" ]
[ "Train_PFNet.py" ]
[ "import os\nimport sys\nimport argparse\nimport random\nimport torch\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.utils.data\nimport torchvision.transforms as transforms\nfrom torch.autograd import Variable\nimport utils\nfrom utils import PointLoss\nfrom utils import distance_squre...
[ [ "torch.Tensor", "torch.load", "torch.nn.init.constant_", "torch.manual_seed", "torch.unsqueeze", "torch.autograd.Variable", "torch.nn.BCEWithLogitsLoss", "torch.FloatTensor", "torch.nn.init.normal_", "torch.cuda.is_available", "torch.cuda.manual_seed_all", "torch.cu...
lanl/nubhlight
[ "6c0f2abc05884538fe8e4e2e70a021b7c48a72c2" ]
[ "script/analysis/check_transformation_matrices.py" ]
[ "# ======================================================================\n# copyright 2020. Triad National Security, LLC. All rights\n# reserved. This program was produced under U.S. Government contract\n# 89233218CNA000001 for Los Alamos National Laboratory (LANL), which\n# is operated by Triad National Security,...
[ [ "numpy.array", "numpy.zeros" ] ]
almostdutch/mortgage-payment-optimization
[ "9aeb9037ceb4383fe679f0e210bbfc06a828cee8" ]
[ "demo_mortgage_payment_optimization.py" ]
[ "\"\"\"\ndemo_mortgage_payment_optimization.py\n\nNumerical optimization to find the optimum way for the quickest reduction in the mortage debt \\\n while keeping the monthly payments as low as possible.\n \nSet lambda1 and lambda2 according to your priorities.\n\nmortgage_amount = initial mortgage amount ...
[ [ "matplotlib.pyplot.tight_layout", "numpy.linalg.inv", "numpy.arange", "numpy.eye", "matplotlib.pyplot.subplots", "numpy.concatenate", "numpy.repeat", "numpy.zeros" ] ]
lialzm/akshare
[ "5bc7f0ddcb540f4290c37a89b23feba3fceddf18", "5bc7f0ddcb540f4290c37a89b23feba3fceddf18" ]
[ "akshare/index/index_zh_em.py", "akshare/stock/stock_info_em.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\"\"\"\nDate: 2022/2/2 23:26\nDesc: 东方财富网-行情首页-沪深京 A 股\n\"\"\"\nimport requests\nimport pandas as pd\n\n\ndef index_code_id_map_em() -> dict:\n \"\"\"\n 东方财富-股票和市场代码\n http://quote.eastmoney.com/center/gridlist.html#hs_a_board\n :return: 股票和市场代码\n :rtyp...
[ [ "pandas.to_datetime", "pandas.to_numeric", "pandas.DataFrame" ], [ "pandas.notna", "pandas.DataFrame" ] ]
Brinks0211/cognitive_paradigms_patients_data_analysis
[ "c9a231cb5e1ec321f11b99a3bacb0ed80b2c4bac", "c9a231cb5e1ec321f11b99a3bacb0ed80b2c4bac" ]
[ "11_Time_Perception.py", "9_Simple_Guessing_Task.py" ]
[ "import csv\r\nimport numpy\r\nimport tkinter as tk\r\nfrom tkinter.filedialog import askopenfilename\r\nreacttime = []\r\ncorratio = []\r\nStandard_Deviation = []\r\n\r\n# GUI\r\nroot = tk.Tk()\r\nroot.wm_title(\"11_Time_Perception\")\r\nroot.geometry(\"700x200\")\r\npath=tk.StringVar()\r\nw0=tk.Label(root, text='...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.std", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel" ], [ "matplotlib.pyplot.legend", "matplotli...
phww/Study-Model-Myself
[ "f7cb97899c6711b0105b9e4c7ad0eecdda2ad0b4" ]
[ "R-CNN/utils/template.py" ]
[ "#!/usr/bin/env python\n# _*_ coding: utf-8 _*_\n# @Time : 2021/5/14 下午4:59\n# @Author : PH\n# @Version:V 0.1\n# @File : template.py\n# @desc :\nimport torch\nimport os\nimport os.path as osp\n\n\nclass TemplateModel:\n def __init__(self):\n # tensorboard\n self.writer = None\n # 训练状态\n ...
[ [ "torch.save", "torch.cuda.empty_cache", "torch.cat", "torch.load" ] ]
dreamer121121/U-2-Net
[ "99fbfbab1126677f8596ea04fa40c5baadea73db" ]
[ "u2net_test.py" ]
[ "import os\nfrom skimage import io, transform\nimport torch\nimport torchvision\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms#, utils\n# import torch.optim as optim\n\nimport numpy as...
[ [ "torch.max", "torch.load", "torch.min", "torch.utils.data.DataLoader", "torch.cuda.is_available", "numpy.array", "torch.autograd.Variable" ] ]
Srujan35007/My-GANs
[ "7953c859169134a0a84ac3cd674f629af9942465" ]
[ "Simple GAN/train.py" ]
[ "import torch \nimport torch.nn as nn \nimport torch.nn.functional as F \nimport torch.optim as optim \nimport numpy as np \nimport random\nfrom networks import Generator, Discriminator\nimport matplotlib.pyplot as plt \nprint('Imports complete')\n\n\ndef normalize(array, original_range, target_range):\n min_arr...
[ [ "torch.empty", "torch.max", "torch.min", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "torch.rand", "torch.cuda.is_available", "torch.device" ] ]
temuller/cosmo_phot
[ "011333f84486614cb9339d3874dc072c45ebed23" ]
[ "src/hostphot/local_photometry.py" ]
[ "# Check the following urls for more info about Pan-STARRS:\n#\n# https://outerspace.stsci.edu/display/PANSTARRS/PS1+Image+Cutout+Service#PS1ImageCutoutService-ImportantFITSimageformat,WCS,andflux-scalingnotes\n# https://outerspace.stsci.edu/display/PANSTARRS/PS1+Stack+images#PS1Stackimages-Photometriccalib...
[ [ "numpy.log", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.Circle", "numpy.copy", "numpy.log10", "numpy.nanmean", "matplotlib.pyplot.close", "numpy.nanstd", "matplotlib.pyplot.show" ] ...
ahmadjubair33/qiskit-finance
[ "63822defdc5d12798009c7d98e82f515ca81249b" ]
[ "qiskit_finance/circuit/library/probability_distributions/normal.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2022.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.eye", "numpy.sum", "scipy.stats.multivariate_normal.pdf" ] ]
cclauss/episodic-curiosity
[ "3c406964473d98fb977b1617a170a447b3c548fd" ]
[ "episodic_curiosity/environments/dmlab_utils.py" ]
[ "# coding=utf-8\n# Copyright 2019 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl...
[ [ "numpy.array", "numpy.random.RandomState", "numpy.moveaxis" ] ]
AnH0ang/big-data-challenge
[ "aa9ba92e2355bc2838a037219d20d387e2eefdbb" ]
[ "src/app/utils.py" ]
[ "from copy import deepcopy\n\nimport numpy as np\nimport optuna\nimport pandas as pd\nimport plotly.express as px\nimport plotly.graph_objects as go\nimport streamlit as st\nfrom optuna.study import Study\nfrom sklearn.metrics import (\n accuracy_score,\n auc,\n f1_score,\n log_loss,\n roc_auc_score,...
[ [ "sklearn.metrics.roc_auc_score", "numpy.linspace", "numpy.cumsum", "sklearn.metrics.roc_curve", "sklearn.metrics.log_loss", "sklearn.metrics.auc", "sklearn.metrics.f1_score", "numpy.histogram", "sklearn.metrics.accuracy_score" ] ]
lopez86/DataTools
[ "573419f3a40ddeb5e9eaf5ced8ea8dbf41c8a65e" ]
[ "data_tools/tf/feed_dict.py" ]
[ "import funcy\r\nimport numpy as np\r\n\r\n\r\ndef make_simple_feed_builder(\r\n istrain_str='is_train',\r\n sparse=None\r\n):\r\n builder = funcy.partial(\r\n simple_feed_builder,\r\n istrain_str=istrain_str,\r\n sparse=sparse\r\n )\r\n return builder\r\n\r\n\r\ndef simple_feed_...
[ [ "numpy.mat" ] ]
pahn04/PPConv
[ "395957b919786bb5b603f37a94ccf9173afce085" ]
[ "fpconv_code/models/ppcnn/modules/se.py" ]
[ "import torch.nn as nn\n\n__all__ = ['SE']\n\n\nclass SE(nn.Module):\n def __init__(self, channel, reduction=8):\n super().__init__()\n self.fc = nn.Sequential(\n nn.Linear(channel, channel // reduction, bias=False),\n nn.ReLU(inplace=True),\n nn.Linear(channel // r...
[ [ "torch.nn.Linear", "torch.nn.ReLU", "torch.nn.Sigmoid" ] ]
QuinnQiao/pytorch-CycleGAN-and-pix2pix
[ "1f293d1f7c357002ef963ed0cbdbf87c9ba970f5" ]
[ "data/colorization_dataset.py" ]
[ "import os.path\nfrom data.base_dataset import BaseDataset, get_params, get_transform\nfrom data.image_folder import make_dataset\nfrom skimage import color # require skimage\nfrom PIL import Image\nimport numpy as np\nimport torchvision.transforms as transforms\n\n\nclass ColorizationDataset(BaseDataset):\n \"...
[ [ "numpy.array" ] ]
EllonLi/faster-rcnn-pytorch
[ "577a5062f3643b2667d9d28018b07e255dbf7551" ]
[ "lib/model/faster_rcnn/resnet.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom model.utils.config import cfg\nfrom model.faster_rcnn.faster_rcnn import _fasterRCNN\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\ni...
[ [ "torch.nn.Sequential", "torch.load", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.Linear", "torch.nn.Module.train", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.utils.model_zoo.load_url", "torch.nn.init.kaimi...
Psychedelic-Engineering/sleep-machine
[ "2fcb486b3735fc8ec1d3d29e75c6c9bb60c7d2a7" ]
[ "hardware/channel.py" ]
[ "from collections import deque\nimport math\nimport numpy as np\nfrom scipy import signal\n\n\nclass Channel:\n\n\tdef __init__(self, name, min, max, maxNum, offset=0.0):\n\t\tself.name = name\n\t\tself.min = min\n\t\tself.max = max\n\t\tself.num = 0\n\t\tself.sum = 0\n\t\tself.buffersum = 0\n\t\tself.size = maxNum...
[ [ "scipy.signal.lfilter", "numpy.zeros", "scipy.signal.firwin" ] ]
satejsoman/matplotlib2tikz
[ "583a66f6842d236ee42d85485de9c6a503585893" ]
[ "test/test_scatter.py" ]
[ "# -*- coding: utf-8 -*-\n#\nfrom helpers import assert_equality\n\n\ndef plot():\n from matplotlib import pyplot as plt\n import numpy as np\n\n fig = plt.figure()\n with plt.style.context((\"fivethirtyeight\")):\n np.random.seed(123)\n plt.scatter(\n np.linspace(0, 100, 101),\...
[ [ "numpy.linspace", "numpy.random.seed", "matplotlib.pyplot.style.context", "numpy.random.rand", "matplotlib.pyplot.figure" ] ]
jjd9/RobotMapping_SLAM_Assignments_In_Cpp
[ "4810a5dbb9ec8f07c8412d27049426a384ef3120" ]
[ "UKF_Slam/C++/plot.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\n\ndata = pd.read_csv(\"SLAM_estimates.csv\").values\n\nrobot = data[:,:2]\nplt.plot(robot[:,0],robot[:,1],'k-o',label='robot')\n\nfor j, i in enumerate(range(3,data.shape[1],2)):\n print(i)\n plt.plot(data[:,i],data[:,i+1],'o', label = 'landmark: '+ str(j...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
Mattio89/visualization
[ "562f231c887e7328cd098a3a675cf5b99bec8aaa" ]
[ "find_tweets.py" ]
[ "#Tweet Finding\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nfrom matplotlib.dates import DateFormatter\nimport matplotlib.ticker as mtick\nimport numpy as np\nimport datetime\n\ndforlando = pd.read_csv(\"ORLANDO_Full.csv\", usecols=[3,4], header=0, names=['url', 'text...
[ [ "pandas.read_csv", "pandas.to_numeric" ] ]
Leviyu/EQVirSa
[ "7727ae6b504f2e903dedafe79767f4c171e69bf8" ]
[ "code_dir/get_AVE_SNR_of_file.py" ]
[ "import numpy as np\nimport sys \nimport os\n\n\n\n\nfile_name = sys.argv[1]\n\ndt_array = []\n\nwith open(file_name,\"r\") as f:\n for line in f.readlines():\n value = float(line.strip())\n #print(value)\n dt_array.append(value)\n\n\n\n#print(dt_array)\nmean = np.mean(dt_array)\nstd = np.st...
[ [ "numpy.std", "numpy.mean" ] ]
huangming6220/news_mining
[ "83389fcc8598a7b934fad0ac4b4db141ce26e7d9" ]
[ "step2-2-2_clean_news_more.py" ]
[ "# coding: utf-8\n\n###################################################################\n# Step 2-2-1: further clean news\n###################################################################\n\n# Libraries:\n# ==========\n\nimport re\nimport pandas as pd\n\n# Functions:\n# ==========\n\n### clean data\ndef clean_me...
[ [ "pandas.read_pickle" ] ]
robert-g-butler/python_reference_guide
[ "b9945ef645699c8676660a7c76eabe5a99bf9298" ]
[ "module_scikit-learn/linear_regression.py" ]
[ "'''\nThis script contains examples of Linear Regression analysis, using the SciKit-\nLearn library.\n\nLinear regression is useful when trying to predict from a set of continuous\ndata.\n'''\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom sklearn.datasets ...
[ [ "sklearn.metrics.explained_variance_score", "pandas.Series", "matplotlib.pyplot.scatter", "sklearn.metrics.mean_absolute_error", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.LinearRegression", "sklea...
surajkothawade/mmdetection
[ "a148d8a9079c6d88ad6eddee929d577388c8182c" ]
[ "mmdet/datasets/builder.py" ]
[ "import copy\nimport platform\nimport random\nfrom functools import partial\n\nimport numpy as np\nfrom mmcv.parallel import collate\nfrom mmcv.runner import get_dist_info\nfrom mmcv.utils import Registry, build_from_cfg\nfrom torch.utils.data import DataLoader\n\nfrom .samplers import DistributedGroupSampler, Dist...
[ [ "numpy.random.seed" ] ]
glennpow/glearn
[ "e50046cb76173668fec12c20b446be7457482528" ]
[ "glearn/viewers/discrete_env_viewer.py" ]
[ "import queue\nimport numpy as np\nfrom .advanced_viewer import AdvancedViewer\n\n\nclass DiscreteEnvViewer(AdvancedViewer):\n def __init__(self, config, **kwargs):\n super().__init__(config, **kwargs)\n\n def prepare(self, trainer):\n super().prepare(trainer)\n\n self.trainer.add_fetch(\...
[ [ "numpy.amax", "numpy.full", "numpy.argmax", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
chatipat/ivac
[ "c4673a8b5e425bc1841415763190996794e48a1e" ]
[ "src/ivac/nonlinear.py" ]
[ "import numpy as np\nimport torch\nimport pytorch_lightning as pl\nfrom .linear import LinearVAC, LinearIVAC\n\n\nclass NonlinearIVAC:\n \"\"\"Solve nonlinear IVAC using a neural network basis.\n\n Parameters\n ----------\n minlag : int\n Minimum IVAC lag time in units of frames.\n maxlag : in...
[ [ "torch.nn.Sequential", "torch.nn.BatchNorm1d", "torch.mean", "torch.randint", "torch.max", "torch.cat", "torch.trace", "torch.utils.data.DataLoader", "torch.inverse", "torch.nn.Linear", "numpy.shape", "torch.rand", "torch.argsort", "torch.bucketize", "to...
criteo-dexter/deepr
[ "4de9cb8afc09cb3d2f7c42da248a966bfea5fc83" ]
[ "deepr/layers/lstm.py" ]
[ "# pylint: disable=no-value-for-parameter,unexpected-keyword-arg\n\"\"\"LSTM layers.\"\"\"\n\nimport tensorflow as tf\n\nfrom deepr.layers import base\n\n\n@base.layer(n_in=2, n_out=3)\ndef LSTM(tensors, num_units: int, bidirectional: bool = False, **kwargs):\n \"\"\"LSTM layer.\"\"\"\n words, nwords = tensor...
[ [ "tensorflow.concat", "tensorflow.contrib.rnn.TimeReversedFusedRNN", "tensorflow.contrib.rnn.LSTMBlockFusedCell", "tensorflow.transpose" ] ]
wonderseen/OVC-MMT
[ "b982038ea1295cc038b8dcbca11aa81d318f7a49" ]
[ "OVC_train.py" ]
[ "'''\nOur implementation of our proposed OVC refers to the original data pipeline of VAG-NMT\nand modifications were done, including:\n1. Preprocess all object-level features and detect translation-relevant/irrelevant objects\n in Multi30K, which needs lots of prep work, which costs around 1-2 days.\n2. Preproces...
[ [ "torch.optim.Adam", "torch.nn.NLLLoss", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.ones", "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available" ] ]
vznncv/vznncv-signal-generator
[ "d5fe9a4effa19e4f1af01ab52e782790af11afad" ]
[ "src/vznncv/signal/generator/onedim/_generator.py" ]
[ "\"\"\"\nMain module to generate one dimensional random process.\n\"\"\"\nimport logging\nfrom typing import Iterable\n\nimport numpy as np\n\nfrom vznncv.signal.generator.onedim._window import calculate_linear_window_size, linear_window\nfrom ._utils import get_random_state, UnaryFunction, BinaryFunction, TrendFun...
[ [ "numpy.fft.irfft", "numpy.sqrt", "numpy.abs", "numpy.fft.rfftfreq", "numpy.empty_like", "numpy.arange", "numpy.full_like", "numpy.result_type", "numpy.trapz", "numpy.empty" ] ]
jamiesweeney/matrixmagic
[ "4c7674232643fa8b7524f0febdefd49f7950c62f" ]
[ "compare_complex.py" ]
[ "'''\n Jamie Sweeney\n April 2018\n\n Some more complex examples\n\n'''\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport time\nimport sys\nimport math\n\n\n\n# Example 1\n#-- Take RGB image convert to greyscale\nRGB_BINS = [0.299, 0.587, 0.114]\n\n# Iterative version of turning to greyscale\n...
[ [ "matplotlib.pyplot.legend", "numpy.array_equiv", "matplotlib.pyplot.plot", "numpy.random.rand", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros", "numpy.vstack", "matplotlib.pyplot.ylabel" ] ]
dkaramit/OpSDE
[ "c20bfbc17b905408aebcc8e32e6265f32738a285" ]
[ "Optimizers/Gradient-Descent/python/GD/NAdamGD.py" ]
[ "from numpy import sqrt as np_sqrt\nfrom numpy import abs as np_abs\n\nfrom .GradientDescent import GradientDescent\n\nclass NAdamGD(GradientDescent):\n '''Implementation of NAdam.'''\n def __init__(self,loss,beta_m=1-1e-1,beta_v=1-1e-3,epsilon=1e-8,alpha=1e-2):\n '''\n loss: the loss functi...
[ [ "numpy.abs", "numpy.sqrt" ] ]
snehasharma0707/License-Plate-Recognition
[ "433251795c5fdef06ab07497d5d13537a89c1a41", "433251795c5fdef06ab07497d5d13537a89c1a41" ]
[ "GenData.py", "Main_.py" ]
[ "# This file is used for training character recognition and the output of this file is classifications.txt and flattened_images.txt\n\nimport sys\nimport numpy as np\nimport cv2\nimport os\n\nMIN_CONTOUR_AREA = 100\n\nRESIZED_IMAGE_WIDTH = 20\nRESIZED_IMAGE_HEIGHT = 30\n\n\ndef main():\n imgTrainingNumbers = cv2...
[ [ "numpy.savetxt", "numpy.append", "numpy.array", "numpy.empty" ], [ "pandas.set_option", "pandas.read_json" ] ]
ebubae/adversarial-robustness-toolbox
[ "55efab2c1a60ae14c37b72fe84778355314396ea" ]
[ "art/classifiers/keras.py" ]
[ "# MIT License\n#\n# Copyright (C) IBM Corporation 2018\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy, ...
[ [ "numpy.expand_dims", "numpy.unique", "numpy.squeeze", "numpy.max", "numpy.argmax", "numpy.zeros", "numpy.sum", "numpy.random.randint" ] ]
pythonist2/marketpy
[ "50df49337012cc4049c395b4ed672e2710f22514" ]
[ "big_data_prepartion.py" ]
[ "from marketpy.preprocessing import *\nimport pandas as pd\nimport os\n\n\ndf_all = pd.DataFrame()\nfor file_name in os.listdir(\"data/indicies\"):\n df = pd.read_csv(\"data/indicies/\" + file_name)\n X, y =prepare_data_from_stooq(df)\n X, _, y, _ = train_test_split(X,y, test_size = 0.2)\n\n columns = [...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
MijungTheGatsbyPostdoc/SimSiam
[ "d8dd2b01f493d094dca1e7634d3b7c00857b5224" ]
[ "dc_gan_cifar.py" ]
[ "# originally code is from https://github.com/Ksuryateja/DCGAN-CIFAR10-pytorch/blob/master/gan_cifar.py\n# I am taking its generator for cifar10 dataset (nov 18, 2021)\n\n# used these are parameters in pycharm\n# --data_dir ../Data/ --log_dir ../logs/ -c configs/train_gen_cifar10_to_cifar10.yaml --ckpt_dir ~/.cache...
[ [ "torch.randint", "torch.load", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "torch.randn", "torch.reshape", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "torch.optim.lr_scheduler.StepLR", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", ...
TabeaSonnenschein/Spatial-Agent-based-Modeling-of-Urban-Health-Interventions
[ "23a207fe74005e45e6349853cdde516ce66647e0" ]
[ "Natural Language Processing Bibliometrics/CrossRef_XML_mining.py" ]
[ "import urllib.request\nimport os\nimport pandas as pd\nimport requests\nimport numpy as np\nimport itertools\nimport elsapy\n\nos.chdir(r\"C:\\Users\\Tabea\\Documents\\PhD EXPANSE\\Literature\\WOS_ModalChoice_Ref\")\npaper_DOIs = pd.read_csv(\"WOS_references_search5_metareviews_DOIs.csv\")\nprint(paper_DOIs.iloc[:...
[ [ "numpy.array", "pandas.read_csv" ] ]
iOsnaaente/Faculdade_ECA-UFSM
[ "aea8b8d66169b073c439b47ad990e45695cbe953", "aea8b8d66169b073c439b47ad990e45695cbe953" ]
[ "DeepLearning/01-Backpropagation/BackpropagationMNIST.py", "Metodos_numericos/MetodosDeGauss/GaussJacobi.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom struct import unpack\n\ndef read_imgs(img_filename):\n ''' Esta função lê o arquivo de imagens\n da base de dados MNIST\n '''\n\n # Abre o arquivo\n img_file = open(img_filename,'rb')\n\n # Lê o cabeçalho do arquivo\n magic = unpack('>i', img_file.read...
[ [ "numpy.dot", "matplotlib.pyplot.imshow", "numpy.log", "numpy.random.random", "numpy.reshape", "matplotlib.pyplot.plot", "numpy.argmax", "numpy.exp", "matplotlib.pyplot.show", "numpy.zeros", "numpy.random.randint" ], [ "numpy.array", "numpy.linalg.norm" ] ]
0shimax/chainer-feedbacknet
[ "0a4660ca194ad2a1bd26f3b3728fa332b7a50811" ]
[ "src/common/image_processor/feature_extractor/nucleus_diamiters.py" ]
[ "import sys, os\nsys.path.append('./src/common/image_processor/feature_extractor')\nimport cv2\nimport numpy as np\nimport pandas as pd\nfrom operator import itemgetter\nfrom collections import defaultdict\nfrom feature_extractor_utils import (show_image,\n smooth_contour,\n ...
[ [ "numpy.where", "numpy.abs", "pandas.DataFrame" ] ]
AzNOAOTares/plasticc
[ "03f8995673b6f09156783d35c7d63f34729d0610" ]
[ "plasticc/get_data.py" ]
[ "# -*- coding: UTF-8 -*-\n\"\"\"\nGet PLASTICC data from SQL database\n\"\"\"\nimport sys\nimport os\nimport numpy as np\nimport warnings\nimport argparse\nimport pandas as pd\nimport astropy.table as at\nimport astropy.io.fits as afits\nfrom collections import OrderedDict\nimport database\nimport helpers\n\nROOT_D...
[ [ "numpy.concatenate", "numpy.array", "numpy.where", "pandas.DataFrame" ] ]
pastas/pastastore
[ "82eaf25ade96e1a09871390745b3cf441f8ef264" ]
[ "tests/test_005_benchmark.py" ]
[ "import numpy as np\nimport pandas as pd\nimport pastastore as pst\nimport pytest\n\n# %% write\n\n# data\ndata = np.random.random_sample(int(1e5))\ns = pd.Series(index=pd.date_range(\"1970\", periods=1e5, freq=\"H\"),\n data=data)\nmetadata = {\"x\": 100000., \"y\": 300000.}\n\n\ndef series_write(conn...
[ [ "pandas.read_csv", "pandas.date_range" ] ]
PRIS-CV/BSNet
[ "993ce867aadc73aea33139751fd4454033cde9dd" ]
[ "methods/meta_template.py" ]
[ "import backbone\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport numpy as np\nimport torch.nn.functional as F\nimport utils\nfrom abc import abstractmethod\n\nclass MetaTemplate(nn.Module):\n def __init__(self, model_func, n_way, n_support, change_way = True):\n super(Met...
[ [ "numpy.sqrt", "numpy.asarray", "numpy.std", "numpy.mean", "numpy.sum" ] ]
partha-ghosh/pyeffects
[ "b941e9b09c9889c01b103d758707d36c3520de2a" ]
[ "elements/latex.py" ]
[ "import hashlib\nimport os\n\nimport bs4\nimport numpy as np\n\nfrom .group import Group\nfrom .path import Path\nfrom .shapes import Rectangle\n\n\nclass TexConfig:\n main_font = None\n mono_font = None\n sans_font = None\n margin = 5.5\n scale_factor = 8\n fill = [255, 255, 255]\n stroke = [2...
[ [ "numpy.array" ] ]
zzz1515151/self-supervised_learning_sketch
[ "4253986afc92a1f30ee5caadbc074acb297f43b0" ]
[ "train_tcn.py" ]
[ "from __future__ import print_function\nimport sys\nsys.path.append(\"../\")\nimport argparse\nimport os\nimport torch \nimport time\nimport imp\nimport numpy as np\nimport datetime\nfrom tensorboardX import SummaryWriter\nfrom tqdm import tqdm\nfrom torch import nn, optim\nfrom torch.nn.utils import clip_grad_norm...
[ [ "torch.nn.CrossEntropyLoss", "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.cuda.manual_seed_all", "torch.save" ] ]
sujanshahi050/Disaster-Response-Classifier
[ "fb8a9a28eeba7f9e8f1d63bff85ee45ca43892ab" ]
[ "app/run.py" ]
[ "import json\nimport plotly\nimport pandas as pd\nfrom nltk.stem import WordNetLemmatizer\nfrom nltk.tokenize import word_tokenize\n\nfrom flask import Flask\nfrom flask import render_template, request, jsonify\nfrom plotly.graph_objs import Bar\nfrom sklearn.externals import joblib\nfrom sqlalchemy import create_e...
[ [ "pandas.read_sql_table", "sklearn.externals.joblib.load" ] ]
cnrpman/HBMP
[ "ae47bd737d88657f7f9284b2dd1adc96e535bbd9" ]
[ "test.py" ]
[ "import numpy as np\nimport sys\nfrom argparse import ArgumentParser\nimport torch\nimport random\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\nfrom torchtext import data\nfrom torchtext import datasets\nfrom corpora import MultiNLI, SciTail, StanfordNLI, AllNLI, Breakin...
[ [ "torch.nn.CrossEntropyLoss", "torch.max", "torch.cuda.manual_seed", "numpy.random.seed", "torch.load", "torch.manual_seed", "numpy.mean" ] ]
dylancromer/coolplots
[ "58ddfed2090af14d0ce42e93a35c93339e9c619f" ]
[ "coolplots/data.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\ndef plot1d(xdata, ydata, outfile=None, xdata_label=None, ydata_label=None, caption=None):\n plt.gcf().clear()\n with plt.xkcd():\n fig = plt.figure()\n ax = fig.add_axes((0.1, 0.2, 0.8, 0.7))\n\n ax.spines['right'].set_color('none')\...
[ [ "matplotlib.pyplot.xkcd", "numpy.linspace", "matplotlib.pyplot.scatter", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "numpy.random.rand", "matplotlib.pyplot.xlabel", "numpy.exp", "matplotlib.pyplot.figure" ] ]
serge-m/omicron_ai_pilot_keras
[ "c9f0459ecd880ff685ba852eccd24685ab73623e" ]
[ "src/ai_driver.py" ]
[ "#!/usr/bin/env python3\nimport threading\n\nimport rospy\nfrom ackermann_msgs.msg import AckermannDriveStamped\nfrom sensor_msgs.msg import CompressedImage\n\nimport tensorflow as tf\nfrom tensorflow.python.keras.models import load_model\nfrom keras_preprocessing.image.utils import load_img, img_to_array\n\nfrom i...
[ [ "tensorflow.keras.backend.get_session", "tensorflow.get_default_graph", "numpy.zeros", "tensorflow.python.keras.models.load_model" ] ]
huschen/kaggle_nips17_adversarial
[ "aa619d937a77ef5f2efee6475b573aea652cf3cf" ]
[ "models_targeted_attacks/target_mng/attack_target_mng.py" ]
[ "\"\"\"Implementation of target attack.\n Three models (base_incep, adv_incep, res_incep) are used.\n The models are ensembled using mean norm gradient methrod.\n The inferstructure code is based on\n https://github.com/tensorflow/cleverhans/cleverhans/tree/master/\n examples/nips17_adversarial_competition/sam...
[ [ "tensorflow.Graph", "tensorflow.train.Scaffold", "tensorflow.contrib.slim.get_model_variables", "tensorflow.flags.DEFINE_string", "tensorflow.train.MonitoredSession", "tensorflow.placeholder", "numpy.copy", "tensorflow.logging.set_verbosity", "tensorflow.flags.DEFINE_float", ...
KEHANG/chemprop
[ "98e7da830e766311a70318bd8393cbc24cc5e9fd" ]
[ "chemprop/args.py" ]
[ "import json\nimport os\nfrom tempfile import TemporaryDirectory\nimport pickle\nfrom typing import List, Optional, Tuple\nfrom typing_extensions import Literal\n\nimport torch\nfrom tap import Tap # pip install typed-argument-parser (https://github.com/swansonk14/typed-argument-parser)\n\nfrom chemprop.features i...
[ [ "torch.device", "torch.cuda.device_count", "torch.cuda.is_available" ] ]
devhliu/dlaais-data
[ "790c497ab8e1c39524d37f924a72ea52343a01a8" ]
[ "proj_temp/step_04.02_batch_check_rigid_registration_site005.py" ]
[ "\nimport os\nimport ants\nimport shutil\nimport nibabel as nib\nimport numpy as np\nimport pandas as pd\n\nfrom glob import glob\n\nworking_root = '/data/public/data/003_STROKE_CTP/002_NIIX_SITE005'\nclinical_root = '/data/public/data/003_STROKE_CTP/003_CLINICAL_SITE005'\noutput_xlsx_filename = '002_NIIX_SITE005_C...
[ [ "numpy.mean", "pandas.DataFrame" ] ]
wtabib/extrinsics_calibrator
[ "b0957e45e9c1c09e60ec115c1ec94991a0b338a0" ]
[ "nodes/centered_mocap_rebroadcaster.py" ]
[ "#!/usr/bin/env python2.7\nfrom __future__ import division\nimport roslib\nimport rospy\nimport tf\nfrom nav_msgs.msg import Odometry\nfrom nav_msgs.msg import Path\nfrom geometry_msgs.msg import PoseStamped\nimport numpy as np\n\n\nclass GT_cleaner:\n\n def __init__(self):\n\n self.last_time = rospy.Time...
[ [ "numpy.dot", "numpy.linalg.inv", "numpy.eye", "numpy.linalg.norm", "numpy.array" ] ]
y0ast/uncertainty-baselines
[ "8d32c77ba0803ed715c1406378adf10ebd61ab74", "b9c6b870790034c1a2303246f887fd2cf53bff38" ]
[ "baselines/jft/heteroscedastic_test.py", "uncertainty_baselines/models/criteo_mlp_test.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Uncertainty Baselines 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# Unles...
[ [ "tensorflow.test.main" ], [ "tensorflow.test.main" ] ]
jypkkjj/rqalpha
[ "f88be1112369c765054ba54512d1f7de3bc2ed47" ]
[ "strategy/github/chougoushi_1.0.py" ]
[ "# 可以自己import我们平台支持的第三方python模块,比如pandas、numpy等。\r\n#存在问题:如果一只股票已经买入了,但是被剔除出股票池,以后就不会再操作它。\r\n#目标收益6%:4年累计25.958%\r\n#\r\nimport talib\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n# 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。\r\ndef init(context):\r\n # 在context中保存全局变量\r\n # context.s1 = \"600600.XS...
[ [ "numpy.array", "pandas.DataFrame" ] ]
0lidaxiang/IR
[ "e4a7213f43e7aa2e332057b2b4b2bd98ceabf5be" ]
[ "homework3-EM/code/em_algorithms.py" ]
[ "#!/usr/bin/python3\n# coding: utf-8\n\nimport numpy as np\nimport math\nfrom datetime import datetime\n\nimport dictionary\nimport document\nimport wordDocsCount\nimport wordDocsNoCount\n\nstartInitial = datetime.now()\n\ndocList = document.getFilesName()\nwordList = dictionary.getDictionary()\nwNumber = len(wordL...
[ [ "numpy.zeros", "numpy.ones" ] ]
UofSC-QDEVS/shipsys
[ "d01a8c8273aac916a1772a3d37db35faff68ea83" ]
[ "python/qdlpy3/QdlPy/funcss.py" ]
[ "\"\"\"Delegate function-based State Space Framework.\n\"\"\"\n\nimport lti\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass FuncSystem(object):\n\n def __init__(self, num_states, num_inputs, num_outputs):\n\n self.n = num_states\n self.m = num_inputs\n self.p = num_outputs\n\...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.show", "numpy.zeros" ] ]
hougeaaa/HappyDay
[ "60e226d380862db30b3c6abc1d7d7fbbcddd04a0" ]
[ "Study_NumPy/6.py" ]
[ "import numpy as np\n\n# 数组的 dtype 为 int8(一个字节)\nx = np.array([1, 2, 3, 4, 5], dtype=np.int8)\nprint(x.itemsize)\n\n# 数组的 dtype 现在为 float64(八个字节)\ny = np.array([1, 2, 3, 4, 5], dtype=np.float64)\nprint(y.itemsize)" ]
[ [ "numpy.array" ] ]
yilmazbaysal/Fashion-Classifier
[ "79cced68c83c32bda275a003a55b1a7cfdbc845a" ]
[ "src/feature_extractor.py" ]
[ "import cv2\nimport numpy as np\nfrom keras import Model\nfrom keras.applications import VGG16\nfrom keras.preprocessing import image\nfrom keras.applications.vgg16 import preprocess_input\n\n\nclass FeatureExtractor:\n\n def __init__(self):\n self.model = VGG16(weights='imagenet', include_top=True)\n\n ...
[ [ "numpy.expand_dims" ] ]
shjwudp/fastmoe_shen
[ "b861e928000ddf1a94bb5f795e6286769e743bd9" ]
[ "examples/transformer-xl/mem_transformer.py" ]
[ "import sys\nimport math\nimport functools\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nsys.path.append('utils')\nfrom proj_adaptive_softmax import ProjectedAdaptiveLogSoftmax, Projection\nfrom log_uniform_sampler import LogUniformSampler, sample_logits\n\nclass P...
[ [ "torch.nn.functional.softmax", "torch.cat", "torch.zeros", "torch.nn.Embedding", "torch.no_grad", "torch.device", "torch.triu", "torch.nn.Dropout", "torch.ones", "torch.einsum", "torch.tril", "torch.arange", "torch.nn.functional.linear", "torch.LongTensor", ...
sanowar-raihan/meta-neus
[ "de58a303498423b674f0b03c4682b11e995c3064" ]
[ "models/rendering.py" ]
[ "import torch\nimport torch.nn as nn\nfrom models.networks import GeometryNet, AppearanceNet, SDensity\n\n\nclass NeuSRenderer(nn.Module):\n \"\"\"\n Neural Renderer according to NeuS \n https://arxiv.org/abs/2106.10689\n \"\"\"\n def __init__(self,\n geometry_net,\n a...
[ [ "torch.linspace", "torch.sigmoid", "torch.rand_like", "torch.einsum", "torch.cumprod", "torch.ones_like" ] ]
boeleman/scipy
[ "e8212863a7c09e047e78a9a8f983527ad01c69fc" ]
[ "scipy/stats/tests/test_discrete_basic.py" ]
[ "import numpy.testing as npt\nimport numpy as np\nimport pytest\n\nfrom scipy import stats\nfrom .common_tests import (check_normalization, check_moment, check_mean_expect,\n check_var_expect, check_skew_expect,\n check_kurt_expect, check_entropy,\n ...
[ [ "numpy.testing.assert_equal", "numpy.histogram", "numpy.linspace", "numpy.random.seed", "numpy.unique", "numpy.arange", "numpy.full", "numpy.testing.assert_array_equal", "numpy.testing.assert_", "numpy.testing.assert_allclose", "numpy.array", "numpy.zeros", "sci...
suoluowan/AMANet-pytorch
[ "9981447a284bde8e76744928f0feba34f2a5cd6f" ]
[ "detectron2/engine/defaults.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\n\"\"\"\nThis file contains components with some default boilerplate logic user may need\nin training / testing. They will not work for everyone, but many users may find them useful.\n\nThe behavior of functions/class...
[ [ "torch.no_grad" ] ]