code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import matplotlib import matplotlib.pyplot as plt import numpy as np import numpy.testing as npt import pytest import freud matplotlib.use("agg") class TestGaussianDensity: def test_random_point_with_cell_list(self): fftpack = pytest.importorskip("scipy.fftpack") fft = fftpack.fft fftshi...
[ "numpy.prod", "numpy.random.rand", "freud.data.make_random_system", "matplotlib.use", "numpy.conj", "numpy.max", "freud.box.Box.cube", "matplotlib.pyplot.close", "numpy.sum", "pytest.importorskip", "pytest.raises", "numpy.array", "freud.density.GaussianDensity" ]
[((126, 147), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (140, 147), False, 'import matplotlib\n'), ((243, 279), 'pytest.importorskip', 'pytest.importorskip', (['"""scipy.fftpack"""'], {}), "('scipy.fftpack')\n", (262, 279), False, 'import pytest\n'), ((483, 545), 'freud.data.make_random_syst...
import numpy as np import os import warnings from Input import Input class InputFromData(Input): """ Used to draw random samples from a data file. """ def __init__(self, input_filename, delimiter=" ", skip_header=0, shuffle_data=True): """ :param input_filename: path ...
[ "numpy.copy", "os.path.isfile", "numpy.isnan", "warnings.warn", "numpy.genfromtxt", "numpy.random.shuffle" ]
[((975, 1050), 'numpy.genfromtxt', 'np.genfromtxt', (['input_filename'], {'delimiter': 'delimiter', 'skip_header': 'skip_header'}), '(input_filename, delimiter=delimiter, skip_header=skip_header)\n', (988, 1050), True, 'import numpy as np\n'), ((2896, 2911), 'numpy.copy', 'np.copy', (['sample'], {}), '(sample)\n', (290...
''' Created on Nov 29, 2020 @author: manik ''' import numpy as np import src.person_properties_util as idx class Movement(): """ Class providing abstraction into each movement of the population """ def update_persons(self, persons: np.ndarray, size: int, speed: float = 0.1, ...
[ "numpy.random.random", "numpy.clip", "numpy.random.normal" ]
[((1288, 1318), 'numpy.random.random', 'np.random.random', ([], {'size': '(size,)'}), '(size=(size,))\n', (1304, 1318), True, 'import numpy as np\n'), ((1643, 1689), 'numpy.random.normal', 'np.random.normal', ([], {'loc': '(0)', 'scale': '(1 / 3)', 'size': 'shp'}), '(loc=0, scale=1 / 3, size=shp)\n', (1659, 1689), True...
import numpy as np import sympy as sp from devitoboundary.symbolics.symbols import a, n, n_max def standard_stencil(deriv, space_order, offset=0., as_float=True): """ Generate a stencil expression with standard weightings. Offset can be applied to this stencil to evaluate at non-node positions. Param...
[ "sympy.Sum", "sympy.symbols", "numpy.array", "sympy.finite_diff_weights", "sympy.diff" ]
[((1516, 1536), 'sympy.symbols', 'sp.symbols', (['"""x_poly"""'], {}), "('x_poly')\n", (1526, 1536), True, 'import sympy as sp\n'), ((1554, 1595), 'sympy.Sum', 'sp.Sum', (['(a[n] * x_poly ** n)', '(n, 0, n_max)'], {}), '(a[n] * x_poly ** n, (n, 0, n_max))\n', (1560, 1595), True, 'import sympy as sp\n'), ((1026, 1065), ...
#!/usr/bin/env python # coding: utf-8 # In[11]: import pandas as pd import numpy as np import glob,os from glob import iglob #import scanpy as sc from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import RocCurveDisplay from sklearn.datasets import load_wine from skl...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "sklearn.model_selection.StratifiedKFold", "numpy.mean", "numpy.delete", "matplotlib.pyplot.xlabel", "pandas.DataFrame", "sklearn.model_selection.cross_val_score", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xticks", "matplotlib.pyplot.gca", "...
[((1084, 1152), 'pandas.read_csv', 'pd.read_csv', (['"""./combined_gene_for_machine_learning.csv"""'], {'index_col': '(1)'}), "('./combined_gene_for_machine_learning.csv', index_col=1)\n", (1095, 1152), True, 'import pandas as pd\n'), ((1161, 1204), 'numpy.append', 'np.append', (['features.index.values', '"""patient"""...
import os import cv2 import torch import numpy as np import torchvision from tqdm import tqdm device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") class Args: checkpoints_dir = '/path/to/checkpoints/dir' # FOR BDD dataroot = '/path/to/data/BDD100k/' segmentation_network_name = '...
[ "torchvision.models.segmentation.deeplabv3_resnet101", "os.path.exists", "numpy.where", "tqdm.tqdm", "os.path.join", "torch.cuda.is_available", "os.mkdir", "torch.utils.data.DataLoader" ]
[((1929, 2029), 'torchvision.models.segmentation.deeplabv3_resnet101', 'torchvision.models.segmentation.deeplabv3_resnet101', ([], {'pretrained': '(False)', 'num_classes': 'opt.n_classes'}), '(pretrained=False,\n num_classes=opt.n_classes)\n', (1980, 2029), False, 'import torchvision\n'), ((2527, 2547), 'tqdm.tqdm',...
from numpy.core.fromnumeric import take from gi.repository import Gtk, GLib, Gio from matplotlib.backends.backend_gtk3agg import ( FigureCanvasGTK3Agg as FigureCanvas) from matplotlib.figure import Figure import numpy as np import time import threading import serial # from pyfirmata import Arduino, util from steppe...
[ "gi.repository.Gtk.FileFilter", "stepper.StepperMotor", "sys.platform.startswith", "time.sleep", "numpy.array", "numpy.sin", "gi.repository.Gtk.Button.new_with_label", "numpy.arange", "gi.repository.GLib.idle_add", "gi.repository.Gtk.Paned.new", "gi.repository.Gtk.Label.new", "glob.glob", "g...
[((375, 407), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (393, 407), False, 'import gi\n'), ((750, 791), 'gi.repository.Gtk.Paned.new', 'Gtk.Paned.new', (['Gtk.Orientation.HORIZONTAL'], {}), '(Gtk.Orientation.HORIZONTAL)\n', (763, 791), False, 'from gi.repository i...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import io import time import numpy as np import scipy.io as sio from scipy import sparse as sp from scipy import spatial import cPickle as pkl import networkx as nx import rando...
[ "networkx.from_dict_of_lists", "scipy.spatial.distance.cosine", "cPickle.dump", "scipy.sparse.vstack", "numpy.sort", "scipy.sparse.triu", "numpy.floor", "numpy.array", "numpy.zeros", "numpy.vstack", "scipy.sparse.isspmatrix_coo", "cPickle.load" ]
[((1112, 1135), 'numpy.sort', 'np.sort', (['degrees_sorted'], {}), '(degrees_sorted)\n', (1119, 1135), True, 'import numpy as np\n'), ((2524, 2535), 'numpy.zeros', 'np.zeros', (['l'], {}), '(l)\n', (2532, 2535), True, 'import numpy as np\n'), ((2567, 2596), 'numpy.array', 'np.array', (['mask'], {'dtype': 'np.bool'}), '...
import unittest import sys import os.path from os.path import exists, join import json import functools import inspect from utils_for_tests import SimpleCase, WS_DIR try: import tensorflow TF_INSTALLED=True if tensorflow.__version__.startswith('2.'): TF_VERSION=2 else: TF_VERSION=1 exc...
[ "pandas.read_csv", "tensorflow.feature_column.indicator_column", "numpy.array", "tensorflow.keras.layers.Dense", "unittest.main", "tensorflow.cast", "os.path.exists", "tensorflow.keras.layers.DenseFeatures", "inspect.isgenerator", "tensorflow.stack", "dataworkspaces.kits.tensorflow.CheckpointCon...
[((224, 263), 'tensorflow.__version__.startswith', 'tensorflow.__version__.startswith', (['"""2."""'], {}), "('2.')\n", (257, 263), False, 'import tensorflow\n'), ((1370, 1437), 'unittest.skipUnless', 'unittest.skipUnless', (['TF_INSTALLED', '"""SKIP: Tensorflow not available"""'], {}), "(TF_INSTALLED, 'SKIP: Tensorflo...
import gensim from gensim.utils import simple_preprocess from gensim.parsing.preprocessing import STOPWORDS from nltk.stem import WordNetLemmatizer, SnowballStemmer from nltk.stem.porter import * import numpy as np np.random.seed(400) import nltk nltk.download('wordnet') import pandas as pd data = pd.read_csv('abcnew...
[ "gensim.corpora.Dictionary", "nltk.download", "pandas.read_csv", "gensim.models.LdaMulticore", "numpy.random.seed", "numpy.load", "gensim.models.TfidfModel" ]
[((215, 234), 'numpy.random.seed', 'np.random.seed', (['(400)'], {}), '(400)\n', (229, 234), True, 'import numpy as np\n'), ((247, 271), 'nltk.download', 'nltk.download', (['"""wordnet"""'], {}), "('wordnet')\n", (260, 271), False, 'import nltk\n'), ((301, 360), 'pandas.read_csv', 'pd.read_csv', (['"""abcnews-date-text...
#!/usr/bin/env python3 ##################################### # # Filename : test_Superimposer.py # # Projectname : diSTruct # # Author : <NAME> # # Creation Date : Fri 18 May 2018 06:28:53 PM CEST # # Last Modified : Fri 29 Mar 2019 04:12:22 PM CET # ##################################### import numpy as np from pytes...
[ "pytest.approx", "distruct.tools.pdb.get_contacts", "Bio.PDB.PDBParser", "distruct.Superimposer", "numpy.array", "Bio.SeqIO.parse", "Bio.PDB.Superimposer" ]
[((554, 663), 'numpy.array', 'np.array', (['[[51.65, -1.9, 50.07], [50.4, -1.23, 50.65], [50.68, -0.04, 51.54], [50.22,\n -0.02, 52.85]]', '"""f"""'], {}), "([[51.65, -1.9, 50.07], [50.4, -1.23, 50.65], [50.68, -0.04, 51.54],\n [50.22, -0.02, 52.85]], 'f')\n", (562, 663), True, 'import numpy as np\n'), ((698, 807...
import argparse import logging import os import numpy as np import torch.cuda import torch.nn as nn from torch.utils.data import DataLoader from torch.autograd import Variable import torch.backends.cudnn as cudnn cudnn.benchmark = True from utils.iam_loader import IAMLoader from config import * from m...
[ "logging.basicConfig", "logging.getLogger", "utils.iam_loader.IAMLoader", "torch.nn.functional.ctc_loss", "argparse.ArgumentParser", "numpy.concatenate", "torch.utils.data.DataLoader", "torch.nn.functional.log_softmax", "utils.auxilary_functions.affine_transformation", "valid_deforms.uncertainty_r...
[((519, 658), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[%(asctime)s, %(levelname)s, %(name)s] %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""', 'level': 'logging.INFO'}), "(format=\n '[%(asctime)s, %(levelname)s, %(name)s] %(message)s', datefmt=\n '%Y-%m-%d %H:%M:%S', level=logging.I...
#!/usr/bin/env python import functools import math import numpy import hypothesis import hypothesis.extra.numpy from hypothesis.strategies import complex_numbers, floats import libnu.array from test import eq arrays = functools.partial( hypothesis.extra.numpy.arrays, shape=10, unique=True, ) numpy.ones...
[ "numpy.mean", "numpy.ones", "test.eq", "hypothesis.strategies.floats", "math.log", "numpy.zeros", "functools.partial", "hypothesis.strategies.complex_numbers", "numpy.sin", "math.exp" ]
[((223, 294), 'functools.partial', 'functools.partial', (['hypothesis.extra.numpy.arrays'], {'shape': '(10)', 'unique': '(True)'}), '(hypothesis.extra.numpy.arrays, shape=10, unique=True)\n', (240, 294), False, 'import functools\n'), ((323, 373), 'functools.partial', 'functools.partial', (['numpy.ones'], {'dtype': 'num...
''' Spline2.py: wrapper for B. Thijsse et al.'s hyper-spline routines. Yet another spline interpolation routine. The problem: given a set of experimental data with noise, find the spline with the optimal number of knots. Solution: They use the usual kind of routines to determine least-squares splines from ...
[ "numpy.array", "numpy.shape", "numpy.asarray" ]
[((4296, 4310), 'numpy.asarray', 'num.asarray', (['x'], {}), '(x)\n', (4307, 4310), True, 'import numpy as num\n'), ((4338, 4352), 'numpy.asarray', 'num.asarray', (['y'], {}), '(y)\n', (4349, 4352), True, 'import numpy as num\n'), ((6280, 6292), 'numpy.shape', 'num.shape', (['x'], {}), '(x)\n', (6289, 6292), True, 'imp...
""" Copyright (C) 2012 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublice...
[ "numpy.dot", "numpy.zeros" ]
[((4026, 4051), 'numpy.zeros', 'np.zeros', (['self.numNeurons'], {}), '(self.numNeurons)\n', (4034, 4051), True, 'import numpy as np\n'), ((5043, 5068), 'numpy.zeros', 'np.zeros', (['self.numNeurons'], {}), '(self.numNeurons)\n', (5051, 5068), True, 'import numpy as np\n'), ((5183, 5213), 'numpy.dot', 'np.dot', (['w', ...
""" Computes the American option price using the deep optimal stopping (DOS). It is the implementation of the deep optimal stopping (DOS) introduced in (deep optimal stopping, Becker, Cheridito and Jentzen, 2020). """ import numpy as np import torch import torch.optim as optim import torch.utils.data as tdata from o...
[ "torch.manual_seed", "numpy.flip", "torch.nn.init.xavier_uniform_", "torch.mean", "torch.from_numpy", "numpy.zeros", "optimal_stopping.algorithms.utils.neural_networks.NetworkDOS", "torch.set_grad_enabled" ]
[((529, 550), 'torch.manual_seed', 'torch.manual_seed', (['(42)'], {}), '(42)\n', (546, 550), False, 'import torch\n'), ((592, 631), 'torch.nn.init.xavier_uniform_', 'torch.nn.init.xavier_uniform_', (['m.weight'], {}), '(m.weight)\n', (621, 631), False, 'import torch\n'), ((1496, 1525), 'numpy.flip', 'np.flip', (['stoc...
import numpy as np from typing import Sequence import pyrado from pyrado.utils.data_types import EnvSpec from pyrado.tasks.base import Task from pyrado.tasks.utils import never_succeeded from pyrado.tasks.reward_functions import RewFcn class EndlessFlippingTask(Task): """ Task class for flipping an object ar...
[ "pyrado.tasks.utils.never_succeeded", "numpy.array", "numpy.fmod", "numpy.min", "pyrado.TypeErr" ]
[((2969, 3069), 'numpy.array', 'np.array', (['[[self._last_angle + self.des_angle_delta], [self._last_angle - self.\n des_angle_delta]]'], {}), '([[self._last_angle + self.des_angle_delta], [self._last_angle -\n self.des_angle_delta]])\n', (2977, 3069), True, 'import numpy as np\n'), ((3166, 3195), 'numpy.fmod', ...
import os import sys import argparse import numpy as np from .validate_ic import validate_ic __all__ = ["validation_pipeline"] def validation_pipeline(cat_folder, visit_num, sne_SED_path): """ Parameters ---------- cat_folder is a string; the path to the directory containing the phosim_NNNNN.txt c...
[ "os.path.join", "numpy.isnan" ]
[((1163, 1211), 'os.path.join', 'os.path.join', (["os.environ['TWINKLES_DIR']", '"""data"""'], {}), "(os.environ['TWINKLES_DIR'], 'data')\n", (1175, 1211), False, 'import os\n'), ((1238, 1302), 'os.path.join', 'os.path.join', (['twinkles_data_dir', '"""cosmoDC2_v1.1.4_agn_cache.csv"""'], {}), "(twinkles_data_dir, 'cosm...
#################################################################### # Copyright (c) 2020 <NAME> # # # # This source code is licensed under the MIT license found in the # # LICENSE file in the root directory of this source tr...
[ "os.path.isfile", "numpy.array", "numpy.dot" ]
[((6030, 6073), 'numpy.array', 'numpy.array', (['list_points'], {'dtype': 'numpy.int32'}), '(list_points, dtype=numpy.int32)\n', (6041, 6073), False, 'import numpy, os\n'), ((6228, 6271), 'numpy.array', 'numpy.array', (['list_points'], {'dtype': 'numpy.int32'}), '(list_points, dtype=numpy.int32)\n', (6239, 6271), False...
import shapefile # import finoa import shapely # import matplotlib import numpy as np import matplotlib.pyplot as plt # import matplotlib.pyplot as plt # import pandas as pd from pyproj import Proj, transform # import stateplane __author__ = '<NAME>' def distPL(Point, lineseg): # input:Point(x,y);lineseg[(x,y)...
[ "numpy.sqrt", "shapefile.Writer", "matplotlib.pyplot.figure", "numpy.min", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((1512, 1528), 'numpy.min', 'np.min', (['distlist'], {}), '(distlist)\n', (1518, 1528), True, 'import numpy as np\n'), ((1563, 1615), 'numpy.sqrt', 'np.sqrt', (['((P1[0] - P2[0]) ** 2 + (P1[1] - P2[1]) ** 2)'], {}), '((P1[0] - P2[0]) ** 2 + (P1[1] - P2[1]) ** 2)\n', (1570, 1615), True, 'import numpy as np\n'), ((4507,...
#! /usr/bin/env python3 # Copyright(c) 2019 Intel Corporation. # License: MIT See LICENSE file in root directory. from argparse import ArgumentParser, SUPPRESS from openvino.inference_engine import IENetwork, IEPlugin, IECore import cv2 import logging as log import numpy as np import os import sys import time # Spec...
[ "logging.basicConfig", "cv2.rectangle", "openvino.inference_engine.IEPlugin", "cv2.flip", "argparse.ArgumentParser", "os.path.splitext", "logging.info", "numpy.argmax", "os.getcwd", "cv2.putText", "cv2.imshow", "cv2.waitKey", "cv2.destroyAllWindows", "cv2.VideoCapture", "time.time", "c...
[((529, 559), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (543, 559), False, 'from argparse import ArgumentParser, SUPPRESS\n'), ((1437, 1531), 'logging.basicConfig', 'log.basicConfig', ([], {'format': '"""[ %(levelname)s ] %(message)s"""', 'level': 'log.INFO', 'str...
""" dealing with sampling things """ import os import sys import copy import random import numpy as np import global_settings import update_settings as us import job_drivers def get_uniform_uncertainties(n_size=3, value=3.0, exclude=None): """ return uniform uncertainties """ result = np.ones(n_size)...
[ "random.uniform", "numpy.ones", "global_settings.get_s_a_setting", "os.path.join", "update_settings.update_s_a_setting", "os.path.isfile", "os.path.realpath", "job_drivers.make_run_timeout", "numpy.savetxt", "copy.deepcopy", "numpy.loadtxt", "os.remove" ]
[((305, 320), 'numpy.ones', 'np.ones', (['n_size'], {}), '(n_size)\n', (312, 320), True, 'import numpy as np\n'), ((891, 906), 'numpy.ones', 'np.ones', (['n_size'], {}), '(n_size)\n', (898, 906), True, 'import numpy as np\n'), ((1204, 1245), 'global_settings.get_s_a_setting', 'global_settings.get_s_a_setting', (['data_...
# -*- coding: utf-8 -*- """ Functions to evaluate a trained model Note: The file was more or less taken from Spotlight """ import numpy as np import scipy.stats as st FLOAT_MAX = np.finfo(np.float32).max def mrr_score(model, test, train=None): """ Compute mean reciprocal rank (MRR) scores. One score ...
[ "numpy.clip", "numpy.isscalar", "scipy.stats.rankdata", "numpy.random.choice", "numpy.array", "numpy.random.seed", "numpy.finfo" ]
[((184, 204), 'numpy.finfo', 'np.finfo', (['np.float32'], {}), '(np.float32)\n', (192, 204), True, 'import numpy as np\n'), ((1428, 1442), 'numpy.array', 'np.array', (['mrrs'], {}), '(mrrs)\n', (1436, 1442), True, 'import numpy as np\n'), ((2846, 2860), 'numpy.isscalar', 'np.isscalar', (['k'], {}), '(k)\n', (2857, 2860...
""" Contains unit tests for the functions in the package. Author: <NAME> Year: 2021 """ import time import numpy as np import pandas as pd from .classifier_comparisons import _rank_single_dataset # ----------------------------------------- # Main function # ----------------------------------------- def main(...
[ "numpy.array" ]
[((755, 791), 'numpy.array', 'np.array', (['[0.3, 0.1, 0.04, 0.6, 1.0]'], {}), '([0.3, 0.1, 0.04, 0.6, 1.0])\n', (763, 791), True, 'import numpy as np\n'), ((807, 832), 'numpy.array', 'np.array', (['[3, 2, 1, 4, 5]'], {}), '([3, 2, 1, 4, 5])\n', (815, 832), True, 'import numpy as np\n'), ((939, 974), 'numpy.array', 'np...
#!/usr/local/bin/python # coding=utf-8 import numpy as np import matplotlib.pylab as plt N = 10 # Generates 1D Laplace matrix using Dirichlet boundary conditions def generate_1D(N): L = np.zeros(shape=((N - 1), (N - 1))) for i in range(0, N - 1): # rows for j in range(0, N - 1): # columns ...
[ "matplotlib.pylab.subplots", "numpy.linalg.solve", "matplotlib.pylab.Figure", "numpy.linspace", "numpy.zeros", "matplotlib.pylab.show", "numpy.random.randn" ]
[((504, 526), 'numpy.random.randn', 'np.random.randn', (['(N - 1)'], {}), '(N - 1)\n', (519, 526), True, 'import numpy as np\n'), ((531, 552), 'numpy.linalg.solve', 'np.linalg.solve', (['L', 'b'], {}), '(L, b)\n', (546, 552), True, 'import numpy as np\n'), ((634, 662), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)...
# Copyright (C) 2021 poypoyan from setuptools import setup from Cython.Build import cythonize import numpy setup( name="edhsmm", version="0.1.2", description="An(other) implementation of Explicit Duration HMM/HSMM in Python 3", long_description=open("README.md", encoding="utf-8").read(), long_desc...
[ "numpy.get_include" ]
[((993, 1012), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (1010, 1012), False, 'import numpy\n')]
from __future__ import annotations from dataclasses import dataclass from typing import Sequence, Tuple, Optional, List, Dict, Any, Iterable import logging from pathlib import Path import os from concurrent.futures import ThreadPoolExecutor from requests import HTTPError from catpy.applications import CatmaidClientApp...
[ "logging.getLogger", "pandas.UInt64Dtype", "pathlib.Path", "concurrent.futures.ThreadPoolExecutor", "numpy.array", "pandas.concat", "catpy.applications.morphology.lol_to_df" ]
[((482, 509), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (499, 509), False, 'import logging\n'), ((1269, 1453), 'catpy.applications.morphology.lol_to_df', 'lol_to_df', (['response', "['connector_id', 'x', 'y', 'z', 'confidence', 'edit_time', 'user_id']", '[np.uint64, np.float64, np.fl...
"""Code used to create the examples in the overflow paper. This module contains the code used to create the examples in the paper at https://arxiv.org/pdf/2001.09611v1, referred to as the overflow paper. Execute this module as a script to reproduce the examples. The code has been tested using Python 3.5.2, NumPy ...
[ "numpy.flipud", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.floor", "overflow_algorithm.solve_overflow_traffic_equation", "create_overflow_networks.square_network_example", "numpy.zeros", "numpy.linspace", "matplotlib.pyplot.figure", "create_overflow_networks.w...
[((2160, 2171), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (2168, 2171), True, 'import numpy as np\n'), ((2264, 2292), 'numpy.linspace', 'np.linspace', (['(0)', '(1.0)', 'grid_nr'], {}), '(0, 1.0, grid_nr)\n', (2275, 2292), True, 'import numpy as np\n'), ((2314, 2342), 'numpy.linspace', 'np.linspace', (['(0)', '(...
import numpy as np import pytest from keras.utils.test_utils import layer_test from keras import layers from keras.models import Sequential @pytest.mark.parametrize( 'padding,stride,data_format', [(padding, stride, data_format) for padding in ['valid', 'same'] for stride in [1, 2] for data_for...
[ "keras.layers.Masking", "keras.layers.GlobalAveragePooling1D", "keras.utils.test_utils.layer_test", "keras.models.Sequential", "pytest.main", "pytest.mark.parametrize", "numpy.random.randint", "numpy.array_equal" ]
[((144, 348), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""padding,stride,data_format"""', "[(padding, stride, data_format) for padding in ['valid', 'same'] for stride in\n [1, 2] for data_format in ['channels_first', 'channels_last']]"], {}), "('padding,stride,data_format', [(padding, stride,\n da...
from dataclasses import astuple, dataclass import numpy as np import torch from copy import deepcopy class Binarizer: def __init__(self, binarization): self.bin = binarization def __call__(self, tens): if self.bin is None: return tens elif self.bin[0] == "neq": ...
[ "torch.FloatTensor", "numpy.array", "torch.tensor", "torch.nn.Parameter", "dataclasses.astuple", "copy.deepcopy", "torch.zeros" ]
[((4869, 4912), 'numpy.array', 'np.array', (['[[1, 1, 1], [1, 1, 1], [1, 1, 1]]'], {}), '([[1, 1, 1], [1, 1, 1], [1, 1, 1]])\n', (4877, 4912), True, 'import numpy as np\n'), ((5030, 5086), 'torch.nn.Parameter', 'torch.nn.Parameter', ([], {'data': 'kernel_var', 'requires_grad': '(False)'}), '(data=kernel_var, requires_g...
import torch import numpy as np from utils import get_2d_joints, get_all_32joints from utils.data import un_normalize_data, H36M_NAMES dim_to_use_2d = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 24, 25, 26, 27, 30, 31, 34, 35, 36, 37, 38, 39, 50, 51, 52, 53, 54, 55] dim_to_use_3d = [3, 4, 5, 6, ...
[ "torch.tensor", "utils.data.un_normalize_data", "numpy.load", "utils.get_2d_joints" ]
[((679, 708), 'numpy.load', 'np.load', (['"""models/mean_3d.npy"""'], {}), "('models/mean_3d.npy')\n", (686, 708), True, 'import numpy as np\n'), ((723, 751), 'numpy.load', 'np.load', (['"""models/std_3d.npy"""'], {}), "('models/std_3d.npy')\n", (730, 751), True, 'import numpy as np\n'), ((1636, 1708), 'utils.data.un_n...
#!/usr/bin/env python # -*- coding: utf-8 -*- import cv2, os, sys import numpy as np from abc import ABC, abstractmethod def extractImage(path): # error handller if the intended path is not found image = cv2.imread(path, cv2.IMREAD_GRAYSCALE); return image def checkImage(image): """ Args: ...
[ "cv2.countNonZero", "numpy.ones", "numpy.where", "cv2.erode", "cv2.imshow", "numpy.sum", "cv2.destroyAllWindows", "sys.exit", "cv2.dilate", "cv2.waitKey", "cv2.imread" ]
[((213, 251), 'cv2.imread', 'cv2.imread', (['path', 'cv2.IMREAD_GRAYSCALE'], {}), '(path, cv2.IMREAD_GRAYSCALE)\n', (223, 251), False, 'import cv2, os, sys\n'), ((3314, 3354), 'cv2.imshow', 'cv2.imshow', (['"""Displayed Image"""', 'new_image'], {}), "('Displayed Image', new_image)\n", (3324, 3354), False, 'import cv2, ...
import os, glob import subprocess from os import listdir from os.path import isfile, join import time import traceback import shutil import numpy as np import csv import time def checkForUpdate(count, lastUpdate): sn = os.environ['SERVERNUM'] hdfs = os.environ['HDFS'] updateCount = -1 print("UPDATE CHE...
[ "os.path.getsize", "numpy.genfromtxt", "os.walk", "os.path.join", "numpy.asarray", "time.sleep", "os.getcwd", "os.chdir", "subprocess.call", "numpy.savetxt", "csv.reader", "numpy.concatenate", "os.path.islink", "traceback.print_exc", "time.time", "glob.glob", "os.remove" ]
[((5282, 5293), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (5291, 5293), False, 'import os, glob\n'), ((5304, 5357), 'os.chdir', 'os.chdir', (["('/home/mydata/Worker' + sn + '_' + wn + '/')"], {}), "('/home/mydata/Worker' + sn + '_' + wn + '/')\n", (5312, 5357), False, 'import os, glob\n'), ((5359, 5377), 'glob.glob',...
import numpy as np import matplotlib.pyplot as plt from matplotlib.cm import get_cmap from pandas import DataFrame from scipy.interpolate import griddata import glob import os #Package Imports from .read import load_mol_abund,\ load_rates, get_reac_str, total_rates,\ load_radfield,\...
[ "numpy.log10", "numpy.hstack", "numpy.argsort", "numpy.array", "numpy.nanmean", "numpy.nanmin", "numpy.genfromtxt", "numpy.arange", "os.path.exists", "numpy.sort", "numpy.asarray", "numpy.exp", "numpy.vstack", "numpy.nanmax", "numpy.argmin", "pandas.DataFrame", "matplotlib.cm.get_cma...
[((926, 947), 'os.path.exists', 'os.path.exists', (['direc'], {}), '(direc)\n', (940, 947), False, 'import os\n'), ((3161, 3172), 'pandas.DataFrame', 'DataFrame', ([], {}), '()\n', (3170, 3172), False, 'from pandas import DataFrame\n'), ((3630, 3664), 'numpy.genfromtxt', 'np.genfromtxt', (['self.inp'], {'dtype': 'str'}...
import numpy as np import matplotlib.pyplot as plt x,y = np.linspace(0,5,100),np.linspace(0,2,100) X,Y = np.meshgrid(x,y) U = X V = Y*(1-Y) speed = np.sqrt(U*U + V*V) start = [[.3,.15], [0.3,1], [.3,1.5],[3,1.5]] fig0, ax0 = plt.subplots() strm = ax0.streamplot(x,y, U, V, color=(.75,.90,.93)) strmS = ax0.streamplot...
[ "numpy.sqrt", "numpy.linspace", "numpy.meshgrid", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((106, 123), 'numpy.meshgrid', 'np.meshgrid', (['x', 'y'], {}), '(x, y)\n', (117, 123), True, 'import numpy as np\n'), ((149, 171), 'numpy.sqrt', 'np.sqrt', (['(U * U + V * V)'], {}), '(U * U + V * V)\n', (156, 171), True, 'import numpy as np\n'), ((228, 242), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '(...
# !pip install datasets transformers[sentencepiece] # !apt install git-lfs # !git config --global user.email "<EMAIL>" # !git config --global user.name "<NAME>" import torch import seqeval import numpy as np from datasets import load_dataset from datasets import load_metric from transformers import AutoTokenizer from...
[ "torch.cuda.get_device_name", "datasets.load_metric", "transformers.TrainingArguments", "torch.cuda.device", "numpy.argmax", "torch.cuda.device_count", "transformers.AutoModelForTokenClassification.from_pretrained", "torch.cuda.is_available", "datasets.load_dataset", "transformers.AutoTokenizer.fr...
[((849, 874), 'datasets.load_dataset', 'load_dataset', (['"""conll2003"""'], {}), "('conll2003')\n", (861, 874), False, 'from datasets import load_dataset\n'), ((1141, 1188), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['model_checkpoint'], {}), '(model_checkpoint)\n', (1170, 1188), ...
from os.path import join import numpy as np import matplotlib as mpl # For headless environments mpl.use('Agg') # NOQA import matplotlib.pyplot as plt PLOT_CURVES = 'plot_curves' def plot_curves(run_path): """Plot the training and validation accuracy over epochs. # Arguments run_path: the path to t...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "os.path.join", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "numpy.genfromtxt", "matplotlib.pyplot.legend" ]
[((98, 112), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (105, 112), True, 'import matplotlib as mpl\n'), ((362, 387), 'os.path.join', 'join', (['run_path', '"""log.txt"""'], {}), "(run_path, 'log.txt')\n", (366, 387), False, 'from os.path import join\n'), ((399, 452), 'numpy.genfromtxt', 'np.genfrom...
import numpy as np from PIL import Image import skimage import skimage.transform import scipy.io as io import matplotlib.pyplot as plt import utils.common_utils as cu import scipy.io def load_data(path, f): img = np.array(Image.open(path)) img = skimage.transform.resize(img, (img.shape[0]//f,img.shape[1]//f), ...
[ "numpy.clip", "matplotlib.pyplot.imshow", "numpy.mean", "PIL.Image.open", "utils.common_utils.ts_to_np", "scipy.io.loadmat", "numpy.max", "matplotlib.pyplot.axis", "matplotlib.pyplot.title", "skimage.transform.resize", "matplotlib.pyplot.show" ]
[((255, 348), 'skimage.transform.resize', 'skimage.transform.resize', (['img', '(img.shape[0] // f, img.shape[1] // f)'], {'anti_aliasing': '(True)'}), '(img, (img.shape[0] // f, img.shape[1] // f),\n anti_aliasing=True)\n', (279, 348), False, 'import skimage\n'), ((353, 364), 'numpy.max', 'np.max', (['img'], {}), '...
""" Packing module ============== :synopsis: Prepares packed spheres for tessellation. .. moduleauthor:: <NAME> <<EMAIL>> .. moduleauthor:: <NAME> <<EMAIL>> """ from __future__ import division, print_function import struct import os import time import random import subprocess import numpy as np import p...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "scipy.stats.lognorm.rvs", "os.remove", "os.path.exists", "numpy.reshape", "subprocess.Popen", "matplotlib.pyplot.xlabel", "scipy.stats.lognorm.ppf", "numpy.linspace", "pandas.DataFrame", "matplotlib.pyplot.savef...
[((1045, 1075), 'numpy.zeros', 'np.zeros', (['(number_of_cells, 3)'], {}), '((number_of_cells, 3))\n', (1053, 1075), True, 'import numpy as np\n'), ((2548, 2594), 'pandas.DataFrame', 'pd.DataFrame', (['centers'], {'columns': "('x', 'y', 'z')"}), "(centers, columns=('x', 'y', 'z'))\n", (2560, 2594), True, 'import pandas...
import torch import torch.nn as nn import numpy as np import torch.distributions as TD import scipy import scipy.linalg from copy import deepcopy from multipledispatch import dispatch from collections import Iterable import sdepy from .em import batchItoEuler from .em_proxrec import torchBatchItoEulerProxrec class OU_...
[ "numpy.linalg.matrix_rank", "numpy.array", "multipledispatch.dispatch", "numpy.asarray", "numpy.exp", "numpy.dot", "torch.matmul", "scipy.linalg.schur", "numpy.diagonal", "numpy.eye", "numpy.allclose", "numpy.random.randn", "torch.stack", "numpy.diag", "torch.tensor", "numpy.linalg.inv...
[((7132, 7188), 'multipledispatch.dispatch', 'dispatch', (['np.ndarray', 'TD.Distribution', 'float', 'float', 'int'], {}), '(np.ndarray, TD.Distribution, float, float, int)\n', (7140, 7188), False, 'from multipledispatch import dispatch\n'), ((8496, 8557), 'multipledispatch.dispatch', 'dispatch', (['TD.Distribution', '...
# -*- coding: utf-8 -*- """ Created on Sat Oct 10 13:01:49 2020 @author: saksh """ import numpy as np np.random.seed(1337) import tensorflow as tf import pandas as pd from statsmodels.tsa.api import VAR from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.svm import SVR from s...
[ "numpy.abs", "statsmodels.tsa.api.VAR", "tensorflow.keras.callbacks.TensorBoard", "tensorflow.losses.MeanSquaredError", "numpy.hstack", "sklearn.model_selection.train_test_split", "tensorflow.optimizers.SGD", "tensorflow.metrics.RootMeanSquaredError", "tensorflow.keras.callbacks.EarlyStopping", "n...
[((110, 130), 'numpy.random.seed', 'np.random.seed', (['(1337)'], {}), '(1337)\n', (124, 130), True, 'import numpy as np\n'), ((564, 597), 'statsmodels.tsa.api.VAR', 'VAR', (['data_cache[[label1, label2]]'], {}), '(data_cache[[label1, label2]])\n', (567, 597), False, 'from statsmodels.tsa.api import VAR\n'), ((2768, 28...
import numpy as np from PIL import Image, ImageDraw, ImageFont import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms import torch.autograd as autograd from torch.autograd import Variable cuda = True if torch.cuda.is_available() else False Tensor = torch.cuda.Flo...
[ "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.nn.parallel.data_parallel", "torch.nn.Dropout", "torch.nn.Tanh", "torch.nn.LeakyReLU", "numpy.prod", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.Dropout2d", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.cuda.is_available", "torch...
[((260, 285), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (283, 285), False, 'import torch\n'), ((589, 675), 'torch.nn.Conv2d', 'nn.Conv2d', (['input_nc', 'ngf'], {'kernel_size': 'kernel_size', 'padding': 'padding', 'stride': 'stride'}), '(input_nc, ngf, kernel_size=kernel_size, padding=padd...
import numpy as np import cv2 import torch import torch.backends.cudnn as cudnn from numpy import random from utils.datasets import letterbox from models.experimental import attempt_load from utils.general import non_max_suppression, scale_coords from utils.torch_utils import select_device model = None device = None...
[ "models.experimental.attempt_load", "torch.from_numpy", "numpy.ascontiguousarray", "utils.general.non_max_suppression", "utils.general.scale_coords", "utils.datasets.letterbox", "torch.zeros" ]
[((432, 493), 'models.experimental.attempt_load', 'attempt_load', (['"""checkpoints/face/yolo.pt"""'], {'map_location': 'device'}), "('checkpoints/face/yolo.pt', map_location=device)\n", (444, 493), False, 'from models.experimental import attempt_load\n'), ((805, 830), 'numpy.ascontiguousarray', 'np.ascontiguousarray',...
import pandas as pd import numpy as np import os from collections import Counter from scipy.cluster.hierarchy import linkage, fcluster from scipy.spatial.distance import squareform def find_correlation_clusters(corr,corr_thresh): dissimilarity = 1.0 - corr hierarchy = linkage(squareform(dissimilarity), method...
[ "scipy.spatial.distance.squareform", "numpy.sqrt", "pandas.read_csv", "collections.Counter", "os.path.isfile", "pandas.DataFrame", "scipy.cluster.hierarchy.fcluster" ]
[((380, 434), 'scipy.cluster.hierarchy.fcluster', 'fcluster', (['hierarchy', 'diss_thresh'], {'criterion': '"""distance"""'}), "(hierarchy, diss_thresh, criterion='distance')\n", (388, 434), False, 'from scipy.cluster.hierarchy import linkage, fcluster\n'), ((519, 534), 'collections.Counter', 'Counter', (['labels'], {}...
import random from typing import Tuple import numpy as np from numpy.ma.core import where import numpy.ma as ma TOTALLAYERS = 2 # SNACKLAYER = 0 # HAZARDLAYER = 1 # RESULTLAYER = 2 # each snake layer represents the number of turns left until that location is no longer occupied by the snake # TOTALSNAKELAYERS = 2 # S...
[ "numpy.copy", "random.uniform", "numpy.add", "numpy.where", "numpy.absolute", "numpy.subtract", "numpy.bitwise_and", "numpy.zeros", "numpy.amax" ]
[((1681, 1736), 'numpy.zeros', 'np.zeros', (['(self.x, self.y, TOTALLAYERS)'], {'dtype': 'np.int32'}), '((self.x, self.y, TOTALLAYERS), dtype=np.int32)\n', (1689, 1736), True, 'import numpy as np\n'), ((2913, 2933), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (2927, 2933), False, 'import rando...
import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.lines as lines import matplotlib.text as text import matplotlib.patches as patches import argparse import sys from matplotlib.backends.backend_pdf import PdfPages from emma.processing.dsp import butter_filter from common import * d...
[ "matplotlib.patches.Rectangle", "argparse.ArgumentParser", "matplotlib.font_manager.FontProperties", "numpy.fft.fftfreq", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "matplotlib.backends.backend_pdf.PdfPages", "numpy.fft.fftshift", "numpy.lo...
[((4107, 4170), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Draw DES problem figure."""'}), "(description='Draw DES problem figure.')\n", (4130, 4170), False, 'import argparse\n'), ((698, 771), 'matplotlib.font_manager.FontProperties', 'matplotlib.font_manager.FontProperties', ([], {'...
from PIL import ImageDraw, Image import numpy as np import hashlib import random # array_list = [1] background_color = '#F2F1F2' colors = ['#CD00CD', 'Red', 'Orange', "#66FF00", "#2A52BE"] def generate_array(bytes): ## Generate array for i in range(100): # Array 6 * 12 need_array = np.arr...
[ "PIL.Image.new", "PIL.ImageDraw.Draw", "random.choice", "numpy.concatenate" ]
[((974, 1018), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'img_size', 'background_color'], {}), "('RGB', img_size, background_color)\n", (983, 1018), False, 'from PIL import ImageDraw, Image\n'), ((1030, 1049), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['img'], {}), '(img)\n', (1044, 1049), False, 'from PIL import Ima...
import numpy as np import scipy.signal __all__ = ['instant_parameters'] #----------------------------------- def instant_parameters(signal, fs = None): ''' Instant parameters estimation: ..math:: analitc_signal = hilbert(signal) envelope = |analitc_signal| phase = unwrap(angle(a...
[ "numpy.abs", "numpy.unwrap", "numpy.asarray", "numpy.diff", "numpy.angle" ]
[((867, 885), 'numpy.asarray', 'np.asarray', (['signal'], {}), '(signal)\n', (877, 885), True, 'import numpy as np\n'), ((1023, 1039), 'numpy.abs', 'np.abs', (['analytic'], {}), '(analytic)\n', (1029, 1039), True, 'import numpy as np\n'), ((1055, 1073), 'numpy.angle', 'np.angle', (['analytic'], {}), '(analytic)\n', (10...
#Start up torch dist package import torch import torch.distributed as dist dist.init_process_group(backend='mpi') #Load classes for simulations and controls from brownian_fts import BrownianParticle import numpy as np #Starting and ending configuration. start = torch.tensor([[-1.0]]) end = torch.tensor([[1.0]]) def i...
[ "numpy.mean", "numpy.random.choice", "numpy.std", "torch.tensor", "numpy.array", "torch.distributed.get_rank", "torch.distributed.init_process_group", "torch.distributed.get_world_size" ]
[((75, 113), 'torch.distributed.init_process_group', 'dist.init_process_group', ([], {'backend': '"""mpi"""'}), "(backend='mpi')\n", (98, 113), True, 'import torch.distributed as dist\n'), ((264, 286), 'torch.tensor', 'torch.tensor', (['[[-1.0]]'], {}), '([[-1.0]])\n', (276, 286), False, 'import torch\n'), ((293, 314),...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Imports import os import pickle import pandas as pd from warnings import simplefilter from model_funs import fasta_frame, ohe_fun, flatten_sequence import numpy as np from numpy import array from sklearn import preprocessing from sklearn.model_selection import train_tes...
[ "pandas.read_csv", "keras.utils.to_categorical", "tensorflow.keras.utils.plot_model", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.MaxPooling1D", "sklearn.preprocessing.LabelBinarizer", "tensorflow.compat.v1.random.set_random_seed", "numpy.random.seed", "warnings.simplefilter", "model...
[((679, 732), 'warnings.simplefilter', 'simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (691, 732), False, 'from warnings import simplefilter\n'), ((1030, 1071), 'tensorflow.compat.v1.random.set_random_seed', 'tf.compat.v1.random.set_random_se...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Program: Fit peaks with Lorentzian distribution Version: 20201123 @author: <NAME> (GitHub: @pranabdas) data = suv.fit_lorentz(x, y, a='', x0='', gamma='', xmin='', xmax='') """ def fit_lorentz(x, y, a='', x0='', gamma='', xmin='', xmax='', num=1000): import numpy ...
[ "scipy.optimize.curve_fit", "numpy.linspace" ]
[((1003, 1055), 'scipy.optimize.curve_fit', 'optimize.curve_fit', (['lorentz', 'x', 'y'], {'p0': '[a, x0, gamma]'}), '(lorentz, x, y, p0=[a, x0, gamma])\n', (1021, 1055), False, 'from scipy import optimize\n'), ((1179, 1207), 'numpy.linspace', 'np.linspace', (['xmin', 'xmax', 'num'], {}), '(xmin, xmax, num)\n', (1190, ...
from rdkit import Chem from smdt.descriptors import AtomProperty import numpy import pandas as pd def _CalculateGearyAutocorrelation(mol, lag=1, propertylabel='m'): """ **Internal used only** Calculation of Geary autocorrelation descriptors based on different property weights. """ ...
[ "rdkit.Chem.GetDistanceMatrix", "rdkit.Chem.MolFromSmiles", "pandas.DataFrame", "numpy.square" ]
[((655, 682), 'rdkit.Chem.GetDistanceMatrix', 'Chem.GetDistanceMatrix', (['mol'], {}), '(mol)\n', (677, 682), False, 'from rdkit import Chem\n'), ((3986, 4017), 'pandas.DataFrame', 'pd.DataFrame', (['geary_descriptors'], {}), '(geary_descriptors)\n', (3998, 4017), True, 'import pandas as pd\n'), ((582, 609), 'numpy.squ...
import os import random import numpy as np import argparse import logging import pickle from pprint import pformat from exps.data import get_modelnet40_data_fps from settree.set_data import SetDataset, OPERATIONS, flatten_datasets import exps.eval_utils as eval if __name__ == '__main__': parser = argparse.Argu...
[ "pickle.dump", "settree.set_data.SetDataset", "argparse.ArgumentParser", "exps.data.get_modelnet40_data_fps", "random.seed", "exps.eval_utils.create_logger", "numpy.random.seed", "os.path.abspath", "exps.eval_utils.train_and_predict_xgboost", "logging.info", "exps.eval_utils.train_and_predict_se...
[((307, 332), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (330, 332), False, 'import argparse\n'), ((681, 755), 'exps.eval_utils.create_logger', 'eval.create_logger', ([], {'log_dir': 'log_dir', 'log_name': 'args.exp_name', 'dump': 'args.log'}), '(log_dir=log_dir, log_name=args.exp_name, dum...
import numpy import h5py import scipy.sparse from pyscf import gto, scf, mcscf, fci, ao2mo, lib from pauxy.systems.generic import Generic from pauxy.utils.from_pyscf import generate_integrals from pauxy.utils.io import ( write_qmcpack_wfn, write_qmcpack_dense, write_input ) mol = gto.M(...
[ "numpy.abs", "pyscf.gto.M", "pyscf.fci.addons.large_ci", "numpy.array", "pyscf.mcscf.CASSCF", "pauxy.utils.io.write_qmcpack_wfn", "numpy.linalg.eigh", "pyscf.scf.RHF", "pauxy.utils.io.write_input" ]
[((314, 406), 'pyscf.gto.M', 'gto.M', ([], {'atom': "[('N', 0, 0, 0), ('N', (0, 0, 3.0))]", 'basis': '"""sto-3g"""', 'verbose': '(3)', 'unit': '"""Bohr"""'}), "(atom=[('N', 0, 0, 0), ('N', (0, 0, 3.0))], basis='sto-3g', verbose=3,\n unit='Bohr')\n", (319, 406), False, 'from pyscf import gto, scf, mcscf, fci, ao2mo, ...
import json import numpy as np from collections import OrderedDict from src.evaluation.summary_loader import load_processed_dataset import seaborn as sns import matplotlib.pyplot as plt import pandas as pd sns.set() sns.set_style("darkgrid") n_videos = 50 videos = {} n_splits = 5 x_axis = [] y_axis = [] df = pd.Da...
[ "pandas.Series", "seaborn.set", "numpy.arange", "seaborn.set_style", "json.load", "pandas.DataFrame", "seaborn.relplot", "matplotlib.pyplot.show" ]
[((208, 217), 'seaborn.set', 'sns.set', ([], {}), '()\n', (215, 217), True, 'import seaborn as sns\n'), ((218, 243), 'seaborn.set_style', 'sns.set_style', (['"""darkgrid"""'], {}), "('darkgrid')\n", (231, 243), True, 'import seaborn as sns\n'), ((315, 374), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['Videos...
#!/usr/bin/env python3 import argparse import random import json import logging import pandas as pd from scipy import stats import spacy import time from tqdm import tqdm, trange import torch import torch.nn.functional as F import numpy as np import os from pytorch_pretrained_bert import GPT2LMHeadModel, GPT2Tokeniz...
[ "logging.getLogger", "pytorch_pretrained_bert.GPT2LMHeadModel.from_pretrained", "torch.cuda.is_available", "pytorch_pretrained_bert.GPT2Tokenizer.from_pretrained", "torch.nn.functional.softmax", "torch.random.manual_seed", "os.path.exists", "argparse.ArgumentParser", "random.Random", "spacy.load",...
[((416, 559), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(name)s - %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt=\n '%m/%d/%Y %H:%M:%S', level=l...
import numpy as np from scipy.stats import entropy from scipy.spatial.distance import cosine def jsd(p1, p2) -> float: '''Returns the Jensen Shannon Divergence''' p1 = np.asarray(p1) p2 = np.asarray(p2) p1 /= p1.sum() p2 /= p2.sum() m = (p1 + p2) / 2 return (entropy(p1, m) + en...
[ "scipy.spatial.distance.cosine", "numpy.asarray", "numpy.unique", "scipy.stats.entropy" ]
[((185, 199), 'numpy.asarray', 'np.asarray', (['p1'], {}), '(p1)\n', (195, 199), True, 'import numpy as np\n'), ((210, 224), 'numpy.asarray', 'np.asarray', (['p2'], {}), '(p2)\n', (220, 224), True, 'import numpy as np\n'), ((431, 444), 'numpy.asarray', 'np.asarray', (['a'], {}), '(a)\n', (441, 444), True, 'import numpy...
""" Mesh class containing geometry information """ from pyrr import matrix44 import numpy class Mesh: """Mesh info and geometry""" def __init__(self, name, vao=None, material=None, attributes=None, bbox_min=None, bbox_max=None): """ :param name: Name of the mesh :param vao: VAO ...
[ "numpy.append", "numpy.asarray", "pyrr.matrix44.apply_to_vector" ]
[((2345, 2380), 'numpy.append', 'numpy.append', (['self.bbox_min[:]', '(1.0)'], {}), '(self.bbox_min[:], 1.0)\n', (2357, 2380), False, 'import numpy\n'), ((2395, 2430), 'numpy.append', 'numpy.append', (['self.bbox_max[:]', '(1.0)'], {}), '(self.bbox_max[:], 1.0)\n', (2407, 2430), False, 'import numpy\n'), ((2483, 2525)...
from sklearn import datasets, linear_model, preprocessing, decomposition, manifold, svm from sklearn.metrics import make_scorer, accuracy_score import numpy as np from sklearn.model_selection import cross_validate, cross_val_score, train_test_split import matplotlib.pyplot as plt import time ##########################...
[ "sklearn.preprocessing.LabelEncoder", "numpy.sqrt", "numpy.unique", "numpy.where", "sklearn.linear_model.LogisticRegression", "numpy.dot", "numpy.savetxt", "numpy.linalg.lstsq", "numpy.loadtxt", "time.time" ]
[((492, 620), 'numpy.loadtxt', 'np.loadtxt', (['"""/home/cristianopatricio/Documents/Datasets/Animals_with_Attributes2/Features/ResNet101/AwA2-features.txt"""'], {}), "(\n '/home/cristianopatricio/Documents/Datasets/Animals_with_Attributes2/Features/ResNet101/AwA2-features.txt'\n )\n", (502, 620), True, 'import n...
#Functions used for gibbs sampling # <NAME> #02 April 2019 import pandas as pd import numpy as np class gibbs: def gibbs_difference(y, ind, mu0 = 50, tau0 = 1/625, del0 = 0, gamma0 = 1/625, a0 = 0.5, b0 = 50, maxiter = 5000): y1 = y[ind == 1] y2 = y[ind == 2] n1 = len(y1) n2 = len...
[ "numpy.mean", "numpy.sqrt", "numpy.random.gamma", "pandas.DataFrame", "numpy.var" ]
[((457, 508), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['mu', 'del', 'tau', 'theta']"}), "(columns=['mu', 'del', 'tau', 'theta'])\n", (469, 508), True, 'import pandas as pd\n'), ((1639, 1653), 'numpy.mean', 'np.mean', (['theta'], {}), '(theta)\n', (1646, 1653), True, 'import numpy as np\n'), ((1904, 1972),...
from __future__ import division import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np import cv2 # Note origin is top-left corner of the image # Formula for bx,by,bh,w # bx=sigmoid(tx)+cx , by=sigmoid(ty)+cy # where tx,ty is prediction ...
[ "torch.sort", "torch.unique", "torch.max", "torch.sigmoid", "torch.clamp", "torch.min", "torch.exp", "torch.cat", "torch.nonzero", "numpy.meshgrid", "torch.from_numpy", "numpy.full", "cv2.resize", "torch.FloatTensor", "numpy.arange", "torch.true_divide" ]
[((887, 949), 'cv2.resize', 'cv2.resize', (['img', '(new_w, new_h)'], {'interpolation': 'cv2.INTER_CUBIC'}), '(img, (new_w, new_h), interpolation=cv2.INTER_CUBIC)\n', (897, 949), False, 'import cv2\n'), ((966, 1007), 'numpy.full', 'np.full', (['(inp_dim[1], inp_dim[0], 3)', '(128)'], {}), '((inp_dim[1], inp_dim[0], 3),...
import numpy as np from envs.EnvWrapper import EnvWrapper class LunarLanderWithNoise(EnvWrapper): def __init__(self, random_state): super(LunarLanderWithNoise, self).__init__("LunarLander-v2", random_state) self.state_sz = 256 def transform_obs(self, obs): return np.concatenate((obs, ...
[ "numpy.random.uniform" ]
[((320, 347), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(248)'}), '(size=248)\n', (337, 347), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 5/18/2019 1:38 PM # @Author : chinshin # @FileName: ggnn_preprocessor.py from __future__ import unicode_literals from collections import defaultdict import numpy as np from rdkit import Chem from chainer_chemistry.dataset.preprocessors.common \ i...
[ "chainer_chemistry.dataset.preprocessors.common.construct_discrete_edge_matrix", "chainer_chemistry.dataset.preprocessors.common.type_check_num_atoms", "numpy.array", "collections.defaultdict", "rdkit.Chem.GetAdjacencyMatrix" ]
[((2821, 2862), 'chainer_chemistry.dataset.preprocessors.common.type_check_num_atoms', 'type_check_num_atoms', (['mol', 'self.max_atoms'], {}), '(mol, self.max_atoms)\n', (2841, 2862), False, 'from chainer_chemistry.dataset.preprocessors.common import type_check_num_atoms\n'), ((3062, 3097), 'chainer_chemistry.dataset....
#!/usr/bin/env python """ Convert text data to embeddings __author__ = "<NAME>" __copyright__ = "Copyright 2018, <NAME>" __license__ = "The MIT License" __email__ = "<EMAIL>" """ import os import logging import re import numpy as np import keras from gensim.models.word2vec import Word2Vec from project.text_to_id im...
[ "logging.getLogger", "gensim.models.word2vec.Word2Vec.load", "project.text_to_id.map_text_to_word_list", "os.environ.get", "keras.utils.to_categorical", "numpy.array", "numpy.sum", "numpy.concatenate" ]
[((354, 381), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (371, 381), False, 'import logging\n'), ((1259, 1284), 'gensim.models.word2vec.Word2Vec.load', 'Word2Vec.load', (['MODEL_PATH'], {}), '(MODEL_PATH)\n', (1272, 1284), False, 'from gensim.models.word2vec import Word2Vec\n'), ((271...
# -*- coding: utf-8 -*- """ Created on Wed Apr 28 09:08:29 2021 @author: <NAME> """ from . import multiasset as ma from . import opt_abc as opt import numpy as np import scipy.stats as spst class BsmBasketAsianJu2002(ma.NormBasket): def __init__(self, sigma, cor=None, weight=None, intr=0.0, divr=0.0, is_fwd=Fals...
[ "numpy.sqrt", "numpy.isscalar", "numpy.log", "numpy.exp", "numpy.zeros", "scipy.stats.norm.pdf", "numpy.full", "scipy.stats.norm.cdf" ]
[((5440, 5472), 'numpy.zeros', 'np.zeros', (['(num_asset, num_asset)'], {}), '((num_asset, num_asset))\n', (5448, 5472), True, 'import numpy as np\n'), ((9337, 9354), 'numpy.isscalar', 'np.isscalar', (['spot'], {}), '(spot)\n', (9348, 9354), True, 'import numpy as np\n'), ((9411, 9433), 'numpy.isscalar', 'np.isscalar',...
import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import numpy as np import os import datetime ''' se_txt_to_npz ''' # # spatial embedding # f = open("sz/SE(sz).txt", mode='r') # lines = f.readlines() # temp = lines[0].split(' ') # N, dims = int(temp[0]), int(temp[1]) # SE = np.zeros(shape=(N, dims), dtype=np...
[ "os.path.exists", "tensorflow.compat.v1.disable_v2_behavior", "os.makedirs", "os.path.join", "numpy.sum", "numpy.isnan", "numpy.around", "tensorflow.compat.v1.trainable_variables", "numpy.isinf" ]
[((34, 58), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (56, 58), True, 'import tensorflow.compat.v1 as tf\n'), ((763, 787), 'tensorflow.compat.v1.trainable_variables', 'tf.trainable_variables', ([], {}), '()\n', (785, 787), True, 'import tensorflow.compat.v1 as tf\n'), ((138...
# iris/train.py import json from argparse import Namespace from typing import Dict, Tuple import numpy as np import optuna import pandas as pd import torch import torch.nn as nn from numpyencoder import NumpyEncoder from sklearn.preprocessing import LabelEncoder # from config import config from config.config import l...
[ "sklearn.preprocessing.LabelEncoder", "optuna.TrialPruned", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.nn.CrossEntropyLoss", "pandas.read_csv", "iris.eval.evaluate", "json.dumps", "torch.sigmoid", "config.config.logger.info", "iris.utils.set_seed", "torch.inference_mode", "numpy.vsta...
[((6145, 6177), 'iris.utils.set_seed', 'utils.set_seed', ([], {'seed': 'params.seed'}), '(seed=params.seed)\n', (6159, 6177), False, 'from iris import data, eval, models, utils\n'), ((6191, 6225), 'iris.utils.set_device', 'utils.set_device', ([], {'cuda': 'params.cuda'}), '(cuda=params.cuda)\n', (6207, 6225), False, 'f...
import pdb import logging from pathlib import Path import PIL # type: ignore import click from typing import Tuple from guppy import hpy # type: ignore import numpy as np # type: ignore import matplotlib.pyplot as plt # type: ignore import torch from sklearn.metrics import pairwise_distances # type: ignore from tqdm i...
[ "logging.basicConfig", "logging.getLogger", "click.argument", "PIL.Image.fromarray", "numpy.unique", "pathlib.Path", "numpy.random.random", "utils.load_cifar_imgs", "sklearn.metrics.pairwise_distances", "utils.slice_image", "numpy.argsort", "numpy.random.randint", "utils.glue_images", "cli...
[((565, 620), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': 'log_fmt'}), '(level=logging.INFO, format=log_fmt)\n', (584, 620), False, 'import logging\n'), ((630, 681), 'logging.getLogger', 'logging.getLogger', (['"""Image gluing genetic algorithm"""'], {}), "('Image gluing genet...
import matplotlib.pyplot as plt from dgl.data.utils import load_graphs import numpy as np from sklearn import linear_model plt.rcParams.update({'font.size': 14}) def design_size(design_file): g, _ = load_graphs('data/dgl/' + design_file + '.def.dgl') return g[0].num_nodes(), g[0].num_edges() def analyze(): ...
[ "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.rcParams.update", "numpy.array", "matplotlib.pyplot.scatter", "matplotlib.pyplot.tight_layout", "dgl.data.utils.load_graphs", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.show" ]
[((124, 162), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 14}"], {}), "({'font.size': 14})\n", (143, 162), True, 'import matplotlib.pyplot as plt\n'), ((205, 256), 'dgl.data.utils.load_graphs', 'load_graphs', (["('data/dgl/' + design_file + '.def.dgl')"], {}), "('data/dgl/' + design_fil...
import numpy as np import pandas as pd from pylab import * import pickle import tensorflow as tf import random import os from sklearn.model_selection import train_test_split import matplotlib.lines as mlines from random import randint from sklearn import preprocessing from sklearn.model_selection import KFol...
[ "tensorflow.keras.losses.MSE", "pandas.read_csv", "numpy.array", "tensorflow.compat.v1.keras.initializers.glorot_normal", "sklearn.model_selection.KFold", "os.path.exists", "numpy.mean", "tensorflow.placeholder", "itertools.product", "tensorflow.Session", "tensorflow.nn.sigmoid", "tensorflow.m...
[((1498, 1512), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1509, 1512), False, 'import pickle\n'), ((2169, 2219), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'k', 'random_state': 'seed', 'shuffle': '(True)'}), '(n_splits=k, random_state=seed, shuffle=True)\n', (2174, 2219), False, 'from sklear...
from __future__ import division, print_function, absolute_import import os import numpy as np from dipy.direction.peaks import (PeaksAndMetrics, reshape_peaks_for_visualization) from dipy.core.sphere import Sphere from dipy.io.image import save_nifti import h5py def _safe_save(grou...
[ "dipy.core.sphere.Sphere", "os.path.splitext", "dipy.io.image.save_nifti", "h5py.File", "numpy.array", "dipy.direction.peaks.PeaksAndMetrics", "dipy.direction.peaks.reshape_peaks_for_visualization" ]
[((1105, 1126), 'h5py.File', 'h5py.File', (['fname', '"""r"""'], {}), "(fname, 'r')\n", (1114, 1126), False, 'import h5py\n'), ((1138, 1155), 'dipy.direction.peaks.PeaksAndMetrics', 'PeaksAndMetrics', ([], {}), '()\n', (1153, 1155), False, 'from dipy.direction.peaks import PeaksAndMetrics, reshape_peaks_for_visualizati...
import json import os from typing import List, Tuple, Callable, Any import numpy as np from piepline.data_producer import BasicDataset, DataProducer from pietoolbelt.pipeline.abstract_step import AbstractStepDirResult from pietoolbelt.pipeline.predict.common import AbstractPredictResult class ThresholdsSearchResult...
[ "numpy.where", "os.path.join", "numpy.concatenate", "piepline.data_producer.DataProducer", "json.dump" ]
[((442, 478), 'os.path.join', 'os.path.join', (['path', '"""threshold.json"""'], {}), "(path, 'threshold.json')\n", (454, 478), False, 'import os\n'), ((886, 934), 'json.dump', 'json.dump', (['self._thresholds', 'meta_file'], {'indent': '(4)'}), '(self._thresholds, meta_file, indent=4)\n', (895, 934), False, 'import js...
import os import os.path as osp import json import pydicom import imageio import argparse import numpy as np from glob import glob from tqdm import tqdm from sklearn.metrics import cohen_kappa_score import sys sys.path.append("..") from GLD.utils import AverageMeter, cal_dice, Logger from data_processing import calc_i...
[ "numpy.abs", "imageio.imread", "pydicom.dcmread", "argparse.ArgumentParser", "numpy.arange", "GLD.utils.cal_dice", "os.path.join", "numpy.argmax", "GLD.utils.AverageMeter", "numpy.array", "json.load", "numpy.meshgrid", "sys.path.append", "glob.glob" ]
[((211, 232), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (226, 232), False, 'import sys\n'), ((423, 460), 'pydicom.dcmread', 'pydicom.dcmread', (['dcm_name'], {'force': '(True)'}), '(dcm_name, force=True)\n', (438, 460), False, 'import pydicom\n'), ((1262, 1302), 'numpy.meshgrid', 'np.meshgri...
Name = 'ReshapeTable' Label = 'Reshape Table' FilterCategory = 'CSM Geophysics Filters' Help = 'This filter will take a vtkTable object and reshape it. This filter essentially treats vtkTables as 2D matrices and reshapes them using numpy.reshape in a C contiguous manner. Unfortunately, data fields will be renamed arbit...
[ "numpy.reshape", "numpy.array", "numpy.empty", "vtk.util.numpy_support.numpy_to_vtk", "vtk.util.numpy_support.vtk_to_numpy" ]
[((965, 987), 'numpy.empty', 'np.empty', (['(cols, rows)'], {}), '((cols, rows))\n', (973, 987), True, 'import numpy as np\n'), ((1513, 1558), 'numpy.reshape', 'np.reshape', (['data', '(nrows, ncols)'], {'order': 'order'}), '(data, (nrows, ncols), order=order)\n', (1523, 1558), True, 'import numpy as np\n'), ((1060, 10...
"""Pull gSSURGO data based on mukeys.""" # https://gdal.org/python/ # https://gis.stackexchange.com/a/200477/32531 import os import sys import sqlite3 import gdal import pandas as pd import numpy as np from pyproj import Proj, transform from .aoi import state_by_bbox def query_gpkg(src_tif, gpkg_path, sql_query, ou...
[ "pandas.read_sql_query", "gdal.Open", "numpy.reshape", "pandas.merge", "pyproj.transform", "os.path.isfile", "pyproj.Proj", "pandas.DataFrame" ]
[((1019, 1037), 'gdal.Open', 'gdal.Open', (['src_tif'], {}), '(src_tif)\n', (1028, 1037), False, 'import gdal\n'), ((1381, 1403), 'pyproj.Proj', 'Proj', ([], {'init': '"""epsg:4326"""'}), "(init='epsg:4326')\n", (1385, 1403), False, 'from pyproj import Proj, transform\n'), ((1417, 1595), 'pyproj.Proj', 'Proj', (['"""+p...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright [2020] [Indian Institute of Science, Bangalore] SPDX-License-Identifier: Apache-2.0 """ import pandas as pd import numpy as np import geopandas as gpd from shapely.geometry import Point, MultiPolygon def seedIndividuals(city): cityDF = gpd.read_file("....
[ "geopandas.read_file", "pandas.read_csv", "numpy.logical_and", "numpy.where", "numpy.arange", "shapely.geometry.Point", "numpy.array", "numpy.full", "pandas.read_json", "shapely.geometry.MultiPolygon" ]
[((304, 358), 'geopandas.read_file', 'gpd.read_file', (["('./data/base/' + city + '/city.geojson')"], {}), "('./data/base/' + city + '/city.geojson')\n", (317, 358), True, 'import geopandas as gpd\n'), ((378, 447), 'pandas.read_json', 'pd.read_json', (["('./data/' + city + '-100K-300students/individuals.json')"], {}), ...
import numpy as np def value_iteration(env, theta=0.0001, discount_factor=1.0): """ Value Iteration Algorithm. Args: env: OpenAI environment. env.P represents the transition probabilities of the environment. theta: Stopping threshold. If the value of all states changes less than theta ...
[ "numpy.abs", "numpy.zeros", "numpy.argmax", "numpy.max" ]
[((545, 561), 'numpy.zeros', 'np.zeros', (['env.nS'], {}), '(env.nS)\n', (553, 561), True, 'import numpy as np\n'), ((575, 601), 'numpy.zeros', 'np.zeros', (['[env.nS, env.nA]'], {}), '([env.nS, env.nA])\n', (583, 601), True, 'import numpy as np\n'), ((1589, 1605), 'numpy.zeros', 'np.zeros', (['env.nA'], {}), '(env.nA)...
# Author: <NAME> # github.com/kaylani2 # kaylani AT gta DOT ufrj DOT br ## Load dataset, describe, hadle categorical attributes ## CICIDS used as an example import pandas as pd import numpy as np import sys # Random state for eproducibility STATE = 0 ## Hard to not go over 80 columns CICIDS_DIRECTORY = '../../datase...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.mean_squared_error", "numpy.append", "sys.exit", "sklearn.metrics.r2_score", "sklearn.linear_model.LinearRegression" ]
[((784, 813), 'pandas.read_csv', 'pd.read_csv', (['CICIDS_WEDNESDAY'], {}), '(CICIDS_WEDNESDAY)\n', (795, 813), True, 'import pandas as pd\n'), ((5358, 5417), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(1 / 5)', 'random_state': 'STATE'}), '(X, y, test_size=1 / 5, random_...
import numpy as np class GA(object): def __init__(self, nInd, nCrom, probCruz, probMut, nGer, fCusto, tipoSel='roleta', tipoCruz='ponto', tipoMut='bit-a-bit', elit=True, verbose=True): ''' Algoritmo genético para problemas de minimização de custo. nInd - Número de indivíduos ...
[ "numpy.ones", "numpy.random.random", "numpy.where", "numpy.sum", "numpy.random.randint", "numpy.zeros", "numpy.argmin" ]
[((1474, 1522), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)', '(self.nInd, self.nCrom)'], {}), '(0, 2, (self.nInd, self.nCrom))\n', (1491, 1522), True, 'import numpy as np\n'), ((1548, 1566), 'numpy.ones', 'np.ones', (['self.nInd'], {}), '(self.nInd)\n', (1555, 1566), True, 'import numpy as np\n'), ((247...
import re from collections import defaultdict, Counter from numbers import Number from typing import Optional, List, Dict import numpy as np import torch from allennlp.common import FromParams, Registrable from dataclasses import dataclass, replace from pycocoevalcap.bleu.bleu import Bleu from pycocoevalcap.cider.cid...
[ "third_party.detection_metrics.lib.Evaluator.BoundingBoxes", "pycocoevalcap.bleu.bleu.Bleu", "dataclasses.dataclass", "numpy.array", "third_party.detection_metrics.lib.Evaluator.Evaluator", "gpv2.data.dataset.CaptioningExample", "re.search", "gpv2.utils.image_utils.get_image_size", "numpy.mean", "...
[((1083, 1105), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (1092, 1105), False, 'from dataclasses import dataclass, replace\n'), ((6042, 6062), 'collections.Counter', 'Counter', (['ngt_answers'], {}), '(ngt_answers)\n', (6049, 6062), False, 'from collections import defaultdict,...
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file. # All rights reserved. Use of this source code is governed by # a BSD-style license that can be found in the LICENSE file. # from memory_profiler import profile from collections import OrderedDict import os from toast_planck.preproc_modules import ...
[ "numpy.radians", "astropy.io.fits.ColDefs", "numpy.hstack", "healpy.rotator.get_coordconv_matrix", "numpy.argsort", "numpy.array", "astropy.io.fits.Column", "numpy.diff", "numpy.dot", "numpy.eye", "collections.OrderedDict", "astropy.io.fits.PrimaryHDU", "toast_planck.preproc_modules.MapSampl...
[((933, 942), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (939, 942), True, 'import numpy as np\n'), ((689, 714), 'numpy.radians', 'np.radians', (['(90 - self.lat)'], {}), '(90 - self.lat)\n', (699, 714), True, 'import numpy as np\n'), ((734, 754), 'numpy.radians', 'np.radians', (['self.lon'], {}), '(self.lon)\n', (...
import torch import numpy import environment as env from environment import get_valid_directions, move, prettyprint class Policy(nn.Module): def __init__(self): super(Policy, self).__init__() self.input_dim = 4 # onehot of possible paths self.output_dim = 4 # action probs self...
[ "numpy.mean", "torch.distributions.Categorical", "environment.get_valid_directions", "torch.mean", "torch.stack", "torch.cuda.is_available", "torch.sum", "environment.move", "torch.no_grad", "torch.zeros", "torch.cat", "torch.device" ]
[((1234, 1259), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1257, 1259), False, 'import torch\n'), ((1210, 1230), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (1222, 1230), False, 'import torch\n'), ((1265, 1284), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (C) 2010-2018 GEM Foundation, <NAME>, <NAME>, # <NAME>. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero General Public # Li...
[ "openquake.hazardlib.mfd.truncated_gr.TruncatedGRMFD", "numpy.ones", "openquake.hazardlib.tom.PoissonTOM", "openquake.hmtk.seismicity.catalogue.Catalogue", "numpy.testing.assert_array_equal", "warnings.resetwarnings", "openquake.hmtk.sources.point_source.mtkPointSource", "openquake.hazardlib.geo.point...
[((2647, 2663), 'openquake.hazardlib.tom.PoissonTOM', 'PoissonTOM', (['(50.0)'], {}), '(50.0)\n', (2657, 2663), False, 'from openquake.hazardlib.tom import PoissonTOM\n'), ((3081, 3112), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (3102, 3112), False, 'import warnings\n'), ...
import unittest import numpy as np from pax import core, plugin from pax.datastructure import Event, Peak class TestPosRecMaxPMT(unittest.TestCase): def setUp(self): self.pax = core.Processor(config_names='XENON100', just_testing=True, config_dict={'pax': { 'plugin_group_names': ['test'], ...
[ "pax.core.Processor", "numpy.array", "numpy.zeros", "pax.datastructure.Event.empty_event", "unittest.main", "pax.datastructure.Peak" ]
[((2092, 2107), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2105, 2107), False, 'import unittest\n'), ((193, 342), 'pax.core.Processor', 'core.Processor', ([], {'config_names': '"""XENON100"""', 'just_testing': '(True)', 'config_dict': "{'pax': {'plugin_group_names': ['test'], 'test': 'MaxPMT.PosRecMaxPMT'}}"}...
""" Provides infilling support for stitched IFCB rev 1 images Based on pyifcb API """ import numpy as np from scipy.interpolate import Rbf from functools32 import lru_cache from ifcb.data.utils import BaseDictlike from ifcb.data.stitching import Stitcher _LEGACY_EPS = 0.000001 def normz(a): m = np.max(a) + _LE...
[ "numpy.convolve", "numpy.sqrt", "numpy.logical_not", "numpy.array", "numpy.cumsum", "numpy.arange", "numpy.where", "numpy.max", "numpy.take", "numpy.random.seed", "numpy.random.normal", "numpy.ones", "numpy.argmax", "ifcb.data.stitching.Stitcher", "functools32.lru_cache", "numpy.sum", ...
[((925, 974), 'numpy.array', 'np.array', (['[2, 2, 2, 2, 2, 4, 8, 2, 1, 1, 1, 1, 1]'], {}), '([2, 2, 2, 2, 2, 4, 8, 2, 1, 1, 1, 1, 1])\n', (933, 974), True, 'import numpy as np\n'), ((459, 473), 'numpy.arange', 'np.arange', (['(256)'], {}), '(256)\n', (468, 473), True, 'import numpy as np\n'), ((507, 526), 'numpy.sum',...
from math import sqrt from baseClasses.Template import * import os, numpy as np, random from helper.functions import outputObj, loadOBJ, scaleValues from PIL import Image as im class EurecomTemplate(Template): folderTemplate = None faceMarks = [] layersChar = None overFlow = None underFlow = None ...
[ "helper.functions.scaleValues", "os.path.exists", "PIL.Image.fromarray", "PIL.Image.open", "numpy.uint8", "os.makedirs", "os.path.join", "numpy.zeros", "os.path.sep.join", "random.randint", "helper.functions.loadOBJ" ]
[((2344, 2371), 'os.path.exists', 'os.path.exists', (['fullImgPath'], {}), '(fullImgPath)\n', (2358, 2371), False, 'import os, numpy as np, random\n'), ((4618, 4643), 'os.path.exists', 'os.path.exists', (['filesPath'], {}), '(filesPath)\n', (4632, 4643), False, 'import os, numpy as np, random\n'), ((5367, 5412), 'PIL.I...
import numpy as np import cv2 #def maxpoolGlobal(res): def MaxPoolingDos(Img): fr=len(Img)//2 cr=len(Img[0])//2 Resultado=np.zeros((fr,cr),np.uint8) #Proceso del maxPooling a=0 for i in range(0,len(Img),2): b=0 for j in range(0,len(Img),2): Resultado[a][b]=np.a...
[ "numpy.zeros", "numpy.amax" ]
[((135, 163), 'numpy.zeros', 'np.zeros', (['(fr, cr)', 'np.uint8'], {}), '((fr, cr), np.uint8)\n', (143, 163), True, 'import numpy as np\n'), ((316, 346), 'numpy.amax', 'np.amax', (['Img[i:i + 2, j:j + 2]'], {}), '(Img[i:i + 2, j:j + 2])\n', (323, 346), True, 'import numpy as np\n')]
import numpy as np from data import io ''' flatten(imageset) - converts an image to a column vector ''' def flatten(imageset): flat = imageset.reshape(imageset.shape[ 0 ], -1).T return flat ''' weight(U, dataset, shi) - calculate weight of each train sample - using first k pca ''' def weight(U, d...
[ "numpy.dot", "data.io.load", "numpy.linalg.eig" ]
[((345, 371), 'numpy.dot', 'np.dot', (['U.T', '(dataset - shi)'], {}), '(U.T, dataset - shi)\n', (351, 371), True, 'import numpy as np\n'), ((542, 560), 'numpy.dot', 'np.dot', (['phi', 'phi.T'], {}), '(phi, phi.T)\n', (548, 560), True, 'import numpy as np\n'), ((586, 611), 'numpy.linalg.eig', 'np.linalg.eig', (['covari...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Mar 12 14:16:29 2018 Script gathering functions related to the psd and fft calculations. @author: misiak """ import numpy as np def psd(fft, fs, weight=None): """ Computes the Power Spectral Density (PSD) from the Fast Fourier Transform (...
[ "numpy.abs", "numpy.sqrt", "numpy.fft.fftfreq", "numpy.conjugate", "numpy.angle", "numpy.exp", "numpy.array", "numpy.sum", "numpy.concatenate", "numpy.random.uniform", "numpy.fft.ifft" ]
[((1254, 1284), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['nfft', '(fs ** -1)'], {}), '(nfft, fs ** -1)\n', (1268, 1284), True, 'import numpy as np\n'), ((1879, 1909), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['nfft', '(fs ** -1)'], {}), '(nfft, fs ** -1)\n', (1893, 1909), True, 'import numpy as np\n'), ((2402, 2433), 'n...
################################################################################ # Copyright (c) 2019. ContinualAI. All rights reserved. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
[ "torch.utils.tensorboard.SummaryWriter", "torch.as_tensor", "numpy.tan", "numpy.arange", "numpy.random.random", "json.dumps", "numpy.zeros", "numpy.cos", "numpy.sin", "torch.randn", "torch.rand" ]
[((1300, 1322), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', (['log_dir'], {}), '(log_dir)\n', (1313, 1322), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((1436, 1483), 'json.dumps', 'json.dumps', (["{'mb_size': 12, 'inc_train_ep': 10}"], {}), "({'mb_size': 12, 'inc_train_ep': 10})\n", (1...
#! /usr/bin/env python3 """ Copyright 2021 <NAME>. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
[ "os.listdir", "numpy.savez_compressed", "os.makedirs", "os.path.join", "absl.app.run", "absl.flags.DEFINE_boolean", "absl.flags.mark_flag_as_required", "os.path.isdir", "sys.exit", "yacos.info.ncc.Inst2Vec.remove_data_directory", "yacos.info.ncc.Inst2Vec.extract", "yacos.info.ncc.Inst2Vec.prep...
[((2962, 3029), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""dataset_directory"""', 'None', '"""Dataset directory"""'], {}), "('dataset_directory', None, 'Dataset directory')\n", (2981, 3029), False, 'from absl import app, flags, logging\n'), ((3082, 3147), 'absl.flags.DEFINE_boolean', 'flags.DEFINE_boolean...
import matplotlib.pyplot as plt import numpy as np from matplotlib.figure import Figure from numpy.random.mtrand import RandomState from torch.utils.data import Dataset def draw_samples(dataset: Dataset, cols: int, rows: int, width: float = 3, height: float = 3, fontsize: int = 8, ...
[ "matplotlib.pyplot.imshow", "matplotlib.pyplot.grid", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "numpy.random.RandomState" ]
[((556, 605), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(cols * width, rows * height)'}), '(figsize=(cols * width, rows * height))\n', (566, 605), True, 'import matplotlib.pyplot as plt\n'), ((415, 438), 'numpy.random.RandomState', 'np.random.RandomState', ([], {}), '()\n', (436, 438), True, 'import n...
from sklearn.svm import SVC from imblearn.over_sampling import SMOTE from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report, confusion_matrix import time import argparse import util import numpy as np import pandas as pd def main(args): X = pd.read_csv(args.data) ...
[ "sklearn.metrics.confusion_matrix", "argparse.ArgumentParser", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.classification_report", "imblearn.over_sampling.SMOTE", "numpy.array", "time.time", "sklearn.svm.SVC" ]
[((296, 318), 'pandas.read_csv', 'pd.read_csv', (['args.data'], {}), '(args.data)\n', (307, 318), True, 'import pandas as pd\n'), ((327, 351), 'pandas.read_csv', 'pd.read_csv', (['args.labels'], {}), '(args.labels)\n', (338, 351), True, 'import pandas as pd\n'), ((431, 468), 'sklearn.model_selection.train_test_split', ...
#!/usr/bin/env python #vim:fileencoding=UTF-8 import sys import math from numpy import histogram if len(sys.argv) != 8: print('Usage: SCRIPT [angle data] [polar data] [theta from] [theta to] [phi from] [phi to] [output prefix]') print(' (theta and phi is in the unit of degree)') sys.exit(2) file_in...
[ "numpy.histogram", "math.radians", "sys.exit" ]
[((2015, 2048), 'numpy.histogram', 'histogram', (['theta'], {'bins': 'theta_bins'}), '(theta, bins=theta_bins)\n', (2024, 2048), False, 'from numpy import histogram\n'), ((2065, 2114), 'numpy.histogram', 'histogram', (['theta'], {'weights': 'weight', 'bins': 'theta_bins'}), '(theta, weights=weight, bins=theta_bins)\n',...
import numpy as np def skew(x: np.ndarray) -> np.ndarray: """ Args: x: An array of shape (3,). Returns: The skew symmetric array of shape (3, 3). """ return np.array([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]])
[ "numpy.array" ]
[((196, 260), 'numpy.array', 'np.array', (['[[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]]'], {}), '([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]])\n', (204, 260), True, 'import numpy as np\n')]
import sys import cv2 import numpy as np import imutils from imutils import paths import argparse class Orthomosaic: def __init__(self, debug): cv2.namedWindow("output", cv2.WINDOW_NORMAL) self.no_raw_images = [] self.temp_image = [] self.final_image = [] self.debug = debug...
[ "cv2.resize", "argparse.ArgumentParser", "cv2.findHomography", "numpy.float32", "cv2.imshow", "cv2.BFMatcher_create", "numpy.array", "cv2.ORB_create", "cv2.destroyAllWindows", "imutils.paths.list_images", "numpy.concatenate", "cv2.perspectiveTransform", "cv2.waitKey", "cv2.namedWindow", ...
[((158, 202), 'cv2.namedWindow', 'cv2.namedWindow', (['"""output"""', 'cv2.WINDOW_NORMAL'], {}), "('output', cv2.WINDOW_NORMAL)\n", (173, 202), False, 'import cv2\n'), ((381, 406), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (404, 406), False, 'import argparse\n'), ((2304, 2342), 'cv2.imshow...
import unittest from ParamSklearn.components.classification.multinomial_nb import \ MultinomialNB from ParamSklearn.util import _test_classifier, _test_classifier_iterative_fit, \ get_dataset import numpy as np import sklearn.metrics class MultinomialNBComponentTest(unittest.TestCase): def test_default_...
[ "ParamSklearn.util.get_dataset", "ParamSklearn.components.classification.multinomial_nb.MultinomialNB.get_hyperparameter_search_space", "ParamSklearn.util._test_classifier_iterative_fit", "ParamSklearn.util._test_classifier", "numpy.nanmean", "ParamSklearn.components.classification.multinomial_nb.Multinom...
[((1233, 1262), 'ParamSklearn.util.get_dataset', 'get_dataset', ([], {'dataset': '"""digits"""'}), "(dataset='digits')\n", (1244, 1262), False, 'from ParamSklearn.util import _test_classifier, _test_classifier_iterative_fit, get_dataset\n'), ((1431, 1478), 'ParamSklearn.components.classification.multinomial_nb.Multinom...
import pandas as pd import numpy as np # County / Unitary Authorities Apr-2021 # NOMIS API - Population estimates - local authority based by five year age band url = "https://www.nomisweb.co.uk/api/v01/dataset/NM_31_1.data.csv?geography=1807745025...1807745028,1807745030...1807745032,1807745034...1807745083,180774508...
[ "numpy.where", "pandas.merge", "pandas.DataFrame", "pandas.read_csv" ]
[((800, 816), 'pandas.read_csv', 'pd.read_csv', (['url'], {}), '(url)\n', (811, 816), True, 'import pandas as pd\n'), ((2121, 2137), 'pandas.read_csv', 'pd.read_csv', (['url'], {}), '(url)\n', (2132, 2137), True, 'import pandas as pd\n'), ((3310, 3326), 'pandas.read_csv', 'pd.read_csv', (['url'], {}), '(url)\n', (3321,...
#-*-coding:utf8-*-# import os from cv2 import cv2 from PIL import Image,ImageDraw from datetime import datetime import time import tensorflow as tf import numpy as np import gender_train_data as train_data from gender_train_data import labels_text import matplotlib.pyplot as plt # 人脸检测 class DetectFaces(): def _...
[ "tensorflow.transpose", "numpy.array", "PIL.ImageDraw.Draw", "numpy.reshape", "tensorflow.Session", "cv2.cv2.resize", "os.mkdir", "cv2.cv2.cvtColor", "tensorflow.get_default_graph", "numpy.argmax", "tensorflow.train.import_meta_graph", "tensorflow.train.latest_checkpoint", "matplotlib.pyplot...
[((8159, 8173), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (8171, 8173), False, 'from datetime import datetime\n'), ((8264, 8278), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (8276, 8278), False, 'from datetime import datetime\n'), ((576, 598), 'cv2.cv2.imread', 'cv2.imread', (['image_nam...
from typing import List, Tuple import matplotlib.pyplot as plt import numpy as np import scipy.stats as scs from scipy.optimize import minimize class DistrManager: def __init__( self, left_border: int = -1.8, right_border: int = 2, step: int = 0.2 ) -> None: self._left_border = left_border ...
[ "numpy.mean", "matplotlib.pyplot.grid", "matplotlib.pyplot.legend", "scipy.optimize.minimize", "matplotlib.pyplot.plot", "scipy.stats.norm.rvs", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "numpy.arange", "matplotlib.pyplot.show" ]
[((441, 501), 'numpy.arange', 'np.arange', (['self._left_border', 'self._right_border', 'self._step'], {}), '(self._left_border, self._right_border, self._step)\n', (450, 501), True, 'import numpy as np\n'), ((1683, 1758), 'scipy.optimize.minimize', 'minimize', (['self._minimize_mnm', '[beta_0, beta_1]'], {'args': '(x,...