repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Daz-Riza-Seriog/Op_Heat_transfer
[ "3ee27a049a2de5deaf13356ed3e675562233ac29" ]
[ "Parcial 3.py" ]
[ "# Code made for Sergio Andres Diaz Ariza\n# 16 December 2021\n# License MIT\n# Heat Operations: Python Program\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n##### Part 1- Masic Flux Oil #####\nT_oil_in = 350 + 273.15 # [K]\nT_oil_out = 200 + 273.15 # [K]\nT_water_in = 170 + 273...
[ [ "numpy.log" ] ]
longodj/tcvaemolgen
[ "70fee6e73430b497a9a0f6296da0ac188af05843" ]
[ "notebooks/4_T-CVAE.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport copy\nfrom dgl import batch, unbatch\nimport rdkit.Chem as Chem\nfrom rdkit import RDLogger\nimport torch\ntorch.manual_seed(0)\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport numpy as np\nnp.random.seed(0)\n\nimport os,sys,inspect\ns...
[ [ "torch.nn.Linear", "torch.nn.init.constant", "torch.nn.init.xavier_normal", "numpy.random.seed", "torch.optim.lr_scheduler.ExponentialLR", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "torch.multiprocessing.set_sharing_strategy" ] ]
neosavvy/serenity
[ "c7c8f4d2f48437cd33e0f6b135455f008031b19f" ]
[ "src/serenity/equity/batch/utils.py" ]
[ "import datetime\nimport hashlib\nimport logging\nfrom abc import ABC, abstractmethod\n\n\nimport luigi\nimport pandas as pd\nimport quandl\nfrom luigi import Target, LocalTarget\nfrom sqlalchemy.orm import Session\n\nfrom serenity.equity.sharadar_api import create_sharadar_session, BatchStatus\n\n\nclass ExportQua...
[ [ "pandas.read_csv" ] ]
suntao2012/draw
[ "502452fb66eba68a00526cbd3c3746c57786c150" ]
[ "draw.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\"\nSimple implementation of http://arxiv.org/pdf/1502.04623v2.pdf in TensorFlow\n\nExample Usage: \n\tpython draw.py --data_dir=/tmp/draw --read_attn=True --write_attn=True\n\nAuthor: Eric Jang\n\"\"\"\n\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials import mnist\nimpo...
[ [ "tensorflow.exp", "tensorflow.constant_initializer", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.clip_by_norm", "tensorflow.global_variables_initializer", "tensorflow.random_normal", "tensorflow.InteractiveSession", "tensorflow.flags.DEFINE_string", "tensorflow.c...
JadeMaveric/transformers
[ "b6a28e9ac916523165289be57e6214a65247f051" ]
[ "src/transformers/models/prophetnet/modeling_prophetnet.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Microsoft Authors and The HuggingFace Inc. 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/LICEN...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LayerNorm", "torch.einsum", "torch.gather", "torch.arange", "torch.nn.functional.dropout", "torch.bmm", "torch.ones", "torch.abs", "torch.zeros_like", "torch.all", "torch.ones_like", "torch.nn.functional.softmax", ...
gthomas-slack/omniduct
[ "af0148e1f0de147c6c3757dc8c22293225caa543" ]
[ "omniduct/databases/hiveserver2.py" ]
[ "from __future__ import absolute_import\n\nimport json\nimport os\nimport re\nimport shutil\nimport tempfile\nimport time\n\nimport pandas as pd\nfrom interface_meta import override\nfrom jinja2 import Template\n\nfrom omniduct.utils.debug import logger\nfrom omniduct.utils.processes import Timeout, run_in_subproce...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
mondrasovic/context_rcnn
[ "b3f6b4fdd63fc76f33becae0fba1363f9e873f50" ]
[ "src/eval.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2021 Milan Ondrašovič <milan.ondrasovic@gmail.com>\n#\n# MIT License\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Sof...
[ [ "torch.device", "torch.cuda.synchronize", "torch.no_grad", "torch.get_num_threads", "torch.cuda.is_available", "torch.set_num_threads" ] ]
exusnraul/exusnraul-interview_solutions
[ "1b4dbfaece3c924b971acc4e9186a227f57bc450" ]
[ "multithred_test.py" ]
[ "import time\r\nfrom concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n\r\ndef multithreading(func, args, workers):\r\n with ThreadPoolExecutor(workers) as ex:\r\n res = ex.map(func, args)\r\n return list(res)\r\n\r\n\r...
[ [ "numpy.array", "matplotlib.pyplot.xlim", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
dfsp-spirit/cogload
[ "ff9d19803c2e0c9aea248a45380959c2758ba83a" ]
[ "tests/brainload/test_brainlocate.py" ]
[ "\"\"\"\nFunctions for testing brainlocate.\n\"\"\"\n\nimport pytest\nimport numpy as np\nimport os\nfrom numpy.testing import assert_array_equal, assert_allclose\nimport brainload as bl\nimport brainload.brainlocate as loc\n\n\nTHIS_DIR = os.path.dirname(os.path.abspath(__file__))\nTEST_DATA_DIR = os.path.join(THI...
[ [ "numpy.array", "scipy.spatial.distance.cdist", "numpy.argmin" ] ]
rickyHong/markowitz-portfolio-optimization
[ "4376e581096d866cf1121962b812f1a058afe442" ]
[ "posdef.py" ]
[ "import numpy as np\nfrom numpy import linalg as la\n\ndef nearestPD(A):\n \"\"\"Find the nearest positive-definite matrix to input\n\n A Python/Numpy port of John D'Errico's `nearestSPD` MATLAB code [1], which\n credits [2].\n\n [1] https://www.mathworks.com/matlabcentral/fileexchange/42885-nearestspd\...
[ [ "numpy.linalg.norm", "numpy.random.randn", "numpy.eye", "numpy.linalg.svd", "numpy.linalg.cholesky", "numpy.diag", "numpy.linalg.eigvals" ] ]
abumafrim/OpenNMT-tf
[ "f14c05a7cb8b1b8f3a692d6fea3c12067bc3eb2c" ]
[ "opennmt/tests/transformer_test.py" ]
[ "from parameterized import parameterized\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom opennmt.layers import transformer\n\n\nclass TransformerTest(tf.test.TestCase):\n\n @parameterized.expand([[tf.bool], [tf.float32]])\n def testBuildFutureMask(self, dtype):\n length = [2, 4, 3]\n expected = np.ar...
[ [ "tensorflow.sequence_mask", "tensorflow.zeros", "numpy.array", "tensorflow.expand_dims", "tensorflow.random.uniform", "tensorflow.reshape", "tensorflow.logical_not", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.test.main" ] ]
DevilMayNotCry/My_curl
[ "a4e59533685257098eb02a25d0f90e40cf04e0a1" ]
[ "util.py" ]
[ "# -*- coding: utf-8 -*-\n'''\nThis is a PyTorch implementation of CURL: Neural Curve Layers for Global Image Enhancement\nhttps://arxiv.org/pdf/1911.13175.pdf\n\nPlease cite paper if you use this code.\n\nTested with Pytorch 1.7.1, Python 3.7.9\n\nAuthors: Sean Moran (sean.j.moran@gmail.com), \n\n'''\nfrom skimage...
[ [ "matplotlib.use", "torch.zeros", "torch.cat", "torch.mul", "torch.stack", "torch.min", "torch.max", "numpy.minimum", "numpy.set_printoptions", "torch.FloatTensor", "torch.clamp", "torch.ones", "numpy.swapaxes", "torch.cuda.FloatTensor", "torch.matmul" ...
intel-iot-devkit/motor-defect-detector-python
[ "e793357b4961f9052e35309acb60bec0851e15a0" ]
[ "Kmeans/kmeanstestingall.py" ]
[ "2# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu May 24 17:13:42 2018\n\n@author: SHEFALI JAIN\n\"\"\"\n\"\"\"\n this script is used to test which bearing has failed using the trained Kmeans model.\n\"\"\"\n# import the libraries\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom...
[ [ "matplotlib.pyplot.show", "numpy.array", "numpy.load", "pandas.DataFrame" ] ]
e-kayrakli/arkouda
[ "59da8f05f8dbf71382083964bc1b59ddceedc1ac" ]
[ "converter/lanl_format.py" ]
[ "import numpy as np\nimport re\n\nsplitter = re.compile(r'([a-zA-Z]*)(\\d*)')\n\ndef numerify(s):\n name, num = splitter.match(s).groups()\n prefix = hash(name) & 0xffff\n if num == '':\n postfix = 0\n else:\n postfix = int(num)\n return np.int64((prefix << 20) ^ postfix)\n\ndef deport(...
[ [ "numpy.int64" ] ]
JwDong2019/CVWC-2019-FCOS
[ "9c343dc820aea7bc79ee0b8206527fa48ebf106f" ]
[ "mmdet/models/bbox_heads/convfc_bbox_head.py" ]
[ "import torch.nn as nn\n\nfrom .bbox_head import BBoxHead\nfrom ..registry import HEADS\nfrom ..utils import ConvModule\n\nfrom mmcv.cnn import kaiming_init, constant_init\n\nfrom ..detectors.yang.Mergev2 import Merge\n\n@HEADS.register_module\nclass ConvFCBBoxHead(BBoxHead):\n \"\"\"More general bbox head, with...
[ [ "torch.nn.Linear", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU" ] ]
pdigese/CarND-Capstone-team-5-june20
[ "0c7a7539a61c48f62b7557a76edd2c6308c60b81" ]
[ "ros/src/object_detection/object_detection.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nfrom sensor_msgs.msg import Image\nfrom geometry_msgs.msg import PoseStamped, Pose\nimport tensorflow as tf\nimport os\nfrom PIL import (\n Image as Img,\n) # Must not be named image since there is a datatype called Image from ROS\nfrom PIL import ImageColor\nfrom PIL imp...
[ [ "numpy.zeros_like", "numpy.array", "tensorflow.Graph", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "numpy.sqrt", "numpy.squeeze", "numpy.expand_dims" ] ]
pan-webis-de/duan20
[ "dd2fd2b13787d40fed0c639dea1efa67668ccb43" ]
[ "model/BERTModel.py" ]
[ "import torch.nn as nn\nimport torch\n\nclass BERTModel(nn.Module):\n def __init__(self,\n bert,\n hidden_dim,\n output_dim,\n n_layers,\n bidirectional,\n dropout):\n \n super().__init__()\n \n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.GRU", "torch.no_grad" ] ]
jswoboda/GeoDataPython
[ "c3e29541327ec754eb5a2a9e8dd94bf1abee3328" ]
[ "Test/subplots_test.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nExample code on using the alt_slice_overlay function in the plotting.py file.\nTakes two h5 files--a RISR file and an OMTI file-- and creates 2 objects. This is inputed into alt_slice_overlay.\nThe output is a 2D colorplot with the OMTI data on the bottom in...
[ [ "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.subplots" ] ]
tsipkens/tfer-PMA
[ "314cb6dccc4612d5c748bde6545f0aae15b64c26" ]
[ "py/main.py" ]
[ "# import functions\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom prop_pma import prop_pma\nimport tfer_pma # import relevant functions to evaluate the PMA transfer function\n\n# define input variables\nm_star = 0.01e-18\nm = np.arange(0.8, 1.2, 0.001) * m_star # numpy array spanning 80 to 120% m_s...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.arange" ] ]
robbievanleeuwen/steeldesign
[ "4a2351c7d922a4f0f379b413ecca17b672be1c6e" ]
[ "steeldesign/member.py" ]
[ "import numpy as np\n\n\nclass Member:\n \"\"\"a\"\"\"\n\n def __init__(self, section, length, restraints):\n \"\"\"Inits the Member class.\"\"\"\n\n self.section = section\n self.length = length\n self.restraints = []\n\n for restraint in restraints:\n self.add_r...
[ [ "numpy.array", "numpy.interp", "numpy.sqrt" ] ]
bertmaher/functorch
[ "8c5be62a9b140c4d35366720427b735bdcff8d01" ]
[ "test/common_utils.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport itertools\nimport torch\nimport functorch\nfrom functorch import vmap\nimport torch.utils._pytr...
[ [ "torch.testing._internal.common_methods_invocations.DecorateInfo", "torch.stack", "torch.ones", "torch.utils._pytree.tree_unflatten", "torch.utils._pytree.tree_flatten" ] ]
torms3/DataProvider3
[ "28c18e520e658f10547edbfb495dac07d60574b6" ]
[ "dataprovider3/datasuperset.py" ]
[ "import numpy as np\n\nfrom .dataset import Dataset\n\n\nclass DataSuperset(Dataset):\n \"\"\"\n Superset of datasets.\n \"\"\"\n def __init__(self, tag=''):\n self.tag = tag\n self.datasets = list()\n self.p = None\n\n def __call__(self, spec=None):\n return self.random_s...
[ [ "numpy.sum", "numpy.asarray" ] ]
Moon-sung-woo/Tacotron2_ParallelWaveGAN_korean
[ "437c9748673f2e5cb84e99884e8d0d916f269c9e" ]
[ "inference.py" ]
[ "# *****************************************************************************\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redis...
[ [ "torch.cuda.synchronize", "torch.autograd.Variable", "torch.no_grad", "torch.randint", "torch.cuda.is_available", "torch.load", "torch.jit.script" ] ]
kcorder/autonomous-learning-library
[ "0266195fa47564e51a32087bc007bff6dda5e263" ]
[ "all/experiments/parallel_env_experiment.py" ]
[ "\nimport torch\nimport time\nimport numpy as np\nfrom all.core import State\nfrom .writer import ExperimentWriter, CometWriter\nfrom .experiment import Experiment\nfrom all.environments import VectorEnvironment\nfrom all.agents import ParallelAgent\nimport gym\n\n\nclass ParallelEnvExperiment(Experiment):\n '''...
[ [ "numpy.zeros" ] ]
zhang0557kui/Fundus_Lesion2018
[ "bfb9516a2049f9f1c2662e963734a2746d5c3e4f" ]
[ "data_generator.py" ]
[ "import json\n\nimport cv2 as cv\nimport numpy as np\nfrom keras.utils import Sequence, to_categorical\n\nfrom augmentor import seq_det, seq_img\nfrom config import img_rows, img_cols, batch_size, num_classes, gray_values\nfrom utils import preprocess_input\n\n\nclass DataGenSequence(Sequence):\n def __init__(se...
[ [ "numpy.empty", "numpy.argmax", "numpy.zeros", "numpy.random.shuffle" ] ]
luomingshuang/GE2E-SV-TI-Voxceleb-LMS
[ "000b0176b4b3a484e390c986045e491d64427c8b" ]
[ "test.py" ]
[ "#coding:utf-8\nimport os\nimport random\nimport time\nimport torch\nfrom torch.utils.data import DataLoader\n\nfrom hparam import hparam as hp\nfrom data_load import SpeakerDatasetTIMIT, SpeakerDatasetTIMITPreprocessed\nfrom speech_embedder_net import SpeechEmbedder, GE2ELoss, get_centroids, get_cossim\nfrom tenso...
[ [ "torch.device", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load" ] ]
jingzbu/InverseVITraffic
[ "c0d33d91bdd3c014147d58866c1a2b99fb8a9608" ]
[ "Python_files/OD_matrix_estimation_GLS_Apr_weekday_NT_ext.py" ]
[ "#!/usr/bin/env python\n\n\n__author__ = \"Jing Zhang\"\n__email__ = \"jingzbu@gmail.com\"\n__status__ = \"Development\"\n\n\nfrom util import *\nimport numpy as np\nfrom numpy.linalg import inv, matrix_rank\nimport json\n\n# load logit_route_choice_probability_matrix\nP = zload('../temp_files/logit_route_choice_pr...
[ [ "numpy.matrix", "numpy.nan_to_num", "numpy.transpose", "numpy.all", "numpy.matrix.reshape" ] ]
ParthKalkar/digital-superheroes-hackathon
[ "0acc4a1b59a3dd2762a45744869b75dade891fa8" ]
[ "Arima model/Arima Model/Arima Model/CSV.py" ]
[ "from pandas import read_csv\r\nfrom pandas import datetime\r\nfrom matplotlib import pyplot\r\nfrom statsmodels.tsa.arima_model import ARIMA\r\nfrom sklearn.metrics import mean_squared_error\r\n\r\ndef parser(x):\r\n return datetime.strptime('190'+x, '%Y-%m')\r\n\r\nseries = read_csv('shampoo-sales.csv', header=0...
[ [ "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.plot", "pandas.datetime.strptime", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
bryankim96/deep-learning-gamma
[ "cac4f2d90b6536eedf95c3a07ea73d4c7a69c5b7" ]
[ "ctlearn/default_models/single_cnn.py" ]
[ "import importlib\nimport sys\n\nimport tensorflow as tf\n\ndef single_cnn_model(data, model_params):\n\n # Load neural network model\n network_input = tf.keras.Input(shape=data.img_shape, name=f'images')\n network_name = model_params.get('name', 'CNN') + '_block'\n trainable_backbone = model_params.get...
[ [ "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.models.load_model", "tensorflow.keras.Model", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.keras.Input" ] ]
minhson/tensorpack
[ "5421ad0e6abd4500df14a0438c49d53ce7d7c1cd" ]
[ "tensorpack/dataflow/imgaug/crop.py" ]
[ "# -*- coding: utf-8 -*-\n# File: crop.py\n\nimport numpy as np\nimport cv2\n\nfrom ...utils.argtools import shape2d\nfrom ...utils.develop import log_deprecated\nfrom .base import ImageAugmentor, ImagePlaceholder\nfrom .transform import CropTransform, TransformList, ResizeTransform\nfrom .misc import ResizeShortes...
[ [ "numpy.sqrt" ] ]
dfangshuo/neuro-vectorizer
[ "9258bcaab31280dc0685610a165a08cb3bdaa023" ]
[ "envs/neurovec.py" ]
[ "'''\nCopyright (c) 2019, Ameer Haj Ali (UC Berkeley), and Intel Corporation\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright n...
[ [ "tensorflow.compat.v1.Session", "numpy.array", "tensorflow.compat.v1.tables_initializer", "tensorflow.squeeze" ] ]
zwt233/automl-toolkit
[ "67d057f5e0c74bec5b3cbde1440ec014696737ef" ]
[ "automlToolkit/components/ensemble/stacking.py" ]
[ "import numpy as np\nimport warnings\nimport os\nimport pickle as pkl\nfrom sklearn.model_selection import StratifiedKFold, KFold\nfrom sklearn.metrics.scorer import _BaseScorer\n\nfrom automlToolkit.components.ensemble.base_ensemble import BaseEnsembleModel\nfrom automlToolkit.components.utils.constants import CLS...
[ [ "numpy.array", "sklearn.model_selection.StratifiedKFold", "sklearn.linear_model.LinearRegression", "numpy.zeros", "sklearn.ensemble.gradient_boosting.GradientBoostingClassifier", "sklearn.linear_model.logistic.LogisticRegression", "sklearn.model_selection.KFold" ] ]
mxhofer/OrgSim-RL
[ "bd494579c4b6e6ce6ebda5dbbfd2706124569f6c" ]
[ "dyna-q/utils_diagnostics.py" ]
[ "# -- Import packages ---------------------------------------------------------------------------------------------------\nfrom collections import OrderedDict\nimport os\nimport json\nimport numpy as np\n\n\nclass Diagnostics:\n \"\"\"\n Diagnostics for an episode.\n \"\"\"\n\n def __init__(self, runs):...
[ [ "numpy.zeros" ] ]
maumruiz/ICNN_Loss
[ "249405f50421a2cf097a8ab4046db9cb32811164" ]
[ "algorithms/icnn_loss.py" ]
[ "import torch\nimport torch.nn.functional as F\n\nimport util.globals as glob\n\ndef distance_matrix(x, y=None, p=2):\n y = x if type(y) == type(None) else y\n\n n = x.size(0)\n m = y.size(0)\n d = x.size(1)\n\n x = x.unsqueeze(1).expand(n, m, d)\n y = y.unsqueeze(0).expand(n, m, d)\n \n dis...
[ [ "torch.var", "torch.cat", "torch.arange", "torch.max", "torch.pow", "torch.abs", "torch.nn.functional.cross_entropy", "torch.all", "torch.count_nonzero", "torch.ones_like", "torch.zeros_like", "torch.log", "torch.sum" ] ]
mathiassunesen/Speciale_retirement
[ "9db901a3791b9b75f228d1cec6c180e917be93e8" ]
[ "Main/setup.py" ]
[ "# global modules\nfrom numba import boolean, int32, int64, float64, double, njit, typeof\nimport numpy as np\nimport itertools\nimport pandas as pd\n\n# consav package\nfrom consav import misc \n\n# local modules\nimport transitions\nimport funs\n\ndef single_lists():\n\n parlist = [ # (name,numba type), parame...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "numpy.sum", "pandas.read_excel", "numpy.ones", "numpy.nonzero", "numpy.diff", "numpy.allclose", "numpy.random.uniform", "numpy.sqrt", "numpy.cumsum", "numpy.repeat", "numpy.linspace...
Chichilele/pycaret
[ "c2910c50cbcb9c6b0126d7945b891fb6129d1d48" ]
[ "pycaret/internal/tabular.py" ]
[ "# Module: Classification\n# Author: Moez Ali <moez.ali@queensu.ca>\n# License: MIT\n# Release: PyCaret 2.2\n# Last modified : 26/08/2020\n\nfrom enum import Enum, auto\nimport math\nfrom pycaret.internal.meta_estimators import (\n PowerTransformedTargetRegressor,\n get_estimator_from_meta_estimator,\n)\nfrom...
[ [ "pandas.reset_option", "sklearn.tree.plot_tree", "sklearn.model_selection.cross_validate", "numpy.mean", "numpy.where", "numpy.unique", "pandas.concat", "sklearn.model_selection._search.GridSearchCV", "sklearn.model_selection.StratifiedKFold", "pandas.set_option", "pand...
ali-alsabbah/floweaver
[ "b4321e2e32dfdf117e682b4b24c4c09b0b5ea2d2" ]
[ "floweaver/results_graph.py" ]
[ "import pandas as pd\n\nfrom .layered_graph import MultiLayeredGraph, Ordering\nfrom .partition import Partition, Group\nfrom .sankey_definition import ProcessGroup\n\n\ndef results_graph(view_graph,\n bundle_flows,\n flow_partition=None,\n time_partition=None,\n ...
[ [ "pandas.concat" ] ]
whoiszyc/andes
[ "67f51b824f3ac364e9e4d161450e476d4967e85b" ]
[ "andes/models/pss.py" ]
[ "\"\"\"\nPower system stabilizer models.\n\"\"\"\nfrom andes.core.param import NumParam, IdxParam, ExtParam\nfrom andes.core.var import Algeb, ExtAlgeb, ExtState\nfrom andes.core.block import Lag2ndOrd, LeadLag2ndOrd, LeadLag, WashoutOrLag, Gain, Lag, GainLimiter\nfrom andes.core.service import ExtService, DataSele...
[ [ "numpy.equal" ] ]
meandme234/uav-autonomous-landing
[ "40e5566a8577b3f443ae0ec8052b2f46d329a998" ]
[ "trajectories_life_long.py" ]
[ "import matplotlib\nimport matplotlib.pyplot as plt \nimport matplotlib as mpl\nfrom mpl_toolkits.mplot3d import Axes3D\nimport pandas as pd\nimport os\nimport matplotlib.pyplot as plt\nimport sys\nimport itertools\n\n\nmpl.rcParams['legend.fontsize'] = 12\nDPI = 5000\n\ninput_dir = \"/home/pablo/ws/log/trajectorie...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure" ] ]
familywei/RLs
[ "8414cb0d31701e1c328a733d1251cfc10b9f38db" ]
[ "gym_wrapper.py" ]
[ "import gym\r\nimport numpy as np\r\nimport threading\r\n\r\n\r\nclass MyThread(threading.Thread):\r\n\r\n def __init__(self, func, args=()):\r\n super().__init__()\r\n self.func = func\r\n self.args = args\r\n\r\n def run(self):\r\n self.result = self.func(*self.args)\r\n\r\n d...
[ [ "numpy.array" ] ]
scoumeri/geopm
[ "2406b8cca92d8eb32d4dc26d24bb2273164f186c" ]
[ "integration/experiment/energy_efficiency/gen_plot_profile_comparison.py" ]
[ "#!/usr/bin/env python3\n#\n# Copyright (c) 2015 - 2022, Intel Corporation\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyright\n# ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots" ] ]
ccha23/CS1302ICP
[ "80907dae8d4d90b911e52dbea159629a221b9a3c" ]
[ "_build/jupyter_execute/Lab2/Calculators.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Calculators\n\n# **CS1302 Introduction to Computer Programming**\n# ___\n\n# Run the following to load additional tools required for this lab. \n# In particular, the `math` library provides many useful mathematical functions and constants.\n\n# In[ ]:\n\n\nget_ipython...
[ [ "matplotlib.pyplot.gca", "numpy.linspace" ] ]
subond/tools
[ "05b93e6c78eab65ef6587e684303b12c686a3480" ]
[ "ROMS/pmacc/tools/post_tools/rompy/tags/rompy-0.1.5/rompy/extract_from_series.py" ]
[ "import os\nimport datetime as dt\nimport time\nimport glob\n\nimport pytz\nimport netCDF4 as nc\nimport numpy as np\n\nimport extract_utils\nimport extract_from_file\n\n__version__ = '0.1.5'\n\n# def file_time(f):\n# \tUTC = pytz.timezone('UTC')\n# \tncf = nc.Dataset(f,mode='r')\n# \tot = ncf.variables['ocean_time...
[ [ "numpy.array", "numpy.arange", "numpy.zeros" ] ]
ver0z/Deformable-DETR-
[ "f37ef3e73675ee4be1d8a0649901b1402f907f1a" ]
[ "models/position_encoding.py" ]
[ "# ------------------------------------------------------------------------\r\n# Deformable DETR\r\n# Copyright (c) 2020 SenseTime. All Rights Reserved.\r\n# Licensed under the Apache License, Version 2.0 [see LICENSE for details]\r\n# ------------------------------------------------------------------------\r\n# Mo...
[ [ "torch.nn.init.uniform_", "torch.cat", "torch.nn.Embedding", "torch.arange" ] ]
bucknerns/ms-mint
[ "140f607a4b6aab84b5db2b8c9876dc6c1d2b7943" ]
[ "tests/test__MINT-integration.py" ]
[ "import os\nimport pandas as pd\nfrom sklearn.metrics import r2_score\n\nfrom ms_mint.Mint import Mint\nfrom ms_mint.tools import check_peaklist, MINT_RESULTS_COLUMNS\n\nmint = Mint(verbose=True)\nmint_b = Mint(verbose=True)\n\nclass TestClass():\n \n def run_without_files(self):\n mint.run()\n \n ...
[ [ "sklearn.metrics.r2_score", "pandas.DataFrame", "pandas.read_csv", "pandas.merge" ] ]
chenlongzhen/FATE-0.1
[ "38fe6cea0dca3841b59c3d04cb04f556803e2e29" ]
[ "federatedml/ftl/hetero_ftl/hetero_ftl_guest.py" ]
[ "#\n# Copyright 2019 The FATE 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 r...
[ [ "numpy.array", "numpy.squeeze", "numpy.expand_dims" ] ]
burn-research/PyTROMode
[ "c3ed440930f80ac94fb60369b7d01f04972a0346" ]
[ "OpenMORe/utilities.py" ]
[ "'''\nMODULE: utilities.py\n@Author:\n G. D'Alessio [1,2]\n [1]: Université Libre de Bruxelles, Aero-Thermo-Mechanics Laboratory, Bruxelles, Belgium\n [2]: CRECK Modeling Lab, Department of Chemistry, Materials and Chemical Engineering, Politecnico di Milano\n@Contacts:\n giuseppe.dalessio@ulb.ac.be\n@D...
[ [ "numpy.random.rand", "numpy.argmin", "numpy.median", "numpy.genfromtxt", "numpy.min", "numpy.mean", "numpy.linalg.qr", "numpy.where", "numpy.multiply", "numpy.cos", "numpy.cumsum", "numpy.max", "numpy.concatenate", "numpy.zeros_like", "numpy.sin", "n...
JBris/EasyOCR
[ "f41a5d951bd6fce8cfcdaa67a956c639c013eb18" ]
[ "easyocr/utils.py" ]
[ "from __future__ import print_function\n\nimport torch\nimport pickle\nimport numpy as np\nimport math\nimport cv2\nfrom PIL import Image\nimport hashlib\nimport sys\nimport requests\n\ndef consecutive(data, mode ='first', stepsize=1):\n group = np.split(data, np.where(np.diff(data) != stepsize)[0]+1)\n group...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.sin", "torch.IntTensor", "numpy.roll", "numpy.mean", "numpy.diff", "numpy.where", "numpy.argmax", "numpy.sqrt", "numpy.append", "numpy.cos", "numpy.argwhere", "numpy.maximum" ] ]
pabloppp/glimpse-models
[ "224bd9614a47f773c1e78b85fd9bf0bbff88529b" ]
[ "data-prepare/PythonAPI/saliconDemo.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\n#get_ipython().magic(u'reload_ext autoreload')\n#get_ipython().magic(u'autoreload 2')\n#get_ipython().magic(u'matplotlib inline')\nfrom salicon.salicon import SALICON\nimport numpy as np\nimport skimage.io as io\nimport matplotlib.pyplot as plt\n\n\n# In[2]:\n\ndataDir='..'\ndataTy...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.figure" ] ]
yongfeng-nv/incubator-tvm
[ "a6cb4b8d3778db5341f991db9adf76ff735b72ea" ]
[ "tests/python/relay/test_op_qnn_concatenate.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.concatenate", "numpy.arange", "numpy.power" ] ]
mgwillia/unsupervised-analysis
[ "66b5c7af391199394ace3a1ff396d46ac5bd7ce5" ]
[ "datasets/neighbors_dataset.py" ]
[ "\"\"\" \n NeighborsDataset\n Returns an image with one of its neighbors.\n\"\"\"\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\n\n\nclass NeighborsDataset(Dataset):\n def __init__(self, dataset, indices, num_neighbors=None):\n super(NeighborsDataset, self).__init__()\n\n ...
[ [ "numpy.random.choice", "torch.from_numpy" ] ]
rutgers-apl/rlibm-all
[ "b014190b223d2d4842a5cf8235eeff3aa6cdd573" ]
[ "SpeedupOverRlibm32.py" ]
[ "import matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport numpy as np\n\nmatplotlib.rcParams['pdf.fonttype'] = 42\nmatplotlib.rcParams['ps.fonttype'] = 42\n\noverallLabel = [\"ln\", \"log2\", \"log10\", \"exp\", \"exp2\", \"exp10\", \"sinh\", \"cosh\", \"sinpi\", \"cospi\", \"a...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.gcf", "matplotlib.pyplot.subplots", "matplotlib.ticker.FormatStrFormatter" ] ]
ArshdeepSahni/MonoPort
[ "a67fdc02b4fb45b3cc187aa4ae34053574d0383c" ]
[ "monoport/lib/render/gl/Render.py" ]
[ "import numpy as np\nfrom .Shader import *\n\n\nclass Render(object):\n def __init__(self,\n width, height,\n multi_sample_rate=1,\n num_render_target=1\n ):\n self.width = width\n self.height = height\n\n self.vbo_list = []\n ...
[ [ "numpy.ascontiguousarray", "numpy.flip" ] ]
fabiotabalipa/cnes-hospitais
[ "7e98e75fa5ed0808b4de5257ec258441a8b93211" ]
[ "transform/cnes.py" ]
[ "import pandas as pd\nimport warnings\n\nPREFIX_MAIN_TBL = \"tbEstabelecimento\"\nPREFIX_BEDS_TBL = \"rlEstabComplementar\"\nPREFIX_INSURANCE_TBL = \"rlEstabAtendPrestConv\"\nPREFIX_CITY_TBL = \"tbMunicipio\"\n\nCOD_GENERAL_HOSPITAL = 5\nCOD_SPECIALIZED_HOSPITAL = 7\n\nCOD_INSURANCE_OWN = 3\nCOD_INSURANCE_THIRD = 4...
[ [ "pandas.read_csv" ] ]
p-patil/baselines
[ "72d6757cfe88521012a30e8f38c4b313455da395" ]
[ "baselines/deepq/deepq.py" ]
[ "import os\nimport tempfile\n\nimport tensorflow as tf\nimport zipfile\nimport cloudpickle\nimport numpy as np\n\nimport baselines.common.tf_util as U\nfrom baselines.common.tf_util import load_variables, save_variables\nfrom baselines import logger\nfrom baselines.common.schedules import LinearSchedule\nfrom basel...
[ [ "numpy.array", "numpy.ones_like", "tensorflow.train.AdamOptimizer", "tensorflow.train.latest_checkpoint", "tensorflow.Session", "numpy.mean", "numpy.abs" ] ]
psteinb/b3get
[ "70bfd37881bdef2ecd6a7bbfc105a001b3e97749" ]
[ "tests/test_datasets.py" ]
[ "import os\nimport requests\nimport shutil\nimport zipfile\nimport glob\nimport tifffile\nimport numpy as np\n\nfrom bs4 import BeautifulSoup\nfrom b3get.utils import filter_files, tmp_location\nfrom b3get.datasets import dataset, ds_006, ds_008, ds_024, ds_027\nimport pytest\n\n# manual tests for exploration\n\n\n...
[ [ "numpy.all", "numpy.array_equal" ] ]
dairatom/stable-baselines
[ "fc55681eeb6687301b429a407a875e9a6e01a0c5" ]
[ "stable_baselines/deepq/policies.py" ]
[ "#import tensorflow as tf\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nimport tensorflow.keras.layers as tf_layers\nimport numpy as np\nfrom gym.spaces import Discrete\n\nfrom stable_baselines.common.policies import BasePolicy, nature_cnn, register_policy\n\n\nclass DQNPolicy(BasePolicy):\n \"\"...
[ [ "tensorflow.keras.layers.fully_connected", "numpy.random.choice", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.layers.flatten", "tensorflow.compat.v1.nn.softmax", "tensorflow.compat.v1.variable_scope", "tensorflow.keras.layers.layer_norm", "tensorflow.compat.v1...
sDauenbaugh/AwesamBot
[ "ca4f0e2eeb81a02a672226d13be74fbb9c43bc0f" ]
[ "src/controllers/pidController.py" ]
[ "import numpy as np\nfrom rlbot.agents.base_agent import SimpleControllerState\n\n\nclass PID:\n\n def __init__(self, kp, ki, kd):\n self.Kp = kp\n self.Ki = ki\n self.Kd = kd\n self.last_err = 0\n self.sum_err = 0\n self.err = 0\n\n def update(self, e_t):\n se...
[ [ "numpy.arctan2" ] ]
ugurcanozalp/heli-gym
[ "78d754f63f9d0bbc606da760bfff9218c84d8be3" ]
[ "heligym/envs/helicopter.py" ]
[ "\"\"\"\nHelicopter control.\n\"\"\"\nimport yaml\nimport sys, math\nimport numpy as np\nimport os\nimport copy\n\nimport gym\nfrom gym import spaces\nfrom gym.utils import seeding, EzPickle\n\nfrom .dynamics import HelicopterDynamics\nfrom .dynamics import WindDynamics\nfrom .renderer.api import Renderer\n\nFPS ...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.copy", "numpy.sqrt", "numpy.append", "numpy.abs" ] ]
neolixcn/mmdetection3d
[ "45b5b8c2b2cc35762f27b020b34d2c3ee6be97af" ]
[ "mmdet3d/models/dense_heads/train_mixins.py" ]
[ "import numpy as np\nimport torch\n\nfrom mmdet3d.core import limit_period\nfrom mmdet.core import images_to_levels, multi_apply\n\n\nclass AnchorTrainMixin(object):\n \"\"\"Mixin class for target assigning of dense heads.\"\"\"\n\n def anchor_target_3d(self,\n anchor_list,\n ...
[ [ "torch.zeros_like", "torch.floor", "torch.cat", "torch.clamp" ] ]
lehduong/Policy-gradient-credit-assignment
[ "1d4c102964b985212874c1fe8710a8aa6ff9f328" ]
[ "main.py" ]
[ "import os\nimport time\nfrom collections import deque\n\nimport numpy as np\nimport torch\n\nfrom core import algorithms, utils\nfrom core.arguments import get_args\nfrom core.envs import make_vec_envs\nfrom core.agents import PolicyGradientAgent, CPCPolicyGradientAgent\nfrom core.storage import RolloutStorage, CP...
[ [ "numpy.max", "torch.device", "torch.cuda.manual_seed_all", "numpy.median", "torch.FloatTensor", "torch.no_grad", "numpy.min", "numpy.mean", "torch.manual_seed", "torch.cuda.is_available", "torch.set_num_threads" ] ]
stejsle1/semestralni_prace_PYT
[ "ffee7a8deeae9c73c8b8097494345d7fe90c2889" ]
[ "wator_tests/tests/test_wator_init.py" ]
[ "import numpy\nimport pytest\n\nfrom wator import WaTor\n\n\ndef test_creatures():\n creatures = numpy.zeros((8, 8))\n creatures[2, 4] = 3\n creatures[1, :] = -5\n wator = WaTor(creatures)\n print(wator.creatures)\n assert (creatures == wator.creatures).all()\n assert wator.count_fish() == 1\n ...
[ [ "numpy.zeros" ] ]
negarIravani/machine-learning-engineering-for-production-public
[ "886ecc93dbf74ff3b6cde8b77eb0b1f2b49b7c2e" ]
[ "course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py" ]
[ "import pickle\nimport numpy as np\nfrom typing import List\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel, conlist\n\n# small changes to test\n\napp = FastAPI(title=\"Predicting Wine Class with batching\")\n\n# Open classifier in global scope\nwith open(\"models/wine-95-fixed.pkl\", \"rb\") as file:\...
[ [ "numpy.array" ] ]
deHasara/dask
[ "fb544144611b25a6f23d90637038a93f93153f8f" ]
[ "dask/utils.py" ]
[ "from datetime import datetime, timedelta\nimport functools\nimport inspect\nimport os\nimport shutil\nimport sys\nimport tempfile\nimport re\nfrom errno import ENOENT\nfrom collections.abc import Iterator\nfrom contextlib import contextmanager\nfrom importlib import import_module\nfrom numbers import Integral, Num...
[ [ "numpy.empty", "numpy.random.RandomState", "numpy.allclose", "numpy.frombuffer", "numpy.cumsum" ] ]
ALEXKIRNAS/DataScience
[ "14119565b8fdde042f6ea3070bc0f30db26620c0" ]
[ "CS231n/assignment2/cs231n/optim.py" ]
[ "import numpy as np\n\n\"\"\"\nThis file implements various first-order update rules that are commonly used\nfor training neural networks. Each update rule accepts current weights and the\ngradient of the loss with respect to those weights and produces the next set of\nweights. Each update rule has the same interfa...
[ [ "numpy.zeros_like", "numpy.sqrt" ] ]
akathpal/RoboND-Perception-Project
[ "6304d3114f36760cea6ed31b40e99618166a3a7c" ]
[ "code/train_svm.py" ]
[ "#!/usr/bin/env python\nimport pickle\nimport itertools\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import svm\nfrom sklearn.preprocessing import LabelEncoder, StandardScaler\nfrom sklearn import cross_validation\nfrom sklearn import metrics\n\ndef plot_confusion_matrix(cm, classes,\n ...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.cross_validation.cross_val_score", "matplotlib.pyplot.xticks", "matplotlib.pyplot.colorbar", "sklearn.cross_validation.cross_val_predict", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.tight_layout", "sklear...
Cocopyth/MscThesis
[ "60162bc779a3a668e7447b60bb9a4b2a616b8093" ]
[ "amftrack/pipeline/functions/post_processing/time_hypha.py" ]
[ "from amftrack.pipeline.functions.image_processing.hyphae_id_surf import get_pixel_growth_and_new_children\r\nimport numpy as np\r\nimport networkx as nx\r\nfrom amftrack.pipeline.functions.post_processing.util import get_length_um_edge, is_in_study_zone,get_length_um\r\nfrom scipy import sparse\r\n\r\ndef get_time...
[ [ "numpy.sum", "scipy.sparse.csr_matrix" ] ]
erik-grennberg-jansson/matern_sfem
[ "1e9468084abf41cc0ae85f1b4b1254904ed2d72f" ]
[ "pool_example.py" ]
[ "\nfrom numpy.random import normal\nimport numpy as np\n\nfrom dolfin import *\nfrom ctypes import *\n\nfrom mesh_generation import sphere_mesh\nfrom utils import solve_problem\nfrom Problem import Problem \n\nL = 25 # number of KL terms\nbeta = 0.51 #smoothness parameter \nkappa =1.0 #length scale parameter \nk =...
[ [ "numpy.random.normal" ] ]
leonjovanovic/ml-real-estate
[ "3f1ca50eb793dbe77d35eda14dfc468d28861a5a" ]
[ "linear_regression/main.py" ]
[ "import json\r\nimport numpy as np\r\nfrom sklearn.utils import shuffle\r\nimport matplotlib.pyplot as plt\r\n\r\nHYPERPARAMETERS = {\r\n 'num_features': 7,\r\n 'features': ('lokacija2', 'kvadratura', 'sprat', 'broj_soba', 'parking', 'lift', 'terasa'),\r\n 'learning_rate': [0.001, 0.003, 0.01, 0.03], # 0....
[ [ "numpy.array", "numpy.delete", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.ones", "numpy.mean", "numpy.std", "numpy.absolute", "matplotlib.pyplot.show", "numpy.vstack", "sklearn.utils.shuffle" ] ]
cuulee/eltgan
[ "17a5627f1526607e56696e6b832cc8f6f0d43897" ]
[ "data/unaligned_dataset.py" ]
[ "import torch\nfrom torch import nn\nimport os.path\nimport torchvision.transforms as transforms\nfrom data.base_dataset import BaseDataset, get_transform\nfrom data.image_folder import make_dataset, store_dataset\nimport random\nfrom PIL import Image\nimport PIL\nfrom pdb import set_trace as st\n\ndef pad_tensor(i...
[ [ "torch.min", "torch.max", "torch.unsqueeze", "torch.LongTensor", "torch.nn.ReflectionPad2d" ] ]
starxchina/Patch-Diffusion
[ "97f4881ae04c335fc1a13ded432d8e10a47df5f0" ]
[ "pd_module.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass Patch_Diffusion(nn.Module):\n def __init__(self, input_feature_channel, patch_channel, patch_num, l=1):\n \"\"\"Patch Diffusion Moudle\n\n Args:\n input_feature_channel (int): the channel number of input feature\n patch_channel (in...
[ [ "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
1nF0rmed/alf
[ "84bf56379d5fb552fb43365c5a77d8edc46d06c3" ]
[ "alf/trainers/policy_trainer_test.py" ]
[ "# Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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...
[ [ "torch.all" ] ]
CMU-IDS-2020/a3-yet-another-streamlit
[ "c09421e428621de99c68823c9a75045da49b98d8" ]
[ "interactive_polynomial.py" ]
[ "import numpy as np\nimport pandas as pd\nimport streamlit as st\nimport altair as alt\nfrom multivariate_LR import LinearRegression\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import train_test_split\n\n# time-series data for losses\ndef get_loss_df(train_losses, test_losses):\n...
[ [ "numpy.concatenate", "numpy.random.normal", "numpy.zeros", "sklearn.preprocessing.StandardScaler", "pandas.DataFrame", "numpy.ones", "numpy.random.randn", "numpy.arange", "pandas.concat", "sklearn.model_selection.train_test_split" ] ]
zhongdixiu/tensorflow-learn
[ "42728c94ec7506a9a69fda54bc17d3244ce4bf57" ]
[ "dataset_learn_slim.py" ]
[ "# coding=utf-8\n\n\"\"\"以MNIST为例,使用slim.data\n\"\"\"\n\nimport os\nimport tensorflow as tf\n\nslim = tf.contrib.slim\n\ndef get_data(data_dir, num_samples, num_class, file_pattern='*.tfrecord'):\n \"\"\"返回slim.data.Dataset\n\n :param data_dir: tfrecord文件路径\n :param num_samples: 样本数目\n :param num_class:...
[ [ "tensorflow.FixedLenFeature", "tensorflow.zeros", "tensorflow.train.batch" ] ]
mbinfokyaw/n2v
[ "480d94a4e87c08c26e4e8c301468b125682b67f3" ]
[ "tests/test_Noise2VoidDataWrapper.py" ]
[ "from n2v.internals.N2V_DataWrapper import N2V_DataWrapper\n\nimport numpy as np\n\ndef test_subpatch_sampling():\n\n def create_data(in_shape, out_shape):\n X, Y = np.random.rand(*in_shape), np.random.rand(*in_shape)\n X_Batches, Y_Batches = np.zeros(out_shape), np.zeros(out_shape)\n indice...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "numpy.sum", "numpy.random.shuffle", "numpy.arange", "numpy.random.randint" ] ]
bonilab/malariaibm-generation-of-MDR-mutants
[ "41086cf621274dcdf8b445435cb1825424a2e722" ]
[ "misc/MDA_WHO_ERG_2018/input_generator_FLAL_Figure_S2.4.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 7 14:23:33 2018\n\n@author: NguyenTran\n\"\"\"\n\nimport yaml;\nimport numpy as np;\nfrom math import log;\nimport copy;\n\n#import inflect;\n#p = inflect.engine();\n\ndef kFormatter(num):\n return str(num) if num <=999 else str(round(num/1000)) +'k';\n\n\nst...
[ [ "numpy.full" ] ]
seryogin17/dlcourse_ai
[ "7a32e527bf5b5eaf16ba67468109e459c45ec62e" ]
[ "assignments/assignment2/gradient_check.py" ]
[ "import numpy as np\n\n\n\ndef check_gradient(f, x, delta=1e-7, tol = 1e-4):\n '''\n Checks the implementation of analytical gradient by comparing\n it to numerical gradient using two-point formula\n\n Arguments:\n f: function that receives x and computes value and gradient\n x: np array, init...
[ [ "numpy.isclose", "numpy.ones_like", "numpy.nditer", "numpy.sum", "numpy.random.randn" ] ]
Corleone-Huang/unleashing-transformers
[ "66925b11c3d63222a34a2f66b499c900e4b6cef4" ]
[ "models/autoregressive.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom .sampler import Sampler\nfrom .transformer import Transformer\nimport numpy as np\nimport math\n\n\nclass AutoregressiveTransformer(Sampler):\n def __init__(self, H, embedding_weight):\n super().__init__(H, embedding_weight)\n self.net = Transfor...
[ [ "torch.zeros", "torch.cat", "torch.multinomial", "numpy.prod", "torch.nn.functional.softmax" ] ]
codewithzichao/DeepClassifier
[ "c07e8041a2aca855fed9bf69fd571f1cbd5ec032" ]
[ "tests/test_han.py" ]
[ "# -*- coding:utf-8 -*-\n'''\n\nAuthor:\n Zichao Li,2843656167@qq.com\n\n'''\nfrom __future__ import print_function\n\nimport os\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader\nimport torch.optim as optim\nfrom deepclass...
[ [ "torch.nn.CrossEntropyLoss", "numpy.random.randn", "numpy.random.randint", "torch.utils.data.DataLoader" ] ]
henrykironde/DeepTreeAttention
[ "a50f5f4499e5aa0a74732e84b9b51d482bc508bb" ]
[ "src/data.py" ]
[ "#Ligthning data module\nimport argparse\nfrom . import __file__\nfrom distributed import wait\nimport glob\nimport geopandas as gpd\nimport json\nimport numpy as np\nimport os\nimport pandas as pd\nfrom pytorch_lightning import LightningDataModule\nimport rasterio as rio\nfrom sklearn import preprocessing\nfrom sr...
[ [ "numpy.asarray", "numpy.rollaxis", "numpy.random.shuffle", "torch.from_numpy", "sklearn.preprocessing.scale", "numpy.prod", "numpy.arange", "torch.utils.data.DataLoader", "torch.tensor", "pandas.concat", "numpy.sort", "numpy.argmax", "pandas.read_csv", "nump...
krai/ck-object-detection
[ "30a43faaca8afef05299b1604a0c04541d5723a7" ]
[ "program/double-inference/custom_hooks.py" ]
[ "#MIT License\n#\n#Copyright (c) 2019 YangYun\n#\n#Permission is hereby granted, free of charge, to any person obtaining a copy\n#of this software and associated documentation files (the \"Software\"), to deal\n#in the Software without restriction, including without limitation the rights\n#to use, copy, modify, mer...
[ [ "numpy.concatenate", "numpy.full", "numpy.array", "numpy.logical_or", "numpy.reshape", "numpy.minimum", "tensorflow.compat.v1.get_default_graph", "numpy.exp", "numpy.logical_and", "numpy.shape", "numpy.finfo", "numpy.argmax", "numpy.multiply.reduce", "numpy....
nschloe/scipy
[ "3f05efb9498e29f4e735aa7e0220139a8d8c8773" ]
[ "scipy/spatial/distance.py" ]
[ "\"\"\"\nDistance computations (:mod:`scipy.spatial.distance`)\n=====================================================\n\n.. sectionauthor:: Damian Eads\n\nFunction reference\n------------------\n\nDistance matrix computation from a collection of raw observation vectors\nstored in a rectangular array.\n\n.. autosumm...
[ [ "numpy.dot", "numpy.issubdtype", "numpy.empty", "numpy.log", "numpy.sqrt", "numpy.linalg.inv", "numpy.vstack", "numpy.atleast_2d", "numpy.square", "numpy.array", "numpy.zeros", "numpy.nansum", "numpy.bitwise_and", "numpy.power", "numpy.bitwise_or", "...
qooglewb/QBuilder
[ "6156b97c636c5b568c5a57c23b77d9ae28421bba" ]
[ "ashpy/models/fc/encoders.py" ]
[ "# Copyright 2019 Zuru Tech HK Limited. 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 b...
[ [ "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.layers.Dense" ] ]
ElementalCognition/transformers
[ "29ad1f790c123a3d68c2fb124e512cc4a9f6cf49" ]
[ "src/transformers/generation_utils.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team.\n# Copyright (c) 2020, 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 complianc...
[ [ "torch.zeros", "torch.cat", "torch.arange", "torch.gather", "torch.no_grad", "torch.nn.functional.log_softmax", "torch.ones", "torch.multinomial", "torch.full", "torch.nn.functional.softmax", "torch.zeros_like", "torch.sort", "torch.topk" ] ]
xuanhien070594/robosuite
[ "1cac10607c7f37113710af13c85cff1421a37815" ]
[ "robosuite/wrappers/gym_wrapper.py" ]
[ "\"\"\"\nThis file implements a wrapper for facilitating compatibility with OpenAI gym.\nThis is useful when using these environments with code that assumes a gym-like \ninterface.\n\"\"\"\n\nimport numpy as np\nfrom gym import spaces\nfrom gym.core import Env\n\nfrom robosuite.wrappers import Wrapper\n\n\nclass Gy...
[ [ "numpy.concatenate", "numpy.array", "numpy.random.seed" ] ]
StephenRogers1/cogent3
[ "1116a0ab14d9c29a560297205546714e2db1896c" ]
[ "src/cogent3/evolve/likelihood_function.py" ]
[ "#!/usr/bin/env python\n\nimport json\nimport random\n\nfrom collections import defaultdict\nfrom copy import deepcopy\n\nimport numpy\n\nfrom cogent3.core.alignment import ArrayAlignment\nfrom cogent3.evolve import substitution_model\nfrom cogent3.evolve.simulate import AlignmentEvolver, random_sequence\nfrom coge...
[ [ "numpy.dot", "numpy.asarray", "numpy.zeros", "numpy.take" ] ]
dattatreya303/OpenNMT-py
[ "f240346274925743379b72c221a47208cc4bd1d0" ]
[ "onmt/encoders/transformer.py" ]
[ "\"\"\"\nImplementation of \"Attention is All You Need\"\n\"\"\"\n\nimport torch.nn as nn\n\nimport onmt\nfrom onmt.encoders.encoder import EncoderBase\n# from onmt.utils.misc import aeq\nfrom onmt.modules.position_ffn import PositionwiseFeedForward\n\n\nclass TransformerEncoderLayer(nn.Module):\n \"\"\"\n A ...
[ [ "torch.nn.Dropout", "torch.nn.LayerNorm" ] ]
samvidav/VISTA
[ "e5bc3e649133714bc1dc6a9edde2a5be826f4f49" ]
[ "Shiny/getStringInteractors.py" ]
[ "# ADAPTED FROM \n# Michelle Kennedy\n# 1.29.2019\n\n# Below are the main functions needed to get the string interactions. \n\nimport requests\n\n# for outputting the response from STRING to a pandas data frame\nimport io \nimport pandas as pd\nimport numpy as np\nimport time\n\nclass GetSTRINGInteractions:\n de...
[ [ "pandas.concat" ] ]
ComitUniandes/ICS-SDN
[ "fa1df31849dbe26264eabc1aa58ebda2f79ca698" ]
[ "francisco-topo/plot_tim_uio.py" ]
[ "\"\"\"Plot the solution that was generated by differential_equation.py.\"\"\"\n \nfrom numpy import loadtxt\nfrom pylab import figure, plot, xlabel, grid, hold, legend, title, savefig\nfrom matplotlib.font_manager import FontProperties\nimport sys\n\nt, x1, = loadtxt(sys.argv[1] , unpack=True)\n\n\nfigure(1, figsi...
[ [ "numpy.loadtxt" ] ]
ColwynGulliford/lume-gpt
[ "75f76adf72567c1d527d3ed010c6b60869a5c068" ]
[ "gpt/parsers.py" ]
[ "import copy\nfrom . import easygdf\nimport time\nimport numpy as np\nimport re\nimport os\n\nfrom gpt.tools import full_path\n\nimport shutil\n\n# ------ Number parsing ------\ndef isfloat(value):\n try:\n float(value)\n return True\n except ValueError:\n return False\n\ndef find_path(li...
[ [ "numpy.array", "numpy.sum", "numpy.abs", "numpy.sqrt", "numpy.argsort" ] ]
cristinamicula/profiler
[ "3af06b41efa0272401e299b62cfc9bfba10a9b62" ]
[ "Profiler.py" ]
[ "import datetime\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\n\n\nclass Operation:\n def __init__(self, name: str, max_number: int):\n self.name = name\n self.operation_count = 0\n self.max_number = max_number\n\n def count(self, value: int = 1...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
shangeth/Speaker-Representation-Learning
[ "44d6cade2f9dd3fefb60f63d8c19e229e701faf6" ]
[ "visualize_test_embedding.py" ]
[ "from argparse import ArgumentParser\nimport pytorch_lightning as pl\nimport torch\nimport torch.utils.data as data\nimport torchaudio\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom dataset import EmbDataset\nfrom models.lightning_model import RepresentationModel\n\nfrom torch.utils.tensorboard import SummaryWr...
[ [ "torch.stack", "torch.utils.tensorboard.SummaryWriter", "torch.load" ] ]
Menerve/pylearn2
[ "ad7bcfda3294404aebd71f5a5c4a8623d401a98e" ]
[ "pylearn2/utils/video.py" ]
[ "\"\"\"\nUtilities for working with videos, pulling out patches, etc.\n\"\"\"\nimport numpy\n\nfrom pylearn2.utils.rng import make_np_rng\n\n__author__ = \"David Warde-Farley\"\n__copyright__ = \"Copyright 2011, David Warde-Farley / Universite de Montreal\"\n__license__ = \"BSD\"\n__maintainer__ = \"David Warde-Far...
[ [ "numpy.random.random_integers", "numpy.cumsum" ] ]
yanivbl6/mage
[ "e251fa814f7091cfcd5630321bf6b00a079523f5" ]
[ "utils.py" ]
[ "import numpy as np\nimport random\nimport torch\n\n\ndef set_seed(seed, fully_deterministic=True):\n np.random.seed(seed)\n random.seed(seed)\n torch.manual_seed(seed)\n if torch.cuda.is_available():\n torch.cuda.manual_seed_all(seed)\n if fully_deterministic:\n torch.backends....
[ [ "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.cuda.manual_seed_all" ] ]
chiahsuan156/chiahsuan156.github.io
[ "d87f649940cccec13fc9896f077abdb7c3ff266f" ]
[ "markdown_generator/publications.py" ]
[ "\n# coding: utf-8\n\n# # Publications markdown generator for academicpages\n# \n# Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `...
[ [ "pandas.read_csv" ] ]
herilalaina/mosaic_ml
[ "4eb6229006061d275ff0b80a1d31514d9d7d22f0", "4eb6229006061d275ff0b80a1d31514d9d7d22f0" ]
[ "setup.py", "mosaic_ml/model_config/classification/extra_trees.py" ]
[ "# -*- encoding: utf-8 -*-\nimport os\nimport sys\nimport codecs\nimport os.path\nfrom setuptools import setup, find_packages\nfrom setuptools.extension import Extension\nfrom setuptools.command.build_ext import build_ext\n\ndef read(rel_path):\n here = os.path.abspath(os.path.dirname(__file__))\n with codecs...
[ [ "numpy.get_include" ], [ "sklearn.ensemble.ExtraTreesClassifier" ] ]
gecheline/stargrit
[ "ec293eaa9f911145f05a297e6e4c321b6adebbd0" ]
[ "stargrit/radiative_transfer/cobain/gray.py" ]
[ "import numpy as np \nimport stargrit as sg\nimport quadpy.sphere as quadsph\nimport scipy.interpolate as spint\nfrom stargrit.structure import potentials\nfrom stargrit.radiative_transfer.cobain.general import RadiativeTransfer, DiffrotStarRadiativeTransfer, ContactBinaryRadiativeTransfer\nfrom stargrit.geometry.s...
[ [ "numpy.isnan", "numpy.zeros", "numpy.argmin", "scipy.interpolate.UnivariateSpline", "matplotlib.pyplot.plot", "numpy.load", "numpy.exp", "matplotlib.pyplot.legend", "numpy.hstack", "numpy.abs", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspac...
saran87/Real-Time-Data-Processing
[ "e460b33c0a73a00a3606d9a5c427cc63c78bcea3" ]
[ "paktrack/shock/shock_data_processor.py" ]
[ "import logging\nimport operator\nfrom numpy import mean, sqrt, square\n\nfrom paktrack.common.common import (get_average_for_event)\nfrom paktrack.shock.shock_response_spectrum import srs, np\n\nPEEK_DETECTION_THRESHOLD = 3\nFACE_DETECTION_THRESHOLD = 1.5\nNUMBER_CHUNK_SIZE = 16\nAXIS_MAPPING = {0: \"x\", 1: \"y\"...
[ [ "numpy.square" ] ]
PacktPublishing/Deep-Learning-with-Keras-V-
[ "5b2ad1bbbddd994437506198eceacccc5cee4bcc" ]
[ "Section-1/Keras_MNIST_V1.py" ]
[ "from __future__ import print_function\nimport numpy as np\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Activation\nfrom keras.optimizers import SGD\nfrom keras.utils import np_utils\n\nnp.random.seed(1671) # for reproducibility\n\n# network and train...
[ [ "numpy.random.seed" ] ]
jessecantu/tensorflow
[ "60028072a1c3b4376e145b6fea8e4ccd3324377f" ]
[ "tensorflow/python/kernel_tests/array_ops/gather_op_test.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.framework.test_util.force_cpu", "tensorflow.python.eager.context.executing_eagerly", "tensorflow.python.platform.test.main", "tensorflow.python.ops.math_ops.cast", "numpy.take", "numpy.prod", "tensorflow.python.ops.array_ops.placeholder", "numpy.arange", "ten...