code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.calibration import CalibratedClassifierCV
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
import pandas as pd
from sklearn.model_selection import train_test_split
from skle... | [
"pandas.Series",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"numpy.hstack",
"sklearn.model_selection.train_test_split",
"numpy.delete",
"matplotlib.pyplot.ylabel",
"sklearn.svm.LinearSVC",
"matplotlib.pyplot.show",
"numpy.argsort",
"sklearn.feature_extraction.text.TfidfVectorizer",
"matpl... | [((2003, 2038), 'pandas.read_csv', 'pd.read_csv', (["('Data/' + icd + '.csv')"], {}), "('Data/' + icd + '.csv')\n", (2014, 2038), True, 'import pandas as pd\n'), ((2044, 2062), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (2056, 2062), True, 'import pandas as pd\n'), ((2110, 2139), 'pandas.Series', '... |
import numpy as np
world_alcohol = np.genfromtxt('world_alcohol.csv', delimiter =',', dtype = 'U75', skip_header = 1)
#Je ne dois pas utiliser skip_header, sinon quand on utilise le skip_header pour suprrimer la première ligne
print(world_alcohol) | [
"numpy.genfromtxt"
] | [((36, 113), 'numpy.genfromtxt', 'np.genfromtxt', (['"""world_alcohol.csv"""'], {'delimiter': '""","""', 'dtype': '"""U75"""', 'skip_header': '(1)'}), "('world_alcohol.csv', delimiter=',', dtype='U75', skip_header=1)\n", (49, 113), True, 'import numpy as np\n')] |
from utils.visualize import HumanPoseVisualizer
from utils.OakRunner import OakRunner
from utils.pose import getKeypoints
from utils.draw import displayFPS
from pathlib import Path
import depthai as dai
import numpy as np
import cv2
fps_limit = 6
frame_width, frame_height = 456, 256
pairs = [[1, 2], [1, 5], [2, 3], ... | [
"depthai.SpatialLocationCalculatorConfigData",
"pathlib.Path",
"cv2.line",
"depthai.Point2f",
"cv2.imshow",
"utils.OakRunner.OakRunner",
"cv2.circle",
"numpy.concatenate",
"utils.visualize.HumanPoseVisualizer",
"cv2.resize",
"depthai.SpatialLocationCalculatorConfig",
"utils.pose.getKeypoints"
... | [((3415, 3426), 'utils.OakRunner.OakRunner', 'OakRunner', ([], {}), '()\n', (3424, 3426), False, 'from utils.OakRunner import OakRunner\n'), ((885, 1008), 'utils.visualize.HumanPoseVisualizer', 'HumanPoseVisualizer', (['(300)', '(300)', '[runner.left_camera_location, runner.right_camera_location]'], {'colors': 'colors'... |
import numpy as np
import pandas as pd
class StrategyOptimiser:
def __init__(self,
fitness_function,
n_generations,
generation_size,
n_genes,
gene_ranges,
mutation_probability,
gene_mutation_probability,
n_select_best):
"""
Initializes a genetic algorithm with the given parameters.
Par... | [
"numpy.multiply",
"numpy.random.random",
"numpy.logical_not",
"numpy.array",
"numpy.random.randint",
"pandas.DataFrame"
] | [((1590, 1655), 'numpy.random.randint', 'np.random.randint', (['self.gene_ranges[i][0]', 'self.gene_ranges[i][1]'], {}), '(self.gene_ranges[i][0], self.gene_ranges[i][1])\n', (1607, 1655), True, 'import numpy as np\n'), ((2389, 2413), 'numpy.logical_not', 'np.logical_not', (['dad_mask'], {}), '(dad_mask)\n', (2403, 241... |
import codecademylib3_seaborn
import numpy as np
from matplotlib import pyplot as plt
from sklearn import datasets
from sklearn.cluster import KMeans
digits = datasets.load_digits()
print(digits.target)
plt.gray()
plt.matshow(digits.images[100])
plt.show()
print(digits.target[100])
model = KMeans(n_clusters = 10, r... | [
"sklearn.cluster.KMeans",
"matplotlib.pyplot.gray",
"sklearn.datasets.load_digits",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.matshow",
"matplotlib.pyplot.show"
] | [((161, 183), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (181, 183), False, 'from sklearn import datasets\n'), ((206, 216), 'matplotlib.pyplot.gray', 'plt.gray', ([], {}), '()\n', (214, 216), True, 'from matplotlib import pyplot as plt\n'), ((217, 248), 'matplotlib.pyplot.matshow', 'plt.m... |
import numpy as np
import tqdm
from scipy import stats
from hmmpy.base import BaseHiddenMarkov
class SampleHMM(BaseHiddenMarkov):
"""
Class to handle sampling from HMM hidden_markov with user parameters.
Parameters
----------
n_states : int, default=2
Number of hidden states
hmm_... | [
"numpy.sqrt",
"numpy.random.choice",
"scipy.stats.norm.rvs",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.random.seed",
"numpy.arange"
] | [((1931, 1957), 'numpy.array', 'np.array', (["hmm_params['mu']"], {}), "(hmm_params['mu'])\n", (1939, 1957), True, 'import numpy as np\n'), ((1977, 2004), 'numpy.array', 'np.array', (["hmm_params['std']"], {}), "(hmm_params['std'])\n", (1985, 2004), True, 'import numpy as np\n'), ((2024, 2051), 'numpy.array', 'np.array... |
import os
import numpy as np
import argparse
import time
import torch
import torchvision
import cv2
def yolo_forward_dynamic(output, num_classes, anchors, num_anchors, scale_x_y):
# Output would be invalid if it does not satisfy this assert
# assert (output.size(1) == (5 + num_classes) * num_anchor... | [
"numpy.fromfile",
"os.listdir",
"numpy.minimum",
"os.makedirs",
"argparse.ArgumentParser",
"numpy.where",
"torch.sigmoid",
"os.path.join",
"numpy.argmax",
"torch.exp",
"numpy.max",
"torch.from_numpy",
"numpy.array",
"torch.tensor",
"numpy.maximum",
"numpy.loadtxt",
"torch.cat"
] | [((1178, 1204), 'torch.cat', 'torch.cat', (['bxy_list'], {'dim': '(1)'}), '(bxy_list, dim=1)\n', (1187, 1204), False, 'import torch\n'), ((1263, 1289), 'torch.cat', 'torch.cat', (['bwh_list'], {'dim': '(1)'}), '(bwh_list, dim=1)\n', (1272, 1289), False, 'import torch\n'), ((1350, 1382), 'torch.cat', 'torch.cat', (['det... |
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import sys
def packagedWarpPerspective(f, u0, v0, a, b, c, w, h):
m31 = 0 - a
m32 = 0 - b
m33 = f + a * (w/2 + u0) + b * (h/2 + v0)
m11 = c - w / 2 * a
m12 = 0 - w / 2 * b
m13 = w / 2 * m33 - c * (w/2 + u0)
m21 = 0 - h / 2 * a
m22 = ... | [
"numpy.mat",
"cv2.imwrite",
"cv2.destroyAllWindows",
"sys.exit",
"cv2.waitKey",
"cv2.imread"
] | [((1373, 1408), 'cv2.imread', 'cv2.imread', (['image', 'cv2.IMREAD_COLOR'], {}), '(image, cv2.IMREAD_COLOR)\n', (1383, 1408), False, 'import cv2\n'), ((1776, 1819), 'cv2.imwrite', 'cv2.imwrite', (['"""cxl190012_outp_1.png"""', 'output'], {}), "('cxl190012_outp_1.png', output)\n", (1787, 1819), False, 'import cv2\n'), (... |
#!/usr/bin/env python3
from filterpy.kalman import KalmanFilter
import matplotlib.pyplot as plt
import numpy as np
import pdb
from scipy.optimize import linear_sum_assignment as linear_assignment
import sys
import time
from transform_utils import convert_3dbox_to_8corner
from iou_utils import compute_iou_2d_bboxes
... | [
"scipy.optimize.linear_sum_assignment",
"numpy.where",
"filterpy.kalman.KalmanFilter",
"numpy.column_stack",
"numpy.diag",
"transform_utils.convert_3dbox_to_8corner",
"numpy.array",
"numpy.stack",
"numpy.empty",
"numpy.isnan",
"numpy.concatenate",
"iou_utils.compute_iou_2d_bboxes",
"numpy.ma... | [((8172, 8202), 'scipy.optimize.linear_sum_assignment', 'linear_assignment', (['(-iou_matrix)'], {}), '(-iou_matrix)\n', (8189, 8202), True, 'from scipy.optimize import linear_sum_assignment as linear_assignment\n'), ((8250, 8282), 'numpy.column_stack', 'np.column_stack', (['matched_indices'], {}), '(matched_indices)\n... |
"""
This file is part of pyS5p
https://github.com/rmvanhees/pys5p.git
The class ICMio provides read access to S5p Tropomi ICM_CA_SIR products
Copyright (c) 2017-2021 SRON - Netherlands Institute for Space Research
All Rights Reserved
License: BSD-3-Clause
"""
from datetime import datetime, timedelta
from pathli... | [
"datetime.datetime",
"pathlib.Path",
"datetime.datetime.utcnow",
"numpy.asarray",
"h5py.File",
"numpy.squeeze",
"numpy.append",
"numpy.issubdtype",
"setuptools_scm.get_version",
"numpy.isnan",
"numpy.split",
"numpy.concatenate",
"h5py.special_dtype",
"pathlib.PurePosixPath"
] | [((11000, 11029), 'datetime.datetime', 'datetime', (['(2010)', '(1)', '(1)', '(0)', '(0)', '(0)'], {}), '(2010, 1, 1, 0, 0, 0)\n', (11008, 11029), False, 'from datetime import datetime, timedelta\n'), ((30579, 30616), 'numpy.concatenate', 'np.concatenate', (['data'], {'axis': 'column_dim'}), '(data, axis=column_dim)\n'... |
import cv2 # Importe l'api OpenCV
import numpy as np # Importe le module "numpy"
def main():
confidence_ratio = 0.8 #Assigne une valeur de confiance au résultat du detecteur de chaines de caractères prenant donc que les prédictions qui ont plus de 90% de chance d'être juste
image = cv2.imread('input.png') #Ch... | [
"cv2.rectangle",
"cv2.text_TextDetectorCNN.create",
"cv2.drawContours",
"cv2.inRange",
"numpy.zeros",
"cv2.cvtColor",
"cv2.findContours",
"cv2.resize",
"cv2.imread",
"cv2.boundingRect"
] | [((293, 316), 'cv2.imread', 'cv2.imread', (['"""input.png"""'], {}), "('input.png')\n", (303, 316), False, 'import cv2\n'), ((361, 392), 'numpy.zeros', 'np.zeros', (['image.shape', 'np.uint8'], {}), '(image.shape, np.uint8)\n', (369, 392), True, 'import numpy as np\n'), ((562, 633), 'cv2.text_TextDetectorCNN.create', '... |
from pak.datasets.Dataset import Dataset
import numpy as np
import zipfile
import tarfile
import urllib.request
import shutil
from os import makedirs, listdir
from os.path import join, isfile, isdir, exists, splitext
from scipy.ndimage import imread
from scipy.misc import imresize
from scipy.io import loadmat
from skim... | [
"os.listdir",
"numpy.memmap",
"os.path.join",
"pak.datasets.Dataset.Dataset.__init__",
"scipy.io.loadmat",
"numpy.max",
"os.path.isfile",
"numpy.array",
"pak.utils.talk",
"numpy.min"
] | [((683, 737), 'pak.datasets.Dataset.Dataset.__init__', 'Dataset.__init__', (['self', '"""egohands_data"""', 'root', 'verbose'], {}), "(self, 'egohands_data', root, verbose)\n", (699, 737), False, 'from pak.datasets.Dataset import Dataset\n'), ((845, 872), 'os.path.join', 'join', (['root', '"""egohands_data"""'], {}), "... |
# imports
import time
from pathlib import Path
from typing import Tuple, Union
import numpy as np
import torch
from shapely.geometry.point import Point
from skimage.draw import circle_perimeter_aa
from torch import nn, Tensor # using torch.Tensor is annoying
from torch.utils.data import Dataset, DataLoader
from CNN ... | [
"numpy.mean",
"skimage.draw.circle_perimeter_aa",
"numpy.random.rand",
"pathlib.Path",
"CNN.CNN",
"torch.from_numpy",
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"torch.is_tensor",
"torch.nn.MSELoss",
"torch.sum",
"torch.utils.data.DataLoader",
"time.time",
"shapely.geometry.po... | [((3378, 3445), 'torch.utils.data.DataLoader', 'DataLoader', (['train_dataset'], {'batch_size': 'args.batch_size', 'shuffle': '(True)'}), '(train_dataset, batch_size=args.batch_size, shuffle=True)\n', (3388, 3445), False, 'from torch.utils.data import Dataset, DataLoader\n'), ((3504, 3570), 'torch.utils.data.DataLoader... |
import numpy as np
class Maze(object):
def __init__(self, filename):
'''
Maze objects have two main attributes:
- dim: mazes should be square, with sides of even length. (integer)
- walls: passages are coded as a 4-bit number, with a bit value taking
0 if there is a wall... | [
"numpy.array"
] | [((1283, 1298), 'numpy.array', 'np.array', (['walls'], {}), '(walls)\n', (1291, 1298), True, 'import numpy as np\n')] |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# 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 appli... | [
"numpy.random.randint",
"numpy.random.uniform",
"unittest.main",
"numpy.maximum",
"paddle.fluid.core.CPUPlace"
] | [((2104, 2119), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2117, 2119), False, 'import unittest\n'), ((1531, 1581), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)', '(batch_size, num_classes)'], {}), '(0, 2, (batch_size, num_classes))\n', (1548, 1581), True, 'import numpy as np\n'), ((1792, 1807),... |
#!/usr/bin/env python3
""" Robot Module
This module initializes the robot class
Author: <NAME>
"""
import numpy as np
class Robot:
def __init__(self, x_dim, y_dim):
self._x_dim = x_dim
self._y_dim = y_dim
self._tunnel_grid = np.zeros((self._x_dim, self._y_dim))
self._explored_map = np.zeros_like(self._t... | [
"numpy.zeros",
"numpy.zeros_like"
] | [((239, 275), 'numpy.zeros', 'np.zeros', (['(self._x_dim, self._y_dim)'], {}), '((self._x_dim, self._y_dim))\n', (247, 275), True, 'import numpy as np\n'), ((299, 331), 'numpy.zeros_like', 'np.zeros_like', (['self._tunnel_grid'], {}), '(self._tunnel_grid)\n', (312, 331), True, 'import numpy as np\n'), ((441, 473), 'num... |
import torch
import numpy as np
import carb
from pxr import UsdGeom, Gf, Sdf, Usd, PhysxSchema, PhysicsSchema, PhysicsSchemaTools, Semantics
import os
import time
import atexit
import asyncio
import numpy as np
import random
import matplotlib.pyplot as plt
import collections
from omni.isaac.synthetic_utils import v... | [
"numpy.flip",
"omni.isaac.synthetic_utils.SyntheticDataHelper",
"random.choice",
"collections.deque",
"random.uniform",
"road_environment.Environment",
"random.randrange",
"gym.spaces.Box",
"numpy.exp",
"numpy.array",
"numpy.dot",
"jetbot.Jetbot",
"numpy.random.randn",
"pxr.Gf.Vec3d"
] | [((825, 882), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(2.0)', 'shape': '(2,)', 'dtype': 'np.float32'}), '(low=0, high=2.0, shape=(2,), dtype=np.float32)\n', (835, 882), False, 'from gym import spaces\n'), ((1047, 1111), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(255)', 'shape': '... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# <NAME> <<EMAIL>> <https://hanxiao.github.io>
import multiprocessing
import os
import random
import sys
import threading
import time
from collections import defaultdict
from datetime import datetime
from itertools import chain
from multiprocessing import Process
from multi... | [
"termcolor.colored",
"zmq.utils.jsonapi.dumps",
"os.path.join",
"numpy.ascontiguousarray",
"zmq.utils.jsonapi.loads"
] | [((5715, 5737), 'zmq.utils.jsonapi.loads', 'jsonapi.loads', (['raw_msg'], {}), '(raw_msg)\n', (5728, 5737), False, 'from zmq.utils import jsonapi\n'), ((1294, 1326), 'termcolor.colored', 'colored', (['"""VENTILATOR"""', '"""magenta"""'], {}), "('VENTILATOR', 'magenta')\n", (1301, 1326), False, 'from termcolor import co... |
import os
if not os.path.exists('AdsorptionParameters.py'):
os.symlink('../AdsorptionParameters.py', 'AdsorptionParameters.py')
import matplotlib.pyplot as plt
import asap3.nanoparticle_mc.langmuirExpression as le
import numpy as np
#Test the CO Plot now
#Get one coverage for each CN for each temperature at 1mbar
... | [
"os.path.exists",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"os.symlink",
"numpy.linspace",
"asap3.nanoparticle_mc.langmuirExpression.getCoverages",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((324, 350), 'numpy.linspace', 'np.linspace', (['(0.1)', '(800)', '(100)'], {}), '(0.1, 800, 100)\n', (335, 350), True, 'import numpy as np\n'), ((602, 633), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'CN_4'], {'label': '"""CN 4"""'}), "(x, CN_4, label='CN 4')\n", (610, 633), True, 'import matplotlib.pyplot as plt\n... |
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from queue import Queue
from moviepy.editor import VideoFileClip
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((6*9,3), np.float32)
objp[:,:2] = np.mgrid[0:9,0... | [
"cv2.rectangle",
"numpy.hstack",
"numpy.polyfit",
"numpy.array",
"cv2.warpPerspective",
"cv2.destroyAllWindows",
"cv2.calibrateCamera",
"cv2.findChessboardCorners",
"matplotlib.pyplot.imshow",
"numpy.mean",
"matplotlib.pyplot.plot",
"cv2.undistort",
"numpy.max",
"cv2.addWeighted",
"numpy... | [((262, 294), 'numpy.zeros', 'np.zeros', (['(6 * 9, 3)', 'np.float32'], {}), '((6 * 9, 3), np.float32)\n', (270, 294), True, 'import numpy as np\n'), ((574, 616), 'glob.glob', 'glob.glob', (['"""./camera_cal/calibration*.jpg"""'], {}), "('./camera_cal/calibration*.jpg')\n", (583, 616), False, 'import glob\n'), ((1576, ... |
import numpy as np
import cv2
circle_directions = ('north', 'north-northeast', 'northeast', 'east-northeast', 'east', 'east-southeast',
'southeast', 'south-southeast', 'south', 'south-southwest', 'southwest', 'west-southwest',
'west', 'west-northwest', 'northwest', 'north-nort... | [
"numpy.sum",
"numpy.array",
"cv2.boundingRect"
] | [((904, 929), 'cv2.boundingRect', 'cv2.boundingRect', (['contour'], {}), '(contour)\n', (920, 929), False, 'import cv2\n'), ((2161, 2177), 'numpy.sum', 'np.sum', (['validate'], {}), '(validate)\n', (2167, 2177), True, 'import numpy as np\n'), ((1314, 1330), 'numpy.array', 'np.array', (['radius'], {}), '(radius)\n', (13... |
from ..utils import constants, utils
import folium
from folium.plugins import HeatMap
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import shapely
from geojson import LineString
import geopandas as gpd
import json
import warnings
STACKLEVEL = 2
# COLOR = {
# 0: '#FF0000', # Red
# 1: '... | [
"geojson.LineString",
"numpy.median",
"folium.Icon",
"numpy.round",
"folium.Circle",
"json.dumps",
"folium.RegularPolygonMarker",
"operator.itemgetter",
"folium.Map",
"numpy.random.randint",
"folium.CircleMarker",
"folium.Popup",
"warnings.warn",
"folium.plugins.HeatMap",
"matplotlib.pyp... | [((16118, 16156), 'matplotlib.pyplot.xlim', 'plt.xlim', (['start_datetime', 'end_datetime'], {}), '(start_datetime, end_datetime)\n', (16126, 16156), True, 'import matplotlib.pyplot as plt\n'), ((1695, 1720), 'numpy.random.randint', 'np.random.randint', (['(0)', '(255)'], {}), '(0, 255)\n', (1712, 1720), True, 'import ... |
import src as ai
import numpy as np
import wandb
wandb.init(project='lstm-timeseries', config={'version' : 'new-a'})
model = ai.lstm(inshape=1, outshape=1, outactivation=ai.identity(), learningrate=0.01)
Data = np.genfromtxt(r"data/timeseries/airpassenger.csv", dtype=int)
Data = (Data - min(Data)) / (max(Data) - min... | [
"wandb.log",
"src.identity",
"wandb.init",
"numpy.sum",
"numpy.genfromtxt"
] | [((50, 116), 'wandb.init', 'wandb.init', ([], {'project': '"""lstm-timeseries"""', 'config': "{'version': 'new-a'}"}), "(project='lstm-timeseries', config={'version': 'new-a'})\n", (60, 116), False, 'import wandb\n'), ((214, 274), 'numpy.genfromtxt', 'np.genfromtxt', (['"""data/timeseries/airpassenger.csv"""'], {'dtype... |
from numpy.testing import assert_
from alns.Statistics import Statistics
def test_empty_new_statistics():
"""
Tests if a new Statistics object starts empty.
"""
statistics = Statistics()
assert_(len(statistics.objectives) == 0)
def test_collect_objectives():
"""
Tests if a Statistics ob... | [
"alns.Statistics.Statistics",
"numpy.testing.assert_"
] | [((193, 205), 'alns.Statistics.Statistics', 'Statistics', ([], {}), '()\n', (203, 205), False, 'from alns.Statistics import Statistics\n'), ((386, 398), 'alns.Statistics.Statistics', 'Statistics', ([], {}), '()\n', (396, 398), False, 'from alns.Statistics import Statistics\n'), ((550, 597), 'numpy.testing.assert_', 'as... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, Biota Technology.
# www.biota.com
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ---------------------... | [
"biom.load_table",
"tempfile.TemporaryDirectory",
"qiime2.Artifact.load",
"os.path.exists",
"pandas.read_csv",
"numpy.testing.assert_allclose",
"os.path.join",
"unittest.main",
"os.path.abspath",
"qiime2.plugins.sourcetracker2.actions.gibbs"
] | [((8970, 8985), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8983, 8985), False, 'import unittest\n'), ((4888, 4913), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (4903, 4913), False, 'import os\n'), ((5230, 5284), 'os.path.join', 'os.path.join', (['tst_pth', '"""data/tiny-test/otu_... |
from __future__ import division, print_function
from action_detector_diagnosis import ActionDetectorDiagnosis
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import numpy as np
import pandas as pd
import os
from collections import OrderedDict
from utils import interpolated_prec_rec
from matplotlib i... | [
"action_detector_diagnosis.ActionDetectorDiagnosis",
"matplotlib.pyplot.GridSpec",
"numpy.nanmean",
"numpy.array",
"argparse.ArgumentParser",
"pandas.Categorical",
"numpy.linspace",
"matplotlib.pyplot.yticks",
"pandas.DataFrame",
"collections.OrderedDict",
"matplotlib.rcParams.update",
"matplo... | [((364, 378), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (371, 378), True, 'import matplotlib as mpl\n'), ((662, 689), 'matplotlib.rcParams.update', 'mpl.rcParams.update', (['params'], {}), '(params)\n', (681, 689), True, 'import matplotlib as mpl\n'), ((1970, 1983), 'collections.OrderedDict', 'Orde... |
"""
@FileName: lsb.py
@Description: Implement lsb
@Author: Ryuk
@CreateDate: 2021/06/27
@LastEditTime: 2021/06/27
@LastEditors: Please set LastEditors
@Version: v0.1
"""
import scipy.io.wavfile as wav
import numpy as np
np.random.seed(2020)
stop_mark = np.random.randint(0, 2, 128)
class LSBEmbedder:
def __init_... | [
"numpy.hstack",
"numpy.array",
"numpy.random.randint",
"scipy.io.wavfile.read",
"numpy.random.seed",
"numpy.concatenate",
"scipy.io.wavfile.write"
] | [((222, 242), 'numpy.random.seed', 'np.random.seed', (['(2020)'], {}), '(2020)\n', (236, 242), True, 'import numpy as np\n'), ((255, 283), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)', '(128)'], {}), '(0, 2, 128)\n', (272, 283), True, 'import numpy as np\n'), ((822, 836), 'scipy.io.wavfile.read', 'wav.re... |
import os
import random
import pickle as pk
import logging
from collections import defaultdict
from chemreader.readers.readmol2 import Mol2
import h5py
import numpy as np
from scipy import sparse
from tqdm import tqdm
from slgnn.config import PAD_ATOM, PAD_BOND
SEED = 1458907
random.seed(SEED)
class ZincToHdf5:
... | [
"random.sample",
"pickle.dump",
"random.shuffle",
"os.scandir",
"chemreader.readers.readmol2.Mol2",
"os.path.join",
"random.seed",
"h5py.File",
"tqdm.tqdm",
"pickle.load",
"numpy.array",
"collections.defaultdict",
"h5py.string_dtype",
"logging.info"
] | [((280, 297), 'random.seed', 'random.seed', (['SEED'], {}), '(SEED)\n', (291, 297), False, 'import random\n'), ((1515, 1535), 'os.scandir', 'os.scandir', (['dir_path'], {}), '(dir_path)\n', (1525, 1535), False, 'import os\n'), ((1822, 1848), 'random.shuffle', 'random.shuffle', (['mol2blocks'], {}), '(mol2blocks)\n', (1... |
import networkx as nx
import numpy as np
import math
from tqdm import tqdm
import numba
from numba.experimental import jitclass
from numba import jit
steadyspec = [
('adj_matrix',numba.float64[:,:]),
('graph_size',numba.int32),
('background_field',numba.float64[:]),
('fixed_point_iter',numba.int32)... | [
"numpy.identity",
"numpy.abs",
"numpy.sqrt",
"numpy.ones",
"numpy.arange",
"numpy.random.choice",
"numpy.sort",
"numba.experimental.jitclass",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numba.jit",
"numpy.sum",
"numpy.cumsum",
"numpy.maximum",
"networkx.to_numpy_matrix",
"math.tanh"... | [((361, 381), 'numba.experimental.jitclass', 'jitclass', (['steadyspec'], {}), '(steadyspec)\n', (369, 381), False, 'from numba.experimental import jitclass\n'), ((3349, 3367), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (3352, 3367), False, 'from numba import jit\n'), ((3451, 3469), 'numba.j... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Creation date: 2021-09-11 (year-month-day)
"""
Implements SGLD to sample from the input data distribution, and various buffers to
store the MCMC samples.
"""
import torch
import torch.nn as nn
from torch.distributions.bernoulli import Bernoulli as TorchBer... | [
"numpy.random.choice",
"torch.LongTensor",
"torch.stack",
"torch.distributions.bernoulli.Bernoulli",
"torch.randint",
"torch.argsort",
"torch.autograd.grad",
"numpy.setdiff1d",
"torch.no_grad",
"torch.zeros",
"numpy.arange",
"torch.randn"
] | [((2576, 2591), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2589, 2591), False, 'import torch\n'), ((1606, 1669), 'torch.autograd.grad', 'torch.autograd.grad', (['nrg_split', 'x_hat_split'], {'create_graph': '(False)'}), '(nrg_split, x_hat_split, create_graph=False)\n', (1625, 1669), False, 'import torch\n'), ... |
"""
@author: <NAME>
@title: Third Activity - Binarization
"""
import skimage
from skimage.color import rgb2gray
from skimage import data
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.size'] = 18
import numpy as np
def Invert(image):
grayim = rgb2gray(image)
a, b = np.shape(... | [
"matplotlib.pyplot.imshow",
"skimage.color.rgb2gray",
"skimage.data.chelsea",
"matplotlib.pyplot.figure",
"numpy.empty",
"numpy.shape",
"matplotlib.pyplot.show"
] | [((788, 802), 'skimage.data.chelsea', 'data.chelsea', ([], {}), '()\n', (800, 802), False, 'from skimage import data\n'), ((803, 815), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (813, 815), True, 'import matplotlib.pyplot as plt\n'), ((816, 833), 'matplotlib.pyplot.imshow', 'plt.imshow', (['image'], {}... |
import sys
import os
# Root directory of the project
ROOT_DIR = os.getcwd()
print(f"{ROOT_DIR}")
# Import Mask RCNN
sys.path.append(ROOT_DIR) # To find local version of the library
from mrcnn import visualize
from mrcnn import model as modellib
from mrcnn import utils
from mrcnn.config import Config
from mrcnn.model... | [
"mrcnn.model.MaskRCNN",
"os.path.exists",
"random.choice",
"numpy.ones",
"argparse.ArgumentParser",
"mrcnn.utils.download_trained_weights",
"mrcnn.model.load_image_gt",
"os.path.join",
"os.getcwd",
"numpy.stack",
"mrcnn.visualize.display_instances",
"mrcnn.model.log",
"sys.path.append",
"m... | [((65, 76), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (74, 76), False, 'import os\n'), ((117, 142), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (132, 142), False, 'import sys\n'), ((1460, 1503), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""mask_rcnn_coco.h5"""'], {}), "(ROOT_DIR, 'm... |
from sklearn import datasets
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
iris = datasets.load_iris()
x = pd.DataFrame(iris.data)
x.columns = ['Sepal_Length','Sepal_Wid... | [
"sklearn.datasets.load_iris",
"sklearn.cluster.KMeans",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.confusion_matrix"
] | [((232, 252), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (250, 252), False, 'from sklearn import datasets\n'), ((258, 281), 'pandas.DataFrame', 'pd.DataFrame', (['iris.data'], {}), '(iris.data)\n', (270, 281), True, 'import pandas as pd\n'), ((359, 384), 'pandas.DataFrame', 'pd.DataFrame', ([... |
import numpy as np
from tkinter import filedialog
import sys
import os
import matplotlib.pyplot as plt
import pyproj
import math
import datetime
#------------------------------------------------------------------------------
# READ DELFT GRID FILE
class grd():
"""Orthogonal curvilinear grid file. See A.3.2 in Del... | [
"numpy.abs",
"numpy.ma.masked_equal",
"numpy.reshape",
"numpy.ones",
"math.floor",
"numpy.where",
"tkinter.filedialog.asksaveasfile",
"numpy.size",
"pyproj.transform",
"numpy.array",
"datetime.datetime.now",
"pyproj.Proj",
"tkinter.filedialog.askopenfilename",
"matplotlib.pyplot.axis",
"... | [((1635, 1651), 'numpy.array', 'np.array', (['header'], {}), '(header)\n', (1643, 1651), True, 'import numpy as np\n'), ((4007, 4024), 'math.floor', 'math.floor', (['(m / 5)'], {}), '(m / 5)\n', (4017, 4024), False, 'import math\n'), ((6371, 6413), 'numpy.arange', 'np.arange', (['y0', '(y0 + m * cellsize)', 'cellsize']... |
# coding=utf-8
# Copyright 2021 The Uncertainty Baselines 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 ap... | [
"jax.tree_util.tree_structure",
"numpy.sqrt",
"io.BytesIO",
"absl.logging.info",
"numpy.argsort",
"tensorflow.io.gfile.rename",
"dataclasses.is_dataclass",
"scipy.ndimage.zoom",
"numpy.savez",
"tensorflow.io.gfile.GFile",
"jax.tree_util.tree_map",
"numpy.concatenate",
"absl.logging.warning",... | [((1831, 1860), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1854, 1860), False, 'import collections\n'), ((2843, 2904), 'jax.tree_util.tree_map', 'jax.tree_util.tree_map', (['_convert_and_recover_bfloat16', 'values'], {}), '(_convert_and_recover_bfloat16, values)\n', (2865, 2904),... |
# Copyright 2017-2021 Lawrence Livermore National Security, LLC and other
# CallFlow Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: MIT
# ------------------------------------------------------------------------------
"""
CallFlow's operation to calculate ensemble gradients... | [
"callflow.modules.histogram.Histogram._format_data",
"callflow.utils.utils.histogram",
"numpy.ndenumerate",
"callflow.get_logger",
"numpy.append",
"warnings.simplefilter",
"callflow.utils.df.df_unique"
] | [((681, 710), 'callflow.get_logger', 'callflow.get_logger', (['__name__'], {}), '(__name__)\n', (700, 710), False, 'import callflow\n'), ((711, 788), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'pd.errors.PerformanceWarning'}), "(action='ignore', category=pd.errors.Perf... |
#!/usr/bin/env python
import numpy as np
def main():
dt = 10
x0 = np.array([[2.0],[1.0]])
P0 = 2*np.identity(2)
# define model
A = np.matrix([[1, dt], [0, 1]])
C = np.array([[1, 0]])
Q = 0.1*np.identity(2)
R = 0.1
z = 2.25
# predict
x = A*x0 # np.multiply(A, x0)
P = A*P0*np.transpose(A) + Q
# update... | [
"numpy.identity",
"numpy.array",
"numpy.linalg.inv",
"numpy.matrix",
"numpy.transpose"
] | [((71, 95), 'numpy.array', 'np.array', (['[[2.0], [1.0]]'], {}), '([[2.0], [1.0]])\n', (79, 95), True, 'import numpy as np\n'), ((141, 169), 'numpy.matrix', 'np.matrix', (['[[1, dt], [0, 1]]'], {}), '([[1, dt], [0, 1]])\n', (150, 169), True, 'import numpy as np\n'), ((175, 193), 'numpy.array', 'np.array', (['[[1, 0]]']... |
import numpy as np
from scipy.sparse import csr_matrix
arr = np.array([
[1,0,0,1,0,0],
[0,0,2,0,0,1],
[0,0,0,2,0,0]
])
print(f"arr is {arr}")
S = csr_matrix(arr)
print(f"CSR matrix is {S}")
B = S.todense()
print(f"dense matrix is {B}")
| [
"numpy.array",
"scipy.sparse.csr_matrix"
] | [((63, 133), 'numpy.array', 'np.array', (['[[1, 0, 0, 1, 0, 0], [0, 0, 2, 0, 0, 1], [0, 0, 0, 2, 0, 0]]'], {}), '([[1, 0, 0, 1, 0, 0], [0, 0, 2, 0, 0, 1], [0, 0, 0, 2, 0, 0]])\n', (71, 133), True, 'import numpy as np\n'), ((166, 181), 'scipy.sparse.csr_matrix', 'csr_matrix', (['arr'], {}), '(arr)\n', (176, 181), False,... |
import numpy as np
def imagem_to_cinza(matrix_colorida: np.array) -> np.array:
linhas = matrix_colorida.shape[0]
colunas = matrix_colorida.shape[1]
matrix_gray = np.zeros((linhas, colunas))
for i in range(linhas):
for j in range(colunas):
r, g, b = matrix_colorida[i, j]
... | [
"numpy.zeros"
] | [((177, 204), 'numpy.zeros', 'np.zeros', (['(linhas, colunas)'], {}), '((linhas, colunas))\n', (185, 204), True, 'import numpy as np\n'), ((557, 584), 'numpy.zeros', 'np.zeros', (['(linhas, colunas)'], {}), '((linhas, colunas))\n', (565, 584), True, 'import numpy as np\n'), ((600, 627), 'numpy.zeros', 'np.zeros', (['(l... |
import torch.nn as nn
from modules.DGL.transformer.layers import *
from modules.DGL.transformer.functions import *
from modules.DGL.transformer.embedding import *
from modules.DGL.transformer.optims import *
import dgl.function as fn
import torch.nn.init as INIT
class MultiHeadAttention(nn.Module):
... | [
"dgl.function.src_mul_edge",
"dgl.function.sum",
"numpy.sqrt",
"dgl.function.copy_edge",
"torch.sqrt",
"modules.make_model",
"torch.cuda.is_available",
"functools.partial",
"dgl.contrib.transformer.get_dataset",
"torch.nn.Linear",
"torch.set_grad_enabled",
"dgl.contrib.transformer.GraphPool"
] | [((7507, 7518), 'dgl.contrib.transformer.GraphPool', 'GraphPool', ([], {}), '()\n', (7516, 7518), False, 'from dgl.contrib.transformer import get_dataset, GraphPool\n'), ((8739, 8758), 'dgl.contrib.transformer.get_dataset', 'get_dataset', (['"""copy"""'], {}), "('copy')\n", (8750, 8758), False, 'from dgl.contrib.transf... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeRegressor
base = pd.read_csv('plano-saude2.csv')
X = base.iloc[:, 0:1].values
y = base.iloc[:, 1].values
regressor = DecisionTreeRegressor()
regressor.fit(X, y) # treinamento do regressor de árvore de decisão... | [
"sklearn.tree.DecisionTreeRegressor",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title"
] | [((126, 157), 'pandas.read_csv', 'pd.read_csv', (['"""plano-saude2.csv"""'], {}), "('plano-saude2.csv')\n", (137, 157), True, 'import pandas as pd\n'), ((228, 251), 'sklearn.tree.DecisionTreeRegressor', 'DecisionTreeRegressor', ([], {}), '()\n', (249, 251), False, 'from sklearn.tree import DecisionTreeRegressor\n'), ((... |
# -*- coding:utf-8 -*-
import abc
import math
import numbers
import numpy as np
import scipy.sparse as sp
from .physicalmodel import PhysicalModel
class ClassicalIsingModel(PhysicalModel):
@classmethod
def initial_state(cls, shape, state_type):
if state_type == 'qubo':
return cls.initia... | [
"numpy.random.randint",
"numpy.zeros",
"numpy.random.RandomState",
"scipy.sparse.csr_matrix",
"numpy.tri",
"math.exp"
] | [((499, 546), 'numpy.random.randint', 'np.random.randint', (['(2)'], {'size': 'shape', 'dtype': 'np.int8'}), '(2, size=shape, dtype=np.int8)\n', (516, 546), True, 'import numpy as np\n'), ((1083, 1099), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['j'], {}), '(j)\n', (1096, 1099), True, 'import scipy.sparse as sp\n'),... |
# -*- coding: utf-8 -*-
from scipy import misc
from scipy import ndimage
import numpy as np
import util
import os
oriDir = '../data/'
tgtDir = '../processedData/'
imgLength = 512
compressRatio = 0.2
compressLen = int(imgLength * compressRatio)
def flipImageMatrix(img):
flipped_img = np.ndarray... | [
"os.listdir",
"numpy.fliplr",
"scipy.misc.imsave",
"numpy.zeros",
"numpy.ndarray",
"scipy.misc.imresize",
"util.updateDir",
"scipy.ndimage.rotate",
"util.getImageMatrix",
"numpy.random.permutation"
] | [((310, 346), 'numpy.ndarray', 'np.ndarray', (['img.shape'], {'dtype': '"""uint8"""'}), "(img.shape, dtype='uint8')\n", (320, 346), True, 'import numpy as np\n'), ((375, 398), 'numpy.fliplr', 'np.fliplr', (['img[:, :, 0]'], {}), '(img[:, :, 0])\n', (384, 398), True, 'import numpy as np\n'), ((427, 450), 'numpy.fliplr',... |
# Lint as: python3
# Copyright 2020 DeepMind Technologies Limited.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"numpy.clip",
"tensorflow.io.FixedLenSequenceFeature",
"tensorflow.shape",
"acme.wrappers.SinglePrecisionWrapper",
"reverb.ReplaySample",
"dm_control.composer.Environment",
"dm_control.composer.variation.distributions.Uniform",
"dm_control.locomotion.arenas.corridors.GapsCorridor",
"tensorflow.io.de... | [((1924, 1988), 'dm_control.locomotion.arenas.bowl.Bowl', 'arenas.bowl.Bowl', ([], {'size': '(20.0, 20.0)', 'aesthetic': '"""outdoor_natural"""'}), "(size=(20.0, 20.0), aesthetic='outdoor_natural')\n", (1940, 1988), False, 'from dm_control.locomotion import arenas\n'), ((2020, 2118), 'dm_control.locomotion.tasks.escape... |
import os
import tensorflow as tf
import numpy as np
import matplotlib
# matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import argparse
from numpy import linalg as LA
from keras.applications.vgg16 import VGG16
from keras.preprocessing import image
from keras.applications.vgg... | [
"keras.applications.vgg16.VGG16",
"matplotlib.pyplot.plot",
"os.path.join",
"numpy.asarray",
"numpy.zeros",
"keras.applications.vgg16.preprocess_input",
"numpy.expand_dims",
"numpy.linalg.norm"
] | [((687, 840), 'keras.applications.vgg16.VGG16', 'VGG16', ([], {'weights': 'self.weight', 'input_shape': '(self.input_shape[0], self.input_shape[1], self.input_shape[2])', 'pooling': 'self.pooling', 'include_top': '(True)'}), '(weights=self.weight, input_shape=(self.input_shape[0], self.\n input_shape[1], self.input_... |
import os
import time
import argparse
from datetime import datetime
import subprocess
import pdb
import math
import numpy as np
import pybullet as p
import pickle
import matplotlib.pyplot as plt
import gym
from gym import error, spaces, utils
from gym.utils import seeding
from gym.spaces import Box, Dict
import torch
i... | [
"ray.rllib.agents.ppo.DEFAULT_CONFIG.copy",
"ray.rllib.models.torch.fcnet.FullyConnectedNetwork",
"gym_pybullet_drones.envs.multi_agent_rl.MeetupAviary.MeetupAviary",
"ray.init",
"torch.nn.Module.__init__",
"os.path.exists",
"argparse.ArgumentParser",
"ray.rllib.models.torch.torch_modelv2.TorchModelV2... | [((5268, 5365), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Multi-agent reinforcement learning experiments script"""'}), "(description=\n 'Multi-agent reinforcement learning experiments script')\n", (5291, 5365), False, 'import argparse\n'), ((7880, 7894), 'ray.shutdown', 'ray.shut... |
# coding: utf-8
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn as nn
from .pretrainedmodels import inceptionresnetv2
def l2norm(input, p=2.0, dim=1, eps=1e-12):
"""
Compute L2 norm, row-wise
"""
#print("input size(): ", input.size())
l2_inp = input / input.nor... | [
"torch.IntTensor",
"numpy.sqrt",
"torch.nn.Linear",
"torch.nn.GRU"
] | [((481, 493), 'numpy.sqrt', 'np.sqrt', (['(6.0)'], {}), '(6.0)\n', (488, 493), True, 'import numpy as np\n'), ((495, 514), 'numpy.sqrt', 'np.sqrt', (['(nin + nout)'], {}), '(nin + nout)\n', (502, 514), True, 'import numpy as np\n'), ((1290, 1319), 'torch.nn.Linear', 'nn.Linear', (['dim_image', 'hid_dim'], {}), '(dim_im... |
from __future__ import absolute_import
from builtins import str
from builtins import range
from anuga.coordinate_transforms.geo_reference import Geo_reference, DEFAULT_ZONE
from anuga.geometry.polygon import point_in_polygon, populate_polygon
from anuga.utilities.numerical_tools import ensure_numeric
import numpy as n... | [
"anuga.caching.cache",
"anuga.utilities.numerical_tools.ensure_numeric",
"anuga.coordinate_transforms.geo_reference.Geo_reference",
"builtins.str",
"anuga.pmesh.mesh.Mesh",
"exceptions.Exception",
"anuga.geometry.polygon.point_in_polygon",
"builtins.range",
"anuga.utilities.log.resource_usage_timing... | [((7508, 7547), 'anuga.utilities.numerical_tools.ensure_numeric', 'ensure_numeric', (['bounding_polygon', 'float'], {}), '(bounding_polygon, float)\n', (7522, 7547), False, 'from anuga.utilities.numerical_tools import ensure_numeric\n'), ((11197, 11235), 'anuga.pmesh.mesh.Mesh', 'Mesh', ([], {'geo_reference': 'mesh_geo... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | [
"logging.getLogger",
"pytorch_lightning.callbacks.ModelCheckpoint",
"numpy.random.get_state",
"gluonts.itertools.Cached",
"pytorch_lightning.Trainer",
"gluonts.core.component.validated"
] | [((1011, 1038), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1028, 1038), False, 'import logging\n'), ((1555, 1566), 'gluonts.core.component.validated', 'validated', ([], {}), '()\n', (1564, 1566), False, 'from gluonts.core.component import validated\n'), ((4507, 4578), 'pytorch_lightn... |
from sandbox.crazyflie.src.gcg.envs.GibsonEnv.env_modalities import CameraRobotEnv, BaseRobotEnv
from sandbox.crazyflie.src.gcg.envs.GibsonEnv.env_bases import *
from sandbox.crazyflie.src.gcg.envs.GibsonEnv.robot_locomotors import Quadrotor3
from transforms3d import quaternions
import os
import numpy as np
import sys
... | [
"collections.OrderedDict",
"termcolor.colored",
"sandbox.crazyflie.src.gcg.envs.GibsonEnv.robot_locomotors.Quadrotor3",
"numpy.logical_and",
"sandbox.crazyflie.src.gcg.envs.GibsonEnv.env_modalities.CameraRobotEnv._reset",
"gcg.envs.env_spec.EnvSpec",
"sandbox.crazyflie.src.gcg.envs.GibsonEnv.env_modalit... | [((1117, 1230), 'sandbox.crazyflie.src.gcg.envs.GibsonEnv.env_modalities.CameraRobotEnv.__init__', 'CameraRobotEnv.__init__', (['self', 'self.config', 'gpu_count'], {'scene_type': '"""building"""', 'tracking_camera': 'tracking_camera'}), "(self, self.config, gpu_count, scene_type='building',\n tracking_camera=tracki... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.gridspec as gridspec
import matplotlib.patches as mpatches
from scipy.optimize import minimize
import time
def sim_run(options, MPC):
start = time.clock()
# Simulator Options
FIG_SIZE = options['F... | [
"matplotlib.patches.Rectangle",
"time.clock",
"numpy.delete",
"scipy.optimize.minimize",
"numpy.append",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"numpy.rad2deg",... | [((258, 270), 'time.clock', 'time.clock', ([], {}), '()\n', (268, 270), False, 'import time\n'), ((490, 524), 'numpy.zeros', 'np.zeros', (['(mpc.horizon * num_inputs)'], {}), '(mpc.horizon * num_inputs)\n', (498, 524), True, 'import numpy as np\n'), ((872, 896), 'numpy.array', 'np.array', (['[[0, 0, 0, 0]]'], {}), '([[... |
import xml.dom.minidom as MD
# import csv
# import pandas
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
Batch_Size = 32
LR = 0.01
GAMMA = 0.9
EPSILON = 0.9
TARGET_REPLACE_ITER = 100
MEMORY_SIZE = 700
STATES_DIMENTION = 4
ACTIONS_DIMENTI... | [
"numpy.hstack",
"numpy.random.choice",
"torch.max",
"torch.nn.MSELoss",
"numpy.zeros",
"numpy.random.uniform",
"numpy.random.randint",
"torch.nn.functional.relu",
"torch.nn.Linear",
"torch.FloatTensor"
] | [((445, 482), 'torch.nn.Linear', 'torch.nn.Linear', (['STATES_DIMENTION', '(50)'], {}), '(STATES_DIMENTION, 50)\n', (460, 482), False, 'import torch\n'), ((552, 590), 'torch.nn.Linear', 'torch.nn.Linear', (['(50)', 'ACTIONS_DIMENTION'], {}), '(50, ACTIONS_DIMENTION)\n', (567, 590), False, 'import torch\n'), ((702, 711)... |
import os
import numpy as np
from PIL import Image
import torch
import torch.nn as nn
from dataset import TestDataset
from models import ModelBuilder, SegmentationModule
from utils import colorEncode
from lib.nn import user_scattered_collate, async_copy_to
from lib.utils import as_numpy
from constants import REQ_FILE... | [
"flask_cors.CORS",
"flask.Flask",
"numpy.int32",
"io.BytesIO",
"flask_cors.cross_origin",
"torch.max",
"numpy.array",
"dataset.TestDataset",
"models.SegmentationModule",
"utils.colorEncode",
"torch.nn.NLLLoss",
"time.time",
"torch.cuda.set_device",
"PIL.Image.fromarray",
"PIL.Image.open"... | [((481, 492), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (490, 492), False, 'import os\n'), ((621, 635), 'numpy.int32', 'np.int32', (['pred'], {}), '(pred)\n', (629, 635), True, 'import numpy as np\n'), ((2279, 2306), 'torch.nn.NLLLoss', 'nn.NLLLoss', ([], {'ignore_index': '(-1)'}), '(ignore_index=-1)\n', (2289, 2306)... |
# Copyright (c) 2021 Cisco Systems, Inc. and its affiliates
# All rights reserved
#
# 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... | [
"sklearn.metrics.classification_report",
"time.sleep",
"numpy.arange",
"monai.transforms.LoadImage",
"monai.utils.set_determinism",
"os.path.exists",
"monai.transforms.ScaleIntensity",
"os.listdir",
"argparse.ArgumentParser",
"monai.transforms.AddChannel",
"monai.transforms.ToTensor",
"monai.a... | [((7769, 7808), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (7792, 7808), False, 'import argparse\n'), ((2013, 2053), 'os.path.join', 'os.path.join', (['root_dir', '"""MedNIST.tar.gz"""'], {}), "(root_dir, 'MedNIST.tar.gz')\n", (2025, 2053), False, 'impor... |
'''
CIS 419/519 project: Using decision tree ensembles to infer the pathological
cause of age-related neurodegenerative changes based on clinical assessment
nadfahors: <NAME>, <NAME>, & <NAME>
This file contains code for preparing NACC data for analysis, including:
* synthesis of pathology data to create pat... | [
"pandas.Series",
"numpy.ceil",
"numpy.unique",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.OneHotEncoder",
"pandas.crosstab",
"pickle.load",
"numpy.array",
"sklearn.impute.SimpleImputer",
"pandas.DataFrame",
"pandas.concat",
"sklearn.metrics.confusio... | [((1110, 1148), 'pandas.read_csv', 'pd.read_csv', (['"""investigator_nacc48.csv"""'], {}), "('investigator_nacc48.csv')\n", (1121, 1148), True, 'import pandas as pd\n'), ((1349, 1372), 'pandas.read_csv', 'pd.read_csv', (['"""xvar.csv"""'], {}), "('xvar.csv')\n", (1360, 1372), True, 'import pandas as pd\n'), ((13754, 13... |
import unittest
import numpy as np
from PCAfold import preprocess
class TestClustering(unittest.TestCase):
################################################################################
#
# Clustering functions
#
################################################################################
def test_variabl... | [
"numpy.random.rand",
"PCAfold.preprocess.get_centroids",
"PCAfold.preprocess.variable_bins",
"PCAfold.preprocess.get_populations",
"numpy.min",
"PCAfold.preprocess.flip_clusters",
"numpy.array",
"numpy.zeros",
"numpy.linspace",
"PCAfold.preprocess.get_partition",
"PCAfold.preprocess.degrade_clus... | [((6999, 7038), 'numpy.array', 'np.array', (['[0, 0, 0, 1.1, 1, 1, 2, 2, 2]'], {}), '([0, 0, 0, 1.1, 1, 1, 2, 2, 2])\n', (7007, 7038), True, 'import numpy as np\n'), ((7171, 7214), 'numpy.array', 'np.array', (['[-1.2, 0, 0, 0, 1, 1, 1, 2, 2, 2]'], {}), '([-1.2, 0, 0, 0, 1, 1, 1, 2, 2, 2])\n', (7179, 7214), True, 'impor... |
#!/usr/local/bin/env python
import json
import os
import numpy as np
from PIL import Image
# Read input data from JSON
fn = "../../../versign-core/src/app/register_request.json"
fo = open(fn, "r")
payload = json.loads(fo.read())
fo.close()
os.remove(fn)
# Get customer ID
user = payload['customerId']
print('Customer:... | [
"numpy.array",
"PIL.Image.fromarray",
"numpy.reshape",
"os.remove"
] | [((242, 255), 'os.remove', 'os.remove', (['fn'], {}), '(fn)\n', (251, 255), False, 'import os\n'), ((649, 687), 'numpy.reshape', 'np.reshape', (['pixelData', '(height, width)'], {}), '(pixelData, (height, width))\n', (659, 687), True, 'import numpy as np\n'), ((533, 563), 'numpy.array', 'np.array', (["refSign['pixelDat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Define some basic robot costs used in reinforcement learning and optimization.
Dependencies:
- `pyrobolearn.states`
- `pyrobolearn.actions`
"""
from abc import ABCMeta
import numpy as np
import pyrobolearn as prl
from pyrobolearn.robots.robot import Robot
from pyrobol... | [
"numpy.copy",
"numpy.abs",
"numpy.allclose",
"numpy.array",
"numpy.linalg.norm"
] | [((3318, 3335), 'numpy.allclose', 'np.allclose', (['x', '(0)'], {}), '(x, 0)\n', (3329, 3335), True, 'import numpy as np\n'), ((4811, 4838), 'numpy.copy', 'np.copy', (['self.state.data[0]'], {}), '(self.state.data[0])\n', (4818, 4838), True, 'import numpy as np\n'), ((5293, 5310), 'numpy.copy', 'np.copy', (['curr_pos']... |
import logging
import os
import shutil
import tempfile
from pythonrouge.pythonrouge import Pythonrouge
from dotenv import load_dotenv
from sacred.observers import MongoObserver
import torch
import numpy as np
load_dotenv()
SAVE_FILES = os.getenv("SACRED_SAVE_FILES", "false").lower() == "true"
def setup_mongo_observ... | [
"logging.getLogger",
"pythonrouge.pythonrouge.Pythonrouge",
"os.getenv",
"numpy.in1d",
"os.path.join",
"dotenv.load_dotenv",
"tempfile.mkdtemp",
"shutil.rmtree",
"sacred.observers.MongoObserver.create"
] | [((210, 223), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (221, 223), False, 'from dotenv import load_dotenv\n'), ((344, 373), 'os.getenv', 'os.getenv', (['"""SACRED_MONGO_URL"""'], {}), "('SACRED_MONGO_URL')\n", (353, 373), False, 'import os\n'), ((388, 415), 'os.getenv', 'os.getenv', (['"""SACRED_DB_NAME""... |
import torch
import torch.utils.data
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torchvision import datasets, transforms
import torch.nn.functional as F
import numpy as np
from dataset.data_loader_kitti_reimpl import KITTIReader_traj
from models.vgg_warper_weak_short... | [
"torch.mul",
"numpy.log",
"torch.nn.functional.sigmoid",
"torch.nn.MSELoss",
"utils.visual.VisdomShow",
"ops.flow_warper_pad_2x.FlowWarp",
"numpy.mean",
"numpy.concatenate",
"torch.autograd.Variable",
"dataset.data_loader_kitti_reimpl.KITTIReader_traj",
"models.vgg_warper_weak_shortcut_nobn.VGG_... | [((807, 900), 'dataset.data_loader_kitti_reimpl.KITTIReader_traj', 'KITTIReader_traj', ([], {'is_test': '(True)', 'max_interval': '(10)', 'min_ntraj': '(10)', 'max_ntraj': '(10)', 'is_eval': '(True)'}), '(is_test=True, max_interval=10, min_ntraj=10, max_ntraj=10,\n is_eval=True)\n', (823, 900), False, 'from dataset.... |
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap, Normalize
import matplotlib.pylab as pylab
import numpy as np
import sys
np.random.seed(0)
class Pl... | [
"numpy.ones_like",
"numpy.abs",
"matplotlib.pyplot.savefig",
"numpy.average",
"matplotlib.collections.PatchCollection",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.zeros",
"numpy.linspace",
"numpy.random.seed",
"matplotlib.pylab.rcParams.update",
"matplotlib.colors.Normalize",
"numpy.a... | [((293, 310), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (307, 310), True, 'import numpy as np\n'), ((801, 830), 'matplotlib.pylab.rcParams.update', 'pylab.rcParams.update', (['params'], {}), '(params)\n', (822, 830), True, 'import matplotlib.pylab as pylab\n'), ((850, 862), 'matplotlib.pyplot.figur... |
import io
import re
from contextlib import redirect_stdout
import pytest
from numpy.distutils import log
def setup_module():
f = io.StringIO() # changing verbosity also logs here, capture that
with redirect_stdout(f):
log.set_verbosity(2, force=True) # i.e. DEBUG
def teardown_module():
log.s... | [
"contextlib.redirect_stdout",
"numpy.distutils.log.set_verbosity",
"re.compile",
"pytest.mark.parametrize",
"io.StringIO"
] | [((374, 429), 're.compile', 're.compile', (['"""\\\\x1B(?:[@-Z\\\\\\\\-_]|\\\\[[0-?]*[ -/]*[@-~])"""'], {}), "('\\\\x1B(?:[@-Z\\\\\\\\-_]|\\\\[[0-?]*[ -/]*[@-~])')\n", (384, 429), False, 'import re\n'), ((430, 502), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func_name"""', "['error', 'warn', 'info', 'd... |
# https://colab.research.google.com/github/akeshavan/IntroDL/blob/master/IntroToKeras.ipynb#scrollTo=ZCR5NALKsm1o
# *********************************************************************************************************
# 0. Required libraries
# ************************************************************************... | [
"keras.layers.Conv2D",
"keras.utils.to_categorical",
"keras.optimizers.SGD",
"keras.layers.Dense",
"numpy.arange",
"matplotlib.pyplot.imshow",
"numpy.random.seed",
"numpy.vstack",
"keras.backend.clear_session",
"matplotlib.pyplot.axis",
"glob.glob",
"keras.optimizers.Adam",
"matplotlib.pyplo... | [((391, 412), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (405, 412), False, 'import matplotlib\n'), ((2278, 2299), 'glob.glob', 'glob', (['"""dataset/*.jpg"""'], {}), "('dataset/*.jpg')\n", (2282, 2299), False, 'from glob import glob\n'), ((2394, 2420), 'numpy.zeros', 'np.zeros', (['(N, 256, ... |
import logging, os
logging.disable(logging.WARNING)
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import tensorflow as tf
from tensorflow.keras import models
from tensorflow.keras import layers
from tensorflow.keras.layers import BatchNormalization, Conv2D, UpSampling2D, MaxPooling2D, Dropout
from tensorflow.keras.optimiz... | [
"numpy.clip",
"tensorflow.math.logical_not",
"tensorflow.keras.backend.epsilon",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.cast",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Conv2D",
"argparse.ArgumentParser",
"tensorflow.keras.optimizers.Adagrad",
"numpy.stack",
"n... | [((20, 52), 'logging.disable', 'logging.disable', (['logging.WARNING'], {}), '(logging.WARNING)\n', (35, 52), False, 'import logging, os\n'), ((4737, 4770), 'tensorflow.keras.layers.Input', 'layers.Input', ([], {'shape': '(512, 512, 3)'}), '(shape=(512, 512, 3))\n', (4749, 4770), False, 'from tensorflow.keras import la... |
# Donut problem using logistic regression
# Code Flow:
# 1. Import all relevant libraries.
# 2. Generate sample data.
# 3. Plot the data.
# 4. Add bias term.
# 5. Add radius as a feature.
# 6. Generate random weights for initialization.
# 7. Define sigmoid function.
# 8. Calculate Y.
... | [
"numpy.ones",
"matplotlib.pyplot.ylabel",
"numpy.random.random",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.log",
"numpy.exp",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.cos",
"matplotlib.pyplot.scatter",
"numpy.concatenate",
"numpy.sin",
"matplotlib.pyplot.title",... | [((1208, 1242), 'numpy.concatenate', 'np.concatenate', (['[X_inner, X_outer]'], {}), '([X_inner, X_outer])\n', (1222, 1242), True, 'import numpy as np\n'), ((1249, 1290), 'numpy.array', 'np.array', (['([0] * (N // 2) + [1] * (N // 2))'], {}), '([0] * (N // 2) + [1] * (N // 2))\n', (1257, 1290), True, 'import numpy as n... |
# Copyright 2021 Sony Semiconductors Israel, Inc. All rights reserved.
#
# 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 b... | [
"model_compression_toolkit.core.common.graph.graph_matchers.NodeFrameworkAttrMatcher",
"numpy.array",
"model_compression_toolkit.core.common.graph.graph_matchers.NodeOperationMatcher",
"model_compression_toolkit.core.common.graph.BaseNode",
"model_compression_toolkit.core.common.substitutions.shift_negative... | [((4868, 4903), 'model_compression_toolkit.core.common.graph.graph_matchers.NodeOperationMatcher', 'NodeOperationMatcher', (['ZeroPadding2D'], {}), '(ZeroPadding2D)\n', (4888, 4903), False, 'from model_compression_toolkit.core.common.graph.graph_matchers import NodeOperationMatcher, NodeFrameworkAttrMatcher\n'), ((6009... |
import numpy as np
import pandas as pd
l_2d = [[0, 1, 2], [3, 4, 5]]
arr_t = np.array(l_2d).T
print(arr_t)
print(type(arr_t))
# [[0 3]
# [1 4]
# [2 5]]
# <class 'numpy.ndarray'>
l_2d_t = np.array(l_2d).T.tolist()
print(l_2d_t)
print(type(l_2d_t))
# [[0, 3], [1, 4], [2, 5]]
# <class 'list'>
df_t = pd.DataFrame(l... | [
"pandas.DataFrame",
"numpy.array"
] | [((79, 93), 'numpy.array', 'np.array', (['l_2d'], {}), '(l_2d)\n', (87, 93), True, 'import numpy as np\n'), ((306, 324), 'pandas.DataFrame', 'pd.DataFrame', (['l_2d'], {}), '(l_2d)\n', (318, 324), True, 'import pandas as pd\n'), ((193, 207), 'numpy.array', 'np.array', (['l_2d'], {}), '(l_2d)\n', (201, 207), True, 'impo... |
import torch
import shapely
from shapely.geometry import Polygon
import numpy as np
from .transformer_obb import poly2bbox
from .bbox_overlaps_cython import bbox_overlaps_cython
import DOTA_devkit.polyiou as polyiou
def bbox_overlaps(bboxes1, bboxes2, mode='iou', is_aligned=False):
"""Calculate overlap between tw... | [
"DOTA_devkit.polyiou.VectorDouble",
"numpy.where",
"torch.max",
"torch.from_numpy",
"torch.min",
"shapely.geometry.Polygon"
] | [((4246, 4264), 'numpy.where', 'np.where', (['(ious > 0)'], {}), '(ious > 0)\n', (4254, 4264), True, 'import numpy as np\n'), ((1150, 1191), 'torch.max', 'torch.max', (['bboxes1[:, :2]', 'bboxes2[:, :2]'], {}), '(bboxes1[:, :2], bboxes2[:, :2])\n', (1159, 1191), False, 'import torch\n'), ((1218, 1259), 'torch.min', 'to... |
import os
import imageio
import numpy as np
from skimage.transform import resize
import tensorflow as tf
from tensorflow.keras.initializers import RandomNormal
from tensorflow.keras.layers import Conv2D, Activation, Concatenate
# from keras_contrib.layers.normalization.instancenormalization import InstanceNormal... | [
"os.listdir",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.initializers.RandomNormal",
"tensorflow.keras.layers.Concatenate",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.nn.moments",
"numpy.asarray",
"os.path.join",
"tensorflow.random_normal_initializer",
"numpy.zeros",
"ten... | [((3435, 3460), 'tensorflow.keras.initializers.RandomNormal', 'RandomNormal', ([], {'stddev': '(0.02)'}), '(stddev=0.02)\n', (3447, 3460), False, 'from tensorflow.keras.initializers import RandomNormal\n'), ((1142, 1186), 'tensorflow.nn.moments', 'tf.nn.moments', (['x'], {'axes': '[1, 2]', 'keepdims': '(True)'}), '(x, ... |
import numpy as np
def to_2darray(x: np.array, copy: bool = True, trans: bool = False,
flip: bool = False) -> np.array:
"""
Assumption:
-----------
x is assumed to be numpy 2D array or matrix.
(please convert x accordingly). For example,
x = nptweak.to_2darray(x)
The... | [
"numpy.flipud"
] | [((757, 769), 'numpy.flipud', 'np.flipud', (['y'], {}), '(y)\n', (766, 769), True, 'import numpy as np\n')] |
#!/usr/bin/python
#-*- coding:utf-8 -*-
__author__ = 'david'
import numpy as np
import nibabel as nib
import resources as rs
from vispy import app
from plot import Canvas
import matplotlib.pyplot as plt
import gc
np.random.seed()
class Clarity(object):
def __init__(self,token,imgfile=None,pointsfile=None):
... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.hist",
"nibabel.load",
"matplotlib.pyplot.ylabel",
"numpy.hstack",
"numpy.mean",
"numpy.histogram",
"numpy.where",
"numpy.random.random",
"matplotlib.pyplot.xlabel",
"numpy.max",
"numpy.random.seed",
"numpy.vstack",
"numpy.abs",
"numpy.int16",... | [((215, 231), 'numpy.random.seed', 'np.random.seed', ([], {}), '()\n', (229, 231), True, 'import numpy as np\n'), ((844, 862), 'nibabel.load', 'nib.load', (['pathname'], {}), '(pathname)\n', (852, 862), True, 'import nibabel as nib\n'), ((1005, 1022), 'numpy.max', 'np.max', (['self._img'], {}), '(self._img)\n', (1011, ... |
#!/usr/bin/env python
import numpy as np
import netCDF4 as nc
import pandas as pd
import multiprocessing
import textwrap
import matplotlib.pyplot as plt
import lhsmdu
import glob
import json
import os
import ast
import shutil
import subprocess
from contextlib import contextmanager
import param_util as pu
import outp... | [
"pandas.read_csv",
"param_util.get_CMT_datablock",
"numpy.array",
"os.cpu_count",
"os.listdir",
"param_util.cmtdatablock2dict",
"subprocess.run",
"netCDF4.Dataset",
"os.path.isdir",
"doctest.testmod",
"os.mkdir",
"pandas.DataFrame",
"glob.glob",
"param_util.build_param_lookup",
"lhsmdu.r... | [((1521, 1568), 'numpy.array', 'np.array', (["[p['bounds'][0] for p in param_props]"], {}), "([p['bounds'][0] for p in param_props])\n", (1529, 1568), True, 'import numpy as np\n'), ((1579, 1626), 'numpy.array', 'np.array', (["[p['bounds'][1] for p in param_props]"], {}), "([p['bounds'][1] for p in param_props])\n", (1... |
import numpy as np
# import matplotlib.pyplot as plt
import pickle
from pathlib import Path
import torch
from google.protobuf import text_format
from second.utils import simplevis
from second.pytorch.train import build_network
from second.protos import pipeline_pb2
from second.utils import config_tool
import time
impor... | [
"numpy.fromfile",
"second.utils.simplevis.draw_box_in_bev",
"cv2.imshow",
"numpy.array",
"torch.cuda.is_available",
"cv2.destroyAllWindows",
"pathlib.Path",
"numpy.where",
"second.protos.pipeline_pb2.TrainEvalPipelineConfig",
"numpy.concatenate",
"cv2.waitKey",
"pickle.load",
"second.pytorch... | [((661, 699), 'second.protos.pipeline_pb2.TrainEvalPipelineConfig', 'pipeline_pb2.TrainEvalPipelineConfig', ([], {}), '()\n', (697, 699), False, 'from second.protos import pipeline_pb2\n'), ((2060, 2117), 'torch.tensor', 'torch.tensor', (['anchors'], {'dtype': 'torch.float32', 'device': 'device'}), '(anchors, dtype=tor... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import numpy as np
import math
def ClassifyColor( BGR, width, height ): ##分類顏色 (BGR, width, height)
r_threshold = 20 ##r閾值 before 10
b_threshold = 20 ##b閾值 before 10
FortyFive_degree = math.pi / 4 ## 45度
grey_threshold = 10.0 * ... | [
"numpy.ones",
"cv2.erode",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.dilate",
"cv2.waitKey"
] | [((1180, 1199), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1196, 1199), False, 'import cv2\n'), ((2914, 2937), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (2935, 2937), False, 'import cv2\n'), ((1440, 1475), 'cv2.imshow', 'cv2.imshow', (['"""Original frame"""', 'frame'], {}... |
#!/usr/bin/env python
#
# Copyright 2020 Xilinx Inc.
#
# 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 o... | [
"pyxir.ops.input",
"numpy.ones",
"pyxir.ops.prelu",
"pyxir.graph.layer.xlayer.XLayer",
"pyxir.shapes.TensorShape",
"pyxir.ops.constant",
"numpy.array",
"unittest.SkipTest",
"numpy.testing.assert_array_equal"
] | [((1095, 1189), 'unittest.SkipTest', 'unittest.SkipTest', (['"""Skipping Tensorflow related test because Tensorflow is not available"""'], {}), "(\n 'Skipping Tensorflow related test because Tensorflow is not available')\n", (1112, 1189), False, 'import unittest\n'), ((3407, 3604), 'pyxir.graph.layer.xlayer.XLayer',... |
##########################################################################
# NSAp - Copyright (C) CEA, 2013
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details.
##########... | [
"os.path.exists",
"nibabel.save",
"nibabel.load",
"pyfreesurfer.utils.filetools.get_or_check_freesurfer_subjects_dir",
"pyfreesurfer.wrapper.FSWrapper",
"os.path.join",
"numpy.diag",
"os.path.isfile",
"os.path.dirname",
"numpy.loadtxt",
"numpy.linalg.inv",
"numpy.dot",
"os.path.basename",
... | [((2114, 2164), 'pyfreesurfer.utils.filetools.get_or_check_freesurfer_subjects_dir', 'get_or_check_freesurfer_subjects_dir', (['subjects_dir'], {}), '(subjects_dir)\n', (2150, 2164), False, 'from pyfreesurfer.utils.filetools import get_or_check_freesurfer_subjects_dir\n'), ((2563, 2599), 'os.path.join', 'os.path.join',... |
#np39.py
#39.Zipfの法則
"「単語の出現頻度順位を横軸,その出現頻度を縦軸として,両対数グラフをプロットせよ.」"
cat = 'neko.txt.mecab'#catに格納
with open(cat)as f:
#1文ずつ区切って読み込み
text = f.read().splitlines()
import re
#「\t」と「,」で分割してリスト化
nlist = [re.split("[\t|,]", lines) for lines in text]
catlist = []
for line in nlist:
linelist = []
if line[0] != "EOS"... | [
"collections.Counter",
"re.split",
"numpy.log",
"matplotlib.pyplot.show"
] | [((999, 1009), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1007, 1009), True, 'import matplotlib.pyplot as plt\n'), ((201, 226), 're.split', 're.split', (['"""[\t|,]"""', 'lines'], {}), "('[\\t|,]', lines)\n", (209, 226), False, 'import re\n'), ((976, 997), 'numpy.log', 'np.log', (['f_most_common'], {}), '... |
# -*- coding: utf-8 -*-
# Copyright 2020 The PsiZ Authors. All Rights Reserved.
#
# 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 r... | [
"psiz.utils.standard_split",
"tensorflow_probability.math.softplus_inverse",
"pathlib.Path.home",
"psiz.keras.Restarter",
"numpy.equal",
"tensorflow.keras.backend.clear_session",
"psiz.keras.callbacks.EarlyStoppingRe",
"tensorflow.keras.losses.CategoricalCrossentropy",
"os.fspath",
"pathlib.Path",... | [((2063, 2094), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'size': 'small_size'}), "('font', size=small_size)\n", (2069, 2094), True, 'import matplotlib.pyplot as plt\n'), ((2099, 2136), 'matplotlib.pyplot.rc', 'plt.rc', (['"""axes"""'], {'titlesize': 'medium_size'}), "('axes', titlesize=medium_size)\n", (2105... |
# helper function that are used by the settings for multidomain
#
import numpy as np
import pickle
import sys
import struct
import scipy.stats
def load_mesh(fiber_file, sampling_stride_z, rank_no):
# get the mesh nodes, either from a .bin file or a python pickle file
if ".bin" in fiber_file:
# data input from... | [
"numpy.sqrt",
"pickle.load",
"numpy.inner",
"numpy.array",
"struct.unpack",
"numpy.linalg.norm"
] | [((6831, 6869), 'numpy.array', 'np.array', (['fiber_data[0][z_index_fiber]'], {}), '(fiber_data[0][z_index_fiber])\n', (6839, 6869), True, 'import numpy as np\n'), ((6883, 6941), 'numpy.array', 'np.array', (['fiber_data[(n_fibers_x - 1) // 2][z_index_fiber]'], {}), '(fiber_data[(n_fibers_x - 1) // 2][z_index_fiber])\n'... |
# -*- coding:utf-8 -*-
import numpy as np
def dropout(x, level):
if level < 0 or level >= 1:
raise ValueError("Dropout Level must be in interval[0, 1)")
retain_prob = 1. - level
random_tensor = np.random.binomial(n = 1, p = retain_prob, size = x.shape)
print(random_tensor)
x *= random_te... | [
"numpy.array",
"numpy.random.binomial"
] | [((391, 446), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, 7, 8, 9]'], {'dtype': 'np.float32'}), '([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float32)\n', (399, 446), True, 'import numpy as np\n'), ((217, 269), 'numpy.random.binomial', 'np.random.binomial', ([], {'n': '(1)', 'p': 'retain_prob', 'size': 'x.shape'}), '(n=... |
# -*- coding: utf-8 -*-
"""
A simple general csv dataset wrapper for pylearn2.
Can do automatic one-hot encoding based on labels present in a file.
"""
__authors__ = "<NAME>"
__copyright__ = "Copyright 2013, <NAME>"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "3-clause BSD"
__maintainer__ = "?"
__email__ = "<EMAIL... | [
"pylearn2.utils.string_utils.preprocess",
"numpy.array",
"numpy.loadtxt",
"pandas.read_csv"
] | [((4090, 4111), 'pylearn2.utils.string_utils.preprocess', 'preprocess', (['self.path'], {}), '(self.path)\n', (4100, 4111), False, 'from pylearn2.utils.string_utils import preprocess\n'), ((4533, 4555), 'pandas.read_csv', 'pd.read_csv', (['self.path'], {}), '(self.path)\n', (4544, 4555), True, 'import pandas as pd\n'),... |
#coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import argparse
import numpy as np
import PIL.Image as Image
import tensorflow as tf
import retrain as retrain
from count_ops import load_graph
from sklearn.decomposition... | [
"numpy.mean",
"os.listdir",
"sklearn.decomposition.PCA",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"tensorflow.Session",
"os.path.join",
"numpy.stack",
"numpy.array",
"nets.nets_factory.get_network_fn",
"sys.path.append",
"xlsxwriter.Workbook",
"tensorflow.get_default_graph"
] | [((450, 570), 'sys.path.append', 'sys.path.append', (['"""/home/deepl/PHICOMM/FoodAI/FoodAi/tensorflow/tensorflow_models/models/research/PHICOMM/slim"""'], {}), "(\n '/home/deepl/PHICOMM/FoodAI/FoodAi/tensorflow/tensorflow_models/models/research/PHICOMM/slim'\n )\n", (465, 570), False, 'import sys\n'), ((628, 644... |
import logging
import urllib.parse
from collections import defaultdict
import dask.array as da
import dask.dataframe as dd
import lightgbm
import numpy as np
import pandas as pd
from dask import delayed
from dask.distributed import wait, default_client, get_worker
from lightgbm.basic import _safe_call, _LIB
from toolz... | [
"logging.getLogger",
"dask.distributed.get_worker",
"pandas.Series",
"dask.distributed.default_client",
"lightgbm.basic._LIB.LGBM_NetworkFree",
"dask.distributed.wait",
"numpy.array",
"sparse.concatenate",
"toolz.assoc",
"collections.defaultdict",
"toolz.first",
"numpy.concatenate",
"pandas.... | [((484, 511), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (501, 511), False, 'import logging\n'), ((3251, 3262), 'dask.distributed.wait', 'wait', (['parts'], {}), '(parts)\n', (3255, 3262), False, 'from dask.distributed import wait, default_client, get_worker\n'), ((3565, 3582), 'colle... |
__author__ = 'igor'
import numpy as np
from pandas.io.parsers import read_csv
from sklearn.utils import shuffle
import os
F_TRAIN = 'data/training.csv'
F_TEST = 'data/test.csv'
def load(test=False, cols=None):
'''
如果test为真则读取test数据,否则读取训练数据
'''
fname = F_TEST if test else F_TRAIN
df = read_csv(os... | [
"sklearn.utils.shuffle",
"numpy.fromstring",
"numpy.vstack",
"os.path.expanduser"
] | [((318, 343), 'os.path.expanduser', 'os.path.expanduser', (['fname'], {}), '(fname)\n', (336, 343), False, 'import os\n'), ((605, 634), 'numpy.vstack', 'np.vstack', (["df['Image'].values"], {}), "(df['Image'].values)\n", (614, 634), True, 'import numpy as np\n'), ((948, 978), 'sklearn.utils.shuffle', 'shuffle', (['X', ... |
"""
Module: tfrecords
Tfrecords creation and reader for improved performance across multi-gpu
There were a tradeoffs made in this repo. It would be natural to save the generated prepreprocessed image to tfrecord from the generator. This results in enormous (100x) files.
"""
import tensorflow as tf
import os
import cs... | [
"tensorflow.unstack",
"tensorflow.train.Int64List",
"numpy.array",
"tensorflow.io.FixedLenFeature",
"tensorflow.cast",
"pandas.concat",
"os.mkdir",
"pandas.DataFrame",
"tensorflow.stack",
"tensorflow.io.TFRecordWriter",
"tensorflow.subtract",
"deepforest.preprocess.compute_windows",
"tensorf... | [((1942, 1958), 'numpy.array', 'np.array', (['raster'], {}), '(raster)\n', (1950, 1958), True, 'import numpy as np\n'), ((2390, 2456), 'deepforest.preprocess.compute_windows', 'preprocess.compute_windows', (['numpy_image', 'patch_size', 'patch_overlap'], {}), '(numpy_image, patch_size, patch_overlap)\n', (2416, 2456), ... |
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras import layers
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import auc,precision_recall_curve,roc_curve,confusion_matrix
import os,sys
import pickle
def draw_ROC(y_true,y_pred):
fpr,tpr,_... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"tensorflow.keras.losses.MeanSquaredError",
"sklearn.metrics.auc",
"tensorflow.keras.layers.BatchNormalization",
"numpy.array",
"tensorflow.keras.callbacks.EarlyStopping",
"sklearn.metrics.roc_curve",
"tensorflow.keras.layers.Dense",
"numpy.arange",
... | [((9766, 9780), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (9778, 9780), True, 'import matplotlib.pyplot as plt\n'), ((10178, 10188), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (10186, 10188), True, 'import matplotlib.pyplot as plt\n'), ((10223, 10237), 'matplotlib.pyplot.subplots', 'p... |
import numpy
from PIL import Image
import scipy.ndimage
import sys
path = sys.argv[1]
region = sys.argv[2]
x_start = int(sys.argv[3])
y_start = int(sys.argv[4])
x_end = int(sys.argv[5])
y_end = int(sys.argv[6])
out_fname = sys.argv[7]
x_len = x_end - x_start
y_len = y_end - y_start
merged_im = numpy.zeros((x_len * 4... | [
"numpy.zeros"
] | [((298, 357), 'numpy.zeros', 'numpy.zeros', (['(x_len * 4096, y_len * 4096, 3)'], {'dtype': '"""uint8"""'}), "((x_len * 4096, y_len * 4096, 3), dtype='uint8')\n", (309, 357), False, 'import numpy\n')] |
"""
Contains useful graphic generators. Currently, effect measure plots and functional form assessment plots
are implemented. Uses matplotlib to generate graphics. Future inclusions include forest plots
Contents:
Functional form assessment- func_form_plot()
Forest plot/ effect measure plot- EffectMeasurePlot()
... | [
"matplotlib.ticker.NullFormatter",
"numpy.log",
"statsmodels.api.families.family.Binomial",
"matplotlib.ticker.ScalarFormatter",
"statsmodels.formula.api.glm",
"scipy.stats.norm.cdf",
"statsmodels.api.families.family.Gaussian",
"pandas.qcut",
"numpy.where",
"numpy.max",
"numpy.linspace",
"matp... | [((16314, 16323), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (16321, 16323), True, 'import matplotlib.pyplot as plt\n'), ((18833, 18861), 'pandas.concat', 'pd.concat', (['[rf, fff]'], {'axis': '(1)'}), '([rf, fff], axis=1)\n', (18842, 18861), True, 'import pandas as pd\n'), ((20839, 20848), 'matplotlib.pyplo... |
import math
import cloudpickle
import torch
import numpy as np
from collections import OrderedDict
def save_checkpoint(state, filename='checkpoint.pkl'):
data = cloudpickle.dumps(state)
with open(filename, 'wb') as fi:
fi.write(data)
def load_checkpoint(filename='checkpoint.pkl'):
with open(fil... | [
"cloudpickle.dumps",
"cloudpickle.load",
"numpy.max"
] | [((168, 192), 'cloudpickle.dumps', 'cloudpickle.dumps', (['state'], {}), '(state)\n', (185, 192), False, 'import cloudpickle\n'), ((964, 978), 'numpy.max', 'np.max', (['values'], {}), '(values)\n', (970, 978), True, 'import numpy as np\n'), ((355, 375), 'cloudpickle.load', 'cloudpickle.load', (['fi'], {}), '(fi)\n', (3... |
# cython: language_level=3
# -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (c) 2016-2020, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fo... | [
"numpy.median",
"time.perf_counter",
"dpctl.device_context",
"os.path.abspath",
"numpy.dtype"
] | [((2004, 2023), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2021, 2023), False, 'import time\n'), ((2076, 2095), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2093, 2095), False, 'import time\n'), ((2152, 2171), 'numpy.median', 'numpy.median', (['times'], {}), '(times)\n', (2164, 2171), ... |
import numpy as np
import pytest
from vispy.color import Colormap as VispyColormap
from napari.utils.colormaps import Colormap
from napari.utils.colormaps.colormap_utils import (
_MATPLOTLIB_COLORMAP_NAMES,
_VISPY_COLORMAPS_ORIGINAL,
_VISPY_COLORMAPS_TRANSLATIONS,
AVAILABLE_COLORMAPS,
_increment_un... | [
"napari.utils.colormaps.colormap_utils._increment_unnamed_colormap",
"pytest.mark.filterwarnings",
"numpy.random.rand",
"napari.utils.colormaps.Colormap",
"numpy.testing.assert_almost_equal",
"numpy.array",
"napari.utils.colormaps.colormap_utils.AVAILABLE_COLORMAPS.keys",
"pytest.raises",
"numpy.ran... | [((3373, 3422), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore::UserWarning"""'], {}), "('ignore::UserWarning')\n", (3399, 3422), False, 'import pytest\n'), ((3953, 4002), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore::UserWarning"""'], {}), "('ignore::UserWarning')\... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 10:43:03 2020
@author: danish
"""
import cv2 # for capturing videos
import math # for mathematical operations
import pandas as pd
from keras.preprocessing import image # for preprocessing the images
from glob import glob
from tqdm import tqdm
import os
import ... | [
"keras.preprocessing.image.img_to_array",
"cv2.imwrite",
"os.makedirs",
"math.floor",
"numpy.array",
"shutil.rmtree",
"pandas.DataFrame",
"glob.glob",
"keras.preprocessing.image.load_img"
] | [((740, 754), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (752, 754), True, 'import pandas as pd\n'), ((1528, 1566), 'os.makedirs', 'os.makedirs', (['frames_dir'], {'exist_ok': '(True)'}), '(frames_dir, exist_ok=True)\n', (1539, 1566), False, 'import os\n'), ((3390, 3404), 'pandas.DataFrame', 'pd.DataFrame', ... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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 a... | [
"numpy.dtype",
"pytest.raises"
] | [((2325, 2348), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyError)\n', (2338, 2348), False, 'import pytest\n'), ((2749, 2772), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyError)\n', (2762, 2772), False, 'import pytest\n'), ((3020, 3045), 'pytest.raises', 'pytest.raises', (['ValueError'], {... |
"""Implementation of core scheduling algorithms using Gurobi."""
import logging
import os
from collections import defaultdict
from gurobipy import *
import numpy as np
import shelve
import astropy.units as u
import pandas as pd
from collections import defaultdict
from .constants import TIME_BLOCK_SIZE, EXPOSURE_TIME, ... | [
"logging.getLogger",
"pandas.Series",
"numpy.where",
"pandas.merge",
"numpy.sum",
"collections.defaultdict",
"pandas.melt"
] | [((567, 594), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (584, 594), False, 'import logging\n'), ((692, 710), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (703, 710), False, 'from collections import defaultdict\n'), ((1527, 1637), 'pandas.melt', 'pd.melt', (... |
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 3 16:30:52 2021
@author: jakubicek
"""
import os
import numpy as np
import numpy.matlib
import matplotlib.pyplot as plt
# import pandas as pd
# from pathlib import Path
import torch.optim as optim
import glob
import torch.nn as nn
import torch.nn.functional as F
# fro... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"numpy.array",
"torch.nn.BatchNorm1d",
"torch.squeeze",
"torch.nn.functional.softmax",
"numpy.arange",
"torch.nn.MaxPool1d",
"numpy.mean",
"torch.nn.LSTM",
"matplotlib.pyplot.plot",
"loaders.Load_cut_gen_h5",
"os.path.normpa... | [((5185, 5260), 'torch.optim.lr_scheduler.StepLR', 'optim.lr_scheduler.StepLR', (['optimizer'], {'step_size': '(30)', 'gamma': '(0.1)', 'verbose': '(True)'}), '(optimizer, step_size=30, gamma=0.1, verbose=True)\n', (5210, 5260), True, 'import torch.optim as optim\n'), ((5419, 5437), 'numpy.array', 'np.array', (['lbl_li... |
#from __future__ import print_function
#from six.moves import range
from math import log
import numpy as np
class MDLP(object):
'''
Entropy-based Minimum description length principle.
'''
def discretize_feature(self, x, binning):
'''
Discretize a feature x with respective to the given ... | [
"numpy.unique",
"numpy.log",
"math.log",
"numpy.argsort",
"numpy.array",
"numpy.append"
] | [((564, 584), 'numpy.array', 'np.array', (['x_discrete'], {}), '(x_discrete)\n', (572, 584), True, 'import numpy as np\n'), ((1090, 1106), 'numpy.array', 'np.array', (['values'], {}), '(values)\n', (1098, 1106), True, 'import numpy as np\n'), ((1619, 1635), 'numpy.log', 'np.log', (['variable'], {}), '(variable)\n', (16... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | [
"mvpa2.misc.stats.compute_ts_boxplot_stats",
"mvpa2.misc.plot.timeseries_boxplot",
"pylab.subplot",
"pylab.xticks",
"pylab.savefig",
"pylab.xlabel",
"numpy.logical_not",
"pylab.figure",
"numpy.array",
"numpy.rad2deg",
"pylab.ylabel",
"pylab.show"
] | [((3992, 4238), 'mvpa2.misc.plot.timeseries_boxplot', 'timeseries_boxplot', (["stats[0]['median']"], {'mean': "stats[0]['mean']", 'std': "stats[0]['std']", 'n': "stats[0]['n']", 'min': "stats[0]['min']", 'max': "stats[0]['max']", 'p25': "stats[0]['p25']", 'p75': "stats[0]['p75']", 'outlierd': 'stats[1]', 'segment_sizes... |
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
import numpy
import sys
import re
###Definitions###
infile = sys.argv[1]
###Functions###
def get_scaff_names(file):
names = []
for seq in SeqIO.parse(file, 'fasta'):
names.append(seq.id)
return names
def get_sca... | [
"numpy.sum",
"Bio.SeqIO.parse",
"Bio.SeqIO.index",
"re.sub",
"re.findall"
] | [((960, 988), 'Bio.SeqIO.index', 'SeqIO.index', (['infile', '"""fasta"""'], {}), "(infile, 'fasta')\n", (971, 988), False, 'from Bio import SeqIO\n'), ((234, 260), 'Bio.SeqIO.parse', 'SeqIO.parse', (['file', '"""fasta"""'], {}), "(file, 'fasta')\n", (245, 260), False, 'from Bio import SeqIO\n'), ((1075, 1097), 'numpy.s... |
import os
import sys
import numpy as np
from copy import deepcopy
from collections import deque
import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
sys.path.append(os.path.join(os.environ["HOME"], "TTTArena"))
from environment import Environment
from alphazero.mcts import ... | [
"torch.tanh",
"torch.manual_seed",
"torch.nn.functional.leaky_relu",
"torch.log",
"torch.nn.Flatten",
"os.path.join",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.MSELoss",
"torch.cuda.is_available",
"numpy.random.seed",
"torch.nn.Linear",
"numpy.expand_dims",
"torch.nn.functional.soft... | [((411, 435), 'torch.manual_seed', 'torch.manual_seed', (['(80085)'], {}), '(80085)\n', (428, 435), False, 'import torch\n'), ((436, 457), 'numpy.random.seed', 'np.random.seed', (['(80085)'], {}), '(80085)\n', (450, 457), True, 'import numpy as np\n'), ((209, 253), 'os.path.join', 'os.path.join', (["os.environ['HOME']"... |
import numpy as np
import cv2
from libs.util import MaskGenerator, ImageChunker
mask = MaskGenerator(128, 128, 3, rand_seed = 1222)._generate_mask()
mask=mask[0:63,0:63,0]
# import keras.activations as activations
# import tensorflow as tf
# f = np.array([[1, 2, 1],
# [1, 0, 0],
# [-1, 0, 1... | [
"numpy.ones",
"numpy.random.rand",
"libs.util.MaskGenerator",
"numpy.zeros",
"numpy.savetxt",
"cv2.imread"
] | [((610, 683), 'cv2.imread', 'cv2.imread', (['"""C:\\\\Users\\\\dell\\\\Desktop\\\\paper2\\\\\\\\figure\\\\Fig3\\\\\\\\img.jpg"""'], {}), "('C:\\\\Users\\\\dell\\\\Desktop\\\\paper2\\\\\\\\figure\\\\Fig3\\\\\\\\img.jpg')\n", (620, 683), False, 'import cv2\n'), ((753, 773), 'numpy.random.rand', 'np.random.rand', (['(7)',... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.