repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
jec34/molecool
[ "7c47a568c4964a851c026b667aa7fe12d99128d2" ]
[ "molecool/tests/test_molecule.py" ]
[ "\"\"\"\nTests for the molecule module\n\"\"\"\nimport molecool\nimport pytest\nimport numpy as np\n\ndef test_molecular_mass():\n symbols = ['C', 'H', 'H', 'H', 'H']\n\n calculated_mass = molecool.calculate_molecular_mass(symbols)\n\n actual_mass = 16.04\n\n assert pytest.approx(actual_mass, abs=1e-2) ...
[ [ "numpy.array", "numpy.array_equal" ] ]
astutespruce/sarp-connectivity
[ "d2f80c1de6cb0ac35ae35c9023d8bf482684b026" ]
[ "analysis/export/summarize.py" ]
[ "from pathlib import Path\n\nimport pandas as pd\nfrom openpyxl.styles import Alignment, NamedStyle\nfrom openpyxl.utils import get_column_letter\n\nfrom api.constants import DOMAINS\n\nprimary_col_style = NamedStyle(\n name=\"PrimaryColumnStyle\", alignment=Alignment(horizontal=\"left\", wrap_text=True)\n)\n\n\...
[ [ "pandas.crosstab", "pandas.DataFrame", "pandas.ExcelWriter", "pandas.read_feather" ] ]
acured/nni
[ "03ff374189837d28d98c3e0a14ea248d9a231f82" ]
[ "test/ut/retiarii/test_strategy.py" ]
[ "import random\nimport time\nimport threading\nfrom typing import *\n\nimport nni.retiarii.execution.api\nimport nni.retiarii.nn.pytorch as nn\nimport nni.retiarii.strategy as strategy\nimport torch\nimport torch.nn.functional as F\nfrom nni.retiarii import Model\nfrom nni.retiarii.converter import convert_to_graph...
[ [ "torch.jit.script", "torch.nn.functional.max_pool2d", "torch.nn.functional.log_softmax" ] ]
yohokuno/dl4nlp
[ "818db943835195397cd999e98806cabdc3499c19" ]
[ "dl4nlp/word2vec.py" ]
[ "import numpy as np\nfrom dl4nlp.utilities import softmax\n\n\ndef softmax_cost_gradient(parameters, input, output):\n \"\"\"\n Softmax cost and gradient function for word2vec models\n :param parameters: word vectors for input and output (shape: (2, vocabulary_size, vector_size))\n :param input: index t...
[ [ "numpy.array", "numpy.zeros_like", "numpy.log" ] ]
krishna-bala/gym-collision-avoidance
[ "a4dc1284d602808f3f96a25871327f7b2b4c4040" ]
[ "gym_collision_avoidance/envs/agent.py" ]
[ "import numpy as np\nfrom gym_collision_avoidance.envs import Config\nfrom gym_collision_avoidance.envs.util import wrap, find_nearest\nimport operator\nimport math\n\nclass Agent(object):\n \"\"\" A disc-shaped object that has a policy, dynamics, sensors, and can move through the environment\n\n :param start...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.empty", "numpy.dot", "numpy.zeros", "numpy.sin", "numpy.ones", "numpy.roll", "numpy.arctan2", "numpy.cos", "numpy.linalg.inv" ] ]
rajflume/tf-quant-finance
[ "5cb9474f6f2e74617735d38ef26aaef28ce69aff" ]
[ "tf_quant_finance/models/__init__.py" ]
[ "# Lint as: python3\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.python.util.all_util.remove_undocumented" ] ]
zacc23/freevirgil
[ "9099b1447dd764f8bb0f6c32cbb3b6bedf135920" ]
[ "examples/plot.py" ]
[ "import math\nimport freevirgil as fv\nfrom matplotlib import pyplot as plt\n\nspin = fv.spin_conf(N=10)\nham = fv.hamiltonian(J=-2, mu=1.1)\n\nirange = 100\nT = [0] * irange\nE = [0] * irange\nM = [0] * irange\nHC = [0] * irange\nMS = [0] * irange\n\nfor i in range(0, irange):\n\n T[i] = 0.1 * (i + 1)\n E[i]...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure" ] ]
vmarkovtsev/ml
[ "22699b2f44901b84507d15e732003955024e6755" ]
[ "sourced/ml/algorithms/id_splitter/features.py" ]
[ "import logging\nimport string\nimport tarfile\nfrom typing import List, Tuple\n\nfrom modelforge.progress_bar import progress_bar\nimport numpy\n\n\ndef read_identifiers(csv_path: str, use_header: bool, max_identifier_len: int, identifier_col: int,\n split_identifier_col: int, shuffle: bool = T...
[ [ "numpy.random.shuffle" ] ]
iCarrrot/Evol-algs
[ "51a51f9a0c7bca3731097160c40a96a7f40fa8f5" ]
[ "2/SGA.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport time\nfrom MutationLocalSearch import mutation_local_search\n\n\ndef SGA(\n population_size,\n chromosome_length,\n number_of_offspring,\n crossover_probability,\n mutation_probability,\n number_of_iterations,\n tsp_objective_function...
[ [ "numpy.mod", "numpy.random.choice", "numpy.zeros", "numpy.random.permutation", "numpy.ones", "numpy.min", "numpy.random.random", "numpy.argsort", "numpy.hstack", "numpy.vstack" ] ]
seansegal/fastMRI
[ "44ebd517d792c5f6e66c64c004d0e0603057e7e1" ]
[ "models/sensitivity/espirit.py" ]
[ "# Uecker, M., Lai, P., Murphy, M. J., Virtue, P., Elad, M., Pauly, J. M., ... & Lustig, M. (2014). ESPIRiT—an eigenvalue approach to autocalibrating parallel MRI: where SENSE meets GRAPPA. Magnetic resonance in medicine, 71(3), 990-1001.\n# https://github.com/mikgroup/espirit-python\nimport numpy as np\n\nfft = l...
[ [ "numpy.reshape", "numpy.zeros", "numpy.sum", "numpy.fft.ifftshift", "numpy.shape", "numpy.linalg.svd", "numpy.sqrt" ] ]
DDTR/learning_task2
[ "3a235edb6515d1c83dee996d90df7da11661fb61" ]
[ "retrain_proc/example/mlp_policy.py" ]
[ "from baselines.common.mpi_running_mean_std import RunningMeanStd\nimport baselines.common.tf_util as U\nimport tensorflow as tf\nimport gym\nfrom baselines.common.distributions import make_pdtype\nimport numpy as np\nimport pdb\n\n# almost same parametrization of NN policies as in functioning_implementations/own_a...
[ [ "tensorflow.zeros_initializer", "numpy.array", "tensorflow.zeros", "tensorflow.concat", "tensorflow.nn.relu", "numpy.sum", "tensorflow.matmul", "tensorflow.constant", "tensorflow.variable_scope", "tensorflow.clip_by_value", "tensorflow.placeholder", "numpy.amax", ...
jungomi/swiss-language-model
[ "d071598b63c6f9d261dbcf056c0249b00bce1823" ]
[ "evaluate.py" ]
[ "import argparse\nimport multiprocessing\nimport os\nimport time\nfrom collections import OrderedDict\nfrom typing import Dict\n\nimport lavd\nimport torch\nimport torch.distributed as dist\nimport torch.multiprocessing as mp\nimport torch.nn as nn\nfrom torch.nn.parallel import DistributedDataParallel\nfrom torch....
[ [ "torch.device", "torch.distributed.init_process_group", "torch.distributed.all_gather", "torch.multiprocessing.spawn", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.current_device", "torch.cuda.set_device", "torch.c...
JCSDA-internal/pycrtm
[ "fbad865c3c369c8454944790949e5e19172767f0" ]
[ "testCases/test_atms_threads.py" ]
[ "#!/usr/bin/env python3\nimport os, h5py, sys \nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom pyCRTM import pyCRTM, profilesCreate\n \ndef main(sensor_id):\n thisDir = os.path.dirname(os.path.abspath(__file__))\n casesIn = os.listdir( os.path.join(thisDir,'data') )\n casesIn.sort()\n ca...
[ [ "numpy.asarray", "numpy.zeros", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.linspace" ] ]
archer2balls/Practice
[ "77301e3203a1fe01c850f38b9eb5eac1dec28fe0" ]
[ "StockWebApp.py" ]
[ "#Description: Stock market dashboard to show some charts and data on some stock\n\n#Import the libraries\nimport streamlit as st\nimport pandas as pd\nfrom PIL import Image\n\n#Add a title and an image\nst.write(\"\"\"\n#Stock Market Web Application\n**Visually** show data on a stock! Date range from Jan 01, 2020 ...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.read_csv", "pandas.DatetimeIndex" ] ]
dymbe/ad-versarial
[ "8fd46cd198baff03f11a5202e27e9a602bd3bb08" ]
[ "page-based/data-collection/generator.py" ]
[ "#! /usr/bin/env python3\n\nfrom skimage import draw, transform, util, filters, color, io\nimport math\nfrom io import BytesIO\nimport os\nimport argparse\nimport hashlib\nimport json\nimport random\nimport numpy as np\nimport threading\nimport concurrent.futures\nimport sys\n\nimport logging\nlogger = logging.getL...
[ [ "numpy.append", "numpy.clip" ] ]
TaeMiKim/Siamusic
[ "d529b098588bd361d978239169684e2a071bea11" ]
[ "augmentation.py" ]
[ "'''\ninput : torch.tensor() (16,1,48000)\noutput : augmented audio tensor\n'''\nimport pedalboard\nimport random\nimport time\nfrom utils import listen\nfrom dataset import MTA, GTZAN\nimport torch\nfrom torch.utils.data import DataLoader\nimport numpy as np\nfrom pedalboard import (Pedalboard, \n ...
[ [ "torch.tensor", "torch.utils.data.DataLoader" ] ]
JunzuoWan/Add-subtraction-multiplication-and-division
[ "eccad7adf0068e322c52c51ce87ad2f6a8be4401" ]
[ "tfLinearRegressionBest.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Apr 2 10:21:56 2018\r\n\r\n@author: J.Wan\r\n\"\"\"\r\n\r\n#linear regression\r\n##linear regression: find the linear fit to generated data\r\n\r\nfrom __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\...
[ [ "numpy.random.normal", "tensorflow.multiply", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "tensorflow.Session", "numpy.random.randn", "matplotlib.pyplot.figure", "tensorflow.placeholder", "matplotlib.pypl...
kenchan0226/AbsThenExtPublic
[ "567811d6c76fe51c2c368eeaca1761eb322db2a2" ]
[ "model/copy_cond_summ.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import init\nfrom torch.nn import functional as F\n\nfrom .attention import step_attention\nfrom .util import sequence_mean, len_mask\nfrom .copy_summ import CopySumm, CopyLSTMDecoder\nfrom . import beam_search as bs\nfrom .rnn import lstm_encoder\n\n\nclass CopyCo...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.stack", "torch.nn.Tanh", "torch.mm", "torch.matmul", "torch.LongTensor", "torch.nn.init.xavier_normal_", "torch.Tensor" ] ]
phetdam/npy_openblas_demo
[ "ff5f9932b19f82162bc0d9d46b341d42805f942b" ]
[ "npypacke/regression/tests/conftest.py" ]
[ "\"\"\"pytest test fixtures for regression.tests subpackage.\n\n.. codeauthor:: Derek Huang <djh458@stern.nyu.edu>\n\"\"\"\n\nimport numpy as np\nimport pytest\nfrom sklearn.datasets import make_regression\n\n# pylint: disable=no-name-in-module\nfrom .._linreg import LinearRegression\n\n\n@pytest.fixture\ndef lr_de...
[ [ "numpy.linalg.svd", "numpy.array", "numpy.linalg.matrix_rank", "sklearn.datasets.make_regression" ] ]
SirPopiel/IWDA
[ "5693b0704f1abf9f69f92fba243599c5f4056a3c" ]
[ "Examples/Electricity_test.py" ]
[ "from skmultiflow.meta import AdaptiveRandomForestRegressor\nfrom skmultiflow.trees import HoeffdingAdaptiveTreeRegressor, HoeffdingAdaptiveTreeClassifier\nfrom skmultiflow.evaluation import EvaluatePrequential\nfrom skmultiflow.data import DataStream\nfrom src.Environment import *\nfrom sklearn.linear_model import...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc", "matplotlib.pyplot.margins", "matplotlib.pyplot.ylabel" ] ]
JoleProject/Jole
[ "24739e6d9a28840acccbb531de415a5ef0eea0c8" ]
[ "src/garage/tf/algos/jole_ddpg_v1.py" ]
[ "\"\"\"Deep Deterministic Policy Gradient (DDPG) implementation in TensorFlow.\"\"\"\nfrom collections import deque\n\nfrom dowel import logger, tabular\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib as tc\nimport random\nfrom garage.misc.overrides import overrides\nfrom garage.np.algos.off...
[ [ "numpy.concatenate", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.squared_difference", "numpy.max", "numpy.sum", "tensorflow.nn.moments", "numpy.mean", "numpy.std", "numpy.random.uniform", "tensorflow.name_scope", "numpy.abs", "numpy.clip", "tensorf...
jokfun/reservoirpy
[ "da978670a8a940847ad799ff0e92524dda873df0" ]
[ "minimalESN_MackeyGlass.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nA minimalistic Echo State Networks demo with Mackey-Glass (delay 17) data\nin \"plain\" scientific Python.\nby Mantas LukoÅ¡eviÄ?ius 2012\nhttp://minds.jacobs-university.de/mantas\n---\nModified by Xavier Hinaut: 2015-2016\nhttp://www.xavierhinaut.com\n\"\"\"\n#from numpy import *\...
[ [ "numpy.square", "numpy.dot", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "scipy.linalg.pinv", "numpy.eye", "numpy....
WorldChanger01/CORE_VAE
[ "702cc05f721b128ba219667b79357dcac88988ed" ]
[ "models/COREVAE.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\n\nimport math\n\nfrom scipy.misc import logsumexp\n\n\nimport torch\nimport torch.utils.data\nimport torch.nn as nn\nfrom torch.nn import Linear\nfrom torch.autograd import Variable\nfrom torch.nn.functional import normalize\n\nfrom utils.distributions i...
[ [ "torch.nn.Linear", "torch.nn.functional.normalize", "torch.nn.Dropout", "torch.max", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.Sigmoid", "torch.clamp", "numpy.prod", "torch.nn.Hardtanh", "torch.mean" ] ]
Seanforfun/Distributed-Tensorflow-Framework
[ "a765505a068104a997f021a6d0fead3377652053" ]
[ "distribute.py" ]
[ "# ====================================================\n# Filename: distribute.py\n# Author: Botao Xiao\n# Function: This is the entrance of the distributed training system.\n# We run the training program by calling this file.\n# ====================================================\nimport os\nimport sys...
[ [ "tensorflow.train.Server", "tensorflow.train.AdamOptimizer", "tensorflow.train.ClusterSpec", "tensorflow.FixedLenFeature", "tensorflow.app.run" ] ]
CapFreddy/BUAA-DL
[ "42be01f7a5d09e0336d0a3462f3e2d94131fedd1" ]
[ "svhn/Q4/regularizer.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numbers\n\nfrom tensorflow.python.framework import constant_op\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.ops import nn\nfro...
[ [ "tensorflow.python.ops.standard_ops.multiply", "tensorflow.python.ops.math_ops.abs", "tensorflow.python.platform.tf_logging.info", "tensorflow.python.framework.ops.convert_to_tensor", "tensorflow.python.framework.ops.name_scope" ] ]
ahmadghizzawi/quantify-unfairness-emd
[ "b4dfccfdf839387a048fa9a49227438a82ab47d0" ]
[ "disparity/helpers.py" ]
[ "import csv\nimport math\nimport time\nimport json\nimport numpy as np\nfrom beautifultable import BeautifulTable\nfrom pymongo import MongoClient\n\nclass Helper:\n def __init__(self,\n db_name=\"WorkerSet100K\",\n collection_name=\"workers\",\n configuration=\"tr...
[ [ "numpy.mean" ] ]
seanrsinclair/ORSuite
[ "54e05db3d6d34e60ce8982ef4e25eefdbe07b11e" ]
[ "or_suite/agents/ambulance/command_line_metric.py" ]
[ "import numpy as np\nimport sys\nfrom .. import Agent\n\nclass commandLineAgent(Agent):\n \"\"\"\n Allows the user to act as the agent by entering locations for each of the ambulances through the command line. Only works with the metric environment.\n \n Methods:\n reset() : clears data and call_...
[ [ "numpy.zeros" ] ]
mahnooranjum/UpperConfidenceBound_ReinforcementLearning
[ "4c242d6bb39821bb63db5e5e14df674eee7ba6d7" ]
[ "upper_confidence_bound.py" ]
[ "##############################################################################\n#\n# Mahnoor Anjum\n# manomaq@gmail.com\n# References:\n# SuperDataScience,\n# Official Documentation\n#\t Dataset by:\n#\t\thttps://www.kaggle.com/c/criteo-display-ad-challenge\n#################################...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
NamNguyen0905/FaceRecognition_MobileBio
[ "8a674906f6b4f12216cf72c37fd76d18cf628546" ]
[ "Nghia/get_landmarks.py" ]
[ "import dlib\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport cv2\r\nimport math\r\nimport os\r\nimport time\r\n\r\n#from pyimagesearch.helpers import convert_and_trim_bb\r\n\r\ndef distances(points):\r\n dist = []\r\n for i in range(points.shape[0]):\r\n for j in range(points.shape[0...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.imshow" ] ]
hauntsaninja/pytorch
[ "83b45fe1666fd8ecc697078ca99ff46dabe0286b" ]
[ "torch/ao/quantization/quantization_mappings.py" ]
[ "import copy\n\nimport torch\nfrom torch import nn\n\nimport torch.nn.functional as F\nimport torch.nn.intrinsic as nni\nimport torch.nn.intrinsic.quantized as nniq\nimport torch.nn.intrinsic.quantized.dynamic as nniqd\nimport torch.nn.intrinsic.qat as nniqat\nimport torch.nn.quantized as nnq\nimport torch.nn.quant...
[ [ "torch.ao.quantization.utils.get_combined_dict" ] ]
bilzard/Pedestrian-Synthesis-GAN
[ "adaf6efdf94ce99abf27bd613ade5d2722cfcd8a" ]
[ "models/pix2pix_model.py" ]
[ "import numpy as np\nimport torch\nimport os\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nimport util.util as util\nfrom util.image_pool import ImagePool\nfrom .base_model import BaseModel\nfrom copy import deepcopy\nfrom . import networks\nfrom PIL import Image\nimport torchvision.tra...
[ [ "torch.autograd.Variable", "torch.cat", "torch.nn.L1Loss" ] ]
DecodEPFL/eiv-grid-id
[ "093a0f6f3537ee2d4003b6af6a10caaca986fa7a", "093a0f6f3537ee2d4003b6af6a10caaca986fa7a" ]
[ "identify_network.py", "src/models/bayesian_prior.py" ]
[ "import click\nimport numpy as np\n\nfrom src.identification import run, run3ph\nimport conf.identification\nfrom conf import simulation\nfrom src.simulation.lines import admittance_phase_to_sequence, measurement_phase_to_sequence\n\n\n@click.command()\n@click.option('--network', \"-n\", default=\"bolognani56\", he...
[ [ "numpy.delete", "numpy.load", "numpy.any", "numpy.savez", "numpy.sqrt" ], [ "numpy.concatenate", "numpy.array", "numpy.ones_like", "numpy.zeros", "numpy.vstack" ] ]
xiaoxiaoheimei/SeqDialN
[ "0675a4e3737a2f849e273123330ad6fddbfb2fba" ]
[ "visdialch/attention/dense_att_enc.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom visdialch.utils import DynamicRNN_v2\nimport numpy as np\nimport pdb\n\nclass DenseCoAttLayer(nn.Module):\n '''\n This layer implements the image-feature/content-feature dense co-attention mechanisum proposed by:\n \"Improve...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.init.kaiming_uniform_", "torch.cat", "torch.nn.LSTM", "torch.arange", "torch.nn.init.constant_", "torch.nn.ReLU", "torch.LongTensor", "numpy.sqrt", "torch.matmul" ] ]
statisticalbiotechnology/exactpermutation
[ "fd8fbca9fedad7fbdfeb3c1e203f1aa35baa91b0" ]
[ "exp/cll/cll_scatter.py" ]
[ "import pandas as pd\nimport numpy as np\nimport numpy.random as rnd\nimport scipy.stats as stat\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport sys\nsys.path.append(\"../../src/\")\n\nfrom scatter_plots import *\n\ncll_data = pd.read_csv(\"eig_stat_cll.csv\", delimiter=\"\\t\")\nscatter_from_df(cl...
[ [ "pandas.read_csv" ] ]
SamuelSchmidgall/EvolutionarySelfReplication
[ "1a6f8225378b59423a97b439b56710bbed2754e9" ]
[ "evo_gym/vector/tests/test_vector_env.py" ]
[ "import pytest\nimport numpy as np\n\nfrom evo_gym.vector.tests.utils import make_env\n\nfrom evo_gym.vector.async_vector_env import AsyncVectorEnv\nfrom evo_gym.vector.sync_vector_env import SyncVectorEnv\n\n@pytest.mark.parametrize('shared_memory', [True, False])\ndef test_vector_env_equal(shared_memory):\n en...
[ [ "numpy.all" ] ]
omarmohamed15/Scalo_CAE
[ "7ca9d27b1e57be00a8b3817c5671fec211a9f8f5" ]
[ "Utils.py" ]
[ "from matplotlib.colors import ListedColormap\nimport h5py\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.io\nfrom sklearn.cluster import KMeans\nfrom sklearn.mixture import GaussianMixture\nfrom sklearn.cluster import MeanShift\nfrom scipy import ndimage, misc\nimport obspy\nfrom obspy.imaging....
[ [ "numpy.zeros_like", "sklearn.cluster.KMeans", "numpy.min", "matplotlib.pyplot.subplots", "numpy.shape", "numpy.mean", "numpy.where", "numpy.std", "numpy.arange", "numpy.sort", "numpy.abs" ] ]
rvencu/clip-retrieval
[ "6d77497a98aab323c0d2b259d83a7afa97902f85" ]
[ "clip_retrieval/clip_back.py" ]
[ "from flask import Flask, request, make_response\nfrom flask_restful import Resource, Api\nfrom flask_cors import CORS\nimport clip\nimport faiss\nimport torch\nimport json\nfrom PIL import Image\nfrom io import BytesIO\nfrom PIL import Image\nimport base64\nimport os\nimport fire\nfrom pathlib import Path\nimport ...
[ [ "pandas.DataFrame", "pandas.read_parquet", "torch.cuda.is_available" ] ]
nakul-shahdadpuri/sunpy
[ "e0555ae1c47749bf85cf5d58c0b38b731cd623eb" ]
[ "sunpy/map/mapbase.py" ]
[ "\"\"\"\nMap is a generic Map class from which all other Map classes inherit from.\n\"\"\"\nimport copy\nimport html\nimport textwrap\nimport warnings\nimport webbrowser\nfrom io import BytesIO\nfrom base64 import b64encode\nfrom tempfile import NamedTemporaryFile\nfrom collections import namedtuple\n\nimport matpl...
[ [ "numpy.dot", "numpy.min", "numpy.cos", "numpy.ma.getdata", "numpy.deg2rad", "numpy.max", "numpy.sin", "matplotlib.pyplot.get_cmap", "numpy.flipud", "matplotlib.backend_bases.FigureCanvasBase", "matplotlib.patches.Circle", "numpy.isfinite", "matplotlib.pyplot.sci...
wh3248/pf-xarray
[ "f971e0c3e9962958fcf807e45d2623a0784cba8c" ]
[ "pf_xarray/io.py" ]
[ "from collections.abc import Iterable\nimport itertools\nfrom numba import jit\nimport numpy as np\nimport struct\nfrom typing import Mapping, List, Union\nfrom numbers import Number\nfrom pprint import pprint\n\n\ndef read_pfb(file: str, mode: str='full', z_first: bool=True):\n \"\"\"\n Read a single pfb fil...
[ [ "numpy.max", "numpy.concatenate", "numpy.array", "numpy.empty", "numpy.flatnonzero", "numpy.min", "numpy.prod", "numpy.arange", "numpy.all", "numpy.hstack", "numpy.floor" ] ]
ygan/IRNet
[ "d52b1f3a72624dbe3146a587dbfae74fa19b0a24" ]
[ "eval.py" ]
[ "# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT license.\r\n\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\n# @Time : 2019/5/27\r\n# @Author : Jiaqi&Zecheng\r\n# @File : eval.py\r\n# @Software: PyCharm\r\n\"\"\"\r\n\r\n\r\nimport torch\r\nfrom src import args as arg\r\nfrom src import utils\r\nf...
[ [ "torch.load" ] ]
weselyj/jesse
[ "24ce05c17494b6ac7b4201cf06b4fa9d16d4d709" ]
[ "jesse/modes/optimize_mode/fitness.py" ]
[ "\"\"\"\nFor the multiprocessing to work property, it's best to pass around pure functions into workers instead\nof methods of a class. Below functions have been designed with that in mind.\n\"\"\"\nfrom math import log10\nimport jesse.helpers as jh\nfrom jesse.research.backtest import _isolated_backtest as isolate...
[ [ "numpy.isnan" ] ]
ayandeephazra/Chemical_Origins_Of_Life
[ "5858b51063c53b2db00529fe79a67d321193171e" ]
[ "Approach 1/Model that was derived from reactions and had all relevant terms/forwardSimulation.py" ]
[ "from scipy.integrate import solve_ivp\nimport numpy as np\nfrom ode_helpers import state_plotter\n\n\ndef f(t, y, model1, model2):\n dydt = [1]\n for i in range(len(model1.equations())):\n\n sumT = 0\n string = model1.equations()[i]\n listOfWords = string.split()\n # print(listOfW...
[ [ "numpy.linspace" ] ]
deimqs/ClusterModel
[ "a073ffff012ad3404acd9ce12396f63fe7e81109" ]
[ "ClusterTools/cluster_xspec.py" ]
[ "\"\"\"\nThis script contains Xspec tools.\nIt requires to have xspec installed on your machine.\n\n\"\"\"\n\nimport os\nimport re\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom ClusterModel.ClusterTools import map_tools\n\n\n#==================================================\n# Get the hydrogen colu...
[ [ "numpy.zeros", "numpy.median", "matplotlib.pyplot.xlabel", "numpy.roll", "matplotlib.pyplot.figure", "numpy.std", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "numpy.log10", "matplotlib.pyplot.show", "numpy.linspace" ] ]
matteobarato/Upsampling_Vocoder
[ "f7659bee8c89223fe9c13e9cb39cb683acd2fc7f" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\n\nclass LinearNorm(torch.nn.Module):\n def __init__(self, in_dim, out_dim, bias=True, w_init_gain='linear'):\n super(LinearNorm, self).__init__()\n self.linear_layer = torch.nn.Linear(in_dim, out_dim, bias=...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.nn.ConvTranspose1d", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.BatchNorm1d", "torch.nn.init.calculate_gain" ] ]
pawelkobojek/pytorch-lightning-bolts
[ "2f3f58045a44ffb32103a3644c2ee2be920a508b", "2f3f58045a44ffb32103a3644c2ee2be920a508b" ]
[ "pl_bolts/datamodules/kitti_datamodule.py", "pl_bolts/models/self_supervised/moco/moco2_module.py" ]
[ "import os\n\nimport torch\nimport torchvision.transforms as transforms\nfrom pytorch_lightning import LightningDataModule\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.dataset import random_split\n\nfrom pl_bolts.datasets.kitti_dataset import KittiDataset\n\n\nclass KittiDataModule(LightningDataM...
[ [ "torch.Generator", "torch.utils.data.DataLoader" ], [ "torch.zeros", "torch.nn.functional.normalize", "torch.cat", "torch.nn.Linear", "torch.distributed.get_world_size", "torch.einsum", "torch.no_grad", "torch.argsort", "torch.distributed.all_gather", "torch.ran...
Pakketeretet2/lammps-tools
[ "1e2109018a7412c33c80bb3eceb1f97003495341" ]
[ "python/lammpstools/normal_mode_analysis.py" ]
[ "\"\"\"!\nThis module contains some normal mode analysis tools\n\n\\ingroup lammpstools\n\"\"\"\n\nimport dumpreader\nimport lammpstools\nimport numpy as np\nimport scipy\nimport sys, os\nimport math\nfrom typecasts import *\nfrom ctypes import *\n\n\nfrom multiprocessing import Process\n\ndef normal_mode_analysis(...
[ [ "numpy.linspace", "numpy.linalg.eig", "numpy.zeros" ] ]
AlexTintin/Face_Recognition_CV_Project
[ "6becb159dd3d8f547d617983bd422e3f2a9fb52e" ]
[ "correlationmodel.py" ]
[ "\nimport argparse\nimport os\nimport sys\nimport torch as t\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.autograd import Variable\nfrom torchvision import models, transforms\n\nimport numpy as np\n\nnormalize = transforms.Normalize(\n mean=[0.485, 0.456, 0.406],\n std=[0.229, 0.224, 0....
[ [ "torch.autograd.Variable", "torch.stack", "torch.nn.functional.conv2d" ] ]
CryptoBerryBot/Okapi
[ "3e58c159b488ae5c1eebe383e6ea8185d80dd912" ]
[ "src/okapi/api/market.py" ]
[ "# Copyright 2022 Romain Brault\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to...
[ [ "pandas.to_datetime", "pandas.DataFrame", "numpy.asarray", "pandas.DataFrame.from_dict" ] ]
ceavelasquezpi/neuralnilm
[ "184b2301333e49828d29064c59496f82c89dcbad" ]
[ "neuralnilm/trainer.py" ]
[ "from __future__ import print_function, division\nfrom functools import partial\nimport os\nimport shutil\nfrom copy import copy\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport theano\nfrom time import time\nfrom pymongo import MongoClient\n\nfrom lasagne.updates import nesterov_mo...
[ [ "numpy.isnan", "matplotlib.pyplot.savefig", "pandas.DataFrame", "numpy.ones", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots" ] ]
dham/sum_factorisation_scaling_tests
[ "abe90cd92725224a2695bbc30f9a74c57bbdb68e" ]
[ "plot.py" ]
[ "import pylab as plt\nimport json\nimport numpy as np\n\ndataset = json.load(file(\"data.json\", \"r\"))\n\nscaling = {\"matrix\": lambda dim: 2 * dim + 1,\n \"action\": lambda dim: dim + 1}\n\n\nfor dim in (2, 3):\n for operation, data in dataset[str(dim)].iteritems():\n\n plt.figure()\n\n ...
[ [ "numpy.array" ] ]
dhermes/foreign-fortran
[ "725d39b243fdf379dec4ce37a53e9e9b0b98c5a0" ]
[ "cython/check_cython.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\n\nfrom check_ctypes import MAKE_UDF_TEMPLATE\nfrom check_ctypes import SEPARATOR\nimport example\n\n\ndef main():\n print(SEPARATOR)\n # foo()\n bar = 1.0\n baz = 16.0\n quux = example.foo(bar, baz)\n print(\"quux = foo({}, {}) = {}\".f...
[ [ "numpy.asfortranarray" ] ]
pedro-abundio-wang/image-classification
[ "952719d7561b9998add0daf71d61e55cb6103eaf" ]
[ "vision/image_classification/inception/inceptionV1_model.py" ]
[ "\"\"\"GoogLeNet model for Keras.\n\nRelated papers:\n- https://arxiv.org/abs/1409.4842\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom tensorflow.keras import backend\nfrom tensorflow.keras import models\nfrom tensorflow.keras impo...
[ [ "tensorflow.keras.layers.Permute", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Activation", "tensorflow.keras.backend.image_data_format", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers....
mbbroberg/SEODeploy
[ "5de0c3f8f3658638128445e78854e6a6e2daa8cf" ]
[ "src/seodeploy/lib/__init__.py" ]
[ "#! /usr/bin/env python\n# coding: utf-8\n#\n# Copyright (c) 2020 JR Oakes\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the...
[ [ "pandas.DataFrame" ] ]
cew8/mcf
[ "c71a3de528e418db5539eefbcb980877cafc824e" ]
[ "mcf/mcf_iate_functions.py" ]
[ "\"\"\"\nProcedures needed for IATE estimation.\n\nCreated on Thu Dec 8 15:48:57 2020.\n\n@author: MLechner\n\n# -*- coding: utf-8 -*-\n\"\"\"\nfrom concurrent import futures\nimport numpy as np\nimport pandas as pd\nfrom sklearn.cluster import KMeans\nfrom sklearn.metrics import silhouette_score\nimport scipy.stat...
[ [ "numpy.median", "numpy.copy", "numpy.mean", "numpy.size", "pandas.concat", "pandas.read_csv", "numpy.concatenate", "numpy.count_nonzero", "numpy.empty", "pandas.set_option", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.sqrt", ...
gherbin/ComputerVisionKUL
[ "c1367c812007d4533aca24d0d09b06590c0193a5" ]
[ "assignment1/template_matching_test.py" ]
[ "import cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nimg = cv2.imread('D:/Videos/Test/image_test_template.png',0)\nimg2 = img.copy()\ntemplate = cv2.imread('D:/Videos/template_91_91.png',0)\nw, h = template.shape[::-1]\n\n# All the 6 methods for comparison in a list\nmethods = ['cv2.TM_CCOEFF', ...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.title", "matplotlib.pyplot.yticks", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks", "matplotlib.pyplot.imshow" ] ]
OctopusRice/LineNet
[ "a03ce3bf741dc497ae6bc680cd779128bda1a34b", "a03ce3bf741dc497ae6bc680cd779128bda1a34b" ]
[ "core/sample/cornernet.py", "core/test/linenet.py" ]
[ "import cv2\nimport math\nimport numpy as np\nimport torch\n\nfrom .utils import random_crop, draw_gaussian, gaussian_radius, normalize_, color_jittering_, lighting_\n\n\ndef _resize_image(image, detections, size):\n detections = detections.copy()\n height, width = image.shape[0:2]\n new_height, new_width ...
[ [ "numpy.random.uniform", "torch.from_numpy", "numpy.zeros", "numpy.clip" ], [ "numpy.concatenate", "numpy.array", "numpy.zeros", "torch.from_numpy", "torch.cuda.FloatTensor", "numpy.clip", "numpy.partition" ] ]
hymenoby/ucacity-image-classifier
[ "f84e822f10e4fb6a1d2b40861a7e5714caf4a0eb" ]
[ "train.py" ]
[ "import argparse\nimport errno\nimport sys\nimport time\nimport torch\nimport os\nimport utils\nfrom torchvision import models\nfrom torch import nn\nfrom torch import optim\n\n# get arguments\nparser = argparse.ArgumentParser(description=\"Training neural network\")\nparser.add_argument('data_directory', action='s...
[ [ "torch.nn.NLLLoss", "torch.device", "torch.no_grad", "torch.cuda.is_available" ] ]
JWTAmsterdam/RockTheRoad
[ "1806e44005dfe328dbe89df2edd8793333eed8ba" ]
[ "plot/plot.py" ]
[ "#very simple plotter for the csv data\n#this example works specifically for the ice.csv data\n#run on your terminal python plot.py\n#how to change data here\n\nfrom matplotlib import pyplot\nimport numpy as np\n\nall_data = np.loadtxt(open(\"data/sample.csv\",\"r\"),\n delimiter=\",\",\n skiprows=1,\n dty...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
gitter-badger/bokeh
[ "5481346de1642a4e6710d32b70262fd6c2674360" ]
[ "examples/embed/app_reveal.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport time\nfrom threading import Thread\n\nimport numpy as np\nimport scipy.special\n\nfrom bokeh.embed import autoload_server\nfrom bokeh.objects import Glyph\nfrom bokeh.plotting import (annular_wedge, curplot, cursession, figure, hold,\n legend, line, outp...
[ [ "numpy.random.normal", "numpy.zeros_like", "numpy.histogram", "numpy.sin", "numpy.roll", "numpy.exp", "numpy.cos", "numpy.sqrt", "numpy.linspace" ] ]
JoseALermaIII/lightkurve
[ "174eae6a6470f40a26eec67225f1d84238ea6670" ]
[ "lightkurve/mast.py" ]
[ "\"\"\"Functions which wrap `astroquery.mast` to obtain Kepler/K2 data from MAST.\"\"\"\n\nfrom __future__ import division, print_function\nimport os\nimport logging\nimport numpy as np\n\nfrom astroquery.mast import Observations\nfrom astroquery.exceptions import ResolverError\nfrom astropy.coordinates import SkyC...
[ [ "numpy.array", "numpy.asarray", "numpy.shape", "numpy.any", "numpy.where", "numpy.arange", "numpy.unique" ] ]
jianzhnie/d2nlp
[ "94da74ec9be3aeee699b358f6bba9fde43bd80c0" ]
[ "nlptoolkit/models/elmo/elmo_model.py" ]
[ "'''\nAuthor: jianzhnie\nDate: 2022-01-05 17:00:54\nLastEditTime: 2022-01-20 10:20:20\nLastEditors: jianzhnie\nDescription:\n\n'''\nimport os\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\n\nclass Highway(nn.Module...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.cat", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.max", "torch.arange", "torch.nn.functional.dropout", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.functional.relu" ] ]
Xuduoteng/ProblemJudgment
[ "cf6664f5b77c3b9defa30126b2db193d3cc8debd" ]
[ "image_process.py" ]
[ "import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom PIL import Image\n \n# img = cv2.imread(r'C:\\\\Users\\\\27466\\\\Desktop\\\\RECENT\\\\yolov5-streamlit-by-xdt-master\\\\yolov5-streamlit-by-xdt-master\\\\data\\\\images\\\\3.jpg', cv2.IMREAD_GRAYSCALE)#GRAYSCALE\n\ndef imageGray(uploaded_fil...
[ [ "numpy.round" ] ]
ForrestPi/3DfaceReconstruction
[ "d75a6f9112efc04f4912402835810f3e01d2a9f9" ]
[ "faceSwap/3DDFA/modules/Deep3DFaceReconstruction/preprocess_img.py" ]
[ "import numpy as np \nfrom scipy.io import loadmat,savemat\nfrom PIL import Image\n\n#calculating least sqaures problem\ndef POS(xp,x):\n\tnpts = xp.shape[1]\n\n\tA = np.zeros([2*npts,8])\n\n\tA[0:2*npts-1:2,0:3] = x.transpose()\n\tA[0:2*npts-1:2,3] = 1\n\n\tA[1:2*npts:2,4:7] = x.transpose()\n\tA[1:2*npts:2,7] = 1;...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.stack", "numpy.linalg.lstsq", "numpy.expand_dims" ] ]
scikit-maad/scikit-maad
[ "2052c6f5ffc2a973fa1676364cc1663d7da1715a" ]
[ "maad/sound/spectro_func.py" ]
[ "#!/usr/bin/env python\r\n\"\"\" \r\nCollection of functions transform an audio signal into spectrogram and \r\nmanipulate spectrograms.\r\n\"\"\"\r\n#\r\n# Authors: Juan Sebastian ULLOA <lisofomia@gmail.com>\r\n# Sylvain HAUPERT <sylvain.haupert@mnhn.fr>\r\n#\r\n# License: New BSD License\r\n\r\n# =====...
[ [ "numpy.max", "numpy.array", "scipy.signal.spectrogram", "numpy.asarray", "numpy.sum", "numpy.min", "numpy.mean", "numpy.arange", "numpy.sqrt", "numpy.ndim" ] ]
erichiggins/PyShoot
[ "f97dba8efecebb73c2cd7a04c29513dc8755c7da" ]
[ "PyShoot.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nimport math\nimport random\nimport functools\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.spatial import ConvexHull\n\n\n# Application bounds\nLOWER_CAL = 0.17\nUPPER_CAL = 0.5\nMIN_SHOTS = 3\nMAX_SHOTS = 100000\n\n# Default Application variables\nAC...
[ [ "numpy.random.normal", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.Circle", "scipy.spatial.ConvexHull", "matplotlib.pyplot.show", "matplotlib.pyplot.gca" ] ]
aztan2/charged-defects-framework
[ "db23be39f580bb110abe0b2a2fb5da415fb6a381" ]
[ "qdef2d/defects/corrections/alignment_correction_2d.py" ]
[ "import os\nimport time\nimport argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\nplt.switch_backend('agg')\nfrom qdef2d import logging\n\n\ndef calc(vref,vdef,encut,q,threshold_slope=1e-3,threshold_C=1e-3,max_iter=20,\n vfile='vline-eV.dat',noplots=False,allplots=False,logfile=None):\n \n ...
[ [ "matplotlib.pyplot.switch_backend", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.sign", "numpy.loadtxt", "numpy.polyfit", "matplotlib.pyplot.ylab...
RichardScottOZ/bluecap
[ "9d06de2fbdb60080d448287099d8b5621fb642d2" ]
[ "Actions/ComparativeSensitivityAction.py" ]
[ "\"\"\"\nCopyright (C) 2019-2021, Monash University, Geoscience Australia\nCopyright (C) 2018, Stuart Walsh \n\nBluecap is released under the Apache License, Version 2.0 (the \"License\");\nyou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://ww...
[ [ "numpy.array", "numpy.isnan", "numpy.abs", "numpy.moveaxis", "numpy.nanmax" ] ]
EPFL-VILAB/omnidata
[ "a1e31eb26172ecf8a3e49ba8a5c82ab3038a9c01" ]
[ "paper_code/omnidata_sasha_edits/transforms.py" ]
[ "import json\nimport numpy as np\nimport os\nfrom PIL import Image\nimport h5py\nimport torch\nfrom scipy.ndimage.filters import convolve\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom typing import Optional\n\nimport task_configs\n\n...
[ [ "numpy.square", "numpy.array", "numpy.uint8", "scipy.ndimage.filters.convolve", "numpy.minimum", "numpy.ones", "numpy.load", "numpy.sqrt", "torch.Tensor", "numpy.expand_dims" ] ]
Shigangli/dace
[ "966365a572921a6916737e4292e581e767873cf0" ]
[ "dace/symbolic.py" ]
[ "# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.\nimport ast\nfrom functools import lru_cache\nimport sympy\nimport pickle\nimport re\nfrom typing import Any, Dict, Optional, Set, Tuple, Union\nimport warnings\nimport numpy\n\nimport sympy.abc\nimport sympy.printing.str\n\nfrom dace impo...
[ [ "numpy.any", "numpy.int64" ] ]
shenao-zhang/DCPU
[ "0da9aa2b7878b54ba4ee4dca894c2e86cdc0d559" ]
[ "exps/util.py" ]
[ "\"\"\"Utilities for GP-UCRL experiments.\"\"\"\nfrom itertools import chain\n\nimport gpytorch\nimport numpy as np\nimport torch\nimport torch.jit\nimport torch.nn as nn\nimport torch.optim as optim\nimport yaml\nfrom rllib.algorithms.mpc import CEMShooting, MPPIShooting, RandomShooting\nfrom rllib.model import Ab...
[ [ "torch.zeros", "torch.tensor", "torch.abs" ] ]
TheScientist1900/Faster-rcnn-helmet-detection
[ "48485716e47bd80788d05b00d7f24a9f234571c7", "48485716e47bd80788d05b00d7f24a9f234571c7" ]
[ "utils/utils.py", "nets/vgg16.py" ]
[ "import logging\nimport pathlib\nimport time\nimport numpy as np\nfrom PIL import Image\nimport cv2\nimport os\n\nfrom tqdm import tqdm\n#---------------------------------------------------------#\n# 将图像转换成RGB图像,防止灰度图在预测时报错。\n# 代码仅仅支持RGB图像的预测,所有其它类型的图像都会转化成RGB\n#-------------------------------------------------...
[ [ "numpy.shape" ], [ "torch.nn.Linear", "torch.nn.Dropout", "torch.flatten", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.init.normal_...
nickpezzotti1/IIC3
[ "9edd27b28d2bddec4c3979ea4591380f5c411c8e" ]
[ "code1/utils/cluster/eval_metrics.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\nimport torch\nfrom sklearn import metrics\nfrom sklearn.utils.linear_assignment_ import linear_assignment\n\n\ndef _original_match(flat_preds, flat_targets, preds_k, targets_k):\n # map each output channel to the best matching ground truth (many to one)...
[ [ "sklearn.utils.linear_assignment_.linear_assignment", "sklearn.metrics.adjusted_rand_score", "sklearn.metrics.normalized_mutual_info_score", "numpy.zeros" ] ]
chebee7i/ipython
[ "85b169fa3afc3d374973295c7f1409ededddbaca" ]
[ "IPython/kernel/zmq/eventloops.py" ]
[ "# encoding: utf-8\n\"\"\"Event loop integration for the ZeroMQ-based kernels.\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (C) 2011 The IPython Development Team\n\n# Distributed under the terms of the BSD License. The full license is in\n# the file COP...
[ [ "matplotlib.backends.backend_macosx.show.mainloop", "matplotlib.backends.backend_macosx.TimerMac" ] ]
Sooner0931/pymc3
[ "458e513e47ed764c1ec4efcfce50ea7bd9fefbfd" ]
[ "pymc3/theanof.py" ]
[ "# Copyright 2020 The PyMC Developers\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 appli...
[ [ "numpy.array", "numpy.ones", "numpy.asarray" ] ]
IcarusWizard/monodepth-paddle
[ "ccd616b4416903fcff874d54888f34528a2275bb" ]
[ "eval/evaluate_kitti.py" ]
[ "import numpy as np\nimport cv2\nimport argparse\nfrom tqdm import tqdm\nfrom evaluation_utils import *\n\nparser = argparse.ArgumentParser(description='Evaluation on the KITTI dataset')\nparser.add_argument('--split', type=str, help='data split, kitti or eigen', required=True)\nparser.add_a...
[ [ "numpy.isinf", "numpy.array", "numpy.zeros", "numpy.load", "numpy.logical_and", "numpy.abs" ] ]
HPLegion/glue
[ "1843787ccb4de852dfe103ff58473da13faccf5f" ]
[ "glue/core/data_factories/tests/test_fits.py" ]
[ "import os\nfrom collections import namedtuple\nfrom copy import deepcopy\n\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_array_equal\n\nfrom glue.core import data_factories as df\n\nfrom glue.tests.helpers import requires_astropy, make_file\n\nfrom ..fits import fits_reader\n\n\nDATA = os.pa...
[ [ "numpy.array", "numpy.testing.assert_array_equal", "numpy.ones" ] ]
Xinfeng-Yao/APEC
[ "0596e2c8947fd9eb3b4cb5acee8d298ebbe8408a" ]
[ "code_v1.0.6/generate_umap.py" ]
[ "import sys,getopt,numpy,pandas,umap,scipy.stats\nfrom sklearn.decomposition import PCA\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n#\n#\ndef get_parameters(argv):\n project, cellinfo, rand_stat, norm_method = '', '', 0, 'zscore'\n help_info = ['Plot UMAP figure \\n',\n ...
[ [ "matplotlib.use", "numpy.array", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.where", "pandas.read_csv" ] ]
kirillbobyrev/crawlboy
[ "a34297951cdd58e2c594fe0d24e7bd972a792aab" ]
[ "misc/visualize_doc2vec.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom gensim.models.doc2vec import Doc2Vec\nfrom sklearn.manifold import TSNE\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import offsetbox\n\n\ndef plot_embedding(X, title=No...
[ [ "numpy.max", "numpy.array", "numpy.sum", "matplotlib.pyplot.title", "matplotlib.offsetbox.OffsetImage", "numpy.min", "sklearn.manifold.TSNE", "matplotlib.pyplot.figure", "matplotlib.pyplot.yticks", "matplotlib.pyplot.cm.Set1", "matplotlib.pyplot.xticks", "matplotlib...
DMGW-Goethe/imripy
[ "8e5c2fd2af539f00b4ea66a285d4ed276c8df7a1" ]
[ "src/imripy/merger_system.py" ]
[ "import numpy as np\nimport imripy.cosmo as cosmo\nimport imripy.halo as halo\n#from scipy.constants import G, c\n\n\nhz_to_invpc = 1.029e8\ns_to_pc = 9.716e-9\nm_to_pc = 3.241e-17\nsolar_mass_to_pc = 4.8e-14\ng_cm3_to_invpc2 = 7.072e8\nyear_to_pc = 0.3064\n\n\n\nclass SystemProp:\n \"\"\"\n A class describin...
[ [ "numpy.shape" ] ]
toccip/mnist_img_recog
[ "f304a3d4002248dc613d77db24d52b15923f9e99" ]
[ "neural_network.py" ]
[ "import numpy as np\nimport random\n\ndef sig(x):\n x = np.clip( x, -600, 600 )\n return 1.0 / (1.0 + np.exp(-x))\n \ndef sig_d(x):\n return sig(x) * (1.0 - sig(x))\n\n\ndef read_images(filename, data_size):\n img_data = list()\n with open(filename, 'rb') as f:\n f.read(4)\n img_num ...
[ [ "numpy.full", "numpy.dot", "numpy.empty", "numpy.random.randn", "numpy.exp", "numpy.subtract", "numpy.argmax", "numpy.clip" ] ]
NunoEdgarGub1/qiskit-toaster
[ "7981ccd073e06acce98309beac036ba8d8b71901" ]
[ "quantastica/qiskit_toaster/ToasterBackend.py" ]
[ "# This code is part of quantastica.qiskit_toaster\n#\n# (C) Copyright Quantastica 2019. \n# https://quantastica.com/\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.apac...
[ [ "numpy.random.RandomState" ] ]
arinachison/abides
[ "39356709ef5ee18be5f76b47ed90490865278a8b" ]
[ "cli/midpoint_plot.py" ]
[ "import ast\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport os\nimport sys\n\nfrom joblib import Memory\n\n# Auto-detect terminal width.\npd.options.display.width = None\npd.options.display.max_rows = 1000\npd.options.display.max_colwidth = 200\n\n# Initiali...
[ [ "matplotlib.use", "pandas.read_pickle", "matplotlib.pyplot.rcParams.update", "pandas.to_datetime", "pandas.date_range", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ] ]
GuillaumeLeclerc/armory
[ "c24928701b4ff6fc37cdb994ea784f9733a8e8da" ]
[ "tests/test_docker/test_metrics.py" ]
[ "\"\"\"\nTest cases for ARMORY datasets.\n\"\"\"\n\nimport json\n\nimport pytest\nimport numpy as np\n\nfrom armory.utils import metrics\n\n\ndef test_categorical_accuracy():\n y = [0, 1, 2, 3, 4]\n y_pred = [0, 1, 2, 2, 3]\n assert metrics.categorical_accuracy(y, y_pred) == [1, 1, 1, 0, 0]\n assert met...
[ [ "numpy.array", "numpy.zeros", "numpy.ones", "numpy.eye", "numpy.log10" ] ]
tyomj/linucrl
[ "8438330bdc20bacf5f985835c1d2e70aec6b00b8" ]
[ "lucrl/scripts/ml_to_df.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nimport yaml\nfrom tqdm import tqdm\nfrom joblib import Parallel, delayed\n\nproject_dir = os.path.normpath(os.path.dirname(os.path.abspath(__file__)) + os.sep + os.pardir)\n\nfrom lucrl.utils.coordinator import Coordinator\ncrd = Coordinator(project_dir)\n\nfrom ...
[ [ "numpy.stack", "pandas.concat" ] ]
afonit/bokeh
[ "37a9d6c81ed592d07effd0d3584befd0fc95b53c" ]
[ "examples/reference/models/Ray.py" ]
[ "import numpy as np\n\nfrom bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid\nfrom bokeh.models.glyphs import Ray\nfrom bokeh.io import curdoc, show\n\nN = 9\nx = np.linspace(-2, 2, N)\ny = x**2\nl = x*5 + 25\n\nsource = ColumnDataSource(dict(x=x, y=y, l=l))\n\nxdr = DataRange1d()\nydr = Da...
[ [ "numpy.linspace" ] ]
fred4li/NLP-theory-and-implementation
[ "84a484e4c5ff387f8ae626cc4a7e8d1db1aa621e" ]
[ "utils.py" ]
[ "import re\nimport string\nimport numpy as np\n\nfrom nltk.corpus import stopwords\nfrom nltk.stem import PorterStemmer\nfrom nltk.tokenize import TweetTokenizer\n\n\ndef process_tweet(tweet):\n \"\"\"Process tweet function.\n Input:\n tweet: a string containing a tweet\n Output:\n tweets_cle...
[ [ "numpy.squeeze", "numpy.zeros" ] ]
oricon/ciftify
[ "40eff619dd2ba047280cd19f24f5049f15597c7a" ]
[ "ciftify/bin/ciftify_seed_corr.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nProduces a correlation map of the mean time series within the seed with\nevery voxel in the functional file.\n\nUsage:\n ciftify_seed_corr [options] <func> <seed>\n\nArguments:\n <func> functional data (nifti or cifti)\n <seed> seed mask (nifti, cifti or g...
[ [ "numpy.zeros", "numpy.where", "numpy.std", "numpy.loadtxt", "numpy.arange", "numpy.intersect1d", "numpy.corrcoef" ] ]
peisuke/RANSAC-Flow
[ "2dab6708e6d025d2ef086e134f2353c246427c2e" ]
[ "utils/outil.py" ]
[ "import torch.nn.functional as F\nimport PIL.Image as Image \nimport torch \nimport numpy as np\n\ndef resizeImg(I, strideNet, minSize = 400, mode=Image.LANCZOS) :\n\n w, h = I.size\n ## resize img, the largest dimension is maxSize\n wratio, hratio = w / minSize, h / minSize\n resizeRatio = min(wratio, ...
[ [ "numpy.array", "torch.stack", "torch.argmax", "numpy.zeros", "numpy.reshape", "torch.any", "numpy.ones", "torch.transpose", "torch.det", "torch.randint", "numpy.linalg.lstsq", "numpy.linalg.svd", "torch.nn.functional.pad", "torch.mean", "torch.sum" ] ]
aapeebles/mod3_project
[ "5a6babf4b59d0ee303d38d88253613b089460e4d" ]
[ "data_cleaning.py" ]
[ "\"\"\"\nThis module is for your data cleaning.\nIt should be repeatable.\n\n## PRECLEANING\nThere should be a separate script recording how you transformed the json api calls into a dataframe and csv.\n\n## SUPPORT FUNCTIONS\nThere can be an unlimited amount of support functions.\nEach support function should have...
[ [ "pandas.read_csv" ] ]
dahatake/Azure-Machine-Learning-sample
[ "4cb093dbffa403df638f6ae186479cc0ea932262" ]
[ "6.AutoML-Probability/scoring_file_v_1_0_0.py" ]
[ "# ---------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# ---------------------------------------------------------\nimport json\nimport logging\nimport os\nimport pickle\nimport numpy as np\nimport pandas as pd\nfrom sklearn.externals import joblib...
[ [ "sklearn.externals.joblib.load", "pandas.DataFrame", "numpy.array", "pandas.Series" ] ]
helloyide/Cross-stitch-Networks-for-Multi-task-Learning
[ "c07edb758aad7e0a2eb8da82e63105eae2ef77a4" ]
[ "gender_age_multi_task_learning.py" ]
[ "import pickle\nfrom datetime import datetime\n\nimport sys\nimport argparse\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib as contrib\nfrom keras.utils import to_categorical\n\n\ndef load_data():\n with open(\"saved_data\", \"rb\") as file:\n # data is a list with length 2000\n ...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.contrib.layers.fully_connected", "tensorflow.matmul", "tensorflow.reshape", "numpy.mean", "tensorflow.initializers.identity", "tensorflow.contrib.layers.flatten", "tensorflow.global_variables_initializer", "tensorfl...
schen496/auditory-hallucinations
[ "31b89df838a9f3c4558c7c3b69dbcd43c7f9de19" ]
[ "extract_image_features/old_code/video_extraction.py" ]
[ "from skimage import transform, color, io\nimport scipy.io as sio\nimport skvideo.io\nimport os\nimport numpy as np\nimport imageio\nimport matplotlib.pyplot as plt\nimport re\nfrom skimage import transform, color, io\nimport warnings\nfrom tqdm import tqdm\nimport h5py\nimport pickle\n\n### LOADING VIDEOS ###\nvid...
[ [ "numpy.max", "numpy.array", "scipy.io.loadmat" ] ]
tanishq1g/Author_Style_Recognition
[ "f39016eeeef99245384c6ef345d9d6135c4bd2ea" ]
[ "for TAs/run.py" ]
[ "#for TAs\r\n# we have provided the test set as two CSVs, one is Xtest and other is Ytest.\r\n# to reproduce results, follow these steps\r\n#first extract the test files from the zip file and place them in this folder.\r\n\r\n#1. import all packages\r\n#2. load pickle file, Xtest and Ytest files\r\n#3. run the mode...
[ [ "pandas.read_csv", "sklearn.metrics.accuracy_score" ] ]
nachovazquez98/COVID-19_Paper
[ "6d7b398b8e6c3eeb0f76cabd0aeb077ff575e3a6" ]
[ "tpot/models/df_caso5_1_tpot_pipeline.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.naive_bayes import BernoulliNB\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import PolynomialFeatures\nfrom tpot.builtins import OneHotEncoder\n\n# NOTE: Make sure that the outcome...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.naive_bayes.BernoulliNB", "sklearn.preprocessing.PolynomialFeatures" ] ]
Jorjeous/NeMo
[ "cafc21ee6a0c7781fb08e9821c327b1ece1f83e3" ]
[ "nemo/core/classes/modelPT.py" ]
[ "# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "torch.cuda.is_available", "torch.load", "torch.cuda.current_device" ] ]
ThomasLittrell1/udacity_deeprl_course
[ "b247cf0128623bbb8264ef35a977a8e640a0ccdd" ]
[ "lab-taxi/monitor.py" ]
[ "from collections import deque\nimport sys\nimport math\nimport numpy as np\n\ndef interact(env, agent, num_episodes=20000, window=100):\n \"\"\" Monitor agent's performance.\n \n Params\n ======\n - env: instance of OpenAI Gym's Taxi-v1 environment\n - agent: instance of class Agent (see Agent.py...
[ [ "numpy.mean" ] ]
OttoStruve/muler
[ "61d3e1676b1dbbe5616c303e6a64bc24d7519f4f" ]
[ "tests/test_igrins.py" ]
[ "# from astropy.nddata.ccddata import _uncertainty_unit_equivalent_to_parent\nimport astropy\nimport pytest\nimport time\nfrom muler.igrins import IGRINSSpectrum, IGRINSSpectrumList\nfrom specutils import Spectrum1D\n\n# from astropy.nddata.nduncertainty import StdDevUncertainty\nimport numpy as np\nimport glob\n\n...
[ [ "numpy.all", "numpy.median", "numpy.isclose", "numpy.nanmedian" ] ]
serge-sans-paille/scipy
[ "7df7d350fb3156d6e1554eec6997be8bb59cb052" ]
[ "scipy/signal/setup.py" ]
[ "from scipy._build_utils import numpy_nodepr_api\nimport os\n\n\ndef configuration(parent_package='', top_path=None):\n from numpy.distutils.misc_util import Configuration\n from scipy._build_utils.compiler_helper import set_c_flags_hook\n\n config = Configuration('signal', parent_package, top_path)\n\n ...
[ [ "numpy.distutils.misc_util.Configuration" ] ]
jfrygeo/Read-Headers-CSV-python
[ "bf5a225bac1186c7d30ab233154f2c4f17c7b5ce" ]
[ "SampleData/Read-Headers-CSV-python_Split_Data.py" ]
[ "#Reads one line in a large csv file\n#Gives total count of lines csv\n# __author__ = 'john6807'\nimport csv,os, pandas\n\n#Input the filepath to your csv file: i.e. \"C:\\\\MyFolder\\\\MyCSV.csv\"\n#filename = \"C:\\\\MyFolder\\\\MyCSV.csv\"\n#filename = os.path.join(os.path.dirname(__file__)+\"\\SampleData\\TestC...
[ [ "pandas.read_csv" ] ]
ky0on/keras-vis
[ "5987b56e0717aaba9989f5c8cb4f5b90c459ad52" ]
[ "vis/backend/tensorflow_backend.py" ]
[ "from __future__ import absolute_import\n\nimport os\nimport tempfile\nimport inspect\nimport numpy as np\nimport tensorflow as tf\n\nfrom ..utils import utils\nfrom tensorflow.python.framework import ops\nimport keras\nfrom keras.models import load_model\nfrom keras.layers import advanced_activations, Activation\n...
[ [ "tensorflow.set_random_seed", "tensorflow.get_default_graph", "numpy.random.seed", "tensorflow.Session", "tensorflow.RegisterGradient", "tensorflow.GPUOptions", "tensorflow.cast" ] ]