repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Elaine-DWL/DeepCTR | [
"66d173e5736eae2e19c32e28e6d656ef873461a5"
] | [
"examples/run_classification_criteo_hash.py"
] | [
"import pandas as pd\nfrom sklearn.metrics import log_loss, roc_auc_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\n\nfrom deepctr.models import DeepFM\nfrom deepctr.feature_column import SparseFeat, DenseFeat,get_feature_names\n\nif __name__ == \"__main_... | [
[
"sklearn.metrics.log_loss",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.metrics.roc_auc_score"
]
] |
vishaltiwari/XNet | [
"a7ad8d9a610edb1d522fef56b8ed1067fb39f30f"
] | [
"tools/python/draw_nz_mf_2files.py"
] | [
"def draw_nz_mf(datafile, datafile2, k, num_species, colors = False):\n\n '''\n Colorbar is currently not working. \n Inputs: datafile = must be a ts file\n datafile2 = second datafile\n k = desired timestep for thermodynamic and mass fraction data\n num... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplot... |
HestiaSky/GNN-MTL | [
"2a1319c6d3e479a56d98a685926bf4d7586d4d0f"
] | [
"layers/layers.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.modules.module import Module\n\n\ndef get_dim_act(args):\n # Helper function to get dimension and activation at every layer.\n if not args.act:\n act = lambda x: x\n else:\n act = getattr(... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.zeros",
"torch.nn.functional.dropout",
"torch.FloatTensor",
"torch.mm",
"numpy.sqrt",
"torch.spmm"
]
] |
h-oll/QuNetSim | [
"e3647e512182eda2a303085ded30c7d1e55a4e01"
] | [
"components/network.py"
] | [
"import networkx as nx\nimport matplotlib.pyplot as plt\nfrom queue import Queue\nimport time\nimport random\nfrom components import protocols\nfrom components.logger import Logger\nfrom objects.daemon_thread import DaemonThread\nfrom inspect import signature\n\nfrom objects.packet import Packet\nfrom objects.routi... | [
[
"matplotlib.pyplot.show"
]
] |
mees/calvin_env | [
"1431a46bd36bde5903fb6345e68b5ccc30def666"
] | [
"calvin_env/scripts/check_tasks.py"
] | [
"from pathlib import Path\n\nimport cv2\nimport hydra\nimport numpy as np\nimport pybullet as p\n\n\"\"\"\nThis script loads a rendered episode and replays it using the recorded actions.\nOptionally, gaussian noise can be added to the actions.\n\"\"\"\n\n\ndef scale_depth(img):\n img = np.clip(img, 0, 1.5)\n ... | [
[
"numpy.random.normal",
"numpy.zeros",
"numpy.load",
"numpy.radians",
"numpy.clip"
]
] |
nilsleh/deepLearning2020 | [
"8b4b1c3092afb1411c2d5d95cafc768c77d26688"
] | [
"assignment_3/3_generative/part1/mlp_encoder_decoder.py"
] | [
"################################################################################\n# MIT License\n#\n# Copyright (c) 2020 Phillip Lippe\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 Soft... | [
[
"torch.nn.Linear",
"torch.reshape",
"torch.nn.Sequential",
"numpy.prod",
"torch.nn.ELU"
]
] |
ianchute/filipino-mahjong-solver | [
"d28385af76d5104be6df867fd6a20714cc952e74"
] | [
"main.py"
] | [
"import pandas as pd\nfrom models.game import Game\nfrom models.tile import Tile\nfrom solver import Solver, TIMES\n\nprint(\"Initializing game...\")\ngame = Game()\nprint(f\"\\n\\nThere are {len(game.deck)} tiles in the deck!\")\n\nprint(\"Initializing hands...\")\ngame.random_hand()\n# game.player_hand_up = [\n# ... | [
[
"pandas.Series"
]
] |
achen353/lama | [
"57438f957d5178d1180040fa349423e84af58e11",
"57438f957d5178d1180040fa349423e84af58e11"
] | [
"src/saicinpainting/utils.py",
"src/saicinpainting/training/modules/multiscale.py"
] | [
"import bisect\nimport functools\nimport logging\nimport numbers\nimport os\nimport signal\nimport sys\nimport traceback\nimport warnings\n\nimport torch\nfrom pytorch_lightning import seed_everything\n\nLOGGER = logging.getLogger(__name__)\n\nimport platform\n\nif platform.system() != \"Linux\":\n signal.SIGUSR... | [
[
"torch.is_tensor"
],
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.nn.functional.interpolate",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d"
]
] |
sebastienlanglois/flask-hydro | [
"2bd399ca91fdaeea297ec5e6ee076ce1a53d0f37"
] | [
"app/locallib/db_create/ERA5.py"
] | [
"from rasterio import features\nfrom affine import Affine\nimport geopandas as gpd\nfrom shapely import affinity\nimport sqlite3\nimport pytz\nimport numpy as np\nimport xarray as xr\nimport glob\nimport os\nimport json\nimport pandas as pd\n\n\nold_timezone = pytz.timezone(\"UTC\")\nnew_timezone = pytz.timezone(\"... | [
[
"pandas.to_datetime",
"numpy.isnan",
"numpy.asarray",
"pandas.DataFrame",
"numpy.interp",
"numpy.nanmin",
"numpy.where",
"pandas.concat",
"numpy.nanmax",
"pandas.pivot_table",
"pandas.read_sql_query"
]
] |
jaeminsung/ml_stock_trading | [
"32f5305f5111ba86eb428e982ac6f0f18842558d"
] | [
"scripts/indicators.py"
] | [
"import numpy as np\nimport pandas as pd\nimport utils\n\nclass Indicators:\n def __init__(self, stock, start_date, end_date):\n self.stock = stock\n self.start_date = start_date\n self.end_date = end_date\n self.data = utils.read_stock_data(stock)\n\n def calculate_all_indicators(... | [
[
"numpy.divide",
"numpy.add",
"pandas.DataFrame",
"numpy.subtract",
"pandas.concat"
]
] |
wyd1502/DGNN | [
"7eca3e8e901a5902cd790b575d9eb899dfd12841"
] | [
"modules/memory.py"
] | [
"import torch\nfrom torch import nn\n\nfrom collections import defaultdict\nfrom copy import deepcopy\n\n\nclass Memory(nn.Module):\n\n def __init__(self, n_nodes, memory_dimension, message_dimension=None,\n device=\"cpu\"):\n super(Memory, self).__init__()\n self.n_nodes = n_nodes\n self.me... | [
[
"torch.manual_seed",
"torch.zeros",
"torch.nn.init.xavier_normal"
]
] |
ishan-modi/OpenCV | [
"b1650c0056e9b159f260e50637db6fe414384eab"
] | [
"FashionMnist_ImageClassification/FashionMnist_Image_Classification.py"
] | [
"from keras.datasets import fashion_mnist\nimport matplotlib.pyplot as plt\nfrom keras.utils import to_categorical\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Conv2D, MaxPool2D, Flatten\nfrom sklearn.metrics import classification_report\n\n(x_train,y_train),(x_test,y_test)=fashion_mnist.lo... | [
[
"sklearn.metrics.classification_report"
]
] |
yngtodd/vel | [
"689f24ce5b12dd985b7164874538d590a0e6e59b"
] | [
"vel/rl/models/backbone/nature_cnn.py"
] | [
"\"\"\"\nCode based loosely on implementation:\nhttps://github.com/openai/baselines/blob/master/baselines/ppo2/policies.py\n\nUnder MIT license.\n\"\"\"\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\n\nimport vel.util.network as net_util\n\... | [
[
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.init.kaiming_normal_",
"torch.nn.init.constant_"
]
] |
marymlucas/fairlearn | [
"73e6a8ff797d5f6e6b2f5932313b72ffb95331c8"
] | [
"test/unit/postprocessing/test_threshold_optimizer_multiple_sensitive_features.py"
] | [
"# Copyright (c) Microsoft Corporation and Fairlearn contributors.\n# Licensed under the MIT License.\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import accuracy_score, balanced_accuracy_score\n\nfrom fairlearn.metrics import MetricFrame, false... | [
[
"pandas.DataFrame",
"numpy.sum",
"sklearn.linear_model.LinearRegression",
"pandas.Series"
]
] |
gully/ynot | [
"71deb7df6527f714b2a7adb902ff0fafc6f64b69"
] | [
"test/test_datasets.py"
] | [
"import pytest\nimport torch\nimport time\nfrom ynot.datasets import FPADataset\nimport ccdproc\nimport warnings\nimport logging\nimport astropy\n\nlogging.getLogger(\"ccdproc\").setLevel(logging.ERROR)\n\n\ndef test_import():\n \"\"\"Can we import the module?\"\"\"\n data = FPADataset()\n assert isinstanc... | [
[
"torch.var"
]
] |
rg321/affective-2017-musa2-ode | [
"abba8c84a5fe6624601cdf6d08bf48d54ca490ac"
] | [
"src/experiments/util/training.py"
] | [
"\"\"\"\nSet of functions and flags used for training neural networks\n\nSome of them are taken from TensorFlow multi-GPU tutorial, e.g. average_gradients()\n\"\"\"\n\nimport os\nimport subprocess\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\n\nfrom .tf_functions import *\n\ntf.logging.set_verbo... | [
[
"tensorflow.constant_initializer",
"tensorflow.train.get_checkpoint_state",
"tensorflow.histogram_summary",
"tensorflow.add_to_collection",
"tensorflow.cast",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.trainable_variables",
"tensorflow.argmax",
"tensorflow.summary... |
IRMVLab/NonOccFlow | [
"ee727af59fc282defa7927526c402bea0ebfb7ed"
] | [
"data_conversion_scripts/convert_KITTI_multiview_to_tfrecords.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Google Research 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 requ... | [
[
"tensorflow.compat.v1.gfile.FastGFile",
"tensorflow.train.BytesList",
"tensorflow.train.Int64List",
"tensorflow.io.gfile.listdir",
"tensorflow.image.decode_png",
"tensorflow.io.TFRecordWriter",
"tensorflow.image.encode_png",
"tensorflow.image.resize",
"tensorflow.cast"
]
] |
marinarierav-uab/mmdetection | [
"63435553b36e2427051701311bc55c6b4bd66a86"
] | [
"mmdet/models/detectors/cascade_rcnn.py"
] | [
"from __future__ import division\n\nimport torch\nimport torch.nn as nn\n\nfrom mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner,\n build_sampler, merge_aug_bboxes, merge_aug_masks,\n multiclass_nms)\nfrom .. import builder\nfrom ..registry import ... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.ModuleList",
"torch.no_grad",
"torch.ones",
"torch.from_numpy",
"torch.randn"
]
] |
GuoShi28/TwoStageAlignment_for_BurstRestoration | [
"7abfdbfd6248fbbb1aeae359cf658c5a445c9f40"
] | [
"codes/utils/unprocess.py"
] | [
"# coding=utf-8\r\n# Copyright 2019 The Google Research Authors.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n... | [
[
"torch.sqrt",
"torch.stack",
"numpy.log",
"torch.max",
"torch.FloatTensor",
"torch.Generator",
"torch.inverse",
"torch.clamp",
"torch.mm",
"torch.sum",
"torch.asin",
"numpy.random.uniform",
"torch.tensor",
"torch.zeros_like",
"torch.mean",
"torch.exp... |
PhoenixDL/rising | [
"6de193375dcaac35605163c35cec259c9a2116d1"
] | [
"tests/transforms/test_intensity_transforms.py"
] | [
"import random\nimport unittest\nfrom math import isclose\nfrom unittest.mock import Mock, call\n\nimport torch\n\nfrom rising.random import DiscreteParameter\nfrom rising.transforms import (\n Clamp,\n ExponentialNoise,\n GammaCorrection,\n GaussianNoise,\n Noise,\n NormMeanStd,\n NormMinMax,\... | [
[
"torch.rand",
"torch.arange",
"torch.manual_seed",
"torch.tensor",
"torch.ones_like"
]
] |
zjut-jianhuazhang/CalibRCNN | [
"aed7f63ccb4e3562268bc1865d11642aaa86dcd2"
] | [
"transform_function.py"
] | [
"import tensorflow as tf\nimport config_res as config\nimport cv2\nimport numpy as np\nimport copy\n\n\ndef points2d_to_rgbimg(points_2d, img):\n\n img_ht = img.shape[0]\n img_wdt = img.shape[1]\n Z = points_2d[2, :]\n x = (points_2d[0, :] / Z).T\n y = (points_2d[1, :] / Z).T\n\n x = np.clip(x, 0.... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.matmul",
"numpy.zeros",
"numpy.ones",
"numpy.nonzero",
"numpy.loadtxt",
"numpy.clip",
"numpy.linalg.inv",
"numpy.vstack"
]
] |
robbisg/mne-python | [
"3d8816c0571050aacee8dcb26ebad65a85f590dd"
] | [
"mne/viz/tests/test_3d.py"
] | [
"# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Denis Engemann <denis.engemann@gmail.com>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Eric Larson <larson.eric.d@gmail.com>\n# Mainak Jas <mainak@neuro.hut.fi>\n# Mark Wronkiewicz <wronk.mark@gmail.com... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.empty",
"numpy.random.rand",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.sum",
"numpy.testing.assert_array_equal",
"numpy.ones",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.close",
"matplotlib.pyplot.... |
zsquaredz/XSum | [
"10f2fac2e70801e7a3973c864b5a24b61d3f8bfe"
] | [
"XSum-Topic-ConvS2S/fairseq/tokenizer.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nfrom collections impor... | [
[
"torch.IntTensor"
]
] |
varman-m/fooof | [
"6046c89bb3c87f30a8a368809a9d321c8c33e1a8"
] | [
"examples/plot_mne_example.py"
] | [
"\"\"\"\nUsing fooof with MNE\n====================\n\nThis examples illustrates how to use fooof with MNE and create topographical plots.\n\nThis tutorial does require that you have `MNE\n<https://mne-tools.github.io/>`_ installed. If you don't already have\nMNE, you can follow instructions to get it `here\n<https... | [
[
"numpy.isnan",
"matplotlib.pyplot.subplots",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.nanmean",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.gca",
"numpy.squeeze"
]
] |
brianherman/data-act-broker-backend | [
"80eb055b9d245046192f7ad4fd0be7d0e11d2dec"
] | [
"dataactvalidator/filestreaming/sqlLoader.py"
] | [
"import logging\nimport os\nimport pandas as pd\n\nfrom dataactcore.config import CONFIG_BROKER\nfrom dataactcore.logging import configure_logging\nfrom dataactcore.interfaces.db import GlobalDB\nfrom dataactcore.models.lookups import FILE_TYPE_DICT, RULE_SEVERITY_DICT\nfrom dataactcore.models.validationModels impo... | [
[
"pandas.read_csv"
]
] |
100rab-S/ga-learner-dsb-repo | [
"b89891e0336501746b0e65c1bc028998b56409f8"
] | [
"Melbourne-house-price-prediction/code.py"
] | [
"# --------------\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n# path- variable storing file path\r\n\r\n#Code starts here\r\ndf = pd.read_csv(path)\r\n#print(df.head())\r\nX = df.drop('Price', axis = 1)\r\ny = df.Price\r\n\r\nX_train, X_test, y_train, y_... | [
[
"sklearn.linear_model.Lasso",
"sklearn.linear_model.LinearRegression",
"sklearn.metrics.r2_score",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.linear_model.Ridge",
"numpy.mean",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.model_selection.cro... |
langosco/jax | [
"d8c75da807f697503c49262ab7dae514f565d232"
] | [
"tests/lax_numpy_test.py"
] | [
"# 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 by applicable law or agreed ... | [
[
"numpy.rot90",
"numpy.vander",
"numpy.diag_indices",
"numpy.msort",
"numpy.isclose",
"numpy.dot",
"numpy.isposinf",
"numpy.median",
"numpy.tile",
"numpy.mean",
"numpy.where",
"numpy.tensordot",
"numpy.geomspace",
"numpy.random.random",
"numpy.inner",
... |
Lszemraj/DSFM-Monitor | [
"ce09f61dfe0feb868c2f9f887f92d37cf8d27af5"
] | [
"Development/StateofFMS.py"
] | [
"import plotly.express as px\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport plotly.graph_objects as go\nimport pandas as pd\nimport numpy as np\nimport base64\nimport os\nimport dash_table\nimport plotly.express as px\nfrom PIL import Image\nfrom dash.dependencies impo... | [
[
"pandas.read_pickle",
"pandas.DataFrame",
"numpy.concatenate",
"numpy.degrees"
]
] |
nadavWeisler/PythonThePracticalAspect | [
"7ffd52fc95d0f692f48390cb02eb5d93931577bb"
] | [
"Ex/Ex6/ex6-sol/colors_task.py"
] | [
"#316493758\n#3\n\nimport pandas as pd\nimport numpy as np\nimport pygame\nimport agent\n\n# define global arguments for visual properties\nWIDTH = 1200\nHEIGHT = 800\nWHITE = (255, 255, 255)\nBLACK = (0, 0, 0)\nBLUE = (0, 0, 255)\nRED = (255, 0, 0)\nCYAN = (0, 255, 255)\nYELLOW = (255, 255, 0)\nGREY = (127, 127, 1... | [
[
"numpy.random.choice",
"matplotlib.pyplot.xlabel",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
lopezcaraballoch/striptease | [
"86bde677d46af8c7fc14becdf32e456685074d66",
"86bde677d46af8c7fc14becdf32e456685074d66"
] | [
"join_hdf5.py",
"calibration/__init__.py"
] | [
"#!/usr/bin/env python3\n# -*- encoding: utf-8 -*-\n\nfrom argparse import ArgumentParser, RawDescriptionHelpFormatter\nimport sqlite3\nimport astropy.time\nimport numpy as np\nfrom pathlib import Path\nimport h5py\nimport sys\n\nDEFAULT_COMPRESSION_LEVEL = 4\n\ntry:\n from tqdm import tqdm\nexcept:\n ERASE_E... | [
[
"numpy.ones",
"numpy.dtype"
],
[
"pandas.read_excel"
]
] |
IshitaTakeshi/Tadataka | [
"2c5a3db1db7e651bfaa7808bbf79a6c1c6a42fc5"
] | [
"tadataka/robust/weights.py"
] | [
"import numpy as np\n\n\ndef compute_weights_student_t(r, nu=5, n_iter=10):\n # Kerl Christian, Jürgen Sturm, and Daniel Cremers.\n # \"Robust odometry estimation for RGB-D cameras.\"\n # Robotics and Automation (ICRA)\n\n def weights(variance):\n return (nu + 1) / (nu + s / variance)\n\n s = ... | [
[
"numpy.zeros",
"numpy.median",
"numpy.ones",
"numpy.power",
"numpy.abs"
]
] |
AndreMaz/dnn-attention | [
"86e834b90bd419646fd00c6ff4df910ab7874910",
"86e834b90bd419646fd00c6ff4df910ab7874910"
] | [
"date-conversion/tests/date_format_test.py",
"sorting-numbers/models/transformer/custom_attention.py"
] | [
"import sys\nsys.path.append('./date-conversion')\n\nimport unittest\nfrom dataset import date_format\nimport numpy as np\n\nclass TestStringMethods(unittest.TestCase):\n\n # def test_upper(self):\n # self.assertEqual('foo'.upper(), 'FOO')\n\n # def test_isupper(self):\n # self.assertTrue('FOO'.... | [
[
"numpy.all"
],
[
"tensorflow.convert_to_tensor",
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.squeeze",
"tensorflow.math.sqrt",
"tensorflow.nn.softmax",
... |
saethlin/python-fsps | [
"6c0d5544ceb8e645f7b119e57c6f0064b46709e7"
] | [
"setup.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport sys\nimport glob\nimport shutil\nimport subprocess\n\ntry:\n from setuptools import setup, Extension\n from setuptools.command.build_ext import build_ext\nexcept ImportError:\n from distutils.core import setup, Extension\n from distutils.command.build_ext impo... | [
[
"numpy.f2py.main"
]
] |
usgs/neversink_workflow | [
"acd61435b8553e38d4a903c8cd7a3afc612446f9",
"acd61435b8553e38d4a903c8cd7a3afc612446f9",
"acd61435b8553e38d4a903c8cd7a3afc612446f9"
] | [
"python_packages_static/flopy/utils/postprocessing.py",
"python_packages_static/flopy/utils/mtlistfile.py",
"python_packages_static/flopy/utils/swroutputfile.py"
] | [
"import numpy as np\n\n\ndef get_transmissivities(\n heads,\n m,\n r=None,\n c=None,\n x=None,\n y=None,\n sctop=None,\n scbot=None,\n nodata=-999,\n):\n \"\"\"\n Computes transmissivity in each model layer at specified locations and\n open intervals. A saturated thickness is det... | [
[
"numpy.logical_not",
"numpy.logical_or",
"numpy.array",
"numpy.full",
"numpy.empty",
"numpy.reshape",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.diff",
"numpy.ma.array",
"numpy.isscalar",
"numpy.argmax",
"numpy.squeeze",
"numpy.empty_like"
],
[... |
danielbrenners/buzz-lightyear | [
"e6eb526b124d55e31917bf445875de27110cae16"
] | [
"pi/emo_reco/emotion_detector_test.py"
] | [
"# USAGE\n\n# python emotion_detector_test.py --cascade haarcascade_frontalface_default.xml --model checkpoints/epoch_75.hdf5\n\n# 'camera = cv2.VideoCapture(0)'\n# model from checkpoints, not output\n\n# import the necessary packages\nfrom keras.preprocessing.image import img_to_array\nfrom keras.models import loa... | [
[
"numpy.expand_dims",
"numpy.zeros"
]
] |
unFYDP/octopus | [
"b431871098ff7a79a1080d87afae50d53dd48ad7"
] | [
"lib/io.py"
] | [
"import cv2\nimport json\nimport pickle as pkl\nimport numpy as np\n\n\nLABELS_FULL = {\n 'Sunglasses': [170, 0, 51],\n 'LeftArm': [51, 170, 221],\n 'RightArm': [0, 255, 255],\n 'LeftLeg': [85, 255, 170],\n 'RightLeg': [170, 255, 85],\n 'LeftShoe': [255, 255, 0],\n 'RightShoe': [255, 170, 0],\n... | [
[
"numpy.all",
"numpy.array",
"numpy.mean"
]
] |
rvitorper/xor-neural-network | [
"d9faa099063a8f9839220b237369b4eb47756bf5"
] | [
"predict.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\nmodel = tf.keras.models.load_model(\"model.keras\")\n\nprint(model.predict(np.array([[0, 0]]))[0])\nprint(model.predict(np.array([[1, 0]]))[0])\nprint(model.predict(np.array([[0, 1]]))[0])\nprint(model.predict(np.array([[1, 1]]))[0])\n"
] | [
[
"tensorflow.keras.models.load_model",
"numpy.array"
]
] |
jsh9/PySeismoSoil | [
"455be0fb5c46ab48cbe107b8ec91f852e732d28a"
] | [
"PySeismoSoil/tests/test_helper_simulations.py"
] | [
"import unittest\nimport numpy as np\n\nimport PySeismoSoil.helper_simulations as sim\nimport PySeismoSoil.helper_site_response as sr\n\nfrom PySeismoSoil.class_Vs_profile import Vs_Profile\nfrom PySeismoSoil.class_parameters import HH_Param_Multi_Layer\nfrom PySeismoSoil.class_curves import Multiple_GGmax_Damping_... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.allclose",
"matplotlib.pyplot.ylabel",
"numpy.corrcoef"
]
] |
shaandesai1/AIMS | [
"fee0be214b393af2184d565eb1e9aebb4eb6eeec"
] | [
"optimization/prac1/optim/bcfw.py"
] | [
"import torch\nimport random\nimport math\n\nfrom optim.base import Optimizer, Variable, HParams\n\n\nclass HParamsBCFW(HParams):\n required = ('n_samples', 'batch_size', 'n_features', 'n_classes', 'mu')\n defaults = {'verbose': 1, 'eps': 1e-5}\n\n def __init__(self, **kwargs):\n super(HParamsBCFW, ... | [
[
"torch.zeros",
"torch.norm",
"torch.LongTensor",
"torch.tensor"
]
] |
khinsen/synthia | [
"9d5aeda09867169a9a9f8c94ed46d1a3402b6bea"
] | [
"synthia/generators/copula.py"
] | [
"# Synthia (https://github.com/dmey/synthia).\n# Copyright (c) 2020 D. Meyer and T. Nagler. Licensed under the MIT License.\n\nfrom typing import List, Optional, Union, Dict\nimport numpy as np\nimport xarray as xr\n\nfrom scipy.stats import rankdata\n\nfrom ..parameterizers.parameterizer import Parameterizer\nfrom... | [
[
"numpy.concatenate",
"numpy.quantile",
"scipy.stats.rankdata",
"numpy.empty"
]
] |
zhaoxin111/learn-to-cluster | [
"3dc9a0d43cae2f0af379646a83563343d93cd0d8"
] | [
"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",
"torch.cuda.manual_seed_all",
"numpy.linalg.norm",
"numpy.random.seed",
"numpy.load",
"torch.manual_seed",
"numpy.savez_compressed",
"numpy.fromfile"
]
] |
MatthewYancey/processing | [
"3cf82a875bdbe439c5b3073516281ee3400313d9"
] | [
"wall_art/wall_art17/text_processing.py"
] | [
"import os\nimport pandas as pd\n\nwith open(os.getcwd() + '/family_rain/YanceyGould.ged', 'r') as f:\n text = f.readlines()\n\nres = []\n# lines that start with 0 are the begining of a record\ngiven_name = ''\nsur_name = ''\nsex = ''\nbirth_date = ''\ndeath_date = ''\nplace = ''\n\nfor i, line in enumerate(text... | [
[
"pandas.DataFrame",
"pandas.to_numeric"
]
] |
gonzalo-munillag/Benchmarking_Differential_Privacy_Analytics_Libraries | [
"eb0aaa38686812112d421085b0b61fa9880c4f87"
] | [
"Time_and_Memory_calculation/Code/Python/smartnoise.py"
] | [
"import opendp.smartnoise.core as sn\nimport sys\nimport math\nimport numpy as np \nimport pandas as pd \nimport time\nimport os\nimport psutil\nfrom needed_functions import *\nepsilon = pd.read_pickle('epsilon.pkl')\n\nlibrary_name = 'smartnoise'\n\ndef smartnoise_single_query(dataset_folder_path, number_of_csv_fi... | [
[
"pandas.read_pickle",
"numpy.max",
"numpy.min"
]
] |
azavea/raster-vision-tile2vec | [
"9767cf5ca7400497434e90d131c747f54f4d0767"
] | [
"tile2vec/plugin/backend/tile2vec_backend.py"
] | [
"import os\nimport uuid\nimport shutil\nfrom time import time\n\nimport numpy as np\nimport rastervision as rv\nfrom rastervision.utils.files import (download_if_needed, make_dir,start_sync,\n sync_to_dir, sync_from_dir)\n\nfrom tile2vec.datasets import triplet_dataloader\nfrom ... | [
[
"torch.autograd.Variable",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.load",
"numpy.moveaxis",
"numpy.expand_dims"
]
] |
okumakito/dnb-bts | [
"5521e76d7c7ac3eccbd111227dad49c77a198ac7"
] | [
"scripts/utils/calculate_deg.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom utils import calculate_q\nfrom scipy import stats\n\ndef calculate_deg_fold_change(data1_df, data2_df, fc_cutoff=1, \n alternative='two-sided'):\n \"\"\"\n This function calculates differentially expressed genes (DEGs) \n between two Dat... | [
[
"scipy.stats.ttest_ind",
"numpy.random.randn"
]
] |
chrispla/composition_tool | [
"cb6de5fa8cd08c58fb32ab9d0e800bdf22f71dd1"
] | [
"project_general.py"
] | [
"import os\nimport librosa\nimport numpy as np\nfrom pydub import AudioSegment\nfrom sklearn.cluster import KMeans\n\n#---Reading files names to array---#\npath = '.'\nfiles = []\n# r=root, d=directories, f = files\nfor r, d, f in os.walk(path):\n for file in f:\n if '.wav' in file:\n files.app... | [
[
"numpy.asarray",
"numpy.round",
"sklearn.cluster.KMeans",
"numpy.mean",
"numpy.std"
]
] |
aalto-ml4h/pummel-regression | [
"73175390b73a9118199638d580ff4847925e7598"
] | [
"src/preprocess/prepare_data_for_nlp.py"
] | [
"\"\"\"\n- Script takes input years and output years and loads the corresponding year's\n(processed) visits tables. \n- It then sorts the visits based on krypht.\n- merges the visits table with the combined diagnosis table \n- sets the target \n\"\"\"\nimport os\nimport sys\nimport time\nimport gc\n\nimport pandas ... | [
[
"sklearn.model_selection.train_test_split",
"numpy.sum",
"pandas.read_csv",
"pandas.concat"
]
] |
vegaluisjose/reticle-evaluation | [
"35eff04d0362547cce2ac5549f7c050d1f37ccbf"
] | [
"scripts/compiler_runtime.py"
] | [
"import os\nfrom utilities import *\nfrom time import perf_counter\nimport pandas as pd\n\n\ndef run(prog):\n backends = [\"base\", \"hint\", \"reticle\"]\n progs = get_prog_list(prog)\n lens = get_prog_len(prog)\n data = {}\n for b in backends:\n make_source_dir(b)\n for p, l in zip(pr... | [
[
"pandas.DataFrame.from_dict"
]
] |
deepakrana47/Recursive-Autoencoder | [
"e95316b94f5e10317b9121878157dc04377fd4f8"
] | [
"util/Utility.py"
] | [
"import numpy as np, re, pickle\nfrom random import shuffle\n\ndef init_weight(size1, size2=0, mean = 0, sigma = 0.1):\n if size2 == 0:\n return np.random.normal(mean, sigma, (size1, 1))\n return np.random.normal(mean, sigma, (size1, size2))\n\n\ndef get_n_feature(line1, line2):\n nfeat = [0,0,0]\n ... | [
[
"numpy.random.normal",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.argmin",
"numpy.ones",
"numpy.amin",
"numpy.cumsum",
"numpy.floor"
]
] |
dennyac/onnxruntime | [
"d5175795d2b7f2db18b0390f394a49238f814668",
"d5175795d2b7f2db18b0390f394a49238f814668",
"d5175795d2b7f2db18b0390f394a49238f814668"
] | [
"onnxruntime/python/tools/transformers/test/test_data/gpt2_pytorch1.5_opset11/generate_tiny_gpt2_model.py",
"orttraining/orttraining/python/training/_utils.py",
"tools/test/test_custom_ops_pytorch_exporter.py"
] | [
"#-------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n#--------------------------------------------------------------------------\n# This tool generates a tiny GPT2 model for testing fusion script... | [
[
"numpy.random.randint",
"numpy.random.rand",
"numpy.sqrt",
"numpy.asarray"
],
[
"torch.device"
],
[
"numpy.testing.assert_allclose",
"torch.no_grad",
"torch.inverse",
"torch.manual_seed",
"torch.jit._flatten",
"torch.onnx.export",
"torch.nn.GELU",
"torch... |
FrancisTembo/VoiceLab | [
"107d326c96d59cb79084d9e0aa833e389800b600"
] | [
"Voicelab/toolkits/Voicelab/MeasureFormantPositionsNode.py"
] | [
"from Voicelab.pipeline.Node import Node\nfrom parselmouth.praat import call\nfrom Voicelab.toolkits.Voicelab.VoicelabNode import VoicelabNode\nfrom Voicelab.toolkits.Voicelab.MeasurePitchNode import measure_pitch\nfrom scipy import stats\nimport statistics\n\n\nclass MeasureFormantPositionsNode(VoicelabNode):\n ... | [
[
"scipy.stats.zscore",
"scipy.stats.normaltest"
]
] |
prihoda/bgc-pipeline-1 | [
"29300da912fd1836eea8e285e2e50f5326f021f3"
] | [
"bgc_detection/evaluation/merge_split_samples.py"
] | [
"#!/usr/bin/env python\n# David Prihoda\n# Functions for shuffling and merging sequence samples (DataFrames) into a long sequence\n# Used for fake genome generation from positive and negative BGC samples\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import KFold\n\ndef merge_samples(sampl... | [
[
"sklearn.model_selection.KFold",
"numpy.random.shuffle",
"pandas.Series"
]
] |
idarlenearaujo/HackerRank_Python | [
"3fc4d0baf37fe321737f1e1ae9320d67e5ee984a"
] | [
"Numpy/Arrays.py"
] | [
"import numpy\n\n# função\ndef arrays(arr):\n return (numpy.array(arr, float))[::-1]\n\n# entrada\narr = input().strip().split()\nresult = arrays(arr)\nprint(result)\n"
] | [
[
"numpy.array"
]
] |
andravin/cupy | [
"5cf50a93bbdebe825337ed7996c464e84b1495ba"
] | [
"cupy/padding/pad.py"
] | [
"import numpy\nimport six\n\nimport cupy\n\n\ndef _prepend_const(narray, pad_amount, value, axis=-1):\n if pad_amount == 0:\n return narray\n padshape = tuple([x if i != axis else pad_amount\n for i, x in enumerate(narray.shape)])\n return cupy.concatenate((cupy.full(padshape, v... | [
[
"numpy.repeat",
"numpy.rint",
"numpy.tile",
"numpy.asarray"
]
] |
drivendataorg/DrivenData-2021-Geopose-Solution | [
"fc1dead0aeb1ade9e9d87b55f56e631c57e966a6"
] | [
"geopose/dataset.py"
] | [
"import json\nimport math\nimport os.path\nfrom typing import Optional, List, Callable, Tuple\n\nimport albumentations as A\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom PIL import Image\nfrom pytorch_toolbelt.datasets import (\n mask_to_bce_target,\n INPUT_INDEX_KEY,\n INPUT_IMA... | [
[
"torch.zeros",
"torch.cos",
"numpy.array",
"numpy.sin",
"sklearn.model_selection.StratifiedKFold",
"sklearn.preprocessing.LabelEncoder",
"numpy.zeros",
"torch.sin",
"pandas.merge",
"torch.tensor",
"numpy.cos",
"numpy.isfinite",
"torch.atan2"
]
] |
chamhoo/Severstal | [
"29e7cf7083b6e5a6228379177dc83f6f85533e9a"
] | [
"fiat/DataAugment.py"
] | [
"\"\"\"\nauther: LeeCHH\n\"\"\"\nimport tensorflow as tf\n\n\ndef flip_up_down():\n\n def augment(dataset):\n return dataset.map(lambda img, label: (\n tf.image.random_flip_up_down(img, 18473),\n tf.image.random_flip_up_down(label, 18473)))\n return augment\n\n\ndef flip_left_righ... | [
[
"tensorflow.image.adjust_saturation",
"tensorflow.image.random_hue",
"tensorflow.image.random_flip_left_right",
"tensorflow.image.random_flip_up_down",
"tensorflow.image.random_contrast",
"tensorflow.image.random_brightness",
"tensorflow.image.transpose_image",
"tensorflow.image.pe... |
yohey/meshio | [
"3a66b0056c51e94dd5e746056a845d60735f8df1"
] | [
"test/test_flac3d.py"
] | [
"import copy\nimport pathlib\nimport sys\n\nimport helpers\nimport numpy as np\nimport pytest\n\nimport meshio\n\n\n@pytest.mark.parametrize(\n \"mesh, data\",\n [\n (helpers.empty_mesh, []),\n (helpers.tet_mesh, []),\n (helpers.hex_mesh, []),\n (helpers.tet_mesh, [1, 2]),\n ],\... | [
[
"numpy.array"
]
] |
aeksco/FRMA-Ontology | [
"1eab8731bdad49328dddfbf52468d2a107d3f247"
] | [
"attributes_data/nearestNeighborTest.py"
] | [
"\"\"\"\nThis is a test that we're using to gather example data from our two example models.\nThis is passed a list of image names, image numbers, and the vector representing the face in the photo,\nand this script takes that and a split of testing vs training data to determine how accurate the model was by simply\... | [
[
"numpy.linalg.norm",
"numpy.zeros"
]
] |
ianb/sheets | [
"373f4b9630c7fdafdf8a93566fdae0c3df32345b"
] | [
"sheets/support/matplotlib.py"
] | [
"from contextlib import contextmanager\nfrom io import BytesIO\nfrom tempita import html_quote\nfrom webob import Response\nfrom ..http import http_objects\nfrom matplotlib import pyplot\nfrom ..env import add_global\n\n# Just a way to save stuff for now\nsave_these = []\n\n@contextmanager\ndef make_figure(use_figu... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.figure"
]
] |
Utsav-Patel/Voyage-Into-the-Unknown | [
"0e5bd26eb59fa8f1d5dfb92ea85fc23b0fae9bc5"
] | [
"tests/Problem_4.py"
] | [
"\"\"\"\nThis is the test file to solve the problem 4.\n\"\"\"\n\n# Necessary Imports\nimport numpy as np\nfrom src.Maze import Maze\nfrom src.helper import generate_grid_with_probability_p, astar_search, single_plot\nfrom constants import NUM_ROWS, NUM_COLS, STARTING_POSITION_OF_AGENT, GOAL_POSITION_OF_AGENT\nfrom... | [
[
"numpy.linspace"
]
] |
nicholasmalaya/paleologos | [
"11959056caa80d3c910759b714a0f8e42f986f0f"
] | [
"disputatio/routines/wind_impact/wind.py"
] | [
"#!/bin/py\n\n# m/s | hot | cold \n# 3 34.9 | 29.8\n# 2 40.09 | 9.3\n# 1 34.5 | .8745\n# 0 20.0 | 0.0\n#\n\nimport numpy as np\n\nspeed = [0,1,2,3]\nh = [7.0,12.5,30.09,54.9]\nc = [0.0,.8745,7.3,24.8]\n\n\nhot = 11.65*np.array(h)\ncold = 11.65*np.array(c)\n\n#\n#\n#\nimp... | [
[
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel"
]
] |
nfsergiu/PyOpenPose | [
"b5cc3b352e850cbebf35a6216df70b895950856c"
] | [
"scripts/OpLoop.py"
] | [
"\"\"\"\nExample script using PyOpenPose.\n\"\"\"\nimport PyOpenPose as OP\nimport time\nimport cv2\n\nimport numpy as np\nimport os\n\nOPENPOSE_ROOT = os.environ[\"OPENPOSE_ROOT\"]\n\n\ndef showHeatmaps(hm):\n for idx, h in enumerate(hm):\n cv2.imshow(\"HeatMap \"+str(idx), h)\n\n\ndef showPAFs(PAFs, sta... | [
[
"numpy.zeros_like",
"numpy.mean"
]
] |
ViRu-ThE-ViRuS/Evolve | [
"293a18ee67b005b66a32e95918d6023564def032"
] | [
"example.py"
] | [
"'''\nExample program, demonstrating use of evolve\n'''\n\nimport evolve\n\nENV_NAME = 'CartPole-v1'\n\n\ndef env_function():\n '''\n Returns a new environment\n '''\n\n import gym\n return gym.make(ENV_NAME)\n\n\ndef model_function(env):\n '''\n Returns a keras model\n '''\n\n from tenso... | [
[
"tensorflow.keras.models.Sequential",
"tensorflow.keras.layers.Dense"
]
] |
igorcosta/bidu | [
"7c9e7b788bfae851a3fc37b494ccea27709adf2d"
] | [
"bidu/preprocessing/image.py"
] | [
"'''Fairly basic set of tools for real-time data augmentation on image data.\nCan easily be extended to include new transformations,\nnew preprocessing methods, etc...\n'''\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport numpy as np\nimport re\nfrom scipy import linalg\nimpo... | [
[
"numpy.dot",
"scipy.ndimage.interpolation.affine_transform",
"numpy.rollaxis",
"numpy.copy",
"scipy.linalg.svd",
"numpy.min",
"numpy.mean",
"numpy.cos",
"numpy.random.random",
"numpy.max",
"numpy.sin",
"numpy.arange",
"numpy.random.randint",
"numpy.sqrt",
... |
darkosarajkic997/mmediting | [
"772791b62914c7404d0de152b2790de942077ca6"
] | [
"demo/matting_demo.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport argparse\n\nimport mmcv\nimport torch\n\nfrom mmedit.apis import init_model, matting_inference\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='Matting demo')\n parser.add_argument('config', help='test config file path')\n parse... | [
[
"torch.device"
]
] |
salesforce/ctrl-detector | [
"6f0dc8f1a820ae963d80308a72054f7dc8d61331"
] | [
"server.py"
] | [
"\"\"\"\nCopyright (c) 2020, salesforce.com, inc.\nAll rights reserved.\nSPDX-License-Identifier: BSD-3-Clause\nFor full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause\n\"\"\"\n\nimport os\nimport sys\nfrom http.server import HTTPServer, SimpleHTTPRequestHandler\... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.tensor",
"torch.ones_like",
"torch.load"
]
] |
pnkraemer/jax | [
"1df942f276f99e3b8615a519f49712beeb1d9bb5"
] | [
"jaxlib/lapack.py"
] | [
"# 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 by applicable law or agreed ... | [
[
"numpy.int32",
"numpy.uint8",
"numpy.dtype"
]
] |
Cadair/VivaTalk | [
"d9bd5b0c0fca7756c07cbe1adb2f809cd00e9dae"
] | [
"python/time_distance_plots.py"
] | [
"# coding: utf-8\nfrom __future__ import print_function\n\nimport os\nfrom functools import partial\nimport numpy as np\n\nfrom scipy.interpolate import interp1d\n\n\ndef get_filepath(base_path, driver, period, post_amp, tube_r, exp_fac):\n if exp_fac is not None:\n data_dir = os.path.join(base_path, '%s/... | [
[
"numpy.zeros",
"numpy.abs",
"numpy.sqrt",
"numpy.cumsum",
"numpy.isfinite",
"numpy.linspace"
]
] |
HninPwint/adv_dsi_lab_2 | [
"6845920821bedc059dbe92af5c4a7689cb616023"
] | [
"src/features/dates.py"
] | [
"\n\ndef convert_to_date(df, cols:list):\n ''' Convert the specified columns of the dataframe into datetime\n \n Parameters\n ----------\n df : pd.dataframe\n Input dataframe\n cols: list\n List of columns to be converted\n\n Returns\n -------\n pd.DataFrame\n Pandas ... | [
[
"pandas.to_datetime"
]
] |
wimiz/matplotlib | [
"e987a86aa2ee86f17ddc8ca5df5cf48f9a39615b"
] | [
"lib/matplotlib/legend.py"
] | [
"\"\"\"\nThe legend module defines the Legend class, which is responsible for\ndrawing legends associated with axes and/or figures.\n\n.. important::\n\n It is unlikely that you would ever create a Legend instance manually.\n Most users would normally create a legend via the\n :meth:`~matplotlib.axes.Axes.... | [
[
"matplotlib.patches.FancyBboxPatch",
"numpy.tile",
"matplotlib.offsetbox.DraggableOffsetBox.__init__",
"matplotlib.offsetbox.TextArea",
"matplotlib.cbook.silent_list",
"numpy.concatenate",
"matplotlib.font_manager.FontProperties",
"matplotlib.cbook.is_string_like",
"matplotlib.... |
bimal1988/detector | [
"5201a0db69f318b8ccc5081e35418b5cbc1ec065"
] | [
"demo/predictor.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport cv2\nimport torch\nfrom torchvision import transforms as T\n\nfrom lib.modeling.detector import build_detection_model\nfrom lib.utils.checkpoint import DetectronCheckpointer\nfrom lib.structures.image_list import to_image_list\nfrom li... | [
[
"torch.zeros",
"torch.device",
"torch.nonzero",
"torch.cat",
"matplotlib.pyplot.get_cmap",
"numpy.copy",
"torch.no_grad",
"torch.tensor"
]
] |
schuderer/bprl | [
"e9820a7d0d8120776f4feac9776c66f205713075"
] | [
"tests/agents/test_discretizer.py"
] | [
"\"\"\"Tests for the agents.discretizer module\"\"\"\n\n# Stdlib imports\n\n# Third-party imports\nfrom gym.spaces.box import Box\nfrom gym.spaces.dict import Dict\nfrom gym.spaces.discrete import Discrete\nimport numpy as np\nimport pytest\n\n# Application imports\nfrom agents.discretizer import create_discretizer... | [
[
"numpy.array"
]
] |
sumeetsk/maxgap_bandit | [
"34dbf4dbe8717302f972d1a1c8c966c573e38ccd"
] | [
"streetview_data/generate_data.py"
] | [
"import pandas as pd\nimport numpy as np\nimport copy\nimport pickle\nimport multiprocessing\nfrom functools import partial\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\ndelta = 0.1\nsigma = 0.1\n\ndef calculate_ci(pulls, delta, K):\n beta = 0.5; a = 1.+10./K;\n ci = (1.+beta) ... | [
[
"matplotlib.use",
"numpy.random.normal",
"numpy.zeros_like",
"numpy.array",
"numpy.zeros",
"numpy.log",
"numpy.random.seed",
"matplotlib.pyplot.savefig",
"numpy.ones",
"matplotlib.pyplot.subplots",
"numpy.sort",
"numpy.argsort",
"numpy.random.random",
"panda... |
pieromarini/PyNeuNet | [
"b70fbf2e857167ac106dae7f6cf6731d6de38420"
] | [
"neuralnetwork.py"
] | [
"import numpy as np\nfrom scipy.special import expit\n\n\nclass NeuralNetwork():\n \"\"\"\n NOTE: Currently supports only 1 hidden layer.\n layers = (x, y, z)\n Defines a neural network -> x input | y hidden | z outputs\n \"\"\"\n\n def __init__(self, layers, learn_rate=0.3):\n ... | [
[
"numpy.array",
"scipy.special.expit",
"numpy.matmul",
"numpy.transpose"
]
] |
Helmholtz-AI-Energy/AI-HERO-Energy | [
"41507dc1c9f00c35c65b62c2dc4c23bdb36059a0"
] | [
"training.py"
] | [
"#!/usr/bin/env python3\n\nfrom argparse import ArgumentParser\nimport os\nimport torch\nfrom torch import nn\nfrom torch.utils.data import DataLoader\nfrom model import LoadForecaster\nfrom dataset import CustomLoadDataset\n\n\nforecast_days = 7\n\n\ndef main():\n parser = ArgumentParser()\n parser.add_argum... | [
[
"torch.zeros",
"torch.device",
"torch.nn.MSELoss",
"torch.no_grad",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
]
] |
Wu-hengcheng/motion_imitation | [
"a152a43419cfc76b71b988b94d267220896da607"
] | [
"mpc_controller/raibert_swing_leg_controller.py"
] | [
"\"\"\"The swing leg controller class.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\n#from __future__ import google_type_annotations\nfrom __future__ import print_function\n\nimport os\nimport inspect\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentfr... | [
[
"numpy.array"
]
] |
92ypli/imgclsmob | [
"648137251e14c36ff8226ac5cf5b5a8fd05544e3"
] | [
"tensorflow_/tensorflowcv/models/shufflenet.py"
] | [
"\"\"\"\n ShuffleNet for ImageNet-1K, implemented in TensorFlow.\n Original paper: 'ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices,'\n https://arxiv.org/abs/1707.01083.\n\"\"\"\n\n__all__ = ['ShuffleNet', 'shufflenet_g1_w1', 'shufflenet_g2_w1', 'shufflenet_g3_w1', 'shuff... | [
[
"tensorflow.trainable_variables",
"tensorflow.nn.relu",
"tensorflow.Session",
"tensorflow.reset_default_graph",
"tensorflow.layers.dense",
"tensorflow.global_variables_initializer",
"tensorflow.layers.average_pooling2d"
]
] |
HadiSalehWeb/LearningFromLabelProportions | [
"eab2338b1103d371572d3cc510e353bc515e1ab8"
] | [
"LearningFromLabelProportions/LearningFromLabelProportions/MnistDataProcessor.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom tensorflow import keras\nfrom keras import layers, models\nimport matplotlib.pyplot as plt\n\ndef get_processed_mnist_data(group_size, class0=0, class1=1):\n \"\"\"Creates a set of bags, each containing a number of samples and the proportion of a certain label i... | [
[
"numpy.array",
"tensorflow.keras.datasets.mnist.load_data",
"numpy.random.shuffle"
]
] |
alextongue/vaessl-doa | [
"5efc40514a34c30b6673f1bedfc3f7829ed20d0d"
] | [
"vaessl_core.py"
] | [
"\"\"\"\nCode implementing inference and generative models for semi-supervised\nvariational autoencoder (VAE-SSL) approach to source localization in reverberant\nenvironments\n\nThe method implemented here is described in:\n1. M.J. Bianco, S. Gannot, E. Fernandez-Grande, P. Gerstoft, \"Semi-supervised\nsource loca... | [
[
"torch.zeros",
"numpy.array",
"torch.ones",
"torch.topk",
"torch.abs",
"torch.zeros_like",
"torch.log",
"torch.sum"
]
] |
menhuan/notes | [
"aaebe6a37b272d6b1110c7d23724aab079468628"
] | [
"code/python/python_study/thirteen/pandas_learn.py"
] | [
"import pandas\nfrom pandas import Series, DataFrame\n\nindex_values = Series([1, 2, 3, 4, 5])\nchart_values = Series([1, 2, 3, 4, 5], index={\"a\", \"b\", \"c\", \"d\", \"e\"})\nprint(index_values)\nprint(chart_values)\n\ncontent = {\"a\": 1, \"b\": 2, \"c\": \"3\"}\ndict_values = Series(content)\nprint(dict_value... | [
[
"pandas.concat",
"pandas.DataFrame",
"pandas.read_excel",
"pandas.read_json",
"pandas.Series",
"pandas.read_csv"
]
] |
MarkAWard/mlflow | [
"7cee20af9c4c0b0177ab7eb93c34a935f68fc458"
] | [
"mlflow/lightgbm.py"
] | [
"\"\"\"\nThe ``mlflow.lightgbm`` module provides an API for logging and loading LightGBM models.\nThis module exports LightGBM models with the following flavors:\n\nLightGBM (native) format\n This is the main flavor that can be loaded back into LightGBM.\n:py:mod:`mlflow.pyfunc`\n Produced for use by generic ... | [
[
"numpy.array",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.argsort"
]
] |
thomasgibson/firedrake-hybridization | [
"b9f2710cfce3b15fecb11fc9c13dc34283c800d3"
] | [
"compressible_examples/dcmip_3-1_meanflow_quads.py"
] | [
"from gusto import *\nfrom firedrake import (CubedSphereMesh, ExtrudedMesh, Expression,\n VectorFunctionSpace, FunctionSpace, Function,\n SpatialCoordinate, as_vector, interpolate,\n CellVolume, exp, acos, cos, sin, pi,\n sqrt, ... | [
[
"numpy.finfo"
]
] |
jaealways/fear-and-greed | [
"796ce9858facada728e47d64eb461c4bf0c9865a"
] | [
"fng/calculation.py"
] | [
"import numpy as np\n\nclass VariableCalculation:\n def get_return_time_series(self, X):\n \"\"\"\n Parameters\n ----------\n X: array, shape = [m, t]\n Price time series\n\n Returns\n -------\n G: array, shape = [m, t-1]\n \"\"\"\n rp = n... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.log",
"numpy.zeros",
"numpy.true_divide",
"numpy.diff",
"numpy.nanmean",
"numpy.sqrt",
"numpy.nanstd"
]
] |
cavaunpeu/cadCAD | [
"5d727a65cd81b99a2f706f8606489a7edd9e8643"
] | [
"simulations/regression_tests/models/config_multi_1.py"
] | [
"from copy import deepcopy\nfrom pprint import pprint\n\nimport numpy as np\nfrom datetime import timedelta\n\n# from cadCAD import configs\nfrom cadCAD.configuration import Experiment\nfrom cadCAD.configuration.utils import bound_norm_random, config_sim, time_step, env_trigger\nfrom simulations.regression_tests.ex... | [
[
"numpy.array",
"numpy.random.RandomState"
]
] |
Dr-Gunter-St/paphack | [
"2301c4b7de82e4052067717c8545e6c37ad1176f"
] | [
"consumer/consumer.py"
] | [
"import os\nimport cv2\nimport face_recognition\nimport numpy as np\nfrom flask import Flask, Response, render_template, jsonify\nfrom kafka import KafkaConsumer\n# Kafka Topic\ntopic = \"test\"\nW = 288\nH = 512\n\nconsumer = KafkaConsumer(\n topic,\n bootstrap_servers=['kafka:9093'])\n\n# Set the consumer i... | [
[
"numpy.frombuffer"
]
] |
broadinstitute/CRISPRiTilingDesign | [
"cc07d2e5636cc91588b9d91e074a95e1514ceb93"
] | [
"src/PrimeEditor.py"
] | [
"###############################################################################\n## Library code for designing CRISPRi screens\n## Jesse Engreitz\n## November 14, 2019\n## Design Prime Editor gRNAs\n\n\nimport Bio\nfrom Bio.Seq import Seq\nfrom Bio.SeqFeature import SeqFeature, FeatureLocation\nfrom Bio import Seq... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
MarcoGorelli/Theano-PyMC | [
"55ef0e6b7380e062bdd09fcd7f820643f8521fb0"
] | [
"theano/scan/utils.py"
] | [
"\"\"\"This module provides utility functions for the `Scan` `Op`.\"\"\"\n\n__docformat__ = \"restructedtext en\"\n__authors__ = (\n \"Razvan Pascanu \"\n \"Frederic Bastien \"\n \"James Bergstra \"\n \"Pascal Lamblin \"\n \"Arnaud Bergeron\"\n)\n__copyright__ = \"(c) 2010, Universite de Montreal\"\n... | [
[
"numpy.isinf",
"numpy.isnan"
]
] |
dada1437903138/imagepy | [
"3c378ebaf72762b94f0826a410897757ebafe689"
] | [
"imagepy/menus/Plugins/StackReg/stackreg_plgs.py"
] | [
"from sciapp.action import Filter, Simple\nfrom pystackreg import StackReg\nimport numpy as np\nimport pandas as pd\nfrom skimage import transform as tf\nimport scipy.ndimage as ndimg\n\nclass Register(Simple):\n\ttitle = 'Stack Register'\n\tnote = ['8-bit', '16-bit', 'int', 'float', 'stack']\n\n\tpara = {'trans':'... | [
[
"numpy.array",
"numpy.zeros_like",
"scipy.ndimage.gaussian_filter"
]
] |
robertburbidgedata/aizynthfinder | [
"c05be3ce2eb3773dbdd2c52345f49543ca5b5b1e"
] | [
"tests/conftest.py"
] | [
"import sys\n\nimport pytest\nimport numpy as np\nimport yaml\n\nfrom aizynthfinder.mcts.config import Configuration\nfrom aizynthfinder.mcts.policy import Policy\nfrom aizynthfinder.mcts.stock import Stock\nfrom aizynthfinder.mcts.node import Node\nfrom aizynthfinder.chem import Reaction\nfrom aizynthfinder.mcts.m... | [
[
"numpy.array",
"numpy.zeros"
]
] |
VivanVatsa/ds-salary-proj | [
"b78b5498d2e3326799cae445ba47d6e6a5637ccb"
] | [
"model_building.py"
] | [
"#%%\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndf = pd.read_csv(\"data_eda.csv\")\n# choose the relevant columns\n\n#%%\ndf.columns\n\n#%%\ndf_model = df[[\n \"avg_salary\",\n \"Rating\",\n \"Size\",\n \"Type of ownership\",\n \"Industry\",\n \"Sector\",\n \"R... | [
[
"sklearn.linear_model.Lasso",
"sklearn.linear_model.LinearRegression",
"sklearn.model_selection.GridSearchCV",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"sklearn.metrics.mean_absolute_error",
"sklearn.ensemble.RandomForestRegressor",
"sklearn.model_selection.train_test_split",
... |
pbloem/python-stuff | [
"db50fc52bcd59245c826013f196eb63319b326bc"
] | [
"newton.py"
] | [
"import torch\n\nfrom torch.autograd import Variable\n\nimport torch.optim as optim\nimport torch.nn as nn\n\nimport cmath as cm\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport random, math\nfrom tqdm import trange\n\nSTEPS = 100\nRES = 100\n\n\nclass Net(nn.Module):\n\n def __init__(self, r0, c0)... | [
[
"matplotlib.pyplot.colorbar",
"numpy.asarray",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"torch.FloatTensor",
"numpy.linalg.pinv",
"matplotlib.pyplot.set_cmap",
"torch.autograd.grad",
"matplotlib.pyplot.gcf",
"numpy.outer",
"numpy.linspace",
"matplotlib.pyplot.ims... |
ygao12/akshare | [
"29b969fa9271c6b82308651ec9f6c00bf75abdc9"
] | [
"akshare/stock/zh_stock_ah_tx.py"
] | [
"# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nAuthor: Albert King\ndate: 2019/10/29 15:20\ncontact: jindaxiang@163.com\ndesc: 获取腾讯财经-A+H股数据, 实时行情数据和历史行情数据(后复权)\n\"\"\"\nimport random\n\nimport requests\nimport pandas as pd\nimport demjson\nfrom tqdm import tqdm\n\nfrom akshare.stock.cons import (hk_url,\n... | [
[
"pandas.DataFrame",
"pandas.read_json"
]
] |
min-tang-hash/captum | [
"1168bc5f57f38d169a02a97553edbdf192be0134"
] | [
"tests/attr/layer/test_layer_gradient_x_activation.py"
] | [
"#!/usr/bin/env python3\nimport unittest\nfrom typing import Any, List, Tuple, Union\n\nimport torch\nfrom torch import Tensor\nfrom torch.nn import Module\n\nfrom captum._utils.typing import ModuleOrModuleList\nfrom captum.attr._core.layer.layer_activation import LayerActivation\nfrom captum.attr._core.layer.layer... | [
[
"torch.no_grad",
"torch.tensor"
]
] |
Spataner/trafficsign-cyclegan | [
"dcc0731f7fd4fb4b7f855a3e875dcbc182388c5f"
] | [
"code/cyclegan/apps/run.py"
] | [
"'''\nApplication for running an existing CycleGAN model on a dataset (unidirectionally).\nUsage: run in_config_path direction in_path out_path [-e extension] [-i in_labels_path] [-o out_labels_path] [-n model_name]\n\nDominic Spata,\nReal-Time Computer Vision,\nInstitut fuer Neuroinformatik,\nRuhr University Bochu... | [
[
"tensorflow.random_uniform",
"tensorflow.reset_default_graph",
"tensorflow.Session",
"tensorflow.train.get_checkpoint_state",
"tensorflow.ConfigProto",
"tensorflow.app.run",
"tensorflow.global_variables_initializer"
]
] |
toddrme2178/pandas | [
"983fae65fbadb83a064dfec53031d875d8e13928"
] | [
"pandas/tests/groupby/test_function.py"
] | [
"import builtins\nimport datetime as dt\nfrom io import StringIO\nfrom string import ascii_lowercase\n\nimport numpy as np\nimport pytest\n\nfrom pandas.errors import UnsupportedFunctionCall\n\nimport pandas as pd\nfrom pandas import (\n DataFrame,\n Index,\n MultiIndex,\n NaT,\n Series,\n Timesta... | [
[
"numpy.random.choice",
"pandas.Grouper",
"pandas.Timestamp",
"numpy.finfo",
"pandas.concat",
"scipy.stats.sem",
"pandas._testing.assert_series_equal",
"numpy.dtype",
"pandas.Timedelta",
"pandas.DataFrame",
"pandas.timedelta_range",
"numpy.random.randint",
"panda... |
dchigarev/arrow | [
"20cd08a8143eed7b48686ac3e696252dc5fdee88"
] | [
"python/pyarrow/tests/test_schema.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... | [
[
"pandas.DataFrame",
"numpy.array",
"pandas.Int32Dtype",
"numpy.dtype"
]
] |
ktirta/PoinTr-LQ | [
"782ae2eed5db19dc2fc90ab474c50d117ed3087a"
] | [
"tools/runner.py"
] | [
"import torch\nimport torch.nn as nn\nimport os\nimport json\nfrom tools import builder\nfrom utils import misc, dist_utils\nimport time\nfrom utils.logger import *\nfrom utils.AverageMeter import AverageMeter\nfrom utils.metrics import Metrics\nfrom extensions.chamfer_dist import ChamferDistanceL1, ChamferDistance... | [
[
"numpy.savetxt",
"torch.cuda.synchronize",
"torch.nn.SyncBatchNorm.convert_sync_batchnorm",
"torch.no_grad",
"numpy.mean",
"torch.cuda.device_count",
"torch.Tensor",
"torch.nn.DataParallel"
]
] |
hesseltuinhof/lingvo | [
"1c5aae535379f0f210202c5748a5df156dfed85f"
] | [
"lingvo/core/batch_major_attention.py"
] | [
"# Lint as: python3\n# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2... | [
[
"numpy.sqrt"
]
] |
kmuehlbauer/xarray | [
"79fa060dd6b567e8aa3606b8b8cc0c54d1b14acb"
] | [
"xarray/core/combine.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport itertools\nimport warnings\nfrom collections import Counter\n\nimport pandas as pd\n\nfrom . import utils\nfrom .alignment import align\nfrom .merge import merge\nfrom .pycompat import OrderedDict, basestring, iteritems\nfrom .variable impo... | [
[
"pandas.unique"
]
] |
Sohamkayal4103/mlflow | [
"4e444efdf73c710644ee039b44fa36a31d716f69"
] | [
"mlflow/shap.py"
] | [
"from contextlib import contextmanager\nimport os\nimport tempfile\nimport yaml\nimport warnings\n\nimport numpy as np\n\nimport mlflow\nimport types\nimport mlflow.utils.autologging_utils\nfrom mlflow import pyfunc\nfrom mlflow.exceptions import MlflowException\nfrom mlflow.utils.annotations import experimental\nf... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.gcf",
"numpy.save"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.