repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
eoincarley/iLiSA
[ "e0a734f02614724896d2a6265c1b2d2fde5d2789" ]
[ "ilisa/monitorcontrol/modeparms.py" ]
[ "\"\"\"This package is for the parameters involved in observation modes.\n\"\"\"\nimport argparse\nimport math\nimport numpy\nimport datetime\nimport warnings\n\nANTENNA_SETS = ['LBA_INNER', 'LBA_OUTER',\n 'LBA_SPARSE_EVEN', 'LBA_SPARSE_ODD',\n 'LBA_X', 'LBA_Y',\n 'HBA_D...
[ [ "numpy.linspace" ] ]
liaofuyou/CellSegmentation
[ "e73e5d6f65e145d47eeececf1590fa50ca26c5d6" ]
[ "preprocess_dsb2018.py" ]
[ "import os\nfrom glob import glob\n\nimport cv2\nimport numpy as np\nfrom tqdm import tqdm\n\n\ndef main():\n img_size = 96\n\n paths = glob('inputs/stage1_train/*')\n\n os.makedirs('inputs/dsb2018_%d/images' % img_size, exist_ok=True)\n os.makedirs('inputs/dsb2018_%d/masks/0' % img_size, exist_ok=True)...
[ [ "numpy.zeros", "numpy.tile" ] ]
lixinsu/multi_span
[ "dcdc57da11a350e0d1521bc3039318b3d04975a2" ]
[ "examples/run_squad.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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...
[ [ "torch.distributed.init_process_group", "torch.cuda.set_device", "numpy.random.seed", "torch.utils.data.distributed.DistributedSampler", "torch.manual_seed", "torch.utils.data.TensorDataset", "torch.utils.data.SequentialSampler", "torch.utils.data.DataLoader", "torch.utils.data...
Kaixhin/GUDRL
[ "c13fa605a9ffb4c2932390b0b86e476aec62c142" ]
[ "policy.py" ]
[ "from typing import Dict, List, Optional, Tuple\n\nimport haste_pytorch as haste\nimport torch\nfrom torch import Tensor, nn\nfrom torch.distributions import Categorical, Distribution\nfrom torch.nn import functional as F\n\n\n# Module to embed a single command\nclass CommandEmbedding(nn.Module):\n def __init__(se...
[ [ "torch.zeros", "torch.nn.TransformerEncoderLayer", "torch.nn.Linear", "torch.distributions.Categorical", "torch.rand", "torch.nn.functional.one_hot", "torch.stack" ] ]
jiffyclub/scipy
[ "6a7327e8bb8248b2ea165180bc602edf1ab33dda", "e346aa55c0416b915148c35cc200a0ed74f85c0a" ]
[ "scipy/io/arff/tests/test_arffread.py", "scipy/linalg/_procrustes.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import division, print_function, absolute_import\n\nimport datetime\nimport os\nimport sys\nfrom os.path import join as pjoin\n\nif sys.version_info[0] >= 3:\n from io import StringIO\nelse:\n from cStringIO import StringIO\n\nimport numpy as np\n\nfrom numpy.testing im...
[ [ "scipy.lib._version.NumpyVersion", "numpy.testing.run_module_suite", "scipy.io.arff.arffread.read_header", "scipy.io.arff.arffread.parse_type", "scipy.io.arff.arffread.loadarff", "numpy.testing.assert_array_equal", "numpy.testing.assert_raises", "numpy.testing.assert_", "numpy....
jmnybl/keras-models
[ "5633a5414ce8fcf2a2b27a84038892f1b7fa7ecd" ]
[ "poetry.py" ]
[ "# original version: https://github.com/fchollet/keras/blob/master/examples/lstm_text_generation.py\n\n'''Example script to generate text from Nietzsche's writings.\nAt least 20 epochs are required before the generated text\nstarts sounding coherent.\nIt is recommended to run this script on GPU, as recurrent\nnetwo...
[ [ "numpy.log", "numpy.asarray", "numpy.random.multinomial", "numpy.argmax", "numpy.exp", "numpy.sum" ] ]
rhasspy/bemused_client
[ "80f7d90a4f53c9f38bc439bd0bcace7667f3331b" ]
[ "bemused_client/utils.py" ]
[ "import tensorflow as tf\nfrom tensorflow.lite.experimental.microfrontend.python.ops import (\n audio_microfrontend_op as frontend_op,\n)\n\n\ndef to_micro_spectrogram(\n audio,\n sample_rate: int = 16000,\n window_size_ms: int = 30,\n window_step_ms: int = 20,\n feature_bin_count: int = 40,\n):\n...
[ [ "tensorflow.lite.experimental.microfrontend.python.ops.audio_microfrontend_op.audio_microfrontend", "tensorflow.multiply" ] ]
cjcourt/cdesnowball
[ "ed08637a06d72d3ef83296bfb686a682df0d4443" ]
[ "chemdataextractor/relex/utils.py" ]
[ "\n# -*- coding: utf-8 -*-\n\"\"\"\nchemdataextractor.relex.utils.py\nVarious utility functions\n\"\"\"\nimport numpy as np\nfrom collections import OrderedDict\n\n\ndef match_score(pi, pj, prefix_weight=0.1, middle_weight=0.8, suffix_weight=0.1):\n \"\"\" Compute match between phrases using a dot product of vec...
[ [ "numpy.ascontiguousarray", "numpy.dot", "numpy.linalg.norm", "numpy.prod" ] ]
talonchandler/polaris
[ "3955843c40f559159145801ffcdce26f0f38ad68" ]
[ "examples/analyse.py" ]
[ "from polaris import spang, phantom, data\nfrom polaris.micro import multi\nimport numpy as np\n\n# Specify input and output\nin_folder = '/Users/Talon/local-data/2018-dispim-min/20180725_Polimaging_FixedCells_eGFP-210_R-Ph/Cell4_Processed/Registered/561/'\nout_folder = './roi2-561/'\n\n# in_folder = '/Users/Talon/...
[ [ "numpy.zeros" ] ]
agartland/lifelines_bak
[ "bd7da4621a03fe191387ca45d9f5f80b98104ffb" ]
[ "tests/test_plotting.py" ]
[ "from __future__ import print_function\n\nimport os\nimport pytest\nimport numpy as np\nfrom lifelines.estimation import NelsonAalenFitter, KaplanMeierFitter, AalenAdditiveFitter\nfrom lifelines.generate_datasets import generate_random_lifetimes, generate_hazard_rates\nfrom lifelines.plotting import plot_lifetimes\...
[ [ "numpy.linspace", "numpy.random.exponential", "numpy.random.binomial", "numpy.random.uniform", "numpy.random.randint" ] ]
acids-ircam/lottery_mir
[ "1440d717d7fd688ac43c1a406602aaf2d5a3842d" ]
[ "code/information/edge.py" ]
[ "\n# EDGE Estimator for Shannon Mutual Information\n#\n# Created by Morteza Noshad (noshad@umich.edu)\n# Current version: 4.3.1 \n# Requirements: numpy, cvxpy(v1.0.6),scipy, sklearn\n# \t\t\t\t\n# 10/1/2018\n#\n# Based on the paper: Scalable Mutual Information Estimation using Dependence Graphs\n#\n################...
[ [ "numpy.dot", "numpy.sqrt", "numpy.linspace", "numpy.squeeze", "sklearn.manifold.TSNE", "numpy.max", "numpy.mean", "numpy.reshape", "numpy.std", "sklearn.neighbors.NearestNeighbors", "numpy.zeros", "numpy.median", "numpy.random.rand", "numpy.floor", "nump...
UnibsMatt/NN
[ "25eaddc079cd08227a52fdebd95453473fcd3b29" ]
[ "Nets/BasicBlock.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass BasicBlock(nn.Module):\n def __init__(self, in_channel, out_channel):\n \"\"\"\n in_channel: canali in input\n out_channel: canali in uscita\n \"\"\"\n super(BasicBlock, self).__init__()\n self.conv2d = nn.Conv2d(in_channel...
[ [ "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm2d" ] ]
lhirschfeld/ChempropUncertaintyEstimation
[ "b42733b9541a3989529375b83a8344f775a1b7ee" ]
[ "web/app/views.py" ]
[ "\"\"\"Defines a number of routes/views for the flask app.\"\"\"\n\nfrom argparse import ArgumentParser, Namespace\nfrom functools import wraps\nimport io\nimport os\nimport sys\nimport shutil\nfrom tempfile import TemporaryDirectory, NamedTemporaryFile\nimport time\nfrom typing import Callable, List, Tuple\nimport...
[ [ "numpy.mean", "numpy.unique" ] ]
singerep/summer2021internship
[ "d113646f1e5e56bf0f30eba7f352042b72b55557" ]
[ "City Of Boston/EM_scrape.py" ]
[ "from bs4 import BeautifulSoup\nimport requests\nimport pandas as pd\nimport re\nfrom datetime import datetime\n\narticle_list = []\nPAGES = 70\n\nheaders = {\n 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0',\n}\nbase_url = \"https://elmundoboston.com/category/...
[ [ "pandas.DataFrame" ] ]
turimang/turingpatterns
[ "570fd2e441e0ab5f3e37bce99e554017886f9c33" ]
[ "MCMC.py" ]
[ "import numpy as np\nimport random\nfrom turing_anna import turing\nfrom calculate_error import calc_error\nimport os\nimport matplotlib.pyplot as plt\nimport json\n\nclass guess:\n \"\"\"\n a and b parameters chosen, and the error calculated\n \"\"\"\n def __init__(self, a, b, time, target):\n s...
[ [ "numpy.random.multivariate_normal", "matplotlib.pyplot.show", "matplotlib.pyplot.hist" ] ]
s6thseng/irrad_control
[ "7c1ee99c95b5ee465785b04edcf35bd37e09b354" ]
[ "irrad_control/irrad_interpreter.py" ]
[ "import os\nimport sys\nimport zmq\nimport time\nimport multiprocessing\nimport threading\nimport logging\nimport yaml\nimport numpy as np\nimport tables as tb\nfrom zmq.log import handlers\nfrom irrad_control import daq_config, xy_stage_config, package_path\nfrom collections import defaultdict\n\n\nclass IrradInte...
[ [ "numpy.sqrt", "numpy.std", "numpy.mean", "numpy.array", "numpy.zeros" ] ]
brunofreitasv/detection_util_scripts
[ "1135d29ca6e6dbd17d03dd30491ffee9d132470a" ]
[ "generate_pbtxt.py" ]
[ "import pandas as pd\nimport argparse\n\n\ndef pbtxt_from_classlist(l, pbtxt_path):\n pbtxt_text = ''\n\n for i, c in enumerate(l):\n pbtxt_text += 'item {\\n id: ' + str(i + 1) + '\\n display_name: \"' + str(c) + '\"\\n}\\n\\n'\n\n with open(pbtxt_path, \"w+\") as pbtxt_file:\n pbtxt_file.wri...
[ [ "pandas.read_csv" ] ]
rozim/ChessAtAGlance
[ "c4ba60ffc08e609b0673513c4191bbb6e5b14366" ]
[ "predict.py" ]
[ "import sys, os\nimport time\nimport collections\nimport tensorflow as tf\nfrom absl import app\nfrom absl import flags\nfrom absl import logging\nfrom tensorflow import keras\nimport pandas as pd\nfrom data import create_input_generator, _extract, _extract2, NUM_CLASSES\nfrom plan import load_plan\n\nFLAGS = flags...
[ [ "tensorflow.keras.models.load_model", "tensorflow.compat.v1.logging.set_verbosity" ] ]
JosephKJ/iOD
[ "7fae556667b45cf98769f0997540c60549c018a2" ]
[ "detectron2/modeling/meta_arch/rcnn.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nimport numpy as np\nimport torch\nfrom torch import nn\n\nfrom detectron2.structures import ImageList\nfrom detectron2.utils.events import get_event_storage\nfrom detectron2.utils.logger import log_first_n\nfrom detectron2.util...
[ [ "torch.device", "numpy.concatenate", "torch.Tensor" ] ]
daphnemt181/MScProject
[ "8691bf984efe08f8f12c006c307cfcba4c21aae5" ]
[ "Translation/src/experiments/fr_en_wavenet_experiment.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\nExperiment for WaveNet on translation (en->fr)\n\"\"\"\n\nimport argparse\nimport os\nimport sys\nimport timeit\nimport time\nimport cPickle as pickle\nfrom pprint import pprint\nimport codecs\n# so that we can pipe unicode\nsys.stdout = codecs.getwriter('utf8')(sys.stdout)\nsys....
[ [ "numpy.set_printoptions" ] ]
sbhal/be-fruitful
[ "30fc42c9817ce1bcfd359944034cb058f69cfe1c" ]
[ "pythonProject/todim_1992.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 7 01:49:33 2017\n\n@author: sbhal\n\"\"\"\nimport numpy as np\nfrom sklearn.preprocessing import normalize\nimport logging, sys\n\n\n\nclass todimClass:\n def __init__(self, data, n_alternatives, m_criteria, minMaxArray, weights=None, ...
[ [ "numpy.sqrt", "numpy.asarray", "numpy.set_printoptions", "sklearn.preprocessing.normalize", "numpy.argmax", "numpy.empty" ] ]
brijow/foobar-gamestop
[ "54302ab330ff5a2099c7300f943f271ea9d30b52" ]
[ "foobar/data_loader/_finnhub_data.py" ]
[ "import configparser\nimport os\nimport time\nfrom datetime import datetime, timedelta\n\nimport finnhub\nimport pandas as pd\nfrom _base import get_data_loader_conf_dir, get_or_create_raw_data_dir\n\n# Finnhub API config\nconfig = configparser.ConfigParser()\nconfig.read(os.path.join(get_data_loader_conf_dir(), \"...
[ [ "pandas.DataFrame" ] ]
jamestszhim/modals
[ "58f9966213634a6226fdc451990e9e8ce4831154" ]
[ "modals/data_util.py" ]
[ "import copy\nimport os\nimport random\nfrom pathlib import Path\n\nimport dill\nimport torch\nimport torchtext.data as data\nimport torchtext.datasets as datasets\nfrom torch.utils.data import Sampler\nfrom torchtext.vocab import GloVe\nfrom modals.setup import EMB_DIR\n\n\ndef save_txt_dataset(dataset, path):\n ...
[ [ "torch.load", "torch.save" ] ]
ZhangXinNan/models
[ "b64f67d4632b82aa881e5c9cc164f9b1423f9e22" ]
[ "official/recommendation/data_async_generation.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.gfile.ListDirectory", "numpy.random.seed", "tensorflow.gfile.Open", "tensorflow.gfile.Copy", "tensorflow.python_io.TFRecordWriter", "numpy.concatenate", "numpy.ceil", "numpy.ones", "tensorflow.gfile.MakeDirs", "numpy.random.permutation", "tensorflow.gfile.Re...
lxywizard/techx-drl-homework
[ "44521e9bff0754b12e91d2b9a2f395e22ad2851c" ]
[ "classic/fc-mnist.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport random\n\n# import mnist\nmnist = tf.keras.datasets.mnist\n(x_train, y_train), (x_test, y_test) = mnist.load_data()\nx_train, x_test = x_train / 255.0, x_test / 255.0\n\n\ndef sigmoid(x):\n return 1.0 / (1.0 + np.exp(-x))\n\n\ndef sigmoid_prime(x):\n dx = s...
[ [ "numpy.dot", "numpy.random.seed", "numpy.reshape", "numpy.random.permutation", "numpy.random.randn", "numpy.exp", "numpy.zeros" ] ]
wzong/yfinance_snapshot
[ "afcde352c9eefe74d48ecf65bf997b87cae97de1" ]
[ "analysis/yfinance_client.py" ]
[ "import datetime\nimport math\nfrom typing import Any, Dict, Iterable\n\nimport pandas as pd\nimport yfinance as yf\n\nfrom protos import yfinance_pb2 as yfpb\n\n_REQUIRED_ANALYSIS = [\n 'Growth',\n 'End Date',\n 'Earnings Estimate Avg',\n 'Revenue Estimate Avg',\n 'Earnings Estimate Growth',\n]\n\ndef GetFloa...
[ [ "pandas.isnull" ] ]
NS2LPS/pyslave
[ "adc30a4f762f42811587be1f10b08f1d2865098e" ]
[ "pyslave/drivers/rohdeschwarz/__zvb__/rszvb.py" ]
[ "\"\"\"The rszvb module exposes to Python the functions of the rszvd DLL.\"\"\"\r\nimport numpy as numpy\r\nfrom ctypes import *\r\n\r\n# Prerequisition: installed rszvb driver 32-bit\r\n\r\n# Reference to rszvb dll\r\nrszvbDLL = windll.rszvb_64\r\n\r\nclass ZVBDLLERROR(Exception):\r\n\tpass\r\n\r\niStringBufferLen...
[ [ "numpy.ctypeslib.ndpointer" ] ]
LinjianMa/cotengra
[ "ede0236891286d2f14bddc93d9692488221857b2" ]
[ "cotengra/plot.py" ]
[ "import math\nimport functools\nimport collections\n\nimport numpy as np\n\n\ndef _return_or_close_fig(fig, return_fig):\n from matplotlib import pyplot as plt\n if return_fig:\n return fig\n else:\n plt.show()\n plt.close(fig)\n\n\ndef plot_trials(\n self,\n y='score',\n colo...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.colors.to_rgb", "numpy.linspace", "numpy.empty_like", "numpy.cos", "matplotlib.pyplot.subplots", "numpy.sin", "matplotlib.colors.Normalize", "pandas.DataFrame", "matplotlib.colorbar.ColorbarBase", "matplotlib.cm.ScalarMappab...
HaroldMills/Vesper
[ "2bde3447eeb34b75cc580fbdafe7b26195a31530" ]
[ "vesper/util/signal_utils.py" ]
[ "\"\"\"Utility functions pertaining to signals.\"\"\"\n\n\nimport bisect\nimport datetime\n\nimport numpy as np\n\nfrom vesper.util.bunch import Bunch\n\n\ndef seconds_to_frames(seconds, frame_rate):\n return int(round(seconds * frame_rate))\n\n\ndef get_duration(num_samples, sample_rate):\n \n \"\"\"\n ...
[ [ "numpy.abs", "numpy.arange", "scipy.signal.resample", "numpy.all", "numpy.array", "numpy.where" ] ]
Chokerino/cclib
[ "b474599d98e9e5564bd7b817a5e4f40b5e7dd7ea" ]
[ "cclib/parser/daltonparser.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2017, the cclib development team\n#\n# This file is part of cclib (http://cclib.github.io) and is distributed under\n# the terms of the BSD 3-Clause License.\n\n\"\"\"Parser for DALTON output files\"\"\"\n\n\nfrom __future__ import print_function\n\nimport re\n\nimport n...
[ [ "numpy.array", "numpy.zeros", "numpy.empty" ] ]
jgavris/tensorflow
[ "dc6353d12fd41ec869283679dd7766ebff75c520" ]
[ "tensorflow/python/estimator/estimator_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...
[ [ "tensorflow.python.training.saver.latest_checkpoint", "tensorflow.python.estimator.estimator.Estimator", "tensorflow.python.ops.state_ops.assign_add", "tensorflow.python.training.training.SessionRunHook", "tensorflow.python.ops.variables.Variable", "tensorflow.python.client.session.Session...
zabir-nabil/eeg-p300-detection-algo-exe
[ "6f3c4848ae7b61d58d0e2cefdc568dca4572aa62" ]
[ "main.py" ]
[ "\"\"\"\nauthor: github.com/zabir-nabil\neeg p300 detection\n\"\"\"\nimport pandas as pd\nfrom optparse import OptionParser\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Rectangle\nimport numpy as np\n\n# https://web.archive.org/web/20181105231756/http://developer.choosemuse.com/tools/available-d...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.axhline", "pandas.read_csv", "matplotlib.pyplot.title", "numpy.min", "matplotlib.patches.Rectangle", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.max", "numpy.std", "matplotlib.pyplot.c...
wesleyktatum/SSTS
[ "2360bd448512f424a801b86bbd26ef1f0806765c" ]
[ "m2py/utils/seg_label_utils.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom skimage import measure\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\n\n#from m2py.utils import config\n\n\"\"\"\nThis module contains functions for sorting and grouping labels resulting\nfrom the GMM segmentation and clustering workflows. Labels and th...
[ [ "matplotlib.pyplot.legend", "numpy.expand_dims", "numpy.asarray", "numpy.squeeze", "matplotlib.pyplot.plot", "numpy.var", "numpy.histogram", "matplotlib.pyplot.tight_layout", "numpy.unique", "numpy.reshape", "numpy.std", "matplotlib.pyplot.subplot", "numpy.count...
srio/report_diaboloid_resources
[ "1c9013a397b8bb5a6d164affafb2670864f727e1" ]
[ "scripts/test_diff_sagittal_howard.py" ]
[ "import numpy\nfrom srxraylib.plot.gol import plot, set_qt\nset_qt()\n\na = numpy.loadtxt(\"diaboloid_sagittal.txt\")\nx = a[:,0].copy()\ny = a[:,1].copy()\nprint(a.shape,y.shape)\n\n# x = numpy.linspace(0, 0.015, 500)\np = 20.0 # 18.8\nq = 10.0 # 8.075\ntheta = 5e-3 # 2e-3\n\nsin2t = numpy.sin(2 * theta)\n\n#\n# s...
[ [ "numpy.sqrt", "numpy.loadtxt", "numpy.sin" ] ]
JeromeIllgner/bioInspired
[ "37017e413f53dd3a2f5a64007853a58a93308cd6" ]
[ "network/functions.py" ]
[ "import numpy as np\n\nfrom network.my_types import Data\n\n# Activation Functions\n\n\ndef null(_: float) -> float:\n \"\"\"\n Function that always returns 0\n :param _: Input value to function\n :type _: int\n :return: Always 0\n :rtype: int\n \"\"\"\n return 0\n\n\ndef sigmoid(x: float) -...
[ [ "numpy.array", "numpy.exp", "numpy.sin" ] ]
BIIG-UC3M/pMoSS
[ "f9d76b0a4c05df3189736111a1c5ced44e148b79" ]
[ "pMoSS/statistical_tests.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Jun 19 19:39:28 2018\r\n\r\n@author: egomez\r\n\"\"\"\r\nimport numpy as np\r\nimport scipy\r\nimport scipy.stats\r\nimport pandas as pd\r\n\r\ndef compare_continuous_samples(sample, groupA, grupB, measure_name, test = None):\r\n # sample: dataframe with value...
[ [ "pandas.crosstab", "pandas.concat", "scipy.stats.chi2_contingency", "numpy.str", "pandas.DataFrame", "scipy.stats.mannwhitneyu", "scipy.stats.ranksums", "numpy.array", "scipy.stats.ttest_ind", "numpy.sum" ] ]
AsquaredXIV/gs-quant
[ "702550b0f27c085844d046f492cd7e578a1bf272" ]
[ "gs_quant/timeseries/measures.py" ]
[ "# Copyright 2019 Goldman Sachs.\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in wr...
[ [ "pandas.concat", "pandas.tseries.offsets.CustomBusinessDay", "pandas.to_datetime", "pandas.merge", "pandas.Series", "numpy.unique", "numpy.power", "pandas.Timestamp.today", "pandas.tseries.holiday.Holiday", "pandas.DataFrame", "pandas.DatetimeIndex", "numpy.timedelt...
apizzuto/v2_alert_stacking_FRA
[ "6b5bd3f6cd1b5e472797a81a389a30198c64cd9f" ]
[ "francis/sensitivity_fit_functions.py" ]
[ "import numpy as np\nimport scipy as sp\nfrom scipy.optimize import curve_fit\nfrom scipy.stats import chi2\nimport pickle, sys\nfrom glob import glob\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport healpy as hp\nimport scipy.stats as st\n\nfrom francis.time_...
[ [ "scipy.stats.norm.ppf", "numpy.radians", "numpy.sqrt", "numpy.asarray", "numpy.max", "numpy.exp", "numpy.where", "scipy.optimize.curve_fit", "scipy.stats.poisson.cdf", "scipy.special.gammaincc", "numpy.unique", "numpy.argmax", "numpy.interp", "numpy.count_no...
GloryToArstotzka/Shadow-fight-2-AI
[ "37414c2034db7b8b6eb34df87f7a7ef4a743dbed" ]
[ "screen_grabber.py" ]
[ "# Done by Frannecklp\n\nimport cv2\nimport numpy as np\n#import pywintypes\nimport win32gui\nimport win32ui\nimport win32con\nimport win32api\n\n\ndef grab_screen(region=None, color='Gray'):\n hwin = win32gui.GetDesktopWindow()\n\n if region:\n left, top, x2, y2 = region\n width = x2 - left + 1...
[ [ "numpy.fromstring" ] ]
gerph/cpython
[ "98813cb03c2371789669c3d8debf8fca2a344de9" ]
[ "Lib/test/pickletester.py" ]
[ "import collections\nimport copyreg\nimport dbm\nimport io\nimport functools\nimport os\nimport math\nimport pickle\nimport pickletools\nimport shutil\nimport struct\nimport sys\nimport threading\nimport unittest\nimport weakref\nfrom textwrap import dedent\nfrom http.cookies import SimpleCookie\n\ntry:\n import...
[ [ "numpy.arange", "numpy.testing.assert_equal" ] ]
jeremysmith244/aipnd-project
[ "b86a61e4e7517b95877f16394d54208a286167dd" ]
[ "predict.py" ]
[ "from PIL import Image\nimport numpy as np\nimport torch\nimport argparse\nfrom collections import OrderedDict\nfrom torch import nn\nfrom torchvision import models\nimport json\n\n\ndef process_image(image):\n\n ''' Scales, crops, and normalizes a PIL image for a PyTorch model,\n returns an Numpy array\n...
[ [ "torch.nn.LogSoftmax", "torch.load", "torch.tensor", "torch.exp", "torch.nn.Linear", "torch.device", "torch.nn.ReLU", "numpy.array" ] ]
kSahatova/MULAN-XAI
[ "7f2ede7cc8ad4e772a3cfe7d52f0a710d5c89d5a" ]
[ "maskrcnn/modeling/roi_heads/box_head/roi_box_predictors.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nfrom torch import nn\nfrom maskrcnn.config import cfg\nimport numpy as np\n\n\nclass FPNPredictor(nn.Module):\n def __init__(self):\n super(FPNPredictor, self).__init__()\n num_classes = cfg.MODEL.ROI_BOX_HEAD.NUM_CLASSES\n ...
[ [ "torch.nn.init.constant_", "torch.nn.Linear", "numpy.log", "torch.nn.init.normal_" ] ]
rjfranssen/PyAlly
[ "f24d4d449dd0578f52e75365ad0ba69a572d3237" ]
[ "ally/Quote/timesales.py" ]
[ "# MIT License\n#\n# Copyright (c) 2020 Brett Graves\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, ...
[ [ "pandas.DataFrame" ] ]
angela1C/MLASProject
[ "a490e710f41ef352f2f814c66568047969e7dd4f" ]
[ "application.py" ]
[ "from flask import Flask, url_for, redirect, jsonify, render_template\n# numpy for numerical work.\nimport numpy as np\n\n# to import the models saved in the notebook, I saved the polynomials in both pickle and joblib\nimport joblib\nmodel_poly3 = joblib.load('models/model_poly3.joblib')\nmod_poly3 = joblib.load('m...
[ [ "tensorflow.keras.models.load_model" ] ]
scottprahl/iadpython
[ "df04f6446c73b5c5c1aabed072e986877f81104b" ]
[ "tests/test_performance.py" ]
[ "# pylint: disable=invalid-name\n# pylint: disable=no-self-use\n\n\"\"\"Compare speed of pure python implementation with c-library.\"\"\"\n\nimport time\nimport scipy.optimize\nimport numpy as np\nimport iadpython\nimport pytest\nimport unittest\n\n@pytest.mark.iadc\nclass speed(unittest.TestCase):\n \"\"\"Perfo...
[ [ "numpy.empty_like", "numpy.empty", "numpy.linspace" ] ]
alffore/ciaf2f
[ "4ba1a134545a8b37dd3fb534f043115a441ca043" ]
[ "src/attdecoder.py" ]
[ "# from __future__ import unicode_literals, print_function, division\n\nimport torch\nimport torch.nn as nn\n\nimport torch.nn.functional as F\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nMAX_LENGTH = 28\n\n\nclass AttnDecoderRNN(nn.Module):\n def __init__(self, hidden_size, ou...
[ [ "torch.nn.Dropout", "torch.cat", "torch.zeros", "torch.nn.GRU", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.functional.relu", "torch.cuda.is_available" ] ]
a373913a/opencv
[ "e24546653722df00084a3ffc2bcb010948e146f9" ]
[ "train.py" ]
[ "\"\"\"\nRetrain the YOLO model for your own dataset.\n\"\"\"\n\nimport numpy as np\nimport keras.backend as K\nfrom keras.layers import Input, Lambda\nfrom keras.models import Model\nfrom keras.optimizers import Adam\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping\n\nfro...
[ [ "numpy.random.shuffle", "numpy.array", "numpy.zeros", "numpy.random.seed" ] ]
aassmile/Collision_Avoidance_joint
[ "79323d638476016da946532ded8cff4684fa8e41" ]
[ "train/src/run.py" ]
[ "#!/usr/bin/env python3\n\nimport threading, queue\nimport time\nimport os\nimport shutil\nimport numpy as np\nimport math\nimport rospy\nfrom ddpg import DDPG\nfrom env_v4 import Test \n\nMAX_EPISODES = 100000\nMAX_EP_STEPS = 500\nMEMORY_CAPACITY = 10000\nSIDE = ['right_', 'left_']\nGOAL_REWARD = 1000\nLOAD = Fals...
[ [ "numpy.linalg.norm" ] ]
seigfredprado/DeepCATS-AD
[ "79dd17218ca117138ffd731d4a0eb7daf5285271" ]
[ "stitching/python/parasyncstitching_svp_hpc.py" ]
[ "\"\"\"\n################################################################################\nParallel-and-asynchronous Stitching Script - Parallel version\n\nAuthors: Gerald Moore, Seigfred Prado\n\nThis script pulls the data generated through TissueCyte (or another microscope system) and\ncan perfom image averaging ...
[ [ "numpy.maximum", "numpy.sqrt", "numpy.multiply", "numpy.max", "numpy.nanmean", "numpy.zeros", "numpy.divide" ] ]
Tato14/fastai2
[ "0ce2ffc95ac3a7b1dc5eaf90fc7c3997e7125651", "0ce2ffc95ac3a7b1dc5eaf90fc7c3997e7125651" ]
[ "fastai2/vision/core.py", "fastai2/launch.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/07_vision.core.ipynb (unless otherwise specified).\n\n__all__ = ['Image', 'ToTensor', 'imagenet_stats', 'cifar_stats', 'mnist_stats', 'n_px', 'shape', 'aspect', 'load_image',\n 'image2tensor', 'PILBase', 'PILImage', 'PILImageBW', 'PILMask', 'OpenMask', 'Add...
[ [ "matplotlib.patheffects.Normal", "matplotlib.patches.Rectangle", "matplotlib.patheffects.Stroke" ], [ "torch.cuda.device_count" ] ]
josephdviviano/fcn_maker
[ "b3b9c6a037480511fe190c926d9fe457b9bd0637" ]
[ "example_resunet_isbi-em.py" ]
[ "from __future__ import (print_function,\n division)\nfrom builtins import input\nfrom collections import OrderedDict\nimport sys\n\nimport numpy as np\nimport tifffile\nfrom keras import backend as K\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.callbacks import (Earl...
[ [ "numpy.prod", "numpy.expand_dims", "numpy.float" ] ]
spaenigs/peptidereactor
[ "17efcb993505934f5b9c2d63f5cc040bb244dde9", "17efcb993505934f5b9c2d63f5cc040bb244dde9", "17efcb993505934f5b9c2d63f5cc040bb244dde9" ]
[ "peptidereactor/tests/test_class_assignment.py", "nodes/vis/sds_4_Similarity/scripts/utils.py", "peptidereactor/iFeature/codes/NMBroto.py" ]
[ "import unittest\nimport secrets\nfrom snakemake.shell import shell\nimport pandas as pd\nfrom modlamp.core import read_fasta\n\nTOKEN = secrets.token_hex(4)\n\n\nclass TestClassAssignments(unittest.TestCase):\n\n @classmethod\n def setUpClass(cls):\n seqs, names = read_fasta(f\"tests/seqs.fasta\")\n ...
[ [ "pandas.read_csv" ], [ "scipy.cluster.hierarchy.dendrogram", "scipy.spatial.distance.pdist" ], [ "numpy.std", "numpy.average" ] ]
hey-yahei/Quantization.MXNet
[ "0bfbd7cff79b520548df56fdc3cf74dc591a4325" ]
[ "quantize/distribution_calibrate.py" ]
[ "#-*- coding: utf-8 -*-\n# MIT License\n#\n# Copyright (c) 2019 hey-yahei\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 rig...
[ [ "numpy.log", "numpy.min", "numpy.arange", "numpy.concatenate", "numpy.max", "numpy.copy", "numpy.ceil", "numpy.bincount", "numpy.zeros" ] ]
qfyin/nni
[ "59a1ccf8eba68b94974e84fc3834f38d851faf89", "59a1ccf8eba68b94974e84fc3834f38d851faf89" ]
[ "nni/compression/pytorch/utils/counter.py", "nni/algorithms/compression/pytorch/pruning/net_adapt_pruner.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport functools\nfrom collections import Counter\nfrom prettytable import PrettyTable\n\nimport torch\nimport torch.nn as nn\nfrom nni.compression.pytorch.compressor import PrunerModuleWrapper\n\n\n__all__ = ['count_flops_params']\n\n\nd...
[ [ "torch.Tensor", "torch.zeros", "torch.is_tensor", "torch.no_grad", "torch.prod" ], [ "torch.load" ] ]
attilab97/DeFCN
[ "ec3f86e0210bf2e4e0d76ffe3faf96ebbb67446f" ]
[ "playground/detection/coco/poto.res50.fpn.coco.800size.9x_ms/fcos.py" ]
[ "import logging\nimport math\nfrom typing import List\n\nimport torch\nimport torch.nn.functional as F\nfrom scipy.optimize import linear_sum_assignment\nfrom torch import nn\n\nfrom cvpods.layers import ShapeSpec, cat, generalized_batched_nms\nfrom cvpods.modeling.box_regression import Shift2BoxTransform\nfrom cvp...
[ [ "torch.nn.Sequential", "torch.max", "torch.Tensor", "torch.cat", "torch.nn.init.constant_", "torch.min", "torch.nn.Conv2d", "torch.zeros_like", "torch.exp", "torch.nn.functional.relu", "torch.no_grad", "torch.nn.init.normal_", "torch.device", "torch.nn.Group...
ashwinpn/proj1
[ "7559c9f24767f7b039245a6fe8174ba14332b7fa" ]
[ "imagenet/main.py" ]
[ "import argparse\nimport os\nimport random\nimport shutil\nimport time\nimport warnings\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\nimport torch.optim\nimport torch.multiprocessing as mp\nimport torch.utils.data\nimport to...
[ [ "torch.nn.CrossEntropyLoss", "torch.distributed.init_process_group", "torch.multiprocessing.spawn", "torch.utils.data.distributed.DistributedSampler", "torch.cuda.set_device", "torch.manual_seed", "torch.load", "torch.utils.data.DataLoader", "torch.nn.DataParallel", "torch....
akinoriosamura/models
[ "cf83222da2bba31af500a7d797234c7d3387723f" ]
[ "research/deeplab/train.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 requi...
[ [ "tensorflow.device", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.cast", "tensorflow.gfile.MakeDirs", "tensorflow.contrib.training.multiply_gradients", "tensorflow.group", "tensorflow.summary.scalar", "tensorflow.add_n", "tensorflow.train.MonitoredTrai...
thunlp/ConvDR
[ "4dfdd7b42e69e9c3f5cdcb64fc72a306402dcedd" ]
[ "drivers/gen_passage_embeddings.py" ]
[ "import sys\r\n\r\nsys.path += ['../']\r\nimport torch\r\nimport os\r\nfrom utils.util import (\r\n barrier_array_merge,\r\n StreamingDataset,\r\n EmbeddingCache,\r\n)\r\nfrom data.tokenizing import GetProcessingFn\r\nfrom model.models import MSMarcoConfigDict\r\nfrom torch import nn\r\nimport torch.distri...
[ [ "torch.distributed.init_process_group", "torch.cuda.set_device", "torch.distributed.get_rank", "torch.utils.data.DataLoader", "torch.distributed.barrier", "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available", "torch.multiprocessing.set_sharing_strategy", "torch.d...
ZHUI/PaddleX
[ "f001960b7359f3a88b7dd96e1f34500b90566ceb" ]
[ "paddlex/cv/datasets/coco.py" ]
[ "# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\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.array", "numpy.zeros", "numpy.ones" ] ]
HeLiu-0102/geemap-1
[ "12338a43f0afbea94ef04a9c11c271d68f526b6b" ]
[ "geemap/toolbar.py" ]
[ "\"\"\"Module for dealing with the toolbar.\n\"\"\"\nimport ee\nimport os\nimport ipyevents\nimport ipywidgets as widgets\nfrom ipyleaflet import WidgetControl, DrawControl\nfrom IPython.core.display import display\nfrom ipyfilechooser import FileChooser\nfrom ipywidgets.widgets.widget_box import HBox\nfrom .common...
[ [ "pandas.read_csv", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.colormaps", "matplotlib.pyplot.subplots", "matplotlib.colors.Normalize", "matplotlib.pyplot.plot", "matplotlib.colorbar.ColorbarBase", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib....
techthiyanes/luke
[ "aa234d934527eda96a9a4c3bd9c7999c05c3fd58" ]
[ "examples_allennlp/utils/retrieval/scoring_functions/scoring_function.py" ]
[ "import tqdm\n\nimport torch\nfrom allennlp.common import Registrable\n\n\ndef sharding(iterable, sharding_size: int = 1):\n l = len(iterable)\n for ndx in range(0, l, sharding_size):\n yield iterable[ndx : min(ndx + sharding_size, l)]\n\n\nclass ScoringFunction(Registrable):\n def __init__(self, sh...
[ [ "torch.cat" ] ]
younik/pytorch
[ "281fd9c113c778e846d9dd1b65bf6e5804f4d22d" ]
[ "torch/distributed/fsdp/fully_sharded_data_parallel.py" ]
[ "import contextlib\nimport copy\nimport functools\nimport itertools\nimport traceback\nimport warnings\nfrom contextlib import contextmanager\nfrom dataclasses import dataclass\nfrom enum import Enum, auto\nfrom math import inf\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n Gener...
[ [ "torch.zeros", "torch.distributed._shard.sharded_tensor.Shard.from_tensor_and_offsets", "torch.autograd.Variable._execution_engine.queue_callback", "torch.distributed.distributed_c10d._get_default_group", "torch.no_grad", "torch.cuda.is_available", "torch.cuda.stream", "torch.devic...
devjeetr/pandas
[ "37c5b83bd9abc3c03a8940fe1d77e237d3ad2ed9", "37c5b83bd9abc3c03a8940fe1d77e237d3ad2ed9" ]
[ "pandas/core/generic.py", "pandas/tests/frame/test_period.py" ]
[ "import collections\nfrom datetime import timedelta\nimport functools\nimport gc\nimport json\nimport operator\nimport pickle\nimport re\nfrom textwrap import dedent\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n FrozenSet,\n Hashable,\n List,\n Mapping,\n Optional,\n...
[ [ "pandas.tseries.frequencies.to_offset", "pandas.util._validators.validate_bool_kwarg", "pandas.core.dtypes.inference.is_hashable", "numpy.unique", "numpy.asanyarray", "pandas.core.dtypes.common.is_re_compilable", "pandas.concat", "pandas.core.dtypes.common.is_list_like", "panda...
smruthi98/qiita
[ "8514d316670919e074a927226f985b56dba815f6" ]
[ "qiita_db/test/test_artifact.py" ]
[ "# -----------------------------------------------------------------------------\n# Copyright (c) 2014--, The Qiita Development Team.\n#\n# Distributed under the terms of the BSD 3-clause License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------...
[ [ "pandas.DataFrame.from_dict" ] ]
MargauxMasson/semanticGAN_code
[ "a5b7fbbc505f8ae08c8aab8e199aa6406fffdb07" ]
[ "utils/inception_utils.py" ]
[ "\"\"\"\nCopyright (C) 2021 NVIDIA Corporation. All rights reserved.\nLicensed under The MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including...
[ [ "torch.mean", "torch.nn.functional.softmax", "torch.cat", "torch.nn.functional.dropout", "torch.no_grad", "numpy.mean", "torch.nn.functional.interpolate", "numpy.iscomplexobj", "numpy.exp", "torch.trace", "numpy.trace", "torch.sqrt", "torch.randn", "numpy.ey...
zhangwenwen/mmdetection
[ "da6b1c82715c189bf33e944c6edda80590b5a867" ]
[ "mmdet/core/bbox/geometry.py" ]
[ "import torch\n\n\ndef bbox_overlaps(bboxes1, bboxes2, mode='iou', is_aligned=False):\n \"\"\"Calculate overlap between two set of bboxes.\n\n If ``is_aligned`` is ``False``, then calculate the ious between each bbox\n of bboxes1 and bboxes2, otherwise the ious between each aligned pair of\n bboxes1 and...
[ [ "torch.min", "torch.max" ] ]
twmacro/pyye
[ "c4febd44be836bd87368da13c1fb0cf82838b687" ]
[ "pyyeti/cla/_rptext1.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nLow level tool for writing extrema reports. Typically, this is called\nvia: :func:`cla.DR_Results.rptext`.\n\"\"\"\nfrom types import SimpleNamespace\nimport numpy as np\nfrom pyyeti import ytools, writer\nfrom ._utilities import nan_absmax, _get_rpt_headers\n\n\n__all__ = [\"rptex...
[ [ "numpy.arange", "numpy.set_printoptions" ] ]
tyfecho/cakechat
[ "98945f558759eee14f34d99f4c8a3ddbd0f5b292" ]
[ "tools/train.py" ]
[ "import argparse\nimport os\nimport sys\n\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport random\nimport numpy\nimport tensorflow as tf\n\nfrom cakechat.utils.env import init_keras, try_import_horovod\n\nhvd = try_import_horovod()\ninit_keras(hvd)\n\n# fix random seeds for ex...
[ [ "tensorflow.compat.v1.set_random_seed", "numpy.random.seed" ] ]
FlorianWilhelm/pyro
[ "eb4909702af275aed7d4516cc6df63691f401b88" ]
[ "tests/distributions/test_distributions.py" ]
[ "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport numpy as np\nimport pytest\nimport torch\n\nimport pyro\nimport pyro.distributions as dist\nfrom pyro.distributions import TorchDistribution\nfrom pyro.distributions.testing.gof import auto_goodness_of_fit\nfrom pyro...
[ [ "torch.Size", "torch.ones", "torch.tensor" ] ]
burn874/mtg
[ "cef47f6ec0ca110bdcb885ec09d6f5aca517c3b2" ]
[ "mtg/ml/utils.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport pickle\nimport os\n\n\nclass CustomSchedule(tf.keras.optimizers.schedules.LearningRateSchedule):\n \"\"\"\n learning rate scheduling\n \"\"\"\n\n def __init__(self, d_model, warmup_steps=1000):\n super(CustomSchedule, self).__init__()\n\n ...
[ [ "numpy.log", "tensorflow.saved_model.load", "numpy.clip", "numpy.power", "tensorflow.cast", "tensorflow.math.rsqrt", "tensorflow.math.minimum" ] ]
waliens/tissuenet-challenge
[ "814e9db4d18a11ca252fb7ad5742888087611e49" ]
[ "training/dataset.py" ]
[ "import os\nfrom abc import abstractmethod\nfrom collections import defaultdict\n\nimport PIL\nimport cv2\nimport math\nimport numpy as np\nimport sldc\nimport torch\nfrom PIL import Image\nfrom cytomine.models import Annotation\nfrom rasterio.features import rasterize\nfrom shapely import wkt\nfrom shapely.affinit...
[ [ "numpy.asarray", "torch.utils.data.DataLoader", "numpy.cumsum", "numpy.searchsorted", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
hodossy/pandas-extras
[ "0d07fa388f5a125314371415a3c73e551495ab94" ]
[ "tests/test_util.py" ]
[ "import unittest\nfrom datetime import datetime\n\nimport pandas as pd\nimport pandas.api.types as ptypes\nfrom pandas.testing import assert_frame_equal\n\nfrom pandas_extras import check_duplicated_labels\n\n\nclass UtilTestCase(unittest.TestCase):\n def test_check_duplicated_labels_pos_01(self):\n df = ...
[ [ "pandas.DataFrame" ] ]
unc-optimization/SGN
[ "64ecc816940f3a4a25f86eb2d306fe0b5460705f" ]
[ "asset_example/method_sgn2.py" ]
[ "\"\"\"!@package method_sgn2\n\nSGN2 algorithm for the Asset Allocation example.\n\n\"\"\"\n\nimport numpy as np\nfrom .asset_utils import *\nfrom .solver import *\nimport time\n\ndef asset_sgn2(x0, in_data, prob_params, alg_params, print_interval=2.0):\n\n rho = prob_params['rho']\n M_const = prob_params['M_...
[ [ "numpy.maximum", "numpy.abs", "numpy.linalg.norm", "numpy.zeros_like", "numpy.zeros" ] ]
beezy3601/Quant-Econ
[ "b88d2a748b9d74f87287a0b1b83231d332025e18" ]
[ "examples/paths_and_hist.py" ]
[ "\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom quantecon import LSS\nimport random\n\nphi_1, phi_2, phi_3, phi_4 = 0.5, -0.2, 0, 0.5\nsigma = 0.1\n\nA = [[phi_1, phi_2, phi_3, phi_4],\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0]]\nC = [sigma, 0, 0, 0]\...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "numpy.ones" ] ]
Terf/BrainMaGe
[ "a824baf39404afd4e79a13ae7ea1c9e603b0469e" ]
[ "BrainMaGe/models/seg_modules.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun May 24 06:21:23 2020\n\n@author: siddhesh\n\"\"\"\n\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass in_conv(nn.Module):\n def __init__(self, input_channels, output_channels, kernel_size=3,\n ...
[ [ "torch.nn.Module.__init__", "torch.cat", "torch.nn.Dropout3d", "torch.nn.Conv3d", "torch.nn.functional.interpolate", "torch.nn.InstanceNorm3d" ] ]
DengYuelin/baselines-assembly
[ "d40171845349395f0ed389d725873b389b08f94f" ]
[ "baselines/gps/gui/image_visualizer.py" ]
[ "\"\"\"\nImage Visualizer\n\nThe Image Visualizer class expects to be given images in real time (via the\nupdate function), and displays those images onto the screen. Optionally,\nimages can be supplied via a rostopic.\n\nThe Image Visualizer can also overlay an initial image or target image on top \nof the realtim...
[ [ "matplotlib.gridspec.GridSpecFromSubplotSpec", "matplotlib.pyplot.subplot", "numpy.fromstring", "numpy.array", "numpy.zeros" ] ]
dslaborg/sumo
[ "1e9bfedaff201d4bd37b4889b6091cc4b9c8ad01", "1e9bfedaff201d4bd37b4889b6091cc4b9c8ad01" ]
[ "sumo/loss/loss.py", "scripts/predict_plain_data.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass GeneralizedDiceLoss(nn.Module):\n \"\"\"\n Compute the generalised Dice loss defined in:\n Sudre, C. et al. (2017) Generalised Dice overlap as a deep learning loss function for highly unbalanced\n segmentations. DLM...
[ [ "torch.nn.functional.one_hot", "torch.nn.functional.softmax", "torch.isinf", "torch.no_grad" ], [ "torch.load", "torch.zeros", "numpy.arange", "torch.utils.data.DataLoader", "scipy.stats.zscore", "torch.from_numpy", "numpy.argmax", "numpy.argmin", "numpy.loa...
dagster-io/dagster-ml-example
[ "c80fbcc49a2be0f32e46b7c4824ff909a92bba83" ]
[ "basic_ml/basic_ml.py" ]
[ "from sklearn.datasets import load_iris\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.tree import DecisionTreeClassifier\n\nfrom dagster import get_dagster_logger, job, op\n\nlogger = get_dagster_logger()\n\n\n@op\ndef load_train_test_set():\n iris = load_iris()\n return iris\n\n\n@op\ndef train_c...
[ [ "sklearn.tree.DecisionTreeClassifier", "sklearn.datasets.load_iris", "sklearn.metrics.accuracy_score" ] ]
google/pwlfit
[ "ee64c2203cd71d0fd699a59ba62044f76d9db293" ]
[ "tests/utils_test.py" ]
[ "# Lint as: python3\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applic...
[ [ "numpy.sqrt", "numpy.random.seed", "numpy.unique", "numpy.arange", "numpy.linalg.lstsq", "numpy.random.normal", "numpy.random.uniform", "numpy.array", "numpy.vstack", "numpy.random.randint" ] ]
freewind2016/tensorflow
[ "84d6b43f5fc72c9ac5eb0fc95b91b23f532a2738" ]
[ "tensorflow/lite/python/util.py" ]
[ "# Lint as: python2, python3\n# 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/...
[ [ "tensorflow.python.grappler.tf_optimizer.OptimizeGraph", "tensorflow.core.protobuf.graph_debug_info_pb2.GraphDebugInfo", "tensorflow.lite.python.op_hint.find_all_hinted_output_nodes", "tensorflow.lite.python.op_hint.convert_op_hints_to_stubs", "tensorflow.core.protobuf.meta_graph_pb2.Signature...
intel-iot-devkit/object-flaw-detector-python
[ "96ec8c90cda6df1875cd523efbd6f7e641c47bfb" ]
[ "application/object_flaw_detector.py" ]
[ "\"\"\"Object flaw detector.\"\"\"\n\"\"\"\n* Copyright (c) 2018 Intel Corporation.\n*\n* Permission is hereby granted, free of charge, to any person obtaining\n* a copy of this software and associated documentation files (the\n* \"Software\"), to deal in the Software without restriction, including\n* without limit...
[ [ "numpy.array", "numpy.empty" ] ]
DuFanXin/RNN-SignalProcess
[ "b62f754fcb185b51110352b8c7900ae18c0f7fc3" ]
[ "rnn/BiDirLSTM.py" ]
[ "# -*- coding:utf-8 -*-\n\"\"\" \n#====#====#====#====\n# Project Name: RNN-Astronomy-Signal-Process \n# File Name: BiDirLSTM \n# Date: 3/7/18 3:20 PM \n# Using IDE: PyCharm Community Edition \n# From HomePage: https://github.com/DuFanXin/RNN-Astronomy-Signal-Process\n# Author: ...
[ [ "tensorflow.nn.rnn_cell.BasicLSTMCell", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.transpose", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.argmax", "tensorflow.placeholder", "tensorflow.cast", "tensorflow.global_variables_initializer", "tensor...
pghartig/Power-Control
[ "c23613b74c9fe1a1ecd6d415f5bf0cb625920661" ]
[ "optimization_work/interferenceConstraintComparison.py" ]
[ "from network_simulations import het_net\nimport cvxpy as cp\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport copy\nimport time\n\n\"\"\"\nfirst setup the network according using the het_net class then consolidate all of the information from the network to solve the central optimization problem\n\"\"\"\...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
LamaLenny/DeepGenerativeModels
[ "c2a40e4e71af844f8357da5267b1d017f762a235" ]
[ "homework/2-GAN/block.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass Block(nn.Module):\n def __init__(self, in_features: int, out_features: int,\n kernel_size: int, stride: int, padding: int,\n in_norm: bool = False, conv_tr: bool = False,\n add_act: bool = True, leaky: bool = False):\...
[ [ "torch.nn.Sequential", "torch.nn.ConvTranspose2d", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "torch.nn.LeakyReLU", "torch.nn.ReLU" ] ]
tetromino/note-seq
[ "a71716327619d9d995cce3ca1e0d8442ab2e0d73" ]
[ "note_seq/pianoroll_encoder_decoder_test.py" ]
[ "# Copyright 2021 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.zeros" ] ]
brisu/spleeter
[ "7e2ce1457bcb7f06cb5196a640afbd49358ad0cb", "7e2ce1457bcb7f06cb5196a640afbd49358ad0cb" ]
[ "spleeter/model/functions/blstm.py", "spleeter/audio/ffmpeg.py" ]
[ "#!/usr/bin/env python\n# coding: utf8\n\n\"\"\"\n This system (UHL1) uses a bi-directional LSTM network as described in :\n\n `S. Uhlich, M. Porcu, F. Giron, M. Enenkl, T. Kemp, N. Takahashi and\n Y. Mitsufuji.\n\n \"Improving music source separation based on deep neural networks through\n data augm...
[ [ "tensorflow.compat.v1.keras.initializers.he_uniform", "tensorflow.keras.layers.Reshape", "tensorflow.compat.v1.keras.layers.CuDNNLSTM", "tensorflow.keras.layers.Flatten" ], [ "numpy.frombuffer", "numpy.dtype" ] ]
xieyulai/MSP-STTN-DATA
[ "181f4754da7839ebf1aac034492569b0d64b4b80" ]
[ "GET_DENSITY/csv_to_density.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom pyheatmap.heatmap import HeatMap\nimport cv2\nimport matplotlib.pyplot as plt\n\ngrid_x_min = 115.994279229\ngrid_x_max = 116.747278635\ngrid_y_min = 39.681856275\ngrid_y_max = 40.188086241\n\ndef csv_to_grid_01():\n \"\"\"\n :return: 20200117_20200131 csv to gri...
[ [ "pandas.read_csv", "numpy.save", "numpy.stack", "numpy.concatenate", "numpy.array", "numpy.zeros" ] ]
epfl-dlab/KLearn
[ "e05ef059005f55a7321e5b7765236c39e6941132" ]
[ "klearn/Convertor.py" ]
[ "import numpy as np\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.decomposition import LatentDirichletAllocation\nimport nltk\nfrom nltk.util import ngrams\nfrom nltk.stem.snowball import SnowballStemmer\nfrom nltk.tokenize import RegexpTokenizer\nfrom nltk.corpus import stopwords\n\nst...
[ [ "sklearn.feature_extraction.text.CountVectorizer", "numpy.array", "sklearn.decomposition.LatentDirichletAllocation" ] ]
jesnyder/MeasuredStress
[ "8009529da326a66733c26983cc59af8619f6cb42" ]
[ "code/python/archive/c0115_plot_segment.py" ]
[ "from c0101_retrieve_ref import retrieve_ref\nfrom c0101_retrieve_ref import retrieve_ref_color\nfrom c0101_retrieve_ref import retrieve_sensor_unit\nfrom c0102_timestamp import timestamp_source\nfrom c0103_trim_record_to_max import trim_record_to_max\nfrom c0104_plot_timestamp import plot_timestamp\nfrom c0105_fin...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure" ] ]
ribuild/delphin_6_automation
[ "12024381fc1042b46314c55d88b6349229ea33b7", "12024381fc1042b46314c55d88b6349229ea33b7" ]
[ "test_files/driving_rain_model.py", "data_process/simtime_prediction/gather_data.py" ]
[ "__author__ = \"Christian Kongsgaard\"\n__license__ = 'MIT'\n\n# -------------------------------------------------------------------------------------------------------------------- #\n# IMPORTS\n\n# Modules\nimport numpy as np\nimport pandas as pd\nfrom scipy.optimize import curve_fit\nimport os\nimport matplotlib...
[ [ "sklearn.preprocessing.PolynomialFeatures", "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsRegressor", "sklearn.linear_model.Ridge", "sklearn.linear_model.LinearRegression", "numpy.array", "numpy.sum", "sklearn.preprocessing.MinMaxScaler" ], [ "pan...
Davidvandijcke/Davidvandijcke.github.io
[ "7edcd890cde8bfc4f3b0733335ac4d1f7fb38228" ]
[ "markdown_generator/publications.py" ]
[ "\n# coding: utf-8\n\n# # Publications markdown generator for academicpages\n#\n# Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `m...
[ [ "pandas.read_csv" ] ]
dlshriver/DFV-Artifact
[ "76c5480be9b77108a740330421fc38b081b3261c" ]
[ "rq3/benchmark/properties/dronet_property_5.py" ]
[ "from dnnv.properties import *\nimport numpy as np\n\nN = Network(\"N\")\nN_prob_coll = N[2:-2, 1]\nN_steer_angle = N[2:-1, 0]\n\nlogit = lambda x: np.log(x / (1 - x))\nP_coll_min = logit(0.5)\nP_coll_max = logit(0.6)\n\nsteer_max = 50 * np.pi / 180\n\nForall(\n x,\n Implies(\n And(0 <= x <= 1, P_coll_...
[ [ "numpy.log" ] ]
blue-atom/DeepLearningImplementations
[ "2163918fa2e2815aa0adf907ee56fd0897a75e9c" ]
[ "pix2pix/src/data/make_dataset.py" ]
[ "import os\nimport cv2\nimport h5py\nimport parmap\nimport argparse\nimport numpy as np\nfrom pathlib import Path\nfrom tqdm import tqdm as tqdm\nimport matplotlib.pylab as plt\n\n\ndef format_image(img_path, size, nb_channels):\n \"\"\"\n Load img with opencv and reshape\n \"\"\"\n\n if nb_channels == ...
[ [ "numpy.expand_dims", "matplotlib.pylab.show", "numpy.arange", "numpy.concatenate", "matplotlib.pylab.figure", "matplotlib.pylab.imshow", "matplotlib.pylab.clf", "numpy.array", "matplotlib.pylab.close" ] ]
stevosn/irm_tools
[ "f2e5b00ff28dc15a9d71079724ac055c808de8e8" ]
[ "plotting/plotting.py" ]
[ "# -*- coding: utf-8 -*-\n# \"\"\"\n# - Author: steve simmert\n# - E-mail: steve.simmert@uni-tuebingen.de\n# - Copyright: 2015\n# \"\"\"\n\nimport matplotlib.gridspec as gridspec\nimport matplotlib.pyplot as plt\n\ncol_dict = {'x': 'blue',\n 'y': 'green',\n 'z': 'orange',\n 'psdX': ...
[ [ "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.figure" ] ]
ICRA-2018/gcg
[ "b1027f7e65660d3782f927119f6a75394c30cc47", "b1027f7e65660d3782f927119f6a75394c30cc47" ]
[ "sandbox/gkahn/gcg/sampler/replay_pool.py", "sandbox/rocky/tf/core/layers.py" ]
[ "import time\nimport itertools\nfrom collections import defaultdict\nimport numpy as np\n\nimport rllab.misc.logger as logger\n\nfrom sandbox.gkahn.gcg.utils.utils import timeit\n\nclass RNNCriticReplayPool(object):\n\n def __init__(self, env_spec, env_horizon, N, gamma, size, obs_history_len, sampling_method,\n...
[ [ "numpy.expand_dims", "numpy.sqrt", "numpy.vstack", "numpy.all", "numpy.max", "numpy.mean", "numpy.any", "numpy.linalg.svd", "numpy.std", "numpy.argmax", "numpy.zeros", "numpy.min", "numpy.random.choice", "numpy.cov", "numpy.array", "numpy.sum", "...
dua-arpit/qecsim
[ "70ded606a653fd96d517e07fbba15d9b755df752" ]
[ "demos/giacomo/experiment-04-17-21/sim-random_rot_XZ_YZ.py" ]
[ "import collections\nimport itertools\nimport numpy as np\nfrom qecsim import paulitools as pt\nimport matplotlib.pyplot as plt\nimport qecsim\nfrom qecsim import app\nfrom qecsim.models.generic import PhaseFlipErrorModel,DepolarizingErrorModel,BiasedDepolarizingErrorModel,BiasedYXErrorModel\nfrom qecsim.models.pla...
[ [ "numpy.vectorize", "numpy.sum", "numpy.linspace" ] ]
qiuliwang/LIDC-IDRI-Toolbox-python
[ "ac564124a5b9cc6fe1a6df54780f6d4d1bf8791b" ]
[ "codeforclinic/get_item.py" ]
[ "#-*- coding: UTF-8 -*-\n'''\nCreated by Wang Qiuli\n4.10.2020\n\nget Dicom items, like slicethickness, and so on. All items are listed in dicomstruct.txt\n\nget HU value\n'''\n\nimport pydicom\nimport cv2\nimport os\nimport scipy.misc\nimport numpy as np \n\n\ndir = 'testdicom/'\n\nfilelist = os.listdir(dir)\nseli...
[ [ "numpy.array", "numpy.int16" ] ]
argonne-lcf/molan
[ "48d1e4d0b4f95190ae96f9dcb85e46e6443a7689" ]
[ "code/melting_predict_Spark_RF/clustering/get_metadata.py" ]
[ "def get_metadata(path,smi):\n \"\"\"\n A function to extract the dataset size related parameters and the numpy array required for ML.\n :param path: path to db (str)\n :param smi: smiles string (smi)\n :return: observables (floats)\n \"\"\"\n import os, json\n\n smidict = json.load(open('...
[ [ "numpy.zeros" ] ]
fsoubelet/PyhDToolk
[ "aef9d5f1fac2d4c4307d50ba5c53f6a5eb635a66" ]
[ "tests/test_cpymadtools/test_special.py" ]
[ "import math\nimport random\n\nimport pytest\n\nfrom cpymad.madx import Madx\nfrom pandas.testing import assert_frame_equal\n\nfrom pyhdtoolkit.cpymadtools.constants import (\n LHC_ANGLE_FLAGS,\n LHC_CROSSING_ANGLE_FLAGS,\n LHC_EXPERIMENT_STATE_FLAGS,\n LHC_IP2_SPECIAL_FLAG,\n LHC_IP_OFFSET_FLAGS,\n ...
[ [ "pandas.testing.assert_frame_equal" ] ]
Harlequln/C2M18X-System_Integration
[ "a322c0c3ec50db9f82a66d25e66bf22a0641c44b" ]
[ "ros/src/twist_controller/twist_controller.py" ]
[ "import numpy as np\nimport rospy\n\nfrom geometry_msgs.msg import TwistStamped\nfrom lowpass import LowPassFilter\nfrom pid import PID\nfrom yaw_controller import YawController\n\nfrom utilities import *\n\n\nclass Controller(object):\n\n def __init__(self, vehicle_mass, fuel_capacity, brake_deadband,\n ...
[ [ "numpy.isclose" ] ]