repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
zhaohongyin/mmdetection-2.15 | [
"9fd29bfd373a6ad00674471c04ecc916f8ad413e"
] | [
"mmdet/models/losses/eqlv2.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.distributed as dist\nfrom mmdet.utils import get_root_logger\nfrom functools import partial\n\nfrom ..builder import LOSSES\n\n\n@LOSSES.register_module()\nclass EQLv2(nn.Module):\n def __init__(self,\n use_sigmoi... | [
[
"torch.abs",
"torch.sigmoid",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.sum",
"torch.exp",
"torch.arange",
"torch.distributed.all_reduce"
]
] |
kosletr/SessionBehaviorClassifierAPI | [
"15e72da6c9c84dca20beb16469c855e11f901b82"
] | [
"malicious-payload-text-classifier/data_utils.py"
] | [
"import numpy as np\nimport re\nimport csv\n\n\nclass Data(object):\n \"\"\"\n Class to handle loading and processing of raw datasets.\n \"\"\"\n\n def __init__(self, data_source,\n alphabet=\"abcdefghijklmnopqrstuvwxyz0123456789-,;.!?:'\\\"/\\\\|_@#$%^&*~`+-=<>()[]{}\",\n ... | [
[
"numpy.asarray",
"numpy.eye",
"numpy.array",
"numpy.zeros"
]
] |
ahmadsalim/numpyro | [
"015c80ddd24cf6bc89006fc3a70b424fecd09331"
] | [
"numpyro/infer/kernels.py"
] | [
"from abc import ABC, abstractmethod\nfrom typing import Callable, List, Dict, Tuple\nimport numpy as np\nimport numpy.random as npr\nimport jax.numpy as jnp\nimport jax.scipy.stats\nimport jax.scipy.linalg\nimport numpyro.distributions as dist\nfrom numpyro.util import sqrth, posdef, safe_norm\n\n\nclass PrecondMa... | [
[
"numpy.random.randn",
"numpy.random.rand",
"numpy.random.choice"
]
] |
drorlab/pensa | [
"0d4c138793d6e4f05f85cb9ece2bf4f0ddc1882f"
] | [
"pensa/statesinfo/discrete_states.py"
] | [
"import numpy as np\nfrom queue import PriorityQueue \nimport math\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import curve_fit\nfrom scipy.signal import argrelextrema\nimport os\nfrom pensa.features import *\n\n\n# -- Functions to cluster feature distributions into discrete states --\n\n\ndef _smooth(x,w... | [
[
"numpy.sqrt",
"matplotlib.pyplot.plot",
"scipy.signal.argrelextrema",
"numpy.exp",
"numpy.histogram",
"scipy.optimize.curve_fit",
"numpy.where",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.log",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig... |
janismac/ksp_rtls_launch_to_rendezvous | [
"195ebfb5aacf1a857aaaf0a69bf071d93d887efd"
] | [
"predict_orbit_BCBF.py"
] | [
"import numpy as np\nimport scipy.integrate\n\ndef predict_orbit_BCBF(vessel, frame):\n r0 = vessel.position(frame)\n v0 = vessel.velocity(frame)\n\n omega = vessel.orbit.body.rotational_speed\n mu = vessel.orbit.body.gravitational_parameter\n\n y0 = list(r0)+list(v0)\n\n t_grid = np.arange(0.0,60... | [
[
"numpy.dot",
"numpy.hstack",
"numpy.arange",
"numpy.cross",
"numpy.array"
]
] |
acolono/ACONA-scheduler-intelligence | [
"1ccaaca21a2b4e10b30242294d5fc8dc087dbd8d"
] | [
"dags/acona_notifications.py"
] | [
"from airflow.decorators import dag, task\nfrom airflow.utils.dates import days_ago\nfrom airflow.operators.bash import BashOperator\nfrom airflow.providers.postgres.operators.postgres import PostgresOperator\nfrom airflow.hooks.postgres_hook import PostgresHook\nfrom airflow.models import Variable\nfrom datetime i... | [
[
"pandas.DataFrame"
]
] |
martinwe001/U-Net-Building-Segmentation | [
"8bd32a8a2bca25a4c0bd9b22fee5a09d77bffbad"
] | [
"test.py"
] | [
"import os\nos.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\nimport tensorflow as tf\nimport numpy as np\nimport cv2\nfrom glob import glob\nfrom tqdm import tqdm\nimport tensorflow_addons as tfa\n\n\nif __name__ == \"__main__\":\n \"\"\" Load the test images \"\"\"\n test_images = glob(\"building-segmentation/t... | [
[
"numpy.concatenate",
"tensorflow.keras.models.load_model",
"numpy.expand_dims"
]
] |
AndrewZhaoLuo/OnnxSnippets | [
"40e2231da8dc3d9152bc71daff5f4b154b97a5e4"
] | [
"onnx_export/export_mobilenetv3_block.py"
] | [
"import torch\nfrom pytorch.common.blocks import mobilenetv3_block\n\nfrom onnx_export import common\n\n\nclass ExportMobilenetV3:\n default_conditions = {\n \"in_channels\": 64,\n \"spatial_dimension\": 128,\n }\n\n sequential_conditions = {\n \"in_channels\": [32, 64, 128],\n }\n\... | [
[
"torch.randn"
]
] |
dalonsoa/tensorlayer | [
"066c09be1eea1b49914b2a6e806329a599edce58"
] | [
"tensorlayer/app/computer_vision_object_detection/yolov4.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"YOLOv4 for MS COCO.\n\n# Reference:\n- [tensorflow-yolov4-tflite](\n https://github.com/hunglc007/tensorflow-yolov4-tflite)\n\n\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\nimport tensorlayer as tl\nfrom tensorlayer.activation import mish\nfrom tensorl... | [
[
"numpy.load"
]
] |
bjedwards/NetworkX_fork | [
"6cb4465d73b8adc4692206fdbc8e1a3934d94fe6"
] | [
"networkx/linalg/tests/test_spectrum.py"
] | [
"from nose import SkipTest\n\nimport networkx as nx\nfrom networkx.generators.degree_seq import havel_hakimi_graph\n\nclass TestSpectrum(object):\n @classmethod\n def setupClass(cls):\n global numpy\n global assert_equal\n global assert_almost_equal\n try:\n import numpy... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array",
"numpy.sqrt"
]
] |
Lornatang/DayHR | [
"02e81961e0a710f2c82db70c06b505e608db61cc"
] | [
"Python/AI-ToolBox/computer_vision/image_classification_keras/parameterAdjusting_practice/CNN_v3/CNN_v3.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Nov 1 12:02:27 2018\n\nCNN调参练习version3:\n\n使用一个类似AlexNet和VGG的简单架构\n在CNN_v2的基础上,进行数据增强\n\n@author: zyb_as\n\"\"\"\n\n# -----------------------------------------------------------\n# 基本参数\n# -----------------------------------------------------------\n\ntrainSetRootPa... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
jpmjpmjpm/kraken | [
"8ceae75230f5e47bc5d75f8d68fb41b0532cd0ca"
] | [
"kraken/ketos.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Copyright 2015 Benjamin Kiessling\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 requir... | [
[
"torch.manual_seed",
"torch.utils.data.DataLoader",
"numpy.random.shuffle",
"numpy.std",
"numpy.random.normal",
"numpy.mean"
]
] |
adarbha/disaster_response | [
"34e1e3586caffb18e6d7f57a2c121426c02f1886"
] | [
"app/run.py"
] | [
"import json\nimport plotly\nimport pandas as pd\n\n\nfrom flask import Flask\nfrom flask import render_template, request, jsonify\nfrom plotly.graph_objs import Bar\nfrom sklearn.externals import joblib\nfrom sqlalchemy import create_engine\n\nfrom nltk.corpus import stopwords\nfrom nltk.stem.wordnet import WordNe... | [
[
"pandas.read_sql_table",
"sklearn.externals.joblib.load"
]
] |
cojo24/eia | [
"b2115a4cbc2e30c23abcbf4060deef962d3f82f9"
] | [
"schema.py"
] | [
"import datetime as dt\nimport pandas as pd\n\nfrom .client import EIA\nfrom collections import namedtuple\nfrom typing import Optional, Union\n\n\nCategoryCollection = namedtuple('CategoryCollection', 'items')\nSeriesCollection = namedtuple('SeriesCollection', 'items')\n\n\nclass Category:\n\n def __init__(\n ... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
teejaytanmay/image_object_localization_flipkart | [
"ca0976a7df1280be942d666cdebea110e1a70633"
] | [
"Round3/train.py"
] | [
"# coding: utf-8\n\nimport keras\nfrom keras.layers import Dense, Conv2D, BatchNormalization, Activation\nfrom keras.layers import AveragePooling2D, MaxPooling2D, Input, Flatten\nfrom keras.optimizers import Adam\nfrom keras.regularizers import l2\nfrom keras import backend as K\nfrom keras.models import Model,load... | [
[
"tensorflow.multiply",
"tensorflow.reduce_mean",
"tensorflow.less",
"tensorflow.maximum",
"tensorflow.shape",
"tensorflow.minimum",
"tensorflow.square",
"tensorflow.where",
"tensorflow.abs"
]
] |
mehrdad-shokri/tensornets | [
"e36eff73e5fc984977c5ceadefc1adb089e7bab5"
] | [
"tensornets/contrib_layers/optimizers.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.python.ops.math_ops.log",
"tensorflow.python.training.training.assert_global_step",
"tensorflow.python.summary.summary.scalar",
"tensorflow.python.ops.math_ops.exp",
"tensorflow.python.summary.summary.histogram",
"tensorflow.python.ops.variables.trainable_variables",
"tenso... |
DEVESHTARASIA/h2o-3 | [
"9bd73fcedb4236b7ea8f214b36ca95f3e00d4548"
] | [
"h2o-py/h2o/frame.py"
] | [
"# -*- encoding: utf-8 -*-\n\"\"\"\nH2O data frame.\n\n:copyright: (c) 2016 H2O.ai\n:license: Apache License Version 2.0 (see LICENSE for details)\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport csv\nimport datetime\nimport functools\nimport os\nimport sys\nim... | [
[
"scipy.sparse.issparse",
"matplotlib.pyplot.title",
"scipy.sparse.find",
"matplotlib.use",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
alibaba/Retrieval-based-Pre-training-for-Machine-Reading-Comprehension | [
"9ccad31bd0bf2216004cf729d1d511fc3e0b77c9"
] | [
"general_util/utils.py"
] | [
"import collections\r\nimport json\r\nimport math\r\nimport random\r\nimport re\r\nimport string\r\nimport torch\r\nfrom collections import Counter\r\nfrom torch.nn.functional import softmax\r\nfrom typing import List, Callable, Tuple, Any, Optional\r\n\r\ntry:\r\n from pytorch_pretrained_bert.tokenization impor... | [
[
"torch.nn.functional.softmax",
"torch.zeros"
]
] |
dmitryrubtsov/Predictions-of-calls-in-Moscow-Megafon | [
"260bb49e859694d6a7c0dfb8cb13cd39d05ed597"
] | [
"runner_predict_proba.py"
] | [
"import os\nimport pickle\nimport time\n\nimport pandas as pd\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\n\nclass ColumnSelector(BaseEstimator, TransformerMixin):\n def __init__(self, columns):\n self.columns = columns\n\n def fit(self, X, y=None):\n return self\n\n def tra... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
prijatelj/bayesian_eval_ground_truth-free | [
"c0e569c78d63beb79f5e1e727c322293c3584323"
] | [
"psych_metric/datasets/crowd_layer/convert_txt_to_csv_ner.py"
] | [
"\"\"\"Converts given data txt file into a more parsable formatted csv.\n\"\"\"\nimport argparse\n\nimport numpy as np\nimport pandas as pd\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='Convert the given ner-mturk txt file into an easier to parse csv file.')\n\n parser.add_argument('inp... | [
[
"pandas.read_csv"
]
] |
tsudalab/rxngenerator | [
"6f459828c03485926adb390e5bfbd4a6d91de30b",
"6f459828c03485926adb390e5bfbd4a6d91de30b"
] | [
"sample.py",
"bo/gauss.py"
] | [
"import sys\nsys.path.append('./rxnft_vae')\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\nfrom torch.utils.data import DataLoader\nfrom torch.autograd import Variable\n\nimport math, random, sys\nfrom optparse import OptionParser\nfrom collecti... | [
[
"torch.device",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.load"
],
[
"numpy.dot",
"numpy.sqrt",
"numpy.tile",
"numpy.ones",
"numpy.float32",
"numpy.transpose",
"numpy.array",
"numpy.exp",
"numpy.sum"
]
] |
stevencdang/AutoML-DS-Components | [
"b0490262d3db5307c37f82c92e25cd938dd3a242"
] | [
"lib/ls_dataset/d3m_dataset.py"
] | [
"\n# Author: Steven C. Dang\n\n# Class encapsulating operations on a remote d3m dataset\n\nimport logging\nimport os.path as path\nimport os\nfrom io import IOBase\nimport json\nimport csv\nimport pandas as pd\n\nfrom ls_dataset.ls_dataset import LSDataset\nfrom ls_dataset.dsr_table import DSRTable\nfrom ls_dataset... | [
[
"pandas.read_csv"
]
] |
coruscating/qiskit-experiments | [
"dac1febf13be870d3bac16af22aa341a088e0766"
] | [
"test/data_processing/test_nodes.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 ... | [
[
"numpy.sqrt",
"numpy.arctan",
"numpy.allclose",
"numpy.std",
"numpy.array"
]
] |
bdsinger/PsyNeuLink | [
"71d8a0bb1691ff85061d4ad3de866d9930a69a73",
"71d8a0bb1691ff85061d4ad3de866d9930a69a73",
"71d8a0bb1691ff85061d4ad3de866d9930a69a73"
] | [
"Scripts/rum.py",
"tests/states/test_parameter_states.py",
"tests/functions/test_selection.py"
] | [
"\n# coding: utf-8\n\n# In[14]:\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n# get_ipython().run_line_magic('matplotlib', 'inline')\nimport psyneulink as pnl\n\n\n# In[15]:\nimport psyneulink.core.components.functions.transferfunctions\n\nnouns=['oak','pine','rose','daisy','canary','robin','salmon','su... | [
[
"numpy.shape",
"numpy.sum",
"numpy.zeros"
],
[
"numpy.allclose"
],
[
"numpy.random.rand",
"numpy.random.seed",
"numpy.allclose"
]
] |
DamianoGiani/EGVSRprova | [
"2cae74436f2bf864f061d63eadae079a328ed9ed"
] | [
"codes/data/__init__.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\n\nfrom .paired_lmdb_dataset import PairedLMDBDataset\nfrom .unpaired_lmdb_dataset import UnpairedLMDBDataset\nfrom .paired_folder_dataset import PairedFolderDataset\nfrom .mypaired_folder_dataset import MyPairedFolderDataset\n\... | [
[
"torch.device",
"torch.nn.functional.conv2d",
"torch.utils.data.DataLoader"
]
] |
sebastian-sz/tf-autoaugment | [
"6807f5095df1b842a8a17265dc2361165f5d1658"
] | [
"tf_autoaugment/transforms/color.py"
] | [
"\"\"\"Code for Color transform.\"\"\"\nimport tensorflow as tf\n\nfrom tf_autoaugment.image_utils import blend_batch\nfrom tf_autoaugment.transforms.base_transform import BaseTransform\n\n\nclass Color(BaseTransform):\n \"\"\"Implements Color Transform.\"\"\"\n\n def __call__(self, images: tf.Tensor, level: ... | [
[
"tensorflow.image.rgb_to_grayscale",
"tensorflow.cast"
]
] |
dvapan/simplex_method | [
"dcc930b092dffa2e55162ea035f43d85572c8568"
] | [
"simplex_method.py"
] | [
"# coding=utf-8\n__author__ = 'dvapan'\n\nimport scipy as sc\nimport scipy.linalg as lin\nimport pprint\n#\n# c = sc.matrix([2.0, 3.0]).transpose()\n# A = sc.matrix([[-10.0, 5.0], [6.0, 20.0], [8.0, 15.0]])\n# b = sc.matrix([600.0, 600.0, 600.0]).transpose()\n\n\n\n# I = [2, 3, 4]\ndef transform_to_classic(A,b,c):\... | [
[
"scipy.zeros",
"scipy.matrix",
"scipy.full",
"scipy.resize",
"scipy.eye",
"scipy.linalg.solve"
]
] |
tdjames1/TMA-data-extraction | [
"03af0ef3b61df5486f6f061e4e3b62de2e238476"
] | [
"python/process_content.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"tma_process_content\n.. module:: TMA-data-extraction\n :synopis: Scripts and functions for extracting weather alert data\n from Tanzanian Meteorological Authority \"Five days Severe weather\n impact-based forecasts\" PDFs.\n.. moduleauthor: Tamora D. J... | [
[
"matplotlib.pyplot.imread",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"numpy.mean",
"numpy.hstack",
"pandas.read_csv",
"numpy.arange",
"numpy.matmul",
"numpy.stack",
"numpy.zeros",
"numpy.linalg.inv",
"matplotlib.path.Path",
"numpy.append",
"numpy.meshg... |
happyfuntimegroup/machinelearning | [
"105273b2cf5907b23a2ee2b4c076d89f215c38ff"
] | [
"CODE/models/.ipynb_checkpoints/regression-checkpoint.py"
] | [
"def simple_linear(X_train, y_train, X_val, y_val):\n from sklearn.linear_model import LinearRegression\n from sklearn.metrics import r2_score, mean_absolute_error\n\n model = LinearRegression()\n reg = model.fit(X = X_train, y = y_train)\n y_pred_val = model.predict(X_val)\n print(r2_score(y_val,... | [
[
"sklearn.metrics.r2_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.metrics.mean_absolute_error",
"sklearn.linear_model.LinearRegression",
"numpy.ravel",
"sklearn.preprocessing.StandardScaler"
]
] |
manodeep/yymao-helpers | [
"4ceffd639f4a10d259146f3f94e0b2415e835f32"
] | [
"helpers/shuffleMockCatalog.py"
] | [
"__all__ = ['shuffleMockCatalog', 'generate_upid']\nimport warnings\nfrom itertools import izip\nimport numpy as np\nfrom numpy.lib.recfunctions import rename_fields\n\ndef _iter_plateau_in_sorted_array(a):\n if len(a):\n k = np.where(a[1:] != a[:-1])[0]\n k += 1\n i = 0\n for j in k:... | [
[
"numpy.logspace",
"numpy.lib.recfunctions.rename_fields",
"numpy.in1d",
"numpy.asarray",
"numpy.isnan",
"numpy.dtype",
"numpy.ceil",
"numpy.random.randn",
"numpy.remainder",
"numpy.searchsorted",
"numpy.ravel",
"numpy.fromiter",
"numpy.where"
]
] |
geneing/TensorFlowTTS | [
"0035ba00fec1b2b1184c8df32646d6a88b01ee5b"
] | [
"examples/mfa_extraction/fix_mismatch.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2020 TensorFlowTTS Team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.array",
"numpy.sum"
]
] |
MahdiDavari/pymatgen | [
"eb6cd95230c11ac761a96ebf82b98f71177bb71f"
] | [
"pymatgen/core/tests/test_structure.py"
] | [
"# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\nfrom __future__ import division, unicode_literals, print_function\n\nfrom pymatgen.util.testing import PymatgenTest\nfrom pymatgen.core.periodic_table import Element, Specie\nfrom pymatgen.core.composi... | [
[
"numpy.radians"
]
] |
kacel33/ActionAI_PC | [
"a0528f49ea61cc07d7c1e9a3cd6846e5f50cfae7"
] | [
"lib/utils/paf_to_pose.py"
] | [
"import cv2\nimport numpy as np\nimport time\nfrom scipy.ndimage.filters import gaussian_filter, maximum_filter\n\nfrom scipy.ndimage.morphology import generate_binary_structure\nfrom lib.pafprocess import pafprocess\n\nfrom lib.utils.common import Human, BodyPart, CocoPart, CocoColors, CocoPairsRender\n\n# Heatmap... | [
[
"numpy.expand_dims",
"numpy.maximum",
"numpy.nonzero",
"numpy.linspace",
"numpy.arange",
"numpy.vstack",
"numpy.ones",
"scipy.ndimage.filters.gaussian_filter",
"scipy.ndimage.morphology.generate_binary_structure",
"numpy.count_nonzero",
"numpy.array",
"numpy.sum",
... |
jrbourbeau/composition | [
"f8debd81b0467a6094d5ba56a5f0fc6047369d30"
] | [
"analysis/ShowerLLH/reco-vs-true-containment.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import LogNorm\nimport argparse\nimport seaborn.apionly as sns\n\nimport composition.support_functions.paths as paths\nfrom composition.support_functions.checkdir import checkdir\nfrom compos... | [
[
"numpy.rot90",
"matplotlib.pyplot.imshow",
"numpy.flipud",
"numpy.log10",
"numpy.ma.masked_where",
"numpy.histogram2d"
]
] |
Abdullah-Abuolaim/defocus-deblurring-dual-pixel | [
"21a43e7d12350c62c4038485cdeebc27a078765b"
] | [
"DPDNet/image_to_patch_filter.py"
] | [
"\"\"\"\nThis code is used to extract image patches from the training and validation\nsets as described in the paper. For the training set patches, we discard 30%\nof the patches that have the lowest sharpness energy. Recall that we don't\nextract patches for test images because we process full image at test time.\... | [
[
"numpy.sqrt",
"numpy.min",
"numpy.asarray",
"numpy.argmin",
"numpy.load",
"numpy.sum"
]
] |
kcotar/Stellar_abudance_trees | [
"1a4377ef53a4b4c8df1be860598a70be31626110"
] | [
"colorize_sky.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.basemap import Basemap\n\n\ndef _prepare_ra_dec(data):\n ra = data['ra']\n idx_trans = ra > 180\n if len(idx_trans) > 0:\n ra[idx_trans] -= 360\n ra = np.deg2rad(ra)\n dec = np.deg2rad(data['dec'])\n return ra, dec\n\n\... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"numpy.min",
"numpy.arange",
"matplotlib.pyplot.savefig",
"numpy.max",
"numpy.deg2rad",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
hyuanmech/MOPSO | [
"f2cbe9151d9dbd21b562957b368f22e2648232b9"
] | [
"check_generated_geometry.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Mar 23 16:05:17 2020\r\n\r\n@author: yuanh\r\n\"\"\"\r\n\r\nimport os\r\nimport shutil\r\nfrom openpyxl import load_workbook\r\nimport numpy as np\r\n\r\nit = 6\r\n\r\nflag = 0\r\n\r\nnPop = 100\r\n\r\nif flag == 1:\r\n n = 9\r\n index = np.zeros((n, 1))\r\... | [
[
"numpy.zeros"
]
] |
jaspreetj/opics | [
"037ed93ad9f6c9ad9fec5feb214bb89de24635f0"
] | [
"opics/utils.py"
] | [
"from typing import Any, Dict, List, Tuple\nimport cmath as cm\nimport time\nimport re\nimport itertools\nimport inspect\nfrom copy import deepcopy\nimport numpy as np\nfrom numpy import ndarray\nfrom pathlib import PosixPath\nfrom defusedxml.ElementTree import parse\n\n\ndef fromSI(value: str) -> float:\n \"\"\... | [
[
"numpy.savez",
"numpy.linspace",
"numpy.exp",
"numpy.load",
"numpy.array",
"numpy.zeros"
]
] |
collector-m/H-23D_R-CNN | [
"40c89c7a6910b738f7e4ed1d0dbb32b1ca99a016"
] | [
"pcdet/models/model_utils/layers.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass ConvBNReLU(nn.Module):\n\n def __init__(self, in_channels, out_channels, kernel_size, stride=1, eps=1e-3, momentum=0.01):\n super().__init__()\n self.block = nn.Sequential(\n nn.Conv2d(in_channels, out_channels, kernel_size, stride=stride, padding=kernel_s... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d"
]
] |
bfirsh/StyleCLIP | [
"164fa8497ea91ea184c0488fcc5e3e14f709561a"
] | [
"global_directions/cog_predict.py"
] | [
"import tempfile\nfrom pathlib import Path\nimport os\nfrom argparse import Namespace\nimport time\nimport dlib\nimport os\nimport sys\nimport numpy as np\nfrom PIL import Image\nimport torch\nimport torchvision.transforms as transforms\nimport tensorflow as tf\nimport numpy as np\nimport torch\nimport clip\nfrom P... | [
[
"torch.load",
"numpy.set_printoptions",
"numpy.load",
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"torch.no_grad",
"torch.cuda.is_available",
"tensorflow.get_default_graph"
]
] |
CSchulzeTLK/FMPy | [
"fde192346c36eb69dbaca60a96e80cdc8ef37b89",
"fde192346c36eb69dbaca60a96e80cdc8ef37b89"
] | [
"fmpy/gui/MainWindow.py",
"fmpy/ssp/simulation.py"
] | [
"\"\"\" Entry point for the graphical user interface \"\"\"\r\n\r\ntry:\r\n from . import compile_resources\r\n compile_resources()\r\nexcept Exception as e:\r\n print(\"Failed to compiled resources. %s\" % e)\r\n\r\nimport os\r\nimport sys\r\n\r\nfrom PyQt5.QtCore import QCoreApplication, QDir, Qt, pyqtSi... | [
[
"numpy.repeat",
"numpy.dtype"
],
[
"numpy.dtype"
]
] |
chengemily/Distributional-Signatures | [
"cd7e4659fc9761a8af046e824853aa338b22f2f6"
] | [
"src/embedding/auxiliary/factory.py"
] | [
"import datetime\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom embedding.auxiliary.pos import POS\n\n\ndef get_embedding(args):\n '''\n @return AUX module with aggregated embeddings or None if args.aux\n did not provide additional embeddings\n '''\n print(\"{... | [
[
"torch.nn.ModuleList",
"torch.FloatTensor",
"torch.cat"
]
] |
Thirty-OneR/Astr496_assignment03 | [
"e5c8c842906fa9d6c141fb92a0fc9e134810ec64"
] | [
"dodo.py"
] | [
"from doit.tools import run_once\nimport h5py\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef task_generate_gaussian():\n N = 32**3\n seed = 0x4d3d3d3\n fn = \"gaussian.h5\"\n def _generate():\n np.random.seed(seed)\n pos = np.random.normal(loc = [0.5, 0.5, 0.5], scale = 0.2, s... | [
[
"numpy.random.normal",
"numpy.random.random",
"numpy.random.seed",
"numpy.ones"
]
] |
tkortz/motion_planning_rt | [
"08e914642b802f7217a8ad0f6153d41ccdce8c7d"
] | [
"python_src/adaptive_formation/gradient_interactive.py"
] | [
"# In order to launch execute:\n# python3 gradient_interactive.py\n\nimport numpy as np\nfrom numpy.linalg import norm\nimport matplotlib.pyplot as plt\nfrom matplotlib import collections\nfrom scipy.ndimage.morphology import distance_transform_edt as bwdist\nfrom math import *\nimport random\nfrom impedance_modele... | [
[
"scipy.ndimage.morphology.distance_transform_edt",
"matplotlib.pyplot.pause",
"numpy.gradient",
"numpy.arange",
"matplotlib.pyplot.cla",
"numpy.linalg.norm",
"matplotlib.pyplot.show",
"matplotlib.pyplot.draw",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"n... |
parkjan4/HiggsBoson | [
"1e31f9bd2c6cb03c6acc8caed573046bbc0d2c08"
] | [
"project/Python Code/implementations.py"
] | [
"from proj1_helpers import *\nimport numpy as np\nimport random\nimport matplotlib.pyplot as plt\n\n######################### Loss Functions #########################\n\n# Compute loss with Mean Squared Error\ndef compute_loss(y, tx, w):\n e = y.reshape((len(y),1)) - tx.dot(w).reshape((len(y),1))\n return 1/2... | [
[
"numpy.log",
"numpy.random.seed",
"numpy.power",
"numpy.logspace",
"numpy.arange",
"numpy.squeeze",
"numpy.eye",
"numpy.delete",
"numpy.random.permutation",
"numpy.mean",
"numpy.exp",
"numpy.array",
"numpy.zeros"
]
] |
WillemWybo/Electrical_compartmentalization_in_neurons | [
"1ff297be97412ff40042485479b78148fba11c27"
] | [
"_matplotlibsettings.py"
] | [
"import matplotlib\n# matplotlib.use(\"Agg\")\nimport matplotlib.pyplot as pl\nimport matplotlib.animation as manimation\nfrom matplotlib.gridspec import GridSpec\nfrom matplotlib.patches import Rectangle\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nfrom matplotlib import rc, rcParams\nfrom mpl_toolkit... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.get_cmap",
"matplotlib.rc"
]
] |
Thomas-Brd/3D_landslide_detection | [
"95ec6fc4dd013ecc7c3c8cb22dbbbc8712467830"
] | [
"scripts/.ipynb_checkpoints/gdal_functions-checkpoint.py"
] | [
"# coding: utf-8\n# Thomas Bernard\n# fonctions utilisant gdal\n\nfrom osgeo import gdal\nimport ogr, osr\nimport numpy as np\n#import rasterio\n#from rasterio.plot import show\nimport subprocess\nimport os\nimport matplotlib.pyplot as plt \n\n#import scripts.eros_function as eros\n\n\ndef read_tif_file(path_to_fil... | [
[
"matplotlib.pyplot.imshow",
"pandas.read_csv",
"numpy.abs",
"numpy.logical_and",
"numpy.unique",
"numpy.around",
"matplotlib.pyplot.subplots",
"numpy.max",
"numpy.copy",
"numpy.ma.masked_equal",
"numpy.size",
"numpy.ma.masked_where"
]
] |
LC-John/Sorting | [
"c34ab338a910a12def0db426495a97b5170b971b"
] | [
"src/SlowSort.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Dec 23 13:55:02 2018\n\n@author: zhanghuangzhao\n\"\"\"\n\nimport numpy\n\nimport copy\nimport os, shutil\n\nimport imageio\nimport matplotlib.pyplot as plt\n\nsize = 8\narr = None\n \ndef SlowSort(a, idx_begin, idx_end, reverse=False):\n ... | [
[
"matplotlib.pyplot.ylim",
"numpy.random.uniform",
"matplotlib.pyplot.cla",
"numpy.floor"
]
] |
XC-Li/FiscalNote_Project | [
"a8343f22156f619f2c8fe9102e6df684d1b4c97f"
] | [
"deployment/util_code/doc2vec_vectorizer.py"
] | [
"\"\"\"By: Xiaochi (George) Li: github.com/XC-Li\"\"\"\nfrom gensim.models.doc2vec import Doc2Vec\nimport numpy as np\nfrom scipy.sparse import hstack as sparse_hstack\n\n\nclass D2V(object):\n def __init__(self, file):\n self.model = Doc2Vec.load(file)\n\n def fit(self, X):\n pass\n\n def tr... | [
[
"scipy.sparse.hstack",
"numpy.vstack"
]
] |
cpratim/DALI-Data-Challenge | [
"ad0d6d048abb240dd2316ff70590606bd2d8c44f"
] | [
"modeling/net.py"
] | [
"import os\n\nimport torch\nfrom torch import nn\nfrom torch import optim\nimport torch.nn.functional as F\nfrom tqdm import tqdm\n\nimport numpy as np\nfrom sklearn.preprocessing import (\n StandardScaler,\n MinMaxScaler,\n)\nfrom sklearn.pipeline import Pipeline\nfrom gplearn.genetic import SymbolicTransfor... | [
[
"torch.Tensor",
"torch.nn.Flatten",
"torch.nn.MaxPool1d",
"torch.nn.Linear",
"sklearn.preprocessing.StandardScaler",
"torch.cuda.is_available",
"torch.nn.Conv1d",
"numpy.corrcoef",
"torch.nn.ReLU",
"torch.tensor_split",
"torch.nn.MSELoss"
]
] |
nbergam2021/ICESat_data_analysis_tools | [
"46f4132d2b34efe9a21470cdbaddf195301cfcd3"
] | [
"crossover_finder.py"
] | [
"#crossover_finder.py\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as stats\nimport glob\nimport os\nimport sys\n\ndef solve(line_list, box):\n # input: [slope, intersect, other_stuff]\n # output: [ [], [], [], [] ]\n\n # Group slopes, compare lines within each group\n # box is list of t... | [
[
"pandas.read_csv",
"numpy.subtract",
"pandas.DataFrame",
"scipy.stats.linregress",
"numpy.std",
"numpy.prod",
"numpy.var",
"numpy.add",
"numpy.array"
]
] |
terrytangyuan/katib | [
"5a7a144a1b33e05466174edd721803349622aabc"
] | [
"pkg/suggestion/v1alpha1/NAS_Reinforcement_Learning/Operation.py"
] | [
"import itertools\nimport numpy as np\nfrom pkg.api.v1alpha1.python import api_pb2\n\n\nclass Operation(object):\n def __init__(self, opt_id, opt_type, opt_params):\n self.opt_id = opt_id\n self.opt_type = opt_type\n self.opt_params = opt_params\n \n def get_dict(self):\n opt_di... | [
[
"numpy.arange"
]
] |
mhrah7495/View-Adaptive-Neural-Networks-for-Skeleton-based-Human-Action-Recognition | [
"b2113aa6295d7292516d5a74582b619d775a5b3d"
] | [
"data/ntu/get_raw_denoised_data.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\nimport os\nimport os.path as osp\nimport numpy as np\nimport pickle\nimport logging\n\nroot_path = './'\nraw_data_file = osp.join(root_path, 'raw_data', 'raw_skes_data.pkl')\nsave_path = osp.join(root_path, 'denoised_da... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.ones"
]
] |
louisponet/aiida-core | [
"3214236df66a3792ee57fe38a06c0c3bb65861ab"
] | [
"tests/backends/aiida_django/migrations/test_migrations_many.py"
] | [
"# -*- coding: utf-8 -*-\n###########################################################################\n# Copyright (c), The AiiDA team. All rights reserved. #\n# This file is part of the AiiDA code. #\n# ... | [
[
"numpy.array"
]
] |
michaelhalim168/GiftFinder | [
"7fda99be827a06e5ef2d112174ded93ad1d3b7b1"
] | [
"scripts/classifier.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.svm import LinearSVC\nfrom sklearn.preprocessing import LabelEncoder\nfrom va... | [
[
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.svm.LinearSVC",
"numpy.exp",
"sklearn.preprocessing.LabelEncoder",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
scott-trinkle/fiberorient | [
"306cf2741008eb46a97cfccdcf81e9ec33189a8d"
] | [
"tests/test_vis.py"
] | [
"import pytest\nimport numpy as np\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\n\nfrom context import fiberorient as fo\n\n\ndef test_img_to_dec(img, vectors):\n true_dec = np.zeros_like(vectors)\n true_dec[..., 0] = fo.util.rescale(img, scale=255).astype(np.uint8)\n test_dec =... | [
[
"numpy.testing.assert_array_equal",
"numpy.zeros_like"
]
] |
daithimarkham/pands-project | [
"f3d6dcb82fda1db851a3d78571a9d4a48f908eba"
] | [
"scatterplot.py"
] | [
"# David Markham\n# Fisher Iris Data set\n\n# Use a Multivariate scatter-plot to distinguish the relationship between the flowers.\n\n\n# Import Libraries \nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sn\nfrom pandas.plotting import scatter_matrix\n\n\n# Load dataset\... | [
[
"pandas.read_csv",
"pandas.plotting.scatter_matrix",
"matplotlib.pyplot.show"
]
] |
bopopescu/wso2-spark | [
"6982456ded39a8fef0ad26600218f8f575aac2a5"
] | [
"python/pyspark/tests.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"numpy.array"
]
] |
MarSaKi/NvEM | [
"a636245c96c07f3b507b69f2a9837a4ff127f4aa"
] | [
"r2r_src/speaker.py"
] | [
"import torch\nimport numpy as np\nfrom param import args\nimport os\nimport utils\nimport model\nimport torch.nn.functional as F\nimport time\n\n\nclass Speaker():\n env_actions = {\n 'left': (0,-1, 0), # left\n 'right': (0, 1, 0), # right\n 'up': (0, 0, 1), # up\n 'down': (0, 0,-1),... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.load",
"torch.zeros",
"torch.from_numpy",
"numpy.stack",
"numpy.logical_or",
"numpy.concatenate",
"torch.distributions.Categorical",
"torch.stack",
"numpy.array",
"numpy.zeros",
"torch.save"
]
... |
akiaohk/Udacity-Disaster-Response-Pipelines | [
"9a6042a0d288381c1310de1948121bccf647f418"
] | [
"data/process_data.py"
] | [
"\"\"\"\nProject: Disaster Response Pipeline\n\nScript Syntax for execution:\n> python process_data.py <path to messages csv file> <path to categories csv file> <path to sqllite destination db>\n> python process_data.py disaster_messages.csv disaster_categories.csv DisasterResponse.db\n\"\"\"\n\n# Import libraries... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
granatb/mlops_handin | [
"b0992be9667bf7f1e226efd0174289327a548efb"
] | [
"src/models/model_lightning.py"
] | [
"import os\nimport sys\nfrom typing import Callable, List, Optional, Tuple, Union\n\nimport matplotlib.pyplot as plt # type: ignore\nimport pytorch_lightning as pl\nimport torch\nimport torch.nn.functional as F\nfrom pytorch_lightning import loggers\nfrom torch import nn\nfrom torch.utils.data import Dataset\n\nsy... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout2d",
"torch.nn.functional.nll_loss",
"torch.cat",
"torch.load",
"torch.nn.Conv2d",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
marcvergees/rieffel_method | [
"5377284c10010691238f10d5d6f77935c44d8f3d"
] | [
"neural_network.py"
] | [
"# Big Data, Xarxes Neuronals i Màrqueting: la clau de l'èxit?\r\n# Treball de recerca (TR)\r\n# Marc Vergés Santiago - Escola Pia Mataró\r\n#\r\n#\r\n#\r\n# Copyright (c) 2021, Marc Vergés Santiago\r\n# All rights reserved.\r\n#\r\n# Redistribution and use in source and binary forms, with or without\r\n# modificat... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.array",
"sklearn.preprocessing.LabelEncoder",
"numpy.sum",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
jairideout/q2-feature-table | [
"494e0b8080799c746c55be2271278891798b8e56"
] | [
"q2_feature_table/tests/test_merge.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2016-2017, QIIME 2 development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------... | [
[
"numpy.array",
"pandas.util.testing.assert_series_equal",
"pandas.Series"
]
] |
dashstander/cog | [
"0aee3c9ef50ac346d053010e39c4e7becbbcb70d"
] | [
"python/tests/server/test_http_output.py"
] | [
"import base64\nimport io\nimport os\nimport tempfile\n\nimport numpy as np\nfrom PIL import Image\nimport responses\nfrom responses.matchers import multipart_matcher\n\nfrom cog import BaseModel, BasePredictor, Path, File\nfrom .test_http import make_client\n\n\ndef test_return_wrong_type():\n class Predictor(B... | [
[
"numpy.float64"
]
] |
hamk-uas/HAMK_Smart_City | [
"c9408ea1caac995522489a331207737b37971314"
] | [
"rnn.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom tensorflow import Variable\nfrom tensorflow.keras.models import Sequential, load_model\nfrom tensorflow.keras.layers import Dense, GRU, LSTM, SimpleRNN, BatchNormalization\nfrom tensorflow.keras.optimizers import Adam\nfrom tensorflow.keras.callbacks import EarlyStoppi... | [
[
"matplotlib.pyplot.legend",
"tensorflow.keras.models.load_model",
"pandas.to_datetime",
"numpy.sqrt",
"sklearn.model_selection.KFold",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.concatenate",
"numpy.mean",
"sklearn.preprocessing.MinMaxScaler",
"tensorflow.kera... |
zhangchenkai/piwise_segmentation | [
"3dfecaae32cde9097d9c312e3373a834b0884319"
] | [
"main.py"
] | [
"import sys\nfrom argparse import ArgumentParser\n\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom torch.autograd import Variable\nfrom torch.optim import Adam\nfrom torch.utils.data import DataLoader\nfrom torchvision.transforms import Compose, Normalize\nfrom torchvision.transforms import ToTensor, T... | [
[
"torch.ones",
"torch.load",
"pandas.DataFrame",
"numpy.concatenate",
"torch.autograd.Variable"
]
] |
alar0330/amazon-sagemaker-build-train-deploy | [
"b476c5ba5b3bd55a99709e7788079763fa498682"
] | [
"03_train_model/source_dir/training_debug.py"
] | [
"import argparse\nimport json\nimport os\nimport random\nimport pandas as pd\nimport glob\nimport pickle as pkl\n\nimport xgboost\n\nfrom smdebug import SaveConfig\nfrom smdebug.xgboost import Hook\n\ndef parse_args():\n\n parser = argparse.ArgumentParser()\n\n parser.add_argument(\"--max_depth\", type=int, d... | [
[
"pandas.read_csv"
]
] |
x1011x/yfinance | [
"87a6dc2e9be7b013a11f956eb4593a5595798e2e"
] | [
"yfinance/ticker.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Yahoo! Finance market data downloader (+fix for Pandas Datareader)\n# https://github.com/ranaroussi/yfinance\n#\n# Copyright 2017-2019 Ran Aroussi\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in comp... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
TausifAnsari/PyHub | [
"6281e9f515674fb51f0d0862c26ec18020fa7d83"
] | [
"Graphs/Line Graph.py"
] | [
"# pip install matplotlib\nimport matplotlib.pyplot as graph\n\nmonths = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\"]\nscores = [100,130,125,90,20,50,70]\n\ngraph.plot(months,scores,color=(0/255,0/255,255/255),marker = \"+\",markersize = 10,markeredgewidth = 2,\nlinewidth = 2,linestyle = \"dotted\", ma... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
bopopescu/sage-5 | [
"9d85b34956ca2edd55af307f99c5d3859acd30bf"
] | [
"src/sage/calculus/desolvers.py"
] | [
"r\"\"\"\nSolving ordinary differential equations\n\nThis file contains functions useful for solving differential equations\nwhich occur commonly in a 1st semester differential equations\ncourse. For another numerical solver see :meth:`ode_solver` function\nand optional package Octave.\n\nCommands:\n\n- ``desolve``... | [
[
"scipy.integrate.odeint"
]
] |
hubertjb/dynamic-spatial-filtering | [
"4580d60c06cd926b34470b8d05d4d72f8e2fd58c"
] | [
"datasets.py"
] | [
"\"\"\"Dataset-related functions and classes.\n\nInspired by `mne.datasets.sleep_physionet`.\n\"\"\"\n\nimport os\nimport os.path as op\n\nimport mne\nimport wfdb\nimport numpy as np\nimport pandas as pd\nfrom mne.datasets.utils import _get_path\nfrom mne.datasets.sleep_physionet._utils import _fetch_one\nfrom brai... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.Series",
"numpy.diff",
"numpy.array",
"numpy.where"
]
] |
intersun/LightningDOT | [
"5f2880f69ba87b8701ab89348d70ebb11432578c"
] | [
"uniter_model/train_vcr.py"
] | [
"# coding=utf-8\n# copied from hugginface github\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc.\n# team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in com... | [
[
"torch.utils.data.distributed.DistributedSampler",
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.nn.ModuleList",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.nn.Embedding",
"torch.utils.data.ConcatDataset",
"torch.no_grad",
"torch.cud... |
erslog/QGrain | [
"9644415c73a929bbdd30d7eb4c3fa861401a5ea4"
] | [
"QGrain/algorithms.py"
] | [
"import weakref\nfrom enum import Enum, unique\nfrom threading import Lock\nfrom typing import Callable, Dict, Iterable, List, Tuple\n\nimport numpy as np\nfrom scipy.special import gamma\n\nINFINITESIMAL = 1e-100\nFRACTION_PARAM_NAME = \"f\"\nNAME_KEY = \"Name\"\nBOUNDS_KEY = \"Bounds\"\nDEFAULT_VALUE_KEY = \"Defa... | [
[
"numpy.square",
"numpy.log",
"scipy.special.gamma",
"numpy.greater",
"numpy.sqrt",
"numpy.zeros_like",
"numpy.array",
"numpy.exp",
"numpy.sum"
]
] |
kirillProkofiev/deep-object-reid | [
"2abc96ec49bc0005ed556e203925354fdf12165c"
] | [
"torchreid/models/osnet_ain.py"
] | [
"from __future__ import division, absolute_import\n\nimport warnings\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torchreid.losses import AngleSimpleLinear\nfrom torchreid.ops import Dropout, HSwish, GumbelSigmoid, LocalContrastNormalization\n\... | [
[
"torch.load",
"torch.cat",
"torch.sum",
"torch.no_grad",
"torch.nn.ModuleDict",
"torch.nn.Sigmoid",
"torch.nn.init.ones_",
"torch.nn.functional.adaptive_max_pool2d",
"torch.nn.functional.relu",
"torch.nn.GroupNorm",
"torch.nn.Sequential",
"torch.nn.BatchNorm1d",
... |
jhamman/MetSim | [
"538ebb141414355a5db0eddde6c0d4bec2e56390"
] | [
"metsim/disaggregate.py"
] | [
"\"\"\"\nDisaggregates daily data down to hourly data using some heuristics\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\nimport metsim\nfrom metsim.defaults import PARAMS as params\nfrom metsim.defaults import CONSTS as consts \n\ntiny_rad_fract = np.zeros(366) #This is updated during the mtclim run\n\ndef... | [
[
"numpy.zeros",
"pandas.DataFrame",
"pandas.date_range"
]
] |
hbery/ML_Image_Compression_Ratio_Analysis | [
"16b21091bc4e3ced62f94f0e68ee302c1da5bf1e"
] | [
"scripts/only_testing.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"Script for testing model\n\n :Date: 06.2021 \n :Author: Adam Twardosz (a.twardosz98@gmail.com, https://github.com/hbery)\n\"\"\"\n\nimport os, sys\nos.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\"\nos.environ['CUDA_VISIBLE_DEVICES'] = '-1'\n\nimport numpy as np\nfrom keras.models ... | [
[
"numpy.savez"
]
] |
PurdueDualityLab/memoized-regex-engine | [
"e7edcb0033a1eba90589e7831733f6527d9c4909"
] | [
"eval/libMemo.py"
] | [
"\"\"\"Memoization: utils associated with memoization experiments\n\"\"\"\n\n# Import libLF\nimport os\nimport sys\nsys.path.append(os.path.join(os.environ['MEMOIZATION_PROJECT_ROOT'], 'eval', 'lib'))\nimport libLF\n\n# Other imports\nimport json\nimport re\nimport tempfile\nimport pandas as pd\n\n###\n# Constants\... | [
[
"pandas.DataFrame"
]
] |
kiototeko/PRIMAL2 | [
"331ca7ba11d48483694594a9f2029d76238668bb"
] | [
"Ray_ACNet.py"
] | [
"import tensorflow as tf\nimport tensorflow.contrib.layers as layers\nimport numpy as np\n\n# parameters for training\nGRAD_CLIP = 10.0\nKEEP_PROB1 = 1 # was 0.5\nKEEP_PROB2 = 1 # was 0.7\nRNN_SIZE = 512\nGOAL_REPR_SIZE = 12\n\n\n# Used to initialize weights for policy and value output layers (Do we need to use t... | [
[
"tensorflow.nn.dynamic_rnn",
"tensorflow.concat",
"tensorflow.nn.rnn_cell.LSTMStateTuple",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.contrib.layers.flatten",
"numpy.random.randn",
"numpy.square",
"tensorflow.contrib.layers.variance_scaling_initializer",
"tens... |
alcinos/auto_yolo | [
"78727596f937b38d4de47dd9f0a7cc8c6104323f"
] | [
"experiments/comparison/baseline_search.py"
] | [
"from auto_yolo import envs\nimport argparse\nimport numpy as np\n\nreadme = \"Searching for baseline threshold.\"\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--n-digits\", type=int, default=1)\nparser.add_argument(\"--transfer\", action=\"store_true\")\nparser.add_argument(\"--sc\", choices=\"AP... | [
[
"numpy.linspace"
]
] |
XiaoyongNI/hybrid-inference | [
"c268e1ada019e08f62e3f02fc6d5059130ec5358"
] | [
"datasets/nclt.py"
] | [
"from __future__ import print_function\nimport sys, os\nsys.path.append('../')\nimport torch.utils.data as data\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport torch\nimport pickle\nimport settings\nimport time\ndates = [];\ndates.append('2012-01-08')\ndates.append('2012-01-15')\nd... | [
[
"numpy.square",
"torch.LongTensor",
"pandas.read_csv",
"numpy.expand_dims",
"numpy.abs",
"numpy.random.seed",
"numpy.linspace",
"numpy.min",
"numpy.eye",
"numpy.cos",
"numpy.sin",
"numpy.concatenate",
"numpy.mean",
"numpy.argmin",
"numpy.zeros"
]
] |
Next-Generation-Neural-Interfaces/Hardware-efficient-MUA-compression | [
"853c6e0f3d085812e88fd0572ac7c64a172255d7"
] | [
"Behavioral decoding/HPC code/Flint_HPC_BDP_S_test.py"
] | [
"\"\"\"\r\nEvaluating spike-based BMI decoding using Wiener filter\r\nLoad Flint data from matlab. HPC version.\r\n\"\"\"\r\n\r\n# import packages\r\nimport numpy as np\r\nfrom HPC_working_dir.functions.preprocess import input_shaping, split_index\r\nfrom HPC_working_dir.functions.decoders import WienerCascadeDecod... | [
[
"numpy.isnan",
"numpy.arange",
"scipy.io.loadmat",
"numpy.cumsum",
"numpy.full",
"numpy.round",
"numpy.copy",
"numpy.delete",
"numpy.shape",
"numpy.nanmean",
"numpy.mean",
"numpy.nanstd",
"numpy.zeros"
]
] |
twild-fb/pytext | [
"07cadc0d130dac30d71d9da70380f124b3f5ac59"
] | [
"pytext/utils/distributed.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport torch\nimport torch.distributed as dist_c10d\n\n\ndef dist_init(\n distributed_rank: int,\n world_size: int,\n init_method: str,\n device_id: int,\n backend: str = \"nccl\",\n):\n \"\"\"\n ... | [
[
"torch.distributed.all_reduce",
"torch.distributed.init_process_group",
"torch.cuda.is_available"
]
] |
ml-jku/mc-lstm | [
"8bbaece3ecb4187a76c6318d4c6e40c1dcc71303"
] | [
"modelzoo/hnn.py"
] | [
"import torch\nfrom torch import nn\n\n\nclass HNN(nn.Module):\n '''Learn arbitrary vector fields that are sums of conservative and solenoidal fields'''\n\n def __init__(self, input_dim, differentiable_model, field_type='solenoidal',\n baseline=False, assume_canonical_coords=True):\n su... | [
[
"torch.sigmoid",
"torch.ones",
"torch.cat",
"torch.eye",
"torch.zeros_like",
"torch.nn.Linear",
"torch.nn.init.orthogonal_"
]
] |
ODU-Internship/BedSore | [
"c9927ce181eb48fc93a3d2adf2330cc0ec412182"
] | [
"app.py"
] | [
"import os\r\nimport plotly.express as px\r\nimport plotly.figure_factory as ff\r\nimport dash\r\nimport dash_core_components as dcc\r\nimport dash_html_components as html\r\nimport numpy as np\r\nimport time\r\n\r\nexternal_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']\r\n\r\napp = dash.Dash(__name_... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
Hongbo-Miao/Cirq | [
"d6c6f9b1ea282e79db4475e5327d0380e6558ba6"
] | [
"cirq/ops/three_qubit_gates.py"
] | [
"# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o... | [
[
"numpy.diag",
"numpy.array",
"numpy.exp",
"numpy.sin"
]
] |
sourcepirate/ML-From-Scratch | [
"c6839bf47c360d6fa48861302fd90ccd4a8c38db"
] | [
"mlfromscratch/supervised_learning/regression.py"
] | [
"from __future__ import print_function, division\nimport numpy as np\nimport math\nfrom mlfromscratch.utils import normalize, polynomial_features\n\n\nclass Regression(object):\n \"\"\" Base regression model. Models the relationship between a scalar dependent variable y and the independent \n variables X. \n ... | [
[
"numpy.diag",
"numpy.sign",
"numpy.linalg.pinv",
"numpy.shape",
"numpy.insert",
"numpy.identity",
"numpy.random.uniform"
]
] |
jornix/Stavanger-school-learning-results | [
"9974cac4ebb91ea51b0437f8b7750feac3049804"
] | [
"script.py"
] | [
"import pandas as pd\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\n\n# Read csv and store in dataframe df\ndf = pd.read_csv(\"results.csv\")\ndf.drop([\"index\"], axis=1).reset_index(drop=True)\n\n\n# Separate fifth grade tests\nfemte_trinn = df[\n (df[\"statistikk\"] == \"Nasjonale prøver 5. tri... | [
[
"pandas.read_csv",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"pandas.isna",
"matplotlib.pyplot.show"
]
] |
misads/cv_template | [
"9976ee0ada449a494d26f896c598610f233edc10"
] | [
"dataloader/dataloaders.py"
] | [
"# encoding=utf-8\nfrom dataloader.image_list import ListTrainValDataset, ListTestDataset\nfrom dataloader.transforms import get_transform\nfrom torch.utils.data import DataLoader\nfrom options import opt\nimport pdb\nimport os\n###################\n\nTEST_DATASET_HAS_OPEN = False # 有没有开放测试集\n\n###################... | [
[
"torch.utils.data.DataLoader"
]
] |
wfbradley/snpko | [
"abc77349d702915519518eacdf919f06579413d0"
] | [
"make_knockoffs.py"
] | [
"#!/usr/bin/env python\n\n\nimport pandas as pd\nimport os\nimport numpy as np\nimport SNPknock.fastphase as fp\nfrom SNPknock import knockoffHMM\nfrom joblib import Parallel, delayed\nimport utils_snpko as utils\n\nlogger = utils.logger\n\n\ndef make_knockoff(chromosome=None, grouped_by_chromosome=None, df_SNP=Non... | [
[
"numpy.arange",
"pandas.notnull",
"numpy.unique"
]
] |
pfnet-research/hierarchical-molecular-learning | [
"2c88a4737c9268e691e97d92bf2e9e2c7e2c1790"
] | [
"unsupNFP/train.py"
] | [
"import argparse\n\nfrom chainer import optimizers\nfrom chainer import serializers\nimport numpy as np\n\nimport model\nimport load_mutag\nimport load_nci1\nimport classification\n\n\nn_epoch = 200\nn_parts = 5\n\nparser = argparse.ArgumentParser()\nparser.add_argument('dataset', type=str, choices=('mutag', 'ptc')... | [
[
"numpy.asarray"
]
] |
cirmuw/functional-twin-analysis | [
"b6730f09f2143d5372f1a90d5fac47e3385e54fb",
"b6730f09f2143d5372f1a90d5fac47e3385e54fb"
] | [
"Code/PrepareTables/SelectedROICorrs_positionVar.py",
"Code/PrepareTables/SelectedROICorrs_vertex.py"
] | [
"#script to create tabels containig x, y and z coordinates of functionally corresponding vertices (position variability) for each twin, one table per vertex\n#input:id of functionally corresponding vetices of each twin to reference\n#output: tables with vertex position in each subject, one table per vetex\nimport n... | [
[
"pandas.concat",
"pandas.DataFrame",
"numpy.concatenate",
"numpy.delete",
"pandas.ExcelFile",
"numpy.load",
"numpy.zeros",
"numpy.where"
],
[
"pandas.concat",
"numpy.expand_dims",
"numpy.squeeze",
"numpy.concatenate",
"numpy.delete",
"numpy.any",
"pa... |
fernandezc/pint | [
"37a61ede6fbd628c7dc160eb36278cf41c96484c"
] | [
"pint/testing.py"
] | [
"from __future__ import annotations\n\nimport math\nimport warnings\nfrom numbers import Number\n\nfrom . import Quantity\nfrom .compat import ndarray\n\ntry:\n import numpy as np\nexcept ImportError:\n np = None\n\n\ndef _get_comparable_magnitudes(first, second, msg):\n if isinstance(first, Quantity) and ... | [
[
"numpy.testing.assert_array_equal",
"numpy.testing.assert_allclose"
]
] |
rafcy/FastMOT | [
"9aee101b1ac83a5fea8cece1f8cfda8030adb743"
] | [
"fastmot/utils/visualization.py"
] | [
"import colorsys\nimport numpy as np\nimport cv2\n\n\nGOLDEN_RATIO = 0.618033988749895\n\n\ndef draw_tracks(frame, tracks, show_flow=False, show_cov=False):\n for track in tracks:\n draw_bbox(frame, track.tlbr, get_color(track.trk_id), 2, str(track.trk_id))\n if show_flow:\n draw_feature... | [
[
"numpy.fmod",
"numpy.sqrt",
"numpy.rint",
"numpy.tile",
"numpy.arctan2",
"numpy.linalg.eigh"
]
] |
RachithP/rpg_public_dronet | [
"244b44c6d321e77cfe326071f8413ea1f7e438cb"
] | [
"utils.py"
] | [
"import re\nimport os\nimport numpy as np\nimport tensorflow as tf\nimport json\nimport time\nfrom keras import backend as K\nfrom keras.preprocessing.image import Iterator\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.utils.generic_utils import Progbar\nfrom keras.models import model_from_j... | [
[
"tensorflow.reduce_sum",
"tensorflow.equal",
"tensorflow.minimum",
"tensorflow.squeeze",
"tensorflow.cast",
"numpy.concatenate",
"tensorflow.nn.top_k",
"tensorflow.gather",
"numpy.array",
"numpy.loadtxt"
]
] |
CellEight/vision | [
"e8dded4c05ee403633529cef2e09bf94b07f6170"
] | [
"test/test_datasets.py"
] | [
"import contextlib\nimport sys\nimport os\nimport unittest\nfrom unittest import mock\nimport numpy as np\nimport PIL\nfrom PIL import Image\nfrom torch._utils_internal import get_file_path_2\nimport torchvision\nfrom torchvision.datasets import utils\nfrom common_utils import get_tmp_dir\nfrom fakedata_generation ... | [
[
"torch.randint",
"torch.iinfo",
"torch.tensor",
"torch.save",
"torch.rand",
"numpy.array",
"numpy.random.randint"
]
] |
araistrick/camera_pan_renderer | [
"900c6c064ac7d2b460087a16be49204276679e04"
] | [
"render.py"
] | [
"import os\nimport argparse\nfrom pathlib import Path\n\nimport bpy\nimport numpy as np\n\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"PCI_BUS_ID\"\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\n\ndef use_cuda():\n bpy.context.preferences.addons[\"cycles\"].preferences.compute_device_type = \"CUDA\"\n print(bpy.con... | [
[
"numpy.array"
]
] |
siyuan-song/Container | [
"42313132af32f2edf710643b9ceb8ca84693ba5c"
] | [
"samples/demo.py"
] | [
"\n# coding: utf-8\n\n# # Mask R-CNN Demo\n# \n# A quick intro to using the pre-trained model to detect and segment objects.\n\n# In[1]:\n\n\nimport os\nimport sys\nimport random\nimport math\nimport numpy as np\nimport skimage.io\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n# Root directory of the projec... | [
[
"numpy.mean",
"numpy.random.choice"
]
] |
deepkashiwa20/TrafficAccident | [
"c5fb26106137a4e85e5b5aa1e8ffdbb672a61988",
"c5fb26106137a4e85e5b5aa1e8ffdbb672a61988"
] | [
"save/tokyo202112_MemGCRN_c1to1_20220208115005_time/traintest_MemGCRN.py",
"save/tokyo202112_MemGCRN_c1to1_20220208115005_time/MemGCRN.py"
] | [
"import sys\nimport os\nimport shutil\nimport math\nimport numpy as np\nimport pandas as pd\nimport scipy.sparse as ss\nfrom sklearn.preprocessing import StandardScaler, MinMaxScaler\nfrom datetime import datetime\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.funct... | [
[
"torch.nn.init.uniform_",
"torch.load",
"numpy.squeeze",
"numpy.vstack",
"torch.utils.data.DataLoader",
"torch.nn.init.xavier_uniform_",
"torch.set_num_threads",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"torch.nn.L1Loss",
"torch.utils.data.TensorD... |
dmayo/brain-score | [
"3ab4258152c9e3f8c7d29afb10158b184dbcebbe"
] | [
"packaging/dicarlo/sanghavi/sanghavimurty2020things1.py"
] | [
"import os\nfrom pathlib import Path\nimport json\n\nimport numpy as np\nimport xarray as xr\nimport pandas as pd\n\nfrom brainio_base.assemblies import NeuronRecordingAssembly\nfrom brainio_base.stimuli import StimulusSet\nfrom brainio_collection.packaging import package_data_assembly, package_stimulus_set\nfrom m... | [
[
"pandas.read_csv",
"numpy.unique",
"numpy.arange",
"numpy.mean",
"numpy.load",
"numpy.where",
"numpy.isin"
]
] |
rubensmau/splink | [
"da4f5d5bc09753b6c6974af308dd1bad324d9b4b"
] | [
"splink/intuition.py"
] | [
"from .model import Model\n\nfrom .charts import load_chart_definition, altair_if_installed_else_json\n\nimport pandas as pd\nfrom math import log2\n\ninitial_template = \"\"\"\nInitial probability of match (prior) = λ = {lam:.4g}\n\"\"\"\n\ncol_template = [\n (\"Comparison of {column_name}. Values are:\", \"\"... | [
[
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.