repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ggafiled/ThaiPersonalCardExtract
[ "7747086ff4d28ad9ec04f8ca7d68ac6e6f393cd4" ]
[ "src/ThaiPersonalCardExtract/DrivingLicense/DrivingLicense.py" ]
[ "from ..utils import Language, Provider, automatic_brightness_and_contrast\nfrom collections import namedtuple\nimport os\nimport cv2\nimport sys\nimport yaml\nimport base64, binascii\nimport numpy as np\nimport pytesseract\nimport easyocr\nfrom PIL import Image\nfrom pathlib import Path\n\nclass DrivingLicense:\n ...
[ [ "numpy.float32" ] ]
pipidogs/My-Little-Lovable
[ "ba30d0b48bc241ad83a196e914592d09101383eb" ]
[ "csv_to_tsv.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\n @Name: csv_to_tsv\n @Date: 2021/8/23\n @Description: 将csv文件转化为tsv文件\n\"\"\"\nimport numpy as np\n\nimport pandas as pd\n\nfilename = '此处文件名'\ntrain_set = pd.read_csv(f\"data/{filename}.csv\", sep=',', header=0)\ntrain_set.dropna(inplace=True)\ntrain_set...
[ [ "pandas.read_csv" ] ]
logan-connolly/portfolio-posts
[ "31d2e2f7cfeac7b04c12ec0db781ce7164749b88" ]
[ "posts/moneyball_lacrosse/plot.py" ]
[ "import pandas as pd\nimport plotly.express as px\nimport plotly.graph_objs as go\nimport plotly.io as pio\nfrom loguru import logger\nfrom sklearn.metrics import r2_score\n\nfrom util import fit_model, make_predictions\n\n\ndef generate_model_plot(df, x, y, preds, out_file=None, title=None):\n plt = px.scatter(...
[ [ "sklearn.metrics.r2_score" ] ]
windrunner-e101/Zeta-1
[ "e663ad495080a0e80e86d53651616da24d804225" ]
[ "exts/utility.py" ]
[ "import io\nimport discord\nimport asyncpg\nimport matplotlib\nfrom main import Zeta\nfrom discord.ext import commands\nfrom matplotlib import pyplot as plt\n\n\ndef generate_plot(x, y):\n \"\"\"\n Generates a plot based on given data and returns a python file like object that has the plot image encoded in pn...
[ [ "matplotlib.pyplot.subplots" ] ]
xchani/TD3
[ "fe0c1371df59ae1751e1d5281cb07efe4e3715c6" ]
[ "ablation/TD3_CDQ.py" ]
[ "import copy\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n# Implementation of Twin Delayed Deep Deterministic Policy Gradients (TD3)\n# Paper: https://arxiv.org/abs/1802.09477\n\n\nclass Ac...
[ [ "torch.nn.Linear", "torch.cat", "torch.no_grad", "torch.nn.functional.mse_loss", "torch.randn_like", "torch.cuda.is_available", "torch.load" ] ]
nnzhan/AutoGCN
[ "22c1062152a67581b310c371dfc5a5e27f79dddb" ]
[ "nets/superpixels_graph_classification/sgc_net.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport dgl\nfrom torch.nn import Linear, ReLU, Dropout\n\n\"\"\"\n GCN: Graph Convolutional Networks\n Thomas N. Kipf, Max Welling, Semi-Supervised Classification with Graph Convolutional Networks (ICLR 2017)\n http://arxiv.org/abs/16...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.ModuleList", "torch.nn.ReLU", "torch.nn.CrossEntropyLoss" ] ]
maltius/cocoapi
[ "1ed9bc0515ba8b73b092774fcd6425d2aa87b336" ]
[ "PythonAPI/stable_version/align_imges_coco.py" ]
[ "import os\nimport platform\nimport numpy as np\nimport math\nimport cv2\nfrom scipy import ndimage\nimport time\n\n# read files and labels\nlabel1= np.load('data_configs/cocos_mids_new_aligned_pc.npy')\nfile_name = np.load('data_configs/files_mids_new_aligned_pc.npy')\n\n# what to name the file\nspec_name='what_to...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.sin", "scipy.ndimage.rotate", "numpy.zeros", "numpy.arcsin", "numpy.copy", "numpy.load", "numpy.save", "numpy.cos" ] ]
pgoel92/ParlAI
[ "9db71ed4d09763c166ec6fb811dac5617167c76d" ]
[ "tests/test_utils.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\nfrom parlai.cor...
[ [ "numpy.array", "torch.LongTensor", "numpy.arange" ] ]
bremond/siconos
[ "8deea56ff6779379f4f69e0376d24a81562a42d4" ]
[ "examples/Mechanics/GranularMaterial/chute_con_vibrador_bottom.py" ]
[ "#!/usr/bin/env python\n\n__all__ = ['create_chute']\n\nimport os, sys\n\nimport numpy\nimport math\nimport pickle\n\nfrom siconos.mechanics.collision.tools import Contactor\nimport siconos.numerics as Numerics\n\n# WARNING : in 3D by default z-axis is upward\n# this is very important to direct PLANx objects\n\ndim...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot" ] ]
estherrolf/representation-matters
[ "502e351e21fc6b33aaa5c96b8c1409c76807f5a7" ]
[ "goodreads/scripts/process_goodreads_data.py" ]
[ "from sklearn.feature_extraction.text import TfidfVectorizer\nimport pandas as pd\nimport numpy as np\nimport os\nimport sys\nimport scipy.sparse\n\nsys.path.append('../../code/scripts')\nfrom dataset_chunking_fxns import add_stratified_kfold_splits\n\ndata_dir = '../../data'\ngoodreads_data_dir = os.path.join(data...
[ [ "numpy.array", "numpy.random.RandomState", "pandas.read_json", "numpy.intersect1d", "pandas.concat", "sklearn.feature_extraction.text.TfidfVectorizer", "numpy.argsort" ] ]
jfilter/masters-thesis
[ "39a3d9b862444507982cc4ccd98b6809cab72d82" ]
[ "code/ynacc/12/finetune_CL_emb.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\n#!/usr/bin/env python\n\n\n# In[10]:\n\n\nimport argparse\nimport datetime\nfrom pathlib import Path\nimport shutil\n\nimport fastai\nimport pandas as pd\nimport pymongo\nimport sacred\nimport sklearn.metrics\nfrom fastai.basic_train import get_preds\nfrom fa...
[ [ "pandas.read_csv" ] ]
M-Josefsson/qmeq
[ "f4f08864fc778de7c14b198c0ffbaafe33ce18f6" ]
[ "qmeq/approach/elph/lindblad.py" ]
[ "\"\"\"Module containing python functions, which generate first order Lindblad kernels.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport numpy as np\nimport itertools\n\nfrom ...aprclass import ApproachElPh\nfrom ...specfunc.specfunc_elp...
[ [ "numpy.sqrt", "numpy.zeros" ] ]
NeilGirdhar/efax
[ "3a0f1ea3fafb456b024137dc5a20a9e7f9806a9f" ]
[ "tests/create_info.py" ]
[ "from typing import Any, List\n\nimport numpy as np\nimport scipy.stats as ss\nfrom numpy.random import Generator\nfrom tjax import ComplexArray, RealArray, Shape\n\nfrom efax import (BernoulliEP, BernoulliNP, BetaEP, BetaNP, ChiEP, ChiNP, ChiSquareEP, ChiSquareNP,\n ComplexCircularlySymmetricNorma...
[ [ "scipy.stats.geom", "scipy.stats.bernoulli", "numpy.mean", "numpy.exp", "numpy.cos", "scipy.stats.beta", "scipy.stats.poisson", "numpy.sin", "numpy.empty", "numpy.eye", "scipy.stats.chi", "scipy.stats.nbinom", "numpy.multiply.outer", "numpy.sqrt", "scipy...
robintzeng/RAFT
[ "0b3c54677fcc0cd9f414b6406a7b10e0b6969a14" ]
[ "extract_flow.py" ]
[ "import sys\nfrom numpy.lib.function_base import gradient\n\nfrom numpy.lib.twodim_base import histogram2d\nsys.path.append('core')\nimport pandas as pd \nimport argparse\nimport os\nimport cv2\nimport glob\nimport numpy as np\nimport torch\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nfrom tqdm import t...
[ [ "numpy.concatenate", "numpy.array", "numpy.ones_like", "matplotlib.pyplot.savefig", "numpy.sum", "torch.no_grad", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "torch.from_numpy", "numpy.where", "numpy.arange", "matplotlib.pyplot.tight_layout", "torch...
tsgolden/GUTILS
[ "02e07f3948689cfb3a8b0ff381c355db395e6560" ]
[ "gutils/nc.py" ]
[ "#!python\n# coding=utf-8\nfrom __future__ import division\n\nimport os\nimport json\nimport math\nimport shutil\nimport argparse\nimport calendar\nimport tempfile\nfrom glob import glob\nfrom pathlib import Path\nfrom datetime import datetime\nfrom collections import OrderedDict\n\nimport netCDF4 as nc4\nfrom comp...
[ [ "pandas.concat" ] ]
ychnlgy/LipoWithGradients
[ "4fe5228a3dae8bf5d457eef6191ba29314421f6b" ]
[ "src/src/tensortools/rand_indices.py" ]
[ "import torch, numpy\n\ndef rand_indices(n):\n I = torch.arange(n).long()\n numpy.random.shuffle(I.numpy())\n return I\n" ]
[ [ "torch.arange" ] ]
sylar-hj/mechineLearning-1
[ "6f310288dbfbb7838ac820b0899ba599693b19f9" ]
[ "MaiZi-Course/network.py" ]
[ "\"\"\"\nnetwork.py\n~~~~~~~~~~\n\nA module to implement the stochastic gradient descent learning\nalgorithm for a feedforward neural network. Gradients are calculated\nusing backpropagation. Note that I have focused on making the code\nsimple, easily readable, and easily modifiable. It is not optimized,\nand om...
[ [ "numpy.dot", "numpy.random.randn", "numpy.exp", "numpy.zeros" ] ]
thatscotdatasci/streamlit-example
[ "4d944085be7e30ea3fa9129d5ca16aa2aaf04e78" ]
[ "app/content/streamlit_examples_radio.py" ]
[ "import time\n\nimport numpy as np\nimport pandas as pd\nimport streamlit as st\n\nfrom app.abstract_classes.abstract_navigation_radio import AbstractNavigationRadio\n\n\nclass StreamlitExamplesRadio(AbstractNavigationRadio):\n\n name = \"Streamlit Examples\"\n\n def _action(self):\n st.markdown(\"\"\"...
[ [ "pandas.DataFrame", "numpy.random.randn" ] ]
p9n/cros-hummingbird
[ "6abe6e2e8ae3a5029c87e22c75d5c3353819c760" ]
[ "hummingbird.py" ]
[ "\"\"\"HummingBird I2C Eletrical Test Automation.\n\nThe project serves as an extension measurement module\nrun on Saleae Logic2 Software. Supporting main function\nwould be running I2C electrical test on capture data.\n\n\"\"\"\nimport csv\nimport math\nimport os\nimport sys\n\nfrom generate_report import OutputRe...
[ [ "numpy.median", "numpy.max", "numpy.argmax", "numpy.min" ] ]
mqjinwon/yoloSiamTracking
[ "1704a6cdc86d49f09b18481dbbac40ae223b3dd3" ]
[ "tools/util.py" ]
[ "\nfrom __future__ import division\n\nimport torch \nimport torch.nn as nn\nimport torch.nn.functional as F \nfrom torch.autograd import Variable\nimport numpy as np\nimport cv2 \nimport matplotlib.pyplot as plt\nfrom bbox import bbox_iou\n\ndef count_parameters(model):\n return sum(p.numel() for p in model.para...
[ [ "torch.sigmoid", "torch.cat", "torch.nonzero", "torch.nn.Softmax", "torch.max", "torch.autograd.Variable", "torch.FloatTensor", "torch.from_numpy", "torch.sort", "numpy.arange", "torch.HalfTensor", "numpy.meshgrid", "torch.exp", "numpy.unique" ] ]
IBAS0742/yolo3-pytorch
[ "04554c22a77ee34d65fa3333c12b6faa0f3ad617" ]
[ "yolo.py" ]
[ "import colorsys\r\nimport os\r\nimport time\r\n\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nfrom PIL import ImageDraw, ImageFont\r\n\r\nfrom nets.yolo import YoloBody\r\nfrom utils.utils import (cvtColor, get_anchors, get_classes, preprocess_input,\r\n resize_image)\r\...
[ [ "numpy.array", "torch.cat", "torch.no_grad", "numpy.shape", "torch.from_numpy", "numpy.mean", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel", "numpy.floor" ] ]
zdq0394/myai
[ "124eff250e4b847591d66f2438bc671ffdd7caf3" ]
[ "projects/base/eager.py" ]
[ "import tensorflow as tf\n\ndata = tf.constant([1,2])\nprint(\"Tensor:\", data)\n\nprint(\"Array:\", data.numpy())\n\nimport numpy as np\narr_list = np.arange(0, 100)\nshape = arr_list.shape\nprint(arr_list)\nprint(shape)\n\ndataset = tf.data.Dataset.from_tensor_slices(arr_list)\ndataset_iterator = dataset.shuffle(...
[ [ "tensorflow.constant", "numpy.arange", "tensorflow.data.Dataset.from_tensor_slices" ] ]
Iamlegend-Imani/LamData3
[ "69c593c2a69a6894a3e3d8770737d3f9bd14e468" ]
[ "Assignment4/test_helperfunctions.py" ]
[ "\"\"\" File where testing references are stores \"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport pytest\nfrom Assignment2.helper_functions import CleanData, WarpData, WarpAddress\n\n# Reference Dataframe for CleanData, WarpData testing\ndf = pd.DataFrame(\n np.array(\n [\n [1, 2, 3, 4...
[ [ "numpy.array" ] ]
chunibyo-wly/Open3D
[ "800595885c02e4333ba8f1f454b2bedf3eb0517a" ]
[ "python/open3d/ml/tf/python/layers/convolutions.py" ]
[ "# ----------------------------------------------------------------------------\n# - Open3D: www.open3d.org -\n# ----------------------------------------------------------------------------\n# The MIT License (MIT)\n#\n# Copyright (c) 2018-2021 www.open3d.org\n#\n# ...
[ [ "tensorflow.dtypes.cast", "tensorflow.convert_to_tensor", "tensorflow.zeros", "tensorflow.shape", "tensorflow.keras.initializers.get", "numpy.asarray", "tensorflow.keras.activations.get", "tensorflow.keras.regularizers.get", "tensorflow.expand_dims", "tensorflow.TensorShape...
LucasHenriqueP/IA_Meses
[ "cc585f7e28e897fe7af609d87afbe3c67a917e49" ]
[ "main.py" ]
[ "import matplotlib.pyplot as plt\r\nfrom sklearn.neighbors import KNeighborsClassifier\r\nimport numpy as np\r\nfrom skimage.feature import hog\r\nfrom skimage import data, exposure, io\r\nfrom skimage.transform import rescale, resize\r\nimport cv2\r\nimport os\r\nimport glob\r\n\r\nmeses = ['janeiro', 'fevereiro',...
[ [ "sklearn.neighbors.KNeighborsClassifier" ] ]
amirbawab/image_recognition
[ "84deff7e323f6cc0b073129fdd0fd78ce82556e0" ]
[ "tools/python/cnn_keras2.py" ]
[ "import keras\nimport numpy as np\nfrom sklearn.preprocessing import OneHotEncoder\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation, Conv2D, MaxPooling2D, Flatten, Dropout, BatchNormalization\nfrom keras.optimizers import Adam as Adam\nfrom keras.layers.advanced_activations import Le...
[ [ "numpy.reshape", "pandas.DataFrame", "numpy.genfromtxt", "numpy.random.shuffle", "numpy.argmax", "sklearn.preprocessing.OneHotEncoder" ] ]
hfzx01/Substation
[ "760e2f1a5d21102a6a05973cc31bc8252659757c" ]
[ "albumentations/albumentations/augmentations/domain_adaptation.py" ]
[ "import random\nfrom typing import Callable, List, Tuple, Union\n\nimport cv2\nimport numpy as np\nfrom qudida import DomainAdapter\nfrom skimage.exposure import match_histograms\nfrom sklearn.decomposition import PCA\nfrom sklearn.preprocessing import MinMaxScaler, StandardScaler\n\nfrom ..core.transforms_interfac...
[ [ "numpy.angle", "numpy.fft.ifftshift", "numpy.real", "numpy.exp", "numpy.abs", "numpy.fft.fftshift", "numpy.squeeze", "numpy.floor" ] ]
XuYi-fei/HUST-EIC-MathematicalModeling
[ "73797bdba17d4f759be3a39603b42be081a98e5c" ]
[ "Lesson8/q2.py" ]
[ "import networkx as nx\nfrom networkx import bipartite \ndef replace_name(match, labels):\n sets = set()\n for i in match:\n sets.add((labels[i[0]], labels[i[1]]))\n return sets\n\n\ndef plotGraph(graph,ax,title): \n pos=[(ii[1],ii[0]) for ii in graph.nodes()]\n pos_dict=dict(zip(graph.n...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
JynxC98/ga-learner-dsmp-repo
[ "4bdb8f8b94d57987ddcaa7f69653bd8f3e21d6e4" ]
[ "Reguarization/code.py" ]
[ "# --------------\n#Importing header files\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\n\n\n\n#Code starts here\n\n#Loading the data\ndata=pd.read_csv(path)\n\n#Plotting histogram of Rating\ndata['Rating'].plot(kind='hist')\n\nplt.show()\n\n\n#Subsetting the dataframe based on `...
[ [ "pandas.to_datetime", "sklearn.preprocessing.LabelEncoder", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "pandas.concat", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.xticks" ] ]
mdda/libgpuarray
[ "5e9d33b3ad80684158938c2937a81161939992eb" ]
[ "setup.py" ]
[ "import sys\n\nhave_cython = False\n\ntry:\n import Cython\n if Cython.__version__ < '0.19':\n raise Exception('cython is too old or not installed '\n '(at least 0.19 required)')\n from Cython.Build import cythonize\n have_cython = True\nexcept Exception:\n # for devel v...
[ [ "numpy.get_include" ] ]
qwertyadrian/FDTD
[ "bbef3695e374570dbdbb612a52756db89a9b226f" ]
[ "task3.py" ]
[ "# -*- coding: utf-8 -*-\nimport pathlib\n\nimport numpy as np\nfrom scipy.constants import speed_of_light\n\nimport tools\nfrom sources import GaussianDiffPlaneWave\n\nif __name__ == '__main__':\n # Размер области моделирования вдоль оси X\n X = 3.5\n # Относительная диэлектрическая проницаемость области ...
[ [ "numpy.ones", "numpy.sqrt", "numpy.zeros" ] ]
yalickj/GraphSAGE
[ "81afad629d470922174c2c7edf4db2261ad6d935" ]
[ "graphsage/supervised_models.py" ]
[ "import tensorflow as tf\n\nimport graphsage.models as models\nimport graphsage.layers as layers\nfrom graphsage.aggregators import MeanAggregator, MaxPoolingAggregator, MeanPoolingAggregator, SeqAggregator, GCNAggregator\n\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\nclass SupervisedGraphsage(models.SampleAndAggr...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.train.AdamOptimizer", "tensorflow.concat", "tensorflow.summary.scalar", "tensorflow.nn.l2_loss", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.constant", "tensorflow.clip_by_value", "tensorflow.nn.s...
jbeezley/simulation-hello-world
[ "b4e1258de9c7601af1701041fa39f8f6c5e5a61e" ]
[ "nlisim/oldmodules/neutrophil.py" ]
[ "from enum import IntEnum\nimport itertools\nfrom random import choice, shuffle\nfrom typing import Any, Dict, Tuple\n\nimport attr\nimport numpy as np\n\nfrom nlisim.cell import CellData, CellList\nfrom nlisim.coordinates import Point, Voxel\nfrom nlisim.grid import RectangularGrid\nfrom nlisim.module import Modul...
[ [ "numpy.dtype", "numpy.logical_and" ] ]
PontusHultkrantz/tcapy
[ "3699c70031c95943f70a732849a1a6dac26760e9" ]
[ "tcapy/data/databasepopulator.py" ]
[ "from __future__ import print_function\n\n__author__ = 'saeedamen' # Saeed Amen / saeed@cuemacro.com\n\n#\n# Copyright 2017 Cuemacro Ltd. - http//www.cuemacro.com / @cuemacro\n#\n# See the License for the specific language governing permissions and limitations under the License.\n#\n\nimport abc\nimport pytz\n\nim...
[ [ "pandas.Timestamp", "pandas.date_range", "pandas.Timedelta", "pandas.concat" ] ]
yoyomimi/AS-Net
[ "85ce753707c6d1838c3983111ccbba4b1861f438" ]
[ "libs/utils/misc.py" ]
[ "import os\nimport subprocess\nimport time\nfrom collections import defaultdict, deque\nimport datetime\nimport pickle\nfrom typing import Optional, List\n\nimport torch\nimport torch.distributed as dist\nfrom torch import Tensor\n\n# needed due to empty tensor bug in pytorch and torchvision 0.5\nimport torchvision...
[ [ "torch.distributed.get_world_size", "torch.cat", "torch.stack", "torch.ones", "torch.cuda.is_available", "torch.distributed.init_process_group", "torch.ByteTensor", "torch.distributed.is_initialized", "torch.tensor", "torch.distributed.get_rank", "torch.empty", "tor...
zhouyangwang/AtlasCNV
[ "4094259e74f4eef2a3e962658c059b546cf2d5cd" ]
[ "src/call.py" ]
[ "# --------------------------------------------------------------------------------\n# atlas_cnv.R v0. called by main atlas_cnv.pl v0, Sep 11, 2018. Ted Chiang\n# Copyright 2016-2018, Baylor College of Medicine Human Genome Sequencing Center.\n# All rights reserved.\n# ----------------------------------------------...
[ [ "pandas.DataFrame", "numpy.mean", "numpy.std", "numpy.nanmean", "numpy.where", "numpy.isfinite", "numpy.log2", "numpy.nanmedian", "numpy.nanstd" ] ]
grayerbeard/aiy
[ "1a9868d90b8dfcdde2d2fde81e415a222f2642b1" ]
[ "src/examples/vision/video_capture/video_capture.py" ]
[ "#!/usr/bin/env python3\r\n# Copyright 2017 Google 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# Un...
[ [ "numpy.array", "numpy.argmax" ] ]
kayzhou/election
[ "3b2659c478272e9171e2bfc81efe93aad00b6b94" ]
[ "shorten.py" ]
[ "# -*- coding: utf-8 -*-\n# Author: Kay Zhou\n# Date: 2019-03-08 17:01:02\n\nimport json\nimport multiprocessing\nimport os\nimport sqlite3\nimport sys\nimport time\nimport traceback\nfrom urllib.parse import urlparse\n\nimport networkx as nx\nimport pandas as pd\nimport requests\nfrom tqdm import tqdm\n\nimport tl...
[ [ "pandas.read_csv" ] ]
rhiannonlynne/planetpy
[ "4f543430bcc3c934af4b036e816ca0d972808ac3" ]
[ "planetpy/factsheet_parse.py" ]
[ "import pandas as pd\nimport numpy as np\n\nall_planets_url = 'http://nssdc.gsfc.nasa.gov/planetary/factsheet/'\n\n\ndef grep_url_data():\n # parse remote URL\n df = pd.read_html(all_planets_url,\n header=0, index_col=0)[0]\n # returning transform because planets on the index make more...
[ [ "pandas.read_html", "pandas.Series" ] ]
govindak-umd/Autonomous_Robotics
[ "5293b871c7032b40cbff7814bd773871ee2c5946" ]
[ "All_RasPy_Files/encodercontrol02.py" ]
[ "#automatically rotate the wheel for one rotation and test the encoder\nimport RPi.GPIO as gpio\nimport time\nimport numpy as np\n\ndef init():\n gpio.setmode(gpio.BOARD)\n gpio.setup(31,gpio.OUT) #IN1\n gpio.setup(33,gpio.OUT) #IN2\n gpio.setup(35,gpio.OUT) #IN3\n gpio.setup(37,gpio.OUT) #IN4\n \...
[ [ "numpy.uint64" ] ]
GeorgeKyriakides/nord
[ "94f4d6503dfe2ed9aaebc9e02d55aaba81c02994" ]
[ "nord/design/metaheuristics/genetics/neat/chromosome.py" ]
[ "\"\"\"\r\nCreated on 2018-10-29\r\n\r\n@author: George Kyriakides\r\n ge.kyriakides@gmail.com\r\n\"\"\"\r\nimport numpy as np\r\n\r\n\r\nclass Chromosome(object):\r\n\r\n def __init__(self):\r\n self.genes = dict()\r\n self.fitness = None\r\n self.index = list()\r\n\r\n def set_f...
[ [ "numpy.random.randint" ] ]
kaizhang1215/MTTR
[ "c383c5b151e3c97aeb45cd2fb4bf08719016498b" ]
[ "datasets/a2d_sentences/create_gt_in_coco_format.py" ]
[ "\"\"\"\nThis script converts the ground-truth annotations of the a2d-sentences dataset to COCO format (for mAP calculation).\nThis results in a ground-truth JSON file which can be loaded using the pycocotools API.\nNote that during evaluation model predictions need to be converted to COCO format as well (check out...
[ [ "numpy.array" ] ]
NicolasTe/GeoVectors
[ "b1302612b1d4f0b13aeb003ecfe3c27fd1a5f52f" ]
[ "util.py" ]
[ "import numpy as np\nfrom tqdm import tqdm\nfrom multiprocessing import Process\nimport osmium\nfrom copy import deepcopy\nimport setproctitle\nfrom argparse import Namespace\n\n\"\"\"\nThis file contains multiple utility functions.\n\"\"\"\ndef read_samples(path):\n names = ['country', 'id', 'type', 'tags', 'la...
[ [ "numpy.mean" ] ]
syrull/spaCy
[ "9ad3b8cf8d3ebf52c10537ee7459b57393ad3445" ]
[ "spacy/tests/pipeline/test_spancat.py" ]
[ "import pytest\nfrom numpy.testing import assert_equal\nfrom spacy.language import Language\nfrom spacy.training import Example\nfrom spacy.util import fix_random_seed, registry\n\n\nSPAN_KEY = \"labeled_spans\"\n\nTRAIN_DATA = [\n (\"Who is Shaka Khan?\", {\"spans\": {SPAN_KEY: [(7, 17, \"PERSON\")]}}),\n (\...
[ [ "numpy.testing.assert_equal" ] ]
zhihanyang2022/CleanRL
[ "dfeb9aa992032b63bab9df0dc08ded334ceda546" ]
[ "offpcc/algorithms_recurrent/recurrent_td3.py" ]
[ "import gin\n\nimport numpy as np\nimport torch\nimport torch.optim as optim\n\nfrom basics.abstract_algorithms import RecurrentOffPolicyRLAlgorithm\nfrom basics.summarizer import Summarizer\nfrom basics.actors_and_critics import MLPTanhActor, MLPCritic\nfrom basics.replay_buffer_recurrent import RecurrentBatch\nfr...
[ [ "torch.no_grad", "torch.tensor", "numpy.random.randn", "torch.clamp" ] ]
zhhezhhe/DAIN
[ "a7b703ab0bf78c4d19654b4468f1aef43c005360" ]
[ "PWCNet/correlation_package_pytorch1_0/setup.py" ]
[ "#!/usr/bin/env python3\nimport os\nimport torch\n\nfrom setuptools import setup, find_packages\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\ncxx_args = ['-std=c++11']\n\nnvcc_args = [\n '-gencode', 'arch=compute_50,code=sm_50',\n '-gencode', 'arch=compute_52,code=sm_52',\n '-genc...
[ [ "torch.utils.cpp_extension.CUDAExtension" ] ]
boomsbloom/dtm-fmri
[ "159aab87f04b745d874b53f64fd30703b4d5a70c" ]
[ "DTM/for_gensim/lib/python2.7/site-packages/matplotlib/contour.py" ]
[ "\"\"\"\nThese are classes to support contour plotting and\nlabelling for the axes class\n\"\"\"\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nfrom matplotlib.externals import six\nfrom matplotlib.externals.six.moves import xrange\n\nimport warnin...
[ [ "matplotlib.text.Text.get_rotation", "numpy.dot", "numpy.argmin", "matplotlib.text.Text.is_math_text", "numpy.resize", "numpy.ma.minimum", "matplotlib.mlab.path_length", "matplotlib.cbook.silent_list", "matplotlib.font_manager.FontProperties", "matplotlib.cbook.is_string_li...
leimao/Graph_Frozen_Load_TensorFlow
[ "8767d1ee8aa5e5b340a52dd0a8208896687c3131" ]
[ "TensorFlow_v1/utils.py" ]
[ "import numpy as np\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\n\ndef model_accuracy(label, prediction):\n\n # Evaluate the trained model\n return np.sum(label == prediction) / len(prediction)\n\n\ndef plot_curve(train_losses,\n train_accuracies,\n ...
[ [ "matplotlib.use", "numpy.sum", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ] ]
smop3/smop
[ "781bed05121d62170d1c108143386354bdee3fdb" ]
[ "smop/libsmop.py" ]
[ "# SMOP compiler runtime support library\n# Copyright 2014 Victor Leikehman\n\n# MIT license\n\nimport numpy\nfrom numpy import sqrt, prod, exp, log, dot, multiply, inf\nfrom numpy.fft import fft2\nfrom numpy.linalg import inv\nfrom numpy.linalg import qr as _qr\n\ntry:\n from scipy.linalg import schur as _schur...
[ [ "numpy.random.rand", "numpy.finfo", "numpy.concatenate", "numpy.logical_and", "numpy.prod", "numpy.arange", "numpy.ndarray.copy", "numpy.logical_or", "numpy.array", "numpy.zeros", "numpy.random.randn", "numpy.amax", "numpy.isscalar", "numpy.amin", "numpy...
daigo0927/blog
[ "ced0eec11ac71816820565e584a5901751ceb74e" ]
[ "vertex-pipelines-sample/components/train/main.py" ]
[ "import argparse\nimport pandas as pd\nimport lightgbm as lgb\nimport joblib\nfrom pathlib import Path\nfrom sklearn.metrics import accuracy_score\n\nSEED = 42\n\n\ndef run(dataset_uri: str, artifact_uri: str, learning_rate: float,\n max_depth: int, bagging_fraction: float, feature_fraction: float,\n ...
[ [ "pandas.read_csv", "sklearn.metrics.accuracy_score" ] ]
FrancescoPinto/edward2
[ "94c5ddbcbd08f9c8643dc8fb52672acb731eda6e", "94c5ddbcbd08f9c8643dc8fb52672acb731eda6e" ]
[ "edward2/tensorflow/layers/convolutional.py", "experimental/rank1_bnns/refining.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Edward2 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 ...
[ [ "tensorflow.exp", "tensorflow.python.keras.layers.InputSpec", "tensorflow.python.keras.backend.learning_phase", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.clip_by_value", "tensorflow.tile", "tensorflow.linalg.trace", "tensorflow.shape", "tensorflow.concat", ...
liuyunhaozz/YOLOX-
[ "2bf3c21afc4cc5063b2b21e8f9c674f43368cb2b" ]
[ "yolox/evaluators/voc_eval.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Code are based on\n# https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/datasets/voc_eval.py\n# Copyright (c) Bharath Hariharan.\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport numpy as np\n\nimport os\nimport pickle\nimport xml.etree.ElementT...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.sum", "numpy.where", "numpy.finfo", "numpy.arange", "numpy.argmax", "numpy.argsort", "numpy.cumsum", "numpy.maximum" ] ]
flix-/phasar
[ "85b30c329be1766136c8cbc6f925cb4fd1bafd27" ]
[ "utils/phasar-plot-pamm.py" ]
[ "#!/usr/bin/env python3\n\n# author: Richard Leer\n\n# For DataFrame please refer to https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.plot.html\n# For colormap please refer to https://matplotlib.org/users/colormaps.html\n\nimport json\nimport pprint\nimport numpy as np\nimport pandas\nimport ...
[ [ "numpy.around", "pandas.cut", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.show", "pandas.to_numeric" ] ]
jschmidtnj/astronomy
[ "b3b65036d151a1b5a881ac93f44cbd7dbfe22332" ]
[ "lab2/src/main.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nmain file\n\nentry point for running assignment 1\n\"\"\"\n\nimport pandas as pd\nfrom loguru import logger\nfrom data import get_data\nfrom analyze import analyze\n\n\ndef initialize() -> None:\n \"\"\"\n initialize config\n \"\"\"\n pd.set_option('mode.chained_assignme...
[ [ "pandas.set_option" ] ]
portfedh/FX_MXNUSD
[ "718feb6dc21b5639e7d3064d3741fa7032e24da2" ]
[ "fx_get_terminal.py" ]
[ "# Programa para mostrar el tipo de cambio MXN:USD\n# Para un periodo de fechas.\n\n# Imports del Programa\n######################\nimport os\nimport requests\nimport pandas as pd\n\n# Fechas para el calculo\n########################\nprint(\"\\n Busqueda de FX para Solventar Obligaciones: \\n\")\nfecha_inicial = i...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
alguru/metagenemark-2
[ "99f8cf091911b9200af97e722543ad84a247770f" ]
[ "code/python/driver/build_mgm_models_from_gms2_models.py" ]
[ "# Author: Karl Gemayel\n# Created: 6/22/20, 3:41 PM\nimport logging\nimport argparse\nimport math\nimport operator\n\nimport numpy as np\nimport pandas as pd\nfrom typing import *\n\nimport seaborn\nimport yaml\nfrom tqdm import tqdm\nfrom statsmodels import api as sm\nimport matplotlib.pyplot as plt\n\n# noinspec...
[ [ "matplotlib.pyplot.xlim", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel" ] ]
joe-siyuan-qiao/maskrcnn-benchmark
[ "8721745b1eef16fc724066982ae3b4e900e531c3" ]
[ "maskrcnn_benchmark/layers/misc.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\"\"\"\nhelper class that supports empty tensors on some nn functions.\n\nIdeally, add support directly in PyTorch to empty tensors in\nthose functions.\n\nThis can be removed once https://github.com/pytorch/pytorch/issues/12013\nis implement...
[ [ "torch.nn.functional.interpolate", "torch.nn.functional.conv2d", "torch.nn.modules.utils._ntuple" ] ]
HoKinChung/Knowledge-Fusion-Model-Based-on-Attention
[ "b3403cbf754477afe24e413f5dfceb67e71c0e96" ]
[ "util.py" ]
[ "import json\nimport nltk\nimport numpy as np\nimport os\nimport random\nimport torch\nimport yaml\n\nfrom collections import Counter\n\nfrom torch.autograd import Variable\nfrom tqdm import tqdm\n\nimport argparse\n\n\ndef get_config(config_path=None):\n if not config_path:\n parser = argparse.ArgumentPa...
[ [ "torch.Size", "torch.arange", "numpy.sum", "torch.save", "torch.mm", "torch.cuda.is_available", "torch.load" ] ]
the-aerospace-corporation/ITU-Rpy
[ "4456da2db9f28453d5a08339c84fe5bf25b999d8" ]
[ "test/test_ITU_report.py" ]
[ "# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\nimport pandas as pd\nimport os.path as path\nfrom collections import defaultdict\n\nimport unittest as test\n\nimport itur.models as models\nfrom itur import atmospheric_attenuation_slant_path\n\npd.set_option('display.max_colwidth', -1)\ntest_data = path.jo...
[ [ "pandas.DataFrame", "pandas.set_option" ] ]
astrorobyn/ebfpy
[ "32f63223f85ab81a2dc6c94341acfe0eb444bb1e" ]
[ "ebf.py" ]
[ "#! /usr/bin/env python\n#-----------------------------------------------------------------------------\n#\n#EBF (Efficient Binary Format) Software Library and Utilities\n#Copyright (c) 2012 Sanjib Sharma\n#All rights reserved.\n#\n# This file is part of EBF. The full EBF copyright notice, including \n# term...
[ [ "numpy.set_printoptions", "numpy.min", "numpy.mean", "numpy.where", "numpy.fromstring", "numpy.dtype", "numpy.concatenate", "numpy.max", "numpy.seterr", "numpy.prod", "numpy.arange", "numpy.int32", "numpy.array", "numpy.zeros", "numpy.float64", "nump...
ElDeveloper/metagenomics_pooling_notebook
[ "f72377599084a24775dc6cca7d8fbddb66f82316" ]
[ "metapool/amplipool.py" ]
[ "import os\nimport pandas as pd\n\nfrom metapool.plate import _decompress_well, _plate_position\n\n\ndef assign_emp_index(plate_df, metadata):\n \"\"\"Assign an EMP index to wells based on their compressed position\n\n Parameters\n ----------\n plate_df: pd.DataFrame\n Object with a Well column, ...
[ [ "pandas.read_csv" ] ]
avdosev/building_predictor
[ "99ec9b82d1a9421723f958d38cf7f97c8204fe04" ]
[ "train.py" ]
[ "import warnings\nwarnings.simplefilter(action='ignore', category=FutureWarning)\n\nimport numpy as np\nimport os\nfrom osgeo import gdal\n\nos.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'\n\nfrom tensorflow import keras\nimport tensorflow as tf\nimport math\nimport model as m\nimport config\nfrom common import tr...
[ [ "numpy.array", "numpy.random.rand", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.metrics.FalseNegatives", "tensorflow.keras.metrics.Recall", "tensorflow.keras.optimizers.Adam", "numpy.expand_dims" ] ]
jkapila/paper-codebase
[ "35198a924b66299cab0bf405d4f5ab54ca504be9" ]
[ "fatigue/DriverFatigueness/preprocessing/YawnPreprocess.py" ]
[ "import numpy as np\nimport os\n\nfrom six.moves import cPickle as pickle\nimport cv2\ndirs = ['Dataset/yawnMouth', 'Dataset/normalMouth']\ncountYawn = 40\ncountNormal = 34\n\ndef generate_dataset():\n '''countYawn = 0\n countNormal = 0\n maxY = 0\n maxX = 0\n minX = 1000\n minY = 1000\n pos = ...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.ndarray" ] ]
sourav1122/foremast-brain
[ "6c361083290d2fdabeaa4c0f64dcffab9e298e79" ]
[ "src/utils/dfUtils.py" ]
[ "import pandas\nimport numpy as np\nfrom utils.converterutils import addHeader\nimport datetime as dt\nfrom dateutil.parser import parse\nfrom datetime import datetime\n\n\ndef convertToProphetDF(dataframe):\n idx = dataframe.index.get_values()\n p_utc = [datetime.utcfromtimestamp(int(d)) for d in idx]\n d...
[ [ "pandas.merge" ] ]
Pravin74/flownet2
[ "0643121ea2e9275b5a39ae59f1312668551c31b8" ]
[ "scripts/run-flownet.py" ]
[ "#!/usr/bin/env python2.7\n\nfrom __future__ import print_function\nimport os, sys, numpy as np\nimport argparse\nfrom scipy import misc\nimport caffe\nimport tempfile\nfrom math import ceil\n\nparser = argparse.ArgumentParser()\nparser.add_argument('caffemodel', help='path to model')\nparser.add_argument('deploypr...
[ [ "numpy.array", "numpy.isnan", "scipy.misc.imread", "numpy.fromfile", "numpy.squeeze" ] ]
MatheusZickuhr/PyGame-Learning-Environment
[ "b82c7a335481df59d2764f24718b6784c00b6471" ]
[ "ple/games/snake.py" ]
[ "import pygame\nimport sys\nimport math\n\n#import .base\nfrom .base.pygamewrapper import PyGameWrapper\n\nfrom pygame.constants import K_w, K_a, K_s, K_d\nfrom .utils.vec2d import vec2d\nfrom .utils import percent_round_int\n\n\nclass Food(pygame.sprite.Sprite):\n\n def __init__(self, pos_init, width, color,\n ...
[ [ "numpy.random.RandomState" ] ]
IainBrookshaw/mobile_robot
[ "bd60e6eeb7ade7669786ddfc3ebd497163f2e7af" ]
[ "reports/demos/python-packges/path_planning/test_astar/test_planner.py" ]
[ "#! /usr/bin/env python3\n\"\"\"\nMobile Robot Path Planning: Base Planner Testing\nIain Brookshaw\nCopyright (c), 2019. All Rights Reserved\nMIT License\n\"\"\"\n\nimport unittest\nimport numpy as np\nfrom path_planning.planner import Node, GridMapPlanner\n\n\nclass TestNode(unittest.TestCase):\n\n def test_eq(...
[ [ "numpy.ones", "numpy.zeros", "numpy.sqrt" ] ]
sakoht/anndata
[ "9e0767b7611fd3c784303dd60e5ebf3070825adf" ]
[ "anndata/tests/helpers.py" ]
[ "from functools import singledispatch, wraps\nfrom string import ascii_letters\nfrom typing import Tuple\nfrom collections.abc import Mapping\nimport warnings\n\nimport h5py\nimport numpy as np\nimport pandas as pd\nfrom pandas.api.types import is_numeric_dtype\nimport pytest\nfrom scipy import sparse\n\nfrom annda...
[ [ "numpy.random.binomial", "numpy.random.choice", "numpy.asarray", "pandas.DataFrame", "pandas.api.types.is_numeric_dtype", "numpy.allclose", "scipy.sparse.random", "numpy.random.randint", "numpy.all", "numpy.random.random" ] ]
asappresearch/flop
[ "bdfc1845dbdddde70e65ce5a98ef7d0070833541" ]
[ "examples/enwik8/eval_enwik8.py" ]
[ "import sys\nimport argparse\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nimport sru\nimport flop\n\n\ndef read_corpus(path, num_test_symbols=5000000):\n raw_data = open(path).read()\n raw_data = np.fromstring(raw_data, dtype=np.uint8)\n unique, data = np.unique(raw_data, return_inverse=Tr...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.no_grad", "numpy.exp", "torch.from_numpy", "torch.load", "numpy.fromstring", "numpy.log2", "torch.nn.CrossEntropyLoss", "numpy.unique" ] ]
sborquez/HER2_Fuzzy_Logic
[ "f685510f017850c2dd36fab9bce5297491a0dd2b" ]
[ "extract_features.py" ]
[ "import cv2\r\nfrom skimage.color import rgb2hed\r\nfrom skimage.feature import local_binary_pattern, greycomatrix\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom tqdm import tqdm\r\nimport csv\r\nfrom os.path import exists, basename\r\n\r\nfeatures_ranges = {\r\n # Color\...
[ [ "numpy.array", "numpy.zeros", "numpy.multiply", "numpy.arange", "numpy.sqrt" ] ]
BjoernBiltzinger/threeML-1
[ "dd118a106a01f52029da05585fe29affb85b570c" ]
[ "threeML/bayesian/zeus_sampler.py" ]
[ "import numpy as np\n\nfrom threeML.io.logging import setup_logger\nfrom threeML.bayesian.sampler_base import MCMCSampler\nfrom threeML.config.config import threeML_config\n\nfrom threeML.parallel.parallel_client import ParallelClient\nfrom astromodels import use_astromodels_memoization\n\n\ntry:\n\n import zeus...
[ [ "numpy.floor" ] ]
NREL/EMeRGE
[ "573e86ca8e62080c664998e8cc79e9231e7ad502" ]
[ "EMeRGE/csvconverter/formatter.py" ]
[ "# Standard imports\nimport os,pathlib\nimport shutil\nimport logging\nimport json\n\n# Third party imports\nimport numpy as np\nimport pandas as pd\n\n# Internal imports\nfrom csvconverter.constants import DEFAULT_CONFIGURATION, VALID_SETTINGS\nfrom dssglobal.validate import validate\nfrom dssglobal.logger import ...
[ [ "pandas.DataFrame.from_dict", "numpy.unique" ] ]
wangshauitj/Mutatt
[ "53de5d064fa488f2c2bf7ecedec45eec0cc5f96b" ]
[ "pyutils/mask-faster-rcnn/lib/model/config.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport os.path as osp\nimport numpy as np\n# `pip install easydict` if you don't have it\nfrom easydict import EasyDict as edict\n\n__C = edict()\n# Consumers can get config by:\n# from fa...
[ [ "numpy.array" ] ]
kaifamiao/geSinaStockData
[ "417f81b45eca1bd0ce42d1218218feb82895ba7a" ]
[ "Get163Data.py" ]
[ "import urllib.request,time\nimport pandas as pd\npd.set_option('display.expand_frame_repr', False)\n\ndef get_page(url): #获取页面数据\n req=urllib.request.Request(url,headers={\n 'Connection': 'Keep-Alive',\n 'Accept': 'text/html, application/xhtml+xml, */*',\n 'Accept-Language':'zh-CN,zh;q=0.8...
[ [ "pandas.read_csv", "pandas.set_option" ] ]
fuwhu/spark
[ "bf594a978812419e5905a47535b50167dbad532f" ]
[ "python/pyspark/ml/tests/test_algorithms.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...
[ [ "numpy.allclose", "numpy.isclose" ] ]
lukasc-ch/CBinfer
[ "7fa0a7fbe4efc143e49e676cbf464614a8d1ff4c" ]
[ "poseDetection/tx2power.py" ]
[ "#Copyright (c) 2018 ETH Zurich, Lukas Cavigelli\n\"\"\"\nConvient power measurement script for the Jetson TX2/Tegra X2. \nrelevant docs: http://developer2.download.nvidia.com/embedded/L4T/r27_Release_v1.0/Docs/Tegra_Linux_Driver_Package_Release_Notes_R27.1.pdf\n\"\"\"\nimport os\n\n# descr, i2c-addr, channel\n_nod...
[ [ "numpy.histogram", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.argmax", "matplotlib.pyplot.axvline" ] ]
chews0n/glowing-waffle
[ "b381421f64bc6a5202421d3870548c7737f93bce" ]
[ "docs/practice-problem/Thomas/MaxTempPrediction.py" ]
[ "import pandas as pd\nfrom catboost import Pool\nimport shap\nimport numpy as np\nimport sys\nfrom plotly.offline import init_notebook_mode\nfrom IPython.core.display import display, HTML\nimport plotly.express as px\nfrom catboost import CatBoostRegressor\nimport math\nfrom sklearn.metrics import mean_absolute_err...
[ [ "pandas.to_datetime", "numpy.isnan", "pandas.set_option", "numpy.set_printoptions", "pandas.DataFrame", "numpy.nanmean", "sklearn.metrics.mean_absolute_error", "numpy.abs", "pandas.concat", "pandas.read_csv" ] ]
hgroll/tikzplotlib
[ "1b261f4657d5a70c8fae4ca380e4607b2988db2b" ]
[ "tests/test_boxplot.py" ]
[ "\"\"\" Box Plot test\nThis test plots a box plot with three data series. The causes an empty Line2D\nto be plotted. Without care, this can turn into an empty table in PGFPlot\nwhich crashes latex (due to it treating an empty table as a table with\nexternal data in the file '' or '.tex')\nSee: https://github.com/n...
[ [ "matplotlib.pyplot.figure" ] ]
KenMighell/mkpy3
[ "598126136b43fa93bc4aded5db65a1251d60a9ba" ]
[ "mkpy3/mkpy3_finder_chart_survey_fits_image_get_v1.py" ]
[ "#!/usr/bin/env python3\n\n# file://mkpy3_finder_chart_survey_fits_image_get_v1.py\n\n# Kenneth Mighell\n# SETI Institute\n\n# =============================================================================\n\n\ndef mkpy3_finder_chart_survey_fits_image_get_v1(\n ra_deg=None,\n dec_deg=None,\n radius_arcmin=N...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplot", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.figure" ] ]
KmolYuan/fourbar-simscape
[ "3bb97536252f40adc87f80a4e653c6579bb0fba5" ]
[ "hw4.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom math import degrees, radians\nfrom numpy import array, arange, linspace, concatenate, zeros, pi, sin, cos, sqrt\nfrom scipy.interpolate import interp1d\nimport matplotlib.pyplot as plt\n\nl2 = 38e-3\nl3 = 133e-3\nr2 = 0.3 * l2\nr3 = 0.36 * l3\ntheta2 = 0\ndtheta2 = 200 * 2 * pi / 60...
[ [ "numpy.array", "numpy.sin", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "numpy.cos", "matplotlib.pyplot.show", "numpy.linspace" ] ]
shuaihu1992/model-analysis
[ "1a1ef8e42bec5c5362268d05936f6dc49c018693" ]
[ "tensorflow_model_analysis/api/model_eval_lib.py" ]
[ "# Lint as: python3\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.version.VERSION.split", "tensorflow.io.gfile.makedirs", "tensorflow.io.gfile.exists", "tensorflow.compat.v1.python_io.tf_record_iterator" ] ]
jonluntzel/pulse2percept
[ "2a1e15159af234fb247092b88a465b7bdffd21db" ]
[ "scripts/ConvertImage2Percept.py" ]
[ "\nimport sys\nsys.path.append('..')\n\nimport numpy as np\nimport electrode2currentmap as e2cm\nimport effectivecurrent2brightness as ec2b\nfrom scipy import interpolate\nimport scipy.io as sio\nfrom utils import TimeSeries\nimport matplotlib.pyplot as plt\nimport utils\nfrom PIL import Image\n\n\n\n\nfps=30\n\nxl...
[ [ "numpy.array", "numpy.zeros", "numpy.save", "scipy.io.savemat", "numpy.arange" ] ]
Damehou/FaceParsing
[ "2cb0d8aa8b698826ec56052c69bab7bb3f732fa5" ]
[ "networks/danet.py" ]
[ "\"\"\"Dual Attention Network for Scene Segmentation\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport torch.utils.model_zoo as model_zoo\n\n\nmodel_urls = {\n 'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth',\n}\n\n\nclass _PositionAttentionModule(n...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.functional.interpolate", "torch.nn.init.kaiming_normal_", "torch.utils.model_zoo.load_url", "torch.max", "torc...
blastseld/ibis
[ "b1570316441e430edcf1fb545ebc3f7d34690875" ]
[ "ibis/expr/api.py" ]
[ "\"\"\"Ibis expression API definitions.\"\"\"\n\nimport collections\nimport datetime\nimport functools\nimport numbers\nimport operator\nfrom typing import Union\n\nimport dateutil.parser\nimport pandas as pd\nimport toolz\n\nimport ibis\nimport ibis.common.exceptions as com\nimport ibis.expr.analysis as _L\nimport...
[ [ "pandas.to_datetime", "pandas.Timestamp" ] ]
smaranjitghose/DeepRobust
[ "91f2b922e61a3fa0987e37b7ea6c1cd9150c1c81" ]
[ "examples/graph/test_fga.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom deeprobust.graph.defense import GCN\nfrom deeprobust.graph.targeted_attack import FGA\nfrom deeprobust.graph.utils import *\nfrom deeprobust.graph.data import Dataset\nfrom tqdm import tqdm\nimport argparse\n\npars...
[ [ "torch.cuda.manual_seed", "numpy.random.choice", "numpy.union1d", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.exp" ] ]
jscheithe/tslearn
[ "b296be47def87f7e84bb688092e0b8022a06a1f3" ]
[ "tslearn/shapelets.py" ]
[ "\"\"\"\nThe :mod:`tslearn.shapelets` module gathers Shapelet-based algorithms.\n\nIt depends on the `keras` library for optimization.\n\"\"\"\n\nfrom keras.models import Model\nfrom keras.layers import Dense, Conv1D, Layer, Input, concatenate, add\nfrom keras.metrics import categorical_accuracy, categorical_crosse...
[ [ "numpy.empty", "numpy.random.choice", "numpy.zeros", "numpy.eye", "numpy.log10", "sklearn.preprocessing.LabelBinarizer" ] ]
vermouth1992/mbrl_hvac
[ "eb0e2213cc2734b1a8f83e485180cc622ffced5d" ]
[ "torchlib/deep_rl/algorithm/model_based/policy.py" ]
[ "\"\"\"\nPolicy Network for training imitation learning model. For discrete case, we use classifier.\nFor continuous case, we use regressor.\n\"\"\"\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torchlib.common import move_tensor_to_gpu, convert_numpy_to_tensor, enable_cuda\nfrom torchlib.deep_rl...
[ [ "torch.nn.MSELoss", "torch.no_grad", "torch.nn.CrossEntropyLoss", "numpy.mean", "torch.argmax", "numpy.expand_dims" ] ]
fduguet-nv/cunumeric
[ "dd701af4e7061ff30975dd97fe6a61810389bc6c" ]
[ "tests/integration/test_shape.py" ]
[ "# Copyright 2021-2022 NVIDIA Corporation\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 la...
[ [ "numpy.random.random", "numpy.array" ] ]
Daniel4SE/icassp2021
[ "64d2ec87f75cedffbe5dfbaa71053f39fddbeaf6" ]
[ "layers/overtone.py" ]
[ "# ==================================================================================================\n# Copyright (c) 2021, Jennifer Williams and Yamagishi Laboratory, National Institute of Informatics\n# Author: Jennifer Williams (j.williams@ed.ac.uk)\n# All rights reserved.\n# ===================================...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.cat", "torch.stack", "torch.nn.ConvTranspose1d", "torch.nn.GRU", "torch.nn.Conv1d", "torch.no_grad", "torch.tensor", "torch.zeros_like", "torch.tanh", "torch.nn.GRUCell" ] ]
JeffroMF/mars
[ "2805241ac55b50c4f6319baa41113fbf8c723832" ]
[ "mars/tests/test_session.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 1999-2020 Alibaba Group Holding 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/li...
[ [ "pandas.testing.assert_frame_equal", "numpy.random.rand", "numpy.asarray", "numpy.random.RandomState", "pandas.DataFrame", "numpy.testing.assert_array_equal", "pandas.date_range", "numpy.ones", "numpy.modf", "numpy.shape", "numpy.split", "numpy.testing.assert_array_...
ViniciusM2/AtividadesPOO
[ "f0c61a8539fd5bb448e09c8f0693069dceeddf2b" ]
[ "atividade06/linear.py" ]
[ "from initialize import initialize\nimport matplotlib.pyplot as plt\n\nx, y = initialize()\n\nx.sort()\ny.sort()\n\nplt.plot(x,y)\nplt.show()" ]
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ] ]
ceos-seo/Data_Cube_v2
[ "81c3be66153ea123b5d21cf9ec7f59ccb7a2050a" ]
[ "agdc-v2/tests/storage/test_storage.py" ]
[ "# Copyright 2015 Geoscience Australia\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 b...
[ [ "numpy.arange" ] ]
DavAug/ErlotinibGefinitib
[ "f0f2a3918dfaeb360bd5c27e8502d070dbe87160" ]
[ "pkpd/tests/test_models.py" ]
[ "#\n# This file is part of the ErlotinibGefitinib repository\n# (https://github.com/DavAug/ErlotinibGefitinib/) which is released under the\n# BSD 3-clause license. See accompanying LICENSE.md for copyright notice and\n# full license details.\n#\n\nimport unittest\n\nimport numpy as np\n\nimport pkpd\n\n\n# Unit te...
[ [ "numpy.testing.assert_almost_equal", "numpy.log" ] ]
VectorInstitute/vector_cv_tools
[ "37d5b4c41a83f15554994bf7d19d8d274282ee61" ]
[ "demo/covid_video_classification.py" ]
[ "import streamlit as st\nimport tempfile\nimport os\nfrom os.path import join\nimport random\n\nimport torch\nimport numpy as np\nimport cv2\n\nfrom model import all_models, get_model\nfrom vector_cv_tools.utils import VideoReader\n\nif torch.cuda.is_available():\n device = torch.device('cuda')\nelse:\n devic...
[ [ "torch.device", "numpy.array", "torch.nn.Softmax", "torch.from_numpy", "torch.cuda.is_available", "torch.load", "torch.argmax" ] ]
qazmichaelgw/worldmodels
[ "244f79c2aaddd6ef994d155cd36b34b6d907dcfe" ]
[ "carracing/extract.py" ]
[ "'''\nsaves ~ 200 episodes generated from a random policy\n'''\n\nimport numpy as np\nimport random\nimport os\nimport gym\n\nfrom model import make_model\n\nMAX_FRAMES = 1000 # max length of carracing\nMAX_TRIALS = 200 # just use this to extract one trial. \n\nrender_mode = False # for debugging.\n\nDIR_NAME = 're...
[ [ "numpy.random.seed", "numpy.array", "numpy.savez_compressed", "numpy.random.rand" ] ]
j-river1/Croppie
[ "b7c00c9d445b4b6c8a7acb2dec4cd86649e5f45a" ]
[ "CODE/YOLO/val.py" ]
[ "# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\r\n\"\"\"\r\nValidate a trained YOLOv5 model accuracy on a custom dataset\r\n\r\nUsage:\r\n $ python path/to/val.py --data coco128.yaml --weights yolov5s.pt --img 640\r\n\"\"\"\r\n\r\nimport argparse\r\nimport json\r\nimport os\r\nimport sys\r\nfrom pathlib import Pat...
[ [ "torch.zeros", "numpy.concatenate", "torch.cat", "numpy.savetxt", "torch.stack", "numpy.zeros", "torch.no_grad", "torch.linspace", "torch.tensor", "numpy.unique", "torch.Tensor", "torch.where" ] ]
pbrown801/aggienova-templates
[ "24f1269bf26ab8026a27df87358f80ea8ad04933" ]
[ "old/vegaspecphot.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n'''\nHow to call this function:\n\nIn the header of your program, type:\nfrom vegaspecphot.py import *\nTo use the code, type into your program:\nvegaspecphot(x_array, y_array)\nwhere x_array is the wavelength range of your spectrum\ny_array is the flux data\n...
[ [ "numpy.interp", "numpy.where", "numpy.loadtxt", "numpy.trapz", "numpy.log10" ] ]
neurips2020submission11699/metarl
[ "ae4825d21478fa1fd0aa6b116941ea40caa152a5" ]
[ "src/metarl/tf/algos/te_npo.py" ]
[ "\"\"\"Natural Policy Optimization with Task Embeddings.\"\"\"\n# pylint: disable=too-many-lines\nimport akro\nfrom dowel import Histogram, logger, tabular\nimport numpy as np\nimport scipy.stats\nimport tensorflow as tf\n\nfrom metarl import InOutSpec, log_performance, TrajectoryBatch\nfrom metarl.misc import tens...
[ [ "tensorflow.exp", "numpy.ones_like", "tensorflow.debugging.check_numerics", "numpy.mean", "tensorflow.reshape", "tensorflow.clip_by_value", "tensorflow.identity", "tensorflow.cast", "tensorflow.compat.v1.placeholder", "numpy.concatenate", "tensorflow.concat", "numpy...
fmidev/resiclim-climateatlas
[ "b0c4c0ba6e3d189524cc89904636129733916f69" ]
[ "indices.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 13 12:28:43 2022\n\n@author: mprantan\n\"\"\"\nimport xarray as xr\nimport pandas as pd\nimport numpy as np\nimport warnings\n\ndef thermal_growing_season_length(da_t2mean_summer, basevalue):\n \n ## This function calculates the len...
[ [ "pandas.to_datetime", "numpy.zeros", "scipy.ndimage.label", "numpy.maximum.accumulate", "numpy.shape", "numpy.sqrt", "numpy.cumsum" ] ]
sdu2011/xalpha
[ "c91873213b1d277d40336decd76fa16f8ee6ccf4", "76dc6390cb5714b1c004f7e79e4af832ad1e6fa5" ]
[ "fund_2020.py", "xalpha/record.py" ]
[ "#coding=utf-8\nimport sys\n# sys.path.insert(0, \"../../\")\n\nimport xalpha as xa\nprint(xa.__path__)\n\nxa.info._do_print_warning = False #不打印某些warning\n\nfrom datetime import date\n\nfrom datetime import date\nfrom datetime import datetime, timedelta\ntoday = date.today()\ntoday = today.strftime(\"%Y-%m-%d\")\n...
[ [ "pandas.DataFrame", "numpy.datetime64" ], [ "pandas.to_datetime", "pandas.DataFrame", "pandas.read_csv" ] ]