repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
goncaloasimoes/net-pro-sim | [
"77f766661229327df16bef1e6813152e02350459"
] | [
"src/DataProcessing/VisualizeCommunities.py"
] | [
"from . import Visualize #pylint: disable=relative-beyond-top-level\nimport networkx as nx\nfrom matplotlib import lines\nfrom scipy.spatial import Voronoi, voronoi_plot_2d\nimport numpy as np\n\n# TODO: Needs to be retested and fixed.\n''' Visualize or save images of the network with its various communities repres... | [
[
"matplotlib.lines.Line2D",
"scipy.spatial.Voronoi",
"numpy.any",
"numpy.asarray",
"numpy.all",
"numpy.array",
"numpy.dot",
"numpy.linalg.norm"
]
] |
janvonrickenbach/Chaco_wxPhoenix_py3 | [
"21a10cfd81100f28e3fbc273357ac45642519f33"
] | [
"chaco/ticks.py"
] | [
"#-------------------------------------------------------------------------------\r\n#\r\n#\r\n# Written by: David C. Morrill (based on similar routines written by Eric Jones)\r\n#\r\n# Date: 2007-05-01\r\n#\r\n# (c) Copyright 2002-7 by Enthought, Inc.\r\n#\r\n#---------------------------------------------------... | [
[
"numpy.ceil",
"numpy.concatenate",
"numpy.floor",
"numpy.argsort",
"numpy.arange",
"numpy.log10",
"numpy.shape",
"numpy.array",
"numpy.minimum.reduce",
"numpy.finfo"
]
] |
slowy07/keras | [
"d3688b72924a4235598f0f80038de8c897f44799"
] | [
"keras/saving/saved_model/serialized_attributes.py"
] | [
"# Copyright 2018 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.compat.v2.__internal__.tracking.AutoTrackable"
]
] |
jackromo/GSOCMcgillApplication | [
"769fdb2529008f7812a90ce7aba306e2bc630203"
] | [
"mcgill_app/graphs.py"
] | [
"\"\"\"\n.. module:: graphs\n :synopsis: All graph plotting and creation facilities.\n\n.. moduleauthor:: Jack Romo <sharrackor@gmail.com>\n\n\"\"\"\n\nfrom __future__ import division\nimport matplotlib.pyplot as plt\n\n\nclass FunctionsGraph(object):\n \"\"\"\n A graph that wraps around matplotlib.pyplot ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
jshi31/NAFAE | [
"3421070d966877bbeb33d2d9b26a9d755a178589"
] | [
"lib/model/transformer/Modules.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport numpy as np\nimport pdb\n\n__author__ = \"Yu-Hsiang Huang\"\n\nclass Linear(nn.Module):\n ''' Simple Linear layer with xavier init '''\n def __init__(self, d_in, d_out, bias=True):\n super(Linear, self).__init__()\n self.... | [
[
"torch.ones",
"torch.nn.Linear",
"torch.std",
"torch.nn.init.xavier_normal",
"numpy.power",
"torch.zeros",
"torch.bmm",
"torch.nn.Dropout",
"torch.mean"
]
] |
jgollub1/tennis_match_prediction | [
"1ccf0ecd5ddb5d98da2d3610e4890fcab844dfcc"
] | [
"src/data_functions.py"
] | [
"import os\nimport sys\n\nsys.path.insert(0, './sackmann')\n\nimport re\nimport datetime\nimport numpy as np\nimport pandas as pd\nimport elo_538 as elo\nfrom tennisMatchProbability import matchProb\nfrom processing_util import normalize_name\nfrom data_classes import stats_52, adj_stats_52, tny_52, commop_stats\nf... | [
[
"numpy.sum",
"numpy.intersect1d",
"numpy.nanvar",
"numpy.nan_to_num",
"numpy.nanmean",
"numpy.random.choice",
"pandas.to_datetime",
"numpy.isnan",
"numpy.where",
"numpy.unique",
"numpy.mean",
"numpy.zeros",
"pandas.read_csv",
"pandas.concat",
"numpy.divi... |
microsoft/aaai21-copy-that | [
"7dfb2ebabbbf1165a33c2430ef2f2571e487b4fd"
] | [
"model/tests/copyspan_seq2seq_synth_edits.py"
] | [
"import logging\r\nimport random\r\n\r\nimport numpy as np\r\n\r\nfrom dpu_utils.utils import run_and_debug, RichPath\r\n\r\nfrom data.representationviz import RepresentationsVisualizer\r\nfrom data.synthetic.charedits import get_dataset\r\nfrom editrepcomponents.alignededitencoder import AlignedEditTokensEmbedding... | [
[
"numpy.array",
"numpy.random.seed"
]
] |
kvenkman/hummingbird | [
"b8ec670b3c90ec7e87d3ae4a2b268075bd5eae65"
] | [
"tests/test_sklearn_linear_converter.py"
] | [
"\"\"\"\nTests sklearn linear classifiers (LinearRegression, LogisticRegression, SGDClassifier, LogisticRegressionCV) converters.\n\"\"\"\nimport unittest\nimport warnings\n\nimport numpy as np\nimport torch\nfrom sklearn.linear_model import LinearRegression, LogisticRegression, SGDClassifier, LogisticRegressionCV\... | [
[
"sklearn.linear_model.SGDClassifier",
"sklearn.linear_model.LinearRegression",
"numpy.random.seed",
"sklearn.linear_model.LogisticRegressionCV",
"numpy.random.rand",
"sklearn.linear_model.LogisticRegression",
"numpy.array",
"numpy.random.randint",
"sklearn.datasets.load_iris"
... |
paminco/paminco | [
"2b8da7cc83adde3c72af5150cf6d7294ff6fd29e"
] | [
"paminco/net/tests/test_cost.py"
] | [
"import pytest\nimport numpy as np\n\nfrom itertools import zip_longest\n\nfrom paminco.net import load_sioux\nfrom paminco.net._data_gas import temporary_gas_files\nfrom paminco.net._data_examples import (NET_SIMPLE_POLYNOMIAL,\n NET_ELECTRICAL_PIECEWISE)\nfrom paminco.net.net... | [
[
"numpy.allclose",
"numpy.random.default_rng",
"numpy.arange",
"numpy.random.random",
"numpy.array_equal",
"numpy.array",
"numpy.concatenate",
"numpy.random.randint",
"numpy.full"
]
] |
duboviy/misc | [
"4cd8cbcf12fc29dd2f12699fbd2f3dd738b5e4b5"
] | [
"hist.py"
] | [
"\"\"\" Horizontal histogram plotting function. \"\"\"\n\nfrom __future__ import absolute_import\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef horizontal_hist(items, title=None, axis_label=None, color=None, height=10, width=20, reverse=False):\n \"\"\"\n Plots a histogram of values and frequen... | [
[
"numpy.unique",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.xlabel"
]
] |
takaratruong/emergent-generalization | [
"20de15ee6514dba48b48c76d8cd9289d62966932"
] | [
"code/train.py"
] | [
"\"\"\"\nTrain an RNN decoder to make binary predictions;\nthen train an RNN language model to generate sequences\n\"\"\"\n\n\nimport contextlib\nfrom collections import defaultdict\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nimport models\nimport util\nimport data\nim... | [
[
"torch.set_grad_enabled",
"pandas.DataFrame",
"numpy.random.choice",
"pandas.DataFrame.from_records",
"pandas.concat",
"torch.zeros",
"numpy.where",
"torch.cat",
"numpy.unique",
"numpy.mean"
]
] |
NEISSproject/tf_neiss | [
"50df6153d0d1f5d471dd9ec0bc52617805001f79"
] | [
"model_fn/model_fn_nlp/util_nlp/graphs_pos.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\nfrom model_fn.graph_base import GraphBase\nfrom model_fn.model_fn_nlp.util_nlp.attention import Selfattention, MultiHeadAttention\nfrom model_fn.model_fn_nlp.util_nlp.transformer import EncoderLayer, Encoder, Decoder\nimport model_fn.model_fn_nlp.util_nlp.graphs_bert_... | [
[
"tensorflow.math.equal",
"tensorflow.reduce_max",
"tensorflow.shape",
"tensorflow.train.get_checkpoint_state",
"tensorflow.ones",
"tensorflow.keras.layers.Softmax",
"numpy.cos",
"numpy.float32",
"numpy.arange",
"tensorflow.cast",
"tensorflow.train.latest_checkpoint",
... |
Twizwei/maskrcnn_detector | [
"095584f813acb40c937672ff5b63603d40095a2a"
] | [
"build/lib.linux-x86_64-3.6/maskrcnn_benchmark/engine/inference.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport datetime\nimport logging\nimport tempfile\nimport time\nimport os\nimport json\nfrom collections import OrderedDict\n\nimport torch\n\nfrom tqdm import tqdm\n\nfrom ..utils.comm import is_main_process\nfrom ..utils.comm import scatter_... | [
[
"torch.distributed.deprecated.get_world_size",
"torch.no_grad",
"torch.device",
"torch.distributed.deprecated.is_initialized"
]
] |
pyrooka/pathfinder | [
"c6226e1f02ef8471ddc42e1c19afde39dbb8c4ec"
] | [
"path_finder.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n/***************************************************************************\n PathFinder\n A QGIS plugin\n Find the shortest path between two points in a raster image.\n -------------------\n begin ... | [
[
"numpy.copy"
]
] |
llbxg/NIST-SP-800-22 | [
"7e82243643b62fdc07cbe5f40d540b0a16a4372a"
] | [
"tests/t_05_binary_matrix_rank_test.py"
] | [
"import math\n\nimport numpy as np\nimport scipy.special as sc\n\nfrom tests.src.utils import split_list, __print\nfrom tests.src.rakn import rank\n\n# .5 Binary Matrix Rank Test\ndef binary_matrix_rank_test(key, n, M=32, Q=32, b_print=True):\n if n < 38912:\n __print(b_print, '{:40} : Error. Need at leas... | [
[
"numpy.array"
]
] |
usamaahsan93/Perceptron | [
"27dbcefe39f5bd61f30a66887abd810bb59c9b2c"
] | [
"myPerceptron.py"
] | [
"import numpy as np\nfrom numpy.random import randn\n\n#This function is taken from Dr Fayyaz ul Amir Afsar Minhas (Github User: foxtrotmike)\ndef getExamples(n=100,d=2):\n \"\"\"\n Generates n d-dimensional normally distributed examples of each class \n The mean of the positive class is [1] and for... | [
[
"numpy.vstack",
"numpy.sign",
"numpy.random.randn",
"numpy.random.random",
"numpy.array"
]
] |
barbagroup/pygbe_validation_paper | [
"ef826a8e956a817f919c4357a08aa8f675a910a4"
] | [
"repro_packs/rockstuhl/repro_exec_files/scripts/cext_wave_prism_34K_SE.py"
] | [
"import numpy\nimport time\nimport sys\nimport os\nfrom argparse import ArgumentParser\n\nimport pygbe\nfrom pygbe.util.read_data import read_fields\nfrom pygbe.main import main\n\nfrom cext_wavelength_scanning import create_diel_list, Cext_wave_scan, Cext_analytical\n\n\ndef read_inputs(args):\n \"\"\"\n Par... | [
[
"numpy.loadtxt"
]
] |
khdlr/PyQtImageViewer | [
"0f41c10684915bd6ed8db6ce5fb5a783d7bc5889"
] | [
"ViewGeoTIFF.py"
] | [
"#!/usr/bin/env python\n\"\"\" ViewGeoTIFF.py: PyQt image viewer widget for a QPixmap in a QGraphicsView scene with mouse zooming and panning.\n\n\"\"\"\n\nimport os.path\ntry:\n from PyQt5.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR\n from PyQt5.QtGui import QImage, QPixmap, QPainterPath\n from P... | [
[
"numpy.stack",
"numpy.clip"
]
] |
tongni1975/stackup-workshops | [
"d83f1d5adcc0b133b10e22d1db295020af967bac"
] | [
"pi-pytorch/tutorials/rnn/data.py"
] | [
"import numpy as np\nimport math, random\n\n# Generate a noisy multi-sin wave \ndef sine_2(X, signal_freq=60.):\n return (np.sin(2 * np.pi * (X) / signal_freq) + np.sin(4 * np.pi * (X) / signal_freq)) / 2.0\n\ndef noisy(Y, noise_range=(-0.05, 0.05)):\n noise = np.random.uniform(noise_range[0], noise_range[1],... | [
[
"numpy.random.uniform",
"numpy.sin",
"numpy.arange"
]
] |
victorfariassb/ministros_mencao_estado | [
"cf490a09aef646d68a399700a9a7b6cdfef18f54"
] | [
"contagem_palavras_especificas.py"
] | [
"import pandas as pd\r\n\r\nestados = ['acre|ac', 'alagoas|al', 'amapá|ap', 'amazonas|am', 'bahia|ba', 'ceará|ce', 'espírito santo|es', 'goiás|go', 'maranhão|ma', 'mato grosso|mt', 'mato grosso do sul|ms', 'goiás|go',\r\n 'maranhão|ma', 'minas gerais|mg', 'pará|pa', 'paraíba|pb', 'paraná|pr', 'pernambuco|... | [
[
"pandas.read_csv"
]
] |
tkf/matplotlib | [
"5b90a27aeda308a7dcbf70d5cc7a0612b3bb41e5"
] | [
"lib/matplotlib/tests/test_transforms.py"
] | [
"from __future__ import print_function\nfrom nose.tools import assert_equal\nfrom numpy.testing import assert_almost_equal\nfrom matplotlib.transforms import Affine2D, BlendedGenericTransform\nfrom matplotlib.path import Path\nfrom matplotlib.scale import LogScale\nfrom matplotlib.testing.decorators import cleanup\... | [
[
"numpy.testing.assert_almost_equal",
"numpy.allclose",
"matplotlib.pyplot.draw",
"matplotlib.transforms.Affine2D",
"matplotlib.pyplot.axes",
"matplotlib.scale.LogScale.Log10Transform",
"matplotlib.path.Path",
"numpy.array",
"matplotlib.transforms.Transform.__init__",
"matpl... |
PartumSomnia/bns_ppr_tools | [
"b02bab870bb54171bc0d0cd7e07bfb50e978e7dd"
] | [
"module_ejecta/ejecta_formulas.py"
] | [
"\nimport numpy as np\n\nclass FORMULAS:\n\n @staticmethod\n def vinf(eninf):\n return np.sqrt(2. * eninf)\n\n @staticmethod\n def vinf_bern(eninf, enthalpy):\n return np.sqrt(2.*(enthalpy*(eninf + 1.) - 1.))\n\n @staticmethod\n def vel(w_lorentz):\n return np.sqrt(1. - 1. / (... | [
[
"numpy.sqrt"
]
] |
mjirik/wsicolorfilter | [
"85f8f3705d21065781d49d0b700ab162e9063870"
] | [
"wsicolorfilter/svm_filter.py"
] | [
"import pickle as plk\n\nfrom sklearn import svm\n\nfrom wsicolorfilter.filter import Filter\n\n\nclass SvmFilter(Filter):\n \"\"\"Filter which assign each pixel to the nearest centroid of the model.\"\"\"\n\n def create_model(self):\n return svm.LinearSVC()\n\n def train_model(self, x, y):\n ... | [
[
"sklearn.svm.LinearSVC"
]
] |
idzol/battlesnake | [
"3d94e70143d4d5f1cffd79fe6b84b59e1cb4864b"
] | [
"_tests/test_interrupt.py"
] | [
"from typing import List, Dict\n\nimport math\nimport operator\nfrom operator import add\n\nimport random as rand\nimport numpy as np\n# import pandas as pd\n# import random as rand\nimport copy as copy\n\nimport time as time\nfrom logClass import log\n\nimport constants as CONST\nimport functions as fn\n\nfrom sna... | [
[
"numpy.where",
"numpy.zeros"
]
] |
travers-rhodes/deepmind-research | [
"59bace8e09b31686f1a4d4bd642c47388bc230fb"
] | [
"iodine/main.py"
] | [
"# Lint as: python3\n# Copyright 2019 Deepmind Technologies Limited.\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# Unles... | [
[
"tensorflow.compat.v1.train.Saver",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.summary.scalar",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.global_norm",
"tensorflow.compat.v1.train.MonitoredTrainingSession",
"tensorflow.compat.v1.train.StopAtStepHook",
"te... |
ypark234/openmc | [
"571ed3b6ab449e555fc9c8452106425d26b19bd3"
] | [
"openmc/volume.py"
] | [
"from collections import OrderedDict\nfrom collections.abc import Iterable, Mapping\nfrom numbers import Real, Integral\nfrom xml.etree import ElementTree as ET\nimport warnings\n\nimport numpy as np\nimport pandas as pd\nimport h5py\nfrom uncertainties import ufloat\n\nimport openmc\nimport openmc.checkvalue as cv... | [
[
"pandas.DataFrame.from_records",
"numpy.all",
"numpy.asarray",
"numpy.isinf"
]
] |
neevparikh/lwm | [
"ec8d27f6c011a732aa58ae04cba66a5bac68f8f8"
] | [
"atari/dqn/prepare_obs.py"
] | [
"import torch\n\n\ndef prepare_obs(obs, done, fstack):\n assert obs.dtype == torch.uint8\n assert obs.shape[2] == 1\n\n if fstack > 1:\n obs = stack_frames(obs, fstack)\n done_stacked = stack_frames(done, fstack)\n obs = obs * obs_mask(done_stacked)\n return obs.float() / 128 - 1\n\... | [
[
"torch.empty",
"torch.ones_like"
]
] |
ssense-ai/gitpod-heroku-python-ai-1 | [
"9d33cf2d8bcced448affcf39f86abde291e7e0b3"
] | [
"build_model.py"
] | [
"import numpy as np\nimport pandas as pd\n\n#データ分割用\nfrom sklearn.model_selection import train_test_split\n\n#LightGBM\nimport lightgbm as lgb\n\n#pickle\nimport pickle\n\n#データ読み込み\ndf_train = pd.read_csv(\"train.csv\")\ndf_test = pd.read_csv(\"test.csv\")\n\n#データ結合\ndf_train[\"TrainFlag\"] = True\ndf_test[\"TrainF... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"pandas.get_dummies"
]
] |
Aletechdev/mutil | [
"30339f409723a2288c0e3575d466529555961305"
] | [
"test_gene.py"
] | [
"import pandas as pd\nfrom gene import get_gene_bnum\n\ndf = pd.DataFrame.from_dict(\n {'OBJECT_ID': ['ECK120000001'],\n 'OBJECT_SYNONYM_NAME': ['b4053'],\n 'OS_INTERNAL_COMMENT': [None],\n 'KEY_ID_ORG': ['ECK12']}, orient=\"columns\")\n\nassert(get_gene_bnum(\"ECK120000001\", df) == \"b4053\")\n\npr... | [
[
"pandas.DataFrame.from_dict"
]
] |
amolmore3171/flaskoythonheatmapapp | [
"f80e62d8bed0e352b8a6bd5241839f0695573752"
] | [
"GDO_events.py"
] | [
"from __future__ import print_function\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport pandas as pd\nimport io\nfrom flask import Flask, make_response\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\n\n\napp = Flask(__name__)\n\n\n@app.route('/plot.png')\ndef... | [
[
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.subplots",
"matplotlib.dates.WeekdayLocator",
"matplotlib.backends.backend_agg.FigureCanvasAgg"
]
] |
dekelmeirom/pathologylab | [
"262b0bd9cb9233bc960671c2d674cf895b228f39"
] | [
"algo/PDL1Net/cell_count.py"
] | [
"import cv2\nimport numpy as np\nimport copy\nimport algo.mrcnn.visualize_pdl1 as vis_pdl1\n\nclass_names = {\"INFLAMMATION\": 1, \"NEGATIVE\": 2, \"POSITIVE\": 3, \"OTHER\": 4}\n\n\ndef gamma_correction(img, gammas):\n \"\"\"\n apply gamma correction on the given image.\n allow different gamma for each co... | [
[
"numpy.broadcast_to",
"numpy.ones",
"numpy.logical_and",
"numpy.zeros"
]
] |
eulerlab/QDSpy | [
"29f0fd118cca7b86925f3a0187f64f0f2560aedc"
] | [
"QDSpy_core_presenter.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nQDSpy module - interprets and presents compiled stimuli\n\n'Presenter' \n Presents a compiled stimulus. \n This class is a graphics API independent.\n \nCopyright (c) 2013-2016 Thomas Euler\nDistributed under the terms of the GNU General Public License (GPL... | [
[
"numpy.array",
"numpy.zeros"
]
] |
yihui-lai/coffea | [
"351cc727845ab83a8e31a193dc06e534bedb97fe"
] | [
"coffea/jetmet_tools/CorrectedMETFactory.py"
] | [
"from coffea.jetmet_tools.JECStack import JECStack\nimport awkward\nimport numpy\nimport warnings\nfrom copy import copy\n\n\nclass CorrectedMETFactory(object):\n\n def __init__(self, name_map):\n if 'xMETRaw' not in name_map or name_map['xMETRaw'] is None:\n warnings.warn('There is no name map... | [
[
"numpy.arctan2",
"numpy.hypot"
]
] |
vishalbelsare/classifications | [
"e16dbc9b625ff7e233be30bfb3d432f7b026facd"
] | [
"product/HS/IntlAtlas/clean.py"
] | [
"import pandas as pd\nimport sys\n\nsys.path.append(\"../../..\")\nfrom classification import (\n Hierarchy,\n repeated_table_to_parent_id_table,\n parent_code_table_to_parent_id_table,\n spread_out_entries,\n sort_by_code_and_level,\n Classification,\n)\n\n\ndef get_hs_services(file=\"./in/Servic... | [
[
"pandas.read_csv",
"pandas.read_table"
]
] |
zhouzach/spark | [
"ad77b400da4089a2de74394e2b8aed813633025a"
] | [
"python/pyspark/ml/clustering.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"numpy.set_printoptions"
]
] |
atomicoo/EnhanceIMG | [
"8c009fbb6c5461ff6d7f30bdacec72232639c7f2"
] | [
"awegan/options/base_options.py"
] | [
"import argparse\nimport os, sys\nfrom abc import ABC, abstractmethod\n\nimport torch\nimport models\nimport datasets\n\n\nclass BaseOptions(ABC):\n \"\"\"This class is an abstract base class (ABC) for options.\n To create a subclass, you need to implement the following five functions:\n -- <__init__>:... | [
[
"torch.cuda.set_device"
]
] |
zhunzhong/audio-sync-kit | [
"abe826334ef4cf0a3e6809877584b6aa243140d7"
] | [
"audio_sync/cli.py"
] | [
"# Copyright 2016 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 ... | [
[
"numpy.mean"
]
] |
dhill2522/OPTIONS | [
"f5058e39bef204a53991b275d79f2d7223ff2d61"
] | [
"Class1_Eq.py"
] | [
"\"\"\"\r\nCreated on Mon Nov 05 03:52:36 2018\r\n@author: Paul\r\n\"\"\"\r\n\r\n### Boiler-Plate ###\r\nfrom threading import Thread\r\nimport matplotlib.pylab as plt\r\nimport numpy as np\r\nimport scipy as sp\r\nfrom numpy import random\r\nimport time\r\n\r\nfrom Func import *\r\nfrom iapws97 import _PSat_T\r\n\... | [
[
"numpy.sqrt",
"numpy.zeros",
"numpy.log",
"numpy.log10",
"numpy.array"
]
] |
inessus/ai-skills | [
"527f32d49887f06eee357c83bb6a9a21edc69bc5"
] | [
"src/model/pytorch/21-RL/DeepRL-Tutorials/agents/Quantile_Rainbow.py"
] | [
"import numpy as np\n\nimport torch\n\nfrom agents.DQN import Model as DQN_Agent\nfrom networks.network_bodies import SimpleBody, AtariBody\nfrom networks.networks import DuelingQRDQN\nfrom utils.ReplayMemory import PrioritizedReplayMemory\n\nclass Model(DQN_Agent):\n def __init__(self, static_policy=False, env=... | [
[
"torch.zeros",
"torch.no_grad",
"torch.tensor",
"numpy.arange"
]
] |
pedronarloch/jMetalPy_phD | [
"c16a31a65c23a203d439f33a4d99668982e7c25b"
] | [
"jmetal/problem/singleobjective/CEC2013LSGO.py"
] | [
"from cec2013lsgo.cec2013 import Benchmark\nimport numpy as np\nfrom jmetal.core.problem import FloatProblem, S\n\n\nclass CEC2013LSGO(FloatProblem):\n\n def __init__(self, function_type: int = 0, number_of_variables: int = 1000):\n\n super(CEC2013LSGO, self).__init__()\n self.number_of_objectives ... | [
[
"numpy.array"
]
] |
ahmedshahin9/melanoma.1.0 | [
"db6e458ae7376993c0d3fccfe56b7e88b6f936f0"
] | [
"batches.py"
] | [
"import os\nfrom scipy import misc\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom skimage.util import img_as_bool\n\n# this script creates batches from the dataset\n# batch size: 224 * 224 * 3\n# we save the batch and its ground truth in two separate folders \"batches\" , \"batches_ground\n\n\npath = \"... | [
[
"numpy.where",
"numpy.random.randint",
"scipy.misc.imread",
"numpy.delete"
]
] |
jacobboney/featuretools | [
"679aa0c9a3985942ce5278f56353b44c41958907"
] | [
"featuretools/demo/weather.py"
] | [
"import pandas as pd\n\nimport featuretools as ft\n\n\ndef load_weather(nrows=None,\n return_single_table=False):\n '''\n Load the Australian daily-min-temperatures weather dataset.\n\n Args:\n\n nrows (int): Passed to nrows in ``pd.read_csv``.\n return_single_table (bool): Ex... | [
[
"pandas.read_csv"
]
] |
kbschliep/pycroscopy | [
"4f18e7b453aca496e611603616112c1a1a524beb"
] | [
"pycroscopy/io/translators/time_series.py"
] | [
"\"\"\"\nCreated on Feb 9, 2016\n\n@author: Chris Smith\n\"\"\"\n\nfrom __future__ import division, print_function, absolute_import, unicode_literals\n\nimport os\n\nimport numpy as np\nfrom skimage.measure import block_reduce\nimport h5py\n\nfrom .df_utils.dm_utils import read_dm3\nfrom pyUSID.io.image import read... | [
[
"numpy.mean",
"numpy.arange",
"numpy.sqrt",
"numpy.zeros"
]
] |
UKPLab/conll2019-snopes-experiments | [
"102f4a05cfba781036bd3a7b06022246e53765ad"
] | [
"src/rte_pac/feature_extaction/average_word_embedding.py"
] | [
"from gensim.models import KeyedVectors\nimport numpy as np\nimport nltk\n\n\n# model = KeyedVectors.load_word2vec_format('data/GoogleNews-vectors-negative300.bin',binary=True)\n#\n# vecab = model.vocab.keys()\n# print(len(vecab))\n# vector = model.get_vector('This')\n# print(type(vector))\n# print(vector.shape)\n\... | [
[
"numpy.array",
"numpy.sum",
"numpy.zeros"
]
] |
RimeT/p3_radio | [
"3d522a4356c62255cd93c6d74eb388a2e474dd00"
] | [
"radiomics/get_test_features.py"
] | [
"import argparse\n\nimport pandas as pd\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n # debug\n parser.add_argument('feature_csv', help='feature csv file')\n parser.add_argument('tags_csv', help='tags csv. extract dataset=1 samples')\n parser.add_argument('out_csv', help='featu... | [
[
"pandas.read_csv",
"pandas.merge"
]
] |
eldarbaykiev/magtess-inversion-python | [
"e775fb0393c00eff9871cfa3e40c5784a89f3e5e"
] | [
"gmi_create_design_matrix.py"
] | [
"def main(dr):\n\n #**************** TESTING PARAMS (WOULD BE REMOVED)*******#\n TRUNCATE = True\n #**************** ---------------------------------*******#\n\n\n\n import gmi_misc\n #**************** PRINT HEADER ***************************#\n gmi_misc.print_header()\n print (\"Script no. 3:... | [
[
"numpy.save",
"numpy.zeros"
]
] |
Unbabel/caption | [
"90725dbf5bc3809e0364d20d0837c58968ceb2b1"
] | [
"caption/models/utils.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nfrom caption.tokenizers import TextEncoderBase\n\n\ndef mask_fill(\n fill_value: float,\n tokens: torch.tensor,\n embeddings: torch.tensor,\n padding_index: int,\n) -> torch.tensor:\n \"\"\"\n Function that masks embeddings representing padded elements.\n ... | [
[
"torch.tensor",
"torch.full",
"torch.randint",
"torch.bernoulli"
]
] |
leidian977/bert | [
"d7a54fce83a5678777a02bc50176e7fa527d7f9f"
] | [
"tokenization_test.py"
] | [
"# coding=utf-8\r\n# Copyright 2018 The Google AI Language Team Authors.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE... | [
[
"tensorflow.test.main"
]
] |
GeoscienceAustralia/uncoverml | [
"672914377afa4ad1c069fcd4845bc45f80132e36"
] | [
"tests/test_cubist.py"
] | [
"\nimport numpy as np\nfrom sklearn.metrics import r2_score\n\nfrom uncoverml.cubist import Cubist, MultiCubist\n\n# Declare some test data taken from the boston houses dataset\nx = np.array([\n [0.006, 18.00, 2.310, 0.5380, 6.5750, 65.20, 4.0900, 1, 296.0, 15.30],\n [0.027, 0.00, 7.070, 0.4690, 6.421... | [
[
"numpy.array",
"sklearn.metrics.r2_score"
]
] |
Edinburgh-Genome-Foundry/Taskpacker | [
"151b581e3b64c6f462e177a5b8b2ff3457529ad0"
] | [
"tests/test_basics.py"
] | [
"\"\"\"Basic tests.\n\nAnd I mean reeeaaaally basic, I'm just making sure the main example runs here.\nThat's because the project is still experimental and \"expected behavior\" is\na very fluid concept at this time.\n\"\"\"\nimport os\nimport matplotlib\nmatplotlib.use('Agg')\nfrom taskpacker import (tasks_from_sp... | [
[
"matplotlib.use",
"matplotlib.cm.Paired"
]
] |
sand-ci/AlarmsAndAlerts | [
"37b783cbb22bb7d01532e3e1427fd18098717095"
] | [
"ps-throughput.py"
] | [
"import threading\nimport time\nimport datetime\nimport pandas as pd\nfrom functools import reduce, wraps\nfrom datetime import datetime, timedelta\nimport numpy as np\nfrom scipy.stats import zscore\n\nimport utils.queries as qrs\nimport utils.helpers as hp\nfrom data_objects.NodesMetaData import NodesMetaData\n\... | [
[
"pandas.Grouper",
"pandas.to_datetime",
"pandas.merge",
"pandas.concat"
]
] |
davtoh/RRTools | [
"6dde2d4622719d9031bf21ffbf7723231a0e2003"
] | [
"tests/GUI_tests/Ex_pyplot2.py"
] | [
"\"\"\"Demo of how to pop up plots asynchronously using separate processes.\"\"\"\nfrom __future__ import print_function\n# https://gist.github.com/dwf/1222883\nfrom multiprocessing import Process\nimport time\nimport sys\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef demo():\n i = 0\n processes ... | [
[
"numpy.random.uniform",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show"
]
] |
OsbornHu/tensorflow-ml | [
"56c3051e7085a919a603481709b63e4a6614192a"
] | [
"chapter02/demo_2.8.py"
] | [
"#!/usr/bin/python2.7\n# -*- coding:utf-8 -*-\n\n# Author: NetworkRanger\n# Date: 2018/11/4 下午12:04\n\n# 2.8 TensorFlow 实现创建张量\n\n# 1. 导入相应的工具库,初始化计算图\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import datasets\nimport tensorflow as tf\nsess = tf.Session()\n\n# 2. 导入iris数据集,根据目标数据是否为山鸢尾将其转换成1... | [
[
"tensorflow.initialize_all_variables",
"tensorflow.matmul",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"tensorflow.random_normal",
"sklearn.datasets.load_iris",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.suptitle",
"numpy.linspace",
"tensorflow.nn.sigmoid_cross... |
goan15910/ConvDet | [
"6404622cc9d0c8e8b756260c4979b6842b2d0cb0"
] | [
"src/dataset/imdb.py"
] | [
"# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016\n\n\"\"\"The data base wrapper class\"\"\"\n\nimport os\nimport random\nimport shutil\n\nfrom PIL import Image, ImageFont, ImageDraw\nimport cv2\nimport numpy as np\nfrom utils.util import iou, batch_iou, drift_dist, recolor, scale_trans, rand_flip\n\nclass imdb... | [
[
"numpy.argsort",
"numpy.log",
"numpy.array",
"numpy.square",
"numpy.random.randint"
]
] |
MaajidKhan/ONNX-1.6.0-OP-Library | [
"df26621fa225485849853f5e11180600be71d11d"
] | [
"operators/sign.py"
] | [
"#sign\n\nimport onnx\nfrom onnx import helper\nfrom onnx import numpy_helper\nfrom onnx import AttributeProto, TensorProto, GraphProto\nimport numpy as np\nfrom Compare_output import compare\n\n# Create the inputs (ValueInfoProto)\nx = helper.make_tensor_value_info('x', TensorProto.FLOAT, [11,])\n\n\n# Create one ... | [
[
"numpy.sign",
"numpy.asarray",
"numpy.squeeze"
]
] |
OniOniOn-/maplestory_dpm_calc | [
"fbe824f01ab8e8210b174dd9db8295da80c267cd"
] | [
"statistics/optimization_hint.py"
] | [
"import argparse\n\nimport pandas as pd\nfrom dpmModule.character.characterKernel import JobGenerator\nfrom dpmModule.character.characterTemplate import TemplateGenerator\nfrom dpmModule.jobs import jobMap\nfrom dpmModule.kernel import core\nfrom dpmModule.status.ability import Ability_grade\n\nfrom .loader import ... | [
[
"pandas.DataFrame"
]
] |
zeroized/DeepRec-torch | [
"2957f65501243107284f3a43735b77b3e89ce684"
] | [
"model/wrapper/base.py"
] | [
"import torch\nfrom torch.utils.data import DataLoader\n\nfrom util.log_util import create_file_console_logger\nfrom util.train import config_path, split_dataset, train_model\nfrom torch.utils.tensorboard import SummaryWriter\n\n\nclass BaseModel:\n def __init__(self):\n self.loader_args = None\n s... | [
[
"torch.utils.tensorboard.SummaryWriter",
"torch.utils.data.DataLoader",
"torch.device"
]
] |
Manza12/kornia | [
"580bbbffc771470445de27a7957d970b5a606172"
] | [
"kornia/augmentation/functional/functional3d.py"
] | [
"from typing import Tuple, List, Union, Dict, cast, Optional\n\nimport torch\n\nimport kornia as K\nfrom kornia.constants import Resample, BorderType, pi\nfrom kornia.geometry.transform.affwarp import _compute_rotation_matrix3d, _compute_tensor_center3d\nfrom kornia.geometry.transform.projwarp import warp_affine3d\... | [
[
"torch.eye",
"torch.tensor",
"torch.flip"
]
] |
christophcc/xarray | [
"132733a917171fcb1f269406eb9e6668cbb7e376"
] | [
"xarray/coding/variables.py"
] | [
"\"\"\"Coders for individual Variable objects.\"\"\"\nimport warnings\nfrom functools import partial\nfrom typing import Any, Hashable\n\nimport numpy as np\nimport pandas as pd\n\nfrom ..core import dtypes, duck_array_ops, indexing\nfrom ..core.pycompat import dask_array_type\nfrom ..core.utils import equivalent\n... | [
[
"numpy.dtype",
"numpy.issubdtype",
"numpy.asarray",
"numpy.ravel",
"numpy.array",
"pandas.isnull",
"numpy.where"
]
] |
dixit-dude7/LDAM-DRW | [
"6366f4756d3ac0c6b6db784b7f20e16066967ed4"
] | [
"utils.py"
] | [
"import torch\r\nimport shutil\r\nimport os\r\nimport numpy as np\r\nimport matplotlib\r\nmatplotlib.use('Agg')\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.metrics import confusion_matrix\r\nfrom sklearn.utils.multiclass import unique_labels\r\n\r\nclass ImbalancedDatasetSampler(torch.utils.data.sampler.Samp... | [
[
"numpy.diag",
"torch.save",
"torch.no_grad",
"torch.multinomial",
"matplotlib.pyplot.subplots",
"sklearn.metrics.confusion_matrix",
"torch.DoubleTensor",
"numpy.arange",
"numpy.power",
"torch.max",
"matplotlib.use",
"numpy.array",
"numpy.unique"
]
] |
mzhaoshuai/RMI | [
"10a40cdbeb58bdd1bd7125fde73b48b12f9452c7"
] | [
"losses/normal_loss.py"
] | [
"#coding=utf-8\n\n\"\"\"\nImplementation of some commonly used losses.\n\"\"\"\n\n# python 2.X, 3.X compatibility\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\n\n#import os\n#import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn... | [
[
"torch.sum",
"torch.div"
]
] |
Learning-and-Intelligent-Systems/predicators | [
"0b2e71cacf86ba2bfdc1d9059c3a78016d0a4d7e"
] | [
"src/envs/painting.py"
] | [
"\"\"\"Painting domain, which allows for two different grasps on an object (side or\ntop).\n\nSide grasping allows for placing into the shelf, and top grasping allows\nfor placing into the box. The box has a lid which may need to be opened;\nthis lid is NOT modeled by any of the given predicates.\n\"\"\"\n\nfrom ty... | [
[
"numpy.allclose",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"numpy.clip",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.suptitle",
"numpy.array",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.Rectangle"
]
] |
leggitta/mne-python | [
"11fb55c41b7c2cc800eb3406d9e44cabf00fc027"
] | [
"mne/fixes.py"
] | [
"\"\"\"Compatibility fixes for older version of python, numpy and scipy\n\nIf you add content to this file, please give the version of the package\nat which the fixe is no longer needed.\n\n# XXX : copied from scikit-learn\n\n\"\"\"\n# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>\n# ... | [
[
"numpy.sum",
"numpy.ones",
"numpy.diff",
"numpy.core.multiarray.result_type",
"numpy.fft.irfft",
"numpy.ones_like",
"numpy.asarray",
"numpy.copy",
"numpy.isscalar",
"scipy.signal.signaltools.get_window",
"numpy.isfinite",
"numpy.unravel_index",
"numpy.abs",
... |
minhhn2910/conga2022 | [
"81ad2fb9c0055c332f8f305b2ea409b6577003f4"
] | [
"train-cifar10/models/resnet_posit.py"
] | [
"'''ResNet in PyTorch.\n\nFor Pre-activation ResNet, see 'preact_resnet.py'.\n\nReference:\n[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n Deep Residual Learning for Image Recognition. arXiv:1512.03385\n'''\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BasicBlock(nn.Mo... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.functional.avg_pool2d",
"torch.randn",
"torch.nn.functional.relu",
"torch.nn.Conv2d",
"torch.nn.Sequential"
]
] |
laiguokun/fairseq | [
"6c01c91aac81eb2e3173add4463dfa45c404ffa5"
] | [
"models/protected_multihead_attention.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport math\n\nimport ... | [
[
"torch.nn.init.xavier_uniform_",
"torch.cumsum",
"torch.bmm",
"torch.cat",
"torch.onnx.operators.reshape_from_tensor_shape",
"torch.nn.functional.dropout",
"torch.nn.init.xavier_normal_",
"torch.cos",
"torch.onnx.operators.shape_as_tensor",
"torch.nn.init.normal_",
"tor... |
Tiamat-Tech/npms | [
"2d1bce8c98b0f24aa69273975c52b2fbdb101c29"
] | [
"npms/datasets/sdf_dataset.py"
] | [
"from __future__ import division\nimport sys\nfrom torch.utils.data import Dataset\nimport os\nimport numpy as np\nimport pickle\nimport imp\nimport trimesh\nimport torch\nimport json\nfrom tqdm import tqdm\nfrom timeit import default_timer as timer\n\nfrom utils.gaps_utils import read_pts_file\n\n\nclass SDFDatase... | [
[
"numpy.rint",
"torch.utils.data.DataLoader",
"numpy.load",
"numpy.sum",
"numpy.empty",
"numpy.zeros",
"numpy.random.permutation",
"numpy.any",
"numpy.random.seed",
"numpy.all",
"numpy.array",
"numpy.concatenate",
"numpy.random.randint"
]
] |
enricorotundo/alibi | [
"190d7960630221813f704817ee48cc5af46a9e07"
] | [
"alibi/explainers/anchor_base.py"
] | [
"import copy\nimport logging\nimport numpy as np\nfrom collections import defaultdict, namedtuple\nfrom functools import partial\nfrom typing import Callable, Tuple, Set, Dict, List\n\nfrom alibi.utils.distributed import ActorPool, RAY_INSTALLED\nfrom alibi.utils.distributions import kl_bernoulli\n\n\nlogger = logg... | [
[
"numpy.sqrt",
"numpy.sum",
"numpy.zeros",
"numpy.argmin",
"numpy.argsort",
"numpy.argmax",
"numpy.logical_not",
"numpy.arange",
"numpy.log",
"numpy.array",
"numpy.where"
]
] |
peteseibel/retention-data-pipeline | [
"9839d2b900f77722fffb762772697e422e7ec8fb"
] | [
"retention_data_pipeline/dao/edw.py"
] | [
"import os\nimport pyodbc\nimport pandas\nfrom django.conf import settings\n\nDB = \"UWSDBDataStore\"\n\n\ndef get_day1_enrollments(year, quarter):\n \"\"\"\n Returns a list of student system_keys enrolled on day one and EOP status\n \"\"\"\n campus = 0\n db_query = \"\"\"\n SELECT *\n FROM ... | [
[
"pandas.read_sql"
]
] |
patelajaychh/Hierarchical-Localization | [
"d3f155d0587376a6fd0395ea36125016160fa448"
] | [
"hloc/localize_inloc.py"
] | [
"import argparse\nfrom pathlib import Path\nimport numpy as np\nimport h5py\nfrom scipy.io import loadmat\nimport torch\nfrom tqdm import tqdm\nimport logging\nimport pickle\nimport cv2\nimport pycolmap\n\nfrom .utils.parsers import parse_retrieval, names_to_pair\n\n\ndef interpolate_scan(scan, kp):\n h, w, c = ... | [
[
"numpy.count_nonzero",
"numpy.all",
"torch.from_numpy",
"torch.nn.functional.grid_sample",
"numpy.array",
"torch.isnan",
"numpy.concatenate",
"numpy.fromstring"
]
] |
czhao39/xacc-vqe | [
"4ad1d9308794e28c37772b7ea29cd3923388168a"
] | [
"examples/general/scipy_minimization_with_xacc.py"
] | [
"import numpy as np\nimport pyxacc as xacc\nfrom pyxacc import InstructionParameter\nimport pyxaccvqe as vqe\nfrom pyxaccvqe import PauliOperator\nfrom scipy.optimize import minimize\n\nxacc.Initialize()\n\n# Construct the First Quantized 2x2 and 3x3 Hamiltonians\nhamiltonian3x3 = PauliOperator(7.7658547225) + Paul... | [
[
"scipy.optimize.minimize",
"numpy.asarray"
]
] |
t-kaichi/hyperspoof | [
"6effdf03be8489ba74154a12416c69948681aa51"
] | [
"train.components.py"
] | [
"import os\r\nimport time\r\nfrom tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint\r\nfrom absl import app\r\nfrom absl import flags\r\nfrom albumentations import (\r\n Compose, HorizontalFlip, RandomBrightness,RandomContrast,\r\n ShiftScaleRotate, ToFloat, VerticalFlip)\r\n\r\nfrom models imp... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.callbacks.EarlyStopping"
]
] |
Gael-de-Sailly/flopy | [
"4104cf5e6a35e2a1fd6183442962ae5cb258fa7a"
] | [
"autotest/t016_test.py"
] | [
"import os\nimport flopy\nimport numpy as np\n\n\ntpth = os.path.abspath(os.path.join('temp', 't016'))\nif not os.path.isdir(tpth):\n os.makedirs(tpth)\n\n\nexe_name = 'mfusg'\nv = flopy.which(exe_name)\n\nrun = True\nif v is None:\n run = False\n\n\ndef test_usg_disu_load():\n\n pthusgtest = os.path.join(... | [
[
"numpy.array_equal"
]
] |
iliasprc/CVPR21Chal-SLR | [
"9d0c9a593d2c4bbfd69eff040b84e9f0538740fb"
] | [
"Conv3D/Sign_Isolated_Conv3D_hha_clip_mask.py"
] | [
"import os\nimport sys\nfrom datetime import datetime\nimport logging\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader, random_split\nfrom torch.utils.tensorboard import SummaryWriter\nimport torchvision.transforms as transfo... | [
[
"torch.utils.data.DataLoader",
"torch.nn.functional.log_softmax",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.utils.tensorboard.SummaryWriter",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.nn.DataParallel"
]
] |
MouseHu/emdqn | [
"ba907e959f21dd0b5a17117accccae9c82a79a3b"
] | [
"baselines/deepq/experiments/atari/train_modelbased.py"
] | [
"import argparse\nimport gym\nimport numpy as np\nimport os\nimport tensorflow as tf\nimport tempfile\nimport time\n\nimport sys\n\ncwd = os.getcwd()\ncwd = '/'.join(cwd.split('/')[:-4])\ntemp = sys.path\ntemp.append('')\ntemp[1:] = temp[0:-1]\ntemp[0] = cwd\nprint(sys.path)\n\nfrom baselines.deepq.dqn_utils import... | [
[
"numpy.tile",
"numpy.mean",
"tensorflow.train.AdamOptimizer",
"numpy.random.random",
"numpy.arange",
"numpy.max",
"numpy.clip",
"tensorflow.get_default_graph",
"numpy.round",
"numpy.where",
"numpy.random.randint",
"numpy.array",
"tensorflow.Summary"
]
] |
inspire-group/ml_defense | [
"e7e8944d617885389a013061c320fa3553e779f0"
] | [
"lib/utils/DCA.py"
] | [
"\"\"\"\nDCA class performs Discriminant Correlation Analysis (DCA). It can be used as\na dimensionality reduction algorithm. Usage is similar to sklearn's\npreprocessing classes such as PCA.\n(Code from Thee Chanyaswad (tc7@princeton.edu))\n\"\"\"\n\nimport numpy as np\nimport scipy\nfrom sklearn.metrics import pa... | [
[
"numpy.eye",
"numpy.linalg.solve",
"numpy.zeros",
"numpy.argwhere",
"numpy.linalg.eigvalsh",
"scipy.linalg.eigh",
"numpy.max",
"numpy.inner",
"numpy.outer",
"numpy.unique",
"numpy.mean"
]
] |
jairideout/scikit-bio | [
"81a1ce5acb434603c537f832caee64a76db19190"
] | [
"skbio/diversity/alpha/_ace.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n# ---------------------------------... | [
[
"numpy.bincount"
]
] |
ccharp/dplyPY | [
"681af27b6ca595bec88e1a9b98ea90c9ac848f1b"
] | [
"dplypy/test/test_arrange.py"
] | [
"import pandas as pd\nimport numpy as np\n\nfrom dplypy.dplyframe import DplyFrame\nfrom dplypy.pipeline import arrange\n\n\ndef test_arrange():\n pandas_df = pd.DataFrame(\n data=[[5, 1, 0], [20, 2, 2], [0, 8, 8], [np.nan, 7, 9], [10, 7, 5], [15, 4, 3]],\n columns=[\"col1\", \"col2\", \"col3\"],\n... | [
[
"pandas.DataFrame",
"pandas.testing.assert_frame_equal"
]
] |
padma-g/data | [
"b65e4e04a759ecc5b0b4df67e8cc290b0ddcadff"
] | [
"scripts/fbi/crime/preprocess.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 agreed ... | [
[
"pandas.read_excel"
]
] |
preetham7897/Estimation-of-Rainfall-Quantity-using-Hybrid-Ensemble-Regression | [
"659fa450e28eeea262295e86c5ebe04a50a8a88b"
] | [
"codes/simple average.py"
] | [
"import pandas as pd\r\nfrom sklearn.linear_model import LinearRegression\r\nfrom sklearn.tree import DecisionTreeRegressor\r\nfrom sklearn.svm import SVR\r\nfrom sklearn.preprocessing import PolynomialFeatures\r\nfrom sklearn.metrics import mean_squared_error as mse\r\nfrom sklearn.metrics import mean_absolute_err... | [
[
"sklearn.metrics.mean_squared_error",
"pandas.read_csv",
"sklearn.model_selection.RepeatedKFold",
"sklearn.svm.SVR",
"sklearn.linear_model.LinearRegression",
"pandas.DataFrame",
"sklearn.tree.DecisionTreeRegressor",
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.median... |
Sidbenake/ga-learner-dsmp-repo | [
"273af724ddea5c4eb957065def51e17ff9ad1279"
] | [
"Decision-Tree/code.py"
] | [
"# --------------\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\ndata = pd.read_csv(path)\nX = data.drop(['customer.id','paid.back.loan'],axis=1)\ny = data['paid.back.loan']\nX_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.3,random_state=0)\n\n\n# --------------\n#Impor... | [
[
"matplotlib.pyplot.imread",
"pandas.read_csv",
"sklearn.tree.DecisionTreeClassifier",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show",
"sklearn.model_selection.GridSearchCV",
"sklearn.preprocessing... |
jbohnslav/kornia | [
"74cc0cfd6406179570b06ca4ef8423142e7eaa0b"
] | [
"kornia/utils/image.py"
] | [
"from typing import Optional\n\nimport numpy as np\nimport torch\n\n\ndef image_to_tensor(image: np.ndarray, keepdim: bool = True) -> torch.Tensor:\n \"\"\"Converts a numpy image to a PyTorch 4d tensor image.\n\n Args:\n image (numpy.ndarray): image of the form :math:`(H, W, C)`, :math:`(H, W)` or\n ... | [
[
"torch.from_numpy"
]
] |
ai4er-cdt/gtc-exposure | [
"f0504d8c40c3553ba1466faef3d802ced09bd984"
] | [
"settlement_segmentation/data/sentinel_time_series/gen_train_data.py"
] | [
"import numpy as np\nimport descarteslabs as dl\nfrom shapely.geometry import Polygon, MultiPolygon\nfrom PIL import Image\n\ndef generate_sentinel_training_images(geometry,\n area, #eg. 'Jamaca'\n tile_size= 512,\n ... | [
[
"numpy.ma.median",
"numpy.max",
"numpy.zeros"
]
] |
ozcell/pytorch-auto-drive | [
"f1c2fd223cf7d307a3968fe671d0271b03ced39c"
] | [
"transforms/transforms.py"
] | [
"# Mostly copied and modified from torch/vision/references/segmentation to support unlabeled data\n# Copied functions from fmassa/vision-1 to support multi-dimensional masks loaded from numpy ndarray\n# Update: The current torchvision github repo now supports tensor operation for all common transformations,\n# you ... | [
[
"numpy.matmul",
"torch.as_tensor",
"torch.tensor",
"numpy.asarray",
"numpy.array"
]
] |
jacobkimmel/GSEA.py | [
"8084e96dcd4f57ea99a8c18fa7f96db25d6f1f0d"
] | [
"tests/test_gsea.py"
] | [
"# Dummy test\nimport numpy as np\nfrom gsea import *\nfrom numpy.testing import assert_almost_equal\n\ndef test_rank_genes():\n D = np.array([[-1,1],[1,-1]])\n C = [0,1]\n L,r = rank_genes(D,C)\n assert_almost_equal(L, [0,1])\n assert_almost_equal(r, [1,-1])\n\ndef test_enrichment_score():\n L = ... | [
[
"numpy.array",
"numpy.testing.assert_almost_equal"
]
] |
jackieleng/pandas | [
"ccec504e31ce74f8016952ac75add1cc4bec7080"
] | [
"pandas/tseries/index.py"
] | [
"# pylint: disable=E1101\nfrom __future__ import division\nimport operator\nimport warnings\nfrom datetime import time, datetime\nfrom datetime import timedelta\nimport numpy as np\nfrom pandas.core.base import _shared_docs\n\nfrom pandas.types.common import (_NS_DTYPE, _INT64_DTYPE,\n ... | [
[
"numpy.asarray",
"pandas.core.index.Index.intersection",
"pandas.tslib.get_timezone",
"pandas.types.common.is_datetime64_ns_dtype",
"pandas.util.decorators.deprecate_kwarg",
"pandas.tslib.dates_normalized",
"pandas.tseries.offsets.generate_range",
"pandas.formats.format._get_format... |
aryankhatana01/Currency-Denomination-Prediction | [
"1cc80817af7a126a9f752c634db121408bcb56ab"
] | [
"VideoCap.py"
] | [
"# import the necessary packages\nfrom keras.preprocessing.image import img_to_array\nfrom keras.models import load_model\nimport tensorflow as tf\nimport numpy as np\nimport imutils\nimport time\nimport cv2\nimport os\nimport pyttsx3\n\nframeWidth= 640 # CAMERA RESOLUTION\nframeHeight = 480\nbrightness = 1... | [
[
"numpy.amax",
"numpy.argmax",
"numpy.asarray",
"tensorflow.keras.models.load_model"
]
] |
kangyifei/CloudSimPy | [
"45912e7ea35086b67941624102e400cb22e549ab"
] | [
"playground/Non_DAG_with_Energy_rllib/algorithm/DeepJS/DRL.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\ntf.enable_eager_execution()\n\nclass Node(object):\n def __init__(self, observation, action, reward, clock):\n self.observation = observation\n self.action = action\n self.reward = reward\n self.clock = clock\n\n\nclass RLAlgorithm(objec... | [
[
"tensorflow.enable_eager_execution",
"tensorflow.multinomial",
"tensorflow.convert_to_tensor"
]
] |
xiaonanzzz/easy-deep-learning-pytorch | [
"a3b6566ce0e73f2cbea1007e8883d2ffa2282829"
] | [
"easydl/datasets/cub.py"
] | [
"import torchvision\nimport os\nimport pandas as pd\nfrom easydl.datasets import ImageLoader\nimport numpy as np\nfrom torchvision.transforms import ToTensor, Resize, Normalize\n\n\n_default_image_transformer = torchvision.transforms.Compose([\n Resize((224, 224)),\n ToTensor(),\n Normalize(0.45, 0.22), ... | [
[
"pandas.read_csv",
"numpy.arange"
]
] |
PhilJd/addons | [
"758d8838090c24914ee74b88bd24ee02f7e68850"
] | [
"tensorflow_addons/activations/sparsemax_test.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.sort",
"numpy.cumsum",
"numpy.transpose",
"numpy.zeros",
"numpy.reshape",
"numpy.ones_like",
"numpy.argsort",
"numpy.argmax",
"numpy.asarray",
"numpy.arange",
"numpy.random.RandomState",
"numpy.select",
"numpy.maximum",
"numpy.testing.assert_allclose"... |
gopi231091/mmdetection3d | [
"1b2e64cd75c8d1c238c61a3bc1e3c62a7d403b53"
] | [
"mmdet3d/models/dense_heads/train_mixins.py"
] | [
"import numpy as np\nimport torch\n\nfrom mmdet3d.core import limit_period\nfrom mmdet.core import images_to_levels, multi_apply\n\n\nclass AnchorTrainMixin(object):\n \"\"\"Mixin class for target assigning of dense heads.\"\"\"\n\n def anchor_target_3d(self,\n anchor_list,\n ... | [
[
"torch.zeros_like",
"torch.cat",
"torch.clamp",
"torch.floor"
]
] |
jaimesouza/devito | [
"aa85166f8ea4924498d3bb143b6d40ff5e97e97a"
] | [
"devito/types/basic.py"
] | [
"import abc\nfrom collections import namedtuple\nfrom ctypes import POINTER, Structure, byref\nfrom functools import reduce\nfrom operator import mul\n\nimport numpy as np\nimport sympy\nfrom sympy.core.assumptions import _assume_rules\nfrom cached_property import cached_property\nfrom cgen import Struct, Value\n\n... | [
[
"numpy.add"
]
] |
yu-frank/PerspectiveCropLayers | [
"ae0580cb7b3b41c21965cd32e280d2af0e8cf2c3"
] | [
"src/dataset_3dhp.py"
] | [
"import re\nfrom glob import iglob\nfrom os import path\nfrom torchvision import transforms\n\nimport h5py\nimport numpy as np\nimport torch\nfrom PIL import Image, ImageOps\nfrom pose3d_utils.coords import homogeneous_to_cartesian, ensure_homogeneous\nfrom torchvision.transforms import RandomCrop, RandomHorizontal... | [
[
"numpy.random.uniform",
"torch.FloatTensor",
"torch.min",
"torch.LongTensor",
"numpy.random.normal",
"torch.from_numpy",
"torch.max",
"numpy.array",
"numpy.random.randint"
]
] |
vnshanmukh/pvoutput | [
"9773c60445b38b7b67f8d5e10316379f47090549"
] | [
"pvoutput/pvoutput.py"
] | [
"import logging\nimport os\nimport time\nimport warnings\nfrom datetime import date, datetime, timedelta\nfrom io import StringIO\nfrom typing import Dict, Iterable, List, Optional, Union\nfrom urllib.parse import urljoin\n\nimport numpy as np\nimport pandas as pd\nimport requests\nimport tables\n\nfrom pvoutput.co... | [
[
"pandas.Timestamp.utcnow",
"numpy.diff",
"pandas.Timestamp",
"pandas.DataFrame",
"pandas.Timestamp.now",
"numpy.float32",
"pandas.HDFStore",
"pandas.to_datetime",
"pandas.read_hdf",
"pandas.isnull",
"numpy.where",
"pandas.Timestamp.utcfromtimestamp",
"numpy.uniq... |
CalciferZh/KinectRecorder | [
"cab45c35264feb4bfcde32172e2492711788b3bd"
] | [
"visualizer.py"
] | [
"import numpy as np\nimport pygame\nimport cv2\n\nfrom utils import pickle_load\nfrom utils import pickle_save\n\n\nclass RawVisualizer:\n def __init__(self, load_prefix):\n \"\"\"\n Display raw stream recorded by `KinectRecorder`.\n\n Parameter\n ---------\n load_prefix: Path to load data. Will loa... | [
[
"numpy.transpose",
"numpy.repeat",
"numpy.flip"
]
] |
panwalas/SDC-P5 | [
"818a2de532c37f16761e2913ca3ff18d2de9f828"
] | [
"vehicleLab/chogtrainingRGB2.py"
] | [
"import matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport numpy as np\nimport cv2\nimport glob\nimport time\nfrom tqdm import tqdm\nfrom sklearn.svm import LinearSVC\nfrom sklearn.preprocessing import StandardScaler\nfrom skimage.feature import hog\nfrom skle... | [
[
"numpy.vstack",
"numpy.histogram",
"matplotlib.pyplot.figure",
"sklearn.svm.LinearSVC",
"matplotlib.pyplot.savefig",
"numpy.copy",
"numpy.max",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.Subplot",
"numpy.min",
"sklearn.preprocessing.StandardScaler",
"sklearn... |
prefrontalvortex/SigFlux | [
"aa1cb1d4fe66b37ac6f659068678853756117060"
] | [
"sigflux/logscale.py"
] | [
"import numpy as np\nfrom scipy import fftpack, interpolate, signal\n\nfrom sigflux import clip\n\n\ndef freq_logscale(data, ndim=1024, fs=400, down=30, smoothing_cutoff=1, hard_cutoff=200, log_low_cut=-2.32,\n prenormalize=True, useEnvelope=True):\n \"\"\"\n This function returns ... | [
[
"numpy.log2",
"scipy.fftpack.fft",
"numpy.power",
"scipy.signal.resample_poly",
"scipy.interpolate.Akima1DInterpolator"
]
] |
niab/dip | [
"b83d6d10762adb28c29b116565d17538b6129a2a"
] | [
"common.py"
] | [
"import csv\nimport pymongo\nimport numpy as np\nimport math\nfrom collections import OrderedDict\nfrom decimal import Decimal\nfrom scipy.stats import fisher_exact\n\n#################\n### CONSTANTS ###\n#################\n\nDB_HOST = 'localhost'\nDB_PORT = 27017\nDB_NAME_GR = 'gr' \nDB_NAME_EXAC = 'exac'\n\t\t\t... | [
[
"scipy.stats.fisher_exact"
]
] |
gy29289957/deep-anpr | [
"e4e1bc8f1f560f0f01b4c39d6302d8d8edde89fd"
] | [
"common.py"
] | [
"# Copyright (c) 2016 Matthew Earl\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, pu... | [
[
"numpy.sum",
"numpy.exp"
]
] |
Tjorriemorrie/trading | [
"aafa15a6c564bfa86948ab30e33d554172b38a3e"
] | [
"19_rf_kelly/main.py"
] | [
"import logging as log\nimport pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import scale\nfrom sklearn.cross_validation import train_test_split\nfrom indicators import ewma, rsi\n\n\nDATA = [\n {'currency': 'AUDUSDe', 'timeframe': 1440},\n {'currency': 'EURGBPe', 'timeframe': 1440},\n {'cur... | [
[
"sklearn.preprocessing.scale",
"sklearn.cross_validation.train_test_split"
]
] |
RyanRizzo96/RL_baselines | [
"4f7c217095c6b02093386ed4e527c44c79b42007"
] | [
"custom/aggregator.py"
] | [
"# MIT License\n# Copyright (c) 2019 Sebastian Penhouet\n# GitHub project: https://github.com/Spenhouet/tensorboard-aggregator\n# ==============================================================================\n\"\"\"Aggregates multiple tensorbaord runs\"\"\"\n\nimport ast\nimport argparse\nimport os\nimport re\nfro... | [
[
"tensorflow.summary.FileWriter",
"numpy.transpose",
"tensorflow.Summary.Value",
"tensorflow.core.util.event_pb2.Event"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.