repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
devineniraghava/Ventilation_Efficiency_2 | [
"3918d5335e3d7df0492088a05acfd9d9c7958a20"
] | [
"results_plot.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Nov 5 15:32:00 2020\n\n@author: Devineni\n\"\"\"\n\nimport pandas as pd\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\nfrom uncertainties import ufloat_fromstr\nfrom uncertainties import ufloat\n\nimport xlrd\n\nimpor... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"pandas.read_excel",
"numpy.linspace",
"matplotlib.pyplot.ylim",
"matplotlib.lines.Line2D",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"mat... |
levozavr/finance-ml | [
"efc23e664821861fa03bb91fc94448b6fb14636e"
] | [
"ml_model/vector_model_mnist.py"
] | [
"from keras.datasets import mnist\nfrom keras.models import Model\nfrom keras.layers import Input, Dense\nfrom PreProcessors.csv_pre_processor_vector import PreProcessor\nimport matplotlib.pyplot as plt\n\n\nbatch_size = 200\nnum_epochs = 200\nhidden_size = 512\n\nPP = PreProcessor('../index/avg_index.csv')\nPP.sta... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
tbenthompson/BIE_book | [
"dcbbd7f0777ebf4a35d70737643e67138d9d684b"
] | [
"tectosaur2/hmatrix/toy_aca.py"
] | [
"import numpy as np\n\n\ndef ACA_plus(\n n_rows,\n n_cols,\n calc_rows,\n calc_cols,\n eps,\n row_dim=3,\n col_dim=3,\n max_iter=None,\n verbose=False,\n Iref0=None,\n Jref0=None,\n):\n \"\"\"\n Run the ACA+ plus algorithm on a matrix implicitly defined by the\n row and col... | [
[
"numpy.abs",
"numpy.min",
"numpy.cumsum",
"numpy.argmax",
"numpy.linalg.qr",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.random.randint"
]
] |
Lucas-BLP/ScriptProfilerPy | [
"21a243629bb4f13e1b39e87a509bc9677df82694"
] | [
"example_testfile_STP_test.py"
] | [
"import pandas as pd\n\nfrom datetime import datetime\nimport shutil\nfrom speed_testpy import ScriptProfilerPy\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import LinearLocator\nspeed_test_restime = []\nspeed_test_lines = []\nspeedtest_startimefile = datetime.now()\nglobal speedtest_startime\nspeedtest... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.barh",
"numpy.random.randn",
"pandas.date_range",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
amazon-picking-challenge/team_pfn | [
"2f76524b067d816d8407f6c4fae4e6d33939c024"
] | [
"script/coord_transformer.py"
] | [
"#!/usr/bin/env python\n\n# Copyright 2016 Preferred Networks, 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... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
patrick-ubc/Huawei_HiFly_Drone | [
"5dae1b56f49c2b86c3b852bbc5e3a63e84ccd490"
] | [
"ros_atlas/handProcessor.py"
] | [
"import sys\nimport time\nimport numpy as np\nimport rospy\n\nsys.path.append(\"lib/\")\n\nfrom core.BasePostprocessor import Postprocessor\nfrom cv_bridge import CvBridge, CvBridgeError\nfrom rospy.exceptions import ROSException, ROSSerializationException, ROSInterruptException\n\nclass HandPostprocessNode(Postpro... | [
[
"numpy.array"
]
] |
misaka3/generativemagic | [
"58f24a9fd95c94828281ed6c1267d570ee7c7b10"
] | [
"generativemagic/effects/simple_effects.py"
] | [
"import numpy as np\n\nfrom generativemagic.effect import Effect, DECK_TOP\n\n\nclass InjectAt(Effect):\n \"\"\"Injects a chosen cards at the top or bottom of the deck.\n This is a simple palming or putting the deck on top of the chosen cards.\n\n Why does it not allow to put anywhere? Because this is a si... | [
[
"numpy.insert"
]
] |
crazydemo/Progressive-Multi-stage-Feature-Mix-for-Person-Re-Identification | [
"e451c30ee5ac8dffa0f043f06cf26d2992a89294"
] | [
"models/progressive_networks.py"
] | [
"# encoding: utf-8\nimport copy\nimport itertools\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\nimport random\nfrom scipy.spatial.distance import cdist\nfrom sklearn.preprocessing import normalize\nfrom torch import nn, optim\nfrom torch.utils.data ... | [
[
"torch.cat",
"numpy.max",
"torch.cuda.is_available",
"torch.split",
"torch.utils.model_zoo.load_url",
"torch.nn.AdaptiveMaxPool2d",
"torch.nn.Dropout",
"numpy.uint8",
"torch.tensor",
"torch.nn.Sigmoid",
"torch.nn.functional.relu",
"torch.nn.Sequential",
"torch.n... |
rangsimanketkaew/sGDML | [
"3f06e0de33462afdfaecb310ac2d4e073b6ed2cf"
] | [
"sgdml/cli.py"
] | [
"#!/usr/bin/python\n\n# MIT License\n#\n# Copyright (c) 2018-2021 Stefan Chmiela\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation ... | [
[
"numpy.sqrt",
"numpy.einsum",
"numpy.squeeze",
"numpy.concatenate",
"numpy.max",
"numpy.mean",
"torch.cuda.is_available",
"numpy.var",
"numpy.hstack",
"numpy.asscalar",
"numpy.arange",
"numpy.load",
"numpy.random.choice",
"numpy.isnan",
"numpy.min",
... |
whitemike889/glow | [
"1c36392512a98f2b7d28e36c9eb7d9ccdc8e489c"
] | [
"torch_glow/tests/functionality/to_glow_selective_test.py"
] | [
"# isort:skip_file\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport unittest\n\nimport torch_glow\nimport torch\n\n\nclass Qux(torch.nn.Module):\n def __init__(self, x):\n super(Qux, self).__init__()\n self.x = x\n\n def forward(self, a, b):\n ... | [
[
"torch.jit.trace",
"torch.zeros",
"torch.classes.glow.GlowCompileSpec",
"torch.allclose",
"torch.classes.glow.SpecInputMeta"
]
] |
atiselsts/tensorflow | [
"8d746f768196a2434d112e98fc26c99590986d73"
] | [
"tensorflow/python/keras/distribute/dataset_creator_model_fit_test.py"
] | [
"# Lint as: python3\n# Copyright 2021 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... | [
[
"tensorflow.python.compat.v2_compat.enable_v2_behavior",
"tensorflow.python.framework.config.list_physical_devices",
"tensorflow.python.platform.gfile.ListDirectory",
"tensorflow.python.keras.metrics.Accuracy",
"tensorflow.python.keras.optimizer_v2.gradient_descent.SGD",
"tensorflow.python... |
miruetoto/miruetoto.github.io | [
"42392e34e89c761ed2116d0aaf3e5736a6109a64"
] | [
"source/pybase.py"
] | [
"#1. import useful python packages \nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt \nfrom matplotlib.pyplot import plot \nfrom matplotlib.pyplot import imshow\n\n#2. python system \nimport warnings\nwarnings.filterwarnings(action='ignore')\n\n\n#3. rpy2 \nimport rpy2\nimport rpy2.robjects... | [
[
"numpy.matrix",
"numpy.hstack",
"numpy.arange",
"numpy.full",
"numpy.asmatrix",
"numpy.prod",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.vstack"
]
] |
Naagar/BigGANs_seeds | [
"91e2cca7e889338aad888e16f5f7c6a62e8526ab"
] | [
"utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n''' Utilities file\nThis file contains utility functions for bookkeeping, logging, and data loading.\nMethods which directly affect training should either go in layers, the model,\nor train_fns.py.\n'''\n\nfrom __future__ import print_function\nimport sys\nimport o... | [
[
"torch.randint",
"torch.zeros",
"torch.randperm",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.no_grad",
"numpy.random.randint",
"torch.norm",
"torch.randn",
"torch.eye",
"torch.arange",
"torch.DoubleTensor",
"torch.linspace",
"torch.stack",
"numpy... |
gabriel-vanzandycke/experimentator | [
"e733e03930fc45ad62dfbf3f85cb9babfd078585"
] | [
"experimentator/tf1_chunk_processors.py"
] | [
"import tensorflow as tf\n\nclass ChunkProcessor():\n # graph property should be set in the framework specific experiment\n graph = None\n\nclass DoNothing(ChunkProcessor):\n def __call__(self, chunk):\n pass\n\nclass UnSparsify(ChunkProcessor):\n def __call__(self, chunk):\n for name in c... | [
[
"tensorflow.losses.mean_squared_error",
"tensorflow.nn.softmax",
"tensorflow.nn.sigmoid",
"tensorflow.reduce_max",
"tensorflow.sparse.to_dense",
"tensorflow.reduce_mean",
"tensorflow.losses.sigmoid_cross_entropy",
"tensorflow.identity",
"tensorflow.expand_dims",
"tensorflow... |
stevenwchien/csml-iw-rrp | [
"ad95afd614997bb39a1b8822dbe997886f18407b"
] | [
"test_model.py"
] | [
"from transformers import BertForSequenceClassification, BertTokenizer\nfrom transformers import DistilBertTokenizer, DistilBertForSequenceClassification\nimport torch\nimport numpy as np\nimport pandas as pd\nfrom sklearn import metrics\nfrom torch.utils.data import SequentialSampler, DataLoader\nfrom logger impor... | [
[
"pandas.crosstab",
"pandas.read_csv",
"numpy.abs",
"torch.utils.data.SequentialSampler",
"numpy.stack",
"pandas.DataFrame",
"torch.cuda.is_available",
"sklearn.metrics.classification_report"
]
] |
EIDOSlab/SeReNe | [
"d553078de6d2ae000cabd4f288ce65ea42a8224c"
] | [
"src/utilities/pruning/thresholding/plateau_scheduler.py"
] | [
"from copy import deepcopy\nfrom math import inf, isnan\n\nimport torch\n\n\nclass Scheduler(object):\n \"\"\"\n Identifies a plateau in the classificaiton loss, based on `torch.optim.lr_scheduler.ReduceLROnPlateau`.\n \"\"\"\n\n def __init__(self, model, pwe):\n \"\"\"\n :param model: PyT... | [
[
"torch.no_grad"
]
] |
emay2022/fraplib | [
"9c580ea6c9405bcf2dbf50cdbf66e39bfbad0b06"
] | [
"fraplib/_falsecolor.py"
] | [
"import numpy as np\nfrom matplotlib import cm\nfrom matplotlib import pyplot as plt\nfrom matplotlib.colors import LinearSegmentedColormap, ListedColormap\n\n\ndef make_colormap(rgb):\n \"\"\"\n creates a new color map from black to white through the specified RGB color\n\n Parameters\n ----------\n ... | [
[
"matplotlib.pyplot.imshow",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"numpy.ones",
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.axis",
"matplotlib.cm.get_cmap"
]
] |
jvahala/ping-pong-ranker | [
"eda814e9dc1fd1798ff45645a9a2387d1c145ba1"
] | [
"py-modules/utils.py"
] | [
"import numpy as np \n\ndef softmax(x,rescale_=False): \n\tif rescale_: \n\t\tx_ = rescale(x)\n\telse: \n\t\tx_ = x\n\texpx = np.exp(-1.0*np.array(x_))\t\t#take exponential of the -x(i) values in x \n\ttotal = np.sum(expx)\t#for use in the denominator\n\treturn expx/float(total)\n\ndef rescale(x,max_=10):\n\tx_scal... | [
[
"numpy.array",
"numpy.sum"
]
] |
zbchern/Neural-Relational-Topic-Models | [
"49e57a56039e1c5af10d5774cc220f87bb46269a"
] | [
"main_cora.py"
] | [
"import tensorflow as tf\nimport utils\nimport os\nimport logging\nimport models\nimport vae\n\nutils.set_best_gpu()\n\nflags = tf.app.flags\n\n# model training settings\nflags.DEFINE_integer('batch_size', 128, 'training batch size')\nflags.DEFINE_float('init_lr_pretrain', 0.01, 'initial learning rate for pre-train... | [
[
"tensorflow.app.run"
]
] |
Prausome/nmf_python- | [
"a931b664a6b076941cdf1de31965f1eaf7e1e632"
] | [
"nonnegfac/nmf.py"
] | [
"import numpy as np\nimport scipy.sparse as sps\nimport scipy.optimize as opt\nimport numpy.linalg as nla\nimport nonnegfac.matrix_utils as mu\nimport time\nimport json\nfrom numpy import random\nfrom nonnegfac.nnls import nnlsm_activeset\nfrom nonnegfac.nnls import nnlsm_blockpivot\n\n\nclass NMF_Base(object):\n\n... | [
[
"scipy.io.mmio.mmwrite",
"numpy.minimum",
"numpy.sqrt",
"numpy.linalg.matrix_rank",
"numpy.cumsum",
"numpy.all",
"numpy.where",
"numpy.square",
"numpy.linalg.svd",
"scipy.sparse.issparse",
"numpy.unique",
"numpy.arange",
"numpy.size",
"numpy.zeros",
"sci... |
jeyong/AirSim | [
"1fd6a3fc311c704bbbb0b2b6b245e8fa0ba26c8b"
] | [
"PythonClient/computer_vision/create_ir_segmentation_map.py"
] | [
"import numpy\nimport cv2\nimport time\nimport sys\nimport os\nimport random\nfrom airsim import *\n\ndef radiance(absoluteTemperature, emissivity, dx=0.01, response=None):\n \"\"\"\n title::\n radiance\n\n description::\n Calculates radiance and integrated radiance over a bandpass of 8 to 14... | [
[
"numpy.arange",
"numpy.load",
"numpy.array",
"numpy.exp",
"numpy.where",
"numpy.trapz"
]
] |
jmenges/yolov1_maxim | [
"299d0d52edf3aec961b3b9c72cdd590352d26beb"
] | [
"loss_plot.py"
] | [
"import re\n\ndef extract_value(fname, regex_str, strloc, endloc):\n f = open(fname, 'r')\n str_buf = f.read()\n\n regex = re.compile(regex_str)\n\n str_list = regex.findall(str_buf)\n print(str_list)\n data_list = []\n for item in str_list:\n # data_list.append(float(item[7:]))\n ... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
AlexMGitHub/TheWholeEnchilada | [
"9b488777ab2e82d616b952457b45acf6b7eb7c69",
"9b488777ab2e82d616b952457b45acf6b7eb7c69"
] | [
"src/bokeh_server/results/plots/regression_results.py",
"src/bokeh_server/train/twe_learn/train_model.py"
] | [
"\"\"\"Display classification results of trained model.\n\nResults:\n - actual_vs_pred: Scatter plot of predicted values vs. actual values\n\n - resid_hist: Histogram of regression residuals\n\n - resid_vs_pred_plot: Return plot containing residuals versus predictions\n\"\"\"\n\n# %% Imports\n# Stand... | [
[
"sklearn.metrics.mean_absolute_error",
"numpy.histogram",
"sklearn.metrics.r2_score",
"sklearn.metrics.mean_squared_error"
],
[
"sklearn.preprocessing.StandardScaler",
"sklearn.model_selection.GridSearchCV",
"sklearn.model_selection.train_test_split",
"sklearn.pipeline.Pipeline... |
trajkova-elena/scikit-multiflow | [
"dd372c677a97346a9c60cd25b45b350e0fd83d3c"
] | [
"tests/meta/test_multi_output_learner.py"
] | [
"from skmultiflow.data.generator.multilabel_generator import MultilabelGenerator\nfrom skmultiflow.data.generator.regression_generator import RegressionGenerator\nfrom skmultiflow.meta.multi_output_learner import MultiOutputLearner\nfrom skmultiflow.metrics.measure_collection import hamming_score\nfrom sklearn.line... | [
[
"numpy.array_equal",
"sklearn.linear_model.SGDRegressor",
"sklearn.metrics.mean_absolute_error",
"sklearn.set_config",
"sklearn.linear_model.SGDClassifier",
"numpy.isclose"
]
] |
ccen-stripe/tflite-support | [
"a92abc7eb8bd08c1fb8b26fecf394e0f8fcf3654"
] | [
"tensorflow_lite_support/custom_ops/kernel/ngrams_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.lite.python.interpreter.InterpreterWithCustomOps",
"tensorflow.ragged.constant",
"tensorflow.test.main",
"tensorflow.lite.python.interpreter.Interpreter",
"tensorflow.function",
"tensorflow.lite.TFLiteConverter.from_saved_model",
"tensorflow.TensorSpec"
]
] |
KGJsGit/my_Optimization-studio | [
"1f3f78c22c58017f439c7be8b716a233be872ccc",
"1f3f78c22c58017f439c7be8b716a233be872ccc"
] | [
"code/CS/cps2.py",
"code/GA/GA_TSP.py"
] | [
"import numpy as np\r\nimport pandas as pd\r\nimport random as rd\r\n\r\npd.set_option('display.expand_frame_repr', False) # DataFrame 출력시 짤림 해결\r\npd.set_option('display.max_rows', 400)\r\npd.set_option('display.max_columns', 200)\r\npd.set_option('display.width', 1000)\r\n\r\nclass Machine :\r\n # ['Set', job,... | [
[
"pandas.set_option"
],
[
"numpy.argsort",
"numpy.delete",
"numpy.array",
"numpy.vstack"
]
] |
mmaher22/Instance-based-smoothing | [
"a6aaed2d26d828f59bbc2ae10a9bd6ad83528ecc"
] | [
"Instance-based Smoothing in Neural Networks/Instance-based-smoothing.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport gc\nimport copy\nimport torch\nimport pickle\nimport random\nimport argparse\nimport torchvision\nimport numpy as np\nimport pandas as pd\nimport torch.nn as nn\nfrom PIL import Image\nimport torch.optim as optim\nfrom netcal.metrics import ECE\nimport torch.nn.functional... | [
[
"torch.optim.lr_scheduler.MultiStepLR",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"numpy.random.seed",
"torch.nn.functional.log_softmax",
"numpy.amin",
"torch.load",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.utils.data.sampler.SubsetRandomSampler",
"numpy.rand... |
MAYURGAIKWAD/meshrcnn | [
"b47ecd47ca7de7055b7d141e63ddab286c5245f3",
"b47ecd47ca7de7055b7d141e63ddab286c5245f3"
] | [
"shapenet/modeling/mesh_arch.py",
"shapenet/utils/binvox_torch.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport torch\nimport torch.nn as nn\nfrom detectron2.utils.registry import Registry\nfrom pytorch3d.ops import cubify\nfrom pytorch3d.structures import Meshes\nfrom pytorch3d.utils import ico_sphere\n\nfrom shapenet.modeling.backbone import bu... | [
[
"torch.randn",
"torch.tensor"
],
[
"torch.stack",
"torch.cat",
"torch.arange",
"torch.tensor"
]
] |
joseppinilla/networkx | [
"c034a899070774f70119c0d73207411db7db90b6"
] | [
"networkx/algorithms/similarity.py"
] | [
"\"\"\" Functions measuring similarity using graph edit distance.\n\nThe graph edit distance is the number of edge/node changes needed\nto make two graphs isomorphic.\n\nThe default algorithm/implementation is sub-optimal for some graphs.\nThe problem of finding the exact Graph Edit Distance (GED) is NP-hard\nso it... | [
[
"numpy.log",
"numpy.log2",
"numpy.allclose",
"numpy.random.choice",
"numpy.eye",
"numpy.copy",
"numpy.fill_diagonal",
"numpy.argpartition",
"numpy.argsort",
"scipy.optimize.linear_sum_assignment",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.random.ra... |
Mike030668/Python--learning--UII | [
"4b0a3fe32b1bb4e6f98130aab09b3ab55eca2df4"
] | [
"Lesson _8/lesson_8_light.py"
] | [
"import time\nimport numpy as np\n\n\n# декоратор\ndef split_sings(f):\n def checker(*args, **kwargs):\n start = time.time()\n data_t = f(*args, **kwargs)\n print(f'время до декоратора {data_t[1]}')\n plus = list(filter(lambda x: x > 0, data_t[0]))\n minus = list(filter(lambda ... | [
[
"numpy.arange",
"numpy.random.gumbel",
"numpy.random.standard_normal"
]
] |
nitantrajput/project-111 | [
"bf99036974b9c7bd3e7e470608f869e005d58053"
] | [
"main.py"
] | [
"import plotly.figure_factory as ff\nimport plotly.graph_objects as go\nimport statistics\nimport random\nimport pandas as pd\nimport csv\n\ndf = pd.read_csv(\"z-test-master\\studentMarks.csv\")\ndata = df[\"Math_score\"].tolist()\n\n#plotting the graph\nfig = ff.create_distplot([data],[\"Math Scores\"], show_hist=... | [
[
"pandas.read_csv"
]
] |
rclapp/optimus-py | [
"178e6638169a551ed3d92d47ca86bae99ec7a85e"
] | [
"results.py"
] | [
"import itertools\nimport logging\nimport os\nimport statistics\nfrom pathlib import WindowsPath\nfrom typing import List, Union\n\nimport seaborn as sns; sns.set_theme()\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nSEPARATOR = \",\"\nHEADER = [\"ID\", \"Mode\", \"Is Best\", \"Mean Query Time\", \"Query... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.figure"
]
] |
ianovski/google-play-store-nlp | [
"afdfe5517bbf30e02f3e3ba80e9267fd574d7ee7"
] | [
"src/local_run/train.py"
] | [
"import time\nimport random\nimport pandas as pd\nfrom glob import glob\nimport argparse\nimport json\nimport subprocess\nimport sys\nimport os\nimport tensorflow as tf\nfrom transformers import DistilBertTokenizer\nfrom transformers import TFDistilBertForSequenceClassification\nfrom transformers import TextClassif... | [
[
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.data.TFRecordDataset",
"tensorflow.io.parse_single_example",
"tensorflow.io.FixedLenFeature",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.keras.metrics.SparseCategoricalAc... |
Danielaleite/Nextrout | [
"a513c5320e7f3c3a7ff61cade863dea075913af1"
] | [
"nextrout_core/main.py"
] | [
"#### import the needed stuff\nimport dmk_cont\nimport pre_extraction\nimport filtering\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport matplotlib.tri as mtri\nimport numpy as np\nimport pickle as pkl\nimport os\n\n\n\ndef nextrout(\n forcing_flag,\n extra_info,\n beta_c,\n beta_d = 1,... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
]
] |
hoostus/prime-harvesting | [
"6606b94ea7859fbf217dbea4ace856e3fa4d154e"
] | [
"market.py"
] | [
"from decimal import Decimal\nimport itertools\nimport pandas\nimport collections\nfrom adt import AnnualChange\nimport random\n\ndef namedtuple_with_defaults(typename, field_names, default_values=()):\n T = collections.namedtuple(typename, field_names)\n T.__new__.__defaults__ = (None,) * len(T._fields)\n ... | [
[
"pandas.read_stata",
"pandas.read_csv"
]
] |
Summer0328/Landuse_DL | [
"4a3c46979678a089065a02b595022668e60adc50"
] | [
"multiArea_test/analyze_dataAug_results.py"
] | [
"#!/usr/bin/env python\n# Filename: analyze_dataAug_results \n\"\"\"\nintroduction:\n\nauthors: Huang Lingcao\nemail:huanglingcao@gmail.com\nadd time: 29 March, 2021\n\"\"\"\n\nimport os, sys\ncode_dir = os.path.expanduser('~/codes/PycharmProjects/Landuse_DL')\nsys.path.insert(0, code_dir)\nimport basic_src.io_func... | [
[
"pandas.read_excel",
"pandas.DataFrame",
"pandas.ExcelWriter"
]
] |
mehrdad-shokri/tvm | [
"86d5de6a166922d1422d24d252d9190f94a32176"
] | [
"topi/tests/python/test_topi_reduce.py"
] | [
"\"\"\"Test code for reduce.\"\"\"\nimport os\nimport numpy as np\nimport tvm\nimport topi\n\ndef _my_npy_argmax(arr, axis, keepdims):\n if not keepdims:\n return arr.argmax(axis=axis)\n else:\n if axis is not None:\n out_shape = list(arr.shape)\n out_shape[axis] = 1\n ... | [
[
"numpy.random.uniform",
"numpy.exp"
]
] |
Wanggcong/SolutionSimilarityLearning | [
"26279b61686b3c34745c369b2cc4175c71c55403"
] | [
"models/rnn.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nfrom torch.autograd import Variable\r\n\r\n\r\nclass RNN(nn.Module):\r\n def __init__(self, input_size, hidden_size, output_size, num_layers=2):\r\n super(RNN, self).__init__()\r\n self.hidden_size = hidden_size\r\n self.num_layers = num_layers\r\n ... | [
[
"torch.nn.GRU",
"torch.nn.Linear",
"torch.nn.LogSoftmax",
"torch.zeros"
]
] |
shubhambhokare1/vision | [
"2fe0c2d0b2108440ec5efbf297d48cf26d0d8624"
] | [
"torchvision/prototype/transforms/_augment.py"
] | [
"import math\nimport numbers\nimport warnings\nfrom typing import Any, Dict, Tuple\n\nimport torch\nfrom torchvision.prototype.transforms import Transform, functional as F\n\nfrom ._utils import query_image\n\n\nclass RandomErasing(Transform):\n _DISPATCHER = F.erase\n\n def __init__(\n self,\n ... | [
[
"torch.randint",
"torch.empty",
"torch.tensor",
"torch.rand",
"torch.clamp"
]
] |
colfrog/deepsnek-py | [
"6731f91e2b65fa7f09b624c21017a10f64a07cc9"
] | [
"dqn_agent.py"
] | [
"import random\nimport math\nfrom collections import deque, namedtuple\nfrom tensorflow import keras\nimport numpy as np\n\ndef max_index(array):\n\tmaxval = None\n\tmaxindex = 0\n\tfor i in range(len(array)):\n\t\ttry:\n\t\t\ttest = iter(array[i])\n\t\t\t_, val = max_index(array[i])\n\t\texcept TypeError:\n\t\t\tv... | [
[
"tensorflow.keras.models.clone_model"
]
] |
hassan11196/Torch-TensorRT | [
"a2d0d0e935bf223523a7c28d7814cdbd32f323b2",
"a2d0d0e935bf223523a7c28d7814cdbd32f323b2"
] | [
"py/torch_tensorrt/fx/test/converters/acc_op/test_any.py",
"py/torch_tensorrt/fx/tracer/acc_tracer/acc_ops.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch_tensorrt.fx.tracer.acc_tracer.acc_ops as acc_ops\nfrom parameterized import parameterized\nfrom torch.testing._internal.common_fx2trt import AccTestCase\nfrom torch.testing._internal.common_utils import run_tests\n\n\nclass TestAnyConverters(AccTestCase):\n @par... | [
[
"torch.any",
"torch.randn",
"torch.testing._internal.common_utils.run_tests"
],
[
"torch.fmod",
"torch.nn.quantized.functional.conv2d",
"torch.max",
"torch.sin",
"torch.neg",
"torch.numel",
"torch.acos",
"torch.where",
"torch.topk",
"torch.ops.quantized.embe... |
filiparag/petnica-2018-fpga-image-filter | [
"fe05e8205c23a14d6ed101bdc7a523146dfd492c"
] | [
"Software/PriorityDecoder.py"
] | [
"#! /usr/bin/env python3\n\nimport numpy as np\nimport converter as convert\n\ndef arch_priority_decoder(in_write, in_value):\n\n out_values = np.zeros([256], dtype=np.uint8)\n\n if in_write:\n for value in range(256):\n if convert.bin_to_num(in_value) <= value:\n out_values[v... | [
[
"numpy.zeros"
]
] |
NSLS-II/databroker | [
"a2a5d6600ecf75efdd1c70cb67a0ebe2a1584bbd"
] | [
"databroker/mongo_normalized.py"
] | [
"import builtins\nimport collections\nimport collections.abc\nimport copy\nfrom datetime import datetime, timedelta\nimport functools\nimport itertools\nimport json\nimport logging\nimport os\nimport sys\nimport threading\n\nfrom bson.objectid import ObjectId, InvalidId\nimport cachetools\nimport entrypoints\nimpor... | [
[
"numpy.product",
"numpy.pad",
"numpy.asarray",
"numpy.stack",
"numpy.dtype",
"numpy.array"
]
] |
BayesianSCA/k-trace-CCA | [
"8dbf10ff28712848dcb8874e370c3fe40a0566a0"
] | [
"python/full_attack.py"
] | [
"#!/usr/bin/env python3\nimport sys\nimport os\nimport math\nimport random\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport itertools\nimport traceback\nfrom multiprocessing import cpu_count\n\nsys.path.append('lib/')\n\nfrom helpers.experiment import Experiment\nfrom helpers.params i... | [
[
"numpy.random.default_rng"
]
] |
pmla/hyperspherical-coverings | [
"5c9130c5dd0043d0a658712c5256c8588a384f02"
] | [
"regular_simplex.py"
] | [
"import numpy as np\nimport scipy.special\n\n\ndef ei(t):\n return np.exp(1j * t)\n\n\ndef verify_solution(t, z0):\n\n sol = (ei(3*t) + z0)**4 / ((1 - z0) * (ei(4*t) - z0)**3)\n\n if abs(np.real(sol) - 1.0) > 1E-3:\n raise Exception(\"real part not 1\")\n if abs(np.imag(sol)) > 1E-3:\n rai... | [
[
"numpy.imag",
"numpy.sqrt",
"numpy.cos",
"numpy.sin",
"numpy.real",
"numpy.angle",
"numpy.exp"
]
] |
jayanthchandra/nilearn | [
"d8b6f3121f4663914c65c10ae8d2c2bc513a89ba"
] | [
"examples/plot_decoding_tutorial.py"
] | [
"\"\"\"\nA introduction tutorial to fMRI decoding\n==========================================\n\nHere is a simple tutorial on decoding with nilearn. It reproduces the\nHaxby 2001 study on a face vs cat discrimination task in a mask of the\nventral stream.\n\nThis tutorial is meant as an introduction to the various ... | [
[
"pandas.read_csv",
"sklearn.model_selection.KFold",
"sklearn.model_selection.LeaveOneGroupOut"
]
] |
qiang55/codes | [
"f50daf56fe67db0e5341436a828d37d05e1630e7"
] | [
"mosfit/modules/seds/sed.py"
] | [
"\"\"\"Definitions for the `SED` class.\"\"\"\nimport numpy as np\nfrom astropy import constants as c\nfrom astropy import units as u\n\nfrom mosfit.modules.module import Module\n\n\n# Important: Only define one ``Module`` class per file.\n\n\nclass SED(Module):\n \"\"\"Template class for SED Modules.\n\n Mod... | [
[
"numpy.array"
]
] |
S4NdeeP/sat-tensorflow | [
"cdc237b2bed24afc655af06b6e9570c557311af7"
] | [
"core/model.py"
] | [
"# =========================================================================================\n# Implementation of \"Show, Attend and Tell: Neural Caption Generator With Visual Attention\".\n# There are some notations.\n# N is batch size.\n# L is spacial size of feature vector (196).\n# D is dimension of image featu... | [
[
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.stack",
"tensorflow.random_uniform_initializer",
"tensorflow.squeeze",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.to_float",
"tensorflow.argmax",
"tensorflow.nn.dropout",
... |
fengliu90/DK-for-TST | [
"1c4065e81fb902e46e3316bfd98eadd0b7f22d74"
] | [
"Ablation_Tests_MNIST.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Dec 21 14:57:02 2019\r\n@author: Learning Deep Kernels for Two-sample Test\r\n@Implementation of MMD-D and baselines in our paper on MNIST dataset\r\n\r\nBEFORE USING THIS CODE:\r\n1. This code requires PyTorch 1.1.0, which can be found in\r\nhttps://pytorch.org/get-... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout2d",
"numpy.sqrt",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.cuda.is_available",
"torch.device",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.sqrt",
"numpy.arange",
"torch.from_numpy",
"torch.tensor",
"numpy... |
AakashKT/analytic_ss_cpu | [
"1d6528d5a86db314c336906cd579a1ac46d4b53c"
] | [
"plot_runtime.py"
] | [
"import os, sys, math, random, time, csv, copy, argparse\n\nimport matplotlib\nfrom matplotlib import cm\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport cv2\n\nfig = None\nax1 = None\nax2 = None\nax3 = None\n\ndef plot_overall():\n # max_vals = [\n # 94.03,\n # 98.06,\n # ... | [
[
"numpy.array",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.figure"
]
] |
geyang/gym-sawyer | [
"c6e81ab4faefafcfa3886d74672976cc16452747"
] | [
"sawyer/peg_3d.py"
] | [
"from collections import OrderedDict\nimport numpy as np\nimport gym\nfrom gym.spaces import Box, Dict\n\nfrom .env_util import get_asset_full_path\nfrom .base import SawyerXYZEnv, SawyerCamEnv, pick\n\n\nclass SawyerPeg3DEnv(SawyerCamEnv, SawyerXYZEnv):\n\n def __init__(\n self,\n task=Non... | [
[
"numpy.array"
]
] |
sam210723/xrit-rx | [
"405b01578240ff554752a6ea64da403d7c606859"
] | [
"src/products.py"
] | [
"\"\"\"\nproducts.py\nhttps://github.com/sam210723/xrit-rx\n\nParsing and assembly functions for downlinked products\n\"\"\"\n\nimport collections\nimport colorama\nfrom colorama import Fore, Back, Style\nimport io\nimport numpy as np\nimport pathlib\nfrom PIL import Image, ImageFile, UnidentifiedImageError\nimport... | [
[
"numpy.array"
]
] |
cthoyt/pykeen | [
"e2164149492291ba5e4b130ab8d2f9babfc55a50",
"e2164149492291ba5e4b130ab8d2f9babfc55a50"
] | [
"tests/test_models.py",
"src/pykeen/datasets/ogb.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Test that models can be executed.\"\"\"\n\nimport importlib\nimport os\nimport tempfile\nimport traceback\nimport unittest\nfrom typing import Any, ClassVar, Mapping, Optional, Type\nfrom unittest.mock import patch\n\nimport numpy\nimport pytest\nimport torch\nfrom click.testing im... | [
[
"torch.norm",
"torch.randint",
"torch.zeros",
"numpy.asarray",
"torch.randperm",
"torch.is_tensor",
"torch.isfinite",
"torch.rand",
"torch.arange",
"torch.stack",
"torch.allclose",
"torch.ones_like",
"torch.as_tensor"
],
[
"numpy.stack"
]
] |
voidstrike/FPSG | [
"238b1de1402e72669e7df432ce1e7ab6efe4a6e9"
] | [
"src/models/support_models.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\nimport torch.nn.functional as F\n\nclass AuxClassifier(nn.Module):\n def __init__(self, in_dim, out_dim, num_layer=3):\n super(AuxClassifier, self).__init__()\n self.fc1 = nn.Linear(in_dim, 512)\n self.fc2 = nn.Linear(512, 256)\n ... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Dropout",
"torch.nn.functional.log_softmax",
"torch.nn.init.xavier_normal_",
"torch.nn.Linear",
"torch.nn.functional.sigmoid"
]
] |
alexmasterdi/CoCosNet | [
"5d1e58eccca3cb67e1ae93e3719f425e7b8f0a67"
] | [
"models/networks/architecture.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nimport torch.nn.utils.spectral_norm as spectral_norm\nfrom models.networks.normalization import SPADE, equal_lr, SPADE_TwoPath\n\n\n# ResNet block t... | [
[
"torch.nn.Sequential",
"torch.nn.ReflectionPad2d",
"torch.nn.utils.spectral_norm",
"torch.nn.Conv2d",
"torch.tensor",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.leaky_relu",
"torch.nn.ReLU"
]
] |
kota7/kgschart | [
"a08a1ac37d351a9c999c0221ba3a35c28492f148"
] | [
"kgschart/parser.py"
] | [
"# -*- coding: utf-8 -*-\n\n\nfrom PIL import Image\nimport os\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom matplotlib import pyplot as plt\nfrom datetime import datetime\nfrom datetime import timedelta\n\nfrom .colors import BLACK, WHITE, BEIGE, GRAY, GREEN\nfrom .utils import rgb_dist, detect_consec... | [
[
"matplotlib.pyplot.imshow",
"numpy.isnan",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.show",
"numpy.empty"
]
] |
FullMetalNicky/FrontNetPorting | [
"8dc12f1c83ae770936101cfe815523dd7e95188b"
] | [
"pulp/Calibrator.py"
] | [
"#!/usr/bin/env python\n\n\nimport numpy as np\nimport cv2\nimport os\nfrom time import time\nimport sys, getopt\n\nheight = 244\nwidth = 324\npage_size = 4096\n\n\ndef read_from_pipe(pipein):\n\tremaining_size = height * width\n\t\n\tdata = []\n\twhile(remaining_size >= page_size):\n\t\toutput = os.read(pipein, p... | [
[
"numpy.reshape",
"numpy.frombuffer",
"numpy.array",
"numpy.zeros"
]
] |
ruiningTang/mmdetection | [
"100b0b5e0edddc45af0812b9f1474493c61671ef",
"100b0b5e0edddc45af0812b9f1474493c61671ef"
] | [
"mmdet/models/dense_heads/gfocal_head.py",
"tools/feature_visualization.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init\nfrom mmcv.runner import force_fp32\n\nfrom mmdet.core import (anchor_inside_flags, bbox2distance, bbox_overlaps,\n build_assigner, build_sampler, di... | [
[
"torch.nn.Sequential",
"torch.linspace",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.zeros_like",
"torch.nn.Sigmoid",
"torch.tensor",
"torch.split",
"torch.stack",
"torch.nn.ReLU"
],
[
"numpy.max",
"numpy.maximum",
"numpy.uint8",
"n... |
stefanosantaris/DynVGAE | [
"f5cba46b055e7c7aa3048ace0d24fce1a5300313"
] | [
"utils/dataset/GraphLoader.py"
] | [
"import networkx as nx\nimport numpy as np\nimport scipy.sparse as sps\n\nclass GraphLoader():\n def __init__(self, path):\n super(GraphLoader, self).__init__()\n self.path = path\n\n def load_graph(self, file):\n return nx.read_weighted_edgelist(self.path + \"edges\" + str(file) +\".csv\... | [
[
"numpy.zeros",
"scipy.sparse.csr_matrix"
]
] |
chen-zichen/SelfTextAttack | [
"d241122d91e871a5ed6adaf1afb21f6ba06dfcaa"
] | [
"robust_train_bowen.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom textattack.models.bert_models import BertSModel, Attacker\nfrom tqdm import tqdm\nfrom transformers import BertTokenizer, BertForSequenceClassification, AdamW\n\nimport os\n\ndef write_adv(file_addr, orig_list, adv_list, label_list):\n with... | [
[
"torch.LongTensor",
"numpy.random.choice",
"torch.device",
"numpy.array",
"torch.argmax"
]
] |
bsgiovanini/transformer | [
"e128fa862f1b3d17d7b92df169a2bbee3f08366f"
] | [
"conf.py"
] | [
"\"\"\"\n@author : Hyunwoong\n@when : 2019-10-22\n@homepage : https://github.com/gusdnd852\n\"\"\"\nimport torch\n\n# GPU device setting\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\n# model parameter setting\nbatch_size = 32\nmax_len = 256\nd_model = 512\nn_layers = 6\nn_heads = 8... | [
[
"torch.cuda.is_available"
]
] |
SConsul/multi-head-training-da | [
"407db085e4284ac11ff6abc842d11c24e1153acd"
] | [
"wilds/datasets/camelyon17_dataset.py"
] | [
"import os\nimport torch\nimport pandas as pd\nfrom PIL import Image\nimport numpy as np\nfrom wilds.datasets.wilds_dataset import WILDSDataset\nfrom wilds.common.grouper import CombinatorialGrouper\nfrom wilds.common.metrics.all_metrics import Accuracy\n\nclass Camelyon17Dataset(WILDSDataset):\n \"\"\"\n The... | [
[
"numpy.max",
"torch.LongTensor"
]
] |
darrenudaiyan/TensorFlowExperiments | [
"32af9ee0679c5844a383cb8edafb4dab81d894e3"
] | [
"data/trained_model.py"
] | [
"import numpy as np\r\n\r\nclass TrainedModel:\r\n def __init__(self, monkey_magic,monkey_factor_log):\r\n self.monkey_magic = monkey_magic\r\n self.monkey_factor = np.exp(monkey_factor_log)"
] | [
[
"numpy.exp"
]
] |
vvanirudh/imitation-learning-gym | [
"94dc4f3eb4222112fdb735bd3894338a03a75f5b"
] | [
"gym/envs/mujoco/pusher.py"
] | [
"import numpy as np\nfrom gym import utils\nfrom gym.envs.mujoco import mujoco_env\n\nimport mujoco_py\n\nclass PusherEnv(mujoco_env.MujocoEnv, utils.EzPickle):\n def __init__(self):\n utils.EzPickle.__init__(self)\n mujoco_env.MujocoEnv.__init__(self, 'pusher.xml', 5)\n\n def step(self, a):\n ... | [
[
"numpy.asarray",
"numpy.square",
"numpy.linalg.norm"
]
] |
luweishuang/AdelaiDet | [
"514f20b23ea664b682b065979e36f2289aee5763"
] | [
"demo/predictor.py"
] | [
"import numpy as np\nimport atexit\nimport bisect\nimport multiprocessing as mp\nfrom collections import deque\nimport cv2\nimport torch\n# import matplotlib.pyplot as plt\n\nfrom detectron2.data import MetadataCatalog\nfrom detectron2.engine.defaults import DefaultPredictor\nfrom detectron2.utils.video_visualizer ... | [
[
"torch.device",
"torch.cuda.device_count"
]
] |
WindQAQ/tensorflow-wavenet | [
"3a751b66bfa563da7911e24f58597742799e9f9c"
] | [
"utils/kaldi_io.py"
] | [
"#!/usr/bin/env python\n# Copyright 2014-2016 Brno University of Technology (author: Karel Vesely)\n# Licensed under the Apache License, Version 2.0 (the \"License\")\n\nimport numpy as np\nimport os\nimport re\nimport gzip\nimport struct\n\n#################################################\n# Adding kaldi tools t... | [
[
"numpy.fromfile",
"numpy.unique",
"numpy.reshape",
"numpy.vstack",
"numpy.rint",
"numpy.empty",
"numpy.dtype",
"numpy.all",
"numpy.frombuffer",
"numpy.float32",
"numpy.array",
"numpy.sum",
"numpy.loadtxt"
]
] |
flyudvik/ray | [
"4888d7c9af6a62ea5b1bedd8a56ed95529408bb4"
] | [
"python/ray/tests/test_reference_counting_2.py"
] | [
"# coding: utf-8\nimport logging\nimport os\nimport platform\nimport random\nimport signal\nimport sys\nimport time\n\nimport numpy as np\n\nimport pytest\n\nimport ray\nimport ray.cluster_utils\nfrom ray.internal.internal_api import memory_summary\nfrom ray._private.test_utils import SignalActor, put_object, wait_... | [
[
"numpy.random.random",
"numpy.zeros",
"numpy.ones"
]
] |
jattenberg/datascience-utilities | [
"b2b543696af6ea8c5731970d15f3ddd2b3c2985a"
] | [
"datascience_utilities/describe.py"
] | [
"#!/usr/local/bin/python\n\"\"\"\nCopyright (c) 2013 Josh Attenberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, ... | [
[
"pandas.read_csv",
"scipy.stats.normaltest",
"numpy.unique",
"scipy.stats.bayes_mvs",
"scipy.stats.stats.kurtosis",
"scipy.stats.stats.mode",
"scipy.stats.stats.scoreatpercentile",
"scipy.stats.stats.skew",
"scipy.stats.sem"
]
] |
OrkunAvci/Document-Clustering | [
"a91389cefb78d8dbe559870689450610a7bceba8"
] | [
"main.py"
] | [
"import numpy as np\nfrom sklearn.cluster._kmeans import KMeans\n\nimport file_manager as fm\n\nall_links = fm.get(\"_all_links\")\nguide = fm.get(\"_guide\")\n\ntrain = fm.get(\"_train_gft\")\ntest = fm.get(\"_test_gft\")\n\nclusters = 3\nout = KMeans(n_clusters=clusters, random_state=0).fit(train)\n\ntest = np.re... | [
[
"numpy.array",
"sklearn.cluster._kmeans.KMeans"
]
] |
nticea/superhawkes | [
"cbaec7c4aae7ced71ec68f6d69cc516bc19ace5a"
] | [
"test/cython_parallel_parent_test.py"
] | [
"import numpy as np\n\nfrom pyhawkes.internals.parent_updates import mf_update_Z\n\ndef test_parallel_parent_updates():\n \"\"\"\n Just run the parent updates in a parallel loop and watch htop\n to make sure that all the cores are being used.\n :return:\n \"\"\"\n\n T = 10000\n K = 100\n B =... | [
[
"numpy.random.poisson",
"numpy.zeros",
"numpy.allclose",
"numpy.random.gamma"
]
] |
LuizHuang/AI-LearnNote | [
"e6c7dd1ee7ae4208a72f297d645fcdbc5b23a01c"
] | [
"3_Feature/MinMaxScaler.py"
] | [
"# 不属于同一量纲:即特征的规格不一样,不能够放在一起比较。无量纲化可以解决这一问题。\n# 和stanardscaler比,适合对存在极端大和小的点的数据。\n# 除了上述介绍的方法之外,另一种常用的方法是将属性缩放到一个指定的最大值和最小值(通常是1-0)之间,这可以通过preprocessing.MinMaxScaler类来实现。\n# X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0))\n# X_scaled = X_std * (max - min) + min\n\nfrom sklearn.preprocessing import Min... | [
[
"sklearn.preprocessing.MinMaxScaler"
]
] |
Gyfis/kohonen-nn-implementation-II | [
"9e60f33ab4166e095f56ab891e17444ac976e824"
] | [
"kohonen.py"
] | [
"import numpy as np\nfrom itertools import product\nfrom operator import sub\nimport lateral_inhibitions\nfrom enum import Enum\n\n\nclass Layout(Enum):\n square = 1,\n hex = 2\n\n\ndef dist(neuron1, neuron2):\n return sum(abs(neuron1 - neuron2))\n\n\ndef id_dist(id1, id2):\n return sum(map(abs, map(sub... | [
[
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
cycleuser/imagepy | [
"5dc1a9a8137280c5215287392ba1b23d368bd7e9"
] | [
"imagepy/core/app/imagepy.py"
] | [
"import wx, os, sys\nimport time, threading\nsys.path.append('../../../')\nimport wx.lib.agw.aui as aui\nfrom sciwx.widgets import MenuBar, ToolBar, ChoiceBook, ParaDialog, WorkFlowPanel, ProgressBar\nfrom sciwx.canvas import CanvasNoteBook\nfrom sciwx.grid import GridNoteBook\nfrom sciwx.mesh import Canvas3DNoteBo... | [
[
"numpy.arange",
"numpy.zeros"
]
] |
robingong/imgaug | [
"702a257d5a89252ec0aab597f2cc42cfe82fd42b"
] | [
"test/augmentables/test_batches.py"
] | [
"from __future__ import print_function, division, absolute_import\n\nimport time\nimport warnings\nimport sys\n# unittest only added in 3.4 self.subTest()\nif sys.version_info[0] < 3 or sys.version_info[1] < 4:\n import unittest2 as unittest\nelse:\n import unittest\n# unittest.mock is not available in 2.7 (t... | [
[
"matplotlib.use",
"numpy.zeros"
]
] |
manuelmarschall/CompressedFTIR | [
"40cb621943cc926789e55870a01c32e2434763b6"
] | [
"compressedftir/lcurve.py"
] | [
"'''\r\nLicense\r\n\r\n copyright Manuel Marschall (PTB) 2020\r\n\r\n This software is licensed under the BSD-like license:\r\n\r\n Redistribution and use in source and binary forms, with or without\r\n modification, are permitted provided that the following conditions are met:\r\n\r\n 1. Redistributions of source ... | [
[
"numpy.issubdtype",
"numpy.max",
"numpy.argmin",
"numpy.any",
"numpy.diff",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.nonzero",
"numpy.min",
"matplotlib.pyplot.title",
"numpy.log10",
"numpy.argsort",
"matplotlib.pyplot.show",
"numpy.array",
"nump... |
foamliu/Look-Into-Person-v2 | [
"ca524bac51e3b54a0d723e746ee400905567adcb"
] | [
"data_gen.py"
] | [
"import os\nimport random\n\nimport cv2 as cv\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom torchvision import transforms\n\nfrom config import im_size, color_map, num_classes\n\ntrain_images_folder = 'data/instance-level_human_parsing/Training/Images'\ntrain_categories_folder = 'dat... | [
[
"numpy.fliplr",
"numpy.zeros",
"numpy.random.random_sample",
"numpy.clip"
]
] |
aborodya/AlphaPy | [
"b24de414b89a74d0ef1a6249e0bc4f96fb508a1e"
] | [
"alphapy/transforms.py"
] | [
"################################################################################\n#\n# Package : AlphaPy\n# Module : transforms\n# Created : March 14, 2020\n#\n# Copyright 2020 ScottFree Analytics LLC\n# Mark Conway & Robert D. Scott II\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");... | [
[
"pandas.ewma",
"pandas.concat",
"pandas.to_datetime",
"pandas.Series",
"pandas.DataFrame",
"numpy.diff",
"numpy.count_nonzero",
"pandas.get_dummies"
]
] |
bhavika/transformers | [
"65cf33e7e53cd46313f3655f274b3f6ca0fd679d",
"65cf33e7e53cd46313f3655f274b3f6ca0fd679d"
] | [
"src/transformers/models/wavlm/modeling_wavlm.py",
"tests/bart/test_modeling_bart.py"
] | [
"# coding=utf-8\n# Copyright 2021 The Fairseq Authors, Microsoft Research, and The HuggingFace Inc. team. 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# ... | [
[
"torch.abs",
"torch.nn.init.uniform_",
"torch.nn.functional.softmax",
"torch.nn.functional.glu",
"torch.zeros",
"torch.cat",
"torch.nn.Embedding",
"torch.FloatTensor",
"torch.where",
"torch.full_like",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.mm",... |
ihmeuw/vivarium | [
"77393d2e84ff2351c926f65b33272b7225cf9628"
] | [
"src/vivarium/examples/disease_model/intervention.py"
] | [
"import pandas as pd\n\nfrom vivarium.framework.engine import Builder\n\n\nclass TreatmentIntervention:\n\n configuration_defaults = {\n 'intervention': {\n 'effect_size': 0.5,\n }\n }\n\n def __init__(self, name: str, affected_value: str):\n self.name = name\n self.a... | [
[
"pandas.Series"
]
] |
OmerAhmedKhan/recommendationSystem | [
"17d6bf5b450bb03389ec1eb4b5ce04927b15107e"
] | [
"GraphScripts/Collaborative_Filters.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import mean_squared_error\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom sklearn.metrics import mean_squared_error\n\n\n\nu_cols = [... | [
[
"pandas.merge",
"pandas.read_csv",
"matplotlib.pyplot.title",
"numpy.isnan",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
cdever01/torchani | [
"3f7e1347a06422f50010c04a65219e22f2179bfa"
] | [
"tests/test_vibrational.py"
] | [
"import os\nimport math\nimport unittest\nimport torch\nimport torchani\nimport ase\nimport ase.optimize\nimport ase.vibrations\nimport numpy\n\n\npath = os.path.dirname(os.path.realpath(__file__))\npath = os.path.join(path, '../dataset/xyz_files/H2O.xyz')\n\n\nclass TestVibrational(unittest.TestCase):\n\n def t... | [
[
"numpy.real",
"torch.where",
"torch.tensor"
]
] |
m-abdulhak/OpenSfM | [
"767756c2c2f35a2d081a03dffdaa0ba21400a89e"
] | [
"opensfm/actions/undistort.py"
] | [
"import logging\n\nimport cv2\nimport numpy as np\nfrom opensfm import dataset\nfrom opensfm import features\nfrom opensfm import log\nfrom opensfm import pygeometry\nfrom opensfm import pysfm\nfrom opensfm import transformations as tf\nfrom opensfm import types\nfrom opensfm.context import parallel_map\n\n\nlogger... | [
[
"numpy.dot",
"numpy.indices"
]
] |
MoisesExpositoAlonso/deepbiosphere | [
"555bd6d081b2bca87f43eaa3896f1eeec9ea4f3e"
] | [
"scripts/DEEPBIO_GBIF.py"
] | [
"\"\"\"\nParsing and gridding GBIF [taxon, latitude, longitude] .csv file\n@author: moisesexpositoalonso@gmail.com\n\n\"\"\"\n\nimport pandas as pd\nimport os\nimport numpy as np\n\n\n###########################################################################################\ndef subcoor(d,lat,lon):\n d_ = d.loc... | [
[
"pandas.read_csv",
"numpy.zeros"
]
] |
gowtham366/CG_Chennai_Hackathon_2019 | [
"16a3dc0a399a53f9bf2913b92d6a0952ae86379a"
] | [
"loan.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat May 25 10:25:07 2019\n\n@author: gowthc\n\"\"\"\nimport pandas as pd\n#import re\nimport nltk\nfrom sklearn.datasets import load_files\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.ensemble im... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.preprocessing.StandardScaler",
"sklearn.metrics.accuracy_score"
]
] |
oplatek/Theano | [
"09605e7cae876e15c5502c4edaba6a9644c50c11",
"09605e7cae876e15c5502c4edaba6a9644c50c11"
] | [
"theano/tensor/elemwise.py",
"theano/sandbox/gpuarray/tests/test_elemwise.py"
] | [
"from __future__ import print_function\nimport sys\nfrom copy import copy\n\nimport numpy\n\nimport theano\nfrom theano import gof\nfrom theano.compat import izip\nfrom theano.compat import get_unbound_function\nfrom six import iteritems\nfrom six.moves import xrange\nfrom theano.gof import Apply, Op, OpenMPOp\nfro... | [
[
"numpy.may_share_memory",
"numpy.asarray",
"numpy.frompyfunc",
"numpy.dtype",
"numpy.copy",
"numpy.sctype2char",
"numpy.array"
],
[
"numpy.random.rand",
"numpy.random.randint"
]
] |
slee01/homework | [
"144ad6311d28531c250dd610d331d6e01f8e17c2"
] | [
"hw1/behavior_cloning.py"
] | [
"import os\nimport pickle\nimport tensorflow as tf\nimport numpy as np\nimport tf_util\nimport gym\nimport load_policy\nimport random\nimport math\n\nimport argparse\n\ndef main(Session):\n parser = argparse.ArgumentParser()\n parser.add_argument('expert_data_file', type=str)\n parser.add_argument('envname... | [
[
"tensorflow.matmul",
"tensorflow.random_uniform_initializer",
"numpy.squeeze",
"tensorflow.placeholder",
"numpy.concatenate",
"tensorflow.global_variables_initializer",
"numpy.std",
"numpy.mean",
"tensorflow.variable_scope",
"tensorflow.Session",
"tensorflow.square",
... |
abuccts/tutel | [
"09bbdc379f1122b69daa1f0eab5f8a4d63f2389d"
] | [
"tutel/parted/backend/torch/executor.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport os, sys\nimport time\nimport json\nimport torch\n\nfrom tutel import system_init\nfrom tutel.impls import communicate as C\n\ndef warp_bwd_allreduce(data, is_param):\n if is_param:\n fusable_params.add(id(data))\n ... | [
[
"torch.cuda.synchronize",
"torch.nn.Parameter",
"torch.nn.functional.nll_loss",
"torch.manual_seed",
"torch.randn",
"torch.optim.SGD",
"torch.chunk"
]
] |
nicoloval/iterative_reconstruction | [
"09fc440b75e8af1e8c52973b520309b6bdcc8142"
] | [
"tests/test_exp_knn.py"
] | [
"'''Test function iterative_solver \n'''\nimport sys\nsys.path.append('../')\nfrom sample import iterative_solver # where the functions are\nimport sample\nimport numpy as np\nfrom numba import jit\nimport unittest # test tool\nimport networkx as nx\nimport scipy.sparse\n\n\nclass MyTest(unittest.TestCase):\n\n ... | [
[
"numpy.array"
]
] |
simontorres/specidentify | [
"7c148b9b8c4770b77bdeba3b1d67ffecb5607b0d"
] | [
"specreduce/models/RSSModel.py"
] | [
"\"\"\"RSSmodel is a class that describes the optical arm of the Robert Stobie\nSpectrograph. This model inherents from Spectragraph. The RSS is currently\ndescribed by the grating, grating angle, and camera angle. All other components\nare fixed.\n\n20090913 SMC First version\n20120325 SMC -Update to incl... | [
[
"numpy.arctan"
]
] |
google/joint_vae | [
"984f456d1a38c6b27e23433aef241dea56f53384"
] | [
"datasets/mnist_attributes/eval.py"
] | [
"#\n# Copyright 2017 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 agr... | [
[
"tensorflow.Graph",
"tensorflow.contrib.slim.summaries.add_scalar_summary",
"tensorflow.zeros",
"tensorflow.contrib.slim.metrics.accuracy",
"tensorflow.argmax",
"tensorflow.contrib.slim.metrics.aggregate_metric_map",
"tensorflow.app.run"
]
] |
rajatmodi62/PytorchWCT | [
"58a957c647f976f92cd4324d72cb5b167c6a0cc4"
] | [
"test_model.py"
] | [
"import torch\nimport models.vgg_normalised_conv2_1 as vgg_normalised_conv2_1\nmodel = vgg_normalised_conv2_1.vgg_normalised_conv2_1\ncheckpoint= torch.load('models/vgg_normalised_conv2_1.pth')\nmodel.load_state_dict(checkpoint)\nprint(checkpoint.keys())"
] | [
[
"torch.load"
]
] |
ShashwatNigam99/PointRCNN | [
"eee5f90fe4215cff0156e1f8cecf485e18dce1f8"
] | [
"lib/datasets/kitti_rcnn_dataset.py"
] | [
"import numpy as np\nimport os\nimport pickle\nimport torch\n\nfrom lib.datasets.kitti_dataset import KittiDataset\nimport lib.utils.kitti_utils as kitti_utils\nimport lib.utils.roipool3d.roipool3d_utils as roipool3d_utils\nfrom lib.config import cfg\n\n\nclass KittiRCNNDataset(KittiDataset):\n def __init__(self... | [
[
"numpy.logical_xor",
"numpy.arctan2",
"numpy.concatenate",
"numpy.round",
"numpy.where",
"numpy.random.randint",
"numpy.arange",
"torch.from_numpy",
"numpy.copy",
"numpy.load",
"numpy.zeros",
"numpy.nonzero",
"numpy.random.choice",
"numpy.random.rand",
"... |
andyoneal/fastteradata | [
"d8a5edb719b48b6c128ad65d495a1c79d1d29f3f"
] | [
"fastteradata/file_processors/file_processors.py"
] | [
"import pandas as pd\nimport numpy as np\nimport pyodbc as odbc\nimport teradata\n\nimport json\nimport os\n\nfrom .io_processors import *\nfrom ..metadata_processors.metadata_processors import *\nfrom ..auth.auth import read_credential_file, load_db_info\n\nauth, auth_dict, env_dict = read_credential_file()\n\ndef... | [
[
"numpy.arange",
"pandas.read_sql"
]
] |
hirnimeshrampuresoftware/vispy | [
"241ec8b9e54e4ed5b460377b81c6a4ea60df5a83",
"241ec8b9e54e4ed5b460377b81c6a4ea60df5a83"
] | [
"examples/scene/isocurve_for_trisurface_qt.py",
"examples/gloo/animate_shape.py"
] | [
"# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n# ----------------------------------------------------------------------... | [
[
"numpy.linspace"
],
[
"numpy.array",
"numpy.zeros"
]
] |
mike-gimelfarb/deep-successor-features-for-transfer | [
"42a547fdc6c9e34e2e92735d615cdb9db0059aee"
] | [
"source/agents/sfql.py"
] | [
"# -*- coding: UTF-8 -*-\nimport numpy as np\n\nfrom agents.agent import Agent\n\n\nclass SFQL(Agent):\n \n def __init__(self, lookup_table, *args, use_gpi=True, **kwargs):\n \"\"\"\n Creates a new tabular successor feature agent.\n \n Parameters\n ----------\n lookup... | [
[
"numpy.max",
"numpy.argmax",
"numpy.linalg.norm"
]
] |
ipc-sim/rigid-ipc | [
"d839af457236e7363b14c2e482a01d8160fa447e"
] | [
"tools/fixtures/2D/generate_line_stack.py"
] | [
"#!/usr/local/bin/python3\n\"\"\"Script to generate a fixture of a box falling on a saw.\"\"\"\n\nimport pathlib\n\nimport numpy\n\nfrom fixture_utils import *\n\n\ndef generate_fixture(args):\n \"\"\"Generate a fixture of a N boxes stacked on top of each other.\"\"\"\n fixture = generate_custom_fixture(args)... | [
[
"numpy.array"
]
] |
LinLearn/linlearn | [
"de5752d47bbe8e2fb62d41b0dcf2526f87545e1c"
] | [
"linlearn/estimator/hg.py"
] | [
"# Authors: Stephane Gaiffas <stephane.gaiffas@gmail.com>\n# Ibrahim Merad <imerad7@gmail.com>\n# License: BSD 3 clause\n\n\nfrom collections import namedtuple\nimport numpy as np\nfrom numba import jit, prange\nfrom ._base import Estimator, jit_kwargs\nfrom .._utils import np_float\nfrom math import ceil\... | [
[
"numpy.log",
"numpy.expand_dims",
"numpy.linalg.eigh",
"numpy.cov",
"numpy.argmin",
"numpy.mean",
"numpy.argsort",
"numpy.empty"
]
] |
booltime/nlpaug | [
"d21e51bacd170dcd3dddfc34a401f0215f91dbf1"
] | [
"nlpaug/util/visual/wave.py"
] | [
"import matplotlib.pyplot as plt\nimport librosa.display\nimport numpy as np\n\n\nclass VisualWave:\n @staticmethod\n def visual(title, audio, sample_rate):\n plt.figure(figsize=(8, 4))\n librosa.display.waveplot(audio, sr=sample_rate)\n plt.title(title)\n plt.tight_layout()\n ... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure"
]
] |
wk-atmchem/wk-atmchem.github.io | [
"f975126a98121203126f88ffd20c18b419bf101a"
] | [
"python-scripts/plot4O3conc-CMAQ/CMAQproplot.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun May 3 17:14:54 2020\nRevised version of plotting CMAQ output from Stacy's script'\n@author: Kai Wu\nEmail:atmwu@ucdavis.edu\n\n\"\"\"\n\n# Libraries\n#--------------\nfrom matplotlib import pyplot as plt ; from matplotlib import colors\nimport numpy as np; import nu... | [
[
"numpy.average",
"pandas.DataFrame"
]
] |
mayanks888/mAP | [
"7e6a6c4b916223e737d30c76ebb11a75ed15d984"
] | [
"scripts/extra/bdd_evaluation/json_to_csv_bdd.py"
] | [
"import json\nimport os\n\nimport cv2\nimport pandas as pd\n\nfilename = []\nwidth = []\nheight = []\nClass = []\nxmin = []\nymin = []\nxmax = []\nymax = []\nlight_color = []\na = []\nfile_number = 0\n# classes=['bus','light','traffic_sign','person','bike','truck','motor','car','train','Rider']\nclasses=['bus','lig... | [
[
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.