repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
mfkiwl/OpenXcvr | [
"9bea6efd03cd246f16982f0fadafed684ac5ce1c"
] | [
"firmware/audio_agc.py"
] | [
"from baremetal import *\nfrom math import log, pi\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport sys\nfrom math import log, ceil\nfrom settings import Settings\nfrom measure_magnitude import measure_magnitude\nfrom calculate_gain import calculate_gain\nfrom slow_barrel_shifter import slow_barrel... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
LocalLegend517/zenml | [
"0f9639a7a1014d893885263647bbe3b9b1a36d5f"
] | [
"src/zenml/integrations/plotly/visualizers/pipeline_lineage_visualizer.py"
] | [
"# Copyright (c) ZenML GmbH 2021. 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... | [
[
"pandas.DataFrame.from_dict"
]
] |
Pakleung/Mixup-TransUnet | [
"d7d0ae264589cd46db8f5da1135e786f065c372d"
] | [
"models/encoder_layers.py"
] | [
"import tensorflow as tf\nimport tensorflow_addons as tfa\n\ntfk = tf.keras\ntfkl = tfk.layers\ntfm = tf.math\n\n\nclass AddPositionEmbs(tfkl.Layer):\n \"\"\"Adds (optionally learned) positional embeddings to the inputs.\"\"\"\n\n def __init__(self, trainable=True, **kwargs):\n super().__init__(trainab... | [
[
"tensorflow.math.sqrt",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.nn.softmax",
"tensorflow.matmul",
"tensorflow.cast",
"tensorflow.random_normal_initializer",
"tensorflow.transpose"
]
] |
rainwoodman/pandas | [
"671cf86a78e931a9c98ad72571ec65cd3c35d8a7"
] | [
"pandas/tests/strings/test_strings.py"
] | [
"from datetime import (\n datetime,\n timedelta,\n)\n\nimport numpy as np\nimport pytest\n\nfrom pandas import (\n DataFrame,\n Index,\n MultiIndex,\n Series,\n isna,\n)\nimport pandas._testing as tm\n\n\ndef assert_series_or_index_equal(left, right):\n if isinstance(left, Series):\n ... | [
[
"pandas._testing.assert_numpy_array_equal",
"pandas.Series",
"pandas._testing.assert_produces_warning",
"pandas.DataFrame",
"pandas._testing.assert_frame_equal",
"pandas._testing.assert_index_equal",
"pandas._testing.assert_series_equal",
"pandas.MultiIndex.from_tuples",
"panda... |
levinem/WarpX | [
"86f690e672578fb51e70493824026f3c372d5540"
] | [
"Python/pywarpx/PGroup.py"
] | [
"import numpy as np\nfrom . import _libwarpx\n\nclass PGroup(object):\n \"\"\"Implements a class that has the same API as a warp ParticleGroup instance.\n \"\"\"\n\n def __init__(self, igroup, ispecie, level=0):\n self.igroup = igroup\n self.ispecie = ispecie\n self.level = level\n ... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.arange",
"numpy.sqrt",
"numpy.full",
"numpy.array"
]
] |
PranavKhadpe/Detecting-usefulness-of-Yelp-Reviews | [
"7a176ee01b5b1a1494321177d08dc3be0a04f589"
] | [
"pre-processing-source/time_filter/epoch_remove.py"
] | [
"from datetime import datetime\nimport pandas as pd\nimport numpy as np\nimport json\n\ndf = pd.read_csv('/home/josh/python/SNLP/src/truncate_data/epoch_rev.json')\ndf = df[df.epoch_time < 1483142400.0]\ndf = df[df.epoch_time > 1419984000.0]\nwith open('epoch_fil.json', 'w+') as f:\n f.write(out)\n"
] | [
[
"pandas.read_csv"
]
] |
IMTtugraz/PyQMRI | [
"158ac75e0a86374f3eb907467660f96233260009"
] | [
"test/unittests/test_gradient_double.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 12 11:26:41 2019\n\n@author: omaier\n\"\"\"\n\nimport pyqmri\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\nfrom pyqmri._helper_fun import CLProgram as Program\nfrom pkg_resources import resource_filenam... | [
[
"numpy.zeros_like",
"numpy.diff",
"numpy.stack",
"numpy.random.randn",
"numpy.testing.assert_allclose",
"numpy.array"
]
] |
Challyfilio/NAIC2021 | [
"11b38a920dcc902f9b798dc43ae360062862e6e4"
] | [
"project/fastreid/modeling/backbones/mobilenet.py"
] | [
"\"\"\"\nCreates a MobileNetV2 Model as defined in:\nMark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen. (2018).\nMobileNetV2: Inverted Residuals and Linear Bottlenecks\narXiv preprint arXiv:1801.04381.\nimport from https://github.com/tonylins/pytorch-mobilenet-v2\n\"\"\"\nimport logging\... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.ReLU6",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.device"
]
] |
DANancy/Web-Scraper-Starter | [
"bfde0c67dd004bd065f084b57040ed644bfab2fd"
] | [
"bilibili/video_analysis.py"
] | [
"#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# env libs\nimport os\nfrom dotenv import load_dotenv\nfrom pathlib import Path\n\n# dash libs\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport plotly.graph_objs as pgo\n\n#... | [
[
"pandas.to_datetime"
]
] |
sadamarif/Basic-50-ML | [
"4b30228cb2a30c85864683c685205c1cc8a84461"
] | [
"1 Create1DVector/CreateVector.py"
] | [
"# Load library\nimport numpy as np\n# Create a vector as a row\nvector_row = np.array([1, 2, 3])\n# Create a vector as a column\nvector_column = np.array([[1],[2],[3]])"
] | [
[
"numpy.array"
]
] |
threewisemonkeys-as/myrl | [
"3e67072591027bd3314f4c85cf32ddcf547c7840"
] | [
"dqn/dqn_torch.py"
] | [
"# Deep Q Network in pytorch\n# Atharv Sonwane <atharvs.twm@gmail.com>\n\n# References -\n# https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf\n\nimport copy\nimport random\nimport time\nfrom collections import deque, namedtuple\nfrom itertools import count\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport... | [
[
"torch.nn.Linear",
"torch.load",
"torch.nn.MSELoss",
"torch.argmax",
"matplotlib.pyplot.savefig",
"torch.no_grad",
"torch.tensor",
"numpy.random.random",
"matplotlib.pyplot.title",
"torch.nn.ReLU",
"torch.cuda.is_available",
"matplotlib.pyplot.ylabel",
"matplotl... |
a18shasa/a18shasa | [
"a6bcabac61e53b92893112f4e5361faa16547bc1"
] | [
"classifEvaluationFunctions.py"
] | [
"from sklearn.metrics import accuracy_score, precision_score, f1_score, recall_score, confusion_matrix\nimport pandas as pd\n\ndef getClassification_scores(true_classes, predicted_classes):\n acc = accuracy_score(true_classes, predicted_classes)\n prec = precision_score(true_classes, predicted_classes,average... | [
[
"pandas.crosstab",
"sklearn.metrics.f1_score",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score"
]
] |
cnheider/botorch | [
"1d90aaff64b2f1e1f49bcac233b45ba18427f6fd"
] | [
"botorch/optim/initializers.py"
] | [
"#!/usr/bin/env python3\n\nimport typing # noqa F401\nimport warnings\n\nimport torch\nfrom torch import Tensor\n\nfrom ..exceptions.warnings import BadInitialCandidatesWarning\n\n\ndef initialize_q_batch(X: Tensor, Y: Tensor, n: int, eta: float = 1.0) -> Tensor:\n r\"\"\"Heuristic for selecting initial conditi... | [
[
"torch.multinomial",
"torch.exp",
"torch.any",
"torch.randperm",
"torch.max"
]
] |
srijan-deepsource/cupy | [
"f7c3d579b76b5f815fa8f4a0ddc79ef9ca2d3b02"
] | [
"tests/cupy_tests/math_tests/test_sumprod.py"
] | [
"import unittest\nimport math\n\nimport numpy\nimport pytest\n\nimport cupy\nimport cupy.core._accelerator as _acc\nfrom cupy.core import _cub_reduction\nfrom cupy import testing\n\n\n@testing.gpu\nclass TestSumprod(unittest.TestCase):\n\n def tearDown(self):\n # Free huge memory for slow test\n cu... | [
[
"numpy.dtype",
"numpy.lib.NumpyVersion",
"numpy.arange",
"numpy.nansum",
"numpy.prod"
]
] |
Ziggareto/cs229 | [
"10b03b68b24d252dad3e3437561976d9509ebdd0"
] | [
"ps3/src/cartpole/cartpole.py"
] | [
"\"\"\"\nCS 229 Machine Learning\nQuestion: Reinforcement Learning - The Inverted Pendulum\n\"\"\"\n\nfrom __future__ import division, print_function\nimport matplotlib\nmatplotlib.use('TkAgg')\nfrom env import CartPole, Physics\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.signal import lfilter\... | [
[
"numpy.random.uniform",
"numpy.ones",
"numpy.tile",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.random.seed",
"numpy.abs",
"scipy.signal.lfilter",
"matplotlib.pyplot.ylabel",
"numpy.random.rand",
"matplotlib.use",
"matplotlib.p... |
johnjim0816/rl-tutorials | [
"5d271a43e7b24e9b0d982636d44159e25d4ae30e"
] | [
"codes/TD3/agent.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n'''\nAuthor: JiangJi\nEmail: johnjim0816@gmail.com\nDate: 2021-12-22 10:40:05\nLastEditor: JiangJi\nLastEditTime: 2021-12-22 10:43:55\nDiscription: \n'''\nimport copy\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom TD3.memory im... | [
[
"torch.nn.functional.mse_loss",
"torch.min",
"torch.nn.Linear",
"torch.load",
"torch.randn_like",
"torch.no_grad",
"torch.cat"
]
] |
Hellowlol/bw_plex | [
"86768d6ee89ee1c08d2f6e6468976e4c51135915"
] | [
"bw_plex/audfprint/audfprint_match.py"
] | [
"# coding=utf-8\n\"\"\"\naudfprint_match.py\n\nFingerprint matching code for audfprint\n\n2014-05-26 Dan Ellis dpwe@ee.columbia.edu\n\"\"\"\nfrom __future__ import division, print_function\nimport os\nimport time\n\nimport psutil\nimport matplotlib.pyplot as plt\nimport librosa\nimport numpy as np\nimport scipy.sig... | [
[
"numpy.bincount",
"numpy.array",
"numpy.zeros",
"numpy.logical_and",
"numpy.argsort",
"numpy.greater",
"numpy.argmax",
"numpy.greater_equal",
"numpy.abs",
"numpy.amin",
"matplotlib.pyplot.show",
"numpy.max",
"numpy.log",
"numpy.amax",
"numpy.nonzero",
... |
rafcy/HarpyTM | [
"e91d0b7cce4a21eada642d12e2d0604ace0c179f"
] | [
"src/kalman.py"
] | [
"import numpy as np\nfrom numpy.linalg import inv\n\n# Kalman Filter Class\nclass KalmanFilter:\n \"\"\"\n Simple Kalman filter\n \"\"\"\n\n def __init__(self, XY, B=np.array([0]), M=np.array([0])):\n stateMatrix = np.zeros((4, 1), np.float32) # [x, y, delta_x, delta_y]\n if XY != 0:\n ... | [
[
"numpy.array",
"numpy.eye",
"numpy.linalg.inv",
"numpy.zeros"
]
] |
chrisgans/Daisy_World | [
"29d76707101f8036300977508555619be442ae34"
] | [
"daisy_world_exc_4.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nif __name__ == \"__main__\":\n print(\"In __main__\")\n import numpy as np\n import matplotlib.pyplot as plt\n\n import model_functions as mf\n\n ### 4)\n luminosities = np.arange(0.5, 1.6, 0.002) # Stelar luminosities\n alphaw_out = np.ones(l... | [
[
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tight_layout"
]
] |
TreshUp/poliastro | [
"602eb3c39d315be6dc1edaa12d72ab0e361334f6"
] | [
"src/poliastro/core/angles.py"
] | [
"import numpy as np\nfrom numba import njit as jit\n\n\n@jit\ndef _kepler_equation(E, M, ecc):\n return E_to_M(E, ecc) - M\n\n\n@jit\ndef _kepler_equation_prime(E, M, ecc):\n return 1 - ecc * np.cos(E)\n\n\n@jit\ndef _kepler_equation_hyper(F, M, ecc):\n return F_to_M(F, ecc) - M\n\n\n@jit\ndef _kepler_equa... | [
[
"numpy.cosh",
"numpy.arcsinh",
"numpy.arctan",
"numpy.cos",
"numpy.sinh",
"numpy.tan",
"numpy.sqrt",
"numpy.sin",
"numpy.tanh"
]
] |
shell-done/Spongo_IHM | [
"3492c889b1d60cf50b4b2625b496fd6958309a8e"
] | [
"Services/NeuralNetwork/NeuralNetwork.py"
] | [
"import cv2\r\nimport torch\r\n\r\nfrom Services.NeuralNetwork.tool.torch_utils import do_detect\r\nfrom Services.NeuralNetwork.tool.darknet2pytorch import Darknet\r\n\r\nclass NeuralNetwork:\r\n @staticmethod\r\n def isCudaAvailable() -> bool:\r\n return torch.cuda.is_available()\r\n\r\n @staticmet... | [
[
"torch.cuda.is_available",
"torch.no_grad",
"torch.cuda.device_count",
"torch.cuda.get_device_name"
]
] |
zixiliuUSC/deep_grammar_error_corrector | [
"d18ebe1fa3b0a50fb96835d1f47c6fe1e73461ad"
] | [
"fairseq/fairseq/models/simple_lstm.py"
] | [
"import torch.nn as nn\nfrom fairseq import utils\nfrom fairseq.models import FairseqEncoder\n\nclass SimpleLSTMEncoder(FairseqEncoder):\n\n def __init__(\n self, args, dictionary, embed_dim=128, hidden_dim=128, dropout=0.1,\n ):\n super().__init__(dictionary)\n self.args = args\n\n ... | [
[
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.zeros_like",
"torch.nn.LSTM",
"torch.nn.Dropout"
]
] |
t-k-/tinynn | [
"969eb96020406885d081a961084d9328e2939622"
] | [
"test/test_utils_data_iterator.py"
] | [
"\"\"\"test unit for utils/data_iterator.py\"\"\"\n\nimport runtime_path # isort:skip\n\nimport numpy as np\n\nfrom utils.data_iterator import BatchIterator\n\n\ndef test_batch_iterator():\n batch_size = 10\n n_data = 10 * batch_size # 10 batches\n iterator = BatchIterator(batch_size=batch_size)\n x_d... | [
[
"numpy.random.randint"
]
] |
AleksanderLidtke/ConjunctionDetection | [
"c21596737757d87ea5bd2353c4b128c0795632d0"
] | [
"Release/validationDataProcessing.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nParse and analyse orbital conjunctions' data.\nCreated on Wed Apr 23 15:12:47 2014\nTO be used to analyse one on all data for Envisat and compare those to STK CAT results.\n\n@author: Aleksander Lidtke\n@version 1.0.0\n@since 22/05/2014 15:42:00\n\nCHANGELOG:\n\n\"\"\"\nimport date... | [
[
"numpy.linalg.inv",
"matplotlib.pyplot.grid",
"numpy.linalg.det",
"matplotlib.pyplot.subplots",
"matplotlib.rc",
"matplotlib.pyplot.subplots_adjust",
"numpy.array",
"numpy.linalg.norm"
]
] |
Steve-Tod/DeformSyncNet | [
"c4e6628ae4fd80e6e6aa702f4cd5885368047b4f"
] | [
"code/solver/BaseSolver.py"
] | [
"import logging\nimport os\nfrom collections import OrderedDict\nimport torch\nimport torch.nn as nn\nfrom torch.nn.parallel import DistributedDataParallel\n\nlogger = logging.getLogger('base')\n\nclass BaseSolver:\n def __init__(self, opt):\n self.opt = opt\n if opt['gpu_id'] is not None and torch... | [
[
"torch.save",
"torch.cuda.is_available",
"torch.load",
"torch.device"
]
] |
mk-michal/pytorch-image-models | [
"9c77a1dfbff5ddc229d9ef6578ab19409ba7ca93"
] | [
"timm/models/efficientnet.py"
] | [
"\"\"\" PyTorch EfficientNet Family\n\nAn implementation of EfficienNet that covers variety of related models with efficient architectures:\n\n* EfficientNet (B0-B8, L2 + Tensorflow pretrained AutoAug/RandAug/AdvProp/NoisyStudent weight ports)\n - EfficientNet: Rethinking Model Scaling for CNNs - https://arxiv.org... | [
[
"torch.nn.functional.dropout",
"torch.nn.Dropout",
"torch.nn.Sequential"
]
] |
nagnath001/ga-learner-dsmp-repo | [
"7035fd2ebe967182a44011dde59cb8ae411badb6"
] | [
"Challenges-in-Machine-Learning/code.py"
] | [
"# --------------\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\n# Code starts here\ndf=pd.read_csv(path)\n#print(df.head())\n#print(df.info)\ndf['INCOME'] = df['INCOME'].str.replace('$','')\ndf['INCOME'] = df['... | [
[
"pandas.read_csv",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.precision_score",
"sklearn.preprocessing.LabelEncoder",
"sklearn.linear_model.LogisticRegression",
"sklearn.preprocessing.StandardScaler",
"sklearn.model_selection.train_test_split"
]
] |
theycallmepeter/pytorch3d_PBR | [
"bc83c23969ff7843fc05d2da001952b368926174"
] | [
"pytorch3d/io/experimental_gltf_io.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\r\n# All rights reserved.\r\n#\r\n# This source code is licensed under the BSD-style license found in the\r\n# LICENSE file in the root directory of this source tree.\r\n\r\n\r\n\"\"\"\r\nThis module implements loading meshes from glTF 2 assets stored in a\r\nGLB ... | [
[
"torch.FloatTensor",
"numpy.transpose",
"numpy.dtype",
"torch.from_numpy",
"numpy.prod",
"numpy.array",
"numpy.frombuffer"
]
] |
ArturoDeza/NeuroFovea_PyTorch | [
"cf8f3e41ccc08b9f631f5f59776c01f92d52e944"
] | [
"Metamer_Transform.py"
] | [
"import argparse\nfrom pathlib import Path\n\nimport torch\nimport torch.nn as nn\nfrom PIL import Image\nfrom torchvision import transforms\nfrom torchvision.utils import save_image\nimport numpy as np\nimport math\nimport time\n\nimport net\nfrom function import adaptive_instance_normalization, coral\n\n# Example... | [
[
"torch.sum",
"numpy.sqrt",
"torch.load",
"torch.randn",
"torch.no_grad",
"numpy.arange",
"torch.cuda.is_available",
"numpy.shape",
"torch.index_select",
"torch.zeros"
]
] |
QingshuChen/Paddle | [
"25a92be3e123ed21fd98c7be6bd7e3a6320756a3"
] | [
"python/paddle/v2/fluid/tests/test_ftrl_op.py"
] | [
"import unittest\nimport numpy as np\nfrom op_test import OpTest\n\n\nclass TestFTRLOp(OpTest):\n def setUp(self):\n self.op_type = \"ftrl\"\n w = np.random.random((102, 105)).astype(\"float32\")\n g = np.random.random((102, 105)).astype(\"float32\")\n sq_accum = np.full((102, 105), 0... | [
[
"numpy.sign",
"numpy.abs",
"numpy.random.random",
"numpy.power",
"numpy.sqrt",
"numpy.full",
"numpy.array"
]
] |
jpkulasingham/Eelbrain | [
"1061ce0b781a8e55ec187723b58491a5cde32e08"
] | [
"eelbrain/save/_besa.py"
] | [
"\"\"\"\nExport events for use in the Besa pipeline.\n\nUse :func:`meg160_triggers` to export a trigger list for MEG160, then reject\nunwanted events, and finally use :func:`besa_evt` to export a corresponding\n``.evt`` file.\n\n\"\"\"\nimport numpy as np\n\nfrom .._data_obj import Var, Dataset\nfrom .._utils impor... | [
[
"numpy.arange",
"numpy.ones"
]
] |
Aggrathon/MtGan | [
"81bc78f9dee485a0f5704109fe4a5a28650feaf3"
] | [
"models/model.py"
] | [
"\"\"\"\n Tensorflow GAN model\n\"\"\"\nimport os\nfrom pathlib import Path\nimport tensorflow as tf\n\nDIRECTORY = Path('network')\nDATA = Path('data')\nIMAGE_LIST = DATA / 'images.txt'\nART_LIST = DATA / 'art.txt'\nART_BLACK_LIST = DATA / 'art_black.txt'\nART_GREEN_LIST = DATA / 'art_green.txt'\nART_WHITE_LIST... | [
[
"tensorflow.image.random_brightness",
"tensorflow.image.random_contrast",
"tensorflow.image.random_flip_left_right",
"tensorflow.image.random_saturation",
"tensorflow.image.resize_image_with_crop_or_pad",
"tensorflow.reshape",
"tensorflow.device",
"tensorflow.summary.merge_all",
... |
Deeptituscano/Deep-Learning-with-TensorFlow | [
"7ea73195922bce6919864352b529b84194ec9d30"
] | [
"Chapter06/Python 3.5/bidirectional_RNN_1.py"
] | [
"import tensorflow as tf\r\nimport numpy as np\r\nfrom tensorflow.contrib import rnn\r\n\r\nfrom tensorflow.examples.tutorials.mnist import input_data\r\nmnist = input_data.read_data_sets(\"/tmp/data/\", one_hot=True)\r\n\r\nlearning_rate = 0.001\r\ntraining_iters = 100000\r\nbatch_size = 128\r\ndisplay_step = 10\r... | [
[
"tensorflow.placeholder",
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.random_normal",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.reshape",
"tensorflow.global_variables_initializer",
"tensorflow.contrib.rnn.static_bidirectional_rnn",
"tensorflow.train.Ada... |
JoyeBright/nlp981 | [
"94267f4c3030319ca753d32fa02df492dda1acae"
] | [
"Week2/ManualNN.py"
] | [
"import numpy as np\n\n# Mini Dataset\ninput_data = np.array([5, 7, 8, 1])\n\nweights = {'node0': np.array([1, 1]),\n 'node1': np.array([-1, 1]),\n 'output': np.array([2, -1])}\n\n\n# Activation Function\ndef ReLu(x):\n out = max(0, x)\n return out\n\n\ndef predict_with_NN(input_data_row, ... | [
[
"numpy.array"
]
] |
morkovka1337/mmdetection | [
"5187d94b6c96084b17817249622d6e4520213ae6"
] | [
"mmdet/models/backbones/imgclsmob.py"
] | [
"# Copyright (C) 2020-2021 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.distributed.barrier"
]
] |
TTitcombe/tfShell2 | [
"a95cbc6cb1f2168c1ea51096dcfb9e4a8e33d699"
] | [
"test/utils.py"
] | [
"import tensorflow as tf\n\n\nclass MockModel(tf.keras.Model):\n \"\"\"\n A Mock keras model to test basic tester functionality.\n This model only has one variable: a weight matrix of shape 2x1.\n This model accepts 2-dimensional input data and outputs 1-d data\n \"\"\"\n def __init__(self):\n ... | [
[
"tensorflow.linalg.matmul",
"tensorflow.ones"
]
] |
WhatTheFar/practical-ai-bootcamp | [
"e2fe013390c00df0a5486795a737d7b777266f35"
] | [
"day5/lab-guide-ans/lab5-problem1-1.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\n\ndataframe = pd.read_csv('data/problem1data.txt', header=None)\ndatasetClass0 = dataframe.loc[dataframe[2] == 0]\ndatasetClass1 = dataframe.loc[dataframe[2] == 1]\n\nfigure = plt.figure()\naxis = figure.add_subplot(111)\naxis.scatter(datasetClass0[0], datasetC... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
]
] |
WM-CSCI-435-F19/data-science-4-software-engineering | [
"3692163df710550d4ee5b399a2a184968a0f18c6"
] | [
"ds4se/mgmnt/prep/files_mgmnt.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/0.2_mgmnt.prep.files_mgmnt.ipynb (unless otherwise specified).\n\n__all__ = ['logger', 'get_file_name', 'get_files_list', 'jsonl_list_to_dataframe', 'jsonl_to_dataframe',\n 'csv_to_dataframe', 'load_np_vectors', 'get_vector_paths_4_sample_set']\n\n# Cell\n\... | [
[
"pandas.read_csv",
"pandas.read_json"
]
] |
zmlabe/InternalSignal | [
"2ac31bc7a0c445ed9fa609f3c7f9800bec7b4aed"
] | [
"DarkScripts/plot_SNRComposites_XLENS_Method4.py"
] | [
"\"\"\"\nPlot signal-to-noise ratios for XLENS simulations\n\nMethod 4 = mean temperature change / mean std of temperature in 1920-1959\n\nReference : Deser et al. [2020, JCLI] & Barnes et al. [2020, JAMES]\nAuthor : Zachary M. Labe\nDate : 28 October 2020\n\"\"\"\n\n### Import packages\nimport math\nimpor... | [
[
"numpy.empty",
"numpy.nanmax",
"matplotlib.pyplot.rc",
"numpy.nanmean",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"numpy.nanstd",
"numpy.repeat",
"numpy.nanmin",
"numpy.arange",
"matplotlib.pyplot.subplots_adjust",
... |
redis-developer/the-pattern | [
"faa629b8152f405f92987c1436565938fa302932"
] | [
"the-pattern-api/qasearch/tokeniser_gears_redisai.py"
] | [
"### This gears will pre-compute (encode) all sentences using BERT tokenizer for QA\n\ntokenizer = None \n\ndef loadTokeniser():\n global tokenizer\n from transformers import BertTokenizerFast\n tokenizer = BertTokenizerFast.from_pretrained(\"bert-large-uncased-whole-word-masking-finetuned-squad\")\n # ... | [
[
"numpy.append"
]
] |
sozuer53/BBC | [
"31bb128cb1e1a19db955fd673d67cf0e92bac3a4"
] | [
"Server/ChatBot/venv/Lib/site-packages/tensorflow/python/ops/gen_dataset_ops.py"
] | [
"\"\"\"Python wrappers around TensorFlow ops.\n\nThis file is MACHINE GENERATED! Do not edit.\n\"\"\"\n\nimport collections as _collections\n\nfrom tensorflow.python.eager import execute as _execute\nfrom tensorflow.python.eager import context as _context\nfrom tensorflow.python.eager import core as _core\nfrom ten... | [
[
"tensorflow.python.eager.execute.args_to_matching_eager",
"tensorflow.python.eager.execute.make_type",
"tensorflow.python.eager.execute.record_gradient",
"tensorflow.python.eager.execute.make_str",
"tensorflow.python.eager.execute.make_shape",
"tensorflow.python.eager.context.context",
... |
danja/elfquake | [
"0c42a32ccc1d7008febf120eabe666fbdccff781"
] | [
"ingv/aggregate.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport glob\nimport csv\nimport numpy as np\nfrom numpy import genfromtxt\nimport gc # garbage collection\nimport hickle as hkl\n\n\nclass Aggregate():\n def __init__(self):\n self.csv_dir = \"./csv_data/raw/\"\n # 40N-47N, 7E-15E - northern Italy\n\n ... | [
[
"numpy.zeros",
"numpy.datetime64"
]
] |
estenssoros/sqlwriter | [
"881df2354929944a26418c6673a978568360bdfa"
] | [
"tests/utils.py"
] | [
"# -*- coding: utf-8 -*-\nimport datetime as dt\nimport os\nimport random\nimport string\nimport sys\nimport time\n\nimport pandas as pd\nimport yaml\nfrom past.builtins import basestring\n\nthis_dir = os.path.dirname(__file__)\n\n\ndef get_config(prog=None):\n cfg_file = os.path.join(this_dir, 'conf.yaml')\n\n ... | [
[
"pandas.DataFrame"
]
] |
zoharli/armin | [
"9bf8e4533850a66bbef26390244f0d0ad30c067b"
] | [
"pmnist_task/ntm/modules/head.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n\nclass NTMHead(nn.Module):\n\n def __init__(self, mode, controller_size, key_size):\n super().__init__()\n self.mode = mode\n self.key_size = key_size\n\n # all the fc layers to produce scalars for memory address... | [
[
"torch.sum",
"torch.nn.init.xavier_uniform_",
"torch.nn.Linear",
"torch.nn.init.normal_",
"torch.cat"
]
] |
duncanwood/EO-analysis-jobs | [
"26d22e49c0d2e32fbf2759f504048754f66ecc45"
] | [
"harnessed_jobs/prnu_raft/v0/validator_prnu_raft.py"
] | [
"#!/usr/bin/env ipython\n\"\"\"\nValidator script for raft-level PRNU analysis.\n\"\"\"\nimport astropy.io.fits as fits\nimport numpy as np\nimport lcatr.schema\nimport siteUtils\nimport eotestUtils\nimport camera_components\n\nraft_id = siteUtils.getUnitId()\nraft = camera_components.Raft.create_from_etrav(raft_id... | [
[
"numpy.round"
]
] |
2877992943/tensor2tensor | [
"84cab42173724689ebddf853351a5aae704035a5"
] | [
"tensor2tensor/models/research/autoencoders.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir... | [
[
"tensorflow.layers.conv2d",
"tensorflow.summary.scalar",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.squeeze",
"tensorflow.one_hot",
"tensorflow.concat",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"tensorflow.get_variable_scope",
"tensorflo... |
JulioDeBastiani/yolov3-tf2 | [
"c349d352bffbf12a6668ffb90c2487b5f5f3aa33"
] | [
"tools/create_tensorflow_warmup.py"
] | [
"import os\nimport tensorflow as tf\n\nfrom os import path\nfrom absl import app, flags, logging\nfrom absl.flags import FLAGS\nfrom tensorflow_serving.apis import model_pb2, predict_pb2, prediction_log_pb2\n\nfrom yolov3_tf2.dataset import preprocess_image, load_tfrecord_dataset\n\n\nflags.DEFINE_string('dataset',... | [
[
"tensorflow.expand_dims",
"tensorflow.make_tensor_proto",
"tensorflow.concat",
"tensorflow.io.TFRecordWriter"
]
] |
jelleman8/TractSeg | [
"2a42efe6016141f3a32d46c8f509758302c5875b"
] | [
"tractseg/libs/tractometry.py"
] | [
"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom collections import defaultdict\n\nimport numpy as np\nfrom scipy.ndimage.morphology import binary_dilation\nfrom scipy.ndimage.interpolation import map_coordinates\nfrom dipy.segment.clustering ... | [
[
"scipy.ndimage.morphology.binary_dilation",
"numpy.argmax",
"scipy.spatial.cKDTree",
"numpy.array",
"numpy.dot",
"numpy.linalg.norm"
]
] |
mitch-parker/rascore | [
"d6105db80359b43a7573edf7f36a756061be6965"
] | [
"src/rascore/util/scripts/annot_lig.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n Copyright 2022 Mitchell Isaac Parker\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 ... | [
[
"pandas.DataFrame"
]
] |
neerajprad/pyro | [
"3b5b2c5de208209365bf26f239f12521de68acc4"
] | [
"tests/infer/test_abstract_infer.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport torch\n\nimport pyro\nimport pyro.distributions as dist\nimport pyro.poutine as poutine\nfrom pyro.infer import EmpiricalMarginal, TracePredictive\nfrom pyro.infer.mcmc import MCMC, NUTS\nfrom tests.common import assert_equal\n\n\ndef model... | [
[
"torch.ones"
]
] |
j2k0618/PECNet_nuScenes | [
"9bed2f846ddae11c21b9a4df6487e5c80e9eb01f"
] | [
"rasterization_q10/input_representation/agents.py"
] | [
"# nuScenes dev-kit.\n# Code written by Freddy Boulton, 2020.\nimport colorsys\nfrom typing import Any, Dict, List, Tuple, Callable\n\nimport cv2\nimport numpy as np\nfrom pyquaternion import Quaternion\n\nfrom nuscenes.prediction import PredictHelper\nfrom nuscenes.prediction.helper import quaternion_yaw\nfrom nus... | [
[
"numpy.int0",
"numpy.append",
"numpy.zeros",
"numpy.arctan",
"numpy.linalg.det",
"numpy.column_stack",
"numpy.asarray",
"numpy.arange",
"numpy.all",
"numpy.dot",
"numpy.linalg.norm"
]
] |
victorgmlyra/GA_routing | [
"fe229f55620972c36822bc333953069e67e17a59"
] | [
"roteamento.py"
] | [
"from evo import Evo\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport networkx as nx\nfrom itertools import islice\n\n\ndef k_shortest_paths(G, source, target, k, weight=None):\n return list(\n islice(nx.shortest_simple_paths(G, source, target, weight=weight), k)\n )\n\ndef draw_graph_with_... | [
[
"numpy.load",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.random.rand",
"numpy.array",
"matplotlib.pyplot.plot",
"numpy.linalg.norm"
]
] |
ezw21/Geospatial_exw | [
"b128cbbdf6fff929e478d46baadc2259e0be1c25"
] | [
"Matcher/Feature_Matching.py"
] | [
"#__author__ = \"Edward Wong\"\n#__copyright__ = \"Copyright 2021, The X Project\"\n#__credits__ = [\"Edward Wong\"]\n#__license__ = \"MIT\"\n#__version__ = \"1.0.1\"\n#__maintainer__ = \"Edward Wong\"\n#__email__ = \"edwsin65@gmail.com\"\n\n\nimport numpy as np\nimport cv2 as cv\nimport matplotlib.pyplot as plt\n\... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show"
]
] |
qiumuyang/NJU-DIP2021 | [
"dda047ffc8752cfbb3a0d618c38480b772eaaa22"
] | [
"algorithm.py"
] | [
"from typing import List, Callable\nfrom functools import wraps\nimport numpy as np\nfrom numpy import ndarray\nfrom numpy.fft import fft2, fftshift, ifft2, ifftshift\n\n\ndef split_channel(func: Callable[[ndarray], ndarray]):\n \"\"\" Split channels of the input image.\n\n Assume the decorated function only ... | [
[
"numpy.ones",
"numpy.sum",
"numpy.histogram",
"numpy.dstack",
"numpy.vstack",
"numpy.abs",
"numpy.where",
"numpy.eye",
"numpy.zeros",
"numpy.fft.fft2",
"numpy.median",
"numpy.arange",
"numpy.hstack",
"numpy.power",
"numpy.max",
"numpy.min",
"nump... |
jcwon0/BlurHPE | [
"c97a57e92a8a7f171b0403aee640222a32513562"
] | [
"mmpose/core/evaluation/top_down_eval.py"
] | [
"import warnings\r\n\r\nimport cv2\r\nimport numpy as np\r\n\r\nfrom mmpose.core.post_processing import transform_preds\r\n\r\n\r\ndef _calc_distances(preds, targets, mask, normalize):\r\n \"\"\"Calculate the normalized distances between preds and target.\r\n\r\n Note:\r\n batch_size: N\r\n num_... | [
[
"numpy.ones",
"numpy.log",
"numpy.amax",
"numpy.transpose",
"numpy.tile",
"numpy.eye",
"numpy.zeros",
"numpy.argmax",
"numpy.arange",
"numpy.max",
"numpy.einsum",
"numpy.finfo",
"numpy.linalg.norm",
"numpy.sign",
"numpy.linalg.inv",
"numpy.clip",
... |
gully/jax | [
"eb086f9b22154104b216b22ed006264989bcad41"
] | [
"jax/numpy/lax_numpy.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.sum",
"numpy.version.version.split",
"numpy.diff",
"numpy.dtype",
"numpy.any",
"numpy.issubdtype",
"numpy.asarray",
"numpy.insert",
"numpy.size",
"numpy.int64",
"numpy.log",
"numpy.isscalar",
"numpy.delete",
"numpy.where",
"numpy.ceil",
"numpy... |
DHI-GRAS/rmstripes | [
"08012961959275ad7bc4731da9b4da3d90597c76"
] | [
"rmstripes/stripes.py"
] | [
"import numpy as np\nimport pywt\n\n\ndef damp_coefficient(coeff, sigma):\n \"\"\"Filter DWT coefficients by performing an FFT and applying a Gaussian\n kernel.\n \"\"\"\n fft_coeff = np.fft.fft(coeff, axis=0)\n fft_coeff = np.fft.fftshift(fft_coeff, axes=[0])\n\n ydim, _ = fft_coeff.shape\n ga... | [
[
"numpy.fft.fft",
"numpy.fft.fftshift",
"numpy.fft.ifftshift",
"numpy.fft.ifft",
"numpy.arange"
]
] |
chriscrsmith/pyslim | [
"babfedf4e9758e00ea431cc6d6ce74642796ee38"
] | [
"pyslim/methods.py"
] | [
"import msprime\nimport tskit\nimport warnings\nimport numpy as np\n\nfrom .slim_tree_sequence import *\nfrom .slim_metadata import *\nfrom .provenance import *\nfrom .util import *\n\ndef recapitate(ts,\n ancestral_Ne=None,\n **kwargs):\n '''\n Returns a \"recapitated\" tree seque... | [
[
"numpy.random.default_rng",
"numpy.any",
"numpy.repeat",
"numpy.nextafter",
"numpy.array",
"numpy.where",
"numpy.full"
]
] |
Pratiush/Raspberry-pi-Home-security | [
"56002e98de4d085a500e81f61935f791d54682d2"
] | [
"StoreData.py"
] | [
"import cv2,os\r\nimport numpy as np\r\nfrom PIL import Image\r\ncam = cv2.VideoCapture(0)\r\n\r\nrecognizer = cv2.createLBPHFaceRecognizer()\r\ndetector=cv2.CascadeClassifier('frontface.xml')\r\n\r\n\r\n'''\r\nBelow function converts data into yml\r\n'''\r\ndef getImagesAndLabels(path):\r\n imagePaths=[os.path.... | [
[
"numpy.array"
]
] |
Puneethnaik/Generative-Adversarial-Networks | [
"283abe2caaccbb99e1516b2a3f251cd8d005a386"
] | [
"utilities/mini_batch_gradient_descent.py"
] | [
"import numpy as np\n\n#This is crafted especially for normal distribution for MLE.\nclass GradientDescentOptimizer:\n def __init__(self, X, tolerance, learning_rate):\n self.learning_rate = learning_rate\n self.tolerance = tolerance\n self.X = X\n if(len(X.shape) == 1):\n ... | [
[
"numpy.sqrt",
"numpy.sum",
"numpy.random.randint",
"numpy.resize"
]
] |
mjjohns1/catboost | [
"08719381259ab93f00b8e350433f67ae9782fef6"
] | [
"contrib/python/scipy/scipy/_lib/_numpy_compat.py"
] | [
"\"\"\"Functions copypasted from newer versions of numpy.\n\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport warnings\nimport sys\n\nimport numpy as np\nfrom numpy.testing._private.nosetester import import_nose\n\nfrom scipy._lib._version import NumpyVersion\n\nif NumpyVersion(np.... | [
[
"scipy._lib._version.NumpyVersion",
"numpy.testing._private.nosetester.import_nose",
"numpy.iterable",
"numpy.nditer",
"numpy.array"
]
] |
dcat52/interop | [
"b016b2c25e468e21649bdb7475d828198b5e6958"
] | [
"server/auvsi_suas/models/access_log.py"
] | [
"\"\"\"Model for an access log.\"\"\"\n\nimport datetime\nimport numpy as np\nfrom time_period import TimePeriod\nfrom django.conf import settings\nfrom django.db import models\nfrom django.utils import timezone\n\n\nclass AccessLog(models.Model):\n \"\"\"Base class which logs access of information.\n\n Attri... | [
[
"numpy.array",
"numpy.max",
"numpy.mean"
]
] |
jet-code/multivariable-control-systems | [
"81b57d51a4dfc92964f989794f71d525af0359ff"
] | [
"cp2/cp2_method23.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\n# Alexander Hebert\n# ECE 6390\n# Computer Project #2\n# Method 2/3\n\n\n# In[2]:\n\n# Tested using Python v3.4 and IPython v2\n\n\n##### Import libraries and functions\n\n# In[3]:\n\nimport numpy as np\n\n\n# In[4]:\n\nfrom PlaneRotationFn import planeRotation1\nfrom PlaneRotation... | [
[
"numpy.sqrt",
"numpy.eye",
"numpy.zeros",
"numpy.diag",
"numpy.linalg.inv",
"numpy.set_printoptions",
"numpy.linalg.svd",
"numpy.linalg.matrix_rank",
"numpy.array",
"numpy.dot",
"numpy.linalg.eig",
"numpy.loadtxt"
]
] |
Anthchirp/dials | [
"211cf7646d6711769b86643b010cb2fe5aaf71b9"
] | [
"command_line/show.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport collections\nimport os\n\nimport iotbx.phil\nimport numpy as np\nfrom cctbx import uctbx\nfrom dials.array_family import flex\nfrom dials.util import Sorry, tabulate\nfrom dxtbx.model.experiment_list import ExperimentListFactory\nfrom scitb... | [
[
"numpy.sum"
]
] |
dme65/botorch | [
"508f215bfe987373924e39444c8fb544d5132178"
] | [
"test/acquisition/test_monte_carlo.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport warnings\nfrom unittest import mock\n\nimport torch\nfrom botorch import settings\nfrom botorch.acqui... | [
[
"torch.Size",
"torch.rand",
"torch.tensor",
"torch.equal",
"torch.zeros"
]
] |
ESMWG/noahmp-tools | [
"818b6d874f2981098dd3ad1ee239c88ee4743892"
] | [
"noahmp_ldasout2cf.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# convert NoahMP outputs to CF-compatible files\n\n\nimport sys\nimport os\nimport glob\nimport datetime\nimport argparse\nimport dateutil.parser\nimport numpy as np\nimport netCDF4 as nc\nnp.seterr(invalid='ignore')\n\n\nTDIM = 'time'\nTVAR = 'TIMES'\ntimeunits =... | [
[
"numpy.seterr",
"numpy.issubdtype",
"numpy.squeeze"
]
] |
ZhiqingXiao/probability | [
"06a2ca643792c0cf8f047fab7971ba6784dec1c4"
] | [
"tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py"
] | [
"# Copyright 2020 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"numpy.var",
"tensorflow.compat.v2.zeros",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.ones",
"numpy.mean"
]
] |
AniruddhA-Omni/Personal-projects | [
"bc5380874425ec5319452aaa1ea61f284a4c3b5e"
] | [
"pythonProject1/pr1.py"
] | [
"import pandas as pd\nimport numpy as np\nimport sklearn\nfrom sklearn import linear_model\nfrom sklearn.utils import shuffle\nimport matplotlib.pyplot as py\nimport pickle\nfrom matplotlib import style\n\ndata = pd.read_csv(\"student-mat.csv\", sep=\";\")\n#print(data.head())\ndata = data[[\"G1\", \"G2\", \"G3\", ... | [
[
"pandas.read_csv",
"matplotlib.pyplot.xlabel",
"matplotlib.style.use",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"numpy.array",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter"
]
] |
ppizarror/CC3501-2018-2 | [
"399da13589db46a0898c486469b03929845c631f"
] | [
"aux 6/heroe.py"
] | [
"import pygame\nfrom pygame.locals import *\nfrom OpenGL.GL import *\nfrom OpenGL.GLU import *\nimport numpy as np\n\nfrom curvas import *\nfrom utils import rgb\n\nclass Heroe:\n def __init__(self, p):\n self.p = np.array(p) # posicion\n self.vive = True # marca para poder eliminar ...\n se... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
wutong8023/PLM4CL | [
"4e9e98be425150ad75468b26feb8fb7f5e93c34b"
] | [
"analyze/dataset_distribution.py"
] | [
"\"\"\"\n\n\nAuthor: Tong\nTime: --2021\n\"\"\"\nfrom argparse import ArgumentParser\nfrom datasets import NAMES as DATASET_NAMES\nimport importlib\nimport os\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom utils.conf import base_path\n\n\nclass DatasetAnalysis:\n def __init__(s... | [
[
"numpy.sum",
"numpy.sort",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.yscale",
"numpy.max",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.unique"
]
] |
Japanuspus/pandas | [
"e38e987160c792f315685dc74fc1fc33d9389a71"
] | [
"pandas/tests/frame/methods/test_describe.py"
] | [
"import numpy as np\n\nimport pandas as pd\nfrom pandas import Categorical, DataFrame, Series, Timestamp, date_range\nimport pandas._testing as tm\n\n\nclass TestDataFrameDescribe:\n def test_describe_bool_in_mixed_frame(self):\n df = DataFrame(\n {\n \"string_data\": [\"a\", \"b... | [
[
"pandas._testing.assert_numpy_array_equal",
"pandas.timedelta_range",
"pandas.Series",
"pandas.DatetimeIndex",
"pandas.CategoricalIndex",
"pandas.date_range",
"pandas._testing.assert_categorical_equal",
"pandas._testing.assert_produces_warning",
"pandas.DataFrame",
"pandas.... |
Switham1/PromoterArchitecture | [
"0a9021b869ac66cdd622be18cd029950314d111e"
] | [
"src/data_sorting/choose_TFs_cv.py"
] | [
"import argparse\nimport os\n\nimport pandas as pd\n\n\ndef parse_args(args):\n parser = argparse.ArgumentParser(description=\"choose_TFs_cv\")\n parser.add_argument(\n \"file_names\",\n type=str,\n help=\"Name of folder and filenames for the promoters extracted\",\n )\n parser.add_... | [
[
"pandas.read_table",
"pandas.merge",
"pandas.concat",
"pandas.qcut"
]
] |
Reasmey/adsi_beer_app | [
"345bab07d6fe579c019a06660cffa5d13718e03c"
] | [
"src/data/sets.py"
] | [
"def subset_x_y(target, features, start_index:int, end_index:int):\n \"\"\"Keep only the rows for X and y sets from the specified indexes\n\n Parameters\n ----------\n target : pd.DataFrame\n Dataframe containing the target\n features : pd.DataFrame\n Dataframe containing all features\n... | [
[
"numpy.save",
"numpy.load",
"sklearn.model_selection.train_test_split",
"scipy.stats.mode"
]
] |
xalhs/Random-Walks | [
"106f972e2b9c204039ba4ae0e39ccdec4165e656"
] | [
"source/random_walk.py"
] | [
"import random\nimport math\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import animation\n\ntmax = 875\nt = 0\n\nx = [0]\ny = [0]\n\n\nt=0\nt_total = 0\n\ndist = 0\n\n#coord = [[x[t],y[t]]]\n\nwhile t < tmax:\n coord = random.randint(0,1)\n\n if coord == 0:\n direction = r... | [
[
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.plot"
]
] |
rcarson3/pyFEpX | [
"f95851e41025fb57893041d0395d53a5745b7e6c"
] | [
"PythonScripts/pyevtk/src/examples/lowlevel.py"
] | [
"#! /usr/bin/env python\n\n# ***********************************************************************************\n# * Copyright 2010 - 2016 Paulo A. Herrera. All rights reserved * \n# * *\n# * Redistribution and use ... | [
[
"numpy.arange",
"numpy.random.rand",
"numpy.zeros"
]
] |
avilab/sars-cov2-est | [
"94e358740eb3b0830c35b75e0f89dd12387ffe56"
] | [
"scripts/download_google_drive.py"
] | [
"import gdown\nimport tempfile\nimport pandas as pd\nfrom Bio import SeqIO\nimport io\n\n# Download GISAID cov2020 acknowledgements file from Google drive\nexcel_url = \"https://drive.google.com/uc?id=1g85nEcuiVnmO75Hh8yWAty5uW8P_RSiR\"\n\n# Download sars-cov-2 genomic sequences fasta file\nfasta_url = \"https://dr... | [
[
"pandas.read_excel",
"pandas.concat"
]
] |
Praneet9/Docify | [
"a936014750dedf4a6b5a84918bbbf66cd63109de"
] | [
"api/lib/fast_rcnn/nms_wrapper.py"
] | [
"import numpy as np\r\nfrom .config import cfg\r\npure_python_nms = False\r\ntry:\r\n from lib.utils.gpu_nms import gpu_nms\r\n from ..utils.cython_nms import nms as cython_nms\r\nexcept ImportError:\r\n pure_python_nms = True\r\n\r\n\r\ndef nms(dets, thresh):\r\n if dets.shape[0] == 0:\r\n retur... | [
[
"numpy.maximum",
"numpy.where",
"numpy.minimum"
]
] |
HPG-AI/bachbot | [
"6656e866ea67a1092a1a450117a7766c9baf88d0"
] | [
"scripts/theanet/utils.py"
] | [
"import climate\nimport pickle\nimport gzip\nimport numpy as np\nimport os\nimport pickle\nimport sys\nimport tarfile\nimport tempfile\nimport urllib\n\ntry:\n import matplotlib.pyplot as plt\nexcept ImportError:\n logging.critical('please install matplotlib to run the examples!')\n raise\n\nlogging = clim... | [
[
"numpy.eye",
"numpy.zeros",
"matplotlib.pyplot.gcf",
"numpy.asarray",
"numpy.sqrt",
"numpy.dot"
]
] |
Juan-S-Galindo/Web-Scraping-Challenge | [
"4f351cecf8f81e8ebb785656728adb7e75afae3c"
] | [
"scrape_mars.py"
] | [
"#Import Libraries\n#Web Scraping tools \nfrom bs4 import BeautifulSoup as bs\nfrom selenium import webdriver\n#from splinter import Browser\n\n#DataFrame tools\nimport pandas as pd\n\n#Misc tools for web scraping\nimport time\nimport requests\n\n#Function to initianilze browser.\ndef init_browser():\n\n #Settin... | [
[
"pandas.read_html"
]
] |
bwang514/google-research | [
"b7ae2e24a39cc72b19c1779d9f4b35befc4b8b8b"
] | [
"non_semantic_speech_benchmark/export_model/model_export_utils.py"
] | [
"# coding=utf-8\n# Copyright 2021 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.io.gfile.exists",
"tensorflow.train.load_checkpoint",
"tensorflow.saved_model.load",
"numpy.zeros",
"tensorflow.io.gfile.GFile",
"tensorflow.io.gfile.listdir",
"numpy.testing.assert_array_equal",
"tensorflow.train.latest_checkpoint",
"tensorflow.train.Checkpoint",
... |
nla-group/slearn | [
"2c90f11a7f80235dcfcc77be522b97cf3ce689c1"
] | [
"slearn/tools.py"
] | [
"# Copyright (c) 2021, nla group, manchester\n# All rights reserved. \n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n\n# 1. Redistributions of source code must retain the above copyright notice, this\n# list ... | [
[
"numpy.random.shuffle",
"pandas.DataFrame",
"numpy.geomspace",
"numpy.arange",
"numpy.round",
"numpy.linspace"
]
] |
Jasputtar/deepr | [
"e887a3b2c55e7e760ca61f8c99978a8284834ac8"
] | [
"deepr/jobs/optimize_saved_model.py"
] | [
"\"\"\"Converts SavedModel into an optimized protobuf for inference\"\"\"\n\nfrom dataclasses import dataclass, field\nimport logging\nimport re\nfrom typing import List, Dict, Iterable, Union\n\nimport tensorflow as tf\nfrom tensorflow.python.tools.freeze_graph import freeze_graph_with_def_protos\nfrom tensorflow.... | [
[
"tensorflow.io.write_graph",
"tensorflow.python.framework.graph_util.extract_sub_graph",
"tensorflow.compat.v1.NodeDef",
"tensorflow.compat.v1.AttrValue",
"tensorflow.Graph",
"tensorflow.compat.v1.GraphDef",
"tensorflow.compat.v1.saved_model.loader.load",
"tensorflow.group",
"t... |
kubkon/Phd-python | [
"5dccd6a107204a3b196e42205e691025539311aa"
] | [
"Auctions/Digital Marketplace/expected_prices/expected_prices.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\nexpected_prices.py\n\nCreated by Jakub Konka on 2012-10-13.\nCopyright (c) 2012 University of Strathclyde. All rights reserved.\n\"\"\"\nimport argparse\nimport csv\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib import rc\nimport numpy as np\n... | [
[
"scipy.stats.t.ppf",
"numpy.abs",
"numpy.exp",
"numpy.random.RandomState",
"numpy.sqrt",
"numpy.linspace"
]
] |
niwtr/VQA-GAN | [
"61275bf7e5b3f37fd8fbc0ec9ce4e0045343e299"
] | [
"code/model_noattn.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.parallel\nfrom torch.autograd import Variable\nfrom torchvision import models\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.functional as F\n\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nfrom miscc.config import cfg\... | [
[
"torch.nn.functional.avg_pool2d",
"torch.nn.GRU",
"torch.nn.Upsample",
"torch.nn.Conv2d",
"torch.nn.functional.grid_sample",
"torch.nn.Sigmoid",
"torch.cat",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.Dropout",
"torch.nn.BatchNorm2d",
"torch.nn.BatchNorm1d",
... |
jorgstei/Datateknologi | [
"6fea7bf2c557cd93981c6996c7f4cca02f343d9e"
] | [
"TDT4195/image_processing/A1/assignment1/dataloaders.py"
] | [
"import torchvision\nimport torch\n\n\ndef load_dataset(batch_size,\n image_transform,\n root_dir=\"data/\"):\n\n dataset_train = torchvision.datasets.MNIST(\n root=root_dir,\n download=True,\n transform=image_transform\n )\n dataset_test = torchvision.d... | [
[
"torch.utils.data.DataLoader"
]
] |
sirmarcel/cmlk | [
"e099bf3e255b60675e8e1b3ad29db750dbd6faf3"
] | [
"cmlkit/tune/search/hyperopt.py"
] | [
"\"\"\"Hyperopt search algorithm.\"\"\"\n\nimport numpy as np\nfrom copy import deepcopy\nimport hyperopt as hpo\nimport logging\nfrom itertools import count\n\nfrom cmlkit.engine import Component\nfrom cmlkit.utility.config_helpers import (\n find_pattern_apply_f,\n find_pattern,\n tuples_to_lists,\n)\n\n... | [
[
"numpy.random.RandomState",
"numpy.logspace"
]
] |
williamdjones/cv_assignment_5 | [
"d1fc46b26e44ab0fd14b62ea4f8f12b7c8d43678"
] | [
"losses.py"
] | [
"import numpy as np\nfrom keras import backend as K\n\n\n#\n# Tuning these will adjust the output of your network\n# class_weights[0] = penalty for misclassifying background\n# class_weights[1] = penalty for misclassifying unknown \n# class_weights[2] = penalty for misclassifying foreground \n# Setting class_weight... | [
[
"numpy.array"
]
] |
Teaksters/MonoScene | [
"0a5803052b54e57eb98556e53d3bf45be890b269"
] | [
"monoscene/loss/sscMetrics.py"
] | [
"\"\"\"\nPart of the code is taken from https://github.com/waterljwant/SSC/blob/master/sscMetrics.py\n\"\"\"\nimport numpy as np\nfrom sklearn.metrics import accuracy_score, precision_recall_fscore_support\n\n\ndef get_iou(iou_sum, cnt_class):\n _C = iou_sum.shape[0] # 12\n iou = np.zeros(_C, dtype=np.float3... | [
[
"numpy.sum",
"numpy.ones",
"numpy.zeros",
"numpy.diag",
"numpy.nanmean",
"numpy.logical_and",
"numpy.argmax",
"numpy.count_nonzero",
"numpy.int32",
"numpy.copy",
"numpy.mean"
]
] |
UTS-AnimalLogicAcademy/nuke-ML-server | [
"3bec5e9efc1f3101e7506401eb57e7b8c955f84c"
] | [
"Models/common/model_builder.py"
] | [
"# Copyright (c) 2019 Foundry.\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 agreed... | [
[
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.image.resize",
"tensorflow.keras.Sequential",
"tensorflow.keras.applications.MobileNet",
"tensorflow.keras.models.Model",
"tensorflow.compat.v1.variable_scope",
"tensorflow.compat.v1.get_varia... |
brainvisa/aims-free | [
"5852c1164292cadefc97cecace022d14ab362dc4"
] | [
"pyaimsalgo/python/soma/aimsalgo/tests/test_geometric.py"
] | [
"# -*- coding: utf-8 -*-\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-B license under\n# French law and abiding by the ... | [
[
"numpy.zeros"
]
] |
zhigangjiang/LGT-Net | [
"d9a619158b2dc66a50c100e7fa7e491f1df16fd7"
] | [
"loss/grad_loss.py"
] | [
"\"\"\" \n@Date: 2021/08/12\n@description:\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport numpy as np\n\nfrom visualization.grad import get_all\n\n\nclass GradLoss(nn.Module):\n def __init__(self):\n super().__init__()\n self.loss = nn.L1Loss()\n self.cos = nn.CosineSimilarity(dim=-1... | [
[
"torch.nn.L1Loss",
"torch.tensor",
"torch.nn.Conv1d",
"torch.from_numpy",
"torch.nn.CosineSimilarity"
]
] |
NehzUx/AutoGraph-KDDCup2020 | [
"d2fc228f4ccc5785db3129cca0445a80b6fef11d"
] | [
"src/code_submission/2_pasanju/preprocessing/prepredict.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time: 2020/5/14 20:41\n# @Author: Mecthew\nimport time\n\nimport numpy as np\nimport pandas as pd\nimport scipy\nfrom sklearn.svm import LinearSVC\nfrom sklearn.linear_model import logistic\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom sklearn.... | [
[
"numpy.eye",
"sklearn.linear_model.logistic.LogisticRegression",
"sklearn.svm.LinearSVC",
"pandas.DataFrame",
"numpy.isinf",
"numpy.abs",
"numpy.argmax",
"scipy.sparse.diags",
"sklearn.metrics.accuracy_score",
"scipy.sparse.coo_matrix",
"numpy.power",
"numpy.array",... |
Mitchwatts93/thunderfit | [
"a722d9160281cd0058c653181ab662b6988c714d"
] | [
"thunderfit/thunderfit/utilities.py"
] | [
"import logging\r\nfrom json import dump as j_dumps\r\nfrom json import load as j_load\r\nfrom os import mkdir\r\nfrom os.path import join, abspath\r\nfrom time import strftime\r\n\r\nimport pandas as pd\r\nfrom dill import dump as d_dump\r\nfrom dill import load as d_load\r\nfrom numpy import vstack, pad, diff, fr... | [
[
"numpy.vstack",
"numpy.diff",
"numpy.histogram",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"numpy.std",
"matplotlib.pyplot.subplots",
"pandas.HDFStore",
"matplotlib.pyplot.show",
"matplotlib.pyplot.text",
"matplotlib.pyplot.close",
"matp... |
Amit-H/Rosalind-Problems | [
"b0256b66fd1e3e6669899eb24ce5a7ed055e92f1"
] | [
"Bioinformatics Stronghold/iprb.py"
] | [
"from scipy.special import comb\n\ndef mendelian_probability(k, m, n):\n '''\n Calculates the chance of getting dominant alleles in a population\n\n Input params:\n k = homozygous dominant\n m = heterozygous\n n = homozygous recessive\n '''\n total_population = k + m + n \n total_combinat... | [
[
"scipy.special.comb"
]
] |
Bastianleaf/TravellingSalesman | [
"fafd7bb2e2ac79abc23bc261899e7d89cd0d8e9e"
] | [
"Main/perfomance_graph.py"
] | [
"from Main.Tools import *\nfrom time import time\nimport matplotlib.pyplot as plt\nimport numpy\n\n\n#Parametros Globales\ndataset_path = \"../Data/ciudades_europa\" # 1- \"../Data/ciudades_europa 2- \"../Data/region_metropolitana 3- \"../Data/cities\norigin_name = \"Madrid\" #Nombre de la ciudad, depende del da... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
QinglinDong/nilearn-extenstion | [
"8eba7f29f1d5a788758514a639ed1c639041fe7d"
] | [
"nilearn/decomposition/canica.py"
] | [
"\"\"\"\nCanICA\n\"\"\"\n\n# Author: Alexandre Abraham, Gael Varoquaux,\n# License: BSD 3 clause\n\nfrom operator import itemgetter\n\nimport numpy as np\nfrom scipy.stats import scoreatpercentile\nfrom sklearn.decomposition import fastica\nfrom sklearn.externals.joblib import Memory, delayed, Parallel\nfrom sklear... | [
[
"numpy.sum",
"sklearn.utils.check_random_state",
"numpy.abs",
"numpy.iinfo",
"sklearn.externals.joblib.Memory",
"sklearn.externals.joblib.Parallel"
]
] |
yazdotai/tensorlayer | [
"dea9d4023b578b4452c3861618e46466d4553658"
] | [
"tensorlayer/files/utils.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\n\nimport gzip\nimport math\nimport pickle\nimport progressbar\nimport re\nimport requests\nimport shutil\nimport tarfile\nimport time\nimport zipfile\n\nfrom tqdm import tqdm\n\nfrom six.moves import cPickle\n# from six.moves import zip\n\nfrom ... | [
[
"numpy.save",
"numpy.random.seed",
"numpy.asarray",
"matplotlib.pyplot.imshow",
"numpy.vstack",
"matplotlib.pyplot.pause",
"numpy.transpose",
"matplotlib.pyplot.figure",
"numpy.savez",
"tensorflow.gfile.GFile",
"matplotlib.pyplot.gca",
"scipy.io.loadmat",
"numpy... |
anon-paper-github/cvpr-641 | [
"d969e2a3ca002bee9d9320d0ee33802b2f532742"
] | [
"ZSSGAN/mapper/training/ranger.py"
] | [
"# Ranger deep learning optimizer - RAdam + Lookahead + Gradient Centralization, combined into one optimizer.\r\n\r\n# https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer\r\n# and/or\r\n# https://github.com/lessw2020/Best-Deep-Learning-Optimizers\r\n\r\n# Ranger has now been used to capture 12 records on th... | [
[
"torch.zeros_like",
"torch.empty_like"
]
] |
parekhmitchell/NCAA-ML | [
"f075448e89b993a8515d02ab52bec1fb0ac3c020"
] | [
"src/NCAAClassification.py"
] | [
"# Toolkit used for Classification\n\n# Importing Libraries\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.svm import SVC\nfrom sklearn.ensemble import RandomForestClassifier\n\n# Logistic Regression Classification\ndef logRegress(X_train, y_train, X_test, y_test):\n # Fitting Logistic Regres... | [
[
"sklearn.ensemble.RandomForestClassifier",
"sklearn.svm.SVC",
"sklearn.linear_model.LogisticRegression"
]
] |
Asurada2015/TF-_for_MI | [
"5fafdb78286b122036fa9aecf2a4be72ea4673e1"
] | [
"chapters/04_machine_learning_basics/generic.py"
] | [
"# TF code scaffolding for building simple models.\n# 为模型训练和评估定义一个通用的代码框架\nimport tensorflow as tf\n\n\n# 初始化变量和模型参数,定义训练闭环中的运算\n# initialize variables/model parameters\n# define the training loop operations\ndef inference(X):\n # compute inference model over data X and return the result\n # 计算推断模型在数据X上的输出,并将... | [
[
"tensorflow.initialize_all_variables",
"tensorflow.train.start_queue_runners",
"tensorflow.Session",
"tensorflow.train.Coordinator"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.