repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jaingaurav3/ML_sample | [
"4e53de198f7965fa96f0db44717df27032df4b48"
] | [
"utils/datasets.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nfrom sklearn.datasets.samples_generator import make_swiss_roll\nimport torch\nimport torchvision\nfrom torchvision import transforms\nimport glob\nimport random\n\nimport config as cfg\nimport utils.metadata as meta\nfrom . import csv_loader\nfrom . import img_lo... | [
[
"numpy.array",
"torch.utils.data.DataLoader",
"numpy.sin",
"torch.FloatTensor",
"sklearn.datasets.samples_generator.make_swiss_roll",
"torch.utils.data.dataloader.DataLoader",
"numpy.random.RandomState"
]
] |
hiepnth/people-counting-pose | [
"8cdaab5281847c296b305643842053d496e2e4e8"
] | [
"video_pose_ed.py"
] | [
"import sys\nimport os\n\nimport math\n\nimport imageio\nfrom moviepy.editor import *\n\nimport time\n\ndef read_video(video_name):\n # Read video from file\n video_name_input = 'testset/' + video_name\n video = VideoFileClip(video_name_input)\n return video\n\ndef video2frame(video_name):\n video = ... | [
[
"numpy.asarray"
]
] |
meghdeepj/Social-Navigation-Simulator | [
"806d304081bf5ff4fc7a0a58defb050627375865",
"806d304081bf5ff4fc7a0a58defb050627375865"
] | [
"gym_collision_avoidance/envs/policies/SOCIALFORCEPolicy.py",
"gym_collision_avoidance/envs/policies/NAVIGAN/scripts/sgan/utils.py"
] | [
"import os\nimport math\nimport sys\nimport torch\nimport numpy as np\n\n\nfrom gym_collision_avoidance.envs.policies.InternalPolicy import InternalPolicy\nfrom gym_collision_avoidance.envs import Config\nfrom gym_collision_avoidance.envs.util import *\n\nfrom gym_collision_avoidance.envs.policies import socialforc... | [
[
"numpy.arctan2",
"numpy.array",
"numpy.linalg.norm"
],
[
"numpy.isnan",
"torch.cuda.synchronize",
"torch.unsqueeze"
]
] |
ManavR123/cs_285_project | [
"2a0496345c2a8de06338ae7e44ca3775a9291f4c"
] | [
"deeptutor/scripts/run.py"
] | [
"import os\nimport pickle\n\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom deeptutor.envs.DashEnv import *\nfrom deeptutor.envs.EFCEnv import EFCEnv\nfrom deeptutor.envs.HRLEnv import *\nfrom deeptutor.infrastructure.utils import *\nfrom deeptutor.tutors.LeitnerTutor import LeitnerTutor\nfrom deeptutor.tutors.R... | [
[
"numpy.zeros",
"numpy.random.seed"
]
] |
linkinpark213/pytorch-lstm-toy | [
"a89eba74a3606dab125d394e63e4a585319227f1"
] | [
"test.py"
] | [
"import torch\nimport numpy as np\nimport torch.utils.data\nfrom net import SurnameLSTM\nfrom data import SurnameDataset\n\nif __name__ == '__main__':\n net = SurnameLSTM()\n state_dict = torch.load('model.pth')\n net.load_state_dict(state_dict)\n\n dataset = SurnameDataset(subset='val')\n data_loade... | [
[
"torch.load",
"torch.utils.data.DataLoader",
"torch.tensor",
"numpy.array",
"numpy.where"
]
] |
ronaldosvieira/rl | [
"01e7ac1a6fabe7a74171ce45e220232fdb23280b"
] | [
"main.py"
] | [
"import numpy as np\n\nclass Reward:\n\tpass\n\nclass StaticReward(Reward):\n\tdef __init__(self, value):\n\t\tself.value = value\n\n\tdef get(self):\n\t\treturn value\n\nclass NormalReward(Reward):\n\tdef __init__(self, mean, std):\n\t\tself.mean = mean\n\t\tself.std = std\n\n\tdef get(self):\n\t\treturn np.random... | [
[
"numpy.random.random",
"numpy.random.seed",
"numpy.random.choice",
"numpy.random.normal",
"numpy.argmax"
]
] |
senisioi/Romanian-Transformers | [
"45f4c4513fd0a5a81f4a20a5d63b4b9cd1d10b43"
] | [
"corpus/text_cleaner.py"
] | [
"import re, multiprocessing\nfrom tqdm import tqdm\nimport numpy as np\n\nclass Cleaner():\n def __init__(self, num_threads=1): # right now, it's single threaded\n self.num_threads = min(num_threads, int(multiprocessing.cpu_count()/2))\n\n \"\"\"\n S- ar putea să fie necesar să- l recitiţi.\n ... | [
[
"numpy.array"
]
] |
ksburaya/aphantasia | [
"de9d430dee7108abfcb1b19eb2d8d806b8e5d899"
] | [
"illustrip.py"
] | [
"# coding: UTF-8\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport argparse\nimport numpy as np\nimport shutil\nimport PIL\nimport time\nfrom imageio import imread, imsave\nfrom googletrans import Translator\n\nimport torch\nimport torchvision\nimport t... | [
[
"torch.optim.Adam",
"torch.view_as_real",
"torch.fft.rfftn",
"torch.cuda.empty_cache",
"torch.rfft",
"torch.view_as_complex",
"torch.clip",
"torch.no_grad",
"torch.rand",
"torch.fft.irfftn",
"torch.irfft"
]
] |
cptq/smooth-ot | [
"a165c0c949730ec0490a0670352e04c39762062c"
] | [
"smoothot/tests/test_projection.py"
] | [
"import numpy as np\nfrom sklearn.utils.testing import assert_array_almost_equal\n\nfrom smoothot.projection import projection_simplex\n\n\ndef _projection_simplex(v, z=1):\n \"\"\"\n Old implementation for test and benchmark purposes.\n The arguments v and z should be a vector and a scalar, respectively.\... | [
[
"sklearn.utils.testing.assert_array_almost_equal",
"numpy.maximum",
"numpy.arange",
"numpy.cumsum",
"numpy.sort",
"numpy.ones",
"numpy.random.RandomState"
]
] |
Macielyoung/sentence_representation_matching | [
"aa33147eb870a805f69dbc54c2177b11a94cf814",
"aa33147eb870a805f69dbc54c2177b11a94cf814"
] | [
"simcse/train_unsup.py",
"esimcse/loading.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2021/6/10\n# @Author : kaka\n\n\nimport argparse\nimport logging\nimport os\nfrom config import Params\n\nfrom datasets import load_dataset\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\nfrom transformers import... | [
[
"torch.mean",
"torch.nn.functional.cross_entropy",
"torch.utils.data.DataLoader",
"torch.eye",
"numpy.mean",
"torch.arange"
],
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
ph7klw76/Data_science_project | [
"5b99c49d44e6858269c4220135ea4c2e0f0bcdef"
] | [
"Economic Growth & GDP per capita.py"
] | [
"import pandas as pd\ndata=pd.read_csv(\"C:/Users/user/Documents/API_NY.GDP.PCAP.CD_DS2_en_csv_v2_1068945.csv\") #your raw data obtained from world bank\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nfulldataonly=data.dropna()\nlistofcountry=fulldataonly['Country Name']\nlistofcountry=list(listofcountry)... | [
[
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.ylabel"
]
] |
HzcIrving/DLRL_PlayGround | [
"0db9a4bdb87130d1d26aea1591ef74cbe6aaa43b"
] | [
"VIT/Train.py"
] | [
"#! /usr/bin/enc python\n# -*- coding: utf-8 -*-\n# author: Irving He \n# email: 1910646@tongji.edu.cn\n\nimport logging\nimport argparse\nimport os\nimport random\nimport numpy as np\nfrom tqdm import tqdm\n\nimport datetime\nfrom datetime import timedelta\n\nimport torch\nimport torch.distributed as dist\n\nfrom ... | [
[
"torch.nn.CrossEntropyLoss",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.load",
"torch.argmax"
]
] |
ElnuraMusaoglu/KernelizedCorrelationFilter | [
"282a6312be23f6c4bce3b38c19045a1d1a3bce3b"
] | [
"hog_cpp/fhog/get_hog.py"
] | [
"from hog_cpp.fhog import fhog\nimport numpy as np\n\n'''\nhttps://github.com/lawpdas/fhog-python\n'''\n\ndef get_hog(img):\n M = np.zeros(img.shape[:2], dtype='float32')\n O = np.zeros(img.shape[:2], dtype='float32')\n H = np.zeros([img.shape[0] // 4, img.shape[1] // 4, 32], dtype='float32') # python3\n ... | [
[
"numpy.zeros"
]
] |
rajputakhil/ludwig | [
"dd1a37ea1018db6624f05d72c34ae8b0f7068e6c",
"dd1a37ea1018db6624f05d72c34ae8b0f7068e6c",
"dd1a37ea1018db6624f05d72c34ae8b0f7068e6c",
"dd1a37ea1018db6624f05d72c34ae8b0f7068e6c"
] | [
"ludwig/models/modules/recurrent_modules.py",
"ludwig/utils/visualization_utils.py",
"ludwig/utils/misc.py",
"ludwig/models/modules/reduction_modules.py"
] | [
"# coding=utf-8\r\n# Copyright (c) 2019 Uber Technologies, Inc.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the 'License');\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r... | [
[
"tensorflow.get_variable",
"tensorflow.python.framework.tensor_shape.TensorShape",
"tensorflow.nn.dynamic_rnn",
"tensorflow.concat",
"tensorflow.layers.dropout",
"tensorflow.global_variables",
"tensorflow.cast",
"tensorflow.tile",
"tensorflow.matmul",
"tensorflow.shape",
... |
wangxiaoyunanne/TAGCN | [
"9f2df35e1586f49efcd6d4706e3edd2499c1c6f1"
] | [
"layers.py"
] | [
"from inits import *\nimport tensorflow as tf\n\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\n# global unique layer ID dictionary for layer name assignment\n_LAYER_UIDS = {}\n\n\ndef get_layer_uid(layer_name=''):\n \"\"\"Helper function, assigns unique layer IDs.\"\"\"\n if layer_name not in _LAYER_UIDS:\n ... | [
[
"tensorflow.matmul",
"tensorflow.floor",
"tensorflow.sparse_retain",
"tensorflow.sparse_tensor_dense_matmul",
"tensorflow.add_n",
"tensorflow.name_scope",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.variable_scope",
"tensorflow.nn.dropout",
"tensorflow.rando... |
wla80/pandas | [
"dccfee53ff68dfa2c42a7571f26ba640694aa547"
] | [
"pandas/tests/indexes/datetimes/test_arithmetic.py"
] | [
"# -*- coding: utf-8 -*-\nimport warnings\nfrom datetime import datetime, timedelta\nimport operator\n\nimport pytest\n\nimport numpy as np\n\nimport pandas as pd\nfrom pandas.compat.numpy import np_datetime64_compat\nimport pandas.util.testing as tm\nfrom pandas.errors import PerformanceWarning, NullFrequencyError... | [
[
"pandas.to_datetime",
"pandas.offsets.Day",
"pandas.util.testing.assert_produces_warning",
"pandas.offsets.DateOffset",
"pandas.util.testing.assert_index_equal",
"pandas.util.testing.assert_numpy_array_equal",
"pandas.offsets.Hour",
"numpy.subtract",
"pandas.Index",
"pandas... |
zhangzhenhu/zzh | [
"ebacd9c0c46a0a537d014550bd2bff0a85452a6e"
] | [
"zzh/mllib/model/_deep_fm.py"
] | [
"\"\"\"\nTensorflow implementation of DeepFM\n\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.compat.v1 as tf1\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.metrics import roc_auc_score\nfrom time import time\nfrom tensorflow.contrib.layers.python.layers import bat... | [
[
"tensorflow.cond",
"tensorflow.compat.v1.train.import_meta_graph",
"tensorflow.concat",
"numpy.sqrt",
"tensorflow.reduce_sum",
"sklearn.metrics.confusion_matrix",
"tensorflow.compat.v1.train.Saver",
"tensorflow.Graph",
"tensorflow.compat.v1.train.AdamOptimizer",
"numpy.resh... |
wenguanwang/ContrastiveSeg | [
"9a381b9799c16d81e18d8f9f25ab509b93fb56de"
] | [
"lib/loss/loss_contrast.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom abc import ABC\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom lib.loss.loss_helper import FSAuxCELoss, FSAuxRMILoss\nfrom lib.utils.tools.logger import Logger as L... | [
[
"torch.transpose",
"torch.max",
"torch.zeros",
"torch.randperm",
"torch.cat",
"torch.arange",
"torch.exp",
"torch.unique",
"torch.log",
"torch.nn.functional.interpolate",
"torch.unbind",
"torch.ones_like"
]
] |
jskinn/arvet | [
"742cf3e7ee8848c4efebfaa887fc9c0fd90a06e9",
"742cf3e7ee8848c4efebfaa887fc9c0fd90a06e9"
] | [
"arvet/batch_analysis/tests/test_task.py",
"arvet/database/tests/mock_image_manager.py"
] | [
"# Copyright (c) 2017, John Skinner\nimport unittest\nimport numpy as np\nimport arvet.database.tests.database_connection as dbconn\nfrom arvet.config.path_manager import PathManager\nimport arvet.batch_analysis.task as task\n\n\nclass MockTask(task.Task):\n def run_task(self, path_manager: PathManager):\n ... | [
[
"numpy.random.RandomState"
],
[
"numpy.array_equal"
]
] |
Wenhao-Yang/DeepSpeaker-pytorch | [
"99eb8de3357c85e2b7576da2a742be2ffd773ead",
"99eb8de3357c85e2b7576da2a742be2ffd773ead",
"99eb8de3357c85e2b7576da2a742be2ffd773ead",
"99eb8de3357c85e2b7576da2a742be2ffd773ead",
"99eb8de3357c85e2b7576da2a742be2ffd773ead",
"99eb8de3357c85e2b7576da2a742be2ffd773ead"
] | [
"Score/Cosine_Score.py",
"TrainAndTest/Spectrogram/train_domres_egs.py",
"TrainAndTest/train_egs.py",
"TrainAndTest/Fbank/TDNNs/train_etdnn_kaldi.py",
"Process_Data/validate_data.py",
"TrainAndTest/deprecated/test_accuracy_kaldi.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\n\"\"\"\n@Author: yangwenhao\n@Contact: 874681044@qq.com\n@Software: PyCharm\n@File: Cosine.py\n@Time: 19-6-26 下午9:43\n@Overview: Implement Cosine Score for speaker identification!\nEnrollment set files will be in the 'Data/enroll_set.npy' and the classes-to-index file is... | [
[
"numpy.matmul",
"numpy.linalg.norm",
"numpy.finfo",
"numpy.load",
"numpy.zeros"
],
[
"torch.nn.Softmax",
"torch.max",
"torch.load",
"torch.utils.data.DataLoader",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"numpy.exp",
"torch.autograd.Variable"... |
mmicromegas/ransX | [
"2faaa786e00cfd14dce0e18f0793cd0252428d2a",
"2faaa786e00cfd14dce0e18f0793cd0252428d2a"
] | [
"EQUATIONS/InternalEnergyEquation.py",
"CANUTO1997/LuminosityEquation.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom UTILS.Calculus import Calculus\nfrom UTILS.SetAxisLimit import SetAxisLimit\nfrom UTILS.Tools import Tools\nfrom UTILS.Errors import Errors\nimport sys\n\n\n# Theoretical background https://arxiv.org/abs/1401.5176\n\n# Mocak, Meakin, Viallet, Arnett, 2014, ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotl... |
cwaitt/zse | [
"4330397ddf84dafaa0af7bddd25756e008cb3ff5"
] | [
"cif_tools.py"
] | [
"__all__ = ['read_cif','cif_site_labels']\n\nfrom ase.io import read\nfrom ase.spacegroup import spacegroup\nimport sys\nimport os\nimport logging\nfrom math import *\nimport numpy as np\nimport pkg_resources\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n\npath = '.temp_files/'\nfilepath = pkg_resources.... | [
[
"numpy.round",
"numpy.array",
"numpy.count_nonzero"
]
] |
VirgiAgl/V_savigp | [
"310f31f789db34737313bf057ff1474e314d68fd",
"310f31f789db34737313bf057ff1474e314d68fd"
] | [
"GP/data_transformation.py",
"GP/model_learn.py"
] | [
"import numpy as np\nfrom sklearn import preprocessing\n\n\nclass DataTransformation:\n \"\"\"\n A generic class for the transformation of data\n \"\"\"\n\n def __init__(self):\n pass\n\n def transform_X(self, X):\n \"\"\"\n transforms X\n\n :param\n X: Input X\n ... | [
[
"sklearn.preprocessing.StandardScaler",
"numpy.log"
],
[
"numpy.savetxt",
"numpy.hstack",
"numpy.array"
]
] |
jscarlson/stylegan2-pytorch | [
"b460a7378ff3e80ff56190b3225c65e42e37ad6e"
] | [
"blend.py"
] | [
"import os\nimport copy\nimport numpy as np\nimport click\nfrom typing import List, Optional\nimport torch\nimport pickle\n\ndef extract_conv_names(model):\n model_names = list(name for name in model.keys())\n\n return model_names\n\ndef blend_models(low, high, model_res, level):\n\n levels = [x for x in ... | [
[
"torch.device",
"torch.save"
]
] |
traffic-analysis/gandalf | [
"7015cdde2765fadd0cb653adea1e2b5dc2a6145e"
] | [
"wfi/cw/wfi-cw5.py"
] | [
"import tensorflow as tf\nimport tensorflow.contrib.distributions as tfd\nimport numpy as np\nimport os.path as opth\nimport tqdm\nimport os\nfrom sklearn.utils import shuffle\nimport argparse\nHOME = os.path.expanduser('~')\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"2\";\nlayers = tf.keras.layers\nparser = argparse... | [
[
"tensorflow.device",
"tensorflow.control_dependencies",
"tensorflow.equal",
"numpy.concatenate",
"tensorflow.nn.l2_loss",
"numpy.mean",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow.reduce_logsumexp",
"tensorflow.Graph",
"tensorflow.contrib.... |
bi3mer/Word2Vec | [
"55297c4f10c5dbfdcaf93b01282808efdd275956"
] | [
"Word2Vec/NearestNeighbor.py"
] | [
"from heapq import heappush, nsmallest\nimport numpy as np\n\nclass NearestNeighbor():\n def __init__(self, embeddings, encodings, config):\n self.embeddings = embeddings\n self.encodings = encodings\n self.config = config\n\n def euclidian_distance(self, e1, e2):\n '''\n ht... | [
[
"numpy.linalg.norm"
]
] |
jlazzaridean/mScarlet_lifetime_reports_pH | [
"13b022b1dc1fff8ebd0a881248011923e378889b",
"13b022b1dc1fff8ebd0a881248011923e378889b"
] | [
"figures/fig3_baf_time_series/baf_TS_plot_lyso_hist.py",
"figures/figS13_baf_time_series_other_ex/01_baf_TS_plot_lyso_hist.py"
] | [
"from pathlib import Path\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import Divider, Size\nimport pandas as pd\n\n# This script plots histograms of pHlys by lysosome from two particular\n# recordings (DMSO 10/29 01, pos 5; Baf 10/29 01 pos 9) for use in main\n# text figure 3.... | [
[
"pandas.read_csv",
"numpy.linspace",
"numpy.min",
"numpy.max",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure"
],
[
"pandas.read_csv",
"numpy.linspace",
"numpy.min",
"numpy.max",
"matplotlib.pyplot.show",
"matplotlib.pyplo... |
wangna11BD/Paddle | [
"bc379ca3d5895eadbc1748bc5b71606011563ee1"
] | [
"python/paddle/nn/functional/extension.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 ... | [
[
"numpy.abs"
]
] |
ysBach/astropy | [
"3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9"
] | [
"astropy/coordinates/spectral_coordinate.py"
] | [
"import warnings\nfrom textwrap import indent\n\nimport astropy.units as u\nimport numpy as np\nfrom astropy.constants import c\nfrom astropy.coordinates import (ICRS,\n CartesianDifferential,\n CartesianRepresentation, SkyCoord)\nfrom astropy.coordina... | [
[
"numpy.errstate",
"numpy.sqrt"
]
] |
565353780/pointcloud-manage | [
"77f16671ec0b88f53cd9fde2538143721f9d3ab6"
] | [
"PointCloudClass/renderer.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport cv2\nimport numpy as np\nfrom math import cos, sin, pi\nfrom tqdm import tqdm\nimport open3d as o3d\n\ndef render(pointcloud_file_path, estimate_normals_radius, estimate_normals_max_nn):\n pointcloud = o3d.io.read_point_cloud(pointcloud_file_path, print_p... | [
[
"numpy.asarray",
"numpy.dot",
"numpy.array",
"numpy.linalg.norm"
]
] |
unkper/PedestrainSimulationModule | [
"039ed0903a0861130566d8d1d862594064b8e0db"
] | [
"rl/env/multiagent_particle_envs/multiagent/multi_discrete.py"
] | [
"# An old version of OpenAI Gym's multi_discrete.py. (Was getting affected by Gym updates)\n# (https://github.com/openai/gym/blob/1fb81d4e3fb780ccf77fec731287ba07da35eb84/gym/spaces/multi_discrete.py)\n\nimport numpy as np\n\nimport gym\n\nclass MultiDiscrete(gym.Space):\n \"\"\"\n - The multi-discrete action... | [
[
"numpy.multiply",
"numpy.array_equal",
"numpy.array",
"numpy.random.RandomState"
]
] |
tonthatnam/japanese_ocr | [
"c78ed95d940fd979bbec1f33bca085e9977cafa4"
] | [
"tess/utilities/image_process.py"
] | [
"from PIL import Image\nimport tempfile\nimport cv2\nimport imutils\nimport numpy as np\n\ndef set_image_dpi_ppi(file_path):\n im = Image.open(file_path)\n length_x, width_y = im.size\n factor = float(length_x/width_y)\n size = int(600), int(600/factor)\n im_resized = im.resize(size, Image.ANTIALIAS)... | [
[
"numpy.int0"
]
] |
opendilab/DI-hpc | [
"8f001382cd1c0119013e1d0d0e98ff41c751d8a2"
] | [
"tests/test_iqn_nstep_td_error.py"
] | [
"import time\nimport torch\nfrom hpc_rll.origin.td import iqn_nstep_td_error, iqn_nstep_td_data\nfrom hpc_rll.rl_utils.td import IQNNStepTDError\nfrom testbase import mean_relative_error, times\n\nassert torch.cuda.is_available()\nuse_cuda = True\n\ntau = 33\ntauPrime = 34\nT = 10\nB = 64\nN = 8\ngamma = 0.95\nkapp... | [
[
"torch.cuda.synchronize",
"torch.randint",
"torch.randn",
"torch.cuda.is_available",
"torch.flatten",
"torch.cuda.cudart"
]
] |
leonsor/scikit-learn-mooc | [
"b58f051efb591a38859a4242369c9494ccac6a17",
"27c5caf7b0d2f0cc734baee59ad65efc263704cd"
] | [
"python_scripts/03_categorical_pipeline_sol_01.py",
"python_scripts/ensemble_sol_01.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.6.0\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n# %% [markdown]\n# # 📃 Solution f... | [
[
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"sklearn.dummy.DummyClassifier",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.compose.make_column_selector",
"sklearn.preprocessing.OrdinalEncoder",
"sklearn.model_selection.cross_validate"
],
[
"sklearn.tree.Deci... |
aarora8/icefall | [
"8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a",
"8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a",
"8cb7f712e413fffbcdfdd865be73d6ff43f0ce7a"
] | [
"egs/librispeech/ASR/conformer_mmi/decode.py",
"egs/librispeech/ASR/tdnn_lstm_ctc/train.py",
"egs/librispeech/ASR/conformer_ctc/export.py"
] | [
"#!/usr/bin/env python3\n# Copyright 2021 Xiaomi Corporation (Author: Liyong Guo, Fangjun Kuang)\n#\n# See ../../../../LICENSE for clarification regarding multiple 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# Y... | [
[
"torch.set_num_interop_threads",
"torch.load",
"torch.set_num_threads",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"torch.stack"
],
[
"torch.multiprocessing.spawn",
"torch.distributed.barrier",
"torch.set_grad_enabled",
"torch.utils.tensorboard.Summ... |
DevilCarp/Paddle | [
"04325d2cbefb029a4478bdc069d3279cd566ac6a",
"04325d2cbefb029a4478bdc069d3279cd566ac6a",
"04325d2cbefb029a4478bdc069d3279cd566ac6a",
"04325d2cbefb029a4478bdc069d3279cd566ac6a",
"04325d2cbefb029a4478bdc069d3279cd566ac6a",
"04325d2cbefb029a4478bdc069d3279cd566ac6a",
"04325d2cbefb029a4478bdc069d3279cd566ac6... | [
"python/paddle/tensor/linalg.py",
"python/paddle/tensor/manipulation.py",
"python/paddle/fluid/tests/unittests/ipu/test_one_hot_v2_op_ipu.py",
"python/paddle/fluid/tests/unittests/test_inner.py",
"python/paddle/fluid/tests/unittests/auto_parallel_autoconvert.py",
"python/paddle/fluid/tests/unittests/test_... | [
"# 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 ... | [
[
"numpy.float"
],
[
"numpy.asscalar",
"numpy.zeros"
],
[
"numpy.array"
],
[
"numpy.inner",
"numpy.random.randn",
"numpy.random.rand",
"numpy.random.seed"
],
[
"numpy.random.normal",
"numpy.random.random",
"numpy.random.seed"
],
[
"numpy.array",
... |
wilsongis/3DP_Experiments | [
"da9bd3b4ba1d82bac7dcfa27d86634add59db087"
] | [
"Samples/codes/matopt_review/add_objective.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCopyright (c) 2021 Showa Denko Materials co., Ltd. All rights reserved.\n\nThis software is for non-profit use only.\n\nTHIS SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\nINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FO... | [
[
"numpy.atleast_2d",
"numpy.vstack",
"numpy.empty"
]
] |
JiwanChung/acav100m | [
"51cb948d5682da69334a8d05d2df631971b60215"
] | [
"subset_selection/code/measures/contrastive/contrastive.py"
] | [
"import csv\nfrom pathlib import Path\n\nimport torch\nimport pandas\nimport numpy as np\n\nfrom utils import peek, load_json, dump_json\nfrom .module import ContrastiveModule\nfrom mps import distributed as du\nfrom save import format_rows\n\n\ndef get_penultimates(keys):\n penultimates = {}\n for key in key... | [
[
"pandas.Series",
"torch.Tensor",
"torch.load",
"torch.cat",
"torch.optim.AdamW",
"torch.no_grad",
"numpy.array",
"torch.save"
]
] |
Genevievekim/semantic-segmentation-1 | [
"f28b026e44cff80fe3ca4cac94cea27e4073821b",
"f28b026e44cff80fe3ca4cac94cea27e4073821b",
"f28b026e44cff80fe3ca4cac94cea27e4073821b",
"f28b026e44cff80fe3ca4cac94cea27e4073821b"
] | [
"semseg/models/bisenetv1.py",
"semseg/datasets/ade20k.py",
"semseg/datasets/helen.py",
"scripts/onnx_infer.py"
] | [
"import torch \nimport math\nfrom torch import nn, Tensor\nfrom torch.nn import functional as F\nfrom semseg.models.backbones import *\nfrom semseg.models.modules.common import ConvModule\n\n\nclass SpatialPath(nn.Module):\n def __init__(self, c1, c2) -> None:\n super().__init__()\n ch = 64\n ... | [
[
"torch.cat",
"torch.nn.init.zeros_",
"torch.randn",
"torch.load",
"torch.nn.Conv2d",
"torch.nn.PixelShuffle",
"torch.nn.Sigmoid",
"torch.nn.init.ones_",
"torch.nn.Upsample",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
],
[
"torch.te... |
aryaman4/tensorboard | [
"72a104edb0f8d83ef8889ebee7dd39be684461c1"
] | [
"tensorboard/plugins/hparams/backend_context_test.py"
] | [
"# Copyright 2019 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.test.main"
]
] |
wqqpp007/geoist | [
"116b674eae3da4ee706902ce7f5feae1f61f43a5"
] | [
"geoist/cattools/MapTools.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n\nfrom mpl_toolkits.basemap import Basemap\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport numpy as np\n\n#-----------------------------------------------------------------------------------------\n\nclass GeoMap:\n '''\n INFO:\n\n Map boun... | [
[
"matplotlib.pyplot.legend",
"matplotlib.colors.BoundaryNorm",
"matplotlib.pyplot.title",
"matplotlib.pyplot.scatter",
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.close",
... |
cschlick/espaloma | [
"cae5664446d0c89025de5eb827f507d8af64e2d4",
"cae5664446d0c89025de5eb827f507d8af64e2d4"
] | [
"espaloma/nn/readout/node_typing.py",
"espaloma/mm/tests/test_openmm_consistency.py"
] | [
"# =============================================================================\n# IMPORTS\n# =============================================================================\nimport torch\n\nfrom espaloma.nn.readout.base_readout import BaseReadout\n\n\n# ==============================================================... | [
[
"torch.nn.Linear"
],
[
"numpy.testing.assert_almost_equal",
"torch.zeros",
"numpy.zeros",
"torch.tensor"
]
] |
KeAWang/emmental | [
"dae9f9fbba944f7c8404ab85aa9296545db1b82b"
] | [
"src/emmental/utils/seed.py"
] | [
"# Copyright (c) 2021 Sen Wu. All Rights Reserved.\n\n\n\"\"\"Helper function to set random seed for reproducibility of models.\"\"\"\n\nimport logging\nimport random\nfrom typing import Optional\n\nimport numpy as np\nimport torch\n\nlogger = logging.getLogger(__name__)\n\n\ndef set_random_seed(seed: Optional[int]... | [
[
"torch.manual_seed",
"numpy.iinfo",
"numpy.random.seed"
]
] |
MyBourse/pandas-ta | [
"98478f8bf049a4c8748d6f3c795f4f335ced05ca"
] | [
"pandas_ta/overlap/hilo.py"
] | [
"# -*- coding: utf-8 -*-\nfrom numpy import NaN as npNaN\nfrom pandas import DataFrame, Series\n# from pandas_ta.overlap.ma import ma\nfrom .ma import ma\nfrom pandas_ta.utils import get_offset, verify_series\n\n\ndef hilo(high, low, close, high_length=None, low_length=None, mamode=None, offset=None, **kwargs):\n ... | [
[
"pandas.Series",
"pandas.DataFrame"
]
] |
BlueOwlDev/dask | [
"a1187b13321d69565b9c21359d739c239bd04c65"
] | [
"dask/array/wrap.py"
] | [
"from functools import partial\nfrom itertools import product\n\nimport numpy as np\n\nfrom tlz import curry\n\nfrom ..base import tokenize\nfrom ..utils import funcname\nfrom .blockwise import BlockwiseCreateArray\nfrom .core import Array, normalize_chunks\nfrom .utils import (\n meta_from_array,\n empty_lik... | [
[
"numpy.ndim",
"numpy.dtype"
]
] |
colour-science/sample_code | [
"8bda35b674d770da5a0e6c210634a77691527fce"
] | [
"ty_lib/test_pattern_generator2.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\n評価用のテストパターン作成ツール集\n\n\"\"\"\n\nimport os\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom colour.colorimetry import CMFS, ILLUMINANTS\nfrom colour.models import XYZ_to_xy, xy_to_XYZ, XYZ_to_RGB, RGB_to_XYZ\nfrom colour.models import x... | [
[
"numpy.linspace",
"numpy.all",
"numpy.round",
"numpy.zeros_like",
"scipy.ndimage.filters.convolve",
"numpy.hstack",
"numpy.ones_like",
"numpy.clip",
"numpy.reshape",
"numpy.arange",
"numpy.sin",
"numpy.repeat",
"numpy.zeros",
"matplotlib.pyplot.figure",
... |
ijinmao/CAM-Localization | [
"dfa214be984f77d577dba1065e2c63e0c1b0b82b"
] | [
"demo.py"
] | [
"\nimport numpy as np\nimport cv2\nimport matplotlib.pylab as plt\nfrom keras.preprocessing.image import load_img\nfrom keras.models import model_from_json\nfrom models import (\n\tcreate_cam_model, preprocess_image, \n\tget_cam_img\n)\n\n# Define CAM conv layer name\nCAM_CONV_LAYER = 'cam_conv_layer'\n\n\ndef read... | [
[
"matplotlib.pylab.show",
"matplotlib.pylab.imshow"
]
] |
reinforcementdriving/cvpods | [
"32d98b74745020be035a0e20337ad934201615c4",
"614a975e5425bbaeb66bbd1ffca552d633ba89ca",
"32d98b74745020be035a0e20337ad934201615c4",
"614a975e5425bbaeb66bbd1ffca552d633ba89ca",
"614a975e5425bbaeb66bbd1ffca552d633ba89ca"
] | [
"cvpods/engine/predictor.py",
"cvpods/modeling/backbone/splat.py",
"cvpods/data/datasets/torchvision_datasets.py",
"cvpods/modeling/meta_arch/auto_assign.py",
"cvpods/utils/visualizer/visualizer.py"
] | [
"#!/usr/bin/python3\n# -*- coding:utf-8 -*-\nfrom copy import deepcopy\n\nimport torch\n\nfrom cvpods.checkpoint import DefaultCheckpointer\nfrom cvpods.data import build_transform_gens\n\n__all__ = [\"DefaultPredictor\"]\n\n\nclass DefaultPredictor:\n \"\"\"\n Create a simple end-to-end predictor with the gi... | [
[
"torch.no_grad",
"torch.cuda.set_device"
],
[
"torch.nn.functional.softmax",
"torch.nn.modules.utils._pair",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.functional.sigmoid",
"torch.split",
"torch.nn.ReLU"
],
[
"numpy.asarray",
"numpy.ascontiguousarray",
... |
Tapot/evidently | [
"ab9b91425d622566b663565508dd1c43e741f515",
"ab9b91425d622566b663565508dd1c43e741f515",
"ab9b91425d622566b663565508dd1c43e741f515",
"ab9b91425d622566b663565508dd1c43e741f515"
] | [
"tests/dashboard/widgets/test_reg_error_normality_widget.py",
"src/evidently/dashboard/widgets/num_output_values_widget.py",
"tests/dashboard/widgets/test_percent_widget.py",
"tests/dashboard/widgets/test_reg_pred_vs_actual_widget.py"
] | [
"from typing import Optional\n\nimport pandas as pd\n\nimport pytest\n\nfrom evidently.analyzers.regression_performance_analyzer import RegressionPerformanceAnalyzer\nfrom evidently.model.widget import BaseWidgetInfo\nfrom evidently.options import OptionsProvider\nfrom evidently.pipeline.column_mapping import Colum... | [
[
"pandas.DataFrame"
],
[
"numpy.std",
"numpy.mean"
],
[
"pandas.DataFrame"
],
[
"pandas.DataFrame"
]
] |
hohsieh/osgeopy-code | [
"bc85f4ec7a630b53502ee491e400057b67cdab22"
] | [
"Chapter13/listing13_7.py"
] | [
"# Script that uses meshgrid to get map coordinates and then plots\n# the DEM in 3d.\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom osgeo import gdal\n\n\nds = gdal.Open(r'D:\\osgeopy-data\\Washington\\dem\\sthelens_utm.tif')\nband = ds.GetRasterBand(1)\nov_ban... | [
[
"numpy.arange",
"matplotlib.pyplot.axis",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
taesup-aws/autogluon | [
"51b20c4a18de148b4f06b384e56b102c86727153",
"51b20c4a18de148b4f06b384e56b102c86727153"
] | [
"tabular/src/autogluon/tabular/models/knn/knn_model.py",
"core/src/autogluon/core/scheduler/mo_asha.py"
] | [
"import logging\n\nimport numpy as np\nimport math\nimport psutil\nimport time\n\nfrom autogluon.common.features.types import R_BOOL, R_CATEGORY, R_OBJECT, S_BOOL, S_TEXT_NGRAM, S_TEXT_SPECIAL, S_DATETIME_AS_INT\nfrom autogluon.core.constants import REGRESSION\nfrom autogluon.core.utils.exceptions import NotEnoughM... | [
[
"numpy.zeros",
"numpy.random.choice"
],
[
"numpy.array"
]
] |
winnerineast/keras | [
"1e94c43d7ba0d7b6b629b2300e40470f495bdbe0",
"1e94c43d7ba0d7b6b629b2300e40470f495bdbe0",
"1e94c43d7ba0d7b6b629b2300e40470f495bdbe0"
] | [
"keras/initializers/initializers_v2.py",
"keras/benchmarks/keras_examples_benchmarks/cifar10_cnn_benchmark_test.py",
"keras/preprocessing/text_dataset_test.py"
] | [
"# Copyright 2020 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.util.tf_export.keras_export",
"tensorflow.as_dtype"
],
[
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Sequential",
"tensorflow.keras.datasets.cifar10.load_data",
"tensorflow.test.ma... |
BradyBromley/botorch | [
"270599207f5b9bf8c66e1197ad2632bb69c3d3b9"
] | [
"botorch/acquisition/monte_carlo.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nr\"\"\"\nBatch acquisition functions using the reparameterization trick in combination\nwith (quasi) Monte-Carlo sampling. See [Rezende2014reparam]_ and\n[Wilson2017reparam]_\n\n.. [Rezende2014reparam]\n D. J. Re... | [
[
"torch.sigmoid",
"torch.is_tensor"
]
] |
erialc-cal/NLP-FOMC | [
"2a8ad113a87e79f5d7beefa6cfd4653f445c92d5",
"2a8ad113a87e79f5d7beefa6cfd4653f445c92d5"
] | [
"RA_project/code_python/image_score_posi.py",
"LDA_qje/QJE_prep.py"
] | [
"import pandas as pd\nimport datetime\nimport matplotlib.pyplot as plt\nimport ast\nfrom gensim.parsing.preprocessing import STOPWORDS\nfrom nltk.corpus import stopwords\nfrom collections import defaultdict\nfrom nltk.stem import WordNetLemmatizer \nimport datetime\n\n\n\nstop_words = stopwords.words('english')\nle... | [
[
"pandas.read_excel",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.close",
"matplotlib.pyplot.text",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel"
],
[
"pandas.read_csv",
"... |
tszumowski/lightning-flash | [
"d094fee4065d3d8d1337eed451041ee17fdf50aa"
] | [
"flash_examples/object_detection.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.cuda.device_count"
]
] |
MPGek/client | [
"541d760c5cb8776b1ad5fcf1362d7382811cbc61"
] | [
"wandb/fastai/__init__.py"
] | [
"'''\nThis module hooks fast.ai Learners to Weights & Biases through a callback.\nRequested logged data can be configured through the callback constructor.\n\nExamples:\n WandbCallback can be used when initializing the Learner::\n\n ```\n from wandb.fastai import WandbCallback\n [...]\n l... | [
[
"matplotlib.use",
"matplotlib.pyplot.Axes",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
garg-aayush/devito | [
"b1e8fffdee7d6b556ff19a372d69ed1aebee675a"
] | [
"devito/passes/clusters/aliases.py"
] | [
"from collections import OrderedDict, defaultdict, namedtuple\nfrom functools import partial\nfrom itertools import groupby\n\nfrom cached_property import cached_property\nimport numpy as np\n\nfrom devito.ir import (SEQUENTIAL, PARALLEL, PARALLEL_IF_PVT, ROUNDABLE, DataSpace,\n Forward, Itera... | [
[
"numpy.floor"
]
] |
harshgrovr/Graphs_Thesis | [
"36daf66f6216bad4d30651311bcb87aa45dd33d5",
"9ffd0d23c8f8b4bd53db9fd5b9bf5776666814e0"
] | [
"examples/pytorch/ogb/line/reading_data.py",
"related_code/3-basics/tutorial_utils.py"
] | [
"import os\nimport numpy as np\nimport scipy.sparse as sp\nimport pickle\nimport torch\nfrom torch.utils.data import DataLoader\nfrom dgl.data.utils import download, _get_dgl_url, get_download_dir, extract_archive\nimport random\nimport time\nimport dgl\n\ndef ReadTxtNet(file_path=\"\", undirected=True):\n \"\"\... | [
[
"torch.LongTensor",
"numpy.power",
"numpy.ceil",
"numpy.array",
"numpy.sum"
],
[
"torch.nn.functional.one_hot",
"pandas.read_csv",
"torch.tensor"
]
] |
danielvarga/vat_tf | [
"0b40b256922b7996558504a5d2c3556b5f9fff15"
] | [
"train_semisup.py"
] | [
"import time\n\nimport numpy as np\nimport tensorflow as tf\n\nimport layers as L\nimport vat\n\nFLAGS = tf.app.flags.FLAGS\n\ntf.app.flags.DEFINE_string('device', '/gpu:0', \"device\")\n\ntf.app.flags.DEFINE_string('dataset', 'cifar10', \"{cifar10, svhn}\")\n\ntf.app.flags.DEFINE_string('log_dir', \"\", \"log_dir\... | [
[
"tensorflow.device",
"tensorflow.global_variables",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.train.AdamOptimizer",
"numpy.random.randint",
"tensorflow.Graph",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.trainable_variables",
"numpy.load",
"tensorflow.Summary... |
yuvallanger/matplotlib | [
"c9898ea9a30c67c579ab27cd61b68e2abae0fb0e",
"c9898ea9a30c67c579ab27cd61b68e2abae0fb0e",
"c9898ea9a30c67c579ab27cd61b68e2abae0fb0e"
] | [
"examples/pylab_examples/mri_with_eeg.py",
"examples/pylab_examples/dashpointlabel.py",
"examples/pylab_examples/log_bar.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nThis now uses the imshow command instead of pcolor which *is much\nfaster*\n\"\"\"\nfrom __future__ import division, print_function\n\nimport numpy as np\n\nfrom matplotlib.pyplot import *\nfrom matplotlib.collections import LineCollection\nimport matplotlib.cbook as cbook\n# I use... | [
[
"numpy.hstack",
"numpy.nonzero",
"matplotlib.collections.LineCollection",
"numpy.arange",
"numpy.ravel",
"matplotlib.cbook.get_sample_data",
"numpy.zeros"
],
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
],
[
"matplotlib.pylab.show",
"matplotlib.pylab... |
TristanThomson/Year-3-Final-Project | [
"07a588ff3312040c6ff41fd170c1909357991c66"
] | [
"Twitter_scraping/graph_builder.py"
] | [
"import os\nimport networkx as nx\nimport pandas as pd\nfrom pathlib import Path\nfrom Twitter_scraping.scraper_helper import RandomPicker\n\nG = nx.DiGraph() # initialises empty NetworkX graph\nmin_list = RandomPicker().min_df[\"Twitter\"].dropna() # Pandas series from the \"Twitter\" col of the SYI dataset\nmep... | [
[
"pandas.read_csv"
]
] |
evgps/mmdetection_trashcan | [
"aaf4237c2c0d473425cdc7b741d3009177b79751",
"aaf4237c2c0d473425cdc7b741d3009177b79751",
"aaf4237c2c0d473425cdc7b741d3009177b79751"
] | [
"mmdet/models/backbones/res2net.py",
"tests/test_utils/test_assigner.py",
"mmdet/models/dense_heads/free_anchor_retina_head.py"
] | [
"import math\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.checkpoint as cp\nfrom mmcv.cnn import (build_conv_layer, build_norm_layer, constant_init,\n kaiming_init)\nfrom mmcv.runner import load_checkpoint\nfrom torch.nn.modules.batchnorm import _BatchNorm\n\nfrom mmdet.utils impo... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.AvgPool2d",
"torch.utils.checkpoint.checkpoint",
"torch.split"
],
[
"torch.all",
"torch.LongTensor",
"torch.empty",
"torch.Tensor",
"torch.FloatTensor",
"torch.rand"
],
[
"torch.sigmoid",
"torch.cat",
"to... |
RedVoxInc/libquantum | [
"5e0d741e69be0ac1b94c018a4a0de99f4630deae"
] | [
"examples/03_sweep_linear.py"
] | [
"\"\"\"\nlibquantum example 3: 03_sweep_linear.py\nConstruct classic linear chirp and illustrate CWT and STFT TRFs.\n\"\"\"\n\nimport os\nfrom pathlib import Path\nimport numpy as np\nimport scipy.io.wavfile\nimport matplotlib.pyplot as plt\nfrom libquantum import atoms, entropy, scales, spectra, utils, synthetics\... | [
[
"numpy.flipud",
"numpy.ceil",
"numpy.copy",
"numpy.real",
"matplotlib.pyplot.show"
]
] |
jiangnanboy/gcn_for_prediction_of_protein_interactions | [
"b2a9eb06cdfe0971d0c352299db1075ec4827dd9"
] | [
"src/graph_nheads_att_gan/train.py"
] | [
"import scipy.sparse as sp\nimport numpy as np\nimport torch\nimport time\nimport os\nfrom configparser import ConfigParser\n\nimport sys\nsys.path.append('/home/shiyan/project/gcn_for_prediction_of_protein_interactions/')\n\nfrom src.util.load_data import load_data, sparse_to_tuple, mask_test_edges, preprocess_gra... | [
[
"torch.LongTensor",
"torch.Size",
"scipy.sparse.eye",
"numpy.save",
"torch.tensor",
"scipy.sparse.identity",
"torch.FloatTensor",
"torch.cuda.is_available",
"numpy.array"
]
] |
DocYard-ai/UCR | [
"7618aa336f56e71d9fd8cdc2d591e3d138e3dc68"
] | [
"ucr/core/architecture/head/rec_srn_head.py"
] | [
"# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\n#\n# Modifications copyright (c) 2021 DocYard Authors. All Rights Reserve.\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 Lice... | [
[
"torch.nn.ConstantPad1d",
"torch.nn.functional.softmax",
"torch.sigmoid",
"torch.cat",
"torch.tile",
"torch.reshape",
"torch.nn.Flatten",
"torch.nn.Embedding",
"torch.nn.Linear",
"torch.bmm",
"torch.topk",
"torch.nn.functional.tanh"
]
] |
glee1228/segment_temporal_context_aggregation | [
"e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d"
] | [
"utils.py"
] | [
"import io\nimport os\nimport random\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom PIL import Image\n\n\ndef resize_axis(tensor, axis, new_size, fill_value=0, random_sampling=False):\n \"\"\"Truncates or pads a tensor to new_size on on a given axis.\n Trunca... | [
[
"torch.nn.CrossEntropyLoss",
"torch.randint",
"torch.Tensor",
"torch.narrow",
"torch.clamp_min",
"torch.ones_like",
"numpy.random.randint"
]
] |
WISE-Project/wiselib2 | [
"9daf7b3b72e81d154fe094c05000406ee203c3de"
] | [
"wiselib2/Noise.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jul 07 14:08:31 2016\n\n@author: Mic\n\"\"\"\nfrom __future__ import division\nfrom wiselib2.must import *\nimport numpy as np\nimport wiselib2.Rayman as rm\nGauss1d = lambda x ,y : None\nfrom scipy import interpolate as interpolate\n\nfrom matplotlib import pyplot ... | [
[
"matplotlib.pyplot.legend",
"numpy.amax",
"numpy.sqrt",
"numpy.linspace",
"numpy.fft.fftshift",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes",
"numpy.max",
"numpy.all",
"numpy.exp",
"numpy.hstack",
"numpy.arange",
"scipy.integrate.trapz",
"numpy.real",
... |
OYukiya/PyIntroduction | [
"433142b25de36552867b209649b17113ca2e11c6"
] | [
"opencv/pycv_tutorial/color_space.py"
] | [
"\n# -*- coding: utf-8 -*-\n## @package pycv_tutorial.color_space\n#\n# 画像処理: 色空間の変換\n# @author tody\n# @date 2016/06/27\n\nimport cv2\nimport matplotlib.pyplot as plt\n\n# RGB画像の表示\ndef showImageRGB(image_file):\n image_bgr = cv2.imread(image_file)\n image_rgb = cv2.cvtColor(image_bgr, cv2.COL... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.gray",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
]
] |
JohnnySun8/TextWorld | [
"9a54e9d642f7605a0f3ebba3285cdd04047975e2"
] | [
"scripts/sample_quests.py"
] | [
"#!/usr/bin/env python\n\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\n\nimport os\nimport argparse\nfrom os.path import join as pjoin\n\nimport numpy as np\nimport networkx as nx\n\nfrom textworld.render import visualize\nfrom textworld.generator import Game\nfr... | [
[
"numpy.random.RandomState"
]
] |
zuru/pytorch_cluster | [
"442e8d9c8cec0c7621966dc45f9f7dd151209044"
] | [
"torch_cluster/fps.py"
] | [
"from typing import Optional\n\nimport torch\nfrom torch import Tensor\n\n\n@torch.jit._overload # noqa\ndef fps(src, batch=None, ratio=None, random_start=True): # noqa\n # type: (Tensor, Optional[Tensor], Optional[float], bool) -> Tensor\n pass # pragma: no cover\n\n\n@torch.jit._overload # noqa\ndef fps... | [
[
"torch.ones_like",
"torch.cumsum",
"torch.ops.torch_cluster.fps",
"torch.tensor"
]
] |
f74066357/Image_Inpainting | [
"1c89cdadcf420633d29136c8bdcbd280f2546769",
"1c89cdadcf420633d29136c8bdcbd280f2546769"
] | [
"mmedit/models/inpaintors/vic/common.py",
"mmedit/models/inpaintors/one_stage.py"
] | [
"\"\"\"\nBasicSR/codes/dataops/common.py (8-Nov-20)\nhttps://github.com/victorca25/BasicSR/blob/dev2/codes/dataops/common.py\n\"\"\"\n\nimport os\nimport math\nimport pickle\nimport random\nimport numpy as np\nimport torch\nimport cv2\nimport logging\n\nimport copy\nfrom torchvision.utils import make_grid\n\n#from ... | [
[
"numpy.dot",
"torch.abs",
"numpy.expand_dims",
"torch.cat",
"torch.zeros",
"torch.sin",
"numpy.issubdtype",
"torch.sum",
"torch.FloatTensor",
"torch.finfo",
"torch.ones",
"numpy.clip",
"numpy.matmul",
"torch.from_numpy",
"numpy.full",
"numpy.frombuff... |
gabriellm1/pandas | [
"020040b3b92516b445ddd8daba3b9818340e82d4",
"020040b3b92516b445ddd8daba3b9818340e82d4",
"020040b3b92516b445ddd8daba3b9818340e82d4",
"020040b3b92516b445ddd8daba3b9818340e82d4",
"020040b3b92516b445ddd8daba3b9818340e82d4",
"020040b3b92516b445ddd8daba3b9818340e82d4"
] | [
"pandas/core/construction.py",
"pandas/tests/reshape/test_melt.py",
"pandas/tests/series/methods/test_replace.py",
"pandas/tests/arithmetic/test_interval.py",
"pandas/tests/window/moments/test_moments_consistency_ewm.py",
"pandas/tests/test_sorting.py"
] | [
"\"\"\"\nConstructor functions intended to be shared by pd.array, Series.__init__,\nand Index.__new__.\n\nThese should not depend on core.internals.\n\"\"\"\nfrom __future__ import annotations\n\nfrom collections import abc\nfrom typing import TYPE_CHECKING, Any, Optional, Sequence, Union, cast\n\nimport numpy as n... | [
[
"pandas.core.dtypes.common.is_datetime64_ns_dtype",
"pandas.core.dtypes.cast.maybe_cast_to_integer_array",
"pandas.core.dtypes.common.is_extension_array_dtype",
"pandas.core.dtypes.cast.maybe_cast_to_datetime",
"pandas._libs.lib.is_scalar",
"pandas.core.arrays.FloatingArray._from_sequence"... |
tangku006/cnn-text-classification-tf-master | [
"510a39d2726a23b0b94a5e6f4fc83014b0e0fa30"
] | [
"test.py"
] | [
"#! /usr/bin/env python\r\n\r\nimport tensorflow as tf\r\nimport numpy as np\r\nimport os\r\nimport time\r\nimport datetime\r\nimport data_helpers\r\nfrom text_cnn import TextCNN\r\nfrom tensorflow.contrib import learn\r\n\r\n# Parameters\r\n# ==================================================\r\n\r\n# Data loading... | [
[
"tensorflow.flags.DEFINE_boolean",
"numpy.random.seed",
"tensorflow.flags.DEFINE_string",
"tensorflow.flags.DEFINE_float",
"tensorflow.contrib.learn.preprocessing.VocabularyProcessor",
"tensorflow.flags.DEFINE_integer"
]
] |
cdiswine/data-engineering-nanodegree | [
"a5895e3ba2f94128a16b9da6d07327451bacb173"
] | [
"ETL-data-with-postgres/etl.py"
] | [
"import os\nimport glob\nimport psycopg2\nimport pandas as pd\nimport numpy as np\nfrom sql_queries import *\n\n\ndef process_song_file(cur, filepath):\n # open song file\n df = pd.read_json(filepath, lines = True)\n\n # insert song record\n song_data = df[[\"song_id\", \"title\", \"artist_id\", \"year\... | [
[
"numpy.array",
"pandas.to_datetime",
"pandas.read_json",
"pandas.DataFrame"
]
] |
weightan/quaternion_polynomials | [
"50d00bb883c4a4249f13154cffcb459a1319ecb9",
"50d00bb883c4a4249f13154cffcb459a1319ecb9"
] | [
"old_stuff/harold/_time_domain.py",
"old_stuff/harold/tests/test_static_ctrl_design.py"
] | [
"import numpy as np\nfrom numpy import (reciprocal, einsum, maximum, minimum, zeros_like,\n atleast_1d, squeeze)\nfrom scipy.linalg import eig, eigvals, matrix_balance, norm\nfrom harold._classes import Transfer, transfer_to_state\nfrom harold._discrete_funcs import discretize\nfrom harold._arg_ut... | [
[
"numpy.minimum",
"numpy.linspace",
"numpy.einsum",
"numpy.asarray",
"numpy.squeeze",
"numpy.max",
"numpy.zeros_like",
"numpy.any",
"numpy.allclose",
"numpy.arange",
"numpy.atleast_1d",
"numpy.block",
"numpy.diff",
"scipy.linalg.norm",
"numpy.reciprocal",... |
ananthsub/d2go | [
"8c3618d9e73518d32350ab4e6d0fb6509c9e08b6",
"8c3618d9e73518d32350ab4e6d0fb6509c9e08b6"
] | [
"d2go/setup.py",
"d2go/evaluation/prediction_count_evaluation.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\n\nimport argparse\nimport logging\nimport os\nimport time\n\nimport detectron2.utils.comm as comm\nimport torch\nfrom d2go.config import (\n CfgNode as CN,\n auto_scale_world_size,\n reroute_config_path,\n ... | [
[
"torch.get_num_threads"
],
[
"numpy.mean"
]
] |
petersvenningsson/radar-Bayesian-human-motion | [
"728db0f39c107faccf9d711670177aac74456e3f",
"728db0f39c107faccf9d711670177aac74456e3f"
] | [
"train.py",
"pytrack/simulation.py"
] | [
"import argparse\n\nimport numpy as np\nfrom sklearn.metrics import accuracy_score, jaccard_score, balanced_accuracy_score\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\n\nimport dataloader\nimport track\nfrom classifiers import ObservationsConditionsClassifier\nfrom classifiers impor... | [
[
"matplotlib.pyplot.tight_layout",
"sklearn.metrics.jaccard_score",
"numpy.reshape",
"sklearn.metrics.balanced_accuracy_score",
"pandas.DataFrame",
"numpy.seterr",
"matplotlib.pyplot.show",
"numpy.zeros",
"sklearn.metrics.accuracy_score"
],
[
"numpy.diag",
"numpy.vst... |
cpiker/condaCDF | [
"58f0c15fa387798f49c0372cc33d3639d997112d"
] | [
"pycdf/__init__.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ndas developers note:\n\n This a is modification of the original SpacePy pycdf package. All\n refereneces to the greater spacepy package have been removed to create\n a small standalone module.\n \n --cwp 2018-10-18\n \n The libcdf.so location code h... | [
[
"numpy.rollaxis",
"numpy.hstack",
"numpy.trunc",
"numpy.abs",
"numpy.min",
"numpy.arange",
"numpy.ma.getdata",
"numpy.flipud",
"numpy.frompyfunc",
"numpy.dtype",
"numpy.round",
"numpy.max",
"numpy.char.array",
"numpy.vectorize",
"numpy.asanyarray",
"... |
juancruzsosa/torchero | [
"d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797",
"d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797"
] | [
"torchero/utils/defaults.py",
"torchero/meters/confusion_matrix.py"
] | [
"from collections import Iterable\n\nfrom torch import nn\nfrom torch import optim\n\nfrom torchero import meters\nfrom functools import partial\n\nINVALID_MODE_INFERENCE_MESSAGE = (\n \"Could not infer mode from meter {meter}\"\n)\n\ndef get_default_mode(meter):\n if hasattr(meter.__class__, 'DEFAULT_MODE'):... | [
[
"torch.optim.SGD"
],
[
"matplotlib.pyplot.gca",
"torch.max",
"torch.cat",
"torch.zeros",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.gcf"
]
] |
filipeaguiarrod/Formacao-Cientista-de-Dados-com-Python-e-R | [
"c9b72f93b2a6ead49641d765fe2a0f23ffb4b1bf"
] | [
"Python/grafico_3d.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import axes3d\n\nbase = pd.read_csv('orchard.csv')\n\nfigura = plt.figure()\neixo = figura.add_subplot(1, 1, 1, projection = '3d')\neixo.scatter(base.decrease, base.rowpos, base.colpos)\neixo.set_xlabel('decrease')\neixo.set_ylabel('ro... | [
[
"pandas.read_csv",
"matplotlib.pyplot.figure"
]
] |
xli94/simpeg | [
"a0078301f7dfd54431d6b51abcf092079ad0e5a3"
] | [
"SimPEG/electromagnetics/natural_source/survey.py"
] | [
"import sys\nimport numpy as np\nfrom numpy.lib import recfunctions as recFunc\n\nfrom ..frequency_domain.survey import Survey\nfrom ...data import Data as BaseData\nfrom ...utils import mkvc\nfrom .sources import Planewave_xy_1Dprimary, Planewave_xy_1DhomotD\nfrom .receivers import Point3DImpedance, Point3DTipper\... | [
[
"numpy.hstack",
"numpy.lib.recfunctions.stack_arrays",
"numpy.ones",
"numpy.any",
"numpy.array",
"numpy.empty"
]
] |
daniel98789/bullet3 | [
"b57aa900293e21f7808ea2697a5b64b494867492"
] | [
"python_part/trees.py"
] | [
"import PyBulletEnv\nimport Obj\nfrom numpy import random\n\nif __name__ == \"__main__\":\n env = PyBulletEnv.PyBulletEnv()\n env.setup()\n tree = Obj.Obj(\"data/tree/Tree.obj\")\n \n\n forest = []\n for _ in range(2):\n x = random.uniform(0, 20)\n y = random.uniform(0, 20)\n ... | [
[
"numpy.random.uniform"
]
] |
QSD-for-WaSH/sanitation | [
"cbcbdd7ead382a6e66b51b5193852494ab3f081b",
"cbcbdd7ead382a6e66b51b5193852494ab3f081b",
"cbcbdd7ead382a6e66b51b5193852494ab3f081b"
] | [
"qsdsan/sanunits/_suspended_growth_bioreactor.py",
"qsdsan/_lca.py",
"qsdsan/_transportation.py"
] | [
"# -*- coding: utf-8 -*-\n'''\nQSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems\n\nThis module is developed by:\n Joy Zhang <joycheung1994@gmail.com>\n\nThis module is under the University of Illinois/NCSA Open Source License.\nPlease refer to https://github.com/QSD-Group/QSDs... | [
[
"numpy.hstack",
"numpy.asarray",
"scipy.integrate.solve_ivp",
"numpy.ndarray",
"numpy.full",
"numpy.concatenate",
"numpy.ones",
"numpy.append",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
],
[
"pandas.concat",
"pandas.Index",
"pandas.ExcelWriter",
"... |
Maruja/Maruja-ILAS-Python | [
"af304bfa2767fb30982e88d4b2138113237ba99d"
] | [
"Assignment/Environmental_Project/part_A.py"
] | [
"from pandas import read_csv\nfrom IPython.display import display\nimport numpy as np\nimport sys\nimport math\n\n###############################\n ####Maria Eugenia Lopez ##### \n###############################\n\n\ndef fully_grown_depuration(number_to_remove=0.50):\n\t return plants.loc[plants.height_m > number_t... | [
[
"pandas.read_csv"
]
] |
RodolfoFerro/iris-api | [
"3034a1629d28feb215be2fdbf24edbd1176ff0d6"
] | [
"app.py"
] | [
"# -*- coding: utf-8 -*-\n\n# ===============================================================\n# Author: Rodolfo Ferro\n# Email: ferro@cimat.mx\n# Twitter: @FerroRodolfo\n#\n# ABOUT COPYING OR USING PARTIAL INFORMATION:\n# This script was originally created by Rodolfo Ferro, for\n# his workshop in HackSureste 2019 ... | [
[
"numpy.array"
]
] |
DuttaAbhigyan/robust-adaptive-lqr | [
"89d5ff606806a389a1ec4026bc5c17fb51573ae6"
] | [
"python/sls.py"
] | [
"\"\"\"sls.py\n\nAn implementation of the robust adaptive controller.\nBoth FIR SLS version with CVXPY and the common \nLyapunov relaxation.\n\n\n\"\"\"\n\nimport numpy as np\nimport cvxpy as cvx\nimport utils\nimport logging\nimport math\nimport scipy.linalg\n\nfrom abc import ABC, abstractmethod\nfrom adaptive im... | [
[
"numpy.sqrt",
"numpy.eye",
"numpy.set_printoptions",
"numpy.linalg.norm",
"numpy.ones",
"numpy.array",
"numpy.zeros"
]
] |
christabella/GPflow | [
"30824d289f8ee3f58d4249238c8b7267e6a0b2fc",
"30824d289f8ee3f58d4249238c8b7267e6a0b2fc",
"30824d289f8ee3f58d4249238c8b7267e6a0b2fc",
"30824d289f8ee3f58d4249238c8b7267e6a0b2fc"
] | [
"doc/source/notebooks/understanding/models.pct.py",
"doc/source/notebooks/theory/Sanity_check.pct.py",
"doc/source/notebooks/basics/GPLVM.pct.py",
"tests/integration/test_method_equivalence.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,.pct.py:percent\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.3.3\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---... | [
[
"tensorflow.matmul",
"numpy.random.seed",
"numpy.eye",
"numpy.cos",
"numpy.sin",
"tensorflow.math.log",
"numpy.argmax",
"numpy.random.randn",
"numpy.random.rand",
"numpy.exp",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure"
],
[
"numpy.sqrt",
"... |
autt/gathering-leto | [
"37894d8d8ad0381a2aacbb38593325a882b030f5"
] | [
"src/data/data/__init__.py"
] | [
"import github\nimport pandas as pd\n\n\ndef get_issues(repo_addr):\n g = github.Github()\n repo = g.get_repo(repo_addr)\n return repo.get_issues()\n\n\ndef fetch_issue_activity(repo_addr):\n g = github.Github()\n issues = g.get_repo(repo_addr).get_issues(state=\"all\")\n\n events = []\n for is... | [
[
"pandas.DataFrame"
]
] |
gasteigerjo/gdc | [
"996bc47acffd86bc9bb1df3293c87a3c7573744f"
] | [
"data.py"
] | [
"__author__ = \"Stefan Weißenberger and Johannes Gasteiger\"\r\n__license__ = \"MIT\"\r\n\r\nimport os\r\n\r\nimport numpy as np\r\nfrom scipy.linalg import expm\r\n\r\nimport torch\r\nfrom torch_geometric.data import Data, InMemoryDataset\r\nfrom torch_geometric.datasets import Planetoid, Amazon, Coauthor\r\n\r\nf... | [
[
"torch.LongTensor",
"torch.zeros",
"torch.load",
"numpy.arange",
"numpy.eye",
"torch.FloatTensor",
"numpy.random.RandomState",
"numpy.zeros",
"numpy.where",
"torch.save"
]
] |
showerhhh/ComplexNetwork | [
"344fadee4e85924f45263a43d2110dae2a9394fe"
] | [
"homework_3/main.py"
] | [
"import functools\nimport os\nimport random\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\n\n\ndef make_graph(path):\n G = nx.DiGraph()\n\n with open(path, 'r') as f:\n lines = f.readlines()\n # random.seed(0)\n sample_nums = int(len(lines) * 0.00006)\n lines = random.s... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.savefig"
]
] |
comeCU/coding-python | [
"3a35e67f5a92c32734b93b5503e5b08bc63b06bd"
] | [
"funnyPython/test_wordcloud.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\n# 生成词云\n'''\nReference:\n https://amueller.github.io/word_cloud/\n \thttps://github.com/amueller/word_cloud\n'''\n\nfrom wordcloud import WordCloud\nimport matplotlib.pyplot as plt\n\n\nfilename = \"***.txt\"\t# 文本\nwith open(filename) as f:\n\tmytext = f.... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
yuko29/tflite_custom_op | [
"66df2c5ade62b04b920034e7721c4b6afc60e942"
] | [
"tensorflow_zero_out/python/ops/convert_to_tflite.py"
] | [
"import tensorflow as tf\nimport tensorflow_zero_out \nimport numpy as np\nimport os\n\n# Create a model using low-level tf.* APIs\nclass ZeroOut(tf.Module):\n @tf.function(input_signature=[tf.TensorSpec(shape=[None], dtype=tf.int32)])\n def __call__(self, x):\n return tensorflow_zero_out.zero_out(x)\nmodel = ... | [
[
"tensorflow.TensorSpec",
"tensorflow.lite.TFLiteConverter.from_concrete_functions"
]
] |
jeongwhanchoi/graph-neural-pde | [
"4323db3bb3badbcfc3c569635b7f8f072946528d"
] | [
"test/test_attention.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nTest attention\n\"\"\"\nimport unittest\nimport torch\nfrom torch import tensor\nfrom torch import nn\nfrom function_GAT_attention import SpGraphAttentionLayer, ODEFuncAtt\nfrom torch_geometric.utils import softmax, to_dense_adj\nfrom data import get_dataset\... | [
[
"torch.all",
"torch.Size",
"torch.mm",
"torch.ones",
"torch.cat",
"torch.tensor",
"torch.nn.LeakyReLU",
"torch.cuda.is_available"
]
] |
bshapiroalbert/PsrSigSim | [
"74bb40814295fb6ef84aa932a0de2f684162b8c4"
] | [
"tests/test_simulate.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport pytest\nimport os\nimport numpy as np\nimport glob\n\nfrom psrsigsim.signal.fb_signal import FilterBankSignal\nfrom psrsigsim.pulsar.pulsar import Pulsar\nfrom psrsigsim.pulsar.portraits import DataPortrait\nfrom psrsigsim.pulsar.profiles import DataProfile... | [
[
"numpy.load",
"numpy.exp"
]
] |
johny-c/noge | [
"88e68ba8c51ff0d63577991e233e9110cb76e228"
] | [
"scripts/train_dqn.py"
] | [
"import copy\nimport torch\nimport logging\nimport numpy as np\nfrom sacred import Experiment\n\nfrom noge.data_loaders import get_datasets, get_test_loader, get_train_generator\nfrom noge.factory import make_env, make_memory\nfrom noge.network import make_network\nfrom noge.agent import Actor, main_loop, loop_ing\... | [
[
"torch.device",
"numpy.set_printoptions",
"torch.nn.MSELoss",
"torch.cuda.is_available"
]
] |
ziqi123/AutoParking | [
"bc2c86fe93892c0502cc7cf689d8ec072d2974d1",
"bc2c86fe93892c0502cc7cf689d8ec072d2974d1",
"bc2c86fe93892c0502cc7cf689d8ec072d2974d1",
"bc2c86fe93892c0502cc7cf689d8ec072d2974d1"
] | [
"preprocessing/make_dataset_new.py",
"hourglass_four/dataloader/dataloader_four.py",
"stackedHourglass/dataloader/dataset_stackedHourglass.py",
"models/hourglass.py"
] | [
"import numpy as np\nimport os\nimport cv2\nfrom PIL import Image\nimport numpy as np\nimport random\nimport itertools\nimport matplotlib.pyplot as plt # plt 用于显示图片\nfrom tqdm import tqdm\n\n# 标注文件数据处理\n\n\ndef read_pslot(annt_file):\n # print(annt_file)\n with open(annt_file, \"r\") as f:\n annt = f.... | [
[
"numpy.dot",
"numpy.expand_dims",
"numpy.float32",
"numpy.array",
"numpy.mat",
"numpy.loadtxt"
],
[
"torch.utils.data.DataLoader"
],
[
"numpy.expand_dims",
"numpy.asarray",
"numpy.concatenate",
"numpy.seterr",
"torch.FloatTensor",
"numpy.exp",
"numpy... |
vlievin/booster-pytorch | [
"a8f447160c30224112731a25f90f6f97126a34b2"
] | [
"booster/logging/logger.py"
] | [
"import logging\nimport os\nimport sys\nimport warnings\nfrom collections import namedtuple\nfrom typing import *\n\nimport matplotlib.image\nimport matplotlib.pyplot as plt\nfrom torch import Tensor\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom booster import Diagnostic\nfrom .datatracker import DataT... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig"
]
] |
thunlp/AMNRE | [
"16970d9887561c75886123828960943b7efc9c62"
] | [
"CNN/src/models.py"
] | [
"from __future__ import print_function\nimport torch\nfrom torch import nn\nimport numpy as np\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom constant import *\nfrom torch.nn.utils.rnn import pack_padded_sequence\n\nclass EncoderGRU(nn.Module):\n def __init__(self,\n vo... | [
[
"torch.nn.functional.normalize",
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.mean",
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.GRU",
"torch.sum",
"torch.from_numpy",
"torch.nn.Embedding",
"torch.nn.Tanh",
"torch.nn.Sigmoid",
"torch.nn.MaxPool1d"... |
Lan-Jing/Courses | [
"540db9499b8725ca5b82a2c4e7a3da09f73c0efa",
"540db9499b8725ca5b82a2c4e7a3da09f73c0efa",
"540db9499b8725ca5b82a2c4e7a3da09f73c0efa"
] | [
"DCS311 Artificial Intelligence/KNN/lab1_code/M3/dist.py",
"DCS311 Artificial Intelligence/CNN/main.py",
"DCS311 Artificial Intelligence/RNN/nn.py"
] | [
"# module for distance computation;\nimport numpy as np\n\ndef dist(arraya, arrayb, mode):\n if mode == 0:\n dis = np.sum(np.abs(np.subtract(arraya, arrayb)))\n elif mode == 1:\n dis = np.sqrt(np.sum(np.power(np.subtract(arraya, arrayb), 2)))\n else:\n dis = 1 - np.dot(arraya, arrayb) ... | [
[
"numpy.dot",
"numpy.multiply",
"numpy.power",
"numpy.subtract",
"numpy.mean"
],
[
"torch.nn.CrossEntropyLoss",
"torch.cuda.is_available"
],
[
"torch.nn.Dropout",
"torch.max",
"torch.nn.LSTM",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.equal",
"tor... |
czuo0303/Python | [
"4866b1330bc7c77c0ed0e050e6b99efdeb026448",
"c906ba82f3772173a7e90bd0918c846530439a8b"
] | [
"digital_image_processing/filters/gaussian_filter.py",
"machine_learning/logistic_regression.py"
] | [
"\"\"\"\nImplementation of gaussian filter algorithm\n\"\"\"\nfrom cv2 import imread, cvtColor, COLOR_BGR2GRAY, imshow, waitKey\nfrom numpy import pi, mgrid, exp, square, zeros, ravel, dot, uint8\nfrom itertools import product\n\n\ndef gen_gaussian_kernel(k_size, sigma):\n center = k_size // 2\n x, y = mgrid[... | [
[
"numpy.square",
"numpy.ravel",
"numpy.dot",
"numpy.zeros"
],
[
"numpy.dot",
"matplotlib.pyplot.legend",
"numpy.log",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"sklearn.datasets.load_iris",
"matplotlib.pyplot.contour",
"numpy.exp",
"matplotlib.pyplot.sho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.