repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
geraldmc/DL4CV-2022
[ "d734290849244816e4861efc0578325684c58409" ]
[ "project-I/loader/gtsrb_data.py" ]
[ "import os\nimport torch\nimport pandas as pd\nfrom skimage import io, transform\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\nfrom PIL import Image\n\nfrom loader.transforms import base_transform\n\n# See: https://...
[ [ "pandas.read_csv" ] ]
Shikhargupta/rl-teacher-atari
[ "fd6c399921d347333d7c5b4b12c63f1a955cea5c" ]
[ "agents/ga3c/ga3c/Environment.py" ]
[ "# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of c...
[ [ "numpy.dot", "scipy.misc.imresize", "numpy.array", "numpy.transpose" ] ]
nickmarton/kaggle
[ "ca1a0e0de18be505e271ad2e4018c8524fd7c33d" ]
[ "Titanic/Visualizer.py" ]
[ "\"\"\"Visualize data.\"\"\"\n\nfrom __future__ import division, print_function\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\ndef zipper(frame, *columns):\n \"\"\"Zip given columns of a frame together.\"\"\"\n return (np.array(frame[[col for col in columns]]))\n\n\ndef ticket_...
[ [ "pandas.read_csv", "numpy.array", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ] ]
sundarjhu/DAWGI_Lectures_2021
[ "8d6d1db3eff6505d1e90597b8b94c6db39240ac3" ]
[ "Demo_DAWGI_HBM/Pleiades/Marginal_SFH_Bar_NoScale.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.interpolate\nimport a_statistics_def_fun as st_def\nplt.style.use('classic')\n\n\ndef list_ticks(x):\n x_tk=[]\n for i in x:\n if i%1.==0.:\n x_tk.append(str(int(i)))\n else:\n x_tk.append(str(i))\n ...
[ [ "numpy.sum", "numpy.unique", "numpy.arange", "numpy.round", "numpy.append", "numpy.array", "matplotlib.pyplot.style.use" ] ]
jvmcgovern/model2roms_MI
[ "0085acd29d15b319dbe76ce27fe76bebbe5c5352" ]
[ "clim2bry.py" ]
[ "\"\"\"\nThis is CLM2BRY\n\"\"\"\nfrom datetime import datetime\n\nimport numpy as np\nfrom netCDF4 import Dataset, num2date\n\nimport IOBry\n\n__author__ = 'Trond Kristiansen'\n__email__ = 'me@trondkristiansen.com'\n__created__ = datetime(2009, 3, 2)\n__modified__ = datetime(2019, 3, 12)\n__version__ = \"1.5\"\n__...
[ [ "numpy.squeeze", "numpy.array" ] ]
loveisacat/mappo
[ "8a9f705858232bfc7622f051e0ec78db895ff2f2" ]
[ "onpolicy/runner/shared/base_runner.py" ]
[ "import wandb\nimport os\nimport numpy as np\nimport torch\nfrom tensorboardX import SummaryWriter\nfrom onpolicy.utils.shared_buffer import SharedReplayBuffer\nfrom onpolicy.algorithms.utils.darnet import DarNet\nfrom onpolicy.algorithms.utils.tranback import BackNet\n\n\n\ndef _t2n(x):\n \"\"\"Convert torch te...
[ [ "numpy.concatenate", "torch.no_grad", "numpy.mean" ] ]
Anthony102899/Lego-ImageGenerator
[ "52b19c8bb20f77a3394675e7c037c943a50c1e15", "52b19c8bb20f77a3394675e7c037c943a50c1e15" ]
[ "solvers/rigidity_solver/main_3d.py", "solvers/rigidity_solver/eigen_analysis.py" ]
[ "from bricks_modeling.file_IO.model_reader import read_bricks_from_file\nfrom bricks_modeling.file_IO.model_writer import write_bricks_to_file\nfrom bricks_modeling.connectivity_graph import ConnectivityGraph\nimport numpy as np\nfrom util.debugger import MyDebugger\nfrom solvers.rigidity_solver.algo_core import so...
[ [ "numpy.array", "numpy.linalg.eigh", "numpy.linalg.norm", "numpy.linalg.matrix_rank" ], [ "numpy.linalg.inv", "numpy.linalg.multi_dot", "numpy.linalg.norm", "scipy.linalg.cholesky", "numpy.transpose", "scipy.linalg.null_space" ] ]
KonstantinKlepikov/covid-kaliningrad
[ "bd7402c07661cf93ad0e4bda69d22c7449660d60" ]
[ "supportFunction.py" ]
[ "import streamlit as st\nimport numpy as np\nimport pandas as pd\nfrom drawTools import Linear\n\n\n\"\"\"Support functions for data visualistion, wraped with cache decorator\nreduces app loading time\n\"\"\"\n\n\ncTime = 900. # cache time\n\n\n@st.cache(allow_output_mutation=True, ttl=cTime)\ndef dataloader(url):\...
[ [ "pandas.read_csv" ] ]
Lcrypto/CGO2019-AE
[ "cba7598b42f10eab655a8907a6db71094c1f558d" ]
[ "fb-tc/fb-wo-tuning/input_tccg_1.py" ]
[ "# tccg-1\nimport time\nimport tensor_comprehensions as tc\nimport torch\n\nlang = \"\"\"\ndef tccg1(float(G, D, A, B) L, float(E, F, G, C) R) -> (O) {\n\tO(a, b, c, d, e, f) +=! L(g, d, a, b) * R(e, f, g, c)\n}\n\"\"\"\n\nprint (\"tccg-40: O(a, b, c, d, e, f) +=! L(g, d, a, b) * R(e, f, g, c)\")\nprint (\"(a,b,c,d...
[ [ "torch.randn", "torch.cuda.synchronize" ] ]
raeidsaqur/ml-gradientdescent
[ "a061423c8e9c131ad05970d7cbaf2f42f646db1c" ]
[ "optdemo.py" ]
[ "import numpy as np\nimport pylab\nfrom scipy.optimize import line_search\n\ndef steepest_descent(grad_fun,params,num_iters, *varargs):\n ## Learning Rates\n #eta = 0.1\n eta = 2\n #eta = 3\n\n ## Momentum\n alpha=0.7\n momentum=True\n\n d = np.ones(params.shape)\n d = d / np.linalg.norm(...
[ [ "numpy.dot", "numpy.hstack", "numpy.random.seed", "numpy.linspace", "numpy.linalg.norm", "numpy.ones", "numpy.random.randn", "numpy.array", "numpy.meshgrid", "numpy.zeros" ] ]
bratao/DeepSpeed
[ "c50d8955e942e5e26cf81835d59ec3f20ef8540d" ]
[ "deepspeed/runtime/activation_checkpointing/checkpointing.py" ]
[ "'''\r\nCopyright (c) Microsoft Corporation\r\nLicensed under the MIT license.\r\n\r\nUse to partition the activations stored for backward propagation\r\nTherefore reduces the memory consumption\r\nAlso implements CPU checkpointing and contiguous memory checkpointing\r\nReduces memory consumption and memory fragmen...
[ [ "torch.set_rng_state", "torch.cuda._lazy_call", "torch.zeros", "torch.no_grad", "torch.device", "torch.distributed.get_rank", "torch.cuda.synchronize", "torch.autograd.backward", "torch.tensor", "torch.cuda.memory_cached", "torch.enable_grad", "torch.cuda.current_de...
paulromano/armi
[ "6c4fea1ca9d256a2599efd52af5e5ebe9860d192" ]
[ "armi/bookkeeping/db/tests/test_database3.py" ]
[ "# Copyright 2019 TerraPower, LLC\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...
[ [ "numpy.eye", "numpy.array" ] ]
grst/scanorama
[ "75f1a80166cb3b29e8a4b7adff7f76d0379d848e" ]
[ "bin/integration_panorama.py" ]
[ "from process import load_names\nfrom scanorama import *\n\nfrom time import time\nimport numpy as np\n\nNAMESPACE = 'panorama_integrated'\n\nif __name__ == '__main__':\n from config import data_names\n\n datasets, genes_list, n_cells = load_names(data_names)\n datasets, genes = merge_datasets(datasets, ge...
[ [ "numpy.array", "numpy.zeros" ] ]
chanakya1310/background-score-prediction
[ "e56a5534e9a26a459a8ff561594a2fdef5276f7f" ]
[ "src/main/python/Emotion_Detection2.py" ]
[ "from keras.preprocessing.image import img_to_array\nimport imutils\nimport cv2\nfrom keras.models import load_model\nimport numpy as np\nimport argparse\nfrom collections import Counter \nimport time\nfrom tensorflow import keras\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Flatte...
[ [ "numpy.array", "numpy.argmax" ] ]
paramraghavan/beginners-py-learn
[ "120db42b3ad304915d5be172f4ebc555ef2cb405" ]
[ "src/funstuff/zoom_word_cloud.py" ]
[ "'''\nCreate background image for online work meetings and interviews.\nReferenced from :\nhttps://towardsdatascience.com/fun-valentines-day-gift-ideas-for-python-programmers-a27e87b9211b\nhttps://python-course.eu/applications-python/python-wordcloud-tutorial.php\nhttps://python-course.eu/applications-python\nhttps...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ] ]
iamshayankarami/write_with_pen_with_python
[ "90603edef33dc9b9d089e456fdccab2dfdf747d5" ]
[ "Test_image.py" ]
[ "import cv2\n\nimport numpy as np\nimport sys\nimport imutils, argparse\nfrom collections import deque\n\nvideo = cv2.VideoCapture(0)\n\nlow_blue = np.array([110,50,50])\nhigh_blue = np.array([130,255,255])\nshow_line = True\npoint = []\nwhile True:\n ret, frame = video.read()\n Shape = frame.shape\n if fr...
[ [ "numpy.array" ] ]
TnTech-CEROC/irp-logs-mining
[ "e20b409688e950da9f5bf5e5b94d98ebec0a842d" ]
[ "Dataset/data_processing.py" ]
[ "__author__ = \"Md. Ahsan Ayub\"\n__license__ = \"GPL\"\n__credits__ = [\"Ayub, Md. Ahsan\", \"Martindale, Nathan\", \"Smith, Steven\",\n \"Siraj, Ambareen\"]\n__maintainer__ = \"Md. Ahsan Ayub\"\n__email__ = \"mayub42@students.tntech.edu\"\n__status__ = \"Prototype\"\n\n# Importing libraries\nimport ...
[ [ "pandas.to_timedelta", "pandas.get_dummies" ] ]
funcional-health-analytics/covid19-analytics
[ "8aba46dd6f75b8313f26d073078c40065e62ec21" ]
[ "src/app_interactive_seir/visualization/plot_simulation.py" ]
[ "import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport streamlit as st\n\n# plt.style.use(\"seaborn-whitegrid\")\n\n\ndef plot_simulation_output(df: pd.DataFrame, target_location: str):\n df = df[[\"S\", \"E\", \"I\", \"R\", \"E+I\", \"E+I+R\"]]\n\n fig1 = plt.figure()\n sns.d...
[ [ "pandas.DateOffset", "matplotlib.pyplot.grid", "matplotlib.pyplot.xticks", "pandas.Timestamp", "matplotlib.pyplot.figure" ] ]
Lewis-Picker/VIP
[ "494190d124dd19e3494b0825b4c82c37d8207074" ]
[ "vip_hci/var/fit_2d.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\n2d fitting and creation of synthetic PSFs.\n\"\"\"\n\n\n__author__ = 'Carlos Alberto Gomez Gonzalez'\n__all__ = ['create_synth_psf',\n 'fit_2dgaussian',\n 'fit_2dmoffat',\n 'fit_2dairydisk']\n\nimport pdb\nimport numpy as np\nimport pandas as pd\nimpo...
[ [ "numpy.diag", "numpy.sqrt", "numpy.arange", "numpy.indices", "numpy.ptp", "numpy.rad2deg", "pandas.DataFrame", "numpy.deg2rad", "numpy.random.randn", "numpy.array", "numpy.meshgrid", "numpy.where", "numpy.zeros" ] ]
mle-infrastructure/mle-monitor
[ "5451986d3ca6855ec78be343a8147235f893ef8f" ]
[ "mle_monitor/resource/gcp.py" ]
[ "import time\nimport subprocess as sp\nimport pandas as pd\nfrom typing import Union\n\n\nclass GCPResource(object):\n def __init__(self, monitor_config: Union[dict, None]):\n self.resource_name = \"gcp-cloud\"\n self.monitor_config = monitor_config\n\n def monitor(self):\n \"\"\"Helper t...
[ [ "pandas.DataFrame" ] ]
mmurray/merged_depth
[ "a99a518b228c1693e1078d2f4832bcbc03e0924c" ]
[ "merged_depth/nets/DiverseDepth/lib/models/lateral_net.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nfrom lib.core.config import cfg\r\nimport lib.models.ResNeXt as ResNeXt\r\nimport lib.utils.resnext_weights_helper as resnext_utils\r\nimport lib.utils.mobilenetv2_weight_helper as mobilenet_utils\r\nfrom torch.nn import functional as F\r\nimport math\r\n\r\ndef lateral_res...
[ [ "torch.nn.init.kaiming_normal", "torch.nn.Softmax", "torch.nn.Dropout2d", "torch.cat", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.init.xavier_normal_", "torch.nn.Sigmoid", "torch.nn.AdaptiveAvgPool2d", "torch.nn.init.normal_", "to...
EdisonLeeeee/SGAttack
[ "406a836e85294e5588503cf0a6495a82d58ada77" ]
[ "src/ego_graph.py" ]
[ "import numpy as np\r\n\r\nfrom numba import njit\r\nfrom numba import types\r\nfrom numba.typed import Dict\r\n\r\nfrom typing import Union, Tuple\r\n\r\n\r\n\r\n@njit\r\ndef extra_edges(indices, indptr,\r\n last_level, seen,\r\n hops: int):\r\n edges = []\r\n mapping = Dict.emp...
[ [ "numpy.ndim", "numpy.array", "numpy.zeros", "numpy.asarray" ] ]
JoOkuma/DifferentiableSketching
[ "6672508bd362d90e9bfc07966cb7907879d01385" ]
[ "dsketch/models/decoders.py" ]
[ "from numbers import Number\n\nimport torch\nimport torch.nn as nn\n\nfrom dsketch.raster.composite import softor\nfrom dsketch.raster.disttrans import line_edt2\nfrom dsketch.raster.raster import exp\n\n\nclass _RasteriserBase(nn.Module):\n def __init__(self, sz):\n super(_RasteriserBase, self).__init__(...
[ [ "torch.stack", "torch.linspace", "torch.meshgrid" ] ]
estshorter/robotics
[ "38db0e3097b547a94e5a604e1a23b3bd7228f00b" ]
[ "rrt_star.py" ]
[ "import math\r\n\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom rrt import RRT\r\n\r\nshow_animation = True\r\n\r\n\"\"\"\r\nPath planning Sample Code with Randomized Rapidly-Exploring Random Trees (RRT)\r\nauthor: AtsushiSakai(@Atsushi_twi)\r\n\r\nThe MIT License (MIT)\r\n\r\nCopyright (c) 2016 - 2021 Atsushi Saka...
[ [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.pause" ] ]
flaviodsr/examples
[ "7d7c2c448e49d89289a7821061aa99ba5a3126e5" ]
[ "codesets/mlflow/onnx/train.py" ]
[ "# The data set used in this example is from http://archive.ics.uci.edu/ml/datasets/Wine+Quality\n# P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis.\n# Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009.\n\nimport os\nimport ...
[ [ "pandas.read_csv", "sklearn.metrics.r2_score", "numpy.random.seed", "sklearn.linear_model.ElasticNet", "sklearn.metrics.mean_absolute_error", "sklearn.model_selection.train_test_split", "sklearn.metrics.mean_squared_error" ] ]
raphaelvallat/yasa
[ "4d23501a77e16d878779250706f16df4f5eb6296" ]
[ "yasa/spectral.py" ]
[ "\"\"\"\nThis file contains several helper functions to calculate spectral power from\n1D and 2D EEG data.\n\"\"\"\nimport mne\nimport logging\nimport numpy as np\nimport pandas as pd\nfrom scipy import signal\nfrom scipy.integrate import simps\nfrom scipy.interpolate import RectBivariateSpline\n\nlogger = logging....
[ [ "numpy.sqrt", "numpy.asarray", "scipy.signal.stft", "numpy.squeeze", "numpy.ma.masked_outside", "numpy.in1d", "pandas.DataFrame", "numpy.round", "numpy.mean", "scipy.optimize.curve_fit", "numpy.divide", "scipy.signal.welch", "numpy.hstack", "numpy.arange", ...
coreqode/DataAug_GUI
[ "2c830b76c57a5b860d03c122c961cac692c70d04" ]
[ "transfer.py" ]
[ "\"\"\"\nCopyright (c) 2019 NAVER Corp.\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, copy, modify, merge, publish...
[ [ "torch.device", "torch.no_grad", "torch.cuda.is_available" ] ]
hugofloresgarcia/MusEEG
[ "f648a4028b529bfdfc6bd0e9b282983ba6993a93" ]
[ "docs/_documentation/chapters/code/classifier.py" ]
[ "import os\nimport pandas\nimport numpy as np\nfrom tensorflow import keras\nfrom keras import regularizers\nfrom MusEEG import parentDir\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.externals import joblib\n\nimport matplotlib.pyplot as plt\n\nclass cl...
[ [ "tensorflow.keras.layers.Dense", "sklearn.metrics.confusion_matrix", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.random.permutation", "numpy.argmax", "tensorflow.keras.backend.clear_session", "sklearn.externals.joblib.load", "sklearn.preprocessing.MinMaxScaler" ] ]
gdiprisco/VisualFlickr
[ "f793d1fe2694c2ed31d527a5092150db26b6f3c7" ]
[ "modules/classifier.py" ]
[ "import os\nimport numpy as np\nimport json\n\n\ndef caffe_import(verbose):\n \"\"\"\n VERBOSE LEVELS\n 0 - debug\n 1 - info\n 2 - warnings\n 3 - errors\n :param verbose: int\n :return:\n \"\"\"\n os.environ['GLOG_minloglevel'] = str(verbose)\n global caffe\n try:...
[ [ "numpy.load", "numpy.save" ] ]
mrakitin/caproto
[ "ad49ffbe1a69ddc63cac9ec7f1a3468a4965e465" ]
[ "caproto/ioc_examples/too_clever/trigger_with_pc.py" ]
[ "#!/usr/bin/env python3\nimport contextvars\nimport functools\nimport random\nimport sys\nfrom textwrap import dedent\n\nimport numpy as np\n\nfrom caproto import ChannelType\nfrom caproto.server import PVGroup, ioc_arg_parser, pvproperty, run\n\ninternal_process = contextvars.ContextVar('internal_process',\n ...
[ [ "numpy.random.rand" ] ]
LeiSoft/CueObserve
[ "cc5254df7d0cb817a8b3ec427f5cb54a1d420f7e" ]
[ "api/ops/tasks/detection/core/detectionTypes/percentageChange.py" ]
[ "import dateutil.parser as dp\nfrom dateutil.relativedelta import relativedelta\nimport pandas as pd, datetime as dt\n\n\ndef checkLatestAnomaly(df):\n \"\"\"\n Looks up latest anomaly in dataframe\n \"\"\"\n anomalies = df[df[\"anomaly\"] == 15]\n if anomalies.shape[0] > 0:\n lastAnomalyRow =...
[ [ "pandas.to_datetime" ] ]
KyleLevi/BAM_Scripts
[ "71805b57ee81cb3bd4e30f96a6236d8d8e148df7" ]
[ "bin/csv_to_heatmap.py" ]
[ "import numpy as np\nfrom numpy import vstack # VSTACK((a,b)) stacks B on TOP of A\nimport seaborn as sns; sns.set()\nimport matplotlib.pyplot as plt\nimport math\nimport argparse\nimport sys\n\n\ndef csv_to_numpy(csv_file):\n \"\"\"\n Reads in a CSV file and returns a numpy array\n :param csv_file: Strin...
[ [ "numpy.vstack", "numpy.array", "matplotlib.pyplot.savefig" ] ]
szczeles/feast
[ "ae1e4b9677e737d289464283f11222fd48f1960d" ]
[ "tests/e2e/test_historical_features.py" ]
[ "from datetime import datetime, timedelta\nfrom typing import Union\nfrom urllib.parse import urlparse\n\nimport gcsfs\nimport numpy as np\nimport pandas as pd\nfrom google.protobuf.duration_pb2 import Duration\nfrom pandas._testing import assert_frame_equal\nfrom pyarrow import parquet\n\nfrom feast import Client,...
[ [ "pandas.read_parquet", "numpy.random.rand", "numpy.random.seed", "pandas.DataFrame" ] ]
jshower/models
[ "c48b1c51d1eb581c399a5046ad61b34ebad4f1a6" ]
[ "fluid/PaddleCV/gan/cycle_gan/train.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport os\nimport random\nimport sys\nimport paddle\nimport argparse\nimport functools\nimport time\nimport numpy as np\nfrom scipy.misc import imsave\nimport paddle.fluid as fluid\nimport paddle.fluid.p...
[ [ "numpy.squeeze", "numpy.mean", "numpy.random.seed" ] ]
annakuchko/FinNetwork
[ "4566ff96b33fb5668f9b28f41a94791d1cf9249c" ]
[ "finetwork/transformer/market_cycles.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\nfrom finetwork.data_collector.import_data import FinData\r\nfrom finetwork.transformer.splitter import Split\r\nimport finetwork.plotter._plot_market_cycles as pmc\r\n\r\nclass MarketCycle:\r\n def __init__(self, \r\n benchmark_index,\r\n ...
[ [ "numpy.isnan", "pandas.DateOffset", "numpy.abs" ] ]
GuQiangJS/LSTM-for-Stock
[ "3bae9e5075f5c612a125726777c8275e805ccd9e" ]
[ "samples/jupyter_helper.py" ]
[ "import os\nimport sys\nimport time\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\n# import wmi\nfrom keras.backend import clear_session\nfrom scipy import stats\n\nfrom LSTM_for_Stock.data_processor import DataHelper\nfrom LSTM_for_Stock.data_...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
fangfy/wofs
[ "504cb53bfc33c9a667fafba99f2160c0ddcb281c" ]
[ "wofs/terrain.py" ]
[ "import math\n\nimport ephem\nimport numpy\nimport xarray\nfrom datacube.utils.geometry import CRS, line\nfrom pandas import to_datetime\nfrom scipy import ndimage\n\nUNKNOWN = -1\nLIT = 255\nSHADED = 0\n\n\ndef _shade_row(shade_mask, elev_m, sun_alt_deg, pixel_scale_m, no_data, fuzz=0.0):\n \"\"\"\n shade th...
[ [ "pandas.to_datetime", "numpy.sqrt", "numpy.pad", "numpy.arange", "scipy.ndimage.sobel", "numpy.arccos", "scipy.ndimage.interpolation.rotate", "numpy.zeros_like", "numpy.where" ] ]
shjoshi/vispy
[ "2f3d169aa60c738467e766c59096f51570483d6f", "2f3d169aa60c738467e766c59096f51570483d6f" ]
[ "vispy/util/tests/test_dataio.py", "examples/demo/gloo/boids.py" ]
[ "import numpy as np\nfrom os import path as op\nfrom nose.tools import assert_equal, assert_raises\nfrom numpy.testing import assert_allclose, assert_array_equal\nimport warnings\n\nfrom vispy.util.dataio import write_mesh, read_mesh, crate, imsave, imread\nfrom vispy.util._geom import _fast_cross_3d\nfrom vispy.ut...
[ [ "numpy.testing.assert_array_equal", "numpy.random.rand", "numpy.cross", "numpy.where", "numpy.sum", "numpy.testing.assert_allclose" ], [ "numpy.sqrt", "numpy.random.uniform", "numpy.repeat", "numpy.zeros", "scipy.spatial.cKDTree" ] ]
orchardbirds/bokbokbok
[ "3a8c52b7e2f6f80b803ff2e7073f3cfbf8f76b6c" ]
[ "bokbokbok/loss_functions/regression/regression_loss_functions.py" ]
[ "import numpy as np\n\n\ndef LogCoshLoss():\n \"\"\"\n [Log Cosh Loss](https://openreview.net/pdf?id=rkglvsC9Ym) is an alternative to Mean Absolute Error.\n \"\"\"\n\n def _gradient(yhat, dtrain):\n \"\"\"Compute the log cosh gradient.\n\n Args:\n yhat (np.array): Predictions\n ...
[ [ "numpy.tanh", "numpy.cosh" ] ]
jeffrey-hokanson/scipy
[ "ac75879731ff3a40853263f00f51419ab7a11d49" ]
[ "scipy/sparse/linalg/dsolve/linsolve.py" ]
[ "from __future__ import division, print_function, absolute_import\n\nfrom warnings import warn\n\nimport numpy as np\nfrom numpy import asarray, empty, ravel, nonzero\nfrom scipy.sparse import (isspmatrix_csc, isspmatrix_csr, isspmatrix,\n SparseEfficiencyWarning, csc_matrix)\n\nfrom . impo...
[ [ "scipy.sparse.isspmatrix", "scipy.sparse.csc_matrix", "numpy.asarray", "numpy.flatnonzero", "numpy.concatenate", "numpy.ones", "scipy.sparse.isspmatrix_csr", "scipy.sparse.isspmatrix_csc" ] ]
tcstewar/nengo_learning_display
[ "bd2940182743475d0d19b436d295a3398bbb328e" ]
[ "nengo_learning_display/two_dim.py" ]
[ "import nengo\nimport numpy as np\nimport base64\n\ntry:\n from cStringIO import StringIO # Python 2\nexcept ImportError:\n from io import BytesIO as StringIO # Python 3\n\nclass Plot2D(nengo.Node):\n def __init__(self, connection, domain, range, dimension=0):\n import PIL\n from PIL ...
[ [ "numpy.dot", "numpy.clip" ] ]
ypapanik/TDC
[ "3739a918cf3bbb4fc2ef8d6c96d8b809dd8c4d2a" ]
[ "tdc/multi_pred/bi_pred_dataset.py" ]
[ "# -*- coding: utf-8 -*-\n# Author: TDC Team\n# License: MIT\n\nimport pandas as pd\nimport numpy as np\nimport os, sys, json \nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nfrom .. import base_dataset\nfrom ..utils import dataset2target_lists, \\\n fuzzy_search, \\\n ...
[ [ "torch.tensor", "numpy.array", "pandas.DataFrame", "numpy.unique" ] ]
kenkenjlab/burger_war_kit
[ "9332494aa1212805330c01cacc389776a8a354b6" ]
[ "enemy_bot/enemy_bot_level10/teb_local_planner/scripts/export_to_mat.py" ]
[ "#!/usr/bin/env python\n\n# This small script subscribes to the FeedbackMsg message of teb_local_planner\n# and exports data to a mat file.\n# publish_feedback must be turned on such that the planner publishes this information.\n# Author: christoph.roesmann@tu-dortmund.de\n\nimport rospy, math\nfrom teb_local_plann...
[ [ "scipy.io.savemat" ] ]
Philyzh8/Nature-inspired-CS
[ "65e6aa9e983014823ba440205aadb9800d79f4cd" ]
[ "sample_similarity.py" ]
[ "import numpy as np\nfrom dl_simulation import random_phi, get_observations\nfrom union_of_transforms import random_submatrix\nfrom analyze_predictions import *\nfrom scipy.spatial import distance\nfrom scipy.stats import spearmanr\nfrom sklearn.manifold import Isomap, MDS\nimport glob, os\nimport sys\n\n#fp, snr =...
[ [ "numpy.load", "numpy.average", "numpy.percentile" ] ]
rwlee/cudf
[ "77d28496fec322bc80e874be72d832417cf798a1" ]
[ "python/cudf/cudf/groupby/legacy_groupby.py" ]
[ "# Copyright (c) 2018, NVIDIA CORPORATION.\n\nfrom collections import OrderedDict, defaultdict, namedtuple\nfrom itertools import chain\n\nimport numpy as np\nfrom numba import cuda\n\nfrom librmm_cffi import librmm as rmm\n\nfrom cudf.bindings.sort import apply_segsort\nfrom cudf.comm.serialize import register_dis...
[ [ "numpy.asarray", "numpy.zeros" ] ]
hsc1993/GaussianGND
[ "71291384268165a8310d872c055bba4e63532336" ]
[ "main.py" ]
[ "#!/usr/bin/env python\nimport scipy\nfrom scipy import spatial\nfrom scipy.spatial import ConvexHull\n\nimport datetime\nimport gnd_functions\nimport os\nfrom os import path\n\n\n\n#\n# # Face class is used for the combining of multiple coplanar faces of a polyhedron for better visualization and performance\n# cla...
[ [ "scipy.spatial.ConvexHull" ] ]
ellagupta/optical-rl-gym
[ "184d9fd8765060a3165e3dfbda8586f9437bd5d1" ]
[ "optical_rl_gym/envs/deeprmsa_env_sbpp.py" ]
[ "import gym\r\nimport numpy as np\r\n\r\nfrom .rmsa_env_sbpp import RMSASBPPEnv\r\nfrom .optical_network_env import OpticalNetworkEnv\r\n\r\n\r\nclass DeepRMSASBPPEnv(RMSASBPPEnv):\r\n\r\n def __init__(self, topology=None, j=1,\r\n episode_length=1000,\r\n mean_service_holding_tim...
[ [ "numpy.argwhere", "numpy.full", "numpy.mean", "numpy.prod", "numpy.zeros", "numpy.sum" ] ]
TungyuYoung/PaSST
[ "d78688c39faf62b067256e58fa40c3fbe13d9906" ]
[ "models/passt.py" ]
[ "\"\"\"\nMost of this code comes from the timm library.\nWe tried to disentangle from the timm library version.\n\nAdapted from https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py\n\n\"\"\"\nimport math\nimport logging\nimport warnings\nfrom functools import partial\nfro...
[ [ "torch.nn.Dropout", "torch.linspace", "torch.cat", "torch.zeros", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.randperm", "torch.nn.LayerNorm", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.Identity", "torch.nn.init.ones_", "to...
thomasjo/nemo-redux
[ "c4196c0d99633dca011d60008be0cb7667c348b7" ]
[ "src/preprocessing/partition_mask_dataset.py" ]
[ "import json\nimport random\nimport shutil\n\nfrom argparse import ArgumentParser\nfrom pathlib import Path\n\nimport numpy as np\n\nfrom sklearn.model_selection import train_test_split\n\nEXCLUDED_CATEGORIES = [5, 6]\n\n\ndef main(args):\n random.seed(42)\n np.random.seed(42)\n\n json_file = args.source_d...
[ [ "numpy.random.seed", "numpy.unique", "numpy.asarray", "sklearn.model_selection.train_test_split", "numpy.all", "numpy.max", "numpy.argmax", "numpy.any", "numpy.array", "numpy.sum" ] ]
bwdeng20/thgsp
[ "785b3ff291d72ee51e51e4cdbfd4bab63f8de9ac" ]
[ "tests/test_sampling/test_fastgsss.py" ]
[ "import pytest\nimport torch\nimport math\nfrom thgsp.graphs.generators import random_graph\nfrom ..utils4t import devices, float_dtypes, snr_and_mse\nfrom thgsp.sampling.fastgsss import fastgsss, recon_fastssss\n\n\n@pytest.mark.parametrize(\"device\", devices)\n@pytest.mark.parametrize(\"dtype\", float_dtypes)\n@...
[ [ "torch.randn", "torch.rand" ] ]
HoodedPitohui/impact_2021
[ "dac2ff075649ee6ef61fb9db2577568cdd47c22e" ]
[ "code/testing-kshaji/haar1.py" ]
[ "import cv2\nfrom matplotlib import pyplot as plt\n#standard libraries\n# Opening image\nimg = cv2.imread(\"image3.jpg\")\n\nimg_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\nimg_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)\n\n# Use minSize because for not\n# bothering with extra-small\n# dots that would look like ST...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show" ] ]
gusleak/freeCodeCamp
[ "2a9e8ae5c1d8a1c738071f6ce26ef61b64ce5b65" ]
[ "Data_Analysis_with_Python/mean_var_stddev_calculator.py" ]
[ "import numpy as np\n\ndef calculate(initial_list):\n if len(initial_list) < 9:\n raise ValueError('List must contain nine numbers.')\n arr = np.array(initial_list)\n new_arr = arr.reshape(3,3)\n return {\n 'mean': [np.mean(new_arr, axis=0).tolist(), np.mean(new_arr, axis=1).tolist(), np.mean(arr)],\n ...
[ [ "numpy.min", "numpy.max", "numpy.std", "numpy.mean", "numpy.var", "numpy.array", "numpy.sum" ] ]
bevarb/AutoDetect
[ "64118ae0d741618088a470cd4eb704ca38f32ce0" ]
[ "libs/detect/yolo4/nets/yolo_training.py" ]
[ " \nfrom random import shuffle\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport math\nimport torch.nn.functional as F\nfrom matplotlib.colors import rgb_to_hsv, hsv_to_rgb\nfrom PIL import Image\nfrom utils.utils import bbox_iou, merge_bboxes\n\ndef jaccard(_box_a, _box_b):\n b1_x1, b1_x2 = _box...
[ [ "numpy.minimum", "torch.max", "matplotlib.colors.hsv_to_rgb", "torch.sum", "numpy.concatenate", "torch.pow", "numpy.argmax", "numpy.zeros", "torch.sigmoid", "torch.linspace", "torch.min", "torch.zeros_like", "torch.exp", "torch.log", "numpy.random.rand",...
PacktPublishing/Artificial-Intelligence-with-Python-Sequence-Learning
[ "6de47b517b31e56a6fb39bd083ce5036f5418708" ]
[ "Section 2/hmm.py" ]
[ "import datetime\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom hmmlearn.hmm import GaussianHMM\n\nfrom timeseries import read_data \n\nimport warnings\nwarnings.simplefilter(\"ignore\", DeprecationWarning)\n\n# Load input data\ndata = np.loadtxt('data_1D.txt', delimiter=',')\n\n# Extract the data col...
[ [ "numpy.diag", "matplotlib.pyplot.title", "numpy.arange", "numpy.column_stack", "matplotlib.pyplot.show", "numpy.loadtxt" ] ]
Sangarshanan/pandas
[ "90d7ad2cee84ae91e7eb0c6c2b7a142a3ba9351c" ]
[ "pandas/core/indexes/period.py" ]
[ "from datetime import datetime, timedelta\nimport weakref\n\nimport numpy as np\n\nfrom pandas._libs import index as libindex\nfrom pandas._libs.tslibs import NaT, frequencies as libfrequencies, iNaT, resolution\nfrom pandas._libs.tslibs.period import DIFFERENT_FREQ, IncompatibleFrequency, Period\nfrom pandas.util....
[ [ "pandas.tseries.frequencies.to_offset", "pandas.core.missing.isna", "pandas.core.indexes.numeric.Int64Index.join", "numpy.asarray", "pandas.core.accessor.delegate_names", "pandas._libs.tslibs.resolution.get_freq_group", "numpy.searchsorted", "pandas._libs.tslibs.period.Incompatible...
michaelpdu/pytorch-CycleGAN-and-pix2pix
[ "7e7aa3fed935644f92c0e15f7de80ce0971bf510" ]
[ "tools/plot_depth_img.py" ]
[ "#!/usr/bin/env python\n#coding:utf8\n\nimport os\nimport argparse\nimport numpy as np\nimport struct\n\nfrom mpl_toolkits.mplot3d import axes3d\nfrom matplotlib import cm\nimport matplotlib.pyplot as plt\nfrom PIL import Image\n\n#from stl import mesh\n#from stl_tools import numpy2stl\n\ndef main(image_path):\n ...
[ [ "numpy.asarray", "numpy.arange", "numpy.meshgrid", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
marcelrsoub/Force-Measurement-Unit
[ "576dc00e533804469d0469831171e535d1af9cf8" ]
[ "csv-to-graph.py" ]
[ "\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndata = np.loadtxt(open(\"samples/sample-S0229-P2-4-2.csv\", \"rb\"),delimiter=\",\")\n\ntime=data[:,0]\nvalue1=data[:,1]\nvalue2=data[:,2]\n\nplt.plot(time,value1,time,value2)\n# plt.title()\nplt.ylabel(\"Force (g)\")\nplt.xlabel(\"Time (s)\")\nplt.show()\n"...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
gajrajgchouhan/DS3-Assignments
[ "b43937967f80eb3d6d9ebfc6001e0db8da3a2cf8" ]
[ "Lab Assignment 4/KNN.py" ]
[ "import warnings\nimport numpy as np\nimport pandas as pd\nfrom collections import Counter\n\nclass myKNN:\n\n \"\"\"\n My Implementation of KNN classifier.\n \"\"\"\n\n def __init__(self, k):\n\n if (k % 2 == 0):\n w = f\"k = {k} is even, it may not work in the KNN Classifier\"\n ...
[ [ "numpy.square", "pandas.concat" ] ]
tflovorn/displ
[ "094c194c54f02d463353075c6ca82f457f1247fa" ]
[ "displ/pwscf/parseScf.py" ]
[ "import numpy as np\n\ndef fermi_from_scf(scf_path):\n fp = open(scf_path, 'r')\n lines = fp.readlines()\n fp.close()\n\n for line in lines:\n if 'Fermi' in line:\n fermi = float(line.strip().split()[-2])\n return fermi\n # If we get here, didn't find 'Fermi' line in scf_...
[ [ "numpy.zeros" ] ]
LuoMaimingS/django_virtual_stock_market
[ "cfeccdbb906f9998ec0a0633c2d2f39cdd87bf85" ]
[ "market/baselines/baselines/common/mpi_moments.py" ]
[ "from mpi4py import MPI\nimport numpy as np\nfrom market.baselines.baselines.common import zipsame\n\n\ndef mpi_mean(x, axis=0, comm=None, keepdims=False):\n x = np.asarray(x)\n assert x.ndim > 0\n if comm is None: comm = MPI.COMM_WORLD\n xsum = x.sum(axis=axis, keepdims=keepdims)\n n = xsum.size\n ...
[ [ "numpy.square", "numpy.sqrt", "numpy.random.seed", "numpy.allclose", "numpy.asarray", "numpy.concatenate", "numpy.zeros_like", "numpy.random.randn", "numpy.zeros" ] ]
Chaibot97/Sudoku_Solver
[ "db2d1cc1d05916c9b1c5eb7a73bdcfc5671c7977" ]
[ "sudoku_solver.py" ]
[ "\"\"\"\nSudoku solver\nauthor: Lizhou Cai\n\nrun:\npython3 sudoku_solver.py IN_FILE LEVEL(0-4)\n\"\"\"\n\nimport numpy as np\nimport argparse\nimport sys\nimport time\n\n\ndef parseArg():\n \"\"\"\n CMD argument parsing\n :return: the parser\n \"\"\"\n parser = argparse.ArgumentParser(description='S...
[ [ "numpy.unique", "numpy.all", "numpy.where", "numpy.zeros", "numpy.sum" ] ]
WasatchPhotonics/superman
[ "346fc0d590f40bfe0141630e3146ec8e7ee18be3" ]
[ "superman/baseline/rubberband.py" ]
[ "from __future__ import absolute_import\nimport numpy as np\nfrom scipy.spatial import ConvexHull\nfrom six.moves import xrange\nfrom .common import Baseline\n\n\ndef rubberband_baseline(bands, intensities, num_iters=8, num_ranges=64):\n '''Bruker OPUS method. If num_iters=0, uses basic method from OPUS.'''\n y =...
[ [ "numpy.arange", "numpy.append", "numpy.argmax", "numpy.argmin", "numpy.interp", "scipy.spatial.ConvexHull", "numpy.argsort", "numpy.column_stack" ] ]
bit-bcilab/SiamDCA
[ "78a520f2bf6b89f8dee8b05ca7a9399813f77e92" ]
[ "training/DataLoader.py" ]
[ "\r\n\r\nimport numpy as np\r\n\r\nfrom configs.DataPath import TRAIN_PATH, ROOT_PATH, DET_PATH, TRAIN_JSON_PATH\r\nfrom utils.rand import random_sys\r\n\r\nimport cv2\r\nimport json\r\nimport random\r\n\r\n\r\nclass DataLoader(object):\r\n def __init__(self, data_settings, read_all_boxes=False):\r\n self...
[ [ "numpy.array" ] ]
windcrusader/tides
[ "2898cf8f22528c91c18810187323213892bfe9d9" ]
[ "tidepredict/tide.py" ]
[ "from collections import OrderedDict\n#below for compatibility with Python < 3.8\ntry:\n from collections.abc import Iterable # noqa\nexcept ImportError:\n from collections import Iterable # noqa\nfrom itertools import takewhile, count\ntry:\n\tfrom itertools import izip, ifilter\nexcept ImportError: #Python...
[ [ "numpy.dot", "scipy.optimize.fsolve", "numpy.cos", "numpy.dtype", "numpy.ones", "numpy.sin", "numpy.ceil", "numpy.append", "scipy.optimize.leastsq", "numpy.mean", "numpy.finfo", "numpy.mod", "numpy.argsort", "numpy.array", "numpy.extract", "numpy.zer...
BehnazDibayee/syncnet_trainer
[ "77f5f345c48bf9496db07bd24f0ef43a1a4665e9" ]
[ "models/SyncNetModelMFCC.py" ]
[ "#! /usr/bin/python\n# -*- encoding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\nimport pytorch_mfcc\n \nclass SyncNetModel(nn.Module):\n def __init__(self, nOut = 1024, stride=1):\n super(SyncNetModel, self).__init__();\n\n self.netcnnaud = nn.Sequential(\n nn.Conv2d(1, 64, ker...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Conv3d", "torch.nn.MaxPool3d", "torch.nn.BatchNorm2d", "torch.nn.Conv1d", "torch.nn.ReLU", "torch.nn.BatchNorm3d" ] ]
DEVESHTARASIA/mnist-1
[ "7e4d8e78a5c61bbbfb7f135f12d020e0597be3eb" ]
[ "mnist/__init__.py" ]
[ "import os\nimport functools\nimport operator\nimport gzip\nimport struct\nimport array\nimport tempfile\ntry:\n from urllib.request import urlretrieve\nexcept ImportError:\n from urllib import urlretrieve # py2\ntry:\n from urllib.parse import urljoin\nexcept ImportError:\n from urlparse import urljoi...
[ [ "numpy.array" ] ]
jihoonerd/deep-reinforcement-learning-with-double-q-learning
[ "f48c28a2dba06a3fbd656e8c41f16510bb85dd56" ]
[ "ddqn/agent/ddqn_agent.py" ]
[ "from collections import deque\nfrom datetime import datetime\n\nimport gym\nimport imageio\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras.optimizers import Adam\n\nfrom ddqn.environment.atari_env import Environment\nfrom ddqn.networks.dqn_network import DQNNetwork\nfrom ddqn.utils.memory impor...
[ [ "tensorflow.math.argmax", "tensorflow.train.latest_checkpoint", "tensorflow.constant", "tensorflow.random.uniform", "tensorflow.cast", "tensorflow.expand_dims", "tensorflow.stop_gradient", "tensorflow.clip_by_norm", "tensorflow.keras.losses.Huber", "numpy.max", "tensorf...
Xiefan-Guo/Paper-PyTorch
[ "5dbb68ba78f427b56e75ddbd95a68475951e1514" ]
[ "GAN/WGAN/wgan.py" ]
[ "import argparse\nimport os\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\n\nimport torchvision.transforms as transforms\n\nfrom torchvision.utils import save_image\nfrom torch.utils.data import DataLoader\nfrom torch.autograd import Variable\nfrom torchvision import datasets\n\nos.makedirs(\"images\",...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.LeakyReLU", "torch.cuda.is_available", "numpy.prod", "torch.autograd.Variable" ] ]
lwanger/python_ray_tracer
[ "b0e41885a41953eac1cd97402319f5abdf8c477c" ]
[ "test/stl_test.py" ]
[ "from pathlib import Path\n\nimport numpy as np\nfrom stl import mesh # numpy-stl\n\nfrom mpl_toolkits import mplot3d\nfrom matplotlib import pyplot\n\n\n#FILENAME=\"models/sauce_ramp_v2.stl\"\n#FILENAME=\"models/LRW pick (plate stiffener).stl\"\n#FILENAME=\"models/gyroid_20mm.stl\"\n#FILENAME=\"models/modern_hexa...
[ [ "numpy.max", "numpy.min", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
nttcom/HSICLassoVI
[ "4d841feb25f24ae8af5ecfb7bf109dbb12afd2d5" ]
[ "HSICLassoVI/features/make_kernel.py" ]
[ "import numpy as np\nfrom joblib import Parallel, delayed\n\nfrom .kernels import *\n\n\ndef make_kernel(X, Y, y_kernel, x_kernel='Gaussian', n_jobs=-1, discarded=0, B=0, M=1):\n\n d, n = X.shape\n dy = Y.shape[0]\n\n L = compute_kernel(Y, y_kernel, B, M, discarded)\n L = np.reshape(L,(n * B * M,1))\n\n...
[ [ "numpy.dot", "numpy.sqrt", "numpy.random.seed", "numpy.reshape", "numpy.arange", "numpy.eye", "numpy.linalg.norm", "numpy.ones", "numpy.random.permutation", "numpy.zeros" ] ]
CedArctic/VP-Tree
[ "2c85e9dfa57330b541bd09c679794f385b095c6f" ]
[ "vp-tree.py" ]
[ "# Imports\nimport random\nimport matplotlib.pyplot as plt\nimport utilities\nfrom utilities import Node, Point, DQueue\n\n# Constants\nPOINTS_NUMBER = 1000 # Number of randomly generated points\nNEIGHBORS_NUMBER = 5 # Number of neighbors to find\n\n\ndef divideAndConquer(points):\n # Check to end recursion: i...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
abdelabdalla/deepmind-research
[ "4b7e0379ca5ba85e27f6f246fa2b0c060bd86879" ]
[ "mesh/reader.py" ]
[ "import collections\nimport functools\nimport json\nimport os\nimport pickle\n\nfrom absl import app\nfrom absl import flags\nfrom absl import logging\nimport numpy as np\nimport tensorflow as tf\nimport tree\n\nfrom learning_to_simulate import reading_utils\n\ntf.enable_eager_execution()\n\ndef _read_metadata(data...
[ [ "tensorflow.constant", "tensorflow.enable_eager_execution", "tensorflow.transpose", "tensorflow.shape" ] ]
ftramer/FaceCure
[ "35cef519396586028cf4f646b2867a1ea38c025c" ]
[ "lowkey_attack.py" ]
[ "import torch\nimport PIL\nfrom PIL import Image\nimport numpy as np\nfrom util.feature_extraction_utils import feature_extractor, normalize_transforms, warp_image, normalize_batch\nfrom backbone.model_irse import IR_50, IR_101, IR_152\nfrom backbone.model_resnet import ResNet_50, ResNet_101, ResNet_152\nfrom util....
[ [ "numpy.array", "torch.cuda.is_available" ] ]
kuzhamuratov/SAC
[ "9f4ebefb7207fd398371f18baa16f4417ad1a63b" ]
[ "main.py" ]
[ "import argparse\nimport datetime\nimport gym\nimport numpy as np\nimport itertools\nimport torch\nfrom sac import SAC\nfrom torch.utils.tensorboard import SummaryWriter\nfrom replay_memory import ReplayMemory\nimport robel\n\nparser = argparse.ArgumentParser(description='PyTorch Soft Actor-Critic Args')\nparser.ad...
[ [ "torch.manual_seed", "numpy.random.seed" ] ]
PGijsbers/categorical-encoding
[ "25cc10236626b8b95fa89ca8f52761db80fb1327" ]
[ "category_encoders/tests/test_woe.py" ]
[ "import pandas as pd\nfrom unittest2 import TestCase # or `from unittest import ...` if on Python 3.4+\nimport category_encoders.tests.helpers as th\nimport numpy as np\n\nimport category_encoders as encoders\n\nnp_X = th.create_array(n_rows=100)\nnp_X_t = th.create_array(n_rows=50, extras=True)\nnp_y = np.random....
[ [ "pandas.testing.assert_series_equal", "pandas.Series", "numpy.isfinite", "pandas.DataFrame", "numpy.random.randn" ] ]
ggosjw/PointNetVlad
[ "8e0d00b983abdb60d3db15be96840ce20f110c59" ]
[ "loading_pointclouds.py" ]
[ "import os\nimport pickle\nimport numpy as np\nimport random\nimport config as cfg\n\ndef get_queries_dict(filename):\n # key:{'query':file,'positives':[files],'negatives:[files], 'neighbors':[keys]}\n with open(filename, 'rb') as handle:\n queries = pickle.load(handle)\n print(\"Queries Loaded....
[ [ "numpy.expand_dims", "numpy.reshape", "numpy.squeeze", "numpy.cos", "numpy.sin", "numpy.random.randn", "numpy.random.uniform", "numpy.array", "numpy.zeros" ] ]
bamtercelboo/PyTorch_Biaffine_Dependency_Parsing
[ "65e5e0ed6129c75eb6609194bf031480e080c122" ]
[ "test.py" ]
[ "# @Author : bamtercelboo\n# @Datetime : 2018/8/24 15:27\n# @File : test.py\n# @Last Modify Time : 2018/8/24 15:27\n# @Contact : bamtercelboo@{gmail.com, 163.com}\n\n\"\"\"\n FILE : test.py\n FUNCTION : None\n\"\"\"\nimport os\nimport sys\nimport torch\nimport json\nimport numpy as np\nfrom DataUtils.utils i...
[ [ "numpy.round", "torch.load" ] ]
DavidXu999/surveyequivalence
[ "83fc7f3095f7d58a32d5624afa8ec83895073277" ]
[ "surveyequivalence/examples/paper_running_example.py" ]
[ "import pandas as pd\nfrom matplotlib import pyplot as plt\n\nfrom surveyequivalence import AgreementScore, PluralityVote, CrossEntropyScore, \\\n AnonymousBayesianCombiner, FrequencyCombiner, \\\n AnalysisPipeline, Plot, ClassifierResults, DiscretePrediction, DiscreteDistributionPrediction\n\ndef main(path ...
[ [ "pandas.read_csv", "matplotlib.pyplot.subplots" ] ]
Kartikey0412/epilespy_regression_predictions
[ "ec467fe5b93b948d62ef67e223f22b3939c7f63f" ]
[ "src/data/epilepsy_preprocess.py" ]
[ "#In this code we have preprocessed the epilepsy dataset before buidling the prediciton pipeline. We select the\n#desired features, and ascertain that contionus variables are numeric. Categorical varialbes have been binary encoded\n#or one-hot encoded. We have define a 80 - 20% train- test split for the model. #Imp...
[ [ "pandas.concat", "pandas.read_csv", "pandas.notnull", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.preprocessing.Imputer", "sklearn.preprocessing.LabelBinarizer", "pandas.to_numeric" ] ]
ruohoruotsi/pyACA
[ "339e9395b65a217aa5965638af941b32d5c95454" ]
[ "pyACA/FeatureSpectralTonalPowerRatio.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\ncomputes the tonal power ratio from the magnitude spectrum\n\n Args:\n X: spectrogram (dimension FFTLength X Observations)\n f_s: sample rate of audio data\n G_T: energy threshold\n\n Returns:\n vtpr tonal power ratio\n\"\"\"\n\nimport numpy as np\nfrom scipy.signal i...
[ [ "numpy.squeeze", "numpy.expand_dims", "numpy.zeros", "scipy.signal.find_peaks" ] ]
josepic99/mesas
[ "8453fe36b8536795ce5b80975fc9dbc604da42df" ]
[ "examples/Flockers/flockers/model.py" ]
[ "'''\nFlockers\n=============================================================\nA Mesa implementation of Craig Reynolds's Boids flocker model.\nUses numpy arrays to represent vectors.\n'''\n\n\nimport random\nimport numpy as np\n\nfrom mesa import Model\nfrom mesa.space import ContinuousSpace\nfrom mesa.time import ...
[ [ "numpy.array", "numpy.random.random", "numpy.linalg.norm" ] ]
SebMilardo/osmnx
[ "b304cd4be13a4aa2435328f045a7c83815576b86" ]
[ "osmnx/core.py" ]
[ "################################################################################\n# Module: core.py\n# Description: Retrieve and construct spatial geometries and street networks\n# from OpenStreetMap\n# License: MIT, see full license in LICENSE.txt\n# Web: https://github.com/gboeing/osmnx\n###########...
[ [ "pandas.DataFrame" ] ]
Icetalon21/Data-Science
[ "05eea4a027b194b3cfb5ddae5f0640ddcd44c5c7" ]
[ "PCA.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom sklearn import datasets as skdata\n\n#We will use the iris dataset\niris_dataset = skdata.load_iris()\nX = iris_dataset.data # (150, 4)\ny = iris_dataset.target\n\n#Compute the mean\nmu = np.mean(X, axis=0)\n\n#Cente...
[ [ "numpy.linalg.eig", "sklearn.datasets.load_iris", "numpy.matmul", "numpy.mean", "numpy.argsort", "matplotlib.pyplot.show", "numpy.where", "matplotlib.pyplot.figure" ] ]
zhanghang1989/autogluon-legacy
[ "8638fb6a71947161bdd4f6876cc7ad035229c95b" ]
[ "autogluon/core/decorator.py" ]
[ "import copy\nimport logging\nimport argparse\nimport functools\nfrom collections import OrderedDict\nimport numpy as np\nimport multiprocessing as mp\nimport ConfigSpace as CS\n\nfrom .space import *\nfrom .space import _add_hp, _add_cs, _rm_hp, _strip_config_space\nfrom ..utils import EasyDict as ezdict\nfrom ..u...
[ [ "numpy.random.seed" ] ]
matthieu637/DLM
[ "18fb6c80508abde6b81873d06c7e57f93e3425e3" ]
[ "difflogic/thutils.py" ]
[ "#! /usr/bin/env python3\n#\n# Copyright 2018 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ...
[ [ "torch.nn.functional.sigmoid" ] ]
Leggerla/lama
[ "6b4e9d4920a3160a2102b6e863204944202a0d90" ]
[ "saicinpainting/training/trainers/__init__.py" ]
[ "import logging\nimport torch\nfrom .default import DefaultInpaintingTrainingModule\n\n\ndef get_training_model_class(kind):\n if kind == 'default':\n return DefaultInpaintingTrainingModule\n\n raise ValueError(f'Unknown trainer module {kind}')\n\n\ndef make_training_model(config):\n kind = config.t...
[ [ "torch.load" ] ]
ratt-ru/radiopadre
[ "3bf934eba69144d9707777a57da0e827625517a3" ]
[ "radiopadre/casatable.py" ]
[ "import os.path\nfrom collections import OrderedDict\nimport itertools\nimport numpy as np\nfrom numpy.ma import masked_array\nfrom contextlib import contextmanager\n\nimport radiopadre\nfrom radiopadre import casacore_tables\nfrom radiopadre import settings\nfrom .filelist import FileList\nfrom .render import rend...
[ [ "numpy.array", "numpy.zeros", "numpy.ma.masked_array" ] ]
miguelammatos/FaultSee
[ "3e6272e351547b1d0e46178deb69096f646dd7bc" ]
[ "angainor-lsds/examples/nginx/parse.py" ]
[ "#!/usr/bin/env python\nimport json\nimport pandas as pd\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n\ndef load(path):\n def read(path):\n with open(path) as f:\n for line in f:\n line = line.strip()\n split = line.split('\\t', 2)\n while ...
[ [ "pandas.to_datetime", "pandas.Grouper", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "pandas.DataFrame" ] ]
jeremiedecock/fits-viewer
[ "191fe77e2e478c18ba5c3461b9dc0fee6b814744" ]
[ "fitsviewer/gui/tk_matplotlib.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# FITS Viewer\n\n# The MIT License\n#\n# Copyright (c) 2016 Jeremie DECOCK (http://www.jdhp.org)\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...
[ [ "matplotlib.use", "matplotlib.pyplot.figure", "numpy.tile", "matplotlib.pyplot.colorbar", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ] ]
sanjibansg/nbox
[ "bf23b7cceb3179ba3d051a38aac0e32925a513e8" ]
[ "tests/test_hf.py" ]
[ "import os\nimport unittest\n\nimport nbox\nfrom nbox import utils\n\nfrom functools import lru_cache\n\n\n@lru_cache\ndef get_model(*args, **kwargs):\n return nbox.load(*args, **kwargs)\n\n\n@lru_cache\ndef get_parser(*args, **kwargs):\n model = get_model(*args, **kwargs)\n return model.text_parser\n\n\nc...
[ [ "numpy.array" ] ]
dxxx9/scikit-rf
[ "060257568f3c0bdcc817e89742ec29445df81a09" ]
[ "skrf/time.py" ]
[ "\"\"\"\n.. module:: skrf.time\n========================================\ntime (:mod:`skrf.time`)\n========================================\n\nTime domain functions\n\n\n.. autosummary::\n :toctree: generated/\n\n time_gate\n detect_span\n find_n_peaks\n indexes\n\n\"\"\"\nfrom .util import find_nearest_i...
[ [ "numpy.hstack", "scipy.signal.get_window", "numpy.min", "numpy.arange", "numpy.issubdtype", "numpy.fft.fftshift", "numpy.ones", "numpy.max", "numpy.diff", "scipy.ndimage.filters.convolve1d", "numpy.argsort", "numpy.array", "numpy.where", "numpy.zeros" ] ]
viniciusbarbosapaiva/Templates-Python
[ "9e19b84a707826b9aebe61c1f1f5b1afc1b67811" ]
[ "Templates_Machine_learning/Clustering/Template_clustering_tito.py" ]
[ "#K-means Clustering\n#%reset -f\n#Importing Libraries\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.cluster import DBSCAN\nfrom pyclustertend import hopkins\nfrom sklearn.cluster import MeanShift, estimate_bandwidth\nfrom sklearn.metrics import silho...
[ [ "sklearn.cluster.estimate_bandwidth", "matplotlib.pyplot.legend", "pandas.to_datetime", "sklearn.cluster.KMeans", "sklearn.metrics.silhouette_score", "sklearn.cluster.DBSCAN", "pandas.DataFrame", "pandas.plotting.parallel_coordinates", "pandas.read_csv", "matplotlib.pyplot....
calwhi/molinExercises
[ "7ec4f55963b31c8ac3964ca5884a8ee7958d76e6" ]
[ "book_env/lib/python3.9/site-packages/mplfinance/_widths.py" ]
[ "import pandas as pd\nfrom mplfinance._arg_validators import _process_kwargs, _validate_vkwargs_dict\n\ndef _get_widths_df():\n '''\n Provide a dataframe of width data that appropriate scales widths of\n various aspects of the plot (candles,ohlc bars,volume bars) based on\n the amount or density of data...
[ [ "pandas.DataFrame" ] ]
julianazk/stock_cnn
[ "bb809773cc11305048270feff879a73d41b85aef" ]
[ "src/data_generator.py" ]
[ "#\n# Copyright (c) 2020. Asutosh Nayak (nayak.asutosh@ymail.com)\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\nimport o...
[ [ "pandas.read_csv", "pandas.to_datetime", "numpy.sqrt", "numpy.unique", "sklearn.preprocessing.OneHotEncoder", "pandas.offsets.DateOffset", "numpy.stack", "sklearn.feature_selection.SelectKBest", "numpy.zeros", "sklearn.preprocessing.MinMaxScaler" ] ]
FredericoNesti/gym-idsgame
[ "4170cb5cb3ec787adf5911364e0c6395412b9de9" ]
[ "gym_idsgame/agents/training_agents/policy_gradient/actor_critic/actor_critic.py" ]
[ "\"\"\"\nAn agent for the IDSGameEnv that implements the REINFORCE with Baseline (Critic) Policy Gradient algorithm.\n\"\"\"\nfrom typing import Union, List\nimport numpy as np\nimport time\nimport tqdm\nimport torch\nimport copy\nfrom scipy.special import softmax\nfrom torch.distributions import Categorical\nfrom ...
[ [ "torch.nn.SmoothL1Loss", "torch.optim.lr_scheduler.ExponentialLR", "torch.tensor", "numpy.finfo", "torch.distributions.Categorical", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available", "numpy.random.rand", "torch.device", "scipy.special.softmax", "torch....
bartonlin/MWSD
[ "70ad446ee7f00a11988acb290270e32d8e6af925" ]
[ "metric_wsd/utils/utils.py" ]
[ "import os\nimport csv\nimport random\nimport subprocess\nfrom collections import Counter\nfrom argparse import Namespace\nimport glob\nimport yaml\n\nimport torch\nfrom torch.optim import AdamW\n\nfrom metric_wsd.models.models import CBERTLinear, CBERTProto, PairCBERTProto, CBERTProtoConcat\nfrom metric_wsd.config...
[ [ "torch.load", "torch.save" ] ]
datalayer-contrib/holoviz-panel
[ "c97b57e8eaff4b5f542add41f496395da2483b23" ]
[ "panel/pane/vtk/synchronizable_deserializer.py" ]
[ "import json\nimport zipfile\nimport vtk\nimport re\nimport struct\n\nfrom .synchronizable_serializer import arrayTypesMapping\n\n\nMETHODS_RENAME = {\n \"AddTexture\": \"SetTexture\",\n \"SetUseGradientOpacity\": None,\n \"SetRGBTransferFunction\": \"SetColor\",\n}\nWRAP_ID_RE = re.compile(r\"instance:\\$...
[ [ "numpy.frombuffer" ] ]
caosenqi/Edward1
[ "85f833d307512a585b85ebc2979445e17191ed81" ]
[ "tests/test-stats/test_stats_multivariate_normal_entropy.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport tensorflow as tf\n\nfrom edward.stats import multivariate_normal\nfrom scipy import stats\n\nsess = tf.Session()\n\ndef _assert_eq(val_ed, val_true):\n with sess.as_default():\n assert np.allclose(val_ed.eval(), val_true)\n\ndef test_entro...
[ [ "numpy.diag", "tensorflow.constant", "tensorflow.Session", "scipy.stats.multivariate_normal.entropy", "numpy.array" ] ]
michael-iuzzolino/CascadedNets
[ "2746320395424697d7225e9042e5b0fa8657345e" ]
[ "modules/eval_handler.py" ]
[ "\"\"\"Evaluation function handler for sequential or cascaded.\"\"\"\nimport numpy as np\nimport sys\nimport torch\nimport torch.nn.functional as F\n\n\nclass SequentialEvalLoop:\n \"\"\"Evaluation loop for sequential model.\"\"\"\n\n def __init__(\n self, \n num_classes, \n keep_logits=False, \n ...
[ [ "torch.nn.functional.softmax", "torch.zeros", "torch.cat", "torch.eq", "torch.eye", "torch.no_grad", "torch.stack", "numpy.sum", "torch.argmax" ] ]
catalys1/pytorch-lightning
[ "3bd48b85356e36b7a56b5d8f669403f0bfb9d717" ]
[ "tests/callbacks/test_gpu_stats_monitor.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "numpy.isnan", "torch.cuda.is_available", "numpy.genfromtxt" ] ]