repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
nickderobertis/sensitivity | [
"73ccaa7cca4d266d6ab56951a9034589bc329a93"
] | [
"sensitivity/df.py"
] | [
"import operator\nfrom functools import reduce\nfrom typing import Dict, Any, Callable, Sequence, Optional\nimport itertools\nfrom copy import deepcopy\n\nimport pandas as pd\nfrom pandas.io.formats.style import Styler\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom sensitivity.colors import _get_color_map\n\n\n... | [
[
"pandas.DataFrame",
"pandas.Series"
]
] |
Algue-Rythme/anomaly | [
"e6dcfa6f2c92c74e1519f285d0309cce70d0aa5e"
] | [
"sandbox.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\n# from deel.lip.layers import ScaledL2NormPooling2D\nfrom models import ScaledL2NormPooling2D\n\nwith tf.device('/cpu:0'):\n pooler = ScaledL2NormPooling2D(pool_size=(3,3))\n ones = tf.ones(shape=(1,3,3,1))\n other = 3*tf.ones(shape=(1,3,3,1))\n print(ones... | [
[
"tensorflow.linalg.norm",
"tensorflow.ones",
"tensorflow.device"
]
] |
eklitzke/schemaless | [
"eb2ca453a69e8af36980c53fcc66725116ae7971"
] | [
"examples/mysqlbench/plot.py"
] | [
"import csv\nimport sys\nimport optparse\n\nimport matplotlib\nfrom matplotlib import pyplot\n\npyplot.rcParams.update({\n 'backend': 'cairo',\n 'axes.labelsize': 10,\n 'legend.fontsize': 10,\n 'xtick.labelsize': 8,\n 'ytick.labelsize': 8,\n 'font.sans-serif': ['Droid Sans'... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel"
]
] |
Manjunathsai7/Chest_XRay_Classification- | [
"23545c29f3a3a8029b67d1b8f0900827058e53be"
] | [
"V3Net/Analyser.py"
] | [
"import os\nimport numpy as np\nfrom tqdm import tqdm\nimport scipy\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport skimage\nfrom skimage.transform import resize\nfrom sklearn.metrics import confusion_matrix\nimport cv2\nfrom mlxtend.plotting import plot_confusion_matrix\nimport keras\nfrom keras.u... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.asarray",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.argmax",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
ThunderBurster/MDAM | [
"4dfad758d47c5b7cd8f2636becd69dea6bdb1f70"
] | [
"run.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport json\nimport pprint as pp\nimport time\n\nimport torch\nimport torch.optim as optim\nfrom tensorboard_logger import Logger as TbLogger\n\n\nfrom options import get_options\nfrom train import train_epoch, validate, get_inner_model\nfrom reinforce_baselines import NoBaselin... | [
[
"torch.device",
"torch.cuda.set_rng_state_all",
"torch.is_tensor",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.set_rng_state",
"torch.optim.lr_scheduler.LambdaLR",
"torch.nn.DataParallel"
]
] |
kawaremu/H4ckT0b3rF3st-2k20 | [
"a5f253822806fe9d31a77659cea6b5f216258fd1"
] | [
"projects/AutoBadMeme/ABM.py"
] | [
"# -*- coding: utf-8 -*-\n\n'''\nWellcome to AutoBadMeme, the first and only bad meme generator\n'''\n\n#Task one : put the bare minimum to load an image and write text on it. DONE\n\n#Task two : make the image getter read random images from one directory.Done\n\n#Task three : find the position where you write the ... | [
[
"numpy.random.randint"
]
] |
RaMdsC/evalys | [
"d2693a25209b0f547276259b10e42c24bf04c142"
] | [
"evalys/metrics.py"
] | [
"import pandas as pd\nfrom math import sqrt\n\n\ndef cumulative_waiting_time(dataframe):\n '''\n Compute the cumulative waiting time on the given dataframe\n\n :dataframe: a DataFrame that contains a \"starting_time\" and a\n \"waiting_time\" column.\n '''\n # Avoid side effect\n df = pd.Da... | [
[
"pandas.DataFrame.copy",
"pandas.Series",
"pandas.concat"
]
] |
kanwatchara-k/r_lamol | [
"8fd90027989a853e36c268cb1b87368e9078b00b"
] | [
"train.py"
] | [
"import torch\nfrom torch.utils.data import DataLoader\nfrom torch import nn\nfrom pytorch_transformers import AdamW, WEIGHTS_NAME, WarmupLinearSchedule\nimport csv\nimport numpy as np\nimport os\nimport logging\nfrom fp16 import FP16_Module, FP16_Optimizer\nfrom parallel import DataParallelModel, DataParallelCrite... | [
[
"torch.no_grad",
"torch.nn.CrossEntropyLoss",
"torch.load",
"torch.ones"
]
] |
Enigma-li/Sketch2CAD | [
"fb863cad17343b0729bcab0177d125d110c56fa2"
] | [
"networkTraining/utils/util_funcs.py"
] | [
"#\n# Project Sketch2CAD\n#\n# Author: Changjian Li (chjili2011@gmail.com),\n# Copyright (c) 2019. All Rights Reserved.\n#\n# ==============================================================================\n\"\"\"Network training utils.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import di... | [
[
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.gfile.Exists",
"tensorflow.gfile.MakeDirs",
"tensorflow.gfile.DeleteRecursively",
"tensorflow.name_scope",
"tensorflow.slice"
]
] |
erekgit/parlai | [
"5d11848316b0b4fe7bf28ca19b215a37004ec668"
] | [
"parlai/core/torch_generator_agent.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\n\"\"\"\nGeneric PyTorch-based Generator agent.\n\nImplements quite a bit of boilerplate, including forced-d... | [
[
"torch.zeros",
"torch.cat",
"torch.arange",
"torch.nn.parallel.DistributedDataParallel",
"torch.softmax",
"torch.nn.functional.log_softmax",
"torch.ones",
"torch.multinomial",
"torch.LongTensor",
"torch.index_select",
"torch.Tensor",
"torch.nn.CrossEntropyLoss",
... |
looselycoupled/partisan-discourse | [
"8579924094c92e25e21ce59a26232269cf6b34bc"
] | [
"corpus/learn.py"
] | [
"# corpus.learn\n# Machine learning for the corpus with Scikit-Learn.\n#\n# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>\n# Created: Mon Jul 25 17:23:50 2016 -0400\n#\n# Copyright (C) 2016 District Data Labs\n# For license information, see LICENSE.txt\n#\n# ID: learn.py [3100e46] benjamin@bengfort.... | [
[
"sklearn.metrics.precision_recall_fscore_support",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.model_selection.KFold",
"sklearn.decomposition.TruncatedSVD",
"sklearn.feature_extraction.DictVectorizer"
]
] |
ZZWENG/SimCLR | [
"d2cee6e0c6d7ed4d12d5c6e3c05e75d0a18ff97b"
] | [
"clustering/hkmeans_utils.py"
] | [
"import numpy as np\n\ndef norm(x, axis=None):\n return np.linalg.norm(x, axis=axis)\n\n#-------------------------\n#----- Poincaré Disk -----\n#-------------------------\n\n# NOTE: POSSIBLE ISSUE WITH DIFFERENT WAYS TO SPECIFY MINKOWSKI DOT PRODUCT\n# arbritray sign gives different signatures (+, +, +, -), (+, ... | [
[
"numpy.sin",
"numpy.linalg.norm",
"numpy.isnan",
"numpy.dot",
"numpy.zeros",
"numpy.arccosh",
"numpy.random.uniform",
"numpy.sqrt",
"numpy.cos"
]
] |
parkermac/LiveOcean | [
"bef3e1e729ada1069853dd4f57f79f452b54f4fa"
] | [
"x_tef2/flux_get_vol.py"
] | [
"\"\"\"\nFind the volume of each flux segment\n\"\"\"\n\n# imports\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pickle\nimport pandas as pd\nimport netCDF4 as nc\n\nimport os; import sys\nsys.path.append(os.path.abspath('../alpha'))\nimport Lfun\nLdir = Lfun.Lstart(gridname='cas6', tag='v3')\nimport... | [
[
"numpy.zeros",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.ma.masked_where"
]
] |
adanyaev/medical-app | [
"f59b0171f98180364f1b95dc96600c3e7f16f6a5"
] | [
"med/management/commands/parseExcel.py"
] | [
"\n# settings.configure()\n# import os\n# import django\n# os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"mysite.settings\")\n# django.setup()\n\n\n# from . import models\nimport email\nimport pandas\nfrom datetime import time\nimport random\n\nfrom django.core.management.base import BaseCommand\nfrom django.c... | [
[
"pandas.to_datetime",
"pandas.read_csv",
"pandas.isna",
"pandas.read_excel"
]
] |
ajtritt/nwb-api-python | [
"927ac74e1f84b694bd034774bb21aa1ff16b303f"
] | [
"examples/create_scripts/abstract_feature.py"
] | [
"#!/usr/bin/python\nimport sys\nimport numpy as np\nfrom nwb import nwb_file\nfrom nwb import nwb_utils as ut\n\n\"\"\" \nStore the Salient Features of a Drifting Gratings Visual Stimulus\n\nThis example demonstrates how to use an AbstractFeatureSeries to store\ndata that can be summarized by certain high-level fea... | [
[
"numpy.arange"
]
] |
DWesl/basemap | [
"8e9a37e09a65b16429b699f7c12fcab754e1a85a"
] | [
"packages/basemap/doc/users/figures/vandg.py"
] | [
"from mpl_toolkits.basemap import Basemap\nimport numpy as np\nimport matplotlib.pyplot as plt\n# lon_0 is central longitude of projection.\n# resolution = 'c' means use crude resolution coastlines.\nm = Basemap(projection='vandg',lon_0=0,resolution='c')\nm.drawcoastlines()\nm.fillcontinents(color='coral',lake_colo... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.title",
"numpy.arange"
]
] |
LaerkeDIKU/lbscTomo | [
"a23b2b23243196f7b150a2b842e5adbe1d25aee5"
] | [
"lib/dataread3d_lib.py"
] | [
"import math\r\nfrom skimage.transform import rotate\r\nfrom skimage.draw import random_shapes\r\nimport numpy as np\r\nimport scipy.io\r\nimport scipy.misc\r\nimport re\r\n\r\ndef clean_str(str):\r\n str = re.sub('f32', '', str)\r\n str = re.sub('i32', '', str)\r\n str = re.sub('\\[', '', str)\r\n str ... | [
[
"numpy.fromstring"
]
] |
Lukaslong/pytorch-ssd | [
"e35c12f1de795f5cd8c2a5198cab8f66d771d282"
] | [
"vision/ssd/config/mobilenetv2_ssd_config.py"
] | [
"import numpy as np\n\nfrom vision.utils.box_utils import SSDSpec, SSDBoxSizes, generate_ssd_priors\n\n\nimage_size = 300\nimage_mean = np.array([127, 127, 127]) # RGB layout\nimage_std = 128.0\niou_threshold = 0.45\ncenter_variance = 0.1\nsize_variance = 0.2\n\nspecs = [\n SSDSpec(38, 8, SSDBoxSizes(30, 60), [... | [
[
"numpy.array"
]
] |
WilliamAshbee/gan | [
"ab75e87681b9113d3af8df8a3cd97bf3bd69c6ac"
] | [
"catalyst_gan/nn/criterion/bce_gan.py"
] | [
"import torch\nfrom torch import nn\n\n\n# BCE losses\n\n\nclass BCELossGenerator(nn.BCEWithLogitsLoss):\n\n def __init__(self, target=1.0, **kwargs):\n assert 0 <= target <= 1\n self.target = target\n super().__init__(**kwargs)\n\n def forward(self, fake_logits):\n target = self.t... | [
[
"torch.ones_like"
]
] |
prashjha/BayesForSEIRD | [
"b2faa46f73bbca1bbce8705f4a9b91a223ec6d12"
] | [
"Model/seird/seird_problem.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport dolfin as dl\nimport numpy as np\nfrom picard_solver import picard_solver\nfrom seird_forms import seird_forms\n\nSTATE = 0\nPARAMETER = 1\n\nclass seird_fwd_problem:\n def __init__(self, Vh, simulation_time, dt, init_vectors, subdmn_pat... | [
[
"numpy.empty"
]
] |
mtcrawshaw/NMT-Hyperparameters | [
"b9f71c9f5e1ab8de2dfea6496a39138fcdf24bb9"
] | [
"onmt/models/model_saver.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\n\nfrom collections import deque\nfrom onmt.utils.logging import logger\n\nfrom copy import deepcopy\n\n\ndef build_model_saver(model_opt, opt, model, fields, optim):\n model_saver = ModelSaver(opt.save_model,\n model,\n ... | [
[
"torch.save"
]
] |
iclavera/cassie | [
"f2e253bf29fa0f872974188aed1fdfbe06efc37e"
] | [
"softlearning/environments/cassie/new_cassie_env.py"
] | [
"from softlearning.environments.cassie.assets.cassiemujoco import CassieSim, CassieVis, cassie_user_in_t\nimport numpy as np\nfrom gym import utils\nfrom gym import spaces\nimport gym\n\n\n# CASSIE_TORQUE_LIMITS = np.array([4.5*25, 4.5*25, 12.2*16, 12.2*16, 0.9*50]) # ctrl_limit * gear_ratio\n# CASSIE_MOTOR_VEL_LIM... | [
[
"numpy.concatenate",
"numpy.square",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.ones",
"numpy.exp",
"numpy.clip"
]
] |
renjunxiang/enjoy_myself | [
"6a4a48afd2ab234a71d1794a808f5f29bb040f94"
] | [
"chatbot/net/seq2seq.py"
] | [
"from keras.models import Model\nfrom keras.layers import Input, Embedding, GRU, Bidirectional, Dense, \\\n RepeatVector, Masking, concatenate, Reshape, TimeDistributed\nfrom keras.optimizers import SGD, Adagrad, Adam\n\n\ndef seq2seq(input_dic_len=10,\n input_len=10,\n vector_len=20,\n ... | [
[
"numpy.argmax"
]
] |
mrcsfltchr/MaskFastRCNN4GUVs | [
"0ac10832c71d481b9390b9b86f7304af82d05f52"
] | [
"frcnn/visualize.py"
] | [
"\"\"\"\nMask R-CNN\nDisplay and Visualization Functions.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport random\nimport itertools\nimport colorsys\n\nimport numpy as np\nfrom skimage.measure import ... | [
[
"numpy.random.choice",
"numpy.random.rand",
"numpy.where",
"matplotlib.patches.Rectangle",
"numpy.concatenate",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.lines.Line2... |
kentwait/bioseq | [
"4f0649639ea1f301d2947cc5aff4d1a4fd55529c"
] | [
"bioseq/arrays.py"
] | [
"from .basetypes import *\nimport os\nimport numpy as np\nimport re\nfrom collections.abc import MutableMapping\nfrom collections import OrderedDict, Counter\nimport collections\nfrom copy import deepcopy\nfrom scipy.sparse import lil_matrix\nimport pandas as pd\n\n__all__ = ['SEQTYPES', 'validate_sequence_chars',\... | [
[
"numpy.concatenate",
"numpy.delete",
"numpy.array",
"numpy.random.choice",
"numpy.any",
"pandas.concat",
"numpy.all",
"numpy.unique"
]
] |
ArthurBook/TDLearning | [
"f9f6187eb8ebe043b31fcc6439ff90bc2eb81196"
] | [
"tests/call_options_varying_num_steps3.py"
] | [
"import numpy as np\r\nimport pandas as pd\r\n\r\nimport tensorflow as tf\r\nfrom tensorflow import keras\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom StochasticProcesses import Stochastic_Processes\r\nfrom Payoffs import Payoffs\r\n\r\nfrom TD_net_v4 import TD_net, td_metrics\r\n\r\n#%%\r\n\r\ndef input_creation... | [
[
"numpy.concatenate",
"tensorflow.keras.optimizers.SGD",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.sqrt",
"numpy.hstack",
"numpy.linspace",
"numpy.vstack",
"numpy.maximum"
]
] |
toluwajosh/Pointnet_Pointnet2_pytorch | [
"82a37be460a004fb7e300d2f11a395916d539391"
] | [
"train_semseg.py"
] | [
"\"\"\"\nAuthor: Benny\nDate: Nov 2019\n\"\"\"\nimport argparse\nimport os\nfrom data_utils.S3DISDataLoader import S3DISDataset, S3DISDatasetWholeScene\nimport torch\nimport datetime\nimport logging\nfrom pathlib import Path\nimport sys\nimport importlib\nimport shutil\nfrom tqdm import tqdm\nimport provider\nimpor... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"torch.nn.init.constant_",
"numpy.sum",
"torch.save",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.nn.init.xavier_normal_",
"torch.Tensor"
]
] |
blsymens/Bioindustrial-Park | [
"196e2d60ec9bf0466ef804d036c995b89bc72f72"
] | [
"BioSTEAM 1.x.x/build/lib/biorefineries/cornstover/_plot_uncertainty_top.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 13 21:44:23 2019\n\n@author: yoelr\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Patch\nfrom matplotlib.lines import Line2D\nfrom biosteam import colors\nfrom biosteam.evaluation.evaluation_too... | [
[
"numpy.array",
"matplotlib.pyplot.text",
"matplotlib.pyplot.xlim",
"pandas.read_excel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.sca",
"matplotlib.pyplot.yticks",
"numpy.arange",
"matplotlib.pyplot.hlines",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplots_adj... |
Gwiths/seeking-the-shape-of-sound | [
"c9a7c68c66459f86e4885ba0b9a0d4a397510c0f"
] | [
"models/nn/ir_se_model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn import Linear, Conv2d, BatchNorm1d, BatchNorm2d, PReLU, ReLU, Sigmoid, Dropout, MaxPool2d, \\\n AdaptiveAvgPool2d, Sequential, Module\nfrom collections import namedtuple\n\n\n# Support: ['IR_50', 'IR_101', 'IR_152', 'IR_SE_50', 'IR_SE_101', 'IR_SE_152']\n\n\ncl... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.div",
"torch.nn.Sigmoid",
"torch.norm",
"torch.nn.Sequential",
"torch.nn.MaxPool2d",
"torch.nn.init.xavier_uniform_",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.PReLU",
"torch.nn.BatchNorm1... |
lambda-xmu/reinforcement-learning | [
"2a4c5d148fe003a3d87ace8bbcd2954df4dea47f"
] | [
"Morvan_example/Sarsa/RL_brain.py"
] | [
"\"\"\"\nThis part of code is the Q learning brain, which is a brain of the agent.\nAll decisions are made in here.\nView more on my tutorial page: https://morvanzhou.github.io/tutorials/\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\n\nclass RL(object):\n def __init__(self, action_space, learning_rate=0.... | [
[
"numpy.max",
"pandas.DataFrame",
"numpy.random.rand",
"numpy.random.choice"
]
] |
danassutula/biomech-inverse | [
"4ee415f181e815085660dfe722bd861c99da0cd9"
] | [
"examples/human_skin/bimaterial/data/reactionforce.py"
] | [
"\"\"\"\nObtain reaction forces and displacements measurements.\n\"\"\"\n\nimport os\nimport scipy\nimport numpy as np\nimport scipy.optimize\nimport scipy.interpolate\nimport matplotlib.pyplot as plt\n\nfrom examples.utility import apply_mean_filter\n\n\nCURRENT_DIRECTORY = os.path.dirname(os.path.relpath(__file__... | [
[
"numpy.array",
"numpy.ones",
"matplotlib.pyplot.close",
"matplotlib.pyplot.interactive",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
jaak21/hummingbot | [
"f075f7ffaa3aea8773005af94c72f3264f398ea0"
] | [
"hummingbot/client/command/balance_command.py"
] | [
"from hummingbot.client.settings import (\n GLOBAL_CONFIG_PATH,\n ethereum_required_trading_pairs\n)\nfrom hummingbot.user.user_balances import UserBalances\nfrom hummingbot.core.utils.async_utils import safe_ensure_future\nfrom hummingbot.client.config.global_config_map import global_config_map\nfrom humming... | [
[
"pandas.DataFrame"
]
] |
AnHongjun001/YOLOv1-pytorch | [
"4b0e189698d21a16fbd89ee4427097347a5202df"
] | [
"yolo/utils/dataset/transfrom/vdict2yolo.py"
] | [
"\"\"\"\nThis file is under Apache License 2.0, see more details at https://www.apache.org/licenses/LICENSE-2.0\nAuthor: Coder.AN, contact at an.hongjun@foxmail.com\nGithub: https://github.com/BestAnHongjun/YOLOv1-pytorch\n\"\"\"\n\nimport cv2\nimport torch\n\n\nclass vdict2yolo_v1:\n \"\"\"\n A transform whi... | [
[
"torch.zeros",
"torch.tensor"
]
] |
XuankangLin/DiffAbs | [
"b17176464b80b368fa9a87f507e07b1d631ce6ef"
] | [
"diffabs/interval.py"
] | [
"\"\"\" Implement the Vanilla Interval domain based on PyTorch.\n Vanilla Interval: Simply propagates using interval arithmetic without any optimization.\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom pathlib import Path\nfrom typing import Tuple, Union, Iterator, Callable, Iterable\n\nimport torch\nfrom ... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.stack",
"torch.min",
"torch.max",
"torch.nn.Tanh",
"torch.clamp",
"torch.nn.ReLU",
"torch.nn.functional.relu"
]
] |
inidun/unesco_data_collection | [
"6157883ea391f370d350eaaed038dfde6ad7a8fe"
] | [
"courier/elements/export_articles.py"
] | [
"# pylint: disable=redefined-outer-name\nimport os\nimport re\nfrom pathlib import Path\nfrom typing import Any, Dict, List, Union\n\nimport pandas as pd\nfrom loguru import logger\n\nfrom courier.article_index import article_index_to_csv\nfrom courier.config import get_config\nfrom courier.elements.assign_page_ser... | [
[
"pandas.DataFrame"
]
] |
FlyingFordAnglia/Scrabble | [
"47887c7780c81a66b8b4c6f82ca2c50d645b075c"
] | [
"code/savegame.py"
] | [
"# Save game to and load game from file\nimport numpy as np\n\n\ndef savegame(board, racks, players, turn, filename='savegame.sv'):\n # create header for the active racks, player scores, players names, and the active turn\n racks = list(map(lambda x: ''.join(x), racks)) # for each rack, make it into a single... | [
[
"numpy.array",
"numpy.savetxt"
]
] |
jwarley/hcpi | [
"c2f9b305fd21cd2e5cb375acc5b4f8d445432a66"
] | [
"tests/cartpole.py"
] | [
"from policies import FourierPolicy\nfrom agents import FCHC\nimport gym\nimport numpy as np\nimport csv\n\n# Create the environment\nenv = gym.make('CartPole-v0')\n\n# Specify how to normalize the states.\ndef cp_normalize(obs):\n \"\"\" Normalize the features of a cartpole state state observation to the interv... | [
[
"numpy.array",
"numpy.exp"
]
] |
Vinit-source/SubmodularStreamingMaximization | [
"d61de27549c7cf02103e35cdc6d4ec26991ebba0"
] | [
"experiments/examiner/init.py"
] | [
"import spacy\nimport csv\nimport numpy as np\nimport tqdm\n\ndef examiner():\n # https://www.kaggle.com/therohk/examine-the-examiner/\n data = csv.DictReader(open(\"data/examiner-date-text.csv\", \"r\"), delimiter=\",\", dialect=\"excel\")\n nlp = spacy.load(\"en_core_web_lg\")\n dataset = []\n date... | [
[
"numpy.array",
"numpy.save"
]
] |
ph10m/coref | [
"88152e6bf63b5b8f9a0d7146f4235a2ce6b55e43"
] | [
"tollef_dataclean.py"
] | [
"from bert import tokenization\nimport json\nimport sys\nimport os\nimport json\n\nimport tensorflow as tf\nimport util\n\nfilename = \"none\"\n\ntext = [\n\"Firefly is an American space Western drama television series which ran from 2002-2003, created by writer and director Joss Whedon, under his Mutant Enemy Prod... | [
[
"tensorflow.Session"
]
] |
Je-Ba/Wind-farm-wake-control-using-convolutional-neural-networks | [
"4b1accaa262961d78bc82fc28ed9273f6f5a5a63"
] | [
"CNNWake/train_CNN.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import TensorDataset, DataLoader\nfrom torch.optim import lr_scheduler\nfrom .CNN_model import Generator\n\n\n__author__ = \"Jens Bauer\"\n__copyright__ = \"Copyright 2021, CNNwake\"\n__credits_... | [
[
"torch.nn.MSELoss",
"torch.cuda.is_available",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.show"
]
] |
datastreaming/skyline-1 | [
"b02de2f40f8deb6ed1fddd0eace5b19a9b59d0de"
] | [
"skyline/webapp/luminosity_plot_cloudburst.py"
] | [
"import logging\nimport os\nimport traceback\n\nimport pandas as pd\nfrom sqlalchemy.sql import select\nfrom adtk.visualization import plot\n\nimport settings\nfrom functions.database.queries.get_cloudburst_row import get_cloudburst_row\nfrom functions.graphite.get_metrics_timeseries import get_metrics_timeseries\n... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.DatetimeIndex"
]
] |
illinois-ceesd/mirgecom | [
"6ae28905dbb9d073a9f778111d12b10e474fe799"
] | [
"examples/autoignition-mpi.py"
] | [
"\"\"\"Demonstrate combustive mixture with Pyrometheus.\"\"\"\n\n__copyright__ = \"\"\"\nCopyright (C) 2020 University of Illinois Board of Trustees\n\"\"\"\n\n__license__ = \"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the... | [
[
"numpy.abs",
"numpy.zeros"
]
] |
danielbom/codewars | [
"d45b5a813c6f1d952a50d22f0b2fcea4ef3d0e27"
] | [
"Python/7 - kyu/7 kyu - Sum of odd numbers.py"
] | [
"# https://www.codewars.com/kata/sum-of-odd-numbers/train/python\r\n# My solution\r\ndef row_sum_odd_numbers(n):\r\n return n**3\r\n\r\n# ...\r\nrow_sum_odd_numbers=(3).__rpow__\r\n\r\n# ...\r\nimport numpy as np\r\ndef row_sum_odd_numbers(n):\r\n return sum(np.linspace(n**2-(n-1),(n**2+n-1),n))"
] | [
[
"numpy.linspace"
]
] |
severilov/BCI-thesis | [
"18ffe5e72ba65150026d5d66c744e59589492535"
] | [
"code/train_fc.py"
] | [
"import os\nimport pickle\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\nfrom torch import nn\nfrom torch.utils.data import DataLoader\nfrom datetime import datetime\n\nfrom models.fc_nn import BaselineNN\nfrom dataset.base_dataset import SimulateDataset\nfrom visualization import plot_loss\n\nTRAIN_DATA... | [
[
"torch.nn.MSELoss",
"numpy.array",
"torch.utils.data.DataLoader",
"torch.from_numpy"
]
] |
cattale93/pytorch_self_supervised_learning | [
"162c26446837a7c0ffd2679b3fb54ba01f204123"
] | [
"Lib/Nets/utils/generic/trainSN.py"
] | [
"import os\nfrom torch.utils.tensorboard import SummaryWriter\nfrom Lib.Nets.SN.SN import SN\nfrom Lib.Nets.utils.config.config_routine import config_routine\nfrom Lib.Nets.utils.config.general_parser import general_parser\nfrom Lib.Nets.utils.config.specific_parser import specific_parser\nfrom Lib.Datasets.EUSAR.E... | [
[
"torch.utils.data.DataLoader"
]
] |
amrrs/scikit-lego | [
"e4304a67ac114259259b688fe94aa64f22933245"
] | [
"sklego/meta.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn import clone\nfrom sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin, MetaEstimatorMixin\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.utils.multiclass import unique_labels\nfrom sklearn.utils.validation import check_is_fitted, ... | [
[
"pandas.isnull",
"numpy.isinf",
"numpy.array",
"sklearn.utils.validation.check_is_fitted",
"sklearn.utils.validation.check_X_y",
"sklearn.utils.multiclass.unique_labels",
"sklearn.utils.validation.check_array",
"pandas.DataFrame",
"sklearn.clone",
"numpy.ones",
"numpy.w... |
Iamgoofball/VocoderComparisons | [
"3dfc5cb604ccf3756321e2cdf9934aa933314145"
] | [
"repos/hifi-gan/models.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nfrom torch.nn import Conv1d, ConvTranspose1d, AvgPool1d, Conv2d\nfrom torch.nn.utils import weight_norm, remove_weight_norm, spectral_norm\nfrom utils import init_weights, get_padding\n\nLRELU_SLOPE = 0.1\n\n\nclass ResBlock1(torch.nn.Module):\n... | [
[
"torch.nn.AvgPool1d",
"torch.flatten",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.nn.utils.remove_weight_norm",
"torch.nn.ConvTranspose1d",
"torch.abs",
"torch.nn.Conv2d",
"torch.tanh",
"torch.nn.functional.pad",
"torch.mean",
"torch.nn.functional.leaky_relu"
... |
Data-Designer/Informer2020 | [
"03ac6f51a11fe1af5caeabcbc0b96340c66b7fe3"
] | [
"models/model.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom utils.masking import TriangularCausalMask, ProbMask\r\nfrom models.encoder import Encoder, EncoderLayer, ConvLayer, EncoderStack\r\nfrom models.decoder import Decoder, DecoderLayer\r\nfrom models.attn import FullAttention, ProbAtt... | [
[
"torch.nn.Linear",
"torch.device",
"torch.nn.LayerNorm"
]
] |
alperyeg/spiking_GANs | [
"9249093db043c0b41eb1e935dd09f5d415307ca5"
] | [
"src/STP_generation.py"
] | [
"# -*- coding: utf-8 -*-\nimport stocmod as stoc\nimport quantities as pq\nimport time\nimport numpy as np\nimport neo\nimport random\n\nt0 = time.time()\n\n\ndef generate_stp(occurr, xi, t_stop, delays, t_start=0 * pq.s):\n '''\n Generate a spatio-temporal-pattern (STP). One pattern consists in a\n repeat... | [
[
"numpy.zeros",
"numpy.ones",
"numpy.any",
"numpy.random.uniform",
"numpy.all",
"numpy.linspace"
]
] |
davidmashburn/mtm_stats | [
"6808d37c84716b41a356eab75189d3e4ffc98451"
] | [
"mtm_stats/mtm_stats.py"
] | [
"'''The main script'''\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom builtins import range\nfrom future.utils import viewitems\n\n# To update with any Cython changes, just run:\n# python setup.py build_ext --inplace\n\nimport numpy as np\nfrom ... | [
[
"numpy.uint64",
"numpy.empty"
]
] |
ngonhan2k5/cs253-bdt | [
"2b916bf9e45bba8061819d663b17d72c9ab0ea3b"
] | [
"proj/plot/testplot.py"
] | [
"import random\nfrom itertools import count\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib.animation import FuncAnimation\n\n\nimport happybase\nCONNECTION = happybase.Connection('127.0.0.1', 9090)\nCONNECTION.open()\nprint(CONNECTION.tables())\n\ntable = CONNECTION.table('plot')\n\nplt.styl... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
cuihantao/Andes | [
"6cdc057986c4a8382194ef440b6e92b8dfb77e25"
] | [
"andes/models/shunt/shuntsw.py"
] | [
"\"\"\"\nSwitched shunt model.\n\"\"\"\n\nimport ast\nfrom collections import OrderedDict\n\nimport numpy as np\n\nfrom andes.core import NumParam, ConstService\nfrom andes.core.discrete import ShuntAdjust\nfrom andes.core.service import SwBlock\nfrom andes.models.shunt.shunt import ShuntData, ShuntModel\n\n\nclass... | [
[
"numpy.array",
"numpy.isnan",
"numpy.array2string"
]
] |
t-wojciech/LightGBM | [
"d90a16d520fa12d84ecd983fba323727348616a4"
] | [
"python-package/lightgbm/plotting.py"
] | [
"# coding: utf-8\n\"\"\"Plotting library.\"\"\"\nimport warnings\nfrom copy import deepcopy\nfrom io import BytesIO\n\nimport numpy as np\n\nfrom .basic import Booster\nfrom .compat import MATPLOTLIB_INSTALLED, GRAPHVIZ_INSTALLED\nfrom .sklearn import LGBMModel\n\n\ndef _check_not_tuple_of_2_elements(obj, obj_name=... | [
[
"numpy.count_nonzero",
"matplotlib.image.imread",
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.subplots"
]
] |
lahdjirayhan/scikit-lego | [
"5dd145df796c4d254cd505727c9db01484ebc39c"
] | [
"sklego/meta/grouped_transformer.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom sklearn.base import BaseEstimator, TransformerMixin, clone\nfrom sklearn.utils.validation import check_is_fitted\n\nfrom ._grouped_utils import _split_groups_and_values\n\n\nclass GroupedTransformer(BaseEstimator, TransformerMixin):\n \"\"\"\n Construct a trans... | [
[
"pandas.DataFrame",
"sklearn.base.clone",
"sklearn.utils.validation.check_is_fitted"
]
] |
janisoteps/imsim1 | [
"e0f7ec186ac5bbca9d4a453f8147dc525642e6da"
] | [
"vgg16jd.py"
] | [
"# -*- coding: utf-8 -*-\n'''VGG16 model for Keras.\n\n# Reference:\n\n- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)\n\n'''\nfrom __future__ import print_function\n\nimport numpy as np\nimport warnings\n\nfrom keras.models import Model\nfrom keras.layers imp... | [
[
"numpy.expand_dims"
]
] |
wannaphong/HoogBERTa | [
"36ef588314c2c1934a652eb330e88a612ce151ee"
] | [
"hoogberta/trainer/models/multitask_tagger.py"
] | [
"from ..utils import build_dataloader\r\nfrom . import register_model\r\n\r\nimport time\r\nimport torch.nn as nn\r\nfrom torch.nn import ModuleList\r\nimport torch\r\n\r\nfrom fairseq.data.dictionary import Dictionary\r\nfrom fairseq.data.data_utils import collate_tokens\r\nfrom fairseq.models.roberta import Rober... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.init.constant",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.normal_",
"torch.nn.init.xavier_normal_"
]
] |
osgirl/chs-s111 | [
"a88a3de20868d0a0884498fffe3c1a1ea106bd12"
] | [
"scripts/s111_add_irregular_grid.py"
] | [
"#******************************************************************************\n#\n#******************************************************************************\nimport argparse\nimport h5py\nimport numpy\nimport iso8601\nimport pytz\nimport netCDF4\nimport math\n\nms2Knots = 1.943844\n\n#**********************... | [
[
"numpy.empty"
]
] |
neuroevolution-ai/NeuroEvolution-CTRNN_new | [
"23fedf85f9344c7bb6b926c4582cc6064e387c0a"
] | [
"tests/test_i_layered_brain.py"
] | [
"import pytest\nfrom attr import s\nimport numpy as np\nfrom gym import Space\nfrom gym.spaces import Box\n\nfrom brains.i_layer_based_brain import ILayerBasedBrain, LayerdConfigClass\nfrom tools.configurations import ILayerBasedBrainCfg\n\n\n@s(auto_attribs=True, frozen=True, slots=True)\nclass BrainParam:\n we... | [
[
"numpy.array",
"numpy.dot",
"numpy.array_equal",
"numpy.zeros",
"numpy.allclose"
]
] |
FMsunyh/keras-retinanet | [
"cb86a987237d3f6bd504004e2b186cf65606c890"
] | [
"keras_retinanet/utils/image.py"
] | [
"\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la... | [
[
"numpy.moveaxis"
]
] |
Columbine21/THUIAR-ERC | [
"90e928e1ce777152e459dbc487acf04c32cbc645"
] | [
"TextCnn/train_iemocap.py"
] | [
"from tqdm import tqdm\nimport pandas as pd\nimport numpy as np, argparse, time, pickle, random, os, datetime\n\nimport torch\n\nimport torch.optim as optim\nfrom model import MaskedNLLLoss, CnnModel\nfrom dataloader import IEMOCAPDataLoader\n\n\nfrom sklearn.metrics import f1_score, confusion_matrix, accuracy_scor... | [
[
"numpy.concatenate",
"numpy.array",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"numpy.argmin",
"numpy.random.seed",
"numpy.sum",
"torch.FloatTensor",
"sklearn.metrics.accuracy_score",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.argmax",
"... |
varenius/salsa | [
"2ddb4c34943d85aecebdef8745cc64c2daa4b8bb"
] | [
"Developer_notes/Beam_measurements/Beam_2014-10-03/single.py"
] | [
"import matplotlib.pyplot as plt\nfrom scipy.optimize import curve_fit\nimport numpy as np\n# The offset values in Az given to the telescope. Note that \n# This does not necesarily mean that the telescope was pointing in this \n# direction, since it might not move if the difference is too small.\nxdata = [\n-20,\n-... | [
[
"numpy.array",
"scipy.optimize.curve_fit",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.exp",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
zjjlivein/continuous_integration | [
"c8825f32136fdd425389702c37ded08d6fd28a26"
] | [
"framework_api/test_static_optimizer.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"
]
] |
Benjamin-Fouquet/dynMRI | [
"c80b48cee834e2042e95241701ce064c22e3d3d1"
] | [
"AnkleSegmentation/TestReconstruction.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 16 10:35:20 2020\n\n@author: p20coupe\n\"\"\"\n\nimport argparse\nimport sys\n\nimport joblib\nimport numpy as np\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport os\nimport math\nimport statistics\n\nim... | [
[
"matplotlib.use",
"torch.device",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.shape",
"torch.cuda.is_available",
"numpy.sort",
"torch.utils.data.DataLoader",
"torch.load",
"numpy.moveaxis",
"torch.Tensor",
"matplotlib.pyplot.subplot"
]
] |
hoyeon94/CartoonGAN-Tensorflow | [
"e30086bbfb63be49744569b037eda3babe3e60e1"
] | [
"edge_smooth.py"
] | [
"from utils import check_folder\nimport numpy as np\nimport cv2, os, argparse\nfrom glob import glob\nfrom tqdm import tqdm\n\ndef parse_args():\n desc = \"Edge smoothed\"\n parser = argparse.ArgumentParser(description=desc)\n parser.add_argument('--dataset', type=str, default='hw', help='dataset_name')\n ... | [
[
"numpy.pad",
"numpy.sum",
"numpy.copy",
"numpy.ones",
"numpy.multiply",
"numpy.where"
]
] |
cnedwards/lottery-ticket-hypothesis | [
"e2eb64638183b75dc689feb4b745810a2e3e1c8b"
] | [
"lottery_ticket/foundations/save_restore.py"
] | [
"# Copyright (C) 2018 Google Inc.\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 or agreed ... | [
[
"numpy.array",
"tensorflow.io.gfile.Exists",
"numpy.load",
"numpy.save",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.ListDirectory",
"tensorflow.compat.v1.gfile.DeleteRecursively"
]
] |
christophanneser/Bao-for-Presto | [
"b1d93689025d51cdea1a2e81edb8f077df8afcc1"
] | [
"tree_conv/test/test_utils.py"
] | [
"import unittest\nimport numpy as np\nfrom util import prepare_trees, TreeConvolutionError\n\n\nclass TestUtils(unittest.TestCase):\n\n def test_prepare(self):\n # simple smoke test from the example file\n tree1 = (\n (0, 1),\n ((1, 2), ((0, 1),), ((-1, 0),)),\n ((-... | [
[
"numpy.array"
]
] |
pittwolfe/pyqg | [
"3a4b8b0a53dc0204a437376ffdcb981568edb111"
] | [
"setup.py"
] | [
"from setuptools import setup, Extension\nfrom Cython.Build import cythonize\nimport warnings\nimport numpy as np\nimport os\nimport tempfile, subprocess, shutil\nimport versioneer\n\n\nDISTNAME='pyqg'\nURL='http://github.com/pyqg/pyqg'\nAUTHOR='pyqg team'\nAUTHOR_EMAIL='pyqg-dev@googlegroups.com'\nLICENSE='MIT'\n\... | [
[
"numpy.get_include"
]
] |
Daniel1586/Initiative_tensorflow_tutorials | [
"5f1299696e3851d621cc260ae46cda853e56c2b0"
] | [
"lecture_morvan/013_tf_rnn_classification.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n# 通过tf.set_random_seed设定种子数,后面定义的全部变量都可以跨会话生成相同的随机数\ntf.set_random_seed(1)\nnp.random.seed(1)\n\nprint('========== 1.Setting Hype... | [
[
"tensorflow.set_random_seed",
"tensorflow.local_variables_initializer",
"tensorflow.train.AdamOptimizer",
"numpy.random.seed",
"tensorflow.argmax",
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.Session",
"te... |
zlw21gxy/DRL | [
"a0852bbc51de29165d74f58ff86a4a4d9e68c83e"
] | [
"spinup/algos/vpg/core.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport scipy.signal\nfrom gym.spaces import Box, Discrete\n\nEPS = 1e-8\n\ndef combined_shape(length, shape=None):\n if shape is None:\n return (length,)\n return (length, shape) if np.isscalar(shape) else (length, *shape)\n\ndef placeholder(dim=None):\n ... | [
[
"tensorflow.exp",
"tensorflow.trainable_variables",
"tensorflow.shape",
"numpy.log",
"tensorflow.multinomial",
"numpy.ones",
"tensorflow.variable_scope",
"numpy.isscalar",
"tensorflow.reduce_sum",
"tensorflow.placeholder",
"tensorflow.layers.dense",
"tensorflow.one_... |
rth/pandas | [
"fd151ba5a873ecf6392897f722abfdfae915303e"
] | [
"pandas/core/reshape/tile.py"
] | [
"\"\"\"\nQuantilization functions and related stuff\n\"\"\"\nfrom typing import (\n Any,\n Callable,\n Literal,\n)\n\nimport numpy as np\n\nfrom pandas._libs import (\n Timedelta,\n Timestamp,\n)\nfrom pandas._libs.lib import infer_dtype\n\nfrom pandas.core.dtypes.common import (\n DT64NS_DTYPE,\n... | [
[
"pandas._libs.Timedelta",
"pandas.IntervalIndex.from_breaks",
"pandas.core.dtypes.common.is_datetime64_dtype",
"numpy.dtype",
"pandas.core.dtypes.missing.isna",
"pandas._libs.lib.infer_dtype",
"pandas.core.nanops.nanmin",
"numpy.putmask",
"pandas.core.dtypes.common.is_datetime6... |
Dr-Hemanth/CarND-Behavioral-Cloning | [
"9bf5079451ee99e5ff07c30f1611871bacbba4f4"
] | [
"model.py"
] | [
"import csv\nimport numpy as np\nimport cv2\nimport sklearn\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.utils import shuffle\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation, Flatten, Conv2D, Lambda, Dropout\nfrom keras.layers.convolutional import Cropping2D\n... | [
[
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"sklearn.utils.shuffle"
]
] |
stwind/datasets | [
"b097e0985eaaadc6b0c1f4dfa3b3cf88d116c607"
] | [
"tensorflow_datasets/image_classification/oxford_flowers102.py"
] | [
"# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"tensorflow.compat.v2.io.gfile.GFile"
]
] |
ouseful-backup/ggplot | [
"0f3774e6a645796b843d3ce77fb388958773338e"
] | [
"ggplot/stats/stat_smooth.py"
] | [
"from __future__ import (absolute_import, division, print_function,\n unicode_literals)\nimport numpy as np\nimport pandas as pd\n\nfrom ggplot.components import smoothers\nfrom ggplot.utils import make_iterable_ntimes\nfrom .stat import stat\n\n\nclass stat_smooth(stat):\n REQUIRED_AES = ... | [
[
"pandas.DataFrame"
]
] |
shaun95/espnet | [
"afa8f8ec5b8ec77deb1a3c1531915ebbee7b80e6"
] | [
"test/espnet2/bin/test_asr_inference.py"
] | [
"from argparse import ArgumentParser\nfrom pathlib import Path\nimport string\n\nimport numpy as np\nimport pytest\nimport yaml\n\nfrom espnet.nets.beam_search import Hypothesis\nfrom espnet2.bin.asr_inference import get_parser\nfrom espnet2.bin.asr_inference import main\nfrom espnet2.bin.asr_inference import Speec... | [
[
"numpy.random.randn"
]
] |
hudeven/pytext | [
"6e5ab16803be33bcb784b7fd79aa99935cfd12ec"
] | [
"pytext/exporters/test/text_model_exporter_test.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport json\nimport tempfile\nfrom collections import Counter\n\nimport caffe2.python.hypothesis_test_util as hu\nimport caffe2.python.predictor.predictor_exporter as pe\nimport hypothesis.strategies as st\nimport num... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.vectorize",
"numpy.random.randn",
"torch.nn.functional.log_softmax",
"numpy.random.randint",
"torch.tensor",
"torch.transpose"
]
] |
meetshah1995/model-server | [
"1533cbc9f9eb46f244c7b22d7b56c1b70b702f3b"
] | [
"examples/keras_image_classification/keras_image_classification.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom model_server import Servable\n\n\nclass InceptionV3Classifier(Servable):\n def __init__(self, args):\n print(\"Loading InceptionV3 from tf.keras\")\n self.model = tf.keras.applications.InceptionV3(include_top=True, weights=\"imagenet\")\n # ... | [
[
"tensorflow.keras.applications.InceptionV3",
"numpy.expand_dims"
]
] |
Orekisiori/ChatBot | [
"b6492470fd2b7dad893d67526e37c14112181ae2"
] | [
"generate_dialogue_subset.py"
] | [
"import argparse\nfrom os.path import join\nimport numpy as np\nfrom collections import Counter\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import MultipleLocator\n\n\ndef generate_subset():\n \"\"\"\n 用于生成训练子集\n :return:\n \"\"\"\n parser = argparse.ArgumentParser()\n parser.add_argu... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.MultipleLocator",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.gca"
]
] |
cuent/comp551 | [
"4463e4c0d2e7c161bc1575c63389c5893299233a"
] | [
"assignments/assignment4/src/models/model1.py"
] | [
"import torch\nimport torch.utils.data\nfrom torch import nn\nimport torch.nn.functional as F\n\n\nclass VAE(nn.Module):\n def __init__(self, h, n):\n super(VAE, self).__init__()\n self.img_size = 28 * 28\n\n self.h_encoder = nn.Linear(self.img_size, h)\n self.h_mu = nn.Linear(h, n)\n... | [
[
"torch.nn.Linear",
"torch.randn_like",
"torch.exp",
"torch.nn.functional.binary_cross_entropy",
"torch.pow"
]
] |
satyakisikdar/Attributed-VRG | [
"502375d6a62eb84563c2fb6786e2c257edc32e0c"
] | [
"VRG/src/graph_stats.py"
] | [
"\"\"\"\nContainer for different graph stats\n\"\"\"\nimport platform\nimport subprocess as sub\nimport sys\nfrom collections import Counter, deque\nfrom typing import Dict, Tuple, List, Any\n\nsys.path.extend(['./../', './../../'])\nprint('sys path: ', sys.path)\nimport editdistance as ed\nimport matplotlib.pyplot... | [
[
"numpy.fill_diagonal",
"numpy.matmul",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.mean",
"numpy.multiply",
"numpy.float_power",
"matplotlib.pyplot.ylabel",
"numpy.cumsum"
]
] |
verypluming/HELP | [
"216b6497978869718afe629266a672d2e9919326"
] | [
"scripts/create_dataset_PMB.py"
] | [
"\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# Copyright 2019 Hitomi Yanaka\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... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.Series"
]
] |
bioinsilico/LSTM_CONV2D_RRI | [
"77561adbcf3bdaa24d01c1da90c7ffb1011083b5"
] | [
"load_data.py"
] | [
"import subprocess\nimport numpy as np\nfrom aa_to_ch import *\nimport random\n\n\nr_features = dict()\nl_features = dict()\n\ndef create_data(r,l):\n R = [r]\n L = [l]\n dR = dict()\n dL = dict()\n\n dR[r] = 0\n for i in range( 0,len(r_features[r]['nn']) ):\n dR[ r_features[r]['nn'][i] ] = r_features[r]['... | [
[
"numpy.array"
]
] |
nicholasbao/nlp_job | [
"39fb8118c5f7c2674dc38cada86520c634104c6c"
] | [
"text_similarity_cnn/run_cnn.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport time\nfrom datetime import timedelta\n\nimport numpy as np\nimport tensorflow as tf\nfrom sklearn import metrics\n\nfrom cnn_model import TCNNConfig, TextCNN\nfrom data.cnews_loader import read_voca... | [
[
"sklearn.metrics.confusion_matrix",
"tensorflow.summary.scalar",
"tensorflow.Session",
"tensorflow.train.Saver",
"sklearn.metrics.classification_report",
"numpy.argmax",
"tensorflow.summary.merge_all",
"tensorflow.summary.FileWriter",
"tensorflow.global_variables_initializer"
... |
jareddk/triton | [
"ea03d6207728315312d9cb6fa014f6a394b79c71"
] | [
"python/triton/ops/blocksparse/matmul.py"
] | [
"import triton\nimport triton._C.libtriton as libtriton\nimport torch\nimport os\nimport math\n\nsrc = triton.read(os.path.join(os.path.dirname(__file__), 'matmul.c'))\n\n##############\n# MAIN API #\n##############\nclass _matmul(torch.autograd.Function):\n \n sdd_cache = dict()\n dsd_cache = dict()\n dds_ca... | [
[
"torch.zeros",
"torch.cat",
"torch.stack",
"torch.arange",
"torch.empty_like",
"torch.sum",
"torch.tensor",
"torch.ones_like",
"torch.zeros_like",
"torch.empty",
"torch.cumsum"
]
] |
changwoonchoi/nerf-pytorch | [
"ddf4f6224397a7326e2ae113df274f467087693b"
] | [
"src/dataset/dataset_clevr.py"
] | [
"from abc import ABC\n\nfrom torch.utils.data import Dataset\nimport os\nimport numpy as np\nimport json\nimport imageio\nimport torch\nfrom utils.label_utils import colored_mask_to_label_map_np\nfrom utils.math_utils import pose_spherical\n\nimport matplotlib.pyplot as plt\nfrom dataset.dataset_interface import Ne... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.tan",
"numpy.linspace"
]
] |
Cherry-pashka/SignClass | [
"13b0b7913b7f46788ecbbc59f5295ccb33ffbccc"
] | [
"pipeline/models.py"
] | [
"from typing import Optional\n\nimport torch\nimport torch.nn as nn\nfrom torchvision import models\n\nfrom constants import *\n\n\ndef get_resnet_152(device: str = DEVICE,\n ckpt_path: Optional[str] = None\n ) -> nn.Module:\n \"\"\"Returns the pretrained model resnet152 and i... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.load",
"torch.nn.ReLU"
]
] |
tsigalko18/transferability-testing-sdcs | [
"1294466e6cc0bb251a912a68ea88a8468611a12d"
] | [
"manage.py"
] | [
"#!/usr/bin/env python3\r\n\"\"\"\r\nScripts to drive a donkey 2 car\r\n\r\nUsage:\r\n manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical|rnn|imu|behavior|3d|localizer|latent)] [--useadversarial] [--advimage=<file>] [--camera=(single|stereo)] [--meta=<key:value> ...] [--myconfig=<filename>] [... | [
[
"tensorflow.python.keras.models.model_from_json"
]
] |
tanguy-magne/ritm_interactive_segmentation | [
"53e55253a1ff879f370525bdbddf026402a19ff9"
] | [
"inria-aerial-image-labeling/model.py"
] | [
"\"\"\"\nINCLUDE ONLY, DO NOT EXECUTE\n\"\"\"\nfrom settings import *\nimport numpy as np\nimport tensorflow as tf\nimport segmentation_models as sm\n\n\ndef create_model(border=False, trainable_encoder=False):\n if model_type == 'unet':\n model = sm.Unet(backbone_name=backbone,\n i... | [
[
"numpy.equal",
"numpy.minimum",
"numpy.clip",
"tensorflow.keras.metrics.binary_accuracy",
"tensorflow.keras.losses.binary_crossentropy",
"numpy.maximum"
]
] |
saethlin/unyt | [
"e25848166d8739a8ec0ba08b536fe7a81b37bee0"
] | [
"unyt/_physical_ratios.py"
] | [
"import numpy as np\n\n#\n# Physical Constants and Units Conversion Factors\n#\n# Values for these constants, unless otherwise noted, are drawn from IAU,\n# IUPAC, NIST, and NASA data, whichever is newer.\n# http://maia.usno.navy.mil/NSFA/IAU2009_consts.html\n# http://goldbook.iupac.org/list_goldbook_phys_constants... | [
[
"numpy.sqrt"
]
] |
rominashirazi/SpineSegmentation | [
"fb08122ac6d9a598b60aecb4f1a1a2a31fba96ab"
] | [
"segmentation_test/Scripts/medpy_split_xd_to_xminus1d.py"
] | [
"#!c:\\users\\hooma\\documents\\github\\spinesegmentation\\segmentation_test\\scripts\\python.exe\n\n\"\"\"\nSplits a XD into a number of (X-1)D volumes.\n\nCopyright (C) 2013 Oskar Maier\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as... | [
[
"scipy.squeeze"
]
] |
Pegasus-01/Data-manipulation-and-merging-with-pandas | [
"5346678d25820d9fe352bd70294484ecd96fccf7"
] | [
"02-Creating&VisualizingDataframes/05-FindingMissingValues.py"
] | [
"# Import matplotlib.pyplot with alias plt\r\nimport matplotlib.pyplot as plt\r\n\r\n# Check individual values for missing values\r\nprint(avocados_2016.isna())\r\n\r\n# Check each column for missing values\r\nprint(avocados_2016.isna().any())\r\n\r\n# Bar plot of missing values by variable\r\navocados_2016.isna().... | [
[
"matplotlib.pyplot.show"
]
] |
audeering/audformat | [
"a9ffce03e333e21a1ceb0db1d13e9f1fb5b61cca"
] | [
"audformat/core/database.py"
] | [
"import datetime\nimport itertools\nimport os\nimport shutil\nimport typing\n\nimport audiofile\nimport oyaml as yaml\ntry:\n from yaml import CLoader as Loader\nexcept ImportError: # pragma: nocover\n from yaml import Loader\nimport pandas as pd\n\nimport audeer\n\nfrom audformat.core import define\nfrom au... | [
[
"pandas.to_timedelta",
"pandas.Series"
]
] |
stungkit/StockRecommendSystem | [
"020ef035e5189415d01e767f3907751e01d5cefe"
] | [
"Source/StockProcessing/Filter_Stock_US.py"
] | [
"import sys, os, time, datetime, warnings, configparser\nimport pandas as pd\nimport numpy as np\nimport talib\nimport concurrent.futures\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\n\ncur_path = os.path.dirname(os.path.abspath(__file__))\nfor _ in range(2):\n root_path = cur_path[0:cur_path.rfind('/... | [
[
"pandas.to_datetime",
"numpy.array",
"numpy.zeros_like",
"pandas.set_option",
"numpy.diff"
]
] |
pchabets/chronicity-prediction-depression | [
"ba43009cc7213cab91376540393512282e5f9319"
] | [
"code/python/transcriptomics>2-y-chronicity_variance_based_feature_selection_VM.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport os\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\n# In[2]:\n\n\nos.chdir(\"/home/pchabets/Dropbox/STRESS_INDEX/\")\n\n\n# ### Load in transcriptomics data\n\n# In[3]:\n\n\nexpr_train = pd.read_csv(... | [
[
"pandas.read_csv",
"matplotlib.pyplot.figure"
]
] |
pradghos/cudf | [
"58316cb0c1303253f254b7247402ec0ed9bf357d"
] | [
"python/cudf/dataframe/dataframe.py"
] | [
"# Copyright (c) 2018, NVIDIA CORPORATION.\n\nfrom __future__ import print_function, division\n\nimport inspect\nimport random\nfrom collections import OrderedDict\nfrom collections.abc import Sequence, Mapping\nfrom copy import copy\nimport logging\nimport warnings\nimport numbers\n\nimport numpy as np\nimport pan... | [
[
"numpy.result_type",
"pandas.Index",
"pandas.core.dtypes.common._get_dtype_from_object",
"numpy.array",
"pandas.compat.isidentifier",
"pandas.DataFrame",
"pandas.core.indexing.IndexingError",
"numpy.isscalar",
"pandas.api.types.is_dict_like",
"pandas.api.types.is_categorica... |
GaelVaroquaux/scikit-learn-tutorial-1 | [
"c15a1fd2e27923e29b4749e098f68a150010e4b6"
] | [
"python_scripts/02_basic_preprocessing_exercise_01_solution.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# formats: python_scripts//py:percent,notebooks//ipynb\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.2'\n# jupytext_version: 1.2.4\n# kernelspec:\n# display_name: Python 3\n# language: python\n# ... | [
[
"pandas.read_csv",
"sklearn.dummy.DummyClassifier",
"sklearn.model_selection.cross_val_score"
]
] |
PaccMann/paccmann_sets | [
"ef5a9106df140c3261135c88d3d2668b516d93cc"
] | [
"paccmann_sets/models/set_matching/dnn.py"
] | [
"import torch\nimport torch.nn as nn\nfrom paccmann_sets.utils.hyperparameters import ACTIVATION_FN_FACTORY\n\n\nclass DNNSetMatching(nn.Module):\n \"\"\"Generalisable DNN module to allow for flexibility in architecture.\"\"\"\n\n def __init__(self, params: dict) -> None:\n \"\"\"Constructor.\n\n ... | [
[
"torch.nn.Sequential",
"torch.nn.Linear"
]
] |
mpelchat04/geo-deep-learning | [
"87d01b0dac05ed03103d838f5c234b711940759b"
] | [
"evaluate_segmentation.py"
] | [
"import time\nfrom collections import defaultdict\nfrom pathlib import Path\nfrom typing import Sequence\n\nimport numpy as np\nimport pandas as pd\nimport rasterio\nfrom hydra.utils import get_original_cwd\nfrom mlflow import log_metrics\nfrom shapely.geometry import Polygon\nfrom tqdm import tqdm\nimport geopanda... | [
[
"numpy.count_nonzero",
"numpy.unique",
"pandas.concat"
]
] |
DiegoArcelli/De-Stylization-Network | [
"b74d4175c6dd4fad12871e6fe9cde1761803a469"
] | [
"ibn.py"
] | [
"import math\nimport warnings\n\nimport torch\nimport torch.nn as nn\nfrom adaptive_instance_normalization import AdaptiveInstanceNormalization\nfrom destylization_module import DeStylizationModule\nfrom normalization import AdaIN\nfrom torch.nn import Linear\nfrom sequential import DestylerSequential\n\n\nclass IB... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.split",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d"
]
] |
lxuechen/private-transformers | [
"99c74dfdf7cc0c03d261ec1e942d77f8a19190fb"
] | [
"examples/classification/common.py"
] | [
"import torch\n\ntask_name2suffix_name = {\"sst-2\": \"GLUE-SST-2\", \"mnli\": \"MNLI\", \"qqp\": \"QQP\", \"qnli\": \"QNLI\"}\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n"
] | [
[
"torch.cuda.is_available"
]
] |
leowangzi/LightHeadRCNN | [
"2135707d63e519b517ec7690a6383a0a51083430"
] | [
"lib/model/faster_rcnn/xception_like.py"
] | [
"\"\"\" \r\nCreates an Xception-like Model as defined in:\r\nZeming Li, Chao Peng, Gang Yu, Xiangyu Zhang, Yangdong Deng, Jian Sun\r\nLight-Head R-CNN: In Defense of Two-Stage Object Detector\r\nhttps://arxiv.org/pdf/1711.07264.pdf\r\nREMEMBER to set your image size to 3x224x224 for both test and validation\r\nnorm... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.load"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.