repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
SchlossLab/Sovacool_OptiFit_mSphere_2021
[ "096195bf3f47777ebe928786dac353dc1510a1a7" ]
[ "code/py/algorithm_diagram.py" ]
[ "\"\"\" Prep a series of graphs for the algorithm diagram figure.\n\"\"\"\nfrom collections import defaultdict, Counter\nfrom copy import deepcopy\nfrom itertools import combinations\nfrom math import sqrt, factorial # , comb\nimport numpy\nimport pandas\n\n\ndef binom_coeff(n, k):\n \"\"\"\n apparently `fro...
[ [ "numpy.isclose", "numpy.zeros", "pandas.DataFrame", "pandas.DataFrame.from_dict" ] ]
opensandiego/mealscount-backend
[ "f1afb61fa740abe1feadbc15be436c184b791851" ]
[ "strategies/linear_solver.py" ]
[ "from ortools.linear_solver import pywraplp\nimport pandas as pd\nfrom typing import Any, Dict, Tuple\n\n# Package imports\nfrom .base import BaseCEPStrategy, CEPDistrict, CEPGroup\n\npd.options.mode.chained_assignment = None\n\n\nclass _LPOptimizer:\n \"\"\"Runs a greedy linear programming optimizer to group sc...
[ [ "pandas.concat" ] ]
elkiwy/paynter
[ "35a31600b65aa91b26d2f089aaa15051e697a637" ]
[ "paynter/paynter.py" ]
[ "\"\"\"\nThe core module of the PaYnter project, this class will do most of the work when you use this library.\n\"\"\"\n\n#External modules\nimport numpy as N\nimport PIL.Image\nimport PIL.ImageOps\nimport PIL.ImageFont\nimport PIL.ImageDraw \n\n\n#PaYnter Modules\nfrom .blendModes import *\nfrom .brush import *\n...
[ [ "numpy.arctan2", "numpy.sqrt" ] ]
agalbachicar/platform_analytics
[ "73270e43581282661051f30f45ead3e51fa7c5cf" ]
[ "src/platform_analytics/warehouse.py" ]
[ "import networkx as nx\nimport matplotlib.pyplot as plt\n\nclass Warehouse:\n '''\n Builds and holds a grid graph.\n\n Edges have a weight of a x + b where a is the congestion scale, x is the number\n of agents traversing the edge and b is a base cost.\n\n TODO: involve node capacity.\n '''\n def __init__(se...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
PKQ1688/text_detection
[ "e306b003f2e8eb9f8d07fc95d2d9def14fa8b38c" ]
[ "MyDB/data/make_labels/gaussian.py" ]
[ "from math import exp\nimport numpy as np\nimport cv2\nimport os\nimport imgproc\n\n\nclass GaussianTransformer(object):\n\n def __init__(self, imgSize=512, region_threshold=0.4,\n affinity_threshold=0.2):\n distanceRatio = 3.34\n scaledGaussian = lambda x: exp(-(1 / 2) * (x ** 2))\...
[ [ "numpy.expand_dims", "numpy.clip", "numpy.reshape", "numpy.int32", "numpy.concatenate", "numpy.max", "numpy.mean", "numpy.any", "numpy.float32", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.where" ] ]
NewKnowledge/sloth
[ "ed6c9011962f76a1ad1498a03af8b31ac75c6576" ]
[ "Sloth/cluster.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pickle\nfrom scipy import sparse\nimport hdbscan\nfrom sklearn.cluster import DBSCAN\nfrom scipy.spatial.distance import euclidean\nfrom fastdtw import fastdtw\nfrom collections import Counter\nfrom tslearn.clustering import TimeSeriesKMeans, GlobalAlignm...
[ [ "numpy.tril_indices", "numpy.arange", "scipy.sparse.csr_matrix", "numpy.save", "sklearn.cluster.DBSCAN", "numpy.load", "matplotlib.pyplot.figure" ] ]
dulaku/EchoConv-TF
[ "dceafa33914c28beba799f2c996ae2e484005773" ]
[ "EchoConvNetwork.py" ]
[ "import tensorflow, keras, numpy\nfrom tensorflow.python.ops import nccl_ops\nimport matplotlib.pyplot as plt\nimport time\n\nimport config, layers, dataloader, plot\n\ntensorflow_config = tensorflow.ConfigProto()\ntensorflow_config.gpu_options.allow_growth = True # Claim GPU memory as needed\nsession = tensorflow...
[ [ "tensorflow.device", "numpy.mean", "tensorflow.train.AdamOptimizer", "tensorflow.ConfigProto", "tensorflow.clip_by_norm", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.argmax", "numpy.zeros", "matplotlib.pyplot.figure", "tensor...
amypitts01/data440
[ "4900a0a78625614d245b2fd064c6ca74e13049a3", "4900a0a78625614d245b2fd064c6ca74e13049a3" ]
[ "pitts_prj/milestone/project.py", "hw1/10_dims.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"project.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1LKf9ToR_RBmXI4SmLkbuXt5ChrW-1zJA\n\"\"\"\n\nfrom __future__ import print_function\nfrom keras.models import Sequential\nfrom keras import layers\nimp...
[ [ "numpy.random.uniform", "numpy.array", "numpy.random.shuffle", "numpy.random.randint" ], [ "matplotlib.pyplot.title", "numpy.ones", "matplotlib.pyplot.xlabel", "sklearn.datasets.samples_generator.make_blobs", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pypl...
acse-yl27218/cherry
[ "5b349cae64b282facf5a874164690c06808b1c61" ]
[ "tests/unit/_torch_tests.py" ]
[ "#!/usr/bin/env python3\n\nimport unittest\nimport numpy as np\nimport torch as th\nimport cherry as ch\n\nDIM = 5\n\n\nclass TestTorch(unittest.TestCase):\n\n def test_onehot(self):\n single = 3\n oh_single = ch.onehot(single, dim=DIM)\n self.assertTrue(oh_single.size(0) == 1)\n self...
[ [ "torch.zeros", "torch.eye", "numpy.int64", "numpy.float64", "torch.arange" ] ]
cclauss/DALI
[ "38e2ca2a7004f602f069b8d87437d7a23996b491" ]
[ "dali/test/python/test_utils.py" ]
[ "# Copyright (c) 2019, 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 obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req...
[ [ "numpy.minimum", "numpy.abs", "numpy.array_equal", "numpy.random.seed", "numpy.min", "numpy.max", "numpy.mean", "numpy.iinfo", "numpy.random.rand", "numpy.array", "numpy.sum" ] ]
Frodab/InsightFace_Pytorch
[ "44d12109c0b413245bcf7e5248a94361a32961db" ]
[ "verifacation.py" ]
[ "\"\"\"Helper for evaluation on the Labeled Faces in the Wild dataset\n\"\"\"\n\n# MIT License\n#\n# Copyright (c) 2016 David Sandberg\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 Softw...
[ [ "numpy.square", "numpy.logical_not", "numpy.asarray", "numpy.arange", "numpy.less", "numpy.subtract", "sklearn.model_selection.KFold", "numpy.concatenate", "numpy.max", "numpy.std", "numpy.argmax", "numpy.mean", "sklearn.preprocessing.normalize", "scipy.inte...
facebookresearch/rlmeta
[ "6aeeb593b89f2106e8680c0a850632c8ca54c14f" ]
[ "examples/plot.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport json\nimport re\n\nfrom datetime import datetime\nfrom typing import Any, Dict, Optional, Union\n\nimport ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
J-Curwell/portfolio-manager
[ "463d3873b672a99fce5e811b9e7b8f58c772f7c8" ]
[ "src/portfolio_manager/return_calculators.py" ]
[ "import abc\nfrom typing import Any, Union\n\nimport numpy as np\nimport pandas as pd\nfrom numpy_financial import irr\n\nfrom portfolio_manager.exceptions import InsufficientData\nfrom portfolio_manager.portfolio import InvestmentPortfolio\n\n\nclass ReturnCalculator(abc.ABC):\n @abc.abstractmethod\n def cal...
[ [ "numpy.product", "pandas.DataFrame" ] ]
InputBlackBoxOutput/Rock-Paper-Scissors
[ "f9dc5b98f8951360a8d646e88be1952b588eda6c" ]
[ "model/train.py" ]
[ "import pickle\nimport glob\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import classification_report, confusion_matrix\n\ndef train_model():\n l = []\n for each in glob.glob(\"dataset/landmarks/*.csv\"):\n ...
[ [ "pandas.concat", "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.confusion_matrix", "sklearn.model_selection.train_test_split", "sklearn.metrics.classification_report" ] ]
stu314159/pyNFC
[ "635777e3ca8532543ca09bb03c74d4c833ac70bd" ]
[ "pyNFC_Util.py" ]
[ "# pyNFC_Util.py\n\"\"\"\ndefinition module for some pyNFC utility classes\n\n\n\"\"\"\n\nimport numpy as np\n\nclass NFC_Halo_Data_Organizer(object):\n \"\"\"\n collect and organize how halo data will be organized prior to communication\n \"\"\"\n def __init__(self,ngb_rank):\n \"\"\"\n ...
[ [ "numpy.array", "numpy.empty" ] ]
yuananf/Voice-Cloning-App
[ "5996f971232fd8056cd2514b196df44bffef0d34", "5996f971232fd8056cd2514b196df44bffef0d34" ]
[ "training/dataset.py", "dataset/clip_generator.py" ]
[ "import os\nimport numpy as np\nimport random\nimport torch\nfrom training.tacotron2_model import TacotronSTFT\nfrom scipy.io.wavfile import read\nimport inflect\n\nfrom training.clean_text import clean_text\n\n\ndef load_wav_to_torch(full_path):\n \"\"\"\n Credit: https://github.com/NVIDIA/tacotron2\n\n L...
[ [ "torch.IntTensor", "numpy.load", "scipy.io.wavfile.read", "torch.squeeze", "torch.autograd.Variable" ], [ "matplotlib.pyplot.show", "matplotlib.pyplot.hist" ] ]
DTUWindEnergy/Edwin
[ "a7bf2e79a2378a7b97e434fa0aa5e36f8ad3f611" ]
[ "ed_win/two_lines_intersecting.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 11 13:33:46 2020\n\n@author: juru\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pylab as plt\n\n\ndef two_lines_intersecting(line1, line2):\n \"\"\"\n \"\"\"\n intersect = False\n if (((line1[0][0] == line1[1][0]) and (line1[0][1] == line1[1][1])) ...
[ [ "numpy.abs", "numpy.min", "numpy.max", "numpy.random.rand", "numpy.array", "numpy.zeros" ] ]
galatolofederico/vel
[ "bdf9d9eb6ed66278330e8cbece307f6e63ce53c6" ]
[ "vel/modules/input/embedding.py" ]
[ "import torch.nn as nn\n\nfrom vel.api import LinearBackboneModel, TextData, ModelFactory\n\n\nclass EmbeddingInput(LinearBackboneModel):\n \"\"\" Learnable Embedding input layer \"\"\"\n\n def __init__(self, alphabet_size: int, output_dim: int, pretrained: bool=False, frozen: bool=False,\n so...
[ [ "torch.nn.Embedding" ] ]
cjld/models
[ "f7fb0f8088d2c25dd67059d7f218fc417674164e" ]
[ "fluid/PaddleRec/word2vec/reader.py" ]
[ "# -*- coding: utf-8 -*\n\nimport numpy as np\nimport preprocess\n\nimport logging\n\nlogging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')\nlogger = logging.getLogger(\"fluid\")\nlogger.setLevel(logging.INFO)\n\n\nclass Word2VecReader(object):\n def __init__(self,\n dict_path,\...
[ [ "numpy.random.randint" ] ]
Ariiia/PacManAGenerator
[ "769119ec7a43d643cfcdef20ab4dcc760505d738" ]
[ "mapgen.py" ]
[ "from numpy.lib.arraypad import pad\nimport pygame\nimport numpy as np\nfrom numpy import fliplr\nfrom pygame.locals import *\nfrom constants import *\n\nimport random\nimport time\n\n\n\n\n\nclass Maze(object):\n def __init__(self):\n self.maze = []\n\n #do not touch\n self.height = 27 #top...
[ [ "numpy.fliplr", "numpy.concatenate", "numpy.chararray", "numpy.printoptions" ] ]
Patrick5455/Impact-of-Covid-19-on-Food-and-Air-Quality-in-Africa
[ "da67f35785ece028fda2b4a5c4bf928b37cc21b9", "da67f35785ece028fda2b4a5c4bf928b37cc21b9" ]
[ "Kev_is_on_the_bus/twitterDataBlueBird.py", "Kev_is_on_the_bus/sentimentAnalysisModel.py" ]
[ "import pandas as pd\nimport numpy as np\nimport os\nimport re\nimport logging\nimport nltk\nnltk.download('stopwords')\nnltk.download('punkt')\nimport string\nfrom datetime import datetime, date, time, timedelta\nimport tweepy\nfrom tweepy import OAuthHandler, API, Cursor, Stream\nfrom tweepy.streaming import Stre...
[ [ "pandas.concat", "pandas.DataFrame" ], [ "sklearn.model_selection.train_test_split", "sklearn.preprocessing.LabelEncoder", "numpy.zeros", "pandas.read_csv" ] ]
steflbert/batchgenerators
[ "add7f19c54d5c45a2d27aca346eb96c71d25a137" ]
[ "batchgenerators/transforms/abstract_transforms.py" ]
[ "# Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)\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/...
[ [ "numpy.random.uniform" ] ]
JuliaSprenger/probeinterface
[ "4c34a06293cd7a5602293829155a884d0f50a9fe" ]
[ "probeinterface/plotting.py" ]
[ "\"\"\"\nA simple implementation for plotting a Probe or ProbeGroup\nusing matplotlib.\n\nDepending on Probe.ndim, the plotting is done in 2D or 3D\n\"\"\"\n\nimport numpy as np\nfrom matplotlib import path as mpl_path\n\n\ndef plot_probe(probe, ax=None, contacts_colors=None,\n with_channel_index=Fals...
[ [ "numpy.min", "matplotlib.path.Path", "matplotlib.pyplot.subplots", "numpy.max", "matplotlib.collections.PolyCollection", "numpy.array", "matplotlib.pyplot.figure" ] ]
gitter-lab/ml4bio
[ "938d79616018df53c611e396ccc489673d43e561" ]
[ "ml4bio/model.py" ]
[ "import warnings\nimport pandas as pd\nimport numpy as np\nfrom sklearn import tree, ensemble, neighbors, linear_model, neural_network, svm, naive_bayes\nfrom sklearn import preprocessing, model_selection, exceptions\nfrom PyQt5.QtWidgets import QTreeWidgetItem\nfrom matplotlib.backends.backend_qt5agg import Figure...
[ [ "numpy.hstack", "pandas.concat", "numpy.maximum", "numpy.arange", "sklearn.model_selection.train_test_split", "sklearn.model_selection.KFold", "sklearn.model_selection.StratifiedKFold", "matplotlib.rcParams.update", "matplotlib.colors.ListedColormap", "sklearn.preprocessing...
LLNL/narrows
[ "73d3796890c6a884d280db029d4d59834b5e8ac1" ]
[ "test/test_mc21/test_mc21.py" ]
[ "'''\nThis test generates the flux plots for mc21.\n'''\n\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport os\nimport sys\nimport yaml\nMY_DIR = os.path.dirname(__file__)\n\nsys.path.append(f'{MY_DIR}/..')\nimport analyze # noqa: E402\n\nsys.path.append(f'{MY_DIR}/../..')\nimport narrows # noqa: ...
[ [ "numpy.load", "matplotlib.pyplot.style.use" ] ]
HuangRunHua/-
[ "53ec06b1c61c83f41d15bee9267ddf68f6d1b048" ]
[ "yolov3-master/train.py" ]
[ "import argparse\nimport logging\nimport math\nimport os\nimport random\nimport time\nfrom copy import deepcopy\nfrom pathlib import Path\nfrom threading import Thread\n\nimport numpy as np\nimport torch.distributed as dist\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport...
[ [ "torch.optim.Adam", "torch.distributed.broadcast", "torch.optim.lr_scheduler.LambdaLR", "torch.distributed.init_process_group", "torch.cuda.amp.autocast", "numpy.concatenate", "numpy.ones", "torch.cuda.amp.GradScaler", "torch.utils.tensorboard.SummaryWriter", "torch.distrib...
adityajn105/Image-Captions-using-visual-attention
[ "a2df3d6f4365c43fddb2aa5afa49102b97dd9c84" ]
[ "src/test.py" ]
[ "\"\"\"\nBy : Aditya Jain\nLast Update : 9 April 2020\nContact: https://adityajain.me\n\"\"\"\nimport pandas as pd\nimport numpy as np\n\nimport cv2\nimport matplotlib.pyplot as plt\n\nimport pickle as pkl\n\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.applications.vgg19 import preprocess_...
[ [ "tensorflow.keras.models.load_model", "pandas.read_csv", "tensorflow.keras.applications.vgg19.preprocess_input", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.argmax", "numpy.flip", "numpy.array", "numpy.zeros" ] ]
tam17aki/dcase2020_task2_baseline
[ "7930b308ccf41796359b8ec668e518f056a95435" ]
[ "pytorch_vae/common.py" ]
[ "#!/usr/bin/python\n\n\"\"\"\n @file common.py\n @brief Commonly used script\n @author Toshiki Nakamura, Yuki Nikaido, and Yohei Kawaguchi (Hitachi Ltd.)\n Copyright (C) 2020 Hitachi, Ltd. All right reserved.\n\"\"\"\n\n########################################################################\n# import python-lib...
[ [ "numpy.log10", "numpy.zeros", "numpy.empty" ] ]
intermod-pro/presto-demo
[ "82e6ebae1ce2e8aad723ef880780f3ce3be902ef" ]
[ "demo_3_long_pulses.py" ]
[ "\"\"\" Create a long template by concatenating multiple shorter templates.\n\nAlso demonstrate the convenience method setup_long_drive.\n\nConnect Out 1 to In 1 and Out 2 to In 2.\n\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom presto import pulsed\n\nADDRESS = \"192.168.42.50\" # set address...
[ [ "numpy.arange", "matplotlib.pyplot.subplots", "numpy.hanning", "numpy.sin" ] ]
MathysC/DailyClimateAnalysis
[ "411d670047e0a701718a69cebea145ab2e692ac4" ]
[ "Utils/Graphics.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom matplotlib.dates import DateFormatter\nfrom matplotlib.ticker import AutoMinorLocator\n\n\ndef plot_time_series(df, column_name, dateformat=\"%y-%m-%d\", labels=None):\n\t\"\"\"\n\tPlot the given dataframe with time series as index\n\t:...
[ [ "matplotlib.dates.DateFormatter", "matplotlib.ticker.AutoMinorLocator", "matplotlib.pyplot.subplots", "numpy.append", "matplotlib.pyplot.close", "matplotlib.pyplot.show" ] ]
department-of-general-services/priority-vendor-aging-report
[ "7c88c92865c06b4757749f5ced24a9e3a4fe5986" ]
[ "app/src/dgs_fiscal/etl/contract_management/main.py" ]
[ "from __future__ import annotations # prevents NameError for typehints\nfrom typing import List, Dict\nfrom dataclasses import dataclass\n\nimport pandas as pd\nimport numpy as np\n\nfrom dgs_fiscal.systems import CitiBuy, SharePoint\nfrom dgs_fiscal.systems.sharepoint import BatchedChanges, BatchResults\nfrom dgs...
[ [ "pandas.to_datetime", "numpy.where" ] ]
womeier/adaconv
[ "5ba965999bfa515a548c4f871f339655f1e850e0" ]
[ "stylize.py" ]
[ "from argparse import ArgumentParser\r\n\r\nimport torch\r\n\r\nfrom lib import dataset\r\nfrom lib.lightning.lightningmodel import LightningModel\r\n\r\n\r\ndef stylize_image(model, content_file, style_file, content_size=None):\r\n device = next(model.parameters()).device\r\n\r\n content = dataset.load(conte...
[ [ "torch.no_grad", "torch.cuda.is_available" ] ]
Howave/ppq
[ "51bd031b0f50b63d32c4848a2c678a7b9e3d2957" ]
[ "ppq/quantization/algorithm/training.py" ]
[ "# TODO move training logic to here.\n\nfrom typing import Any, Callable, List\n\nimport numpy as np\nimport torch\nfrom ppq.IR.base.graph import Operation\nfrom ppq.IR.quantize import QuantableOperation\nfrom ppq.core import (USING_CUDA_KERNEL, ChannelwiseTensorQuantizationConfig,\n Quantizati...
[ [ "torch.randn_like", "torch.abs", "torch.sigmoid", "torch.zeros_like", "numpy.cos", "torch.clip" ] ]
6un9-h0-Dan/translate
[ "3555a8d150aaea9d178f2c122206f4db64ae32d9", "3555a8d150aaea9d178f2c122206f4db64ae32d9" ]
[ "pytorch_translate/train.py", "pytorch_translate/average_attention.py" ]
[ "#!/usr/bin/env python3\n\nimport builtins as __builtin__\nimport collections\nimport datetime\nimport faulthandler\nimport math\nimport multiprocessing.queues as mp_queues\nimport os\nimport queue\nimport random\nimport time\nfrom typing import Any, Callable, Dict, Optional, Tuple\n\nimport numpy as np\nimport tor...
[ [ "numpy.abs", "torch.cuda.set_device", "torch.multiprocessing.spawn", "numpy.reshape", "torch.manual_seed", "torch.multiprocessing.get_context", "torch.cuda.is_available", "torch.cuda.device_count", "numpy.vstack" ], [ "torch.is_tensor", "torch.cat", "torch.bmm",...
BA-OST-2022/audio-beamformer-software
[ "3052a74b01676701ece403b06f637f6cc4b4a5d9" ]
[ "AudioBeamformer/FaceTracking/KalmanFilter2D.py" ]
[ "import numpy as np\n\nclass KalmanFilter2D:\n def __init__(self, Ts, R, Qp, Qv):\n self.Ts = Ts\n self.x = np.array([[0.0], [0.0], [0.0], [0.0]])\n self.P = np.array([[1000.0, 0.0, 0.0, 0.0],\n [0.0, 1000.0, 0.0, 0.0],\n [0.0, 0.0, 10.0, 0...
[ [ "matplotlib.pyplot.legend", "numpy.linalg.inv", "numpy.arange", "numpy.cos", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "numpy.random.randn", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "numpy.vstack", "matplotlib...
dbis-uibk/MediaEval2020
[ "c1ba6b55ce91347556020b7a14fc317aae1dac9a" ]
[ "src/mediaeval2020/models/cnn.py" ]
[ "import numpy as np\nfrom sklearn.base import BaseEstimator\nfrom sklearn.base import ClassifierMixin\nfrom sklearn.metrics import roc_curve\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.layers import Conv2D\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.layers import Dro...
[ [ "tensorflow.keras.layers.Activation", "numpy.greater", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.optimizers.RMSprop", "sklearn.metrics.roc_curve", "tensorflow.keras.layers.MaxPooling2D", "numpy.full", ...
danielthank/submarine
[ "0bf5b71163fa366b1f91e7d9c5b6e4ce02b827b1" ]
[ "submarine-sdk/pysubmarine/submarine/ml/model/deepfm.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 ma...
[ [ "tensorflow.variable_scope", "tensorflow.reshape" ] ]
nstarman/utilipy
[ "17984942145d31126724df23500bafba18fb7516" ]
[ "utilipy/data_utils/decorators.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"`data_util` decorators.\"\"\"\n\n\n##############################################################################\n# IMPORTS\n\n# BUILT-IN\nimport sys\nimport typing as T\n\n# THIRD PARTY\nimport numpy as np\nfrom typing_extensions import Literal\n\n# PROJECT-SPECIFIC\nfrom utilipy...
[ [ "numpy.asarray" ] ]
alexmlamb/blocks_rl_gru_setup
[ "fe462f79518d14f828e2c7cbf210cd105ff982f4" ]
[ "rainy/envs/atari_wrappers.py" ]
[ "\"\"\"\nThis module provides wrappers of atari environments in openai gym.\nOriginaly from openai baselines, but modified to:\n- Support PyTorch\n- Support [dopamine](https://github.com/google/dopamine) style setting\n\"\"\"\nimport cv2\nimport numpy as np\nimport gym\nfrom gym import spaces\nfrom ..replay import ...
[ [ "numpy.expand_dims", "numpy.sign", "numpy.concatenate", "numpy.zeros_like", "numpy.zeros", "numpy.random.randint" ] ]
clemens33/thesis
[ "c94e066c2fe22881a7465eb9c3859bd02138748e", "c94e066c2fe22881a7465eb9c3859bd02138748e" ]
[ "src/tabnet/attentive.py", "src/baseline/classifier.py" ]
[ "from typing import Tuple, Union\n\nimport torch\nimport torch.nn as nn\nfrom entmax import Entmax15, Sparsemax\n\nfrom tabnet.sparsemax import EntmaxBisect\nfrom tabnet.utils import GhostBatchNorm1d, Round1 as Round, HardSigm2 as HardSigm\n\n\nclass Attentive(nn.Module):\n def __init__(self, dim: int = -1, atte...
[ [ "torch.nn.Softmax", "torch.nn.Linear", "torch.scalar_tensor", "torch.nn.Hardsigmoid" ], [ "torch.nn.BatchNorm1d", "torch.nn.Sequential", "torch.nn.Dropout", "torch.Tensor", "torch.nn.ModuleList", "torch.nn.Embedding", "torch.nn.Linear", "torch.optim.AdamW", ...
jperezvisaires/tfg-intphys
[ "8c32c383bf00c00b0fc627ba7bf1192bc3011c40" ]
[ "modules/old/model_unet.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras import Model, Input\nfrom tensorflow.keras.layers import Conv2D, Conv2DTranspose \nfrom tensorflow.keras.layers import MaxPool2D, UpSampling2D, Concatenate\nfrom tensorflow.keras.layers import BatchNormalization, Activation, Dropout\n\n# Unet Layers.\n\ndef unet_conv...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.layers.Activation", "tensorflow.keras.Input", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.Model",...
Morilor/eemeter
[ "312525bb89119b877d0d905d45c167052b7275f5" ]
[ "eemeter/io.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n\n Copyright 2014-2019 OpenEEmeter contributors\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.apa...
[ [ "pandas.DatetimeIndex", "pandas.read_csv", "pandas.to_datetime", "pandas.DataFrame" ] ]
DJKINGASSASSIN/Real-Time-Voice-Cloning
[ "34bb74b0286840cd093a8d9f71e5ae89da4ce3b4", "34bb74b0286840cd093a8d9f71e5ae89da4ce3b4" ]
[ "synthesizer/synthesize.py", "synthesizer/preprocess.py" ]
[ "import platform\nfrom functools import partial\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\n\nfrom synthesizer.hparams import hparams_debug_string\nfrom synthesizer.models.tacotron import Tacotron\nfrom synthesizer.synthesizer_datase...
[ [ "numpy.int32", "torch.utils.data.DataLoader", "numpy.save", "torch.cuda.is_available", "torch.device", "torch.cuda.device_count" ], [ "numpy.abs", "numpy.save", "numpy.concatenate", "numpy.load", "numpy.array", "numpy.where" ] ]
tigercosmos/uranus-eyes-plus
[ "5d1ab88c4d0a40b616dace6f95b8860bfc3c4271" ]
[ "server/python/label_image.py" ]
[ "import os, sys\nimport json\nimport tensorflow as tf\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\n# change this as you see fit\nimage_path = sys.argv[1]\nlabels_path = sys.argv[2]\ngraph_path = sys.argv[3]\n\n# Read in the image_data\nimage_data = tf.gfile.FastGFile(image_path, 'rb').read()\n\n# Loads label file...
[ [ "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.gfile.FastGFile" ] ]
keppy/tango
[ "fbb78935a1c8a88c049e5ace0a2d0c7eeb4c8893" ]
[ "tests/integrations/torch/train_test.py" ]
[ "import json\n\nimport pytest\nimport torch.distributed as dist\n\nfrom tango.common.logging import initialize_logging, teardown_logging\nfrom tango.common.testing import TangoTestCase\n\n\nclass TestTrainStep(TangoTestCase):\n def setup_method(self):\n super().setup_method()\n initialize_logging(e...
[ [ "torch.distributed.is_initialized", "torch.distributed.destroy_process_group" ] ]
lbertge/handtracking
[ "4f9fbc9507ec652e24ba4a929b3c77d7b08a7be0" ]
[ "egohands_dataset_clean.py" ]
[ "import scipy.io as sio\nimport numpy as np\nimport os\nimport gc\nimport six.moves.urllib as urllib\nimport cv2\nimport time\nimport xml.etree.cElementTree as ET\nimport random\nimport shutil as sh\nfrom shutil import copyfile\nimport zipfile\n\nimport csv\n\n\ndef save_csv(csv_path, csv_content):\n with open(c...
[ [ "scipy.io.loadmat", "numpy.size", "numpy.append", "numpy.array", "numpy.empty" ] ]
oscarlorentzon/repstruct
[ "9af72e4a7e7483b5a89261d438cef4e606c67e1b" ]
[ "tests/test_extract.py" ]
[ "import unittest\nimport numpy as np\n\nfrom mock import Mock, patch, PropertyMock\n\nimport repstruct.features.extract as extract\nimport repstruct.dataset as dataset\n\n\nclass TestExtract(unittest.TestCase):\n\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\n def testGetRgbFromL...
[ [ "numpy.abs", "numpy.isnan", "numpy.linalg.norm", "numpy.ones", "numpy.array", "numpy.zeros" ] ]
eduidl/CarND-Advanced-Lane-Lines
[ "65ee8cdc4bb1c95b181ee9d184dd1022ffa545e1" ]
[ "calibration.py" ]
[ "import cv2\nimport numpy as np\nfrom pathlib import Path\nimport pickle\nimport re\n\ndef extract_num(path):\n pattern = r\"calibration(\\d+).jpg\"\n return int(re.match(pattern, path.name).group(1))\n\ndef calibrate(nx=9, ny=6):\n objp = np.zeros((nx * ny, 3), np.float32)\n objp[:, :2] = np.mgrid[0:nx...
[ [ "numpy.zeros" ] ]
gtsoukas/cfzoo
[ "4ea9f92cfd8582912f28d9b844c10bc9bbe44180" ]
[ "src/main/python/ncf/evaluate.py" ]
[ "import numpy as np\nimport torch\n\n\ndef hit(gt_item, pred_items):\n\tif gt_item in pred_items:\n\t\treturn 1\n\treturn 0\n\n\ndef ndcg(gt_item, pred_items):\n\tif gt_item in pred_items:\n\t\tindex = pred_items.index(gt_item)\n\t\treturn np.reciprocal(np.log2(index+2))\n\treturn 0\n\n\ndef metrics(model, test_loa...
[ [ "torch.topk", "torch.take", "numpy.log2", "numpy.mean" ] ]
tomescaff/antarctica
[ "68eeea49c065e5cada56698ccca4d2883ee486dd" ]
[ "displaying/examples/subsample_time_series_eclipse.py" ]
[ "import sys\nfrom datetime import datetime\nsys.path.append('../../processing/examples/')\nsys.path.append('../../processing/')\n\nfrom subsample_data_eclipse import data\nimport matplotlib.pyplot as plt\n\n# select aws code\ncode = 'jas' # [jas, kth, byd, lda]\n\n# get data from processing dir\naws = data[code]['a...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.axvline", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ]...
student-work-agu-gis2021/lesson7-matplotlib-mayu-sagawa
[ "fac4e1d28639bf18df93899d0dd0d1be037692f3" ]
[ "Exercise_7_problem_2.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# ## Problem 2 - Plotting temperatures \n# \n# In this problem we will plot monthly mean temperatures from the Helsinki-Vantaa airpot for the past 30 years.\n# \n# ## Input data\n# \n# File `data/helsinki-vantaa.csv` monthly average temperatures from Helsinki Vantaa airpo...
[ [ "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
microsoft/semiparametric-distillation
[ "b7153f1e8bbbe6d8261f64c23828611a5419a13a" ]
[ "kd.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nclass KDLoss(nn.Module):\n \"\"\"\n Loss with knowledge distillation.\n \"\"\"\n def __init__(self, temperature=1.0, alpha=0.5):\n super().__init__()\n self.temperature = temperature\n self.alpha = alpha\...
[ [ "torch.nn.functional.softmax", "torch.linspace", "torch.nn.functional.log_softmax", "torch.argmin", "torch.nn.functional.mse_loss", "torch.log", "torch.arange", "torch.nn.functional.one_hot", "torch.clamp", "torch.ones_like" ] ]
DengpanFu/mmsr
[ "addfabdaee86d2f9e41988dcfe92a817c5efe7ab" ]
[ "codes/models/Video_base_model.py" ]
[ "import logging\nfrom collections import OrderedDict\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.parallel import DataParallel, DistributedDataParallel\nimport models.networks as networks\nimport models.lr_sche...
[ [ "torch.optim.Adam", "torch.nn.MSELoss", "torch.ones", "torch.floor", "torch.nn.parallel.DataParallel", "torch.zeros", "torch.cat", "torch.cuda.current_device", "torch.no_grad", "torch.nn.functional.interpolate", "torch.arange", "torch.distributed.get_rank", "tor...
Urban-Analytics/dust
[ "952ca8991ac1f7ff65387a1b21a3fd36cf98314a" ]
[ "Projects/ABM_DA/stationsim/stationsim_gcs_model.py" ]
[ "'''\nStationSim - GrandCentral version\n author: patricia-ternes\n modified: 19/06/2020\n'''\n\nimport warnings\nimport numpy as np\nimport os\nfrom scipy.spatial import cKDTree\nimport matplotlib.pyplot as plt\nfrom matplotlib.animation import FuncAnimation\n# Dont automatically load seaborn as it isn't nee...
[ [ "numpy.dot", "matplotlib.pyplot.legend", "numpy.amax", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "matplotlib.pyplot.plot", "numpy.all", "numpy.mean", "scipy.spatial.cKDTree", "numpy.random.randint", "matplotlib.pyplot.tight_layout", "numpy.clip", "num...
JDaniel41/rl-baselines3-zoo
[ "12748419dfe0e41f25c99b2b74bfe6593e1915aa" ]
[ "scripts/plot_train.py" ]
[ "\"\"\"\nPlot training reward\n\"\"\"\nimport argparse\nimport os\n\nfrom matplotlib import pyplot as plt\nfrom stable_baselines3.common.results_plotter import X_EPISODES, X_TIMESTEPS, X_WALLTIME, plot_results\n\n# For tensorflow imported with tensorboard\n# import warnings\n# warnings.filterwarnings(\"ignore\", ca...
[ [ "matplotlib.pyplot.show" ] ]
sawravchy/MT-EQA
[ "9a5483cc29ed6ee8d00590e28264743c6bcbe7ad" ]
[ "nav_loc_vqa/pyutils/house3d.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport cv2\nimport csv\nimport copy\nimport sys\nimport time\nimport pickle\nimport os\nimport os.path...
[ [ "numpy.sqrt", "numpy.abs", "numpy.ones", "numpy.all", "numpy.ceil", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
sean-dingxu/sciwing
[ "75eca1ea43be165eab20cf8bd81bbc19cecda74c", "75eca1ea43be165eab20cf8bd81bbc19cecda74c" ]
[ "sciwing/modules/lstm2seq_attncontext_encoder.py", "examples/science_ie/science_ie.py" ]
[ "import torch.nn as nn\nfrom sciwing.utils.class_nursery import ClassNursery\nfrom sciwing.data.contextual_lines import LineWithContext\nfrom sciwing.modules.lstm2seqencoder import Lstm2SeqEncoder\nfrom sciwing.modules.embedders.base_embedders import BaseEmbedder\nfrom typing import List, Union\nimport torch\n\n\nc...
[ [ "torch.mean", "torch.cat", "torch.randn", "torch.bmm", "torch.device", "torch.stack" ], [ "torch.device" ] ]
TheMortalCoil92/neuspell_access
[ "f1d1a8b4efa7c6aa6e0564ea17db152905f4c7dc" ]
[ "scripts/trainable/seq_modeling/elmosclstm.py" ]
[ "\r\n#############################################\r\n# USAGE\r\n# CUDA_VISIBLE_DEVICES=1 python elmosclstm.py probword ../../data -1\r\n# CUDA_VISIBLE_DEVICES=2 python elmosclstm.py bea40kfinetune ../../data -1\r\n#\r\n# CUDA_VISIBLE_DEVICES=1 python elmosclstm.py none ../../data 1\r\n# CUDA_VISIBLE_DEVICES=1 pyth...
[ [ "torch.nn.CrossEntropyLoss", "numpy.cumsum", "torch.cuda.empty_cache", "torch.tensor", "torch.no_grad", "numpy.argmin", "torch.cuda.is_available" ] ]
YoniChechik/test_site
[ "6e06de9629fefc4a0a005786ecde600c7462f124" ]
[ "other_tutorials/image_to_chars.py" ]
[ "#%% [markdown]\n# # Image to chars\n# We want to represent images with chars to get a cool matrix effect\n#\n# All data that we are working on can be found here: https://github.com/YoniChechik/AI_is_Math/tree/master/other_tutorials\n\n#%%\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\n#%%\nim_...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.title", "numpy.asarray", "matplotlib.pyplot.colorbar", "numpy.floor", "matplotlib.pyplot.show", "numpy.zeros", "numpy.where" ] ]
pratiman-91/proplo
[ "53f77b05ae68125be0f76b63f502a43366c2798f", "53f77b05ae68125be0f76b63f502a43366c2798f" ]
[ "proplot/constructor.py", "proplot/internals/data.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nThe constructor functions used to build class instances from simple shorthand arguments.\n\"\"\"\n# NOTE: These functions used to be in separate files like crs.py and\n# ticker.py but makes more sense to group them together to ensure usage is\n# consistent and so online documentatio...
[ [ "matplotlib.ticker.MultipleLocator", "matplotlib.ticker.StrMethodFormatter", "matplotlib.projections.get_projection_names", "numpy.arange", "matplotlib.scale.register_scale", "numpy.sort", "numpy.iterable", "matplotlib.ticker.FuncFormatter" ], [ "numpy.nanmedian", "nump...
fdiehl/pytorch_geometric
[ "14b628e18fdefc250915ddc7b7b39f7880dad6cf" ]
[ "examples/reddit.py" ]
[ "import os.path as osp\n\nimport argparse\nimport torch\nimport torch.nn.functional as F\nfrom torch_geometric.datasets import Reddit\nfrom torch_geometric.data import NeighborSampler\nfrom torch_geometric.nn import SAGEConv, GATConv\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--model', type=str, de...
[ [ "torch.cuda.is_available", "torch.nn.functional.log_softmax", "torch.nn.functional.dropout" ] ]
burkbre/pandas
[ "547f128eff607479c0fcda4b363595303b6272c8", "547f128eff607479c0fcda4b363595303b6272c8" ]
[ "pandas/core/computation/pytables.py", "pandas/tests/io/test_sql.py" ]
[ "\"\"\" manage PyTables query interface via Expressions \"\"\"\n\nimport ast\nfrom functools import partial\nfrom typing import Any, Optional, Tuple\n\nimport numpy as np\n\nfrom pandas._libs.tslibs import Timedelta, Timestamp\nfrom pandas.compat.chainmap import DeepChainMap\n\nfrom pandas.core.dtypes.common import...
[ [ "pandas.core.common.flatten", "pandas.core.dtypes.common.is_list_like", "pandas._libs.tslibs.Timedelta", "pandas.compat.chainmap.DeepChainMap", "pandas._libs.tslibs.Timestamp", "pandas.Index", "pandas.core.computation.ops.is_term", "pandas.core.computation.common._ensure_decoded", ...
russelljjarvis/numba_reduced_neuronal_models
[ "bc500aefab267a1a1eaf2a1d8dac83da676d7ee6" ]
[ "unittest/test_numba_models.py" ]
[ "import unittest\n#import nose as nt\nimport nose.tools as nt\nfrom nose.plugins.attrib import attr\nimport jithub\nfrom jithub.models import model_classes\nimport quantities as pq\nimport numpy as np\n#import matplotlib.pyplot as plt\nimport collections\nimport quantities as pq\nimport time\n\nDELAY = 0*pq.ms\nDUR...
[ [ "numpy.round" ] ]
benjaminkaplanphd/traveling-salesperson
[ "5c788554fe90eeb81b6351aeec96f1d64caa7591", "5c788554fe90eeb81b6351aeec96f1d64caa7591" ]
[ "tests/unit/test_algorithm.py", "traveling_salesperson/etl.py" ]
[ "\"\"\"\nUnit tests for the algorithm.py module\n\"\"\"\n# pragma pylint: disable=redefined-outer-name\nimport numpy as np\nimport pytest\n\nfrom traveling_salesperson import algorithm\n\n\n@pytest.fixture()\ndef pyramid_distance_matrix_fixture():\n r\"\"\"A distance matrix, corresponding to a lopsided pyramid,\...
[ [ "numpy.array_equal" ], [ "pandas.read_csv" ] ]
Burdantes/Curvature-based-Analysis-of-Network-Connectivity-in-Private-Backbone-Infrastructures
[ "7f291ddf5693c09c9e5599609a8635b09629e928" ]
[ "visualization/ordering_edges.py" ]
[ "import networkx as nx\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import spearmanr\nfrom adjustText import adjust_text\nimport pickle\nfrom operator import itemgetter\nfrom copy import deepcopy\nfrom collections import Counter\nsns.set_context...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.gca", "pandas.read_csv", "pandas.Series", "matplotlib.pyplot.scatter", "numpy.arange", "pandas.DataFrame", "pandas.DataFrame.from_dict", "scipy.stats.spearmanr", "matplotlib.pyplot.show" ] ]
ansjin/memory_leak_detection
[ "47497fb495ade3e98f46a9d3ddd44ac229de85b0" ]
[ "mem_leak_detection/algo_based_on_change_points.py" ]
[ "import warnings # `do not disturbe` mode\nimport pandas as pd\nimport numpy as np\nfrom sklearn import linear_model\nfrom sklearn.metrics import r2_score\nfrom scipy import stats\nfrom statsmodels.tsa.seasonal import seasonal_decompose\nwarnings.filterwarnings('ignore')\n\n\nclass MemLeakDetectionAlgorithmChangeP...
[ [ "numpy.absolute", "sklearn.metrics.r2_score", "numpy.abs", "numpy.median", "numpy.sort", "pandas.DataFrame", "numpy.std", "numpy.mean", "sklearn.linear_model.LinearRegression" ] ]
8p631G9/8p361-project-imaging
[ "32713052118a83836b485f0f14c16113da49a69b" ]
[ "code/cnn.py" ]
[ "'''\r\n#testing\r\n#testingmarlijn123\r\n#testingstefan123\r\nTU/e BME Project Imaging 2021\r\nConvolutional neural network for PCAM\r\nAuthor: Suzanne Wetstein\r\n'''\r\n\r\n# disable overly verbose tensorflow logging\r\nimport os\r\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # or any {'0', '1', '2'} \r\nimport ...
[ [ "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Flatten", ...
kraanky/process_simulations
[ "5dd686c4c003b7d03f520a9d270671c3dc9211ad" ]
[ "Assignment 5/crosscurrentHX.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport scipy\nimport scipy.integrate\nimport scipy.interpolate\nimport scipy.optimize\nfrom matplotlib import style\n\nstyle.use(\"classic\")\n# print(plt.style.available)\n\ncompH = 'Benzene'\ncompC = 'Ethylene glycol'\n\ndata = pd.read_csv...
[ [ "pandas.read_csv", "numpy.linspace", "scipy.optimize.least_squares", "matplotlib.style.use", "scipy.integrate.odeint" ] ]
hhsummerwind/Mask_RCNN
[ "c2b1f307c8c1e14be28afbf3fd72faf58c9df9a8" ]
[ "samples/text/dataset.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCopyright 2020 huhui, Inc. All Rights Reserved.\n@author: huhui\n@software: PyCharm\t\n@project: Mask_RCNN\t\n@file: dataset.py\t\n@version: v1.0\n@time: 2020/5/14 下午5:02\n@setting: \n-------------------------------------------------\nDescription :\n工程文件说明: \n\"\"\"\n\nimport numpy...
[ [ "numpy.max", "numpy.array", "numpy.stack", "numpy.min" ] ]
mengesser/jwql
[ "ddcb88e85dfb1f755a0997940018ed232c72a195" ]
[ "jwql/utils/preview_image.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nCreate a preview image from a fits file containing an observation.\n\nThis module creates and saves a \"preview image\" from a fits file that\ncontains a JWST observation. Data from the user-supplied ``extension``\nof the file are read in, along with the ``PIXELDQ`` extension if\n...
[ [ "matplotlib.pyplot.gca", "numpy.expand_dims", "matplotlib.colors.LogNorm", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.sort", "numpy.ones", "numpy.int", "numpy.log10", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "...
rystylee/stylegan2-pytorch
[ "2447a5ec093a80243bba3a7a41888966241e1840" ]
[ "op/upfirdn2d.py" ]
[ "from collections import abc\r\nimport os\r\n\r\nimport torch\r\nfrom torch.nn import functional as F\r\nfrom torch.autograd import Function\r\nfrom torch.utils.cpp_extension import load\r\n\r\n\r\nimport upfirdn2d as upfirdn2d_op\r\n# module_path = os.path.dirname(__file__)\r\n# upfirdn2d_op = load(\r\n# \"upf...
[ [ "torch.flip", "torch.nn.functional.conv2d", "torch.nn.functional.pad" ] ]
amad-person/privacy
[ "aaf4c252a0bbfa41670ddefd3798bdf2066c0e21", "aaf4c252a0bbfa41670ddefd3798bdf2066c0e21" ]
[ "tensorflow_privacy/privacy/analysis/privacy_ledger.py", "tutorials/mnist_dpsgd_tutorial_eager.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.Variable", "tensorflow.compat.v1.equal", "tensorflow.compat.v1.math.ceil", "tensorflow.compat.v1.assign", "tensorflow.compat.v1.nest.map_structure", "tensorflow.compat.v1.control_dependencies", "tensorflow.compat.v1.zeros", "tensorflow.compat.v1.executing_eage...
CODEJIN/AutoVC
[ "828874f5b76836b8548c4bb7998dfad2d04bd161" ]
[ "Datasets_bak.py" ]
[ "import torch\nimport numpy as np\nimport yaml, librosa, pickle, os\nfrom random import sample, shuffle\nfrom itertools import combinations\n\nfrom Audio import Audio_Prep, Mel_Generate\n\nwith open('Hyper_Parameter.yaml') as f:\n hp_Dict = yaml.load(f, Loader=yaml.Loader)\n\nclass Train_Dataset(torch.utils.data...
[ [ "numpy.stack", "numpy.ceil", "numpy.floor", "numpy.vstack", "numpy.random.randint" ] ]
kimukook/SDOGS
[ "0122c404d94d99edb58fb3f3a939e3360fb225e9" ]
[ "dogs/exterior_uncertainty.py" ]
[ "\"\"\"\nThis is the class ExteriorUncertainty that stores the main functions to compute exterior uncertainty function used in SDOGS algorithm\n\n=====================================\nAuthor : Muhan Zhao\nDate : Mar. 1, 2022\nLocation: UC San Diego, La Jolla, CA\n=====================================\n\n\nM...
[ [ "numpy.dot", "numpy.sqrt", "numpy.atleast_1d", "numpy.sign", "numpy.copy", "numpy.identity", "numpy.zeros" ] ]
legacysurvey/pipeline
[ "76dc2a9fc94e7b94fcd41af77e7c0423b62d693a", "76dc2a9fc94e7b94fcd41af77e7c0423b62d693a" ]
[ "py/legacypipe/depthcut.py", "py/legacypipe/queue_calibs.py" ]
[ "import os\nimport numpy as np\nfrom legacypipe.utils import find_unique_pixels\n\nimport logging\nlogger = logging.getLogger('legacypipe.depthcut')\ndef info(*args):\n from legacypipe.utils import log_info\n log_info(logger, args)\ndef debug(*args):\n from legacypipe.utils import log_debug\n log_debug(...
[ [ "numpy.sqrt", "numpy.in1d", "numpy.all", "numpy.max", "numpy.zeros_like", "numpy.any", "numpy.mean", "numpy.where", "numpy.arange", "numpy.argmax", "numpy.zeros", "numpy.isin", "numpy.logical_not", "numpy.nonzero", "numpy.median", "numpy.log10", ...
scervilla/EnergyEvalutation_BioPhysics2020
[ "b50dce6749adc99af611f3181f915cd76d7a1e4c" ]
[ "functions.py" ]
[ "import math\nfrom math import e, sqrt\nimport matplotlib.pyplot as pl\n\ndef vdw_energy(atom1, atom2):\n '''Function that calculates the van der Waals energy between two atoms'''\n sig1 = vars(atom1.xtra['vdw'])['sig']\n sig2 = vars(atom2.xtra['vdw'])['sig']\n dis = atom1-atom2\n return 4*sqrt(vars(...
[ [ "matplotlib.pyplot.axhline", "matplotlib.pyplot.annotate", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
vb690/learning_bayes
[ "bf6501b28109f7528ad3f117c18a04e518b799a5" ]
[ "examples/mrp/modules/app_utils.py" ]
[ "import numpy as np\n\nimport pandas as pd\n\nimport matplotlib.pyplot as plt\n\nimport streamlit as st\n\n\ndef plot_post_strat(ps_df, ds_df, samples=100):\n \"\"\"\n \"\"\"\n fig, axs = plt.subplots(\n 1,\n 3,\n figsize=(12, 10),\n sharey=True\n )\n axs = axs.flatten()\n...
[ [ "pandas.read_csv", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
Hirni-Meshram/divik
[ "0f542ec2669428458a4ecf6bb450dc90c33b0653" ]
[ "test/cluster/test_two_step.py" ]
[ "import numpy.testing as npt\nimport pytest\nfrom sklearn.datasets import make_blobs\nfrom sklearn.metrics import adjusted_rand_score\nfrom sklearn.pipeline import Pipeline\n\nfrom divik.cluster import (\n KMeans,\n TwoStep,\n)\nfrom divik.feature_extraction import LocallyAdjustedRbfSpectralEmbedding\n\n\ndef...
[ [ "numpy.testing.assert_array_equal", "sklearn.metrics.adjusted_rand_score", "sklearn.datasets.make_blobs" ] ]
iridiumcc/ppqm
[ "04632970a9f76d31f7ae7c4a5a3e5421868c4b8d" ]
[ "ppqm/xtb.py" ]
[ "\"\"\"\nxTB wrapper functions\n\"\"\"\n\nimport copy\nimport functools\nimport logging\nimport multiprocessing\nimport os\nimport pathlib\nimport shutil\nimport tempfile\nfrom collections import ChainMap\n\nimport numpy as np\nfrom tqdm import tqdm\n\nimport rmsd\nfrom ppqm import chembridge, constants, env, lines...
[ [ "numpy.array", "numpy.zeros", "numpy.float", "numpy.loadtxt" ] ]
jabalazs/ga-reader
[ "3240e0bb198151a1d15eef5a9b78d20bb5caf5e3" ]
[ "model/GAReader.py" ]
[ "import theano\nimport theano.tensor as T\nimport lasagne.layers as L\nimport lasagne\nimport numpy as np\nimport cPickle as pickle\nfrom config import *\nfrom layers import *\n\ndef prepare_input(d,q):\n f = np.zeros(d.shape[:2]).astype('int32')\n for i in range(d.shape[0]):\n f[i,:] = np.in1d(d[i,:,0...
[ [ "numpy.in1d", "numpy.zeros" ] ]
VictorCallejas/FB_MMHM
[ "9a2d4a990a51811406bec9dc76dde612e5ec1c5c" ]
[ "src/utils/utils.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\n\r\nimport torch\r\n\r\nimport os\r\nfrom datetime import datetime\r\nimport sys\r\n\r\nfrom config import cfg\r\n\r\nfrom data.utils import get_test\r\n\r\nDIR_PATH = '../artifacts/'\r\nRUN_TYPE = None\r\nFOLDER_NAME = None\r\nRUN_FOLDER = None\r\n\r\ndef set_determini...
[ [ "torch.cuda.get_device_properties", "torch.cuda.manual_seed", "numpy.random.seed", "torch.Tensor", "torch.manual_seed", "pandas.DataFrame", "torch.nn.Sigmoid", "torch.no_grad", "torch.cuda.is_available", "torch.cuda.get_device_name", "torch.device", "torch.cuda.devi...
ronaldalbertjr/navi-capital
[ "4ed86716f5af0148afdb0eceec291de7249cf639" ]
[ "interface_final.py" ]
[ "import streamlit as st\r\nimport pandas as pd\r\nimport numpy as np\r\nimport plotly.graph_objects as go\r\nfrom sklearn.linear_model import LinearRegression\r\nimport ipywidgets as widgets\r\n\r\nst.write(\"\"\"\r\n # Hackaton Navi-Capital\r\n Ferramenta para ajudar investidores a avaliar a pontuaçã...
[ [ "pandas.merge", "pandas.read_csv", "pandas.to_datetime", "sklearn.linear_model.LinearRegression", "numpy.insert" ] ]
Shlyankin/cardio
[ "9b5d954c21cda85cf8d96dc88bd097cdec27725e" ]
[ "lstmEcgAnnotator.py" ]
[ "# import matplotlib with pdf as backend\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\n\nimport wfdb\nimport os\nimport numpy as np\nimport math\nimport sys\nimport scipy.stats as st\nimport glob, os\nfrom os.path import basename\n\nimport tensorflow as t...
[ [ "matplotlib.pyplot.legend", "tensorflow.device", "numpy.expand_dims", "numpy.random.seed", "matplotlib.pyplot.title", "tensorflow.python.client.device_lib.list_local_devices", "scipy.stats.zscore", "numpy.ones", "matplotlib.pyplot.plot", "tensorflow.ConfigProto", "tenso...
qingswu/Detectron2-CenterNet
[ "40b80d1a6aa85c7352d5088f44225d64c242cf83" ]
[ "detectron2/export/tensorrt.py" ]
[ "import functools\nimport logging\nimport re\nimport time\nimport types\n\nimport onnx\nimport tensorrt as trt\nimport torch\nfrom detectron2.layers.shape_spec import ShapeSpec\nfrom detectron2.modeling import meta_arch\nfrom detectron2.modeling.anchor_generator import build_anchor_generator\nfrom detectron2.modeli...
[ [ "torch.device", "torch.arange", "torch.tensor" ] ]
Prakadeeswaran05/Semantic-Segmentation-with-DeepLabv3
[ "a011a4b478044ff93b65a4a463c40f93283de70c" ]
[ "deeplab_xception_coco.py" ]
[ "\nimport collections\nimport os\nimport io\nimport sys\nimport tarfile\nimport tempfile\nimport urllib\n\nfrom matplotlib import gridspec\nfrom matplotlib import pyplot as plt\nimport numpy as np\nfrom PIL import Image\nimport cv2\nimport skvideo.io\n\nimport tensorflow as tf\n\n# Needed to show segmentation color...
[ [ "numpy.hstack", "tensorflow.Graph", "numpy.expand_dims", "tensorflow.import_graph_def", "numpy.asarray", "tensorflow.compat.v1.Session", "numpy.append", "numpy.array", "numpy.zeros" ] ]
toddoh/thisisallabout_backend
[ "a0c7bad675bd3fff97f99c3e2b49f19a1fef7640" ]
[ "kevin/cluster/cluster_postproc.py" ]
[ "import json\nfrom lib import detect_peaks\nimport os\nfrom datetime import datetime as dt, timedelta\nimport itertools\nfrom operator import itemgetter\nimport pytz\nfrom whoosh.index import create_in\nfrom whoosh.fields import *\nimport whoosh.qparser\nimport numpy as np\nimport uuid\nimport pytz\nfrom sklearn.de...
[ [ "numpy.unique" ] ]
mrayson/sfoda
[ "5bae0894f6e1bad8f9809f874e4fbbf99daae5d6" ]
[ "sfoda/roms/romsplotpy.py" ]
[ "#!/usr/bin/python\n\"\"\"\nSUNTANS NetCDF plotting GUI\n\"\"\"\nimport os\nimport wx\n\n# The recommended way to use wx with mpl is with the WXAgg\n# backend. \n#\nimport matplotlib\n\nmatplotlib.use('WXAgg')\n# Set some default parameters\nmatplotlib.rcParams['text.color']='white'\nmatplotlib.rcParams['savefig.fa...
[ [ "matplotlib.figure.Figure", "matplotlib.use", "matplotlib.backends.backend_wxagg.NavigationToolbar2WxAgg", "matplotlib.cm.datad.keys", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
uai2020-344/uai2020-344
[ "cf6ff689f8ea957d70c54639132e3a875903a257", "a0cf18b26dedcdffad4fa49e444c91e85e54bd61" ]
[ "metrics/mcc.py", "models/tcl/tcl_wrapper_gpu.py" ]
[ "import numpy as np\nimport torch\nfrom scipy.optimize import linear_sum_assignment\nfrom scipy.stats import spearmanr\n\n\ndef auction_linear_assignment(x, eps=None, reduce='sum'):\n \"\"\"\n Solve the linear sum assignment problem using the auction algorithm.\n Implementation in pytorch, GPU compatible.\...
[ [ "torch.mean", "torch.abs", "numpy.abs", "torch.empty", "torch.cat", "torch.sqrt", "torch.sum", "torch.zeros_like", "scipy.optimize.linear_sum_assignment", "torch.diag", "numpy.corrcoef", "scipy.stats.spearmanr", "torch.argsort" ], [ "tensorflow.train.get...
StevRamos/video_summarization
[ "051632fd9e5ad94dd4a2b2bb31ea928f7269c1ac" ]
[ "src/models/CNN3D.py" ]
[ "import cv2\nimport torch.nn as nn\nimport torch\nfrom torchvision import transforms, models\nfrom torch.autograd import Variable\nfrom PIL import Image\nfrom numpy import linalg\nimport numpy as np\n\nfrom .pytorch_i3d import InceptionI3d\nfrom .transforms import CenterCrop, Transform_models_cnn3d\nfrom .resnet3D ...
[ [ "torch.load", "numpy.asarray", "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available", "torch.stack" ] ]
WingsUpete/EEG2Age
[ "8d7b9049fe4e47c701659bbbf2843600fa7c8d8d" ]
[ "EEGAgeDataSet.py" ]
[ "import os\nimport sys\nimport time\nimport random\n\nimport torch\n\nstderr = sys.stderr\nsys.stderr = open(os.devnull, 'w')\nimport dgl\nfrom dgl.data import DGLDataset\nfrom dgl.dataloading import GraphDataLoader\nsys.stderr.close()\nsys.stderr = stderr\n\nimport Config\n\n\ndef checkPathExistence(path):\n if...
[ [ "torch.load" ] ]
saroudant/Percolate
[ "25d4007750ceef69e1263c49927a918676499fe9" ]
[ "GLMJIVE.py" ]
[ "import torch, os\nimport numpy as np\nfrom copy import deepcopy\nfrom sklearn.model_selection import GridSearchCV, KFold\nfrom sklearn.neighbors import KNeighborsRegressor\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.kernel_ridge import KernelRidge\nfrom sklearn.preprocessing import StandardScaler\nfrom sc...
[ [ "numpy.linspace", "torch.load", "torch.cat", "numpy.max", "torch.cuda.is_available", "numpy.random.randint", "numpy.arange", "torch.eye", "numpy.logspace", "numpy.quantile", "sklearn.kernel_ridge.KernelRidge", "numpy.identity", "torch.diag", "sklearn.model_s...
nogrets/scikit-cycling
[ "8263fda28fa1f39711b5e011db0a59dbf3ac2520", "8263fda28fa1f39711b5e011db0a59dbf3ac2520" ]
[ "skcycling/tests/test_base.py", "examples/power_profile/plot_activity_power_profile.py" ]
[ "# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>\n# Cedric Lemaitre\n# License: BSD 3 clause\n\nimport os\nimport shutil\nfrom tempfile import mkdtemp\n\nimport pytest\nfrom pandas.testing import assert_frame_equal\n\nfrom skcycling.base import Rider\nfrom skcycling.datasets import load_fit\nfrom sk...
[ [ "pandas.testing.assert_frame_equal" ], [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
dushanw/DabbaMu-DEEP-TFM
[ "39f05a486ef4e53576859cd66b9a23d505db33f5" ]
[ "aim1/modules/train_utils.py" ]
[ "import torch \nfrom torch import nn\nimport torchvision\nfrom modules.utils import *\nimport numpy as np\n\ndef loop(device, loader, model, criterion, opt, type_= 'train', losses = [], epoch= None):\n losses_temp = []\n for i, (x, y) in enumerate(loader):\n #if i%10==0:print(i)\n x= x.to(device...
[ [ "torch.no_grad", "numpy.mean" ] ]
RonyMadson/metashape-scripts
[ "7716e8187fa91e04a615ceac0dbdfbf2dd68c1de" ]
[ "src/automatic_masking.py" ]
[ "# This is python script for Metashape Pro. Scripts repository: https://github.com/agisoft-llc/metashape-scripts\n#\n# Based on https://github.com/danielgatis/rembg (tested on rembg==1.0.27)\n#\n# See also examples of rembg masking:\n# - https://peterfalkingham.com/2021/07/19/rembg-a-phenomenal-ai-based-background-...
[ [ "scipy.ndimage.morphology.binary_dilation", "numpy.array", "numpy.dstack", "scipy.ndimage.morphology.binary_erosion" ] ]
nightvision04/genetic_world_building
[ "151ae676fd3b4b1edde1f7e91670b6d676879f3a" ]
[ "build.py" ]
[ "import matplotlib.pyplot as plt\nimport animatplot as amp\nimport numpy as np\nimport random\nimport time\nimport copy\n\nclass DynamicTuner():\n '''\n This class watches detects if improvements have stalled,\n and tries to dynamically change mutation levels.\n '''\n\n def __init__(self,model=None,m...
[ [ "numpy.amax", "numpy.log2", "matplotlib.pyplot.draw", "numpy.argmax", "numpy.random.rand", "numpy.roll", "matplotlib.pyplot.show", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.figure" ] ]
eladc-git/model_optimization
[ "46d1c893ca23e61d8ef7597184ad2ba6e2ae6e7a" ]
[ "model_compression_toolkit/keras/gradient_ptq/gptq_loss.py" ]
[ "# Copyright 2021 Sony Semiconductors Israel, Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Un...
[ [ "tensorflow.stack", "tensorflow.pow" ] ]
JeremyBYU/polylidar
[ "81390535887644aa5492d85d4768b5f797098531" ]
[ "examples/python/for_landing/test_classified.py" ]
[ "import time\nimport logging\nimport sys\nimport functools\nimport operator\n\nimport numpy as np\nimport open3d as o3d\nimport matplotlib.cm as cm\nimport yaml\n\n\nfrom polylidar import (Polylidar3D, MatrixDouble, MatrixFloat, extract_tri_mesh_from_float_depth,\n extract_point_cloud_from_flo...
[ [ "matplotlib.cm.viridis", "numpy.sqrt", "numpy.asarray", "numpy.ones", "numpy.random.randn", "numpy.column_stack", "numpy.array" ] ]
KonradDanielewski/simba
[ "d7a448222e33dcb9880b65c14b5b676933cc6fd7" ]
[ "simba/roi_tools/ROI_move_shape.py" ]
[ "import numpy as np\nimport re\n\ndef update_all_tags(closest_roi):\n if closest_roi['Shape_type'] == 'Rectangle':\n closest_roi['Tags']['Center tag'] = (int(closest_roi['topLeftX'] + closest_roi['width'] / 2), int(closest_roi['topLeftY'] + closest_roi['height'] / 2))\n closest_roi['Tags']['Top lef...
[ [ "numpy.reshape", "numpy.array", "numpy.zeros", "numpy.sqrt" ] ]
openclimatefix/nowcasting_forecast
[ "6e9b62d184a8d6474d080a06cd683bc39d481c67" ]
[ "nowcasting_forecast/models/nwp_solar_simple.py" ]
[ "\"\"\" Simple model to take NWP irradence and make solar \"\"\"\nimport logging\nfrom datetime import timedelta, timezone\nfrom typing import Optional, Union\n\nimport pandas as pd\nimport xarray as xr\nfrom nowcasting_dataset.dataset.batch import Batch\n\nlogger = logging.getLogger(__name__)\n\nNAME = \"nwp_simpl...
[ [ "pandas.DataFrame" ] ]
tf-encrypted/big-tensors
[ "386184eb5aaa3db82781f78883339340de93b6f1" ]
[ "tf_big/python/ops/big_ops_test.py" ]
[ "import unittest\n\nimport numpy as np\nimport tensorflow as tf\nfrom absl.testing import parameterized\n\nfrom tf_big.python.ops.big_ops import big_add\nfrom tf_big.python.ops.big_ops import big_div\nfrom tf_big.python.ops.big_ops import big_export\nfrom tf_big.python.ops.big_ops import big_import\nfrom tf_big.pyt...
[ [ "numpy.array" ] ]