repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
param-b/USC-CSCI-Projects
[ "fd707483c619553a8cf858332774411917f5a017" ]
[ "hw3.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"HW3\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1SG0q85xrJVcfb4uZ9qKiNluZd-gZx12i\n\"\"\"\n\nimport sys\nimport pandas as pd\nimport numpy as np\nimport math\nfrom math import sqrt\nfrom numpy import genfromt...
[ [ "numpy.max", "numpy.array", "numpy.savetxt", "numpy.random.seed", "pandas.DataFrame", "numpy.sum", "numpy.genfromtxt", "numpy.random.randn", "numpy.exp", "numpy.random.shuffle", "numpy.arange", "numpy.argmax", "pandas.read_csv" ] ]
juglab/VoidSeg_cluster
[ "71339f9bdd6df9feb26fa197d5dfc390c371910c" ]
[ "noise2seg/csbdeep/internals/losses.py" ]
[ "from __future__ import print_function, unicode_literals, absolute_import, division\nfrom six.moves import range, zip, map, reduce, filter\n\nfrom ..utils import _raise, backend_channels_last\n\nimport numpy as np\nimport keras.backend as K\n\nimport tensorflow as tf\n\nfrom tensorflow.nn import softmax_cross_entro...
[ [ "tensorflow.shape", "numpy.log", "tensorflow.reshape", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.stack" ] ]
abhayKashyap03/datasets
[ "4360602767c0f4d9782d8829224fb372e9134015" ]
[ "tensorflow_datasets/core/tfrecords_writer_test.py" ]
[ "# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "tensorflow.compat.v2.io.gfile.glob", "tensorflow.compat.v2.data.TFRecordDataset" ] ]
mashrafsiddiq/Septor
[ "f2d9a75d50e0fd60b6a86e493afcc1f243e4fc6d" ]
[ "code/baselines/utils.py" ]
[ "import numpy as np\nfrom scipy import stats\nimport math\n\ndef get_stats(actual, predicted):\n correlation, p_val = stats.pearsonr(actual, predicted)\n mse = np.square(np.subtract(actual,predicted)).mean() \n rmse = math.sqrt(mse)\n return correlation, rmse, p_val" ]
[ [ "numpy.subtract", "scipy.stats.pearsonr" ] ]
Shashi456/lm-evaluation-harness
[ "52ebefbd6d61454b213183ca7513781b2ff1070f" ]
[ "lm_eval/base.py" ]
[ "import abc\nimport random\nimport numpy as np\n\nfrom lm_eval.metrics import mean\n\n\nclass LM(abc.ABC):\n def __init__(self):\n self.cache_hook = CacheHook(None)\n\n @abc.abstractmethod\n def loglikelihood(self, requests):\n \"\"\"Compute log-likelihood of generating a continuation from a ...
[ [ "numpy.argmax" ] ]
sharvaridesh/wolfdrone
[ "307f5f8f28281f87fc10cb26144a850e98abc844" ]
[ "scripts/mission/controllers/approach.py" ]
[ "\"\"\"\nCreated on Tue Apr 17 03:18:25 2018\n\n@author: vijayaganesh\n\"\"\"\n\nfrom controller import Controller\nfrom descend import Descend_Controller\nfrom geometry_msgs.msg import TwistStamped\nimport rospy\nimport time\nimport numpy as np\n\n# Maximum Search speed, in m/s\nDEFAULT_MAX_SPEED_XY = 1.5\nDEFAULT...
[ [ "numpy.sqrt" ] ]
KarlTDebiec/PipeScaler
[ "b990ece8f3dd2c3506c226ed871871997fc57beb" ]
[ "pipescaler/sorters/solid_color_sorter.py" ]
[ "#!/usr/bin/env python\n# pipescaler/sorters/solid_color_sorter.py\n#\n# Copyright (C) 2020-2021 Karl T Debiec\n# All rights reserved.\n#\n# This software may be modified and distributed under the terms of the\n# BSD license.\nfrom __future__ import annotations\n\nfrom logging import info\nfrom typing imp...
[ [ "numpy.array" ] ]
ntucsl/RNNRepair
[ "17171f0b1d6e0d1701bef1fd8ef4006ef582b772" ]
[ "RNNRepair/use_cases/image_classification/mutators.py" ]
[ "from __future__ import print_function\nimport sys\nimport cv2\nimport numpy as np\nimport random\nimport time\nimport copy\n\n\n# keras 1.2.2 tf:1.2.0\nclass Mutators():\n def image_translation(img, params):\n\n rows, cols, ch = img.shape\n # rows, cols = img.shape\n\n # M = np.float32([[1,...
[ [ "numpy.random.normal", "numpy.array", "numpy.pad", "numpy.ceil", "numpy.asarray", "numpy.sum", "numpy.copy", "numpy.load", "numpy.random.randn", "numpy.float32", "numpy.ravel", "numpy.random.randint", "numpy.squeeze", "numpy.expand_dims" ] ]
felipefrmelo/what-is-this
[ "e0789e7c85a6cf07fdfc2a9913a43dae08c3fe22" ]
[ "train.py" ]
[ "import torch\nfrom torchvision import transforms\nfrom torch.nn import Sequential, Softmax\nimport torchvision.models as models\nimport argparse\n# Setup an inference pipeline with a pre-trained model\n\n\ndef go(model):\n model = torch.hub.load('pytorch/vision:v0.9.0', model, pretrained=True)\n model.eval()...
[ [ "torch.jit.script", "torch.nn.Softmax", "torch.hub.load" ] ]
sumonbis/FairPreprocessing
[ "c644dd38615f34dba39320397fb00d5509602864" ]
[ "utils/ml_fairness.py" ]
[ "import pandas as pd\nimport csv\nimport numpy as np\nfrom aif360.metrics import *\nfrom sklearn.metrics import confusion_matrix, accuracy_score, f1_score\nimport collections\n\ndef fair_metrics(fname, dataset, pred, pred_is_dataset=False):\n filename = fname\n if pred_is_dataset:\n dataset_pred = pred...
[ [ "sklearn.metrics.confusion_matrix", "numpy.array", "numpy.log", "pandas.DataFrame", "sklearn.metrics.accuracy_score", "sklearn.metrics.f1_score" ] ]
snesnehne/MatPy
[ "291debff0796124c34ddfad2270976dcd2f445e7" ]
[ "devel/test_suite.py" ]
[ "\"\"\"\ntest_suite.py\n06-27-16\n\nContains all functionality needed to\nautomatically determine the yield stress\nof a material, even with noisy data, given\na stress-strain curve in the form\n[Strain|Stress] in each row.\n\nEdward Alexander Nusinovich\n\"\"\"\n\n\"\"\"Basic libs\"\"\"\nimport numpy as np\nimport...
[ [ "numpy.array", "scipy.optimize.curve_fit", "sklearn.cluster.MiniBatchKMeans", "sklearn.linear_model.LinearRegression", "numpy.zeros", "numpy.log", "sklearn.cluster.KMeans", "numpy.linspace" ] ]
NeverendingNotification/pytorch-xai-analyze
[ "fba91bf98c3281ffee5acaa87f2e44191897e0d7" ]
[ "utils.py" ]
[ "import os\nimport random\n\nimport yaml\nimport numpy as np\nimport torch\n\nDEFAULT_SEED = 777\nDEFAULT_PARAM_FILE = \"params.yml\"\nDEFAULT_LOG_DIR = \"log\"\n\ndef load_initialize(yaml_file, **kwargs):\n params = load_params(yaml_file)\n override_params(params, **kwargs)\n initial_setting(params[\"main...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.cuda.manual_seed", "torch.cuda.is_available" ] ]
chandlersong/pythonMath
[ "f267f14b954327bea61485fe37590fefc0d45e65" ]
[ "sklearn_demo/transform_demo.py" ]
[ "import unittest\nimport numpy as np\nfrom unittest import TestCase\n\nfrom sklearn.preprocessing import FunctionTransformer\n\n\ndef plus(X, value):\n return X + value\n\n\nclass TestFunctionTest(TestCase):\n\n def test_function_transform(self):\n transform = FunctionTransformer(plus, kw_args={\"value...
[ [ "numpy.array", "sklearn.preprocessing.FunctionTransformer" ] ]
JustinTervala/PHoDMSs
[ "7fe45031a5ec174de90d240a4f5ea8fcf61a720e" ]
[ "rank_erosion.py" ]
[ "import numpy as np\nimport sys\n\ndef erosion(f, g, spacing, m, n):\n\tfshifts = np.zeros((m,n,n,m,n,n), dtype=int)\n\tgshifts = np.zeros((m,n,n,m,n,n), dtype=int)\n\n\tfor s1 in range(m):\n\t\tfor t1 in range(n):\n\t\t\tfor t2 in range(n):\n\t\t\t\tfor s2 in range(m):\n\t\t\t\t\tfor t3 in range(n):\n\t\t\t\t\t\tf...
[ [ "numpy.reshape", "numpy.zeros", "numpy.shape", "numpy.loadtxt", "numpy.floor", "numpy.maximum" ] ]
Fizyhsp/pytorch_geometric
[ "e7b4581a80fc2ed430ca1c7320e6e889de5967be" ]
[ "torch_geometric/io/tu.py" ]
[ "import os\nimport os.path as osp\nimport glob\n\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\nfrom torch_sparse import coalesce\nfrom torch_geometric.io import read_txt_array\nfrom torch_geometric.utils import remove_self_loops\nfrom torch_geometric.data import Data\n\nnames = [\n 'A', 'gr...
[ [ "numpy.bincount", "torch.bincount", "torch.cat", "torch.nn.functional.one_hot", "torch.arange", "torch.tensor" ] ]
glup-ai/gods-eye
[ "2a2a80a748237b0477b87dff875916b3baa1fb61" ]
[ "utils/draw_face_information.py" ]
[ "\nimport numpy as np\nimport cv2\nimport pandas as pd\n\nmale = pd.read_csv(\"data/names/herrenavn.csv\")\nfemale = pd.read_csv(\"data/names/kvinnenavn.csv\")\nmaleLength = len(male['Navn'])\nfeMaleLength = len(female['Navn'])\n\ndef draw_information(image_total, loc, faces_df, analyzis_object, useRandomNames=Fals...
[ [ "pandas.read_csv", "numpy.ones", "numpy.random.randint" ] ]
penrin/assigncheck
[ "7caa08591b73a8adae32219b8e12ae1734f337a6" ]
[ "assigncheck.py" ]
[ "import sys\nimport os\nimport time\nimport argparse\nimport wave\nfrom subprocess import Popen\nimport numpy as np\n\n\ndef readwav(filename):\n wr = wave.open(filename, 'r')\n params = wr.getparams()\n nchannels = params[0]\n sampwidth = params[1]\n rate = params[2]\n nframes = params[3]\n f...
[ [ "numpy.array", "numpy.empty", "numpy.reshape", "numpy.zeros", "numpy.asarray", "numpy.sign", "numpy.abs", "numpy.frombuffer", "numpy.fromstring" ] ]
mila-iqia/COVI-AgentSim
[ "7e4dea42ad9c5dd251aa8d7546c647ad4f173d28" ]
[ "src/covid19sim/plotting/plot_presymptomatic.py" ]
[ "import numpy as np\nimport os\nimport time\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n\ndef statistics(pkl_data, times, mode):\n\n data = pkl_data[\"human_monitor\"]\n data = sorted(data.items(), key=lambda x: x[0])\n start_date = data[0][0]\n data = [((k - start_date).days, v) for k, v in ...
[ [ "numpy.concatenate", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.rc", "matplotlib.pyplot.clf", "matplotlib.pyplot.subplots_adjust", "numpy.expand_dims" ] ]
AndressaStefany/evolving_systems
[ "718b5935e1e33812467c1e40eead152354fc1f0c" ]
[ "algoritms/autocloud/DataCloud.py" ]
[ "import numpy as np\n\n\nclass DataCloud:\n N = 0\n\n def __init__(self, x):\n self.n = 1\n self.mean = x\n self.variance = 0\n self.pertinency = 1\n DataCloud.N += 1\n\n def addDataClaud(self, x):\n self.n = 2\n self.mean = (self.mean+x)/2\n self.var...
[ [ "numpy.linalg.norm" ] ]
amerfathullah/sumo-rl
[ "93b0074d4d615fe0656efef941afc7f5d982111e" ]
[ "sumo_rl/environment/traffic_signal.py" ]
[ "import os\nimport sys\nif 'SUMO_HOME' in os.environ:\n tools = os.path.join(os.environ['SUMO_HOME'], 'tools')\n sys.path.append(tools)\nelse:\n sys.exit(\"Please declare the environment variable 'SUMO_HOME'\")\nimport traci\nimport numpy as np\nfrom gym import spaces\n\n\nclass TrafficSignal:\n \"\"\"\...
[ [ "numpy.array" ] ]
mirzaelahi/quest
[ "c433175802014386c2b1bf3c8932cd66b0d37c8e" ]
[ "tests/test_dirac_transport_contact_width.py" ]
[ "#!/usr/bin/python\n\n\"\"\"\n TI Surface transport simulator for p-n junction using QMICAD.\n \n Author: K M Masum Habib <masum.habib@virginia.edu>\n Last update: 03/26/2014\n\"\"\"\n\nimport sys\nimport numpy as np\nimport math\nfrom math import pi, tan, cos, sin\n\nimport qmicad\nfrom qmicad.linspace i...
[ [ "numpy.array" ] ]
sarvex/autograph
[ "305337a7d692495cbdd00c67fa9515fe3994523a" ]
[ "reference_tests/call_to_builtin_function_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.test.main" ] ]
ikingye/Paddle
[ "766b35152713d4410d4c5b05a3fa5e5a64a6fa60" ]
[ "python/paddle/fluid/tests/unittests/test_imperative_save_load_v2.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.zeros_like", "numpy.array_equal", "numpy.zeros", "numpy.arange", "numpy.expand_dims" ] ]
acwooding/covid_nlp
[ "d097c35ca5a7cedecae05bb5677bcfb8ff573b97" ]
[ "src/data/transformers.py" ]
[ "import sys\nimport pathlib\nimport os\nfrom sklearn.model_selection import train_test_split\nfrom .datasets import Dataset\nfrom ..log import logger\n\n__all__ = [\n 'available_transformers'\n]\n\n_MODULE = sys.modules[__name__]\n_MODULE_DIR = pathlib.Path(os.path.dirname(os.path.abspath(__file__)))\n\ndef avai...
[ [ "sklearn.model_selection.train_test_split" ] ]
abetan16/clusterpy
[ "6333b67d3f49dd9bb4d26f7e0f01fb009d682a65" ]
[ "clusterpy/core/toolboxes/cluster/componentsAlg/distanceFunctions.py" ]
[ "# encoding: latin2\r\n\"\"\"\r\nDistance functions\r\n\"\"\"\r\n__author__ = \"Juan C. Duque\"\r\n__credits__ = \"Copyright (c) 2009-11 Juan C. Duque\"\r\n__license__ = \"GPL\"\r\n__version__ = \"1.0.0\"\r\n__maintainer__ = \"RiSE Group\"\r\n__email__ = \"contacto@rise-group.org\"\r\n\r\nfrom numpy import add as n...
[ [ "numpy.array", "numpy.subtract", "numpy.add.reduce" ] ]
buqeye/buqeyebox
[ "c78b688b116b357250198576aa66e4eab1d5442c" ]
[ "nn_scattering/eft_gp_jupyter/ChEFT_GP_imports.py" ]
[ "import gsum as gm\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.stats as stats\nfrom scipy.interpolate import interp1d\nimport os\nimport h5py\nfrom sklearn.gaussian_process.kernels import RBF, WhiteKernel\nimport math\nimport re\n\nimport urllib\nimport tables\n\n# S...
[ [ "matplotlib.pyplot.rc_context", "numpy.min", "numpy.exp", "numpy.radians", "matplotlib.pyplot.GridSpec", "numpy.max", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.subplots", "numpy.nonzero", "numpy.arange", "numpy.sqrt", "scipy.interpolate.interp1d", "numpy....
mzy2240/GridCal
[ "0352f0e9ce09a9c037722bf2f2afc0a31ccd2880", "0352f0e9ce09a9c037722bf2f2afc0a31ccd2880", "0352f0e9ce09a9c037722bf2f2afc0a31ccd2880" ]
[ "src/GridCal/Engine/Core/DataStructures/generator_data.py", "src/api_rest/Gui/Main/ClientGui.py", "src/research/three_phase/Engine/Numerical/numerical_power_flow.py" ]
[ "# This file is part of GridCal.\n#\n# GridCal is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# GridCal is distributed in t...
[ [ "numpy.array", "numpy.empty", "numpy.zeros", "numpy.ix_", "numpy.power", "numpy.abs", "numpy.sqrt", "scipy.sparse.lil_matrix" ], [ "pandas.DataFrame" ], [ "numpy.exp", "scipy.sparse.linalg.splu", "scipy.sparse.linalg.spsolve", "numpy.zeros_like", "nu...
data301-2021-summer2/project-data-301-project-53
[ "8adcf394289d70620b0d3c3e6e62ede5c8837a5f" ]
[ "analysis/person1/project_functions(h).py" ]
[ "import pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport os\nimport matplotlib.pyplot as plt\n\ndef load_and_process(path):\n df1 = (\n pd.read_csv(path)\n .rename(columns={\"LifeExp\":\"LifeExpectancy\"})\n .dropna()\n .sort_values(\"Country\", ascendin...
[ [ "numpy.where", "pandas.read_csv" ] ]
AnotherGroupChat/gnn
[ "e9437aa75babbe9c2786a9c46b38e3fc83570346" ]
[ "tensorflow_gnn/graph/graph_piece.py" ]
[ "\"\"\"Base classes for all CompositeTensors used inside a GraphTensor.\n\"\"\"\nimport abc\nimport functools\nfrom typing import Any, Callable, Mapping, Optional, Union\nfrom typing import cast\nfrom typing import List, Tuple\n\nimport tensorflow as tf\n\nfrom tensorflow_gnn.graph import graph_constants as const\n...
[ [ "tensorflow.TensorSpec", "tensorflow.nest.pack_sequence_as", "tensorflow.convert_to_tensor", "tensorflow.TensorShape", "tensorflow.RaggedTensor.from_row_splits", "tensorflow.python.framework.type_spec.type_spec_from_value", "tensorflow.nest.flatten", "tensorflow.nest.map_structure"...
allenhu12/xalpha
[ "1a28427fc22de046f689ea334dd0f3cf6e7d301d" ]
[ "xalpha/universal.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nmodules for universal fetcher that gives historical daily data and realtime data\nfor almost everything in the market\n\"\"\"\n\nimport os\nimport sys\nimport time\nimport datetime as dt\nimport numpy as np\nimport pandas as pd\nimport logging\nimport inspect\nfrom bs4 import Beaut...
[ [ "pandas.to_datetime", "pandas.isna", "pandas.Timedelta", "pandas.DataFrame", "pandas.date_range", "pandas.read_excel", "pandas.Timestamp", "numpy.random.randint", "pandas.read_sql", "pandas.to_numeric" ] ]
day-jeff/pyAudioAnalysis
[ "f0bda7b727e4159f9304d41ca1d35b5c48313738" ]
[ "pyAudioAnalysis/audioAnalysis.py" ]
[ "from __future__ import print_function\nimport argparse\nimport os\nimport numpy\nimport glob\nimport matplotlib.pyplot as plt\nfrom pyAudioAnalysis import ShortTermFeatures as sF\nfrom pyAudioAnalysis import MidTermFeatures as aF\nfrom pyAudioAnalysis import audioTrainTest as aT\nfrom pyAudioAnalysis import audioS...
[ [ "numpy.histogram", "numpy.array", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.im...
dngu7/honeycode
[ "d7a00408f8370f3fea8ca1a94b239f3e4d842a7d" ]
[ "run/runner/trn_runner.py" ]
[ "import importlib.util\nimport logging\nimport os, sys\nimport time\nimport random\nimport pickle\n\nimport networkx as nx\nimport numpy as np\nimport torch\nfrom tqdm import tqdm\n\nfrom utils.read_config import read_config\nfrom utils.train_helper import load_model\nfrom utils.vis_helper import draw_graph_list_se...
[ [ "numpy.bincount", "numpy.asmatrix", "numpy.ceil", "numpy.array", "torch.no_grad", "numpy.logical_and", "numpy.all" ] ]
denis-gordeev/sobakin_glottal_closures
[ "809120835681df1a56d88471c610794f8cc56cf6", "809120835681df1a56d88471c610794f8cc56cf6" ]
[ "venv/lib/python2.7/site-packages/numpy/testing/utils.py", "venv/lib/python2.7/site-packages/numpy/distutils/misc_util.py" ]
[ "\"\"\"\nUtility function to facilitate testing.\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nimport os\nimport sys\nimport re\nimport operator\nimport warnings\nfrom functools import partial\nimport shutil\nimport contextlib\nfrom tempfile import mkdtemp, mkstemp\n\nfrom .nosetest...
[ [ "numpy.lib.iscomplexobj", "numpy.core.isinf", "numpy.lib.imag", "numpy.core.numeric.isclose", "numpy.where", "numpy.core.result_type", "numpy.iscomplexobj", "numpy.core.zeros", "numpy.core.around", "numpy.common_type", "numpy.core.numerictypes.issubdtype", "numpy.co...
chenfengw/UNet_Segmentation
[ "0ee5d9c98376ed22d31f7245e32bf0333a646b36" ]
[ "test.py" ]
[ "import torch\nfrom torch.autograd import Variable\nimport torch.functional as F\nimport dataLoader\nimport argparse\nimport torchvision.utils as vutils\nfrom torch.utils.data import DataLoader\nimport model\nimport torch.nn as nn\nimport os\nimport numpy as np\nimport utils\nimport scipy.io as io\n\nparser = argpa...
[ [ "numpy.array", "numpy.zeros", "torch.autograd.Variable", "numpy.sum", "torch.FloatTensor", "scipy.io.loadmat", "numpy.save", "numpy.mean", "torch.cuda.is_available", "torch.LongTensor", "torch.utils.data.DataLoader", "torch.load", "torch.mean" ] ]
apadee/PyCartool
[ "d030ba80b5304ee0d4ab1ff37a240957fc165914" ]
[ "pycartool/io/sef.py" ]
[ "# -*- coding: utf-8 -*-\n# Authors: Tanguy Vivier <tanguy.viv@gmail.com>\n# Victor Férat <victor.ferat@live.fr>\n#\n# License: BSD (3-clause)\nimport struct\nimport time\nimport datetime as dt\nimport numpy as np\nimport mne\nfrom mne.io import RawArray\nfrom mne import create_info\n\n\ndef read_sef(filen...
[ [ "numpy.transpose", "numpy.reshape" ] ]
FutureTwT/Optimizer
[ "6a56bf68fa3887c5699f4d5bbf6b21bc2e7f900e" ]
[ "Simplex/Simplex.py" ]
[ "import numpy as np\n\ndef init(A, b, c, rank, m):\n A_b = A[:, (m-rank):]\n A_n = A[:, :(m-rank)]\n\n c_b = c[:, (m-rank):]\n c_n = c[:, :(m-rank)]\n\n A_b_inv = np.linalg.pinv(A_b)\n b_ = A_b_inv @ b\n tmp = c_b @ A_b_inv\n ZC = tmp @ A_n - c_n\n\n F = tmp @ b\n\n # Get the Simplex T...
[ [ "numpy.max", "numpy.zeros_like", "numpy.linalg.pinv", "numpy.loadtxt", "numpy.argmax", "numpy.hstack", "numpy.vstack" ] ]
probml/shift-happens
[ "67bd65a7652e0cd148d94a2085d6e546ace584b2" ]
[ "_src/environment.py" ]
[ "import jax\nimport jax.numpy as jnp\nfrom jax import vmap, tree_map\nfrom jax import random\nfrom imax import transforms\n\nimport tensorflow_datasets as tfds\nimport numpy as np\n\nfrom functools import partial\nfrom typing import Any\n\nArray = Any\n\n\nclass Environment:\n def prepare_data(self, dataset_name...
[ [ "numpy.arange" ] ]
quietcoolwu/mlnd-dlnd-2017
[ "4a0ccfd7d9b27e8315fb4c203c6e75c1cb84e525" ]
[ "dlnd/TF_DNN/quizzes/tf_dropout.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\nhidden_layer_weights = [[0.1, 0.2, 0.4], [0.4, 0.6, 0.6], [0.5, 0.9, 0.1],\n [0.8, 0.2, 0.8]]\nout_weights = [[0.1, 0.6], [0.2, 0.1], [0.7, 0.9]]\n\n# Weights and biases\nweights = [tf.Variable(hidden_layer_weights)...
[ [ "tensorflow.zeros", "tensorflow.nn.relu", "tensorflow.matmul", "tensorflow.Variable", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.nn.dropout" ] ]
gonzalezsieira/pelican_gazebo
[ "48f3953f6294cf9a9761bac4497d27c32c600bee" ]
[ "scripts/pelican_gazebo_topics.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nimport math\nimport numpy\nimport tf\nimport std_msgs.msg\nimport gazebo_msgs.msg\nimport geometry_msgs.msg\nimport asctec_hl_comm.msg\nimport tf.transformations\n\nnode_name = 'gazebo_topics'\n\n\nclass Publisher:\n\n def __init__(self, robot_name, world_name, tf_publishe...
[ [ "numpy.matrix" ] ]
jaeyeun97/MusicalStyleTransfer
[ "0aa9e8763597bf86ff0c13ae96dee75d165c4fc2" ]
[ "styletransfer/models/translator_model.py" ]
[ "import itertools\nimport torch\nimport torch.nn as nn\nfrom adabound import AdaBound\nfrom .base_model import BaseModel\nfrom .networks.encoders import TemporalEncoder\nfrom .networks.domain_confusion import DomainConfusion\nfrom .networks.wavenet import WaveNet\nfrom .networks.nv_wavenet import NVWaveNet, Impl\n\...
[ [ "torch.nn.LogSoftmax", "torch.nn.NLLLoss", "torch.no_grad", "torch.nn.functional.interpolate", "torch.LongTensor", "torch.nn.CrossEntropyLoss" ] ]
rgerkin/pyrfume
[ "54e79dc054557b294f8905b379efbcb94e73573e" ]
[ "notebooks/generate-mordred.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.10.3\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\nimport pan...
[ [ "pandas.read_csv" ] ]
aticie/SATRN
[ "af7dc19b85e04a79f0b30936869e2340410940fc" ]
[ "src/utils.py" ]
[ "\"\"\"\nCopyright (c) 2020-present NAVER Corp.\nMIT license\n\"\"\"\nimport os\nimport re\nimport importlib\nimport collections\nimport pickle as cp\nimport tensorflow as tf\nimport unicodedata\n\nfrom constant import SPE_TOKENS, UNK_INDEX, EOS_INDEX, DELIMITER, EOS_TOKEN\n\nTowerResult = collections.namedtuple(\n...
[ [ "tensorflow.edit_distance", "tensorflow.greater", "tensorflow.tables_initializer", "tensorflow.python.eager.context.executing_eagerly", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.train.GradientDescentOptimizer...
Lechatelia/own_detr
[ "accd888755d5b09e91f73997e33851cafb8b7ca1" ]
[ "models/segmentation.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nThis file provides the definition of the convolutional heads used to predict masks, as well as the losses\n\"\"\"\nimport io\nfrom collections import defaultdict\nfrom typing import List, Optional\n\nimport torch\nimport torch.nn as nn...
[ [ "torch.nn.functional.binary_cross_entropy_with_logits", "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.init.kaiming_uniform_", "torch.zeros", "torch.einsum", "torch.nn.init.constant_", "torch.no_grad", "torch.nn.functional.interpolate", "torch.nn.init.xavier_uniform_", ...
Paperspace/tutorials
[ "8e20ffb687080c44e75dabea594d2b57acc53713" ]
[ "feature_examples/tensorflow2/ipu_estimator/cifar10_ipu_estimator_replica.py" ]
[ "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\nfrom functools import partial\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.python import ipu\n\nfrom data import CIFAR10_Data\nfrom model import get_model\nfrom utils import parse_params, create_ipu_run_config\n\n\ndef estimator_m...
[ [ "tensorflow.python.ipu.optimizers.CrossReplicaOptimizer", "tensorflow.estimator.EstimatorSpec", "tensorflow.argmax", "tensorflow.compat.v1.train.GradientDescentOptimizer", "tensorflow.python.ipu.ipu_estimator.IPUEstimator", "tensorflow.compat.v1.metrics.accuracy", "tensorflow.keras.los...
xinghalo/chinese_ocr
[ "48a6424238c59213a5c57a17ba1570a644da69d9" ]
[ "ctpn/ctpn/demo.py" ]
[ "from __future__ import print_function\nimport tensorflow as tf\nimport numpy as np\nimport os, sys, cv2\nimport glob\nimport shutil\nsys.path.append(os.getcwd())\nfrom ctpn.lib.networks.factory import get_network\nfrom ctpn.lib.fast_rcnn.config import cfg,cfg_from_file\nfrom ctpn.lib.fast_rcnn.test import test_ctp...
[ [ "numpy.linalg.norm", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.train.get_checkpoint_state", "numpy.ones", "tensorflow.ConfigProto" ] ]
diana-hep/madminer
[ "3a585d2887a31886cdeadddb0a284f0472146fce" ]
[ "madminer/fisherinformation/information.py" ]
[ "import logging\nimport numpy as np\nimport os\n\nfrom madminer.analysis import DataAnalyzer\nfrom madminer.utils.various import math_commands, weighted_quantile, sanitize_array, mdot\nfrom madminer.utils.various import less_logging\nfrom madminer.ml import ParameterizedRatioEstimator, ScoreEstimator, Ensemble, loa...
[ [ "numpy.logical_not", "numpy.ceil", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.einsum", "numpy.argsort", "numpy.searchsorted", "numpy.linspace", "numpy.maximum" ] ]
ltang320/PXST-Development
[ "0c158bbd958f39c4e03e43f08897588e7a37fe4a" ]
[ "Tomo_sim/2D_projection image.py" ]
[ "import numpy as np\nimport scipy.integrate as integrate\nfrom scipy.signal import fftconvolve\nimport os,sys\nimport yaml\nimport matplotlib.pyplot as plt\nimport math\n\nwith open('configure.yml','r') as conf_para:\n conf_para = yaml.load(conf_para,Loader=yaml.FullLoader)\n#print(conf_para)\n\ndef sample_coord...
[ [ "scipy.signal.fftconvolve", "numpy.exp", "numpy.fft.fft", "numpy.arange", "numpy.abs", "numpy.sqrt" ] ]
tqdo/gluon-ts
[ "4628cd928177ca47d173f7da780b8aa03e545238" ]
[ "src/gluonts/transform/split.py" ]
[ "# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "pandas.offsets.CustomBusinessHour", "numpy.ones", "numpy.diff", "numpy.arange", "numpy.cumsum", "numpy.searchsorted" ] ]
pnnl/neural_ODE_ICRL2020
[ "d0c1b8671c8a500dafe98aec7d234c120d862e3d" ]
[ "analysis/con_iclr_models_analysis.py" ]
[ "\"\"\"\nNeural State Space Models - N-step ahead System ID\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nfrom torch import nn\nimport os\nimport sys\nsys.path.append(os.path.abspath('../'))\nos.chdir('../')\nfrom system_id_nlin_con import make_dataset_con, SSM_black_con, SSM_gray_con,...
[ [ "numpy.concatenate", "torch.device", "matplotlib.pyplot.text", "torch.nn.MSELoss", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout" ] ]
BluePilgrim/amazon-sagemaker-examples
[ "6c59b6e435f040bdbe6a7c346fc0ce397f7746d8" ]
[ "sagemaker-python-sdk/pytorch_lstm_word_language_model/source/train.py" ]
[ "# Based on github.com/pytorch/examples/blob/master/word_language_model\nimport argparse\nimport math\nimport os\nfrom shutil import copy\nimport time\nimport torch\nimport torch.nn as nn\n\nimport data\nfrom rnn import RNNModel\n\nparser = argparse.ArgumentParser(description='PyTorch Wikitext-2 RNN/LSTM Language M...
[ [ "torch.save", "torch.no_grad", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
astaolaf/glenoidplanefitting
[ "3932183a38c94858232ed663f1a6dc88c2ee452b" ]
[ "glenoidplanefitting/algorithms/plane_fitting.py" ]
[ "\n\"\"\"\n\nThis is an implementation of a two plane method, see\n\nA. Ganapathi, J. McCarron, Chen, J. Iannotti.\n`Predicting normal glenoid version from the pathologic scapula:\na comparison of 4 methods in 2- and 3-dimensional models\n<https://doi.org/10.1016/j.jse.2010.05.024>`_\nJ Shoulder Elbow Surg (2011) 2...
[ [ "numpy.array", "numpy.cross", "numpy.linalg.svd" ] ]
trinhtuanvubk/KWS-based-ASR
[ "56ca095a903637ba92527fa3230bccd3357afa91" ]
[ "evaluate/plot_dev.py" ]
[ "import pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\na_file = open(\"data.pkl\", \"rb\")\ndata = pickle.load(a_file)\n\npoints = {}\nfor key in data.keys() : \n if key not in points : \n points[key] = []\n frr = []\n far = []\n # cosine distance\n for threshold in n...
[ [ "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "numpy.linspace" ] ]
tes-id/csv2bib
[ "1f74ffb7a5199a1b03802a5fc988d2ba35f7bba5" ]
[ "springer_link_csv_to_bibtex_parser.py" ]
[ "import pandas as pd\nimport re\nfrom bibtexparser.bwriter import BibTexWriter\nfrom bibtexparser.bibdatabase import BibDatabase\n\n\ndef split_camel_case_joined_names(joined_camel_case_names):\n individual_camel_case_names = re.finditer('.+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)',\n ...
[ [ "pandas.read_csv" ] ]
James-McNeill/Learning
[ "3c4fe1a64240cdf5614db66082bd68a2f16d2afb" ]
[ "Python/Dimensionality-Reduction/t-SNE.py" ]
[ "# t-SNE is a great technique for visual exploration of high dimensional datasets\n# Should be applied to non-numeric features\n\n# Import module\nfrom sklearn.manifold import TSNE\n\n# Non-numerical columns in the dataset\nnon_numeric = ['Branch', 'Gender', 'Component']\n\n# Drop the non-numerical columns from df\...
[ [ "sklearn.manifold.TSNE" ] ]
IrishWhiskey/incubator-mxnet
[ "197fbbaa04e296995b241c2ded1a63ec0e8cec20" ]
[ "tests/python/unittest/test_gluon_rnn.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.concatenate", "numpy.testing.assert_allclose" ] ]
CPerscheid/Comprior
[ "91f76cd9bfa01d20eac71121cfac25372750f83a" ]
[ "code/Python/comprior/pipeline.py" ]
[ "import os\nimport random, logging\nimport multiprocessing\nfrom matplotlib import colors as mcolors\nimport benchutils\nimport preprocessing\nimport featureselection\nimport evaluation\nimport argparse\nimport pandas as pd\n#reset the enabled levels of loggers of other packages ERROR\nlogging.getLogger(\"matplotli...
[ [ "pandas.read_csv" ] ]
fakecoinbase/sweetpandslashAlgorithms
[ "2e4dcf2d42de25531fae5b4ec0d96ce100043117" ]
[ "compare_model_resnet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as models\nimport numpy as np\nfrom torch.autograd import Variable\nfrom torch import transforms\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\nfrom PIL import Image\n\nimport sys, os, shu...
[ [ "torch.nn.Linear", "torch.cat", "numpy.random.choice", "torch.nn.BatchNorm2d", "numpy.mean", "torch.ones", "torch.load", "pandas.read_csv", "numpy.concatenate", "torch.nn.MaxPool2d", "torch.nn.BCELoss", "torch.zeros", "numpy.zeros", "torch.save", "torch....
sankethvedula/flowtorch
[ "44a0f0eff842dd33ca17b01f4e02d8cdda005aa8" ]
[ "flowtorch/bijectors/ops/spline.py" ]
[ "# Copyright (c) Meta Platforms, Inc\n\n# This implementation is adapted in part from:\n# * https://github.com/tonyduan/normalizing-flows/blob/master/nf/flows.py;\n# * https://github.com/hmdolatabadi/LRS_NF/blob/master/nde/transforms/\n# nonlinearities.py; and,\n# * https://github.com/bayesiains/nsf/blob/mast...
[ [ "torch.Size", "torch.sigmoid", "torch.nn.functional.softplus", "torch.distributions.utils._sum_rightmost", "torch.nn.functional.softmax" ] ]
sesterhe/RosettaSilentToolbox
[ "010941b9b20974c61a86858bfb73d5913afc6849" ]
[ "rstoolbox/tests/components/test_design.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n.. codeauthor:: Jaume Bonet <jaume.bonet@gmail.com>\n\n.. affiliation::\n Laboratory of Protein Design and Immunoengineering <lpdi.epfl.ch>\n Bruno Correia <bruno.correia@epfl.ch>\n\"\"\"\n# Standard Libraries\nimport os\nimport copy\n\n# External Libraries\nimport pandas as ...
[ [ "matplotlib.use", "matplotlib.font_manager.FontProperties", "numpy.array", "pandas.DataFrame", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplot2grid", "pandas.concat", "matplotlib.pyplot.gca" ] ]
llorracc/mintapi
[ "51e405d0d2ae65d81996079d59070eb56eec5244" ]
[ "mintapi/api.py" ]
[ "import atexit\nfrom datetime import date, datetime, timedelta\nimport io\nimport json\nimport logging\nimport os\nimport os.path\nimport random\nimport re\nimport requests\nimport subprocess\nfrom sys import platform as _platform\nimport time\nimport zipfile\nimport imaplib\nimport email\nimport email.header\nimpo...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
seeM/nnet
[ "d0833548bbe7b58042b1ecdf7fd6f29dd2b37a2f" ]
[ "nnet2.py" ]
[ "\"\"\"\nTODO:\n\n* print training set accuracy after each epoch\n* train/dev/test split\n* add custom init_params with smaller weights\n - times 0.01?\n - divide square root of x?\n* regularization:\n - dropout\n - L2 regularization/penalized optimization?\n* optimization:\n - SGD\n - BGD\n - ...
[ [ "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "numpy.sum", "numpy.random.permutation", "numpy.random.randn", "numpy.exp", "numpy.argmax" ] ]
mjacob1002/Eir
[ "ab9cb4e353796ba3ab79b1673adc251d434717cf" ]
[ "Eir/DTMC/spatialModel/randomMovement/randMoveSEIRVS.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom .randMoveSEIRV import RandMoveSEIRV\n\nclass RandMoveSEIRVS(RandMoveSEIRV):\n \"\"\"\n Class that simulates the random movement model with an SEIRV model. People in the Exposed compartment are presumed to not be able to propogate infection.\n\n...
[ [ "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.subplots" ] ]
douxiaotian/Deep-Wasserstein-Learning
[ "d29830f104ee8f0cc59c2427e061bf6e3c9c3e96" ]
[ "criteria/shared_margin.py" ]
[ "import numpy as np\nimport torch, torch.nn as nn, torch.nn.functional as F\nimport batchminer\n\n\n\"\"\"=================================================================================================\"\"\"\nALLOWED_MINING_OPS = list(batchminer.BATCHMINING_METHODS.keys())\nREQUIRES_BATCHMINER = True\nREQUIRES_O...
[ [ "torch.stack", "torch.ones", "torch.tensor", "torch.nn.functional.relu", "torch.sum" ] ]
MatthieuBlais/gcp-workflow-components
[ "0a9ace96a28f6580bcf39a34c16ceb097811d8b4" ]
[ "examples/serverless-ml/container/trainer/model.py" ]
[ "import logging\nimport os, json, math, shutil\nimport datetime\nimport numpy as np\nimport tensorflow as tf\nlogging.info(tf.version.VERSION)\n\n\nDATADIR = \"gs://freel-306204-ml/quests/serverlessml/data\"\nNUM_EVAL_EXAMPLES = 100000\nTRAIN_BATCH_SIZE = 32\nNUM_EVALS = 5\nNBUCKETS = 10\nNUM_TRAIN_EXAMPLES = 50000...
[ [ "tensorflow.keras.models.Model", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Dense", "tensorflow.sqrt", "tensorflow.py_function", "tensorflow.keras.layers.Reshape", "tensorflow.saved_model.save", "tensorflow.keras.activations.relu", "tensorflow.featur...
Dongzhixiao/Paddle
[ "b091fa1cd9ffd481e109c1eb4a4dc142d2794eed" ]
[ "python/paddle/fluid/tests/unittests/hybrid_parallel_mp_model.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.seed", "numpy.random.randint", "numpy.random.random_sample" ] ]
YashBansod/CMSC_818B_Decision_Making_in_Robotics
[ "4941bbc527b7bc857901799d22ce40a2de329787" ]
[ "Gaussian_Processes/problem4a_sol.py" ]
[ "# !/usr/bin/env python\n\"\"\"\nSolution for Problem 4a of the Assignment.\n\"\"\"\n# ****************************************** Libraries to be imported ****************************************** #\nfrom __future__ import print_function\n\nimport csv\nimport time\nimport argparse\nimport numpy as np\nfrom m...
[ [ "numpy.square", "numpy.array", "numpy.sin", "numpy.savetxt", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "sklearn.gaussian_process.GaussianProcessRegresso...
digimatronics/tensorflow1
[ "b0ab95c7af7c051d78dd74bd0a3032ce35273ea6" ]
[ "tensorflow/contrib/keras/python/keras/engine/topology.py" ]
[ "# Copyright 2015 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.contrib.keras.python.keras.backend.batch_set_value", "tensorflow.contrib.keras.python.keras.backend.backend", "tensorflow.python.util.tf_inspect.getargspec", "tensorflow.contrib.keras.python.keras.backend.batch_get_value", "tensorflow.contrib.keras.python.keras.layers.deserialize",...
das-projects/singlecell
[ "1433a3eb67e59bbf47089461c23acf1369a90e96" ]
[ "references/scdata_usage/180318_generic_benchmarks/memory_over_time.py" ]
[ "from memory_profiler import profile\nimport numpy as np\nfrom scanpy import neighbors\n\nnp.random.seed(0)\nX = np.random.rand(20000, 50)\n\n\n@profile\ndef numpy():\n neighbors.compute_neighbors_numpy(X, n_neighbors=10)\n\n\n@profile\ndef umap():\n neighbors.compute_neighbors_umap(X, n_neighbors=10)\n\n\n# ...
[ [ "numpy.random.seed", "numpy.random.rand" ] ]
CRZaug/NonlinearWaves
[ "2adfc2cc5e0c18576c6b73420a913ef1ce23000d" ]
[ "RunScriptIS.py" ]
[ "#import Master as ms\nimport MasterNEW_IS as ms\nimport os\nfrom sys import exit\nimport numpy as np\n\nref = 'Reference Directory Structure 6 Sims/'\n\n# The period in seconds. (3 h period)\nperiod = 10800\n\n# Delta f (SHOULD BE 1)\ndeltaf = 1 #mc/s\n\n# The simulations to run. Put 'y' if it is to be run:\nSIMUL...
[ [ "numpy.array" ] ]
ddavid/pyImSegm
[ "3604f8a215a782d101c0ecd538b9efaaf1931135" ]
[ "imsegm/utilities/read_zvi.py" ]
[ "\"\"\"\nhttps://searchcode.com/codesearch/view/40141634/\n\nread ZVI (Zeiss) image file\n\n- incomplete support\n- open uncompressed image from multi item image (Count>0)\n\n- require OleFileIO_PL - a Python module to read MS OLE2 files\n http: //www.decalage.info/en/python/olefileio#attachments\n\n.. code-block:...
[ [ "numpy.array", "numpy.fromstring", "numpy.reshape" ] ]
eggry/nn-emd
[ "5488e3b0de904415e27c9e9e9af3e1e3c8923025", "5488e3b0de904415e27c9e9e9af3e1e3c8923025" ]
[ "test/test_nn_normal.py", "nn/shallow/nn_emd.py" ]
[ "import sys\nimport datetime\nimport logging\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom nn.shallow.nn_shallow import NNShallow\nfrom nn.utils import load_mnist_size\nfrom nn.utils import load_mnist\nfrom nn.utils import timer\n\nt_str = str(datetime.datetime.today())\nlogging.basicConfig(\n l...
[ [ "numpy.sum", "numpy.unique" ], [ "numpy.zeros", "numpy.log", "numpy.random.seed", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.sign", "numpy.random.uniform", "numpy.abs", "numpy.squeeze" ] ]
aquibjaved/Snippext_public
[ "46cbc158dd5dd380fad19db576192eadea34df9b" ]
[ "run_pipeline.py" ]
[ "import torch\nimport torch.nn as nn\nimport os\nimport numpy as np\nimport random\nimport json\nimport jsonlines\nimport csv\nimport spacy\nimport re\nimport time\nimport argparse\nimport sys\n\nfrom torch.utils import data\nfrom tqdm import tqdm\nfrom collections import OrderedDict\n\nfrom snippext.model import M...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load" ] ]
iansuvak/incubator-airflow
[ "76d11f24c64abb53826b1bb99fe87a6bfc317c43" ]
[ "tests/core.py" ]
[ "# -*- coding: utf-8 -*-\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 in wri...
[ [ "numpy.testing.assert_array_almost_equal" ] ]
kostrykin/CarnaPy
[ "c7836cad216d439b7dc6504becd963d91d6b3a7f" ]
[ "test/test_py_demo3.py" ]
[ "import test_tools\nimport carna.py as cpy\nimport math\nimport numpy as np\nimport scipy.ndimage as ndi\n\nimport faulthandler\nfaulthandler.enable()\n\ntest = test_tools.BatchTest()\n\n# =========================================\n# Create toy volume data\n# =========================================\n\ndef gaussia...
[ [ "numpy.random.seed", "scipy.ndimage.label", "numpy.random.randn", "scipy.ndimage.gaussian_filter1d" ] ]
varlamnet/group_testing
[ "a119c4967af22ceeffb89dcf6267fd262d327552" ]
[ "Algorithms.py" ]
[ "import numpy as np\nfrom Functions import thresholder\nfrom sklearn.linear_model import Lasso\n\nclass Algorithm():\n def __init__(self,x,n,k,m,*args):\n \"\"\"Runs known algorithms. Takes >=4 arguments and generates an (m x n) \n sensing matrix A and an (m x 1) vector y of observed test results.\n\n Arg...
[ [ "numpy.dot", "sklearn.linear_model.Lasso", "numpy.zeros", "numpy.round", "numpy.sum", "numpy.random.permutation", "numpy.where", "numpy.sign", "numpy.arange", "numpy.maximum" ] ]
StKyr/astroML_figures
[ "45e9748335e0cd854d09319dff0e43ecd70e7b61", "45e9748335e0cd854d09319dff0e43ecd70e7b61", "45e9748335e0cd854d09319dff0e43ecd70e7b61" ]
[ "book_figures/chapter3/fig_conditional_probability.py", "book_figures/chapter9/fig_simple_naivebayes.py", "book_figures/chapter5/fig_odds_ratio_cauchy.py" ]
[ "from __future__ import division\n\"\"\"\nJoint and Conditional Probabilities\n-----------------------------------\nFigure 3.2.\n\nAn example of a two-dimensional probability distribution. The color-coded\npanel shows p(x, y). The two panels to the left and below show marginal\ndistributions in x and y (see eq. 3.8...
[ [ "numpy.histogram2d", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.text", "numpy.random.normal", "numpy.sin", "numpy.random.seed", "numpy.sum", "matplotlib.pyplot.figure", "matplotlib.ticker.NullFormatter", "numpy.cos", "matplotlib.pyplot.show", "numpy.linspace",...
YINZHI-keji/Lenia
[ "adfc542939266de7f4bb7ebb552e8499701ee107" ]
[ "Python/LeniaNDK.py" ]
[ "import numpy as np # pip3 install numpy\nimport scipy.ndimage # pip3 install scipy\nimport scipy.spatial.distance, scipy.signal\nimport reikna.fft, reikna.cluda # pip3 install pyopencl/pycuda, reikna\nimport PIL.Image, PIL.ImageTk # pip3 install pillow\nimport ...
[ [ "numpy.random.rand", "numpy.minimum", "numpy.set_printoptions", "numpy.rint", "numpy.exp", "numpy.radians", "numpy.fft.fft", "numpy.cos", "numpy.sin", "numpy.linalg.norm", "numpy.angle", "numpy.log", "numpy.hsplit", "numpy.eye", "numpy.random.randint", ...
alexanu/atpy
[ "3f4b5cfe7de7633ef053d2feaddae421806a9799" ]
[ "atpy/data/iqfeed/util.py" ]
[ "import logging\nimport os\nimport queue\nimport tempfile\nimport typing\nimport zipfile\nfrom collections import OrderedDict, deque\n\nimport numpy as np\nimport pandas as pd\nimport requests\n\nimport pyiqfeed as iq\n\n\ndef dtn_credentials():\n return os.environ['DTN_PRODUCT_ID'], os.environ['DTN_LOGIN'], os....
[ [ "pandas.isnull", "pandas.DataFrame" ] ]
axel-sirota/sagemaker-course
[ "3cedf07354262d8c40d4ffc4d89baf0774855f0f" ]
[ "labs/workshop-day2/solutions/preprocess.py" ]
[ "import glob\nimport numpy as np\nimport os\nfrom sklearn.preprocessing import StandardScaler\n\nif __name__ == \"__main__\":\n\n input_files = glob.glob(\"{}/*.npy\".format(\"/opt/ml/processing/input\"))\n print(\"\\nINPUT FILE LIST: \\n{}\\n\".format(input_files))\n scaler = StandardScaler()\n x_train...
[ [ "numpy.load", "numpy.save", "sklearn.preprocessing.StandardScaler" ] ]
cassiobotaro/Rivendell
[ "dcdb2543e42dea26dc07c9134d65b48f2c99bcc7" ]
[ "cv/pallete.py" ]
[ "# module to generate images based on colors\nimport numpy as np\nimport cv2\n\nwidth = height = 100\nchannels = 3\n\n# name -> b,g,r\ncolors = {\n 'white': (255, 255, 255),\n 'red': (0, 0, 255),\n 'blue': (255, 0, 0),\n 'green': (0, 255, 0),\n 'cyan': (255, 255, 0),\n 'magenta': (255, 0, 255),\n ...
[ [ "numpy.ndarray" ] ]
ComputermindCorp/DeepEye
[ "61b128c4914d98d3baffd9dedc8735c3738efe25" ]
[ "src/classification/model/train.py" ]
[ "# DeepLerning libs\r\nimport tensorflow as tf\r\nimport tensorflow.keras as keras\r\nfrom tensorflow.keras.callbacks import (\r\n ReduceLROnPlateau,\r\n EarlyStopping,\r\n ModelCheckpoint,\r\n CSVLogger,\r\n TensorBoard\r\n)\r\nfrom . import util\r\nfrom . import const\r\nfrom . import Network\r\nfr...
[ [ "tensorflow.keras.optimizers.Adamax", "tensorflow.keras.optimizers.SGD", "tensorflow.config.experimental.set_memory_growth", "tensorflow.keras.optimizers.Nadam", "tensorflow.keras.optimizers.RMSprop", "tensorflow.keras.optimizers.Adagrad", "tensorflow.keras.optimizers.Adadelta", "t...
BobbyZhouZijian/AI-Algo-Implmentations
[ "5592d3c358cc1611a1bde61797b93c0d6eee10c6" ]
[ "classification/svm_improved.py" ]
[ "\"\"\"\nThe basic version of SVM uses gradietn ascent\nto find the local maxima of the loss function:\n\nL = 1/2 ||w||^2 + C / N * sum (max(0, 1 - yi(w * xi + b)))\n\nWhile it works, it takes much time to finetune the value of\nthe learning rate in order to for the loss function to converge.\n\nSMO (Sequential Min...
[ [ "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "numpy.mean", "numpy.multiply", "pandas.read_csv" ] ]
dfelikson/GrIS-thinning-limits-and-knickpoints
[ "2eba818d3cabdacb77a917cc33013df71962d1e7" ]
[ "fig2b_thinning_limits_and_knickpoint_geometry.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport glob\n\nfrom netCDF4 import Dataset\n\nimport utils\nfrom matplotlib import pyplot as plt\n\n# Setup\nnetcdf_dir = 'netcdfs'\n\nbasins_mtn = [1.2, 1.3, 2.2, 3.1, 3.2, 3.3, 4.1, 4.3, 5.0, 6.1, 7.2]\nbasins_gtl = [1.1, 1.4, 2.1, 4.2, 6.2, 7.1, 8.1, 8.2]\n\n# Proces...
[ [ "numpy.array", "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.hist", "numpy.arange", "matplotlib.pyplot.ylabel" ] ]
PFMassiani/vibly
[ "5e552cb2ed375d5cd378b92de2f2473485211f2f" ]
[ "demos/computeQ_spaceship4.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport models.spaceship4 as sys\nfrom models.spaceship4 import p_map\nimport viability as vibly # algorithms for brute-force viability\nimport pickle\n\n# * here we choose the parameters to use\n# * we also put in a place-holder action (thrust)\np = {'n_states'...
[ [ "matplotlib.pyplot.show", "numpy.array", "numpy.linspace", "matplotlib.pyplot.imshow" ] ]
tomekrzymyszkiewicz/TSP-simulated-annealing
[ "f6d4cbd73ed48099bb545879cde83c974ecd6b03" ]
[ "quality_from_neighbour.py" ]
[ "#!/usr/bin/python\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom matplotlib import pyplot as pllt\nfrom scipy.special import gamma\n\ndef main():\n if len(sys.argv)>1:\n data = pd.read_csv(str(sys.argv[1]),usecols=['graph_name','calculated_path','calculated_path_weight','defined_path_weight',...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
NishanthVAnand/new_env_gym
[ "6ed044e8ab9b64fb3e6b3def432609833730a60a" ]
[ "parr_russell/envs/grid_world.py" ]
[ "import numpy as np\nimport sys\nfrom six import StringIO, b\n\nfrom gym import utils\nfrom gym.envs.toy_text import discrete\nfrom gym import Env, spaces\nfrom gym.utils import seeding\n\nLEFT = 0\nDOWN = 1\nRIGHT = 2\nUP = 3\n\nMAPS = {\n \"4x3\": [\n \"FFFP\",\n \"FFFN\",\n \"SFFF\"\n ...
[ [ "numpy.array", "numpy.asarray", "numpy.cumsum" ] ]
sithu31296/audio-tagging
[ "04bf3f6ae850564d00fdf8286179818dfe1b880a" ]
[ "datasets/fsdkaggle.py" ]
[ "import torch\nimport random\nimport torchaudio\nfrom pathlib import Path\nfrom torch import Tensor\nfrom torchaudio import transforms as T\nfrom torch.nn import functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom typing import Tuple\nfrom .transforms import mixup_augment\n\n\nclass FSDKaggle201...
[ [ "torch.zeros", "torch.nn.functional.one_hot", "torch.tensor", "torch.utils.data.DataLoader" ] ]
wilsonkl/exemplar-graph
[ "b161baadadb807e3665e4876fab6384259a73ad7" ]
[ "experiments/sgf_connectivity.py" ]
[ "import numpy as np\nimport networkx as nx\n\n\ndef do_experiment(num_trials, alpha):\n \n results = [one_trial(alpha) for _ in range(num_trials)]\n return results\n\ndef one_trial(alpha):\n G = nx.generators.les_miserables_graph()\n Gnew = nx.spectral_graph_forge(G, alpha, transformation='modularity'...
[ [ "numpy.std", "numpy.linspace", "numpy.mean" ] ]
mtreinish/qiskit-machine-learning
[ "88c2a2c8813957fbc5320ee502efbf4e3df25710" ]
[ "qiskit_machine_learning/algorithms/regressors/neural_network_regressor.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ...
[ [ "sklearn.base.RegressorMixin.score" ] ]
pdkary/black-scholes-plus
[ "1df6d0e18416900ce9380e5428da58af6bb785fa" ]
[ "src/utils/PortfolioCalculator.py" ]
[ "from src.utils.transaction_logger import TranactionLogger, TransactionActions, TransactionTypes\nfrom src.utils.time_helpers import timestamp_to_string\nfrom src.data.option_data_service import OptionDataService\nfrom src.data.spot_data_service import SpotDataService\nfrom src.report_generator import ReportGenerat...
[ [ "numpy.vectorize" ] ]
Jiezheng2018/pandas
[ "896256ee02273bebf723428ee41cab31930a69f4" ]
[ "pandas/tests/frame/test_constructors.py" ]
[ "from collections import (\n OrderedDict,\n abc,\n)\nfrom datetime import (\n date,\n datetime,\n timedelta,\n)\nimport functools\nimport itertools\nimport re\n\nimport numpy as np\nimport numpy.ma as ma\nimport numpy.ma.mrecords as mrecords\nimport pytest\nimport pytz\n\nfrom pandas.compat import np...
[ [ "numpy.ma.masked_all", "numpy.random.rand", "pandas.DatetimeIndex", "pandas.CategoricalIndex", "pandas.Timestamp.now", "pandas.Timestamp", "pandas._testing.assert_series_equal", "pandas.period_range", "numpy.broadcast_to", "numpy.dtype", "numpy.concatenate", "pandas...
younesbelkada/altegrad_challenge
[ "90939d3a6ae7c6c80f121679d1c2499014f96a43" ]
[ "utils/dataset_utils.py" ]
[ "import numpy as np\nfrom rich.progress import Progress\nfrom rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn, TimeRemainingColumn,TimeElapsedColumn\n\ndef get_abstracts_dict(path):\n abstracts = dict()\n with open(path, 'r', encoding=\"latin-1\") as f:\n for line in f:\n ...
[ [ "numpy.array" ] ]
htjb/maxsmooth
[ "6187675a26230557f46428edddf060accc4cfe57" ]
[ "example_codes/best_basis_example.py" ]
[ "\"\"\"\nThis function can be used to identify which of the built in DCFs\nfits the data best before running joint fits.\n\nTo use it we begin by loading in the data,\n\"\"\"\n\nimport numpy as np\n\nx = np.load('Data/x.npy')\ny = np.load('Data/y.npy')\n\n\"\"\"\nand then importing the basis_test() function.\n\"\"\...
[ [ "numpy.arange", "numpy.load" ] ]
Bryce-Davidson/brycetools
[ "9bf779a302fb33c2474be0040dac96a3237692d3" ]
[ "brycetools/parsing.py" ]
[ "import os\nimport xmltodict\nimport pandas as pd\nimport collections\nfrom os import walk\n\n\nclass Parser:\n \"\"\"\n Dedicated to parsing Adobe XMP files into a pandas dataframe.\n \"\"\"\n def __init__(self, jpg_dir: str, data_dir: str):\n \"\"\"\n Args:\n jpg_dir (str): wh...
[ [ "pandas.DataFrame" ] ]
joamatab/gdstk
[ "af1cb67bb8b8e133483ca37ba06da7f8001977bc" ]
[ "benchmarks/flexpath-param.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright 2020-2020 Lucas Heitzmann Gabrielli.\n# This file is part of gdstk, distributed under the terms of the\n# Boost Software License - Version 1.0. See the accompanying\n# LICENSE file or <http://www.boost.org/LICENSE_1_0.txt>\n\nimport numpy\nimport gdspy...
[ [ "numpy.sum", "numpy.array", "numpy.sin", "numpy.cos" ] ]
ryuikaneko/exact_diagonalization
[ "723cf283e0eab05834a39ae455ee95538eb47412" ]
[ "testing/201106_ed_1d_TFIsing_no_kron_linearoperator.py" ]
[ "#!/usr/bin/env python\n\n# coding:utf-8\nfrom __future__ import print_function\nimport math\nimport numpy as np\nimport scipy.sparse\nimport scipy.sparse.linalg\nimport argparse\nimport time\nfrom numba import jit\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='transverse field Ising')\n ...
[ [ "numpy.binary_repr", "numpy.zeros" ] ]
Devedunkey/real-time-deep-face-recognition
[ "09fc1e928095ae257c5e783e2c84602e4908ebc1" ]
[ "src/ffff.py" ]
[ "\"\"\"An example of how to use your own dataset to train a classifier that recognizes people.\n\"\"\"\n# MIT License\n#\n# Copyright (c) 2016 David Sandberg\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), ...
[ [ "numpy.equal", "numpy.zeros", "tensorflow.get_default_graph", "numpy.random.seed", "tensorflow.Graph", "tensorflow.Session", "numpy.random.shuffle", "sklearn.svm.SVC", "numpy.argmax" ] ]
MatthiasDR96/inverted_pendulum_simulator
[ "c13314b625445c13a4225b88480e2bed772fe466" ]
[ "src/controllers/FiniteHorizonController.py" ]
[ "import numpy as np\n\n\nclass Control:\n \n def __init__(self, model):\n \n # Bind model\n self.model = model\n \n # Desired x_pos\n self.xd = 0.0\n \n # Control parameters\n self.N = 100 # Prediction and control horizon\n\n # Control par...
[ [ "numpy.zeros", "numpy.eye", "numpy.identity", "numpy.arange", "numpy.linalg.matrix_power", "numpy.kron", "numpy.mat" ] ]
viktor-ferenczi/open-imagilib
[ "3e7328840d58fd49eda28490e9bddf91390b1981" ]
[ "tests/test_image_compression.py" ]
[ "import cv2\nimport numpy as np\n\nfrom helpers import BaseTestCase\nfrom open_imagilib.image.compressor import compress\nfrom open_imagilib.image.decompressor import decompress\n\n\nclass TestImageCompression(BaseTestCase):\n\n def test_compression(self) -> None:\n self.do_compression('olympics')\n ...
[ [ "numpy.array" ] ]
ElementAI/beyond-trivial-explanations
[ "c517d7bdbab68b6a26f74cee4d15e948b3b47238" ]
[ "src/wrappers/__init__.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport tqdm\n\nfrom src.wrappers import tcvae\nfrom src.wrappers import classifier\nfrom src.wrappers import vae\nfrom src.wrappers import gradient_attacks\n\n\ndef get_wrapper(wrapper_name, exp_dict, savedir, datadir):\n if wrapper_name.lower() == \"vae\":\n ...
[ [ "torch.no_grad" ] ]