repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
bbpp222006/elecnose_feature
[ "5195daefbade6ffd8727bf00922f0cd2896ff38e" ]
[ "utils/pca_main.py" ]
[ "import matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\n\nfrom feature import *\nimport load_data\n\ndata_dict = load_data.read_data(\"data\")\n\n\ndef get_all_feature(test_data):\n feature_sum = Feature_sum(test_data)\n feature_sensitive = Feature_sensitive(test_data)\n feature_time = Fea...
[ [ "matplotlib.pyplot.show", "sklearn.decomposition.PCA", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.figure" ] ]
apjansing/MAT560_project
[ "e420f1462e91258ace47a43e6525d540e3ee841e" ]
[ "project/src/gmsh/demo/meshes/plottingVerticesToEigenvalues.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\npoints = []\nheaderSkipped = False\nwith open('plate/verticesToEigenvalues.csv', 'r') as F:\n\tfor line in F:\n\t\tif not headerSkipped:\n\t\t\theaderSkipped = True\n\t\telse:\n\t\t\tpoint = line.split(',')\n\t\t\tpoints += [[int(point[0]), int(point[1])]]\npo...
[ [ "numpy.array", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
rockGithub/incubator-superset
[ "cc0942ac988fc09538da14495f05411fcf2ac5e8" ]
[ "superset/dataframe.py" ]
[ "# -*- coding: utf-8 -*-\n# pylint: disable=C,R,W\n\"\"\" Superset wrapper around pandas.DataFrame.\n\nTODO(bkyryliuk): add support for the conventions like: *_dim or dim_*\n dimensions, *_ts, ts_*, ds_*, *_ds - datetime, etc.\nTODO(bkyryliuk): recognize integer encoded enums.\n\n\"\"\"\nfrom __futu...
[ [ "pandas.to_datetime", "pandas.notnull", "numpy.atleast_1d", "numpy.issubdtype", "pandas.core.common._maybe_box_datetimelike" ] ]
tasigabi97/traffic
[ "f90c6679b77a6c55717ccb9e5d53daff56fa30d2" ]
[ "mrcnn/mrcnn/model.py" ]
[ "\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict...
[ [ "tensorflow.exp", "numpy.random.choice", "tensorflow.image.non_max_suppression", "numpy.copy", "tensorflow.unique", "tensorflow.reshape", "numpy.where", "tensorflow.sqrt", "numpy.sort", "tensorflow.stack", "tensorflow.control_dependencies", "numpy.broadcast_to", ...
Quananhle/Python
[ "96b5901159ca18d5908d6dfb46a94080f8ca2ec6" ]
[ "TradingAI/Quantitative Trading/Lesson 14 - Volatility/volatility.py" ]
[ "import pandas as pd\nimport numpy as np\n\ndef get_most_volatile(prices):\n \"\"\"Return the ticker symbol for the most volatile stock.\n \n Parameters\n ----------\n prices : pandas.DataFrame\n a pandas.DataFrame object with columns: ['ticker', 'date', 'price']\n \n Returns\n ------...
[ [ "pandas.read_csv", "pandas.Series" ] ]
chaoso/Detectron2-deepfashion2
[ "50e585f65a553f52400fc22b55746e52c39ec06f" ]
[ "detectron2/engine/defaults.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\n\"\"\"\nThis file contains components with some default boilerplate logic user may need\nin training / testing. They will not work for everyone, but many users may find them useful.\n\nThe behavior of functions/class...
[ [ "torch.no_grad" ] ]
imh/jax
[ "89a6b6d1a032dea25b786922aecee74305a25e34" ]
[ "docs/autodidax.py" ]
[ "# ---\n# Copyright 2021 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 ...
[ [ "numpy.testing.assert_allclose", "numpy.negative", "numpy.multiply", "numpy.cos", "numpy.size", "numpy.broadcast_to", "numpy.zeros_like", "numpy.sin", "numpy.arange", "numpy.transpose", "numpy.ndim", "numpy.greater", "numpy.expand_dims", "numpy.array", "...
cgoliver/rnaglib
[ "f4ea7ee0223c97d0e5aca8a7b0bb4efbfd029f15" ]
[ "rnaglib/drawing/rna_draw.py" ]
[ "import os\nimport sys\n\nimport networkx as nx\nimport matplotlib\n\nmatplotlib.rcParams['text.usetex'] = True\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nscript_dir = os.path.dirname(os.path.realpath(__file__))\n\nif __name__ == \"__main__\":\n sys.path.append(os.path.join(script_dir, \"..\", \"...
[ [ "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc", "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.clf", "matplotlib.pyplot.axis" ] ]
thaihungle/EPGT
[ "0c0196d9c4137f52f4d05888ad753cb915a5c761" ]
[ "a2c_ppo_acktr/algo/ppo.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\n\r\nfrom collections import deque\r\nfrom .. import epiopt\r\n\r\nclass PPO(nn.Module):\r\n def __init__(self,\r\n actor_critic,\r\n clip_param,\r\n ppo_epoch,\r\n num_mini_bat...
[ [ "torch.min", "torch.max", "torch.clamp", "torch.exp", "torch.mean" ] ]
grechut/DASHboard
[ "5d7f819765cfeda91c13468d51af652607497746" ]
[ "gapminder/utils.py" ]
[ "import numpy as np\n\n\nclass CircleMarkerSizer:\n def __init__(self, values, max_size=50, min_size=10):\n self.min_val = self.transform(values.min())\n self.max_val = self.transform(values.max())\n\n self.max_size = max_size\n self.min_size = min_size\n\n def transform(self, x):\...
[ [ "numpy.log10" ] ]
ntdat041/Face-Filters
[ "a25adeba91dbadf71c379b9317fff211d0b2a5f4" ]
[ "pyfakewebcam/pyfakewebcam.py" ]
[ "from __future__ import absolute_import\nimport os\nimport sys\n\nimport timeit\nimport sys\nimport fcntl\nimport numpy as np\nimport pyfakewebcam.v4l2 as _v4l2\n\ncv2_imported = False\ntry:\n import cv2\n\n cv2_imported = True\nexcept:\n sys.stderr.write(\n \"Warning! opencv could not be imported; ...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.zeros", "numpy.ones", "numpy.clip" ] ]
yuezhao9210/py-Anomaly-Detection
[ "bb3a14ea4df149e3773fa34116dfc62e1c8d5c89" ]
[ "pyod/models/xgbod.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"XGBOD: Improving Supervised Outlier Detection with Unsupervised\nRepresentation Learning. A semi-supervised outlier detection framework.\n\"\"\"\n# Author: Yue Zhao <zhaoy@cmu.edu>\n# License: BSD 2 clause\nfrom __future__ import division\nfrom __future__ import print_function\n\nimp...
[ [ "numpy.concatenate", "sklearn.utils.validation.check_is_fitted", "sklearn.utils.validation.check_X_y", "numpy.zeros", "sklearn.utils.check_array", "sklearn.metrics.roc_auc_score" ] ]
victorgabr/DVH-Analytics
[ "5a8b88348dc3f497f844e22352b9749dfcc2275a" ]
[ "dvha/tools/mlc_analyzer.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# tools.mlc_analyzer.py\n\"\"\"\nTools for analyzing beam and control point information from DICOM files\nHierarchy of classes:\n Plan -> FxGroup -> Beam -> ControlPoint\n\"\"\"\n# Copyright (c) 2016-2019 Dan Cutright\n# This file is part of DVH Analytics, relea...
[ [ "numpy.divide", "numpy.array", "numpy.add", "numpy.sum", "numpy.diff" ] ]
Ursinus-IDS301-S2020/Week5Class
[ "3bf34c0f51bac1da59a44ff541f7819d45e15a41" ]
[ "ThrowBall.py" ]
[ "\"\"\"\nProgrammer: Chris Tralie\nPurpose: To simulate gravitation at the earth's surface\n with Euler steps and vpython, and to apply a simple\n elastic collision with the ground\n\"\"\"\nfrom vpython import *\nimport numpy as np\nimport time\n\n# Make a vpython square box for the floor\nfloorbox ...
[ [ "numpy.array" ] ]
travers-rhodes/disentanglement_lib
[ "73d4b995e88efdd5ffbe98a72e48a620c58f4dc7", "73d4b995e88efdd5ffbe98a72e48a620c58f4dc7" ]
[ "disentanglement_lib/visualize/visualize_model.py", "disentanglement_lib/methods/unsupervised/vae_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The DisentanglementLib 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/LICE...
[ [ "numpy.concatenate", "scipy.stats.logistic.cdf", "tensorflow.compat.v1.gfile.MakeDirs", "numpy.array", "numpy.max", "numpy.random.RandomState", "numpy.tile", "numpy.min", "numpy.mean", "numpy.exp", "numpy.tanh", "numpy.arange", "tensorflow.compat.v1.gfile.IsDire...
jaeilepp/eggie
[ "a7e812f27e33f9c43ac2e36c6b45a26a01530a06" ]
[ "mne/simulation/evoked.py" ]
[ "# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n#\n# License: BSD (3-clause)\nimport copy\n\nimport numpy as np\nfrom scipy import signal\n\nfrom ..io.pick import pick_ch...
[ [ "numpy.max", "numpy.zeros", "numpy.min", "scipy.signal.lfilter", "numpy.log10" ] ]
qizhex/Large-scale-Cloze-Test-Dataset-Created-by-Teachers
[ "8bede0ad87fe7312e72069112c77f0ba64917ac8" ]
[ "src/classifier/Optim.py" ]
[ "import math\nimport torch.optim as optim\n\nclass Optim(object):\n\n def _makeOptimizer(self):\n if self.method == 'sgd':\n self.optimizer = optim.SGD(self.params, lr=self.lr)\n elif self.method == 'adagrad':\n self.optimizer = optim.Adagrad(self.params, lr=self.lr)\n ...
[ [ "torch.optim.Adam", "torch.optim.SGD", "torch.optim.Adagrad", "torch.optim.Adadelta" ] ]
rubendfcosta/neural
[ "14def6bebe620c68f0d3970554f48d23d2de64c7" ]
[ "neural/data/cityscapesv2.py" ]
[ "from os import listdir\nfrom os.path import join\nimport cv2\nfrom numpy import array\nfrom torch.utils.data import Dataset\n\n\nclass Cityscapes(Dataset):\n CLASSES = array([\n 'unlabeled', 'ego vehicle', 'rectification border', 'out of roi',\n 'static', 'dynamic', 'ground', 'road', 'sidewalk', '...
[ [ "numpy.array" ] ]
bekhnam/Object-detection-with-YOLO
[ "e53e30ca679a4d35173a0e5e83a675c8c5aacad4" ]
[ "real_time_object_detection.py" ]
[ "from imutils.video import VideoStream\nimport argparse\nimport imutils\nimport time\nimport numpy as np\nimport cv2\nfrom tensorflow.keras.models import load_model\n\nfrom PIL import ImageFont, ImageDraw\nfrom object_detection import yolo_eval, yolo_head\nfrom utils import draw_boxes, get_colors_for_classes, read_...
[ [ "tensorflow.keras.models.load_model", "numpy.array", "numpy.expand_dims", "numpy.floor" ] ]
jucargoe/robotics_challenge
[ "056e7b25a42093751a2577e0d3200f2afcd91733" ]
[ "packages/epd4/scripts/pyorca.py" ]
[ "# Copyright (c) 2013 Mak Nazecic-Andrlon\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, mer...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.det", "numpy.sqrt" ] ]
jskhu/Waymo-Kitti-Adapter
[ "b6ac976365801431829d203b1fa57b648c428806" ]
[ "adapter.py" ]
[ "import argparse\nimport os\nfrom pathlib import Path\n\nimport math\n# import time\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nfrom parso import split_lines\nimport tensorflow as tf\nimport progressbar\n\nfrom waymo_open_dataset.utils import range_image_utils\nfrom waymo_open_dataset.utils im...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.ones_like", "tensorflow.reshape", "tensorflow.reverse", "numpy.frombuffer", "tensorflow.image.decode_jpeg", "numpy.concatenate", "tensorflow.io.decode_compressed", "matplotlib.pyplot.get_cmap", "numpy.eye", "tensorflow.cons...
stalkerbear/ModiinML
[ "f970c32ecf45caf137dbb63982917b03479ba182" ]
[ "Meeting 1/use-knn-small.py" ]
[ "# import the necessary packages\n# from __future__ import print_function\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.metrics import classification_report\nfrom sklearn import datasets\nfrom skimage import exposure\nimport numpy as np\nimport imutils\nimport cv2\nimport sklearn\n\n\n# handle o...
[ [ "numpy.array", "sklearn.datasets.load_digits", "sklearn.metrics.classification_report", "sklearn.model_selection.train_test_split", "sklearn.__version__.split" ] ]
SmilesDZgk/DU-VAE
[ "6c590922a5b634fadff814bd70d05065d584fa9f" ]
[ "text_IAF.py" ]
[ "import sys\nimport os\nimport time\nimport importlib\nimport argparse\nimport numpy as np\nimport torch\nfrom torch import nn, optim\nfrom data import MonoTextData, VocabEntry\nfrom modules import VAEIAF as VAE\nfrom modules import VariationalFlow, LSTMDecoder\nfrom logger import Logger\nfrom utils import calc_mi,...
[ [ "torch.device", "torch.cuda.manual_seed", "numpy.random.seed", "torch.no_grad", "numpy.exp", "torch.manual_seed", "torch.load", "torch.nn.init.uniform_" ] ]
shwang/imitation-extern
[ "43e23fa0386d37b532ef58baae19ec67852ae8e4" ]
[ "tests/test_rollout.py" ]
[ "\"\"\"Tests for code that generates trajectory rollouts.\"\"\"\n\nimport gym\nimport numpy as np\nfrom stable_baselines.bench import Monitor\nfrom stable_baselines.common.vec_env import DummyVecEnv\n\nfrom imitation.policies import serialize\nfrom imitation.policies.base import RandomPolicy\nfrom imitation.util im...
[ [ "numpy.all", "numpy.testing.assert_allclose", "numpy.array", "numpy.testing.assert_equal" ] ]
soroscaliban/PyBaMM
[ "40ddcf22e450b9dd9029ef845ecc5556540ce997", "40ddcf22e450b9dd9029ef845ecc5556540ce997" ]
[ "tests/unit/test_processed_variable.py", "pybamm/spatial_methods/finite_volume.py" ]
[ "#\n# Tests for the Processed Variable class\n#\nimport pybamm\nimport tests\n\nimport numpy as np\nimport unittest\n\n\nclass TestProcessedVariable(unittest.TestCase):\n def test_processed_variable_1D(self):\n # without space\n t = pybamm.t\n y = pybamm.StateVector(slice(0, 1))\n var...
[ [ "numpy.array", "numpy.ones_like", "numpy.zeros", "numpy.testing.assert_array_equal", "numpy.ones", "numpy.exp", "numpy.linspace" ], [ "numpy.concatenate", "scipy.sparse.coo_matrix", "numpy.array", "numpy.ones_like", "scipy.sparse.diags", "numpy.zeros", "...
emanuele/prni2017_comparison_of_distances
[ "420bb2da8e37dcda7f1514a305cda7a8f440fd87", "420bb2da8e37dcda7f1514a305cda7a8f440fd87" ]
[ "common_functions.py", "dissimilarity.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Common functions for computing various streamline distances, and\ndoing efficient nearest neighbors computations, by means of the\ndissimilarity representationa and k-d tree.\n\nCopyright 2017 Emanuele Olivetti, Giulia Berto e Pietro Gori\n\nMIT License.\n\"\"\"\n\nimport numpy as ...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.diff", "sklearn.neighbors.KDTree" ], [ "numpy.log" ] ]
DalavanCloud/magenta
[ "8f930263b7cfd67f27eb12cd871b4e5fa87d382e" ]
[ "magenta/models/onsets_frames_transcription/create_dataset_util_test.py" ]
[ "# Copyright 2018 The Magenta 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 applicable law o...
[ [ "tensorflow.test.main" ] ]
karimyehia92/EZyRB
[ "5a6d7b24f294184c36a9411b0d33b40db05e53b1" ]
[ "tests/test_pod.py" ]
[ "import numpy as np\n\nfrom unittest import TestCase\nfrom ezyrb import POD\n\nsnapshots = np.load('tests/test_datasets/p_snapshots.npy').T\npoddb = np.load('tests/test_datasets/p_snapshots_pod.npy')\nmodes = np.load('tests/test_datasets/p_snapshots_pod_modes.npy')\n\n\nclass TestPOD(TestCase):\n def test_constr...
[ [ "numpy.testing.assert_array_almost_equal", "numpy.testing.assert_allclose", "numpy.array", "numpy.load" ] ]
Aditya-Kapadiya/gators
[ "d7c9967e3a8e304a601b6a92ad834d03d3e36338", "d7c9967e3a8e304a601b6a92ad834d03d3e36338" ]
[ "build/lib.macosx-10.9-x86_64-3.9/gators/feature_selection/_base_feature_selection.py", "gators/sampling/supervised_sampling.py" ]
[ "# License: Apache-2.0\nfrom ..transformers.transformer import Transformer\nfrom ..util import util\nfrom typing import List, Union\nimport numpy as np\nimport pandas as pd\nimport databricks.koalas as ks\n\n\nclass _BaseFeatureSelection(Transformer):\n \"\"\"Base feature selection transformer class.\n\n Para...
[ [ "pandas.Series" ], [ "pandas.DataFrame", "pandas.Series" ] ]
MAVENSDC/pyspedas
[ "05ede2603acb514bc7803be054016142c0851685" ]
[ "pyspedas/maven/utilities.py" ]
[ "# Copyright 2017 Regents of the University of Colorado. All Rights Reserved.\n# Released under the MIT license.\n# This software was developed at the University of Colorado's Laboratory for Atmospheric and Space Physics.\n# Verify current version before use at: https://github.com/MAVENSDC/Pydivide\n\nimport re\nim...
[ [ "numpy.max", "numpy.array", "numpy.min", "numpy.nanmin", "numpy.abs", "numpy.all", "numpy.nanmax" ] ]
GuillaumeFalourd/formulas-4-tests
[ "fef565078fa2209d9e46475f627f4251cfa6dd86" ]
[ "python/area/src/formula/formula.py" ]
[ "#!/usr/bin/python3\nfrom scipy.spatial import distance as dist\nfrom imutils import perspective\nfrom imutils import contours\nimport numpy as np\nimport argparse\nimport imutils\nimport cv2\n\ndef obj_mindpoint(ptA, ptB):\n return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5)\n\ndef run(image_path, real_w...
[ [ "numpy.array", "scipy.spatial.distance.euclidean" ] ]
AbdulMAbdi/pandas
[ "a5eb94d266fc5f57acd29f585e2c944259cd0861" ]
[ "asv_bench/benchmarks/rolling.py" ]
[ "import numpy as np\n\nimport pandas as pd\n\n\nclass Methods:\n\n params = (\n [\"DataFrame\", \"Series\"],\n [10, 1000],\n [\"int\", \"float\"],\n [\"median\", \"mean\", \"max\", \"min\", \"std\", \"count\", \"skew\", \"kurt\", \"sum\"],\n )\n param_names = [\"constructor\", \...
[ [ "pandas.DataFrame", "pandas.date_range", "numpy.sum", "pandas.api.indexers.FixedForwardWindowIndexer", "pandas.Series", "numpy.random.random" ] ]
AJ1897/RL-Projects
[ "9fdd210616ad1e1beea948beba6c695972ff8e9d" ]
[ "Project5-SEVN/Normal Reward Function/SEVN_Mila_PPO/model.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom distributions import Bernoulli, Categorical, DiagGaussian\nfrom utils import init\n\n\nclass Flatten(nn.Module):\n def forward(self, x):\n return x.view(x.size(0), -1)\n\n\nclass Policy(nn.Module):\n def _...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.GRU", "torch.nn.init.constant_", "torch.nn.Tanh", "torch.nn.ReLU", "torch.nn.Conv2d", "numpy.sqrt", "torch.nn.init.calculate_gain", "torch.nn.init.orthogonal_" ] ]
mszep/deepchem
[ "e47a012d926d2a7c36843235ca3593d5f7a29595" ]
[ "deepchem/feat/molecule_featurizers/mol_graph_conv_featurizer.py" ]
[ "from typing import List, Tuple\nimport numpy as np\n\nfrom deepchem.utils.typing import RDKitAtom, RDKitBond, RDKitMol\nfrom deepchem.feat.graph_data import GraphData\nfrom deepchem.feat.base_classes import MolecularFeaturizer\nfrom deepchem.utils.molecule_feature_utils import one_hot_encode\nfrom deepchem.utils.m...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.any" ] ]
jdeschamps/napari-sklearn-decomposition
[ "5f67e5fdd3b6e2697b43efbc60848c59fe5cded5" ]
[ "src/napari_sklearn_decomposition/_tests/test_widget.py" ]
[ "from typing import Callable\n\nimport napari\nimport numpy as np\nimport pytest\n\nfrom napari_sklearn_decomposition import decomposition\nfrom napari_sklearn_decomposition._widget import NMF, PCA, FastICA\n\nRESULT_NAMES = {\"PCA\": \"PCA Eigenvectors\", \"FastICA\": \"Independent Components\", \"NMF\": \"Non-neg...
[ [ "numpy.random.random" ] ]
KittyLiou/PolygonRCNN
[ "a6059d350c12d53ba8d4bc8a05fb18b120b99ed8" ]
[ "detectron/modeling/detector.py" ]
[ "# Copyright (c) 2017-present, Facebook, 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 applicabl...
[ [ "numpy.max", "numpy.array", "numpy.zeros" ] ]
adamreidsmith/manifold-data-in-nns
[ "0610c0473fd3fcd36bc608d3d47ef774e4544e79" ]
[ "accessory files/nn_hist_include_phi.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jun 4 13:20:36 2019\n\n@author: adamreidsmith\n\"\"\"\n\n'''\nConvolutional neural network with pooling and linear layers with dropout.\nInput is a histogram (100x100 matrix) of t mod T vs x(t), where x(t) is a solution\nto the Van der Pol eq...
[ [ "torch.nn.Linear", "torch.cat", "matplotlib.pyplot.xlim", "torch.optim.lr_scheduler.ExponentialLR", "numpy.load", "numpy.mean", "torch.nn.MaxPool2d", "torch.utils.data.random_split", "torch.utils.data.DataLoader", "torch.Tensor", "numpy.array", "matplotlib.pyplot.ti...
Racana/grandtdata
[ "08995b0e6ee12d89c704f753c1ba9a2d7f929fa8" ]
[ "grandt_etl.py" ]
[ "import pandas as pd\n\ndf = pd.DataFrame()\n\nfiles = pd.read_csv('grandtlinks.csv')\ntry:\n files['status'] = files['status'].astype(str)\n header=False\nexcept KeyError:\n files['status'] = ''\n header=True\n\nfor index, row in files.iterrows():\n if row['status'] == 'parsed':\n continue\n ...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
Hugo-cheng/tutorials
[ "0e2086cc5c2673f621a0492e5b8d50ff76c81024" ]
[ "matplotlibTUT/plt14_3d.py" ]
[ "# View more python tutorials on my Youtube and Youku channel!!!\n\n# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg\n# Youku video tutorial: http://i.youku.com/pythontutorial\n\n# 14 - 3d\n\"\"\"\nPlease note, this script is for python3+.\nIf you are using python2+, please modify ...
[ [ "numpy.sin", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.figure", "numpy.arange", "numpy.sqrt", "matplotlib.pyplot.show", "numpy.meshgrid" ] ]
oja/language
[ "a0bbd3b65a6620b3f35d557e07efdb0a555c7ddc" ]
[ "language/question_answering/layers/document_reader_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.random_uniform", "tensorflow.Graph", "tensorflow.Session", "tensorflow.constant", "tensorflow.test.main", "tensorflow.global_variables_initializer" ] ]
uds5501/pandas
[ "ec356fa62241750a227c1bafb4c0c396bde1c293", "ec356fa62241750a227c1bafb4c0c396bde1c293" ]
[ "pandas/tests/indexes/multi/test_set_ops.py", "pandas/io/packers.py" ]
[ "# -*- coding: utf-8 -*-\n\n\nimport numpy as np\nimport pandas as pd\nimport pandas.util.testing as tm\nfrom pandas import (CategoricalIndex, DatetimeIndex, MultiIndex, PeriodIndex,\n Series, TimedeltaIndex)\n\n\ndef test_setops_errorcases(idx):\n # # non-iterable input\n cases = [0.5, 'xx...
[ [ "pandas.util.testing.assert_raises_regex", "pandas.MultiIndex.from_tuples", "pandas.util.testing.equalContents" ], [ "pandas.compat.u", "pandas.Timestamp", "numpy.iscomplexobj", "numpy.frombuffer", "numpy.dtype", "pandas.compat.callable", "pandas.compat.u_safe", "pa...
Gautam-J/MIME
[ "7c34f3ae6dc8f8b9e6fb89b5bfa016fbaa445018" ]
[ "model/common_layer.py" ]
[ "### MOST OF IT TAKEN FROM https://github.com/kolloldas/torchnlp\n## MINOR CHANGES\nimport matplotlib\n# matplotlib.use('Agg')\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torch.nn.init as I\nimport numpy as np\nimport math\nimport os\nfrom utils...
[ [ "torch.nn.Linear", "torch.nn.ModuleList", "torch.nn.ConstantPad1d", "numpy.mean", "torch.ones", "numpy.cos", "torch.topk", "numpy.full", "numpy.sin", "torch.nn.Conv1d", "torch.FloatTensor", "numpy.arange", "numpy.transpose", "torch.nn.KLDivLoss", "numpy....
maurosilber/pyflim
[ "127d665d8018654450e0bbb08c7baaf29c039781" ]
[ "pyflim/flimds.py" ]
[ "import numpy as np\n\nfrom .functions import (\n modulation_lifetime,\n normal_lifetime,\n phase_lifetime,\n phasor_from_lifetime,\n photon_fraction,\n photon_to_molecular_fraction,\n)\n\n\nclass UncorrectedFLIMds:\n \"\"\"Abstract FLIM dataset.\"\"\"\n\n @property\n def frequency(self):...
[ [ "numpy.divide", "numpy.sum", "numpy.zeros_like" ] ]
aboucaud/BlendingToolKit
[ "b25653113da5030c1b54fbe674b2e9a4ed69072f" ]
[ "btk/utils.py" ]
[ "\"\"\"Contains functions to perform detection, deblending and measurement\n on images.\n\"\"\"\n\nfrom functools import partial\n\nimport astropy.table\nimport numpy as np\nimport skimage.feature\n\nfrom btk import plot_utils\nfrom btk.compute_metrics import Metrics_params\nfrom btk.measure import Measurement_p...
[ [ "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.mean", "numpy.where", "numpy.std", "numpy.stack", "numpy.transpose", "numpy.hypot" ] ]
plogerais/xarray
[ "0f70a876759197388d32d6d9f0317f0fe63e0336" ]
[ "xarray/plot/facetgrid.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport functools\nimport itertools\nimport warnings\n\nimport numpy as np\nfrom ..core.formatting import format_item\nfrom ..core.pycompat import getargspec\nfrom .utils import (\n _determine_cmap_params, _infer_xy_labels, import_matplotlib_pyp...
[ [ "numpy.array", "numpy.ceil", "matplotlib.ticker.MaxNLocator" ] ]
huaxz1986/lingvo
[ "463ae610ee7e21d552662543cd5cfb23ff3c36c6" ]
[ "lingvo/jax/summary_utils.py" ]
[ "# Lint as: python3\n# Copyright 2021 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...
[ [ "tensorflow.compat.v2.summary.scalar", "tensorflow.compat.v2.summary.create_file_writer", "tensorflow.compat.v2.summary.create_noop_writer", "numpy.sum", "tensorflow.compat.v2.summary.image", "tensorflow.compat.v2.summary.text", "numpy.mean" ] ]
minghchen/CARL_code
[ "c574312969c35963fc0050a5b5dbd3e4aa590318", "c574312969c35963fc0050a5b5dbd3e4aa590318" ]
[ "models/__init__.py", "datasets/penn_action.py" ]
[ "import torch\nfrom models.resnet_c2d import BaseModel, Classifier\nfrom models.transformer import TransformerModel\nimport utils.logging as logging\n\nlogger = logging.get_logger(__name__)\n\ndef build_model(cfg):\n if cfg.MODEL.EMBEDDER_TYPE == \"transformer\":\n model = TransformerModel(cfg)\n else:...
[ [ "torch.save", "torch.load" ], [ "numpy.histogram", "torch.distributed.get_world_size", "torch.stack", "torch.arange", "torch.randperm", "torch.ones", "numpy.random.uniform", "torch.tensor", "torch.nn.functional.pad", "torch.distributed.get_rank", "torch.sort...
chunglabmit/pystripe
[ "a8fb6a65c5bfd15aa58f67477a2a93fbf8b319f9" ]
[ "pystripe/core.py" ]
[ "import argparse\nfrom argparse import RawDescriptionHelpFormatter\nfrom pathlib import Path\nimport os\nimport numpy as np\nfrom scipy import fftpack, ndimage\nfrom skimage.filters import threshold_otsu\nimport tifffile\nimport pywt\nimport multiprocessing\nimport tqdm\nfrom dcimg import DCIMGFile\nfrom pystripe i...
[ [ "numpy.rot90", "numpy.exp", "numpy.cumsum", "numpy.imag", "numpy.broadcast_to", "numpy.log", "numpy.interp", "numpy.arange", "scipy.fftpack.fft2", "numpy.array", "numpy.pad", "scipy.fftpack.irfft", "scipy.ndimage.gaussian_filter", "numpy.real", "numpy.cl...
graknlabs/research
[ "ae3ee07106739efd10f0627058210038ab5956d3" ]
[ "kglib/kgcn_tensorflow/models/core.py" ]
[ "#\n# Copyright (C) 2021 Vaticle\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache Li...
[ [ "numpy.exp" ] ]
mbarnig/vits-train
[ "cfb8a0fc91daad868fe3d062ebf85d62edbd7506" ]
[ "vits_train/attentions.py" ]
[ "import math\nimport typing\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom vits_train.commons import subsequent_mask\nfrom vits_train.modules import LayerNorm\n\n\nclass Encoder(nn.Module):\n def __init__(\n self,\n hidden_channels: int,\n filter_channels...
[ [ "torch.sigmoid", "torch.nn.Dropout", "torch.relu", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.arange", "torch.no_grad", "torch.nn.init.xavier_uniform_", "torch.unsqueeze", "torch.abs", "torch.ones_like", "torch.nn.functional.softmax", "torch.nn.functional....
heytanay/mmsegmentation
[ "7ddd2fe2ecff9c95999bd00ec05cc37eafb558f8" ]
[ "mmseg/models/losses/dice_loss.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\n\"\"\"Modified from https://github.com/LikeLy-Journey/SegmenTron/blob/master/\nsegmentron/solver/loss.py (Apache-2.0 License)\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..builder import LOSSES\nfrom .utils import get_class_we...
[ [ "torch.mul", "torch.nn.functional.softmax" ] ]
BAfsharmanesh/New_project
[ "766e43494bd55217abf9f8be22df42e2bc7e678c" ]
[ "src/regression_metrics.py" ]
[ "# the metric used in indoor-location-navigation competition\nimport numpy as np\n\ndef iln_comp_metric(xhat, yhat, fhat, x, y, f):\n intermediate = np.sqrt(np.power(xhat - x,2) + np.power(yhat-y,2)) + 15 * np.abs(fhat-f)\n return intermediate.sum()/xhat.shape[0]\n" ]
[ [ "numpy.power", "numpy.abs" ] ]
hcarlsso/filterpy
[ "05a2dd511225759fc58da4725fa23373e3cb4d3a" ]
[ "filterpy/kalman/tests/test_mmae.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Copyright 2015 Roger R Labbe Jr.\n\nFilterPy library.\nhttp://github.com/rlabbe/filterpy\n\nDocumentation at:\nhttps://filterpy.readthedocs.org\n\nSupporting book at:\nhttps://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python\n\nThis is licensed under an MIT license. See the ...
[ [ "numpy.array", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.random.randn", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplot" ] ]
tsattolo/sunshine_list_analysis
[ "3b17037521d5b8bbb81ef3ee5692b06944a2dc3f" ]
[ "source/data_cleaning/add_column_id.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nAdd ID columns for Employers or Job Titles that will represent the category\neach entry was put into in agg.py.\n\"\"\"\n\nimport json\nimport sys\nimport pandas as pd\nimport pdb\n\nfrom distances import *\n\ndef main():\n folder = sys.argv[1]\n col = sys.argv[2]\n df = pd...
[ [ "pandas.read_pickle" ] ]
mesquita97/HandTalks
[ "cd035dd39ef0acba9e24516bcea9ed7833fde141" ]
[ "GestureVolume/app.py" ]
[ "from flask import Flask, render_template, Response\nimport cv2\nimport time\nimport numpy as np\nimport HandTrackingModule as htm\nimport math\n\napp = Flask(__name__)\n\ndef gen_frames():\n ################################\n wCam, hCam = 640, 480\n ################################\n\n cap = cv2.VideoC...
[ [ "numpy.interp" ] ]
bcgov-c/ligo
[ "e637f5c388c9fa1ecb5e3f5295382618c1d9f830" ]
[ "web-app/linkage/datasets/models.py" ]
[ "from __future__ import unicode_literals, absolute_import\n\nimport pandas as pd\n\nfrom django.conf import settings\nfrom django.contrib.postgres.fields import JSONField\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\nfrom django.utils.encoding import python_2_unicode_compatible\nfrom ...
[ [ "pandas.read_csv" ] ]
alexpod1000/dgl
[ "b1628f2398995d588be1175a9619c08cbc0f4d05" ]
[ "python/dgl/backend/mxnet/sparse.py" ]
[ "import mxnet as mx\nimport numpy as np\nfrom mxnet import nd\nfrom ...sparse import _gspmm, _gsddmm, _segment_reduce, _bwd_segment_cmp, _scatter_add\nfrom ...sparse import _csrmm, _csrsum, _csrmask\nfrom ...base import dgl_warning, is_all, ALL\nfrom .tensor import asnumpy, copy_to, zerocopy_from_numpy, context, to...
[ [ "numpy.ones_like", "numpy.asarray", "numpy.zeros", "numpy.arange", "numpy.add.at", "numpy.cumsum" ] ]
toddrme2178/fastTSNE
[ "6eefe61965c6557b38300f75dccb2ff5d03d7a2c" ]
[ "setup.py" ]
[ "import os\nimport sys\nimport tempfile\nfrom distutils import ccompiler\nfrom distutils.errors import CompileError, LinkError\nfrom os.path import join\n\nimport setuptools\nfrom setuptools import setup, Extension\n\ntry:\n import numpy\nexcept ImportError:\n from subprocess import call\n call(['pip', 'in...
[ [ "numpy.get_include" ] ]
JustinBear99/Mask_RCNN
[ "d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff" ]
[ "detectron/lib/python3.6/site-packages/matplotlib-3.3.0rc1-py3.6-linux-x86_64.egg/matplotlib/legend.py" ]
[ "\"\"\"\nThe legend module defines the Legend class, which is responsible for\ndrawing legends associated with axes and/or figures.\n\n.. important::\n\n It is unlikely that you would ever create a Legend instance manually.\n Most users would normally create a legend via the `~.Axes.legend`\n function. For...
[ [ "matplotlib.cbook._check_in_list", "matplotlib.patches.FancyBboxPatch", "numpy.tile", "matplotlib.offsetbox.DraggableOffsetBox.__init__", "numpy.cumsum", "matplotlib.offsetbox.TextArea", "matplotlib.font_manager.FontProperties._from_any", "matplotlib.cbook.silent_list", "matplo...
JYLeeLYJ/Taichi_Animation_Demos
[ "c0515c1b4831b746966bc0405208a54e0e99896a" ]
[ "src/fluid_simulation.py" ]
[ "import taichi as ti\nimport numpy as np\nfrom pcg_method import PreConditioner , PCG_Solver\nfrom utils.tools import Pair\n\n#resolution\nresolution = 512\n\n\n@ti.data_oriented\nclass Smoke_Solver2D:\n\n @ti.data_oriented\n class MatA :\n \n def __init__(self):\n pass\n\n @ti...
[ [ "numpy.random.rand" ] ]
dand-oss/shap
[ "d4062730e94dd27056a6d5c49b6354fb95f1254c" ]
[ "shap/maskers/_image.py" ]
[ "import numpy as np\nfrom ..utils import assert_import, record_import_error\nfrom ._masker import Masker\nfrom .._serializable import Serializer, Deserializer\nimport heapq\n\n# TODO: heapq in numba does not yet support Typed Lists so we can move to them yet...\n\ntry:\n import cv2\nexcept ImportError as e:\n ...
[ [ "numpy.prod", "numpy.zeros", "numpy.ones" ] ]
sangfrois/NeuroKit
[ "a7cc6dc9e33182892929834644809d63d332dd22" ]
[ "neurokit2/microstates/microstates_classify.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\n\nfrom ..misc import replace\n\n\ndef microstates_classify(segmentation, microstates):\n \"\"\"Reorder (sort) the microstates (experimental).\n\n Based on the pattern of values in the vector of channels (thus, depends on how channels\n are ordered).\n\n Para...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.arange", "numpy.abs", "numpy.argsort" ] ]
cgyurgyik/EXOSIMS
[ "39096fe21c32aa22d31e0223156a2da1f6719d04", "39096fe21c32aa22d31e0223156a2da1f6719d04", "39096fe21c32aa22d31e0223156a2da1f6719d04" ]
[ "EXOSIMS/SurveySimulation/tieredScheduler_sotoSS.py", "EXOSIMS/Prototypes/Observatory.py", "EXOSIMS/PlanetPopulation/DulzPlavchan.py" ]
[ "from EXOSIMS.Prototypes.SurveySimulation import SurveySimulation\nimport EXOSIMS, os\nimport astropy.units as u\nimport astropy.constants as const\nimport numpy as np\nimport itertools\nfrom scipy import interpolate\ntry:\n import cPickle as pickle\nexcept:\n import pickle\nimport time\nfrom EXOSIMS.util.del...
[ [ "numpy.dot", "numpy.argmin", "numpy.copy", "numpy.tile", "numpy.min", "numpy.mean", "numpy.where", "numpy.invert", "numpy.logspace", "numpy.max", "numpy.sin", "numpy.linalg.norm", "numpy.empty", "numpy.logical_and", "numpy.arange", "numpy.transpose",...
HongminWu/bnpy
[ "04c918cc1150ca8d9694c093633d539d9286a1b6" ]
[ "bnpy/allocmodel/hmm/HMMUtil.py" ]
[ "'''\nHMMUtil.py\n\nProvides standard message-passing algorithms for inference in HMMs,\nsuch as the forward-backward algorithm\n\nIntentionally separated from rest of HMM code, so that we can swap in\nany fast routine for this calculation with ease.\n'''\nimport numpy as np\nfrom bnpy.util import EPS\nfrom bnpy.ut...
[ [ "numpy.max", "numpy.delete", "numpy.zeros_like", "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.dot", "numpy.log", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.shape", "numpy.any", "numpy.argmax", "numpy.isfinite", "numpy.outer" ] ]
salarsk1/principal-agent-bilevel-programming
[ "e09b9456dff1e5d253b57bd4bc60f87fd36a749b" ]
[ "sepdesign/_value_functions.py" ]
[ "\"\"\"\nClass of value functions\n\"\"\"\n\n__all__ = ['ValueFunction', 'RequirementValueFunction', \n 'RequirementPlusValueFunction']\n\n\nimport theano\nimport theano.tensor as T\nimport numpy as np\nfrom sepdesign._function import Function\n\n\nclass ValueFunction(Function):\n \"\"\"\n This is a...
[ [ "numpy.array", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplots", "numpy.linspace", "numpy.meshgrid" ] ]
FlorianKlemt/pytorch-latent-i2a
[ "36809bf3adda1fcffaccd27e352b7ad2338060a7" ]
[ "i2a/mini_pacman/i2a_mini_model.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\nfrom i2a.utils import get_linear_dims_after_conv\nfrom model_helpers.model_initialization import xavier_weights_init\n\n\nclass I2A_MiniModel(nn.Module):\n def __init__(self, obs_shape, action_space, use_cuda): #use_cuda is not used and for compatibili...
[ [ "torch.nn.Linear", "torch.nn.Conv2d" ] ]
Zendelo/ipcs
[ "e6942bb26352be371e498673fa27d51924e57584" ]
[ "dataparser.py" ]
[ "#!/usr/bin/env python\n\nimport csv\nimport glob\nimport multiprocessing as mp\nimport os\nimport sys\nimport xml.etree.ElementTree as eT\nfrom collections import defaultdict\nfrom subprocess import run\n\nimport numpy as np\nimport pandas as pd\nfrom lxml import etree\n\n\n# TODO: implement all necessary objects ...
[ [ "pandas.read_table", "pandas.concat" ] ]
gliptak/DataProfiler
[ "37ffbf43652246ef27e070df7ff0d9f1b9529162", "37ffbf43652246ef27e070df7ff0d9f1b9529162" ]
[ "dataprofiler/tests/labelers/test_data_processing.py", "dataprofiler/tests/profilers/test_datetime_column_profile.py" ]
[ "import json\nimport os\nimport random\nimport re\nimport unittest\nfrom io import StringIO\nfrom unittest import mock\n\nimport numpy as np\nimport pkg_resources\n\nfrom dataprofiler.labelers.data_processing import BaseDataProcessor, \\\n CharPostprocessor, CharPreprocessor, DirectPassPreprocessor, \\\n Rege...
[ [ "numpy.testing.assert_almost_equal", "numpy.array", "numpy.array_equal", "numpy.testing.assert_equal" ], [ "pandas.concat", "pandas.Timestamp", "numpy.array", "pandas.Series" ] ]
barryZZJ/dp-sniper
[ "71a3fc06f3fc319b023bde9aad8f05b8c5a47a80" ]
[ "dpsniper/probability/binomial_cdf.py" ]
[ "from scipy.stats import beta\n\n\ndef lcb(n: int, k: int, alpha: float):\n\t\"\"\"\n\tComputes a lower confidence bound on the probability parameter p of a binomial CDF.\n\n\tReturns:\n\t\tThe largest p such that Pr[Binom[n,p] >= k] <= alpha\n\t\"\"\"\n\tif k == 0:\n\t\treturn 0\n\telse:\n\t\t# Inspired by https:/...
[ [ "scipy.stats.beta.ppf" ] ]
RodolfoFerro/dabot
[ "40df74a54096fc1d67934538a1c1b25cbf9c1146" ]
[ "scripts/geo_app.py" ]
[ "# ===============================================================\n# Author: Rodolfo Ferro Pérez\n# Email: ferro@cimat.mx\n# Twitter: @FerroRodolfo\n#\n# ABOUT COPYING OR USING PARTIAL INFORMATION:\n# This script was originally created by Rodolfo Ferro. Any\n# explicit usage of this script or its contents is grant...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
RealPolitiX/perovNet
[ "30ab57c49873fcb119c7898785def0488b0e2340" ]
[ "perovNet/model.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n## The neural network models\n\nimport torch\nimport torch_scatter\n\n\nclass PerovNetShallow(torch.nn.Module):\n \"\"\" Shallow version of the perovskite neural network.\n \"\"\"\n \n def __init__(self, atom_type_in, atom_type_out, model):\n\n ...
[ [ "torch.nn.Linear", "torch.max", "torch.nn.ReLU" ] ]
AlexKuhnle/tensorforce
[ "348dade16393ff0441ae3416158aad4e91d1be59" ]
[ "tensorforce/core/baselines/baseline.py" ]
[ "# Copyright 2017 reinforce.io. 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 by ap...
[ [ "tensorflow.contrib.summary.histogram", "tensorflow.make_template", "tensorflow.nn.l2_loss" ] ]
nizamphoenix/EDD2020
[ "e8d05c38019b98cc8c5e34fd4bc50baceb8d608a" ]
[ "EDD.py" ]
[ "from torch.utils.data import Dataset\nfrom torchvision import transforms\nimport torch\nimport os\nimport numpy as np\nimport glob\nfrom PIL import Image\n\ndef load_image(path,is_mask):\n if not is_mask:\n return np.asarray(Image.open(path).convert(\"RGB\"))\n else:\n return np.asarray(Image.o...
[ [ "numpy.concatenate", "numpy.asarray", "numpy.zeros", "numpy.random.shuffle", "numpy.where", "numpy.moveaxis", "numpy.vstack" ] ]
pymontecarlo/pymontecarlo
[ "87050041724feb17f1ccff5794e9830c3209244e" ]
[ "pymontecarlo/formats/identifier.py" ]
[ "\"\"\"\"\"\"\n\n# Standard library modules.\n\n# Third party modules.\nimport pandas as pd\n\n# Local modules.\nfrom pymontecarlo.settings import Settings\nfrom pymontecarlo.util.cbook import get_valid_filename\nfrom pymontecarlo.formats.dataframe import ensure_distinct_columns\nfrom pymontecarlo.formats.series im...
[ [ "pandas.DataFrame" ] ]
ssfaruque/HD_Computing_Chemometrics
[ "d30ac48506ef172df3aa6bce6ffb24da8dcde7cd" ]
[ "chemometrics/svm_model.py" ]
[ "\nimport sys\nimport random as rand\nimport math\nimport numpy as np\nimport statistics as stats\n\nfrom sklearn import datasets\nfrom sklearn import svm\nfrom sklearn.model_selection import KFold\n\n\nthreshold_values = {\"DNA_ECOLI\": 0.065,\n \"Yeast_inliquid HK\": 0.055,\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.delete", "numpy.copy", "numpy.random.shuffle" ] ]
giovannidoni/DPA
[ "ccfca1d60cd068d748dd0103417d9769dfa25a99" ]
[ "Examples/auxplot.py" ]
[ "import numpy as np\nimport sys\nsys.path.append('../')\nfrom Pipeline import DPA\nimport hdbscan\nimport sklearn.cluster as cluster\nimport matplotlib.pyplot as plt\nimport scipy as sp\nfrom sklearn import manifold\nfrom scipy import cluster\nfrom matplotlib.collections import LineCollection\nfrom math import sqrt...
[ [ "scipy.cluster.hierarchy.dendrogram", "numpy.max", "numpy.empty", "numpy.zeros", "matplotlib.pyplot.get_cmap", "sklearn.metrics.cluster.normalized_mutual_info_score", "numpy.where", "numpy.amax", "numpy.abs", "scipy.cluster.hierarchy.single", "matplotlib.pyplot.NullLoca...
AcharyaRakesh/Blind_Vision
[ "79684ac2e633a7c368e94b1b0bc7eac121a8995c" ]
[ "vqa.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Untitled1.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1y7ltlS6H8y2I3BHnm9Kd5PYhnAm6zbgI\n\"\"\"\n\nimport tensorflow as tf\n\n# We'll generate plots of attention in order to see which parts of an image\...
[ [ "tensorflow.keras.preprocessing.sequence.pad_sequences", "sklearn.preprocessing.LabelEncoder", "numpy.array", "tensorflow.io.read_file", "tensorflow.keras.applications.inception_v3.preprocess_input", "numpy.load", "tensorflow.keras.models.load_model", "tensorflow.image.resize", ...
4AI/TDEER
[ "92a94ae63733bdca393061c2307499adfec663f4" ]
[ "langml/tests/test_layer_norm.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom langml import TF_KERAS\nif TF_KERAS:\n import tensorflow.keras.backend as K\n import tensorflow.keras.layers as L\nelse:\n import keras.backend as K\n import keras.layers as L\n\nimport numpy as np\nimport pytest\n\n\n@pytest.mark.parametrize(\"test_input,expected\", [\n...
[ [ "numpy.array" ] ]
wxxlouisa/faiss
[ "cfd8fd005debd9f30f70cac68c928d3f32fdf20e" ]
[ "tests/test_build_blocks.py" ]
[ "# 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\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\n\nimport faiss\nimport unittest\n\nfrom comm...
[ [ "numpy.bincount", "numpy.array", "numpy.dot", "numpy.empty", "numpy.random.rand", "numpy.zeros", "numpy.random.RandomState", "numpy.random.seed", "numpy.testing.assert_equal", "numpy.testing.assert_array_equal", "numpy.arange", "numpy.random.randint", "numpy.isf...
sthagen/christophM-interpretable-ml-book
[ "d8b82b8e6ab82c78d95de784a601e71025621ab2" ]
[ "scripts/dl-feature-attribution/activation-maximization.py" ]
[ "# code from here: https://gist.github.com/saurabhpal97/158988f112e2e3b6067d25c5f6499ef3#file-activation_max-py\n\n#importing the required modules\nfrom vis.visualization import visualize_activation\nfrom vis.utils import utils\nfrom keras import activations\nfrom keras import applications\nimport matplotlib.pyplot...
[ [ "matplotlib.pyplot.imshow" ] ]
nosa999/brainflow
[ "28dc228379d8bcec6e75ef6ab23fd9b91e16c28e" ]
[ "python-package/brainflow/board_shim.py" ]
[ "import ctypes\nimport numpy\nfrom numpy.ctypeslib import ndpointer\nimport pkg_resources\nimport enum\nimport os\nimport platform\nimport sys\nimport struct\nimport json\nfrom typing import List, Set, Dict, Tuple\n\nfrom nptyping import NDArray, Float64\n\nfrom brainflow.exit_codes import BrainflowExitCodes\n\n\nc...
[ [ "numpy.ctypeslib.ndpointer", "numpy.zeros" ] ]
eth-easl/CheckFreq
[ "ee4e3c1cdeeb330bfba997eed89b464ddeffc86d" ]
[ "models/image_classification/pytorch-imagenet-cf.py" ]
[ "import argparse\nimport os\nimport shutil\nimport time\nimport math\nimport sys\nsys.path.append('./')\nsys.path.append('./src')\nimport copy\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\n...
[ [ "torch.distributed.get_world_size", "torch.cuda.synchronize", "torch.distributed.init_process_group", "torch.autograd.Variable", "torch.save", "torch.no_grad", "torch.multiprocessing.set_start_method", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.set_device",...
marwage/alzheimer
[ "b58688ea91f9b2ca4ae5457858b0fcc2a6e3e041" ]
[ "preprocess_data.py" ]
[ "import json\nimport numpy as np\nimport scipy.sparse as sp\nimport scipy.io\nimport os\n\n\nhome = os.getenv(\"HOME\")\ndata_path = home + \"/gpu_memory_reduction/alzheimer/data\"\n\n\ndef print_array_prop(a):\n print(\"Shape: {}\".format(a.shape))\n print(\"Dtype: {}\".format(a.dtype))\n\n\ndef preprocess_f...
[ [ "scipy.sparse.coo_matrix", "numpy.array", "numpy.zeros", "numpy.genfromtxt", "numpy.load", "numpy.ones", "numpy.save", "scipy.sparse.csr_matrix" ] ]
frankier/vocabirt
[ "6f58e5189113bdef98ebb0d4a7fa683db9ee5845" ]
[ "vocabirt/embed_nn/sum_svl12k.py" ]
[ "import click\nimport pandas\n\nfrom vocabmodel.utils.freq import add_freq_strata, print_df\n\n\n@click.command()\n@click.argument(\"vocab_response_path\")\ndef main(vocab_response_path):\n df = pandas.read_parquet(vocab_response_path)\n add_freq_strata(df)\n df[\"knows\"] = df[\"score\"] == 5\n print_d...
[ [ "pandas.read_parquet" ] ]
raharison-toky/Dawsonmuse
[ "e3b3b0c08b984e676ca5a46a56fcdd827b7404cb" ]
[ "src/dawsonmuse.py" ]
[ "import multiprocessing\nimport time\nfrom time import time\nimport logging\nfrom multiprocessing import Process\nimport os\nfrom os import path, makedirs\nimport numpy as np\nimport pandas as pd\nfrom pylsl import StreamInfo, StreamOutlet, StreamInlet, resolve_byprop\nfrom typing import Union, List, Optional\nfrom...
[ [ "numpy.concatenate", "numpy.array", "matplotlib.pyplot.xlim", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.gca", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "numpy.abs", "pandas.read_csv" ] ]
CoronaWhy/risk-factors
[ "bce39484aa7a7995eb58678fa22081f4e077fe0f" ]
[ "task_risk/context_model/prediction/pipeline.py" ]
[ "from sklearn.base import TransformerMixin\nfrom sklearn.pipeline import Pipeline\n\n\nclass DenseTransformer(TransformerMixin):\n\n def fit(self, X, y=None, **fit_params):\n return self\n\n def transform(self, X, y=None, **fit_params):\n return X.todense()\n\n\ndef create_pipeline_with_dense_tr...
[ [ "sklearn.pipeline.Pipeline" ] ]
nt409/HRHR
[ "62ab397650f4e2a1b1d0e6ef289b4e73790c777e" ]
[ "src/model/simulator.py" ]
[ "\"\"\"\nContains classes:\n\n- RunSingleTactic\n- RunGrid\n\nAnd some others involved in their calculations (not for direct use)\n\"\"\"\n\nfrom abc import ABC, abstractmethod\nimport warnings\nimport numpy as np\nfrom math import ceil\nfrom scipy.integrate import ode\nimport pickle\nimport os\nfrom tqdm import tq...
[ [ "numpy.linspace", "scipy.integrate.ode" ] ]
mostafaelaraby/cvxpy
[ "078e025be8b8315b5f579bd0209e8e3a1e2a2a19", "078e025be8b8315b5f579bd0209e8e3a1e2a2a19" ]
[ "cvxpy/reductions/solvers/conic_solvers/gurobi_conif.py", "cvxpy/reductions/dcp2cone/atom_canonicalizers/log_sum_exp_canon.py" ]
[ "\"\"\"\nCopyright 2013 Steven Diamond, 2017 Robin Verschueren\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by appli...
[ [ "numpy.array", "scipy.sparse.dok_matrix" ], [ "numpy.ones" ] ]
SuwaidAslam/Machine-Learning-Trial-Room
[ "28a2d562ee72728f2dd738295255d5148c12cbd2" ]
[ "Models/KNeighborsClassifier.py" ]
[ "import streamlit as st\nfrom sklearn.neighbors import KNeighborsClassifier\n\n\n\ndef kn_param_selector():\n n_neighbors = st.number_input(\"n_neighbors\", min_value=1, max_value=100, step=1)\n weights = st.selectbox(\"weights\", ('uniform','distance'))\n algorithm = st.selectbox(\"algorithm\", ('auto','b...
[ [ "sklearn.neighbors.KNeighborsClassifier" ] ]
danial1371/ADM-HW1
[ "30c8b7879b14d29dddf6e20192f7e0fea2466cf9" ]
[ "HW1/Numpy/Polynomials.py" ]
[ "import numpy\r\na=list(map(float,input().split()))\r\nx=int(input())\r\nprint(numpy.polyval(a,x))" ]
[ [ "numpy.polyval" ] ]
rajattyagipvr/ml-pytorch-training
[ "aeb992d1035f25a9920ce5dbab01f18fc29a687c" ]
[ "app.py" ]
[ "#!/usr/bin/python\nimport torch\nimport torchvision\n\ndummy_input = torch.randn(10, 3, 224, 224, device='cpu') # or cuda\nmodel = torchvision.models.alexnet(pretrained=True).cpu() # or cuda()\n\ninput_names = [\"actual_input_1\"] + [\"learned_%d\" % i for i in range(16)]\noutput_names = [\"output1\"]\n\ntorch....
[ [ "torch.randn", "torch.onnx.export" ] ]
bpiwowar/salina
[ "f1ba5fb806e183e9b91129e22b9ca9e9f0e501a5" ]
[ "salina_examples/rl/ddpg/agents.py" ]
[ "#\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#\n\nimport gym\nimport torch\nimport torch.nn as nn\nfrom gym.wrappers import TimeLimit\n\nfrom salina import TAgent, instantiate_...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Sequential", "torch.zeros_like", "torch.tanh", "torch.randn", "torch.clip" ] ]
Jungjee/voxceleb_trainer
[ "52fc63eff4ab3c86016a076bde52e7bcd0e5c3da" ]
[ "loss/ge2e.py" ]
[ "#! /usr/bin/python\n# -*- encoding: utf-8 -*-\n## Fast re-implementation of the GE2E loss (https://arxiv.org/abs/1710.10467) \n## Numerically checked against https://github.com/cvqluu/GE2E-Loss\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport time, pdb, numpy\n\nclass GE2ELoss(nn.Mod...
[ [ "torch.stack", "torch.nn.CrossEntropyLoss", "torch.repeat_interleave", "torch.clamp", "torch.tensor", "torch.nn.functional.cosine_similarity", "torch.mean" ] ]
saitharun1997/eazy-nlp
[ "5c665d8793797ce1a91bdb728e0fe648718ed785" ]
[ "model.py" ]
[ "from sklearn.ensemble import RandomForestClassifier\r\nfrom sklearn.model_selection import GridSearchCV\r\nfrom xgboost import XGBClassifier\r\nfrom sklearn.metrics import roc_auc_score,accuracy_score\r\n\r\nclass Model_Finder:\r\n \"\"\"\r\n This class shall be used to find the model with best...
[ [ "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.roc_auc_score", "sklearn.model_selection.GridSearchCV", "sklearn.metrics.accuracy_score" ] ]
osalpekar/modin
[ "86cb1e07b5a6f35f94ce8bf6b3e4593e875a5453" ]
[ "modin/pandas/io.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pandas\nfrom pandas.io.common import _infer_compression\n\nimport inspect\nfrom io import BytesIO\nimport os\nimport py\nimport ray\nimport re\nimport warnings\nimport numpy as np\n\nfrom .dataf...
[ [ "pandas.read_pickle", "numpy.array", "pandas.read_sas", "pandas.read_excel", "pandas.RangeIndex", "pandas.read_clipboard", "pandas.read_stata", "pandas.io.common._infer_compression", "pandas.read_json", "pandas.read_hdf", "pandas.read_msgpack", "pandas.read_csv", ...
vinceq-usgs/gmprocess
[ "2812dfd1803f8b2e0622c56cd8373b1c3fedb1a6" ]
[ "gmprocess/plot.py" ]
[ "import os\nimport datetime\nimport warnings\nimport logging\n\nfrom matplotlib.pyplot import cm\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom obspy.geodetics.base import gps2dist_azimuth\nfrom obspy.core.utcdatetime import UTCDateTime\nfrom impactutils.colors.cpalette import ...
[ [ "matplotlib.colors.BoundaryNorm", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.savefig", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.tight_layout", "numpy.argmax", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyp...
MarcFletcher-HQP/forest_3d_app
[ "dc15c5d633b0f6e83620e2ed70e51e4c391c44ef" ]
[ "src/example_detection_scripts/carabost_detect.py" ]
[ "import sys\nsys.path.insert(0, '../')\nfrom forest3D import lidar_IO,ground_removal,treeDetector,inventory_tools,utilities\n\nimport os\nimport json\nimport numpy as np\n\noutput_dir = '/home/lloyd/Documents/projects/forest_3d_app/outputs'\n\nprint(\"reading the data into python...\")\npath = '/home/lloyd/Document...
[ [ "numpy.hstack" ] ]
ethereon/merlin
[ "0babfed51e65197086d74479a1ca9150259b4f7f" ]
[ "merlin/visualize/color.py" ]
[ "from numbers import Number\nfrom typing import Optional, Sequence, Callable\nfrom functools import partial\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom merlin.typing import Tensor\n\n# A matrix where each row is a single color\nColorMatrix = np.ndarray\n\n# A palette is a callable that accepts a positive...
[ [ "numpy.concatenate", "numpy.array", "numpy.ceil", "tensorflow.gather", "numpy.linspace", "numpy.floor" ] ]
EwoutH/laika
[ "f8bde3cc1b3bd442922bf45f40ca8b28251588b3" ]
[ "laika/rinex_file.py" ]
[ "#!/usr/bin/env python\n\n# Copyright (C) 2014 Swift Navigation Inc.\n#\n# This source is subject to the license found in the file 'LICENSE' which must\n# be be distributed together with this source. All other rights reserved.\n#\n# THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND,\n# EI...
[ [ "numpy.datetime64", "numpy.isnan", "numpy.zeros", "numpy.append" ] ]
AnonymousGFR/wbgan.pytorch
[ "d75cb6599852e901df0136db87520e3314f8ca71", "d75cb6599852e901df0136db87520e3314f8ca71" ]
[ "submodule/template_lib/gans/sinkhorn_autodiff.py", "BigGAN-PyTorch-1-exp-master/TOOLS/interpolation_BigGAN.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nsinkhorn_pointcloud.py\n\nDiscrete OT : Sinkhorn algorithm for point cloud marginals.\n\n\"\"\"\n\nimport torch\nfrom torch.autograd import Variable\n\n\ndef sinkhorn_normalized(x, y, epsilon, n, niter):\n\n Wxy = sinkhorn_loss(x, y, epsilon, n, niter)\n Wxx = sinkhorn_loss(x, ...
[ [ "torch.FloatTensor", "torch.abs", "torch.log", "torch.exp", "torch.sum" ], [ "torch.stack", "torch.arange", "torch.no_grad", "torch.linspace", "torch.randint", "torch.nn.parallel.data_parallel", "torch.randn" ] ]