repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
hammer/sgkit
[ "d3b77ed878ce421c9363b948a9796f46572fa44a" ]
[ "sgkit/tests/test_vcfzarr_reader.py" ]
[ "import allel\nimport numpy as np\nimport pytest\nimport xarray as xr\nimport zarr\nfrom numpy.testing import assert_array_equal\n\nfrom sgkit import read_vcfzarr\nfrom sgkit.io.vcfzarr_reader import _ensure_2d, vcfzarr_to_zarr\n\n\ndef create_vcfzarr(\n shared_datadir, tmpdir, *, fields=None, grouped_by_contig=...
[ [ "numpy.array", "numpy.testing.assert_array_equal" ] ]
Aidlab/aidlab-python-examples
[ "b392490d64985363a29d325a7b0eef817a556538" ]
[ "example_chart_mac_windows.py" ]
[ "import Aidlab\nimport numpy as np\nfrom multiprocessing import Process, Queue, Array\nimport matplotlib.pyplot as pyplot\nimport matplotlib.animation as animation\n\nbuffer_size = 500\nresult = None\nx = [i for i in range(buffer_size)]\ny = []\n\nfigure = pyplot.figure()\naxis = figure.add_subplot(1, 1, 1)\n\n\nde...
[ [ "numpy.max", "matplotlib.animation.FuncAnimation", "numpy.min", "matplotlib.pyplot.figure", "numpy.std", "matplotlib.pyplot.show" ] ]
izeye/tensorflow
[ "d4422ff4b2f142de1d0c626f73c734655d340e0d" ]
[ "tensorflow/python/framework/ops.py" ]
[ "# Copyright 2015 Google Inc. 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 appl...
[ [ "tensorflow.python.framework.tensor_shape.unknown_shape", "tensorflow.python.framework.dtypes.as_dtype", "tensorflow.core.framework.graph_pb2.NodeDef", "tensorflow.core.framework.versions_pb2.VersionDef", "tensorflow.python.framework.registry.Registry", "tensorflow.core.framework.graph_pb2...
TianhongDai/esil-hindsight
[ "b7c22da087095610018f281245fd4f622ef190ed" ]
[ "plot_curves.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\nimport matplotlib\n\n\"\"\"\nexample code for generate the curves\n\"\"\"\n\nsns.set(rc={\"figure.figsize\": (8, 7)})\nsns.set_context(rc={\"lines.linewidth\": 2})\n\n\"\"\"\nsame smooth function from openai baselines to make sure consiste...
[ [ "numpy.ones_like", "matplotlib.pyplot.xlim", "numpy.median", "matplotlib.pyplot.xticks", "numpy.concatenate", "numpy.nanpercentile", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "numpy.array", "matplotlib.pyplot.title", "matplotlib.pyplot.yticks", ...
aavanlee/fyp
[ "48bfc24cc17c86c635a4fe35e4e563c444cfaabc" ]
[ "cocoapi/PythonAPI/pycocotools/coco.py" ]
[ "__author__ = 'tylin'\n__version__ = '2.0'\n# Interface for accessing the Microsoft COCO dataset.\n\n# Microsoft COCO is a large image dataset designed for object detection,\n# segmentation, and caption generation. pycocotools is a Python API that\n# assists in loading, parsing and visualizing the annotations in CO...
[ [ "numpy.max", "numpy.array", "numpy.dstack", "matplotlib.collections.PatchCollection", "matplotlib.pyplot.plot", "numpy.ones", "matplotlib.patches.Polygon", "numpy.min", "numpy.all", "numpy.random.random", "matplotlib.pyplot.gca" ] ]
lujiarui/bioimage
[ "af22aedcc4ae1556c507cc359f0ad18719031b2b" ]
[ "train.py" ]
[ "import argparse\nimport os\nimport logging\nimport random\nimport time\n\nimport torch\nimport torchvision\nimport torch.nn as nn\nfrom sklearn import metrics\nimport matplotlib.pyplot as plt\nfrom sklearn.svm import SVC\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.metrics import confusion_mat...
[ [ "torch.cat", "torch.stack", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "torch.optim.lr_scheduler.MultiStepLR", "sklearn.svm.SVC", "torch.cuda.is_available", "matplotlib.pyplot.ylabel", "torch.nn.BCELoss"...
Srinivas200599/PrePred
[ "10733b5871c5b24351d5548c5b65788aa335d4bc" ]
[ "Personality Prediction/finetune_models/utils/linguistic_features_utils.py" ]
[ "import numpy as np\nimport pandas as pd\nimport re\nimport preprocessor as p\nfrom scipy.io import arff\n\ndef read_and_process(path):\n arff = open(path, 'r')\n attributes = []\n values = []\n is_attr = True\n arff.readline()\n arff.readline()\n while is_attr:\n line = arff.readline()\...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.to_numeric", "pandas.merge" ] ]
NauticalMile64/PyFR
[ "dcb16f01f7a68098efc9d043e77befd076b3eab5" ]
[ "pyfr/backends/opencl/base.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nfrom pyfr.backends.base import BaseBackend\nfrom pyfr.mpiutil import get_local_rank\n\n\nclass OpenCLBackend(BaseBackend):\n name = 'opencl'\n\n def __init__(self, cfg):\n super().__init__(cfg)\n\n import pyopencl as cl\n\n # Get the platf...
[ [ "numpy.dtype", "numpy.zeros" ] ]
u-square2/AcadVault
[ "571612c928a1357c849cf9a06b47bab15dc5afa3" ]
[ "CT/111_introduction_to_communication_theory/yash_vasavda/2019/projects/201801052/test.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib as mpl\nimport scipy.io\nmat = scipy.io.loadmat('Hmatrix2.mat')\n\ndef CopySubMatrix(Matrix,SubMatrix,i,j,rows,columns):\n\tn=rows*rows\n\tk=columns*columns\n\tfor x in range(0,rows):\n\t\tfor y in range(0,columns):\n\t\t\tMatrix[((i + x) , (j ...
[ [ "numpy.array", "numpy.dot", "numpy.count_nonzero", "numpy.random.rand", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "numpy.sqrt", "numpy.size", "matplotlib.pyplot.show" ] ]
shahdloo/pycortex
[ "08693a048cc66d77ada1126129349c7c1ad46d92" ]
[ "cortex/brainctm.py" ]
[ "'''Generates the OpenCTM file that holds the brain mesh for the webgl viewer. \nThis ctm file contains the following information:\n\npts, polys\n Forms the base of the brain mesh, in the fiducial space\n\nmorphTarget%d\n Holds additional surfaces (inflated, etc) as morphTargets for three.js.\n Morphtargets are ...
[ [ "scipy.spatial.cKDTree", "numpy.vstack" ] ]
oluwayetty/dagan-camera
[ "b8d10b32b480f454e26b7290f137907d3f3afa0a" ]
[ "dagan_architectures.py" ]
[ "import tensorflow as tf\nfrom tensorflow.contrib.layers import batch_norm, layer_norm\nfrom tensorflow.python.ops.image_ops_impl import ResizeMethod\nfrom tensorflow.python.ops.nn_ops import leaky_relu\nfrom utils.network_summary import count_parameters\n\n\ndef remove_duplicates(input_features):\n \"\"\"\n ...
[ [ "tensorflow.layers.dropout", "tensorflow.contrib.layers.batch_norm", "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.layers.flatten", "tensorflow.python.ops.nn_ops.leaky_relu", "tensorflow.contrib.layers.layer_norm", "tensorflow.image.resize_nearest_neighbor", ...
frgfm/pair-assignment
[ "2a40fbead16f7cf9ea0adcfa10fda0d2d2998d37" ]
[ "main.py" ]
[ "#!/usr/bin/env python\n\n'''\nThese functions were developped to provide optimisation solutions for assignment problems\n'''\n\n__author__ = 'François-Guillaume Fernandez'\n__license__ = 'MIT License'\n__version__ = '0.1'\n__maintainer__ = 'François-Guillaume Fernandez'\n__status__ = 'Development'\n\nfrom assignme...
[ [ "numpy.sum", "numpy.random.rand" ] ]
jemorrison/jwst_reffiles
[ "9fca3901b059c72f14d05272e314f816bee55e99" ]
[ "jwst_reffiles/bad_pixel_mask/bad_pixel_mask.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"Wrapper script that calls badpix_from_flats.py and badpix_from_darks.py.\nThe results are combined to create a single bad pixel reference file.\n\"\"\"\nimport copy\nimport datetime\nimport os\n\nfrom astropy.io import fits\nfrom jwst.datamodels import MaskModel, util\nimport numpy ...
[ [ "numpy.bitwise_xor", "numpy.bitwise_or", "numpy.arange" ] ]
Nanovel-Ltd/keras-retinanet
[ "8aa02c3c32f8dd545ad20f9e977aee0d6a56dbd2" ]
[ "keras_retinanet/bin/predict_on_images.py" ]
[ "\nimport sys\nimport os\nimport argparse\n\n# Allow relative imports when being executed as script.\nif __name__ == \"__main__\" and __package__ is None:\n sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))\n import keras_retinanet.bin # noqa: F401\n __package__ = \"keras_retinanet.b...
[ [ "numpy.array" ] ]
TTornblom/CMSIS_5
[ "d2039b239cb6385d5a0e865966b2bb0c57f1f21f" ]
[ "CMSIS/NN/Tests/UnitTest/generate_test_data.py" ]
[ "#!/usr/bin/env python3\n#\n# Copyright (C) 2010-2021 Arm Limited or its affiliates.\n#\n# SPDX-License-Identifier: Apache-2.0\n#\n# Licensed under the Apache License, Version 2.0 (the License); you may\n# not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# www....
[ [ "tensorflow.keras.layers.InputLayer", "tensorflow.keras.layers.AveragePooling2D", "numpy.genfromtxt", "tensorflow.reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "tensorflow.cast", "numpy.full", "tensorflow.keras.layers.DepthwiseConv2D", "te...
benblack769/audiosearch
[ "6e260e589e7fc9dd8b32d8b2428b33c66c8a639e" ]
[ "learner_cli/create_json_dataset.py" ]
[ "import pandas\nimport base64\nimport numpy as np\nimport json\n\ntrack_data = pandas.read_csv(\"data/fma_metadata/track_info.csv\")\nlast_vector_num = int(open(\"data/fma_outs/epoc_num.txt\").read())\nvectors = np.load(\"data/final_word_vecs.npy\")#np.load(f\"data/fma_outs/vector_at_{last_vector_num}.npy\")\n\nall...
[ [ "pandas.DataFrame", "pandas.read_csv", "numpy.load", "pandas.merge" ] ]
sgjholt/mlmags
[ "e0a5f418440aa3206f24c62c4ccffbf6bd8b8063" ]
[ "src/data/clean_data_tables.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom typing import Tuple \n\n\ndef col_to_dt(df: pd.DataFrame, name: str):\n \"\"\"[summary]\n\n Args:\n df (pd.DataFrame): [description]\n name (str): [description]\n \"\"\"\n df[name] = pd.to_datetime(df[name].values, unit='ns', utc=True)\n\n\nde...
[ [ "pandas.to_datetime" ] ]
Gaurav1401/Awesome_Python_Scripts
[ "e98044cc42a975e81d880b27546fadcdead17a42" ]
[ "GUIScripts/Postal Code Validator/postal_code_validator.py" ]
[ "\n# Postal Code Validator\n\n# imported necessary library\nimport tkinter\nfrom tkinter import *\nimport tkinter as tk\nimport tkinter.messagebox as mbox\nfrom PIL import Image, ImageTk\nimport pandas as pd\nimport re\n\n\n# created main window\nwindow = Tk()\nwindow.geometry(\"1000x700\")\nwindow.title(\"Postal C...
[ [ "pandas.read_csv" ] ]
ucgmsim/Pre-processing
[ "c4b9ae20a9e5e4f96f930bde29aa15176d9c8b64" ]
[ "srf_generation/source_parameter_generation/uncertainties/versions/cs_20_4.py" ]
[ "\"\"\"A basic perturbator as an example and starting point\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom typing import Any, Dict\n\nfrom qcore.nhm import NHMFault\n\nfrom srf_generation.Fault import fault_factory, Type4\nfrom srf_generation.source_parameter_generation.uncertainties.common import (\n veri...
[ [ "numpy.sqrt" ] ]
amyrebecca/aggregation-for-caesar
[ "5f0d884932312010f9caeb8ebfcfe358f490e41f" ]
[ "panoptes_aggregation/reducers/shape_reducer_dbscan.py" ]
[ "'''\nShape Reducer DBSCAN\n--------------------\nThis module provides functions to cluster shapes extracted with\n:mod:`panoptes_aggregation.extractors.shape_extractor`.\n'''\nimport numpy as np\nfrom sklearn.cluster import DBSCAN\nfrom collections import OrderedDict\nfrom .reducer_wrapper import reducer_wrapper\n...
[ [ "numpy.array", "sklearn.cluster.DBSCAN" ] ]
guodashun/self_supervised_ggcnn
[ "3656d7b017dffefda6c57d1616f0ae61811f01bb" ]
[ "utils/dataset_processing/grasp.py" ]
[ "import numpy as np\n\nimport matplotlib.pyplot as plt\n\nfrom skimage.draw import polygon\nfrom skimage.feature import peak_local_max\n\n\ndef _gr_text_to_no(l, offset=(0, 0)):\n \"\"\"\n Transform a single point from a Cornell file line to a pair of ints.\n :param l: Line from Cornell grasp file (str)\n ...
[ [ "numpy.array", "numpy.sin", "numpy.dot", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.figure", "numpy.stack", "numpy.arctan2", "numpy.sqrt", "numpy.cos", "matplotlib.pyplot.show", "numpy.vstack" ] ]
HarlockOfficial/dva336_labs
[ "0fc354fe02eba38d123fec959433a53b2a99a7c7" ]
[ "Project2/plot_graph.py" ]
[ "#!/usr/bin/python3\nimport math\nfrom typing import Tuple\n\nimport matplotlib.pyplot as plt\n\ndivision_factor_for_reference_values = math.pow(10, 4)/1.5\nk = 4 # thread count\n\n\ndef main():\n x, y_seq, y_par, res_seq, res_par = get_data(\"test_code_output.csv\")\n\n x_fixed = list()\n x_div_k = list(...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.gca" ] ]
AceZhan/pyserini
[ "188060178c012181e1c32791694930bced186534" ]
[ "scripts/ltr_msmarco/ltr_inference.py" ]
[ "#\n# Pyserini: Reproducible IR research with sparse and dense representations\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.read_csv", "numpy.mean" ] ]
tikisi/donkeycar
[ "688204ca074886321e0d58e75d81d89f04f7a2b6" ]
[ "donkeycar/parts/graph.py" ]
[ "import numpy as np\nimport cv2\n\n\nclass Graph(object):\n '''\n Take input values and plot them on an image.\n Takes a list of (x, y) (b, g, r) pairs and\n plots the color at the given coordinate.\n When the x value exceeds the width, the graph is erased\n and begins with an offset to x values s...
[ [ "numpy.zeros_like", "numpy.zeros" ] ]
globophobe/fastapi-quant-candles
[ "0bc95f6bb32071aa32a4951ca0a15521f67f7f97" ]
[ "cryptofeed_werks/exchanges/bitfinex/base.py" ]
[ "from datetime import datetime\nfrom decimal import Decimal\nfrom typing import Optional\n\nimport numpy as np\nfrom pandas import DataFrame\n\nfrom cryptofeed_werks.lib import candles_to_data_frame, timestamp_to_inclusive\n\nfrom .api import format_bitfinex_api_timestamp, get_bitfinex_api_timestamp\nfrom .candles ...
[ [ "numpy.sign" ] ]
MaharshiPedu/Medical-Transformer-with-DWT
[ "a2193b74cbe8f6e9855e0e35b988131a0b77a7cd" ]
[ "disWT/discrete_wt.py" ]
[ "from numpy.core.fromnumeric import size\nimport pywt\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimage\nimport glob\nimport os\nfrom torch.utils.data import DataLoader\nimport numpy as np\nimport torch\ndef DWT(x_batch):\n x_batch_np = x_batch.detach().cpu().numpy()\n LL_list, LH_list, HL_...
[ [ "numpy.array", "matplotlib.image.imread", "torch.tensor" ] ]
fangedward/pylot
[ "a742b3789ee8e7fa2d692ae22bda1e2960ed9345" ]
[ "scripts/sign_data_gatherer.py" ]
[ "from absl import app\nfrom absl import flags\nimport carla\nimport json\nimport numpy as np\nimport PIL.Image as Image\nimport time\nimport re\n\nfrom pylot.drivers.sensor_setup import DepthCameraSetup, RGBCameraSetup, \\\n SegmentedCameraSetup\nfrom pylot.perception.camera_frame import CameraFrame\nfrom pylot....
[ [ "numpy.dot" ] ]
zhuyifan1993/Direct_RGB-D_SLAM
[ "2567177ae7e27479f298fd5a9369e3e89566c41c" ]
[ "output_trajectory.py" ]
[ "import numpy as np\nimport utils.conversions as conv\n\ntraj = np.load('traj_0.npy')\nnum = len(traj)\n\nabsolute_pose_path = 'kf_index_level4.txt'\nf = open(absolute_pose_path)\nline = f.readlines()\n\nfor i in range(num):\n trans = traj[i]\n quater = conv.trans_to_quater(trans)\n timestamp = line[i].spl...
[ [ "numpy.load" ] ]
bdshieh/interaction3
[ "b44c390045cf3b594125e90d2f2f4f617bc2433b" ]
[ "interaction3/arrays/matrix.py" ]
[ "## interaction3 / arrays / matrix.py\n\nimport numpy as np\n\nfrom interaction3.abstract import *\n\n# default parameters\ndefaults = dict()\n\n# membrane properties\ndefaults['length'] = [40e-6, 40e-6]\ndefaults['electrode'] = [40e-6, 40e-6]\ndefaults['nnodes'] = [9, 9]\ndefaults['thickness'] = [2.2e-6,]\ndefault...
[ [ "numpy.linspace" ] ]
kvemani/ibis
[ "37616bd3df0599f33b28101ca1c19e0c0003cf4d" ]
[ "ibis/backends/pandas/aggcontext.py" ]
[ "\"\"\"Implements an object to describe the context of a window aggregation.\n\nFor any particular aggregation such as ``sum``, ``mean``, etc we need to decide\nbased on the presence or absence of other expressions like ``group_by`` and\n``order_by`` whether we should call a different method of aggregation.\n\nHere...
[ [ "pandas.tseries.frequencies.to_offset", "pandas.Series" ] ]
jizhi-zhang/Counterfactual_Reasoning_Model
[ "3c4eb3e022e66e8626facc6fc772141a0079b807" ]
[ "Sentiment_task/roberta_base_CRM.py" ]
[ "from transformers import AutoTokenizer, AutoModelForSequenceClassification\n# from transformers import AutoTokenizer, AutoModelForSequenceClassification\nimport torch\n#from pytorch_pretrained_bert import BertTokenizer, BertModel\nfrom transformers import BertModel,BertTokenizer, BertForSequenceClassification, Ada...
[ [ "torch.nn.Linear", "torch.cat", "torch.cuda.manual_seed", "torch.stack", "pandas.read_csv", "torch.nn.CrossEntropyLoss", "matplotlib.pyplot.savefig", "torch.manual_seed", "torch.cuda.manual_seed_all", "torch.max", "torch.save", "matplotlib.pyplot.title", "torch....
sanger640/attMPTI
[ "a2784b784e0900f3603baa3779631da67bcd0562" ]
[ "models/mpti.py" ]
[ "\"\"\" Multi-prototype transductive inference\n\nAuthor: Zhao Na, 2020\n\"\"\"\nimport numpy as np\nimport faiss\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch_cluster import fps\n\nfrom models.dgcnn import DGCNN\nfrom models.attention import SelfAttention\n\n\nclass BaseLearne...
[ [ "torch.zeros", "torch.diag_embed", "torch.cat", "torch.sqrt", "torch.nonzero", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.gather", "torch.argmin", "torch.from_numpy", "torch.logical_not", "torch.nn.functional.cross_entropy", "numpy.finfo", "torch.eye",...
caiostringari/BBC-JGR-Oceans
[ "4089081ce6e477a232039f6d2257ea43c97bd87b" ]
[ "plot_profiles.py" ]
[ "# ------------------------------------------------------------------------\n# ------------------------------------------------------------------------\n#\n# script : plot_profiles.py\n# pourpose : plot beach profiles\n# author : caio eadi stringari\n# email : caio.eadistringari@uon.edu.au\n#\n# ------------...
[ [ "matplotlib.pyplot.gcf", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.subplot" ] ]
zhengkaitu/rdchiral
[ "eb9d53782a7b1f47cdc85cd19f6ec97c0d26bf10" ]
[ "rdchiral/template_extractor.py" ]
[ "import re\nfrom numpy.random import shuffle\nfrom copy import deepcopy\nfrom rdkit import Chem\nfrom rdkit.Chem import AllChem\nfrom rdkit.Chem.rdchem import ChiralType\n\nVERBOSE = False\nUSE_STEREOCHEMISTRY = True\nMAXIMUM_NUMBER_UNMAPPED_PRODUCT_ATOMS = 5\nINCLUDE_ALL_UNMAPPED_REACTANT_ATOMS = True\n\ndef mols_...
[ [ "numpy.random.shuffle" ] ]
cidimec/opencv-ai-competition-beavers
[ "4849219c7c1525d12c1e681185bbafcf3030079a" ]
[ "codes/3_calculate_distance.py" ]
[ "import threading\r\nfrom pathlib import Path\r\nimport math\r\nimport cv2\r\nimport depthai\r\nimport numpy as np\r\nfrom imutils.video import FPS\r\n\r\nnnPathPeople = str((Path(__file__).parent / Path('models/people.blob')).resolve().absolute()) #544x320 NN\r\nnnPathMask = str((Path(__file__).parent / Path('mode...
[ [ "numpy.array" ] ]
bartoszptak/segmentation_models.pytorch
[ "7f443f7ae39a58841adce1f3a7973d6f4bcd052a" ]
[ "tests/test_models_3d.py" ]
[ "import os\nimport sys\nimport mock\nimport pytest\nimport torch\n\n# mock detection module\nsys.modules[\"torchvision._C\"] = mock.Mock()\nimport segmentation_models_pytorch as smp\n\n\ndef get_encoders_3d():\n exclude_encoders = [\n \"senet154\",\n \"resnext101_32x16d\",\n \"resnext101_32x...
[ [ "torch.no_grad", "torch.ones" ] ]
glemaitre/hexrd
[ "b68b1ba72e0f480d29bdaae2adbd6c6e2380cc7c" ]
[ "hexrd/fitting/peakfunctions.py" ]
[ "# ============================================================\n# Copyright (c) 2012, Lawrence Livermore National Security, LLC.\n# Produced at the Lawrence Livermore National Laboratory.\n# Written by Joel Bernier <bernier2@llnl.gov> and others.\n# LLNL-CODE-529294.\n# All rights reserved.\n#\n# This file is part...
[ [ "numpy.sin", "numpy.reshape", "numpy.zeros", "numpy.exp", "numpy.where", "numpy.tanh", "numpy.arange", "numpy.cos" ] ]
bromjiri/Presto
[ "e5790f60d0935bb1182f676db414b0724ba35c1b" ]
[ "predictor/diff.py" ]
[ "import settings\nimport pandas as pd\nimport numpy as np\nimport datetime\nimport os\n\n\nclass Stock:\n\n def __init__(self, subject):\n input_file = settings.PREDICTOR_STOCK + \"/\" + subject + \".csv\"\n self.stock_df = pd.read_csv(input_file, sep=',', index_col='Date')\n\n def get_diff(self...
[ [ "numpy.round", "pandas.DataFrame", "pandas.read_csv", "pandas.to_datetime" ] ]
mpoziomska/MNE_poprawione
[ "f3b08753dfab3619a65250f6d2aff456a0e595c1" ]
[ "mne/source_estimate.py" ]
[ "# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Mads Jensen <mje.mads@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport contextlib\nimport copy\nimport os.path as op\nimport numpy...
[ [ "numpy.dot", "numpy.array_equal", "scipy.linalg.svd", "numpy.tile", "numpy.mean", "numpy.where", "sklearn.feature_extraction.grid_to_graph", "numpy.frombuffer", "numpy.concatenate", "numpy.max", "numpy.linalg.norm", "numpy.empty", "scipy.sparse.block_diag", ...
Sugoshnr/faiss
[ "48ae55348a58624337e0b5125fb865142d2b9e19" ]
[ "tests/test_index_accuracy.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# noqa E741\n# translation of test_knn.lua\n\nimport numpy as np\n...
[ [ "numpy.dot", "numpy.zeros", "numpy.random.RandomState", "numpy.testing.assert_almost_equal", "numpy.testing.assert_array_equal", "numpy.arange", "numpy.sqrt", "numpy.abs", "numpy.all", "numpy.floor" ] ]
monish33/Continuous-Sign-Language-Recognition
[ "66f137c7066cbf738c7859e00d34a2ca248208a3" ]
[ "mm.py" ]
[ "#!/usr/bin/env python3\n\n# Continuous Sign Language Recognition\n# Created by Monish Murale, https://github.com/monish33\n\nimport os\nfrom os.path import join, exists\nfrom tqdm import tqdm\nimport hand as h\nimport find_frames as ff\nimport numpy as np\nimport cv2\nimport pickle\nimport argparse\n\nhc = []\n# a...
[ [ "numpy.median" ] ]
AbuBakkar32/ML-DL-NLP-TP-FE-MP
[ "2525b6b32fc1876e65643b8c221ffda591981623" ]
[ "Dimensionality/pca.py" ]
[ "import pandas as pd # pandas is a dataframe library\nimport matplotlib.pyplot as plt\n\n\n#Read the data\ndf = pd.read_csv(\"pima-data.csv\")\n\n#Check the Correlation\n#df.corr()\n#Delete the correlated feature\ndel df['skin']\n\n#Data Molding\ndiabetes_map = {True : 1, False : 0}\ndf['diabetes'] ...
[ [ "sklearn.impute.SimpleImputer", "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "sklearn.naive_bayes.GaussianNB", "matplotlib.colors.ListedColormap", "sklearn.metrics....
caibobit/monte-carlo-tree-search
[ "1657c2fb1b182c0802e278a7d40467349998a91f" ]
[ "tests/test_result.py" ]
[ "import numpy as np\n\nfrom mctspy.tree.nodes import TwoPlayersGameMonteCarloTreeSearchNode\nfrom mctspy.tree.search import MonteCarloTreeSearch\nfrom mctspy.games.examples.tictactoe import TicTacToeGameState\n\n\ndef test_tic_tac_toe_best_action():\n state = np.zeros((10, 10))\n initial_board_state = TicTacT...
[ [ "numpy.zeros" ] ]
vusd/vizer-unmix
[ "436ab0ed171995371740771898d15cb9bcaf2c35" ]
[ "eval.py" ]
[ "import argparse\nimport musdb\nimport museval\nimport test\nimport multiprocessing\nimport functools\nfrom pathlib import Path\nimport torch\nimport tqdm\n\n\ndef separate_and_evaluate(\n track,\n targets,\n model_name,\n niter,\n alpha,\n softmask,\n output_dir,\n eval_dir,\n device='cp...
[ [ "torch.device", "torch.cuda.is_available" ] ]
zbwxp/confidence-aware-learning
[ "30a0c8a5f4e7929e8760cede05988093a2fd585f" ]
[ "metrics.py" ]
[ "import numpy as np\r\nimport torch\r\nimport torch.nn.functional as F\r\nfrom sklearn import metrics\r\n\r\ndef calc_metrics(loader, label, label_onehot, model, criterion):\r\n acc, softmax, correct, logit = get_metric_values(loader, model, criterion)\r\n # aurc, eaurc\r\n aurc, eaurc = calc_aurc_eaurc(so...
[ [ "numpy.max", "torch.zeros", "numpy.array", "torch.nn.LogSoftmax", "numpy.log", "torch.max", "numpy.sum", "torch.no_grad", "torch.linspace", "torch.abs", "sklearn.metrics.average_precision_score", "torch.tensor", "numpy.abs", "torch.nn.functional.softmax", ...
swapnilmastekar/ga-learner-dsmp-repo
[ "6442f75d11dc0662fff2a4f36cc1840a3903fc16" ]
[ "Feature-Selection/Forest-Type-Cover-Prediction/code.py" ]
[ "# --------------\nimport pandas as pd\nfrom sklearn import preprocessing\n\n#path : File path\n\n# Code starts here\n\n\n# read the dataset\ndataset=pd.read_csv(path)\n\n# look at the first five columns\ndataset.head()\n\n# Check if there's any column which is not useful and remove it like the column id\ndataset.d...
[ [ "numpy.concatenate", "sklearn.preprocessing.StandardScaler", "pandas.DataFrame", "matplotlib.pyplot.subplots", "sklearn.metrics.accuracy_score", "sklearn.linear_model.LogisticRegression", "sklearn.feature_selection.SelectPercentile", "pandas.read_csv", "sklearn.cross_validation...
ucb-bar/autophase
[ "0c2f6e3cdedf41da95a8c8166b740005e3d67e25" ]
[ "gym-hls/gym_hls/envs/geomean.py" ]
[ "import numpy as np\ndef geomean(iterable):\n \"\"\"\n Examples :\n >>> print(geomean([1, 3, 27]))\n 4.32674871092\n \n\t\t>>> print(geomean([1,9,5,6,6,7])\n 4.73989632394\n\n\n Args:\n iterable (iterable): This parameter can be a list, a tuple, a dictionary, .. etc an...
[ [ "numpy.array" ] ]
ashleefv/covid19fibrosis
[ "3cdd4871708346d0a866340f64290b6a75302c89" ]
[ "Analysis/mean_response_comparison_between_cases.py" ]
[ "import glob\nfrom Butyrate.mcds.pyMCDS import pyMCDS\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib.pyplot as plt # if you want to plot results\nimport random, pickle\nimport os\nimport seaborn as sns\nfrom pylab...
[ [ "matplotlib.use", "matplotlib.pyplot.rcParams.update", "numpy.array", "numpy.mean", "matplotlib.pyplot.subplots" ] ]
phosseini/bert
[ "6d91a1578a2c963e26a7d057fc673b258585d3c4" ]
[ "modeling.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.ones", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.cast", "tensorflow.shape", "tensorflow.concat", "tensorflow.transpose", "tensorflow.train.list_variables", "te...
shijun18/torch_deploy
[ "2055ec5a9be79bb55c8fbbf459abb2173b3f9e0f" ]
[ "test_deploy/transformer.py" ]
[ "import torch \nimport numpy as np \nfrom skimage.transform import resize\n\n\n\n\nclass Trunc_and_Normalize(object):\n '''\n truncate gray scale and normalize to [0,1]\n '''\n def __init__(self, scale):\n self.scale = scale\n assert len(self.scale) == 2, 'scale error'\n\n def __call__(self, image):\n \n...
[ [ "numpy.transpose", "numpy.expand_dims", "torch.from_numpy" ] ]
chrisnbattista/multi-agent-kinetics
[ "01af3bbd8a44038e7e8744975000e5474fa1124b" ]
[ "experiments.py" ]
[ "import numpy as np\nimport torch\nimport random, math\nfrom . import worlds\n\ndef initialize_random_sphere(n_particles,\n radius,\n center=None,\n min_dist=4,\n random_speed=0,\n ...
[ [ "torch.zeros", "numpy.linalg.norm", "numpy.zeros", "torch.tensor", "numpy.abs" ] ]
sebi06/czi_demos
[ "b3f7801f46de0138a8a1ac245e9c80787e0a3f17" ]
[ "test_stardist_cziRGB.py" ]
[ "from __future__ import print_function, unicode_literals, absolute_import, division\nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plt\n# %matplotlib inline\n# %config InlineBackend.figure_format = 'retina'\n\nfrom glob import glob\nfrom tifffile import imread\nfrom csbdeep.utils import Path, normaliz...
[ [ "numpy.moveaxis", "matplotlib.pyplot.figure" ] ]
Richard-L-Johnson/pyalgotrader
[ "ad2bcc6b25c06c66eee4a8d522ce844504d8ec62" ]
[ "testcases/technical_hurst_test.py" ]
[ "# PyAlgoTrade\n#\n# Copyright 2011-2018 Gabriel Martin Becedillas Ruiz\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# Unle...
[ [ "numpy.log10", "numpy.random.randn" ] ]
mfalkiewicz/nipype
[ "373bdddba9f675ef153951afa368729e2d8950d2" ]
[ "nipype/interfaces/cmtk/tests/test_nbs.py" ]
[ "from __future__ import unicode_literals\nfrom ..nbs import NetworkBasedStatistic\nfrom ....utils.misc import package_check\nimport numpy as np\nimport networkx as nx\nimport pytest\n\nhave_cv = True\ntry:\n package_check('cviewer')\nexcept Exception as e:\n have_cv = False\n\n@pytest.fixture()\ndef creating_...
[ [ "numpy.random.rand" ] ]
johnamcleod/tensorflow
[ "e25272e74334cb2a4c6b256c132786f72c28fcd0" ]
[ "tensorflow/python/distribute/strategy_common_test.py" ]
[ "# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.distribute.multi_worker_test_base.get_task_type", "tensorflow.python.ops.array_ops.identity", "tensorflow.python.distribute.combinations.combine", "tensorflow.python.eager.def_function.function", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.ops.math_ops.red...
dburkhardt/slalom
[ "547a56316e5c3ccc63e592eb907dc53b00212466" ]
[ "slalom/bayesnet/misc.py" ]
[ "# Copyright(c) 2014, The scLVM developers (Forian Buettner, Paolo Francesco Casale, Oliver Stegle)\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/licen...
[ [ "scipy.linalg.svd", "scipy.isscalar", "scipy.array", "scipy.linalg.pinv", "scipy.diag" ] ]
james-choncholas/coral-webcam-segmentation
[ "dac2f3d0d84b12a14c41d660000db9b89171cfcf" ]
[ "bodypix.py" ]
[ "# Copyright 2019 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.max", "numpy.full", "numpy.zeros", "numpy.ascontiguousarray", "numpy.bitwise_and", "numpy.argmax" ] ]
holmesal/fastai
[ "cbd2a0c91d01842fb2e780072aed510b1325d1e5" ]
[ "alonso/planet.py" ]
[ "from fastai.imports import *\nfrom fastai.transforms import *\nfrom fastai.dataset import *\nfrom sklearn.metrics import fbeta_score\nimport warnings\n\ndef f2(preds, targs, start=0.17, end=0.24, step=0.01):\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n return max([fbeta_...
[ [ "sklearn.metrics.fbeta_score" ] ]
raphael0202/models
[ "2bc90622ab8b278103a3692ac760e6e9aefb38f3" ]
[ "research/object_detection/model_lib.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.contrib.tpu.TPUEstimatorSpec", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.contrib.tpu.CrossShardOptimizer", "tensorflow.ones", "tensorflow.metrics.mean", "tensorflow.stack", "tensorflow.tile", "tensorflow.logging.warning", "tensorflow.add_to_collection", ...
DLPerf/graphics
[ "c42eb846f1a9b2b326c86ec08c2ba10f5903a460" ]
[ "tensorflow_graphics/projects/points_to_3Dobjects/utils/evaluator.py" ]
[ "# Copyright 2020 The TensorFlow 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "numpy.load", "numpy.min", "tensorflow.reshape", "numpy.mean", "numpy.where", "tensorflow.zeros_like", "numpy.finfo", "numpy.cumsum", "tensorflow.cast", "numpy.concatenate", "matplotlib.pyplot.colorbar", "tensorflow.concat", "matplotlib.pyplot.subplots", "te...
CEAC33/sanic-skeleton-api
[ "0003789e467f6bb111dd68629959e0a6caa70f74" ]
[ "apps/utils/mongo_utils.py" ]
[ "from pymongo import MongoClient\nimport pandas as pd\nfrom sanic.log import logger\nfrom config import *\nfrom bson.objectid import ObjectId\nimport copy\nimport json\n\n\nasync def save_csv_to_mongo(config, csv_file, config_id): \n client = MongoClient(config.MONGO_HOST, config.MONGO_PORT)\n db=client.exago...
[ [ "pandas.notnull", "pandas.read_csv" ] ]
sidd0529/COSMOS_Lens
[ "203c97948f8ba30d8874ec6bbc0d00e3c82639da" ]
[ "gauss_smooth.py" ]
[ "from __future__ import division\nimport numpy as np\n\n# ----------- Gaussian Smoothing (self-defined) ------------------------------------------------------------\n''' https://matthew-brett.github.io/teaching/smoothing_intro.html '''\n\ndef sigma2fwhm(sigmaa):\n\treturn sigmaa * np.sqrt(8 * np.log(2))\n\n\ndef fw...
[ [ "numpy.log", "numpy.zeros", "numpy.sum", "numpy.exp", "numpy.sqrt" ] ]
johnrbnsn/Composite-Plate
[ "aa59af3d8cde768ead8212c75f45846e80030e4a" ]
[ "composite_plate/classical_plate_theory_test.py" ]
[ "import unittest\nimport numpy as np\nfrom classical_plate_theory import Ply, InputError, Laminae, Laminate\n\nclass TestCompositePlateClasses(unittest.TestCase):\n \"\"\" Defines a series of tests for the CompositePlate Module\n \n \"\"\"\n def test_ply_E1_value(self):\n \"\"\" Checks to see if ...
[ [ "numpy.max", "numpy.matrix", "numpy.power", "numpy.abs", "numpy.nanmax" ] ]
RevanMacQueen/LearningFromHumans
[ "2a899f103a329dba17ea132ce4de167da3f34752" ]
[ "lfh/envs/atari.py" ]
[ "import numpy as np\nfrom collections import deque\nimport gym\nfrom gym import spaces\nimport cv2\ncv2.ocl.setUseOpenCL(False)\n# from dqn.environment.monitor import Monitor\n\nclass NoopResetEnv(gym.Wrapper):\n def __init__(self, env, noop_max=30):\n \"\"\"Sample initial states by taking random number o...
[ [ "numpy.concatenate", "numpy.sign", "numpy.zeros" ] ]
mark-nick-o/mavlink_experiments
[ "a9e6d4a87ef7c8e58ad36ece2533b3fecb39dbb1" ]
[ "newtests/250222_hb4.py" ]
[ "# ===============================================================================================================================\r\n#\r\n# Name : mavlinkSonyCamWriteVals.py\r\n# Desc : Global memory value class for use to write mavlink to sony cam\r\n# Auth : AIR-obots Ai-Robots\r\n#\r\n# ========================...
[ [ "numpy.fromfile", "numpy.array", "numpy.dtype", "numpy.zeros" ] ]
wjsutton/tableau_public_api
[ "db7f2c32c460aefaf54e58734b1de59e417df56e" ]
[ "Python/example_profile_call.py" ]
[ "# TO DO \n# Parse out profile address data fields\n# can take options: country, state, city but each can also be empty but not quoted\n\n\nimport json\nimport urllib3\nimport pandas as pd\n\nhttp = urllib3.PoolManager()\n\nyour_username = 'wjsutton'\nprofile_call = \"https://public.tableau.com/profile/api/\" + you...
[ [ "pandas.concat", "pandas.merge", "pandas.json_normalize" ] ]
josemarioqv/FS0741-DynamicalSystems-FractalGeometry
[ "e59f7df0fad6c3aeac8c9e654dcbc13e7985ca9b" ]
[ "Second_Exam/fern.py" ]
[ "import numpy as np\nimport random\nimport pyglet\n\n\nclass Fern():\n\n def __init__(self):\n self.W = np.array([[[0., 0.], [0., 0.4]],\n [[0.85, 0.04], [-0.04, 0.85]],\n [[0.2, -0.26], [0.23, 0.22]],\n [[-0.15, 0.28], [0.25, 0.24...
[ [ "numpy.array", "numpy.dot" ] ]
liujiawen-jpg/shifu
[ "b018b07b3c8a04722b7761b0aceeaed261d19e5f" ]
[ "dispose.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\nimport glob\r\nimport numpy as np\r\n\r\n\r\npath=glob.glob('nose_vector_45_nor')\r\ndir_list = glob.glob(f'{path[0]}/*')\r\nfor d in dir_list:\r\n file_list=glob.glob(f'{d}/*.txt')\r\n for file in file_list:\r\n name=file.split('\\\\')[-1]\r\n point_arr=[]\r\n ...
[ [ "numpy.max", "numpy.array", "numpy.min" ] ]
mathematiguy/stylized-neural-painting
[ "97de8a22c8146fbef0bc7b9e75bb54b937521a45" ]
[ "imitator.py" ]
[ "import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\nimport os\r\n\r\nimport utils\r\nimport loss\r\nfrom networks import *\r\n\r\nimport torch\r\nimport torch.optim as optim\r\nfrom torch.optim import lr_scheduler\r\nimport torch.nn as nn\r\n\r\nimport renderer\r\n\r\n\r\n# Decide which device w...
[ [ "numpy.concatenate", "numpy.array", "numpy.clip", "torch.optim.lr_scheduler.StepLR", "matplotlib.pyplot.imsave", "torch.nn.functional.interpolate", "numpy.mean", "torch.cuda.is_available", "numpy.append", "numpy.mod" ] ]
lukovnikov/transformer_generalization
[ "a538bfbba6877cd7a21e710f2535df2e9236ba52" ]
[ "layers/transformer/multi_head_attention.py" ]
[ "import torch\nimport torch.nn\nimport torch.nn.functional as F\nimport math\nfrom typing import Optional, Callable, List, Union, Tuple\nfrom dataclasses import dataclass\n\n\n@dataclass\nclass AttentionMask:\n src_length_mask: Optional[torch.Tensor]\n position_mask: Optional[torch.Tensor]\n\n\nclass MultiHea...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.init.xavier_uniform_", "torch.bmm", "torch.nn.functional.softmax" ] ]
Daedalos/statsmodels
[ "f67fc16d581767c030b6f191cf650c3a69d9ed5d" ]
[ "statsmodels/discrete/tests/test_discrete.py" ]
[ "\"\"\"\nTests for discrete models\n\nNotes\n-----\nDECIMAL_3 is used because it seems that there is a loss of precision\nin the Stata *.dta -> *.csv output, NOT the estimator for the Poisson\ntests.\n\"\"\"\n# pylint: disable-msg=E1101\nfrom statsmodels.compat.pandas import assert_index_equal\n\nimport os\nimport ...
[ [ "numpy.testing.assert_allclose", "numpy.dot", "numpy.exp", "numpy.size", "numpy.cumsum", "numpy.random.random", "pandas.read_csv", "numpy.bincount", "numpy.log", "pandas.DataFrame", "numpy.random.poisson", "numpy.eye", "numpy.random.randint", "numpy.arange",...
nci/drish
[ "89cd8b740239c5b2c8222dffd4e27432fde170a1" ]
[ "bin/assets/scripts/unet3Plus/unet_collection/layer_utils.py" ]
[ "from __future__ import absolute_import\n\nfrom tensorflow.keras.layers import MaxPooling2D, MaxPooling3D, AveragePooling2D, AveragePooling3D, UpSampling2D, UpSampling3D, Conv2DTranspose, Conv3DTranspose, GlobalAveragePooling2D, GlobalAveragePooling3D\nfrom tensorflow.keras.layers import Conv2D, DepthwiseConv2D, Co...
[ [ "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Conv3D" ] ]
Sean-Bin-Yang/TPR
[ "5a36bbe032d65a08a5f84695eccce7441723d267" ]
[ "embed/embedding.py" ]
[ "import torch.nn as nn\nimport torch\n\n\nclass PathEmbedding(nn.Module):\n \n def __init__(self, node2vec, dropout=0.1):\n \n super().__init__()\n\n self.path_embed = nn.Embedding.from_pretrained(node2vec) \n \n\n # self.rt = nn.Embedding(21, 64) ##road type\n # self....
[ [ "torch.nn.Embedding.from_pretrained", "torch.nn.Dropout" ] ]
cwwang15/neural_network_cracking
[ "2bb89da599ca0f30d868ca26ab284d559b56d301" ]
[ "setup.py" ]
[ "from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Distutils import build_ext\nimport numpy\n\nsetup(\n cmdclass = { 'build_ext': build_ext },\n version = '0.0.1',\n ext_modules = [Extension(\"generator\", [\"pwd_guess_ctypes.pyx\"],\n incl...
[ [ "numpy.get_include" ] ]
JohanMabille/proteus
[ "6307c442a74471945a688efe4cfeb347bdd765ca" ]
[ "proteus/tests/SWFlow/seawall.py" ]
[ "from __future__ import division\nfrom builtins import object\nfrom past.utils import old_div\nfrom proteus.mprans import (SW2DCV, GN_SW2DCV)\nfrom proteus.Domain import RectangularDomain, PlanarStraightLineGraphDomain\nimport numpy as np\nfrom proteus import (Domain, Context, MeshTools as mt)\nfrom proteus.Profili...
[ [ "numpy.cosh", "numpy.tanh", "numpy.piecewise", "numpy.sqrt" ] ]
steliosploumpis/menpo
[ "473bfc83ce027e8be3290daba31914f54ef84e6e" ]
[ "menpo/shape/mesh/textured.py" ]
[ "import numpy as np\n\nfrom menpo.shape import PointCloud\nfrom menpo.transform import tcoords_to_image_coords\n\nfrom ..adjacency import mask_adjacency_array, reindex_adjacency_array\nfrom .base import TriMesh, grid_tcoords\n\n\nclass TexturedTriMesh(TriMesh):\n r\"\"\"\n Combines a :map:`TriMesh` with a tex...
[ [ "numpy.all", "numpy.clip" ] ]
ciaranmccormick/mm-transcription-server
[ "d7e44756beb703bf24a7a2bfe2cdfeaae8a6b49d" ]
[ "transcript/models.py" ]
[ "from django.conf import settings\nfrom django.contrib.auth.models import User\nfrom django.db import models\nfrom django.db.models.signals import post_save\nfrom django.dispatch import receiver\nfrom rest_framework.authtoken.models import Token\nimport numpy as np\nimport numpy.random as nprand\nimport random\n\n\...
[ [ "numpy.ceil" ] ]
jerinka/LSTM_Video_classifier
[ "46dd9f8bf6f4cc00619a4ee7108fd5d0e3896269" ]
[ "getdata.py" ]
[ "import numpy as np\nimport random\n\n\n# generate the next frame in the sequence\ndef next_frame(last_step, last_frame, column):\n # define the scope of the next step\n lower = max(0, last_step-1)\n upper = min(last_frame.shape[0]-1, last_step+1)\n # choose the row index for the next step\n step = r...
[ [ "numpy.array", "numpy.zeros" ] ]
hoangdzung/pygcn
[ "71276e6361e8f004c3d221e953730de08a414e1f" ]
[ "pygcn/classify.py" ]
[ "from __future__ import print_function\nimport os\nfrom sklearn.linear_model import LogisticRegression\nfrom collections import defaultdict\nimport pdb\nimport numpy\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.metrics import f1_score, accuracy_score\nfrom sklearn.preprocessing import MultiLabe...
[ [ "numpy.asarray", "numpy.random.seed", "sklearn.metrics.f1_score", "sklearn.metrics.accuracy_score", "sklearn.linear_model.LogisticRegression", "numpy.random.get_state", "sklearn.preprocessing.MultiLabelBinarizer", "numpy.random.set_state" ] ]
QuTech-Delft/qilib
[ "a87892f8a9977ed338c36e8fb1e262b47449cf44" ]
[ "src/tests/unittests/data_set/test_mongo_data_set_io.py" ]
[ "import unittest\nfrom collections import namedtuple\nfrom unittest.mock import patch, MagicMock, call\n\nimport numpy as np\nfrom bson import ObjectId\nfrom pymongo.errors import DuplicateKeyError\n\nfrom qilib.data_set import MongoDataSetIO\nfrom qilib.data_set.mongo_data_set_io import DocumentNotFoundError, Fiel...
[ [ "numpy.ndarray", "numpy.issubdtype" ] ]
gayatrichitturi/-Building-Detection-
[ "aaa14983cb7e03939d6736605a7cb13c08ab7f29" ]
[ "utils.py" ]
[ "from sklearn.metrics import jaccard_similarity_score as iou\nimport numpy as np\n\ndef color_map(N=256, normalized=False):\n \"\"\"\n Python implementation of the color map function for the PASCAL VOC data set\n source: https://gist.github.com/wllhf/a4533e0adebe57e3ed06d4b50c8419ae\n \"\"\"\n def bi...
[ [ "sklearn.metrics.jaccard_similarity_score", "numpy.array", "numpy.zeros", "numpy.unique" ] ]
prestigeworldwide7/Create-Your-Own-Image-Classifier-Project
[ "7b794e5416216ff25aa790710b70d0ee173e94e8" ]
[ "predict.py" ]
[ "import argparse\nimport torch\nfrom torch.autograd import Variable\nfrom torchvision import transforms, models\nimport torch.nn.functional as F\nimport numpy as np\nfrom PIL import Image\nimport json\nimport os\nimport random\nfrom utils import load_checkpoint, load_cat_names\n\n\n\ndef parse_args():\n parser =...
[ [ "numpy.int", "torch.no_grad", "torch.nn.functional.softmax" ] ]
kokkiemouse/ml-agents
[ "dd0c901f2391c650b55c7f7d98561d97a2c5e710" ]
[ "ml-agents/mlagents/trainers/tests/test_simple_rl.py" ]
[ "import math\nimport tempfile\nimport pytest\nimport yaml\nimport numpy as np\nfrom typing import Dict, Any\n\nfrom mlagents.trainers.tests.simple_test_envs import (\n SimpleEnvironment,\n MemoryEnvironment,\n RecordEnvironment,\n)\nfrom mlagents.trainers.trainer_controller import TrainerController\nfrom m...
[ [ "numpy.array" ] ]
alexwim/CS263A_Project
[ "f955711a02e4920bf0b7c4fbecfdf00b18e213ec" ]
[ "utils.py" ]
[ "from nltk.tokenize import WordPunctTokenizer\nimport nltk.data\nimport numpy as np\nimport re\nimport os\n\nroot = os.path.dirname(os.path.abspath(__file__))\n\n##################\n# TEXTS INVOLVED #\n##################\n##Alexandre Dumas\n# 0:The Three Musketeers\n# 1:Twenty Years After (D'Artagnan Series: Part T...
[ [ "numpy.random.multinomial", "numpy.exp", "numpy.log" ] ]
googleinterns/multimodal-long-transformer-2021
[ "8161dfd1698967d2eb76a262b46cbf44b9dd4739" ]
[ "src/tasks/classification.py" ]
[ "# 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 agre...
[ [ "tensorflow.keras.metrics.Mean", "tensorflow.keras.metrics.AUC", "tensorflow.train.latest_checkpoint", "tensorflow.GradientTape", "tensorflow.distribute.get_strategy", "tensorflow.sigmoid", "tensorflow.argmax", "tensorflow.reshape", "tensorflow.io.gfile.isdir", "tensorflow....
nflu/softlearning
[ "b4db23ad266f594c891357d9dabe981ecf9bcdea" ]
[ "softlearning/replay_pools/flexible_replay_pool.py" ]
[ "from dataclasses import dataclass\nfrom typing import Union, Callable\nfrom numbers import Number\nimport gzip\nimport pickle\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom flatten_dict import flatten, unflatten\nfrom .replay_pool import ReplayPool\n\n\n@dataclass\nclass Field:\n name: str\n dtype: U...
[ [ "numpy.any", "numpy.arange", "numpy.array", "numpy.random.randint" ] ]
mohanliu/qmpy
[ "4dd7f6206df06213f8cbf335f992c1c54690ef5b" ]
[ "qmpy/analysis/symmetry/routines.py" ]
[ "import fractions as frac\nimport numpy as np\nimport logging\n\nimport qmpy\nif qmpy.FOUND_SPGLIB:\n import pyspglib._spglib as spg\n\nimport qmpy.data as data\nfrom qmpy.utils import *\n\nlogger = logging.getLogger(__name__)\n\nif not qmpy.FOUND_SPGLIB:\n logger.critical('Must install spglib to be able to d...
[ [ "numpy.array", "numpy.transpose", "numpy.zeros" ] ]
KonstantinWilleke/lucent
[ "4809cf3429316ad97847d883a4257bf07042e242" ]
[ "lucent/optvis/objectives.py" ]
[ "# Copyright 2020 The Lucent Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required...
[ [ "torch.nn.functional.normalize", "numpy.zeros", "torch.no_grad", "torch.cuda.is_available", "numpy.arange", "torch.tensor", "torch.ones_like", "torch.transpose", "torch.nn.CosineSimilarity", "torch.nn.functional.conv2d", "torch.sum" ] ]
wjmaddox/online_gp
[ "3bff4c347263a9b8b1f0aa801a986f4aaa019a66" ]
[ "online_gp/utils/data.py" ]
[ "import numpy as np\nimport pandas as pd\nimport torch\n\n\ndef get_datasets(name):\n if name == 'banana':\n train_x = pd.read_csv(\n \"https://raw.githubusercontent.com/thangbui/streaming_sparse_gp/master/data/banana_train_x.txt\",\n header=None)\n train_y = pd.read_csv(\n ...
[ [ "numpy.concatenate", "torch.cat", "numpy.log", "torch.utils.data.random_split", "torch.cuda.is_available", "torch.tensor", "pandas.read_csv", "torch.utils.data.TensorDataset", "pandas.get_dummies" ] ]
IslamAlam/JUMPING-JIVE-Geodetic-Observatory-Wettzell
[ "53fef7a673a4bcdebd249d11016e8f5b0a2a67e0" ]
[ "data/scripts/update_grafana.py" ]
[ "# ! pip install grafana-api\n\nimport os \ndir_path = os.getcwd() #os.path.dirname(os.path.realpath(__file__))\nprint(dir_path)\n\nimport time\nfrom datetime import datetime\nimport pandas as pd\n\nfrom dateutil.relativedelta import relativedelta\nfrom datetime import date, time, timedelta\n\nimport json\n\nfrom g...
[ [ "pandas.read_html" ] ]
dials-src/dials
[ "25055c1f6164dc33e672e7c5c6a9c5a35e870660" ]
[ "src/dials/report/plots.py" ]
[ "\"\"\"\nThis module defines a number of general plots, which may be relevant to\nfor reports of several programs.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport logging\nfrom io import StringIO\n\nimport numpy as np\nfrom scipy.optimize import least_squares\nfrom scipy.stats import norm\n\nfrom cctbx impo...
[ [ "numpy.histogram2d", "scipy.stats.norm.ppf", "numpy.empty", "numpy.nonzero", "numpy.linspace", "scipy.optimize.least_squares" ] ]
daniele21/Stock_Analysis
[ "6f6a936e1ccce80e20143c698f065b7e4637df6b" ]
[ "core/preprocessing/embeddings.py" ]
[ "from tqdm import tqdm\nfrom typing import Dict, Text\nfrom constants.config import EMBEDDING_DIM\nfrom constants.paths import GLOVE_PATH\nimport numpy as np\n\nfrom core.preprocessing.tokenizers import MyTokenizer\n\n\ndef load_pretrained_glove_embeddings(tokenizer: MyTokenizer,\n ...
[ [ "numpy.asarray", "numpy.zeros" ] ]
arknoll/laspy
[ "8b57c38ac3fe666e527406589fa734a50f9ee86a" ]
[ "tests/test_common.py" ]
[ "from pathlib import Path\n\nimport numpy as np\nimport pytest\n\nimport laspy\nfrom laspy.lib import write_then_read_again\nfrom . import conftest\n\nsimple_las = conftest.SIMPLE_LAS_FILE_PATH\nsimple_laz = conftest.SIMPLE_LAZ_FILE_PATH\nvegetation1_3_las = conftest.VEGETATION1_3_LAS_FILE_PATH\ntest1_4_las = conft...
[ [ "numpy.allclose", "numpy.array", "numpy.alltrue" ] ]
wconnell/pytorch-metric-learning
[ "bf2b7675b7b80e5762b75428d51e4ab0a861e710" ]
[ "tests/miners/test_batch_hard_miner.py" ]
[ "import unittest \r\nfrom .. import TEST_DTYPES\r\nimport torch\r\nfrom pytorch_metric_learning.miners import BatchHardMiner\r\nfrom pytorch_metric_learning.utils import common_functions as c_f\r\nimport numpy as np\r\nfrom pytorch_metric_learning.distances import CosineSimilarity, LpDistance\r\n\r\nclass TestBatch...
[ [ "torch.device", "torch.arange", "numpy.radians", "torch.LongTensor", "torch.equal", "torch.randn", "torch.sum" ] ]
shikivi/-
[ "e83cc9342115801e1464e9907a971801dbd68335" ]
[ "Image Inpainting/model/net.py" ]
[ "import torch as t\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom model.basemodel import BaseModel\nfrom model.basenet import BaseNet\nfrom model.loss import WGANLoss, IDMRFLoss\nfrom model.layer import init_weights, PureUpsampling, ConfidenceDrivenMaskLayer, SpectralNorm, GatedConv, GatedDilatedConv...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.clamp", "torch.nn.L1Loss", "torch.from_numpy", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.ReflectionPad2d", "torch.mean" ] ]
janekfleper/RayTracing
[ "bb34f5eb045fe48384f9c937b2a619b31e628110" ]
[ "raytracing/tests/testsExamples.py" ]
[ "import envtest # modifies path\nimport subprocess\nimport matplotlib as mpl\nmpl.use('Agg')\nfrom matplotlib import patches, transforms\nfrom unittest.mock import Mock, patch\n\nfrom raytracing import *\n\nclass TestExamples(envtest.RaytracingTestCase):\n\n def testRegex(self):\n pattern = r'^(ex\\d+|fi...
[ [ "matplotlib.use" ] ]
SimonKleine/ModeDetection
[ "768f7e5dd8b2ce00f34cd6657606ac160ae4d1df" ]
[ "utils/smoothing.py" ]
[ "from abc import ABC\n\nimport numpy as np\nimport more_itertools as mit\n\n\nclass Smoother(ABC):\n def smooth(self, modes):\n pass\n\n\nclass MajorityVoteSmoother(Smoother):\n def __init__(self, num_iterations, window_size, step_size=1):\n self.num_iterations = num_iterations\n self.hal...
[ [ "numpy.concatenate", "numpy.array", "numpy.argmax", "numpy.unique" ] ]
NCAS-CMS/cfdm
[ "8e6ac54c1a2966ad5c07cd51ef609005a1fd70cc" ]
[ "cfdm/cellmethod.py" ]
[ "import logging\nfrom copy import deepcopy\n\nimport numpy\n\nfrom . import core, mixin\nfrom .data import Data\nfrom .decorators import _manage_log_level_via_verbosity\n\nlogger = logging.getLogger(__name__)\n\n\nclass CellMethod(mixin.Container, core.CellMethod):\n \"\"\"A cell method construct of the CF data ...
[ [ "numpy.argsort" ] ]
ryan-jonesford/Semantic-Segmentation
[ "ca891cb6c4e1aecf0736d28936edaa11f1fcb474" ]
[ "helper.py" ]
[ "import re\nimport random\nimport numpy as np\nimport os.path\nimport scipy.misc\nimport shutil\nimport zipfile\nimport time\nimport tensorflow as tf\nfrom glob import glob\nfrom urllib.request import urlretrieve\n\n\ndef maybe_download_pretrained_vgg(data_dir):\n \"\"\"\n Download and extract pretrained vgg ...
[ [ "numpy.all", "numpy.invert", "numpy.array", "tensorflow.nn.softmax" ] ]
NapITlab/lncRNAmiRNA
[ "f241383ed7e23e9807137c1efb3f03cc04a9695a" ]
[ "lncRNAmiRNA/lncRNAmiRNA_model/utils/util_utils.py" ]
[ "import datetime\nimport json\nimport logging\nimport os\nimport sys\nimport time\nimport traceback\n\nimport pandas as pd\nfrom django.conf import settings\nfrom rest_framework.response import Response\n\nlogger = logging.getLogger(\"lncRNAmiRNA_model\")\ntelegram_logger = logging.getLogger(\"lncRNAmiRNA_model.tel...
[ [ "pandas.read_csv" ] ]