code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
from molsysmt import puw
from ..exceptions import *
def digest_box(box):
return box
def digest_box_lengths_value(box_lengths):
output = None
if type(box_lengths) is not np.ndarray:
box_lengths = np.array(box_lengths)
shape = box_lengths.shape
if len(shape)==1:
... | [
"numpy.array",
"numpy.expand_dims",
"molsysmt.puw.get_value",
"molsysmt.puw.get_unit"
] | [((844, 869), 'molsysmt.puw.get_unit', 'puw.get_unit', (['box_lengths'], {}), '(box_lengths)\n', (856, 869), False, 'from molsysmt import puw\n'), ((894, 920), 'molsysmt.puw.get_value', 'puw.get_value', (['box_lengths'], {}), '(box_lengths)\n', (907, 920), False, 'from molsysmt import puw\n'), ((1766, 1790), 'molsysmt.... |
"""Package for loading and running the nuclei and cell segmentation models programmaticly."""
import os
import sys
import cv2
import imageio
import numpy as np
import torch
import torch.nn
import torch.nn.functional as F
from skimage import transform, util
from hpacellseg.constants import (MULTI_CHANNEL_CELL_MODEL_UR... | [
"numpy.dstack",
"skimage.transform.rescale",
"skimage.util.img_as_ubyte",
"imageio.imread",
"os.path.exists",
"cv2.copyMakeBorder",
"numpy.zeros",
"torch.nn.functional.softmax",
"torch.cuda.is_available",
"skimage.transform.resize",
"torch.device",
"torch.as_tensor",
"hpacellseg.utils.downlo... | [((5151, 5241), 'cv2.copyMakeBorder', 'cv2.copyMakeBorder', (['image', '(32)', '(32 - rows % 32)', '(32)', '(32 - cols % 32)', 'cv2.BORDER_REFLECT'], {}), '(image, 32, 32 - rows % 32, 32, 32 - cols % 32, cv2.\n BORDER_REFLECT)\n', (5169, 5241), False, 'import cv2\n'), ((8231, 8335), 'cv2.resize', 'cv2.resize', (['n_... |
import sys
sys.path.append("..")
import os
here = os.path.dirname(os.path.realpath(__file__))
import pickle
import tempfile
import numpy as np
import pyrfr.regression
data_set_prefix = '%(here)s/../test_data_sets/diabetes_' % {"here":here}
features = np.loadtxt(data_set_prefix+'features.csv', delimiter=",")
resp... | [
"sys.path.append",
"tempfile.NamedTemporaryFile",
"os.remove",
"pickle.dump",
"os.path.realpath",
"numpy.allclose",
"pickle.load",
"numpy.loadtxt"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((258, 317), 'numpy.loadtxt', 'np.loadtxt', (["(data_set_prefix + 'features.csv')"], {'delimiter': '""","""'}), "(data_set_prefix + 'features.csv', delimiter=',')\n", (268, 317), True, 'import numpy as np... |
import numpy as np
import os
import torch
import copy
from math import cos, sqrt, pi
def dct(x, y, v, u, n):
# Normalisation
def alpha(a):
if a == 0:
return sqrt(1.0 / n)
else:
return sqrt(2.0 / n)
return alpha(u) * alpha(v) * cos(((2 * x + 1) * (u * pi)) / (2 * n)... | [
"numpy.absolute",
"numpy.load",
"numpy.maximum",
"numpy.full_like",
"numpy.zeros_like",
"numpy.multiply",
"os.path.dirname",
"os.path.exists",
"numpy.swapaxes",
"math.cos",
"numpy.reshape",
"numpy.add",
"numpy.save",
"numpy.minimum",
"math.sqrt",
"numpy.asarray",
"torch.clamp",
"to... | [((606, 626), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (620, 626), False, 'import os\n'), ((1305, 1329), 'numpy.save', 'np.save', (['path', 'dct_basis'], {}), '(path, dct_basis)\n', (1312, 1329), True, 'import numpy as np\n'), ((1685, 1702), 'numpy.zeros_like', 'np.zeros_like', (['im'], {}), '(im... |
import math
from typing import Any, Dict, Tuple
import attr
from attr import attrib, attrs
import numpy as np
from nlisim.cell import CellData, CellFields, CellList
from nlisim.coordinates import Point, Voxel
from nlisim.grid import RectangularGrid
from nlisim.modules.phagocyte import (
PhagocyteCellData,
Pha... | [
"math.expm1",
"attr.attrs",
"attr.Factory",
"numpy.dtype",
"numpy.where",
"numpy.fromiter",
"nlisim.modules.phagocyte.PhagocyteCellData.create_cell_tuple",
"nlisim.random.rg.shuffle",
"nlisim.random.rg.uniform"
] | [((1350, 1394), 'attr.attrs', 'attrs', ([], {'kw_only': '(True)', 'frozen': '(True)', 'repr': '(False)'}), '(kw_only=True, frozen=True, repr=False)\n', (1355, 1394), False, 'from attr import attrib, attrs\n'), ((1604, 1623), 'attr.attrs', 'attrs', ([], {'kw_only': '(True)'}), '(kw_only=True)\n', (1609, 1623), False, 'f... |
from numpy import array, arange, zeros, unique, searchsorted, full, nan
from numpy.linalg import norm # type: ignore
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.bdf.field_writer_8 import print_card_8, set_blank_if_default
from pyNastran.bdf.field_writer_16 import print_card_16
from pyNastran.... | [
"numpy.full",
"pyNastran.bdf.field_writer_8.set_blank_if_default",
"pyNastran.bdf.bdf_interface.assign_type.string_or_blank",
"pyNastran.bdf.bdf_interface.assign_type.integer",
"pyNastran.bdf.field_writer_8.print_card_8",
"numpy.unique",
"numpy.zeros",
"numpy.searchsorted",
"pyNastran.bdf.bdf_interf... | [((1911, 1940), 'pyNastran.dev.bdf_vectorized.cards.elements.element.Element.__init__', 'Element.__init__', (['self', 'model'], {}), '(self, model)\n', (1927, 1940), False, 'from pyNastran.dev.bdf_vectorized.cards.elements.element import Element\n'), ((3391, 3421), 'pyNastran.bdf.bdf_interface.assign_type.integer', 'in... |
"""
Environments and wrappers for Sonic training.
"""
import gym
import numpy as np
import gzip
import retro
import os
from baselines.common.atari_wrappers import WarpFrame, FrameStack
# from retro_contest.local import make
import logging
import retro_contest
import pandas as pd
train_states = pd.read_csv('../data/so... | [
"pandas.read_csv",
"baselines.common.atari_wrappers.WarpFrame",
"retro.make",
"retro.get_game_path",
"numpy.array",
"retro_contest.StochasticFrameSkip",
"gym.wrappers.TimeLimit",
"os.path.join",
"logging.getLogger"
] | [((297, 345), 'pandas.read_csv', 'pd.read_csv', (['"""../data/sonic_env/sonic-train.csv"""'], {}), "('../data/sonic_env/sonic-train.csv')\n", (308, 345), True, 'import pandas as pd\n'), ((366, 419), 'pandas.read_csv', 'pd.read_csv', (['"""../data/sonic_env/sonic-validation.csv"""'], {}), "('../data/sonic_env/sonic-vali... |
# tf2.0目标检测之csv 2 Tfrecord
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import numpy as np
import random
import cv2
from tqdm import tqdm
import datetime
import os
import time
from detection.models.detectors import faster_rcnn
from... | [
"numpy.sum",
"numpy.maximum",
"numpy.argmax",
"tensorflow.keras.optimizers.SGD",
"bjod_data.ZiptrainDataset",
"numpy.argsort",
"bjod_data.Zipvaluedata",
"numpy.arange",
"cv2.rectangle",
"os.path.join",
"random.randint",
"cv2.cvtColor",
"numpy.cumsum",
"tensorflow.cast",
"numpy.max",
"r... | [((413, 429), 'random.seed', 'random.seed', (['(234)'], {}), '(234)\n', (424, 429), False, 'import random\n'), ((624, 669), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_RGB2BGR', 'image'], {}), '(image, cv2.COLOR_RGB2BGR, image)\n', (636, 669), False, 'import cv2\n'), ((594, 619), 'numpy.squeeze', 'np.squeeze'... |
import numpy as np
from liegroups.numpy import _base
from liegroups.numpy.so2 import SO2
class SE2(_base.SpecialEuclideanBase):
"""Homogeneous transformation matrix in :math:`SE(2)` using active (alibi) transformations.
.. math::
SE(2) &= \\left\\{ \\mathbf{T}=
\\begin{bmatrix}
... | [
"numpy.empty",
"numpy.zeros",
"numpy.expand_dims",
"numpy.hstack",
"numpy.array",
"numpy.squeeze",
"numpy.eye",
"numpy.atleast_2d"
] | [((3705, 3726), 'numpy.hstack', 'np.hstack', (['[rho, phi]'], {}), '([rho, phi])\n', (3714, 3726), True, 'import numpy as np\n'), ((4973, 4989), 'numpy.atleast_2d', 'np.atleast_2d', (['p'], {}), '(p)\n', (4986, 4989), True, 'import numpy as np\n'), ((5007, 5050), 'numpy.zeros', 'np.zeros', (['[p.shape[0], p.shape[1], c... |
import pickle
import numpy as np
from neupy import algorithms
from neupy.exceptions import NotTrained
from algorithms.memory.data import zero, one, half_one, half_zero
from base import BaseTestCase
from helpers import vectors_for_testing
zero_hint = np.array([[0, 1, 0, 0]])
one_hint = np.array([[1, 0, 0, 0]])
cl... | [
"pickle.loads",
"algorithms.memory.data.half_one.ravel",
"numpy.testing.assert_array_equal",
"numpy.array",
"neupy.algorithms.DiscreteBAM",
"numpy.vstack",
"numpy.testing.assert_array_almost_equal",
"numpy.concatenate",
"pickle.dumps"
] | [((255, 279), 'numpy.array', 'np.array', (['[[0, 1, 0, 0]]'], {}), '([[0, 1, 0, 0]])\n', (263, 279), True, 'import numpy as np\n'), ((291, 315), 'numpy.array', 'np.array', (['[[1, 0, 0, 0]]'], {}), '([[1, 0, 0, 0]])\n', (299, 315), True, 'import numpy as np\n'), ((433, 468), 'numpy.concatenate', 'np.concatenate', (['[z... |
import data.tools.maths as m
import pygame, numpy
class MousePicker:
current_ray = None
RAY_RANGE = 600.0
RECURSION_COUNT = 200
def __init__(self, camera, projection_matrix, display, terrain):
self.camera = camera
self.projection_matrix = projection_matrix
self.dis... | [
"numpy.dot",
"data.tools.maths.Maths",
"numpy.linalg.inv",
"pygame.mouse.get_pos"
] | [((1302, 1336), 'numpy.linalg.inv', 'numpy.linalg.inv', (['self.view_matrix'], {}), '(self.view_matrix)\n', (1318, 1336), False, 'import pygame, numpy\n'), ((1370, 1418), 'numpy.dot', 'numpy.dot', (['inverted_view_matrix', 'eye_coordinates'], {}), '(inverted_view_matrix, eye_coordinates)\n', (1379, 1418), False, 'impor... |
import os
import subprocess
from subprocess import check_output
import cv2
import numpy as np
class VideoCaptureYUV:
def __init__(self, filename, size):
self.height, self.width = size
self.frame_len = int(self.width * self.height * 3 / 2)
self.f = open(filename, 'rb')
self.shape = (int(self.height*1.5), self.... | [
"os.remove",
"cv2.VideoWriter_fourcc",
"cv2.cvtColor",
"numpy.frombuffer",
"subprocess.check_output",
"numpy.clip",
"os.listdir",
"numpy.concatenate"
] | [((1505, 1530), 'os.listdir', 'os.listdir', (['inputfilepath'], {}), '(inputfilepath)\n', (1515, 1530), False, 'import os\n'), ((1916, 1932), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1926, 1932), False, 'import os\n'), ((2454, 2470), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (2464, 2470), ... |
# coding: utf-8
# In[1]:
import pandas as pd
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
get_ipython().magic('matplotlib inline')
# In[2]:
data = pd.read_csv("../build/nis_array_.log",delimiter="\n")
t = [7.8 for i in range(498)]
ts = np.arange(0,498,1)
# In[3]:
plt.plot(ts, t, labe... | [
"pandas.read_csv",
"numpy.arange",
"matplotlib.pyplot.plot"
] | [((179, 233), 'pandas.read_csv', 'pd.read_csv', (['"""../build/nis_array_.log"""'], {'delimiter': '"""\n"""'}), "('../build/nis_array_.log', delimiter='\\n')\n", (190, 233), True, 'import pandas as pd\n'), ((268, 288), 'numpy.arange', 'np.arange', (['(0)', '(498)', '(1)'], {}), '(0, 498, 1)\n', (277, 288), True, 'impor... |
"""
Evaluate the model using Eigen split of KITTI dataset
- prepare gt depth running the script https://github.com/nianticlabs/monodepth2/blob/master/export_gt_depth.py
"""
import argparse
import os
import cv2
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from eval_utils import compute_errors, comp... | [
"numpy.load",
"argparse.ArgumentParser",
"os.path.join",
"eval_utils.compute_scale_and_shift",
"eval_utils.compute_errors",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.nn.relu",
"numpy.zeros_like",
"os.path.exists",
"tensorflow.cast",
"numpy.loadtxt",
"tensorflow.io.read_f... | [((2040, 2065), 'os.path.exists', 'os.path.exists', (['test_file'], {}), '(test_file)\n', (2054, 2065), False, 'import os\n'), ((2614, 2636), 'network.Pydnet', 'Pydnet', (['network_params'], {}), '(network_params)\n', (2620, 2636), False, 'from network import Pydnet\n'), ((2710, 2738), 'tensorflow.nn.relu', 'tf.nn.relu... |
"""
==============
Edge operators
==============
Edge operators are used in image processing within edge detection algorithms.
They are discrete differentiation operators, computing an approximation of the
gradient of the image intensity function.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.d... | [
"numpy.maximum",
"numpy.arctan2",
"numpy.abs",
"skimage.filters.farid_v",
"skimage.filters.scharr_h",
"skimage.filters.sobel_v",
"skimage.filters.sobel",
"numpy.sin",
"matplotlib.pyplot.tight_layout",
"skimage.filters.farid_h",
"skimage.filters.scharr",
"skimage.filters.prewitt_h",
"skimage.... | [((491, 499), 'skimage.data.camera', 'camera', ([], {}), '()\n', (497, 499), False, 'from skimage.data import camera\n'), ((515, 529), 'skimage.filters.roberts', 'roberts', (['image'], {}), '(image)\n', (522, 529), False, 'from skimage.filters import roberts, sobel, sobel_h, sobel_v, scharr, scharr_h, scharr_v, prewitt... |
import pandas as pd
import os
import time
import numpy as np
from deriveSummaryDUC import read_simMats, cluster_mat, oracle_per_cluster
import pickle
from collections import defaultdict
from utils import offset_str2list, offset_decreaseSentOffset, insert_string
def find_abstractive_target(predictions_topi... | [
"pandas.DataFrame",
"utils.offset_decreaseSentOffset",
"os.makedirs",
"numpy.argmax",
"deriveSummaryDUC.cluster_mat",
"deriveSummaryDUC.oracle_per_cluster",
"os.path.exists",
"time.strftime",
"utils.insert_string",
"deriveSummaryDUC.read_simMats",
"utils.offset_str2list",
"os.listdir"
] | [((1114, 1145), 'utils.offset_str2list', 'offset_str2list', (['docSpanOffsets'], {}), '(docSpanOffsets)\n', (1129, 1145), False, 'from utils import offset_str2list, offset_decreaseSentOffset, insert_string\n'), ((1161, 1216), 'utils.offset_decreaseSentOffset', 'offset_decreaseSentOffset', (['docSentCharIdx', 'span_offs... |
import logging
import timeit
import numpy as np
import pandas as pd
from tqdm import tqdm
from unified_model import UnifiedModel
from unified_model.utils import truncate_middle, ITEM_COLUMN, SCORE_COLUMN
log = logging.getLogger(__name__)
UNKNOWN_ITEM = '<UNK>'
# https://en.wikipedia.org/wiki/Evaluation_measures_(i... | [
"pandas.DataFrame",
"tqdm.tqdm",
"numpy.sum",
"timeit.default_timer",
"subprocess.check_output",
"numpy.amax",
"tempfile.mkdtemp",
"numpy.array",
"subprocess.call",
"shutil.rmtree",
"os.path.join",
"logging.getLogger"
] | [((213, 240), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (230, 240), False, 'import logging\n'), ((2368, 2396), 'numpy.array', 'np.array', (['target_predictions'], {}), '(target_predictions)\n', (2376, 2396), True, 'import numpy as np\n'), ((2740, 2793), 'pandas.DataFrame', 'pd.DataFr... |
from luminaire.model.base_model import BaseModel, BaseModelHyperParams
from luminaire.exploration.data_exploration import DataExploration
class WindowDensityHyperParams(BaseModelHyperParams):
"""
Hyperparameter class for Luminaire Window density model.
:param str freq: The frequency of the time-series. L... | [
"sklearn.preprocessing.StandardScaler",
"numpy.clip",
"scipy.stats.levene",
"numpy.mean",
"numpy.exp",
"numpy.std",
"luminaire.exploration.data_exploration.DataExploration",
"numpy.max",
"numpy.linspace",
"pandas.Timedelta",
"collections.Counter",
"scipy.stats.kde.gaussian_kde",
"scipy.stats... | [((15154, 15171), 'luminaire.exploration.data_exploration.DataExploration', 'DataExploration', ([], {}), '()\n', (15169, 15171), False, 'from luminaire.exploration.data_exploration import DataExploration\n'), ((37362, 37381), 'pandas.Timedelta', 'pd.Timedelta', (['"""10D"""'], {}), "('10D')\n", (37374, 37381), True, 'i... |
from unittest import TestCase
from unittest.mock import patch
import numpy as np
from exceptions import NoUriProviden
from main import calculate_average_face_encoding
from main import obtain_image_face_encodings
from main import parallelize_face_encodings
class TryTesting(TestCase):
def test_obtain_image_face_en... | [
"main.obtain_image_face_encodings",
"main.parallelize_face_encodings",
"unittest.mock.patch",
"main.calculate_average_face_encoding",
"numpy.ndarray"
] | [((622, 678), 'unittest.mock.patch', 'patch', (['"""main.IMAGE_DIRECTORY"""', '"""/path/that/doesnt/exist"""'], {}), "('main.IMAGE_DIRECTORY', '/path/that/doesnt/exist')\n", (627, 678), False, 'from unittest.mock import patch\n'), ((968, 1026), 'unittest.mock.patch', 'patch', (['"""main.obtain_image_face_encodings"""']... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
from davg.lanefinding.Prediction import Prediction
def plot_line(img, x, y, color=(255,255,0), thickness=2):
''' Takes an image and two arrays of x and y points similar to matplotlib
and writes the lines onto the image. If the points are floats... | [
"matplotlib.pyplot.show",
"cv2.polylines",
"numpy.average",
"davg.lanefinding.Prediction.Prediction.predict_next_values",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"davg.lanefinding.Prediction.Prediction.find_weighted_averages",
"numpy.diff",
"numpy.array",
"numpy.vstack"
] | [((472, 525), 'cv2.polylines', 'cv2.polylines', (['img', '[points]', '(False)', 'color', 'thickness'], {}), '(img, [points], False, color, thickness)\n', (485, 525), False, 'import cv2\n'), ((644, 682), 'numpy.zeros', 'np.zeros', (['(128, 128, 3)'], {'dtype': '"""uint8"""'}), "((128, 128, 3), dtype='uint8')\n", (652, 6... |
'''
@brief Leg-Rest Pos Recommendataion with DecisionTree Regressor
@author <NAME> <<EMAIL>>
@date 2021. 05. 21
'''
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor
import progressbar
'''
Presets & Hyper-parameters
'''
CONF... | [
"pandas.DataFrame",
"sklearn.tree.DecisionTreeRegressor",
"numpy.ravel",
"pandas.read_csv",
"progressbar.Bar",
"progressbar.Percentage",
"numpy.arange",
"pandas.set_option"
] | [((404, 439), 'pandas.set_option', 'pd.set_option', (['"""display.width"""', '(200)'], {}), "('display.width', 200)\n", (417, 439), True, 'import pandas as pd\n'), ((748, 807), 'pandas.read_csv', 'pd.read_csv', (['CONFIGURATION_FILE_PATH'], {'header': '(0)', 'index_col': '(0)'}), '(CONFIGURATION_FILE_PATH, header=0, in... |
import os
import os.path as osp
import re
import time
import shutil
import argparse
import subprocess
import multiprocessing
import cv2
import numpy as np
import pandas as pd
from requests_html import HTML
from selenium import webdriver
def check_banner(args):
valid = False
stage_dir = args[0]
banner_dir... | [
"pandas.DataFrame",
"subprocess.Popen",
"numpy.abs",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.basename",
"time.sleep",
"cv2.imread",
"re.findall",
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.Chrome",
"shutil.rmtree",
"os.path.join",
"os.listdir",
"cv2.resize",
"mu... | [((1762, 1787), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (1785, 1787), False, 'from selenium import webdriver\n'), ((1929, 1985), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (["args['driver']"], {'options': 'chrome_options'}), "(args['driver'], options=chrome_options)\n", (1... |
import argparse
import numpy as np
import struct
from matplotlib import gridspec
import matplotlib.pyplot as plt
from glob import glob
import os
from os.path import join
from natsort import natsorted
from skimage.transform import resize
import re
from tqdm import tqdm
""" Code to process depth/image/pose binaries the ... | [
"numpy.stack",
"matplotlib.pyplot.subplot",
"numpy.flip",
"argparse.ArgumentParser",
"os.makedirs",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"skimage.transform.resize",
"numpy.reshape",
"matplotlib.gridspec.GridSpec",
"os.path.join"
] | [((1955, 1991), 'numpy.reshape', 'np.reshape', (['file_content', '(192, 256)'], {}), '(file_content, (192, 256))\n', (1965, 1991), True, 'import numpy as np\n'), ((2260, 2296), 'numpy.reshape', 'np.reshape', (['file_content', '(192, 256)'], {}), '(file_content, (192, 256))\n', (2270, 2296), True, 'import numpy as np\n'... |
from root.config.main import rAnk, mAster_rank, cOmm
from screws.freeze.main import FrozenOnly
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
class _3dCSCG_1Trace_Visualize(FrozenOnly):
"""The visualization property/component of standard forms."""
def __init__(self, tf):
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.cm.ScalarMappable",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.array",
"numpy.min",
"numpy.linspace",
"root.config.main.cOmm.gather",
"numpy.sqrt"
] | [((1384, 1411), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', 'density'], {}), '(-1, 1, density)\n', (1395, 1411), True, 'import numpy as np\n'), ((1486, 1520), 'root.config.main.cOmm.gather', 'cOmm.gather', (['xyz'], {'root': 'mAster_rank'}), '(xyz, root=mAster_rank)\n', (1497, 1520), False, 'from root.config.main... |
import sympy as sy
from sympy.physics import mechanics as mc
import numpy as np
from sympy import sympify, nsimplify
from forward_kinematics import forward
from sympy import Integral, Matrix, pi, pprint
def Inverse_kin(T0_4, T0_3, T0_2, T0_1, X):
#Calculates inverse kinematics
f=T0_4[:3,3]
J_half=f.jacob... | [
"sympy.symbols",
"forward_kinematics.forward",
"numpy.matrix",
"numpy.array",
"sympy.nsimplify",
"numpy.linalg.pinv"
] | [((572, 616), 'sympy.nsimplify', 'nsimplify', (['J'], {'tolerance': '(0.001)', 'rational': '(True)'}), '(J, tolerance=0.001, rational=True)\n', (581, 616), False, 'from sympy import sympify, nsimplify\n'), ((760, 865), 'sympy.symbols', 'sy.symbols', (['"""R, theta, alpha, a, d, theta1, theta2, theta3, theta4, theta5, d... |
from __future__ import print_function, division
import logging
from time import time
import numpy as np
from ...core.exceptions import IncompatibleAttribute
from ...core.util import Pointer, split_component_view
from ...utils import view_shape, stack_view, color2rgb
from ...clients.image_client import ImageClient
f... | [
"numpy.dstack",
"ginga.util.wcsmod.use",
"numpy.clip",
"time.time",
"numpy.array",
"ginga.misc.Bunch.Bunch",
"numpy.linspace",
"numpy.broadcast_arrays",
"logging.getLogger"
] | [((508, 529), 'ginga.util.wcsmod.use', 'wcsmod.use', (['"""astropy"""'], {}), "('astropy')\n", (518, 529), False, 'from ginga.util import wcsmod\n'), ((12980, 13038), 'ginga.misc.Bunch.Bunch', 'Bunch.Bunch', ([], {'data': 'result', 'scale_x': 'scale_x', 'scale_y': 'scale_y'}), '(data=result, scale_x=scale_x, scale_y=sc... |
"""
Copyright (c) 2021 Intel Corporation
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 writin... | [
"nncf.tensorflow.quantization.quantizers.QuantizerConfig",
"tensorflow.ones",
"numpy.abs",
"nncf.tensorflow.quantization.quantizers.TFQuantizerSpec.from_config",
"tensorflow.keras.layers.Dense",
"nncf.tensorflow.quantization.utils.apply_overflow_fix_to_layer",
"nncf.tensorflow.layers.custom_objects.NNCF... | [((1862, 2021), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""bits,low,range_,narrow_range,ref"""', '[(7, -1, 2, False, -128 / 127), (7, -2, 2, True, -2)]'], {'ids': "['full_range', 'narrow_range']"}), "('bits,low,range_,narrow_range,ref', [(7, -1, 2, \n False, -128 / 127), (7, -2, 2, True, -2)], ids=[... |
"""
Script containing various utilities related to data processing and cleaning. Includes tokenization,
text cleaning, feature extractor (token type IDs & attention masks) for BERT, and IMDBDataset.
"""
import logging
import torch
from torch.utils.data import Dataset
import os
import pickle
import re
import numpy as ... | [
"pickle.dump",
"nltk.stem.WordNetLemmatizer",
"logging.warning",
"pickle.load",
"numpy.array",
"nltk.corpus.stopwords.words",
"re.sub",
"os.path.join",
"os.listdir",
"torch.tensor"
] | [((549, 568), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (566, 568), False, 'from nltk.stem import WordNetLemmatizer\n'), ((508, 534), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (523, 534), False, 'from nltk.corpus import stopwords\n'), ((702, ... |
# Modules
import pygame
import numpy as np
import random
from pygame.constants import KEYDOWN
import settings as s
# Initialize pygame
pygame.init()
# screen
screen = pygame.display.set_mode((s.WIDTH,s.HEIGHT))
# Title and Icon
pygame.display.set_caption('TIC TAC TOE')
icon = pygame.image.load('icon.png')
pygame.disp... | [
"pygame.draw.line",
"pygame.display.set_icon",
"pygame.font.SysFont",
"pygame.event.get",
"pygame.display.set_mode",
"numpy.zeros",
"random.choice",
"pygame.init",
"pygame.display.update",
"pygame.image.load",
"pygame.display.set_caption"
] | [((136, 149), 'pygame.init', 'pygame.init', ([], {}), '()\n', (147, 149), False, 'import pygame\n'), ((169, 213), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(s.WIDTH, s.HEIGHT)'], {}), '((s.WIDTH, s.HEIGHT))\n', (192, 213), False, 'import pygame\n'), ((230, 271), 'pygame.display.set_caption', 'pygame.disp... |
"""
A class for converting ``discretize`` meshes to OMF objects
"""
import omf
import numpy as np
import discretize
def ravel_data_array(arr, nx, ny, nz):
"""Ravel's a numpy array into proper order for passing to the OMF
specification from ``discretize``/UBC formats
"""
dim = (nz, ny, nx)
return ... | [
"discretize.TensorMesh",
"omf.VolumeElement",
"omf.VolumeGridGeometry",
"numpy.array",
"numpy.reshape"
] | [((1217, 1241), 'omf.VolumeGridGeometry', 'omf.VolumeGridGeometry', ([], {}), '()\n', (1239, 1241), False, 'import omf\n'), ((2589, 2625), 'omf.VolumeElement', 'omf.VolumeElement', ([], {'geometry': 'geometry'}), '(geometry=geometry)\n', (2606, 2625), False, 'import omf\n'), ((4741, 4765), 'discretize.TensorMesh', 'dis... |
import sys
import numpy as np
def tvDenoising1D(data, lamb):
"""
This function implements a 1-D Total Variation denoising according to <NAME>. (2013) "A direct algorithm for 1-D total variation denoising."
See also: `<NAME>. (2013). A direct algorithm for 1-D total variation denoising. IEEE Signal Process... | [
"pylab.hold",
"lmfit.models.LinearModel",
"pylab.show",
"numpy.multiply",
"numpy.argmax",
"numpy.argmin",
"numpy.max",
"numpy.min",
"numpy.array",
"numpy.loadtxt",
"lmfit.models.GaussianModel",
"pylab.plot"
] | [((4077, 4092), 'lmfit.models.GaussianModel', 'GaussianModel', ([], {}), '()\n', (4090, 4092), False, 'from lmfit.models import GaussianModel, LinearModel\n'), ((4106, 4119), 'lmfit.models.LinearModel', 'LinearModel', ([], {}), '()\n', (4117, 4119), False, 'from lmfit.models import GaussianModel, LinearModel\n'), ((453... |
"""Functions and utilities used to format the databases."""
import numpy as np
import jax.numpy as jnp
from scipy.integrate import quadrature
import tools21cm as t2c
def apply_uv_coverage(Box_uv, uv_bool):
"""Apply UV coverage to the data.
Args:
Box_uv: data box in Fourier space
uv_bool: mask... | [
"jax.numpy.array",
"jax.numpy.amax",
"jax.numpy.logical_or",
"jax.numpy.fft.fft",
"tools21cm.noise_model.noise_map",
"numpy.empty",
"tools21cm.telescope_functions.jansky_2_kelvin",
"jax.numpy.fft.fftfreq",
"tools21cm.noise_model.get_uv_map",
"numpy.append",
"tools21cm.cosmology.z_to_nu",
"jax.... | [((1580, 1635), 'numpy.append', 'np.append', (['redshifts', '(2 * redshifts[-1] - redshifts[-2])'], {}), '(redshifts, 2 * redshifts[-1] - redshifts[-2])\n', (1589, 1635), True, 'import numpy as np\n'), ((1698, 1736), 'numpy.empty', 'np.empty', (['uv.shape'], {'dtype': 'np.complex64'}), '(uv.shape, dtype=np.complex64)\n... |
# %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import warnings
from itertools import chain
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns... | [
"numpy.random.seed",
"scipy.linalg.orthogonal_procrustes",
"src.io.savefig",
"pandas.read_csv",
"src.traverse.to_transmission_matrix",
"src.cluster.get_paired_inds",
"src.traverse.RandomWalk",
"numpy.mean",
"graspy.cluster.AutoGMMCluster",
"sklearn.manifold.MDS",
"numpy.unique",
"src.graph.pre... | [((1450, 1519), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""ignore"""', 'category': 'ConvergenceWarning'}), "(action='ignore', category=ConvergenceWarning)\n", (1473, 1519), False, 'import warnings\n'), ((1813, 1875), 'seaborn.plotting_context', 'sns.plotting_context', ([], {'context': '""... |
import cv2
import rest
import numpy as np
class ChromaKeyServiceImpl(rest.ChromaKeyingService):
def replace(self, src_image_str, bg_image_str) -> bytes:
bg = cv2.imdecode(np.frombuffer(bg_image_str, np.uint8), cv2.IMREAD_COLOR)
img = cv2.imdecode(np.frombuffer(src_image_str, np.uint8), cv2.IMREAD... | [
"cv2.bitwise_not",
"cv2.bitwise_and",
"numpy.frombuffer",
"cv2.imencode",
"cv2.add",
"cv2.resize"
] | [((665, 686), 'cv2.bitwise_not', 'cv2.bitwise_not', (['mask'], {}), '(mask)\n', (680, 686), False, 'import cv2\n'), ((819, 855), 'cv2.bitwise_and', 'cv2.bitwise_and', (['img', 'img'], {'mask': 'mask'}), '(img, img, mask=mask)\n', (834, 855), False, 'import cv2\n'), ((870, 897), 'cv2.resize', 'cv2.resize', (['bg', '(128... |
# coding=utf-8
# Copyright 2022 HyperBO Authors.
#
# 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 ag... | [
"absl.testing.absltest.main",
"copy.deepcopy",
"numpy.random.seed",
"jax.random.normal",
"hyperbo.basics.linalg.inverse_spdmatrix_vector_product",
"jax.numpy.dot",
"jax.scipy.linalg.cholesky",
"numpy.random.randn",
"jax.numpy.vdot",
"jax.random.PRNGKey",
"jax.numpy.allclose",
"numpy.eye",
"j... | [((909, 926), 'jax.random.PRNGKey', 'random.PRNGKey', (['(0)'], {}), '(0)\n', (923, 926), False, 'from jax import random\n'), ((943, 960), 'jax.random.split', 'random.split', (['key'], {}), '(key)\n', (955, 960), False, 'from jax import random\n'), ((969, 1011), 'jax.random.normal', 'random.normal', (['subkey', 'params... |
"""
For more informations on the contents of this module:
- help(plastic.GenotypeMatrix)
- help(clustering.cluster_mutations)
--------
Module that exposes the clustering algorithm presented at
https://github.com/AlgoLab/celluloid
Simple example workflow:
from plastic import clustering
to_cluster = cl.GenotypeMatri... | [
"kmodes.kmodes.KModes",
"collections.defaultdict",
"numpy.vectorize",
"numpy.array"
] | [((2650, 2711), 'numpy.vectorize', 'np.vectorize', (['(lambda ai, bi: ai != 2 and bi != 2 and ai != bi)'], {}), '(lambda ai, bi: ai != 2 and bi != 2 and ai != bi)\n', (2662, 2711), True, 'import numpy as np\n'), ((4007, 4149), 'kmodes.kmodes.KModes', 'KModes', ([], {'n_clusters': 'k', 'cat_dissim': '_conflict_dissim', ... |
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import skimage
from sklearn import svm, metrics, datasets
from sklearn.utils import Bunch
from sklearn.model_selection import GridSearchCV, train_test_split
#import opencv
from skimage.io import imread
from skimage.transform import res... | [
"sklearn.utils.Bunch",
"time.time",
"pathlib.Path",
"numpy.array",
"skimage.transform.resize",
"sklearn.svm.SVC",
"skimage.io.imread"
] | [((360, 371), 'time.time', 'time.time', ([], {}), '()\n', (369, 371), False, 'import time\n'), ((2311, 2320), 'sklearn.svm.SVC', 'svm.SVC', ([], {}), '()\n', (2318, 2320), False, 'from sklearn import svm, metrics, datasets\n'), ((3544, 3555), 'time.time', 'time.time', ([], {}), '()\n', (3553, 3555), False, 'import time... |
import io
import math
from textwrap import wrap
from time import strftime, gmtime
import bezier
import matplotlib
import numpy as np
import pandas as pd
import seaborn as sns
from PIL import Image
from matplotlib import pyplot as plt
from ..utils import Log
def graph_bpm(map_obj):
"""
graphs the bpm changes... | [
"matplotlib.pyplot.title",
"seaborn.lineplot",
"matplotlib.pyplot.clf",
"textwrap.wrap",
"matplotlib.pyplot.box",
"numpy.arange",
"bezier.Curve",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"bezier.CurvedPolygon",
"numpy.insert",
"numpy.append",
"seaborn.set",
"io.BytesIO",
"matplotli... | [((1024, 1050), 'pandas.DataFrame', 'pd.DataFrame', (['chart_points'], {}), '(chart_points)\n', (1036, 1050), True, 'import pandas as pd\n'), ((1138, 1591), 'seaborn.set', 'sns.set', ([], {'rc': "{'axes.facecolor': col, 'text.color': (236 / 255, 239 / 255, 241 / 255),\n 'figure.facecolor': col, 'savefig.facecolor': ... |
import numpy as np
from sklearn.linear_model import LogisticRegression, SGDClassifier
from sklearn.pipeline import Pipeline
from soccer_xg.ml.preprocessing import simple_proc_for_linear_algoritms
def logreg_gridsearch_classifier(
numeric_features,
categoric_features,
learning_rate=0.08,
use_dask=False... | [
"sklearn.linear_model.SGDClassifier",
"soccer_xg.ml.preprocessing.simple_proc_for_linear_algoritms",
"numpy.logspace",
"sklearn.model_selection.RandomizedSearchCV",
"sklearn.linear_model.LogisticRegression"
] | [((1818, 1873), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {'max_iter': '(10000)', 'fit_intercept': '(False)'}), '(max_iter=10000, fit_intercept=False)\n', (1836, 1873), False, 'from sklearn.linear_model import LogisticRegression, SGDClassifier\n'), ((2275, 2390), 'sklearn.linear_model.SGDCla... |
import math
import random
import warnings
import numpy as np
import scipy.ndimage
import torch
from torch.autograd import Function
from torch.autograd.function import once_differentiable
import torch.backends.cudnn as cudnn
from util.logconf import logging
log = logging.getLogger(__name__)
# log.setLevel(logging.WAR... | [
"numpy.zeros_like",
"numpy.flip",
"warnings.simplefilter",
"numpy.random.random_sample",
"numpy.zeros",
"util.logconf.logging.getLogger",
"random.random",
"warnings.catch_warnings"
] | [((266, 293), 'util.logconf.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (283, 293), False, 'from util.logconf import logging\n'), ((1568, 1606), 'numpy.zeros', 'np.zeros', (['new_shape'], {'dtype': 'image.dtype'}), '(new_shape, dtype=image.dtype)\n', (1576, 1606), True, 'import numpy as... |
"""
Licensed under the terms of the BSD-3-Clause license.
Copyright (C) 2019 <NAME>, <EMAIL>
"""
from dataclasses import dataclass
from typing import ClassVar, Generator, Tuple, Union
import numpy as _np
from numpy.lib.stride_tricks import as_strided
from . audio import AudioFile
from . container import Params
from .... | [
"numpy.ceil",
"numpy.empty",
"numpy.lib.stride_tricks.as_strided",
"numpy.expand_dims"
] | [((12391, 12435), 'numpy.empty', '_np.empty', (['(n_segs, n_perseg)'], {'dtype': 'x.dtype'}), '((n_segs, n_perseg), dtype=x.dtype)\n', (12400, 12435), True, 'import numpy as _np\n'), ((14728, 14771), 'numpy.empty', '_np.empty', (['(n_ons, n_perseg)'], {'dtype': 'x.dtype'}), '((n_ons, n_perseg), dtype=x.dtype)\n', (1473... |
from abc import ABC, abstractmethod
from typing import Tuple, Union, Optional, Iterable
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
import numpy as np
from matplotlib import pyplot as plt
from scipy.stats import norm
from pyPDP.surrogate_models import SurrogateModel
from pyPDP.utils.plotting im... | [
"pyPDP.utils.utils.get_hyperparameters",
"pyPDP.utils.plotting.get_ax",
"numpy.asarray",
"scipy.stats.norm.pdf",
"scipy.stats.norm.cdf",
"numpy.argsort",
"pyPDP.utils.utils.get_selected_idx",
"pyPDP.utils.plotting.check_and_set_axis"
] | [((2469, 2479), 'pyPDP.utils.plotting.get_ax', 'get_ax', (['ax'], {}), '(ax)\n', (2475, 2479), False, 'from pyPDP.utils.plotting import get_ax, check_and_set_axis\n'), ((2508, 2565), 'pyPDP.utils.utils.get_hyperparameters', 'get_hyperparameters', (['x_hyperparameters', 'self.config_space'], {}), '(x_hyperparameters, se... |
from abc import ABC
from dataclasses import dataclass
from enum import Enum
from logging import getLogger
from typing import List, Tuple, Callable
from beamngpy import Scenario
_logger = getLogger("DriveBuild.SimNode.DBTypes.Criteria")
class KPValue(Enum):
"""
Represents the Kleene-Priest logic.
"""
... | [
"shapely.geometry.Point",
"shapely.geometry.Polygon",
"numpy.array",
"warnings.warn",
"drivebuildclient.static_vars",
"logging.getLogger"
] | [((189, 237), 'logging.getLogger', 'getLogger', (['"""DriveBuild.SimNode.DBTypes.Criteria"""'], {}), "('DriveBuild.SimNode.DBTypes.Criteria')\n", (198, 237), False, 'from logging import getLogger\n'), ((2936, 2979), 'drivebuildclient.static_vars', 'static_vars', ([], {'prefix': '"""criterion_"""', 'counter': '(0)'}), "... |
from unittest.mock import MagicMock, Mock, patch
import numpy as np
import pytest
from chitra.visualization.metrics import (
cm_accuracy,
detect_multilabel,
plot_confusion_matrix,
)
def test_detect_multilabel():
with pytest.raises(UserWarning):
detect_multilabel({"label1": "this will raise U... | [
"chitra.visualization.metrics.cm_accuracy",
"unittest.mock.MagicMock",
"numpy.asarray",
"chitra.visualization.metrics.plot_confusion_matrix",
"unittest.mock.patch",
"pytest.raises",
"chitra.visualization.metrics.detect_multilabel"
] | [((524, 565), 'unittest.mock.patch', 'patch', (['"""chitra.visualization.metrics.plt"""'], {}), "('chitra.visualization.metrics.plt')\n", (529, 565), False, 'from unittest.mock import MagicMock, Mock, patch\n'), ((346, 377), 'chitra.visualization.metrics.detect_multilabel', 'detect_multilabel', (['[1, 2, 3, 4]'], {}), ... |
# -*- coding: utf-8 -*-
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
POINTS = 1000
if __name__ == '__main__':
gauss1 = (np.random.randn(POINTS), np.random.randn(POINTS)*0.24);
gauss2 = (np.random.randn(POINTS)*0.28, np.random.randn(POINTS));
x1 = np.array(range(POINTS)) * 0.005
... | [
"matplotlib.pyplot.draw",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show",
"numpy.random.randn"
] | [((604, 637), 'matplotlib.pyplot.scatter', 'plt.scatter', (['cc[0]', 'cc[1]'], {'c': 'u"""b"""'}), "(cc[0], cc[1], c=u'b')\n", (615, 637), True, 'import matplotlib.pyplot as plt\n'), ((642, 675), 'matplotlib.pyplot.scatter', 'plt.scatter', (['dd[0]', 'dd[1]'], {'c': 'u"""r"""'}), "(dd[0], dd[1], c=u'r')\n", (653, 675),... |
# phaseplots.py - examples of phase portraits
# RMM, 24 July 2011
#
# This file contains examples of phase portraits pulled from "Feedback
# Systems" by <NAME> Murray (Princeton University Press, 2008).
import numpy as np
import matplotlib.pyplot as mpl
from control.phaseplot import phase_plot
from numpy import pi
#... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"matplotlib.pyplot.hold",
"matplotlib.pyplot.axis",
"control.phaseplot.phase_plot",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.linspace",
"matplotlib.pyplot.y... | [((360, 376), 'matplotlib.pyplot.close', 'mpl.close', (['"""all"""'], {}), "('all')\n", (369, 376), True, 'import matplotlib.pyplot as mpl\n'), ((603, 615), 'matplotlib.pyplot.figure', 'mpl.figure', ([], {}), '()\n', (613, 615), True, 'import matplotlib.pyplot as mpl\n'), ((617, 626), 'matplotlib.pyplot.clf', 'mpl.clf'... |
#!/usr/bin/python
# ----------------------------------------------------------------------------
# Copyright 2018 Intel
# 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.apac... | [
"argparse.ArgumentParser",
"tensorflow.local_variables_initializer",
"tensorflow.ConfigProto",
"tensorflow.Variable",
"tensorflow.RunOptions",
"psutil.cpu_count",
"tensorflow.placeholder",
"datetime.datetime.now",
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer",
"keras.backen... | [((827, 924), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Benchmark 3D and 2D Convolution Models"""', 'add_help': '(True)'}), "(description=\n 'Benchmark 3D and 2D Convolution Models', add_help=True)\n", (850, 924), False, 'import argparse\n'), ((4769, 4889), 'tensorflow.ConfigProt... |
import numpy as np
a = np.array([1,2,3,4,5,6]) #_ rewrite it!
b = np.array([0,1,2,3,4,5]) #_ rewrite it!
| [
"numpy.array"
] | [((24, 52), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6]'], {}), '([1, 2, 3, 4, 5, 6])\n', (32, 52), True, 'import numpy as np\n'), ((68, 96), 'numpy.array', 'np.array', (['[0, 1, 2, 3, 4, 5]'], {}), '([0, 1, 2, 3, 4, 5])\n', (76, 96), True, 'import numpy as np\n')] |
#!/Users/marc/miniconda3/bin/python3
import glfw
from OpenGL.GL import *
from OpenGL.GLU import *
import math
import ctypes
def framebuffer_size_callback(window, width, height):
# make sure the viewport matches the new window dimensions; note that width and
# height will be significantly larger than specifi... | [
"glfw.window_hint",
"myshader.shader",
"glfw.poll_events",
"glfw.make_context_current",
"glfw.set_window_should_close",
"glfw.window_should_close",
"glfw.get_time",
"math.sin",
"glfw.init",
"glfw.get_key",
"numpy.array",
"ctypes.c_void_p",
"glfw.set_framebuffer_size_callback",
"math.cos",
... | [((1086, 1146), 'glfw.create_window', 'glfw.create_window', (['width', 'height', '"""LearnOpenGL"""', 'None', 'None'], {}), "(width, height, 'LearnOpenGL', None, None)\n", (1104, 1146), False, 'import glfw\n'), ((1234, 1267), 'glfw.make_context_current', 'glfw.make_context_current', (['window'], {}), '(window)\n', (125... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 14 09:52:17 2018
@author: liaamaral
"""
#------
# Load the main libraries
import os
import csv
import numpy as np
import pandas as pd
import logging
#------
# Data input and output paths:
pathin="/media/DATA/tmp/datasets/subsetDB/rain/" # Path of... | [
"os.listdir",
"logging.debug",
"numpy.isfinite",
"os.path.splitext",
"os.path.join",
"pandas.concat"
] | [((630, 648), 'os.listdir', 'os.listdir', (['pathin'], {}), '(pathin)\n', (640, 648), False, 'import os\n'), ((1151, 1222), 'pandas.concat', 'pd.concat', (['frames'], {'sort': '(False)', 'ignore_index': '(True)', 'verify_integrity': '(True)'}), '(frames, sort=False, ignore_index=True, verify_integrity=True)\n', (1160, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@contact: <EMAIL>
@software: PyCharm
@file: cam_sal_to_seed.py
@time: 2020/3/27 1:10
@desc:
"""
import numpy as np
from contrib.tasks.wsss.seeding.e2e_seeding.resolve_loc_cue_conflict import resolve_loc_cue_conflict_by_area_order
__all__ = ["cam_sal_to_... | [
"numpy.amax",
"numpy.zeros",
"contrib.tasks.wsss.seeding.e2e_seeding.resolve_loc_cue_conflict.resolve_loc_cue_conflict_by_area_order"
] | [((916, 992), 'numpy.zeros', 'np.zeros', ([], {'shape': '(cam.shape[0], cam.shape[1], cam.shape[2] + 1)', 'dtype': 'np.int'}), '(shape=(cam.shape[0], cam.shape[1], cam.shape[2] + 1), dtype=np.int)\n', (924, 992), True, 'import numpy as np\n'), ((1357, 1448), 'contrib.tasks.wsss.seeding.e2e_seeding.resolve_loc_cue_confl... |
from __future__ import division
import librosa, pydub
import numpy as np
from tempfile import TemporaryFile
import pickle, json, os
class mash:
def __init__(self, json_, cached=False):
self.sr = 22050 # new Sampling Rate for the audio files
self.songs = json_
self.Yin = []
self.... | [
"numpy.absolute",
"pickle.dump",
"librosa.frames_to_time",
"os.makedirs",
"numpy.argmax",
"os.path.exists",
"tempfile.TemporaryFile",
"numpy.max",
"pickle.load",
"librosa.load",
"librosa.beat.beat_track",
"pydub.AudioSegment.from_file",
"numpy.sqrt",
"librosa.get_duration"
] | [((2481, 2528), 'librosa.beat.beat_track', 'librosa.beat.beat_track', ([], {'y': 'self.Yin', 'sr': 'self.sr'}), '(y=self.Yin, sr=self.sr)\n', (2504, 2528), False, 'import librosa, pydub\n'), ((2576, 2624), 'librosa.beat.beat_track', 'librosa.beat.beat_track', ([], {'y': 'self.Yout', 'sr': 'self.sr'}), '(y=self.Yout, sr... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | [
"megengine.functional.nn.cross_entropy",
"megengine.tensor",
"numpy.log",
"numpy.random.randn",
"numpy.random.rand",
"pytest.raises",
"numpy.random.randint",
"numpy.array",
"numpy.exp",
"numpy.random.permutation"
] | [((627, 658), 'megengine.functional.nn.cross_entropy', 'F.nn.cross_entropy', (['data', 'label'], {}), '(data, label)\n', (645, 658), True, 'import megengine.functional as F\n'), ((764, 795), 'megengine.functional.nn.cross_entropy', 'F.nn.cross_entropy', (['data', 'label'], {}), '(data, label)\n', (782, 795), True, 'imp... |
#!/usr/bin/env python3
from cv_bridge import CvBridge, CvBridgeError
import cv2
import rospy
from sensor_msgs.msg import Image
from gazebo_msgs.srv import GetModelState
from tf.transformations import euler_from_quaternion
import numpy as np
import json
import os
data_dir = os.path.abspath( os.path.join(os.path.dirnam... | [
"rospy.Subscriber",
"rospy.ServiceProxy",
"numpy.sin",
"os.path.dirname",
"rospy.init_node",
"cv2.destroyAllWindows",
"cv2.circle",
"numpy.min",
"numpy.cos",
"cv_bridge.CvBridge",
"json.load",
"numpy.flip",
"cv2.putText",
"numpy.deg2rad",
"rospy.get_rostime",
"rospy.Publisher",
"nump... | [((374, 409), 'rospy.init_node', 'rospy.init_node', (['"""satview_streamer"""'], {}), "('satview_streamer')\n", (389, 409), False, 'import rospy\n'), ((428, 438), 'cv_bridge.CvBridge', 'CvBridge', ([], {}), '()\n', (436, 438), False, 'from cv_bridge import CvBridge, CvBridgeError\n'), ((700, 760), 'rospy.ServiceProxy',... |
import csv
import numpy as np
import os
import sklearn
from sklearn import datasets
from sklearn import neighbors, datasets, preprocessing
from sklearn.decomposition import PCA
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import tra... | [
"sklearn.ensemble.RandomForestClassifier",
"numpy.load",
"numpy.nan_to_num",
"numpy.savetxt",
"numpy.zeros",
"sklearn.linear_model.LogisticRegression",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.decomposition.PCA",
"sklearn.multioutput.MultiOutputClassifier"
] | [((573, 594), 'numpy.zeros', 'np.zeros', (['(2705, 147)'], {}), '((2705, 147))\n', (581, 594), True, 'import numpy as np\n'), ((730, 804), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {'random_state': '(0)', 'solver': '"""saga"""', 'n_jobs': '(-1)', 'max_iter': '(250)'}), "(random_state=0, solv... |
# coding: utf-8
# In[ ]:
import numpy
import sys
import glob
import matplotlib.pyplot
def analyze(filename):
data = numpy.loadtxt(fname=filename, delimiter=',')
fig = matplotlib.pyplot.figure(figsize=(10.0,3.0))
axes1 = fig.add_subplot(1,3,1)
axes2 = fig.add_subplot(1,3,2)
axes3 = fig.ad... | [
"numpy.min",
"numpy.mean",
"numpy.max",
"numpy.loadtxt",
"glob.glob"
] | [((130, 174), 'numpy.loadtxt', 'numpy.loadtxt', ([], {'fname': 'filename', 'delimiter': '""","""'}), "(fname=filename, delimiter=',')\n", (143, 174), False, 'import numpy\n'), ((667, 709), 'numpy.loadtxt', 'numpy.loadtxt', ([], {'fname': 'f_name', 'delimiter': '""","""'}), "(fname=f_name, delimiter=',')\n", (680, 709),... |
import numpy as np
import pytest
import numpy.testing as npt
from lenstronomy.Util import util
import lenstronomy.Util.param_util as param_util
def test_cart2polar():
#singel 2d coordinate transformation
center_x, center_y = 0, 0
x = 1
y = 1
r, phi = param_util.cart2polar(x, y, center_x, center_y)... | [
"lenstronomy.Util.param_util.cart2polar",
"lenstronomy.Util.param_util.shear_polar2cartesian",
"numpy.testing.assert_almost_equal",
"numpy.allclose",
"lenstronomy.Util.util.make_grid",
"lenstronomy.Util.param_util.shear_cartesian2polar",
"pytest.main",
"numpy.sin",
"numpy.array",
"numpy.cos",
"l... | [((273, 320), 'lenstronomy.Util.param_util.cart2polar', 'param_util.cart2polar', (['x', 'y', 'center_x', 'center_y'], {}), '(x, y, center_x, center_y)\n', (294, 320), True, 'import lenstronomy.Util.param_util as param_util\n'), ((429, 445), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (437, 445), True, 'i... |
"""
.. _tut-fnirs-glm-components:
GLM and Design Matrix Parameters
================================
This tutorial describes the various design choices available when analysing
fNIRS data with a GLM approach.
.. sidebar:: Nilearn
If you use MNE-NIRS to conduct a GLM analysis please cite Nilearn.
This package r... | [
"matplotlib.pyplot.title",
"nilearn.glm.first_level.spm_hrf",
"os.path.join",
"numpy.zeros_like",
"matplotlib.colors.Normalize",
"nilearn.plotting.plot_design_matrix",
"matplotlib.cm.ScalarMappable",
"nilearn.glm.first_level.compute_regressor",
"nilearn.glm.first_level.glover_hrf",
"numpy.linspace... | [((3942, 4009), 'nilearn.glm.first_level.glover_hrf', 'first_level.glover_hrf', (['(1)'], {'oversampling': '(50)', 'time_length': 'time_length'}), '(1, oversampling=50, time_length=time_length)\n', (3964, 4009), False, 'from nilearn.glm import first_level\n'), ((4027, 4091), 'nilearn.glm.first_level.spm_hrf', 'first_le... |
# -*- coding: utf-8 -*-
r"""
=================================
Wasserstein unmixing with PyTorch
=================================
In this example we estimate mixing parameters from distributions that minimize
the Wasserstein distance. In other words we suppose that a target
distribution :math:`\mu^t` can be expressed... | [
"ot.emd2",
"torch.tensor",
"matplotlib.pylab.scatter",
"matplotlib.pylab.legend",
"ot.unif",
"ot.dist",
"numpy.zeros",
"numpy.random.RandomState",
"torch.mv",
"matplotlib.pylab.xlabel",
"ot.utils.proj_simplex",
"matplotlib.pylab.semilogy",
"matplotlib.pylab.title",
"torch.no_grad",
"matp... | [((1453, 1477), 'numpy.random.RandomState', 'np.random.RandomState', (['(2)'], {}), '(2)\n', (1474, 1477), True, 'import numpy as np\n'), ((1639, 1665), 'numpy.concatenate', 'np.concatenate', (['(xs1, xs2)'], {}), '((xs1, xs2))\n', (1653, 1665), True, 'import numpy as np\n'), ((1701, 1718), 'numpy.zeros', 'np.zeros', (... |
"""
GTSAM Copyright 2010-2018, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
Authors: <NAME>, et al. (see THANKS for the full author list)
See LICENSE for the license information
Kinematics of three-link manipulator with GTSAM poses and product of exponential maps.
Author: <NAME>
... | [
"unittest.main",
"numpy.stack",
"gtsam.Pose2",
"math.radians",
"numpy.remainder",
"math.sin",
"gtsam.Pose2.Expmap",
"numpy.append",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.linalg.norm",
"numpy.linspace",
"numpy.linalg.inv",
"math.cos",
"numpy.linalg.pinv",
"numpy.testing.asse... | [((775, 810), 'numpy.array', 'np.array', (['[x, y, z]'], {'dtype': 'np.float'}), '([x, y, z], dtype=np.float)\n', (783, 810), True, 'import numpy as np\n'), ((10685, 10703), 'matplotlib.pyplot.figure', 'plt.figure', (['fignum'], {}), '(fignum)\n', (10695, 10703), True, 'import matplotlib.pyplot as plt\n'), ((11207, 112... |
import operator
import os
import re
import sys
import time
from collections import deque
from functools import reduce
import numpy as np
def read_input() -> list[list[int]]:
# Read lines input:
# 2199943210
# 3987894921
# 9856789892
# 8767896789
# 9899965678
# return list with lists of in... | [
"os.path.basename",
"time.process_time",
"numpy.array",
"re.search",
"collections.deque"
] | [((1912, 1919), 'collections.deque', 'deque', ([], {}), '()\n', (1917, 1919), False, 'from collections import deque\n'), ((3345, 3364), 'time.process_time', 'time.process_time', ([], {}), '()\n', (3362, 3364), False, 'import time\n'), ((3441, 3460), 'time.process_time', 'time.process_time', ([], {}), '()\n', (3458, 346... |
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
def plot_image_frame(image_frame):
"""
utils for plot image frames
:param image_frame: list of images
"""
for ii, image in enumerate(image_frame):
plt.figure()
if isinstance(image, list):
image = image[0]
plt.imsh... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.ylabel",
"m... | [((558, 578), 'numpy.array', 'np.array', (['pose_frame'], {}), '(pose_frame)\n', (566, 578), True, 'import numpy as np\n'), ((673, 700), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 7)'}), '(figsize=(12, 7))\n', (683, 700), True, 'import matplotlib.pyplot as plt\n'), ((706, 725), 'numpy.arange', 'np... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import tempfile
import shutil
import numpy as np
import pytest
from datetime import datetime
import os
from urllib.parse import urlparse
import re
from unittest.mock import Mock, patch
from astropy import coordinates
from astropy import units as u
from a... | [
"astropy.units.Unit",
"os.path.join",
"shutil.rmtree",
"os.path.split",
"unittest.mock.Mock",
"pytest.fixture",
"urllib.parse.urlparse",
"unittest.mock.patch",
"datetime.datetime.utcnow",
"datetime.datetime.strptime",
"tempfile.mkdtemp",
"pytest.mark.skipif",
"pytest.raises",
"pytest.mark.... | [((27292, 27350), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dataarchive_url"""', '_test_url_list'], {}), "('dataarchive_url', _test_url_list)\n", (27315, 27350), False, 'import pytest\n'), ((27352, 27407), 'pytest.mark.skip', 'pytest.mark.skip', (['"""Not working for now - Investigating"""'], {}), "('... |
# --------------
# Importing header files
import numpy as np
# Path of the file has been stored in variable called 'path'
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Code starts here
data=np.genfromtxt(path,delimiter=",",skip_header=1)
##print(data)
census=np.concatenate((data,new_record))
... | [
"numpy.sum",
"numpy.std",
"numpy.genfromtxt",
"numpy.max",
"numpy.mean",
"numpy.min",
"numpy.array",
"numpy.concatenate"
] | [((215, 264), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (228, 264), True, 'import numpy as np\n'), ((286, 320), 'numpy.concatenate', 'np.concatenate', (['(data, new_record)'], {}), '((data, new_record))\n', (300, 320), True... |
#! /usr/bin/env python3
"""与加载了RNN Classifier导出的Servable的TensorFlow Serving进行通信
"""
import numpy as np
import jieba
import tensorlayer as tl
from grpc.beta import implementations
import predict_pb2
import prediction_service_pb2
from packages import text_regularization as tr
def text_tensor(text, wv):
"""获取文本向量
... | [
"tensorlayer.files.load_npy_to_any",
"jieba.cut",
"prediction_service_pb2.beta_create_PredictionService_stub",
"predict_pb2.PredictRequest",
"numpy.asarray",
"packages.text_regularization.extractWords"
] | [((965, 1039), 'tensorlayer.files.load_npy_to_any', 'tl.files.load_npy_to_any', ([], {'name': '"""../word2vec/output/model_word2vec_200.npy"""'}), "(name='../word2vec/output/model_word2vec_200.npy')\n", (989, 1039), True, 'import tensorlayer as tl\n'), ((1143, 1209), 'prediction_service_pb2.beta_create_PredictionServic... |
import numpy as np
import tensorflow as tf
def mmd_penalty(sample_qz, sample_pz, pz_scale, kernel='RBF'):
sigma2_p = pz_scale ** 2
n, d = sample_pz.get_shape().as_list()
n = tf.cast(n, tf.int32)
nf = tf.cast(n, tf.float32)
half_size = (n * n - n) / 2
norms_pz = tf.reduce_sum(tf.square(sample_p... | [
"tensorflow.reduce_sum",
"tensorflow.random.normal",
"tensorflow.global_variables_initializer",
"tensorflow.eye",
"tensorflow.Session",
"tensorflow.transpose",
"tensorflow.cast",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.exp",
"numpy.linspace",
"tensorflow.square"
] | [((187, 207), 'tensorflow.cast', 'tf.cast', (['n', 'tf.int32'], {}), '(n, tf.int32)\n', (194, 207), True, 'import tensorflow as tf\n'), ((217, 239), 'tensorflow.cast', 'tf.cast', (['n', 'tf.float32'], {}), '(n, tf.float32)\n', (224, 239), True, 'import tensorflow as tf\n'), ((366, 415), 'tensorflow.matmul', 'tf.matmul'... |
from pouring_base import Pouring_base
from gym import spaces
from scipy.spatial.transform import Rotation as R
from collections import deque
import math
import numpy as np
import os,sys
FILE_PATH = os.path.abspath(os.path.dirname(__file__))
class Pouring_featured(Pouring_base):
"""A concrete water-pouring gym envi... | [
"os.path.dirname",
"numpy.array",
"gym.spaces.Box",
"scipy.spatial.transform.Rotation.from_matrix"
] | [((215, 240), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (230, 240), False, 'import os, sys\n'), ((1024, 1062), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-1)', 'high': '(1)', 'shape': '(3,)'}), '(low=-1, high=1, shape=(3,))\n', (1034, 1062), False, 'from gym import spaces\n'), ((1094... |
'''
Functions to call appropriate constructor functions based on UI data and to link decoder objects in the database
'''
import os
import re
import tempfile
import xmlrpc.client
import pickle
import json
import logging
import numpy as np
from celery import task, chain
from django.http import HttpResponse
from riglib.... | [
"tempfile.NamedTemporaryFile",
"pickle.dump",
"riglib.bmi.train.rescale_KFDecoder_units",
"riglib.bmi.sskfdecoder.SteadyStateKalmanFilter",
"celery.chain",
"os.path.basename",
"riglib.bmi.sskfdecoder.SSKFDecoder",
"riglib.bmi.train._interpolate_KFDecoder_state_between_updates",
"numpy.array",
"rig... | [((2464, 2500), 're.compile', 're.compile', (['"""(\\\\d{1,3})\\\\s*(\\\\w{1})"""'], {}), "('(\\\\d{1,3})\\\\s*(\\\\w{1})')\n", (2474, 2500), False, 'import re\n'), ((6088, 6121), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', (['"""wb"""'], {}), "('wb')\n", (6115, 6121), False, 'import tempfile\n'), ((6... |
"""
PREPARE
Before running train, you need to run prepare.py with the respective task.
Example (in the command line):
> cd to root dir
> conda activate nlp
> python src/prepare.py --do_format --task 1
"""
#NOTE: the following is a workaround for AML to load modules
import os, sys; sys.path.append(os.path.dirname(os.p... | [
"argparse.ArgumentParser",
"helper.load_spacy_model",
"custom.filter_qa",
"custom.load_qa",
"helper.get_logger",
"sys.path.append",
"pandas.DataFrame",
"re.sub",
"pandas.concat",
"os.path.realpath",
"custom.load_text",
"pandas.Series",
"data.Data",
"helper.remove_short",
"custom.get_plac... | [((537, 561), 'sys.path.append', 'sys.path.append', (['"""./src"""'], {}), "('./src')\n", (552, 561), False, 'import sys\n'), ((630, 662), 'helper.get_logger', 'he.get_logger', ([], {'location': '__name__'}), '(location=__name__)\n', (643, 662), True, 'import helper as he\n'), ((11464, 11482), 'custom.load_text', 'cu.l... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
import sys
import os
import pickle
def extract_points(images):
'''
args:
- images: list of strings containing the filenames of the calibration image set
returns:
- mtx: camera ... | [
"cv2.findChessboardCorners",
"matplotlib.image.imread",
"os.makedirs",
"cv2.cvtColor",
"numpy.zeros",
"cv2.imread",
"cv2.calibrateCamera",
"glob.glob",
"cv2.undistort"
] | [((398, 430), 'numpy.zeros', 'np.zeros', (['(6 * 9, 3)', 'np.float32'], {}), '((6 * 9, 3), np.float32)\n', (406, 430), True, 'import numpy as np\n'), ((844, 917), 'cv2.calibrateCamera', 'cv2.calibrateCamera', (['obj_points', 'img_points', 'gray.shape[::-1]', 'None', 'None'], {}), '(obj_points, img_points, gray.shape[::... |
"""
DEPRECATED
USE kwcoco.metrics instead!
Faster pure-python versions of sklearn functions that avoid expensive checks
and label rectifications. It is assumed that all labels are consecutive
non-negative integers.
"""
from scipy.sparse import coo_matrix
import numpy as np
def confusion_matrix(y_true, y_pred, n_lab... | [
"numpy.diag",
"scipy.sparse.coo_matrix",
"numpy.nan_to_num"
] | [((1890, 1903), 'numpy.diag', 'np.diag', (['cfsn'], {}), '(cfsn)\n', (1897, 1903), True, 'import numpy as np\n'), ((2121, 2134), 'numpy.diag', 'np.diag', (['cfsn'], {}), '(cfsn)\n', (2128, 2134), True, 'import numpy as np\n'), ((1645, 1738), 'scipy.sparse.coo_matrix', 'coo_matrix', (['(sample_weight, (y_true, y_pred))'... |
"""
YANK Health Report Notebook formatter
This module handles all the figure formatting and processing to minimize the code shown in the Health Report Jupyter
Notebook. All data processing and analysis is handled by the main multistate.analyzers package,
mainly image formatting is passed here.
"""
import os
import y... | [
"matplotlib.colors.LinearSegmentedColormap",
"numpy.floor",
"yaml.dump",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"pymbar.MBAR",
"numpy.unique",
"numpy.linspace",
"scipy.interpolate.splrep",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.get_cmap",
"numpy.ceil",
"numpy.z... | [((3800, 3834), 'matplotlib.gridspec.GridSpec', 'gridspec.GridSpec', (['self.nphases', '(1)'], {}), '(self.nphases, 1)\n', (3817, 3834), False, 'from matplotlib import gridspec\n'), ((3891, 3903), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3901, 3903), True, 'from matplotlib import pyplot as plt\n'), ... |
import math
import numpy as np
from typing import Dict
from typing import List
from typing import Union
from typing import Iterator
from typing import Optional
from .types import *
from .data_types import *
from .normalizers import *
from .distributions import *
from ...misc import *
params_type = Dict[str, Union[Da... | [
"math.isinf",
"numpy.array"
] | [((2877, 2899), 'math.isinf', 'math.isinf', (['num_params'], {}), '(num_params)\n', (2887, 2899), False, 'import math\n'), ((4226, 4259), 'numpy.array', 'np.array', (['bounds_list', 'np.float32'], {}), '(bounds_list, np.float32)\n', (4234, 4259), True, 'import numpy as np\n')] |
"""EM 算法的实现
"""
import copy
import math
import matplotlib.pyplot as plt
import numpy as np
isdebug = True
# 指定k个高斯分布参数,这里指定k=2。注意2个高斯分布具有相同均方差Sigma,均值分别为Mu1,Mu2。
def init_data(Sigma, Mu1, Mu2, k, N):
global X
global Mu
global Expectations
X = np.zeros((1, N))
Mu = np.random.random(k)
Expect... | [
"copy.deepcopy",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"numpy.zeros",
"numpy.random.random",
"numpy.random.normal"
] | [((264, 280), 'numpy.zeros', 'np.zeros', (['(1, N)'], {}), '((1, N))\n', (272, 280), True, 'import numpy as np\n'), ((290, 309), 'numpy.random.random', 'np.random.random', (['k'], {}), '(k)\n', (306, 309), True, 'import numpy as np\n'), ((329, 345), 'numpy.zeros', 'np.zeros', (['(N, k)'], {}), '((N, k))\n', (337, 345),... |
import os
import h5py
import pytest
import numpy as np
import pandas as pd
import automatic_speech_recognition as asr
@pytest.fixture
def dataset() -> asr.dataset.Features:
file_path = 'test.h5'
reference = pd.DataFrame({
'path': [f'dataset/{i}' for i in range(10)],
'transcript': [f'transcript... | [
"automatic_speech_recognition.dataset.Features.from_hdf",
"os.remove",
"h5py.File",
"pandas.HDFStore",
"numpy.random.random"
] | [((595, 649), 'automatic_speech_recognition.dataset.Features.from_hdf', 'asr.dataset.Features.from_hdf', (['file_path'], {'batch_size': '(3)'}), '(file_path, batch_size=3)\n', (624, 649), True, 'import automatic_speech_recognition as asr\n'), ((896, 916), 'os.remove', 'os.remove', (['"""test.h5"""'], {}), "('test.h5')\... |
"""
This is an implementation of paper
"Attention-based LSTM for Aspect-level Sentiment Classification" with Keras.
Based on dataset from "SemEval 2014 Task 4".
"""
import os
from time import time
# TODO, Here we need logger!
import numpy as np
from lxml import etree
from keras.preprocessing.text import Tokenizer
fr... | [
"keras.models.load_model",
"keras.regularizers.l2",
"numpy.load",
"numpy.random.seed",
"numpy.argmax",
"keras.preprocessing.sequence.pad_sequences",
"keras.optimizers.Adagrad",
"keras.models.Model",
"numpy.arange",
"keras.layers.Input",
"keras.activations.softmax",
"keras.layers.Reshape",
"o... | [((1528, 1550), 'lxml.etree.parse', 'etree.parse', (['data_file'], {}), '(data_file)\n', (1539, 1550), False, 'from lxml import etree\n'), ((11765, 11771), 'time.time', 'time', ([], {}), '()\n', (11769, 11771), False, 'from time import time\n'), ((15107, 15129), 'numpy.load', 'np.load', (['emb_mtrx_file'], {}), '(emb_m... |
import math
import itertools as itt
import numpy as np
from collections import namedtuple
from datetime import datetime
from scipy.special import gamma
from sklearn.neighbors import BallTree
import random
from pywde.pywt_ext import WaveletTensorProduct
from pywde.common import all_zs_tensor
class dictwithfactory(dic... | [
"numpy.amin",
"math.fabs",
"math.sqrt",
"numpy.power",
"scipy.special.gamma",
"numpy.zeros",
"numpy.amax",
"sklearn.neighbors.BallTree",
"numpy.array",
"collections.namedtuple",
"random.seed",
"pywde.pywt_ext.WaveletTensorProduct",
"pywde.common.all_zs_tensor",
"datetime.datetime.now",
"... | [((35069, 35143), 'collections.namedtuple', 'namedtuple', (['"""BallsInfo"""', "['sqrt_vol_k', 'sqrt_vol_k_plus_1', 'nn_indexes']"], {}), "('BallsInfo', ['sqrt_vol_k', 'sqrt_vol_k_plus_1', 'nn_indexes'])\n", (35079, 35143), False, 'from collections import namedtuple\n'), ((34883, 34897), 'numpy.array', 'np.array', (['r... |
#!/usr/bin/env python
# <examples/doc_mode_savemodel.py>
import numpy as np
from lmfit.model import Model, save_model
def mysine(x, amp, freq, shift):
return amp * np.sin(x*freq + shift)
sinemodel = Model(mysine)
pars = sinemodel.make_params(amp=1, freq=0.25, shift=0)
save_model(sinemodel, 'sinemodel.sav')
#... | [
"lmfit.model.save_model",
"numpy.sin",
"lmfit.model.Model"
] | [((209, 222), 'lmfit.model.Model', 'Model', (['mysine'], {}), '(mysine)\n', (214, 222), False, 'from lmfit.model import Model, save_model\n'), ((280, 318), 'lmfit.model.save_model', 'save_model', (['sinemodel', '"""sinemodel.sav"""'], {}), "(sinemodel, 'sinemodel.sav')\n", (290, 318), False, 'from lmfit.model import Mo... |
import numpy as np
import scipy.special as sp
import matplotlib.pyplot as plt
# radius of the oberservation circle
def NMLA_radius(omega,Rest=1):
# Input: omega--frequency; Rest--estimate of the distance from source to observation point
#
# Output: the radius of the oberservation circle
poly = [1,... | [
"numpy.roots",
"numpy.fft.ifft",
"matplotlib.pyplot.show",
"numpy.abs",
"numpy.sum",
"numpy.fft.fft",
"numpy.sin",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"scipy.special.jv",
"numpy.real",
"numpy.cos",
"matplotlib.pyplot.xlabel"
] | [((363, 377), 'numpy.roots', 'np.roots', (['poly'], {}), '(poly)\n', (371, 377), True, 'import numpy as np\n'), ((918, 932), 'scipy.special.jv', 'sp.jv', (['idx', 'kr'], {}), '(idx, kr)\n', (923, 932), True, 'import scipy.special as sp\n'), ((961, 987), 'numpy.array', 'np.array', (['([0.0] * (LP - 1))'], {}), '([0.0] *... |
'''
Created on Oct 26, 2015
@author: wirkert
'''
import numpy as np
import pandas as pd
from sklearn.preprocessing import Normalizer
def preprocess2(df, nr_samples=None, snr=None, movement_noise_sigma=None,
magnification=None, bands_to_sortout=None):
# first set 0 reflectances to nan
df["re... | [
"numpy.log",
"numpy.zeros",
"numpy.ones",
"numpy.clip",
"numpy.random.normal",
"numpy.diag",
"sklearn.preprocessing.Normalizer",
"pandas.concat",
"numpy.delete",
"numpy.vstack"
] | [((2277, 2299), 'numpy.clip', 'np.clip', (['X', '(1e-05)', '(1.0)'], {}), '(X, 1e-05, 1.0)\n', (2284, 2299), True, 'import numpy as np\n'), ((2715, 2736), 'sklearn.preprocessing.Normalizer', 'Normalizer', ([], {'norm': '"""l1"""'}), "(norm='l1')\n", (2725, 2736), False, 'from sklearn.preprocessing import Normalizer\n')... |
'''
Functions to go in here (I think!?):
KC: 01/12/2018, ideas-
KC: 19/12/2018, added-
~NuSTAR class
'''
from . import data_handling
import sys
#from os.path import *
import os
from os.path import isfile
import astropy
from astropy.io import fits
import astropy.units as u
import matplotlib
import matplot... | [
"matplotlib.pyplot.title",
"os.mkdir",
"pickle.dump",
"numpy.sum",
"numpy.argmax",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.subplot2grid",
"os.walk",
"numpy.isnan",
"numpy.argmin",
"numpy.shape",
"matplotlib.pyplot.figure",
"pickle.load",
"numpy.arange",
"matplotlib.colors.LogNorm",
... | [((1121, 1153), 'pandas.plotting.register_matplotlib_converters', 'register_matplotlib_converters', ([], {}), '()\n', (1151, 1153), False, 'from pandas.plotting import register_matplotlib_converters\n'), ((1288, 1332), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='i... |
# Generator functions to generate batches of data.
import numpy as np
import os
import time
import h5py
import matplotlib.pyplot as plt
import collections
from synth.config import config
from synth.utils import utils
def data_gen_SDN(mode = 'Train', sec_mode = 0):
with h5py.File(config.stat_file, mode='r') ... | [
"numpy.random.uniform",
"h5py.File",
"numpy.median",
"numpy.clip",
"numpy.array",
"synth.config.config.singers.index",
"numpy.random.rand",
"os.path.join",
"os.listdir"
] | [((282, 319), 'h5py.File', 'h5py.File', (['config.stat_file'], {'mode': '"""r"""'}), "(config.stat_file, mode='r')\n", (291, 319), False, 'import h5py\n'), ((4725, 4746), 'numpy.array', 'np.array', (['feats_targs'], {}), '(feats_targs)\n', (4733, 4746), True, 'import numpy as np\n'), ((4769, 4790), 'numpy.array', 'np.a... |
import numpy as np
import pandas as pd
import scipy.sparse as sp
from sklearn.metrics.pairwise import cosine_similarity
class Evaluator():
def __init__(self, k=10, training_set=None, testing_set=None, book_sim=None, novelty_scores=None):
self.k = k
self.book_sim = book_sim
self.novelty_scor... | [
"pandas.DataFrame",
"sklearn.metrics.pairwise.cosine_similarity",
"numpy.triu_indices",
"numpy.mean",
"scipy.sparse.csr_matrix",
"numpy.in1d"
] | [((925, 945), 'numpy.in1d', 'np.in1d', (['pred', 'truth'], {}), '(pred, truth)\n', (932, 945), True, 'import numpy as np\n'), ((1977, 2001), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['df.values'], {}), '(df.values)\n', (1990, 2001), True, 'import scipy.sparse as sp\n'), ((2091, 2138), 'sklearn.metrics.pairwise.cosi... |
# Program 19d: Generalized synchronization.
# See Figure 19.8(a).
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# Constants
mu = 5.7
sigma = 16
b = 4
r = 45.92
g = 8 # When g=4, there is no synchronization.
tmax = 100
t = np.arange(0.0, tmax, 0.1)
def rossler_lorenz_odes(X,t... | [
"matplotlib.pyplot.show",
"scipy.integrate.odeint",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((266, 291), 'numpy.arange', 'np.arange', (['(0.0)', 'tmax', '(0.1)'], {}), '(0.0, tmax, 0.1)\n', (275, 291), True, 'import numpy as np\n'), ((740, 786), 'scipy.integrate.odeint', 'odeint', (['rossler_lorenz_odes', 'y0', 't'], {'rtol': '(1e-06)'}), '(rossler_lorenz_odes, y0, t, rtol=1e-06)\n', (746, 786), False, 'from... |
import numpy as np
from tspdb.src.pindex.predict import get_prediction_range, get_prediction
from tspdb.src.pindex.pindex_managment import TSPI
from tspdb.src.pindex.pindex_utils import index_ts_mapper
import time
import timeit
import pandas as pd
from tspdb.src.hdf_util import read_data
from tspdb.src.tsUti... | [
"pandas.DataFrame",
"pandas.date_range",
"pandas.read_csv",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"tspdb.src.hdf_util.read_data",
"numpy.arange",
"numpy.array",
"tspdb.src.pindex.pindex_managment.TSPI"
] | [((645, 664), 'numpy.zeros', 'np.zeros', (['obs.shape'], {}), '(obs.shape)\n', (653, 664), True, 'import numpy as np\n'), ((791, 883), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "{'ts': obs, 'means': means, 'ts_9': obs_9, 'ts_7': obs_7, 'var': var}"}), "(data={'ts': obs, 'means': means, 'ts_9': obs_9, 'ts_7': ob... |
# 10/4/18
# chenyong
# predict leaf counts using trained model
"""
Make predictions of Leaf counts using trained models
"""
import os.path as op
import sys
import numpy as np
import pandas as pd
import pickle
import matplotlib.pyplot as plt
import matplotlib as mpl
from PIL import Image
from schnablelab.apps.base imp... | [
"keras.models.load_model",
"pandas.DataFrame",
"numpy.asarray",
"pathlib.Path",
"schnablelab.apps.base.ActionDispatcher",
"schnablelab.apps.base.OptionParser",
"cv2.resize"
] | [((750, 775), 'schnablelab.apps.base.ActionDispatcher', 'ActionDispatcher', (['actions'], {}), '(actions)\n', (766, 775), False, 'from schnablelab.apps.base import ActionDispatcher, OptionParser, glob\n'), ((938, 963), 'schnablelab.apps.base.OptionParser', 'OptionParser', (['dpp.__doc__'], {}), '(dpp.__doc__)\n', (950,... |
#!/usr/bin/python
"""
FlowCal Python API example, without using calibration beads data.
This script is divided in two parts. Part one processes data from five cell
samples, and generates plots of each one.
Part two exemplifies how to use the processed cell sample data with
FlowCal's plotting and statistics modules, i... | [
"FlowCal.gate.start_end",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"FlowCal.io.FCSData",
"matplotlib.pyplot.close",
"os.path.exists",
"FlowCal.stats.gmean",
"matplotlib.pyplot.ylim",
"FlowCal.gate.density2d",
"FlowCal.transform.to_rfi",
"FlowCal.plot.hist1d",
"FlowCal.plot... | [((949, 982), 'numpy.array', 'np.array', (['[0, 81, 161, 318, 1000]'], {}), '([0, 81, 161, 318, 1000])\n', (957, 982), True, 'import numpy as np\n'), ((7748, 7776), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 3.5)'}), '(figsize=(6, 3.5))\n', (7758, 7776), True, 'import matplotlib.pyplot as plt\n'), ... |
import pytest
import numpy as np
from sklearn.model_selection import GridSearchCV
from sklego.datasets import load_penguins
from sklearn.pipeline import Pipeline
from sklearn.metrics import make_scorer, accuracy_score
from hulearn.preprocessing import PipeTransformer
from hulearn.outlier import InteractiveOutlierDetec... | [
"sklego.datasets.load_penguins",
"sklearn.metrics.make_scorer",
"numpy.random.random",
"hulearn.common.flatten",
"hulearn.outlier.InteractiveOutlierDetector",
"hulearn.outlier.InteractiveOutlierDetector.from_json",
"hulearn.preprocessing.PipeTransformer"
] | [((1658, 1743), 'hulearn.outlier.InteractiveOutlierDetector.from_json', 'InteractiveOutlierDetector.from_json', (['"""tests/test_classification/demo-data.json"""'], {}), "('tests/test_classification/demo-data.json'\n )\n", (1694, 1743), False, 'from hulearn.outlier import InteractiveOutlierDetector\n'), ((1843, 1928... |
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import time
import argparse
import math
from lib import utils
from lib.utils import log_string
from model.DSTGNN import DSTGNN
parser = argparse.ArgumentParser()
parser.add_argument('--P', type = int, default =... | [
"argparse.ArgumentParser",
"numpy.nan_to_num",
"lib.utils.loadData",
"numpy.isnan",
"numpy.mean",
"torch.no_grad",
"model.DSTGNN.DSTGNN",
"torch.isnan",
"torch.load",
"torch.mean",
"numpy.divide",
"torch.zeros_like",
"math.ceil",
"numpy.square",
"numpy.not_equal",
"torch.cuda.is_availa... | [((246, 271), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (269, 271), False, 'import argparse\n'), ((2329, 2364), 'lib.utils.log_string', 'log_string', (['log', '"""loading data...."""'], {}), "(log, 'loading data....')\n", (2339, 2364), False, 'from lib.utils import log_string\n'), ((2448, ... |
import os
import sys
import scipy.io
import scipy.misc
import matplotlib.pyplot as plt
from PIL import Image
from nst_utils import *
from loss_function import *
import numpy as np
import tensorflow as tf
import time
STYLE_LAYERS = [
('conv1_1', 0.2),
('conv2_1', 0.2),
('conv3_1', 0.2),
('conv4_1', 0.2)... | [
"tensorflow.global_variables_initializer",
"tensorflow.reset_default_graph",
"time.time",
"numpy.array",
"tensorflow.InteractiveSession",
"tensorflow.train.AdamOptimizer"
] | [((765, 789), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (787, 789), True, 'import tensorflow as tf\n'), ((826, 849), 'tensorflow.InteractiveSession', 'tf.InteractiveSession', ([], {}), '()\n', (847, 849), True, 'import tensorflow as tf\n'), ((1887, 1914), 'tensorflow.train.AdamOptimi... |
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
"""
Plots random networks with a varying chance of connections between nodes
for figure 2.3.
"""
node_color = 'red'
node_border_color = 'black'
node_border_width = .6
edge_color = 'black'
N = 10
num_graphs = 6
N_columns = 3
N_rows = 2
P ... | [
"matplotlib.pyplot.show",
"networkx.draw_networkx_edges",
"networkx.fast_gnp_random_graph",
"networkx.spring_layout",
"networkx.draw_networkx_nodes",
"numpy.linspace",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
] | [((322, 359), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)'], {'num': 'num_graphs'}), '(0.0, 1.0, num=num_graphs)\n', (333, 359), True, 'import numpy as np\n'), ((729, 760), 'matplotlib.pyplot.subplots', 'plt.subplots', (['N_columns', 'N_rows'], {}), '(N_columns, N_rows)\n', (741, 760), True, 'import matplotlib.p... |
from copy import copy
import numpy as np
from nipy.core.image.image import Image
class ImageList(object):
''' Class to contain ND image as list of (N-1)D images '''
def __init__(self, images=None):
"""
A lightweight implementation of a list of images.
Parameters
-------... | [
"numpy.asarray",
"copy.copy",
"numpy.rollaxis"
] | [((1776, 1793), 'numpy.asarray', 'np.asarray', (['image'], {}), '(image)\n', (1786, 1793), True, 'import numpy as np\n'), ((1809, 1832), 'numpy.rollaxis', 'np.rollaxis', (['data', 'axis'], {}), '(data, axis)\n', (1820, 1832), True, 'import numpy as np\n'), ((1868, 1882), 'copy.copy', 'copy', (['coordmap'], {}), '(coord... |
import numpy as np
import matplotlib.pyplot as plt
def plot_price_history(hist):
''' plot price history '''
plt.plot(hist, '-')
plt.xlabel("time steps"); plt.ylabel("price")
plt.title("price history")
plt.show()
def plot_price_std(arr):
''' plot std of price history over simulations'''
plt.plot(arr, '-')
plt.... | [
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.std",
"numpy.add",
"numpy.zeros",
"numpy.mean",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((859, 884), 'numpy.load', 'np.load', (['"""price_hist.npy"""'], {}), "('price_hist.npy')\n", (866, 884), True, 'import numpy as np\n'), ((898, 923), 'numpy.load', 'np.load', (['"""hash_power.npy"""'], {}), "('hash_power.npy')\n", (905, 923), True, 'import numpy as np\n'), ((938, 964), 'numpy.load', 'np.load', (['"""w... |
#Importing libraries
import argparse
import cv2
from imutils.video import VideoStream #it creates a really good video stream
from imutils import face_utils, translate, resize
#face_utils : something that converts dlib to numpy so it can be furthur used.
#translate : it's going to translate the current position o... | [
"numpy.maximum",
"argparse.ArgumentParser",
"cv2.VideoWriter_fourcc",
"cv2.bitwise_and",
"cv2.fillPoly",
"imutils.face_utils.shape_to_np",
"imutils.translate",
"imutils.resize",
"cv2.imshow",
"dlib.shape_predictor",
"cv2.cvtColor",
"cv2.boundingRect",
"cv2.destroyAllWindows",
"cv2.waitKey"... | [((482, 507), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (505, 507), False, 'import argparse\n'), ((879, 894), 'time.sleep', 'time.sleep', (['(1.5)'], {}), '(1.5)\n', (889, 894), False, 'import time\n'), ((1069, 1101), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([],... |
import torch
import numpy as np
import random
from transformers import T5Tokenizer, T5ForConditionalGeneration
#Set all seeds to make output deterministic
torch.manual_seed(0)
np.random.seed(0)
random.seed(0)
#Paragraphs for which we want to generate queries
paragraphs = [
"Python is an interpreted, high-level and g... | [
"numpy.random.seed",
"torch.manual_seed",
"transformers.T5ForConditionalGeneration.from_pretrained",
"random.seed",
"torch.cuda.is_available",
"transformers.T5Tokenizer.from_pretrained",
"torch.no_grad"
] | [((156, 176), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (173, 176), False, 'import torch\n'), ((177, 194), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (191, 194), True, 'import numpy as np\n'), ((195, 209), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (206, 209), Fals... |
from __future__ import print_function
import time
import numpy as np
import sys
import gym
from PIL import Image
from gibson.core.render.profiler import Profiler
from gibson.envs.husky_env import *
from gibson.envs.ant_env import *
from gibson.envs.humanoid_env import *
from gibson.envs.drone_env import *
import pybull... | [
"numpy.zeros",
"time.sleep",
"numpy.random.random",
"numpy.random.randint",
"numpy.random.choice"
] | [((1326, 1342), 'time.sleep', 'time.sleep', (['(0.01)'], {}), '(0.01)\n', (1336, 1342), False, 'import time\n'), ((628, 666), 'numpy.random.randint', 'np.random.randint', (['self.action_space.n'], {}), '(self.action_space.n)\n', (645, 666), True, 'import numpy as np\n'), ((702, 738), 'numpy.zeros', 'np.zeros', (['self.... |
"""
Copyright 2019 Samsung SDS
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 ... | [
"pandas.DataFrame",
"numpy.array",
"brightics.common.utils.check_required_parameters"
] | [((789, 856), 'brightics.common.utils.check_required_parameters', 'check_required_parameters', (['_polynomial_expansion', 'params', "['table']"], {}), "(_polynomial_expansion, params, ['table'])\n", (814, 856), False, 'from brightics.common.utils import check_required_parameters\n'), ((991, 1005), 'pandas.DataFrame', '... |
import numpy as np
import matplotlib.pylab as plt
import pandas as pd
import scipy.signal as signal
#Concatenación de los datos
data1 = pd.read_csv("transacciones2008.txt",sep = ";",names=['Fecha','Hora','Conversion','Monto'],decimal =",")
data2 = pd.read_csv("transacciones2009.txt",sep = ";",names=['Fecha','Hora'... | [
"pandas.DataFrame",
"matplotlib.pylab.savefig",
"matplotlib.pylab.legend",
"scipy.signal.filtfilt",
"matplotlib.pylab.subplot",
"pandas.read_csv",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.plot",
"pandas.to_datetime",
"scipy.signal.butter",
"numpy.correlate",
"matplotlib.pylab.xlabel",
"p... | [((141, 251), 'pandas.read_csv', 'pd.read_csv', (['"""transacciones2008.txt"""'], {'sep': '""";"""', 'names': "['Fecha', 'Hora', 'Conversion', 'Monto']", 'decimal': '""","""'}), "('transacciones2008.txt', sep=';', names=['Fecha', 'Hora',\n 'Conversion', 'Monto'], decimal=',')\n", (152, 251), True, 'import pandas as ... |
import unittest
import filterdesigner.FIRDesign as FIRDesign
import numpy as np
class TestKaiserord(unittest.TestCase):
def setUp(self):
self.f1 = 0.2
self.f2 = 0.3
self.f3 = 0.4
self.f4 = 0.5
self.f5 = 0.6
self.f6 = 0.7
self.m1 = 1
sel... | [
"filterdesigner.FIRDesign.kaiserord",
"numpy.all"
] | [((916, 1017), 'filterdesigner.FIRDesign.kaiserord', 'FIRDesign.kaiserord', (['[self.f1, self.f2, self.f3, self.f4]', '[self.m2, self.m1, self.m2]', 'self.dev2'], {}), '([self.f1, self.f2, self.f3, self.f4], [self.m2, self.m1,\n self.m2], self.dev2)\n', (935, 1017), True, 'import filterdesigner.FIRDesign as FIRDesig... |
#!/usr/bin/env python3
import os
import sys
import socket
import datetime
import argparse
import torch
import numpy as np
from baselines import logger
from baselines.common.vec_env.dummy_vec_env import DummyVecEnv
from baselines.common.vec_env.vec_normalize import VecNormalize
from envs import make_env
from model_tor i... | [
"numpy.stack",
"model_tor.ActorCriticNetwork",
"baselines.common.vec_env.dummy_vec_env.DummyVecEnv",
"envs.make_env",
"argparse.ArgumentParser",
"ppo_tor.VanillaPPO",
"storage_tor.ExperienceBuffer",
"baselines.common.vec_env.vec_normalize.VecNormalize",
"torch.manual_seed",
"torch.FloatTensor",
... | [((730, 759), 'baselines.logger.configure', 'logger.configure', ([], {'dir': 'log_dir'}), '(dir=log_dir)\n', (746, 759), False, 'from baselines import logger\n'), ((764, 792), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (781, 792), False, 'import torch\n'), ((797, 821), 'torch.set_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.