repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
drixselecta/homebytwo | [
"29d26ce9f5586943e3b64c95aa4ce9ea7263bd10"
] | [
"homebytwo/routes/models/activity.py"
] | [
"from abc import abstractmethod\nfrom typing import List, Optional\n\nfrom django.contrib.gis.db import models\nfrom django.contrib.gis.measure import D\nfrom django.core.exceptions import FieldError\nfrom django.db.models import Count\n\nfrom numpy import array\nfrom pandas import DataFrame\nfrom stravalib import ... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
NSF-Swift/Spectrum-Access-System | [
"02cf3490c9fd0cec38074d3bdb3bca63bb7d03bf",
"02cf3490c9fd0cec38074d3bdb3bca63bb7d03bf"
] | [
"src/harness/testcases/WINNF_FT_S_QPR_testcase.py",
"src/harness/reference_models/propagation/wf_itm.py"
] | [
"# Copyright 2018 SAS Project 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#... | [
[
"numpy.log10",
"numpy.argmin"
],
[
"numpy.array",
"numpy.arange",
"numpy.isscalar",
"numpy.asarray"
]
] |
geexie/dpbench | [
"7d41409ded3c816f35003bc5aea071852bceb892"
] | [
"native_dpcpp/blackscholes/GPU/base_bs_erf.py"
] | [
"# Copyright (C) 2017-2018 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport os\nimport run_utils as utils\nimport numpy as np\nfrom dpbench_datagen.blackscholes import gen_data_to_file, gen_rand_data\nfrom dpbench_python.blackscholes.bs_python import black_scholes_python\n\n# make xrange available in ... | [
[
"numpy.allclose",
"numpy.fromfile",
"numpy.ones",
"numpy.zeros"
]
] |
fyabc/MSRAPaperProject | [
"2d7974acfe8065523d0c56da695807e94acd0b34"
] | [
"MyMLFramework/tests.py"
] | [
"#! /usr/bin/python3\n# -*- encoding: utf-8 -*-\n\nfrom __future__ import unicode_literals, print_function\n\nimport numpy as np\nimport theano.tensor as T\nfrom theano import shared, config\n\nfrom model import SimpleModel, Model\nfrom layers.layer import Dense\nfrom layers.activations import Activation\n\n__autho... | [
[
"numpy.asarray"
]
] |
YuxinZou/volkscv | [
"67ac83f0c0ac85bd6606053732b454db17c53de0"
] | [
"volkscv/utils/parser/txt_parse.py"
] | [
"import os\n\nimport numpy as np\n\nfrom .base import BaseParser\nfrom .utils import read_imglist\n\n\nclass TXTParser(BaseParser):\n \"\"\"Class of parser for classification TXT annotation file.\n\n xxx.png dog\n xxx.png cat\n xxxx.png dog\n\n Args:\n anno_path (str): Path of anno... | [
[
"numpy.array"
]
] |
mabdulhussin/openpilot | [
"3988e14c95043c7f1d35bfe5edbd7701fa44f9bb",
"3988e14c95043c7f1d35bfe5edbd7701fa44f9bb"
] | [
"selfdrive/mapd/test/test_NodesData.py",
"selfdrive/mapd/lib/Route.py"
] | [
"import unittest\nimport numpy as np\nfrom numpy.testing import assert_array_almost_equal\nfrom selfdrive.mapd.lib.mock_data import MockRoad\nfrom selfdrive.mapd.lib.NodesData import vectors\n\n\nclass TestNodesData(unittest.TestCase):\n def test_vectors(self):\n points = np.radians(MockRoad.road1_points_grad)\... | [
[
"numpy.testing.assert_array_almost_equal",
"numpy.radians",
"numpy.array"
],
[
"numpy.array",
"numpy.array_equal",
"numpy.argmin",
"numpy.nonzero",
"numpy.arctan2",
"numpy.cos"
]
] |
yongzx/Semi-supervised-Deep-Embedded-Clustering-with-Anomaly-Detection-for-Semantic-Frame-Induction | [
"7ead941bdf50093f1b8dd860cdeb5f04fb223165"
] | [
"evaluation/clustering.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Nov 04, 2019\n@author: yongzhengxin\n\"\"\"\n\nimport numpy as np\nfrom sklearn import metrics\nimport bcubed\n\ndef purity_score(y_true, y_pred, inv=False):\n \"\"\"\n :param y_true: true cluster ids\n :param y_pred: predicted cluster ids\n :param inv: boole... | [
[
"sklearn.metrics.cluster.contingency_matrix",
"numpy.amax",
"numpy.sum"
]
] |
Steward3103/Tensorflow | [
"1039ff9ee8c8c7ed09f9bb106131a50285866dd4"
] | [
"tensorflow/contrib/lite/python/lite.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.contrib.lite.python.convert_saved_model.freeze_saved_model",
"tensorflow.contrib.lite.python.convert.toco_convert",
"tensorflow.contrib.lite.python.convert.tensor_name",
"tensorflow.python.framework.graph_util.convert_variables_to_constants",
"tensorflow.python.ops.variables.global... |
jjakimoto/rl_traders.py | [
"d5411c96d49ba6a54751d12cdd11974e5cc1a8aa"
] | [
"rl_traders/models.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch_utils.models import FeedForward\n\n\nclass EIIEFeedForwarad(nn.Module):\n def __init__(self, model_params, cash_bias):\n super(EIIEFeedForwarad, self).__init__()\n self.lower_model = FeedForward(model_params['lower_... | [
[
"torch.cat",
"torch.nn.functional.softmax",
"torch.nn.Parameter"
]
] |
tubamuzzaffar/RACT | [
"6c0a44eb795c3b54a0d43e424cb80c400b306197"
] | [
"utils/data_loaders.py"
] | [
"from scipy import sparse\nimport pandas as pd\nimport numpy as np\nimport os\n\nimport tensorflow as tf\n\n\ndef load_train_data(csv_file, n_items):\n tp = pd.read_csv(csv_file)\n n_users = tp['uid'].max() + 1\n\n rows, cols = tp['uid'], tp['sid']\n data = sparse.csr_matrix((np.ones_like(rows), (rows, ... | [
[
"scipy.sparse.isspmatrix",
"tensorflow.SparseTensor",
"numpy.ones_like",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.TensorShape",
"tensorflow.sparse_tensor_to_dense",
"tensorflow.contrib.data.assert_element_shape",
"pandas.read_csv",
"tensorflow.data.Dataset.zip"... |
timcera/plottoolbox | [
"b5f4b634d366eb5ba244e2f1fd33a7ef0eba7298"
] | [
"src/plottoolbox/skill_metrics/index_agreement.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\n\nfrom . import utils\n\n\ndef index_agreement(simulated, observed):\n \"\"\"\n Calculate the index of agreement.\n\n Calculates the index of agreement between two variables\n simulated and observed. The index_agreement is calculated using the\n formula:\... | [
[
"numpy.sum",
"numpy.mean"
]
] |
dobraczka/pystow | [
"d7d66bf87dc3eeb266f6020621649ca8b68be6a4"
] | [
"tests/test_utils.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Tests for utilities.\"\"\"\n\nimport hashlib\nimport os\nimport tempfile\nimport unittest\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\n\nfrom pystow.utils import (\n HexDigestError,\n download,\n getenv_path,\n mkdir,\n mock_envvar,\n n,\n... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.array_equal"
]
] |
exchhattu/MolPro-pyTorch | [
"8dfeb0be4b855741fbc66396a27d7ae0607e161d"
] | [
"Data.py"
] | [
"'''\nWritten by: Rojan Shrestha PhD\nMon Nov 18 17:35:38 2019\n'''\n\nimport sys, os, errno\n\nimport numpy as np\n\nimport flowio # pip install FlowIO\n\nclass FCdata:\n \n def __init__(self, path_to_dir, path_to_label_data, path_to_marker):\n \"\"\"\n \n Params:\n st_path_to_file: \n st_pat... | [
[
"numpy.reshape",
"numpy.zeros",
"numpy.random.permutation",
"numpy.ones",
"numpy.where",
"numpy.unique",
"numpy.hstack",
"numpy.arcsinh",
"numpy.vstack"
]
] |
RasmusVestiH/RV_cds_language2 | [
"61472e7cb385c6ca578dce2f4301fb27666e058b"
] | [
"as5env/lib/python3.6/site-packages/spacy/training/initialize.py"
] | [
"from typing import Union, Dict, Optional, Any, IO, TYPE_CHECKING\nfrom thinc.api import Config, fix_random_seed, set_gpu_allocator\nfrom thinc.api import ConfigValidationError\nfrom pathlib import Path\nimport srsly\nimport numpy\nimport tarfile\nimport gzip\nimport zipfile\nimport tqdm\n\nfrom .pretrain import ge... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
FabricioSMarin/XRFtomo | [
"f5c9f6411bea9a85082d943af873e83f81431e5a"
] | [
"xrftomo/widgets/reconstruction.py"
] | [
"# #########################################################################\n# Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved. #\n# #\n# Software Name: XRFtomo #\n# ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
VasilisNtousis/Hilti_Project_Cyber_Aware | [
"175f9343462175de5d0f24eacf285bd27f12b399"
] | [
"src/create_es_df_to_csv.py"
] | [
"import pandas as pd \n\ndef awareness_dataset():\n sec_df = pd.read_excel('IT Security Awareness Global report.xlsx')\n\n sec_df = sec_df.drop(columns=['Username','FunctionalAreaName','CostCenterName',\n 'Time spent on test','Community name','Content name',\n ... | [
[
"pandas.ExcelFile",
"pandas.read_excel",
"pandas.to_datetime",
"pandas.concat"
]
] |
xinpl/Polaris | [
"2a9717980ab03393f7f5ba646bc58c8a3fbd1b9b"
] | [
"nnExplain/kerasUtils.py"
] | [
"from .NNModel import Layer, LayerKind\nfrom .utils import verbose\nfrom keras.models import load_model\nfrom keras.layers import Dense, Activation, Dropout, InputLayer\nimport tensorflow as tf\n\n\ndef createModelFromKerasModel(m, input_length):\n X = tf.placeholder(tf.float32, shape=[None, input_length])\n ... | [
[
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.nn.relu"
]
] |
ToWeRT1An/tensorpack | [
"f343e65b3c92fdf92cda7a90e8d7fd9df622b1b1"
] | [
"tensorpack/tfutils/summary.py"
] | [
"# -*- coding: utf-8 -*-\n# File: summary.py\n\n\nimport re\nfrom contextlib import contextmanager\nimport six\nfrom six.moves import range\nfrom tensorflow.python.training import moving_averages\n\nfrom ..compat import tfv1 as tf\nfrom ..utils import logger\nfrom ..utils.argtools import graph_memoized\nfrom ..util... | [
[
"tensorflow.python.training.moving_averages.assign_moving_average"
]
] |
gaoyuanhezhihao/pyLib | [
"ecc517d12c4125deafa7b7fe09c63afa3349aaac"
] | [
"OneLib/ImageViewer/evaluate_detection.py"
] | [
"import argparse\nimport os\nfrom os.path import split,join,splitext\nimport xml.etree.ElementTree as ET\nimport re\nimport numpy as np\nfrom shapely.geometry import Polygon\nfrom debug_tool import paint_polygons\nfrom matplotlib import pyplot as plt\n\n\n\ndef parse_point(s):\n s.split(',')\n _, p1, p2, _ = ... | [
[
"numpy.argmax"
]
] |
Hemant2801/Big-mart-sales-prediction | [
"cac2748ed6a446095d568e005601d941f586e104"
] | [
"Sales prediction model.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Importing all the dependencies\n\n# In[1]:\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import metrics\nfrom xgboost import XGBRegressor\nfrom sk... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.figure",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
peekxc/tallem | [
"949af20c1f50f9b6784ee32463e59123cd64294b"
] | [
"notebooks/numba_mds.py"
] | [
"import os\nimport numpy as np\nimport numpy.typing as npt\nfrom numpy.typing import ArrayLike\nfrom typing import *\nfrom .distance import *\nfrom .utility import *\nfrom scipy.sparse.linalg import eigs as truncated_eig\nfrom scipy.linalg import eigh, eig as dense_eig\nfrom scipy.spatial import KDTree\nfrom scipy.... | [
[
"numpy.zeros",
"numpy.sum",
"numpy.linalg.eigh",
"numpy.ones",
"numpy.mean",
"numpy.eye",
"numpy.fliplr",
"numpy.arange",
"numpy.sqrt",
"numpy.flip",
"numpy.flatnonzero"
]
] |
jessierliu/ecogVIS | [
"c97e79a20b3af1074a3a5e1f1ad864a580c97e04"
] | [
"ecogvis/functions/htk_to_nwb/chang2nwb.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nConvert ECoG to NWB.\n\n:Author: Ben Dichter, Jessie R. Liu\nModified by Luiz Tauffer on May 30, 2020\n\"\"\"\nfrom __future__ import print_function\nimport os\nfrom datetime import datetime\nfrom os import path\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\n... | [
[
"numpy.zeros_like",
"scipy.io.wavfile.read",
"numpy.array",
"scipy.io.loadmat",
"numpy.stack",
"numpy.arange",
"numpy.argsort",
"numpy.isfinite",
"pandas.read_csv",
"numpy.unique"
]
] |
tmddusgood/NUGU_movie_recommendation-1 | [
"0c87638963d4681583f94def038dcd980270cb14"
] | [
"nugu/movie_comment_scrapper/build_model/load_model.py"
] | [
"from gensim.models.word2vec import Word2Vec\nimport matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\nimport matplotlib\n\nfont_name = matplotlib.font_manager.FontProperties(\n fname=\"C:/Windows/Fonts/gulim.ttc\" # 한글 폰트 위치를 넣어주세요\n ).get_name()\nmatplotlib.rc('font', fam... | [
[
"matplotlib.font_manager.FontProperties",
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.figure",
"matplotlib.rc",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter"
]
] |
Repiphany/AoC | [
"d59badb62b82434bccd757e37d6d5c4d0bbf2838"
] | [
"2018/day_10/main.py"
] | [
"#!/usr/bin/env python3\n\nimport re\nimport numpy as np\nimport scipy.optimize\nimport sys\n\ndef moment(positions):\n center_of_mass = np.average(positions, axis = 0)\n return np.sum((positions - center_of_mass)**2)\n\ndef part_1(positions, velocities):\n f = lambda i : moment(positions + i*velocities)\n... | [
[
"numpy.max",
"numpy.asarray",
"numpy.sum",
"numpy.min",
"numpy.all",
"numpy.average"
]
] |
lunarnautics/GamestonkTerminal | [
"a1564289c1f4071861240407a069ee57ecad8b84"
] | [
"gamestonk_terminal/common/residuals_analysis/residuals_api.py"
] | [
"\"\"\" Residuals API \"\"\"\n__docformat__ = \"numpy\"\n\nimport argparse\nfrom typing import List\nfrom collections import OrderedDict\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nfrom pandas.plotting import register_matplotlib_converters\nimport seaborn as sns\nfrom scipy import stats\nimport stat... | [
[
"matplotlib.pyplot.xlim",
"scipy.stats.skew",
"matplotlib.pyplot.minorticks_on",
"pandas.DataFrame",
"scipy.stats.kurtosistest",
"matplotlib.pyplot.gca",
"scipy.stats.kurtosis",
"pandas.plotting.register_matplotlib_converters",
"scipy.stats.skewtest",
"matplotlib.pyplot.tit... |
py1sl/neutronicstool | [
"da5e459e47bb67afbef9a9387e054023b6c0f048"
] | [
"format_from_EXCEL.py"
] | [
"\"\"\"\r\nThis tool reads in excel data, formats appropriately and plots graph of beam\r\ncurrent cycles over time.\r\nneeds xlrd package\r\n\"\"\"\r\n\r\nimport re\r\nimport pandas as pd\r\nimport logging\r\nimport utilities\r\n\r\n\r\ndef getdate():\r\n \"\"\"function to select appropriate start and end date ... | [
[
"pandas.Timestamp",
"pandas.date_range",
"pandas.DataFrame",
"pandas.read_excel"
]
] |
cogitoergoread/muszi-macrohard.hu | [
"e9bbd36b789e670f96622a3a2ba8327f0d897561"
] | [
"rlcard3/agents/dqn_agent_pytorch.py"
] | [
"''' DQN agent\n\nThe code is derived from https://github.com/dennybritz/reinforcement-learning/blob/master/DQN/dqn.py\n\nCopyright (c) 2019 Matthew Judell\nCopyright (c) 2019 DATA Lab at Texas A&M University\nCopyright (c) 2016 Denny Britz\n\nPermission is hereby granted, free of charge, to any person obtaining a ... | [
[
"torch.nn.Linear",
"numpy.exp",
"numpy.invert",
"torch.cuda.is_available",
"numpy.prod",
"numpy.argmax",
"numpy.arange",
"numpy.expand_dims",
"torch.nn.Flatten",
"numpy.array",
"torch.nn.Sequential",
"torch.nn.Tanh",
"torch.nn.MSELoss",
"torch.no_grad",
... |
LorenFrankLab/rec_to_nwb | [
"d0630f414662963ebbe23aedf8f3ce07628636bc"
] | [
"rec_to_nwb/processing/nwb/components/iterator/multi_thread_data_iterator.py"
] | [
"import concurrent.futures\n\nimport numpy as np\nfrom hdmf.data_utils import DataChunk\nfrom rec_to_nwb.processing.nwb.components.iterator.data_iterator import \\\n DataIterator\n\n\nclass MultiThreadDataIterator(DataIterator):\n def __init__(self, data, number_of_threads=6):\n DataIterator.__init__(s... | [
[
"numpy.hstack"
]
] |
RodrigoSanMartin/deploy_API_sagemaker_pytorch_webapp_sentiment_analysis | [
"d7df00b91c05a96ccf0975c621704cacb9bb0a37"
] | [
"train/train.py"
] | [
"\nimport argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\n\ndef model_fn(model_dir):\n \"\"\"Load the PyTorch model from the `model_dir` directo... | [
[
"torch.save",
"torch.from_numpy",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.BCELoss",
"torch.utils.data.TensorDataset"
]
] |
farr/RVChallenge | [
"1925682f1a19442560401a7fd2a5b2dde9472f11"
] | [
"setup.py"
] | [
"from setuptools import setup, Extension\nfrom Cython.Build import cythonize\nimport numpy as np\n\nsetup(\n name='rvchallenge',\n version=\"0.0.1\",\n description='An attempt at competing in the RVChallenge.',\n long_description='See https://rv-challenge.wikispaces.com',\n\n author='Will M. Farr',\n... | [
[
"numpy.get_include"
]
] |
vicgalle/ARAMARL | [
"1f0e3d3f76b345e12ec58029dc62d92f33738084"
] | [
"engine.py"
] | [
"\"\"\"\nThis module implements several environments, i.e., the simulators in which agents will interact and learn.\nAny environment is characterized by the following two methods:\n * step : receives the actions taken by the agents, and returns the new state of the simulator and the rewards\n perceived by each agen... | [
[
"numpy.logical_not",
"numpy.array",
"numpy.dot",
"numpy.nan_to_num",
"numpy.asarray",
"numpy.zeros",
"numpy.random.rand",
"numpy.minimum",
"numpy.sum",
"numpy.ones",
"numpy.sign",
"numpy.argmax",
"numpy.base_repr",
"numpy.all",
"numpy.maximum"
]
] |
zxsted/meta-critic-networks | [
"1768751f84845bd6fe98a13d5b57dfaca154c1f8"
] | [
"multi_arm_bandit/mvn_arm4/mvn_test_arm4_sample10_new.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport math\nimport random\nimport os\n\nimport json\n\ndef save_to_json(fname, data):\n with open(fname, 'w') as outfile:\n json.dump(data, outf... | [
[
"torch.nn.Linear",
"numpy.array",
"torch.cat",
"torch.nn.LSTM",
"torch.autograd.Variable",
"numpy.sum",
"numpy.mean",
"numpy.argmax",
"torch.load",
"torch.Tensor",
"torch.sum"
]
] |
baustin13/two-stg-alma | [
"6400fbf1435fc4ef78331f8c730ce09dc5665cd5"
] | [
"Code/sage+gat+diffpool/cross_val.py"
] | [
"import networkx as nx\nimport numpy as np\nimport torch\n\nimport pickle\nimport random\n\nfrom graph_sampler import GraphSampler\n\ndef prepare_val_data(graphs, args, val_idx, max_nodes=0):\n\n random.shuffle(graphs)\n val_size = len(graphs) // 10\n train_graphs = graphs[:val_idx * val_size]\n if val_... | [
[
"torch.utils.data.DataLoader",
"numpy.zeros"
]
] |
GarrettNicolai/OpenNMT-py | [
"9491d900ac1b50fe39da417bacc0b9d610331888"
] | [
"onmt/translate/translator.py"
] | [
"#!/usr/bin/env python\n\"\"\" Translator Class and builder \"\"\"\nfrom __future__ import print_function\nimport codecs\nimport os\nimport time\nimport numpy as np\nfrom itertools import count, zip_longest\n\nimport torch\n\nimport onmt.model_builder\nimport onmt.inputters as inputters\nimport onmt.decoders.ensemb... | [
[
"torch.device",
"torch.cat",
"torch.Tensor",
"torch.no_grad"
]
] |
maxpark/hailo_model_zoo | [
"94beb7d80ef56e5dfa9978c90486e45a73306c79"
] | [
"hailo_model_zoo/core/postprocessing/detection/nanodet.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom tensorflow.image import combined_non_max_suppression\n\nfrom .centernet import COCO_2017_TO_2014_TRANSLATION\n\n\nclass NanoDetPostProc:\n def __init__(self, img_dims=(416, 416), nms_iou_thresh=0.6, labels_offset=0,\n score_threshold=0.3, anchors... | [
[
"tensorflow.concat",
"numpy.reshape",
"tensorflow.sigmoid",
"tensorflow.expand_dims",
"numpy.vectorize",
"tensorflow.transpose",
"tensorflow.py_function",
"tensorflow.reshape",
"tensorflow.cast",
"numpy.stack",
"numpy.arange",
"tensorflow.image.combined_non_max_supp... |
sunnyln/birdnet2 | [
"d1a2b703475345d887c325c135013ed9f72d3a57"
] | [
"detectron2/modeling/meta_arch/rcnn.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nimport torch\nfrom torch import nn\n\nfrom detectron2.structures import ImageList\nfrom detectron2.utils.logger import log_first_n\n\nfrom ..backbone import build_backbone\nfrom ..postprocessing import detector_postprocess\nfro... | [
[
"torch.device",
"torch.Tensor"
]
] |
iglpdc/nilearn | [
"a4cc998b7a34fa48a77ce46f9f0b6b4e75d8a2d1"
] | [
"nilearn/regions/region_extractor.py"
] | [
"\"\"\"\nBetter brain parcellations for Region of Interest analysis\n\"\"\"\n\nimport numbers\nimport numpy as np\n\nfrom scipy.ndimage import label\nfrom scipy.stats import scoreatpercentile\n\nfrom sklearn.externals.joblib import Memory\n\nfrom .. import masking\nfrom ..input_data import NiftiMapsMasker\nfrom .._... | [
[
"scipy.stats.scoreatpercentile",
"sklearn.externals.joblib.Memory",
"scipy.ndimage.label",
"numpy.abs"
]
] |
hodamr/biu-advenced-ai-ex2 | [
"2df6eb7ed389378326bd5c24fae43a65f190d221"
] | [
"deep_rl/utils/torch_utils.py"
] | [
"#######################################################################\n# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# Permission given to modify the code as long as you keep this #\n# declaration at the top #\n#######################... | [
[
"torch.zeros",
"torch.device",
"torch.Size",
"torch.distributions.Categorical",
"torch.arange",
"torch.distributions.Normal",
"torch.tensor",
"torch.set_num_threads"
]
] |
KidChou/yolov5_prune | [
"126054962197a51c79140384c591b9190d146019"
] | [
"models/common.py"
] | [
"# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nCommon modules\n\"\"\"\n\nimport logging\nimport math\nimport warnings\nfrom copy import copy\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nimport requests\nimport torch\nimport torch.nn as nn\nfrom PIL import Image\nfrom torch.cuda impor... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.cuda.amp.autocast",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"numpy.tile",
"torch.nn.MultiheadAttention",
"torch.nn.MaxPool2d",
"pandas.DataFrame",
"torch.tensor",
"torch.nn.Flatten",
"torch.nn.Identity",
"torch.nn.Con... |
cx201910/first_ml | [
"b4ece4f275911707dda5ca461989f1dfdbf25021"
] | [
"backend/ml_service/apps/endpoints/views.py"
] | [
"from django.shortcuts import render\nfrom rest_framework import viewsets\nfrom rest_framework import mixins\nfrom rest_framework.exceptions import APIException\nfrom rest_framework.decorators import action\n\nfrom .models import Endpoint\nfrom .serializers import EndpointSerializer\n\nfrom .models import MLAlgorit... | [
[
"numpy.random.rand"
]
] |
rajahaseeb147/3dFacialPartSegmentation | [
"aedfed75558761295e9bf602b18c2c3b631080e5",
"aedfed75558761295e9bf602b18c2c3b631080e5"
] | [
"Deep Learning/Implementation_3/models/pointnet_cls.py",
"Deep Learning/Implementation_3/data_utils/ShapeNetDataLoader.py"
] | [
"import torch.nn as nn\r\nimport torch.utils.data\r\nimport torch.nn.functional as F\r\nfrom pointnet_utils import PointNetEncoder, feature_transform_reguliarzer\r\n\r\nclass get_model(nn.Module):\r\n def __init__(self, k=40, normal_channel=True):\r\n super(get_model, self).__init__()\r\n if normal... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.functional.log_softmax",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.nn.functional.nll_loss"
],
[
"numpy.sum",
"numpy.array",
"numpy.loadtxt",
"numpy.mean"
]
] |
JinGyeSetBirdsFree/FudanOCR | [
"fd79b679044ea23fd9eb30691453ed0805d2e98b",
"fd79b679044ea23fd9eb30691453ed0805d2e98b",
"fd79b679044ea23fd9eb30691453ed0805d2e98b"
] | [
"model/super_resolution_model/DocumentSRModel/models/srunitnet_2x_2x.py",
"model/detection_model/AdvancedEAST/nms/setup.py",
"model/detection_model/LSN/lib/model/test_roi_align.py"
] | [
"import numpy as np\nfrom scipy.misc import imsave\nimport os\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.init as init\nimport torch.nn.functional as F\nimport torchvision\nfrom torchvision import models\nfrom torch.autograd import Variable\nfrom torch.utils.data import Data... | [
[
"torch.zeros",
"torch.nn.MSELoss",
"numpy.zeros",
"torch.autograd.Variable",
"torch.ones",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"scipy.misc.imsave",
"torch.load"
],
[
"numpy.get_include"
],
[
"torch.IntTensor",
"t... |
ahesford/habis-tools | [
"82f82b99fa18452697404100edcf83bd03d35abc"
] | [
"habis/formats.py"
] | [
"'''\nRoutines for manipulating HABIS data file formats.\n'''\n\n# Copyright (c) 2015 Andrew J. Hesford. All rights reserved.\n# Restrictions are listed in the LICENSE file distributed with this package.\n\nimport mmap\nimport numpy as np\nimport os\nimport struct\n\nfrom itertools import repeat\n\nfrom collections... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.count_nonzero",
"numpy.savetxt",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.load",
"numpy.ndarray",
"numpy.loadtxt",
"numpy.ndim",
"numpy.frombuffer",
"numpy.all",
"numpy.fromfile",
"numpy.issubdtype",
... |
jgerardin/covid-chicago | [
"c2b91fdb42eece413e6fb0f6cee019357b96e00d"
] | [
"data_processing/exceeding_capacity_1.py"
] | [
"print('Importing packages...')\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport datetime as dt\nimport seaborn as sns\nimport numpy as np\nimport matplotlib.dates as mdates\nimport datetime\n#sns.set(color_codes=True)\nimport matplotlib as mpl\nmpl.rcParams['pdf.fonttype'] = 42\nimport statistics as s... | [
[
"numpy.median",
"matplotlib.dates.DateFormatter",
"numpy.mean",
"pandas.concat",
"pandas.read_csv",
"matplotlib.dates.DayLocator",
"matplotlib.pyplot.xticks",
"pandas.DataFrame",
"numpy.arange",
"numpy.append",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.yscale",
... |
conradjones/ngraph-bridge | [
"042011e6653b3ac0983511cf6604f9881cc6ee4b",
"042011e6653b3ac0983511cf6604f9881cc6ee4b"
] | [
"test/python/test_tanhgrad.py",
"examples/mnist/mnist_deep_simplified_distributed.py"
] | [
"# ==============================================================================\n# Copyright 2018-2020 Intel 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# ... | [
[
"tensorflow.python.ops.gen_math_ops.tanh_grad"
],
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.train.MonitoredTrainingSession",
"tensorflow.cast",
"tensorflow.get_default_graph",
"tensorf... |
apoorvanand/Deep-Virtual-Try-On | [
"56d536d46913afb8504ad3336697f2adf7dc965c"
] | [
"lib/geometric_matching_multi_gpu.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn import init\nfrom torchvision import models\nimport os\nimport torch.nn.functional as F\nimport numpy as np\nimport sys\n\nsys.path.append('..')\n\ndef weights_init_normal(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1:\n ini... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LeakyReLU",
"torch.nn.init.kaiming_normal_",
"torch.inverse",
"torch.nn.BatchNorm2d",
"torch.bmm",
"torch.load",
"torch.nn.functional.affine_grid",
"torch.Size",
"torch.mul",
"torch.nn.init.constant_",
"torch.FloatTensor... |
JJUNGYUN/tensorflow-fast-style-transfer | [
"faf8608399b14de008edf533169b2cf25c811dbc"
] | [
"utils.py"
] | [
"import numpy as np\nimport PIL.Image\nimport os\nimport scipy\nfrom matplotlib.pyplot import imread, imsave\nfrom skimage.transform import resize\n\n\n\"\"\"Helper-functions to load MSCOCO DB\"\"\"\n# borrowed from https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py\ndef get_img(src, img_size... | [
[
"numpy.max",
"numpy.array",
"numpy.float32",
"numpy.clip",
"numpy.dstack",
"matplotlib.pyplot.imread"
]
] |
vfdev-5/POT | [
"e757b75976ece1e6e53e655852b9f8863e7b6f5a"
] | [
"test/test_da.py"
] | [
"\"\"\"Tests for module da on Domain Adaptation \"\"\"\n\n# Author: Remi Flamary <remi.flamary@unice.fr>\n#\n# License: MIT License\n\nimport numpy as np\nfrom numpy.testing.utils import assert_allclose, assert_equal\n\nimport ot\nfrom ot.datasets import make_data_classif\nfrom ot.utils import unif\n\n\ndef test_si... | [
[
"numpy.testing.utils.assert_equal",
"numpy.testing.assert_allclose",
"numpy.zeros_like",
"numpy.cov",
"numpy.sum"
]
] |
TropComplique/bicycle-gan | [
"4bc8f4cdbe138e23c8a02c408cfb8e2ff7dfe6ab"
] | [
"networks/encoder.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass ResNetEncoder(nn.Module):\n\n def __init__(self, in_channels, out_dimension, depth=48, num_blocks=5):\n \"\"\"\n Arguments:\n in_channels: an integer.\n out_channels: an integer.\n depth: an integer.\n num_b... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.LeakyReLU",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
Rintarooo/MDVRP_MHA | [
"f196f1c99c3e4efa1ab6d75f4af77685afe4d191"
] | [
"Torch/Nets/decoder_utils.py"
] | [
"import torch\nimport torch.nn as nn\n\nclass Env():\n\tdef __init__(self, x, node_embeddings):\n\t\tsuper().__init__()\n\t\t\"\"\"depot_xy: (batch, n_depot, 2)\n\t\t\tcustomer_xy: (batch, n_customer, 2)\n\t\t\t--> xy: (batch, n_node, 2); Coordinates of depot + customer nodes\n\t\t\tn_node= n_depot + n_customer\n\t... | [
[
"torch.zeros",
"torch.cat",
"torch.arange",
"torch.gather",
"torch.logical_not",
"torch.cuda.is_available",
"torch.eye",
"torch.topk"
]
] |
piyueh/SEM-Exercises | [
"d25e6c1bc609022189952d97488828113cfb2206"
] | [
"utils/misc/misc.py"
] | [
"#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n#\n# Copyright © 2016 Pi-Yueh Chuang <pychuang@gwu.edu>\n#\n# Distributed under terms of the MIT license.\n\n\"\"\"Some misc functions\"\"\"\n\nimport numpy\nimport numbers\nimport functools\n\n# TODO: replace assertion with if ... raise\n\n\ndef ... | [
[
"numpy.array",
"numpy.real",
"numpy.abs"
]
] |
ztultrebor/Kaggle-Santander_Challenge | [
"af5132f986089553a2192183f53ed3b0ec2bcf1b"
] | [
"XGB.py"
] | [
"#!/usr/bin/env python2.7\n# -*- coding: utf-8 -*-\n\nfrom GridSearch import GridSearch\nimport numpy as np\nimport pandas as pd\nimport scipy\nfrom xgboost import XGBClassifier\nfrom sklearn.cross_validation import train_test_split\nfrom sklearn.metrics import roc_auc_score\n\n\n#==================================... | [
[
"scipy.stats.expon",
"numpy.random.seed",
"scipy.stats.geom",
"scipy.stats.randint",
"pandas.read_csv",
"scipy.stats.beta"
]
] |
CatherineH/python-sewing | [
"01873f6341c7ce8e26d4e61aab9d52a586d667f6"
] | [
"merge_pieces.py"
] | [
"from svgpathtools import svg2paths, Path, Line\nfrom svgwrite import Drawing, rgb\nimport argparse\nfrom math import atan, asin, sin, cos, pi\nfrom numpy import argmin\nfrom utils import calc_overall_bbox\n\nparser = argparse.ArgumentParser(\n description='Generate a merged piece from two pieces by stretching t... | [
[
"numpy.argmin"
]
] |
furminator/Furminator-MCPE-Tool | [
"4fe247351503781db2012815c1e40e881d9e1bba"
] | [
"viewports/camera.py"
] | [
"# -*- coding: utf_8 -*-\n# The above line is necessary, unless we want problems with encodings...\nimport sys\nfrom compass import CompassOverlay\nfrom raycaster import TooFarException\nimport raycaster\nimport keys\nimport pygame\n\nimport math\nimport copy\nimport numpy\nfrom config import config\nimport frustum... | [
[
"numpy.array",
"numpy.sin",
"numpy.radians",
"numpy.cos",
"numpy.floor"
]
] |
ziyoujiyi/PaddleRec | [
"9a107c56af2d1ee282975bcc8edb1ad5fb7e7973"
] | [
"models/recall/ncf/evaluate.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.array"
]
] |
Kayce001/mmdeploy | [
"59470fef0b28e0b760c72269e0696bbdf57db7f1",
"59470fef0b28e0b760c72269e0696bbdf57db7f1"
] | [
"mmdeploy/codebase/mmcls/deploy/classification_model.py",
"mmdeploy/codebase/mmdet/deploy/object_detection_model.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nfrom typing import List, Sequence, Union\n\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcls.datasets import DATASETS\nfrom mmcls.models.classifiers.base import BaseClassifier\nfrom mmcv.utils import Registry\n\nfrom mmdeploy.codebase.base import BaseBacken... | [
[
"numpy.array",
"numpy.argsort"
],
[
"numpy.concatenate",
"torch.cat",
"numpy.array",
"torch.stack",
"numpy.zeros",
"torch.arange",
"torch.from_numpy",
"torch.tensor",
"torch.isinf",
"numpy.floor"
]
] |
tcapelle/tsai | [
"36a2f704abf174515c55115832f08ea2d9753e14"
] | [
"tsai/models/MINIROCKET.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/111b_models.MINIROCKET.ipynb (unless otherwise specified).\n\n__all__ = ['MiniRocketClassifier', 'load_minirocket', 'MiniRocketRegressor', 'load_minirocket',\n 'MiniRocketVotingClassifier', 'get_minirocket_preds', 'MiniRocketVotingRegressor']\n\n# Cell\nimp... | [
[
"sklearn.linear_model.RidgeCV",
"sklearn.linear_model.RidgeClassifierCV"
]
] |
learsi1911/GAMA_pygmo_v4 | [
"459807db352dd1c9f9c1e0e322f8c1e9b5abbca0"
] | [
"tests/unit/test_scikitlearn.py"
] | [
"import pandas as pd\nfrom sklearn.datasets import load_iris\nfrom gama.genetic_programming.compilers.scikitlearn import (\n evaluate_individual,\n compile_individual,\n evaluate_pipeline,\n)\nfrom gama.utilities.metrics import Metric, scoring_to_metric\n\n\ndef test_evaluate_individual(SS_BNB):\n impor... | [
[
"pandas.DataFrame",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.datasets.load_iris",
"pandas.Series"
]
] |
Pandinosaurus/doctr | [
"3d645ce7d3d4fe36aa53537d4e4f92507f6cd422",
"7bbdf4b1e5f7e9a28a7047dcd13eb2a5501643ef"
] | [
"demo/app.py",
"api/tests/routes/test_detection.py"
] | [
"# Copyright (C) 2021-2022, Mindee.\n\n# This program is licensed under the Apache License version 2.\n# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.\n\nimport os\n\nimport matplotlib.pyplot as plt\nimport streamlit as st\n\nos.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = ... | [
[
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.config.experimental.set_memory_growth",
"matplotlib.pyplot.subplots",
"tensorflow.squeeze"
],
[
"scipy.optimize.linear_sum_assignment",
"numpy.array"
]
] |
apuranik1/rl-examples | [
"af807bd9311e056e8690ee4bc5abbc63a91381e9"
] | [
"rl_examples/approximate_td.py"
] | [
"from typing import Deque, Tuple\nfrom collections import deque\n\nimport numpy as np\n\nfrom .psfa import PSFAAgent, PSFAEnvironment, TState, TAction\nfrom .approximation import TrainableEstimator, Featurizer\n\n\nclass ApproximationTDNAgent(PSFAAgent[TState, TAction]):\n \"\"\"A bootstrapping agent using n-ste... | [
[
"numpy.random.rand",
"numpy.random.choice",
"numpy.argmax"
]
] |
dukebw/imgaug | [
"eba6eef5808704926edce97de39af23cab18cb7f"
] | [
"checks/check_perspective_transform.py"
] | [
"from __future__ import print_function, division\n\nimport numpy as np\n\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\n\n\ndef main():\n image = ia.data.quokka(size=0.5)\n kps = [\n ia.KeypointsOnImage(\n [\n ia.Keypoint(x=245, y=203),\n ia.Keypoin... | [
[
"numpy.dstack",
"numpy.hstack",
"numpy.pad"
]
] |
AugustasVol/written_test_automation | [
"80d3295f741f4aaa3abaa4e85f20677ff59c146d"
] | [
"nets.py"
] | [
"import numpy as np\n\nimport torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nclass net_base:\n def trainer(self, x,y, epochs = 1, print_loss = True):\n \n self.train(True)\n \n for i in range(epochs):\n\... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.autograd.Variable",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.BCELoss",
"torch.load"
]
] |
Markek1/style-transfer-gui | [
"14892d3c657242c4825129b56a6668904f53a65e"
] | [
"style_transfer.py"
] | [
"import os\n\nimport tensorflow as tf\n\ndef magenta_v1_256_2(content_image, style_image, resize=False, content_res=None, style_res=None):\n '''Resolution of generated image = resolution of content image.\n Resolution of the style image is 256x256 by default because the net\n was trained on it and it... | [
[
"tensorflow.constant",
"tensorflow.image.resize",
"tensorflow.saved_model.load"
]
] |
skerit/gezicht | [
"5361b06e250400b0f1b44faf6f8940b0f39ed5d9"
] | [
"python/main.py"
] | [
"import face_recognition\nimport importlib\nimport numpy as np\nimport socket\nimport time\nimport json\nimport sys\nimport os\n\nfrom PIL import Image\nfrom io import BytesIO\n\npi_spec = importlib.util.find_spec(\"picamera\")\nfound_picam = pi_spec is not None\n_picam = False\nhas_cv = False\npicam_options = {\n\... | [
[
"numpy.empty"
]
] |
disktnk/onnx-chainer | [
"e4542568009e63e7da83aa0f11b2cb5504e8cef8",
"e4542568009e63e7da83aa0f11b2cb5504e8cef8"
] | [
"onnx_chainer/functions/normalization.py",
"onnx_chainer/functions/loss.py"
] | [
"import sys\n\nimport chainer\nimport numpy as np\n\nfrom onnx_chainer.functions.opset_version import support\nfrom onnx_chainer import onnx_helper\n\n\n@support((1, 6, 7))\ndef convert_BatchNormalization(func, opset_version, input_names,\n output_names, context, parameters):\n is_f... | [
[
"numpy.zeros_like",
"numpy.ones_like"
],
[
"numpy.any",
"numpy.array"
]
] |
Abishek15592/pandas | [
"6929e262dd22ac35baabf87a5236d451255fb66d"
] | [
"pandas/tests/test_common.py"
] | [
"import collections\nfrom distutils.version import LooseVersion\nfrom functools import partial\nimport string\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat.numpy import np_version_under1p17\n\nimport pandas as pd\nfrom pandas import Series, Timestamp\nimport pandas._testing as tm\nfrom pandas.core impo... | [
[
"numpy.random.PCG64",
"pandas.core.common.dict_compat",
"numpy.random.RandomState",
"pandas.__dict__.values",
"pandas._testing.round_trip_pickle",
"pandas.core.common.standardize_mapping",
"pandas.core.common.random_state",
"pandas.core.common.all_not_none",
"pandas.Timestamp",... |
adbelniak/stable-baselines3 | [
"61e3b9c3fc4b113b5de65dd3b083de7550676018"
] | [
"stable_baselines3/common/policies.py"
] | [
"\"\"\"Policies: abstract base class and concrete implementations.\"\"\"\n\nimport collections\nimport copy\nimport warnings\nfrom abc import ABC, abstractmethod\nfrom functools import partial\nfrom typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport numpy as np\nimport torch as th\nfr... | [
[
"torch.nn.Linear",
"torch.cat",
"numpy.array",
"torch.nn.Sequential",
"torch.no_grad",
"torch.FloatTensor",
"torch.load",
"numpy.clip",
"numpy.sqrt",
"torch.nn.init.orthogonal_",
"torch.set_grad_enabled"
]
] |
LSchultebraucks/matplotlib_examples | [
"cac02668ce6b81dcbbdf0ff3238cc01506c8f76a"
] | [
"src/mosaic_plot.py"
] | [
"import pandas as pd\nfrom statsmodels.graphics.mosaicplot import mosaic\nimport pylab\nfrom itertools import product\nimport numpy as np\nrand = np.random.random\n\nspeaks_mul_foreign_languages = list(product(['male', 'female'], ['yes', 'no']))\nindex = pd.MultiIndex.from_tuples(speaks_mul_foreign_languages, names... | [
[
"pandas.MultiIndex.from_tuples"
]
] |
lulujianjie/efficient-person-generation-for-reid | [
"1bb29c7c280e3322a65af36b37deecbce0c1d322"
] | [
"data-generation-GAN/generate_samples_market.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\nimport os\nimport sys\nimport cv2\nfrom config.cfg import Cfg\nimport torch\nfrom torch.backends import cudnn\nfrom datasets.bases import read_image\nsys.path.append('.')\nfrom datasets import make_dataloader\nfrom processor import do_inference\nfrom model im... | [
[
"numpy.transpose",
"numpy.load",
"torch.load",
"torch.unsqueeze"
]
] |
BenRussert/pandas | [
"1f02bf240c3d0d3da338af868d056bfc169b28c2",
"9179e633b1e54ac31c5ea42ec0ec24e9a1709aae",
"9179e633b1e54ac31c5ea42ec0ec24e9a1709aae",
"9179e633b1e54ac31c5ea42ec0ec24e9a1709aae"
] | [
"pandas/core/computation/align.py",
"pandas/core/indexes/numeric.py",
"pandas/tests/util/test_util.py",
"pandas/tests/io/formats/test_to_html.py"
] | [
"\"\"\"Core eval alignment algorithms\n\"\"\"\n\nfrom functools import partial, wraps\nimport warnings\n\nimport numpy as np\n\nfrom pandas.compat import range, zip\nfrom pandas.errors import PerformanceWarning\n\nimport pandas as pd\nfrom pandas import compat\nimport pandas.core.common as com\nfrom pandas.core.com... | [
[
"numpy.result_type",
"numpy.array",
"pandas.core.common.flatten",
"pandas.compat.iteritems",
"pandas.compat.zip",
"pandas.core.computation.common._result_type_many",
"pandas.compat.range"
],
[
"numpy.array_equal",
"pandas.core.indexes.base._try_get_item",
"pandas.core.c... |
billsioros/computational-geometry | [
"398a92e3c08046f85eb3e95828afe62230b816fb"
] | [
"Homework_1/exercise3.py"
] | [
"from matplotlib.patches import Polygon\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport random\nfrom exercise1 import check_for_triangle\nfrom exercise1 import plot_2D_points\n\n\ndef remove_duplicates(lst): \n return [item for item in (set(tuple(i) for i in lst))] \n\n\n# select a point from aval... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.Polygon"
]
] |
TheoLvs/westworld | [
"7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b"
] | [
"westworld/_deprecated/chicken_game.py"
] | [
"\nimport sys\nsys.path.append(\"C:/git/reinforcement-learning\")\n\n\nfrom hyperion.agents import *\nfrom hyperion.environment import *\n\nimport random\nimport numpy as np\nimport uuid\nimport attr\n\n\nSTATUSES = [\"EGG\",\"CHICKEN\",\"COW\",\"FARMER\",\"SUPERMAN\"]\nSIZE = 100\n\n\n@attr.s(slots = True)\nclass ... | [
[
"numpy.clip"
]
] |
tpulkit/txt2vid | [
"679b1672fb3221c6b5fe576a158974556047c201"
] | [
"Wav2Lip/util/wav2lip_inference_funcs.py"
] | [
"import numpy as np\nimport os\nimport cv2\nfrom models import Wav2Lip\nimport face_detection\nimport torch\n\ndef get_smoothened_boxes(boxes, T):\n for i in range(len(boxes)):\n if i + T > len(boxes):\n window = boxes[len(boxes) - T:]\n else:\n window = boxes[i: i + T]\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.asarray",
"numpy.mean",
"torch.load"
]
] |
rebecca-palmer/statsmodels | [
"27dd8ba0be0211fdc91097463ce4edd28bce1ef4"
] | [
"statsmodels/sandbox/tsa/fftarma.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Dec 14 19:53:25 2009\n\nAuthor: josef-pktd\n\ngenerate arma sample using fft with all the lfilter it looks slow\nto get the ma representation first\n\napply arma filter (in ar representation) to time series to get white noise\nbut seems slow to be useful for fast est... | [
[
"numpy.exp",
"numpy.fft.fft",
"scipy.signal.lfilter",
"numpy.cos",
"numpy.fft.fftfreq",
"numpy.random.normal",
"matplotlib.mlab.psd",
"numpy.polynomial.Polynomial",
"numpy.arange",
"numpy.ndim",
"numpy.fft.fftshift",
"numpy.atleast_2d",
"numpy.convolve",
"nu... |
tian1327/AutoLDA | [
"be202b70b6d0a02b75ff05016dcd7084c32a9ccf"
] | [
"Hyperband/Embeddings/GLOVE.py"
] | [
"import os\nimport numpy as np\nimport pickle\n# import tqdm\n\ndef load_GLOVE():\n model = 'glove_pretrained_840b_300d.pkl'\n print(\"loading GLOVE pretrained model ......\")\n with open('./Embeddings/GLOVE_pretrained/'+model,'rb') as pk:\n glove_emb = pickle.load(pk)\n print('GLOVE loaded.\\n')... | [
[
"numpy.array"
]
] |
wyyfkim/MRTA | [
"fab515569d3434cae01733c702fc0e1afc73b552"
] | [
"catkin_ws/src/mrta/src/DataGenerator.py"
] | [
"import os, sys\nimport argparse\nimport pickle\nfrom numpy import random\nfrom Task import Task\nfrom PrecedenceGraph import PrecedenceGraph, Node\nfrom Robot import Robot\nfrom Logger import Logger, LogLevel\n\nclass DataSet:\n\n def __init__(self, p_graphs, robots, beta, bid_alpha, cost_alpha):\n self.... | [
[
"numpy.random.uniform",
"numpy.random.randint",
"numpy.random.choice"
]
] |
noranhe/vnpy_optionmaster | [
"180c85f92004d1092bc45032dc31585539de9768"
] | [
"vnpy_optionmaster/ui/manager.py"
] | [
"from typing import Dict, List, Tuple, Optional\nfrom copy import copy\nfrom functools import partial\n\nfrom scipy import interpolate\n\nfrom vnpy.event import Event, EventEngine\nfrom vnpy.trader.engine import MainEngine\nfrom vnpy.trader.ui import QtWidgets, QtCore, QtGui\nfrom vnpy.trader.event import EVENT_TIC... | [
[
"scipy.interpolate.CubicSpline"
]
] |
JeffreyJosanne/nematus_tf | [
"582be1eeba2920bfa8cc064fa642c429f5eddd6d"
] | [
"nematus/data_iterator.py"
] | [
"import numpy\n\nimport gzip\n\nimport shuffle\nfrom util import load_dict\n\ndef fopen(filename, mode='r'):\n if filename.endswith('.gz'):\n return gzip.open(filename, mode)\n return open(filename, mode)\n\nclass FileWrapper(object):\n def __init__(self, fname):\n self.pos = 0\n self.... | [
[
"numpy.array"
]
] |
joeranbosma/ModelsGenesis | [
"5b18ea88d662e5250523434d02cfdcb6b527e634"
] | [
"pytorch/utils.py"
] | [
"from __future__ import print_function\nimport math\nimport os\nimport random\nimport copy\nimport scipy\nimport imageio\nimport string\nimport numpy as np\nfrom skimage.transform import resize\ntry: # SciPy >= 0.19\n from scipy.special import comb\nexcept ImportError:\n from scipy.misc import comb\n\ndef be... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.dot",
"numpy.random.rand",
"numpy.interp",
"numpy.random.shuffle",
"scipy.misc.comb",
"numpy.sort",
"numpy.linspace",
"numpy.flip"
]
] |
mattiaguerri/transformers | [
"ebc36108dc1c20985905c79f7d6a00f57f3cd3ae"
] | [
"src/transformers/modeling_mobilebert.py"
] | [
"# MIT License\n#\n# Copyright (c) 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and github/lonePatient\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 with... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.functional.softplus",
"torch.nn.MSELoss",
"torch.arange",
"torch.nn.Softmax",
"tensorflow.train.load_variable",
"torch.nn.CrossEntropyLoss",
"torch.from_numpy",
"tensorflow.train.list_variables",
"torch... |
sergeyshilin/kaggle-statoil-iceberg-classifier-challenge | [
"fa5c7e721297d9e1478593951b4d9cf16a0cd66d"
] | [
"ensembling/make_submit.py"
] | [
"import sys\nimport pandas as pd\nimport numpy as np\nfrom sklearn.metrics import log_loss\n\npower = float(sys.argv[1])\n\ndef transform(preds):\n return preds ** power / (preds ** power + (1.0 - preds) ** power)\n\nwith open('submit_id', 'r') as submit_id:\n last_submit_id = int(submit_id.read())\n\nlast_su... | [
[
"pandas.read_csv",
"sklearn.metrics.log_loss",
"numpy.clip"
]
] |
FoVNull/MFDSL | [
"8c6fc99260c1c02f4f45cfb14a111028d2a96ded"
] | [
"validation/new/bare_model.py"
] | [
"from typing import Dict, Any\n\nimport tensorflow as tf\nfrom tensorflow.keras.utils import plot_model\nfrom kashgari_local.abc_feature_model import ABCClassificationModel\nfrom kashgari.layers import L\n\n\nclass Bare_Model(ABCClassificationModel):\n def __init__(self, embedding, **params):\n super().__... | [
[
"tensorflow.keras.regularizers.L2",
"tensorflow.keras.Input",
"tensorflow.keras.regularizers.l1",
"tensorflow.keras.Model"
]
] |
sandeepsn1997/civilapp | [
"749027e904924575f60883c5d44688101f7e9864"
] | [
"resources/draw1.py"
] | [
"\n\nimport matplotlib.pyplot as plt\n\ndef draw_line_x(ox, oy, x, y, length):\n for i in range(length+1):\n ox.append(x+i)\n oy.append(y)\n return ox, oy\n\ndef draw_line_y(ox, oy, x, y, length):\n for i in range(length+1):\n ox.append(x)\n oy.append(y+i)\n return ox, oy\n\n... | [
[
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.figtext",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
... |
dego1985/wave_simulation | [
"05f5119aab158e0958170d90066c2b87b998e658"
] | [
"sim_004_complex_001/module/plot.py"
] | [
"import numpy as np\nfrom glumpy import app, gl, glm, gloo\nimport torch\n\nimport module.gpu_work as gw\n\n\nclass mesh():\n def __init__(self, motion):\n # plane\n self.motion = motion\n self.N = N = motion.N[:2]\n self.dx = dx = motion.dx\n\n # vertices\n X = [dx * (n... | [
[
"torch.cat",
"numpy.array",
"numpy.eye",
"numpy.arange",
"numpy.transpose",
"numpy.meshgrid"
]
] |
WeiChengTseng/Basic_Peptides_Model | [
"0b2bb8f157ec4c9752382eca8ffcbaca94fcaa45"
] | [
"model.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport math\nimport os\n\nclass Model():\n def __init__(self, num_label, word_dim=10, batch_size=32):\n self.num_label = num_label\n self.word_dim = word_dim\n self.batch_size = batch_size\n\n return\n\n def build(self, x, y, reg, keep_... | [
[
"tensorflow.reduce_min",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.reduce_mean",
"tensorflow.nn.leaky_relu",
"tensorflow.summary.histogram",
"tensorflow.layers.batch_normalization",
"tensorflow.nn.conv1d",
"tensorflow.add_n",
"tensorflow.losses.sigmoid_cross_en... |
DHsLc/test | [
"4b2fb49fd7578afe7e289936f347af581b5bdab1"
] | [
"tensorflow/python/eager/tape_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.eager.tensor.Tensor",
"tensorflow.python.eager.context.graph_mode",
"tensorflow.python.eager.backprop.val_and_grad_function",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.ops.math_ops.reduce_sum",
"te... |
LuizPitaAlmeida/image_caption_generator | [
"e368b9f23ef283856a42f78b724d3181245b27de",
"e368b9f23ef283856a42f78b724d3181245b27de"
] | [
"src/utils/hardware_stats.py",
"src/data_process/data_loader.py"
] | [
"import torch\nimport nvidia_smi\nimport psutil\n\n\nclass HardwareStats():\n def __init__(self):\n super().__init__()\n self.device = torch.device(\n \"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n nvidia_smi.nvmlInit()\n self.handle = nvidia_smi.nvmlDeviceGetHandl... | [
[
"torch.cuda.is_available"
],
[
"torch.Tensor",
"torch.stack",
"torch.utils.data.DataLoader"
]
] |
javierlorenzod/pytorch-lightning | [
"6dba26666aa564db414eb238d99a4213006d8220",
"6dba26666aa564db414eb238d99a4213006d8220"
] | [
"pytorch_lightning/trainer/training_loop.py",
"tests/metrics/test_metric.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"numpy.argmax",
"numpy.cumsum"
],
[
"torch.manual_seed",
"torch.cuda.is_available",
"torch.tensor"
]
] |
adrianbouza/automl | [
"46dbd753efc8efc73ced146fe8b3bb694709dcff",
"46dbd753efc8efc73ced146fe8b3bb694709dcff",
"46dbd753efc8efc73ced146fe8b3bb694709dcff"
] | [
"efficientdet/keras/infer_lib.py",
"efficientdet/keras/wbf_test.py",
"efficientdet/efficientdet_arch.py"
] | [
"# Copyright 2020 Google Research. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by... | [
[
"tensorflow.io.gfile.GFile",
"tensorflow.lite.TFLiteConverter.from_saved_model",
"tensorflow.python.framework.convert_to_constants.convert_variables_to_constants_v2_as_graph",
"tensorflow.import_graph_def",
"tensorflow.ones",
"tensorflow.function",
"tensorflow.profiler.experimental.sto... |
fossabot/onnx-mlir | [
"ed1377c26b1be69b9b0ed6942025197491ca6c7e"
] | [
"utils/gen_doc.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom collections import defaultdict, OrderedDict\nfrom io import StringIO\nimport io\nimport os\nimport sys\nimport datetime\nimport argp... | [
[
"numpy.round",
"numpy.array"
]
] |
alexhunterlang/natural_bm | [
"b2a1cb15694f4f3a80a3a1cc6f8423892563806d",
"b2a1cb15694f4f3a80a3a1cc6f8423892563806d"
] | [
"natural_bm/datasets/fast.py",
"tests/natural_bm/test_datasets.py"
] | [
"\"\"\"Simplified version of MNIST that is useful for demos and testing \"\"\"\n\n#%%\nimport numpy as np\n\ntry:\n import PIL.Image as Image\nexcept ImportError:\n import Image\n\nfrom natural_bm.datasets.common import Dataset, sample_data, threshold_data, convert2uint8\nfrom natural_bm.datasets import mnist... | [
[
"numpy.concatenate",
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.where",
"numpy.savez_compressed"
],
[
"numpy.all",
"numpy.ones",
"numpy.zeros"
]
] |
emilleishida/resspect_metric | [
"92f0b5d9de9cd6a031ec67fd76f8d302be0efef8"
] | [
"posteriors/fiducial/get_cosmo_posteriors.py"
] | [
"case = 'fiducial'\n\nimport pandas as pd\nimport numpy as np\nimport pystan\nimport os\nfrom resspect.salt3_utils import get_distances\nimport pickle\nimport time\nfrom shutil import copyfile\n\n\n\nfit_lightcurves = False\nrestart_master = True\n\n# number of bins for SALT2mu\nnbins = 70\n\n# rather to re-write f... | [
[
"numpy.array",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"numpy.argsort",
"pandas.concat",
"pandas.read_csv",
"numpy.unique"
]
] |
bmaranville/orsopy | [
"74083afdce8f8f1ab3866c7f1f5209942c8734db"
] | [
"tests/test_slddb/test_dbcreation.py"
] | [
"import sys\nimport unittest\n\nfrom numpy import ndarray, testing\n\nfrom orsopy.slddb import SLDDB, dbconfig, element_table\n\n\nclass TestCreateDB(unittest.TestCase):\n @classmethod\n def setUpClass(cls):\n cls.db = SLDDB(\":memory:\")\n cls.db.create_database()\n\n @classmethod\n def t... | [
[
"numpy.testing.assert_array_equal"
]
] |
Katsute/Baruch-CIS-3120-Assignments | [
"2cb470a7e3b7bf2d49da520fdff079f832624c06"
] | [
"classwork/05_01_2021/plt.py"
] | [
"import matplotlib.pyplot as plt\nimport pandas as pd\n\nx = [5, 2, 9, 4, 7]\ny = [10, 5, 8, 4, 2]\n\nplt.plot(x, y)\nplt.show()\n\nplt.bar(x, y)\nplt.show()\n\nplt.hist(x)\nplt.show()\n\ndf = pd.DataFrame({'x': x, 'y': y})\ndf.plot('x', 'y', kind=\"scatter\")\nplt.show()\n"
] | [
[
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar"
]
] |
AnglinaBhambra/OpenSarToolkit | [
"b2d6562a77eea86b4c236cc14f81f73ff4e75c17"
] | [
"ost/helpers/vector.py"
] | [
"import os\nimport sys\nimport json\nfrom functools import partial\n\nimport osr\nimport ogr\nimport pyproj\nimport geopandas as gpd\n\nfrom shapely.ops import transform\nfrom shapely.wkt import loads\nfrom shapely.geometry import Point, Polygon, mapping, shape\nfrom fiona import collection\nfrom fiona.crs import f... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.annotate"
]
] |
tawatts1/chess | [
"cb2917ec689bb8db1dc2436ed2ef6463319876a7"
] | [
"analyze_results.py"
] | [
"import os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n \ndef get_data(fname):\n out = []\n with open(fname, 'r') as f:\n for line in f:\n datum = []\n for entry in line.split(','):\n datum.append(float(entry))\n out.append(datum)\n r... | [
[
"numpy.array",
"matplotlib.pyplot.savefig",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.shape",
"matplotlib.pyplot.figtext",
"numpy.std"
]
] |
jasonrobwebster/sampling-importance-resampling-example | [
"250e54815f73ccf071a4dad8d62a2bd7ec38c0c2"
] | [
"linear.py"
] | [
"import numpy as np\nfrom scipy.special import softmax\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nif __name__ == '__main__':\n data_size = 100\n true_grad = 3\n true_intercept = 1\n true_sig = 1\n\n x = np.linspace(0, 10, data_size)\n # y = m x + c\n y_obs = true_grad * x + true... | [
[
"numpy.random.normal",
"scipy.special.softmax",
"numpy.random.choice",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.std",
"numpy.random.uniform",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
RichardLeeK/CNM | [
"a3c15cb0a0373d6ad03c5a815a7e020f90ab8522"
] | [
"Plateau/preprocess_image.py"
] | [
"import numpy as np\n\nfrom env import Env\n\ndef fill(image,x_idx,y_idx,bound,value):\n if (x_idx<0) or (x_idx>=900):\n return image\n elif (y_idx<0) or (y_idx>=110):\n return image\n elif image[x_idx][y_idx]>=bound:\n return image\n else:\n image[x_idx][y_idx]=value\n ... | [
[
"numpy.int64",
"numpy.array",
"numpy.zeros"
]
] |
NVlabs/sionna | [
"527d0f7866b379afffad34a6bef7ed3bf6f33ad2",
"488e6c3ff6ff2b3313d0ca0f94e4247b8dd6ff35"
] | [
"test/test_conv_encoding.py",
"sionna/signal/upsampling.py"
] | [
"#\n# SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\ntry:\n import sionna\nexcept ImportError as e:\n import sys\n sys.path.append(\"../\")\nimport unittest\nimport numpy as np\nimport tensorflow as tf\ngpus =... | [
[
"numpy.array",
"numpy.array_equal",
"numpy.zeros",
"tensorflow.config.experimental.set_memory_growth",
"numpy.load",
"tensorflow.reshape",
"tensorflow.function",
"tensorflow.keras.Model",
"tensorflow.tile",
"tensorflow.config.list_physical_devices",
"tensorflow.keras.In... |
hphphp123321/DeepKE | [
"f7efd3fc87d3bf88783a41efc3c09dca7a986013"
] | [
"example/ner/few-shot/run.py"
] | [
"import os\n\nimport hydra\nos.environ[\"CUDA_DEVICE_ORDER\"]=\"PCI_BUS_ID\"\nos.environ[\"CUDA_VISIBLE_DEVICES\"]='1'\nimport logging\nimport sys\nsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), \"../\")))\n\nfrom hydra import utils\nfrom torch.utils.data import DataLoader\nfrom deepke.name... | [
[
"torch.utils.data.DataLoader"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.