repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
rajatscibi/chitra | [
"1543805f1401c571e516e47ab1c8a83b93dd657c"
] | [
"tests/image/test_image.py"
] | [
"from unittest.mock import MagicMock\n\nimport numpy as np\nfrom PIL import Image\n\nfrom chitra.image.image import Chitra, _cache_image\n\nurl = (\n \"https://raw.githubusercontent.com/aniketmaurya/chitra/master/docs/assets/logo.png\"\n)\nimage = Chitra(url, cache=True)\n\n\ndef test__load_image():\n url = \... | [
[
"numpy.random.randn",
"numpy.isclose"
]
] |
notZaki/niworkflows | [
"c2d7fade510abed47d3af16258a6a3e30c4e0040"
] | [
"niworkflows/interfaces/nilearn.py"
] | [
"# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"Utilities based on nilearn.\"\"\"\nimport os\nimport nibabel as nb\nimport numpy as np\nfrom skimage import morphology as sim\nfrom scipy.ndimage.morphology import binary_fill_holes, binary_dil... | [
[
"numpy.log",
"scipy.ndimage.morphology.binary_dilation",
"numpy.pad",
"numpy.isnan",
"numpy.asanyarray"
]
] |
skyeeiskowitz/MLPrimitives | [
"276926afb518c70d9445cac926587f1b1e398e6e"
] | [
"tests/custom/test_timeseries_preprocessing.py"
] | [
"from unittest import TestCase\n\nimport numpy as np\nimport pandas as pd\nfrom numpy.testing import assert_allclose\n\nfrom mlprimitives.custom.timeseries_preprocessing import (\n cutoff_window_sequences, intervals_to_mask, rolling_window_sequences, time_segments_aggregate,\n time_segments_average)\n\n\nclas... | [
[
"pandas.to_datetime",
"pandas.date_range",
"numpy.arange",
"pandas.Timedelta",
"pandas.DataFrame",
"numpy.testing.assert_allclose",
"numpy.array"
]
] |
sotte/great_expectations | [
"5dd18f0d7803ef2c257d91178e8c74c1c11d7106"
] | [
"great_expectations/dataset/util.py"
] | [
"# Utility methods for dealing with Dataset objects\n\nfrom __future__ import division\n\nimport decimal\n\nfrom six import string_types, integer_types\n\nimport numpy as np\nfrom scipy import stats\nimport pandas as pd\nimport numpy as np\nimport warnings\nimport sys\nimport copy\nimport datetime\n\nfrom functools... | [
[
"pandas.Series",
"numpy.linspace",
"numpy.min",
"scipy.stats.kde.gaussian_kde",
"numpy.isnan",
"numpy.concatenate",
"numpy.max",
"numpy.diff",
"numpy.histogram",
"numpy.sum"
]
] |
ywz978020607/HESIC | [
"546e0c0788552caee4ac75a229558ff64f295916"
] | [
"compressai/ops/ops.py"
] | [
"# Copyright 2020 InterDigital Communications, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"torch.round"
]
] |
cyndi5/analyze | [
"886200955ccc2bc2efd9d7eb1d02ff5a52318e68"
] | [
"analyze.py"
] | [
"import numpy as np\nfrom scipy import signal, optimize, stats, integrate, mean\nimport pandas as pd\n\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\n\nimport argparse\n\nparser = argparse.ArgumentParser(description='Uses Plotly Dash core to plot a CSV from Google Science Jou... | [
[
"scipy.integrate.cumtrapz",
"numpy.subtract",
"pandas.read_csv",
"numpy.mean"
]
] |
mdatres/quantlab | [
"09fb24ede78f49768f829afe0fac2ac291b8fd4f"
] | [
"systems/ILSVRC12/AlexNet/alexnet.py"
] | [
"# \n# alexnet.py\n# \n# Author(s):\n# Matteo Spallanzani <spmatteo@iis.ee.ethz.ch>\n# \n# Copyright (c) 2020-2021 ETH Zurich.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.init.constant_",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.init.normal_",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init.kaim... |
kmkolasinski/model-optimization | [
"bd1ad8b72a5feb5d48bbedfaf85fe994d5c421db"
] | [
"tensorflow_model_optimization/python/core/quantization/keras/quantize_annotate_test.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.random.rand",
"tensorflow.keras.utils.custom_object_scope",
"tensorflow.test.main"
]
] |
alexandonian/lightning | [
"90350fd454cd7a51c35adadf5b9753868ac6dccd"
] | [
"lightning_classification/classification/make_lmdb.py"
] | [
"import numpy as np\nimport lmdb\nimport caffe\n\nN = 1000\n\n# Test Data\nX = np.zeros((N, 3, 32, 32), dtype=np.uint8)\ny = np.zeros(N, dtype=np.int64)\n\n# We need to prepare the database for the size. We'll set it 10 times\n# greater than what we theoretically need. There is little drawback to\n# setting this to... | [
[
"numpy.zeros"
]
] |
eshanmherath/AV-Perception | [
"ec56065621141c436d8be39094f4505a6971e796"
] | [
"image_processing/basics/004_hough_transform.py"
] | [
"# You need to specify rho in units of pixels and theta in units of radians.\n\"\"\"\nSo, what are reasonable values? Well, rho takes a minimum value of 1,\nand a reasonable starting place for theta is 1 degree (pi/180 in radians).\nScale these values up to be more flexible in your definition of what constitutes a ... | [
[
"matplotlib.pyplot.imshow",
"numpy.dstack",
"matplotlib.image.imread",
"numpy.copy",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
priya006/PythonProject | [
"fd8ac346e474f48a27cf2a7995fb9d18797bc5c6"
] | [
"2_ml/scores/score_logger.py"
] | [
"from statistics import mean\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nfrom collections import deque\nimport os\nimport csv\nimport numpy as np\n\n# This code is from: https://github.com/gsurma/cartpole\n# Note: right now this is designed to run with only one sample exercise, so th... | [
[
"matplotlib.pyplot.legend",
"numpy.poly1d",
"matplotlib.pyplot.title",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.mean",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplot... |
stevenhurwitt/dealersocket-speedtest | [
"5a6536f4af686e3719e62b535681ce232ad653c1"
] | [
"IDR_Drop/db_connect.py"
] | [
"import numpy as np\nimport pandas as pd\nimport datetime as dt\nfrom subprocess import Popen, PIPE\nimport matplotlib.pyplot as plt\nimport cx_Oracle\nimport time\nimport math\nimport os\n\n''' wrappers for database connections to SQL databases '''\n''' takes query & db as a string and returns a list of results ''... | [
[
"pandas.DataFrame"
]
] |
limjongun95/AIProejct | [
"774a1d155f2917608896ac2e248051b6eb8a9601"
] | [
"settings/TrainSettings.py"
] | [
"import tensorflow as tf\nimport settings.DataSettings as dataSettings\n\n'''\n Following two variables control the shape of input\n data as the shape: [BATCH_SIZE*UNROLLED_SIZE, w, h, c].\n BATCH_SIZE: number of Videos in a batch.\n UNROLLED_SIZE: number of Frames in a Video.\n For the ConvNet p... | [
[
"tensorflow.train.AdamOptimizer"
]
] |
Geson-anko/autokikitori6 | [
"6d60b6bb91b49e85c720ca4b131ba7ca8b8b0668"
] | [
"Kikitori_fftx2_data.py"
] | [
"import torch\nfrom torchaudio.transforms import MelScale\nimport numpy as np\nimport h5py\nfrom pydub import AudioSegment\nimport config\nimport glob\n\nclass ToData:\n \n file_name:str = 'data/encoded_fftx2.h5'\n key_name:str = 'data'\n device = 'cpu'\n\n def __init__(self) -> None:\n self.m... | [
[
"torch.cat",
"torch.zeros",
"torch.from_numpy",
"torch.fft.rfft",
"torch.log1p"
]
] |
logan-dunbar/pybullet_planning | [
"3b25fc7a0f350f4b46048be5c42f9cbf3ab2d6fb"
] | [
"src/pybullet_planning/interfaces/env_manager/pose_transformation.py"
] | [
"import math\nimport numpy as np\nimport pybullet as p\n\nfrom pybullet_planning.utils import get_client, unit_vector, quaternion_from_matrix, clip, euler_from_quaternion\n\n#####################################\n# Geometry\n\n#Pose = namedtuple('Pose', ['position', 'orientation'])\n\ndef Point(x=0., y=0., z=0.):\n... | [
[
"numpy.dot",
"numpy.eye",
"numpy.linalg.norm",
"numpy.math.atan2",
"numpy.cos",
"numpy.sin",
"numpy.less_equal",
"numpy.array"
]
] |
ben-shor/IML.HUJI | [
"65bd0e1262356181bc4d9eb46b1b457b2fc44322"
] | [
"IMLearn/learners/classifiers/perceptron.py"
] | [
"from __future__ import annotations\nfrom typing import Callable\nfrom typing import NoReturn\nfrom ...base import BaseEstimator\nimport numpy as np\n\n\ndef default_callback(fit: Perceptron, x: np.ndarray, y: int):\n pass\n\n\nclass Perceptron(BaseEstimator):\n \"\"\"\n Perceptron half-space classifier\n\... | [
[
"numpy.array",
"numpy.zeros",
"numpy.where",
"numpy.ones"
]
] |
aakashb95/transformers | [
"224bde91caff4ccfd12277ab5e9bf97c61e22ee9"
] | [
"examples/tensorflow/multiple-choice/run_swag.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorflow.reshape",
"tensorflow.keras.losses.SparseCategoricalCrossentropy"
]
] |
rheostat/pyfolio | [
"04ddc116c27f9a9c3265c604474eeb495e0ccc65"
] | [
"pyfolio/plotting.py"
] | [
"#\n# Copyright 2018 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or... | [
[
"matplotlib.pyplot.gca",
"numpy.maximum.accumulate",
"pandas.Series",
"numpy.random.seed",
"numpy.linspace",
"pandas.isnull",
"numpy.arange",
"matplotlib.patches.Rectangle",
"matplotlib.lines.Line2D",
"matplotlib.figure.Figure",
"matplotlib.backends.backend_agg.FigureCa... |
isayevlab/DRACON | [
"b4dc6fcd27988bb4a20a5dade9a980e82acc0014"
] | [
"server/pages/infer_script.py"
] | [
"import torch\nimport pickle\nimport yaml\nimport pandas as pd\n\nfrom torch import nn\nfrom rdkit import Chem\nfrom lib.node_classification_model.models import RGCNNTrClassifier\nfrom lib.dataset.build_dgl_graph import get_bonds, get_nodes\nfrom lib.dataset.torch_dataset import Dataset\nfrom lib.general_utils impo... | [
[
"torch.nn.Sigmoid",
"torch.no_grad",
"pandas.DataFrame",
"torch.load"
]
] |
bskp/PlannedHoliday | [
"79df5bd392b2b0899893af9f5b095cd1739686a2"
] | [
"eq.py"
] | [
"import math\n\nimport numpy as np\nimport sounddevice as sd\nfrom lib import *\n\nscreen = SevenBySeven()\nsamplerate = sd.query_devices(None, 'input')['default_samplerate']\n\nlow, high = (100, 4000)\nbins = 7 \nblock_duration = 20 #ms\n\ndelta_f = (high - low) / (bins - 1)\nfftsize = math.ceil(samplerate / delta... | [
[
"numpy.fft.rfft",
"numpy.linspace",
"numpy.ones"
]
] |
rnitin/python-ar_drone2 | [
"64230f0fc39d42d86924a674512fd57796439111"
] | [
"libardrone/libardrone.py"
] | [
"# Copyright (c) 2011 Bastian Venthur\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, ... | [
[
"numpy.copy",
"numpy.zeros"
]
] |
lianapanatau/Snippext_public | [
"a8829802d47678d6f513dde08391aeb0d4a8e37f"
] | [
"snippext/dataset.py"
] | [
"import random\n\nimport jsonlines\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom torch.utils import data\nfrom transformers import BertTokenizer\n\nfrom .augment import Augmenter\n\ntokenizer = None\n\n\ndef get_tokenizer():\n \"\"\"Return the tokenizer. Intiailize it if not initialized.\n\n Ar... | [
[
"torch.LongTensor",
"pandas.read_csv",
"torch.Tensor",
"pandas.read_json",
"numpy.array"
]
] |
Hrafnir/poptimizer | [
"16bc9e056a6daa452d48cdac0dea5901e4a3d4a1"
] | [
"poptimizer/portfolio/tests/test_metrics.py"
] | [
"from types import SimpleNamespace\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom poptimizer.portfolio import metrics, portfolio\nfrom poptimizer.portfolio.portfolio import CASH, PORTFOLIO\n\n\n@pytest.fixture(scope=\"module\", name=\"single\")\ndef make_metrics():\n positions = dict(BSPB=4890... | [
[
"numpy.array"
]
] |
schreon/transformers | [
"9ac581e69fd5dd07a57afbac837a504713fd917a"
] | [
"examples/research_projects/seq2seq-distillation/utils.py"
] | [
"import itertools\nimport json\nimport linecache\nimport math\nimport os\nimport pickle\nimport socket\nfrom logging import getLogger\nfrom pathlib import Path\nfrom typing import Callable, Dict, Iterable, List, Tuple, Union\n\nimport git\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nfrom rou... | [
[
"torch.Generator",
"torch.tensor",
"numpy.concatenate",
"numpy.argmax",
"numpy.random.permutation",
"torch.distributed.is_available",
"numpy.count_nonzero",
"torch.stack",
"torch.distributed.get_rank",
"torch.distributed.get_world_size",
"numpy.array"
]
] |
Harshit-Vavaiya/Edith-A | [
"e36a21ef3537108d87f5596eacacbfb827e0de7d"
] | [
"chat.py"
] | [
"import random\nimport json\nimport requests\nimport torch\nfrom bs4 import BeautifulSoup\nfrom model import NeuralNet\nfrom nltk_utils import bag_of_words, tokenize\nfrom search import search\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\n\n\ndef getResponse(q='hi'):\n with open('intent... | [
[
"torch.softmax",
"torch.max",
"torch.load",
"torch.from_numpy",
"torch.cuda.is_available"
]
] |
brunnokick/arquitetura-dados | [
"ed6e3c2ccfa0122ba996fa3f880fce96abc857aa"
] | [
"weight_lifting.py"
] | [
"import csv\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom sklearn.ensemble import IsolationForest\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import (\n classification_report,\n confusion_matrix,\n accuracy_score,\... | [
[
"sklearn.neural_network.MLPClassifier",
"sklearn.metrics.plot_confusion_matrix",
"sklearn.metrics.confusion_matrix",
"pandas.DataFrame",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.metrics.f1_score",
"sklearn.metrics.classification_report",
"pandas.read_csv",
"matplotlib.py... |
JuliusHarald/silx | [
"3f9bcda88c074438fdb30cde29fec314d26f471c"
] | [
"silx/gui/plot/items/core.py"
] | [
"# coding: utf-8\n# /*##########################################################################\n#\n# Copyright (c) 2017-2020 European Synchrotron Radiation Facility\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Soft... | [
[
"numpy.nanmax",
"numpy.logical_not",
"numpy.imag",
"numpy.absolute",
"numpy.isfinite",
"numpy.isnan",
"numpy.nanmin",
"numpy.logical_or",
"numpy.atleast_2d",
"numpy.real",
"numpy.any",
"numpy.errstate",
"numpy.ravel",
"numpy.angle",
"numpy.array"
]
] |
JoeshpCheung/trans_models | [
"00f3f640bc065fc4a69fe29839ff1b405f3d707c"
] | [
"cnn_tf_keras.py"
] | [
"#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n#\n# Copyright © 2021 jasoncheung <jasoncheung@iZwz95ffbqqbe9pkek5f3tZ>\n#\n# Distributed under terms of the MIT license.\n\n\"\"\"\n\n\"\"\"\nimport re\nimport json\n\nimport tensorflow as tf\nimport pandas as pd\nimport numpy as np\nimport matplo... | [
[
"matplotlib.pyplot.legend",
"tensorflow.cast",
"sklearn.metrics.confusion_matrix",
"tensorflow.keras.backend.ones_like",
"tensorflow.keras.backend.log",
"sklearn.metrics.classification_report",
"tensorflow.keras.layers.Dropout",
"pandas.read_csv",
"tensorflow.keras.Input",
... |
Sudeepdharam/WEATHER_PREDICTION | [
"2df27c5faa386710c9937daa8da386175019692b"
] | [
"train.py"
] | [
"from keras.models import Sequential\nfrom keras.layers import Dense, Activation\nfrom keras.utils import np_utils\nimport numpy as np\n\nseed = 7\nnp.random.seed(seed)\ndata = np.loadtxt(\"data.txt\")\nX_train = data[:4646,:12]\nY_train = data[:4646,12:13]\nX_test = data[4646:6936,:12]\nY_test = data[4646:6936,12:... | [
[
"numpy.loadtxt",
"numpy.random.seed"
]
] |
Mathanraj-Sharma/OpenCV_Sample_Codes | [
"a20710fa05d7817b9c4c78acc64b852b0cde7583"
] | [
"05_translation_transformation.py"
] | [
"import cv2\nimport numpy as np\nimport argparse\n\n\nap = argparse.ArgumentParser()\nap.add_argument('-i','-image', required = True, help = 'Enter the path for the image')\nargs = vars(ap.parse_args())\n\nimage = cv2.imread(args['i'])\n\n\ndef translate(image, tx, ty):\n\t\"\"\"\n\tThis function will create a tr... | [
[
"numpy.float32"
]
] |
shaochenze/RSI-NAT | [
"dcc5ae2a4fbfc5d9ba8f3bf51dc6aacd284c74e5"
] | [
"model.py"
] | [
"import numpy as np\nimport ipdb\nimport torch\nfrom torch import nn\nimport torch.nn.init as init\nfrom torch.nn import functional as F\nfrom torch.autograd import Variable, Function\nfrom torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence\nfrom collections import Counter\n\nimport math\nimport ra... | [
[
"torch.nn.Softmax",
"torch.nn.functional.softmax",
"torch.mean",
"torch.cat",
"torch.zeros",
"torch.sin",
"torch.sum",
"torch.multinomial",
"numpy.max",
"torch.FloatTensor",
"torch.topk",
"torch.autograd.Variable",
"torch.nn.Dropout",
"torch.ones",
"torc... |
denniswon/hand-gesture-recognition | [
"f07f80370602bae12f8c4ca3697c14dc13530898"
] | [
"simple.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport csv\nimport copy\nimport argparse\nimport itertools\nfrom collections import Counter\nfrom collections import deque\n\nimport cv2 as cv\nimport numpy as np\nimport mediapipe as mp\n\nfrom utils import CvFpsCalc\nfrom model import KeyPointClassifier\n\n\ndef ge... | [
[
"numpy.append",
"numpy.array",
"numpy.empty"
]
] |
brandondavid/scipy | [
"286037791681f4191f3bb741ae4a707671aa5ad0"
] | [
"scipy/spatial/distance.py"
] | [
"\"\"\"\nDistance computations (:mod:`scipy.spatial.distance`)\n=====================================================\n\n.. sectionauthor:: Damian Eads\n\nFunction reference\n------------------\n\nDistance matrix computation from a collection of raw observation vectors\nstored in a rectangular array.\n\n.. autosumm... | [
[
"numpy.deprecate",
"numpy.dot",
"numpy.sqrt",
"numpy.asarray",
"numpy.vstack",
"numpy.issubdtype",
"scipy._lib._util._asarray_validated",
"numpy.any",
"numpy.square",
"numpy.nansum",
"numpy.zeros",
"numpy.bitwise_or",
"numpy.log",
"scipy._lib.deprecation._de... |
zuyezheng/RedditSentiment | [
"c786284323828c1a3e353ee27e1be13421feb0c2"
] | [
"src/transformers/TransformerWrapper.py"
] | [
"import time\n\nimport tensorflow as tf\n\nfrom transformers.TransformerSchedule import TransformerSchedule\n\nTRAIN_STEP_SIGNATURE = [\n tf.TensorSpec(shape=(None, None), dtype=tf.int64),\n tf.TensorSpec(shape=(None, None), dtype=tf.int64),\n]\n\n\nclass TransformerWrapper:\n\n def __init__(\n self... | [
[
"tensorflow.train.CheckpointManager",
"tensorflow.shape",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.train.Checkpoint",
"tensorflow.maximum",
"tensorflow.cast",
"tensorflow.reduce_sum",
"tensorflow.ones",
"tensorflow.math.equal",
"tensorflow.functi... |
AngusNicolson/cvd-vae | [
"9e0ea781e10b0b0ffc5a94d446031c948868389f"
] | [
"run_exp.py"
] | [
"\nfrom pathlib import Path\nfrom argparse import ArgumentParser\nimport json\n\nimport numpy as np\nimport torch\n\nfrom cvd_vae.utils import load_data, create_supervised_vae, load_pretrained\nfrom cvd_vae.trainer import Trainer\n\n# For reproducibility\nnp.random.seed(42)\ntorch.manual_seed(42)\n\n\ndef main(args... | [
[
"torch.manual_seed",
"numpy.random.seed",
"torch.load"
]
] |
boangri/gym-grand-prix | [
"f2bf116482d3769bd1cc1d5464af2c4e94030994"
] | [
"gym_grand_prix/envs/cars/world.py"
] | [
"import itertools\nimport random\nfrom abc import ABCMeta, abstractmethod\nfrom cmath import rect, pi, phase\nfrom time import sleep\n\nimport numpy as np\nimport pygame\n\nfrom gym_grand_prix.envs.cars.agent import SimpleCarAgent\nfrom gym_grand_prix.envs.cars.utils import Action\nfrom gym_grand_prix.envs.cars.tra... | [
[
"numpy.array",
"numpy.mean"
]
] |
KozakaiAya/PyramidFlow | [
"81039630f3b1950fea4fc89b4dd80eb075da7eb7"
] | [
"Code/PyramidFlow/utils.py"
] | [
"import os\nimport cv2\nimport random\nimport numpy as np\n\nimport myconfig\n\ndef get_frame_tuple_list(path):\n frame_tuple_list = []\n with open(os.path.join(path, 'frame_list.txt'), 'r') as f:\n name = f.readlines()\n frame_tuple_list = [x.strip() for x in name]\n\n return frame_tuple_lis... | [
[
"numpy.concatenate",
"numpy.stack"
]
] |
zouning68/QueryCorrector | [
"afe3814c7dbd536089611510e82dacc56ef36413"
] | [
"querycorrect/test.py"
] | [
"import tornado, json, sys, logging, traceback, progressbar, Levenshtein, re, random\nfrom tornado.httpclient import HTTPClient\nfrom tqdm import tqdm\nimport numpy as np\nfrom config import config\nfrom correct import Corrector\nfrom collections import defaultdict\nfrom spider import spider\n\nurl = \"http://%s:%s... | [
[
"numpy.zeros"
]
] |
mianasbat/test | [
"22867073a5a3e87def68b4a76e70fe54d085be32"
] | [
"tests/algorithms/test_fre_from_fle.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\" Tests concerning computing TRE from FLE. \"\"\"\n\n# pylint: skip-file\n\nimport pytest\nimport numpy as np\nimport sksurgerycore.algorithms.errors as err\n\n\ndef measure_fre_1(mean_fle_squared):\n\n fiducials = np.zeros((4, 3))\n fiducials[0][0] = 1\n fiducials[0][1] =... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.isclose"
]
] |
aerorohit/compyle | [
"965e3a4dc5673b63535562363d55de4a8abde3c4"
] | [
"compyle/tests/test_translator.py"
] | [
"from textwrap import dedent\nimport pytest\nimport numpy as np\nimport sys\n\nfrom ..config import get_config\nfrom ..types import annotate, declare\nfrom ..translator import (\n CConverter, CodeGenerationError, CStructHelper, KnownType,\n OpenCLConverter, CUDAConverter, py2c\n)\n\n\n@annotate(i='int', y='fl... | [
[
"numpy.zeros",
"numpy.dtype"
]
] |
jni/microscopium | [
"b9cddd8ef5f3003a396ace602228651b3020c4a3"
] | [
"microscopium/preprocess.py"
] | [
"import os\nimport functools as fun\nimport itertools as it\nimport collections as coll\nimport re\nimport numpy as np\nfrom scipy import ndimage as ndi\nfrom scipy.stats.mstats import mquantiles as quantiles\nfrom skimage import io, util, img_as_float, img_as_ubyte\nfrom skimage import morphology, filters as imfil... | [
[
"numpy.ones_like",
"numpy.clip",
"scipy.ndimage.grey_closing",
"scipy.ndimage.grey_dilation",
"numpy.issubdtype",
"numpy.setdiff1d",
"numpy.ones",
"numpy.round",
"numpy.atleast_2d",
"scipy.ndimage.grey_opening",
"numpy.percentile",
"numpy.dstack",
"numpy.zeros_l... |
HLabProjects/RegenBoneAnalysis | [
"610496c2e8d67472ec02512bad7620b53f02580a"
] | [
"mdbands.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Jul 27 23:21:22 2020\r\n@author: KFH\r\nscript to import greyscale images from CT scans of mouse bones and calculate\r\nbone mineral density in 3d space for a given pixel/voxel/increment size\r\n\"\"\"\r\n\r\nfrom scipy.stats import norm\r\nimport cv2\r\nimport n... | [
[
"numpy.min",
"scipy.stats.norm.fit",
"numpy.save",
"numpy.max",
"numpy.average",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
kweisamx/ESPCN- | [
"1ed590ad1b57d42331be20e5a91e0fdb968a0952"
] | [
"utils.py"
] | [
"import cv2\nimport numpy as np\nimport tensorflow as tf\nimport os \nimport glob\nimport h5py\n\n\n\n# Get the Image\ndef imread(path):\n img = cv2.imread(path)\n return img\n\ndef imsave(image, path, config):\n #checkimage(image)\n # Check the check dir, if not, create one\n if not os.path.isdir(os... | [
[
"numpy.asarray"
]
] |
Lizhuoling/RSN | [
"d649d017ef4d73b5800225e56ee2f8879d0b870b"
] | [
"exps/Res18.coco/train.py"
] | [
"\"\"\"\n@author: Yuanhao Cai\n@date: 2020.03\n\"\"\"\n\nimport argparse\nimport time\n\nimport torch\nfrom tensorboardX import SummaryWriter\n\nfrom cvpack.torch_modeling.engine.engine import Engine\nfrom cvpack.utils.pyt_utils import ensure_dir\n\nfrom config import cfg\nfrom network import RSN \nfrom lib.utils.... | [
[
"torch.device",
"torch.nn.parallel.DistributedDataParallel"
]
] |
Shane-Neeley/DrugMarket | [
"e3859bbb7e906f9d4a2d355bdf6d03a4e067de6b"
] | [
"old/hyperparameter_optimization_tf.py"
] | [
"# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow\n# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow\n# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow\nfrom __future__ import print_function, division\nfrom builtins impor... | [
[
"tensorflow.matmul",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.train.RMSPropOptimizer",
"sklearn.utils.shuffle",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"numpy.mean",
"tensorflow.logging.set_verbosity",
"tensorflow.Session",
... |
neurospin-projects/2022_jchavas_cingulate_inhibitory_control | [
"30e63f0af62fa83abd3858720ce3f3a15a3fbaea"
] | [
"contrastive/utils/plots/visu_utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# This software and supporting documentation are distributed by\n# Institut Federatif de Recherche 49\n# CEA/NeuroSpin, Batiment 145,\n# 91191 Gif-sur-Yvette cedex\n# France\n#\n# This software is governed by the CeCILL license version 2 under... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.savefig"
]
] |
Devsart/MecFlu-TransCal-Comp-EM | [
"65997ad52decbd18ed9f2cba24773831a60821cd"
] | [
"Exercicios_Capitulo2/pendulo_amortecido_forcado.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 26 11:40:06 2021\n\n@author: matheus.sartor\n\"\"\"\n\nimport os\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\n\ndef pendulo_amortecido_forcado(dt,theta_i,gamma,n_iter=2000,v=0.,g=9.81):\n t = 0 \n theta_i = (2*np.pi... | [
[
"numpy.cos",
"matplotlib.pyplot.subplots",
"numpy.sin"
]
] |
Jeffresh/deployment-of-machine-learning-models | [
"bc4a5ff5713601a1a4b2c73292b1f276f22bf258"
] | [
"assignment_3/pipeline.py"
] | [
"from sklearn.linear_model import LogisticRegression\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import StandardScaler\n\nimport preprocessors as pp\nimport config\n\n\ntitanic_pipe = Pipeline(steps=[\n # complete with the list of steps from the preprocessors file\n # and the list of va... | [
[
"sklearn.preprocessing.StandardScaler",
"sklearn.linear_model.LogisticRegression"
]
] |
margiki/Improving-Interpretability-Medical-Imaging | [
"428cf5af4e154dfcac734ba6150e5adcb583460c"
] | [
"robustness/datasets.py"
] | [
"\"\"\"\nModule containing all the supported datasets, which are subclasses of the\nabstract class :class:`robustness.datasets.DataSet`. \n\nCurrently supported datasets:\n\n- ImageNet (:class:`robustness.datasets.ImageNet`)\n- RestrictedImageNet (:class:`robustness.datasets.RestrictedImageNet`)\n- CIFAR-10 (:class... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Dropout",
"torch.nn.init.constant_",
"numpy.arange",
"torch.tensor",
"numpy.ceil",
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_"
]
] |
xinrong-databricks/koalas | [
"2981b0f3d5d9d71d372556a553ee119118d236fc"
] | [
"databricks/koalas/tests/test_indexes.py"
] | [
"#\n# Copyright (C) 2019 Databricks, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable la... | [
[
"pandas.MultiIndex.from_frame",
"numpy.abs",
"pandas.Series",
"pandas.MultiIndex",
"pandas.MultiIndex.from_tuples",
"pandas.Index",
"pandas.DataFrame",
"pandas.MultiIndex.from_arrays",
"numpy.random.randn",
"pandas.MultiIndex.from_product",
"pandas.date_range",
"pan... |
Kshitij-Ambilduke/MedVQA | [
"e20f0d29638c5d05e3e0c385fe67a9bfeef0f921"
] | [
"mmbert/vqarad/train_vqarad.py"
] | [
"import argparse\nfrom utils_vqarad import seed_everything, Model, VQAMed, train_one_epoch, validate, test, load_data, LabelSmoothing\n# import wandb\nimport pandas as pd\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader, Dataset\nimport torch.optim as optim\nimport t... | [
[
"torch.nn.CrossEntropyLoss",
"pandas.concat",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"torch.cuda.amp.GradScaler",
"torch.cuda.is_available"
]
] |
atbrandao/ross_f | [
"6a1b03b0594802bc5b916095937fef4866a735fa"
] | [
"ross/tests/test_stochastic_elements.py"
] | [
"\"\"\"Tests file.\nTests for:\n st_shaft_element.py\n st_disk_element.py\n st_bearing_seal_element.py\n st_point_mass.py\n\"\"\"\nimport numpy as np\nimport plotly.graph_objects as go\nimport pytest\n\nfrom ross.stochastic.st_bearing_seal_element import ST_BearingElement\nfrom ross.stochastic.st_disk_e... | [
[
"numpy.array"
]
] |
gargrohin/Visual-Recognition | [
"2db81526532a23c4cfe5f1824d09e19e2fa25911"
] | [
"Object Detection/train.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\nimport numpy as np\nimport torchvision\nfrom torchvision import datasets, models, transforms\nimport copy\nimport time\nimport os\n\n\n# Data augmentation and normalization for training\ndata_transforms = {\n ... | [
[
"torch.optim.lr_scheduler.StepLR",
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.utils.data.DataLoader",
"torch.sum",
"torch.nn.Linear",
"torch.set_grad_enabled",
"torch.cuda.is_available",
"torch.save"
]
] |
cthoyt/ged4py | [
"ab7940dd5bcd9eadf35e670f2c5313cf23b3d4c4"
] | [
"src/ged4py/abstract_graph_edit_dist.py"
] | [
"# -*- coding: UTF-8 -*-\n\nfrom __future__ import print_function\n\nfrom abc import ABC, abstractmethod\n\nimport numpy as np\nfrom networkx import __version__ as nxv\nfrom scipy.optimize import linear_sum_assignment\n\n\ndef _get_nodes(graph):\n if float(nxv) < 2:\n return graph.nodes()\n\n return li... | [
[
"scipy.optimize.linear_sum_assignment",
"numpy.zeros"
]
] |
ai-pest/shapemask | [
"9a8b08f9a57f2bd1790761497d37ef9144463993"
] | [
"modeling/architecture/nasfpn.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n# Copyright 2022 Northern System Service Co., Ltd. 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 ... | [
[
"tensorflow.compat.v1.layers.max_pooling2d",
"tensorflow.compat.v1.reduce_max",
"tensorflow.compat.v1.variable_scope",
"tensorflow.compat.v1.sigmoid"
]
] |
aggle/webbpsf_ext | [
"b4e50d02d6fe0e89421403f214a7cd3142f3437c"
] | [
"webbpsf_ext/psfs.py"
] | [
"# Import libraries\nimport numpy as np\nimport multiprocessing as mp\n\nfrom . import conf\nfrom .utils import poppy, S\nfrom .maths import jl_poly\nfrom .image_manip import krebin, fshift\nfrom .bandpasses import nircam_grism_res, niriss_grism_res\n\nimport logging\n_log = logging.getLogger('webbpsf_ext')\n\nfrom... | [
[
"numpy.rot90",
"numpy.min",
"numpy.arange",
"scipy.interpolate.RegularGridInterpolator",
"numpy.finfo",
"numpy.concatenate",
"numpy.ceil",
"numpy.copy",
"numpy.size",
"scipy.interpolate.griddata",
"numpy.array",
"numpy.meshgrid",
"numpy.zeros",
"numpy.roll"
... |
linjieyangsc/video_seg | [
"b956142691660f02bd72fad936879fc156ee5b47"
] | [
"mobilenet_v1.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required... | [
[
"tensorflow.zeros_initializer",
"tensorflow.squeeze",
"tensorflow.truncated_normal_initializer",
"tensorflow.ones_initializer",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.variable_scope"
]
] |
steinate/a-simple-implement-of-FasterRCNN | [
"2279f40b4b1180317db35412c8dd9e8eb216f1e7"
] | [
"Faster RCNN/vis_tools.py"
] | [
"import time\r\n\r\nimport numpy as np\r\nimport matplotlib\r\nimport torch as t\r\nimport visdom\r\n\r\nmatplotlib.use('Agg')\r\nfrom matplotlib import pyplot as plot\r\n\r\nVOC_BBOX_LABEL_NAMES = (\r\n 'fly',\r\n 'bike',\r\n 'bird',\r\n 'boat',\r\n 'pin',\r\n 'bus',\r\n 'c',\r\n 'cat',\r\n... | [
[
"matplotlib.pyplot.Rectangle",
"torch.Tensor",
"matplotlib.use",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.roll",
"matplotlib.pyplot.figure"
]
] |
gtg4059/PPO | [
"599780026b12247383e5edfb889eebbe73a4f647"
] | [
"scripts/test.py"
] | [
"#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import String\nfrom geometry_msgs.msg import PoseStamped #4 Angle Data to 3\nfrom sensor_msgs.msg import LaserScan #20 LAser Data\nimport time\nfrom PPO import PPO, Memory\nfrom PIL import Image\nimport torch\n\ndef call_Dist(laser): \n print(laser)\n ... | [
[
"torch.load"
]
] |
yegmor/Final_Project | [
"70241b18f2cfe374e75d78e21be78170a0649956"
] | [
"target_models.py"
] | [
"# Modified from https://github.com/mathcbc/advGAN_pytorch/blob/master/models.py\n\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass MNIST_target_net(nn.Module):\n def __init__(self):\n super(MNIST_target_net, self).__init__()\n\n self.conv1 = nn.Conv2d(1, 32, kernel_size=3)\n ... | [
[
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d",
"torch.nn.functional.dropout"
]
] |
btashton/puppyface | [
"180ed35eebb5f532e3e2c0f642994d78fcd1db4b"
] | [
"eigensave.py"
] | [
"'''\nThis code was inspired by the code at:\nhttps://github.com/edent/Tate-Hack/blob/master/eigensave.py\n'''\n\n\nimport argparse\nimport os\nimport sys\nimport cv2\nimport numpy as np\nimport json\n\n\ndef read_images(path, sz=None):\n img_meta = {}\n X,y = [], []\n count = 0\n for dirname, dirnames,... | [
[
"numpy.asarray"
]
] |
AxelTchaikovsky/MachineLearningFinalProj | [
"ca488683a6276c09a49fe5390ae2e91b1fdd86c0"
] | [
"model/VoxNet.py"
] | [
"\nimport torch\nfrom collections import OrderedDict\n\n\nclass MVVoxNet(torch.nn.Module):\n\n def __init__(self, num_classes, input_shape=(100, 100, 100)):\n #weights_path=None,\n #load_body_weights=True,\n #load_head_weights=True):\n \"\"\"\n VoxNet... | [
[
"torch.nn.Dropout",
"torch.nn.MaxPool3d",
"torch.nn.Conv3d",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.rand",
"torch.nn.ReLU"
]
] |
jbjaveed/transformers | [
"01c1e4b8fe8a275540831acdad6747c51e9a24de"
] | [
"src/transformers/optimization_tf.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.keras.optimizers.schedules.PolynomialDecay",
"tensorflow.constant",
"tensorflow.control_dependencies",
"tensorflow.cast",
"tensorflow.zeros_like",
"tensorflow.no_op",
"tensorflow.name_scope",
"tensorflow.math.pow"
]
] |
SamerSaber/CarND-Capstone-Solution | [
"dbff0c722cd9c9b85f14ef5887fc6d594f7b5861"
] | [
"ros/src/waypoint_updater/waypoint_updater.py"
] | [
"#!/usr/bin/env python\nimport numpy as np\nimport rospy\nfrom geometry_msgs.msg import PoseStamped\nfrom scipy.spatial import KDTree\nfrom std_msgs.msg import Int32\nfrom styx_msgs.msg import Lane, Waypoint\n\nimport math\n\n'''\nThis node will publish waypoints from the car's current position to some `x` distance... | [
[
"numpy.dot",
"numpy.array",
"scipy.spatial.KDTree"
]
] |
PeaBrane/lava-dl | [
"b205b4e0466788c5232ff20497ac0fc433cbccca"
] | [
"tests/lava/lib/dl/slayer/neuron/test_rf_iz.py"
] | [
"# Copyright (C) 2021 Intel Corporation\n# SPDX-License-Identifier: BSD-3-Clause\n\nimport sys\nimport os\nimport unittest\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn.functional as F\nfrom lava.lib.dl.slayer.neuron import rf_iz\n\nverbose = True if (('-v' in sys.argv) or (... | [
[
"matplotlib.pyplot.legend",
"torch.norm",
"numpy.random.random",
"torch.floor",
"numpy.random.seed",
"torch.var",
"numpy.arange",
"matplotlib.pyplot.figure",
"torch.nn.functional.mse_loss",
"torch.cuda.is_available",
"torch.device",
"matplotlib.pyplot.xlabel",
"... |
ctrl-gaurav/Mark-IT | [
"96b3f49b35ecc0c1c746961f41e7eafb1edeebe9"
] | [
"Attendance.py"
] | [
"import cv2\nimport numpy as np\nimport face_recognition\nimport os\nimport datetime\nimport pyrebase\n\nconfig = {\n \"apiKey\": \"AIzaSyBttgLVbtWWdtRhos39BzbqvQZDIJaIe5U\",\n \"authDomain\": \"mark-it-ec28b.firebaseapp.com\",\n \"projectId\": \"mark-it-ec28b\",\n \"storageBucket\": \"mark-it-ec28b.app... | [
[
"numpy.argmin"
]
] |
logarithm27/Improved_Gans_PyTorch | [
"743d836bf1b3e072221e04cd4d7234084d4f0648"
] | [
"Generator.py"
] | [
"import torch\nfrom torch import device\nfrom torch.nn import *\nimport torch.nn.init as weight_initialization\nfrom utilities import weight_normalization\n\n# Make computations over CPU OR GPU\nGPU = 'cuda'\nCPU = 'cpu'\n\n\nclass Generator(Module):\n def __init__(self, noise_dimension, output_dimension=28 * 28... | [
[
"torch.nn.init.kaiming_uniform_",
"torch.rand"
]
] |
Arijit-hydrated/pgmpy | [
"66164e08a21267cb844c0b26fd6a657eecff57bb"
] | [
"pgmpy/tests/test_models/test_MarkovModel.py"
] | [
"import unittest\n\nimport networkx as nx\nimport numpy as np\n\nfrom pgmpy.factors.discrete import DiscreteFactor\nfrom pgmpy.factors import factor_product\nfrom pgmpy.independencies import Independencies\nfrom pgmpy.extern import six\nfrom pgmpy.extern.six.moves import range\nfrom pgmpy.models import BayesianMode... | [
[
"numpy.array",
"numpy.random.random",
"numpy.random.rand"
]
] |
DKJJ/Swin-Transformer-Semantic-Segmentation | [
"c8707951ddabdc0189451bcbd25c145f1f6cc041"
] | [
"mmseg/models/backbones/resnet.py"
] | [
"import torch.nn as nn\nimport torch.utils.checkpoint as cp\nfrom mmcv.cnn import (build_conv_layer, build_norm_layer, build_plugin_layer,\n constant_init, kaiming_init)\nfrom mmcv.runner import load_checkpoint\nfrom mmcv.utils.parrots_wrapper import _BatchNorm\n\nfrom mmseg.utils import get_ro... | [
[
"torch.nn.MaxPool2d",
"torch.nn.ReLU",
"torch.utils.checkpoint.checkpoint"
]
] |
shreyagummadi/Traffic-Sign-Detection-and-Recognition | [
"a92d1386a123d27c31324a1e02d6be83e0cf4ce7"
] | [
"trainClassifier.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu May 16 09:42:36 2019\r\n\r\n@author: Sneha\r\n\"\"\"\r\nfrom PIL import Image\r\nimport glob\r\nimport os\r\nimport cv2\r\nfrom skimage import exposure\r\nfrom skimage import feature\r\nfrom sklearn import svm\r\nimport cv2\r\n\r\n\r\n\r\ndef trainClassifier():\r... | [
[
"sklearn.svm.SVC"
]
] |
PacktPublishing/Automated-Machine-Learning-on-AWS | [
"e232aee0d89c066c8f6f95522a45f2d25495db1c"
] | [
"Chapter09/Files/airflow/dags/model/model_training.py"
] | [
"import argparse\nimport os\nimport numpy as np\nimport pandas as pd\n\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.optimizers import Adam\nfrom sklearn import preprocessing\n\ntf.get_logger()... | [
[
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.save_model",
"tensorflow.get_logger",
"sklearn.preprocessing.normalize",
"tensorflow.keras.models.Sequential"
]
] |
danbider/lightning-pose | [
"23dc5f22e4b40fa8b71193322f11fca703fd8ec9"
] | [
"lightning_pose/models/base.py"
] | [
"\"\"\"Base class for resnet backbone that acts as a feature extractor.\"\"\"\n\nfrom pytorch_lightning.core.lightning import LightningModule\nimport torch\nfrom torch import nn\nfrom torch.optim import Adam\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau, StepLR, MultiStepLR\nfrom torchtyping import Tensor... | [
[
"torch.optim.Adam",
"torch.nn.Sequential",
"torch.optim.lr_scheduler.MultiStepLR"
]
] |
fofore/new-4d2-8-16u2 | [
"4acffcc5763f77f202894ece9b39030a76a2e8ed"
] | [
"demo_with_time_cal.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\n# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick\n# --------------------------------------------... | [
[
"torch.load",
"numpy.asarray",
"numpy.round",
"numpy.max",
"numpy.concatenate",
"torch.FloatTensor",
"numpy.where",
"torch.autograd.Variable",
"torch.from_numpy",
"numpy.copy",
"numpy.argmax",
"torch.sort",
"torch.nonzero",
"numpy.zeros",
"torch.LongTens... |
EPFL-LCSB/geek | [
"62fd7bf19aaf6b5f08928825e09ae8f6e7a41bb3"
] | [
"paper/geek_qssa_example.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n.. module:: geek\n :platform: Unix, Windows\n :synopsis: GEneralised Elementary Kinetics\n\n.. moduleauthor:: geek team\n\n[---------]\n\nCopyright 2018 Laboratory of Computational Systems Biotechnology (LCSB),\nEcole Polytechnique Federale de Lausanne (EPFL), Switzerland\n\nLi... | [
[
"numpy.arange",
"numpy.array",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
JiarunLiu/Co-correcting | [
"4e3ca4951de5d73ca812bbbcfe666273082ff2fd"
] | [
"models/densenet.py"
] | [
"import re\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.checkpoint as cp\nfrom collections import OrderedDict\nfrom torchvision.models.utils import load_state_dict_from_url\nfrom torch import Tensor\nfrom torch.jit.annotations import List\n\n\n__all__ = ['DenseNet', 'den... | [
[
"torch.cat",
"torch.nn.functional.dropout",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.functional.relu",
"torch.utils.checkpoint.checkpoint",
"torch.jit.is_scripting",
"torc... |
ankur-gos/RE-Flex | [
"3c34343d12c4f251b5fee10a20dc55bddb930043"
] | [
"reflex/qa_runner.py"
] | [
"\"\"\"\nClasses for running QA inference\n\"\"\"\nimport os\nimport torch\nfrom torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,\n TensorDataset)\nfrom transformers import BertConfig, BertForQuestionAnswering, BertTokenizer\nfrom dataclasses import dataclass\nfrom... | [
[
"torch.utils.data.TensorDataset",
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.no_grad"
]
] |
hmludwig/aoc2020 | [
"c1a5860feec80a9b8c1b039ceba2cc64ec625a6b"
] | [
"src/day16.py"
] | [
"import sys\nfrom collections import defaultdict\nimport numpy as np\n\nf = open(sys.argv[1])\ndata = f.read().strip().splitlines()\ndata = [d for d in data if d.strip() != '']\nrules = dict()\nrules_section = True\nmy_ticket = None\ntickets = list()\ndeparture_rules = list()\n\nfor i, d in enumerate(data):\n if... | [
[
"numpy.array"
]
] |
liqiwa/python_work | [
"3d1198d5616b28a37fee7dfba5bbef0e1d489c2d"
] | [
"15/mpl_squares.py"
] | [
"import matplotlib.pyplot as plt \n\ninput_values = [1,2,3,4,5]\nsquares = [1,4,9,16,25]\n\nplt.plot(input_values,squares,linewidth = 5)\n\nplt.title(\"Square Numbers\",fontsize = 24)\nplt.xlabel(\"Value\",fontsize = 14)\nplt.ylabel(\"Square of Value\",fontsize = 14)\n\nplt.tick_params(axis = 'both',labelsize = 14)... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel"
]
] |
NextCenturyCorporation/mcs-scene-generator | [
"e0a6ee778359cadd2de682a5006581b7a6134431"
] | [
"tests/optimal_path_test.py"
] | [
"import numpy\nimport pytest\nfrom numpy.testing import assert_array_almost_equal_nulp\nfrom shapely.geometry import Point\n\nfrom generator import geometry, optimal_path\n\n\ndef test_dilate_and_unify_object_bounds():\n bounds = [\n {'x': -1.0, 'z': -1.0},\n {'x': -1.0, 'z': 1.0},\n {'x': 1... | [
[
"numpy.array"
]
] |
lover-520/wzm_landform_scene_model | [
"1bc8894d99b76213ca2544e540dccab2ad52be00"
] | [
"data_loader/ouy_dataloader_64.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author: WZM\n@time: 2021/1/2 17:21\n@function: 实现原文作者的数据加载dataloader 64x64的图片分辨率\n\"\"\"\n\nimport numpy as np\nimport cv2\nimport os\nimport random\nfrom torch.utils.data import DataLoader, Dataset\nimport torch\nimport time as t\nfrom net.ouy_net import Network\nfrom termcolor ... | [
[
"numpy.rot90",
"torch.Tensor",
"torch.from_numpy",
"torch.tensor",
"numpy.copy",
"numpy.zeros"
]
] |
TeamSPoon/logicmoo_nlu | [
"5c3e5013a3048da7d68a8a43476ad84d3ea4bb47"
] | [
"ext/pldata/nltk_3.0a3/nltk/metrics/scores.py"
] | [
"# Natural Language Toolkit: Evaluation\n#\n# Copyright (C) 2001-2013 NLTK Project\n# Author: Edward Loper <edloper@gmail.com>\n# Steven Bird <stevenbird1@gmail.com>\n# URL: <http://nltk.org/>\n# For license information, see LICENSE.TXT\nfrom __future__ import print_function\n\nfrom math import fabs\nimport... | [
[
"scipy.stats.stats.betai"
]
] |
riven314/Santa20-Local-Contest | [
"9bc8d1c9b20f450ead8d43081c3a542a1ff39da5"
] | [
"agent_pools/thompson_modified.py"
] | [
"\"\"\"\nmodified thompson sampling from Vic\n\"\"\"\nimport time\nimport numpy as np\n\n\nbandit = None\ntotal_reward = 0\nn_machines=100\nn_success_n_pull=[[] for _ in range(n_machines)]\nn_pull=np.array([0 for _ in range(n_machines)])\nprob_arrays = [[0.01]*100 for _ in range(n_machines)]\n\n\ndef cond_prob(thet... | [
[
"numpy.arange",
"numpy.argmax",
"numpy.linspace"
]
] |
ysndr/sam-knn-regressor | [
"4402ad28f888b47011b22b4a2171ad8d5bdce6f7"
] | [
"dataset.py"
] | [
"# To add a new cell, type '#%%'\n# To add a new markdown cell, type '#%% [markdown]'\n#%%\n# %load_ext autoreload\n# %autoreload 2\n#pylinignore\n#%matplotlib osx\n\n#%%\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nfrom sklearn.preprocessing import M... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"matplotlib.pyplot.subplots",
"sklearn.preprocessing.MinMaxScaler"
]
] |
tidepool-org/data-science-simulator | [
"fbecdadd8ea4afe88a2789871c13d8d128f637ac"
] | [
"tidepool_data_science_simulator/legacy/risk_metrics_ORIG.py"
] | [
"import numpy as np\n\n\nfrom tidepool_data_science_models.models.simple_metabolism_model import SimpleMetabolismModel\n\n\ndef get_bgri(bg_df):\n # Calculate LBGI and HBGI using equation from\n # Clarke, W., & Kovatchev, B. (2009)\n bgs = bg_df.copy()\n bgs[bgs < 1] = 1 # this is added to take care of... | [
[
"numpy.log",
"numpy.mean",
"numpy.sum"
]
] |
ardihikaru/eaglestitch | [
"b388f0c3b78b0539812985850905c78830e871aa"
] | [
"eaglestitch/image_subscriber/zenoh_pubsub/zenoh_net_publisher.py"
] | [
"from eaglestitch.image_subscriber.zenoh_pubsub.core.zenoh_net import ZenohNet\nimport sys\nimport time\nfrom datetime import datetime\nimport numpy as np\nimport cv2\nimport simplejson as json\nfrom enum import Enum\nimport logging\n\n###\n\nL = logging.getLogger(__name__)\n\n\n###\n\n\nclass ZenohNetPublisher(Zen... | [
[
"numpy.array"
]
] |
CosmoStat/OSCAR | [
"ed0a8b784ce895f07f92dc21575d4fd5f4e5b282"
] | [
"reproducible_research/deconvolution_gamma_zero.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 12 11:04:42 2020\n\n@author: fnammour\n\"\"\"\n\nfrom score import score\nimport numpy as np\nimport os\n\n#define paths\nroot_path = '/Users/username/path/to/'\ndata_path = root_path+'data_folder/'\n\n#load data\n#set SNRs\nSNRs = [40,75,... | [
[
"numpy.load",
"numpy.log10",
"numpy.array",
"numpy.ones"
]
] |
bfgoldstein/tiny_torchfi | [
"82b0f4931ff8aac6079122200fbe61782bb1f0da"
] | [
"torchFI/modules/linear.py"
] | [
"###############################################################\n# This file was created using part of Distiller project developed by:\n# NervanaSystems https://github.com/NervanaSystems/distiller\n# \n# Changes were applied to satisfy torchFI project needs\n#######################################################... | [
[
"numpy.random.binomial",
"torch.nn.functional.linear"
]
] |
StuartCHAN/KARL | [
"2a4bb39d2db7646f57e66bda7c6694ba33022f76"
] | [
"scripts/neural_layers - attn_birnn.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 7 17:23:17 2019\n\n@author: Stuart Chen\n\n#(env)> pip3 install pytorch-pretrained-bert \n\"\"\"\nfrom __future__ import unicode_literals, print_function, division\nfrom io import open\n#import unicodedata\n#import string\n#import re\nimport random\nimport time\... | [
[
"torch.mean",
"torch.sigmoid",
"torch.nn.NLLLoss",
"torch.nn.Dropout",
"torch.nn.LogSoftmax",
"torch.nn.CrossEntropyLoss",
"torch.zeros",
"torch.cat",
"torch.nn.utils.rnn.pad_sequence",
"torch.nn.GRU",
"torch.nn.Embedding",
"torch.tensor",
"torch.nn.Linear",
... |
Mewiss/OpenLabeling | [
"9f41c3c8a0a5d6cfc9b939778cd4ae2ed09caa4c"
] | [
"main/dasiamrpn.py"
] | [
"\"\"\"\nAuthor : Will Stone\nDate : 190407\nDesc : Wrapper class for the DaSiamRPN tracking method. This class has the\n methods required to interface with the tracking class implemented\n in main.py within the OpenLabeling package.\n\"\"\"\nimport torch\nimport numpy as np\nimport sys\nfrom os... | [
[
"numpy.array",
"torch.cuda.is_available",
"torch.load"
]
] |
llhthinker/slot-filling | [
"824258fb5d7f1d6ded8b20e0398c9dd415a17c3d"
] | [
"models/rnn.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass SlotFilling(nn.Module):\n def __init__(self, vocab_size, label_size, mode='elman', bidirectional=False, cuda=False, is_training=True):\n \n super(SlotFilling, self).__init__()\n sel... | [
[
"torch.Tensor",
"torch.nn.LSTM",
"torch.nn.functional.dropout",
"torch.zeros",
"torch.nn.Embedding",
"torch.nn.Linear",
"torch.stack"
]
] |
ammsa23/dials | [
"d9c6cdde2ee0abb3989596c91c80ab585e47f296"
] | [
"algorithms/indexing/ssx/analysis.py"
] | [
"from __future__ import annotations\n\nimport logging\nimport math\nfrom typing import List\n\nimport numpy as np\nfrom jinja2 import ChoiceLoader, Environment, PackageLoader\n\nfrom scitbx.array_family import flex\nfrom xfel.clustering.cluster import Cluster\nfrom xfel.clustering.cluster_groups import unit_cell_in... | [
[
"numpy.linspace",
"numpy.min",
"numpy.concatenate",
"numpy.max",
"numpy.diff",
"numpy.histogram"
]
] |
rodrigodelazcano/rlcard | [
"963cf6886dfaf5f089e9c8d0039a1dbff87aca6d"
] | [
"rlcard/agents/dqn_agent.py"
] | [
"''' DQN agent\n\nThe code is derived from https://github.com/dennybritz/reinforcement-learning/blob/master/DQN/dqn.py\n\nCopyright (c) 2019 Matthew Judell\nCopyright (c) 2019 DATA Lab at Texas A&M University\nCopyright (c) 2016 Denny Britz\n\nPermission is hereby granted, free of charge, to any person obtaining a ... | [
[
"torch.nn.Sequential",
"torch.nn.BatchNorm1d",
"numpy.expand_dims",
"numpy.linspace",
"numpy.invert",
"numpy.arange",
"torch.nn.Flatten",
"torch.from_numpy",
"numpy.ones",
"torch.nn.Tanh",
"torch.nn.Linear",
"numpy.argmax",
"torch.no_grad",
"numpy.prod",
... |
ccpcode/low-order-reactor | [
"57c33e00e8e4e5f612dd375448df3fbcb635f4a9"
] | [
"cstr.py"
] | [
"\"\"\"\nReactor model for one or more CSTR reactors in series at steady-state\nconditions. Chemistry in each reactor based on Liden 1988 kinetic scheme for\nbiomass fast pyrolysis in a bubbling fluidized bed reactor.\n\nFirst-order reactions from Liden 1998 kinetics:\nwood --k1--> tar --k2--> gas\nwood --k3--> (ga... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tick_params",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.close",
"matplotlib.pyplot.grid",
"numpy.exp",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ion... |
haberdashPI/nu_wright_lab_util | [
"6ed933cb94a4ed11e8dcbcf253fbc8ce8bb651ef"
] | [
"src/regress.py"
] | [
"import os\nimport patsy\nimport pandas as pd\nimport numpy as np\nimport scipy\nimport pystan\n\nimport blmm\nfrom sample_stats import *\n\nlinear_model = blmm.load_model('linear',use_package_cache=True)\nrobit_model = blmm.load_model('robit',use_package_cache=True)\nrobit2_model = blmm.load_model('robit2',use_pac... | [
[
"numpy.dot",
"numpy.log",
"numpy.random.beta",
"scipy.stats.norm.pdf",
"numpy.einsum",
"numpy.reshape",
"numpy.arange",
"numpy.squeeze",
"pandas.DataFrame",
"numpy.std",
"numpy.random.normal",
"numpy.mean",
"numpy.exp",
"scipy.stats.beta.logpdf",
"numpy.... |
audunsh/braketlab | [
"262558b22467bb566a3a41f3f04bc490ec552277"
] | [
"braketlab/solid_harmonics.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\n\nimport sympy as sp\n\n \n\ndef get_Slm(l, m):\n \"\"\"\n return the sympy real solid harmonic gaussian S_{lm}(r) \n as presented in table 6.3 of Helgaker, Jørgensen and Olsen\n (page 211)\n \"\"\"\n x,y,z = sp.symbols(\"x y z\")\n r = sp.sqrt(x... | [
[
"numpy.arange",
"numpy.array",
"numpy.sqrt",
"numpy.abs"
]
] |
marrrcin/pandas-feature-union | [
"a2a6e2b35a522893473bdee347fe1089c49d0b42"
] | [
"2_transform_solution.py"
] | [
"import pandas as pd\nfrom sklearn.datasets import load_iris\nfrom sklearn.pipeline import FeatureUnion, make_pipeline\n\nfrom pandas_transform import PandasTransform\n\n\ndef main():\n raw_data = load_iris()\n data = pd.DataFrame(raw_data[\"data\"], columns=raw_data[\"feature_names\"])\n data.loc[:, \"cla... | [
[
"sklearn.datasets.load_iris",
"pandas.DataFrame"
]
] |
chenjyw/transformers | [
"aca16453f41956d0fb74af91899a53f4fe3a5717"
] | [
"transformers/tests/modeling_common_test.py"
] | [
"# coding=utf-8\n# Copyright 2019 HuggingFace Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"torch.jit.save",
"torch.jit.load",
"torch.ones",
"torch.jit.trace",
"numpy.abs",
"torch.isnan",
"numpy.isnan",
"torch.tensor",
"torch.no_grad"
]
] |
fermiPy/dmpipe | [
"e5b3f950d18d5077f7abf46f53fcf59e97bb3301"
] | [
"dmpipe/dm_plotting.py"
] | [
"#!/usr/bin/env python\n#\n\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nTop level scripts to make castro plot and limits plots in mass / sigmav space\n\"\"\"\n\n\nimport os\nfrom os.path import splitext\nimport numpy as np\n\nfrom astropy.table import Table\n\nfrom fermipy.utils import... | [
[
"numpy.squeeze"
]
] |
Aspirisha/l5kit | [
"40ed7576f803e83fc3f0714e6458635f9f6bfe60"
] | [
"l5kit/l5kit/data/map_api.py"
] | [
"from enum import IntEnum\nfrom functools import lru_cache\nfrom typing import Iterator, no_type_check, Sequence, Union\n\nimport numpy as np\nimport pymap3d as pm\n\nfrom l5kit.configs.config import load_metadata\nfrom l5kit.data import DataManager\n\nfrom ..geometry import transform_points\nfrom .proto.road_netwo... | [
[
"numpy.linspace",
"numpy.min",
"numpy.linalg.inv",
"numpy.asarray",
"numpy.arange",
"numpy.max",
"numpy.diff",
"numpy.insert",
"numpy.interp",
"numpy.array",
"numpy.empty"
]
] |
rafelafrance/nitfix | [
"4f895ce84ae8d93f2df7fa3772146dd5d9e02643"
] | [
"nitfix/ingest_nfn_data.py"
] | [
"\"\"\"Extract, transform, and load data related to Notes from Nature data.\"\"\"\n\nimport os\nimport re\nimport string\n\nimport pandas as pd\n\nimport lib.db as db\nimport lib.util as util\n\n\ndef ingest_nfn_data():\n \"\"\"Ingest data related to the taxonomy.\"\"\"\n cxn = db.connect()\n\n exps = [get... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.