repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
jordiclive/ControlPrefixes
[ "b647f68bf0c7e771f847c4a51e5f22af2ac95699" ]
[ "transformers/examples/seq2seq/finetune_trainer.py" ]
[ "import json\nimport logging\nimport os\nimport sys\nfrom dataclasses import dataclass, field\nfrom typing import Callable, Dict, List, Optional, Tuple\n\nimport numpy as np\nimport torch\n\nfrom seq2seq_trainer import Seq2SeqTrainer\nfrom transformers import (\n AutoConfig,\n AutoModelForSeq2SeqLM,\n Auto...
[ [ "numpy.count_nonzero", "torch.stack" ] ]
mcreng/COMP4901K-ML4NLP
[ "14664b4545f2c2ed9437a1869bb675eed0081fca" ]
[ "Proj3/data_helper.py" ]
[ "import math\nimport json\nimport os\nimport numpy as np\nimport pandas as pd\nimport itertools\n\ndef build_input_data(sentences, vocabulary, training=False):\n \"\"\"\n Maps sentences and labels to vectors based on a vocabulary.\n \n Args:\n sentences (pd.Dataframe): date frame of raw sentences...
[ [ "numpy.array", "pandas.read_csv" ] ]
junho-m/rain
[ "88946ab2c727ae23054c77b6eb1381379b186b74" ]
[ "keras/gpu.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# ##### Copyright 2018 The TensorFlow Authors.\n# \n\n# In[ ]:\n\n\n#@title 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.ap...
[ [ "tensorflow.config.experimental.set_visible_devices", "tensorflow.config.set_soft_device_placement", "tensorflow.distribute.MirroredStrategy", "tensorflow.keras.optimizers.SGD", "tensorflow.keras.layers.Input", "tensorflow.matmul", "tensorflow.config.experimental.set_memory_growth", ...
TsingZ0/PFL-Non-IID
[ "2ec1b3410a9a82a241087c6da51f6be95db09dae" ]
[ "dataset/generate_agnews.py" ]
[ "import numpy as np\nimport os\nimport sys\nimport random\nimport torchtext\nfrom utils.dataset_utils import check, separate_data, split_data, save_file\nfrom torchtext.data.utils import get_tokenizer\nfrom torchtext.vocab import build_vocab_from_iterator\n\n\nrandom.seed(1)\nnp.random.seed(1)\nnum_clients = 20\nnu...
[ [ "numpy.random.seed", "numpy.array" ] ]
a3sha2/aslprep-2
[ "eaa5f7cfd91494c10a8fbaaa43326e65d42c8d77" ]
[ "aslprep/niworkflows/interfaces/utils.py" ]
[ "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"Utilities.\"\"\"\nimport os\nimport re\nimport json\nimport shutil\nimport numpy as np\nimport nibabel as nb\nimport nilearn.image as nli\nfrom textwrap import indent\nfrom collections import O...
[ [ "numpy.array", "numpy.savetxt", "scipy.ndimage.binary_erosion", "numpy.round", "numpy.sum", "numpy.allclose", "numpy.loadtxt", "numpy.apply_along_axis", "numpy.clip", "numpy.all", "pandas.read_csv", "numpy.asanyarray" ] ]
jstaffans/renewables
[ "4ab8f524db8fb64b52026351aab1c27b01703028" ]
[ "app/util.py" ]
[ "from datetime import datetime, timedelta\nimport pandas as pd\n\n\ndef _truncate_datetime(dt):\n return dt.replace(hour=0, minute=0, second=0, microsecond=0)\n\n\ndef hour_range(day):\n start_midnight = _truncate_datetime(day)\n hour = start_midnight\n while hour < start_midnight + timedelta(days=1):\n...
[ [ "pandas.date_range", "pandas.Timedelta" ] ]
Coulbe/data-validation
[ "a2c5e5dd2cc50cce8a7eab5c7e72a0cb11b74b2c" ]
[ "tensorflow_data_validation/utils/slicing_util.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "pandas.DataFrame", "numpy.asarray", "pandas.merge" ] ]
Savimaster/Prodigy
[ "d4dcf516639348247ebdba2ba80a20dc3ff09a84" ]
[ "Recommendation/class_recommendation_system.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Class Recommendation System.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1cErX1ARVB1TLtVZVXof1HIzsuGl3K8Rw\n\"\"\"\nimport pandas as pd\nfrom rake_nltk import Rake\nimport numpy as np\nfrom sklearn.metri...
[ [ "pandas.set_option", "pandas.read_json", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.metrics.pairwise.cosine_similarity", "pandas.Series" ] ]
bariluz93/nematus
[ "b9c03b50647f4e0a8f5991b5a265c9a6a84d04ca" ]
[ "nematus/translate_utils.py" ]
[ "import logging\nimport sys\nimport time\nimport numpy\nimport tensorflow as tf\n\n# ModuleNotFoundError is new in 3.6; older versions will throw SystemError\nif sys.version_info < (3, 6):\n ModuleNotFoundError = SystemError\n\ntry:\n from . import exception\n from . import util\nexcept (ModuleNotFoundErro...
[ [ "numpy.array", "numpy.tile" ] ]
Bartolo1024/ignite
[ "b087fef0bc5f97cda415c1c56f1cd589383c54be" ]
[ "tests/ignite/handlers/test_checkpoint.py" ]
[ "import os\nimport warnings\nfrom unittest.mock import MagicMock\n\nimport pytest\nimport torch\nimport torch.nn as nn\n\nimport ignite.distributed as idist\nfrom ignite.engine import Engine, Events, State\nfrom ignite.handlers import Checkpoint, DiskSaver, ModelCheckpoint\nfrom ignite.handlers.checkpoint import Ba...
[ [ "torch.nn.Linear", "torch.device", "torch.rand", "torch.optim.lr_scheduler.ExponentialLR", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.device_count", "torch.manual_seed", "torch.load", "torch.nn.DataParallel" ] ]
Venka97/climART
[ "b2246231f3ba8372d33e564700b872c410e33036" ]
[ "climart/models/column_handler.py" ]
[ "from typing import Dict, Optional, Tuple, Sequence, Any\n\nimport numpy as np\nimport torch\nfrom torch import Tensor\nfrom einops import repeat\n\nfrom climart.models.GNs.constants import NODES, EDGES\nfrom climart.data_wrangling.constants import LAYERS, LEVELS, GLOBALS\nfrom climart.models.additional_layers impo...
[ [ "torch.zeros", "numpy.concatenate", "torch.ones", "numpy.arange", "torch.empty" ] ]
TariqAHassan/byol-pytorch
[ "7be5b87b7dfd41eec8a1b1c2d44b0211a30673da" ]
[ "byol_pytorch/byol_pytorch.py" ]
[ "import copy\nimport random\nfrom functools import wraps\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nfrom torchvision import transforms as T\n\n# helper functions\n\ndef default(val, def_val):\n return def_val if val is None else val\n\ndef flatten(t):\n return t.reshape(t.shape[...
[ [ "torch.nn.Linear", "torch.nn.functional.normalize", "torch.no_grad", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.tensor", "torch.randn" ] ]
gregw18/KaggleAirbusShipDetection
[ "efe0b872d5460da5b8650785a046c805bc0a9918" ]
[ "CreateSegMasks.py" ]
[ "# Create mask file for each source file, using data from segmentation file, which is RLE.\r\n# In this case, RLE means that there is one line in the file for each boat in a file. Each line\r\n# consists of a number of pairs. The first element in the pair is the starting pixel number and the\r\n# second is the numb...
[ [ "pandas.isnull", "pandas.read_csv", "matplotlib.image.imsave", "numpy.zeros" ] ]
daleroberts/QGIS-Classifier-Plugin
[ "c0e302a98c7370115dc6c8ac2b2fdd48ed6d816f" ]
[ "classify/ClassifyMethod.py" ]
[ "import numpy as np\nimport math\nimport inspect\nfrom collections import namedtuple\n\n# Need to use QObject.tr on method name, description\n\nclass ClassifyMethodError( RuntimeError ):\n def message(self):\n return self.args[0] if len(self.args) > 0 else \"Exception\"\n\nContourMethod=namedtuple('Conto...
[ [ "numpy.max", "numpy.array", "numpy.ceil", "numpy.percentile", "numpy.ones", "numpy.min", "numpy.arange", "numpy.linspace", "numpy.floor" ] ]
i2kconnect/lasio
[ "03c88217244a73b7183bc343a21000c479597290" ]
[ "lasio/defaults.py" ]
[ "import re\n\nimport numpy as np\n\nfrom .las_items import (\n HeaderItem, SectionItems, OrderedDict\n)\n\n\ndef get_default_items():\n return {\n 'Version': SectionItems([\n HeaderItem('VERS', '', 2.0, 'CWLS log ASCII Standard -VERSION 2.0'),\n HeaderItem('WRAP', '', 'NO', 'One l...
[ [ "numpy.zeros" ] ]
leomrocha/minibrain
[ "e243f7742495c50104ee13ddc6929b1f3cacfc97" ]
[ "predictors/sequence/text/langmodels/utils/helpers.py" ]
[ "\"\"\"\nHelper functions for training and testing, for the moment many things contain absolute paths and is quite dirty\nThe thing is, I'll be improving the code as the research advances\n\"\"\"\n\nimport os\nimport sys\nimport numpy as np\nfrom datetime import datetime\n\nimport torch\nimport torch.nn as nn\nimpo...
[ [ "torch.zeros", "torch.utils.tensorboard.SummaryWriter", "torch.no_grad", "numpy.load", "torch.ones", "torch.cuda.empty_cache", "torch.nn.Embedding", "torch.where" ] ]
r0leGetter/b_thesis_top
[ "d2e7533909a1104726b03d422d12be582f35f716" ]
[ "src/marginal/marginal.py" ]
[ "from abc import ABCMeta, abstractmethod\nfrom scipy.stats.kde import gaussian_kde\nfrom scipy import integrate\nfrom scipy.stats import norm\nimport pandas as pd\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.mlab as mlab\nfrom matplotlib.patches import Ellipse\nimport sys\nim...
[ [ "scipy.stats.norm.pdf", "numpy.delete", "numpy.array", "sklearn.neighbors.kde.KernelDensity", "numpy.sqrt", "numpy.append", "scipy.stats.kde.gaussian_kde", "numpy.linspace", "pandas.Series", "numpy.logspace" ] ]
Gouzhong1223/Dubhe
[ "8959a51704410dc38b595a0926646b9928451c9a" ]
[ "dubhe-visual-server/parser_service/tbparser/summary_reader.py" ]
[ "# -*- coding: UTF-8 -*-\n# MIT License\n#\n# Copyright (c) 2019 Vadim Velicodnii\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files\n# (the \"Software\"), to deal in the Software without restriction,\n# including without limitat...
[ [ "numpy.array", "numpy.frombuffer" ] ]
olasson/SDCND-P4-AdvancedLaneLines
[ "b0b39c5ec255d523ecc3c53a9a488c0f3dbeeab6" ]
[ "code/_draw.py" ]
[ "\"\"\"\nThis file contains internal, supporting functions for detect.py. They are used for debugging and actually drawing the detected lane lines.\n\"\"\"\n\nimport cv2\nimport numpy as np\n\ndef _draw_line(image, line, color = [255, 0, 0], thickness = 10):\n \"\"\"\n Wrapper for cv2.line\n\n Inputs\n ...
[ [ "numpy.zeros_like", "numpy.array", "numpy.copy", "numpy.concatenate" ] ]
NikolaiSie/django
[ "a19bb9813d7ed957d05edeeaf380988265aae49d" ]
[ "projects/writing/sigurd/views.py" ]
[ "from django.shortcuts import render\nimport numpy as np\nimport datetime\n\nfrom .models import Haiku, Chapter, Poem, Story\n\ndef index(request):\n haiku_id = datetime.datetime.now().strftime(\"%d\")\n haiku = Haiku.objects.get(pk=haiku_id)\n return render(request, 'home.html', {'haiku': haiku, \"line\":...
[ [ "numpy.random.randint" ] ]
caciolai/Generative-Dog-Images-with-BigGan
[ "535d5a9c35ad4187a6f0099c4a02772a45c4a064" ]
[ "src/gan-dogs/model/serialization.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework.tensor_conversion_registry import get\n\nfrom .gan import build_gan\n\n\ndef load_model(use_model, num_classes, latent_dim, img_width, img_height, checkpoint_path):\n \"\"\"Load model from checkpoint on disk.\n\n Args:\n use_model (str): name o...
[ [ "tensorflow.random.normal", "tensorflow.random.uniform" ] ]
Learn-Live/activity_recognition
[ "76fa7bcecc3e422f1ea59fd1aaf576669e1248fb" ]
[ "ar/features/videopose3d/data/prepare_data_h36m.py" ]
[ "# Copyright (c) 2018-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nimport argparse\nimport os\nimport zipfile\nimport numpy as np\nimport h5py\nfrom glob import glob\nfrom shutil imp...
[ [ "scipy.io.loadmat", "numpy.savez_compressed" ] ]
MatthiasGolomb/effmass
[ "8d61851bdd3f8a60b9c639014effa346bce93ece" ]
[ "effmass/inputs.py" ]
[ "#! /usr/bin/env python3\n\n\"\"\"\nA module for storing electronic structure data and user settings. Currently supported codes are VASP and FHI-Aims (with limited functionality).\n\nThe module contains a :class:`Data` class which parses OUTCAR and PROCAR files using the `vasppy <https://github.com/bjmorgan/vasppy>...
[ [ "numpy.array", "numpy.delete", "numpy.array_equal", "numpy.asarray", "numpy.zeros", "numpy.any", "numpy.ravel", "numpy.cross" ] ]
fdcl-gwu/uav_simulator
[ "a31855babfe633ae326ecb36c4ff714066cdb269" ]
[ "scripts/matrix_utils.py" ]
[ "import numpy as np\nimport pdb\n\n\ndef hat(x):\n \"\"\"Returns the hat map of a given 3x1 vector.\n\n Args:\n x: (3x1 numpy array) vector\n\n Returns:\n x_hat: (3x3 numpy array) hat of the input vector\n \"\"\"\n \n x = x.reshape((3, 1)) # You may have to uncomment this line depen...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.eye", "numpy.identity" ] ]
havelhuang/DeepConcolic
[ "d75a100a33dfc4e3674863bbcb3eb8a96b423e2b" ]
[ "GUAP/run_cifar.py" ]
[ "import torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchsummary import summary\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\nimport argparse\nimport torchvision\nfrom torchvision import datasets, transforms\nfrom torch.utils.data impo...
[ [ "torch.cat", "torch.cuda.manual_seed", "numpy.mean", "torch.load", "torch.nn.DataParallel", "numpy.empty", "torch.autograd.Variable", "torch.FloatTensor", "torch.manual_seed", "torch.nn.init.normal_", "torch.utils.data.DataLoader", "torch.Tensor", "torch.cuda.ma...
endolith/wavelets
[ "81e803f71c3306e97a6fdbd9dd762356021bc14a" ]
[ "wavelets/wavelets.py" ]
[ "import numpy as np\nimport scipy\nimport scipy.signal\nimport scipy.optimize\nimport scipy.special\nfrom scipy.special import factorial\n\n__all__ = ['Morlet', 'Paul', 'DOG', 'Ricker', 'Marr', 'Mexican_hat']\n\n\nclass Morlet:\n def __init__(self, w0=6):\n \"\"\"w0 is the nondimensional frequency constan...
[ [ "scipy.special.hermitenorm", "numpy.array", "numpy.exp", "numpy.sign", "scipy.special.factorial", "numpy.sqrt" ] ]
shunlean/carbondata
[ "6891083b4eecb21e132538b5f84c2240675e8af3" ]
[ "python/pycarbon/core/carbon_arrow_reader_worker.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you m...
[ [ "numpy.arange", "pandas.merge" ] ]
CMU-IDS-2022/final-project-champion
[ "248902bf7ee09d0de953593e51c8bc9c6a68e17d" ]
[ "Word_cloud_data_processing.py" ]
[ "import os\nimport pandas as pd\nimport numpy\nimport pytrends\n\nfrom pytrends.request import TrendReq\n\ntop10cities = set([\"Boston\", \"Chicago\", \"Detroit\", \"Philadelphia\", \"Pittsburgh\", \"Seattle\", \"Washington\"]) # \"San Francisco\", \"Los Angeles\", \"New York\", \n\n# filter to leave top 10 cities\...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
Anupam0401/Photo-to-cartoon-convertor
[ "fbd2a38037534778d8caadce1e96c40a4a4edb4d" ]
[ "test_onnx.py" ]
[ "import os\r\nimport cv2\r\nimport numpy as np\r\nimport onnxruntime\r\nimport argparse\r\nfrom utils import Preprocess\r\n\r\n\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument('--photo_path', type=str, help='input photo path')\r\nparser.add_argument('--save_path', type=str, help='cartoon save path')\r\...
[ [ "numpy.transpose" ] ]
WeixinYang/PSFDataset
[ "f29b37489c580ad3c677bb9385a721cc57da60e4" ]
[ "psfdataset/transforms/spatial/crop.py" ]
[ "# -----------------------------------------------------------\n# Class to crop a sequence of keypoints to their common spatial bounding box.\n#\n# (C) 2020 Kevin Schlegel, Oxford, United Kingdom\n# Released under Apache License, Version 2.0\n# email kevinschlegel@cantab.net\n# -------------------------------------...
[ [ "numpy.minimum", "numpy.full", "numpy.zeros", "numpy.amin" ] ]
skarakulak/hfsmx_for_LM
[ "8395c44057aa68e2889f4cd64d4dd511bd650ec8" ]
[ "examples/penn_treebank/run_language_modeling_hsfmx.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.get_world_size", "torch.utils.data.RandomSampler", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "torch.device", "torch.cuda.manual_seed_all"...
arthur-x/SimplySAC
[ "f02ca729b073759915400450cb2b905600805180" ]
[ "plot.py" ]
[ "import matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\n\n\ndef plot_curve(env):\n min_l = 2001\n ret_list = []\n for s in range(5):\n df = pd.read_csv('saves/' + str(env+1) + '/log' + str(s+1) + '.csv')\n ret = df[['return']].to_numpy().transpose(...
[ [ "numpy.max", "matplotlib.style.use", "matplotlib.pyplot.xlim", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "numpy.min", "numpy.mean", "matplotlib.pyplot.legend", "matplotlib.pyplot.fill_between", "matplotlib.pyplot...
0xADD1E/DepSolve
[ "3ef11b66f3f71496dc5370ced8241ffdd2c57d31" ]
[ "Circular.py" ]
[ "# In[]\n# Imports and Stuff\nimport z3\nimport csv\nimport sys\nimport pprint\nimport numpy as np\nfrom collections import defaultdict\nfrom collections import namedtuple\npp = pprint.PrettyPrinter(indent=4)\nDependency = namedtuple('Dependency', 'me dependsOn')\nsystemFile = 'RunFile.smt2'\nresultsFile = 'Results...
[ [ "numpy.full" ] ]
stijnana/druktemeter
[ "cdb9030e54985028ef75677c477c11caf7989a12" ]
[ "geluidleves.py" ]
[ "from Adafruit_IO import *\nimport RPi.GPIO as GPIO\nimport time as yotimma\nimport numpy as np\nimport sounddevice as sd\n\n#Connectie met de adafruit api\naio = Client('Nizari' , '')\n\n#setten van de pins\nGPIO.setmode(GPIO.BCM)\nGPIO.setwarnings(False)\nPIR_PIN = 3\nGPIO.setup(PIR_PIN, GPIO.IN)\n\n#print dat de...
[ [ "numpy.linalg.norm" ] ]
hemanth-s17/Deep-Fish-Tracker-Network
[ "95af21ae662c1f2dee008f41abc6d400a2970ed8" ]
[ "networks/siamese/convolutional_siamese.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nimport numpy as np\n\nimport random\nimport os\nfrom cv2 import imread\nfrom keras.layers import Input,Conv2D,MaxPooling2D,Flatten,Dense,Dropout,Lambda,LSTM,BatchNormalization,LeakyReLU,PReLU\nfrom keras import Sequential\nfrom keras.da...
[ [ "numpy.random.normal", "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.where", "numpy.stack", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.vstack" ] ]
Fuchai/mayoehr
[ "ec79d2157bedf4f4f0fc783d86523df8a758e27c" ]
[ "death/trashcan/babi/babitrainnotmine.py" ]
[ "# I decide to run my model on babi again to see if the convergen ce problem is with my model or dataset\n\nfrom dnc import DNC\nimport torch\nimport numpy\nfrom pathlib import Path\nimport pickle\nimport os\nfrom os.path import join, abspath\nfrom death.DNC.trashcan.babi.babigen import PreGenData\nfrom torch.autog...
[ [ "torch.save", "numpy.arange", "torch.load", "torch.Tensor", "torch.nn.CrossEntropyLoss" ] ]
CVIU-CSU/mediapipe_turtlebot3
[ "ef4171d114af44d14c1525934e6c57a12f318690" ]
[ "model/point_history_classifier/point_history_classifier.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport numpy as np\nimport tensorflow as tf\n\n\nclass PointHistoryClassifier(object):\n def __init__(\n self,\n model_path='model/point_history_classifier/point_history_classifier.tflite',\n score_th=0.5,\n invalid_value=0,\n nu...
[ [ "numpy.array", "tensorflow.lite.Interpreter", "numpy.squeeze" ] ]
sophiaalthammer/dossier_coliee
[ "997168ab076caf04beecd5834f3ba25f399c3f84" ]
[ "eval/eval_bm25_coliee2021.py" ]
[ "import os\r\nimport jsonlines\r\nimport json\r\nimport ast\r\nimport argparse\r\nimport pytrec_eval\r\nimport pandas as pd\r\nfrom matplotlib import pyplot as plt\r\nimport seaborn as sns\r\nimport numpy as np\r\nsns.set(color_codes=True, font_scale=1.2)\r\nfrom collections import Counter\r\n\r\n\r\ndef read_run_w...
[ [ "numpy.mean" ] ]
skachuck/oggm
[ "b391e6923fb0c5269e10ea260f5199a26d5e1082" ]
[ "oggm/shop/its_live.py" ]
[ "import logging\n\nimport numpy as np\n\ntry:\n import salem\nexcept ImportError:\n pass\ntry:\n import rasterio\nexcept ImportError:\n pass\n\nfrom oggm import utils\nfrom oggm.exceptions import InvalidWorkflowError\n\n# Module logger\nlog = logging.getLogger(__name__)\n\nbase_url = ('http://its-live-d...
[ [ "numpy.all", "numpy.sqrt" ] ]
awai54st/LUTNet
[ "81b044f31d1131bee1a7fae41fc4d2fb102ea73a" ]
[ "tiled-lutnet/lutnet/h5py-2-hls/CIFAR_10/h52header_51lut_tm_spase.py" ]
[ "import h5py\nimport numpy as np\n\ndef SignNumpy(x):\n return np.greater(x,0)\n\n# convert a fully connected binarized layer plus batch normalization into \n# the simplified form (binary weight and positive threshold)\n# note that the neurons are assumed to be in the columns of the weight\n# matrix\ndef makeBNCom...
[ [ "numpy.array", "numpy.sum", "numpy.ones", "numpy.tile", "numpy.split", "numpy.shape", "numpy.greater" ] ]
LishenQ-1995/cpsc2021-python-entry
[ "f3592dae18cd23434e52a62f3d78ff9fb6a230ed" ]
[ "entry_2021_Q.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Jun 4 20:50:10 2021\r\n\r\n@author: Lishen Qiu\r\n\"\"\"\r\n\r\n#!/usr/bin/env python3\r\n\r\nimport numpy as np\r\nimport os\r\nimport sys\r\n\r\nimport wfdb\r\n# from utils import qrs_detect, comp_cosEn, save_dict\r\n# import matplotlib # ๆณจๆ„่ฟ™ไธชไนŸ่ฆimportไธ€ๆฌก\r\n# i...
[ [ "numpy.zeros", "numpy.sum", "numpy.diff", "numpy.where", "torch.cuda.is_available", "torch.load", "torch.Tensor", "numpy.expand_dims" ] ]
pha-nguyen/DEFT
[ "7e437262317d2484ebb79add67254b2cb014eeb0" ]
[ "src/lib/model/model.py" ]
[ "# ------------------------------------------------------------------------------\n# Licensed under the MIT License.\n# Written by Xingyi Zhou (zhouxy@cs.utexas.edu)\n# Source: https://github.com/xingyizhou/CenterTrack/\n# Modified by Mohamed Chaabane\n# -------------------------------------------------------------...
[ [ "torch.save", "torch.load" ] ]
Standard-Cognition/recursive-bayesian-filtering
[ "6b22947aa0a58ef7839a96c48bd799cfe5437a2d" ]
[ "stats_tools.py" ]
[ "'''\nStatistics tools for tracking.\n\nMIT License\n\nCopyright (c) 2018 Standard Cognition\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limita...
[ [ "numpy.linalg.cholesky", "numpy.sin", "numpy.random.normal", "numpy.zeros", "matplotlib.pyplot.fill", "numpy.linalg.eigh", "numpy.linalg.det", "numpy.exp", "numpy.random.multivariate_normal", "numpy.isscalar", "numpy.linalg.eigvalsh", "numpy.isrealobj", "numpy.c...
SatyaSiddharthDash/transformers
[ "a39dfe4fb122c11be98a563fb8ca43b322e01036" ]
[ "src/transformers/trainer_tf.py" ]
[ "\"\"\"Tensorflow trainer class.\"\"\"\n\nimport datetime\nimport logging\nimport math\nimport os\nimport sys\nimport warnings\nfrom typing import Callable, Dict, Optional, Tuple\n\nimport numpy as np\nimport tensorflow as tf\nfrom packaging.version import parse\n\nfrom .modeling_tf_utils import TFPreTrainedModel\n...
[ [ "tensorflow.keras.mixed_precision.experimental.set_policy", "tensorflow.range", "tensorflow.summary.trace_on", "tensorflow.train.CheckpointManager", "tensorflow.concat", "tensorflow.data.experimental.cardinality", "tensorflow.summary.scalar", "tensorflow.keras.metrics.Sum", "te...
izzrak/numpy_cnn
[ "f8dc1d577520d70da2f159b6ad6b36b5ad0cc5e1" ]
[ "conv_net.py" ]
[ "import numpy as np\nfrom conv_layer import conv_layer\nfrom pooling_layer import max_pooling\nfrom activation_layer import relu\nfrom fc_layer import fc_layer\nfrom loss_layer import loss_layer\n\n\nclass conv_net(object):\n \"\"\"\n Convolution net class\n methods:\n - forward: forward pass\n - backprop: bac...
[ [ "numpy.array", "numpy.ones", "numpy.argmax" ] ]
xinzhou-ntu/DGNs
[ "1abbecf921c3442c6fbd065eeec16cb32605bd1e" ]
[ "realworld_benchmark/nets/mlp_readout_layer.py" ]
[ "# MIT License\n# Copyright (c) 2020 Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, Xavier Bresson\n\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\"\"\"\n MLP Layer used after graph vector representation\n\"\"\"\n\nclass MLPReadout(nn.Module):\n\n def __init__(self, in...
[ [ "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.ModuleList" ] ]
SecLoop/ECommerceCrawlers
[ "8121a4a23dd8bb38f1ebf9a7bc838952d4146834" ]
[ "QiChaCha/get_parks_companies_threads.py" ]
[ "import os\nimport requests\nfrom config import *\nfrom lxml import etree\nimport csv\n# from fake_useragent import UserAgent\nimport pandas as pd\nimport threading\nimport time\nimport random\n\ndef log(txt):\n print(txt)\n with open('log.txt', 'a') as f:\n f.write(txt+'\\n')\n\n\nclass QiChaCha:\n ...
[ [ "pandas.read_csv" ] ]
TxT168/nlp-bert
[ "c8173797abb81a2c9a7e6911c477106c5a2cede5" ]
[ "utils.py" ]
[ "# coding: UTF-8\nimport torch\nfrom tqdm import tqdm\nimport time\nfrom datetime import timedelta\n\nPAD, CLS = '[PAD]', '[CLS]' # padding็ฌฆๅท, bertไธญ็ปผๅˆไฟกๆฏ็ฌฆๅท\n\n\ndef build_dataset(config):\n\n def load_dataset(path, pad_size=32):\n contents = []\n with open(path, 'r', encoding='UTF-8') as f:\n ...
[ [ "torch.LongTensor" ] ]
akeaveny/Mask_RCNN
[ "b898286e3bebb4af16cc2dfc6f1167eeadd4292f" ]
[ "mrcnn/modeldepth.py" ]
[ "\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict\nimport multiprocessing\nimport numpy as np\nimport skimage.transform\nimport tensorflow as tf\nimport keras\nimport keras.backend as K\nimport keras.layers as KL\nimport keras.engine as KE\nimp...
[ [ "tensorflow.exp", "numpy.random.choice", "tensorflow.image.non_max_suppression", "numpy.copy", "tensorflow.unique", "tensorflow.reshape", "numpy.where", "tensorflow.sqrt", "numpy.sort", "tensorflow.stack", "tensorflow.control_dependencies", "numpy.broadcast_to", ...
cgpu/Long-Read-Proteogenomics
[ "7303e3c9cd4e58f98143eda0994c937a606206f9" ]
[ "modules/visualization_track/src/track_add_rgb_colors_to_bed.py" ]
[ "#!/usr/bin/env python3\n\n# add rgb shading value based on the relative abundances of all pb transcripts\n# of a gene\n\n# %%\n\nimport pandas as pd\nimport math\nimport argparse\n\n# examine all pb transcripts of a gene, determine rgb color\ndef calculate_rgb_shading(grp):\n \"\"\"\n Examine CPM for all PB ...
[ [ "pandas.DataFrame", "pandas.read_table", "pandas.merge" ] ]
Stick-To/Deep_Conv_Backone_tensorflow
[ "c22016f7a41bc7b0caf85ff3db63d9bdab867401" ]
[ "testdpn.py" ]
[ "import tensorflow as tf\nimport keras\nfrom keras.datasets import cifar10\nfrom keras.datasets import cifar100\nimport DPN as net\nimport numpy as np\nimport sys\nfrom keras.preprocessing.image import ImageDataGenerator\nimport os\nimport math\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\ndevice_name = tf.test.gpu_...
[ [ "numpy.array", "tensorflow.test.gpu_device_name", "numpy.mean" ] ]
yixuan/almond
[ "b37de1054a415c5a42ea97a88d935fad1ae3c148" ]
[ "package/almond/langevin.py" ]
[ "import math\nimport numpy as np\nimport mxnet as mx\nimport mxnet.ndarray as nd\n\n\n# Prototype of a probility model\nclass ProbModel:\n def log_pdf(self, x, args):\n f = 0.0\n return f\n\n def log_pdf_grad(self, x, args):\n grad = nd.zeros_like(x)\n return grad\n\n\nclass Langev...
[ [ "numpy.random.seed" ] ]
bgotthold-usgs/batdetect
[ "0d4a70f1cda9f6104f6f785f0d953f802fddf0f1" ]
[ "bat_eval/myskimage.py" ]
[ "\"\"\"\nThis file contains code copied from skimage package. \nSpecifically, this file is a standalone implementation of \nskimage.filters's \"gaussian\" function.\nThe \"image_as_float\" and \"guess_spatial_dimensions\" functions\nwere also copied to as dependencies of \"gaussian\" function.\n\"\"\"\nfrom __futur...
[ [ "numpy.max", "numpy.ceil", "numpy.empty", "numpy.asarray", "numpy.rint", "scipy.ndimage.gaussian_filter", "numpy.min", "numpy.multiply", "numpy.floor_divide", "numpy.floor", "numpy.clip", "numpy.iinfo", "numpy.dtype", "numpy.maximum" ] ]
forkunited/ltprg
[ "4e40d3571d229023df0f845c68643024e04bc202" ]
[ "src/test/py/ltprg/game/synthetic_nom_ref/network_components.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass MLP(nn.Module):\n\tdef __init__(self, in_sz, h_szs, out_sz, \n\t\thiddens_nonlinearity, final_nonlinearity):\n\t\t# in_sz \t\t\t\t\t (int, input sz)\n\t\t# h_szs\t\t\t\t\t\t (list of hidden layer szs)\n\t\t# out_sz\t\t\t\t\t (int, output sz)\n\t\t# hiddens_nonlinearity ...
[ [ "torch.nn.LogSoftmax", "torch.nn.Linear", "torch.nn.ModuleList", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.nn.ReLU" ] ]
Algue-Rythme/GAT-Skim-Gram
[ "e6e9db5a936e87a2adfdf81a1f00d952d800d1c8" ]
[ "dataset.py" ]
[ "import itertools\nfrom itertools import chain\nfrom itertools import product\nimport os\nfrom collections import defaultdict\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow_datasets.public_api as tfds\n\n\ndef standardize_features(features):\n mean = tf.math.reduce_mean(features, axis=0, keepdim...
[ [ "tensorflow.dtypes.cast", "numpy.array", "tensorflow.zeros", "numpy.array_equal", "tensorflow.concat", "tensorflow.math.reduce_sum", "tensorflow.math.reduce_std", "tensorflow.where", "tensorflow.gather_nd", "tensorflow.expand_dims", "tensorflow.math.log", "tensorflo...
vandalt/species
[ "527dd900a60c4d691bd490569cd3b2007f9beead" ]
[ "species/util/data_util.py" ]
[ "\"\"\"\nUtility functions for data processing.\n\"\"\"\n\nfrom typing import Optional, List\n\nimport h5py\nimport numpy as np\n\nfrom typeguard import typechecked\n\nfrom scipy.interpolate import griddata\n\n\ndef update_sptype(sptypes):\n \"\"\"\n Function to update a list with spectral types to two charac...
[ [ "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.argwhere", "scipy.interpolate.griddata", "numpy.log10", "numpy.unique" ] ]
fgitmichael/SelfSupevisedSkillDiscovery
[ "60eee11cfd67046190dd2784bf40e97bdbed9d40" ]
[ "seqwise_cont_highdimusingvae/main_seqwise_cont_skillspace_2d_nav_highdimusingvae_mcar_single_dims.py" ]
[ "import argparse\nimport torch\nimport numpy as np\nimport copy\n#from gym.envs.mujoco import HalfCheetahEnv\n\nimport rlkit.torch.pytorch_util as ptu\nfrom rlkit.launchers.launcher_util import setup_logger\n\nfrom self_supervised.env_wrapper.rlkit_wrapper import NormalizedBoxEnvWrapper\nfrom self_supervised.utils....
[ [ "numpy.random.seed" ] ]
tianyunchn/web-crawler
[ "5e8d95a2f6885b5970d3f4b010145442af341433" ]
[ "selenium-support.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Apr 6 15:04:11 2019\n\n@author: Administrator\n\"\"\"\nfrom selenium import webdriver\nfrom bs4 import BeautifulSoup\nimport re\nimport time\nimport pandas as pd\nfrom pandas import ExcelWriter\n\n\ncat_dir = 'C:/Users/Administrator/Desktop/็ซžๅ“ID.xlsx'\ndf = pd.read_...
[ [ "pandas.read_excel", "pandas.ExcelWriter" ] ]
USTCEarthDefense/SNBTD
[ "b862230b7c7f36578ac94ee228083f7d2e9c6dd9" ]
[ "code/SSGP_classifier.py" ]
[ "import os\n#os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"-1\"\nimport numpy as np\nimport tensorflow as tf\nimport common_funcs\nfrom common_funcs import FLOAT_TYPE\nimport data_loader\nfrom sklearn.cluster import KMeans\n\nimport time\nimport joblib as jb\n\n# Streaming Sparse Gaussian Tensor Decomposition\n# By ZMP\...
[ [ "tensorflow.reshape", "tensorflow.global_variables_initializer", "numpy.concatenate", "tensorflow.concat", "numpy.log", "tensorflow.Variable", "numpy.eye", "tensorflow.ConfigProto", "tensorflow.variable_scope", "tensorflow.linalg.solve", "tensorflow.constant", "nump...
Yannick947/deep_bau
[ "878cbc452cee8f1e7832ccdd54e5c3ef598702e1" ]
[ "machine_learning/optimize_architecture.py" ]
[ "import datetime\n\nfrom machine_learning.classfication_models import create_bayesian_classifier, create_bayesian_dummy_classifier\nimport numpy as np\nimport pandas as pd\nimport kerastuner as kt\nfrom machine_learning.utils import get_datagen_split\nimport machine_learning.models\nimport machine_learning.classfic...
[ [ "pandas.read_csv" ] ]
Merterm/-Modeling-Intensification-for-SLG
[ "800fff3d3c7bacc86c1db8382f7c2e68d2f0c074" ]
[ "code/generation-model/dynamic_selection/decoders.py" ]
[ "from codecs import EncodedFile\nimport torch.nn as nn\nfrom torch import Tensor\nimport torch\nfrom helpers import freeze_params, ConfigurationError, subsequent_mask, uneven_subsequent_mask\nfrom transformer_layers import PositionalEncoding, \\\n TransformerDecoderLayer, TransformerEncoderLayer\nimport random\n...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.cat", "torch.nn.Softmax", "torch.max", "torch.nn.ReLU" ] ]
tls1403/PythonTest
[ "069f23b25ec655aa199d13aef9c14d2e33366861" ]
[ "part4/matplotlib/practice.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\n#ํ•œ๊ธ€ ํฐํŠธ ์˜ค๋ฅ˜ ์ œ๊ฑฐ\nfrom matplotlib import font_manager,rc\nfont_path =\"D:/5674-833_4th/part4/malgun.ttf\"\nfont_name = font_manager.FontProperties(fname=font_path).get_name()\nrc('font',family = font_name)\n\ndf = pd.read_excel('D:/5674-833_4th/part4/์‹œ๋„๋ณ„ ์ „์ถœ์ž… ์ธ๊ตฌ์ˆ˜.xl...
[ [ "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.xlabel", "pandas.read_excel", "matplotlib.pyplot.title", "matplotlib.rc", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show" ] ]
jfsantos/stable-baselines
[ "5bd4ffa98e364b9e8e8b4e64bc2d1be9b6e4897a" ]
[ "stable_baselines/her/experiment/train.py" ]
[ "import os\nimport sys\nfrom subprocess import CalledProcessError\n\nimport click\nimport numpy as np\nimport json\nfrom mpi4py import MPI\n\nfrom stable_baselines import logger\nfrom stable_baselines.common import set_global_seeds, tf_util\nfrom stable_baselines.common.mpi_moments import mpi_moments\nimport stable...
[ [ "numpy.array", "numpy.random.uniform" ] ]
shar999/mead-baseline
[ "bd9cd02c0a1d9c0df91aca171774a6967e6ce190" ]
[ "baseline/utils.py" ]
[ "import six\nimport os\nimport re\nimport sys\nimport json\nimport gzip\nimport pickle\nimport hashlib\nimport logging\nimport zipfile\nimport platform\nfrom operator import lt, le, gt, ge\nfrom contextlib import contextmanager\nfrom typing import Dict, List, Set, Optional\nimport numpy as np\nimport collections\ni...
[ [ "numpy.zeros", "numpy.sum", "numpy.argpartition", "numpy.argsort", "numpy.random.multinomial" ] ]
JoaquinAmatRodrigo/skforecaster
[ "5ee79a51960a27db9e169706014528eae403e1c2" ]
[ "skforecast/ForecasterAutoregCustom/tests/test_predict.py" ]
[ "from pytest import approx\nimport numpy as np\nimport pandas as pd\nfrom skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom\nfrom sklearn.linear_model import LinearRegression\n\n\ndef create_predictors(y):\n '''\n Create first 5 lags of a time series.\n '''\n \n lags = y[-1:-6:-1]\n ...
[ [ "numpy.array", "sklearn.linear_model.LinearRegression", "pandas.RangeIndex", "pandas.testing.assert_series_equal", "numpy.arange" ] ]
bastienboutonnet/sheetwork
[ "7aa757ed12375ddd2c56502b721d91146d22b7ea" ]
[ "tests/mockers.py" ]
[ "import pandas\nfrom pandas import Timestamp\n\nEXPECTED_CONFIG = {\n \"sheet_name\": \"df_dropper\",\n \"sheet_key\": \"sample\",\n \"target_schema\": \"sand\",\n \"target_table\": \"bb_test_sheetwork\",\n \"columns\": [\n {\"name\": \"col_a\", \"datatype\": \"int\"},\n {\"name\": \"co...
[ [ "pandas.DataFrame.from_dict", "pandas.Timestamp" ] ]
exemuel/indiegogo-scrapper
[ "b46f79f19ecf32d7b2bb98c0102f1e398eda08a9" ]
[ "src/main.py" ]
[ "# load standard libraries\nimport sys\nimport os\n\n# load data analysis library\nimport pandas as pd\n\n# load modules in scraper\nfrom scraper import *\nimport multiprocessing\n\ndef main():\n args = sys.argv[1:]\n\n if os.path.exists(\"chromedriver\\chromedriver.exe\") is False:\n print(\"put chrom...
[ [ "pandas.read_csv" ] ]
Chase1325/IFUTR
[ "f1e9bc241ff5878d32bc6420b8f7d8d28ee93292" ]
[ "ifutr/scripts/localization/reports/generate_Table.py" ]
[ "#Generate the data tables\nimport matplotlib as m\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef dataTable(samples):\n\n celltext_100 = []\n celltext_1225 = []\n celltext_2025 = []\n\n columns = ('X [mm]', 'Y [mm]', r'$\\bar{x}$', r'$\\bar{y}$',r'$\\bar{e_{xy}}$',\n r'$\\bar{...
[ [ "numpy.average", "matplotlib.pyplot.gca", "matplotlib.pyplot.title", "matplotlib.pyplot.figure" ] ]
MaryamHoss/BESD
[ "294e9b417cc5866e76be6faad2357ba8d26e61a9" ]
[ "data_processing/eeg_preprocessing.py" ]
[ "\"\"\"\npaper of interest:\nprobably best tutorial: https://mne.tools/dev/auto_examples/decoding/plot_receptive_field_mtrf.html#sphx-glr-auto-examples-decoding-plot-receptive-field-mtrf-py\n\n\"\"\"\n\nfrom mne.externals.pymatreader import read_mat\nimport os\nimport mne\nfrom mne.preprocessing import ICA\nimport ...
[ [ "numpy.mean" ] ]
howards11/agents
[ "8d5627d9b9c3680468a63564c25a4d82fa1befb0" ]
[ "tf_agents/agents/cql/cql_sac_agent_test.py" ]
[ "# coding=utf-8\n# Copyright 2020 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ...
[ [ "tensorflow.nest.pack_sequence_as", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.constant_initializer", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.Variable", "tensorflow.reshape", "tensorflow.nest.flatten", "tensorflow.constant", "tensorflow.exe...
mkolod/CarND-Capstone
[ "82bdeee73e0a788778e9276bbea8ad3376f4214d" ]
[ "ros/src/tl_detector/light_classification/tl_classifier.py" ]
[ "import numpy as np\nimport os\nimport six.moves.urllib as urllib\nimport sys\nimport tarfile\nimport tensorflow as tf\nimport zipfile\nimport rospy\n\nfrom collections import defaultdict\nfrom io import StringIO\n\nfrom PIL import Image\n\nfrom .object_detection.utils import label_map_util\nfrom .object_detection....
[ [ "scipy.stats.mode", "tensorflow.Graph", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "tensorflow.ConfigProto", "numpy.random.randint", "numpy.argwhere", "numpy.expand_dims" ] ]
DiptoChakrabarty/sentimental
[ "9327ed6ce43ec5317b72d7fd237820d4045cd9fb" ]
[ "app.py" ]
[ "from flask import Flask, render_template,url_for,request\nfrom sklearn.externals import joblib\nimport pandas as pd\nimport numpy as np \nfrom sklearn.feature_extraction.text import CountVectorizer\nimport string,pickle\nfrom sentiment import vector,tf\nfrom sklearn.feature_extraction.text import CountVectorizer,T...
[ [ "sklearn.externals.joblib.load", "pandas.concat" ] ]
cardiffgravity/em-followup
[ "b3df83f3d4aacef67284d2b82a6cc7c32d5b87df" ]
[ "download_data.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 17 10:02:19 2018\n\n@author: lewisprole\n\"\"\"\n\nimport os\nimport time\nimport sys\nimport argparse\nimport calendar\nimport requests\nimport numpy as np\n\n\n'''\nlewis notes\ncreate txt file called userdata.txt\nwrite:\nLCOGT archive ...
[ [ "numpy.array" ] ]
jlapeyre/qiskit-aqua
[ "6bc884dced3d1f525daa59d90f0c6ab10274282c" ]
[ "qiskit/optimization/problems/linear_expression.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE...
[ [ "scipy.sparse.dok_matrix" ] ]
djzelenak/ard-clip-auxiliary
[ "0d83abdc8d8dddae23d31f9e043b098f9dc7cfc3" ]
[ "geo_utils.py" ]
[ "from collections import namedtuple\r\nimport numpy as np\r\n\r\n\r\nclass GetExtents:\r\n\r\n GeoExtent = namedtuple('GeoExtent', ['x_min', 'y_max', 'x_max', 'y_min'])\r\n GeoAffine = namedtuple('GeoAffine', ['ul_x', 'x_res', 'rot_1', 'ul_y', 'rot_2', 'y_res'])\r\n GeoCoordinate = namedtuple('GeoCoordinat...
[ [ "numpy.zeros" ] ]
Alexsandruss/sklearn-onnx
[ "b612557615df439e471867a676c9eca8ae4a787c" ]
[ "skl2onnx/operator_converters/sgd_classifier.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\n\nimport numpy as np\nfrom ..common._apply_operation import (\n apply_add, apply_cast, apply_clip, apply_concat, apply_div, apply_exp,\n apply_identity, apply_mul, apply_reciprocal, apply_reshape, apply_sub)\nfrom ..common.data_types import (\n BooleanTensorType, I...
[ [ "numpy.array", "numpy.issubdtype" ] ]
zxlzr/atec_back
[ "dff0fd07fef1879ee6ad51b7907ee895ef308acb" ]
[ "tf/pred_simese_cnn.py" ]
[ "# !/usr/bin/env python\nimport sys\nimport os\n\nimport tensorflow as tf\n\nfrom dataset import Dataset\nfrom train import FLAGS\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"-1\" \nFLAGS.model_dir = '../model/test1/'\nFLAGS.max_document_length = 34\nUpload=False\n\ndef main(input_file, output_file):\n \n graph = ...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.Graph", "tensorflow.Session", "tensorflow.train.import_meta_graph", "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score" ] ]
UmbWill/napari
[ "f6893b18c26c2004b112ba06f53cb4087728aa88" ]
[ "napari/_qt/experimental/render/test_image.py" ]
[ "\"\"\"Create test images\n\nThis is a throw-away file for creating a test image for octree rendering\ndevelopment. If we keep test images in the product long term we'll\nhave a nicer way to generate them.\n\"\"\"\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\n\n\ndef draw_text(image, text, nx=0....
[ [ "numpy.array" ] ]
orion-orion/TipDMCup20
[ "0718fbd8f2714c5a67b9dd3ce8660085fc78a766" ]
[ "feature_eng.py" ]
[ "'''\nDescripttion: \nVersion: 1.0\nAuthor: ZhangHongYu\nDate: 2021-02-18 13:15:08\nLastEditors: ZhangHongYu\nLastEditTime: 2022-05-16 15:36:04\n'''\nimport pandas as pd\nimport numpy as np\nimport os\nfrom sklearn import preprocessing\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.neighbors imp...
[ [ "sklearn.feature_extraction.DictVectorizer", "numpy.array", "numpy.isnan", "sklearn.model_selection.StratifiedKFold", "pandas.merge", "sklearn.preprocessing.StandardScaler", "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "pandas.concat", "sklearn.tree.Decisi...
dirac-institute/SPSAS2019
[ "34781162bb088b17c1b9afb69eee2284dce6bdec" ]
[ "aMLpy/fig_spec_reconstruction.py" ]
[ "\"\"\"\nPCA Reconstruction of a spectrum\n--------------------------------\nThis shows the reconstruction of a spectrum from eigenspectra.\n\"\"\"\n# Author: Jake VanderPlas <vanderplas@astro.washington.edu>\n# License: BSD\n# The figure produced by this code is published in the textbook\n# \"Statistics, Data ...
[ [ "matplotlib.pyplot.show", "numpy.dot", "matplotlib.pyplot.NullFormatter", "matplotlib.pyplot.figure" ] ]
developmentseed/ml-enabler
[ "ab83086df5d7e3bc9bdd5594e1da2e999b31c8fa" ]
[ "tasks/task-tfrecords/generate_datanpz.py" ]
[ "# code adopted from LabelMaker (https://github.com/developmentseed/label-maker)\nimport os\nfrom os import path as op\nimport requests\nimport rasterio\nimport glob\n\nfrom requests.auth import HTTPBasicAuth\nfrom io import BytesIO\nfrom base64 import b64encode\nfrom urllib.parse import urlparse\nfrom typing impor...
[ [ "numpy.array", "numpy.random.seed", "numpy.rollaxis", "numpy.load", "numpy.random.shuffle", "numpy.split", "numpy.any", "numpy.cumsum" ] ]
eloso42/CarND-Capstone
[ "f662a61c1ca057d744586b3a39ef23c2609ba89c" ]
[ "ros/src/waypoint_updater/waypoint_updater.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport rospy\nfrom geometry_msgs.msg import PoseStamped\nfrom styx_msgs.msg import Lane, Waypoint\nfrom scipy.spatial import KDTree\nimport math\nfrom std_msgs.msg import Int32\n\n\n\n'''\nThis node will publish waypoints from the car's current position to some `x` dist...
[ [ "scipy.spatial.KDTree", "numpy.array", "numpy.dot" ] ]
Coderash1998/reconcile-a-report-using-pandas
[ "71664451602fffe2c0044153b862e5c69d600d7b" ]
[ "code.py" ]
[ "# --------------\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# Code starts here\ndf=pd.read_csv(path)\ndf['state']=df['state'].str.lower()\ndf['total']=df['Jan']+df['Feb']+df['Mar']\nsum_row = df[[\"Jan\", \"Feb\", \"Mar\", \"total\"]].sum()\ndf_final = df....
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.read_html" ] ]
hobogalaxy/geometric-deep-learning
[ "b73c65ee6cecc0a53c37fabe970cae4ce8a8e82e" ]
[ "layers.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch_geometric.utils import add_self_loops\nfrom torch_geometric.nn import MessagePassing\n\n\nclass SGCNConv(MessagePassing):\n def __init__(self, coors, out_channels_1, out_features, label_dim=1, dropout=0):\n \"\"\"\n label_dim - dimention of...
[ [ "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.functional.dropout", "torch.t" ] ]
ProtossLuigi/vision-stretcher
[ "e57e4946e510ba7a13c8d1e6b5a26cc73d84f730" ]
[ "main.py" ]
[ "from typing import Tuple\r\nimport numpy as np\r\nfrom seam_carving import seam_carve\r\nfrom detectron2 import model_zoo\r\nfrom detectron2.engine import DefaultPredictor\r\nfrom detectron2.config import get_cfg\r\nfrom detectron2.data import MetadataCatalog\r\n\r\nUNSTRETCHABLE_CLASSES = [\r\n 'person',\r\n ...
[ [ "numpy.zeros" ] ]
aam12/distiller
[ "fd06fcba028d023e430cd37d1531bc2ac5202ea6" ]
[ "models/cifar100/resnet_cifar.py" ]
[ "#\n# Copyright (c) 2018 Intel Corporation\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 ...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
ivanchenzx/CEVT
[ "635301a0864115a1f95e01627dd29b005463c7ae" ]
[ "loss.py" ]
[ "# list all the additional loss functions\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n\n################## entropy loss (continuous target) #####################\ndef cross_entropy_soft(pred):\n softmax = nn.Softmax(dim=1)\n logsoftmax = nn.LogSoftmax(dim=1)\n loss = torch....
[ [ "torch.nn.LogSoftmax", "torch.cat", "torch.nn.Softmax", "torch.nn.functional.log_softmax", "torch.nn.functional.softmax", "torch.transpose", "torch.exp", "torch.mean", "torch.sum" ] ]
zargit/faulty-pill-detection
[ "ff36767d4af2ece99980d4c9bbf1567fc8415061" ]
[ "data_loader.py" ]
[ "\"\"\"\nmnist_loader\n~~~~~~~~~~~~\n\nA library to load the MNIST image data. For details of the data\nstructures that are returned, see the doc strings for ``load_data``\nand ``load_data_wrapper``. In practice, ``load_data_wrapper`` is the\nfunction usually called by our neural network code.\n\"\"\"\n\n#### Lib...
[ [ "numpy.load", "numpy.reshape", "numpy.zeros" ] ]
AK391/PaddleHub
[ "a51ab7447e089776766becb3297e560dfed98573" ]
[ "modules/audio/tts/fastspeech2_baker/module.py" ]
[ "# Copyright (c) 2021 PaddlePaddle 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 re...
[ [ "numpy.load" ] ]
lhw362950217/sqlflow
[ "a96cb7967a4b9cc82620b0286804b17e6d879f2c" ]
[ "python/runtime/feature/derivation.py" ]
[ "# Copyright 2020 The SQLFlow Authors. All rights reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap...
[ [ "numpy.prod" ] ]
kaihsin/Tor10
[ "81194d3a65f328752fd25a1ce15cb1bf38e99457" ]
[ "tor10/UniTensor.py" ]
[ "## [DEBUG] >>> \n## Note, set this to True to enable debug section\nDEBUG = False\n## <<<\n\n\nimport os\nimport pickle as pkl\n\nimport torch\n\nfrom . import linalg\nfrom .Bond import *\nfrom .Bond import _fx_GetCommRows\n\n\n## Developer Note:\n## [KHW]\n## from v0.3+, we deprecate dense Symmetry. \n## Using a ...
[ [ "torch.Size", "torch.device", "torch.rand", "torch.zeros", "torch.from_numpy", "torch.tensor", "torch.diag", "torch.matmul", "torch.tensordot" ] ]
cyx669521/Conv-TasNet-PyTorch
[ "64188ffa48971218fdd68b66906970f215d7eca2" ]
[ "steps/ipsm_oracle_statistic_log.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright 2019 Northwestern Polytechnical University (author: Ke Wang)\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import absolute_import\n\nimport os\nimport sys\n\nimport numpy as np\nimport matplotlib as mpl\nm...
[ [ "matplotlib.use", "numpy.concatenate", "numpy.empty", "numpy.finfo", "numpy.clip" ] ]
akanametov/NeuralStyleTransfer
[ "06efd9d201d0681dbeec3a806a340fc95a7aebfa" ]
[ "model/__init__.py" ]
[ "import torch\nimport torch.nn as nn\nfrom .utils import NormalizationLayer, ContentLossLayer, StyleLossLayer\n\nclass Compiler():\n def __init__(self, baseModel, contentLayerNames, styleLayerNames, device='cuda:0'):\n self.baseModel = baseModel.to(device)\n self.contentLayerNames = contentLayerNam...
[ [ "torch.nn.Sequential", "torch.nn.ReLU" ] ]
zhongsheng-chen/SDF_Converter
[ "1067981b1056c68c38182eb8a4c255b4f3ab7ebe" ]
[ "convert_sdf_utils.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n# Author: Zhongsheng Chen\n# Date: 10/10/2019\n# Copyright: Copyright 2019, Beijing University of Chemical Technology\n# License: The MIT License ...
[ [ "numpy.all", "tensorflow.gfile.MkDir", "tensorflow.gfile.Open" ] ]
rajivranjanbuff/CSE-555-Project-4-Neural-Networks-and-Deep-Learning
[ "719672defdec5bd8500d8b142316f93ed0d3fba3" ]
[ "Assign4_5/two_hidden_layer.py" ]
[ "import numpy\nimport tensorflow as tf\nimport numpy as np\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import Dropout\nfrom keras.utils import np_utils\nfrom keras.optimizers import SGD\nimport matplotlib.pyplot as plt\nimport keras\nimpo...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "tensorflow.to_float", "matplotlib.pyplot.show" ] ]
Pankaj-Baranwal/Reinforcement-learning-with-tensorflow
[ "cf738d3e975aa9d2384dcd1a65dbdd156ddd970f" ]
[ "contents/1_command_line_reinforcement_learning/treasure_on_right.py" ]
[ "\"\"\"\nA simple example for Reinforcement Learning using table lookup Q-learning method.\nAn agent \"o\" is on the left of a 1 dimensional world, the treasure is on the rightmost location.\nRun this program and to see how the agent will improve its strategy of finding the treasure.\n\nView more on my tutorial pag...
[ [ "numpy.random.seed", "numpy.random.uniform", "numpy.random.choice" ] ]
allesklarbeidir/rio-tiler-mvt
[ "8e77435640b02a6098902f63426fdfc72b2bbcb9" ]
[ "setup.py" ]
[ "\"\"\"Setup for rio-tiler-mvt.\"\"\"\n\nfrom setuptools.extension import Extension\nfrom setuptools import setup, find_packages\nfrom Cython.Build import cythonize\n\nimport numpy\n\n\nwith open(\"README.md\") as f:\n long_description = f.read()\n\ninst_reqs = [\"numpy\", \"vtzero\"]\n\nvt = \"vector-tile-base ...
[ [ "numpy.get_include" ] ]
daniel-de-vries/OpenMDAO
[ "c75c0cc5d116cad7960ae17f5a20e3520398faca" ]
[ "openmdao/core/tests/test_distribcomp.py" ]
[ "from __future__ import print_function\n\nimport unittest\nimport time\n\nimport numpy as np\n\nimport openmdao.api as om\nfrom openmdao.utils.mpi import MPI\nfrom openmdao.utils.array_utils import evenly_distrib_idxs, take_nth\nfrom openmdao.utils.assert_utils import assert_rel_error, assert_warning\n\ntry:\n f...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.arange", "numpy.hstack", "numpy.int32" ] ]
edpsw/imbalanced-learn
[ "a376fa6feb5c7d630a3cab5623b442f65eb97f66" ]
[ "imblearn/under_sampling/_prototype_generation/tests/test_cluster_centroids.py" ]
[ "\"\"\"Test the module cluster centroids.\"\"\"\nfrom collections import Counter\n\nimport pytest\nimport numpy as np\nfrom scipy import sparse\n\nfrom sklearn.cluster import KMeans\nfrom sklearn.datasets import make_classification\n\nfrom imblearn.under_sampling import ClusterCentroids\n\nRND_SEED = 0\nX = np.arra...
[ [ "numpy.array", "numpy.isclose", "sklearn.cluster.KMeans", "sklearn.datasets.make_classification", "numpy.all", "scipy.sparse.csr_matrix", "numpy.flatnonzero" ] ]
tobeperson/sigsep-mus-eval
[ "e8e1ff92f97098d4f2b298fd218f3e826e476146" ]
[ "tests/test_museval.py" ]
[ "import numpy as np\nimport pytest\nimport museval.metrics as metrics\nimport museval\n\n\n@pytest.fixture(params=[1, 2])\ndef nb_sources(request):\n return request.param\n\n\n@pytest.fixture(params=[1, 2])\ndef nb_channels(request):\n return request.param\n\n\n@pytest.fixture(params=[100, 1000])\ndef nb_samp...
[ [ "numpy.random.random" ] ]