repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
vjdad4m/idk | [
"0ae633f9802b00170350108438100b1a6b0af4b3"
] | [
"Perlin/Perlin.py"
] | [
"import matplotlib.pyplot as plt\r\nfrom math import sin, cos\r\nimport numpy as np\r\n\r\ndef interpolate(a0, a1, w):\r\n return (a1 - a0) * w + a0\r\n\r\ndef random(ix, iy):\r\n r = 2920 * sin(ix * 21942 + iy * 171324 + 8912) * cos(ix * 23157 * iy * 217832 + 9758)\r\n return (cos(r), sin(r))\r\n\r\ndef d... | [
[
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
L-Net-1992/oneflow | [
"4dc08d65caea36fdd137841ac95551218897e730"
] | [
"python/oneflow/test/exceptions/test_error_msg.py"
] | [
"\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\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 ap... | [
[
"torch.randn",
"numpy.random.randn"
]
] |
ds7711/nlpaug | [
"9d4fb11dcff9980ebaec9d8e6cc7a0381f7db67b"
] | [
"nlpaug/model/audio/vtlp.py"
] | [
"import numpy as np\nimport librosa\nfrom nlpaug.model.audio import Audio\n\n\nclass Vtlp(Audio):\n # https://pdfs.semanticscholar.org/3de0/616eb3cd4554fdf9fd65c9c82f2605a17413.pdf\n def __init__(self, sampling_rate, zone=(0.2, 0.8), coverage=0.1, duration=None, factor=(0.9, 1.1), fhi=4800,\n ... | [
[
"numpy.linspace",
"numpy.concatenate",
"numpy.floor",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
alefabris/information-retrieval-service-elasticsearch | [
"a44d6004a4b7e13e1bdc2276cd51eef6c34b22e2"
] | [
"experiment0.py"
] | [
"import string\r\nimport sys\r\nimport getopt\r\nimport os.path\r\nimport json\r\nimport subprocess\r\nimport pandas as pd\r\nimport nltk\r\nimport re\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\nfrom tqdm import tqdm\r\nfrom sklearn.cluster import KMeans\r\nfrom nltk.corpus ... | [
[
"numpy.arange",
"pandas.DataFrame",
"sklearn.cluster.KMeans",
"sklearn.feature_extraction.text.CountVectorizer"
]
] |
juesato/jax_verify | [
"7a662be88a7787842a01c1ceb28f5c761a24c61b"
] | [
"jax_verify/tests/model_zoo_test.py"
] | [
"# coding=utf-8\n# Copyright 2020 The jax_verify Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ... | [
[
"numpy.reshape",
"numpy.load",
"numpy.argmax",
"numpy.equal"
]
] |
TheSuperMyo/vnpy | [
"e38b7f4de879f1756aa664d5dfe7e0bec65c9a1b"
] | [
"examples/import_csv.py"
] | [
"from vnpy.trader.constant import (Exchange, Interval)\nimport pandas as pd\nfrom vnpy.trader.database import database_manager\nfrom vnpy.trader.object import (BarData,TickData)\nfrom datetime import datetime, timedelta, timezone\nimport sys\n\n# 封装函数\ndef move_df_to_mongodb(imported_data:pd.DataFrame,collection_na... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
zonca/petsc4py | [
"33408c70b4211b801c24f8c3cdb859f5aaf59367"
] | [
"test/test_dmplex.py"
] | [
"from petsc4py import PETSc\nimport unittest\nimport numpy as np\n\n# --------------------------------------------------------------------\n\nclass BaseTestPlex(object):\n\n COMM = PETSc.COMM_WORLD\n DIM = 1\n CELLS = [[0, 1], [1, 2]]\n COORDS = [[0.], [0.5], [1.]]\n COMP = 1\n DOFS = [1, 0]\n\n ... | [
[
"numpy.reshape"
]
] |
fossabot/satsense | [
"b0fa650193995a30328f26a36ebab2437c0e37ef"
] | [
"satsense/features/texton.py"
] | [
"\"\"\"Texton feature implementation.\"\"\"\nimport logging\nfrom typing import Iterator\n\nimport numpy as np\nfrom scipy.signal import convolve\nfrom skimage.filters import gabor_kernel, gaussian\nfrom sklearn.cluster import MiniBatchKMeans\n\nfrom ..generators import FullGenerator\nfrom ..image import Image\nfro... | [
[
"numpy.minimum",
"numpy.linspace",
"numpy.ma.empty",
"numpy.bincount",
"numpy.prod",
"sklearn.cluster.MiniBatchKMeans",
"numpy.random.RandomState",
"numpy.zeros",
"numpy.vstack",
"scipy.signal.convolve"
]
] |
mohdzamrimurah/ftsm_technical_reports | [
"ea6bdbc4184e564d81ec0990af25a94a5abf010f"
] | [
"learning_tensorflow/template_01.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jan 8 23:49:44 2017\n\n@author: zamri\n\"\"\"\n\nimport tensorflow as tf\n# initialize variables / model parameters# define the training loop operations\n\n\ndef inference(X):\n # compute inference model over data X and return the result\n... | [
[
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"tensorflow.initialize_all_variables",
"tensorflow.Session",
"tensorflow.train.Saver"
]
] |
Melvin95/Music-Generation-LSTM-RBM | [
"f6cb0b3f034be2862b2bacefd7f9647cb79270de"
] | [
"lstm_rbm.py"
] | [
"'''\r\nLSTM-RBM model to generate music\r\n'''\r\n\r\nimport tensorflow as tf\r\nfrom tqdm import tqdm\r\nimport utildata as ud\r\nimport numpy as np\r\nfrom music21 import*\r\nimport gc\r\nimport random\r\nimport matplotlib.pyplot as plt\r\n\r\nclass lstm_rbm(object):\r\n '''LSTM-RBM class'''\r\n def __init... | [
[
"tensorflow.scan",
"tensorflow.metrics.accuracy",
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.variables_initializer",
"matplotlib.pyplot.plot",
"tensorflow.tanh",
"tensorflow.while_loop",
"tensorflow.get_collection",
"tensorflow.stop_gradient",
"tensorflow.subt... |
onurbarut/Encrypted_Malware_Detection | [
"2d2323c1e9ea3313b76bc2e37b68a9126587c6cd"
] | [
"vino_nsyss2020/utils/helper.py"
] | [
"import numpy as np\nimport pandas as pd\nimport tensorflow as tf\n\nfrom sklearn import metrics\nfrom sklearn.metrics import classification_report\nfrom tensorflow.python.framework.graph_util_impl import convert_variables_to_constants\n\n\ndef read_csv_dataset(fileName,\n drop_low_packets=False... | [
[
"pandas.read_csv",
"numpy.asarray",
"tensorflow.global_variables",
"sklearn.metrics.confusion_matrix",
"tensorflow.python.framework.graph_util_impl.convert_variables_to_constants",
"sklearn.metrics.classification_report",
"numpy.sum",
"numpy.zeros"
]
] |
alexells/PyAthena | [
"e365b3f4568ebc755b3d6d631dc5da43bca867b1"
] | [
"tests/test_sqlalchemy_athena.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, unicode_literals\n\nimport re\nimport unittest\nimport uuid\nfrom datetime import date, datetime\nfrom decimal import Decimal\n\nimport numpy as np\nimport pandas as pd\nimport sqlalchemy\nfrom future.utils import PY2\nfrom sqlalchemy.engine import c... | [
[
"numpy.int32",
"numpy.int64",
"numpy.float64",
"numpy.float32",
"numpy.bool_"
]
] |
prabhathur/CF | [
"20943f3f326e72ea7c5464bc2c3eee06703ed404"
] | [
"tests/test_model_interface/test_keras_tensorflow_model.py"
] | [
"import numpy as np\nimport pytest\n\nimport dice_ml\nfrom dice_ml.utils import helpers\n\ntf = pytest.importorskip(\"tensorflow\")\n\n@pytest.fixture\ndef tf_session():\n if tf.__version__[0] == '1':\n sess = tf.InteractiveSession()\n return sess\n\n@pytest.fixture\ndef tf_model_object():\n bac... | [
[
"numpy.array"
]
] |
ylhz/Adversarial-attack-on-Person-ReID-With-Deep-Mis-Ranking | [
"2c20cd398be39dd8bba3e676275ef8459bb54820",
"2c20cd398be39dd8bba3e676275ef8459bb54820"
] | [
"models/HACNN.py",
"util/local_dist.py"
] | [
"from __future__ import absolute_import\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nimport torchvision\n\n__all__ = ['HACNN']\n\nclass ConvBlock(nn.Module):\n \"\"\"Basic convolutional block:\n convolution + batch normalization + relu.\n\n Args (following http://pytorch.org... | [
[
"torch.nn.functional.upsample",
"torch.nn.BatchNorm1d",
"torch.cat",
"torch.nn.Conv2d",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.MaxPool2d",
"torch.nn.functional.grid_sample",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
],
[
"torch.randn",
... |
sdpython/ensae_teaching_cs | [
"ac978c4031afe6a5b846402a28628791e547a841",
"3bc80f29d93c30de812e34c314bc96e6a4f0d025"
] | [
"src/ensae_teaching_cs/faq/faq_matplotlib.py",
"_unittests/ut_homeblog/test_tableformula2.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@file\n@brief Quelques problèmes récurrents avec `matplotlib <http://matplotlib.org/>`_.\n\"\"\"\nimport numpy\n\n\ndef graph_style(style='ggplot'):\n \"\"\"\n Changes :epkg:`matplotlib` style.\n\n @param style style\n\n .. faqref::\n :tag: matplotlib\... | [
[
"matplotlib.pyplot.subplots",
"numpy.mean",
"matplotlib.pyplot.close",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure"
],
[
"pandas.read_csv"
]
] |
Neo9061/amazon-sagemaker-examples | [
"da58c2950286a2e40bd53a5d5135b1e23fd79e63"
] | [
"sagemaker-pipeline-multi-model/sagemaker-pipeline/pipelines/restate/dtree_evaluate.py"
] | [
"# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"l... | [
[
"numpy.array",
"pandas.read_csv",
"sklearn.metrics.r2_score",
"sklearn.metrics.mean_squared_error"
]
] |
o-P-o/disagree | [
"4c7aecdbb6bc38f3a6e81338bc0bd7124f6d10c0"
] | [
"disagree/metrics.py"
] | [
"\"\"\"\nSee Jupyter notebooks for example usage\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport itertools\nimport math\nimport sys\n\nfrom collections import Counter\nfrom tqdm import tqdm\nfrom utils import convert_dataframe\n\nfrom scipy.stats import pearsonr, kendalltau, spearmanr\n\n\nDATAFRAME_ERRO... | [
[
"scipy.stats.pearsonr",
"pandas.DataFrame",
"scipy.stats.kendalltau",
"scipy.stats.spearmanr",
"numpy.array",
"numpy.sum"
]
] |
x6rulin/pywonderland | [
"19a8f4503584ba77d60e381e2d14bd3683d9693f"
] | [
"src/mobius/mobius/utils.py"
] | [
"import numpy as np\n\n\ninfty = 1e10\nepsilon = 1e-10\n\n\ndef greater_than(x, y):\n return x > y + epsilon\n\n\ndef less_than(x, y):\n return x < y - epsilon\n\n\ndef equal(x, y):\n return x - epsilon <= y <= x + epsilon\n\n\ndef iszero(x):\n return equal(x, 0)\n\n\ndef nonzero(x):\n return not isz... | [
[
"numpy.exp",
"numpy.angle",
"numpy.tanh"
]
] |
myurasov/PCLSegmentation | [
"fef998fb067a10c77a5c233d05635f20c7510972"
] | [
"pcl_segmentation/configs/SqueezeSegV2_256x256.py"
] | [
"# ==============================================================================\n# MIT License\n#\n# Copyright 2021 Institute for Automotive Engineering of RWTH Aachen University.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation fi... | [
[
"numpy.array"
]
] |
YuxiaoLiu/distribution_system_identification_theoretical_limit | [
"388db842a800b21fb75494f6547fa0940e094288"
] | [
"plot_bound_test_external_case.py"
] | [
"# This script do the boxplot\nimport matplotlib.pyplot as plt\nimport pandas\nfrom pandas import DataFrame\nimport numpy as np\n# Set the default colors\nimport brewer2mpl\nimport matplotlib as mpl\n#http://colorbrewer2.org/#type=qualitative&scheme=Set1&n=5\n# colors = ['empirical','model','sample','bound','test']... | [
[
"matplotlib.pyplot.legend",
"pandas.read_excel",
"numpy.linspace",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.vlines",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
markomanninen/YatzyPy | [
"a6904b22473ae909f588e3b82a67b8b4f2dce0f2"
] | [
"YatzyPy/AlanStrategy.py"
] | [
"# AlanStrategy.py\nfrom . data import file as csvfile, categories, targets, functions, scoring, order\nimport pandas as pd\nfrom . main import Strategy\n\nprobabilities = None\n\ndef process_category(x):\n\treturn int(x)\n\ndef process_hand(x):\n\treturn tuple(map(int, x.replace('[', '').replace(']', '').replace('... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
fricklerhandwerk/diffpriv | [
"82e364816d9801aeea71ceadd286471f52238e82"
] | [
"gui_svt.py"
] | [
"import os\nimport random\nimport wx\nimport wx.lib.agw.floatspin as fs\nfrom wx.lib.intctrl import IntCtrl\n\nimport matplotlib\nmatplotlib.use('WXAgg')\nfrom matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas\nfrom matplotlib.figure import Figure\nfrom matplotlib.ticker import MaxNLocator\n\n... | [
[
"matplotlib.figure.Figure",
"matplotlib.use",
"numpy.arange",
"matplotlib.ticker.MaxNLocator",
"matplotlib.backends.backend_wxagg.FigureCanvasWxAgg",
"scipy.integrate.quad"
]
] |
BoLin/2018-Projects | [
"c0727a883c8b291380aa850f588b9239b6ded30d"
] | [
"Data Visualization/scatter_plot.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\ndef scatterplot(x_data, y_data, x_label=\"\", y_label=\"\", title=\"\", color = \"r\", yscale_log=False):\n\n # Create the plot object\n _, ax = plt.subplots()\n\n # Plot the data, set the size (s), color and transparency (alpha)\n # of the points\... | [
[
"matplotlib.pyplot.subplots"
]
] |
Manpreet1377/analyzing-weather-dataset | [
"6f8efd18871cb41f4ac167eff46f2875cd366462"
] | [
"code.py"
] | [
"# --------------\r\n#Importing the modules\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom scipy.stats import mode \r\n\r\n#Code for categorical variable\r\ndef categorical(df):\r\n categorical_var = df.select_dtypes(include = 'object').columns.tolist()\r\n return categorical_var\r\n \"\"\"\r\n Th... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
UplinkCoder/incubator-mxnet | [
"b68f18c97d08193cded0630a2e0a04673e4a0410"
] | [
"tests/python/gpu/test_gluon_gpu.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.isnan",
"numpy.dtype",
"numpy.ones"
]
] |
ktechhub/resume-ats | [
"c1748db2c37c35aed6172c8468db72c2cc539670"
] | [
"main.py"
] | [
"from collections import Counter\nimport requests\nimport spacy\nfrom bs4 import BeautifulSoup\nimport matplotlib.pyplot as plt\n\nurl = input('Enter job link: ')\npage = requests.get(url)\nhtml = page.text\n\nsoup = BeautifulSoup(html, 'html.parser')\ntitle = soup.find('h1').string\ncompany = soup.find('a', class_... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
Nohossat/youtube_sentiment_analysis | [
"4d8e15111ea448d46b787e7902b7523c8d041d92"
] | [
"tests/test_preprocessing.py"
] | [
"import os\n\nimport pandas as pd\n\nimport nohossat_cas_pratique\nfrom nohossat_cas_pratique.preprocessing import split_data, NLPCleaner\n\nmodule_path = os.path.dirname(os.path.dirname(os.path.dirname(nohossat_cas_pratique.__file__)))\ndata_path = os.path.join(module_path, \"data\", \"comments.csv\")\n\n\ndef tes... | [
[
"pandas.read_csv"
]
] |
firasl/inverse_attention | [
"8c9a08c90cacf4699bb829a234a2e3c7997c6f0c"
] | [
"main_imagenet.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Apr 20 15:26:58 2021\n\n@author: laakom\n\"\"\"\n\n\nfrom __future__ import print_function\nimport tensorflow.keras as ks\nfrom tensorflow.keras.layers import Dense, Conv2D, BatchNormalization, Activation\nfrom tensorflow.keras.layers import AveragePooling2D, Input, ... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.distribute.MirroredStrategy"
]
] |
khamrranirr/multi-party-data-differential-privacy | [
"40bd6aa86ad27e82e1534f60d1a9ce7586c4185a"
] | [
"d_SVM.py"
] | [
"from sklearn import svm\r\nfrom sklearn.naive_bayes import MultinomialNB\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sklearn.metrics import accuracy_score\r\nfrom sklearn.model_selection import KFold\r\nfrom sklearn.naive_bayes import GaussianNB\r\nfrom sklearn.naive_bayes import BernoulliNB\r\n\r\n\r\n# ... | [
[
"pandas.read_csv",
"sklearn.naive_bayes.GaussianNB",
"numpy.unique",
"sklearn.naive_bayes.MultinomialNB",
"pandas.DataFrame",
"sklearn.model_selection.KFold",
"sklearn.naive_bayes.BernoulliNB",
"sklearn.svm.SVC",
"numpy.array"
]
] |
heshanpadmasiri/alpr-simple | [
"61272c56b1ba4b6aec825e48d0eefced902a06b6"
] | [
"models/bbox_25.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras import datasets, layers, models, Input\nfrom models.nn_blocks import rpnet_block_1, rpnet_block_3, mobilenet_block_1\nfrom metrices.iou import IoUMetric\n\n\ndef __get_model__(feature_extractor, input_shape, extractor_layer=None):\n global_average_layer = tf.keras.... | [
[
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.Input",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Sequential",
"tensorflow.keras.Model"
]
] |
guybuk/ANCOR | [
"229f8a52b81fa94cd584cbc6fc715697f98e43e2"
] | [
"localization.py"
] | [
"from __future__ import print_function\n\nimport argparse\nimport os\n\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nfrom torchvision import transforms\n\nfrom datasets.breeds import BREEDSFactory\nfrom... | [
[
"torch.norm",
"torch.cuda.set_device",
"torch.Tensor",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.cuda.is_available"
]
] |
QuantFinEcon/py-learn | [
"7151f01df9f7f096312e43434fe8026d1d7d7828"
] | [
"wordpress-py-scripts/scipy timeseries test 1.py"
] | [
"import numpy as np\nimport pandas as pd\nimport statsmodels.api as sm\ntsa = sm.tsa # as shorthand\n\n\nmdata = sm.datasets.macrodata.load().data\ntype(mdata)\n\nendog = np.log(mdata['m1'])\nexog = np.column_stack([np.log(mdata['realgdp']), np.log(mdata['cpi'])])\nexog = sm.add_constant(exog, prepend=True)\nexog\n... | [
[
"numpy.log",
"pandas.concat",
"pandas.DataFrame",
"numpy.ones",
"numpy.array"
]
] |
cltl/a-proof-zonmw | [
"f6d1a83fc77223bf8b58c9d465aae301269bb679"
] | [
"clf_domains/wandb_sweep.py"
] | [
"\"\"\"\nPerform a sweep for hyperparameters optimization, using Simple Transformers and W&B Sweeps.\nThe sweep is configured in a dictionary in a config file, which should specify the search strategy, the metric to be optimized, and the hyperparameters (and their possible values).\n\nThe script can be customized w... | [
[
"pandas.read_pickle",
"torch.cuda.is_available"
]
] |
theXYZT/codejam-2020 | [
"7d8705725c13ef3a5cb309b4c1ac53bd7e2e7579"
] | [
"Qualification Round/vestigium.py"
] | [
"# Codejam 2020, Qualification Round: Vestigium\n\nimport numpy as np\n\n# I/O Code\nnum_cases = int(input())\n\nfor case in range(1, num_cases + 1):\n N = int(input())\n M = np.array([list(map(int, input().split())) for _ in range(N)])\n\n K = np.trace(M)\n R = sum(len(set(r)) < N for r in M)\n C = ... | [
[
"numpy.trace"
]
] |
dwiel/streamlit | [
"929942f755ca40f859a03d905ffcbf743f45dffa"
] | [
"lib/streamlit/elements/data_frame_proto.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018-2019 Streamlit 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 requi... | [
[
"pandas.isna",
"numpy.array"
]
] |
JeremyBYU/UnrealRooftopLanding | [
"d7f17547b5daff8490cb6fe1582ed2e256faff16"
] | [
"airsimcollect/helper/helper_transforms.py"
] | [
"from airsim.types import Quaternionr, Vector3r\nimport ipdb\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport airsim\nimport quaternion\nimport numpy as np\nimport logging\nfrom os import path\nimport json\nimport warnings\nimport time\nfrom shapely.geometry import Polygon\nfrom airsimcollect.help... | [
[
"matplotlib.colors.BoundaryNorm",
"numpy.linspace",
"numpy.clip",
"numpy.squeeze",
"numpy.rint",
"matplotlib.pyplot.get_cmap",
"numpy.quaternion",
"numpy.ones",
"matplotlib.colors.Normalize",
"numpy.dtype",
"numpy.all",
"numpy.fromstring",
"numpy.floor",
"ma... |
ailnicka/molecular_design_with_beam_search | [
"fbe47bfd2717d898cd96ca80a12111987c3e4db4"
] | [
"src/python/scaffold_hopping_whales/code/mol_properties.py"
] | [
"# ======================================================================================================================\n# * Weighted Holistic Atom Localization and Entity Shape (WHALES) descriptors *\n# v. 1, May 2018\n# ------------------------------------------------------------------------------------------... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
Rlamboll/silicone | [
"bceb8a438dfe53fba22b6ad387a10fca78eeb2a7"
] | [
"tests/unit/test_stats.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\nimport pyam\nimport pytest\nimport scipy.interpolate\n\nimport silicone.stats as stats\n\n_mc = \"model_c\"\n_sa = \"scen_a\"\n_sb = \"scen_b\"\n_sc = \"scen_c\"\n_eco2 = \"Emissions|CO2\"\n_gtc = \"Gt C/yr\"\n_ech4 = \"Emissions|CH4\"\n_mtch4 = \"Mt CH4/yr\"\n... | [
[
"pandas.read_csv",
"numpy.allclose",
"numpy.isnan",
"numpy.arange",
"pandas.DataFrame",
"numpy.var",
"numpy.argsort",
"numpy.array",
"numpy.isclose"
]
] |
LLLjun/learn-to-cluster | [
"3b834589923baf72523e288cc462e0df591b99c1"
] | [
"utils/misc.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport time\nimport json\nimport pickle\nimport random\nimport numpy as np\n\n\nclass TextColors:\n HEADER = '\\033[35m'\n OKBLUE = '\\033[34m'\n OKGREEN = '\\033[32m'\n WARNING = '\\033[33m'\n FATAL = '\\033[31m'\n ENDC = '\\033[0m'\n ... | [
[
"numpy.dot",
"numpy.fromfile",
"numpy.random.seed",
"torch.manual_seed",
"numpy.linalg.norm",
"numpy.savez_compressed",
"torch.cuda.manual_seed_all",
"numpy.load"
]
] |
eisenjulian/bert | [
"9070c136e5a1d716472fd723880a8e8f15d74bbc"
] | [
"run_classifier.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl... | [
[
"tensorflow.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.metrics.accuracy",
"tensorflow.FixedLenFeature",
"tensorflow.nn.log_softmax",
"tensorflow.reduce_sum",
"tensorflow.gfile.GFile",
"tensorflow.cast",
"tensorflow.train.init_from_checkpoint",
"tensorflow.gfile.M... |
ACTCollaboration/mnms | [
"4374f0efef5e1f5d36af472d633861a4dc52bde6"
] | [
"mnms/inpaint.py"
] | [
"import numpy as np\nimport warnings\n\nfrom optweight import mat_utils\nfrom pixell import enmap, utils\n\nfrom mnms import utils as m_utils\n\ndef catalog_to_mask(catalog, shape, wcs, radius=np.radians(4/60)):\n \"\"\"\n Convert catalog with DEC, RA values to binary point source mask.\n\n Parameters\n ... | [
[
"numpy.log",
"numpy.radians",
"numpy.sqrt",
"numpy.abs",
"numpy.asarray",
"numpy.median",
"numpy.argwhere",
"numpy.all",
"numpy.ones",
"numpy.mean",
"numpy.any",
"numpy.ndindex",
"numpy.zeros",
"numpy.sum",
"numpy.random.default_rng"
]
] |
kmpaul/PyReshaper | [
"75a81213a8d2c36db7fc6bc51604491a6c902ab9"
] | [
"tests/checks.py"
] | [
"\"\"\"\nCopyright 2020, University Corporation for Atmospheric Research\nSee LICENSE.txt for details\n\"\"\"\n\nimport os\n\nimport numpy as np\n\nfrom pyreshaper import iobackend\n\nfrom .data import config\n\n\ndef check_outfile(infiles, prefix, tsvar, suffix, metadata, once, **kwds):\n \"\"\"\n Check that... | [
[
"numpy.all"
]
] |
wqrray/nerf_baseline | [
"eb0777530a09baf4451da3e3688ba5d7820d6e8d"
] | [
"dtu_dataset.py"
] | [
"# This file is borrowed from NeuS project\nimport torch\nimport torch.nn.functional as F\nimport cv2 as cv\nimport numpy as np\nimport os\nfrom glob import glob\nfrom scipy.spatial.transform import Rotation as Rot\nfrom scipy.spatial.transform import Slerp\n\n\n# This function is borrowed from IDR: https://github.... | [
[
"numpy.diag",
"torch.linspace",
"torch.randint",
"scipy.spatial.transform.Slerp",
"numpy.linalg.inv",
"numpy.asarray",
"numpy.eye",
"torch.sum",
"torch.stack",
"numpy.stack",
"torch.inverse",
"torch.linalg.norm",
"torch.matmul",
"torch.from_numpy",
"torc... |
mattmecoli/ethereum-forecasting | [
"1c54d42e77d75f96af40591312bce63e36cbcae6"
] | [
"code_snippets/random_forest_example.py"
] | [
"# Creating dict to hold data with and without trend data for streamlined testing\n\ntraining_sets = {'train': [target_train, features_train, target_val, features_val],\n 'train_with_trend' : [target_with_trends_train, features_with_trends_train,\n target_with_tre... | [
[
"sklearn.ensemble.RandomForestClassifier"
]
] |
guillaumehuet/SolidsPy | [
"42887540f579ba5c4f735edd3438421d39ad1694"
] | [
"solidspy/preprocesor.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nPreprocessor subroutines\n-------------------------\n\nThis module contains functions to preprocess the input files to compute\na Finite Element Analysis.\n\n\"\"\"\nimport sys\nimport numpy as np\n\n\ndef readin(folder=\"\"):\n \"\"\"Read the input files\"\"\"\n nodes = np.l... | [
[
"numpy.savetxt",
"numpy.zeros",
"numpy.loadtxt"
]
] |
afkfurby/stable-baselines | [
"e5adbc4c52f41ea315f05e6a6ca9ffc81793a35c"
] | [
"stable_baselines/common/distributions.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\n\nfrom tensorflow.python.ops import math_ops\nfrom gym import spaces\n\nfrom stable_baselines.common.tf_layers import linear\n\n\nclass ProbabilityDistribution(object):\n \"\"\"\n Base class for describing a probability distribution.\n \"\"\"\n def __init_... | [
[
"tensorflow.reduce_max",
"numpy.log",
"tensorflow.concat",
"tensorflow.split",
"tensorflow.unstack",
"tensorflow.shape",
"tensorflow.reduce_sum",
"tensorflow.python.ops.math_ops.less",
"tensorflow.cast",
"tensorflow.sigmoid",
"tensorflow.exp",
"tensorflow.compat.v1.... |
RajatKGupta/fMRI_BrainDancer | [
"e0e5b04a6dde2990134b60288096dcd2886e9334"
] | [
"core/analysis.py"
] | [
"# %%\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated/Last Edited: October 21, 2019\n\n@author: Rajat Kumar\n@maintainer: Rajat Kumar\nNotes:\nScript for executing the analysis routine for denoising.\n\nTo do:\nInclude the option to generate outer mask and corresponding time_series.\n\n\"\"\"\n\n#... | [
[
"numpy.max",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
Benedicte/quantum-systems | [
"31e6f78dceb03f5d01092f4008fbab38516a0623"
] | [
"tests/test_two_dim_ho.py"
] | [
"import os\nimport sys\nimport pytest\nimport numpy as np\n\nfrom quantum_systems.quantum_dots.two_dim.two_dim_helper import (\n get_index_p,\n get_indices_nm,\n get_one_body_elements,\n get_coulomb_elements,\n)\n\nfrom quantum_systems import (\n GeneralOrbitalSystem,\n TwoDimensionalHarmonicOscil... | [
[
"numpy.testing.assert_allclose"
]
] |
FanKuan44/TENAS | [
"eb70174626649ad2852924ca28c4cabe25fe03d4"
] | [
"lib/models/cell_infers/cells.py"
] | [
"import torch\nimport torch.nn as nn\nfrom copy import deepcopy\nfrom ..cell_operations import OPS\n\n\n# Cell for NAS-Bench-201\nclass InferCell(nn.Module):\n\n def __init__(self, genotype, C_in, C_out, stride):\n super(InferCell, self).__init__()\n\n self.layers = nn.ModuleList()\n self.n... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.ModuleDict",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
AlexanderSlav/Automatic-Soccer-Highlights-Generation | [
"073e95776052034a327a102e5291234983965ad2"
] | [
"Celebration_Classification/trainer.py"
] | [
"import torch\nfrom utils import load_split_train_test, accuracy, Logger, AverageMeter\nimport os\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\nclass Trainer:\n def __init__(self, args, model, criterion, optimizer, wandb, scheduler=... | [
[
"torch.max",
"torch.zeros",
"torch.no_grad",
"torch.cuda.is_available",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
SirRob1997/TextAttack | [
"674a34cb966e7f2f2d9e1e4f51fc4e44cfd6821e"
] | [
"textattack/shared/attacked_text.py"
] | [
"from collections import OrderedDict\nimport math\n\nimport numpy as np\nimport torch\n\nimport textattack\n\nfrom .utils import words_from_text\n\n\nclass AttackedText:\n\n \"\"\" \n A helper class that represents a string that can be attacked.\n \n Models that take multiple sentences as input separ... | [
[
"torch.tensor"
]
] |
rafael-junio/JustAChip8PythonEmulator | [
"ff9c2d67aeaf4f87ff3b5fd6f0231702587455a7"
] | [
"core/cpu/config/memory_config.py"
] | [
"import numpy as np\n\n\nclass Config:\n MEMORY_START_ADDRESS = 0x200\n FONT_SET_START_ADDRESS = 0x50\n\n FONT_SET = np.array([\n 0xF0, 0x90, 0x90, 0x90, 0xF0,\n 0x20, 0x60, 0x20, 0x20, 0x70,\n 0xF0, 0x10, 0xF0, 0x80, 0xF0,\n 0xF0, 0x10, 0xF0, 0x10, 0xF0,\n 0x90, 0x90, 0x... | [
[
"numpy.array"
]
] |
Kazuhito00/M-LSD-warpPerspective-Example | [
"3045a14ee6c9e7d1d25ca0bcdcb67160b8ad18c9"
] | [
"example.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport copy\nimport argparse\n\nimport cv2 as cv\nimport numpy as np\nimport tensorflow as tf\n\nfrom utils import CvFpsCalc\nfrom mlsd.utils import pred_lines, pred_squares\n\n\ndef get_args():\n parser = argparse.ArgumentParser()\n\n parser.add_argument(\"--d... | [
[
"numpy.argsort",
"tensorflow.lite.Interpreter",
"numpy.float32"
]
] |
shuklasid19/mlflow-cnn-deep-learning | [
"5dc98b867f1a9f70e226a61d716d87f8b333fe67"
] | [
"src/stage_02_base_model_creation.py"
] | [
"import argparse\nimport os\nimport shutil\nfrom tqdm import tqdm\nimport logging\nfrom src.utils.common import read_yaml, create_directories\nfrom src.utils.model import log_model_summary\nimport random\nimport tensorflow as tf\n\nSTAGE = \"BASE MODEL CREATION\" ## <<< change stage name \n\nlogging.basicConfig(\n ... | [
[
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.Flatten"
]
] |
chauvu/AmpliGraph | [
"783d885b38e82c991a308f26d26eeb5d3513fcc3"
] | [
"tests/ampligraph/datasets/test_datasets.py"
] | [
"# Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.\n#\n# This file is Licensed under the Apache License, Version 2.0.\n# A copy of the Licence is available in LICENCE, or at:\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\nfrom ampligraph.datasets import load_wn18, load_fb15k, load_fb15k_2... | [
[
"numpy.unique",
"numpy.union1d",
"numpy.testing.assert_array_equal",
"numpy.all",
"numpy.concatenate",
"numpy.array"
]
] |
mweiss17/SEVN-model | [
"14bb5b416886cd2aa0d21a3b6ec07411ec671dcb"
] | [
"scripts/parse_comet_noisy.py"
] | [
"from _warnings import warn\n\nfrom comet_ml import API\nimport numpy as np\nimport matplotlib.pyplot as plt\n\napi = API()\n\nexp_ids = {\n \"SEVN-Train-AllObs-Shaped-v1-s0-10p\": \"mweiss17/navi-corl-2019/008004e9c9a940e088437e4ddeab9eb4\",\n \"SEVN-Train-AllObs-Shaped-v1-s1-10p\": \"mweiss17/navi-corl-2019... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.logical_and",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.max",
"matplotlib.pyplot.ticklabel_format",
"numpy.std",
"numpy.mean",
"numpy.insert",
"matplotlib.pyplot.xlabel",
"numpy.arra... |
maurock/Active-3D-Vision-and-Touch | [
"39e24de0ad3c3caad5d78b7cb351e95d4691c88c"
] | [
"pterotactyl/utility/utils.py"
] | [
"# 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\nimport random\nimport os\nfrom PIL import Image\nimport math\nimport json\n\nimport numpy as np\nimport torch\nimport torch.nn.function... | [
[
"numpy.dot",
"torch.abs",
"torch.cat",
"torch.zeros",
"scipy.spatial.transform.Rotation.from_matrix",
"numpy.concatenate",
"numpy.all",
"torch.no_grad",
"torch.FloatTensor",
"torch.where",
"numpy.cross",
"torch.cuda.is_available",
"scipy.ndimage.binary_fill_hole... |
shawntan/compound-pcfg | [
"01577bf19f8170d5325678a8ea630185f4c37987"
] | [
"compare_trees.py"
] | [
"#!/usr/bin/env python3\nimport sys\nimport os\n\nimport argparse\nimport json\nimport random\nimport shutil\nimport copy\n\nimport torch\nfrom torch import cuda\nimport torch.nn as nn\nimport numpy as np\nimport time\nfrom utils import *\nimport re\n\nparser = argparse.ArgumentParser()\n\n# Data path options\npars... | [
[
"numpy.array",
"torch.no_grad"
]
] |
zhenlingcn/scikit-obliquetree | [
"41d70b210799b57306a10b62f43605a9ddb2b6ad"
] | [
"examples/simple_example.py"
] | [
"from scikit_obliquetree.HHCART import HouseHolderCART\nfrom scikit_obliquetree.segmentor import MSE, MeanSegmentor\nfrom sklearn.datasets import load_boston\nfrom sklearn.ensemble import BaggingRegressor\nfrom sklearn.model_selection import cross_val_score\n\nX, y = load_boston(return_X_y=True)\nreg = BaggingRegre... | [
[
"sklearn.model_selection.cross_val_score",
"sklearn.datasets.load_boston"
]
] |
stormxuwz/SeabirdCode | [
"943c38b0ef0272c04157700ee6ecc2e87f2c2aaa"
] | [
"seabird/models/model_segmentation.py"
] | [
"import numpy as np\nimport logging\n\n\n\ndef debugPlot(x, segList, createLineFunc, plotTitle):\n\timport matplotlib.pyplot as plt\n\tplt.figure()\n\tplt.plot(range(len(x)), x)\n\n\tfor seg in segList:\n\t\tplt.scatter(seg, x[seg], s=8)\n\t\tplt.plot(seg, createLineFunc(x[seg]))\n\tplt.title(plotTitle)\n\tplt.save... | [
[
"numpy.abs",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"numpy.linspace",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.concatenate",
"numpy.random.randint",
"numpy.argmin",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.sh... |
chakerouari/UNET_segmetation | [
"a7d9e9ccd31595d482f620cbf9a625a486f5f0df",
"a7d9e9ccd31595d482f620cbf9a625a486f5f0df",
"a7d9e9ccd31595d482f620cbf9a625a486f5f0df"
] | [
"my_transforms.py",
"unet_explanation/model/unet_utils.py",
"DiceLoss.py"
] | [
"import torchvision.transforms as transforms\nimport random\nimport torch.nn.functional as F\nimport numpy as np\n#transforms = {Resize, ToTensor, RandomCrop, ToPILImage}\n\nclass GrayScale(object):\n def __call__(self,sample):\n from torchvision.transforms import Grayscale\n Grayscale = Grayscale(... | [
[
"torch.nn.functional.rotate"
],
[
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Upsample",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.functional.pad"
],
[
"torch.sigmoid"
]
] |
Lupin1998/inv-ML | [
"9f3db461911748292dff18024587538eb66d44bf"
] | [
"invMLEnc_toy/models/InvML_MLP.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.parameter import Parameter\n\n\nclass InvLeakyReLU(nn.Module):\n \"\"\" Invertible Bi-LeakyReLU with alpha \"\"\"\n def __init__(self, alpha=2, inplace=False, invertible=False):\n super(InvLeakyReLU, self)... | [
[
"torch.max",
"torch.zeros",
"torch.pinverse",
"torch.min",
"torch.nn.ModuleList",
"torch.inverse",
"torch.nn.Linear",
"torch.nn.LeakyReLU"
]
] |
janiapurv/offset-human-interface | [
"e4aaba3886f846d9a611397e287079f722b9132c"
] | [
"offset-game/envs/extract_info.py"
] | [
"import numpy as np\n\n\ndef action_parameters(vehicles, parameters):\n centroid = get_centroid(vehicles)\n parameters['centroid_pos'] = centroid\n return parameters\n\n\ndef get_centroid(vehicles):\n \"\"\"Get the centroid of the vehicles\n \"\"\"\n centroid = []\n for vehicle in vehicles:... | [
[
"numpy.asarray"
]
] |
joymallyac/Fairway | [
"6aa11e4a182e7271059a473cd6857f91d1668e7f"
] | [
"Measure.py"
] | [
"import numpy as np\nimport copy,math\nfrom sklearn.metrics import confusion_matrix,classification_report\n\n\ndef get_counts(clf, x_train, y_train, x_test, y_test, test_df, biased_col, metric='aod'):\n \n clf.fit(x_train, y_train)\n y_pred = clf.predict(x_test)\n cnf_matrix = confusion_matrix(y_test, y... | [
[
"numpy.where",
"sklearn.metrics.confusion_matrix"
]
] |
badarsh2/Virtual-Makeup | [
"065ed6d58c269b3be092ac084485277e125c9c5f"
] | [
"foundation/foundation.py"
] | [
"from __future__ import division\nimport cv2\nimport Image, numpy as np,math\nimport scipy as sp\nfrom numpy.linalg import eig, inv\nfrom scipy.interpolate import interp1d, InterpolatedUnivariateSpline\nfrom pylab import *\nfrom skimage import io, color\nfrom scipy import interpolate\n\n\n#Reqd color\nR,G,B = (200.... | [
[
"numpy.dot",
"numpy.minimum",
"numpy.sqrt",
"numpy.arctan",
"numpy.ones_like",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.reshape",
"numpy.arange",
"numpy.copy",
"scipy.interpolate.interp1d",
"numpy.float32",
"numpy.zeros",
"numpy.linalg.inv",
... |
XuJiacong/test2 | [
"79b21b3eea1a402d4f401b771f78242411855524"
] | [
"lib/models/hrunetv666.py"
] | [
"import math\nimport torch\nimport numpy as np \nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\nfrom collections import OrderedDict\nimport time\n\nBatchNorm2d = nn.BatchNorm2d\nbn_mom = 0.1\nalgc = False\n\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convoluti... | [
[
"torch.nn.Sequential",
"torch.cat",
"torch.load",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.Sigmoid",
"torch.nn.AvgPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init.kaiming... |
JohnnyPeng18/coach | [
"1ee9e10747c535b387a00c946efa220efd114d47"
] | [
"rl_coach/agents/ddpg_agent.py"
] | [
"#\n# Copyright (c) 2017 Intel Corporation \n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable... | [
[
"numpy.array",
"numpy.expand_dims",
"numpy.clip"
]
] |
mdobson/detroit-property-data-lookup | [
"c52d7126b43ccd0f7df87731cb12e211398691f4"
] | [
"zillow/zillow_functions.py"
] | [
"# -*- coding: utf-8 -*-\n# Zillow scraper functions, these are sourced at the top of zillow_runfile.py\n\nimport re as re\nimport numpy as np\nimport time\n#import zipcode\nfrom bs4 import BeautifulSoup\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui... | [
[
"numpy.isnan"
]
] |
mickuz/doggofier | [
"3c75df79f3705168b6785d32970430619b531c50"
] | [
"app/utils.py"
] | [
"\"\"\"This module contains tools supporting the main application.\"\"\"\n\nimport torch\nimport torchvision.transforms as transforms\nfrom PIL import Image\nfrom typing import Tuple\nfrom doggofier.models import ResNet50, VGG16\n\n\ndef transform_image(image_path: str) -> torch.Tensor:\n \"\"\"Prepares an image... | [
[
"torch.exp",
"torch.load"
]
] |
thoward27/udacity-datascience | [
"e605a2c6298eae30bfd28a466cf3a33f45717f3a"
] | [
"small-projects/submission/tools/tester.py"
] | [
"#!/usr/bin/pickle\n\n\"\"\" a basic script for importing student's POI identifier,\n and checking the results that they get from it \n \n requires that the algorithm, dataset, and features list\n be written to my_classifier.pkl, my_dataset.pkl, and\n my_feature_list.pkl, respectively\n\n that proces... | [
[
"sklearn.cross_validation.StratifiedShuffleSplit"
]
] |
sgomezsaez/SCARF-Evaluation | [
"a118039ddd62798ca93b78cb968d6ee8b15ec6f2"
] | [
"utility_samples/de/uni-stuttgart/iaas/utilityFunctions/cost_VMs.py"
] | [
"from matplotlib import pyplot as plt\nfrom numpy import *\nimport pylab as pl\nfrom matplotlib import rc\n\nrc('text', usetex=True)\n\n# Creating Plot\n#fig1 = plt.figure(figsize=(10, 8))\n#ax1 = fig1.add_subplot(111)\n\n#x = pl.frange(1,50)\n#log_serie = [1/(e / 2)**(y / 4) for y in x]\n#ax1.plot(x, log_serie, la... | [
[
"matplotlib.pyplot.axvspan",
"matplotlib.rc",
"matplotlib.pyplot.figure"
]
] |
TimurDzhumakaev/retailhero-recommender-workspace | [
"419576ab47d0cbb1aa2d50e1d1ea17c71c04726d"
] | [
"src/nn_models.py"
] | [
"import torch\nfrom torch import nn\n\n\nclass UserModel(nn.Module):\n def __init__(self, num_products, embedding_dim):\n super(UserModel, self).__init__()\n self._model = nn.Sequential(nn.Linear(num_products, embedding_dim),)\n\n def forward(self, x):\n return self._model(x)\n\n\nclass I... | [
[
"torch.nn.Linear",
"torch.nn.Embedding"
]
] |
NiloMendonca/machinelearning-basics | [
"684ac2c6e557415b30e7b4f1f26135b72c30f4a1"
] | [
"logistic-regression-classifier.py"
] | [
"# Classification template\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Social_Network_Ads.csv')\nX = dataset.iloc[:, [2, 3]].values\ny = dataset.iloc[:, 4].values\n\n# Splitting the dataset into the Trainin... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"matplotlib.pyplot.title",
"numpy.unique",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.ylabel",
"matplotlib.colors.ListedColormap",
... |
mallika2011/IOT-controlling-motor | [
"d79f1977d767c7cb783e847cc9039d9440dba24e"
] | [
"test.py"
] | [
"import random\nimport matplotlib.pyplot as plt\nimport math\n\ndate=[]\ntime=[]\nd1=[]\nd2=[]\nrpm=[]\nflag=0\nf = open('data16.txt')\nline = f.readline()\nwhile line:\n lol=line.split('T')\n lee=lol[1].split('\\n')\n lol=lol[0].split()\n # print(lol[`/`])\n if lol[1]==\"20191110\":\n flag=1\... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
BenAlWalker/pytorch | [
"606a792dce8cb363dea2c0b39420236520a48236"
] | [
"torch/testing/_internal/common_methods_invocations.py"
] | [
"from functools import wraps, partial\nfrom itertools import product, chain, islice\nimport itertools\nimport collections\nimport copy\nfrom enum import Enum\nimport operator\nimport random\nimport unittest\nimport math\n\nimport torch\nimport numpy as np\nfrom torch._six import inf\nimport collections.abc\n\nfrom ... | [
[
"torch.all",
"torch.pca_lowrank",
"torch.lu_unpack",
"torch.randint",
"numpy.sqrt",
"torch.zeros",
"numpy.minimum",
"torch.linalg.lu_factor",
"numpy.searchsorted",
"torch.where",
"torch.device",
"torch.topk",
"torch.testing._internal.common_utils.is_iterable_of_... |
wps712/BitSpl | [
"ed8a8eee65ac54bd32f002c107ea55352a192012"
] | [
"models/resnet.py"
] | [
"import torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\n\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152']\n\n\nmodel_urls = {\n 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',\n 'resnet34': 'https://download.pytorch.org/model... | [
[
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.utils.model_zoo.load_url",
"torch.nn.init.kaiming_normal_"
]
] |
SeanLee97/clfzoo | [
"8c51ee316d51a4ec1d3e0c5c91a64248d6705214",
"8c51ee316d51a4ec1d3e0c5c91a64248d6705214"
] | [
"clfzoo/libs/loss.py",
"clfzoo/base.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\nfrom tensorflow.python.ops import array_ops\n\ndef spread_loss(labels, activations, margin):\n activations_shape = activations.get_shape().as_list()\n mask_t = tf.equal(labels, 1)\n mask_i = tf.equal(labels, 0) \n activations_t = tf.reshape(\n ... | [
[
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.equal",
"tensorflow.boolean_mask",
"tensorflow.python.ops.array_ops.where",
"tensorflow.squeeze",
"tensorflow.nn.sigmoid",
"tensorflow.gather_nd",
"tensorflow.pow",
"tensorflow.shape",
"ten... |
tgisaturday/pytorch-image-models | [
"bc25e17bed586148ff43008d0e2f9017297b258e"
] | [
"timm/models/quantization/rexnet.py"
] | [
"\"\"\" ReXNet\n\nA PyTorch impl of `ReXNet: Diminishing Representational Bottleneck on Convolutional Neural Network` -\nhttps://arxiv.org/abs/2007.00992\n\nAdapted from original impl at https://github.com/clovaai/rexnet\nCopyright (c) 2020-present NAVER Corp. MIT license\n\nChanges for timm, feature extraction, an... | [
[
"torch.nn.Sequential",
"torch.nn.ReLU6",
"torch.quantization.fuse_modules",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.quantization.DeQuantStub",
"torch.nn.quantized.FloatFunctional",
"torch.quantization.QuantStub"
]
] |
qingquansong/detext | [
"66df145e653ce05af094d3379e27b60d0d3c81b4"
] | [
"src/detext/train/optimization.py"
] | [
"import re\nimport tensorflow as tf\n\n\ndef create_optimizer(hparams, loss):\n \"\"\"\n Creates an optimizer training op.\n If the parameter lr_bert is specified, then use another adam for this learning rate.\n \"\"\"\n tvars = tf.trainable_variables()\n\n # Print trainable variables\n print(\... | [
[
"tensorflow.train.polynomial_decay",
"tensorflow.multiply",
"tensorflow.constant",
"tensorflow.zeros_initializer",
"tensorflow.cast",
"tensorflow.gradients",
"tensorflow.train.get_or_create_global_step",
"tensorflow.clip_by_global_norm",
"tensorflow.train.GradientDescentOptimiz... |
416104443/QUANTAXIS | [
"23907d5e1398bb57f3e8d9d50c21d9fb5bfe3e86"
] | [
"QUANTAXIS/QABacktest/QABacktest_stock_day.py"
] | [
"# coding=utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2017 yutiansut/QUANTAXIS\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 withou... | [
[
"numpy.asarray"
]
] |
Tarheel-Formal-Methods/kaa-optimize | [
"35fe7b580df3b5efe7de9314b821c257f68d74bf"
] | [
"models/basic/basic.py"
] | [
"import sympy as sp\nimport numpy as np\n\nfrom kaa.bundle import Bundle\nfrom kaa.model import Model\n\nclass Basic(Model):\n\n def __init__(self):\n\n x,y = sp.Symbol('x'), sp.Symbol('y')\n\n dx = x + 1\n dy = y + 1\n\n dyns = [dx, dy]\n vars = [x, y]\n\n #L = np.empt... | [
[
"numpy.empty"
]
] |
Landanjs/composer | [
"de75822706bc8a33e7d487b33a0b994944b9c806"
] | [
"tests/common/datasets.py"
] | [
"# Copyright 2022 MosaicML Composer authors\n# SPDX-License-Identifier: Apache-2.0\n\nimport dataclasses\nfrom typing import List, Optional, Sequence\n\nimport pytest\nimport torch\nimport torch.utils.data\nimport yahp as hp\nfrom PIL import Image\nfrom torch.utils.data import Dataset\nfrom torchvision.datasets imp... | [
[
"torch.randn",
"torch.utils.data.SequentialSampler",
"torch.randint",
"torch.utils.data.RandomSampler"
]
] |
roosephu/boots | [
"2f4f500f54feb95cf36abd863f3de4510d6f4950"
] | [
"boots/v_function/mlp_v_function.py"
] | [
"from typing import List\nimport tensorflow as tf\nimport lunzi as lz\nfrom lunzi.typing import *\nimport lunzi.nn as nn\n\n\nclass MLPVFunction(nn.Module, BaseVFunction):\n def __init__(self, dim_state: int, hidden_sizes: List[int], normalizer: nn.Module = None):\n super().__init__()\n\n self.mlp ... | [
[
"tensorflow.placeholder"
]
] |
iseong83/3d_object_reconstruction | [
"f104cdf9cf7c5a0a7d659073923b991b8ebc5b9f"
] | [
"Reco3D/lib/vis.py"
] | [
"import io\nimport os\nimport re\nimport json\nimport sys\nimport math\nimport shutil\nimport numpy as np\n#import tensorflow as tf\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom skimage import exposure\nfrom PIL import Im... | [
[
"numpy.rollaxis",
"matplotlib.pyplot.imsave",
"matplotlib.pyplot.imshow",
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.unique",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.savefig",
"numpy.argmax",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.clf",
"matplo... |
robmcmullen/vispy | [
"8d5092fdae4a24fc364ae51c7e34e12d3fd6d0a2"
] | [
"examples/demo/gloo/shadertoy.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# vispy: gallery 2, testskip\n# Copyright (c) 2014, Vispy Development Team.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\n\"\"\"\nShadertoy demo. You can copy-paste shader code from an example on\nwww.shadertoy.com and get the demo.\n\... | [
[
"numpy.random.randint"
]
] |
Maniues/Wav2Lip | [
"b2b5351f30efb5b580b1d006ddb53413b9fec3d6"
] | [
"audio.py"
] | [
"import librosa\nimport librosa.filters\nimport numpy as np\nimport tensorflow as tf\nfrom scipy import signal\nfrom scipy.io import wavfile\nfrom hparams import hparams as hp\n\ndef load_wav(path, sr):\n return librosa.core.load(path, sr=sr)[0]\n\ndef save_wav(wav, path, sr):\n wav *= 32767 / max(0.01, np.ma... | [
[
"numpy.dot",
"numpy.log",
"numpy.maximum",
"numpy.abs",
"numpy.power",
"numpy.clip",
"scipy.signal.lfilter"
]
] |
ibusko/glue-jupyter | [
"af67da018152a4fa29c54048a9277a8a43fa06b9"
] | [
"glue_jupyter/bqplot/image/state.py"
] | [
"import numpy as np\n\nfrom echo import CallbackProperty\nfrom glue.viewers.matplotlib.state import (DeferredDrawCallbackProperty as DDCProperty,\n DeferredDrawSelectionCallbackProperty as DDSCProperty)\n\nfrom glue.viewers.image.state import ImageLayerState\nfrom glue.core... | [
[
"numpy.linspace"
]
] |
mzhao035/models | [
"1ac9639950ad81d7fde607a4f75e14c6f1b6d993"
] | [
"research/deeplab/eval_bk.py"
] | [
"# Lint as: python2, python3\n# Copyright 2018 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/L... | [
[
"tensorflow.equal",
"tensorflow.contrib.metrics.aggregate_metric_map",
"tensorflow.gfile.MakeDirs",
"tensorflow.get_default_graph",
"tensorflow.group",
"tensorflow.summary.scalar",
"tensorflow.Graph",
"tensorflow.contrib.training.evaluate_repeatedly",
"tensorflow.greater",
... |
arthurdouillard/continuum | [
"83e7437944486cabd5e4c149d41816dbef49b7bf"
] | [
"continuum/datasets/base.py"
] | [
"import abc\nimport os\nimport warnings\nfrom typing import Callable, List, Optional, Tuple, Union\n\nimport numpy as np\nimport h5py\nfrom torchvision import datasets as torchdata\nfrom torchvision import transforms\n\nfrom continuum.tasks import TaskSet, TaskType\nfrom continuum.transforms import segmentation as ... | [
[
"numpy.array",
"numpy.unique"
]
] |
Elektriman/fractal_curves | [
"35acaea4fc53d2bcfe0006189b40a92f5fd10fdd"
] | [
"sierpinski_triangle.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Aug 31 22:04:01 2021\r\n\r\n@author: Julien\r\n\r\nhttps://en.wikipedia.org/wiki/Sierpi%C5%84ski_triangle\r\n\"\"\"\r\n\r\n# _____ _ \r\n# |_ _| | | \r\n# | | _ __ ___ _ __ ___ _ __| |_ ___ ... | [
[
"numpy.exp",
"matplotlib.pyplot.show",
"numpy.sin",
"matplotlib.pyplot.axis"
]
] |
jenshenriksson/pytorch-cifar | [
"9e5d370ddd233eef445cef7c525ed23acfae8953"
] | [
"main.py"
] | [
"'''Train CIFAR10 with PyTorch.'''\nfrom __future__ import print_function\n\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport argparse\n\nfrom models import *\nfrom pytorch_eval import pytorch_train, pytorch_tes... | [
[
"torch.optim.lr_scheduler.CosineAnnealingLR"
]
] |
zhnagchulan/vectorbt | [
"6b199f6cc8c32fc5eeaa10f88bf8aa81774969c9"
] | [
"vectorbt/portfolio/base.py"
] | [
"\"\"\"Base class for modeling portfolio and measuring its performance.\n\nProvides the class `vectorbt.portfolio.base.Portfolio` for modeling portfolio performance\nand calculating various risk and performance metrics. It uses Numba-compiled\nfunctions from `vectorbt.portfolio.nb` for most computations and record ... | [
[
"pandas.DataFrame.vbt.empty_like",
"pandas.Series",
"numpy.abs",
"numpy.isnan",
"numpy.arange",
"numpy.cumsum",
"pandas.DataFrame",
"numpy.max",
"numpy.mean",
"numpy.any",
"numpy.where"
]
] |
JoungheeKim/emotion_recognition | [
"96dbcf432a23553b9d573e8388ecc22195f1d85e"
] | [
"src/process/label_preprocess.py"
] | [
"import io\nimport os\nimport pandas as pd\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport pandas as pd\nfrom .base_preprocess import BaseProcessor, BasicProcessConfig\nimport numpy as np\nimport logging\nfrom dataclasses import _MISSING_TYPE, dataclass, field\n\n@dataclass\nclass LabelPreprocessConfig(Bas... | [
[
"numpy.array"
]
] |
rtajan/eirballoon | [
"0eded8f86174a9e5ed38297fa26c7f5a53b5ea53"
] | [
"tests/python/synchro_freq_fine.py"
] | [
"from numba import jit\nfrom py_aff3ct.module.py_module import Py_Module\nfrom math import *\nimport numpy as np\nimport sys\nsys.path.insert(0, '../../build/lib')\n\n\nclass synchro_freq_fine(Py_Module):\n @jit(nopython=True, nogil=True, cache = True)\n def func_(s_in, s_out, previousSample, phase, loopFiltS... | [
[
"numpy.real",
"numpy.imag"
]
] |
sulabh-shr/pytorch-deeplab-xception | [
"9135e104a7a51ea9effa9c6676a2fcffe6a6a2e6"
] | [
"train.py"
] | [
"import argparse\nimport os\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom mypath import Path\nfrom dataloaders import make_data_loader\nfrom modeling.sync_batchnorm.replicate import patch_replication_callback\nfrom modeling.deeplab import *\nfrom utils.loss import SegmentationLosses\nfrom utils.calculate_weigh... | [
[
"numpy.load",
"numpy.argmax"
]
] |
wegamekinglc/incubator-airflow | [
"fc174635b0729253a86e8c877d6d8551a815a2cb"
] | [
"airflow/providers/oracle/hooks/oracle.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\")... | [
[
"numpy.isnan"
]
] |
NgvTue/test2 | [
"d475cb2fed16b46185adbe50b4179d5299c791cb"
] | [
"speech_dia_@/src/pyannote_xxx/core/feature.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\n# The MIT License (MIT)\n\n# Copyright (c) 2014-2019 CNRS\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, includin... | [
[
"numpy.arange",
"numpy.vstack",
"numpy.tile",
"numpy.interp",
"numpy.empty"
]
] |
HERA-Team/pyuvsim | [
"d5ae72b06e4bad07433c3fc8073bebb43a3be399"
] | [
"pyuvsim/tests/test_antenna.py"
] | [
"# -*- mode: python; coding: utf-8 -*\n# Copyright (c) 2021 Radio Astronomy Software Group\n# Licensed under the 3-clause BSD License\nimport os\n\nimport numpy as np\nimport yaml\nfrom astropy import units\nimport pytest\nimport pyuvdata.tests as uvtest\n\nimport pyuvsim\nfrom pyuvsim.data import DATA_PATH as SIM_... | [
[
"numpy.meshgrid",
"numpy.linspace",
"numpy.arange",
"numpy.all",
"numpy.array",
"numpy.zeros"
]
] |
frgfm/sdcnd-capstone | [
"75b0c83ea4c01be4d249caa1a0e4faff7419b2b7"
] | [
"ros/src/styx/bridge.py"
] | [
"\nimport rospy\n\nimport tf\nfrom geometry_msgs.msg import PoseStamped, Quaternion, TwistStamped\nfrom dbw_mkz_msgs.msg import SteeringReport, ThrottleCmd, BrakeCmd, SteeringCmd\nfrom std_msgs.msg import Float32 as Float\nfrom std_msgs.msg import Bool\nfrom sensor_msgs.msg import PointCloud2\nfrom sensor_msgs.msg ... | [
[
"numpy.asarray"
]
] |
xuzhenghao0502/CarND-Capstone | [
"57aa0e961e727f120af5aaa28660e2b865b014cc"
] | [
"traffic_light_classifier_training/tl_detector_model.py"
] | [
"import glob\nimport cv2\nimport numpy as np\n\n\nimport tensorflow as tf\nfrom keras.layers import Dense, Flatten, Lambda, Activation, MaxPooling2D, Conv2D, Dropout\nfrom keras.layers.convolutional import Convolution2D\nfrom keras.models import Sequential\nfrom keras.optimizers import Adam\nfrom keras.utils.np_uti... | [
[
"sklearn.utils.shuffle",
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.