repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
anaeliaovalle/atc-mt-dti | [
"755bd175e852ef2a6792be7244b006ebed252d8d"
] | [
"src/bert/tfrecord_smiles.py"
] | [
"import os\nimport csv\nimport json\nimport pickle\nimport random\nimport argparse\nimport numpy as np\nimport tensorflow as tf\nimport _pickle as cPickle\nfrom copy import deepcopy\nimport collections\nfrom collections import OrderedDict\n\n__author__ = 'Bonggun Shin'\n\n\nflags = tf.flags\nFLAGS = flags.FLAGS\nfl... | [
[
"tensorflow.python_io.TFRecordWriter",
"tensorflow.train.Features",
"tensorflow.logging.info",
"tensorflow.gfile.GFile"
]
] |
oasys-kit/OASYS-CRYSTALPY | [
"52b27d225c090894bc6b6d0bdf8d828f19aa3972"
] | [
"orangecontrib/crystalpy/widgets/elements/PhotonViewer.py"
] | [
"import matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas\nimport orangecanvas.resources as resources\nimport os\nimport sys\nimport numpy as np\nfrom orangewidget.settings import Setting\nfrom crystalpy.util.PolarizedPhotonBunch import PolarizedPhotonBunch\n... | [
[
"matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg",
"numpy.array",
"matplotlib.pyplot.subplots",
"numpy.append"
]
] |
jahfet/pandas | [
"1e4c50a56f7e953ab84308f000dff6fc1ac71171"
] | [
"pandas/tests/io/formats/test_format.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nTest output formatting for Series/DataFrame, including to_string & reprs\n\"\"\"\n\nfrom __future__ import print_function\nimport re\n\nimport pytz\nimport dateutil\nimport itertools\nfrom operator import methodcaller\nimport os\nimport sys\nimport warnings\nfrom datetime import ... | [
[
"pandas.compat.StringIO",
"pandas.reset_option",
"pandas.core.config.option_context",
"pandas.compat.u",
"pandas.core.config.set_option",
"pandas.io.formats.printing.pprint_thing",
"pandas.Timestamp",
"numpy.where",
"pandas.io.formats.format.Datetime64Formatter",
"pandas.ut... |
qguyk/entropy | [
"e43077026c83fe84de022cf8636b2c9d42f1d330"
] | [
"entropylab/pipeline/api/tests/test_plot.py"
] | [
"import numpy as np\nimport plotly\n\nfrom entropylab.pipeline.api.plot import CirclePlotGenerator, ImShowPlotGenerator\nfrom plotly.graph_objects import Figure\n\n\ndef test_circle_plot_plotly():\n target = CirclePlotGenerator()\n figure = Figure()\n data = [[0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5]]\n ta... | [
[
"numpy.random.rand"
]
] |
richardqiu/pyjanitor | [
"aa3150e7b8e2adc4733ea206ea9c3093e21d4025"
] | [
"tests/functions/test_convert_unix_date.py"
] | [
"import os\n\nimport pandas as pd\nimport pytest\n\n\n@pytest.mark.skipif(\n os.name == \"nt\", reason=\"Skip *nix-specific tests on Windows\"\n)\ndef test_convert_unix_date():\n unix = [\n \"1284101485\",\n 1_284_101_486,\n \"1284101487000\",\n 1_284_101_488_000,\n \"128410... | [
[
"pandas.DataFrame"
]
] |
MatthijsdeJ/GNN_PN_Operation_MSc_Thesis | [
"593857abfb15290dde2800cbbbaba0f4b480c990"
] | [
"data_preprocessing_analysis/imitation_data_preprocessing.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 28 16:30:55 2021\n\n@author: matthijs\n\"\"\"\nimport grid2op\nimport numpy as np\nfrom typing import List, Tuple, Callable, Sequence\nfrom pathlib import Path, PosixPath\nimport re\nimport json\nimport auxiliary.grid2op_util as g2o_util\n... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.delete",
"numpy.zeros_like",
"numpy.load",
"numpy.sqrt"
]
] |
brgcode/compas_vol | [
"258138f10ac6000534586ff3322d4aeac92a8343"
] | [
"src/compas_vol/combinations/smoothunion.py"
] | [
"from compas import PRECISION\n\n\nclass SmoothUnion(object):\n \"\"\"The smooth union between two volumetric objects.\n\n Parameters\n ----------\n a: volumetric object\n First object to add.\n b: volumetric object\n Second object to add.\n r: float\n Intensity factor, the hi... | [
[
"numpy.maximum"
]
] |
Anirudhsekar96/pandas | [
"2db3b0a0378487e269997700b14777af70838e95"
] | [
"pandas/tests/groupby/test_groupby.py"
] | [
"from datetime import datetime\nfrom decimal import Decimal\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat import IS64\nfrom pandas.errors import PerformanceWarning\n\nimport pandas as pd\nfrom pandas import (\n Categorical,\n DataFrame,\n Grouper,\n Index,\n MultiIndex,\n RangeIndex,\... | [
[
"pandas.Grouper",
"pandas._testing.rands_array",
"pandas.core.common.asarray_tuplesafe",
"pandas.Timestamp",
"pandas.concat",
"pandas._testing.assert_series_equal",
"numpy.random.random",
"numpy.empty",
"pandas.Timedelta",
"pandas.DataFrame",
"pandas._testing.makeTimeDa... |
Johannes-Sahlmann/uhelpers | [
"58f8e25ef8644ab5b24a5be76fd58a338a400912"
] | [
"uhelpers/plotting_helpers.py"
] | [
"\"\"\"Helper functions for recurring plotting tasks\n\nAuthors\n-------\n\n Johannes Sahlmann\n\nUse\n---\n\n\"\"\"\nimport os\nimport numpy as np\nimport pylab as pl\nfrom scipy.stats import norm\n\n\ndef histogram_with_gaussian_fit(omc, facecolors=None, labels=None, titles=None, linecolors=None, xlabel='value... | [
[
"scipy.stats.norm.pdf",
"numpy.sum",
"numpy.diff",
"scipy.stats.norm.fit",
"numpy.arange",
"numpy.expand_dims"
]
] |
Parasgupta44/py_holiday_calendar | [
"18ecc88b3638a1b126e159f96a31a88e517f45f1"
] | [
"py_holiday_calendar/py_holiday_calendar.py"
] | [
"import pandas as pd\nimport datetime\nfrom business_calendar import Calendar, MO, TU, WE, TH, FR\n\n\n# obj_cal = Calendar(workdays=[MO, TU, WE, TH, FR], holidays=[])\n\ndef _initialise_cal_obj(workdays, holidays=[]):\n \"\"\"Function to initialise custom calendar object.\n\n The return value must be the cus... | [
[
"pandas.to_datetime"
]
] |
tgen/vcfMerger2 | [
"3371800eaf2f95077c47ea175f988570757d121b"
] | [
"prep_vcfs_somatic/strelka2/VCF.py"
] | [
"\"\"\"\nVCF.py\nKamil Slowikowski\nOctober 30, 2013\nhttps://gist.github.com/slowkow/6215557\n\nRead VCF files. Works with gzip compressed files and pandas.\n\nNote: This module ignores the genotype columns because\n I didn't need them at the time of writing.\n\nRead more about VCF:\n\n http://vcftools.sou... | [
[
"pandas.DataFrame"
]
] |
fperez/sympy | [
"7d8d096215c8f65ba1d4a9c09af78ec0c3844518"
] | [
"sympy/test_external/test_numpy.py"
] | [
"# This testfile tests SymPy <-> NumPy compatibility\n\n# Don't test any SymPy features here. Just pure interaction with NumPy.\n# Always write regular SymPy tests for anything, that can be tested in pure\n# Python (without numpy). Here we test everything, that a user may need when\n# using SymPy with NumPy\n\ntry:... | [
[
"numpy.allclose",
"numpy.matrix",
"numpy.array"
]
] |
MarinBallu/regularized-wasserstein-estimator | [
"aeb21778180a5f7b88789ac9640bf0aa90a07552"
] | [
"regularized-wasserstein-estimator/computations.py"
] | [
"import numpy as np\n\n### INTERMEDIATE COMPUTATIONS FOR THE UPDATES\n\ndef dual_to_target(b, reg2, beta):\n ''' compute the target given the dual variable '''\n target = b * np.exp( - beta / reg2)\n target = target / target.sum()\n return target\n\ndef partial_target_meas(b, beta, reg2, S):\n ''' Compute one ... | [
[
"numpy.exp",
"numpy.unique"
]
] |
BUSS-DeeCamp/Det3D | [
"c8f4d59af8a0721b22ffcfed8be3805d4b9bd824"
] | [
"tools/train.py"
] | [
"import argparse\nimport json\nimport os\nimport sys\n\nimport numpy as np\nimport torch\nimport yaml\nfrom det3d import __version__\nfrom det3d.datasets import build_dataset\nfrom det3d.models import build_detector\nfrom det3d.torchie import Config\nfrom det3d.torchie.apis import (\n build_optimizer,\n get_r... | [
[
"torch.distributed.init_process_group",
"torch.cuda.set_device",
"torch.distributed.get_world_size"
]
] |
prateekchandan/Flight-Delay-Prediction | [
"4330d32657c197fae47cd799b07cd2690154a4f3"
] | [
"train.py"
] | [
"import pandas as pd\nimport numpy as np\nimport csv\nimport sys\nfrom sklearn import linear_model, svm, ensemble\nimport cPickle\n\nfrom sklearn import tree\nfrom sklearn import cross_validation\n\n\n# Class bcolors\nclass bcolors:\n '''\n Class bcolor used for printing pretty messages\n '''\n HEADER =... | [
[
"pandas.read_csv",
"sklearn.linear_model.LinearRegression"
]
] |
VictorAtPL/Tensorflow-2_Distribution-Strategies_Playground | [
"5f8affd77c07b6df62bf71f6eb07770c2db1f608"
] | [
"common.py"
] | [
"from enum import Enum\n\nimport tensorflow as tf\nfrom tensorflow.keras import models, layers\n\nBUFFER_SIZE = 10000\n\n\nclass ModelArchitecture(Enum):\n SA_MIRI = 1\n RESNET101 = 2\n MOBILENET = 3\n\n def __str__(self):\n return self.name.lower()\n\n def __repr__(self):\n return str(... | [
[
"tensorflow.image.resize",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.applications.MobileNetV2",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.applications... |
tianjixuetu/ray | [
"65297e65f02e52472c114f52797c2ea18cc3fc3e"
] | [
"python/ray/tests/test_advanced_2.py"
] | [
"# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport logging\nimport os\nimport sys\nimport time\n\nimport numpy as np\nimport pytest\n\nimport ray\nimport ray.cluster_utils\nimport ray.test_utils\n\nfrom ray.test_utils import Ray... | [
[
"numpy.random.permutation",
"numpy.random.randint"
]
] |
ahyansaputra/T1002 | [
"462c66d973e2a509cce7f90b57fbe2912c41a924"
] | [
"app.py"
] | [
"from flask import Flask, render_template, request\nimport tensorflow as tf\nfrom tensorflow.keras.preprocessing.text import Tokenizer\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\nfrom keras.models import load_model\n\n\napp = Flask(__name__)\n\n\nmodel = load_model('Indonesian Abusive and Ha... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.preprocessing.text.Tokenizer"
]
] |
Chris-cbc/SGRAF | [
"785535168ad417dda523888f2f047359231fcbf7"
] | [
"data.py"
] | [
"\"\"\"Data provider\"\"\"\n\nimport torch\nimport torch.utils.data as data\n\nimport os\nimport nltk\nimport numpy as np\n\n\nclass PrecompDataset(data.Dataset):\n \"\"\"\n Load precomputed captions and image features\n Possible options: f30k_precomp, coco_precomp\n \"\"\"\n\n def __init__(self, dat... | [
[
"torch.Tensor",
"numpy.load",
"torch.stack",
"torch.utils.data.DataLoader"
]
] |
And1210/Cartoonization | [
"8b05040d574e64b565cdfbff98dbebbab4c7a9d2"
] | [
"losses/VariationLoss.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import Tensor\nfrom torch.autograd import Variable\nimport matplotlib.pyplot as plt\n\nclass VariationLoss(nn.Module):\n def __init__(self, k_size: int) -> None:\n super().__init__()\n self.k_size = k_size\n... | [
[
"torch.mean"
]
] |
gbaasch/Gnu-RL | [
"04621c3cd299eb0fa361d303699676d662aa147d"
] | [
"agent/simulate.py"
] | [
"import gym\nimport eplus_env\n\nimport pandas as pd\nimport pickle\nimport numpy as np\n\nfrom utils import make_dict\n\n# Create Environment. Follow the documentation of 'Gym-Eplus' to set up additional EnergyPlus simulation environment.\nenv = gym.make('5Zone-sim_TMY2-v0');\n#env = gym.make('5Zone-sim_TMY3-v0');... | [
[
"numpy.array",
"pandas.datetime",
"pandas.Timedelta"
]
] |
prabhnoor0212/Empathy-in-Mental-Health-Support | [
"18ca5b2f274487f32eb5f22e793c8e3aa49d1f11"
] | [
"TEST/test.py"
] | [
"import numpy as np\nfrom src.data_utils.data_loader import DataReaderUtility\nimport unittest\nimport pandas as pd\nimport torch\nfrom src.models.epitome import EPITOME\nfrom transformers import AdamW\nfrom config import _EPS, _LR, _LAMBDA_EI, _LAMBDA_RE, _BATCH_SIZE, _max_tokenizer_len\nimport logging\nlogging.g... | [
[
"torch.device",
"pandas.read_csv",
"torch.cuda.is_available",
"numpy.ceil"
]
] |
VCL3D/SingleShotCuboids | [
"586a13bef9f75eb89f1a04a79c57df162f67db08"
] | [
"ssc/cuboid_fitting.py"
] | [
"import torch\nimport numpy as np\nimport functools\nimport kornia\n\nclass CuboidFitting(torch.nn.Module):\n def __init__(self,\n mode: str='joint', # one of ['joint', 'floor', 'ceil', 'avg']\n floor_distance: float=-1.6,\n ):\n super(CuboidFitting, self).__init__() ... | [
[
"torch.cos",
"torch.cat",
"torch.stack",
"torch.trace",
"torch.tan",
"torch.sin",
"numpy.zeros",
"torch.argsort",
"torch.sum",
"torch.cuda.is_available",
"torch.eye",
"torch.ones_like",
"torch.linalg.norm",
"torch.transpose",
"torch.atan2",
"torch.Te... |
adjs/qclib | [
"998a98b33a059c59452a50389084a9a747426ea8"
] | [
"qclib/state_preparation/util/state_tree_preparation.py"
] | [
"# Copyright 2021 qclib project.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed ... | [
[
"numpy.angle",
"numpy.exp",
"numpy.abs"
]
] |
xiongyixiaoyang/QUANTAXIS | [
"08441ce711e55385e2b01f80df17d34e7e89f564"
] | [
"test_backtest/MACD_JCSC.py"
] | [
"# -*- coding: utf-8 -*-\n# Demo: MACD strategy\n# src: ./test_backtest/MACD_JCSC.py\n# jupyter: ./test_backtest/QUANTAXIS回测分析全过程讲解.ipynb\n# paper: ./test_backtest/QUANTAXIS回测分析全过程讲解.md\n\nimport QUANTAXIS as QA\nimport numpy as np\nimport pandas as pd\n\n\n# define the MACD strategy\ndef MACD_JCSC(dataframe, SHORT... | [
[
"pandas.DataFrame"
]
] |
dchealth/covid-mil | [
"b0d6501923dec161a7235167cdee7a90109bf4ed"
] | [
"misc.py"
] | [
"# %%\nimport numpy as np\n\n# %%\ndef get_bbox_pad(data_size, patch_size, center):\n \"\"\"\n Calculate the bbox and needed pad according to patch center.\n \"\"\"\n # bbox_low = center - np.array(patch_size) // 2\n # bbox_high = center + patch_size\n # pad_low = np.abs(np.minimum(bbox_low - 0, 0... | [
[
"numpy.minimum",
"numpy.array",
"numpy.stack",
"numpy.maximum"
]
] |
mkenworthy/pds110 | [
"47a6dc85265e5a6d6d03bf3690ac535331796bde"
] | [
"code/plot_photometry.py"
] | [
"'''\nCopyright 2017, Matthew A. Kenworthy\n\nplot_photometry.py - pretty plots for the PDS 110 Monitoring slack channel\n\n'''\n\nimport numpy as np\nfrom astropy.io import ascii\nimport matplotlib\nmatplotlib.use('qt5agg')\nimport matplotlib.pyplot as plt\n#import seaborn as sns \n\naavso_file = '../data/aavsod... | [
[
"matplotlib.use",
"numpy.array",
"numpy.log",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.draw",
"numpy.power",
"matplotlib.pyplot.show"
]
] |
pmc-tables/pmc-tables | [
"3f4adbfff353b83a5dc660010f058192948a8833"
] | [
"src/pmc_tables/fixers/extra_headers_and_footers.py"
] | [
"import logging\nfrom collections import Counter\nfrom typing import Tuple\n\nimport pandas as pd\n\nfrom ._errors import _FixDoesNotApplyError\n\nlogger = logging.getLogger(__name__)\n\n\ndef fix_extra_headers_and_footers(df: pd.DataFrame, info: dict) -> pd.DataFrame:\n \"\"\"Fix cases where the first / last ro... | [
[
"pandas.isnull"
]
] |
SimlaBurcu/newhbfp | [
"cbafee4e68f42556b0eef098f6b5d657f73b3a8c"
] | [
"cnn/models/wideresnet.py"
] | [
"# Copyright (c) 2021, Parallel Systems Architecture Laboratory (PARSA), EPFL & \n# Machine Learning and Optimization Laboratory (MLO), EPFL. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n... | [
[
"torch.nn.functional.avg_pool2d",
"torch.nn.Sequential",
"torch.nn.functional.dropout",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
mesjou/rl-playground | [
"31b5f88106a96d33cece25e1155bb82eb652b5f2"
] | [
"ppo/utils.py"
] | [
"import collections\n\nimport gym\nimport numpy as np\nimport tensorflow as tf\n\n\ndef make_env(gym_id, seed):\n def thunk():\n env = gym.make(gym_id)\n env = gym.wrappers.RecordEpisodeStatistics(env)\n env.seed(seed)\n env.action_space.seed(seed)\n env.observation_space.seed(... | [
[
"numpy.square",
"tensorflow.constant",
"numpy.random.randn"
]
] |
alonsoir/spark-deep-learning | [
"3f668d9b4a0aa2ef6fe05df5bf5c1d705cd2530d"
] | [
"python/sparkdl/image/imageIO.py"
] | [
"# Copyright 2017 Databricks, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agre... | [
[
"numpy.ndarray",
"numpy.array",
"numpy.can_cast",
"numpy.asarray"
]
] |
Pherokung/VIRTUON | [
"987cf4e37a72b214f02f0f7fbda68c0cc74e6de4"
] | [
"model_deployment/model/grapy/dataloaders/custom_transforms.py"
] | [
"import torch\nimport math\nimport numbers\nimport random\nimport numpy as np\n\nfrom PIL import Image, ImageOps\nfrom torchvision import transforms\n\nclass RandomCrop(object):\n def __init__(self, size, padding=0):\n if isinstance(size, numbers.Number):\n self.size = (int(size), int(size))\n ... | [
[
"numpy.array",
"torch.from_numpy"
]
] |
minhongqi/federated | [
"52ba53dba2f0f171b34a616179436772ff18883e"
] | [
"utils/datasets/infinite_emnist_test.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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agree... | [
[
"tensorflow.test.main"
]
] |
coco-cao-jinglu/coco-linkedin-easyapply | [
"6b8f55e7666c7f6c123f89cbd21de4d9cb109069"
] | [
"easyapplybot.py"
] | [
"import time, random, os, csv, platform\nimport logging\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\nfrom selenium.common.exceptions import TimeoutException\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.common.exceptions import NoSuchElementException\nfro... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
empiricalstateofmind/netrd | [
"30652431a050033436232c925844e32ed6c9acca"
] | [
"netrd/distance/frobenius.py"
] | [
"\"\"\"\nfrobenius.py\n------------\n\nFrobenius norm between two adjacency matrices.\n\n\"\"\"\n\nimport numpy as np\nimport networkx as nx\nfrom .base import BaseDistance\n\n\nclass Frobenius(BaseDistance):\n \"\"\"The Frobenius distance between their adjacency matrices.\"\"\"\n\n def dist(self, G1, G2):\n ... | [
[
"numpy.linalg.norm"
]
] |
ladyteam/phonopy | [
"455ef61dfa15c01fb6b516461b52f15aefbf92b3"
] | [
"phonopy/gruneisen/core.py"
] | [
"\"\"\"Mode Grueneisen parameter calculation.\"\"\"\n# Copyright (C) 2012 Atsushi Togo\n# All rights reserved.\n#\n# This file is part of phonopy.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redist... | [
[
"numpy.linalg.eigh",
"numpy.array"
]
] |
connycode89/Scratchy | [
"1463ec71093bcbb3b89d085893a85deb0a221942"
] | [
"kMeans Clustering.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Oct 13 15:39:56 2017\n\n@author: cdonovan\n\"\"\"\n\n# python 3.5\n\nimport numpy as np\n\n# input data here in the form of a 2D numpy array\n# the array should be entirely numeric & have rows as observations & columns as features\n# data = ?\ndata = np.array([[1,1,1... | [
[
"numpy.max",
"numpy.array",
"numpy.argmin",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.random.uniform",
"numpy.all"
]
] |
cardin-higley-lab/CBASS | [
"0d0b58497313027388351feffc79766f815b47b5"
] | [
"python/Pipeline/.ipynb_checkpoints/CLAMS_L1_GetTrough-checkpoint.py"
] | [
"import time\nimport numpy as np\nfrom scipy import fftpack\n\n# The wavelet functions\nimport pywt\nfrom scipy import signal\nfrom scipy.signal import butter, lfilter, hilbert, filtfilt, sosfiltfilt\n\ndef GetTrough(db2LFP, inSampleRate, db1FilterBand, inRefChan, chLabel=None, chDataFormat=None, sOPTION=None):\n ... | [
[
"numpy.concatenate",
"numpy.angle",
"numpy.fft.fft2",
"scipy.signal.butter",
"numpy.real",
"numpy.where",
"scipy.signal.filtfilt",
"numpy.fft.fft",
"scipy.signal.lfilter",
"numpy.abs",
"numpy.imag"
]
] |
arash94sh/tabnet | [
"c97f4b4e365e2a582caa29136eb7306c1bfe5ab8"
] | [
"pytorch_tabnet/pretraining_utils.py"
] | [
"from torch.utils.data import DataLoader\nfrom pytorch_tabnet.utils import (\n create_sampler,\n PredictDataset,\n)\nfrom sklearn.utils import check_array\n\n\ndef create_dataloaders(\n X_train, eval_set, weights, batch_size, num_workers, drop_last, pin_memory\n):\n \"\"\"\n Create dataloaders with o... | [
[
"sklearn.utils.check_array"
]
] |
TobiasRoeding/advent-of-code-2021 | [
"3db16d52ad9f4f04ac7f43087f6f504dca41cc43"
] | [
"src/day11.py"
] | [
"import numpy as np\n\n\nclass Day11:\n def __init__(self, input=\"src/input/day11.txt\"):\n self.INPUT = input\n\n def read_input(self):\n with open(self.INPUT, \"r\") as fp:\n lines = fp.readlines()\n lines = [list(line.strip()) for line in lines]\n return np.a... | [
[
"numpy.any",
"numpy.array",
"numpy.where"
]
] |
Yindong-Zhang/myGAT | [
"f69132f21785d3a6bf1ec014890adeb124c89e8d"
] | [
"myDataset.py"
] | [
"from torch.utils.data import Dataset, DataLoader\nfrom torch.utils.data.dataloader import default_collate\nfrom collections import deque\nfrom dataset.make_dataset import get_dataset\nimport torch\nimport numpy as np\n\nimport random\n\ndef bfs(start, adj, distance):\n \"\"\"\n\n :param start:\n :param ad... | [
[
"numpy.zeros",
"torch.FloatTensor",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"numpy.arange",
"torch.utils.data.dataloader.default_collate"
]
] |
Soooyeon-Kim/Python | [
"e9e7e94e4a5a4ac94ff55347201cb4d24a5bb768"
] | [
"crawling/selenium_naver_movie_review.py"
] | [
"import time, re, csv\r\nfrom bs4 import BeautifulSoup\r\nfrom selenium import webdriver\r\nfrom selenium.webdriver.common.keys import Keys\r\nfrom selenium.webdriver.common.by import By\r\n\r\ndriver = webdriver.Chrome('C:/Users/sooyeon/Downloads/chromedriver.exe')\r\ndriver.get(\r\n \"https://movie.naver.com/m... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
berkeley-stat159/project-zeta-2 | [
"7c35423fbc1407751e1aea6aac99d5d02a82dfdc"
] | [
"code/correlation_analysis_scripts_sub4.py"
] | [
"import numpy as np\nimport os\nimport matplotlib.pyplot as plt\nfrom matplotlib import colors\nimport copy\n\n# maximally responded area, percentile setting:\npercent = 80\n\n# object_list\nobject_list = [\"bottle\", \"cat\", \"chair\", \"face\", \"house\", \"scissors\", \"scrambledpix\", \"shoe\"]\n\n# important ... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.reshape",
"matplotlib.pyplot.savefig",
"numpy.percentile",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"numpy.arange",
"numpy.ravel",
"numpy.corrcoef",
"matplotlib.p... |
jjuraska/slug2slug | [
"3a1629a05ad6204aac07c24c6250b06311bc28b2"
] | [
"data_loader.py"
] | [
"import os\nimport io\nimport random\nimport string\nimport re\nimport json\nimport pandas as pd\nimport numpy as np\nfrom collections import OrderedDict\nimport nltk\nfrom nltk import FreqDist\nfrom nltk.tokenize import word_tokenize\nfrom nltk.stem.wordnet import WordNetLemmatizer\n\nimport config\n\n\nEMPH_TOKEN... | [
[
"numpy.concatenate",
"numpy.array",
"pandas.DataFrame",
"pandas.read_json",
"pandas.read_csv"
]
] |
MasazI/gan_basic | [
"37e23e1799616bafa18527aeffc1d3c8e7c5f2ef"
] | [
"wface/sampling_reverse.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\nimport os\nimport numpy as np\nfrom sklearn.neighbors import NearestNeighbors\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nimpor... | [
[
"tensorflow.train.start_queue_runners",
"tensorflow.train.get_checkpoint_state",
"tensorflow.python.platform.gfile.Exists",
"tensorflow.global_variables_initializer",
"matplotlib.pyplot.savefig",
"tensorflow.train.Saver",
"tensorflow.ConfigProto",
"numpy.random.randint",
"tenso... |
Retrocamara42/reinforcement_learning_intro_exercices | [
"da3357801ecff91012185b105e8963704ac1316c"
] | [
"exercise_2_3.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nnumAcciones = 10\nepsilon = 0.1\nnum_pasos = 10000\nalfa = 0.1\nmu = [0,0,0,0,0,0,0,0,0,0]\nnum_exper = 100\n\ndef banditArm10(action):\n assert(len(mu)==numAcciones)\n sigma = 1\n s=np.random.normal(mu[action],sigma,1)\n retur... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"numpy.random.normal",
"numpy.random.random"
]
] |
ledbagholberton/Neural-Transfer | [
"b2996dd2e970ce498e3743b55f3add8786f49b22"
] | [
"8-main.py"
] | [
"#!/usr/bin/env python3\n\nimport matplotlib.image as mpimg\nimport numpy as np\nimport tensorflow as tf\n\nNST = __import__('8-neural_style').NST\n\n\nif __name__ == '__main__':\n style_image = mpimg.imread(\"starry_night.jpg\")\n content_image = mpimg.imread(\"golden_gate.jpg\")\n\n np.random.seed(0)\n ... | [
[
"numpy.random.seed",
"matplotlib.image.imread",
"tensorflow.contrib.eager.Variable"
]
] |
wangzheallen/3DMPPE_POSENET_RELEASE | [
"9fad1f6a95041cc75e70664821a4851e79348745"
] | [
"common/utils/vis.py"
] | [
"import os\nimport cv2\nimport numpy as np\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nfrom config import cfg\n\ndef vis_keypoints(img, kps, kps_lines, kp_thresh=0.4, alpha=1):\n\n # Convert from plt 0-1 RGBA colors to 0-255 BGR colors for opencv.\n cma... | [
[
"numpy.array",
"matplotlib.pyplot.get_cmap",
"numpy.copy",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
magnetron/pyleecan | [
"2a3338f4ab080ad6488b5ab8746c3fea1f36f177"
] | [
"Tests/Methods/Slot/test_SlotW29_meth.py"
] | [
"# -*- coding: utf-8 -*-\nfrom unittest import TestCase\n\nfrom ....Classes.Segment import Segment\n\nfrom ....Classes.SlotW29 import SlotW29\nfrom numpy import ndarray, arcsin, exp\nfrom ....Classes.LamSlot import LamSlot\nfrom ddt import ddt, data\nfrom ....Methods.Slot.Slot.comp_height import comp_height\nfrom .... | [
[
"numpy.arcsin"
]
] |
dalakada/TwiCSv2 | [
"40672a99a201f6e2aab9dd085e1f4a29e8253f3b",
"40672a99a201f6e2aab9dd085e1f4a29e8253f3b"
] | [
"stats_eddie/SVM.py",
"production_code/phase2_Trie_baseline_reintroduction_effectiveness.py"
] | [
"\n# coding: utf-8\nimport pandas as pd\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn import svm\nfrom scipy import stats\n\nclass SVM1():\n def __init__(self,train):\n\n #train the algorithm once\n self.train = pd.read_csv(train,delimiter=\",\",sep='\\s*,\\... | [
[
"pandas.read_csv",
"sklearn.svm.SVC"
],
[
"scipy.stats.zscore",
"scipy.spatial.distance.euclidean",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"sklearn.cluster.KMeans",
"sklearn.metrics.silhouette_score",
"scipy.spatial.distance.cosine",
"pandas.concat",
"pan... |
pizza654321/pandas | [
"abf1af545ef8feac46d8927f1fe10dc21312b840"
] | [
"pandas/tests/io/xml/test_xml.py"
] | [
"from __future__ import annotations\n\nfrom io import (\n BytesIO,\n StringIO,\n)\nfrom lzma import LZMAError\nimport os\nfrom urllib.error import HTTPError\nfrom zipfile import BadZipFile\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat._optional import import_optional_dependency\nimport pandas.uti... | [
[
"pandas._testing.assert_produces_warning",
"pandas.DataFrame",
"pandas.io.xml.read_xml",
"pandas.compat._optional.import_optional_dependency",
"pandas._testing.assert_frame_equal",
"pandas._testing.ensure_clean",
"pandas.util._test_decorators.skip_if_installed",
"pandas.util._test_... |
davestanley/animated-succotash | [
"174f08063c222ead153bf9db67c75e2843301912"
] | [
"app/utils_EDAplots.py"
] | [
"\n\n\ndef plotbar_train_dev(myvar,Ntrain,Ndev,varname,xlabel='Article #'):\n \"\"\"Old version with limited axis labels\"\"\"\n # Import fig stuff\n import matplotlib.pyplot as plt\n from matplotlib.pyplot import figure\n\n figure(num=None, figsize=(15, 4),facecolor='w', edgecolor='k')\n barlist ... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
Vivek2018/OSM_Building-Detection-Custom-Repo | [
"278b1f5a46e49cb547162d495979056c36945e43"
] | [
"Archive/floodFillPrototype.py"
] | [
"import cv2\nimport queue\nimport numpy as np\nimport math\n\nTHRESHOLD = 25\n\nFILENAME = 'diff_hue'\nimage = cv2.imread(FILENAME + '.png')\nheight = image.shape[0]\nwidth = image.shape[1]\n\n# used for smoothing out image.\nkernel = np.ones((5, 5), np.float32) / 25\n\ndef RGB_distance_threshold(first_rgb, second_... | [
[
"numpy.array",
"numpy.ones",
"numpy.array_equal",
"numpy.absolute"
]
] |
ComplexCity/policosm | [
"548d4d694df49603f91cd45af7fe50ced79aea68"
] | [
"examples/drawBuildingsMatplotlib.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''\nCreated in February 2017 in ComplexCity Lab\n\n@author: github.com/fpfaende\n\nwhat it does\nclean roads graph created from osm file\n\nparameters\ngraph\n\nhow it works\n1 - remove nodes without geographic informations (latitude or longitude)\n2 - remove self refer... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
makinarocks/Hierarchical-Actor-Critic-HAC-PyTorch | [
"1533356e8ce243d9f589a80b18b6a5016ddd52eb"
] | [
"HAC.py"
] | [
"import torch\nimport numpy as np\nfrom DDPG import DDPG\nfrom utils import ReplayBuffer\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\nclass HAC:\n def __init__(self, k_level, H, state_dim, action_dim, render, threshold, \n action_bounds, action_offset, state_b... | [
[
"numpy.random.uniform",
"numpy.random.normal",
"torch.cuda.is_available",
"numpy.random.random_sample"
]
] |
baicenxiao/Shaping-Advice | [
"a5de626792dc691f301ae6c5c4384931318c0aba"
] | [
"maddpg/trainer/maddpg_spread.py"
] | [
"import numpy as np\nfrom numpy import linalg as LA\nimport random\nimport tensorflow as tf\nimport maddpg.common.tf_util as U\n\nfrom maddpg.common.distributions import make_pdtype\nfrom maddpg import AgentTrainer\nfrom maddpg.trainer.replay_buffer import ReplayBuffer\n\n\ndef discount_with_dones(rewards, dones, g... | [
[
"tensorflow.square",
"numpy.array",
"numpy.arccos",
"numpy.linalg.norm",
"tensorflow.concat",
"numpy.zeros",
"tensorflow.train.AdamOptimizer",
"tensorflow.group",
"numpy.sum",
"numpy.mean",
"numpy.std",
"tensorflow.variable_scope",
"tensorflow.placeholder",
... |
will-yx/CellSeg-CRISP | [
"cf2270ae766fa378f2c83fe26f3c115e40670180"
] | [
"src/cvstitch_plane.py"
] | [
"# cvstitch.py\n# ---------------------------\n# Contains the logic for stitching masks. See class doc for details.\n\nimport numpy as np\nimport cv2\n\nimport itertools\nfrom collections import Counter\nfrom operator import itemgetter\n\nfrom scipy.ndimage.morphology import binary_fill_holes\n\nfrom ctypes import... | [
[
"numpy.ones_like",
"numpy.where",
"numpy.concatenate",
"numpy.max",
"numpy.count_nonzero",
"numpy.zeros_like",
"numpy.empty",
"numpy.add.reduce",
"matplotlib.pyplot.subplots",
"numpy.logical_and",
"matplotlib.pyplot.Axes",
"numpy.arange",
"numpy.column_stack",
... |
Gjjring/starr | [
"2f2116b56c5fb05c91e9fe0aff230553279c7f60"
] | [
"src/starr/physics_component.py"
] | [
"import numpy as np\nimport itertools\nclass PhysicsComponent():\n\n def __init__(self, mass, static=False):\n #self.parent = parent\n self.static = static\n self.mass = mass\n self.velocity = np.zeros((2))\n self.acceleration = np.zeros((2))\n self.previous_collisions =... | [
[
"numpy.linalg.norm",
"numpy.zeros"
]
] |
LBNL-ETA/fmi-for-power-system | [
"7f1818278226a4069a6b90a9b3c4045ebad5f5d5"
] | [
"tests/005_multiplier_with_cyme/simulation.py"
] | [
"# coding: utf-8\nfrom pyfmi import load_fmu\nfrom pyfmi.fmi_coupled import CoupledFMUModelME2\n\n# Load CSV reader FMU\nprint('Loading the csv reader (server ME FMU) ...')\ncyme = load_fmu('cyme/simulator.fmu', log_level=7)\ncyme.setup_experiment(start_time=0, stop_time=20)\n\nprint('Loading the multiplier (functi... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
chrisxthe/financial-data-structures | [
"add660f968f2cd72a733ab597b16ecc2d9cdec0b"
] | [
"main.py"
] | [
"# Author: Jacques Joubert\n# Email: jacques@quantsportal.com\n\n\"\"\"\nAdvances in Financial Machine Learning\nMarcos Lopez De Prado\n\nChapter 2: Financial Data Structures\nIn order to build any of the projects mentioned in the book, we must first\ncreate the various types of structured data from the unstructure... | [
[
"pandas.to_datetime",
"numpy.array",
"pandas.DataFrame",
"pandas.concat",
"pandas.read_csv"
]
] |
mtezzele/BladeX | [
"94cb3145d9174cb711de90b80928cb5799fba039"
] | [
"bladex/blade.py"
] | [
"\"\"\"\nModule for the blade bottom-up parametrized construction.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\nclass Blade(object):\n \"\"\"\n Bottom-up parametrized blade construction.\n \n Given the following parameters of a propeller blade:... | [
[
"numpy.sin",
"numpy.dot",
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"numpy.tan",
"matplotlib.pyplot.figure",
"numpy.radians",
"numpy.arctan",
"numpy.vstack",
"numpy.cos",
"matplotlib.pyplot.axis"
]
] |
Jiajie-Mei/tensorflow-generative-model-collections | [
"028d8e8aaf9d9954858cfbe33f57426a3e976468"
] | [
"snippets/scipy_and_iamgeio.py"
] | [
"from scipy.misc import imsave, imread\nimport imageio\nimport numpy as np\nimport pickle\nimport tensorflow as tf\n\n\n# array = imread('23.png')\n# array = array.astype(np.float64) / 255.0\narray = pickle.load(open('pixels.pickle', 'rb'))\nprint(array, array.dtype)\nprint(np.max(array), np.mean(array), np.min(arr... | [
[
"numpy.max",
"numpy.min",
"numpy.mean",
"numpy.abs",
"numpy.clip",
"scipy.misc.imsave"
]
] |
yashppawar/Fun-Effects | [
"7e1ad63b552c05455245b31f063f7c26d77d8255"
] | [
"helper/face_detector.py"
] | [
"\nimport cv2\nimport numpy as np\n\ndef get_face_detector():\n \n modelFile = \"models/res10_300x300_ssd_iter_140000.caffemodel\"\n configFile = \"models/deploy.prototxt\"\n model = cv2.dnn.readNetFromCaffe(configFile, modelFile)\n \n return model\n\ndef find_faces(img, model):\n \n h, w = img.... | [
[
"numpy.array"
]
] |
dewyeon/toy2d | [
"e84f1b8b951bb1e85cb38ce5c4aae8734d6ed7de"
] | [
"baselines/csflow/custom_datasets/loader.py"
] | [
"import os\nfrom PIL import Image\nimport numpy as np\nimport torch\nfrom torchvision.io import read_video, write_jpeg\nfrom torch.utils.data import Dataset\nfrom torchvision import transforms as T\n\n\n__all__ = ('MVTecDataset', 'StcDataset')\n\n\n# URL = 'ftp://guest:GU.205dldo@ftp.softronics.ch/mvtec_anomaly_det... | [
[
"torch.zeros",
"numpy.concatenate",
"numpy.array",
"torch.std",
"torch.tensor",
"torch.load",
"torch.mean"
]
] |
simonsmh/yolact | [
"e1726ea18eb5b64d98ab91a72ec07b29c8c38650"
] | [
"layers/box_utils.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nfrom ..utils import timer\n\nfrom ..data import cfg\n\n@torch.jit.script\ndef point_form(boxes):\n \"\"\" Convert prior_boxes to (xmin, ymin, xmax, ymax)\n representation for comparison to point form ground truth data.\n Args:\n boxes: (tensor) center-size def... | [
[
"torch.cat",
"torch.min",
"torch.arange",
"torch.max",
"torch.clamp",
"torch.log",
"torch.exp"
]
] |
andreamunafo/automatic_control | [
"dd1d89f732bfd8d95b0ebef6fe99df29b18a1fc2"
] | [
"classical_control_theory/intro_to_control_theory.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 02_Intro_to_control_theory.ipynb (unless otherwise specified).\n\n__all__ = ['Car', 'LinearCar', 'step', 'delta', 'ramp_as_impulses']\n\n# Cell\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Cell\nclass Car:\n _g = 9.8 # Gravity\n\n ... | [
[
"numpy.sin",
"numpy.array",
"numpy.isscalar",
"numpy.cos"
]
] |
dimahwang88/py-mcftracker | [
"b7e845efa3c0f560fe59f2d1c8765087774e78e5",
"b7e845efa3c0f560fe59f2d1c8765087774e78e5"
] | [
"bbox.py",
"pfe/player-feature-extractor/torchreid/models/inceptionresnetv2.py"
] | [
"import numpy as np\n\nclass Box(object):\n def __init__(self, tlbr, confidence, transform, imsize):\n self.tlbr = np.asarray(tlbr, dtype=np.float)\n self.confidence = float(confidence)\n self.transform = transform\n self.size = imsize\n\n def to_tlwh(self):\n tlbr = self.tl... | [
[
"numpy.asarray"
],
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
zzzkk2009/anti-spoofing | [
"ac3992547c430619e236b338575109d7ecbba654"
] | [
"train-mtcnn-zq-mxnet/core/minibatch.py"
] | [
"import cv2\nimport threading\nfrom tools import image_processing\nimport numpy as np\nimport math\n\nclass MyThread(threading.Thread):\n def __init__(self, func, args=()):\n super(MyThread, self).__init__()\n self.func = func\n self.args = args\n def run(self):\n self.ims, self.la... | [
[
"numpy.array",
"numpy.vstack"
]
] |
MQXB7/COMP0064 | [
"15b60d457ae9cda088000b65c78afe03ad5708fd"
] | [
"code/get_lat_long.py"
] | [
"import pandas as pd \nfrom pathlib import Path\n\nfolder = Path('{Path to directory}/Online-Ponzi-Schemes/data/getaddress/').rglob('*.csv')\nfiles = [x for x in folder]\n\nfor name in files:\n\tdf = pd.read_csv(name, usecols=[0,1], header=0)\n\tprint(name, \" \", df.head(1))"
] | [
[
"pandas.read_csv"
]
] |
bianzhenkun/IntelligentShip | [
"ea8a4c1cd0bed11be63d2d10bb7e4cb03e001ed3"
] | [
"vis_simulator/script/boat_simulator.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\n\nBoat simulator\n\nauthor SheffieldWang\n\n\"\"\"\n#import basic\nimport math\nimport numpy as np\nimport bisect\n\n#import ROS\nimport rospy\nfrom nav_msgs.msg import Path\nfrom geometry_msgs.msg import PoseStamped\nfrom control.msg import Command\n\ndt = 0.1 # time tick[s]\nL = ... | [
[
"numpy.deg2rad",
"numpy.radians"
]
] |
Tom-Ryder/VIforSSMs | [
"eb96596c867afe79975e8e98a84cd159c32ca22d"
] | [
"lotka_volterra_partial.py"
] | [
"import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport tensorflow as tf\n# python data types\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\nfrom tensorflow.python.client import timeline\nfrom tensorflow.python.ops import c... | [
[
"tensorflow.exp",
"numpy.tile",
"tensorflow.reshape",
"tensorflow.scatter_nd",
"tensorflow.sqrt",
"tensorflow.tile",
"tensorflow.global_variables_initializer",
"tensorflow.InteractiveSession",
"tensorflow.set_random_seed",
"numpy.concatenate",
"tensorflow.shape",
"t... |
PascalIversen/gluon-ts | [
"60f7d39a965d77d583883d3ddde75d6510c06737"
] | [
"test/trainer/test_model_averaging.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ... | [
[
"numpy.exp"
]
] |
seankmartin/nengo | [
"de345f6d201ac5063fc4c5a7e56c0b16c26785c1"
] | [
"nengo/networks/tests/test_circularconv.py"
] | [
"import numpy as np\nimport pytest\n\nimport nengo\nfrom nengo.networks.circularconvolution import circconv, transform_in, transform_out\nfrom nengo.utils.numpy import rms\n\n\n@pytest.mark.parametrize(\"invert_a\", [True, False])\n@pytest.mark.parametrize(\"invert_b\", [True, False])\ndef test_circularconv_transfo... | [
[
"numpy.dot",
"numpy.sqrt"
]
] |
noetits/ophelia | [
"49f4b1495bbe6c768806cf3f1b0415f73e06008c"
] | [
"perceptual_experiment/compute_score.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n# df.iloc[:,-8:]\n\n\ndef idx_to_case_xy(idx):\n x=((idx/100).astype(int)/100*5).astype(int)\n y=((idx-100*(idx/100).astype(int))/100*5).astype(int)\n\n return x,y\n\n\n# df['Answer.selected_idx']\n# df['Input... | [
[
"numpy.max",
"numpy.array",
"pandas.unique",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.load",
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.subplots",
"numpy.random.randint",
"numpy.arange",
"numpy.sqrt",
"pandas.con... |
dianlujitao/WGAN-GP | [
"d50c26013aca2a6ca7d2c606125614f5bf2c2b01"
] | [
"utils.py"
] | [
"import torch\nimport matplotlib.pyplot as plt\nimport torchvision.utils as vutils\n\n\ndef visualize_data(dataloader):\n batch = next(iter(dataloader))\n plt.figure(figsize=(8, 8))\n plt.axis(\"off\")\n plt.title(\"Training images\")\n images = vutils.make_grid(batch[0][:64], normalize=True, range=(... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"torch.randn",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
brettkoonce/datasets | [
"55bb2a80ab674c2f6254ac74d90bd6e5f478e895"
] | [
"tensorflow_datasets/core/file_format_adapter_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.array",
"tensorflow.enable_eager_execution",
"tensorflow.test.main"
]
] |
zheng-xing/highresnet | [
"4c2e91f993dbdcb63f67837315eded5e5931518e"
] | [
"highresnet/modules/residual.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom .convolution import ConvolutionalBlock\n\n\nBATCH_DIM = 0\nCHANNELS_DIM = 1\n\n\nclass ResidualBlock(nn.Module):\n def __init__(\n self,\n in_channels,\n out_channels,\n num_layers,\n dilation,\n dimens... | [
[
"torch.nn.Sequential",
"torch.cat",
"torch.nn.ModuleList"
]
] |
PawelA/DALI | [
"3a4fc3373b119075e81a55eeb5dcc92e1ab1315a"
] | [
"docs/examples/use_cases/tensorflow/resnet-n/nvutils/image_processing.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.image.central_crop",
"tensorflow.image.random_hue",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.clip_by_value",
"tensorflow.stack",
"tensorflow.image.decode_jpeg",
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.io.FixedLenFeature",
"tensorflow.... |
giovp/SingleCellOpenProblems | [
"8b4243a71f9e4553558b019a08eb46090cd8445e"
] | [
"openproblems/tasks/spatial_decomposition/methods/nnls.py"
] | [
"from ....tools.decorators import method\nfrom ....tools.utils import check_version\nfrom .._utils import normalize_coefficients\nfrom .._utils import obs_means\n\nimport numpy as np\nimport pandas as pd\n\n\n@method(\n method_name=\"NNLS\",\n paper_name=\"Solving Least Squares Problems\",\n paper_url=\"ht... | [
[
"scipy.optimize.nnls",
"scipy.sparse.issparse",
"numpy.zeros",
"pandas.DataFrame"
]
] |
dancoombs/fastai | [
"762aa0847fa8a7cec13cceab7e50d1c9ace77ed0"
] | [
"nbs/vgg16.py"
] | [
"from __future__ import division, print_function\n\nimport os, json\nfrom glob import glob\nimport numpy as np\nfrom scipy import misc, ndimage\nfrom scipy.ndimage.interpolation import zoom\n\nfrom keras.utils.data_utils import get_file\nfrom keras import backend as K\nfrom keras.layers.normalization import BatchNo... | [
[
"numpy.array",
"numpy.argmax"
]
] |
sevimcaliskann/is_fid_score | [
"24d6b2844a9e85e66e7c35362e7eca9f67abde33"
] | [
"inception_score.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\nimport torch.utils.data\n\nfrom torchvision.models.inception import inception_v3\n\nimport numpy as np\nfrom scipy.stats import entropy\n\nfrom inception import InceptionV3\nimport torchvision.datasets as... | [
[
"numpy.empty",
"scipy.stats.entropy",
"numpy.mean",
"torch.from_numpy",
"scipy.misc.imresize",
"numpy.std",
"numpy.stack",
"torch.nn.functional.softmax"
]
] |
yoavkt/causallib | [
"cd258bd8c7ff5b5323a1f649ee7c887dcecff991"
] | [
"causallib/survival/univariate_curve_fitter.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom typing import Optional\nfrom sklearn.base import BaseEstimator as SKLearnBaseEstimator\nfrom .survival_utils import safe_join\nfrom .regression_curve_fitter import RegressionCurveFitter\n\n\nclass UnivariateCurveFitter:\n def __init__(self, learner: Optional[SKLearn... | [
[
"pandas.Index",
"numpy.cumprod",
"numpy.asarray",
"numpy.zeros",
"numpy.interp",
"numpy.finfo",
"numpy.abs",
"pandas.Series",
"numpy.unique"
]
] |
aprasad16/text | [
"c1607c98c70534abc3c75eb231830ce6d87be645"
] | [
"tensorflow_text/python/ops/split_merge_from_logits_tokenizer.py"
] | [
"# coding=utf-8\n# Copyright 2021 TF.Text Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.python.eager.monitoring.Counter",
"tensorflow.python.framework.ops.name_scope",
"tensorflow.python.ops.ragged.ragged_tensor.RaggedTensor.from_row_splits",
"tensorflow.python.platform.resource_loader.get_path_to_datafile"
]
] |
nhatminh46vn/transformers | [
"912f6881d2b69f180522172a5283702bd8c41d9c"
] | [
"src/transformers/models/bart/modeling_tf_bart.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. team.\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.or... | [
[
"tensorflow.ones",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.math.not_equal",
"tensorflow.broadcast_to",
"numpy.cos",
"tensorflow.control_dependencies",
"tensorflow.nn.softmax",
"tensorflow.identity",
"tensorflow.cast",
... |
robertosousa1/streamlit-app | [
"9722d784b70658c712a71246079f03ce0a90c2ec"
] | [
"display_dataframe.py"
] | [
"import streamlit as st\nimport pandas as pd\n\ndef main():\n st.title('Hello, Streamlit!')\n st.header('A simple repository containing some steps to get started with the Stream library.')\n st.text('\\n')\n st.subheader('For more details see the documentation:')\n st.subheader('https://docs.streamli... | [
[
"pandas.read_csv"
]
] |
YangRui2015/rlkit_pro | [
"fccde0877a0da043525f7239bf703995107a8e80"
] | [
"rlkit/core/eval_util.py"
] | [
"\"\"\"\nCommon evaluation utilities.\n\"\"\"\n\nfrom collections import OrderedDict\nfrom numbers import Number\n\nimport numpy as np\n\nimport rlkit.pythonplusplus as ppp\n\n\ndef get_generic_path_information(paths, stat_prefix=''):\n \"\"\"\n Get an OrderedDict with a bunch of statistic names and values.\n... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.array",
"numpy.min",
"numpy.mean",
"numpy.std",
"numpy.hstack",
"numpy.vstack"
]
] |
qipanyang/DQN-tensorflow | [
"6514dfdb01f9b3dbfd53029f19aa35d5188fba2f"
] | [
"main.py"
] | [
"from __future__ import print_function\nimport random\nimport tensorflow as tf\n\nfrom dqn.agent import Agent\nfrom dqn.environment import GymEnvironment, SimpleGymEnvironment\nfrom config import get_config\n\nflags = tf.app.flags\n\n# Model\nflags.DEFINE_string('model', 'm1', 'Type of model')\nflags.DEFINE_boolean... | [
[
"tensorflow.set_random_seed",
"tensorflow.ConfigProto",
"tensorflow.app.run",
"tensorflow.test.is_gpu_available"
]
] |
bor9/estudiando_el_kay | [
"6e07908b8b0b5a5166dadce30001e6100e8304c3"
] | [
"figuras/problem_8_28_code.py"
] | [
"import numpy as np\nfrom scipy import signal, linalg, optimize\n\n# hd es la señal deseada dada, con hd.shape = (N, )\n# el filtro a diseñar tiene función de transferencia con q coeficientes\n# en el numerador y p coeficientes en el denominador, con p = q + 1.\n\n# función no lineal en a a optimizar: hd^T @ A @ (A... | [
[
"numpy.concatenate",
"scipy.linalg.toeplitz",
"numpy.zeros",
"scipy.signal.lfilter",
"scipy.linalg.inv",
"scipy.optimize.minimize"
]
] |
sekunder/ergm | [
"b60bc2b1cb64d2969bcab2dbe75511eb732a113d"
] | [
"util.py"
] | [
"\"\"\"\nutility functions for ergm\n\"\"\"\nimport numpy as np\nimport datetime\nimport sys\nimport networkx as nx\nfrom itertools import combinations\n\n\n# from scipy import sparse\n\ndef log_msg(*args, out=sys.stdout, **kwargs):\n \"\"\"Print message m with a timestamp if out is not None.\"\"\"\n if out:\... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.sin",
"numpy.zeros",
"numpy.diff",
"numpy.multiply",
"numpy.where",
"numpy.arange",
"numpy.sqrt",
"numpy.cos",
"numpy.hstack",
"numpy.linspace"
]
] |
kosho2013/pixelfly-master | [
"345db4fb9a4c5f36a85ff4a65434762545cca23c"
] | [
"src/models/modules/attention/blocksparse_matmul.py"
] | [
"# This is a copy of https://github.com/openai/triton/blob/master/python/triton/ops/blocksparse/matmul.py\r\n# with a one-line fix the bug https://github.com/openai/triton/issues/266\r\nimport triton\r\nimport triton.language as tl\r\nimport triton._C.libtriton as libtriton\r\nimport torch\r\n\r\n\r\n@triton.jit\r\... | [
[
"torch.zeros",
"torch.cat",
"torch.stack",
"torch.arange",
"torch.empty_like",
"torch.from_numpy",
"torch.sum",
"torch.is_autocast_enabled",
"torch.tensor",
"torch.ones_like",
"torch.zeros_like",
"torch.empty",
"torch.cumsum"
]
] |
shiquanyang/MINERVA | [
"6cabd380a9e7114c26c10ef3fd74050ec036d547"
] | [
"code/model/trainer.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom tqdm import tqdm\nimport json\nimport time\nimport os\nimport logging\nimport numpy as np\n# import tensorflow as tf\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nfrom code.model.agent import Agent\nfrom code.options impo... | [
[
"tensorflow.compat.v1.nn.moments",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.clip_by_global_norm",
"numpy.mean",
"tensorflow.compat.v1.trainable_variables",
"tensorflow.compat.v1.reset_default_graph",
"tensorflow.compat.v1.constant",
"tensorflow.compat.v1.pl... |
ZJU-Fangyin/KCL | [
"004f5681b77e4e75c791c909696fdb8a208501a2"
] | [
"code/initial/dataloader.py"
] | [
"#!/usr/bin/python3\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport torch\n\nfrom torch.utils.data import Dataset\n\n\nclass TrainDataset(Dataset):\n def __init__(self, triples, nentity, nrelation, negative_sample_siz... | [
[
"numpy.concatenate",
"torch.cat",
"torch.stack",
"numpy.random.randint",
"torch.LongTensor",
"numpy.in1d",
"torch.Tensor"
]
] |
HsinYiHung/HARK_HY | [
"086c46af5bd037fe1ced6906c6ea917ed58b134f"
] | [
"CGMPortfolio/Code/Python/Simulations/AgeMeans.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Dec 10 15:10:36 2019\n\n@author: mateo\n\"\"\"\n\nimport HARK.ConsumptionSaving.ConsPortfolioModel as cpm\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\n\n# %% Set up figure path\nimport sys,os\n\n# Determine if this is being run as a stan... | [
[
"numpy.array",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.p... |
stephen-derosa/opencv-velocity-prediction | [
"96c5738d6424334def0ce9c4ea06fac9dfbecc27"
] | [
"old/vel_calc_sample.py"
] | [
"import numpy as np\nimport cv2 as cv\nimport argparse\nimport os\nfrom time import sleep\n\ncount = 0\ntotal_x = 0\ntotal_y = 0\n\nfps = 60\nin_per_pixel = (11+8*12)/(805-455)\n\nmax_value = 255\n\nlow_H = 0\nlow_S = 0\nlow_V = 0\nhigh_H = 255\nhigh_S = 255\nhigh_V = 255\nframe_num = 0\n\nwindow_capture_name = 'Fr... | [
[
"numpy.ones",
"numpy.argwhere"
]
] |
Srijay-lab/segment2tissue | [
"d3cd837f4381eba58df798800bdc5503bdf6db22"
] | [
"backup_files/segment2tissue_9d1g.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport argparse\nimport os\nimport json\nimport glob\nimport random\nimport collections\nimport math\nimport time\n# visualize image\nimport matplotlib.pypl... | [
[
"tensorflow.nn.conv2d",
"tensorflow.decode_base64",
"tensorflow.image.random_flip_left_right",
"tensorflow.group",
"tensorflow.encode_base64",
"tensorflow.extract_image_patches",
"tensorflow.gradients",
"tensorflow.reshape",
"tensorflow.zeros_like",
"tensorflow.clip_by_valu... |
hsspratt/Nott-Hawkeye1 | [
"178f4f0fef62e8699f6057d9d50adfd61a851047"
] | [
"VectorFunctions.py"
] | [
"# %% Imports\n\nfrom sympy import Matrix, init_printing\nimport sympy as sym\nimport sympy.printing as printing\nfrom sympy import Integral, Matrix, pi, pprint\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits import mplot3d\nimport functions as f\n\n# %% All Functions and Definitions relatin... | [
[
"numpy.max",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.sin",
"numpy.sum",
"numpy.tan",
"numpy.any",
"numpy.cos",
"numpy.linspace",
"numpy.cross"
]
] |
mengban/traffic-src-spyder | [
"7517e850469daa524228201cf14e56fa2fa3885a"
] | [
"src/data_pro.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu May 31 14:53:58 2018\n\n@author: cadu\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport time\ndef loaddata(Filename):\n data = pd.read_csv(Filename,sep=',',header = None)\n return np.array(data)\ndef get_tt():\n# data... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
ZerounNet/envpool | [
"49780e7caceda5f781072d3ef0cbb8aae082595f"
] | [
"envpool/atari/api_test.py"
] | [
"# Copyright 2021 Garena Online Private 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# Unless required by applic... | [
[
"numpy.testing.assert_allclose",
"numpy.ones",
"numpy.any",
"numpy.where",
"numpy.random.randint",
"numpy.arange",
"numpy.all"
]
] |
minrk/ggplot | [
"c90ab65b959172c4a3488893e395dc3749dd1830"
] | [
"ggplot/scales/scale_colour_gradient.py"
] | [
"from .scale import scale\nfrom copy import deepcopy\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import LinearSegmentedColormap, rgb2hex, ColorConverter\nimport numpy as np\n\n\ndef colors_at_breaks(cmap, breaks=[0, 0.25, 0.5, 0.75, 1.]):\n return [rgb2hex(cmap(bb)[:3]) for bb in breaks]\n\n\ncl... | [
[
"matplotlib.pyplot.cm.register_cmap",
"matplotlib.colors.LinearSegmentedColormap.from_list"
]
] |
firmiana/sl-quant | [
"2ef962244f66eba8ebab62aeee8f0df694f12c55"
] | [
"ex1-self_learning_quant.py"
] | [
"\"\"\"\nName: The Self Learning Quant, Example 1\n\nAuthor: Daniel Zakrisson\n\nCreated: 30/03/2016\nCopyright: (c) Daniel Zakrisson 2016\nLicence: BSD\n\nRequirements:\nNumpy\nPandas\nMatplotLib\nscikit-learn\nKeras, https://keras.io/\nbacktest.py from the TWP library. Download backtest.py a... | [
[
"numpy.set_printoptions",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.Sequential",
"numpy.max",
"numpy.nan_to_num",
"matplotlib.pyplot.savefig",
"numpy.arange",
"numpy.argmax",
"numpy.random.randint",
"numpy.column_sta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.