repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
poramasionwu/kmodes | [
"224b19bad77a3f2150a6cb754c6ae8f5140e4291"
] | [
"kmodes/util/dissim.py"
] | [
"\"\"\"\nDissimilarity measures for clustering\n\"\"\"\n\nimport numpy as np\n\n\ndef matching_dissim(a, b, **_):\n \"\"\"Simple matching dissimilarity function\"\"\"\n return np.sum(a != b, axis=1)\n\n\ndef jaccard_dissim_binary(a, b, **__):\n \"\"\"Jaccard dissimilarity function for binary encoded variab... | [
[
"numpy.take",
"numpy.unique",
"numpy.isnan",
"numpy.bitwise_and",
"numpy.intersect1d",
"numpy.where",
"numpy.sum",
"numpy.bitwise_or"
]
] |
Ashutosh-Malve/qiskit-aqua | [
"649bd70a2a3465e37ef1ff1a04a62d4a63222177"
] | [
"test/finance/test_data_providers.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE... | [
[
"numpy.array"
]
] |
sebasc167/Traveling-Salesman-Genetic-Algo | [
"fe5cf133a20761c20721ee98675e02b205007164"
] | [
"GeneticAlgorithm.py"
] | [
"import random\r\nfrom math import *\r\nfrom random import *\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom CityClass import City\r\nfrom SolutionClass import Solution\r\n\r\nseed(10)\r\ncityList = []\r\nfor i in range(25):\r\n cityList.append(City(randint(0,200),randint(0,200)))\r\n\r\nclass M... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.suptitle",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
fromjupiter/SingerMatch | [
"d3c93ae12d280badc99d6187f5dcd477cbc5843a"
] | [
"singermatch/models/XGBoosting.py"
] | [
"import configparser\nimport pickle\nfrom collections import OrderedDict\n\nimport numpy as np\nfrom sklearn.metrics import f1_score\n\nfrom routines import Routines\nimport xgboost as xgb\n\nconfig = configparser.ConfigParser()\nconfig.read('../../system.ini')\nroutines = Routines(config)\n\nwith open(routines.ess... | [
[
"sklearn.metrics.f1_score",
"numpy.array",
"numpy.zeros"
]
] |
CMU-IDS-2021/fp--05839-abby-jeff-kyle-will | [
"be51cce899d636c2e2811e66cf738b5c59406819"
] | [
"support/word_cloud.py"
] | [
"# word_cloud.py\n# Word cloud generation.\n\nimport pandas as pd\nimport altair as alt\nfrom textblob import TextBlob\nimport matplotlib.pyplot as plt\nimport streamlit as st\nfrom wordcloud import WordCloud, STOPWORDS, ImageColorGenerator\n\n\ndef buildWordCloudText(data):\n text = \"\"\n for i in range(len... | [
[
"matplotlib.pyplot.imshow",
"pandas.DataFrame",
"pandas.read_json",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
]
] |
roseDickinson/nismod2 | [
"5c571b055a6f5dc26bdc2bc8950b9cf1c9202fca"
] | [
"models/transport/run.py"
] | [
"\"\"\"Transport model wrapper\n\"\"\"\n# -*- coding: utf-8 -*-\n\nimport configparser\nimport csv\nimport os\nfrom subprocess import check_output, CalledProcessError\nfrom string import Template\n\nimport pandas as pd\nimport numpy as np\nfrom smif.data_layer.data_array import DataArray\nfrom smif.exception import... | [
[
"pandas.concat",
"numpy.array",
"numpy.zeros",
"pandas.read_csv"
]
] |
Rihanamsadek/keras | [
"4c16931b49aceb38b763b4a24a55a99b6847e29b"
] | [
"keras/engine/training.py"
] | [
"\"\"\"Training-related part of the Keras engine.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport warnings\nimport copy\nimport numpy as np\n\nfrom .network import Network\nfrom .base_layer import Layer\nfrom .training_utils import co... | [
[
"numpy.asarray",
"numpy.expand_dims"
]
] |
gpleiss/uncertainty-baselines | [
"60b08e50e8d64cbd4d09689a35d5be81ed15e624"
] | [
"baselines/cifar/sngp_ensemble.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Uncertainty Baselines 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# Unles... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.nn.softmax",
"tensorflow.concat",
"tensorflow.random.set_seed",
"tensorflow.reduce_mean",
"tensorflow.train.Checkpoint",
"tensorflow.io.gfile.exists",
"tensorflow.cast",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.GFile",... |
zurk/hmr2.0 | [
"3ce454ce7a94f9c4786d2ccb7095940be5e31582"
] | [
"keypoint_annotation_tool/loader/smpl_loader.py"
] | [
"import pickle\nfrom glob import glob\n\nimport cv2\nimport numpy as np\n\n\nclass SmplLoader:\n\n def __init__(self):\n super(SmplLoader, self).__init__()\n\n def init_model(self, file_name):\n with open(file_name, \"rb\") as f:\n model = pickle.load(f)\n\n self.faces = model[... | [
[
"numpy.eye",
"numpy.matmul",
"numpy.dstack",
"numpy.ones",
"numpy.concatenate",
"numpy.load",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
Luma-1994/lama | [
"60d802e2e4cce789f03eea11b038212ba5f7fd1b"
] | [
"FactorNet/CEBPB/meta_Unique35_DGF/dataloader.py"
] | [
"\"\"\"Basenji dataloader\n\"\"\"\n# python2, 3 compatibility\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport numpy as np\nimport pandas as pd\nimport pybedtools\nfrom pybedtools import BedTool\nfrom genomelake.extractors import FastaExtractor, BigwigExtractor\nfrom kipoi.data... | [
[
"numpy.isnan",
"pandas.read_csv",
"numpy.concatenate"
]
] |
sayef/coref | [
"6c2d99886189000b44bf4cc5c1f65dd06267d348"
] | [
"util.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport errno\nimport codecs\nimport collections\nimport shutil\nimport sys\n\nimport numpy as np\nimport tensorflow as tf\nimport pyhocon\n\nfrom . import independent\nfrom . import overlap\... | [
[
"numpy.diag",
"numpy.dot",
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.tanh",
"numpy.random.randn",
"numpy.linalg.qr",
"tensorflow.nn.conv1d",
"tensorflow.truncated_normal_initializer",
"tensorflow.squeeze",
"tensorflow.gather",
"numpy.zeros",
"t... |
kangzh015/radiomics | [
"1291d918272e46daeb98dd819800a7f9f89fffa6"
] | [
"skradiomics/feature_extraction/firstorder.py"
] | [
"# !/usr/bin/env python\n# -*- coding:utf-8 -*-\n# author: jeremy.zhang(szujeremy@gmail.com, Shenzhen University, China)\n\nimport copy\nimport collections\nimport numpy as np\nimport SimpleITK as sitk\n\nfrom .base import RadiomicsBase, bin_image\nfrom skradiomics.utils.modules import FEATURE_EXTRACTORS\n\n#\n# @F... | [
[
"numpy.nanmax",
"numpy.nanpercentile",
"numpy.nanmedian",
"numpy.spacing",
"numpy.sqrt",
"numpy.absolute",
"numpy.unique",
"numpy.isnan",
"numpy.power",
"numpy.log2",
"numpy.nanmin",
"numpy.nansum",
"numpy.nanmean",
"numpy.prod",
"numpy.nanstd",
"num... |
riga/tensorfunk | [
"f607c554911cc39795c3ca696cdb0a747e291e04"
] | [
"tests/models/simple2.py"
] | [
"# -*- coding: utf-8 -*-\n\n\nimport tensorflow as tf\nimport tfdeploy as td\n\n\nsess = tf.Session()\n\nx = tf.placeholder(tf.float32, shape=[None, 10], name=\"input\")\nkeep_prob = tf.placeholder(tf.float32, name=\"keep_prob\")\n\nW = tf.Variable(tf.truncated_normal([10, 5], stddev=0.05))\nb = tf.Variable(tf.zero... | [
[
"tensorflow.matmul",
"tensorflow.truncated_normal",
"tensorflow.zeros",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.initialize_all_variables",
"tensorflow.Session",
"tensorflow.nn.dropout"
]
] |
cvtower/InsightFace_Pytorch | [
"51b15c52527a521ff15b703d93b15feb788d456f"
] | [
"config.py"
] | [
"from easydict import EasyDict as edict\nfrom pathlib import Path\nimport torch\nfrom torch.nn import CrossEntropyLoss\nfrom torchvision import transforms as trans\n\ndef get_config(training = True):\n conf = edict()\n conf.data_path = Path('data')\n conf.work_path = Path('work_space/')\n conf.model_pat... | [
[
"torch.nn.CrossEntropyLoss",
"torch.cuda.is_available"
]
] |
diane-wagner/dino | [
"94175993abde84179449d79e22eab7ea28dec14b"
] | [
"eval_video_segmentation.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\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 ... | [
[
"torch.nn.functional.normalize",
"torch.mm",
"torch.max",
"torch.zeros",
"torch.cat",
"torch.topk",
"torch.min",
"numpy.asarray",
"torch.sum",
"torch.from_numpy",
"numpy.atleast_3d",
"torch.no_grad",
"torch.bmm",
"torch.nn.functional.interpolate",
"torch... |
danielhrisca/vedo | [
"487568b7956a67b87752e3d518ba3f7e87b327a6",
"487568b7956a67b87752e3d518ba3f7e87b327a6",
"487568b7956a67b87752e3d518ba3f7e87b327a6"
] | [
"examples/pyplot/plot3_pip.py",
"examples/pyplot/plot7_stream.py",
"examples/pyplot/plot0_multi.py"
] | [
"\"\"\"Picture in picture plotting\"\"\"\nfrom vedo import show\nfrom vedo.pyplot import plot, settings\nimport numpy as np\n\nsettings.defaultFont = 'Theemim'\n\nx = np.arange(0, 4, 0.1)\ny1 = 3*np.exp(-x)\ny2 = 3*np.exp(-x)*np.cos(2*x)**2\n\naxes_opts = dict(numberOfDivisions=3, xyPlaneColor='lavender', xyAlpha=1... | [
[
"numpy.arange",
"numpy.exp",
"numpy.cos"
],
[
"numpy.random.rand"
],
[
"numpy.linspace"
]
] |
bisite/TwitterProfiling | [
"60148b7eaa93c2e5437af373c323601597a843ad"
] | [
"twitterprofiling/__init__.py"
] | [
"import twitterprofiling.twitter_manager as tm\nfrom twitterprofiling.User import User\nfrom twitterprofiling.auxiliar import *\nfrom twitterprofiling.analysis import *\nimport pandas as pd\nimport pickle\nimport pkg_resources\n\nname = \"twitterprofiling\"\n\n\nclass TwitterProfiling:\n\n \"\"\"\n The main c... | [
[
"pandas.DataFrame"
]
] |
EstebM/QRevPy | [
"3f788d1f84dfd075bbf25cf8d4b47943f9bfe682",
"3f788d1f84dfd075bbf25cf8d4b47943f9bfe682"
] | [
"UI/CrossSection.py",
"UI/BeamDepths.py"
] | [
"import numpy as np\r\nfrom PyQt5 import QtCore\r\n\r\n\r\nclass CrossSection(object):\r\n \"\"\"Class to generate final cross sections using the user settings.\r\n What cross sections are plotted are controlled by the user through checkboxes.\r\n\r\n Attributes\r\n ----------\r\n canvas: MplCanvas\r... | [
[
"numpy.nanmax",
"numpy.ceil",
"numpy.isnan"
],
[
"numpy.isnan",
"numpy.logical_not",
"numpy.ceil",
"numpy.nanmax"
]
] |
Neuraxio/NeuraAxle | [
"93699871e475ef3b275498488b6243390e18596c"
] | [
"testing/steps/test_numpy_steps.py"
] | [
"\"\"\"\nTests for NumPy Steps\n========================================\n\n..\n Copyright 2019, Neuraxio Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n htt... | [
[
"numpy.concatenate",
"numpy.copy",
"numpy.random.random",
"numpy.ones"
]
] |
biemann/rl-testbed-for-energyplus | [
"a01be4d12eda970b352729ff6cb4a3eea8ddee6a"
] | [
"gym_energyplus/envs/energyplus_model.py"
] | [
"# Copyright (c) IBM Corp. 2018. All Rights Reserved.\n# Project name: Reinforcement Learning Testbed for Power Consumption Optimization\n# This project is licensed under the MIT License, see LICENSE\n\nimport json\nimport math\nimport os\nimport sys\nimport time\nfrom abc import ABCMeta, abstractmethod\nfrom datet... | [
[
"pandas.read_csv",
"numpy.clip",
"matplotlib.widgets.Button",
"numpy.min",
"numpy.max",
"numpy.std",
"numpy.average",
"matplotlib.pyplot.rcdefaults",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
anishjain18/Character-level-language-modeling | [
"deb544ba4ce726c1342fde98c0a2b9f7e13ea5d0"
] | [
"Character level language modeling/utils.py"
] | [
"import numpy as np\n\ndef softmax(x):\n e_x = np.exp(x - np.max(x))\n return e_x / e_x.sum(axis=0)\n\ndef smooth(loss, cur_loss):\n return loss * 0.999 + cur_loss * 0.001\n\ndef print_sample(sample_ix, ix_to_char):\n txt = ''.join(ix_to_char[ix] for ix in sample_ix)\n txt = txt[0].upper() + txt[1:] ... | [
[
"numpy.dot",
"numpy.log",
"numpy.random.seed",
"numpy.max",
"numpy.copy",
"numpy.zeros_like",
"numpy.random.randn",
"numpy.zeros"
]
] |
LoniQin/tensorflow | [
"b632883f3a009a4fb2b7b3d2108f7d66971e3785"
] | [
"tensorflow/python/keras/distribute/custom_training_loop_metrics_test.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.distribute.multi_process_runner.test_main",
"tensorflow.python.keras.metrics.Mean",
"tensorflow.python.data.ops.dataset_ops.Dataset.range",
"tensorflow.python.framework.test_combinations.combine",
"tensorflow.python.framework.constant_op.constant"
]
] |
maromaSamsa/mobile-semantic-segmentation-master | [
"2cb772f0f17b3c810eae0751dcf3776b0442bb9b"
] | [
"src/mylib/torch/functional.py"
] | [
"import torch\nimport torch.nn.functional as F\n\n\n@torch.jit.script\ndef calculate_distances(p0: torch.Tensor, p1: torch.Tensor) -> torch.Tensor:\n # ReLU prevents negative numbers in sqrt\n Dij = torch.sqrt(F.relu(torch.sum((p0 - p1) ** 2, -1)))\n return Dij\n\n\ndef calculate_torsions(p0: torch.Tensor,... | [
[
"torch.cat",
"torch.sum",
"torch.tensor",
"torch.atan2",
"torch.cross"
]
] |
brandontrabucco/bvn | [
"ea8c3d3de590f4127505e33f41bb0da8bdfc27be"
] | [
"bvn/__init__.py"
] | [
"from bvn.bvn_step import bvn_step\r\nimport tensorflow as tf\r\nimport numpy as np\r\n\r\n\r\nTOLERANCE = np.finfo(np.float).eps * 10.\r\n\r\n\r\n@tf.function(input_signature=[\r\n tf.TensorSpec(shape=[None, None, None], dtype=tf.float32),\r\n tf.TensorSpec(shape=None, dtype=tf.int32)])\r\ndef bvn(x, max_ite... | [
[
"tensorflow.constant",
"tensorflow.less",
"tensorflow.TensorArray",
"tensorflow.shape",
"tensorflow.equal",
"numpy.finfo",
"tensorflow.zeros_like",
"tensorflow.where",
"tensorflow.reduce_all",
"tensorflow.TensorSpec",
"tensorflow.abs"
]
] |
juexinwang/scGNN | [
"09ac50ba0a2bbf87535613a2d284872074804d02"
] | [
"Preprocessing_benchmark.py"
] | [
"# For benchmark preprocessing usage:\n#\n# python Preprocessing_scFile.py --inputfile /home/wangjue/biodata/scData/allBench/9.Chung/T2000_UsingOriginalMatrix/T2000_expression.txt --outputfile /home/wangjue/biodata/scData/9.Chung.csv --cellcount 317 --genecount 2000 --split space --cellheadflag False\n# python Prep... | [
[
"numpy.asarray"
]
] |
Imanflow/pandas | [
"c124e475d0c0798e3bf4c5e947ebac7bd2f1232c"
] | [
"pandas/core/strings.py"
] | [
"import numpy as np\n\nfrom pandas.compat import zip\nfrom pandas.core.dtypes.generic import ABCSeries, ABCIndex\nfrom pandas.core.dtypes.missing import isna, notna\nfrom pandas.core.dtypes.common import (\n is_bool_dtype,\n is_categorical_dtype,\n is_object_dtype,\n is_string_like,\n is_list_like,\n... | [
[
"pandas.compat.binary_type.__mul__",
"numpy.asarray",
"numpy.ndarray",
"pandas.DataFrame",
"pandas.core.dtypes.missing.notna",
"numpy.where",
"pandas.core.dtypes.common.is_string_like",
"pandas.core.index.MultiIndex.from_tuples",
"numpy.logical_or.reduce",
"pandas._libs.lib... |
felipemoran/tcc_sfm | [
"b0b35e92c7c2f86d84120366147a8a650d0a4f7c"
] | [
"pipeline/utils.py"
] | [
"import os\nfrom itertools import count, chain\nfrom dataclasses import dataclass\n\nimport numpy as np\n\n\nTYPE_CALIBRATION_MATRIX = 0\nTYPE_CAMERA = 1\nTYPE_POINT = 2\n\n\n@dataclass\nclass ErrorMetric:\n frame_number: int\n projection: float\n cam_orientation: float\n cam_position: float\n point_... | [
[
"numpy.isnan",
"numpy.eye",
"numpy.matmul",
"numpy.setdiff1d",
"numpy.intersect1d",
"numpy.zeros",
"numpy.isin"
]
] |
snowde/tsfresh | [
"6cf12fe769762a7c9369a9c78a3a519a28d5c707"
] | [
"tests/units/feature_selection/test_significance_tests.py"
] | [
"import pytest\nimport numpy as np\nimport pandas as pd\n\nfrom tsfresh.defaults import TEST_FOR_BINARY_TARGET_REAL_FEATURE\nfrom tsfresh.feature_selection.significance_tests import target_binary_feature_binary_test, \\\n target_binary_feature_real_test, target_real_feature_real_test, target_real_feature_binary_... | [
[
"numpy.random.binomial",
"numpy.random.normal",
"numpy.ndarray",
"numpy.random.seed"
]
] |
kyraikeda/ginga | [
"e0ce979de4a87e12ba7a90eec0517a0be05d14bc",
"e0ce979de4a87e12ba7a90eec0517a0be05d14bc"
] | [
"ginga/examples/gw/example1_video.py",
"ginga/gtk3w/Plot.py"
] | [
"#! /usr/bin/env python\n#\n# video_play.py -- video playback example with Ginga\n#\n# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.txt for details.\n#\n\"\"\"\nThis example shows how you can set up a recurring refresh rate in Ginga.\nIt reads a video file and displays f... | [
[
"numpy.isnan"
],
[
"matplotlib.use"
]
] |
markelg/ESMValCore | [
"5656fb8b546eeb4d750a424de7ed56a237edfabb"
] | [
"tests/unit/preprocessor/_other/test_other.py"
] | [
"\"\"\"Unit tests for the :func:`esmvalcore.preprocessor._other` module.\"\"\"\n\nimport unittest\n\nimport iris.coord_categorisation\nimport iris.coords\nimport numpy as np\nfrom cf_units import Unit\nfrom iris.cube import Cube\nfrom numpy.testing import assert_array_equal\n\nfrom esmvalcore.preprocessor._other im... | [
[
"numpy.arange",
"numpy.array"
]
] |
allam-labs/compression | [
"0c0e40f3899bcb1f14c4a9d4fbcf6906e40ef033"
] | [
"tensorflow_compression/python/ops/math_ops_test.py"
] | [
"# Copyright 2018 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.constant",
"tensorflow.zeros",
"tensorflow.ones_like",
"tensorflow.test.main",
"tensorflow.linspace",
"tensorflow.random.normal",
"tensorflow.abs",
"tensorflow.GradientTape"
]
] |
webdizz/expansion-ai | [
"80db4937365cfbecfbbd3c83f02ba0d740f422af"
] | [
"expansionai_env.py"
] | [
"import logging\nimport sys\n\nimport gym\nimport numpy as np\nfrom gym import spaces\nfrom gym.utils import seeding\nfrom six import StringIO\n\nlogger = logging.getLogger('ExpansionAiEnv')\n\nMY_LAYER = 1\n\n\nclass ExpansionAiEnv(gym.Env):\n metadata = {'render.modes': ['ansi']}\n\n def __init__(self, boar... | [
[
"numpy.resize",
"numpy.argwhere",
"numpy.random.randn",
"numpy.zeros",
"numpy.sum"
]
] |
champon1020/scene_graph_benchmark | [
"970a7499f8fa2854810bd650f6c991bcad5748db"
] | [
"maskrcnn_benchmark/modeling/detector/generalized_rcnn.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\"\"\"\nImplements the Generalized R-CNN framework\n\"\"\"\n\nimport torch\nfrom torch import nn\n\nfrom maskrcnn_benchmark.structures.bounding_box import BoxList\nfrom maskrcnn_benchmark.structures.image_list import to_image_list\n\nfrom ..b... | [
[
"torch.cuda.is_available"
]
] |
ishine/MAI | [
"64753cd2f59af2949896937c2e5dbfc4d8bab1e0"
] | [
"test/optest/tfunits/MaxPoolTest.py"
] | [
"import tensorflow as tf\n\nsess = tf.InteractiveSession()\n\nprint(\"-------------------With1Channels VALID------------\")\n\n#NHWC 2,2,4,1\ninputData=tf.constant([[[[-1.],[-2],[-3],[-4]],[[-5],[-6],[-7],[-8]]],[[[-9],[-10],[-11],[-12]],[[-13],[-14],[-15],[-16]]]])\n\n#target 2,1,3,1\ntarget=tf.nn.max_pool(inputDa... | [
[
"tensorflow.nn.max_pool",
"tensorflow.constant",
"tensorflow.InteractiveSession"
]
] |
fangchenli/zipline | [
"92abca6e0adb01af23cefd4de80c2c2721d72b89"
] | [
"tests/test_examples.py"
] | [
"#\n# Copyright 2013 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or... | [
[
"matplotlib.use",
"pandas.__version__.replace",
"pandas.isnull"
]
] |
PwLo3K46/vivit | [
"937642975be2ade122632d4eaef273461992d7ab"
] | [
"exp/exp02_noise_analysis/run_noise.py"
] | [
"\"\"\"Load saved models and evaluate noise.\"\"\"\n\nimport os\nfrom collections import defaultdict\n\nimport torch\nfrom backpack import backpack, extend\nfrom backpack.core.derivatives.convnd import weight_jac_t_save_memory\nfrom deepobs.pytorch.testproblems import cifar100_allcnnc\nfrom shared import (\n CON... | [
[
"torch.device",
"torch.manual_seed"
]
] |
RevanMacQueen/Riverswim-Variants | [
"a3593c6b2960185e1815b79aba5a2ccdb6ff9ea7"
] | [
"riverswim_variants/envs/stochastic_riverswim.py"
] | [
"import gym\nimport numpy as np\nfrom numpy.random import normal\n\nfrom gym import error, spaces, utils\nfrom gym.utils import seeding\nfrom gym.envs.toy_text import discrete\n\n\nLEFT = 0\nRIGHT = 1\n\ndef categorical_sample(prob_n, np_random):\n \"\"\"\n Sample from categorical distribution\n Each row s... | [
[
"numpy.asarray",
"numpy.random.normal",
"numpy.zeros",
"numpy.cumsum"
]
] |
ramseylab/RTX | [
"e5782b874021f22cafb21658f8c688a865186eeb"
] | [
"code/reasoningtool/QuestionAnswering/Q2Solution.py"
] | [
"import numpy as np\nnp.warnings.filterwarnings('ignore')\nimport os\nimport ReasoningUtilities as RU\nimport requests_cache\nrequests_cache.install_cache('orangeboard')\nimport argparse\nfrom itertools import compress\nimport sys\nimport CustomExceptions\ntry:\n\timport QueryNCBIeUtils\nexcept ImportError:\n\tsys.... | [
[
"numpy.isnan",
"numpy.warnings.filterwarnings"
]
] |
YueNing/tn_source_code | [
"515713c9349a2444021fdc9b02fd483f5ffd3e56",
"515713c9349a2444021fdc9b02fd483f5ffd3e56"
] | [
"drl_negotiation/a2c/distributions.py",
"drl_negotiation/core.py"
] | [
"import numpy as np\nimport tensorflow.compat.v1 as tf\nfrom tensorflow.python.ops import math_ops\nfrom gym import spaces\nimport drl_negotiation.utils as U\nfrom stable_baselines.common.tf_layers import linear\n\n\nclass ProbabilityDistribution(object):\n \"\"\"\n Base class for describing a probability dis... | [
[
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.zeros_initializer",
"tensorflow.compat.v1.shape",
"tensorflow.python.ops.math_ops.less",
"tensorflow.compat.v1.reduce_sum",
"tensorflow.compat.v1.sigmoid",
"tensorflow.compat.v1.round",
"tensorflow.compat.v1.stop_gradient",
"... |
ArashHosseini/deep_dream | [
"4f5fd39a6d0f23ff1dd2e33953e72c0b909f8a7e"
] | [
"inception.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\nclass Inception:\n\n input_image = \"input:0\"\n layer_names = [\"conv2d0\", \"conv2d1\", \"conv2d2\",\n \"mixed3a\", \"mixed3b\",\n \"mixed4a\", \"mixed4b\", \"mixed4c\", \"mixed4d\", \"mixed4e\",\n \"mixed5... | [
[
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.import_graph_def",
"tensorflow.reduce_mean",
"tensorflow.gradients",
"tensorflow.square",
"tensorflow.GraphDef",
"tensorflow.gfile.FastGFile"
]
] |
annakasprzik/qualle | [
"871f7fbce3d6d3da07fe7197cf21a5a68720645d"
] | [
"tests/features/test_confidence.py"
] | [
"# Copyright 2021 ZBW – Leibniz Information Centre for Economics\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Un... | [
[
"numpy.vstack"
]
] |
hajapy/Hexy | [
"06d920ac7882e41bbbd87a3b3e8131c2aa98dea5"
] | [
"hexy/hex_map.py"
] | [
"\"\"\"\nThis file contains routines for storing the properties of hexes\n\nThe keys are just the axial coordinates.\n\nKey Rules:\n- must be written 'a,b' without quotes\n- no spaces\n- a and b can be negative, so it is okay if the key is written as\n '-a,b' or 'a,-b' or '-a,-b'\n\"\"\"\nimport numpy as np\n\nfro... | [
[
"numpy.array",
"numpy.linalg.solve"
]
] |
marek-cottingham/magSonify | [
"74edf69e6a89365d9a08935d58332bfcd8cfedc1"
] | [
"Example Code/Sonification Algorithm Diagrams/audiotsmWithDebugOutput/wsola.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nThe :mod:`audiotsm.wsola` module implements the WSOLA (Waveform\nSimilarity-based Overlap-Add) time-scale modification procedure.\n\nWSOLA works in the same way as OLA, with the exception that it allows slight\nshift of the position of the analysis frames.\n\"\"\"\n\nimport numpy... | [
[
"numpy.copyto",
"numpy.correlate",
"numpy.argmax",
"numpy.empty"
]
] |
Jhsmit/PyHDX | [
"34bf653743008508bb14f24ccca21ee39b5b25e3",
"34bf653743008508bb14f24ccca21ee39b5b25e3"
] | [
"pyhdx/web/views.py",
"pyhdx/web/controllers.py"
] | [
"import logging\nfrom itertools import groupby, count\n\nimport holoviews as hv\nimport pandas as pd\nimport panel as pn\nimport param\nfrom bokeh.models import HoverTool, Span, Rect, Whisker\nfrom bokeh.models.formatters import NumeralTickFormatter\nfrom bokeh.plotting import figure\nfrom lumen.filters import Para... | [
[
"pandas.DataFrame"
],
[
"matplotlib.colors.BoundaryNorm",
"numpy.product",
"pandas.RangeIndex",
"numpy.issubdtype",
"matplotlib.pyplot.colormaps",
"pandas.DataFrame",
"numpy.all",
"numpy.max",
"numpy.mean",
"numpy.exp",
"numpy.nextafter",
"numpy.unique",
... |
Napam/JallaResearch | [
"f0ed573f20f050ec0a653bff09068eb11a9c4128"
] | [
"coalescmask/coalesc.py"
] | [
"# https://stackoverflow.com/questions/67557724/coalescing-rows-from-boolean-mask?noredirect=1#comment119461081_67557724\nimport numpy as np \n\nrows = np.r_['1,2,0', :6, :6]\nmask = np.tile([1, 1, 0, 0, 1, 1], (2,1)).T.astype(bool)\n\ndef maskforwardfill(a: np.ndarray, mask: np.ndarray):\n mask = mask.copy()\n ... | [
[
"numpy.diff",
"numpy.tile"
]
] |
carismoses/scipy | [
"f368dbdf8b94e848527ab0c80fc3683b83385305"
] | [
"scipy/optimize/linesearch.py"
] | [
"\"\"\"\nFunctions\n---------\n.. autosummary::\n :toctree: generated/\n\n line_search_armijo\n line_search_wolfe1\n line_search_wolfe2\n scalar_search_wolfe1\n scalar_search_wolfe2\n\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nfrom warnings import warn\n\nfrom scip... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.isfinite",
"numpy.clip",
"numpy.asarray",
"numpy.atleast_1d",
"scipy.optimize.minpack2.dcsrch",
"scipy._lib.six.xrange",
"numpy.errstate",
"numpy.zeros",
"numpy.empty"
]
] |
lantian165/Wechat_AutoJump | [
"665e80aa0c580bdb2a0c692e45ad334094d9e2b8",
"665e80aa0c580bdb2a0c692e45ad334094d9e2b8"
] | [
"test/plt.py",
"nn_play.py"
] | [
"#/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# 以灰度模式读入图片,这样img.shape就只有二维。否则还会多一维表示彩色\nimg=cv2.imread('Lena.jpg',cv2.IMREAD_GRAYSCALE)\nimg2 = img.copy()\n# 指定第二个参数0会导致mathTemplate执行报错:template = cv2.imread('Lena_eyes.png',0)\ntemplate = c... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.show"
],
[
"tensorflow.all_variables",
"numpy.expand_dims",
"numpy.linspace",
... |
eldadassa/eligibility_propagation | [
"6ca02ab509785e40c01161f8aa23ef60c49887bb"
] | [
"Syclop_e-prop-rl/compile_test.py"
] | [
"import argparse\nimport subprocess as sp\nimport tensorflow as tf\n\n# from subprocess import PIPE, run\n\ndef out(command):\n result = sp.run(command, stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True, shell=True)\n return result.stdout.rstrip()\n\ncflags = \" \".join(tf.sysconfig.get_compile_flags())... | [
[
"tensorflow.sysconfig.get_compile_flags",
"tensorflow.sysconfig.get_link_flags",
"tensorflow.sysconfig.get_include",
"tensorflow.sysconfig.get_lib"
]
] |
damonge/CCL | [
"04cb83885ccd5f343b48cd8151bebd5779518ca6"
] | [
"benchmarks/test_correlation_MG2.py"
] | [
"import os\nimport numpy as np\nimport pyccl as ccl\nfrom scipy.interpolate import interp1d\nimport pytest\n\n\n@pytest.fixture(scope='module', params=['fftlog', 'bessel'])\ndef corr_method(request):\n errfacs = {'fftlog': 0.21, 'bessel': 0.05}\n return request.param, errfacs[request.param]\n\n\n@pytest.fixtu... | [
[
"numpy.ones_like",
"numpy.arange",
"numpy.fabs",
"scipy.interpolate.interp1d",
"numpy.exp",
"numpy.zeros",
"numpy.loadtxt"
]
] |
kartikvega/Udacity | [
"e84643fbb2bd307d571308a5912c513f0ee6c459"
] | [
"tv-script-generation/problem_unittests.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib import rnn\n\n\ndef _print_success_message():\n print('Tests Passed')\n\n\ndef test_create_lookup_tables(create_lookup_tables):\n with tf.Graph().as_default():\n test_text = '''\n Moe_Szyslak Moe's Tavern Where the elite meet ... | [
[
"tensorflow.Graph",
"numpy.array_equal",
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.placeholder",
"numpy.array"
]
] |
jgd10/PySALESetup | [
"b2d5e2b50c198f7ac25842bf26ebbf4cad9ada47"
] | [
"examples/extension_zones.py"
] | [
"\"\"\"\nExtension zones are a bit fiddly in PySALESetup. They need\nto be created before the mesh object and fed in as arguments.\n\nThey must always be accompanied by an ExtensionZoneFactor as well\nwhich dictates how much they alter the cell size by.\n\"\"\"\n\nfrom PySALESetup import PySALEObject, PySALEMesh\nf... | [
[
"matplotlib.pyplot.show"
]
] |
PatrikValkovic/MasterThesis | [
"6e9f3b186541db6c8395ebc96ace7289d01c805b"
] | [
"src/FFEAT/test/strategies/initialization/UniformTest.py"
] | [
"###############################\n#\n# Created by Patrik Valkovic\n# 3/12/2021\n#\n###############################\nimport unittest\nimport torch as t\nfrom ffeat.strategies import initialization\n\n\nclass UniformTest(unittest.TestCase):\n def test_population_size_match(self):\n i = initialization.Unifor... | [
[
"torch.device",
"torch.all",
"torch.cuda.is_available",
"torch.full"
]
] |
fermi-lat/pointlike | [
"edcdc696c3300e2f26ff3efa92a1bd9790074247"
] | [
"python/uw/utilities/fitter.py"
] | [
"\"\"\"\nBasic fitter utilities\n\nAuthors: Matthew Kerr, Toby Burnett\n$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/utilities/fitter.py,v 1.10 2013/07/28 15:27:44 burnett Exp $\n\n\"\"\"\nimport types\nimport numpy as np\nfrom scipy import optimize #for fmin,fmin_powell,fmin_bfgs\nfrom numpy import li... | [
[
"numpy.maximum",
"numpy.abs",
"numpy.sqrt",
"numpy.minimum",
"numpy.asarray",
"numpy.linalg.inv",
"numpy.isnan",
"numpy.arange",
"numpy.ones",
"numpy.all",
"numpy.linalg.det",
"scipy.optimize.fmin",
"numpy.any",
"numpy.outer",
"numpy.array",
"numpy.z... |
vsocrates/biomedical_el | [
"12e3a3cf72acd18437bc9d94fc385a67bf0b2023"
] | [
"entitylinker/train_utils.py"
] | [
"import json\nimport torch \nfrom torch.utils.data import DataLoader\nimport torch.optim as optim\nfrom torch.nn import CrossEntropyLoss, NLLLoss\nimport torch.nn.functional as F \nfrom torch import autograd\n\nimport numpy as np \n\nfrom transformers.models.luke.configuration_luke import LukeConfig\nfrom transform... | [
[
"torch.zeros",
"torch.squeeze",
"torch.sum",
"torch.linalg.norm",
"torch.tensor",
"torch.no_grad",
"numpy.diff",
"torch.nn.functional.cosine_similarity",
"numpy.array",
"numpy.where",
"torch.ones_like",
"numpy.vstack",
"torch.argmax"
]
] |
stephen-hoover/portdash | [
"f358bcc53a17034dcf52c8c9d650a7fd88b4fec2"
] | [
"portdash/io/quotes.py"
] | [
"\"\"\"Retrieve information about assets from external sources\n\"\"\"\nfrom datetime import datetime\nimport logging\nimport os\nfrom typing import Tuple, Union\n\nimport pandas as pd\n\nfrom portdash.io._alphavantage import fetch_from_web, InvalidAPICall\n\nDEFAULT_QUOTE_SOURCE = \"alphavantage\"\nVALID_QUOTE_SOU... | [
[
"pandas.DataFrame"
]
] |
shibing624/cvnet | [
"5c5c688b530f07688cda85705591634286f0b848"
] | [
"ocr/create_imdb_dataset.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author:XuMing(xuming624@qq.com)\n@description: \n\"\"\"\n\n\"\"\" a modified version of CRNN torch repository https://github.com/bgshih/crnn/blob/master/tool/create_dataset.py \"\"\"\n\nimport os\n\nimport cv2\nimport fire\nimport lmdb\nimport numpy as np\n\n\ndef is_image_valid(i... | [
[
"numpy.frombuffer"
]
] |
JNMaree/solvdoku | [
"d7cbce8618b5a94db8781d88cf3db102e728f4f6"
] | [
"src/numerical/1D_FEM.py"
] | [
"import numpy\nimport matplotlib.pyplot as plot\n\nfrom base.nodespace_1D import NodeSpace1D\nfrom base.elementspace_1D import ElementSpace1D\nfrom base.polynomial import Polynomial\nfrom base.matrix import Matrix\nfrom gaussian_quadrature import GaussianQuad\n\nclass FiniteElementMethod:\n\n # Define the 1D mes... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.ylabel"
]
] |
haocwang/Deep-Learning-Specialization | [
"e2122a8e6be71b412a616b56f19c9b492e97e82b"
] | [
"Improving Deep Neural Networks/Week 1 Practical aspects of Deep Learning/Assignments/Regularization/reg_utils.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\nimport sklearn\nimport sklearn.datasets\nimport sklearn.linear_model\nimport scipy.io\n\ndef sigmoid(x):\n \"\"\"\n Compute the sigmoid of x\n\n Arguments:\n x -- A scalar or numpy array of any size.\n\n Return:\n s -- sigmoid(x)\n... | [
[
"numpy.dot",
"matplotlib.pyplot.contourf",
"numpy.sqrt",
"numpy.linspace",
"numpy.squeeze",
"numpy.random.randn",
"numpy.mean",
"numpy.exp",
"numpy.square",
"numpy.arange",
"numpy.sin",
"numpy.nansum",
"numpy.zeros",
"numpy.log",
"numpy.int64",
"nump... |
JakubSakowski/CMI2020 | [
"ebe3388544f690a20fab7d926364b67e7f441044"
] | [
"dziadekGnom/main.py"
] | [
"import sys\nimport pandas as pd \n\n# reading the data\ndf = pd.read_csv(sys.stdin, skiprows = 1, names = ['x', 'y'], sep = \" \")\n\n# printing the data\n# print(df)\n\n# finding min and max values\nxmin = df['x'].min()\nxmax = df['x'].max()\nymin = df['y'].min()\nymax = df['y'].max()\n# print (xmin, xmax, ymin, ... | [
[
"pandas.read_csv"
]
] |
RobRomijnders/bbvi | [
"613c4c9ba79f0b40488fe1d18a0b7f3c023b639f"
] | [
"bbvi/util.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom sklearn.datasets import load_wine\nfrom sklearn.model_selection import train_test_split\nfrom scipy.stats import multivariate_normal\n\n\nclass DataLoader:\n \"\"\"\n Small wrapper to abstract all code relating to loading data\n \"\"\"\n def __init__(se... | [
[
"tensorflow.get_variable",
"tensorflow.random_uniform_initializer",
"numpy.random.choice",
"sklearn.datasets.load_wine",
"sklearn.model_selection.train_test_split",
"tensorflow.exp",
"numpy.std",
"numpy.mean",
"tensorflow.nn.softplus",
"tensorflow.random_normal"
]
] |
coreyauger/py_deep_learning_udemy | [
"39c55d3c59a9bcb39f12bc255d76fd5b52a53e34"
] | [
"data.py"
] | [
"import matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\n\ndf = pd.read_csv('./data/titanic-train.csv')\nprint(type(df))\nprint(df.head())\nprint(df.info())\nprint(df.describe())\n\n#Indexing\nprint(df.iloc[3])\nprint(df.loc[0:4,'Ticket'])\nprint(df['Ticket'].head())\nprint(df[['Embarked', 'Ticket... | [
[
"pandas.read_csv"
]
] |
borgwang/tinynn-autograd | [
"daf914614236e03b0884a77a5d5df5f033f1d3c4"
] | [
"core/layers.py"
] | [
"\"\"\"Network layers and activation layers.\"\"\"\n\nimport numpy as np\n\nimport core.ops as ops\nfrom core.initializer import XavierUniformInit\nfrom core.initializer import ZerosInit\n\n\nclass Layer(object):\n\n def __init__(self, name):\n self.name = name\n\n self.params, self.grads = {}, {}\... | [
[
"numpy.exp"
]
] |
cdeil/pyregion | [
"83e235f51b41d327cdedf585f255a00af9f46c6d"
] | [
"doc/figures/test_region_drawing2.py"
] | [
"import matplotlib.pyplot as plt\nimport matplotlib.cm as cm\n\nimport pyregion\nimport pyfits\n\n# read in the image\nxray_name=\"pspc_skyview.fits\"\nf_xray = pyfits.open(xray_name)\n\ntry:\n import pywcsgrid2\n ax=pywcsgrid2.subplot(111, header=f_xray[0].header)\nexcept ImportError:\n ax=plt.subplot(111... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
jason718/auto-weights | [
"f9f9b4ecf3609dbde759203fa653dee9f2368a6e"
] | [
"libml/gradients_util.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Paper Authors.\n#\n# =======================================================================\n# 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 ... | [
[
"tensorflow.python.ops.array_ops.shape",
"tensorflow.python.ops.control_flow_util.IsSwitch",
"tensorflow.linalg.matmul",
"tensorflow.python.framework.ops.convert_n_to_tensor_or_indexed_slices",
"tensorflow.python.framework.ops.device",
"tensorflow.python.framework.ops.get_gradient_function... |
sailoridy/MAESTRO | [
"f957d148d2028324a2a1076be244f73dad63fd67"
] | [
"Util/postprocessing/central_angle_average/AngleAveragedProfile.py"
] | [
"\"\"\"\nClass for working with angle-averaged profiles.\n\nDonald E. Willcox\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nclass AngleAveragedProfile(object):\n def __init__(self, filename=None):\n self.init_vars()\n if filename:\n self.read_from_file(filename)\n ... | [
[
"numpy.absolute",
"matplotlib.pyplot.savefig",
"numpy.ceil",
"numpy.log10",
"matplotlib.pyplot.close",
"numpy.floor",
"numpy.array",
"numpy.where",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
TBC-TJU/MetaBCI-brainda | [
"d2dc655163b771ca22e43432d886ece3d98235c8",
"d2dc655163b771ca22e43432d886ece3d98235c8"
] | [
"brainda/datasets/tsinghua.py",
"brainda/algorithms/deep_learning/guney_net.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Authors: Swolf <swolfforever@gmail.com>\n# Date: 2021/01/07\n# License: MIT License\n\"\"\"\nTsinghua BCI Lab.\n\"\"\"\nimport os, zipfile\nfrom typing import Union, Optional, Dict, List, Tuple\nfrom pathlib import Path\n\nimport numpy as np\nimport py7zr\nfrom mne import create_info\... | [
[
"numpy.reshape",
"numpy.arange",
"numpy.concatenate",
"numpy.transpose",
"numpy.zeros"
],
[
"torch.nn.Dropout",
"torch.nn.Conv2d",
"torch.nn.init.xavier_normal_",
"torch.nn.Flatten",
"torch.nn.init.ones_",
"torch.no_grad",
"torch.nn.ReLU"
]
] |
shaojinding/Multilingual_Text_to_Speech | [
"5bcbe1154c759357a28a42f131dc59e77fa49e14"
] | [
"utils/logging.py"
] | [
"import random\nimport time\nimport logging\nimport os\n\nimport librosa.display\nimport matplotlib.pyplot as plt\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom utils import audio, text\nfrom params.params import Params as hp\n\n\nclass Logger:\n \"\"\"Static class wrapping methods for Tensorboard lo... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.colorbar",
"torch.utils.tensorboard.SummaryWriter",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
mm1860/Densenet_FCN | [
"a5360dce226257a8c826addec22bcf1cdbc66f69"
] | [
"test.py"
] | [
"import argparse\nimport os\nimport os.path as osp\nimport sys\nfrom pprint import pprint\n\nimport tensorflow as tf\n\nfrom config import cfg, update_cfg\nfrom fcn import FC_DenseNet\nfrom unet import UNet\nimport udn\nfrom solver import test_model_2D, test_model_3D\nfrom utils.logger import create_logger\n\ndef p... | [
[
"tensorflow.ConfigProto",
"tensorflow.Graph",
"tensorflow.train.Saver",
"tensorflow.Session"
]
] |
gmichalo/UmlsBERT | [
"ba4b084c44107bb509aee3ebc8772daeac7cf87d"
] | [
"text-classification/dataset/mednli/mednli.py"
] | [
"import pandas as pd\n\n\nclass mednil:\n def __init__(self, path1, path_med):\n self.path1 = path1\n self.path_med = path_med\n self.label = {}\n self.label[1] = 'entailment'\n self.label[0] = 'contradiction'\n self.label[2] = 'neutral'\n\n\n def read(self, path2, pa... | [
[
"pandas.DataFrame"
]
] |
AntoniosBarotsis/midi2img | [
"848f54c0f3a5175ee636c693b04b6363d00ee9c8"
] | [
"midi2img.py"
] | [
"from music21 import converter, instrument, note, chord\nimport json\nimport sys\nimport numpy as np\nfrom imageio import imwrite\n\ndef extractNote(element):\n return int(element.pitch.ps)\n\ndef extractDuration(element):\n return element.duration.quarterLength\n\ndef get_notes(notes_to_parse):\n\n \"\"\"... | [
[
"numpy.all",
"numpy.zeros"
]
] |
omriarad/mcas | [
"f47aab12754c91ebd75b0e1881c8a7cc7aa81278"
] | [
"src/python/pymm/testing/tensors.py"
] | [
"#!/usr/bin/python3 -m unittest\n#\n# testing transient memory (needs modified Numpy)\n#\nimport unittest\nimport pymm\nimport numpy as np\nimport torch\n\ndef colored(r, g, b, text):\n return \"\\033[38;2;{};{};{}m{} \\033[38;2;255;255;255m\".format(r, g, b, text)\n\ndef log(*args):\n print(colored(0,255,255... | [
[
"torch.randn",
"numpy.arange",
"torch.ones",
"torch.tensor"
]
] |
cherepas/circles_public | [
"7c8a429cb196fcca9d77d7e992af7a4c70882521"
] | [
"plot_output/e074/drafts/e074w004/main.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\nfrom __future__ import print_function\nfrom __future__ import division\nimport argparse\nimport open3d\nimport torch as t\n# here was hvd import\nimport torch.nn as nn\nimport numpy as np\nimport torchvision\nfrom torchvision import transforms\nfrom skimage import io, transf... | [
[
"numpy.nanmax",
"numpy.expand_dims",
"torch.transpose",
"torch.zeros",
"numpy.nanmin",
"torch.utils.data.DataLoader",
"numpy.max",
"torch.set_grad_enabled",
"torch.set_num_threads",
"numpy.mean",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"numpy.na... |
vferat/nipype | [
"c14f24eba1da08711bbb894e049ee858ed740096"
] | [
"nipype/interfaces/spm/base.py"
] | [
"# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"The spm module provides basic functions for interfacing with SPM tools.\n\nIn order to use the standalone MCR version of spm, you need to ensure that\nthe following co... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.dtype"
]
] |
koen-vg/pypsa-eur | [
"a431bbd5a75a54440fab93fd91577197968032e5"
] | [
"scripts/add_electricity.py"
] | [
"# SPDX-FileCopyrightText: : 2017-2020 The PyPSA-Eur Authors\n#\n# SPDX-License-Identifier: MIT\n\n# coding: utf-8\n\"\"\"\nAdds electrical generators and existing hydro storage units to a base network.\n\nRelevant Settings\n-----------------\n\n.. code:: yaml\n\n costs:\n year:\n USD2013_to_EUR201... | [
[
"pandas.read_csv",
"numpy.sqrt",
"pandas.Series",
"pandas.Index",
"pandas.DataFrame"
]
] |
IAM20/nothing | [
"45cb6da621a8c63e9329c14390b84a6a566bdf49"
] | [
"fairseq/options.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport sys\nfrom typing import Callable, List, Optional\n\nimport torch\n\nfrom fairseq import utils\nfrom fairseq.... | [
[
"torch.cuda.device_count"
]
] |
amankedia/Project-Euler | [
"acc48bf4731ad85e07c22c46cc18360eec3f20e6"
] | [
"AmicableNumbers.py"
] | [
"import numpy as np\ndef sumDivisors(x):\n sum = 1\n j = x\n sqrt = int(np.sqrt(x))\n for i in range(2, sqrt):\n if j%i==0:\n #print(j, i, j/i)\n sum = sum + i\n sum = sum + (j/i)\n if sqrt*sqrt == x:\n sum = sum - sqrt\n #print(sum)\n return sum\n... | [
[
"numpy.sqrt"
]
] |
nebw/pymc3 | [
"2fec315835a9a699a87d5ef931074c3692cca4b7"
] | [
"pymc3/distributions/mixture.py"
] | [
"import numpy as np\nimport theano.tensor as tt\n\nfrom pymc3.util import get_variable_name\nfrom ..math import logsumexp\nfrom .dist_math import bound, random_choice\nfrom .distribution import (Discrete, Distribution, draw_values,\n generate_samples, _DrawValuesContext)\nfrom .continuous ... | [
[
"numpy.asarray",
"numpy.arange",
"numpy.squeeze",
"numpy.tile",
"numpy.broadcast"
]
] |
EarthObservationSimulator/eosim | [
"8a589679235d7f93ed4bb7bad4e607f2ec23e604"
] | [
"eosim/gui/visualizeframe/vis2dframe.py"
] | [
"from tkinter import ttk \nimport tkinter as tk\nimport tkinter.filedialog, tkinter.messagebox\nfrom eosim import config\nfrom orbitpy import preprocess, orbitpropcov, communications, obsdatametrics, util\nimport instrupy\nimport pandas as pd\nimport numpy as np\n\nfrom matplotlib.backends.backend_tkagg import (\n ... | [
[
"pandas.concat",
"pandas.read_csv",
"numpy.sqrt",
"matplotlib.figure.Figure",
"pandas.DataFrame",
"matplotlib.backends.backend_tkagg.NavigationToolbar2Tk",
"numpy.array",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
]
] |
cuiheng1234/CT3D | [
"831eb3cb1bc32775c415db7eb3e77c5ad800c9bb"
] | [
"pcdet/datasets/__init__.py"
] | [
"import torch\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data import DistributedSampler as _DistributedSampler\n\nfrom pcdet.utils import common_utils\n\nfrom .dataset import DatasetTemplate\nfrom .kitti.kitti_dataset import KittiDataset\nfrom .waymo.waymo_dataset import WaymoDataset\n\n__all__ = {\... | [
[
"torch.Generator",
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler"
]
] |
MinjaMiladinovic/ignite | [
"007d320150fa915d7ac8757ddb586aaa9c427682"
] | [
"ignite/utils.py"
] | [
"import collections.abc as collections\nimport functools\nimport logging\nimport random\nimport warnings\nfrom typing import Any, Callable, Dict, Optional, TextIO, Tuple, Type, TypeVar, Union, cast\n\nimport torch\n\n__all__ = [\"convert_tensor\", \"apply_to_tensor\", \"apply_to_type\", \"to_onehot\", \"setup_logge... | [
[
"numpy.random.seed",
"torch.zeros",
"torch.manual_seed",
"torch.cuda.manual_seed_all",
"torch.cuda.is_available"
]
] |
variscarey/ASTARS | [
"63ee17ba73e21880218db6514e4c6dd37671074d"
] | [
"paper_examples/regression_selection.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 19 09:24:41 2020\n\n@author: varis\n\"\"\"\n\nimport numpy as np\nfrom astars.stars_sim import Stars_sim\nimport matplotlib.pyplot as plt\n\n\ndef noisy_cubic(x,var=1E-4):\n return x**3-6*x + np.random.normal(scale=np.sqrt(var),size=x.shape)\n\ndef poly_mod(pr... | [
[
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.legend",
"numpy.vander",
"numpy.sqrt",
"numpy.max",
"numpy.copy",
"numpy.random.uniform",
"matplotlib.pyplot.show",
"numpy.zeros"
]
] |
tmash/pyscf | [
"89c101c1c963e8247808635c61cd165bffab42d6"
] | [
"examples/qmmm/22-with_solvent.py"
] | [
"#!/usr/bin/env python\n#\n# Author: Qiming Sun <osirpt.sun@gmail.com>\n#\n\n'''\nQM/MM charges + implicit solvent model\n'''\n\nimport numpy\nfrom pyscf import gto, qmmm, solvent\nfrom pyscf.data import radii\n\n# load all modeuls\nfrom pyscf import __all__\n\nmol = gto.M(atom='''\nC 0.000000 0.000000 ... | [
[
"numpy.arange",
"numpy.random.random",
"numpy.random.seed"
]
] |
RonyBenitez/triplet-reid-pytorch | [
"b32f5df1084c70aeceb5084001f242dce31d0ebb"
] | [
"eval.py"
] | [
"#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\nimport torch\n\nimport pickle\nimport numpy as np\nimport sys\nimport logging\nimport argparse\nfrom tqdm import tqdm\n\nfrom utils import pdist_np as pdist\n\n\ndef parse_args():\n parse = argparse.ArgumentParser()\n parse.add_argument(\n '--gallery... | [
[
"numpy.logical_and",
"numpy.logical_or",
"numpy.mean",
"numpy.any",
"numpy.argsort",
"numpy.array"
]
] |
robertvsiii/kaic-analysis | [
"f80f85bbaeb1190cba2bb18ed732af915374ff9c"
] | [
"kaic_analysis/scripts.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Nov 15 10:31:23 2017\n\n@author: robertmarsland\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport subprocess\nimport os\nimport pickle\nimport datetime\nfrom sklearn.decomposition import PCA\n\nStateDa... | [
[
"numpy.log",
"pandas.read_csv",
"numpy.linspace",
"numpy.asarray",
"matplotlib.pyplot.subplots",
"pandas.read_table",
"numpy.mean",
"numpy.nanmean",
"numpy.random.rand",
"pandas.DataFrame.from_dict",
"numpy.exp",
"matplotlib.pyplot.show",
"numpy.where",
"skl... |
seblee97/student_teacher_catastrophic | [
"9baaaf2850025ba9cf33d61c42386bc4c3b2dad2"
] | [
"cata/plotters/unified_plotter.py"
] | [
"import os\nfrom typing import Dict\nfrom typing import Optional\nfrom typing import Union\n\nimport pandas as pd\nfrom cata import constants\nfrom cata.plotters import base_plotter\n\n\nclass UnifiedPlotter(base_plotter.BasePlotter):\n \"\"\"Class for plotting generalisation errors, overlaps etc.\n\n For cas... | [
[
"pandas.read_csv"
]
] |
elouie/CodeSamples | [
"3fe9fcf23cbfc82d84a679ea16d69ae41e700f06"
] | [
"cv/CNN/student.py"
] | [
"# Please place any imports here.\r\n# BEGIN IMPORTS\r\n\r\nimport numpy as np\r\nimport cv2\r\nimport random\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nimport torch.nn.functional as F\r\nfrom torchvision import transforms, datasets\r\n\r\n# END IMPORTS\r\n\r\n###################... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.Dropout2d",
"torch.max",
"torch.Tensor",
"numpy.clip",
"numpy.fliplr",
"torch.nn.Conv2d",
"torch.nn.Linear",
"scipy.ndimage.interpolation.rotate",
"torch.nn.MaxPool2d",
"numpy.mean",
"numpy.random.normal",
"torch.clamp",
... |
SkyerYao/stanford-tensorflow-tutorials | [
"43c97b6df32f280056fa7c11c83dcfcd1b97382c"
] | [
"2017/examples/03_linear_regression_sol.py"
] | [
"\"\"\" Simple linear regression example in TensorFlow\nThis program tries to predict the number of thefts from \nthe number of fire in the city of Chicago\nAuthor: Chip Huyen\nPrepared for the class CS 20SI: \"TensorFlow for Deep Learning Research\"\ncs20si.stanford.edu\n\"\"\"\nimport os\nos.environ['TF_CPP_MIN_L... | [
[
"matplotlib.pyplot.legend",
"tensorflow.summary.FileWriter",
"tensorflow.Variable",
"tensorflow.placeholder",
"matplotlib.pyplot.plot",
"tensorflow.global_variables_initializer",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.square",
"tensorflow.Session",
"matplo... |
Voolkia/ML | [
"9b8de9d87cddeb8d13b3ac757f18e68c110c7408"
] | [
"notebooks/5. Batch Transforming/transform.py"
] | [
"from functools import reduce\nfrom config import PERIODO_INI, PERIODO_FIN\nimport pandas as pd\nimport numpy as np\n\npd.options.mode.chained_assignment = None\n\n\ndef check_periods(col):\n print(pd.DataFrame(\n {\"Rango\": [col.min(), col.max()]},\n index=['MIN', 'MAX'])\n )\n\n... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.to_datetime",
"pandas.DataFrame",
"numpy.timedelta64",
"pandas.Timestamp",
"pandas.to_numeric"
]
] |
sqt-aliu/portlab | [
"366755c2cfe7bb53c1b236688684fc2c9d8bf4d1"
] | [
"portlab/report/bin/stockloan_payments.py"
] | [
"#!/opt/anaconda3/bin/python -u\nimport getopt\nimport os.path\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom time import sleep\nfrom datetime import datetime, timedelta\nsys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))\nfrom common.lib.log import debug, error, fatal, info, wa... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
Precistat/CompreFace | [
"dc850c23d4cadc355f77cef08adbbd5f430c01b7"
] | [
"embedding-calculator/src/services/facescan/scanner/facescanner.py"
] | [
"# Copyright (c) 2020 the original author or authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"numpy.random.rand"
]
] |
tuming1990/tf-pdnn | [
"4fd25bcbc6024a6bf0e0f99b51f579c75a3cfdf1"
] | [
"io_func/model_io.py"
] | [
"# Copyright 2013 Yajie Miao Carnegie Mellon University\n# 2015 Yun Wang Carnegie Mellon University\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# htt... | [
[
"numpy.savetxt",
"numpy.array",
"numpy.loadtxt"
]
] |
tanay-gangey/CacheReplacementOptimizer | [
"bb8179e0b86fc75c853fde6ac46cd97bed4fd22c"
] | [
"src/models/mainLSTM.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom lstm import LSTMParamInit, LSTMNet, LossLayer\nfrom sklearn.preprocessing import minmax_scale\n\n\n\ndef split(data, size):\n sequences, y = list(), list()\n for i in range(len(data)):\n end = i + size\n if end >= len(data):\n break\n ... | [
[
"numpy.array",
"pandas.read_csv",
"sklearn.preprocessing.minmax_scale",
"numpy.random.seed"
]
] |
volkale/bab | [
"265e2387fa1e55db9c77088d6c20140880f1da44"
] | [
"bab/tests/test_mcmc.py"
] | [
"import numpy as np\nfrom bab.mcmc import get_mcmc\n\n\ndef test_mcmc_random_seed(stan_model, two_group_sample_data):\n y1, y2 = two_group_sample_data\n\n mcmc1 = get_mcmc(stan_model, y1, y2, rand_seed=1).extract()\n mcmc2 = get_mcmc(stan_model, y1, y2, rand_seed=1).extract()\n\n np.testing.assert_equal... | [
[
"numpy.testing.assert_equal",
"numpy.mean"
]
] |
domcatalano/architectures | [
"93c6fc575f851141720663b478008f2d1543b2e3"
] | [
"emb-parallel/basic.py"
] | [
"## import things\nimport ray\nimport pandas as pd\nfrom prophet import Prophet\n\n## data pre-processing\ndf = pd.read_csv('./yellow_tripdata_2021-01.csv')\ndf[\"tpep_pickup_datetime\"] = pd.to_datetime(df[\"tpep_pickup_datetime\"] ).dt.date.astype(\"datetime64\")\ndf= df[[\"tpep_pickup_datetime\", \"VendorID\", \... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
dhaase-de/dh-python-dh | [
"40b04407e5f67ec261f559263718ec2b2588dabb"
] | [
"dh/network/__init__.py"
] | [
"\"\"\"\nTools for network communication.\n\"\"\"\n\nimport abc\nimport io\nimport json\nimport socket\nimport struct\nimport sys\nimport time\nimport zlib\n\nimport dh.ejson\nimport dh.utils\n\n# NumPy is only needed for some parts and is optional\ntry:\n import numpy as np\nexcept ImportError as e:\n _NUMPY... | [
[
"numpy.load",
"numpy.zeros",
"numpy.save"
]
] |
nisheeth-golakiya/hybrid-sac | [
"025ee9a387ef27bcc7a300780a4911b74199ee48"
] | [
"utils.py"
] | [
"import torch\nimport numpy as np\n\ndef to_gym_action(action_c, action_d, flat_actions=True):\n # assuming both are torch tensors\n if flat_actions:\n ac = action_c.tolist()[0]\n else:\n ac = action_c.unsqueeze(-1).tolist()[0]\n ad = action_d.squeeze().item()\n return [ad, ac]\n\ndef g... | [
[
"numpy.hstack",
"numpy.array",
"torch.Tensor"
]
] |
itzdan/Azure-Sentinel-Notebooks | [
"8798b27d8c721ad51cd48e376a24d43e59564ee9"
] | [
"nbdemo/mp_data.py"
] | [
"# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n... | [
[
"pandas.read_pickle",
"pandas.read_csv"
]
] |
cbonilla20/great_expectations | [
"c5a587a3b1bc5d72d433950aaceb4d09f199690a"
] | [
"tests/expectations/test_expectation_arguments.py"
] | [
"import logging\nfrom typing import List\n\nimport pandas as pd\nimport pytest\n\nimport great_expectations.exceptions as ge_exceptions\nfrom great_expectations.core import (\n ExpectationConfiguration,\n ExpectationSuite,\n ExpectationSuiteValidationResult,\n ExpectationValidationResult,\n)\nfrom great... | [
[
"pandas.DataFrame"
]
] |
Digvijaykumar21/c | [
"33ac15c98120ff1375641503b99622f7244e2c94"
] | [
"chatbot.py"
] | [
"from tensorflow.keras.models import load_model, Model\r\nfrom tensorflow.keras.layers import Input, Concatenate\r\nimport tensorflow as tf\r\nimport os\r\nfrom tensorflow.python.keras.layers import Layer\r\nfrom tensorflow.python.keras import backend as K\r\nimport pickle\r\nimport numpy as np\r\nimport re\r\nfrom... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.models.load_model",
"tensorflow.keras.models.Model",
"numpy.argmax",
"numpy.zeros",
"tensorflow.keras.layers.Input"
]
] |
LakmalAsh/Emotion-recognition-part | [
"38ed02b7cd92f25c9ca55bf1599b35939e851339"
] | [
"train_emotion_classifier.py"
] | [
"\"\"\"\r\nDescription: Train emotion classification model\r\n\"\"\"\r\n\r\nfrom keras.callbacks import CSVLogger, ModelCheckpoint, EarlyStopping\r\nfrom keras.callbacks import ReduceLROnPlateau\r\nfrom keras.preprocessing.image import ImageDataGenerator\r\nfrom load_and_process import load_fer2013\r\nfrom load_and... | [
[
"sklearn.model_selection.train_test_split"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.