repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
mapa17/Computational_Neuroscience_Homework
[ "b358a7cce935ac0b679748c289d3476c63e3f2f0" ]
[ "L5/intfire_noise.py" ]
[ "from __future__ import print_function\n\"\"\"\nCreated on Wed Apr 22 16:02:53 2015\n\nBasic integrate-and-fire neuron \nR Rao 2007\n\ntranslated to Python by rkp 2015\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport sys\n\n\n# input current\nI = 1 # nA\n\n# capacitance and leak resistance\nC ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.hist", "numpy.random.normal", "matplotlib.pyplot.show" ] ]
ChandraKent/web-scraping-challenge
[ "1ee824d633caee6a014863e2f00a79753158eadd" ]
[ "scrape_mars.py" ]
[ "from splinter import Browser\nfrom bs4 import BeautifulSoup\nimport pandas as pd \nimport datetime as dt \n\ndef init_browser():\n executable_path = {\"executable_path\": \"/usr/local/bin/chromedriver\"}\n # return Browser(\"chrome\", executable_path, headless=False)\n return Browser(\"chrome\", **executa...
[ [ "pandas.read_html" ] ]
tacorna/taco
[ "eeaeb879b8622365123edbc61ebc100d84194b80" ]
[ "taco/test/test_change_point.py" ]
[ "'''\nTACO: Multi-sample transcriptome assembly from RNA-Seq\n'''\nimport os\nimport numpy as np\nimport h5py\nimport matplotlib.pyplot as plt\n\nfrom taco.lib.base import Strand, Exon\nfrom taco.lib.dtypes import FLOAT_DTYPE\nfrom taco.lib.splice_graph import SpliceGraph\nfrom taco.lib.path_graph import PathGraphF...
[ [ "numpy.allclose", "numpy.random.random", "numpy.zeros" ] ]
joehandzik/dlcookbook-dlbs
[ "7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30" ]
[ "python/pytorch_benchmarks/models/alexnet.py" ]
[ "# (c) Copyright [2017] Hewlett Packard Enterprise Development LP\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.MaxPool2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.LocalResponseNorm" ] ]
nahian01/HDPS
[ "791d0adfb8e68b96e8cf49a6e6cbeaa290d3baa9" ]
[ "new/test1.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt \nimport pandas as pd\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn im...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.xlabel", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.legend", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "sklearn.mode...
teecha/Autonomous_Tello_Drone
[ "b7fd20f3eb830bf5387dba1579c041975348de14" ]
[ "Yello/headers.py" ]
[ "#header to convert outputs of model into boxes, scores, classes, valid \n\nimport tensorflow as tf\nimport numpy as np\n\ndef YoloV4Header(num_classes, anchorlist, mask, strides,\n max_outputs, iou_threshold, score_threshold,inputs):\n boxes, objects, classes = [], [], []\n dtype = inputs[0]....
[ [ "tensorflow.exp", "tensorflow.shape", "tensorflow.range", "tensorflow.concat", "tensorflow.sigmoid", "tensorflow.reshape", "tensorflow.image.combined_non_max_suppression", "tensorflow.stack", "tensorflow.split", "tensorflow.cast" ] ]
cuifc1997/nuscene-study
[ "f3594b967cbf42396da5c6cb08bd714437b53111" ]
[ "python-sdk/nuscenes/eval/detection/render.py" ]
[ "# nuScenes dev-kit.\n# Code written by Holger Caesar, Varun Bankiti, and Alex Lang, 2019.\n\nimport json\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom nuscenes import NuScenes\nfrom nuscenes.eval.detection.constants import TP_METRICS, DETECTION_NAMES, DETECTION_COLORS, TP_METRICS_UNITS, \\\n ...
[ [ "numpy.isnan", "numpy.minimum", "numpy.sum", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.eye", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
hamzaehsan97/speechRecognition
[ "1d4a7a7ed70326cebf796031cbbb8e23225356e6" ]
[ "Record/record.py" ]
[ "import sounddevice as sd\nfrom scipy.io.wavfile import write\nfrom predictProcess import *\nimport keras\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D, LSTM\nfrom keras.utils import to_categorical\nimport wandb\nfrom wandb.keras import WandbCallback\nf...
[ [ "scipy.io.wavfile.write" ] ]
willmaclean/MedCAT
[ "528a4765acbdf04acf8a8bd90a4f19bc1e3e33c3" ]
[ "medcat/neo/data_preparation.py" ]
[ "import os\nimport pandas as pd\n\n\ndef get_index_queries():\n r''' Run before everything to speed up things\n '''\n return ['CREATE INDEX patientId FOR (p:Patient) ON (p.patientId);',\n 'CREATE INDEX conceptId FOR (c:Concept) ON (c.conceptId);',\n 'CREATE INDEX documentId FOR (d:Doc...
[ [ "pandas.read_csv" ] ]
brucebcampbell/nlp-modelling
[ "b6e5b6c5b2df7cc20e7de68f32d164981353aaf9" ]
[ "pytma/Predict.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n##Text Classification Model using TF-IDF.\n#First, import the MultinomialNB module and create a Multinomial Naive Bayes classifier object using MultinomialNB() function.\n\nfrom __future__ import print_function\n\nimport logging\nimport sys\nfrom optparse import ...
[ [ "matplotlib.pyplot.text", "sklearn.metrics.confusion_matrix", "sklearn.neighbors.NearestCentroid", "sklearn.linear_model.Perceptron", "sklearn.svm.LinearSVC.predict", "sklearn.feature_selection.SelectKBest", "sklearn.metrics.f1_score", "sklearn.svm.LinearSVC", "numpy.max", ...
pedroperrusi/deep-learning-for-robotics
[ "ebb5324f4935110bed4813719cdc1523092bde00" ]
[ "Class02/robotic_arm_incomplete/env_sim/approx_inv_kin_nn.py" ]
[ "'''\nThis simulation executes a trained neural network that approximates the\nclosed form solution given by 2 axis inv kin\n'''\nfrom __future__ import division\n\nimport numpy as np\nimport contextlib\nwith contextlib.redirect_stdout(None):\n import pygame\nimport pygame.locals\nimport sys\nimport os\nimport t...
[ [ "numpy.sin", "numpy.asarray", "torch.no_grad", "torch.cuda.is_available", "torch.load", "numpy.cos" ] ]
eleurent/openai-bots
[ "a8f7311ca442f4dcc548abb4b1c268b0fbbd758d" ]
[ "scripts/planners_evaluation.py" ]
[ "\"\"\"Usage: planners_evaluation.py [options]\n\nCompare performances of several planners\n\nOptions:\n -h --help\n --generate <true or false> Generate new data [default: True].\n --show <true_or_false> Plot results [default: True].\n --directory <path> Specify directory path [default: ./out/pla...
[ [ "pandas.DataFrame.from_records", "numpy.sum", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "numpy.random.randint", "numpy.sort", "numpy.arange" ] ]
Mu-L/dask
[ "1c5bf017429de6a85860eb7a5aa6238e34a4b0e0" ]
[ "dask/array/tests/test_array_core.py" ]
[ "import contextlib\nimport copy\nimport pathlib\nimport xml.etree.ElementTree\nfrom unittest import mock\n\nimport pytest\n\nnp = pytest.importorskip(\"numpy\")\n\nimport operator\nimport os\nimport time\nimport warnings\nfrom functools import reduce\nfrom io import StringIO\nfrom operator import add, sub\nfrom thr...
[ [ "numpy.nancumsum", "numpy.nancumprod" ] ]
ZhaoYilin/moha
[ "d701fd921839474380982db1478e66f0dc8cbd98" ]
[ "moha/system/wavefunction/ci_wavefunction.py" ]
[ "from moha.system.wavefunction.base import BaseWaveFunction\nfrom moha.system.basis_set.ci_basis_set import CIBasisSet\nimport numpy as np \n\nclass CIWaveFunction(BaseWaveFunction):\n \"\"\"Configuration interaction wavefunction class.\n\n Attributes\n ----------\n nelec : int\n Number of electr...
[ [ "numpy.zeros" ] ]
AadSah/fixmatch
[ "e72e8a1b8a9e73fd985c5009cd8cb70f33e85af0" ]
[ "scripts/create_unlabeled.py" ]
[ "#!/usr/bin/env python\n\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ...
[ [ "numpy.zeros", "tensorflow.compat.v1.gfile.Open", "tensorflow.compat.v1.disable_eager_execution", "tensorflow.compat.v1.gfile.Exists", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.io.FixedLenFeature", "tensorflow.compat.v1.data.TFRecordDataset", "tensorflow.compat.v1.pytho...
SH4DY/amazon-forecast-samples
[ "f6f4e2e80df1c41cb50568e62b78bb6f8449f052" ]
[ "notebooks/common/util/fcst_utils.py" ]
[ "import time\nimport json\nimport gzip\n\nimport boto3\nimport botocore.exceptions\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nimport util.notebook_utils\n\n\ndef wait_till_delete(callback, check_time = 5, timeout = None):\n\n elapsed_time = 0\n while timeout is None or elapsed_time < timeout:\...
[ [ "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "pandas.Timestamp", "matplotlib.pyplot.fill_between", "pandas.read_csv", "matplotlib.pyplot.xticks" ] ]
Ovakefali13/pyiron_base
[ "84a9b0c46dab434a7f7c14f987392f6fede68317" ]
[ "pyiron_base/database/filetable.py" ]
[ "import numpy as np\nimport os\nimport pandas\nimport datetime\nimport h5io\nfrom pyfileindex import PyFileIndex\nfrom pyiron_base.generic.util import Singleton\nfrom pyiron_base.database.generic import IsDatabase\n\n\ndef filter_function(file_name):\n return \".h5\" in file_name\n\n\nclass FileTable(IsDatabase,...
[ [ "numpy.max", "pandas.DataFrame", "numpy.array", "pandas.concat" ] ]
almostzero/nlp_3d
[ "dbbee72773b78199d1e8a957bfa4bae1eeee7f31" ]
[ "KOR_3D/kor3d.py" ]
[ "import numpy as np\nfrom .LETTERS import kor_phonemes, kor_re, eng_phonemes, eng_re\nimport numpy as np\n\n\n# 일본어는 나중에\n# https://m.blog.naver.com/PostView.nhn?blogId=aoba8615&logNo=140012660052&proxyReferer=https:%2F%2Fwww.google.com%2F\n\n\ndef check_encodings(string):\n \"\"\"\n 문자열의 인코딩을 확인하는 함수\n 문자...
[ [ "numpy.array" ] ]
wsavran/csep2
[ "daf44c8c31badf8474794a32f89f2c44dcbe1f61" ]
[ "tests/test_JmaCsvCatalog.py" ]
[ "import unittest\nimport csep\n\n\nimport os.path\n\nimport numpy\n\ndef get_datadir():\n root_dir = os.path.dirname(os.path.abspath(__file__))\n data_dir = os.path.join(root_dir, 'artifacts', 'JMA-observed_catalog')\n return data_dir\n\ndef test_JmaCsvCatalog_loading():\n datadir = get_datadir()\n c...
[ [ "numpy.ndarray", "numpy.testing.assert_allclose" ] ]
oscarlazoarjona/orca_memories
[ "43920dae63d1d3d27028f8e9e3bb69c37c297d40" ]
[ "orca_memories/misc.py" ]
[ "# -*- coding: utf-8 -*-\n# Compatible with Python 3.8\n# Copyright (C) 2020-2021 Oscar Gerardo Lazo Arjona\n# mailto: oscar.lazoarjona@physics.ox.ac.uk\nr\"\"\"Miscellaneous routines.\"\"\"\nimport numpy as np\nimport warnings\nfrom scipy.interpolate import interp1d\nfrom numpy import sinc as normalized_sinc\nfrom...
[ [ "scipy.special.gamma", "numpy.exp", "numpy.sinc", "numpy.where", "numpy.fft.fftfreq", "numpy.sin", "numpy.log", "numpy.sqrt", "numpy.array", "scipy.interpolate.interp1d", "numpy.zeros", "numpy.fft.ifftshift", "numpy.real", "numpy.amax", "numpy.amin", ...
CUAI/Differentiable-Frechet-Mean
[ "c73f9e8d0969a727043d3d2a07af6392fdc802af" ]
[ "frechetmean/manifolds/ball.py" ]
[ "import torch\n\nfrom .manifold import Manifold\nfrom frechetmean.utils import EPS, cosh, sinh, tanh, arcosh, arsinh, artanh, sinhdiv, divsinh\n\n\nclass Poincare(Manifold):\n def __init__(self, K=-1.0, edge_eps=1e-3):\n super(Poincare, self).__init__()\n self.edge_eps = 1e-3\n assert K < 0\...
[ [ "torch.zeros", "torch.is_tensor", "torch.tensor", "torch.zeros_like", "torch.where" ] ]
danijar/bridgewalk
[ "fcfe055268c77b4bc9bc6eb7fe8d7243ca5617f9", "fcfe055268c77b4bc9bc6eb7fe8d7243ca5617f9" ]
[ "bridgewalk/objects.py", "bridgewalk/run_random.py" ]
[ "import numpy as np\n\nfrom . import constants\n\n\nclass Object:\n\n def __init__(self, world, pos):\n self.world = world\n self.pos = np.array(pos)\n self.random = world.random\n self.health = 0\n\n @property\n def texture(self):\n raise 'unknown'\n\n @property\n def walkable(self):\n retur...
[ [ "numpy.sign", "numpy.array", "numpy.abs" ], [ "numpy.random.RandomState" ] ]
harimaruthachalam/PyTorchNNs
[ "94fe173204e18fbe5087643e3da1cd9cdd6bd2ef" ]
[ "TitanicKaggle/feedForwardNN.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision.transforms as transforms\nimport torchvision.datasets as dsets\nfrom torch.autograd import Variable\nimport numpy as np\nimport matplotlib.pyplot as plot\nimport collections\nimport pandas as pd\n\ndef substrings_in_string(big_string, substrings):\n for i ...
[ [ "torch.nn.Linear", "torch.max", "torch.autograd.Variable", "torch.nn.Sigmoid", "torch.nn.CrossEntropyLoss", "torch.nn.ReLU", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "pandas.read_csv", "pandas.to_numeric", "torch.utils.data.TensorDat...
joaopfonseca/social_media_crawler
[ "3abce6c850d203805f705e82612d98abf2eb4a47" ]
[ "gui/FlaskApp/db_instagram.py" ]
[ "#!/usr/bin/env python\n\nfrom datetime import datetime\nimport os\n\n#querying\nimport pandas as pd\nimport numpy as np\n\n#plotting\n#from plotly.offline import plot #to save graphs as html files, useful when testing\nimport plotly.graph_objs as go\n\n#dashboarding\nimport dash\nimport dash_core_components as dcc...
[ [ "pandas.read_csv" ] ]
Murphy-OrangeMud/scalabel
[ "6f2d045c7c691fc5ffc61a3c8a29676b3360542d" ]
[ "scalabel/vis/geometry.py" ]
[ "\"\"\"3D geometric functions used by the visualizer.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Dict, List, Tuple, Union\n\nimport numpy as np\n\nfrom ..label.typing import Box3D\n\n\ndef rotate_vector(\n vector: np.ndarray,\n rot_x: float = 0,\n rot...
[ [ "numpy.sin", "numpy.array", "numpy.dot", "numpy.median", "numpy.ones", "numpy.sign", "numpy.cos" ] ]
Rounak-Ghosh/Nifty-50
[ "8863862eec4e6b01582204e3a37f29d485e4e090" ]
[ "main.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\nohlc_data = pd.read_csv('nifty-50\\SBIN.csv', index_col=0, parse_dates=True)\n\ndaily = np.array(ohlc_data)\n\nmoney = int(input('Enter amount you want to invest : '))\nrisk = int(input('Enter no of shares you want to buy/sell in each tran...
[ [ "numpy.array", "pandas.read_csv" ] ]
yih117/Analyzing-the-Generalization-Capability-of-SGLD-Using-Properties-of-Gaussian-Channels
[ "39b7e110d100f13b48c8d0cc2829a6bac34e550a" ]
[ "code/main.py" ]
[ "import numpy as np\r\nimport torch\r\nimport math\r\nfrom torch import nn, optim\r\nfrom torch.utils.data import DataLoader\r\nfrom torch.utils.data import SubsetRandomSampler\r\nimport importlib\r\nimport copy\r\nimport argparse\r\nfrom torchvision import transforms, datasets\r\nfrom torch.autograd import Variabl...
[ [ "torch.device", "numpy.array", "numpy.linalg.norm", "numpy.empty", "numpy.random.choice", "torch.nn.utils.clip_grad_norm_", "numpy.random.seed", "torch.norm", "numpy.load", "numpy.mean", "numpy.save", "torch.cuda.is_available", "torch.utils.data.DataLoader", ...
haamoon/librl
[ "f9fc633b79c1bec1cd1b1a275834eb5221cffff3" ]
[ "rl/tools/normalizers/normalizer.py" ]
[ "from abc import ABC, abstractmethod\nimport numpy as np\nimport copy\nfrom rl.tools.utils.mvavg import ExpMvAvg, PolMvAvg\nfrom rl.tools.utils.misc_utils import deepcopy_from_list\n\n\nclass OnlineNormalizer(ABC):\n \"\"\"\n A normalizer that adapts to streaming observations. Given input x, it computes\n...
[ [ "numpy.square", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.ones", "numpy.mean", "numpy.shape", "numpy.sqrt", "numpy.clip", "numpy.maximum" ] ]
LouisWW/Computational-Finance
[ "50c99f480f83379c06310fd156ddfe048789f58d" ]
[ "Assignment 2/Binomial_tree.py" ]
[ "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\r\n\"\"\"\r\nCreated on Friday Feb 20 2020\r\nThis code was implemented by\r\nLouis Weyland, Floris Fok and Julien Fer\r\n\"\"\"\r\n\r\n# Import built-in libs\r\nimport math\r\n\r\n# Import 3th parties libraries\r\nimport numpy as np\r\nimport matplotlib.pyplot ...
[ [ "numpy.random.normal", "numpy.zeros", "numpy.log", "matplotlib.pyplot.title", "numpy.exp", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.sqrt", "matplotlib.pyplot.show", "scipy.stats.norm.cdf" ] ]
cleancode-for-deeplearning/semantic-segmentation
[ "d092f9f7ed8294d41cd9f6beda91a112627945b3", "d092f9f7ed8294d41cd9f6beda91a112627945b3" ]
[ "networks/architectures/decoders.py", "networks/architectures/base_modules.py" ]
[ "import torch\nimport torch.nn as nn\nfrom utils.network_utils import *\nfrom networks.architectures.base_modules import *\n\nclass UNetDecoder(nn.Module):\n\tdef __init__(self, opt, nf):\n\t\tsuper(UNetDecoder, self).__init__()\n\t\tic, oc, norm_type, act_type, mode = \\\n\t\t\topt.ic, opt.oc, opt.norm_type, opt.a...
[ [ "torch.zeros", "torch.cat", "torch.nn.BatchNorm2d", "torch.bmm", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ], [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.functional.interpolate", "torch.nn.ConvTranspose2d", "to...
Perilla000leaves/timeseries
[ "451e8ceee838e56efceee6d15e8fae61e1582a15" ]
[ "ARMA.py" ]
[ "# Note: The information criteria add 1 to the number of parameters\n# whenever the model has an AR or MA term since, in principle,\n# the variance could be treated as a free parameter and restricted\n# This code does not allow this, but it adds consistency with other\n# packages such as gre...
[ [ "numpy.dot", "scipy.signal.lfilter", "numpy.cumsum", "numpy.zeros_like", "numpy.log", "pandas.DataFrame", "numpy.sqrt", "numpy.ndim", "numpy.column_stack", "numpy.linalg.inv", "numpy.vstack", "numpy.array", "scipy.optimize.fmin_l_bfgs_b", "numpy.zeros", ...
Linzee/tmsei_doodle
[ "b08580fe5d58f6dd614ba6f3f53a03bcd859277b" ]
[ "components/visualization/performanceUserMatrixPlot.py" ]
[ "import numpy as np\nimport pandas as pd\nimport pylab as plt\nimport components.visualization\n\nfrom components.flowUtils import annotateProgress, cached\n\nclass PerformanceUserMatrixPlot:\n\n def __init__(self, flow, orderUsers=None):\n self.flow = flow\n self.performanceMatrix = flow.getPerfor...
[ [ "numpy.array", "numpy.isnan", "numpy.reshape" ] ]
ayushoriginal/Optimized-RGB-To-ColorName
[ "f86d14b751c5422ba08fd9c51bba255a274bc184" ]
[ "rgb2nearestcolor.py" ]
[ "#!/usr/bin/env python\n# rgb2colorname.py\n# by wilsonmar@gmail.com, ayush.original@gmail.com, https://github.com/paarthneekhara\n# Usage: \n# Explained in https://github.com/jetbloom/rgb2colorname/blob/master/README.md\n\nimport numpy as np\nfrom scipy import spatial\n\n\nA = np.array([ \\\n\n[240,248,255] \\\n\n...
[ [ "scipy.spatial.KDTree", "numpy.array", "numpy.delete" ] ]
Rapid-Design-of-Systems-Laboratory/beluga-legacy
[ "d14713d8211b64293c4427005cf02fbd58630598" ]
[ "beluga/IndirectMethod.py" ]
[ "# from beluga.optim import *\nfrom optimalcontrol.elements import Problem\nfrom sympy import *\nfrom sympy.core.function import AppliedUndef, Function\nimport pystache, imp, inspect, logging, os\nimport re as _re\n\nimport beluga.bvpsol.BVP as BVP\n\nfrom beluga.utils import sympify, keyboard, ipsh\nfrom beluga.op...
[ [ "numpy.ones" ] ]
XingchengLin/openawsem
[ "a9f155d72e359b76d350e6d4c2ee476410ebe4c6" ]
[ "functionTerms/templateTerms.py" ]
[ "from simtk.openmm.app import *\nfrom simtk.openmm import *\nfrom simtk.unit import *\nimport numpy as np\nimport pandas as pd\n\ndef read_reference_structure_for_q_calculation_4(oa, contact_threshold,rnative_dat, min_seq_sep=3, max_seq_sep=np.inf):\n # use contact matrix for Q calculation\n # this change use...
[ [ "numpy.array", "numpy.zeros", "numpy.load", "numpy.exp", "numpy.save", "numpy.loadtxt", "numpy.arange", "numpy.savez", "numpy.alltrue", "pandas.read_csv" ] ]
eyurtsev/vision
[ "44e93beb0833ff51ffe75d994fe660434335b53d" ]
[ "torchvision/models/optical_flow/raft.py" ]
[ "from typing import List\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import Tensor\nfrom torch.nn.modules.batchnorm import BatchNorm2d\nfrom torch.nn.modules.instancenorm import InstanceNorm2d\nfrom torchvision.ops import ConvNormActivation\n\nfrom ..._internally_replaced_uti...
[ [ "torch._assert", "torch.cat", "torch.nn.Identity", "torch.nn.functional.avg_pool2d", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.split", "torch.nn.init.kaiming_normal_", "torch.linspace", "torch.nn.functional.relu", "torch.nn.ReLU", "torch.nn.Conv2d", ...
mkbeh/rin-bitshares-arbitry-bot
[ "7ef49e593b0a6d3c5c6561749bb36bc0c6bdee7e" ]
[ "setup.py" ]
[ "import os\n\nimport numpy as np\nimport src\n\nfrom setuptools import setup, find_packages\nfrom Cython.Build import cythonize\nfrom Cython.Distutils import build_ext\n\nfrom src.extra import utils\n\n\ncompiler_directives = {\n 'language_level': 3,\n 'cdivision': True,\n 'boundscheck': True,\n 'wrapar...
[ [ "numpy.get_include" ] ]
Uma0221/AI-102-AIEngineer
[ "32112b354e81cb5d8790b9c2b4f733ef5740a19f", "32112b354e81cb5d8790b9c2b4f733ef5740a19f" ]
[ "venv/Lib/site-packages/matplotlib/axis.py", "venv/Lib/site-packages/matplotlib/__init__.py" ]
[ "\"\"\"\r\nClasses for the ticks and x and y axis.\r\n\"\"\"\r\n\r\nimport datetime\r\nimport functools\r\nimport logging\r\n\r\nimport numpy as np\r\n\r\nimport matplotlib as mpl\r\nfrom matplotlib import _api\r\nimport matplotlib.artist as martist\r\nimport matplotlib.cbook as cbook\r\nimport matplotlib.lines as ...
[ [ "matplotlib.units._is_natively_supported", "numpy.isclose", "matplotlib.transforms.Bbox.from_extents", "matplotlib.units.registry.get_converter", "matplotlib._api.check_getitem", "matplotlib.text.FontProperties", "matplotlib._api.warn_external", "matplotlib._api.make_keyword_only",...
deeplikesea/Pattern-Recognition
[ "350033254b2efbfc057d4ef7202fbbfb2546eb1a" ]
[ "train.py" ]
[ "import tensorflow as tf\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport cv2\r\nimport time\r\nimport os\r\n'''\r\nwriter.write(example.SerializeToString()) input 最后生成数据。\r\n\r\n从TFRecords文件中读取数据, \r\n首先需要用tf.train.string_input_producer生成一个解析队列。\r\n之后调用tf.TFRecordReader的tf.parse_single_example解析器...
[ [ "tensorflow.image.random_hue", "tensorflow.train.start_queue_runners", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.image.random_flip_left_right", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.clip_by_value", "tensorflow.control_dependencies",...
delvallem/specDS
[ "3ce89c0ea8582f6c685b3b3522ace66c5f348df7" ]
[ "preprocessing.py" ]
[ "'''\nData pre-processing\n'''\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\n\ndef concat2D(data):\n '''\n Concatenate all spectra opened with agilentFPA_multiple or agilentFPA where\n mode = 'mosaic'. Useful for processing.\n\n Create a label for each sp...
[ [ "numpy.dot", "matplotlib.pyplot.xlim", "numpy.min", "numpy.mean", "numpy.linalg.lstsq", "numpy.cumsum", "numpy.concatenate", "numpy.max", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.trapz", "numpy.sqrt", "sklearn.decomposition.PCA", "numpy.square", ...
haiqinggatech/reinforcement-learning-an-introduction
[ "d83709e0b36964ade969e6dc3cef15e81a5d5ca6" ]
[ "chapter06/WindyGridWorld.py" ]
[ "#######################################################################\n# Copyright (C) #\n# 2016 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# 2016 Kenta Shimada(hyperkentakun@gmail.com) #\n# Permission given to m...
[ [ "numpy.max", "numpy.random.binomial", "numpy.random.choice", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.argmax", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
ishine/tpse-vc
[ "33c29b510476ebc90779e8d857cba0890a883e7e" ]
[ "code/data/preprocessing_vctk.py" ]
[ "import sys\nimport os\nimport librosa\nimport numpy as np\n\nfrom multiprocessing import Pool\nimport pickle\n\nfrom librosa.filters import mel as librosa_mel_fn\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom sklearn.preprocessing import StandardScaler\nimport warnings\n\nwarnings....
[ [ "torch.sqrt", "torch.hann_window", "numpy.save", "torch.from_numpy", "torch.clamp", "torch.nn.functional.pad", "torch.matmul", "torch.stft" ] ]
aditishankar/test
[ "dd3c46115ed3d5af7e6a4a6f8745cffb9b762c3a" ]
[ "airflow/hooks/dbapi.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\")...
[ [ "pandas.io.sql.read_sql" ] ]
thermokarst/gneiss
[ "20cbcaa6d889eea8462866d4b62e12509f84d47f" ]
[ "gneiss/regression/_ols.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2016--, gneiss development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n# -------------------------------------...
[ [ "numpy.divide", "numpy.dot", "pandas.DataFrame", "numpy.arange", "numpy.abs", "numpy.hstack", "numpy.diag" ] ]
lovvge/gluon-ts
[ "284376138f41968bec0a4cb05b274c8ee259493a", "284376138f41968bec0a4cb05b274c8ee259493a" ]
[ "src/gluonts/model/seq2seq/_transform.py", "test/dataset/test_stat.py" ]
[ "# Standard library imports\nfrom typing import Iterator, List\n\n# Third-party imports\nimport numpy as np\n\n# First-party imports\nfrom gluonts.core.component import validated\nfrom gluonts.transform import DataEntry, FlatMapTransformation, shift_timestamp\n\n\nclass ForkingSequenceSplitter(FlatMapTransformation...
[ [ "numpy.expand_dims", "numpy.concatenate", "numpy.zeros" ], [ "numpy.array", "numpy.random.seed", "numpy.ones", "pandas.Timestamp", "numpy.random.randint" ] ]
mlemainque/dask-lightgbm
[ "243de618c1e4fcd783f502a0d8d0282c49b37701" ]
[ "dask_lightgbm/tests/test_core.py" ]
[ "import numpy as np\nimport pandas as pd\nimport sparse\nimport lightgbm\nimport scipy.sparse\nimport pytest\n\nimport dask.array as da\nfrom dask.array.utils import assert_eq\nimport dask.dataframe as dd\nfrom dask.distributed import Client\nfrom sklearn.datasets import make_blobs\nfrom distributed.utils_test impo...
[ [ "sklearn.metrics.confusion_matrix", "pandas.Series", "sklearn.datasets.make_blobs", "numpy.random.RandomState" ] ]
arunpandianm/Arya-AI---Chatbot
[ "4345b5b6deac885dd96950815823a125813b087e" ]
[ "v1.0/arya - test.py" ]
[ "import nltk\r\n#nltk.download('punkt')\r\nfrom nltk.stem.lancaster import LancasterStemmer\r\nstemmer = LancasterStemmer()\r\n\r\nimport numpy\r\nimport tensorflow\r\nimport random\r\nimport tflearn\r\nimport json\r\nimport pickle\r\n\r\nimport speech_recognition as sr\r\n\r\n## Fetch the training data\r\nwith ope...
[ [ "numpy.array", "tensorflow.reset_default_graph", "numpy.argmax" ] ]
nec-db-ml/perfect_match
[ "3f6c5642c02420ae676c5e7b94bb4d716ed3b5d9" ]
[ "perfect_match/models/benchmarks/tcga_benchmark.py" ]
[ "\"\"\"\nCopyright (C) 2018 Patrick Schwab, ETH Zurich\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify,...
[ [ "numpy.max", "numpy.array", "numpy.random.RandomState", "numpy.rint", "numpy.arange", "numpy.squeeze" ] ]
jmhessel/multi-retrieval
[ "20178dfda368ed4117f3aaee7b0bd2946fcdf9eb" ]
[ "train_doc.py" ]
[ "'''\nCode to accompany\n\"Unsupervised Discovery of Multimodal Links in Multi-Sentence/Multi-Image Documents.\"\nhttps://github.com/jmhessel/multi-retrieval\n\nThis is a work-in-progress TF2.0 port.\n'''\nimport argparse\nimport collections\nimport json\nimport tensorflow as tf\nimport numpy as np\nimport os\nimpo...
[ [ "tensorflow.keras.backend.transpose", "tensorflow.ones_like", "numpy.load", "tensorflow.keras.models.Model", "tensorflow.keras.layers.SpatialDropout1D", "tensorflow.keras.layers.Dense", "tensorflow.zeros_like", "tensorflow.math.top_k", "tensorflow.keras.layers.BatchNormalizatio...
amands97/adverserialSphereFace
[ "91832c4af6768bfa4b116646d09135d98ce727f6" ]
[ "lfw_eval.py" ]
[ "# CUDA_VISIBLE_DEVICES=1 python lfw_eval.py --lfw lfw.zip --epoch_num 2\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\ntorch.backends.cudnn.bencmark = True\n\nimport os,sys,cv2,random,...
[ [ "numpy.array", "numpy.count_nonzero", "numpy.mean", "torch.from_numpy", "numpy.std", "numpy.arange", "torch.load", "numpy.vstack" ] ]
thanard/dorp
[ "3e635699018365696fb7d623cf1c519121fafa69" ]
[ "utils/visualize.py" ]
[ "import matplotlib.pyplot as plt\nfrom envs.gridworld import AGENT_SIZES, RGB_COLORS\nimport numpy as np\nimport os\nfrom envs.key_door import *\nfrom envs.gridworld import *\n\nfrom utils.gen_utils import *\nfrom model import get_discrete_representation\nfrom torchvision.utils import save_image\n\ndef visualize_re...
[ [ "numpy.concatenate", "numpy.full", "numpy.array", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.random.shuffle", "matplotlib.pyplot.figure", "numpy.eye", "numpy.where", "matplotlib.pyplot.his...
Qi-Zha0/COMS4995
[ "c8ec5ceeb62a814194b461c93875c9162b4a8730" ]
[ "code/target_reader.py" ]
[ "import numpy as np\nimport pandas as pd\nimport cv2\n\n\nclass target_reader:\n '''\n Reads in an image of a used archery target and uses openCV to determine\n position and score value for each shot. __init__ initializes session\n settings and run performs analysis.\n '''\n\n # Class-wide setting...
[ [ "numpy.argmin", "numpy.mean", "numpy.radians", "numpy.sort", "numpy.cos", "numpy.full_like", "numpy.max", "numpy.zeros_like", "numpy.linalg.norm", "numpy.sin", "pandas.DataFrame", "numpy.interp", "numpy.prod", "numpy.argmax", "numpy.square", "numpy.a...
GavinRay97/arrow
[ "11d2e4863974b95c1fa637e83757b98f291366c3" ]
[ "python/pyarrow/tests/test_json.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.random.RandomState" ] ]
A-Gharibian/SNVcaller
[ "0d10269381161f2aa990524bef983f6f3f6478f3" ]
[ "vardict_vcf.py" ]
[ "\"\"\"\nThis module automatically converts sorted vardict output to standard .vcf format.\n\nAuthor: Nick Veltmaat\nDate: 19-11-2021\n\"\"\"\n\nimport pandas as pd\nimport glob\nimport sys\n\nif len(sys.argv) != 3:\n print(\"Usage:\\t\" + sys.argv[0] + \"\\t<input_sorted_vardict_file_path>\\t<output_path_filename...
[ [ "pandas.read_csv" ] ]
wessels/protocol-camel
[ "6117e8dbeb6a7d9a1bc5552489699f7ef012fda2" ]
[ "camelplot.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport sys\nfrom IPython.display import set_matplotlib_formats\nfrom pandas.plotting import register_matplotlib_converters\nregister_matplotlib_converters()\n\nimport matplotlib\nimport math\nimport numpy as np\nimport scipy as sp\nimport seaborn as sns\nimpo...
[ [ "pandas.to_datetime", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "pandas.read_csv", "matplotlib.pyplot.stackplot", "pandas.plotting.register_matplotli...
jacobrgardner/pybnn
[ "3fcc7d36ce5d09fa15049872e3f516c9261d7b3e" ]
[ "pybnn/lcnet.py" ]
[ "from copy import deepcopy\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom pybnn.bohamiann import Bohamiann\nfrom pybnn.util.layers import AppendLayer\n\n\ndef vapor_pressure(x, a, b, c, *args):\n b_ = (b + 1) / 2 / 10\n a_ = (a + 1) / 2\n c_ = (c + 1) / 2 / 10\n return torch.exp(-a_ ...
[ [ "torch.nn.Linear", "torch.stack", "numpy.mean", "numpy.std", "torch.log", "torch.exp", "torch.sum" ] ]
pierre-lavieille/abnormality-detection-x-ray
[ "d2092a9a16c3b916fda8c7e84822efe945e120c5" ]
[ "train_classifier/prepare_data.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport logging\nlogger = logging.getLogger('main_logger')\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import StratifiedKFold\nimport os\n\n\ndef get_update_df(conf):\n \"\"\"\n From the direction of the dataset it clean it and return train and validatio...
[ [ "pandas.read_csv", "sklearn.model_selection.StratifiedKFold" ] ]
shibaji7/clustering_superdarn_data
[ "02bc31dd85f66319bb46b632e0e7ac51ed98c432" ]
[ "plotters.py/sma.py" ]
[ "import pandas as pd\nfrom scipy import ndimage\nfrom sklearn.cluster import DBSCAN\nimport numpy as np\nfrom scipy import stats as st\n\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mticker\n#import spacepy.plot as splot\n#import seaborn as sns\nimport ma...
[ [ "scipy.stats.median_absolute_deviation", "numpy.quantile", "scipy.ndimage.minimum_filter", "numpy.median", "numpy.min", "numpy.mean", "numpy.sign", "numpy.where", "numpy.max", "matplotlib.font_manager.FontProperties", "numpy.indices", "pandas.DataFrame", "matplo...
lokijota/datadrivenastronomymooc
[ "175655e5c6450c091534299da6bce6f10a1a3627" ]
[ "wk6/01_splitting_the_train_and_test_sets.py" ]
[ "import numpy as np\nimport math\n\n\ndef splitdata_train_test(data, fraction_training):\n #randomize data set order\n np.random.seed(0)\n np.random.shuffle(data)\n\n #find split point\n training_rows = math.floor(len(data) * fraction_training) #int(...) would be enough\n \n training_set = data[0:training_ro...
[ [ "numpy.random.seed", "numpy.load", "numpy.random.shuffle" ] ]
mecobalamine/crispy-octo-palm-tree
[ "dfcca865ccb1235083c9a4ab997e8a9334a21235" ]
[ "frame/ord_watershed.py" ]
[ "import cv2 as cv\nimport const\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom PIL import Image\nfrom collections import deque\n\n\ndef get_neighbors(height, width, pixel):\n return np.mgrid[\n max(0, pixel[0] - 1):min(height, pixel[0] + 2),\n max(0, pixel[1] - 1):min(width, pix...
[ [ "numpy.full", "matplotlib.pyplot.figure", "numpy.argsort", "matplotlib.pyplot.show", "numpy.linspace" ] ]
bmorris3/boyajian_star_arces
[ "c36adeaf47dc606edacc45b920db0a19c3f2bd88" ]
[ "toolkit/analysis.py" ]
[ "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport numpy as np\nfrom scipy.optimize import fmin\nimport emcee\n\n__all__ = ['mcmc_fit', 'initial_odr_fit']\n\n\ndef v_vector(theta):\n \"\"\"\n Hogg+ 2010, Eqn 29.\n \"\"\"\n return [[-n...
[ [ "numpy.sin", "numpy.log", "numpy.random.randn", "numpy.exp", "numpy.isfinite", "numpy.cos" ] ]
aolin480/openpilot
[ "9ac00c3e5e111a05a0bb10018ccd190571dfff4d", "9ac00c3e5e111a05a0bb10018ccd190571dfff4d" ]
[ "selfdrive/locationd/models/car_kf.py", "selfdrive/locationd/paramsd.py" ]
[ "#!/usr/bin/env python3\nimport math\nimport sys\nfrom typing import Any, Dict\n\nimport numpy as np\n\nfrom selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY\nfrom selfdrive.locationd.models.constants import ObservationKind\nfrom selfdrive.swaglog import cloudlog\n\nfrom rednose.helpers.kalma...
[ [ "numpy.array", "numpy.zeros", "numpy.atleast_2d" ], [ "numpy.radians", "numpy.array", "numpy.atleast_2d" ] ]
sjperkins/awkward-1.0
[ "75dbd5d06a012ff9d1da56f898b747cea2b1d2a9" ]
[ "tests/test_0056b-partitioned-array-numba.py" ]
[ "# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/master/LICENSE\n\nfrom __future__ import absolute_import\n\nimport sys\n\nimport pytest\nimport numpy\n\nimport awkward1\n\nnumba = pytest.importorskip(\"numba\")\n\nawkward1_numba = pytest.importorskip(\"awkward1._connect._numba\")\nawkwar...
[ [ "numpy.array" ] ]
Xiaojieqiu/starfish
[ "426480fcfeda4b8b1eb9371a818ff20275ac898d" ]
[ "starfish/pipeline/gene_assignment/point_in_poly.py" ]
[ "import numpy as np\nfrom skimage.measure import points_in_poly\nimport pandas as pd\n\nfrom ._base import GeneAssignmentAlgorithm\n\n\nclass PointInPoly(GeneAssignmentAlgorithm):\n def __init__(self, verbose=False, **kwargs):\n self.verbose = verbose\n\n @classmethod\n def add_arguments(cls, parser...
[ [ "numpy.sum", "numpy.array" ] ]
oegedijk/dash_oop_demo
[ "5558323d911532558b1bc58cde791020a1609e48" ]
[ "dashboard_components.py" ]
[ "__all__ = ['CovidDashboard']\n\nimport dash_html_components as html\nimport dash_core_components as dcc\nimport dash_bootstrap_components as dbc\n\nfrom dash.dependencies import Input, Output, State\nfrom dash.exceptions import PreventUpdate\nfrom dash_oop_components import DashFigureFactory, DashComponent, DashCo...
[ [ "pandas.read_csv" ] ]
hahaxun/ray
[ "754d7b1f0d6a147315a96dfc9f410504472b28d5" ]
[ "rllib/models/tf/tf_action_dist.py" ]
[ "from math import log\nimport numpy as np\nimport functools\n\nfrom ray.rllib.models.action_dist import ActionDistribution\nfrom ray.rllib.utils import MIN_LOG_NN_OUTPUT, MAX_LOG_NN_OUTPUT, \\\n SMALL_NUMBER, try_import_tree\nfrom ray.rllib.utils.annotations import override, DeveloperAPI\nfrom ray.rllib.utils.fr...
[ [ "numpy.array", "numpy.less", "numpy.log", "numpy.sum", "numpy.prod" ] ]
Matthew-McRaven/ConvVote
[ "b83310217d2830d6ca3374916efab7fc55a70ab4" ]
[ "CNNScan/Samples/Random/ElectionFaker.py" ]
[ "import random\n\nimport numpy as np\nimport numpy.random\nfrom PIL import Image\nfrom faker import Faker\n\nfrom CNNScan.Ballot import BallotDefinitions, MarkedBallots, Positions\nimport CNNScan.Mark.Marks\n# Create a single, fixed fake race with 4 candidates.\ndef create_fake_contest(pagenum, contest_index=0, min...
[ [ "numpy.sum" ] ]
BanafshehKhaki/EOS_img
[ "68764f5e6bf239dee791d495ed4eac1b60a25690" ]
[ "ImgAna_minimum.py" ]
[ "import os\r\nimport sys\r\nimport numpy as np\r\nimport matplotlib.pyplot as pp\r\nimport warnings\r\nfrom datetime import datetime\r\n\r\n#try:\r\n# from PIL import Iamge\r\n#except ImportError:\r\n# print (\"Python module 'PIL' not available.\"\r\n# pass\r\n \r\n\r\n\r\nclass EOS1_Img:\r\n \"\"\"P...
[ [ "numpy.array", "matplotlib.pyplot.colorbar", "numpy.argmin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.where", "numpy.arange", "numpy.polyfit", "matplotlib.pyplot.style.use", "numpy.dstack", ...
strangetom/ingredient-parser
[ "2c6221acafb5ef006fc44597946110b757f8b43b" ]
[ "data/generate_training_testing_data_from_csv.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nimport csv\n\nfrom sklearn.model_selection import train_test_split\nfrom nltk import pos_tag\nfrom nltk.tokenize import word_tokenize\n\ndef load_csv(csv_filename):\n \"\"\"Load csv file generated py ```generate_training_testing_csv.py``` and parse contents into ingred...
[ [ "sklearn.model_selection.train_test_split" ] ]
aliechoes/iflai
[ "74f20236a6fba4704fe3ab4cdde6fb64c6b1343e" ]
[ "iflai/ml/segmentation.py" ]
[ "from skimage.filters import threshold_otsu\nfrom skimage.filters import sobel\nfrom skimage.morphology import disk, remove_small_objects, binary_closing\nfrom scipy.ndimage import binary_fill_holes\n\n__all__ = [ 'segment_all_channels',\n 'bright_field_segmentation',\n 'fluorescent_segmentat...
[ [ "scipy.ndimage.binary_fill_holes" ] ]
xuanyuyt/lanenet-lane-detection
[ "b4e9eeb3b25597ce7a393771d3f324d64ec1348b" ]
[ "data_provider/autoaugment_utils_my.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.reduce_min", "numpy.ones_like", "tensorflow.cumsum", "numpy.minimum", "tensorflow.ones_like", "numpy.tile", "tensorflow.ones", "tensorflow.reshape", "numpy.mean", "numpy.min", "numpy.where", "tensorflow.zeros_like", "tensorflow.clip_by_value", "t...
milesgray/ImageFunctions
[ "35e4423b94149b0ba291eafb0cd98260a70d5f31" ]
[ "models/resnexter.py" ]
[ "from functools import partial\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .registry import register\nfrom .layers import create as create_layer\nfrom .layers.activations import create as create_act\nfrom .layers import SpectralConv2d\n\n__all__ = ['ResNeXtER', 'resnexter18', 're...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.init.kaiming_normal_", "torch.nn.Conv2d", "torch.nn.GELU" ] ]
Yuriowindiatmoko2401/ml_flood
[ "56b63d90c2c6b066e0d077b78c6b96d5ddac06d6" ]
[ "python/misc/utils_floodmodel.py" ]
[ "import warnings\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\nimport geopandas\nfrom rasterio import features\nfrom affine import Affine\nfrom python.aux.utils import calc_area\nnp.seterr(divide='ignore', invalid='ignore')\n\n\"\"\"Contains methods for the flowmodel (transport model & local model)...
[ [ "numpy.array", "numpy.isnan", "numpy.asarray", "numpy.seterr", "numpy.allclose", "numpy.timedelta64", "numpy.cumsum", "numpy.repeat", "pandas.Series", "numpy.floor" ] ]
SrivastavaKshitij/WeightWatcher
[ "afdab804801e62c07e6c5c19e3f6c5dd2538989f" ]
[ "weightwatcher/weightwatcher.py" ]
[ "# Copyright 2018 Calculation Consulting [calculationconsulting.com]\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.dot", "numpy.random.choice", "numpy.fft.fft2", "numpy.min", "numpy.sort", "numpy.max", "numpy.zeros_like", "numpy.linalg.norm", "pandas.DataFrame", "numpy.transpose", "numpy.argmax", "numpy.sqrt", "sklearn.decomposition.TruncatedSVD", "numpy.log10", ...
sukkritsharmaofficial/chitra
[ "93629d0a6d41a3f8b8cf61485684314628e1135e" ]
[ "chitra/core.py" ]
[ "import os\nimport pathlib\nfrom typing import Optional, Tuple\n\nimport requests\nimport tensorflow as tf\n\nfrom chitra.constants import IMAGENET_LABEL_URL\nfrom chitra.logging import logger\n\nIMAGENET_LABELS: Optional[Tuple[str]] = None\n\n\ndef remove_dsstore(path) -> None:\n \"\"\"Deletes .DS_Store files f...
[ [ "tensorflow.strings.split" ] ]
mjwhite/volconv
[ "4756c0880cac050a16c23f5ad2d98014479e10ec" ]
[ "nifti/raw.py" ]
[ "#!/usr/bin/env python\n#\n# Volconv - geometry-aware DICOM-to-NIfTI converter\n# Raw writer (primarily for NIfTI data, hence using NIfTI type system)\n#\n# Copyright 2006-2016 Mark J White <mark@celos.net>\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except ...
[ [ "numpy.memmap", "numpy.reshape" ] ]
StanfordVL/InteractiveGibsonEnv
[ "58ac14cf62949008b6851a5a95602cd5084edffd" ]
[ "igibson/examples/robots/ik_example.py" ]
[ "import argparse\nimport logging\nimport os\nimport time\n\nimport numpy as np\nimport pybullet as p\n\nimport igibson\nfrom igibson.external.pybullet_tools.utils import (\n get_max_limits,\n get_min_limits,\n get_sample_fn,\n joints_from_names,\n set_joint_positions,\n)\nfrom igibson.objects.visual_...
[ [ "numpy.array" ] ]
tbohne/game_of_life
[ "f1f0caaad70e6540adae2eb2aa4d3bfb309d0479" ]
[ "gol.py" ]
[ "import copy\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nfrom argparse import ArgumentParser\n\ndef generate_random_state(dim):\n return [np.random.randint(2, size = dim) for _ in range(dim)]\n\ndef generate_initial_state_from_file(file):\n f = open(file, \"r\")\n grid =...
[ [ "matplotlib.pyplot.subplots", "matplotlib.colors.BoundaryNorm", "numpy.random.randint", "matplotlib.pyplot.pause", "matplotlib.colors.ListedColormap" ] ]
stevenmak-hub/solution_of_challenge
[ "7f3106f1f89660e67b12ace81645a5fc19674e77" ]
[ "audio_preprocessing/FullSubNet/fullsubnet/trainer.py" ]
[ "import matplotlib.pyplot as plt\nimport torch\nfrom torch.cuda.amp import autocast\nfrom tqdm import tqdm\n\nfrom ..audio_zen.acoustics.feature import mag_phase, drop_band\nfrom ..audio_zen.acoustics.mask import build_complex_ideal_ratio_mask, decompress_cIRM\nfrom ..audio_zen.trainer.base_trainer import BaseTrain...
[ [ "matplotlib.pyplot.switch_backend", "torch.no_grad", "torch.stack", "torch.cuda.amp.autocast" ] ]
sasgc6/pysmurf
[ "a370b515ab717c982781223da147bea3c8fb3a9c" ]
[ "scratch/shawn/trianglewave.py" ]
[ "import pysmurf\n\n#S = pysmurf.SmurfControl(make_logfile=False,setup=False,epics_root='test_epics',cfg_file='/usr/local/controls/Applications/smurf/pysmurf/pysmurf/cfg_files/experiment_fp28_smurfsrv04.cfg')\n\n\nimport numpy as np\nimport time\n\nVrange=np.linspace(0,0.195/6.,100)+S.get_tes_bias_bipolar(3)\nVrange...
[ [ "numpy.array", "numpy.linspace" ] ]
desmoteo/swiss-army-keras
[ "49578f1a45761229756a8adbfcf692728039dc3b" ]
[ "swiss_army_keras/quantization_utils.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nfrom datetime import datetime\n\nimport matplotlib.pyplot as plt\n\n\ndef visualize(**images):\n \"\"\"PLot images in one row.\"\"\"\n n = len(images)\n plt.figure(figsize=(16, 5))\n for i, (name, image) in enumerate(images.items()):\n plt.subplot(1...
[ [ "tensorflow.lite.Interpreter", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "tensorflow.cast", "tensorflow.keras.models.load_model", "tensorflow.lite.TFLiteConverter.from_keras_model", "numpy.argmax", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplot...
evgerher/hft-backtesting
[ "737ce7bda4a31b839dd8179eab5f3aae22040c3e" ]
[ "tests/strategy_test.py" ]
[ "import datetime\nimport unittest\n\nfrom hft.backtesting import backtest\nimport numpy as np\n\nfrom hft.backtesting.output import StorageOutput\nfrom hft.backtesting.readers import ListReader\nfrom hft.units.metrics.instant import VWAP_volume\nfrom hft.units.metrics.time import TradeMetric\nfrom hft.utils.consts ...
[ [ "numpy.array" ] ]
TianXie1999/selective-inference
[ "ca02bbd84af5f5597944c75bde8337db9c69066a" ]
[ "doc/learning_examples/knockoffs/knockoff_kernel_multi_5000.py" ]
[ "import functools\n\nimport numpy as np\nfrom scipy.stats import norm as ndist\n\nimport regreg.api as rr\n\nfrom selectinf.tests.instance import gaussian_instance\n\nfrom selectinf.learning.utils import full_model_inference, pivot_plot\nfrom selectinf.learning.core import normal_sampler, keras_fit\n\ndef generate(...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.random.standard_normal", "numpy.linalg.pinv", "matplotlib.pyplot.close", "numpy.mean", "numpy.nonzero", "numpy.fabs", "numpy.sqrt", "numpy.hstack", "pandas.read_csv", "numpy.linalg.inv" ] ]
manuel-rhdt/master-thesis
[ "51806aabefaa66a06bf895cac248fe3bffb04ba7" ]
[ "python/tests/likelihood_test.py" ]
[ "import unittest\nfrom gaussian_system import System, time_matrix, wang_landau\nfrom gaussian_system.thermodynamic_integration import generate_samples_mcmc\nimport numpy as np\nfrom scipy.stats import multivariate_normal\n\n\nclass TestLikelihood(unittest.TestCase):\n def test_trivial(self):\n self.assert...
[ [ "numpy.testing.assert_allclose", "numpy.random.random_sample", "scipy.stats.multivariate_normal", "numpy.linspace", "numpy.linalg.inv" ] ]
the-mahapurush/pds
[ "7cb4087dd8e75cb1e9b2a4283966c798175f61f7" ]
[ "All_Source_Code/LogisticRegression/LogisticRegression_2.py" ]
[ "from sklearn import datasets\nfrom sklearn.model_selection import train_test_split\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn.linear_model import LogisticRegression\nclassifier = LogisticRegression(max_iter=5000,\\\n solver='lbfgs',\\\n ...
[ [ "sklearn.datasets.load_digits", "sklearn.linear_model.LogisticRegression", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
lparolari/weakvtg
[ "e5d5f738ff0d916da8b31e967aa21f01fb74a906" ]
[ "tests/loss/test_loss_orthogonal_box_class_count_scaled.py" ]
[ "import torch\n\nfrom weakvtg.loss import loss_orthogonal_box_class_count_scaled\n\n\ndef test_loss_orthogonal_box_class_count_scaled():\n X = torch.tensor([1, -1, 1, -1, 0, 0, .236, -.751], dtype=torch.float), torch.tensor([3, 1, 1, 1, 0, 1, 1, 0])\n y = torch.tensor([1, -1, -1, 1, -1, 1, -1, 1], dt...
[ [ "torch.square", "torch.tensor" ] ]
yketa/DAMTP_2019_Wiki
[ "9995202a586d5f301f2bdffe868b1fcec6fbb990" ]
[ "Summaries/RTPring/exact_plot.py" ]
[ "from active_work.miscellaneous import RTPring\nfrom active_work.plot import list_colormap\nfrom active_work.init import get_env\n\nimport matplotlib.pyplot as plt\ntry: plt.style.use('paper')\nexcept: print('Matplotlib stylesheet \\'paper\\' does not exist.')\nfrom matplotlib.lines import Line2D\n\nimport numpy as...
[ [ "numpy.max", "matplotlib.lines.Line2D", "matplotlib.pyplot.sca", "matplotlib.pyplot.subplots", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show", "numpy.linspace" ] ]
NRauschmayr/sagemaker-debugger
[ "24ed65631143fcc0457fb325a102500ebd69adfc" ]
[ "tests/pytorch/test_distributed_training.py" ]
[ "\"\"\"\nTests core functionality of naming workers when there are multiple processes.\nSee https://pytorch.org/tutorials/intermediate/ddp_tutorial.html to decide\nhow we want to support DistributedDataParallel with limited user configuration.\n\nThe key methods are\n torch.distributed.get_rank() - when manually...
[ [ "torch.multiprocessing.Process", "torch.nn.functional.sigmoid", "torch.rand", "torch.device", "torch.distributed.get_world_size", "torch.nn.Linear", "torch.distributed.init_process_group", "torch.multiprocessing.set_start_method", "torch.manual_seed", "torch.nn.functional.m...
leVirve/OneGAN
[ "e0d5f387c957fbf599919078d8c6277740015336" ]
[ "onegan/loss.py" ]
[ "# Copyright (c) 2017- Salas Lin (leVirve)\n#\n# This software is released under the MIT License.\n# https://opensource.org/licenses/MIT\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import grad\n\nimport onegan\n\n\ndef adversarial_ce_loss(x, value: float):\n ''' x...
[ [ "torch.nn.NLLLoss", "torch.cat", "torch.nn.functional.log_softmax", "torch.nn.functional.mse_loss", "torch.nn.functional.softmax", "torch.zeros_like", "torch.mean", "torch.nn.functional.binary_cross_entropy" ] ]
ivirshup/anndata
[ "e7a3a3e6e0b5e76c312efb7031bb71d224da297d" ]
[ "anndata/tests/test_concatenate.py" ]
[ "from collections.abc import Hashable\nfrom copy import deepcopy\nfrom itertools import chain, product\nfrom functools import partial\nimport warnings\n\nimport numpy as np\nfrom numpy import ma\nimport pandas as pd\nfrom pandas.api.types import is_categorical_dtype\nimport pytest\nfrom scipy import sparse\nfrom bo...
[ [ "numpy.concatenate", "pandas.testing.assert_frame_equal", "numpy.array", "numpy.array_equal", "numpy.random.choice", "numpy.nan_to_num", "numpy.testing.assert_equal", "numpy.zeros", "numpy.setdiff1d", "numpy.ones", "numpy.random.randn", "pandas.api.types.is_categori...
HAXRD/pattern
[ "09f37920ce727265765ec59a2304b011d81e3454" ]
[ "pattern/algorithms/nets/ed.py" ]
[ "# Copyright (c) 2021, Xu Chen, FUNLab, Xiamen University\n# All rights reserved.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass EncoderDecoder(nn.Module):\n def __init__(self, n_in_chs, n_out_chs, ):\n super(EncoderDecoder, self).__init__()\n self.n_in_chs = n_in...
[ [ "torch.nn.Conv2d", "torch.nn.ConvTranspose2d", "torch.nn.MaxPool2d" ] ]
eth-sri/ACE
[ "62db57971184ced80777771a5b0e88ab1d0562cf" ]
[ "utils.py" ]
[ "import numpy as np\nimport torch\nimport torchvision\nimport matplotlib.pyplot as plt\nimport pickle\nfrom scipy.stats import norm\n\nimport re\nimport json\nimport os\nfrom layers import Linear, Conv2d\nfrom networks import FFNN, ConvMedBig, MyResnet, myNet, EfficientNet\nfrom itertools import combinations\nfrom...
[ [ "numpy.array", "scipy.stats.norm.ppf", "torch.FloatTensor", "numpy.mean", "numpy.power", "torch.load", "torch.randn", "numpy.floor" ] ]
Remember2018/tensorpack
[ "395a5add9196e7362cd1b48cc210f5ee5e339424" ]
[ "tensorpack/train/trainers.py" ]
[ "# -*- coding: utf-8 -*-\n# File: trainers.py\n\nimport sys\nimport os\nimport tensorflow as tf\nimport multiprocessing as mp\n\nfrom ..callbacks import RunOp, CallbackFactory\nfrom ..tfutils.sesscreate import NewSessionCreator\n\nfrom ..utils import logger\nfrom ..utils.argtools import map_arg\nfrom ..utils.develo...
[ [ "tensorflow.name_scope" ] ]
tokaho/MIDI-BERT
[ "16d683830d817fd94897c67c1431ef98118cfbb5", "16d683830d817fd94897c67c1431ef98118cfbb5", "16d683830d817fd94897c67c1431ef98118cfbb5" ]
[ "MidiBERT/CPProgram/finetune.py", "MidiBERT/CPProgram/.ipynb_checkpoints/main-checkpoint.py", "MidiBERT/CP/trainer.py" ]
[ "import argparse\nimport numpy as np\nimport pickle\nimport os\nimport random\n\nfrom torch.utils.data import DataLoader\nimport torch\nfrom transformers import BertConfig\n\nfrom model import MidiBert\nfrom finetune_trainer import FinetuneTrainer\nfrom finetune_dataset import FinetuneDataset\n\nfrom matplotlib imp...
[ [ "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "torch.manual_seed", "torch...
avdmitry/rl_3d
[ "bf2645b104bfe1087d766e833f28a5f141b21f0e" ]
[ "agent_a3c.py" ]
[ "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport numpy as np\nimport cv2\nimport tensorflow as tf\nimport threading\nimport sys\nimport time\nimport os\n\ndef MakeDir(path):\n try:\n os.makedirs(path)\n except:\n pass\n\nlab = False\nload_model = False\ntrain = True\ntes...
[ [ "numpy.random.choice", "tensorflow.contrib.layers.fully_connected", "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow.contrib.layers.conv2d", "tensorflow.reshape", "tensorflow.gradients", "tensorflow.one_hot", "tensorflow.contrib.layers.flatten", "tensorflow.global_variables_...
joshualy/numerical_computing
[ "9f474e36fe85ae663bd20e2f2d06265d1f095173" ]
[ "Vol1A/QR2-LeastSquares/plots.py" ]
[ "# plots.py\n\"\"\"Volume 1A: QR 2 (Least Squares and Computing Eigenvalues). Plotting file.\"\"\"\nfrom __future__ import print_function\nimport matplotlib\nmatplotlib.rcParams = matplotlib.rc_params_from_file('../../matplotlibrc')\n\nfrom matplotlib import pyplot as plt\nfrom functools import wraps\nfrom sys impo...
[ [ "numpy.sin", "numpy.ones_like", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.rc_params_from_file", "numpy.random.randn", "scipy.stats.linregress", "numpy.load", "scipy.linalg.lstsq", "matplotlib.pyplot.close", "numpy...
farchanHakimRaswa/ssdDataset
[ "0f39883bd305da1776c911d1237977fe8efcb6b1" ]
[ "xml_to_csv.py" ]
[ "\"\"\"\nUsage:\n# Create train data:\npython xml_to_csv.py -i [PATH_TO_IMAGES_FOLDER]/train -o [PATH_TO_ANNOTATIONS_FOLDER]/train_labels.csv\n\n# Create test data:\npython xml_to_csv.py -i [PATH_TO_IMAGES_FOLDER]/test -o [PATH_TO_ANNOTATIONS_FOLDER]/test_labels.csv\n\"\"\"\n\nimport os\nimport glob\nimport pandas ...
[ [ "pandas.DataFrame" ] ]
Renovamen/alkaid
[ "78bb19c3d18856234dec9444235b749c6006655f" ]
[ "alkaid/net/qnet.py" ]
[ "import torch\nimport torch.nn as nn\nfrom typing import Union, Sequence\n\nfrom .backbone import MLP\n\nclass QNet(nn.Module):\n \"\"\"\n A simple network for DQN and its variants.\n\n Parameters\n ----------\n state_dim : int\n Dimension of state space\n\n action_dim : int\n Dimens...
[ [ "torch.nn.ReLU", "torch.softmax" ] ]
ZhunYin1652/VIN-for-CSPP
[ "5d8e0b4e30601631aa5c8b0b6dac452067cd75cf" ]
[ "test_LP_History.py" ]
[ "import sys\nimport argparse\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nimport numpy as np\n\nimport torch\nfrom torch.autograd import Variable\n\nfrom dataset.dataset import *\nfrom utility.utils import *\nfrom model_History import *\n\nfrom domains.gridworld_LP import *\nfrom generators.obstacle...
[ [ "torch.zeros", "numpy.concatenate", "torch.cat", "numpy.int", "numpy.zeros", "torch.autograd.Variable", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.waitforbuttonpress", "torch.cuda.is_available", "matplotlib.pyplot.draw", "numpy.rando...
zahraghh/DES_weather_analysis
[ "2c876d7207b6f6e24d906fe0d5ca6d15db036d82" ]
[ "DES_weather_analysis/selecting_buildings.py" ]
[ "import pandas as pd\r\nimport csv\r\nimport math\r\nimport datetime as dt\r\nimport os\r\nimport sys\r\nimport csv\r\nimport statistics\r\nimport matplotlib.pyplot as plt\r\nfrom sko.GA import GA\r\n\r\ndef selecting_buildings_EP(path_test):\r\n editable_data_path =os.path.join(path_test, 'editable_values.csv')...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.rc", "pandas.read_csv" ] ]