repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
mkirby1995/PyISRU
[ "46338999e70308604692bbd3c20b4f770c27dc6d" ]
[ "periodic_table.py" ]
[ "import pandas as pd\nimport json\n\n\nclass Element:\n\n\n def __init__(self, name, abrivation, atomic_number,\n atomic_mass, period, group):\n\n self.name = name\n self.abrivation = abrivation\n self.atomic_number = atomic_number\n self.atomic_mass = atomic_mass\n self.period = perio...
[ [ "pandas.read_csv" ] ]
dan3dewey/Pythonista-bagatelles
[ "8c2e1d061d76184490605e2a5d52fb236931cba7" ]
[ "three_body_2d.py" ]
[ "# coding: utf-8\n# three_body_2d.py\n\"\"\" Use Docstrings like this so that help() can give useful output.\n These can be multi-line, that's nice ;-)\n Simple 3-body simulation constrained to 2D \"\"\"\n\n# run it at os command line:\n# osprompt> py three_body_2d.py\n\n# v8 - adjusted to run in pythonista\...
[ [ "numpy.sqrt", "matplotlib.pyplot.figure", "matplotlib.pyplot.show" ] ]
TPCD/LifelongReID
[ "cb33f9c29fe398e7546db345fab1c338dda8252f" ]
[ "lreid/models/LwFnet.py" ]
[ "import torch.nn as nn\nimport torchvision\nimport copy\nimport torch\nimport numpy as np\nfrom .bnneck import BNClassifier, Classifier, Classifier_without_bias\nfrom torch.autograd import Variable\n\ndef weights_init_kaiming(m):\n classname = m.__class__.__name__\n if classname.find('Linear') != -1:\n ...
[ [ "torch.nn.init.kaiming_normal_", "torch.nn.init.constant_", "torch.nn.AdaptiveMaxPool2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.init.normal_", "torch.nn.Sequential", "torch.nn.ModuleDict" ] ]
vlstyxz/Brain-Computer-Interface-with-Neurosky
[ "185d31a6e8d044fb766838947c37eec0af8f84f4" ]
[ "knn_train.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 17 20:43:41 2019\n\n@author: anilosmantur\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn import metrics\nfrom...
[ [ "numpy.ones", "numpy.random.shuffle", "sklearn.preprocessing.MinMaxScaler", "numpy.arange", "sklearn.metrics.accuracy_score", "sklearn.model_selection.GridSearchCV", "numpy.array", "sklearn.neighbors.KNeighborsClassifier", "numpy.concatenate" ] ]
stanfordmlgroup/CXR-RePaiR
[ "5142820c85f0098a233441710a6f8a0cec004644" ]
[ "retrieval_baseline_edit.py" ]
[ "from cgi import test\nimport torch\nfrom torchvision import transforms\nimport torchvision.models as models\nfrom torch.utils import data\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom scipy.spatial.distance import cdist\n\nfrom PIL import Image\ni...
[ [ "torch.utils.data.DataLoader", "torch.max", "torch.load", "pandas.read_csv", "pandas.DataFrame", "torch.no_grad", "numpy.repeat", "numpy.expand_dims", "torch.is_tensor", "torch.from_numpy", "torch.cuda.is_available", "numpy.shape", "numpy.array", "torch.nn.D...
Lemon-362/RGCSA-master
[ "4425f86e7e07de19a7256a57eee1642ebffb6199" ]
[ "Utils/averageAccuracy.py" ]
[ "import numpy as np\nfrom operator import truediv\n\n\ndef AA_andEachClassAccuracy(confusion_matrix):\n counter = confusion_matrix.shape[0]\n list_diag = np.diag(confusion_matrix) # 对角线\n list_raw_sum = np.sum(confusion_matrix, axis=1)\n each_acc = np.nan_to_num(truediv(list_diag, list_raw_sum))\n a...
[ [ "numpy.sum", "numpy.mean", "numpy.diag" ] ]
havocesp/ta
[ "938d6a9854e2f87ebb4ca3d25c74f9bda863d65e" ]
[ "ta/trend.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n.. module:: trend\n :synopsis: Trend Indicators.\n\n.. moduleauthor:: Dario Lopez Padial (Bukosabino)\n\n\"\"\"\nimport numpy as np\nimport pandas as pd\n\nfrom .utils import *\n\n\ndef macd(close, n_fast=12, n_slow=26, fillna=False):\n \"\"\"Moving Average Convergence Diverge...
[ [ "pandas.Series", "numpy.zeros", "numpy.argmin", "numpy.abs", "numpy.argmax", "numpy.concatenate" ] ]
Stifael/uloganalysis
[ "70c1ae9bf0a39bc96d388cc80b90464f2edd16fa" ]
[ "examples/attitude.py" ]
[ "\"\"\"Create dataframe with messages required to run attitude tests.\n\nStore topics required for attitude tests.\nAdd missing messages to the dataframe which are required for attitude tests.\n\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport argparse\nimport os\nimport pyulog\nfrom pyulgresample import ul...
[ [ "numpy.ones", "numpy.zeros", "matplotlib.pyplot.grid", "matplotlib.pyplot.figure", "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.close", "matplotlib.use", "numpy.around" ] ]
anmatako/PatchmatchNet
[ "82206d8b603ec925b6e4b1990618e0ad769347de" ]
[ "models/net.py" ]
[ "from typing import Dict, List, Tuple\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom .module import ConvBnReLU, depth_regression\r\nfrom .patchmatch import PatchMatch\r\n\r\n\r\nclass FeatureNet(nn.Module):\r\n \"\"\"Feature Extraction Network: to extract features of original...
[ [ "torch.empty", "torch.nn.BatchNorm2d", "torch.unbind", "torch.gather", "torch.nn.functional.smooth_l1_loss", "torch.matmul", "torch.arange", "torch.nn.Conv2d", "torch.cat", "torch.nn.functional.interpolate", "torch.nn.ConvTranspose2d" ] ]
xygu/recourse
[ "7f41843056218ee5cca1921db80948a4c9848a36" ]
[ "loadData.py" ]
[ "import os\nimport sys\nimport copy\nimport pickle\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nfrom pprint import pprint\nfrom sklearn.model_selection import train_test_split\n\nimport utils\nfrom debug import ipsh\n\nsys.path.insert(0, '_data_main')\n\ntry:\n from _data_main.fair_adult_data i...
[ [ "numpy.ones", "numpy.unique", "numpy.zeros", "numpy.setdiff1d", "numpy.random.seed", "pandas.DataFrame", "numpy.floor", "pandas.concat", "numpy.array_equal", "numpy.array", "sklearn.model_selection.train_test_split" ] ]
mrosemeier/compmech
[ "f18f6d0471c72b26a3b014d2df41df3463505eae" ]
[ "compmech/panel/tests/test_panel_field_outputs.py" ]
[ "import numpy as np\n\nfrom compmech.panel import Panel\nfrom compmech.analysis import Analysis\nfrom compmech.sparse import solve\n\ndef test_panel_field_outputs():\n m = 7\n n = 6\n #TODO implement for conical panels\n strain_field = dict(exx=None, eyy=None, gxy=None, kxx=None, kyy=None, kxy=None)\n ...
[ [ "numpy.linspace" ] ]
kunalk3/Machine_Learning_using_Python
[ "6a70e66151dc8358c429be71ebbf3fbc19479847" ]
[ "Hypothesis_testing/HypothesisTesting1.py" ]
[ "#---------------------------------------------------------------------\n# File Name : HypothesisTesting1.py\n# Author : Kunal K.\n# Description : Implementing hypothesis test methods\n# Date: : 9 Nov. 2020\n# Version : V1.0\n# Ref No : DS_Code_P_K07\n#-----------------------------------------...
[ [ "scipy.stats.shapiro", "scipy.stats.levene", "pandas.read_csv", "scipy.stats.ttest_ind", "pandas.crosstab", "scipy.stats.mannwhitneyu", "numpy.array", "scipy.stats.chi2_contingency" ] ]
cofibit/bitmexbot
[ "765ec4efaf710b334b0c9f20a094d003261c297f" ]
[ "indicators.py" ]
[ "\"\"\"\r\nThis file contains a collection of common indicators, which are based on third party or custom libraries\r\n\r\n\"\"\"\r\nfrom numpy.core.records import ndarray\r\nfrom pandas import Series, DataFrame\r\nimport pandas as pd\r\nimport numpy as np\r\n# from math import log\r\n\r\n\r\ndef heikinashi(bars):\...
[ [ "pandas.Series.rolling_mean", "pandas.Series", "pandas.DataFrame", "pandas.set_option", "numpy.where" ] ]
zhong-lab/optics
[ "9de1942d9a128183ecb3d360b160b27126e7b8f0" ]
[ "spyre/spyre/spyrelets/twopulsephotonecho_spyrelet.py" ]
[ "import numpy as np\nimport pyqtgraph as pg\nimport time\nimport csv\nimport os\n\nfrom PyQt5.Qsci import QsciScintilla, QsciLexerPython\nimport matplotlib.pyplot as plt\n\nfrom spyre import Spyrelet, Task, Element\nfrom spyre.widgets.task import TaskWidget\nfrom spyre.plotting import LinePlotWidget\nfrom spyre.wid...
[ [ "numpy.array" ] ]
govindansriram/CobraML
[ "d231d2e446df7e7860071f5d7cfa1e31afa99c6b" ]
[ "Classification/LogisticModel.py" ]
[ "from torch import nn\nimport torch\n\n\nclass LogisticRegression(nn.Module):\n\n def __init__(self,\n theta_params: int):\n\n super(LogisticRegression, self).__init__()\n self.__linear = nn.Linear(theta_params, 1)\n self.__sigmoid_layer = nn.Sigmoid()\n\n def forward(self...
[ [ "torch.nn.Sigmoid", "torch.nn.Linear" ] ]
octonion/betting
[ "d3be4dc3c3d2f5aa77006e5c9f388c1b79414efb" ]
[ "kelly/fractional.py" ]
[ "#!/usr/bin/env python3\n\nimport csv\nimport sys\n\nimport numpy as np\nimport pandas as pd\n\ncsv_name = sys.argv[1]\nfraction = float(sys.argv[2])\n\nwith open(sys.argv[1], 'r') as f:\n csv = csv.reader(f)\n for p in csv:\n ip = next(csv)\n m = int(p[0])\n \n # Our probabilities...
[ [ "numpy.log", "pandas.DataFrame" ] ]
GroupLe/grouple-face-tagger
[ "5fd87c074dc50a5fc341e9f30774094a1616a87f" ]
[ "models/NER/models/lstm/token_dataset.py" ]
[ "from torch.utils.data import Dataset\nimport numpy as np\nimport torch\nfrom . import functions\n\n\nclass TokensDataset(Dataset):\n def __init__(self, X, Y):\n self.X = self.encode_x(X)\n self.y = Y\n\n @staticmethod\n def encode_x(x: list) -> list:\n max_len = len(max(x, key=lambda ...
[ [ "torch.LongTensor", "torch.tensor" ] ]
MattiooFR/plugins
[ "90a686609fb5be2e83221c1f0e8fce18cb2b6021" ]
[ "v7/pyplots/pyplots.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright © 2012-2015 Roberto Alsina and others.\n\n# Permission is hereby granted, free of charge, to any\n# person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the\n# Software without restriction, including without limitation\...
[ [ "matplotlib._pylab_helpers.Gcf.get_all_fig_managers", "matplotlib.rc_file_defaults", "matplotlib.pyplot.close" ] ]
sporreking/Evaluation-of-Synthetic-Face-Generation-Approaches
[ "480608524751c8f48445404ad92708133472cd0e" ]
[ "src/metric/FIDCompoundMetric.py" ]
[ "from src.metric.CompoundMetric import CompoundMetric\nfrom src.metric.SampleMetricManager import SampleMetricManager\nfrom src.core.Setupable import SetupMode\nfrom src.metric.CompoundMetricManager import CompoundMetricManager\nfrom typing import Any\nfrom cleanfid import fid\nfrom src.population.Population import...
[ [ "numpy.random.randint" ] ]
kif/pyFAI
[ "67226eb0adefbfd3fc5f7576a90a17bbc6bfb351" ]
[ "pyFAI/goniometer.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Project: Fast Azimuthal integration\n# https://github.com/silx-kit/pyFAI\n#\n# Copyright (C) 2017-2021 European Synchrotron Radiation Facility, Grenoble, France\n#\n# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)\n#\n# Per...
[ [ "numpy.degrees", "numpy.zeros_like", "numpy.rad2deg", "numpy.logical_and", "scipy.optimize.minimize", "numpy.asarray", "numpy.logical_not", "numpy.unique" ] ]
Dakad/HackSabamApp
[ "03fb248f6c067febdc5d131d9cdc8fa82c80c40d" ]
[ "pipeline/improv.py" ]
[ "from skimage.filters import threshold_local\nimport numpy as np\nimport cv2\nimport imutils\n\n\n# https://github.com/yardstick17/image_text_reader/blob/master/image_preprocessing/remove_noise.py\n\ndef _order_points_(pts):\n # initialzie a list of coordinates that will be ordered\n # such that the first ent...
[ [ "numpy.ones", "numpy.sort", "numpy.zeros", "numpy.diff", "numpy.argmin", "numpy.reshape", "numpy.abs", "numpy.argmax", "numpy.sqrt", "numpy.where", "numpy.array" ] ]
martincourtois/CodinGame
[ "4df9c8af5cb9c513880dd086da9bf3f201bd56ed" ]
[ "CLASSIC PUZZLE - MEDIUM/222-rubiks-cube-movements.py" ]
[ "import sys\nimport math\nimport re\nimport numpy as np\n\nFRONT = [\n ( (2, 2), (2, 3), (3, 3), (3, 2), (2, 2) ),\n ( (1, 2), (2, 4), (4, 3), (3, 1), (1, 2) ),\n ( (1, 3), (3, 4), (4, 2), (2, 1), (1, 3) )\n]\nBACK = [\n ( (2, 6), (2, 7), (3, 7), (3, 6), (2, 6) ),\n\t( (2, 5), (0, 2), (3, 0), (5, 3), (2...
[ [ "numpy.array", "numpy.full" ] ]
ConorDevilly/bar_speed
[ "7a48a21b7dc9794b99a0f65c59a12f7f65d385e6" ]
[ "src/plot.py" ]
[ "import matplotlib.pyplot as plt\nimport argparse\nimport numpy as np\n\n\nclass BarGraph():\n \"\"\"\n Loads data from a log file\n Has ability to display three graphs: Speed, Acceleration and Power\n \"\"\"\n\n def load_data(self, path_to_data):\n \"\"\"Parse necessary data from a file\"\"\"...
[ [ "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel" ] ]
michellechena/azure-intelligent-edge-patterns
[ "b1260b962b208880532391e7ef2148d240f489f8" ]
[ "factory-ai-vision/EdgeSolution/modules/OVMSAdaptorModule/app/ovms_batchImageProcessor.py" ]
[ "import logging\nfrom PIL import Image, ImageDraw\nimport io\nimport numpy as np\nfrom tensorflow import make_tensor_proto, make_ndarray\nimport cv2\nimport inferencing_pb2\nimport media_pb2\nimport extension_pb2\nimport os\nimport ovms\nimport time\n\nfrom cascade.voe_to_ovms import load_voe_config_from_json, voe_...
[ [ "numpy.max", "numpy.asarray", "numpy.argmax", "tensorflow.make_ndarray" ] ]
anair13/agents
[ "756f7bdf493986c25eb585438134f1dbb8045b1b" ]
[ "tf_agents/bandits/agents/greedy_reward_prediction_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.constant_initializer", "tensorflow.executing_eagerly", "tensorflow.range", "tensorflow.nest.flatten", "tensorflow.nest.map_structure", "tensorflow.eye", "tensorflow.compat.v1.train.GradientDescentOptimizer", "tensorflow.ones", "tensorflow.cast", "tensorflow.comp...
OCR-D/ocrd_tesserocr
[ "ac274656bfb7021ccd752bccd947e53403b4a909" ]
[ "ocrd_tesserocr/recognize.py" ]
[ "from __future__ import absolute_import\nimport os.path\nimport math\nfrom PIL import Image, ImageStat\nimport numpy as np\nfrom shapely.geometry import Polygon, asPolygon\nfrom shapely.ops import unary_union\n\nfrom tesserocr import (\n RIL, PSM, PT, OEM,\n Orientation,\n WritingDirection,\n TextlineOr...
[ [ "numpy.round", "numpy.argmax" ] ]
colinsongf/opinion_reader_bert
[ "ec036fb27161ba454b865e387ed601fe10f57b28" ]
[ "script/test.py" ]
[ "import tensorflow as tf\n\nprint(tf.__version__)\n\nwith tf.device('/device:GPU:0'):\n a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')\n b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')\n sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))\n" ]
[ [ "tensorflow.constant", "tensorflow.device", "tensorflow.ConfigProto" ] ]
mansueto-institute/Urban-Growth-Emergent-Statistics
[ "429f24f7c6c4fdd229b9c9f818197f56910b466d" ]
[ "Fig4C.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib.mlab as mlab\nimport scipy.stats as stats\n\nbbar=0.2\nabar=0.1\n\nK1=2. # This is like Hook's constant or the curvature of the potential that keeps the noise localized \n#K0=5.\nK0=(4.*K1)**0.5 # This is the damping\nK2=0. # This is like a m...
[ [ "numpy.sin", "matplotlib.pyplot.savefig", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.random.normal", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel" ] ]
warwickdatascience/podcast-animations
[ "b2b477ab6f2fe220715a95bb850c89501ed3d08b" ]
[ "rule_30/rule_30.py" ]
[ "\"\"\"Generate an animation of the cellular automaton Rule 30.\"\"\"\n\nimport json\nimport os\nimport pathlib\nimport shutil\nimport subprocess\nimport tempfile\n\nimport colour\nimport cv2\nimport imageio\nimport numpy as np\nimport scipy.signal as sg\nimport tqdm\n\n# Global parameters\nCONFIG_PATH = 'config/fu...
[ [ "numpy.array", "numpy.concatenate", "scipy.signal.convolve2d", "numpy.zeros" ] ]
tiskw/random-fourier-features
[ "4a12185e44d1f9aba594f8a7569042e73675d6cd" ]
[ "rfflearn/explainer/permutation.py" ]
[ "#!/usr/bin/env python3\n#\n# Wrapper functions for the permutation feature importance.\n#\n##################################################### SOURCE START #####################################################\n\n\nimport numpy as np\nimport matplotlib.pyplot as mpl\nimport sklearn.inspection\n\n\n### Calculate ...
[ [ "matplotlib.pyplot.boxplot", "matplotlib.pyplot.grid", "matplotlib.pyplot.show", "matplotlib.pyplot.xlabel", "numpy.mean" ] ]
lukasbindreiter/lingvo
[ "d6f2e6901fadc8440a9e6222ac54b68a8b6faf02" ]
[ "lingvo/core/quant_utils.py" ]
[ "# Lint as: python3\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2...
[ [ "numpy.finfo" ] ]
RitwickGhosh/DeepSORT-YOLOv4-TensorRT-OpenVINO
[ "104e0433c56cebb7db503e23aaec9e7f1d7fdd3a" ]
[ "yolo_v4.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\nslim = tf.contrib.slim\n\n_BATCH_NORM_DECAY = 0.9\n_BATCH_NORM_EPSILON = 1e-05\n_LEAKY_RELU = 0.1\n\n_ANCHORS = [(12, 16), (19, 36), (40, 28),\n (36, 75), (76, 55), (72, 146),\n (142, 110), (192, 243), (459, 401)]\n@tf.contrib.framework.add_arg_s...
[ [ "tensorflow.nn.sigmoid", "tensorflow.pad", "tensorflow.reshape", "tensorflow.tile", "tensorflow.identity", "tensorflow.range", "tensorflow.meshgrid", "tensorflow.zeros_initializer", "tensorflow.variable_scope", "tensorflow.exp", "tensorflow.nn.leaky_relu", "tensorfl...
zeddee/info_retrieve
[ "b54f80e1124183221e509c88413a2afc6ff4fae6" ]
[ "src/utils.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.metrics.pairwise import cosine_similarity\n\ndef question_cleaner(df_query):\n kb=([int(xx) for xx in (df_query[3].iloc[0]).split(' ')])\n gt = [int(xx) for xx in (df_query[2].iloc[0]).split(' ')]\n ct=0\n negg=0\n withans=[]\n for ii in range...
[ [ "pandas.read_csv" ] ]
mcrimi/opfunu
[ "1ff3ecf4b7818a0edd5d92ce5475839fa9477da1" ]
[ "opfunu/cec/cec2005/F19.py" ]
[ "#!/usr/bin/env python\n# ------------------------------------------------------------------------------------------------------%\n# Created by \"Thieu Nguyen\" at 19:26, 20/04/2020 %\n# ...
[ [ "numpy.sqrt", "numpy.sum", "numpy.ones", "numpy.cos", "numpy.max", "numpy.array", "numpy.dot" ] ]
bagustris/deep_mlp_ser
[ "079bc6414287dbfb23a52e1e1869b91584eb037e" ]
[ "code/lstm_mixed_loso.py" ]
[ "# CSL Paper: Dimensional speech emotion recognition from acoustic and text\n# Changelog:\n# 2019-09-01: initial version\n# 2019-10-06: optimizer MTL parameters with linear search (in progress)\n# 2012-12-25: modified fot ser_iemocap_loso_hfs.py\n# feature is either std+mean or std+mean+silence (uncomme...
[ [ "numpy.vstack", "numpy.load", "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "numpy.random.seed", "numpy.arange", "tensorflow.set_random_seed", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.where" ] ]
bond005/impartial_text_cls
[ "d7503c55388625b988098b307350b1f899e48e3c" ]
[ "tests/test_utils.py" ]
[ "# Copyright 2019 Ivan Bondarenko\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 agr...
[ [ "numpy.array" ] ]
TUW-GEO/qa4sm-reader
[ "148b034e883a64b88bdae84ad1f859a1ff483e73" ]
[ "src/qa4sm_reader/plotter.py" ]
[ "# -*- coding: utf-8 -*-\nimport warnings\nfrom pathlib import Path\nimport seaborn as sns\nimport pandas as pd\nfrom typing import Union\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom qa4sm_reader.img import QA4SMImg\nimport qa4sm_reader.globals as globals\nfrom qa4sm_reader import plotting_methods a...
[ [ "matplotlib.pyplot.savefig", "pandas.concat", "matplotlib.pyplot.close", "numpy.isnan" ] ]
gaeunpark924/Comprehensive-Design-2
[ "3a4ca01c5f3daa58a90516654bcd3cc4e8725506" ]
[ "nodejs/yolov5/hubconf.py" ]
[ "\"\"\"YOLOv5 PyTorch Hub models https://pytorch.org/hub/ultralytics_yolov5/\n\nUsage:\n import torch\n model = torch.hub.load('ultralytics/yolov5', 'yolov5s')\n\"\"\"\n\nimport torch\n\n\ndef _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbose=True, device=None):\n \"\"\"Creates...
[ [ "torch.cuda.is_available", "torch.device", "numpy.zeros" ] ]
open-pulse/OpenPulse
[ "ef49cd1ff672821c4b57729c0ef9f4ff5a83eadf" ]
[ "data/user_input/model/setup/acoustic/specificimpedanceInput.py" ]
[ "from data.user_input.project.printMessageInput import PrintMessageInput\nimport os\nfrom os.path import basename\nimport numpy as np\nfrom PyQt5.QtWidgets import QToolButton, QPushButton, QLineEdit, QFileDialog, QDialog, QTabWidget, QWidget, QTreeWidgetItem, QTreeWidget, QSpinBox\nfrom PyQt5.QtGui import QIcon\nf...
[ [ "numpy.savetxt", "numpy.array", "numpy.real", "numpy.loadtxt", "numpy.imag" ] ]
MaraniMatias/machine-learning
[ "5346a60d0a16942a889d67b4c313b9332eb8f50a" ]
[ "tensorflow/mandelbrot-set.py" ]
[ "# Import libraries for simulation\nimport tensorflow as tf\nimport numpy as np\n\n# Imports for visualization\nimport PIL.Image\nfrom io import BytesIO\nfrom IPython.display import Image, display\n\n\ndef DisplayFractal(a, fmt='jpeg'):\n \"\"\"Display an array of iteration counts as a\n colorful picture o...
[ [ "tensorflow.global_variables_initializer", "tensorflow.zeros_like", "numpy.cos", "tensorflow.InteractiveSession", "tensorflow.cast", "tensorflow.abs", "numpy.clip", "tensorflow.Variable", "numpy.sin" ] ]
pedrocwb/ms2deepscore
[ "fb6b131d9b7a80a98185fca49cddca5b162dc0cc" ]
[ "ms2deepscore/data_generators.py" ]
[ "\"\"\" Data generators for training/inference with siamese Keras model.\n\"\"\"\nimport warnings\nfrom typing import List, Iterator, NamedTuple\n\nimport numpy as np\nimport pandas as pd\nfrom tensorflow.keras.utils import Sequence\n\nfrom .typing import BinnedSpectrumType\n\n\nclass SpectrumPair(NamedTuple):\n ...
[ [ "numpy.random.shuffle", "numpy.zeros", "numpy.random.seed", "numpy.random.choice", "numpy.arange", "numpy.where", "numpy.random.random", "numpy.concatenate", "numpy.random.randint", "numpy.unique" ] ]
chsafouane/adaptnlp
[ "34bfb8fef32d1e59f89a94799db87ed6da774965" ]
[ "adaptnlp/inference/text_generation.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/09_text_generation.ipynb (unless otherwise specified).\n\n__all__ = ['logger', 'TransformersTextGenerator', 'EasyTextGenerator']\n\n# Cell\nimport logging\nfrom typing import List, Dict, Union\nfrom collections import defaultdict\n\nimport torch\nfrom torch.utils.dat...
[ [ "torch.sum", "torch.ones", "torch.argmax", "torch.no_grad", "torch.cuda.is_available", "torch.utils.data.TensorDataset" ] ]
QAQ-v/HeterGTransformer
[ "8f29ffa86a40b09261092726b87608661139eec0" ]
[ "onmt/utils/misc.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\nimport torch\r\nimport random\r\nimport inspect\r\nfrom itertools import islice\r\n\r\n\r\ndef split_corpus(path, shard_size):\r\n with open(path, \"rb\") as f:\r\n if shard_size <= 0:\r\n yield f.readlines()\r\n else:\r\n while True:\r\n ...
[ [ "torch.clamp", "torch.cuda.manual_seed", "torch.manual_seed", "torch.arange", "torch.matmul" ] ]
jemil-butt/kernel_inference
[ "a82f6bc3bb399c6d2aea389204c45941a5fec2f8" ]
[ "Figures/Special_case_3_random_field.py" ]
[ "\"\"\"\nThe goal of this script is to showcase kernel inference for the task of estimating\nthe covariance of a random field that exhibits an instationary correlation structure.\nThis produces a figure showcasing the kernel inference procedure and its uses \nas detailed in the case example nr 3 which deals with a...
[ [ "numpy.sum", "numpy.ravel_multi_index", "numpy.diag", "numpy.random.seed", "numpy.matrix.flatten", "matplotlib.pyplot.imshow", "matplotlib.pyplot.ylabel", "numpy.kron", "numpy.meshgrid", "matplotlib.pyplot.figure", "matplotlib.pyplot.rcParams.update", "numpy.linspac...
joshua-laughner/CAADA
[ "831c70c0dfa96cabb95a069ad54211fb37533f5a" ]
[ "caada/ca_pems/readers.py" ]
[ "\"\"\"\nThis module contains functions to read Caltrans PEMS station data and metadata files.\n\"\"\"\n\nimport pandas as pd\nimport sys\n\nfrom ..caada_typing import pathlike as _pathlike\n\n\ndef read_pems_station_csv(csv_file: _pathlike) -> pd.DataFrame:\n \"\"\"Read a Caltrans PEMS daily station .csv file\n...
[ [ "pandas.read_csv", "pandas.DatetimeIndex" ] ]
AccessibleAI/ailibrary
[ "f283f7c1608f5998694efc3cdbd0a29ebf3239c2" ]
[ "pr_PrepCSV/test/_data_producer.py" ]
[ "\"\"\"\nAll rights reserved to cnvrg.io\n\n http://www.cnvrg.io\n\ntest_prepcsv.py\n==============================================================================\n\"\"\"\nimport json\nimport os\nimport string\nimport pandas\nimport random\nimport numpy as np\n\n### Produce csv file for testing.\nrows_num = 25...
[ [ "pandas.DataFrame.from_dict" ] ]
gurvirsingh15/CPS847-Group-2
[ "95afb7c7eca9a68682a80fa5d4d8e9fb65dde351" ]
[ "weatherbot.py" ]
[ "# loads .env contents\nimport settings\n\n# use for approximate string matching\nimport difflib\n\nimport pandas as pd \n\nimport os, time, sys\nimport re, json\n\nfrom urllib.request import urlopen\nfrom datetime import datetime as dt\n\nfrom slackclient import SlackClient\n\nkeys = {\n 'weatherbot': os.enviro...
[ [ "pandas.read_csv" ] ]
caurnhammer/AurnhammerFrank_LIG
[ "7598d5912eb6447b7c01d56d1a0f37643f72b80e" ]
[ "RNNs/SRP_DKL_forward.py" ]
[ "###############################################################################\n# Code by Christoph Aurnhammer, based on #\n# https://github.com/pytorch/examples/tree/master/word_language_model #\n# Citation: Aurnhammer & Frank (2019), Neuropsychologia. ...
[ [ "numpy.empty", "torch.load", "pandas.read_csv", "torch.nn.functional.softmax", "torch.autograd.Variable", "pandas.DataFrame", "torch.cuda.is_available", "torch.cuda.LongTensor", "torch.LongTensor" ] ]
samuro95/GSPnP
[ "1aaabf24d2912135da0bdb89cad1cd0846f9649e" ]
[ "PnP_restoration/GS_PnP_restoration.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom utils import utils_sr\nimport torch\nfrom argparse import ArgumentParser\nfrom utils.utils_restoration import rgb2y, psnr, array2tensor, tensor2array\nimport sys\nfrom matplotlib.ticker import MaxNLocator\n\n\nclass PnP_restoration():...
[ [ "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.legend", "matplotlib.pyplot.semilogy", "torch.load", "matplotlib.pyplot.figure", "matplotlib.pyplot.grid", "numpy.abs", "torch.tensor", "matplotlib.pyplot.subplots", "torch.norm", "torch.cuda.is_available", "matplo...
12190143/transformers
[ "ab90353f1abfd15f8d21f99395658d060679a08c", "ab90353f1abfd15f8d21f99395658d060679a08c" ]
[ "examples/mm-imdb/run_mmimdb.py", "src/transformers/modeling_xlm.py" ]
[ "# coding=utf-8\n# Copyright (c) Facebook, Inc. and its affiliates.\n# Copyright (c) HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apac...
[ [ "torch.utils.data.DataLoader", "torch.cuda.manual_seed_all", "torch.no_grad", "numpy.random.seed", "torch.cuda.is_available", "torch.distributed.init_process_group", "torch.cuda.device_count", "sklearn.metrics.f1_score", "torch.nn.DataParallel", "torch.utils.data.RandomSamp...
shubhomb/clonal_evolution
[ "bbbd0a482293d41cadebe53028e0adeded591e6b" ]
[ "simulation/subclone.py" ]
[ "import numpy as np\n\nclass Subclone:\n \"\"\"\n Initializes a Subclone Population.\n :attr label: Either A, B or S\n :attr fitness: Current fitness\n :attr prop: Current Proportion\n \"\"\"\n\n def __init__(self, lbl, c, alpha, prop=0.333, parent=None, birthtime=None, ...
[ [ "numpy.dot" ] ]
richtertill/node_embeddings
[ "7b34fd060178e90b0c82744f5ad2fd600723dbf2" ]
[ "gust/tests/test_preprocessing.py" ]
[ "import pytest\nimport numpy as np\nimport scipy.sparse as sp\n\nimport gust\n\n\nclass TestPreprocessing:\n def setup(self):\n self.A = sp.csr_matrix(np.array(\n [[1. , 0. , 0.5, 0. , 0. ],\n [0. , 1. , 1. , 0. , 1. ],\n [0.5, 0. , 1. , 0. , 0. ],\n ...
[ [ "numpy.array", "numpy.allclose", "numpy.where", "scipy.sparse.eye" ] ]
DDXDaniel/PaddleViT
[ "9b78cd33feafe75daf68c5e5979ea7a27d4d40e9" ]
[ "image_classification/PiT/main_multi_gpu.py" ]
[ "# Copyright (c) 2021 PPViT 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 required...
[ [ "numpy.random.seed" ] ]
marielacour81/CBIG
[ "511af756c6ddabbd3a9681ce3514b79ef5aaaf3f" ]
[ "stable_projects/predict_phenotypes/He2019_KRDNN/cbig/He2019/config.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nWritten by Tong He and CBIG under MIT license:\nhttps://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md\n\"\"\"\n\nimport os\nimport numpy as np\n\n\nclass config:\n BASE_DIR = '../../../../../../data/fmri_predict_behavior'\n CUR_DIR = os.getcwd()\...
[ [ "numpy.sum" ] ]
merz9b/FinanceHub
[ "a8e1b0e645f5811a5cf3b178a75f718ff6871769" ]
[ "trackers/Commodities/comm_futures_tracker.py" ]
[ "\"\"\"\nAuthor: Gustavo Soares\n\"\"\"\n\nimport math\nimport pandas as pd\nfrom bloomberg import BBG\nfrom pandas.tseries.offsets import BDay\nfrom datetime import timedelta\n\n\nclass CommFutureTracker(object):\n \"\"\"\n Class for creating excess return indices for commodity futures using data from bloomb...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.tseries.offsets.BDay" ] ]
Trevor-Waite/vecstack
[ "e9185909e8ece6500139e0f4305635fc1fc9fb50" ]
[ "tests/test_func_api_classification_multiclass.py" ]
[ "#-------------------------------------------------------------------------------\n# !!! cross_val_predict uses stratified split\n#-------------------------------------------------------------------------------\n# Main concept for testing returned arrays:\n# 1). create ground truth e.g. with cross_val_predict\n# 2)...
[ [ "scipy.stats.mode", "numpy.testing.assert_equal", "numpy.random.seed", "sklearn.metrics.make_scorer", "sklearn.linear_model.LogisticRegression", "numpy.testing.assert_array_equal", "numpy.mean", "sklearn.model_selection.cross_val_score", "numpy.load", "numpy.zeros", "nu...
EGAlberts/some_bandits
[ "99ee49e74c85ede2d941932396245c441a4b7e9b" ]
[ "some_bandits/bandits/EXP3.py" ]
[ "import numpy as np\r\nfrom random import sample\r\nfrom some_bandits.bandit_options import bandit_args\r\nfrom some_bandits.utilities import convert_conf, save_to_pickle, calculate_utility\r\nfrom some_bandits.bandits.Bandit import Bandit\r\nfrom some_bandits.bandits.Expert import Expert\r\nfrom statistics import ...
[ [ "numpy.exp" ] ]
Zdddzz/smartcontract
[ "e587c72cb76883437cd653a47cf14f038ab72f74" ]
[ "utils.py" ]
[ "# -*- coding: utf-8 -*- \n# @Time : 2020-12-25 22:28 \n# @Author : Di Zhu\n\n\nimport json\nimport logging\nimport os\nimport shutil\n\nimport torch\n\n\nclass Params(object):\n \"\"\"Class that loads hyperparameters from a json file.\n\n Example:\n ```\n params = Params(json_path)\n print(params.le...
[ [ "torch.save", "torch.load" ] ]
zhaonat/RCWA
[ "15f4300601899d08f57c95863df88280ab6f0d21" ]
[ "TMM_examples/TMM_bragg_multilayer.py" ]
[ "import os\nimport sys\nmodule_path = os.path.abspath(os.path.join('..'))\nif module_path not in sys.path:\n sys.path.append(module_path)\n\nimport numpy as np\nimport matplotlib.pyplot as plt;\nimport cmath;\nfrom TMM_functions import run_TMM_simulation as rTMM\n\n## GOAL: simulate a BRAGG MIRROR at some wavele...
[ [ "numpy.tile", "numpy.eye", "matplotlib.pyplot.legend", "numpy.array", "numpy.sin", "numpy.matrix", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.cos", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.sqrt"...
GeirOwe/adventOfCode
[ "fee1420cb8ecce8b7aaf9d48472364be191ca2a2" ]
[ "day20_2021.py" ]
[ "# Day20 - 2021 Advent of code\r\n# source: https://adventofcode.com/2021/day/20\r\n\r\nimport os\r\nimport numpy as np\r\n\r\ndef clear_console():\r\n os.system('clear')\r\n print('< .... AoC 2021 Day 20, part 1 .... >')\r\n print()\r\n return\r\n\r\n# convert from pixels to binary \"...#...#.\" -> \"0...
[ [ "numpy.array" ] ]
BowenBao/fairseq
[ "a9f5741f58c05c581686b73465d7e3f9df5528f3" ]
[ "fairseq/data/multilingual/sampled_multi_dataset.py" ]
[ "# Copyright (c) Facebook, Inc. and its 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 datetime\nimport hashlib\nimport logging\nimport time\nfrom bisect import bisect_right\nfrom collections import OrderedDict, ...
[ [ "numpy.vstack", "numpy.cumsum", "numpy.argsort", "numpy.argmax", "torch.distributed.is_initialized", "torch.DoubleTensor", "numpy.hstack", "torch.cuda.is_available", "numpy.array", "torch.cat" ] ]
jihyunbak/rec_to_nwb
[ "6e65f8bf0a4faa4d986483ec2442ba19d70c92a9" ]
[ "rec_to_nwb/processing/nwb/components/position/time/invalid/fl_pos_invalid_time_manager.py" ]
[ "import numpy as np\nfrom pynwb import NWBFile\n\nfrom rec_to_nwb.processing.exceptions.missing_data_exception import MissingDataException\nfrom rec_to_nwb.processing.nwb.components.position.time.invalid.fl_pos_invalid_time_builder import \\\n FlPosInvalidTimeBuilder\nfrom rec_to_nwb.processing.tools.beartype.be...
[ [ "numpy.vstack", "numpy.diff", "numpy.asarray", "numpy.insert", "numpy.hstack", "numpy.isnan", "numpy.array", "numpy.where" ] ]
AHEAD-IntelligentCamera/deep-person-reid
[ "a412f8e11f54f78f7bbef9e60dbb2159eed09917" ]
[ "torchreid/data/transforms.py" ]
[ "from __future__ import division, print_function, absolute_import\nimport math\nimport random\nfrom collections import deque\nimport torch\nfrom PIL import Image\nfrom torchvision.transforms import (\n Resize, Compose, ToTensor, Normalize, ColorJitter, RandomHorizontalFlip, Pad\n)\n\n\nclass Random2DTranslation(...
[ [ "torch.zeros_like", "torch.mm", "torch.Tensor" ] ]
andreas-paul/map-of-mars
[ "71205dafdafccdeac76f05aff1ede5fb1911a5a2" ]
[ "main.py" ]
[ "#%%\nimport rasterio\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nfrom blend_modes import blending_functions\nfrom utils import get_dem_data, load_shapefile, crop_raster, save_raster, make_ramp\n\n\n\ndem_path: Path = Path(\"https://planetarymaps.usgs.gov/mosaic/Mars_MGS_MOLA_DEM_mosaic_global_463m....
[ [ "matplotlib.pyplot.Axes", "matplotlib.pyplot.axis" ] ]
ZSL98/ETBA
[ "618317698adb9e372fb11dc0c3a01f856e0759b0" ]
[ "Inference/src/recursive_placement/ocrnet_with_exit.py" ]
[ "##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Shulai Zhang\n## Microsoft Research\n## yuyua@microsoft.com\n## Copyright (c) 2021\n##\n## This source code is licensed under the MIT-style license found in the\n## LICENSE file in the root directory of this source tree \n#...
[ [ "torch.nn.Dropout2d", "torch.nn.Conv2d", "torch.load" ] ]
aishwarya8615/MRNET-GAN
[ "a66b4c83ef5566e95e7587f7ddad43b9ecc263d8" ]
[ "load_data_tf.py" ]
[ "import numpy as np\nimport pandas as pd\nimport tensorflow as tf\n\n\nclass MRNetDataset():\n def __init__(self, root_dir, task, plane, train=True, transform=None, weights=None):\n self.task = task\n self.plane = plane\n self.root_dir = root_dir\n self.train = train\n if self....
[ [ "numpy.load", "numpy.sum", "numpy.stack", "tensorflow.constant", "numpy.array" ] ]
NucciTheBoss/pytorch_geometric
[ "e220a2c08fa1b2f1672d616c22eac2a67b5c8967", "e220a2c08fa1b2f1672d616c22eac2a67b5c8967" ]
[ "benchmark/runtime/dgl/train.py", "examples/pytorch_lightning/graph_sage.py" ]
[ "import time\n\nimport torch\nimport torch.nn.functional as F\n\n\ndef train_runtime(model, data, epochs, device):\n if hasattr(data, 'features'):\n x = torch.tensor(data.features, dtype=torch.float, device=device)\n else:\n x = None\n mask = data.train_mask if hasattr(data, 'train_mask') els...
[ [ "torch.cuda.synchronize", "torch.cuda.is_available", "torch.tensor" ], [ "torch.nn.functional.cross_entropy", "torch.cuda.device_count", "torch.nn.BatchNorm1d" ] ]
sandhi-artha/solaris
[ "230a58f94f300062ee880d43920d218edf3321c4" ]
[ "solaris/nets/infer.py" ]
[ "import os\nimport torch\nfrom osgeo import gdal\nimport numpy as np\nfrom warnings import warn\nfrom .model_io import get_model\nfrom .transform import process_aug_dict\nfrom .datagen import InferenceTiler\nfrom ..raster.image import stitch_images, create_multiband_geotiff\nfrom ..utils.core import get_data_paths\...
[ [ "numpy.swapaxes", "torch.no_grad", "torch.cuda.is_available", "torch.from_numpy", "torch.device" ] ]
Akhilesh271988/numpy
[ "1ab7e8fbf90ac4a81d2ffdde7d78ec464dccb02e" ]
[ "numpy/distutils/__init__.py" ]
[ "\"\"\"\nAn enhanced distutils, providing support for Fortran compilers, for BLAS,\nLAPACK and other common libraries for numerical computing, and more.\n\nPublic submodules are::\n\n misc_util\n system_info\n cpu_info\n log\n exec_command\n\nFor details, please see the *Packaging* and *NumPy Distuti...
[ [ "numpy.distutils.fcompiler.new_fcompiler", "numpy._pytesttester.PytestTester" ] ]
HeartFu/NeuralBabyTalk
[ "acd9f927d3b977c69ff8286bc45f9fb073dd1b6b" ]
[ "object_detection/model/detection/keypoint_rcnn.py" ]
[ "import torch\nfrom torch import nn\n\nfrom torchvision.ops import MultiScaleRoIAlign\n\nfrom ..utils import load_state_dict_from_url\n\nfrom .faster_rcnn import FasterRCNN\nfrom .backbone_utils import resnet_fpn_backbone\n\n\n__all__ = [\n \"KeypointRCNN\", \"keypointrcnn_resnet50_fpn\"\n]\n\n\nclass KeypointRC...
[ [ "torch.nn.init.kaiming_normal_", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.ReLU", "torch.nn.ConvTranspose2d" ] ]
MarziehHaghighi/Mask_RCNN
[ "54d23a28c7bd37c4364b41dbc825adcd104392ab" ]
[ "samples/kidney/kidney3.py" ]
[ "\"\"\"\nMask R-CNN\nConfigurations and data loading code for the synthetic Shapes dataset.\nThis is a duplicate of the code in the noteobook train_shapes.ipynb for easy\nimport into other notebooks, such as inspect_model.ipynb.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for...
[ [ "numpy.stack", "numpy.ones", "numpy.array", "numpy.copy" ] ]
IndigenousEngineering/keras_docker_with_NLTK
[ "1d81a20292ca6926e595d06a6cd725dbb104a146" ]
[ "keras/engine/training_generator.py" ]
[ "\"\"\"Part of the training engine related to Python generators of array data.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport warnings\nimport numpy as np\n\nfrom .training_utils import is_sequence\nfrom .training_utils import iter_s...
[ [ "numpy.concatenate", "numpy.average", "numpy.float64" ] ]
nikosavola/qiskit-metal
[ "04c9e5c0b5573699564244127aa58b447cdf6f66" ]
[ "qiskit_metal/qlibrary/tlines/anchored_path.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2021.\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...
[ [ "numpy.vstack", "numpy.empty", "numpy.expand_dims", "numpy.array", "numpy.concatenate" ] ]
LeoTafti/darts
[ "210605fafb730de564e3d723ab3919ed94da42b9" ]
[ "darts/tests/test_missing_values.py" ]
[ "import unittest\nimport pandas as pd\nimport numpy as np\n\nfrom ..timeseries import TimeSeries\nfrom ..utils.missing_values import auto_fillna, na_ratio\n\n\nclass MissingValuesTestCase(unittest.TestCase):\n\n time = pd.date_range('20130101', '20130130')\n lin = [float(i) for i in range(len(time))]\n cub...
[ [ "numpy.array", "pandas.date_range" ] ]
susan120433/distribution-is-all-you-need
[ "d91510d07384ade86f271e48b1784039f15e0d48" ]
[ "gaussian.py" ]
[ "\"\"\"\n Code by Tae-Hwan Hung(@graykode)\n https://en.wikipedia.org/wiki/Normal_distribution\n\"\"\"\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\ndef gaussian(x, n):\n u = x.mean()\n s = x.std()\n\n # divide [x.min(), x.max()] by n\n x = np.linspace(x.min(), x.max(), n)\n\n a ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "numpy.exp", "numpy.arange", "matplotlib.pyplot.show", "numpy.sqrt", "matplotlib.pyplot.plot" ] ]
VTXNN/E2E
[ "b877d1bf7fdb94f885804ac42f41cc9ecc3102f5" ]
[ "Ops/test_ops.py" ]
[ "import tensorflow as tf\nimport os\nimport math\nimport time\nimport numpy\nimport unittest\n\ntf.compat.v1.disable_eager_execution()\n\nfrom sklearn.neighbors import KernelDensity\n\nfrom kde_histogram import KDEHistogram\nfrom histogram_max import *\n\n\nsession = None\ndef get_session():\n global session\n ...
[ [ "tensorflow.compat.v1.disable_eager_execution", "numpy.sum", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.Session", "numpy.random.uniform", "numpy.zeros", "numpy.histogram", "tensorflow.multiply", "tensorflow.keras.Model", "tensorflow.gradients", "tensorflo...
wenh06/colour
[ "445fdad2711ae39c95b4375166905568d24a95f4" ]
[ "colour/plotting/characterisation.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCharacterisation Plotting\n=========================\n\nDefines the characterisation plotting objects:\n\n- :func:`colour.plotting.plot_single_colour_checker`\n- :func:`colour.plotting.plot_multi_colour_checkers`\n\"\"\"\n\nfrom __future__ import division\n\nimport numpy as np\...
[ [ "numpy.ravel" ] ]
dglowienka/Small_DD_modules
[ "5714a40163b93a50dba2063d4422a0a1aeb7b7f3" ]
[ "Spatial/spatial_graph_calc.py" ]
[ "import matplotlib.pyplot as plt;\nimport numpy as np;\nimport math\n\ndata = np.loadtxt('spatial.txt', skiprows=1);\n\nx = data[:,0];\nV = data[:,1];\nE = data[:,2];\nn = data[:,3];\np = data[:,4];\ns = data[:,5];\nNA = data[:,6];\nNC = data[:,7];\nJn = data[:,8];\nJp = data[:,9];\nJ_NA = data[:,10];\nJ_NC = data[...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.grid", "matplotlib.pyplot.yscale", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "numpy.loadtxt" ] ]
anArkitek/TriNet_WACV2021
[ "760faad04aa697dfba752ec46661fe938665f23b" ]
[ "lib/FSANET_model.py" ]
[ "import sys\nimport logging\nimport numpy as np\n\nimport tensorflow as tf\n\nfrom keras.models import Model\nfrom keras.applications.resnet50 import ResNet50\n\nfrom keras.layers import Input\nfrom keras.layers import Dense\nfrom keras.layers import Conv2D\nfrom keras.layers import Layer\nfrom keras.layers import ...
[ [ "tensorflow.nn.moments", "numpy.random.seed", "tensorflow.matmul" ] ]
song2181/DI-engine
[ "268d77db3cb54401b2cfc83e2bc3ec87c31e7b83" ]
[ "ding/envs/env_manager/tests/conftest.py" ]
[ "import random\nimport time\nfrom collections import namedtuple\nimport pytest\nimport torch\nimport numpy as np\nfrom easydict import EasyDict\nfrom functools import partial\nimport gym\n\nfrom ding.envs.env.base_env import BaseEnvTimestep\nfrom ding.envs.env_manager.base_env_manager import EnvState\nfrom ding.env...
[ [ "torch.randn", "numpy.array", "torch.randint" ] ]
u6052029/cogent3
[ "ca0efcb7f60b715bcbfbecd924cdb98a53cefe20" ]
[ "src/cogent3/evolve/motif_prob_model.py" ]
[ "#!/usr/bin/env python\n\nimport warnings\n\nimport numpy\n\nfrom cogent3.evolve.likelihood_tree import make_likelihood_tree_leaf\n\nfrom . import substitution_calculation\n\n\n__author__ = \"Peter Maxwell\"\n__copyright__ = \"Copyright 2007-2020, The Cogent Project\"\n__credits__ = [\"Peter Maxwell\"]\n__license__...
[ [ "numpy.array", "numpy.dot", "numpy.zeros" ] ]
ngohgia/text2brain_server
[ "16bf523d63319d8c20497acfb2c5a82a5363df5e" ]
[ "google-cloud-function-src/text2brain_model.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pad_sequence\nfrom decoder import ImageDecoder\nimport transformers\n\n\nclass Text2BrainModel(nn.Module):\n def __init__(self, out_channels, fc_channels, decoder_filters, pretrained_bert_dir, decoder_act_fn=nn.Sigmoid, drop_p=0.5, decoder_inpu...
[ [ "torch.nn.utils.rnn.pad_sequence", "torch.nn.Linear", "torch.load", "torch.device", "torch.nn.ReLU", "torch.nn.Dropout" ] ]
JiByungKyu/ludwig
[ "3e2f276459f976054b5c2ab8c55be994170345da" ]
[ "ludwig/features/base_feature.py" ]
[ "# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "tensorflow.reshape", "tensorflow.expand_dims", "tensorflow.cast", "tensorflow.sequence_mask", "tensorflow.concat" ] ]
gkahn13/GtS
[ "8186177de430d4bfef253bb0ea584ee60dc58d3a" ]
[ "src/gcg/tf/tf_utils.py" ]
[ "import os\nimport tensorflow as tf\n\n######################\n### Graph creation ###\n######################\n\ndef create_session_and_graph(gpu_device=None, gpu_frac=None):\n if gpu_device is None:\n gpu_device = 0\n if gpu_frac is None:\n gpu_frac = 0.95\n\n os.environ[\"CUDA_VISIBLE_DEVIC...
[ [ "tensorflow.reshape", "tensorflow.gather_nd", "tensorflow.clip_by_norm", "numpy.random.seed", "tensorflow.abs", "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.nn.softmax", "tensorflow.reduce_sum", "tensorflow.multiply", "tensorflow.Graph", "tensorf...
broadinstitute/segmentation_experiments
[ "396d5659c7c6cda9dc3d3caf3350710ff6210e2c" ]
[ "functions/colors.py" ]
[ "import numpy as np\nimport skimage\nfrom skimage import io, transform, exposure, data, color\nfrom skimage.color import *\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import imshow\n\ndef unmix_purple_img(purp_img, loud=False):\n \"\"\"\n Accepts a purple image object as a parameter \n and r...
[ [ "numpy.ones", "matplotlib.pyplot.subplots" ] ]
omarocegueda/dipy
[ "520b724041116a958892bee0068b057314a21cb2" ]
[ "doc/examples/reconst_shore_metrics.py" ]
[ "\"\"\"\n===========================\nCalculate SHORE scalar maps\n===========================\n\nWe show how to calculate two SHORE-based scalar maps: return to origin\nprobability (rtop) [Descoteaux2011]_ and mean square displacement (msd)\n[Wu2007]_, [Wu2008]_ on your data. SHORE can be used with any multiple b-...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.colorbar", "numpy.sum", "matplotlib.pyplot.savefig" ] ]
tashby/pytorch_geometric
[ "bc1eabc242c8dc6e3b7078db922779911ca3382d" ]
[ "torch_geometric/datasets/amazon.py" ]
[ "import torch\nfrom torch_geometric.data import InMemoryDataset, download_url\nfrom torch_geometric.read import read_npz\n\n\nclass Amazon(InMemoryDataset):\n url = 'https://github.com/shchur/gnn-benchmark/raw/master/data/npz/'\n\n def __init__(self, root, name, transform=None, pre_transform=None):\n s...
[ [ "torch.save", "torch.load" ] ]
pedro-mgb/pedestrian-arc-lstm-smf
[ "1b9fbe6c89c74dc706fd8d3b11ea08977ba2c1d3" ]
[ "other_scripts/data/data_size_in_memory.py" ]
[ "\"\"\"\nCreated on September 11th, 2021\n\nSimple script to compute the size of a dataset (with one or multiple files) in memory (RAM).\nNote that this measure will give an approximate approximate value\n\nIMPORTANT NOTE:\nThe computation may stop with an error if the data does not fit in memory.\nThis makes train...
[ [ "torch.cuda.get_device_properties", "torch.cuda.is_available", "torch.device", "torch.is_tensor" ] ]
zhangyiwen5512/pytorch-faster-rcnn
[ "64b15d3ee4bc2ec62eaab4af63e978a31a0ddbfe", "64b15d3ee4bc2ec62eaab4af63e978a31a0ddbfe" ]
[ "lib/nets/VGG16.py", "lib/nets/network.py" ]
[ "import torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\nimport math\nimport numpy as np\n\n__all__ = [\n 'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn',\n 'vgg19_bn', 'vgg19',\n]\n\n\nmodel_urls = {\n 'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth',\n '...
[ [ "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "numpy.random.shuffle", "torch.nn.Linear", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Dropout" ], [ "numpy.random.shuffle", "torch.nn.Linear", "torch.nn.Mod...
justinchuby/onnx
[ "805ae1e634697e37b43701e585c9c253a29ce076" ]
[ "onnx/backend/test/case/node/mean.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\nimport numpy as np # type: ignore\n\nimport onnx\nfrom ..base import Base\nfrom . import expect\n\n\nclass Mean(Base):\n\n @staticmethod\n def export() -> None:\n data_0 = np.array([3, 0, 2]).astype(np.float32)\n data_1 = np.array([1, 3, 4]).astype(np.f...
[ [ "numpy.array", "numpy.add" ] ]
DivyaKumarBaid/Live_Discord_music_bot
[ "5bda803978a5140acf82ea14a6478c677b1f2793" ]
[ "main.py" ]
[ "import os\nfrom keep_alive import keep_alive\nimport discord\nimport nacl\nfrom discord import FFmpegPCMAudio\nimport youtube_dl\nimport discord.utils\nfrom discord.utils import find\nfrom discord.ext import commands, tasks\nfrom itertools import cycle\nfrom youtubesearchpython import VideosSearch\nimport numpy as...
[ [ "numpy.savetxt", "numpy.loadtxt" ] ]
SAP-samples/security-research-differentially-private-generative-models
[ "c0eced81da3bc0064beb538557f042732cda459f" ]
[ "tflib/inception_score.py" ]
[ "# SPDX-FileCopyrightText: 2020 SAP SE\n#\n# SPDX-License-Identifier: Apache-2.0\n\n# From https://github.com/openai/improved-gan/blob/master/inception_score/model.py\n# Code derived from tensorflow/tensorflow/models/image/imagenet/classify_image.py\nfrom __future__ import absolute_import\nfrom __future__ import di...
[ [ "numpy.sum", "numpy.exp", "tensorflow.squeeze", "numpy.max", "numpy.expand_dims", "numpy.min", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.TensorShape", "numpy.std", "numpy.concatenate", "tensorflow.nn.softmax", "numpy.log", "numpy.mean"...
AntoineSimoulin/pytree
[ "9408799c4b8d4d59b1103e2205ffe7b250614f92" ]
[ "pytree/models/n_ary/modeling_n_ary.py" ]
[ "import torch.nn as nn\nimport torch\nfrom typing import List, Tuple, Optional, overload, Union, cast\nfrom torch import Tensor\nfrom transformers import BertModel\nfrom pytree.data.packed_tree import PackedTree\n\n\nclass TreeEmbeddings(nn.Module):\n\n def __init__(self, config):\n super(TreeEmbeddings, ...
[ [ "torch.ones_like", "torch.nn.init.xavier_uniform_", "torch.nn.Linear", "torch.zeros_like", "torch.no_grad", "torch.nn.Embedding.from_pretrained", "torch.nn.Embedding", "torch.mul", "torch.where", "torch.reshape", "torch.tanh", "torch.zeros", "torch.sigmoid" ] ...
quynhkhanh96/mmaction2
[ "3bca76ac45ba9f28cc4c4d0565515e02bbd4d059" ]
[ "demo/demo_skeleton.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport argparse\nimport os\nimport os.path as osp\nimport shutil\n\nimport cv2\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv import DictAction\n\nfrom mmaction.apis import inference_recognizer, init_recognizer\n\ntry:\n from mmdet.apis import inferenc...
[ [ "torch.cuda.empty_cache", "numpy.zeros" ] ]
AdaAlarm/tensorflow
[ "e0db063159751276a92d88a4ad6d481b1199318c" ]
[ "tensorflow/python/distribute/strategy_combinations.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.distribute.test_util.set_logical_devices_to_at_least", "tensorflow.python.tpu.tpu_strategy_util.initialize_tpu_system", "tensorflow.python.distribute.sharded_variable.FixedShardsPartitioner", "tensorflow.python.eager.remote.connect_to_cluster", "tensorflow.python.distribute....
mridullpandey/sunpy
[ "65bf70731a8147899b8c0fca8b3b1a386e47c010" ]
[ "sunpy/physics/tests/test_differential_rotation.py" ]
[ "import os\nimport pytest\n\nimport numpy as np\nimport astropy.units as u\nfrom astropy.coordinates import SkyCoord\nfrom astropy.coordinates import Longitude\nfrom astropy.tests.helper import assert_quantity_allclose\nfrom astropy.time import TimeDelta\n\nfrom sunpy.coordinates import frames\nfrom sunpy.coordinat...
[ [ "numpy.testing.assert_almost_equal", "numpy.zeros_like", "numpy.zeros", "numpy.ma.array", "numpy.array", "numpy.linspace" ] ]
pawelzell/cbtool
[ "8557cca276ccc2d975c66dfd8f0d0e5e7c368d68" ]
[ "myscripts/analyze_interference.py" ]
[ "import datetime\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn import linear_model\nfrom sklearn.metrics import mean_squared_error\nfrom exp_data import *\nfrom exp_data_utils import RegressionRecord\nfrom read_data.utils import dfTypePair, toSingleRowDF\nimport global_conf...
[ [ "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.savefig", "pandas.DataFrame", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.array" ] ]
adaj/geohunter
[ "fbbb7492f79fa838c2080c90d5e8ac2066d29568" ]
[ "geohunter/osm.py" ]
[ "\"\"\"geohunter.osm\n\nThis module wraps requests to OpenStreetMap's Overpass API with an interface for\nthe GeoPandas data structures. The OpenStreetMap has a data model based on nodes,\nways and relations. The geometric data structures available in geopandas are points,\nlines and polygons (but also multipoints,...
[ [ "pandas.DataFrame", "pandas.json_normalize" ] ]
sbaktha/covid19_pocus_ultrasound
[ "876558a118c7afbe7a520efcc07581af6f8ffbb2" ]
[ "pocovidnet/pocovidnet/evaluate_covid19.py" ]
[ "\"\"\"\nEvaluation class that performs forward pass through trained models\n\"\"\"\nimport os\n\nimport cv2\nimport numpy as np\n\nfrom pocovidnet import MODEL_FACTORY\n\nDIR_PATH = os.path.dirname(os.path.realpath(__file__))\nNUM_FOLDS = 5\n\n\nclass Evaluator(object):\n\n def __init__(self, ensemble=True, spl...
[ [ "numpy.array", "numpy.mean" ] ]
Dzinushi/models_1_4
[ "d7e72793a68c1667d403b1542c205d1cd9b1d17c", "d7e72793a68c1667d403b1542c205d1cd9b1d17c", "d7e72793a68c1667d403b1542c205d1cd9b1d17c" ]
[ "research/object_detection/models/faster_rcnn_inception_v2_feature_extractor.py", "research/object_detection/models/ssd_mobilenet_v1_feature_extractor.py", "research/syntaxnet/dragnn/python/wrapped_units.py" ]
[ "# Copyright 2017 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.shape", "tensorflow.truncated_normal_initializer", "tensorflow.variable_scope", "tensorflow.concat", "tensorflow.control_dependencies" ], [ "tensorflow.shape", "tensorflow.variable_scope", "tensorflow.control_dependencies" ], [ "tensorflow.contrib.rnn.stack_...