repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
matteopilotto/CogView | [
"51203abf9c74415f3d212e31c1e8558313ba35e9"
] | [
"preprocess/utils.py"
] | [
"# -*- encoding: utf-8 -*-\n'''\n@File : utils.py\n@Time : 2021/01/24 16:35:43\n@Author : Ming Ding \n@Contact : dm18@mails.tsinghua.edu.cn\n'''\n\n# here put the import lib\nimport os\nimport sys\nimport math\nimport random\nfrom tqdm import tqdm\n\nimport numpy as np\nimport torch\nimport torch.nn.... | [
[
"torch.cat",
"torch.tensor"
]
] |
LordLean/Checkers-Game | [
"641215782cb0de875a818bf62e9da2122c300963"
] | [
"graphs/bigO.py"
] | [
"#!pip install matplotlib\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Branching factor.\nB = 2.8\n# Search depth of d plies. d = 5.\nx = np.linspace(1,5,500)\n# Minimax Big O.\ny_minimax = np.power(B, x)\n# Alpha beta Big O.\ny_a_b = np.sqrt(y_minimax)\n# Plot:\nplt.plot(x, y_minimax, label=\"Minima... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.power",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
steppenwolf0/primerDesign | [
"1d1a7ea07ece17cca6f5a24133dd5389acc9ae3d"
] | [
"code/outputVal.py"
] | [
"# These are all the modules we'll be using later. Make sure you can import them\n# before proceeding further.\nfrom __future__ import print_function\nimport numpy as np\nimport os\nimport sys\nimport tarfile\nimport math\nimport random\nimport sys\nfrom IPython.display import display, Image\nfrom scipy import ndim... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"sklearn.metrics.auc",
"sklearn.metric... |
njanakiev/geospatial-storytelling | [
"8485d13b49a4dbfae41cf0bacf862520ad0a5906"
] | [
"src/point_heatmap.py"
] | [
"import os\nfrom mpl_toolkits.basemap.pyproj import Proj\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport json\n\n\n\n# Project data to New York Long Island SRS (Spatial Reference System)\n# http://www.spatialreference.org/ref/epsg/2263/\np = Proj(init=\"epsg:2263\")\n\n# Load GPS data from url or file\... | [
[
"numpy.histogram2d",
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.axis"
]
] |
bupticybee/icyChessZero | [
"1be5cfb3ab7dfad11925ae469b86c990efab9d16"
] | [
"cchess/board.py"
] | [
"# -*- coding: utf-8 -*-\n\n'''\nCopyright (C) 2014 walker li <walker8088@gmail.com>\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any... | [
[
"numpy.asarray"
]
] |
data-hound/scikeras | [
"d216d083679d5113b85a4e338d4346b9403e3a71"
] | [
"tests/multi_output_models.py"
] | [
"from typing import List\n\nimport numpy as np\n\nfrom sklearn.utils.multiclass import type_of_target\nfrom tensorflow.keras.backend import floatx as tf_floatx\n\nfrom scikeras.utils.transformers import ClassifierLabelEncoder\nfrom scikeras.wrappers import KerasClassifier\n\n\nclass MultiLabelTransformer(Classifier... | [
[
"numpy.array",
"numpy.split",
"sklearn.utils.multiclass.type_of_target",
"tensorflow.keras.backend.floatx",
"numpy.argmax",
"numpy.column_stack"
]
] |
ssteo/streamlit | [
"fde1b548e4bf2d2e5a97b5c3fcf655d43134b342"
] | [
"lib/streamlit/elements/image.py"
] | [
"# Copyright 2018-2021 Streamlit 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 ... | [
[
"numpy.amin",
"numpy.amax",
"numpy.clip"
]
] |
vangorade/pandas | [
"2b4bcf25f7bc61fe35387654a81908222e1db3da"
] | [
"pandas/core/frame.py"
] | [
"\"\"\"\nDataFrame\n---------\nAn efficient 2D container for potentially mixed-type time series or other\nlabeled data series.\n\nSimilar to its R counterpart, data.frame, except providing automatic data\nalignment and a host of useful data manipulation methods having to do with the\nlabeling information\n\"\"\"\nf... | [
[
"pandas.core.ops.add_flex_arithmetic_methods",
"pandas.core.common.asarray_tuplesafe",
"pandas.core.construction.extract_array",
"pandas.core.dtypes.common.is_float_dtype",
"pandas.core.aggregation.aggregate",
"pandas.io.formats.format.DataFrameRenderer",
"pandas.core.dtypes.cast.maybe... |
oronnir/CAST | [
"c2b095a516e5ad0cdfec8b13196045549cbd3f4c"
] | [
"Featurizer/classifier.py"
] | [
"import collections\nimport torch\n\n\nclass Classifier(torch.nn.Module):\n def __init__(self, num_classes, feature_planes):\n assert isinstance(num_classes, int) or isinstance(num_classes, collections.abc.Iterable)\n super(Classifier, self).__init__()\n self.feature_planes = feature_planes\... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.split"
]
] |
Kreijeck/learning | [
"eaffee08e61f2a34e01eb8f9f04519aac633f48c"
] | [
"Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/solutions/ex01_even_odd_ordering.py"
] | [
"# Beispielprogramm fรผr das Buch \"Python Challenge\"\n#\n# Copyright 2020 by Michael Inden\n\n\nimport numpy as np\n\nfrom ch02_math.solutions.ex01_basics import is_odd, is_even\nfrom ch06_arrays.intro.intro import swap\n\n\ndef order_even_before_odd(numbers):\n i = 0\n while i < len(numbers):\n value... | [
[
"numpy.array"
]
] |
frank1010111/pywaterflood | [
"70c6d39e1a979548db0835296d54b7bb392870f0"
] | [
"pywaterflood/crm.py"
] | [
"\"\"\"Analyze waterfloods with capacitance-resistance models. # noqa: D401,D400\n\nClasses\n-------\nCRM : standard capacitance resistance modeling\nCrmCompensated : including pressure\n\nMethods\n-------\nq_primary : primary production\nq_CRM_perpair : production due to injection (injector-producer pairs)\nq_CRM_... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.array",
"numpy.isnan",
"numpy.zeros",
"numpy.sum",
"pandas.DataFrame",
"numpy.ones",
"numpy.random.default_rng",
"numpy.exp",
"numpy.any",
"numpy.einsum",
"pandas.ExcelWriter",
"scipy.optimize.minimize",
"numpy.v... |
bbalegere/MILP-Interview-Scheduler | [
"8f8e584c8022e45a363aa001d5eda08cf4a74d89"
] | [
"InterviewScheduler.py"
] | [
"\"\"\"\n Author: Bharat Balegere\n Date created: 10-Oct-2017\n Date last modified: 23-Jan-2018\n Python Version: 3.6\n\"\"\"\nimport argparse\nimport datetime\n\nimport numpy as np\nimport pandas as pd\nfrom gurobipy import *\n\n\ndef read_input_csv(filename, typ=None):\n sldf = pd.read_csv(filename... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"numpy.issubdtype"
]
] |
dougbrion/ModernGL | [
"6de8938ccd0042c1389a32b697af5f9c9d279e41"
] | [
"examples/experimental/julia_fractal.py"
] | [
"import moderngl.experimental as mgl\n\nimport numpy as np\n\nfrom example_window import Example, run_example\n\n\nclass Fractal(Example):\n def __init__(self):\n self.ctx = mgl.create_context()\n\n self.prog = self.ctx.program(\n vertex_shader='''\n #version 330\n\n ... | [
[
"numpy.array"
]
] |
openmednlp/shipyard | [
"a325bb4aeb838dad53b76aa75a815a02357c752a"
] | [
"ris/cranial/embeddings.py"
] | [
"import pandas as pd\nfrom configparser import ConfigParser\nimport re\nfrom gensim.models.word2vec import Word2Vec\n\nconfig = ConfigParser()\nconfig.read('config.ini')\n\n\ndef vectorize_dataset(x, x_val, y, y_val, stratify=False):\n from bedrock.feature import train_tfidf_vectorizer\n from bedrock.collecti... | [
[
"pandas.DataFrame"
]
] |
xc-kiwiberry/TRICE | [
"5b37e68fd1111fdc8db7e8544080dcd83c805b35"
] | [
"thumt/models/modeling_bart.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Facebook AI Research Team 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.or... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.isnan",
"torch.finfo",
"torch.bmm",
"torch.cuda.is_available",
"numpy.cos",
"torch.nn.CrossEntropyLoss",
"torch.reshape",
"numpy.sin",
"torch.nn.LayerNorm",
"torch.tensor",
"torch.zeros",
"torch.nn.Identity",
"torch... |
Cyril9227/EfficientMixNet | [
"34d50152d3894c0c7b5175d43e42c72a04c49f19"
] | [
"keras_efficientmixnets/custom_optimizers.py"
] | [
"#! -*- coding: utf-8 -*-\n\nfrom tensorflow.keras import backend as K ### REM: idem\nfrom tensorflow.keras.optimizers import (SGD, Adadelta, Adagrad, Adam, Adamax, Nadam,\n Optimizer, RMSprop)\nfrom tensorflow.keras.utils import (deserialize_keras_object,\n ... | [
[
"tensorflow.keras.backend.int_shape",
"tensorflow.keras.backend.dtype",
"tensorflow.keras.backend.variable",
"tensorflow.keras.backend.batch_get_value",
"tensorflow.keras.backend.switch",
"tensorflow.keras.backend.square",
"tensorflow.keras.backend.learning_phase",
"tensorflow.kera... |
Carreau/yt | [
"d7e1cf22a8349b8a62b9c569017643ee233d9c4f"
] | [
"yt/frontends/moab/data_structures.py"
] | [
"import os\nimport weakref\n\nimport numpy as np\n\nfrom yt.data_objects.index_subobjects.unstructured_mesh import SemiStructuredMesh\nfrom yt.data_objects.static_output import Dataset\nfrom yt.funcs import setdefaultattr\nfrom yt.geometry.unstructured_mesh_handler import UnstructuredIndex\nfrom yt.utilities.file_h... | [
[
"numpy.asarray"
]
] |
aron-kvvon/ai-dataset-python | [
"d10feb0f2e301456995a99227e82a4f294e0ecb7"
] | [
"ai_dataset/utils/convert_type.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nModule Description:\n This module is for converting dataset type.\n\n\"\"\"\nimport numpy as np\nimport torch\nimport tensorflow as tf\n\nfrom ai_dataset.types.keras import KerasData\nfrom ai_dataset.types.torchvision import TorchData\n\n\ndef torch2keras(... | [
[
"numpy.swapaxes",
"torch.tensor",
"numpy.zeros",
"tensorflow.where"
]
] |
Hunteerq/GeneticAlgorithms | [
"267512e21a5c6ca1d0ffcd7162ea4bd6c8ca58ed"
] | [
"libs/generator/population_generator.py"
] | [
"import numpy as np\n\n\nclass PopulationGenerator:\n\n def __init__(self, algorithm_configuration):\n self.__algorithm_configuration = algorithm_configuration\n\n def generate_population(self):\n return np.random.uniform(low=self.__algorithm_configuration.left_range_number,\n ... | [
[
"numpy.random.uniform"
]
] |
grayy921013/RecSys | [
"ce0683b86755935c943722cbba5541931978498e"
] | [
"Algorithms/CB/CBAlgorithm.py"
] | [
"\"\"\"\n Content Based Algorithms Base Class\n===================================================\n\nAll CBAlgorithms should inherit from this class and included the methods here defined\n\n\"\"\"\n\n# Author: Caleb De La Cruz P. <delacruzp>\n\n\nimport logging\nfrom time import time\nimport numpy as np\nimpor... | [
[
"numpy.array",
"numpy.argmax",
"numpy.argpartition"
]
] |
Lyli724/Book_Introduce_Deep-Learning | [
"b24ecc76548794c7e4afaf01142a7e68764744d1",
"b24ecc76548794c7e4afaf01142a7e68764744d1",
"b24ecc76548794c7e4afaf01142a7e68764744d1"
] | [
"ch03/softmax_function.py",
"ch01/Matplotlib_imshow.py",
"ch04/Two_Layer_Net.py"
] | [
"# ่พๅบ็ฅ็ปๅ
็ๆฟๆดปๅฝๆฐ๏ผๅ็ฑป้ฎ้ขๅธธ็จsoftmax๏ผ softmax = exp(Ak) / for i in range(1, n + 1) sum(Ai)\n# softmax็ๅๅญๆฏ่พๅ
ฅไฟกๅทAk็ๆๆฐๅฝๆฐ๏ผๅๆฏๆฏๆๆ่พๅ
ฅไฟกๅท็ๆๆฐๅฝๆฐๅ\nimport numpy as np\n'''\nsoftmax funciton:\nsoftmax็่พๅบ่ๅด้ฝๅจ0.0~1.0ไน้ด็ๅฎๆฐ\nsoftmax็่พๅบๆปๅไธบ1๏ผ ๅ ไธบๆ่ฟไธช็ผๆ
๏ผๆไปฌๅฏไปฅๆsoftmax็่พๅบ่งฃ้ไธบๆฆ็\n'''\n# way 1: normalize:\ndef softmax_normal(a):\n exp_a = np.exp(a)\n... | [
[
"numpy.max",
"numpy.sum",
"numpy.exp"
],
[
"matplotlib.pyplot.show",
"matplotlib.image.imread",
"matplotlib.pyplot.imshow"
],
[
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.random.randn",
"numpy.argmax"
]
] |
velasale/PickApp | [
"2a6b025de217a6f350bd4e83a9bf120d7a2bae56"
] | [
"src/pickapp_data.py"
] | [
"# @Time : 4/7/2022 11:15 AM\n# @Author : Alejandro Velasquez\n\"\"\"\nThis script performs the data post-processing, before feeding it into any machine learning algorithm\n\"\"\"\n\nimport os\nimport numpy as np\nfrom numpy import genfromtxt\nimport math\nimport statistics as st\nimport matplotlib.pyplot as plt\nf... | [
[
"numpy.random.normal",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.boxplot",
"pandas.concat",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
kotoyo/nuFATE | [
"349338fdbb99edd5e0075038e65bb4da870ab8b4"
] | [
"src/python/earth.py"
] | [
"\"\"\" Funcitons to evaluate the Earth density.\n\"\"\"\nimport numpy as np\nimport scipy.integrate as integrate\n\nREarth = 6371. # Earth radius in km.\n\ndef rho_earth(theta, x, d = 0):\n \"\"\" Returns the Earth density in gr/cm^3.\n\n Args:\n theta: zenith angle in radians.\n x: position a... | [
[
"numpy.cos"
]
] |
wahid18benz/selective_search | [
"e928ecbb8e6f64adca3fb00d9b283c4720fb227b"
] | [
"selective_search/structure.py"
] | [
"import numpy as np\nfrom skimage.segmentation import find_boundaries\nfrom scipy.ndimage import find_objects\nfrom . import measure\n\n\nclass HierarchicalGrouping(object):\n def __init__(self, img, img_seg, sim_strategy):\n self.img = img\n self.sim_strategy = sim_strategy\n self.img_seg =... | [
[
"scipy.ndimage.find_objects",
"numpy.unique"
]
] |
mikeseven/aimet | [
"63211a4f259b6457c58dfae1097c70acb93319fe"
] | [
"TrainingExtensions/tensorflow/test/python/test_module_identifier.py"
] | [
"# /usr/bin/env python3.5\n# -*- mode: python -*-\n# =============================================================================\n# @@-COPYRIGHT-START-@@\n#\n# Copyright (c) 2020, Qualcomm Innovation Center, Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# ... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.get_default_graph",
"tensorflow.logging.set_verbosity",
"tensorflow.compat.v1.reset_default_graph"
]
] |
banksempire/FDM | [
"f443a73056490cff937fd547d776f01117771b41"
] | [
"fdm/datasources/tushare/model.py"
] | [
"from time import sleep\nfrom datetime import timedelta\nfrom datetime import datetime\n\nimport pandas as pd\nfrom pandas import DataFrame\n\n\nfrom fdm.datasources.metaclass import (_CollectionBase,\n _DbBase,\n _DynCollectionBase)\nfrom ... | [
[
"pandas.DataFrame"
]
] |
shashankpr/DeepSleep | [
"ea33778f74be1314b1be8f34a101294e8395808d"
] | [
"deepsleep/data_generator.py"
] | [
"import os\nimport logging\nimport numpy as np\n\nfrom keras.preprocessing import sequence\n\nfrom utils import threadsafe_generator\nfrom preprocess import PreProcessData\n\nseed = 42\nnp.random.seed(seed)\n\nclass HeartSequenceGenerator(object):\n\n def __init__(self, seq_len, batch_size, n_classes, is_pretrai... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"numpy.load",
"numpy.random.shuffle",
"numpy.vstack",
"numpy.expand_dims"
]
] |
sukumar1612/GraphTheoryPaper_DiseaseSim | [
"fafea0306a2179f0cc7d5c9b1a9bc6a81262f7f3"
] | [
"GraphTheoryPaper.py"
] | [
"'''\nModelling and analysis of COVID-19 in India using Graph Theory\nProject by : Arvind, Nishanth, Srivatsan, Sukumar, Thyagarajan\n'''\n\nimport random\nimport secrets\n\nimport matplotlib.pyplot as plt\n\n'''\nGlossary:\n\nVertex of graph - \n\n'trunc_gauss' - Normal distribution for a fixed range from bott... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
mOmUcf/DeepCTR | [
"c8b4630e1278dbcd0876bee2e6519b765a85bc88"
] | [
"deepctr/models/dsin.py"
] | [
"# coding: utf-8\n\"\"\"\nAuthor:\n Weichen Shen,wcshen1994@163.com\n\nReference:\n [1] Feng Y, Lv F, Shen W, et al. Deep Session Interest Network for Click-Through Rate Prediction[J]. arXiv preprint arXiv:1905.06482, 2019.(https://arxiv.org/abs/1905.06482)\n\n\"\"\"\n\nfrom collections import OrderedDict\n\n... | [
[
"tensorflow.python.keras.layers.Concatenate",
"tensorflow.python.keras.layers.Input",
"tensorflow.python.keras.initializers.RandomNormal",
"tensorflow.python.keras.layers.Flatten",
"tensorflow.python.keras.regularizers.l2",
"tensorflow.python.keras.layers.Dense",
"tensorflow.python.ker... |
chaoxu0512/Pushbroom-satellite-image-SRGAN | [
"519754b20e94dfdf2fbdb075cd930e278a39807c"
] | [
"srgan-g1d1-with-lr-decay/train.py"
] | [
"# import ipdb\nimport argparse\nimport os\nimport numpy as np\nimport math\nimport itertools\nimport sys\nimport time\nimport datetime\nimport glob\nimport random\nimport cv2\n\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom torch.autograd import Variable\nfrom torch.utils.data ... | [
[
"torch.cat",
"torch.stack",
"torch.nn.MSELoss",
"pandas.DataFrame",
"torch.no_grad",
"torch.nn.functional.interpolate",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.nn.L1Loss",
"torch.cuda.is_available",
"torch.load",
"torch.ones_like",
"torch.nn.DataParallel"
]... |
stubbi/Cirq | [
"680f897345eb1c71c9242515edda8f04b8594319"
] | [
"examples/bell_inequality.py"
] | [
"\"\"\"\nBell's theorem or inequality proves that entanglement based\nobservations can't be reproduced with any local realist theory [1].\n\nThis example shows Bell's inequality in form of CHSH game where two\nplayers Alice and Bob receive an input bit x and y respectively and\nproduce an output a and b based on th... | [
[
"numpy.array"
]
] |
yougoforward/PyTorch-Encoding | [
"4059cc4055cb81ad655099514455bc07e7535adb"
] | [
"encoding/functions/dist_syncbn.py"
] | [
"##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Hang Zhang\n## Email: zhanghang0704@gmail.com\n## Copyright (c) 2020\n##\n## LICENSE file in the root directory of this source tree\n##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nimport torc... | [
[
"torch.Tensor",
"torch.distributed.all_reduce",
"torch.cuda.device_count"
]
] |
77ph/tgnews | [
"e11ff65f2e8c3fce8978fd38b74bd0e2461583e7"
] | [
"df_news.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 23 12:53:29 2019\n\n@author: innerm\n\n\nsudo apt update && sudo apt -y upgrade\nsudo apt install mariadb-server\nsudo systemctl status mysql\nsudo mysqladmin -u root version\n\nsudo mysql -u root\nMariaDB [(none)]> CREATE USER 'tgnews'@'l... | [
[
"pandas.DataFrame",
"pandas.read_sql_query",
"pandas.read_sql_table",
"pandas.Series"
]
] |
larc/SPFN | [
"1c8cc1eb6de38adce0251bfbddfa09a77a8cc159"
] | [
"spfn/lib/network.py"
] | [
"import os, sys\nBASE_DIR = os.path.dirname(__file__)\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_DIR, '..'))\n\nimport architecture\nimport evaluation\nimport fitter_factory\nimport prediction_io\n\nimport time\nimport numpy as np\nimport tensorflow.compat.v1 as tf\nimport re\nimport subprocess\n... | [
[
"tensorflow.compat.v1.zeros",
"tensorflow.compat.v1.Graph",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.ones",
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.logical_and",
"tensorflow.compat.v1.is_finite",
"numpy.ex... |
imenbenmhd/MiniProject | [
"046f288c0553454a8696128001f4be7ff2c57d39"
] | [
"tgibm/algorithm.py"
] | [
"import numpy as np\nfrom . import database\nfrom . import preprocessor\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.tree import DecisionTreeRegressor\n\nnormalization = [\"MinMaxScaler_\", \"Standard_Scaler\", \"PolynomialFeaturesScaler\"]\n\n\ndef normalize(X, norm):\n \"\"\"\n chose a p... | [
[
"sklearn.linear_model.LinearRegression",
"sklearn.tree.DecisionTreeRegressor"
]
] |
kg16/ODETTE | [
"ee407f766a93b09abea9ab8713a890386496b9c4"
] | [
"event_dataset.py"
] | [
"import os\nimport random\nfrom collections import Counter\nimport numpy as np\nimport torch\nimport copy\nimport corenlp\nimport stanfordnlp\n\nclass EventReader:\n\n def __init__(self):\n pass\n\n def read_events(self, root_dir, files):\n '''\n :param root_dir: Directory containing .tsv... | [
[
"torch.cuda.LongTensor",
"torch.FloatTensor",
"torch.LongTensor",
"torch.cuda.FloatTensor"
]
] |
fakhraddinJ/BigData | [
"85e5bfaca9b5062c2a706d734cc9d79e483f707c"
] | [
"2_tweets1_2_3.py"
] | [
"\"\"\"\r\nCreated on Thu Dec 22 19:31:52 2016\r\n\r\n@author: Fakhraddin Jaf\r\n\"\"\"\r\n \r\n#%% \r\nimport collections #High-performance container datatypes\r\nimport pandas as pd\r\n#pandas is an open source, BSD-licensed library providing high-performance,\r\n#easy-to-use data structures and data analysis to... | [
[
"pandas.read_csv"
]
] |
bobbyscharmann/flypy | [
"39dce7decd9633e7d90bb4c77472c8c40aeda61c"
] | [
"examples/two_layer_nn.py"
] | [
"# Simple two layer neural network for playing with\n# Source: https://iamtrask.github.io/2015/07/12/basic-python-network/\nimport numpy as np\n\n# sigmoid function\ndef nonlin(x,deriv=False):\n if(deriv==True):\n return x*(1-x)\n return 1/(1+np.exp(-x))\n \n# input dataset\nX = np.array([ [0,0,1],... | [
[
"numpy.array",
"numpy.dot",
"numpy.random.seed",
"numpy.exp",
"numpy.random.random"
]
] |
mfkiwl/Strain_2D | [
"a204dcafb804efb3050510ae7cb970bf657a22ed"
] | [
"Strain_Tools/strain/utilities.py"
] | [
"# A set of utility functions used throughout the Strain_2D library\nimport numpy as np\n\n\ndef get_float_range(string_range):\n \"\"\"\n :param string_range: format \"-125/-121/32/35\"\n :type string_range: string\n :returns: list of floats\n :rtype: list\n \"\"\"\n number_strings = string_ra... | [
[
"numpy.round",
"numpy.array",
"numpy.arange",
"numpy.shape"
]
] |
Jh123x/Orbital | [
"6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9"
] | [
"gym_invaders/trainingDQN.py"
] | [
"#Python Modules\nimport os\n# Neural Network Modules\nimport torch\n#Gym Environment Dependencies\nimport gym\n\n# In house dependencies\nimport gym_game\nfrom ai_invader.agent import DQNAgent\nfrom ai_invader.model import DQNCNN\n\n'''\nExample of training script\n'''\n#Retrieve Training Environment\n# env = gym.... | [
[
"torch.cuda.is_available"
]
] |
nizamphoenix/kaggle | [
"a9c993d0441a6d9260d605a630f95d938e6329db"
] | [
"Jigsaw2020/read_data.py"
] | [
"import pandas as pd\n\ndef read_data():\n df_train = pd.read_csv(\"/kaggle/input/jigsaw-public-dataset-/train.csv\", usecols=[\"comment_text\", \"toxic\"])\n df_train = df_train.sample(frac=1).reset_index(drop=True)#shuffling\n df_valid = pd.read_csv('/kaggle/input/jigsaw-multilingual-toxic-comment-classi... | [
[
"pandas.read_csv"
]
] |
edazizovv/financial_news_re | [
"d7950da28d77ade29628f3b2fa266f5059527f52"
] | [
"just_chillin.py"
] | [
"#\nimport pytz\nimport pandas\nimport datetime\nfrom matplotlib import pyplot\n\n#\nfrom m_utils.transform import lag_it\nfrom mpydge.wrap.new_data import DataHandler, MaskHandler\nfrom mpydge.chaotic.the_new_pipe import SimplePipe\nfrom new_insane import Insane, Neakt\nfrom new_insane import XBR\nfrom new_insane ... | [
[
"pandas.read_csv",
"sklearn.feature_selection.mutual_info_regression"
]
] |
adrianurdar/100DaysOfCode-Bootcamp | [
"af6340a75979f15cb26687931c64aa8e072de242"
] | [
"Day-025/Squirrel-Census/main.py"
] | [
"import pandas\n\n# Read the file\ndata = pandas.read_csv(\"2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv\")\n\n# Count each fur color\ngray_squirrel_count = len(data[data[\"Primary Fur Color\"] == \"Gray\"])\ncinnamon_squirrel_count = len(data[data[\"Primary Fur Color\"] == \"Cinnamon\"])\nblack_squirrel_c... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
xarion/EPM | [
"3d375093f21d482cb504791b783af2a41f044cbb"
] | [
"features.py"
] | [
"import os\nfrom glob import glob\n\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom torch.utils.data import DataLoader, Dataset\nfrom torchvision import transforms as T\nfrom torchvision.transforms import Normalize\n\nfrom config import USE_CUDA, IMAGE_MEAN, IMAGE_STD\nfrom dataset import get_standar... | [
[
"torch.is_tensor",
"torch.utils.data.DataLoader"
]
] |
jmixon11/StockPredictionAlg | [
"30fc2b01a26b3d55265d59d83b546014d9cfdc25"
] | [
"ExampleMPC.py"
] | [
"from Tkinter import *\nfrom sklearn import tree\n\ndef click():\n\tentered_text=textentry.get()\n\toutput.delete(0.0, END)\n\tword1 = \"Close: \"\n\toutput.insert(END, word1)\n\tclose = clf1.predict([[entered_text]])\n\toutput.insert(END, close)\n\tword2 = \" High: \"\n\toutput.insert(END, word2)\n\thigh = clf2.... | [
[
"sklearn.tree.DecisionTreeClassifier"
]
] |
EmilioCC/gti770-student-framework | [
"3cd72da8fe78c7ecfc26c9e688cbe1b7deee353a"
] | [
"tests/commons/helpers/dataset/strategies/galaxy_dataset/test_galaxyDataSetLabelStrategy.py"
] | [
"from unittest import TestCase\n\nimport os\nimport numpy as np\n\nfrom commons.helpers.dataset.context import Context\nfrom commons.helpers.dataset.strategies.galaxy_dataset.label_strategy import GalaxyDataSetLabelStrategy\n\n\nclass TestGalaxyDataSetLabelStrategy(TestCase):\n\n def setUp(self):\n self.p... | [
[
"numpy.float32"
]
] |
Shubhranshu-Shekhar/pysindy | [
"e8a428da3dd13956a86b278094bdf2eb92eeeb7e"
] | [
"pysindy/optimizers/stlsq.py"
] | [
"import warnings\n\nimport numpy as np\nfrom sklearn.exceptions import ConvergenceWarning\nfrom sklearn.linear_model import ridge_regression\nfrom sklearn.utils.validation import check_is_fitted\n\nfrom pysindy.optimizers import BaseOptimizer\n\n\nclass STLSQ(BaseOptimizer):\n \"\"\"Sequentially thresholded leas... | [
[
"numpy.zeros_like",
"sklearn.utils.validation.check_is_fitted",
"numpy.count_nonzero",
"numpy.zeros",
"sklearn.linear_model.ridge_regression",
"numpy.sum",
"numpy.abs"
]
] |
Pseudomanifold/Skeleton_Persistence | [
"e93cc079548a4e7e95af7652157e29276cb280fe"
] | [
"analyse_matches.py"
] | [
"#!/usr/bin/env python3\n\nfrom collections import defaultdict\n\nimport math\nimport numpy\nimport os\nimport sys\n\nthreshold = 2.0\n\ndef distance( a,b,c,d ):\n return math.sqrt( (a-c)**2 + (b-d)**2 )\n\nfor filename in sys.argv[1:]:\n name = os.path.splitext( os.path.basename(filename) )[0]\n dist... | [
[
"numpy.median",
"numpy.mean"
]
] |
quangtm199/DeepFace | [
"aae47ca199ef1b33824d4c26ace3047ed02b35ae"
] | [
"deepface/commons/functions.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport cv2\nimport base64\nfrom pathlib import Path\nfrom PIL import Image\nimport requests\n\nfrom deepface.detectors import FaceDetector\n\nimport tensorflow as tf\ntf_version = tf.__version__\ntf_major_version = int(tf_version.split(\".\")[0])\ntf_minor_versio... | [
[
"numpy.pad",
"tensorflow.keras.preprocessing.image.img_to_array",
"numpy.expand_dims"
]
] |
matescharnitzky/deep-learning-from-scratch | [
"2b0bf568550bfb7ebca7fa7b434da19b6114c5cc"
] | [
"mate_scratch/joelnet/loss.py"
] | [
"\nfrom numpy import ndarray\nimport numpy as np\n\n\nclass Loss:\n def loss(self, prediction: ndarray, actual: ndarray) -> float:\n raise NotImplementedError\n\n def grad(self, prediction: ndarray, actual: ndarray) -> ndarray:\n raise NotImplementedError\n\n\nclass MSE(Loss):\n \"\"\"\n C... | [
[
"numpy.sum"
]
] |
DavidykZhao/mlflow | [
"c71bae2365177e57d7b50004c5b9964bd455bacc"
] | [
"mlflow/pyfunc/__init__.py"
] | [
"\"\"\"\nThe ``python_function`` model flavor serves as a default model interface for MLflow Python models.\nAny MLflow Python model is expected to be loadable as a ``python_function`` model.\n\nIn addition, the ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format\n<pyfunc-filesystem-format>` for Pyth... | [
[
"pandas.isnull",
"pandas.DataFrame"
]
] |
martingu11/endas | [
"e58be74e844efa14cbd86aba5e76dbc44fe690de"
] | [
"examples/lorenz95.py"
] | [
"\"\"\"\nData assimilation example on the Lorenz 95 dynamical system.\n\nTo run from console, use:\n\n cd examples\n python3 -i lorenz95.py\n\nThe ``-i`` switch is important if you are using regular Python- it enables the interactive mode on the interpreter and\nallows the figures that are generated at the en... | [
[
"matplotlib.use",
"numpy.add",
"numpy.zeros",
"numpy.random.seed",
"matplotlib.pyplot.grid",
"numpy.copy",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.figure",
"numpy.eye",
"numpy.mean",
... |
cagdemir/portfolio-performance-evaluation-module | [
"8a04363c699b05365c403293e80005bb18f50a34"
] | [
"perf_metrics_calculator.py"
] | [
"\nimport matplotlib.pyplot as plt\nplt.style.use('seaborn')\n#import matplotlib.patheffects as path_effects\nimport seaborn as sb\nimport numpy as np\nimport pandas as pd\nfrom tabulate import tabulate\n\n\n#measuring performance metrics quarterly, yearly, and overall\n\n#metrics 1. return - OK\n# ... | [
[
"matplotlib.pyplot.axvspan",
"numpy.ones_like",
"numpy.round",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"pandas.Grouper",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.fill_... |
FDR0903/mimicLOB | [
"0ef79a9a7129fa63a25423e29aba249594ec23b5"
] | [
"mimicLOB/orderbook/orderbook.py"
] | [
"import sys\nimport math\nfrom collections import deque # a faster insert/pop queue\nfrom six.moves import cStringIO as StringIO\nfrom decimal import Decimal\nimport numpy as np\nfrom .ordertree import OrderTree\nimport pandas as pd\nimport time\nfrom .orderlist import OrderList\nimport requests\n\n\nclass OrderBoo... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"pandas.concat"
]
] |
Impavidity/relogic | [
"f647106e143cd603b95b63e06ea530cdd516aefe"
] | [
"relogic/main.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport argparse\nimport json\nimport os\nimport random\nfrom types import SimpleNamespace\n\nimport numpy as np\n\nimport torch\nfrom relogic.logickit.base import utils\nfrom relogic.logickit.base.configure import configure, update_configure\nfrom... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed_all"
]
] |
kh11kim/spatialmath-python | [
"3e75e62da29d909d1a5d0ba5d4cdb97659397263"
] | [
"spatialmath/base/transforms2d.py"
] | [
"# Part of Spatial Math Toolbox for Python\n# Copyright (c) 2000 Peter Corke\n# MIT Licence, see details in top-level file: LICENCE\n\n\"\"\"\nThis modules contains functions to create and transform SO(2) and SE(2) matrices,\nrespectively 2D rotation matrices and homogeneous tranformation matrices.\n\nVector argume... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.block",
"numpy.linalg.det",
"numpy.mean",
"numpy.eye",
"numpy.identity",
"numpy.finfo",
"numpy.linalg.svd",
"numpy.abs",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
tobias-liaudat/ModOpt | [
"913ce6e06340ef03db925be2b1301181836c119d"
] | [
"modopt/base/transform.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"DATA TRANSFORM ROUTINES\n\nThis module contains methods for transforming data.\n\n:Author: Samuel Farrens <samuel.farrens@cea.fr>\n\n\"\"\"\n\nimport numpy as np\n\n\ndef cube2map(data_cube, layout):\n r\"\"\"Cube to Map\n\n This method transforms the input data from a 3D cub... | [
[
"numpy.array",
"numpy.zeros",
"numpy.prod",
"numpy.sqrt",
"numpy.repeat"
]
] |
NZ99/dm_mathematics_ita | [
"f3ed1bcce530f659d3abf233a91388b1ffd08a25"
] | [
"mathematics_dataset/modules/numbers.py"
] | [
"# Copyright 2018 DeepMind Technologies Limited.\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 appli... | [
[
"numpy.random.dirichlet"
]
] |
Letifery/income-analysis-USA | [
"2d2f7cdc5b4caecbbb7c3ae446f2102f2437b0d3"
] | [
"utils/model-alteration.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.model_selection import StratifiedKFold\r\nfrom sklearn.linear_model import Perceptron\r\nfrom sklearn.neighbors import KNeighborsClassifier\r\nfrom sklearn.svm import SVC\r\nfrom sklearn.tree import DecisionTreeClassifier\... | [
[
"sklearn.model_selection.StratifiedKFold",
"sklearn.naive_bayes.ComplementNB",
"matplotlib.pyplot.xlabel",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"sklearn.svm.SVC",
"sklearn.linear_model.Perceptron",
"matplotlib.pyplot.yl... |
AlonViz/IML.HUJI | [
"107f7c20b8bd64d41452e4a5b66abe843af7eb18"
] | [
"Tests/Ex1_Test.py"
] | [
"from scipy.stats import norm\nfrom IMLearn.learners.gaussian_estimators import UnivariateGaussian\nimport numpy as np\n\nsamples_ = np.random.normal(0, 2, 10)\nlgpdf_true = norm.logpdf(samples_, loc=0, scale=2)\ncalcpdf = lambda x: UnivariateGaussian.log_likelihood(0, 4, x)\ncalcpdfvec = np.vectorize(calcpdf)\nlgp... | [
[
"numpy.random.normal",
"scipy.stats.norm.logpdf",
"numpy.array_equal",
"numpy.vectorize",
"numpy.around"
]
] |
adamleon/kuka | [
"cac2880ff9bf1fb798029280a9baf51450195fc4"
] | [
"kuka_driver/src/kuka_driver/kuka_rsi_driver.py"
] | [
"#!/usr/bin/env python\n\n# Copyright (c) 2014, Norwegian University of Science and Technology\n# 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#\n# 1. Redistributions of source code must ... | [
[
"numpy.array"
]
] |
appendixisu/zi2zi | [
"7c78df630d4630de7b688bdfa77a829372bd1166"
] | [
"model/preprocessing_helper.py"
] | [
"import os\nimport pdb\n\nimport PIL\nimport numpy as np\nfrom PIL import Image, ImageFont\nfrom PIL import ImageDraw\n\nfrom model.utils import save_concat_images\n\nCANVAS_SIZE = 256\nCHAR_SIZE = 220\nEMBEDDING_DIM = 128\n\n\ndef _draw_single_char(font, ch, width, height):\n img = Image.new(\"L\", (width, heig... | [
[
"numpy.min"
]
] |
nagasudhirpulla/data_quality_stats_generator | [
"afe65c728dca41afb529e16140b46663e9bff9fd"
] | [
"index.py"
] | [
"# %%\nimport pandas as pd\nimport datetime as dt\nimport logging\nfrom dataFetcher import fetchPntHistData\nimport numpy as np\nfrom appUtils import addMonths\nimport argparse\nlogger = logging.getLogger(__name__)\n# %%\n# python index.py --file input/voltage_cs.xlsx --avg --max --min --sum --random\nparser = argp... | [
[
"pandas.DataFrame",
"pandas.read_excel",
"pandas.date_range",
"pandas.ExcelWriter"
]
] |
yfletberliac/MERL | [
"6eca6c3c9fa0fbd766a82ef9a85fa383b8f649c9"
] | [
"baselines_merl/ddpg/ddpg.py"
] | [
"import os\nimport time\nfrom collections import deque\nimport pickle\n\nfrom baselines_merl.ddpg.ddpg_learner import DDPG\nfrom baselines_merl.ddpg.models import Actor, Critic\nfrom baselines_merl.ddpg.memory import Memory\nfrom baselines_merl.ddpg.noise import AdaptiveParamNoiseSpec, NormalActionNoise, OrnsteinUh... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.std",
"numpy.isscalar",
"numpy.abs"
]
] |
ehtec/pie-chart-ocr | [
"ea36e29e9e585bd7a1779d7563578f190a6e0e65"
] | [
"piechartocr/color_processer_wrapper.py"
] | [
"from ctypes import cdll, c_double\n# from ctypes.util import find_library\nimport ctypes\n# from numpy.ctypeslib import as_ctypes, as_array, as_ctypes_type\nimport numpy as np\nfrom numpy.ctypeslib import ndpointer\nimport copy\nimport logging\nfrom .basefunctions import find_lib, get_root_path\nimport os\n\n\n# r... | [
[
"numpy.ascontiguousarray",
"numpy.prod",
"numpy.ctypeslib.ndpointer"
]
] |
mbarbetti/CaloChallenge | [
"d7b78f6b974cdc12bf4b0410a99ff4b0be1b4bde"
] | [
"code/XMLHandler.py"
] | [
"# pylint: disable=invalid-name\n\"\"\"\n Helperclass that reads the binning xml file\n\"\"\"\n\nimport math\nimport numpy as np\nimport xml.etree.ElementTree as ET\n\nclass XMLHandler:\n\n def __init__(self, particle_name, filename='binning.xml'):\n\n tree = ET.parse(filename)\n root = tree.get... | [
[
"numpy.sin",
"numpy.linspace",
"numpy.cos"
]
] |
tpoiii/dipole_tracer_ac6 | [
"d23287e72536d3aadf457362367a3d018551ca35"
] | [
"odc_util.py"
] | [
"\"\"\"\nApproximate translation of IRBEM-Lib open diffusion code (odc) utility library from Matlab\nContributors: Alexa Halford, Paul O'Brien\n\"\"\"\n\nimport numpy as np\n# global shared constants\n#SI/mks constants\nmks = {}\nmks['e']= 1.602176487e-19 # Coulombs per fundamental charge\nmks['c'] = 299792458 # m/... | [
[
"numpy.sin",
"numpy.log",
"numpy.arcsin",
"numpy.roots",
"numpy.interp",
"numpy.radians",
"numpy.isscalar",
"numpy.arange",
"numpy.sqrt",
"numpy.cos",
"numpy.abs"
]
] |
aaronwalsman/ltron | [
"ac82055687e74084a6e42da5c12725c523c5c63c"
] | [
"ltron/geometry/collision.py"
] | [
"import numpy\n\nfrom scipy.ndimage import binary_erosion\n\nfrom splendor.frame_buffer import FrameBufferWrapper\nfrom splendor.camera import orthographic_matrix\nfrom splendor.image import save_image, save_depth\nfrom splendor.masks import color_byte_to_index\n\nfrom ltron.geometry.utils import unscale_transform,... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.dot",
"numpy.linalg.norm",
"scipy.ndimage.binary_erosion",
"numpy.sum",
"numpy.min",
"numpy.where",
"numpy.any",
"numpy.linalg.inv"
]
] |
RohanAsnani/fingppmatch | [
"50d0d4ae51c29b0d3d4a449262397293665aa1a1"
] | [
"utils.py"
] | [
"import math\nimport numpy as np\nimport cv2 as cv\nimport urllib.request\nimport IPython\nimport base64\nimport html\n\n# Utility function to show an image\ndef show(*images, enlarge_small_images = True, max_per_row = -1, font_size = 0):\n if len(images) == 2 and type(images[1])==str:\n images = [(images[0],... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.sin",
"numpy.cos"
]
] |
gsoxley/OpenMDAO | [
"709401e535cf6933215abd942d4b4d49dbf61b2b"
] | [
"openmdao/core/tests/test_expl_comp.py"
] | [
"\"\"\"Simple example demonstrating how to implement an explicit component.\"\"\"\nfrom __future__ import division\n\nfrom six import assertRaisesRegex\n\nfrom six.moves import cStringIO\nimport unittest\n\nimport numpy as np\n\nfrom openmdao.api import Problem, ExplicitComponent, NewtonSolver, ScipyKrylov, Group, ... | [
[
"numpy.array",
"numpy.ones",
"numpy.arange",
"numpy.zeros"
]
] |
jamesaphoenix/VEX-MMM | [
"bb052c0a6b7a42f2cdc8568068f94db596ac481b"
] | [
"mmm/engineer.py"
] | [
"import statsmodels.tsa as tsa\nimport pandas as pd\nfrom typing import List, Tuple\n\nfrom .select import get_cols_containing\n\ndef add_constant(df:pd.DataFrame) -> None:\n df['constant'] = 1\n\ndef add_adstocks(df:pd.DataFrame, column_label:str, adstock_rates:List[float]=None) -> List:\n if adstock_rates i... | [
[
"pandas.to_datetime",
"pandas.merge",
"pandas.get_dummies"
]
] |
bryevdv/cunumeric | [
"7965ceb96d3252371c22cf32d38ac91c4db77a38"
] | [
"tests/universal_functions_tests/floor_divide_tests/operator_broadcast.py"
] | [
"# Copyright 2021-2022 NVIDIA Corporation\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 la... | [
[
"numpy.random.randn",
"numpy.array_equal"
]
] |
aleung12/manga | [
"5d2b4076592205b411ecc48881b00a512b468b86"
] | [
"simdisk.py"
] | [
"### last changed: 08/28/2018\n\nfrom astropy.io import fits\nimport numpy as np\nimport os, time, gc, sys, types\nfrom dirs import *\n\n\ndef mkdisk(pos_angle_deg,inclination_deg,ext,dim,V_sys=0.,V_max=220.,h_rot=10.,sigma_cen=250.):\n\n pos_angle = pos_angle_deg *np.pi/180\n inclination = inclination_deg ... | [
[
"numpy.sin",
"numpy.zeros",
"numpy.tan",
"numpy.exp",
"numpy.shape",
"numpy.tanh",
"numpy.arctan2",
"numpy.sqrt",
"numpy.cos"
]
] |
SaashaJoshi/quantum-computing | [
"53ce0f9a3ca1ecdf3184c97f356a8ee3925498aa"
] | [
"pennylane-xanadu/pytorch-ml.py"
] | [
"import torch\nfrom torch.autograd import Variable\n# import matplotlib.pyplot as plt\n\ntensor_data = torch.tensor([(0, 0), (0.1, 0.1), (0.2, 0.2)])\t# (data, label)\n\ndef function(phi, input_data = None):\n\treturn phi*input_data\t# Some Linear model/function.\n\ndef loss_function(output, label):\n\treturn torch... | [
[
"torch.abs",
"torch.optim.Adam",
"torch.tensor"
]
] |
khakhalin/mtg | [
"00a6707fb3d21aa29e6277050288d9ae36e130a0"
] | [
"bots/archived/danbot.py"
] | [
"from bot import Bot\nfrom csv import reader\nimport re\nfrom numpy import argsort\n\n\n\n# Because this bot works off of the draftsim ratings,\n# you need to pass it the filename for a set's rating csv\n\nclass DanBot(Bot):\n\n '''Class Constants'''\n PACK_SIZE = 15\n RATING_THRESHOLD = 2.0\n COLOR_COM... | [
[
"numpy.argsort"
]
] |
SDomarecki/Specusticc | [
"c2c2c487cce1e55f7ce6c149bc798a47a967c97c"
] | [
"specusticc/model_creating/models/transformer_classes/multi_head_attention.py"
] | [
"import tensorflow as tf\n\n\n# source: https://www.tensorflow.org/tutorials/text/transformer#multi-head_attention\nclass MultiHeadAttention(tf.keras.layers.Layer):\n def __init__(self, d_model, num_heads):\n super(MultiHeadAttention, self).__init__()\n self.num_heads = num_heads\n self.d_mo... | [
[
"tensorflow.shape",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.math.sqrt",
"tensorflow.nn.softmax"
]
] |
jscarlson/EasyOCR | [
"69010985a582c7eebf8dfd8db812371e77a26755"
] | [
"trainer/tk1957_split.py"
] | [
"from numpy import save\nimport pandas as pd\nimport os\nfrom glob import glob\nimport numpy as np\nfrom shutil import copy\nimport json\n\n\nif __name__ == \"__main__\":\n\n save_dir = \"./easyocr_data\"\n os.makedirs(save_dir, exist_ok=True)\n train_dir = os.path.join(save_dir, \"tk1957_train\")\n val... | [
[
"pandas.DataFrame"
]
] |
trianglecity/theano-develop-docker | [
"ece376fd7819ffe840871cc6ab8ee7c06c4984fb"
] | [
"theano/gpuarray/type.py"
] | [
"from __future__ import absolute_import, print_function, division\nimport numpy\nimport six.moves.copyreg as copyreg\nfrom six import iteritems\nimport warnings\n\nimport theano\nfrom theano.tensor.type import TensorType\nfrom theano.tensor.var import _tensor_py_operators\nfrom theano import Type, Variable, Constan... | [
[
"numpy.isnan",
"numpy.asarray",
"numpy.prod",
"numpy.all",
"numpy.get_include",
"numpy.dtype"
]
] |
SunYH66/adn-master | [
"d69a73e2f9cf2a4472c1d97f7347677b1947543a"
] | [
"adn/utils/log.py"
] | [
"import os\nimport os.path as path\nimport csv\nimport numpy as np\nimport SimpleITK as sitk\nimport yaml\nfrom PIL import Image\nfrom tqdm import tqdm\nfrom collections import defaultdict, OrderedDict\n\n\nclass Logger(object):\n def __init__(self, log_dir, epoch=0, name=\"log\"):\n self.log_dir = log_di... | [
[
"numpy.format_float_scientific",
"numpy.mean"
]
] |
ToughBishop/censor-fix | [
"fada22628470eb3bbde65009cedf777df929b6e8"
] | [
"censorfix/test_censor.py"
] | [
"import numpy as np\nimport pandas as pd\nimport joblib\nfrom censorfix import censorfix\n\n\ndef create_data():\n \"\"\"\n Returns two dataframes a copy of each other\n \"\"\"\n c = 0.5\n n = 3\n cov = c + np.identity(n) * (1 - c)\n size = 100\n full_data = np.random.multivariate_normal(\n ... | [
[
"numpy.identity",
"pandas.DataFrame"
]
] |
andyfaff/lmfit-py | [
"088f81d9f22de026b685382903a9f5ac45cbc1df"
] | [
"examples/doc_nistgauss.py"
] | [
"#!/usr/bin/env python\n#<examples/doc_nistgauss.py>\nimport numpy as np\nfrom lmfit.models import GaussianModel, ExponentialModel\nimport sys\nimport matplotlib.pyplot as plt\n\ndat = np.loadtxt('NIST_Gauss2.dat')\nx = dat[:, 1]\ny = dat[:, 0]\n\nexp_mod = ExponentialModel(prefix='exp_')\npars = exp_mod.guess(y, x... | [
[
"matplotlib.pyplot.show",
"numpy.loadtxt",
"matplotlib.pyplot.plot"
]
] |
DuranAdrian/SpendingVisualization | [
"a1a1111e0fb19726f583b07772a57758dde4aacb"
] | [
"pie_chart.py"
] | [
"from math import pi\r\nimport pandas\r\nimport json\r\nfrom bokeh.io import output_file, show\r\nfrom bokeh.palettes import Category20c\r\nfrom bokeh.plotting import figure\r\nfrom bokeh.transform import cumsum\r\n\r\n# TODO: Use Tinker as GUI to view current category json data and generate pie chart\r\n\r\n# If n... | [
[
"pandas.read_csv",
"pandas.Series"
]
] |
alpha358/keras-retinanet | [
"a6ba70cf07c2b5e84338b39833bab75cde526dc6"
] | [
"keras_retinanet/bin/train.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless ... | [
[
"tensorflow.ConfigProto",
"tensorflow.Session",
"tensorflow.device"
]
] |
ChrisKeefe/q2-diversity | [
"97e9cc466244edf94425de0e9f3d93c00d4dcac2"
] | [
"q2_diversity/tests/test_beta.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2016-2020, QIIME 2 development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array",
"pandas.Index"
]
] |
eugtsa/led_wabbit | [
"04c56b438518d65a385788fa9a118adbe74a1771"
] | [
"examples/example_simple_sklearn_logreg.py"
] | [
"from sklearn.model_selection import train_test_split\nfrom sklearn.metrics import log_loss\nfrom sklearn.utils import shuffle\nfrom itertools import chain\nimport numpy as np\nimport random\n\nfrom led_wabbit.models import LogisticRegressionBinary\n\nif __name__ == '__main__':\n X1 = [[0, 1, random.random()*3] ... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.metrics.log_loss",
"sklearn.utils.shuffle"
]
] |
wkvanderveen/object_segmenter | [
"b63f61123919ba36632cf99bd78949387e6338fc"
] | [
"hparam_optimizer.py"
] | [
"\"\"\"Helper file for automatic hyperparameter grid search.\n This file should not be modified -- for changing variables, go to\n parameters.py.\n Copyright 2018 Werner van der Veen\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with... | [
[
"pandas.read_csv"
]
] |
VaeterchenFrost/ComputationalPhysics2016 | [
"3a673ee0eca720a3dd9ab5acdd5e1126cb45b9c3"
] | [
"6_1_martin_roebke.py"
] | [
"\"\"\"Computational Physics Aufgabe 6.1, Autor: Martin Roebke 05.06.16\n Quantenmechanik von 1D-Potentialen II - Zeitentwicklung\n\nBerechnet und zeichnet die Zeitentwicklung eines Gauss'schen Wellen-\npaketes in einer Doppelmulde mit Hilfe des Moduls quantenmechanik.py .\nPer Mausklick wird ein spezifiziertes... | [
[
"numpy.array",
"numpy.dot",
"matplotlib.pyplot.setp",
"numpy.linalg.norm",
"matplotlib.pyplot.get_current_fig_manager",
"numpy.exp",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.pause",
"numpy.sqrt",
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
Jarvan-Wang/k2 | [
"7f164ecb804d15006fd30e8564d80e0fa212f011"
] | [
"k2/python/tests/dense_fsa_vec_test.py"
] | [
"#!/usr/bin/env python3\n#\n# Copyright (c) 2020 Mobvoi Inc. (authors: Fangjun Kuang)\n#\n# See ../../../LICENSE for clarification regarding multiple authors\n\n# To run this single test, use\n#\n# ctest --verbose -R dense_fsa_vec_test_py\n\nimport unittest\n\nimport k2\nimport torch\n\n\nclass TestDenseF... | [
[
"torch.device",
"torch.eq",
"torch.arange",
"torch.cuda.device_count",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.tensor",
"torch.allclose"
]
] |
JEHoctor/fairlearn | [
"9ffe6e1166db6159c181f8f0c925b1a9402856f7"
] | [
"fairlearn/_input_validation.py"
] | [
"# Copyright (c) Microsoft Corporation and Fairlearn contributors.\n# Licensed under the MIT License.\n\nimport logging\nimport numpy as np\nimport pandas as pd\nfrom sklearn.utils.validation import check_X_y, check_consistent_length, check_array\n\n\nlogger = logging.getLogger(__file__)\n\n_KW_SENSITIVE_FEATURES =... | [
[
"sklearn.utils.validation.check_X_y",
"pandas.DataFrame",
"sklearn.utils.validation.check_array",
"sklearn.utils.validation.check_consistent_length",
"pandas.Series",
"numpy.unique"
]
] |
quiltdata/quilt-renovate | [
"e57a0a35d0e819499a50e07785418c505dbb9055"
] | [
"api/python/tests/test_data_transfer.py"
] | [
"\"\"\" Testing for data_transfer.py \"\"\"\n\n### Python imports\nimport pathlib\n\nfrom unittest import mock\n\n### Third-party imports\nfrom botocore.stub import ANY\nimport pandas as pd\nimport pytest\n\n### Project imports\nfrom quilt3 import data_transfer\n\nfrom .utils import QuiltTestCase\n\n### Code\n\n# p... | [
[
"pandas.DataFrame.from_records"
]
] |
KurtJacobson/pydm | [
"5a5cbc6cdb218b77335a3c4ad57a4a49e060e20d"
] | [
"pydm/widgets/line_edit.py"
] | [
"import locale\nfrom functools import partial\nimport numpy as np\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom qtpy.QtWidgets import QLineEdit, QMenu, QApplication\nfrom qtpy.QtCore import Property, Q_ENUMS\nfrom .. import utilities\nfrom .base import PyDMWritableWidget, TextFormatter\nfrom .disp... | [
[
"numpy.array"
]
] |
liyuanpeng01/flare | [
"0acbe6ece1afc5fa06b78cbb7d62a6210d624c95"
] | [
"flare/examples/img_ac_example.py"
] | [
"import torch.nn as nn\nimport numpy as np\nfrom flare.algorithm_zoo.simple_algorithms import SimpleAC\nfrom flare.model_zoo.simple_models import SimpleModelAC\nfrom flare.framework.manager import Manager\nfrom flare.agent_zoo.simple_rl_agents import SimpleRLAgent\nfrom flare.framework.agent import OnlineHelper\nfr... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.Linear"
]
] |
FoleyLab/FoleyLab.github.io | [
"1f84e4dc2f87286dbd4e07e483ac1e48943cb493"
] | [
"assets/pib_wp.py"
] | [
"import numpy as np\nfrom matplotlib import pyplot as plt\nfrom matplotlib import animation\n\n\n\n\n# First set up the figure, the axis, and the plot element we want to animate\n#fig = plt.figure()\n#ax = plt.axes(xlim=(0, 500), ylim=(-0.03, 0.03))\n#line, = ax.plot([], [], lw=2)\n\n### Function that takes in a li... | [
[
"numpy.sin",
"matplotlib.animation.FuncAnimation",
"numpy.exp",
"numpy.real",
"matplotlib.pyplot.figure",
"numpy.conj",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.axes",
"numpy.imag"
]
] |
hepansls/simpletransformers | [
"abbb8d628f341ef47ee920e1d971510d607b1a90"
] | [
"simpletransformers/classification/classification_model.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n\nfrom __future__ import absolute_import, division, print_function\nimport collections\nimport logging\nimport math\nimport os\nimport random\nimport warnings\nfrom dataclasses import asdict\nfrom multiprocessing import cpu_count\nimport tempfile\nfrom pathlib import Path\... | [
[
"scipy.stats.mode",
"sklearn.metrics.confusion_matrix",
"torch.utils.data.RandomSampler",
"torch.cuda.amp.autocast",
"torch.cuda.is_available",
"sklearn.metrics.average_precision_score",
"torch.load",
"torch.nn.DataParallel",
"scipy.special.softmax",
"pandas.DataFrame",
... |
THUYimingLi/Semi-supervised_Robust_Training | [
"17a6d6fbb4ff3bc4951c1506981dbb6f87f1c26a"
] | [
"spatial_exps/mnist_eval.py"
] | [
"\"\"\"\nEvaluation of a given checkpoint in the standard and adversarial sense. Can be\ncalled as an infinite loop going through the checkpoints in the model directory\nas they appear and evaluating them. Accuracy and average loss are printed and\nadded as tensorboard summaries.\n\"\"\"\nfrom __future__ import ab... | [
[
"numpy.array",
"tensorflow.train.latest_checkpoint",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.Summary.Value",
"tensorflow.train.get_or_create_global_step",
"tensorflow.summary.FileWriter"
]
] |
Leyan529/InstanceSegmentation- | [
"1017bf40d28598aecb69b26a72b86dacbd113f2d"
] | [
"nets/resnet.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass Bottleneck(nn.Module):\n expansion = 4\n def __init__(self, inplanes, planes, stride=1, downsample=None, norm_layer=nn.BatchNorm2d):\n super().__init__()\n self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)\n self.bn1 = ... | [
[
"torch.nn.ModuleList",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.load"
]
] |
TranNhiem/solo-learn | [
"7539732b68d153087d09a26a23e1edfdc49bc086"
] | [
"solo/utils/io.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport json\nimport logging\nimport os\nimport pickle\nimport re\nimport time\nfrom urllib.parse import urlparse\n\nimport numpy as n... | [
[
"pandas.read_csv",
"numpy.load",
"numpy.save"
]
] |
e-koch/pyuvdata | [
"ac36067f195c75127b28f02479eda1eb7a3400ed"
] | [
"pyuvdata/uvbeam/cst_beam.py"
] | [
"# -*- mode: python; coding: utf-8 -*-\n# Copyright (c) 2018 Radio Astronomy Software Group\n# Licensed under the 2-clause BSD License\n\"\"\"Class for reading beam CST files.\"\"\"\nimport os\nimport re\nimport warnings\n\nimport numpy as np\n\nfrom .uvbeam import UVBeam\nfrom .. import utils as uvutils\n\n__all__... | [
[
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.min",
"numpy.exp",
"numpy.diff",
"numpy.radians",
"numpy.allclose",
"numpy.loadtxt",
"numpy.where",
"numpy.unique"
]
] |
hzy46/pytorch-cifar | [
"2fb4d53004ef19954b8cbf11697169ac556aa23b"
] | [
"DP.py"
] | [
"'''Train CIFAR10 with PyTorch.'''\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport argparse\n\nfrom models import *\nimport time\n\nparser ... | [
[
"torch.device",
"torch.save",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel"
]
] |
kylelo/pytorch3d | [
"818e161ec5394e3e6edad816a18287a08393e8c8"
] | [
"pytorch3d/renderer/cameras.py"
] | [
"# Copyright (c) Meta Platforms, Inc. and 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 math\nimport warnings\nfrom typing import List, Optional, Sequence, Tuple, Union\n\nimport nu... | [
[
"torch.zeros",
"torch.nn.functional.normalize",
"torch.cat",
"torch.cos",
"torch.stack",
"torch.tan",
"torch.sin",
"torch.is_tensor",
"torch.ones",
"torch.eye",
"torch.tensor",
"torch.cross",
"torch.where"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.