repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
kklkodi/empirikushazi
[ "8780a9c4e3e4603e636da2fccbe6f2d8a5afad4b" ]
[ "hw_demo_estimation/data_manipulation.py" ]
[ "import pandas as pd\n\n\ndef compute_directed_edges(edges_w_features):\n \"\"\"\n Converts the undirected edge information into a directed format, by duplicating each edge and flipping the node\n attributes to make it point in the opposite direction. This makes computation from the viewpoint of each node\...
[ [ "pandas.concat" ] ]
Jianningli/MIA
[ "bf9b90b9972cd43f885f676c926a984bf38b743a" ]
[ "source/EncoderDecoder_boundaryloss.py" ]
[ "from __future__ import print_function, division\r\n\r\nimport os\r\nimport numpy as np\r\nfrom keras.layers import BatchNormalization, Activation\r\nfrom keras.layers import Input, Dense, Flatten, Dropout\r\nfrom keras.layers.advanced_activations import LeakyReLU\r\nfrom keras.layers.convolutional import UpSamplin...
[ [ "numpy.zeros_like", "numpy.load", "scipy.ndimage.distance_transform_edt", "scipy.ndimage.zoom", "numpy.expand_dims", "numpy.random.randint" ] ]
johnhendrick/adventofcode2021
[ "04d884d65eebc0178ddb79b1ff2a5c088c349e5e" ]
[ "adventcode/day7.py" ]
[ "import numpy as np\nfrom utils import read_file\n\nfile_path = './input/day7.txt'\n\n\ndef parse_file(file_content):\n return [int(x) for x in file_content.split(',')]\n\n\ndef fuel(steps):\n return steps*(steps+1)/2\n\n\ndata = parse_file(read_file(file_path))\n\nnp_data = np.array(data)\nmedian = np.median...
[ [ "numpy.array", "numpy.abs", "numpy.median" ] ]
cjluo/money-monkey
[ "b43e3c6df4221d14d78e1f6c8487ec2308286be1" ]
[ "model_presenter.py" ]
[ "import matplotlib\n# Do not use X for plotting\nmatplotlib.use('Agg')\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.dates import DateFormatter\nfrom matplotlib.ticker import FormatStrFormatter\nfrom tempfile import NamedTemporaryFile\n\n\ndef plot_to_file(symbol, timestamp, close, score):\n fig, ax1 = plt...
[ [ "matplotlib.dates.DateFormatter", "matplotlib.ticker.FormatStrFormatter", "matplotlib.pyplot.subplots", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.use" ] ]
TheRensselaerIDEA/ExplainableAI
[ "ea7a24c660120b61dc3d346ac0a0bc845c5eb0cf" ]
[ "build/lib/explainableAI/metrics/TAUOPTIMAL.py" ]
[ "import numpy as np\ndef optimalTau(probabilities, ylabels):\n \n \"\"\" Finds the Optimal tau based on the F1 score\"\"\"\n \n #STEP 1 SORT PROBABILITIES AND LABELS\n sortedIndexes = np.argsort( probabilities )\n probabilities1 = probabilities[ sort...
[ [ "numpy.array", "numpy.where", "numpy.argsort" ] ]
tranbaohieu/SAFL_pytorch
[ "4d582974e40031fd595c663489f631dff1abbb5a" ]
[ "demo.py" ]
[ "from __future__ import absolute_import\nimport sys\nsys.path.append('./')\nimport timeit\nimport argparse\nimport os\nimport os.path as osp\nimport numpy as np\nimport math\nimport time\nfrom PIL import Image, ImageFile\n\nimport torch\nfrom torch import nn, optim\nfrom torch.backends import cudnn\nfrom torch.util...
[ [ "torch.cuda.manual_seed_all", "torch.cuda.manual_seed", "torch.manual_seed", "torch.save", "numpy.random.seed", "torch.no_grad", "numpy.floor", "torch.set_default_tensor_type", "torch.cuda.is_available", "torch.IntTensor", "torch.nn.DataParallel", "torch.device" ]...
erthalion/ansible-ycsb
[ "86916fbc4128629df77090b49819a9a4c4d15ea4" ]
[ "parse.py" ]
[ "#!/usr/bin/env python3.6\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport glob\nimport json\nimport logging\nimport itertools\nimport toolz\nimport statistics\n\nfrom matplotlib import rc\nrc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\nrc('text', usetex=True)\n\nimport matplotlib.pyplot ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.rc", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "scipy.interpolate.spline", "numpy.linspace" ] ]
CnBDM-Su/LV_XNN
[ "52f1ab2041d734a4b35066a7d2ffef1a3da7d792" ]
[ "scripts/benchmark/xgb_test.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 19 10:59:51 2020\n\n@author: suyu\n\"\"\"\nfrom sklearn.model_selection import train_test_split,GridSearchCV,PredefinedSplit\nfrom sklearn.metrics import make_scorer,mean_squared_error,roc_auc_score,mean_absolute_error,log_loss\nfrom xgboost import XGBClassifier,...
[ [ "numpy.ones", "sklearn.model_selection.PredefinedSplit", "sklearn.metrics.mean_squared_error", "sklearn.metrics.mean_absolute_error", "pandas.DataFrame", "sklearn.metrics.roc_auc_score", "sklearn.metrics.make_scorer", "numpy.where", "sklearn.metrics.log_loss", "numpy.std", ...
Cyber-Neuron/inception_v3
[ "d3f566ccfc17f4779900a9f2d81dd593b3100df5" ]
[ "inception/inception/inception_train.py" ]
[ "# Copyright 2016 Google Inc. 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.initialize_all_variables", "tensorflow.app.flags.DEFINE_string", "tensorflow.name_scope", "tensorflow.app.flags.DEFINE_float", "tensorflow.concat", "tensorflow.identity", "tensorflow.all_variables", "tensorflow.get_variable_scope", "tensorflow.split", "tensorflo...
rhoadesScholar/daisy
[ "78cdd2ed0d67647a6602fb53cc952214450f3753" ]
[ "examples/visualize.py" ]
[ "#!/usr/bin/env python\n\nfrom funlib.show.neuroglancer import add_layer\nimport argparse\nimport daisy\nimport glob\nimport neuroglancer\nimport os\nimport webbrowser\nimport numpy as np\nimport zarr\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\n '--file',\n '-f',\n type=str,\n action='a...
[ [ "numpy.concatenate" ] ]
aelnouby/summerschool2015
[ "c96da4af353fc1b0c1a7e3a08863c6de89072b19" ]
[ "convnets/logistic_sgd.py" ]
[ "\"\"\"\nThis tutorial introduces logistic regression using Theano and stochastic\ngradient descent.\n\nLogistic regression is a probabilistic, linear classifier. It is parametrized\nby a weight matrix :math:`W` and a bias vector :math:`b`. Classification is\ndone by projecting data points onto a set of hyperplanes...
[ [ "numpy.mean", "numpy.asarray", "numpy.zeros" ] ]
fxdupe/graphmatchingtools
[ "4503a04c4a0822315535e6ab3cd698417859908d" ]
[ "graph_matching_tools/algorithms/multiway/hippi.py" ]
[ "\"\"\"\nHiPPI algorithm as described in ICCV 2019 paper\n\n.. moduleauthor:: François-Xavier Dupé\n\"\"\"\nimport numpy as np\n\nimport graph_matching_tools.algorithms.multiway.utils as utils\n\n\ndef hippi_multiway_matching(s, sizes, knode, u_dim, iterations=100, tolerance=1e-6, init=None):\n \"\"\"\n HiPPI...
[ [ "numpy.random.randn", "numpy.trace", "numpy.abs", "numpy.ones" ] ]
summerRainn/DeepLearningNotes
[ "6657694d5e22e73969e47699b4e31a28385d0f19" ]
[ "Note-6 A3CNet/Note-6.2.1 代码阅读顺序/sonnet/python/modules/base_test.py" ]
[ "# Copyright 2017 The Sonnet 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 required ...
[ [ "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.Graph", "tensorflow.trainable_variables", "tensorflow.name_scope", "numpy.random.rand", "tensorflow.identity", "tensorflow.constant", "tens...
h77h7/tvm-04.26
[ "1bd8e6b921f392ae29b7672159326d94d40d6922" ]
[ "tutorials/language/reduction.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.random.uniform", "numpy.zeros" ] ]
AkshatSh/BinarizedNMT
[ "7fa15149fdfcad6b1fd0956157c3730f3dcd781f" ]
[ "translation/models/AttentionQRNN.py" ]
[ "import sys\nsys.path.append(\"..\")\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport random\nimport argparse\n\ntry:\n from torchqrnn import QRNN\nexcept:\n # to stop python 3.7.x breaking\n QRNN = None\n\nfrom models.EncoderDecoder import (\n EncoderModel,\n DecoderMod...
[ [ "torch.zeros", "torch.cat", "torch.nn.Dropout" ] ]
imjoseangel/100DaysOfCode
[ "bff90569033e2b02a56e893bd45727125962aeb3" ]
[ "python/mltraining/cross-validation/leave-p-out.py" ]
[ "# Example of LOOCV and LPOCV splitting\n\nimport numpy\nfrom sklearn.model_selection import LeaveOneOut, LeavePOut\n\n# Configurable constants\nP_VAL = 2\n\n\ndef print_result(split_data):\n \"\"\"\n Prints the result of either a LPOCV or LOOCV operation\n Args:\n split_data: The resulting (train, ...
[ [ "numpy.array", "sklearn.model_selection.LeaveOneOut", "sklearn.model_selection.LeavePOut" ] ]
Jacob-Barhak/holoviews
[ "5df0269595ca7befca202f9d05522c68983dc974", "5df0269595ca7befca202f9d05522c68983dc974" ]
[ "holoviews/tests/plotting/bokeh/testelementplot.py", "holoviews/tests/plotting/matplotlib/testrasterplot.py" ]
[ "from unittest import SkipTest\nfrom collections import OrderedDict\n\nimport numpy as np\n\nfrom bokeh.core.properties import value\nfrom holoviews.core import Dimension, DynamicMap, NdOverlay, HoloMap\nfrom holoviews.element import Curve, Image, Scatter, Labels\nfrom holoviews.streams import Stream, PointDraw\nfr...
[ [ "numpy.array", "numpy.ones", "numpy.random.randn" ], [ "numpy.array" ] ]
andreped/GSI-RADS
[ "3582ed84216266e05cb71f6223ce9814a6df203f" ]
[ "diagnosis/src/Utils/volume_utilities.py" ]
[ "import numpy as np\nfrom copy import deepcopy\nfrom skimage.transform import resize\nfrom scipy.ndimage import binary_fill_holes\nfrom skimage.measure import regionprops\nfrom diagnosis.src.Utils.configuration_parser import *\n\n\ndef crop_MR(volume, parameters):\n original_volume = np.copy(volume)\n volume[...
[ [ "scipy.ndimage.binary_fill_holes", "numpy.copy", "numpy.max", "numpy.min", "numpy.std", "numpy.pad", "numpy.percentile", "numpy.mean" ] ]
2742195759/Paddle
[ "ce034db1834af85539b22ab68492df9972ff3e69" ]
[ "python/paddle/fluid/tests/unittests/mkldnn/test_activation_mkldnn_op.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.sqrt", "numpy.random.uniform", "numpy.random.random_sample", "numpy.sign", "numpy.random.seed", "numpy.abs", "numpy.exp", "scipy.special.expit", "numpy.maximum", "numpy.tanh" ] ]
Term-inator/Brain-Tumor-Detection
[ "b59715092cca7a17b589b5d906983eb42ee4ad87" ]
[ "run.py" ]
[ "# ====================================================\n# main\n# ====================================================\nimport os\nimport shutil\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import GroupKFold\n\nfrom utils import get_score, seed_torch\nfrom train import train_loop, set_p...
[ [ "pandas.read_csv", "sklearn.model_selection.GroupKFold", "pandas.DataFrame", "pandas.concat", "numpy.array", "numpy.round", "numpy.mean" ] ]
AlexFaernon/refactoring
[ "5aafbbcadd92f3fe1fb3b6a6cfb2fd79d6bef9a4" ]
[ "filter.py" ]
[ "from PIL import Image\r\nimport numpy as np\r\n\r\ncorrect_path = False\r\nCELL_X_OFFSET = 10\r\nCELL_Y_OFFSET = 10\r\nGREY_GRADATION = 50\r\nwhile not correct_path:\r\n img_path = input(\"Enter path to image for filtering: \")\r\n try:\r\n img = Image.open(img_path)\r\n correct_path = True\r\n...
[ [ "numpy.array", "numpy.sum", "numpy.zeros" ] ]
swiftfish/flexitext
[ "9863650b662bef6dd63222f0b9bade2e72f4d762" ]
[ "flexitext/flexitext.py" ]
[ "import matplotlib.pyplot as plt\n\nfrom matplotlib.offsetbox import AnnotationBbox\n\nfrom flexitext.parser import make_texts\nfrom flexitext.textgrid import make_text_grid\n\n\nclass FlexiText:\n \"\"\"Handle storing and drawing of formatted text.\n\n Parameters\n ----------\n\n texts: tuple or list o...
[ [ "matplotlib.offsetbox.AnnotationBbox", "matplotlib.pyplot.gca" ] ]
mwmoura/Concreto-armado
[ "487d9d513cfa4ba24c765fa8015bf5fc43cd60f1" ]
[ "Concreto/MomxCurv2.py" ]
[ "# Diagrama Momento x curvatura para seções transversais de concreto armado\n#\n# ENTRADA DE DADOS\n# Chamar biblioteca matemática\nimport numpy as np\n#\ndef tensao(esl):\n # Calcula a tensão no aço\n # es = módulo de elasticidade do aço em kN/cm2\n # esl = deformação de entrada\n # fyd = tensão de esc...
[ [ "numpy.abs", "numpy.asarray" ] ]
vhn0912/python-snippets
[ "80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038" ]
[ "notebook/numpy_swap_select.py" ]
[ "import numpy as np\n\na = np.arange(10, 35).reshape(5, 5)\nprint(a)\n# [[10 11 12 13 14]\n# [15 16 17 18 19]\n# [20 21 22 23 24]\n# [25 26 27 28 29]\n# [30 31 32 33 34]]\n\ncol_swap = a[:, [3, 2, 4, 0, 1]]\nprint(col_swap)\n# [[13 12 14 10 11]\n# [18 17 19 15 16]\n# [23 22 24 20 21]\n# [28 27 29 25 26]\n# ...
[ [ "numpy.arange" ] ]
BaconBoi95/tensorflow
[ "484e8acedceebec8d7ea5fb008d4c367041c9cff" ]
[ "tensorflow/python/debug/lib/check_numerics_callback_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.data.ops.dataset_ops.make_one_shot_iterator", "tensorflow.python.data.ops.dataset_ops.Dataset.range", "tensorflow.python.keras.layers.Dropout", "tensorflow.python.debug.lib.check_numerics_callback.limit_string_length", "tensorflow.python.framework.constant_op.constant", ...
AdityaSidharta/kaggle_humpback_new_whale
[ "779d60746f8eba99d0336836200150fa7a08388e" ]
[ "model/dataset.py" ]
[ "import os\n\nimport torch\nfrom skimage import io\nfrom skimage.color import gray2rgb\nfrom torch.utils.data import Dataset\nfrom torchvision.transforms import Compose, Resize, RandomHorizontalFlip, \\\n RandomVerticalFlip, RandomAffine, Normalize, ToTensor, ToPILImage, Grayscale\n\ntrain_transform = Compose([\...
[ [ "torch.Tensor" ] ]
NVlabs/UMR
[ "d858c4ddd56bdac6e3342609f9c02618c279b990" ]
[ "utils/geometry.py" ]
[ "# -----------------------------------------------------------\n# Code adapted from: https://github.com/akanazawa/cmr/blob/master/utils/geometry.py\n# \n# MIT License\n# \n# Copyright (c) 2018 akanazawa\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and assoc...
[ [ "numpy.matmul", "numpy.linalg.inv", "numpy.copy", "numpy.stack", "numpy.linalg.norm" ] ]
r-vu/barc
[ "7f90d4f8689df7410f0bf4be8843cfe216da1c9f" ]
[ "workspace/src/labs/src/lab2/plot.py" ]
[ "import rosbag\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport matplotlib.patches as patches\n\nbag = rosbag.Bag(os.path.expanduser(\"/d/Documents/classes/me131/_2020-02-10-20-44-36.bag\"))\n\n\ntopics = bag.get_type_and_topic_info()[1].keys()\ntypes = []\nfor i in range(0,len(bag.get_type_a...
[ [ "numpy.ones", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel" ] ]
jwbrun/ASGDSimulator
[ "ecab2cc83986f08b21bc85151cece85a08fcce82" ]
[ "convNet/trainer.py" ]
[ "import time\nimport logging\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nfrom torch.nn.utils import clip_grad_norm_\nfrom utils.meters import AverageMeter, accuracy\n\n\ndef _flatten_duplicates(inputs, target, batch_first=True):\n if batch_first:\n target = target.view(-1, 1).expand(-1...
[ [ "torch.nn.DataParallel", "torch.nn.parallel.DistributedDataParallel", "torch.no_grad", "torch.cat" ] ]
ryu577/survival
[ "0c6bf3dfcbb570ffd9e053bee56c86541acc01f0" ]
[ "survival/misc/misc.py" ]
[ "import numpy as np\n\n\ndef solve_hazard_eqn(fn, val, minval=10.0, maxval=900.0, interval=1.0):\n\t'''\n\tFinds the approximate point where a function crosses a value from below.\n\t'''\n\tprev_val = fn(minval)\n\n\tfor i in np.arange(minval+interval, maxval, interval):\n\t\tnext_val = fn(i)\n\t\tif next_val < val...
[ [ "numpy.arange" ] ]
LavinaVRovine/hazard
[ "e0408374dc0b76f8b9a0107f5f12cca2d4c033ef" ]
[ "predictions/lol_predictor.py" ]
[ "import pandas as pd\nimport mlflow.sklearn\nfrom sqlalchemy import create_engine\nfrom config import DATABASE_URI\n\nfrom predictions.common_predictor import CommonPredictor\nfrom config import ROOT_DIR\n\npd.set_option(\"display.width\", 1000)\npd.set_option(\"display.max_columns\", 50)\n\n\nclass LoLPredictor(Co...
[ [ "pandas.read_sql", "pandas.set_option" ] ]
saiabinesh/EdgeNets
[ "2b232d3f7fb60658755dad1ebca0ffc895cc795e" ]
[ "nn_layers/efficient_dwise_conv.py" ]
[ "#============================================\n__author__ = \"Sachin Mehta\"\n__maintainer__ = \"Sachin Mehta\"\n#============================================\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom nn_layers.cnn_utils import activation_fn, CBR, Shuffle, BR\nimport math\n\n\nclas...
[ [ "torch.nn.AdaptiveAvgPool2d", "torch.nn.Sigmoid", "torch.nn.Conv2d", "torch.Tensor" ] ]
selim-karaduman/pytorch-drl-algs
[ "c354399893eae41fe820134e5e57d0d152d9fe5a" ]
[ "pytorch_drl/utils/exploration.py" ]
[ "import numpy as np\nfrom pytorch_drl.utils.schedule import LinearSchedule\n\nclass OrnsteinUhlenbeck:\n\n def __init__(self, x_size, mu=0, \n sigma_init=0.2, sigma_final=0.2, \n sigma_horizon=1, theta=0.2, dt=1e-2):\n self.mu = mu\n self.x_size = x_size\n self....
[ [ "numpy.sqrt", "numpy.random.randn", "numpy.zeros" ] ]
phoenx34/wav.snipe
[ "d6d0b26440e5913dfbd5ea33b53ff226d405339c" ]
[ "development/librosa/core/constantq.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n'''Constant-Q transforms'''\nfrom __future__ import division\n\nimport numpy as np\nimport scipy.fftpack as fft\n\nfrom . import audio\nfrom .time_frequency import cqt_frequencies, note_to_hz\nfrom .spectrum import stft\nfrom .pitch import estimate_tuning\nfrom .. im...
[ [ "numpy.vstack", "numpy.sum", "numpy.log2", "scipy.fftpack.fft", "numpy.abs", "numpy.max", "numpy.min", "numpy.sqrt", "numpy.ascontiguousarray" ] ]
liudengfeng/zipline
[ "01fdd51d83efeb3453e92b7d02c255a06eba49ac" ]
[ "zipline/pipeline/fundamentals/localdata_wy.py" ]
[ "\"\"\"\n\n查询本地数据\n\n尽管`bcolz`最终会丢失时区信息,但写入时依旧将时间列转换为UTC时区。\n除asof_date、timestamp列外,其余时间列无需转换\n\n\"\"\"\n\nimport re\nimport warnings\nfrom concurrent.futures.thread import ThreadPoolExecutor\nfrom functools import partial\n\nimport numpy as np\nimport pandas as pd\n\nfrom cnswd.cninfo.utils import _rename\nfrom cn...
[ [ "pandas.DataFrame", "pandas.Timedelta", "pandas.DataFrame.from_records", "numpy.log", "pandas.concat", "pandas.Timestamp", "pandas.pivot_table" ] ]
DuckerMan/ru-gpts
[ "cbe8b1e4ae3b88642292590f51c5eacdea7b6846" ]
[ "utils.py" ]
[ "# coding=utf-8\n# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0...
[ [ "numpy.random.set_state", "torch.get_rng_state", "torch.distributed.get_rank", "torch.load", "numpy.random.get_state", "torch.cuda.memory_cached", "torch.cuda.get_rng_state", "torch.cuda.set_rng_state", "torch.save", "torch.cuda.synchronize", "torch.cuda.current_device"...
jesbu1/h-baselines
[ "f6f775bb18de22527f2d01d73bd733ed2e435ba3" ]
[ "SocialRobotCustom/python/social_bot/gazebo_agent.py" ]
[ "# Copyright (c) 2019 Horizon Robotics. 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 requi...
[ [ "numpy.cos", "numpy.clip", "numpy.array", "numpy.sin", "numpy.concatenate" ] ]
Tgordon523/ps5_analysis
[ "019b8f956ef552624dc823583e19bcf384dcfc08" ]
[ "ps5_shortage.py" ]
[ "### Script to pull and update data tracking\n### import packages\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport requests\nimport io\nimport pathlib\nfrom bs4 import BeautifulSoup\n\n\ndef dataset_load() -> pd.DataFrame():\n \"\"\"\n Function to load a...
[ [ "pandas.DataFrame" ] ]
jakartaresearch/receipt-ocr
[ "003e067eb7d80495226ad15235fa1d626a09103e" ]
[ "src/text_detector/load_model.py" ]
[ "import torch\nimport torch.backends.cudnn as cudnn\n\nfrom collections import OrderedDict\nfrom .modules.utils import yaml_loader, create_model_for_provider\nfrom .modules.craft import CRAFT\n\n\ndef copy_state_dict(state_dict):\n if list(state_dict.keys())[0].startswith(\"module\"):\n start_idx = 1\n ...
[ [ "torch.nn.DataParallel", "torch.cuda.is_available", "torch.load" ] ]
MannyKayy/DeepSpeed
[ "67821f95e4ee04f65965eac4ecc1ffacab4302e6" ]
[ "deepspeed/pt/deepspeed_timer.py" ]
[ "'''\nCopyright 2019 The Microsoft DeepSpeed Team\n'''\n\nimport time\nimport psutil\nimport torch\n\nfrom deepspeed.pt.log_utils import logger\n\n\ndef print_rank_0(message):\n if torch.distributed.is_initialized():\n if torch.distributed.get_rank() == 0:\n logger.info(message)\n else:\n ...
[ [ "torch.distributed.get_rank", "torch.cuda.memory_cached", "torch.cuda.synchronize", "torch.distributed.is_initialized", "torch.cuda.max_memory_allocated", "torch.cuda.memory_allocated", "torch.cuda.max_memory_cached" ] ]
lccatala/tfg_ros
[ "d8da2bc6b1e0036e34460d174e708764a3c6f4ca" ]
[ "tfg/src/pytorch_segmentation/utils/helpers.py" ]
[ "import os\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport math\nimport PIL\nimport matplotlib.pyplot as plt\n\ndef show_images(images, in_row=True):\n '''\n Helper function to show 3 images\n '''\n total_images = len(images)\n\n rc_tuple = (1, total_images)\n if not in_row:\n ...
[ [ "torch.nn.init.kaiming_normal_", "numpy.zeros", "matplotlib.pyplot.axis", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "torch.from_numpy" ] ]
Ray-Young/Machine_Learning_Study
[ "f665d4b9fe7c1c1f722c76e91a5b3f99b2b8a19c" ]
[ "K-Nearest-Neighbor/bk/process.py" ]
[ "import numpy as np\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom decimal import Decimal\nimport csv\n\ndef processFile(inFile):\n lst = []\n with open(inFile) as f:\n for line in f:\n tmp = line.strip().split(\",\")\n lst.append(tmp)\n # sums = [0,0,0,0,0,...
[ [ "numpy.std", "numpy.average" ] ]
franklili3/pyfolio
[ "a63245b768e9b90154f31ca1a7a1a2472caafbfd" ]
[ "pyfolio/interesting_periods.py" ]
[ "#\n# Copyright 2016 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...
[ [ "pandas.Timestamp" ] ]
gqkc/CLOSURE
[ "a0204396822ae70d91e44ecb12ae05e2e02e69d7" ]
[ "scripts/preprocess_questions.py" ]
[ "#!/usr/bin/env python3\n\n# This code is released under the MIT License in association with the following paper:\n#\n# CLOSURE: Assessing Systematic Generalization of CLEVR Models (https://arxiv.org/abs/1912.05783).\n#\n# Full copyright and license information (including third party attribution) in the NOTICE file...
[ [ "numpy.asarray" ] ]
LeDuySon/Vehicle-tracking-deepsort
[ "ab03375d11d83def0452260d7071e9c1cc7406c2" ]
[ "yolov3_deepsort.py" ]
[ "import os\nimport cv2\nimport time\nimport argparse\nimport torch\nimport warnings\nimport numpy as np\n\nfrom detector import build_detector\nfrom deep_sort import build_tracker\nfrom utils.draw import draw_boxes\nfrom utils.parser import get_config\nfrom utils.log import get_logger\nfrom utils.io import write_re...
[ [ "torch.cuda.is_available" ] ]
GandalfSaxe/letomes
[ "5f73a4066fcf69260cb538c105acf898b22e756d" ]
[ "code/cudasim/cuda_rocketry.py" ]
[ "from orbsim.r3b_2d.simulators import run_sim\nfrom multiprocessing import Pool\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# import pygmo as pg\n# from pygmo import algorithm\nimport os\nimport sys\nfrom orbsim.r3b_2d.simulators import run_sim\n\n# from orbsim.plotting import orbitplot2d, orbitplot_n...
[ [ "scipy.stats.rankdata", "numpy.zeros", "numpy.random.seed", "numpy.random.randn", "numpy.array", "numpy.dot" ] ]
frankstratton/eps
[ "37e8b2f739df68db9d49e66852e294c110b8bf8a" ]
[ "test/support/python/naive_bayes.py" ]
[ "import pandas as pd\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn2pmml import sklearn2pmml\nfrom sklearn2pmml.decoration import ContinuousDomain, CategoricalDomain\nfrom sklearn2pmml.pipeline i...
[ [ "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder", "sklearn.naive_bayes.GaussianNB" ] ]
EM-AutoML/AutoDL-Projects
[ "8ff416fe5d6cb1b310b885fe376e6f2790fbda14" ]
[ "exps/algos/R_EA.py" ]
[ "##################################################\n# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020 #\n##################################################################\n# Regularized Evolution for Image Classifier Architecture Search #\n##################################################################\nimport ...
[ [ "torch.set_num_threads", "torch.save", "torch.cuda.is_available", "torch.utils.data.sampler.SubsetRandomSampler" ] ]
VuongLong/DANCE_W
[ "8a7dc39a16908bb4726ed57049c6a7d6698a76bc" ]
[ "models/algorithms.py" ]
[ "import torch\nfrom torch.autograd import Function\nfrom torch import nn\nimport torch.nn.functional as F\n\ndef op_copy(optimizer):\n for param_group in optimizer.param_groups:\n param_group['lr0'] = param_group['lr']\n return optimizer\n\ndef lr_scheduler(optimizer, iter_num, max_iter, gamma=10, powe...
[ [ "torch.nn.Linear", "torch.nn.init.xavier_normal_", "torch.nn.init.normal_", "torch.nn.init.zeros_", "torch.nn.init.kaiming_uniform_" ] ]
hoxmark/Deep_reinforcement_active_learning
[ "7458916d6f75c7fbfcfd4bc81763ab5ba16208ad" ]
[ "selection_strategies/download_graphs/cnn/cnn_sim_umich_n_del.py" ]
[ "from pprint import pprint\nfrom visdom import Visdom\nimport pathlib\nimport json\nimport sys\nimport matplotlib.pyplot as plt\n\ndef download_env(env):\n vis = Visdom('http://logserver.duckdns.org', port=5010)\n data = vis.get_window_data(env=env)\n d = json.loads(data)\n \n n_deleted = []\n tes...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.axis", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel" ] ]
lauritowal/plainFDM_public
[ "3d47352e5aad15b0c632488b048b470d0528c652" ]
[ "plain_fdm/lfz_controlFDM/pid_regler.py" ]
[ "import numpy as np\nimport logging\n\nfrom plain_fdm.servicesFDM.utils import Utils\n\nlogging.basicConfig(filename='pid_regler.log', filemode='w', level=logging.DEBUG)\n\n\n# siehe auch Drohne-Code Unity\nclass PidRegler(object):\n\n def __init__(self):\n self.utils = Utils()\n self.kpaElevator ...
[ [ "numpy.clip", "numpy.rad2deg" ] ]
xiaoyili/elasticdl
[ "93e58c42eb5e2ef14661469777d0224884d7bf1d" ]
[ "elasticdl/python/common/model_handler.py" ]
[ "import abc\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom elasticdl.python.common.constants import DistributionStrategy\nfrom elasticdl.python.common.log_utils import default_logger as logger\nfrom elasticdl.python.common.save_utils import CheckpointSaver\nfrom elasticdl.python.elasticdl.layers.embedding i...
[ [ "tensorflow.keras.layers.Embedding", "numpy.zeros", "tensorflow.keras.backend.clear_session", "tensorflow.keras.models.clone_model", "tensorflow.keras.initializers.serialize" ] ]
BitBottleneck/cvprreview
[ "5beff8aa6948cfb1665301f4ece1769175fd546f" ]
[ "transfer_learning.py" ]
[ "# -*-coding:utf-8-*-\n\nimport tensorflow as tf\nimport numpy as np\nfrom tensorflow.python import pywrap_tensorflow\nimport os\n\n# The save address of the weight of baseline quantization.\nFILE_PATH_old = \"/home/zxc/Liu/Bit-Bottleneck-ResNet/logs_Bit_Bottleneck/old/model.ckpt\"\n# The new address used to save t...
[ [ "tensorflow.global_variables_initializer", "tensorflow.contrib.framework.load_variable", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.Variable", "tensorflow.contrib.framework.list_variables" ] ]
tefavidal/py-pde
[ "427be3f2f4b096775f46111cd5a5d05af50e94bc" ]
[ "pde/solvers/scipy.py" ]
[ "\"\"\"\nDefines a solver using :mod:`scipy.integrate`\n \n.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de> \n\"\"\"\n\nfrom typing import Callable\n\nimport numpy as np\n\nfrom ..fields.base import FieldBase\nfrom ..pdes.base import PDEBase\nfrom .base import SolverBase\n\n\nclass ScipySolver(SolverBase):...
[ [ "numpy.ravel" ] ]
bintulab/storm-analysis
[ "71ae493cbd17ddb97938d0ae2032d97a0eaa76b2" ]
[ "storm_analysis/spliner/measure_psf_utils.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nVarious utility functions for PSF measurement. Basically\ntrying to consolidate/improve what is common between the \nseveral different scripts that do this.\n\nHazen 03/18\n\"\"\"\nimport numpy\nimport scipy\nimport scipy.ndimage\n\nimport storm_analysis.sa_library.imagecorrelation a...
[ [ "numpy.zeros_like", "numpy.sum", "numpy.fft.fftn", "numpy.zeros", "scipy.ndimage.interpolation.zoom", "numpy.copy", "numpy.max", "scipy.ndimage.filters.gaussian_filter", "numpy.concatenate", "numpy.meshgrid", "numpy.fft.fftfreq", "numpy.mean", "scipy.ndimage.int...
javabrett/pandas
[ "7b92e7ee47fa3024aa5bc4fb3518717157c88dcc" ]
[ "pandas/core/base.py" ]
[ "\"\"\"\nBase and utility classes for pandas objects.\n\"\"\"\nimport builtins\nfrom collections import OrderedDict\nimport textwrap\nimport warnings\n\nimport numpy as np\n\nimport pandas._libs.lib as lib\nfrom pandas.compat import PYPY\nfrom pandas.compat.numpy import function as nv\nfrom pandas.errors import Abs...
[ [ "pandas.compat.numpy.function.validate_min", "pandas.Series", "pandas.core.algorithms.value_counts", "pandas.core.dtypes.cast.is_nested_object", "pandas.compat.numpy.function.validate_argmax_with_skipna", "pandas.core.reshape.concat.concat", "numpy.asarray", "pandas.core.nanops.nan...
arangoml/dgl
[ "d135058f9986fadcbdf6aa1011a00c3ad45a8ce3" ]
[ "tutorials/basics/2_basics.py" ]
[ "\"\"\"\r\n.. currentmodule:: dgl\r\n\r\nDGLGraph and Node/edge Features\r\n===============================\r\n\r\n**Author**: `Minjie Wang <https://jermainewang.github.io/>`_, Quan Gan, Yu Gai,\r\nZheng Zhang\r\n\r\nIn this tutorial, you learn how to create a graph and how to read and write node and edge represent...
[ [ "torch.ones", "torch.randn", "torch.tensor", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "torch.zeros" ] ]
Bertinus/causal_cell_embedding
[ "417b55749130fc7b7832fd3ee4c49feff4a04593" ]
[ "ai/causalcell/training.py" ]
[ "import ai.causalcell.utils.configuration as configuration\nimport ai.causalcell.datasets.synthetic_dataset as sd\nimport logging\nimport numpy as np\nimport torch\nimport random\nimport os\nimport copy\nimport dill as pickle\nimport skopt\nfrom collections import OrderedDict\n\n# from ai.causalcell.datasets.synthe...
[ [ "torch.cuda.manual_seed_all", "torch.manual_seed", "torch.no_grad", "numpy.random.seed", "torch.tensor" ] ]
ahstarwab/nn-gev_torch
[ "f7849e55230322fd5bfb4da81efc72875e2e76da" ]
[ "nn_models.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport pdb\nclass BLSTMMaskEstimator(nn.Module):\n def __init__(self, input_dim=513, hidden_dim=512, num_layers=1, dropout=0.3, bidirectional=True):\n super(BLSTMMaskEstimator, self).__init__()\n self.dropout = dropout\n ...
[ [ "torch.nn.Sigmoid", "torch.nn.LSTM", "torch.nn.Linear" ] ]
tomsnail/opencv_tf_py
[ "cf9aa7fa250546564cff56aa33b5a39991b0d8f1" ]
[ "learn/C01/01/Convolution.py" ]
[ "import cv2\nfrom scipy import signal\nimport matplotlib.pyplot as plt\n\nimg = cv2.imread('images/1.jpg',cv2.IMREAD_GRAYSCALE)\nkernel = [[1,1,1],[0,0,0],[-1,-1,-1]]\ndest = signal.convolve2d(img,kernel)\nplt.imshow(dest,cmap='gray')\nplt.show()" ]
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "scipy.signal.convolve2d" ] ]
fire-suppression-abm/mesa
[ "8498eea3e5d4a739aee3b003107a0e7de59c5026" ]
[ "mesa/datacollection.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nMesa Data Collection Module\n===========================\n\nDataCollector is meant to provide a simple, standard way to collect data\ngenerated by a Mesa model. It collects three types of data: model-level data,\nagent-level data, and tables.\n\nA DataCollector is instantiated with...
[ [ "pandas.DataFrame.from_records", "pandas.DataFrame" ] ]
google-research/growneuron
[ "2ab6fe19f920b9f3b9cc9cf8ac39c8965967a5fe" ]
[ "growneuron/layers_test.py" ]
[ "# coding=utf-8\n# Copyright 2022 GradMax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.norm", "tensorflow.math.reduce_prod", "tensorflow.reshape", "tensorflow.ones_like", "tensorflow.zeros_like", "tensorflow.math.count_nonzero", "tensorflow.keras.regularizers.L2", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dense", "tens...
mpeychev/disentangled-autoencoders
[ "2d1f18fe198486f29c74ba5606ffcadaff7055cf" ]
[ "src/base_autoencoder.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport draw_util\nimport os\n\nclass Autoencoder(object):\n\n def partial_fit(self, targets):\n assert (self.is_training)\n if not self.is_denoising:\n self.sess.run(self.train_op, feed_dict={self.input_layer: targets,\n self.b...
[ [ "tensorflow.train.latest_checkpoint", "numpy.square", "tensorflow.reset_default_graph", "numpy.exp" ] ]
lelloman/python-languagedetector
[ "2abfa582b2f2100399e6cf8f92bc65d68ba20dad" ]
[ "to_tensorflow_lite.py" ]
[ "#!/usr/bin/python\nfrom __future__ import print_function\nfrom common import *\nimport tensorflow.contrib.lite as tflite\n\nimport keras\n\na = keras.models.Sequential()\n\nmodel = load_model()\n\nfull_model_file_name = 'full_model.h5'\nmodel.save(full_model_file_name)\nconverter = tflite.TFLiteConverter.from_ker...
[ [ "tensorflow.contrib.lite.TFLiteConverter.from_keras_model_file" ] ]
Con-Mi/lambda-packs
[ "b23a8464abdd88050b83310e1d0e99c54dac28ab" ]
[ "Skimage_numpy/source/scipy/special/__init__.py" ]
[ "\"\"\"\n========================================\nSpecial functions (:mod:`scipy.special`)\n========================================\n\n.. module:: scipy.special\n\nNearly all of the functions below are universal functions and follow\nbroadcasting and automatic array-looping rules. Exceptions are noted.\n\nError h...
[ [ "numpy.dual.register_func", "numpy.testing.Tester" ] ]
desikan95/ludwig
[ "c6b5594db98b6eaadc7bcd32e38983fe3cb4c3f2" ]
[ "tests/integration_tests/test_combiners.py" ]
[ "import logging\n\nimport pytest\nimport tensorflow as tf\n\nfrom ludwig.combiners.combiners import (\n ConcatCombiner,\n SequenceConcatCombiner,\n SequenceCombiner,\n ComparatorCombiner,\n sequence_encoder_registry,\n)\n\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.INFO)\nlogging.g...
[ [ "tensorflow.random.normal" ] ]
taijihagino/tensorflow-hangul-recognition
[ "8c39444ea8accd8b3d935f277e34fa2797564114" ]
[ "tools/classify-hangul.py" ]
[ "#!/usr/bin/env python\n\nimport argparse\nimport io\nimport os\nimport sys\n\nimport tensorflow as tf\n\nSCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))\n\n# Default paths.\nDEFAULT_LABEL_FILE = os.path.join(\n SCRIPT_PATH, '../labels/2350-common-hangul.txt'\n)\nDEFAULT_GRAPH_FILE = os.path.join(\n ...
[ [ "tensorflow.reshape", "tensorflow.gfile.GFile", "tensorflow.read_file", "tensorflow.InteractiveSession", "tensorflow.Graph", "tensorflow.image.convert_image_dtype", "tensorflow.image.decode_jpeg", "tensorflow.import_graph_def", "tensorflow.Session", "tensorflow.GraphDef" ...
neuml/txtai
[ "b25173a8650a73dbcae43caa278f32020fef0236" ]
[ "src/python/txtai/vectors/words.py" ]
[ "\"\"\"\nWord Vectors module\n\"\"\"\n\nimport os\nimport pickle\nimport tempfile\n\nfrom errno import ENOENT\nfrom multiprocessing import Pool\n\nimport numpy as np\n\n# Conditionally import Word Vector libraries as they aren't installed by default\ntry:\n import fasttext\n from pymagnitude import converter,...
[ [ "numpy.array" ] ]
rok20/flood-warning-rok20
[ "660b0e87de60732df2ee85bf8bdd83c9806168b7" ]
[ "floodsystem/plot.py" ]
[ "\nfrom .analysis import polyfit\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\n\ndef plot_water_levels(station, dates, levels):\n #plot the dates and water levels\n plt.plot(dates, levels, label = 'Water level')\n\n # Add axis labels, rotate date labels and add plot title\n pl...
[ [ "matplotlib.pyplot.xticks", "matplotlib.pyplot.axhline", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "numpy.linspace", "matplotlib.pyplot.xlabel", "matplotlib.dates.date2num" ...
jokteur/ASMA
[ "25ac8a0455c680232d56c18d31de62c3188b7153" ]
[ "plots/exploration/finite_size_fluct.py" ]
[ "import time\nimport copy\nimport os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import gridspec\nfrom matplotlib.animation import FuncAnimation\nimport matplotlib.animation as animation\n\nimport flowrect\nfrom flowrect.simulations.util import calculate_age, calculate_mt, eta_SRM\nfrom ...
[ [ "numpy.ones", "matplotlib.pyplot.legend", "numpy.histogram", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "numpy.array", "matplotlib.pyplot.plot", "matplotlib.gridspec.GridSpec" ] ]
igor-krawczuk/pytorch-lightning
[ "7de51f78ac2ec09b230e1cb8a786f872de3b861f" ]
[ "tests/models/test_gpu.py" ]
[ "import os\n\nimport pytest\nimport torch\n\nimport tests.base.utils as tutils\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.core import memory\nfrom pytorch_lightning.trainer.distrib_parts import (\n parse_gpu_ids,\n determine_root_gpu...
[ [ "torch.optim.lr_scheduler.StepLR", "torch.eq", "torch.cuda.device_count" ] ]
friggog/trimesh
[ "8ba65f6f19664b15bec1d13115af5040365254da" ]
[ "trimesh/visual/texture.py" ]
[ "import copy\n\nimport numpy as np\n\nfrom .base import Visuals\nfrom . import color\n\nfrom .. import util\nfrom .. import caching\nfrom .. import grouping\n\nfrom .material import SimpleMaterial, PBRMaterial, empty_material # NOQA\n\n\nclass TextureVisuals(Visuals):\n def __init__(self,\n uv=N...
[ [ "numpy.ones", "numpy.log2", "numpy.zeros", "numpy.column_stack", "numpy.asanyarray", "numpy.median", "numpy.arange", "numpy.array" ] ]
itsameercat/polychrom
[ "a3a39290857bc889627f9d437faa050248bbdc13" ]
[ "polychrom/polymer_analyses.py" ]
[ "# Code written by: Maksim Imakaev (imakaev@mit.edu)\n\"\"\"\nAnalyses of polymer conformations\n=================================\n\n\nThis module presents a collection of utils to work with polymer conformations.\n\n\nTools for calculating contacts\n------------------------------\n\nThe main function calculating ...
[ [ "numpy.sum", "numpy.diff", "numpy.asarray", "numpy.copy", "numpy.log", "numpy.fill_diagonal", "numpy.transpose", "numpy.nanmean", "numpy.concatenate", "numpy.log10", "numpy.isnan", "numpy.mean", "numpy.ceil", "numpy.searchsorted", "scipy.spatial.ckdtree....
lemoner20/tensorlayer
[ "69bd591f247b4a67f8968bd29c3660b22dbffae4" ]
[ "example/tutorial_frozenlake_dqn.py" ]
[ "import gym, random, time\nimport numpy as np\nimport tensorflow as tf\nimport tensorlayer as tl\nfrom tensorlayer.layers import *\nimport matplotlib.pyplot as plt\n\n\"\"\" Q-Network Q(a, s) - TD Learning, Off-Policy, e-Greedy Exploration (GLIE)\n\nQ(S, A) <- Q(S, A) + alpha * (R + lambda * Q(newS, newA) - Q(S, A)...
[ [ "tensorflow.placeholder", "numpy.zeros", "numpy.max", "tensorflow.train.GradientDescentOptimizer", "tensorflow.Session", "tensorflow.argmax", "numpy.random.rand", "tensorflow.reset_default_graph", "tensorflow.random_uniform_initializer" ] ]
oasislabs/ready-layer-2
[ "dcfc5edd2a645ab7a0dfc54933a71a7dca923fff" ]
[ "demo/train_models.py" ]
[ "#!/usr/bin/env python3\n\nfrom contextlib import contextmanager\nfrom os import path as osp\n\nimport joblib\nimport pandas as pd\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.svm import SVC\n\n\nDEMO_DIR = osp.abspath(osp.dirname(__file__))\nDATA_DIR = osp.join(DEMO_DIR, \"data\")\nMODELS_DIR = o...
[ [ "sklearn.ensemble.AdaBoostClassifier", "sklearn.svm.SVC", "pandas.factorize" ] ]
ag88/Test-stock-prediction-algorithms
[ "b2d12dc71acd0ed201976549cab7d2076db4721c" ]
[ "StockMarketTimeSeriesAnomalies/FindInflectionPoints.py" ]
[ "\n\n# http://github.com/timestocome\n\nimport numpy as np \nimport pandas as pd \nimport matplotlib.pyplot as plt\nfrom scipy import signal\n\n# use data leveled, log'd and otherwise smoothed in \n# https://github.com/timestocome/StockMarketData\n# to do some analysis\n\n# http://www.mdpi.com/1999-4893/5/4/588\n# ...
[ [ "pandas.read_csv", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ] ]
codezakh/ALBEF
[ "16aee1da1b7682afcd5a5f1ded74fc8dc199a8cf" ]
[ "models/unified/contrastive.py" ]
[ "'''\n * Copyright (c) 2021, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause\n'''\n\nfrom functools import partial\nfrom multiprocessing.sharedctypes import Value\...
[ [ "torch.ones_like", "torch.distributed.all_gather", "torch.ones", "torch.nn.functional.log_softmax", "torch.nn.Linear", "torch.hub.load_state_dict_from_url", "torch.randint", "torch.distributed.get_world_size", "torch.randn", "torch.nn.functional.normalize", "torch.nn.fu...
jbrockmendel/sm2
[ "c02a3f9a4fcba35ffc8c852ca5ad8b9d7620f4cf" ]
[ "sm2/regression/tests/test_cov.py" ]
[ "\"\"\"Example: minimal OLS\n\n\"\"\"\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_almost_equal, assert_allclose\n\nimport sm2.api as sm\n\n\n@pytest.mark.not_vetted\ndef test_HC_use():\n np.random.seed(0)\n nsample = 100\n x = np.linspace(0, 10, 100)\n X = sm.add_constant(np.col...
[ [ "numpy.testing.assert_almost_equal", "numpy.eye", "numpy.linalg.inv", "numpy.random.seed", "numpy.column_stack", "numpy.random.normal", "numpy.testing.assert_allclose", "numpy.array", "numpy.dot", "numpy.linspace" ] ]
wguanicedew/qiskit-terra
[ "f8e4fcb53e328b8b17762fc8df0a8d0a44da8d9a" ]
[ "qiskit/extensions/standard/u1.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\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.\...
[ [ "numpy.exp" ] ]
ptigwe/treex
[ "c46687376ccc50c8fea6cb8617e22e4b4dd1924a" ]
[ "treex/metrics/metrics.py" ]
[ "import typing as tp\n\nimport jax\nimport jax.numpy as jnp\nimport numpy as np\nimport treeo as to\n\nfrom treex import types, utils\nfrom treex.metrics.metric import Metric\n\n\nclass Metrics(Metric):\n metrics: tp.Dict[str, Metric]\n\n def __init__(\n self,\n metrics: tp.Any,\n on: tp....
[ [ "numpy.prod" ] ]
danhartfiction/LedFx
[ "eaf40ab180ef7e8f4f769193b35b3ffd5fe2a340" ]
[ "ledfx/effects/drano(Reactive).py" ]
[ "from ledfx.effects.audio import AudioReactiveEffect, FREQUENCY_RANGES\nfrom ledfx.effects.colorrainbow import ColorRainbowEffect \nimport voluptuous as vol\nimport numpy as np\nimport time\nimport statistics\nimport requests\nimport threading\n\nclass DranoBeatAudioEffect(AudioReactiveEffect, ColorRainbowEffect):\...
[ [ "numpy.linspace", "numpy.zeros" ] ]
vanessagraber/bilby
[ "80ee2d123a913d881f2a790b04e2939c46584d27" ]
[ "bilby/core/prior.py" ]
[ "from __future__ import division\n\nimport os\nfrom collections import OrderedDict\nfrom future.utils import iteritems\n\nimport numpy as np\nimport scipy.stats\nfrom scipy.integrate import cumtrapz\nfrom scipy.interpolate import interp1d\nfrom scipy.special import erf, erfinv\n\n# Keep import bilby statement, it i...
[ [ "numpy.multiply", "scipy.interpolate.interp1d", "numpy.any", "numpy.log", "numpy.trapz", "numpy.nan_to_num", "numpy.isfinite", "numpy.arccos", "numpy.cos", "scipy.special.erfinv", "numpy.random.uniform", "numpy.arcsin", "scipy.integrate.cumtrapz", "numpy.exp...
van-truong/comptox_ai
[ "393b05c617822e30f54c967ef07ec53ba4b09688" ]
[ "comptox_ai/ml/nn.py" ]
[ "\"\"\"\nBase class and utilities for defining neural networks to be used on ComptoxAI\ndata.\n\nWe stick to PyTorch for implementing all neural networks, due to its speed,\nexpressiveness, and readability. For more documentation on PyTorch, check out \n`PyTorch Documentation<https://pytorch.org/docs/stable/index.h...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.zeros", "torch.cat", "torch.nn.functional.binary_cross_entropy_with_logits" ] ]
imsandydk/Convoying_project_s22
[ "0b60a23fe148839f243a8a96acae9ee0fd8b9a81" ]
[ "convoy.py" ]
[ "import carla\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport math\nimport sys\nfrom srunner.tools.route_manipulation import interpolate_trajectory\n\n#Returns only the waypoints in one lane\ndef single_lane(waypoint_list, lane):\n waypoints = []\n for i in range(len(waypoint_list) - 1):\n ...
[ [ "matplotlib.pyplot.savefig", "numpy.clip", "matplotlib.pyplot.plot", "numpy.dot", "numpy.linalg.norm" ] ]
santhtadi/rest_api_in_django
[ "eae65bce23494e1950b9bd8dfdf6dbab71f1f922" ]
[ "restApi/views.py" ]
[ "from django.http import HttpResponse\nfrom rest_framework.views import APIView\nfrom rest_framework.response import Response\nfrom rest_framework import status\nimport numpy as np\nfrom PIL import Image\nimport io\n\n\n# Create your views here.\ndef index(request):\n return HttpResponse(request, \"hi there\")\n...
[ [ "numpy.array" ] ]
UtkarshK10/NLP-Spam-Filter
[ "795ea74897bd32cd3ce345e78f8c5d772a6da350" ]
[ "spam_filter.py" ]
[ "import sys\nimport nltk\nimport sklearn\n\n\nimport pandas as pd\nimport numpy as np\n\ndf= pd.read_table('SMSSpamCollection',header= None, encoding='utf-8')\n\n\nclasses = df[0]\nprint(classes.value_counts())\n\n#Preprocess the data\n\n\"\"\"\n0= ham\n1=spam\nfor this we use label encoder\n\"\"\"\nfrom sklearn.pr...
[ [ "pandas.read_table", "numpy.random.shuffle", "sklearn.svm.SVC", "sklearn.metrics.classification_report", "sklearn.tree.DecisionTreeClassifier", "sklearn.linear_model.SGDClassifier", "sklearn.naive_bayes.MultinomialNB", "sklearn.metrics.confusion_matrix", "sklearn.ensemble.Votin...
jld23/saspy
[ "47adeb5b9e298e6b9ec017f850245e318f2faa57" ]
[ "saspy/sasiocom.py" ]
[ "#\n# Copyright SAS Institute\n#\n# Licensed under the Apache License, Version 2.0 (the License);\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "pandas.to_datetime", "pandas.isnull", "pandas.DataFrame.from_records", "pandas.to_numeric" ] ]
verult-prowtest/Cirq
[ "653bf210f04635f6d8fde80d37cb25edbab6eb31" ]
[ "cirq/ops/eigen_gate.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.round", "numpy.around" ] ]
ocjosen/tensorflow
[ "ada0605591911094c142d39cbd87294ed2716e8b" ]
[ "tensorflow/python/feature_column/feature_column.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.check_ops.assert_greater_equal", "tensorflow.python.ops.array_ops.gather_nd", "tensorflow.python.ops.sparse_ops.sparse_slice", "tensorflow.python.platform.gfile.GFile", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.platform.tf_logging.debu...
JosephMeghanath/apptuit-py
[ "ae0d038931efca94435e3a5efe5e4a4ed6f1956e" ]
[ "tests/test_query.py" ]
[ "\"\"\"\nTests for the query API\n\"\"\"\n\nimport sys\n\ntry:\n from unittest.mock import Mock, patch\nexcept ImportError:\n from mock import Mock, patch\n\nfrom nose.tools import assert_is_not_none, assert_is_none, assert_equals, assert_true, assert_raises\nimport pandas as pd\nimport requests\nfrom apptuit...
[ [ "pandas.read_csv" ] ]
ktaebum/tf2-gnn
[ "3c763274f6586fb8d4cf3d74e3e0fd03b970b43f" ]
[ "tf2_gnn/test/layers/test_RGCN.py" ]
[ "\"\"\"Tests for the RGCN message passing layer.\"\"\"\nimport tensorflow as tf\nimport pytest\n\nfrom tf2_gnn.layers.message_passing import MessagePassingInput, RGCN\n\n\nshape_test_data = [\n (tf.TensorShape(dims=(None, 3)), tuple(tf.TensorShape(dims=(None, 2)) for _ in range(3)), 5),\n (tf.TensorShape(dims...
[ [ "tensorflow.TensorShape" ] ]
WeipengMO/flair
[ "e6c9990bcfdd1d2e585bab1f45b7f8dc68b21fbc" ]
[ "script/get_full_length_transcripts.py" ]
[ "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n'''\r\nAuthor : windz\r\nDate : 2020-04-15 15:26:26\r\nLastEditTime : 2021-10-09 16:43:49\r\nDescription : get full length transcripts from bam\r\n'''\r\n\r\n\r\nimport pysam\r\nimport pandas as pd\r\nimport click\r\n\r\n\r\n@click.command()\r\n@c...
[ [ "pandas.read_csv" ] ]
Moyzes-Campos/pykernels
[ "c8afdc79a15197ad3be2a0db0118f5e948577f49" ]
[ "tests/datasets.py" ]
[ "\"\"\"\nAccess layer for datasets used in tests\n\"\"\"\n\n__author__ = 'lejlot'\n\nimport numpy as np\n\ndef baseline_logic(operator):\n \"\"\" Creates 4-point dataset with given logical operator \"\"\"\n\n data = np.array([[1, 1], [0, 0], [1, 0], [0, 1]])\n labels = np.array([max(0, min(1, operator(*poi...
[ [ "numpy.array" ] ]
jeromekelleher/msprime_sim
[ "8ec1945290fcfd2889dbb2a677e21012162fbc89" ]
[ "src/write.py" ]
[ "from __future__ import division\nimport msprime\nimport pandas as pd\nimport numpy as np\nimport os\n\ndef trees(out, tree_sequence, chr, m, n_pops, N, sim, vcf, sample_index):\n\t# DEV: Throw a warning if you try to do this and n_sims is high.\n\tvcf_name = out + \".vcf\"\n\twith open(vcf_name, \"w\") as vcf_file...
[ [ "numpy.arange", "numpy.tile", "pandas.DataFrame", "numpy.empty" ] ]
pierfra-ro/allesfitter
[ "a6a885aaeb3253fec0d924ef3b45e8b7c473b181" ]
[ "allesfitter/detection/transit_search.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 14 17:55:39 2020\n\n@author:\nDr. Maximilian N. Günther\nEuropean Space Agency (ESA)\nEuropean Space Research and Technology Centre (ESTEC)\nKeplerlaan 1, 2201 AZ Noordwijk, The Netherlands\nEmail: maximilian.guenther@esa.int\nGitHub: mngu...
[ [ "numpy.format_float_scientific", "numpy.interp", "numpy.format_float_positional", "matplotlib.pyplot.figure", "matplotlib.pyplot.gcf", "numpy.random.seed", "matplotlib.pyplot.subplots", "numpy.float", "numpy.max", "matplotlib.pyplot.close", "numpy.isnan", "numpy.arr...
IgnacioCarlucho/linear_nonlinear_control
[ "37a7d720f64c6441c7eda386fa2eb6948634e120" ]
[ "mpc/extend/main_track.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport math\nimport copy\n\n# from mpc_func_with_cvxopt import MpcController as MpcController_cvxopt\nfrom extended_MPC import IterativeMpcController\nfrom animation import AnimDrawer\n# from control import matlab\nfrom coordinate_trans import coordinate_transfo...
[ [ "numpy.sum", "numpy.ones", "numpy.zeros", "numpy.diag", "numpy.argmin", "numpy.hstack", "numpy.array" ] ]
ili0820/Superresolution
[ "69d3f578d00c5521928c0614894d70b63ed42963" ]
[ "utility.py" ]
[ "import math\nimport time\nimport random\nimport numpy as np\nimport torch\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lrs\n\n\ndef set_seed(seed):\n random.seed(seed)\n np.random.seed(seed)\n torch.manual_seed(seed)\n if torch.cuda.device_count() == 1:\n torch.cuda.manual_se...
[ [ "torch.cuda.manual_seed_all", "torch.cuda.manual_seed", "torch.manual_seed", "numpy.random.seed", "torch.cuda.device_count" ] ]
seibert/metagraph-cuda
[ "ba29e59604cd34864cfed763c9ce9dc21d5b1377" ]
[ "metagraph_cuda/plugins/cugraph/types.py" ]
[ "import numpy as np\nfrom metagraph.wrappers import (\n EdgeSetWrapper,\n EdgeMapWrapper,\n CompositeGraphWrapper,\n BipartiteGraphWrapper,\n)\nfrom metagraph import dtypes\nfrom metagraph.types import (\n Graph,\n BipartiteGraph,\n EdgeSet,\n EdgeMap,\n)\nfrom .. import has_cugraph\nfrom ty...
[ [ "numpy.issubdtype" ] ]
BillGatesNephew/Cirq
[ "fda14a5f6c65356dfabf8a5bcd599bf57e542041" ]
[ "cirq/testing/consistent_protocols_test.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.conj", "numpy.cos", "numpy.exp", "numpy.sin", "numpy.dot" ] ]
fubel/vision
[ "6845355fd80a48ca7ec80c06aa2d97d50f0b077d" ]
[ "torchvision/models/detection/keypoint_rcnn.py" ]
[ "import torch\nfrom torch import nn\n\nfrom torchvision.ops import MultiScaleRoIAlign\n\nfrom ._utils import overwrite_eps\nfrom ..utils import load_state_dict_from_url\n\nfrom .faster_rcnn import FasterRCNN\nfrom .backbone_utils import resnet_fpn_backbone, _validate_trainable_layers\n\n\n__all__ = [\n \"Keypoin...
[ [ "torch.nn.init.kaiming_normal_", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.ReLU", "torch.nn.ConvTranspose2d" ] ]