code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from ..tools.velocity_embedding import velocity_embedding
from ..tools.utils import groups_to_bool
from .utils import default_basis, default_size, default_color, get_components, savefig_or_show, make_unique_list, get_basis
from .velocity_embedding_grid import compute_velocity_on_grid
from .scatter import scatter
from .... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.figure",
"numpy.isnan",
"matplotlib.pyplot.streamplot"
] | [((6200, 6302), 'matplotlib.pyplot.streamplot', 'pl.streamplot', (['X_grid[0]', 'X_grid[1]', 'V_grid[0]', 'V_grid[1]'], {'color': '"""grey"""', 'zorder': '(3)'}), "(X_grid[0], X_grid[1], V_grid[0], V_grid[1], color='grey',\n zorder=3, **stream_kwargs)\n", (6213, 6302), True, 'import matplotlib.pyplot as pl\n'), ((48... |
# Copyright 2008-2018 Univa 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... | [
"mock.patch.object",
"pytest.raises",
"tortuga.resourceAdapter.aws.Aws"
] | [((3428, 3480), 'mock.patch.object', 'mock.patch.object', (['Aws', '"""_load_config_from_database"""'], {}), "(Aws, '_load_config_from_database')\n", (3445, 3480), False, 'import mock\n'), ((3784, 3836), 'mock.patch.object', 'mock.patch.object', (['Aws', '"""_load_config_from_database"""'], {}), "(Aws, '_load_config_fr... |
import pygame
import logging
from Framework.Shapes.Box import Box
from Framework.Shapes.Circle import Circle
from Framework.Sprite import *
from Framework.SpriteText import *
from Framework.GeometricGroup import GeometricGroup
from Framework.MouseListener import MouseListener
from GameObjects.gacha.stickman import Stic... | [
"GameObjects.gacha.stickman.Stickman",
"pygame.Surface",
"pygame.mouse.get_pressed",
"pygame.Rect",
"Framework.Shapes.Circle.Circle",
"pygame.display.get_surface",
"Framework.GeometricGroup.GeometricGroup",
"pygame.time.get_ticks"
] | [((1007, 1021), 'GameObjects.gacha.stickman.Stickman', 'Stickman', (['game'], {}), '(game)\n', (1015, 1021), False, 'from GameObjects.gacha.stickman import Stickman\n'), ((1370, 1393), 'pygame.time.get_ticks', 'pygame.time.get_ticks', ([], {}), '()\n', (1391, 1393), False, 'import pygame\n'), ((3751, 3783), 'pygame.Sur... |
import os
class Config:
UPLOADED_PHOTOS_DEST ='app/static/photos'
API_KEY = os.environ.get('API_KEY')
SECRET_KEY = os.environ.get('SECRET_KEY')
# class TestConfig(Config):
# SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://'
class ProdConfig(Config):
SQLALCHEMY_DATABASE_URI = "postgresql... | [
"os.environ.get"
] | [((88, 113), 'os.environ.get', 'os.environ.get', (['"""API_KEY"""'], {}), "('API_KEY')\n", (102, 113), False, 'import os\n'), ((131, 159), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (145, 159), False, 'import os\n')] |
import os
#--------------------------------------#
# 設定ファイル
#--------------------------------------#
# 環境
ENV = 'development'
DEBUG = True
# DB設定
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://{user}:{password}@{host}/{db_name}?charset=utf8'.format(**{
'user': os.getenv('DB_USER', 'root'),
'password': os.getenv('D... | [
"os.getenv"
] | [((262, 290), 'os.getenv', 'os.getenv', (['"""DB_USER"""', '"""root"""'], {}), "('DB_USER', 'root')\n", (271, 290), False, 'import os\n'), ((308, 336), 'os.getenv', 'os.getenv', (['"""DB_PASSWORD"""', '""""""'], {}), "('DB_PASSWORD', '')\n", (317, 336), False, 'import os\n'), ((350, 383), 'os.getenv', 'os.getenv', (['"... |
#!/usr/bin/env python3
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
import os
import sys
import pstats
import io
import cProfile
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GdkPixbuf', '2.0')
try:
gi.require_version('GtkSource', '4')
except ValueEr... | [
"gi.require_version",
"io.StringIO",
"ocrd_browser.application.OcrdBrowserApplication",
"pstats.Stats",
"gi.repository.Gtk.main_level",
"ocrd_utils.initLogging",
"cProfile.Profile",
"pathlib.Path",
"gi.repository.Gtk.main_quit",
"gi.repository.Gio.resources_register",
"gi.repository.GLib.idle_ad... | [((188, 220), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (206, 220), False, 'import gi\n'), ((221, 259), 'gi.require_version', 'gi.require_version', (['"""GdkPixbuf"""', '"""2.0"""'], {}), "('GdkPixbuf', '2.0')\n", (239, 259), False, 'import gi\n'), ((369, 405), 'g... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This prog... | [
"quantization.new_qrec.QRec.copy_ktype",
"utils.node_id.NodeId",
"copy.deepcopy",
"graph.types.NNEdge",
"importer.common.provisional_dim.ProvisionalDim",
"importer.common.provisional_dim.ProvisionalDim.from_tflite_shape",
"numpy.array",
"numpy.reshape",
"quantization.qtype.QType.from_min_max_sq",
... | [((1811, 1865), 'numpy.array', 'np.array', (['[elem for elem in shape if elem is not None]'], {}), '([elem for elem in shape if elem is not None])\n', (1819, 1865), True, 'import numpy as np\n'), ((8214, 8249), 'numpy.reshape', 'np.reshape', (['inp[0].value', 'new_shape'], {}), '(inp[0].value, new_shape)\n', (8224, 824... |
"""
Module to deploy WhoTracksMe site to an s3 bucket.
Usage:
deploy_to_s3 <bucket_name> [<prefix>] [--production]
Options:
-h, --help Show help message.
--production Production deployment (set cache-control metadata)
"""
import os
import boto3
from docopt import docopt
fro... | [
"boto3.client",
"docopt.docopt",
"os.path.isdir",
"os.walk",
"mimetypes.MimeTypes",
"concurrent.futures.ThreadPoolExecutor",
"os.path.join"
] | [((1578, 1589), 'mimetypes.MimeTypes', 'MimeTypes', ([], {}), '()\n', (1587, 1589), False, 'from mimetypes import MimeTypes\n'), ((2384, 2399), 'docopt.docopt', 'docopt', (['__doc__'], {}), '(__doc__)\n', (2390, 2399), False, 'from docopt import docopt\n'), ((2904, 2922), 'boto3.client', 'boto3.client', (['"""s3"""'], ... |
import os
from approvaltests import verify
from approvaltests.reporters.python_native_reporter import *
def test_files_identical(tmpdir):
file1 = os.path.join(str(tmpdir), "a.received.txt")
file2 = os.path.join(str(tmpdir), "b.approved.txt")
identical_contents = "abc"
with open(file1, "w") as f1:
... | [
"approvaltests.verify"
] | [((878, 890), 'approvaltests.verify', 'verify', (['diff'], {}), '(diff)\n', (884, 890), False, 'from approvaltests import verify\n')] |
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import IUPAC
from Bio.Alphabet import generic_dna
from Bio.Restriction import *
##################################
#FUNCTIONS:
def obtainFastaSequences(filename):
handle = open(filename)
records = []
for seq... | [
"Bio.Seq.Seq",
"Bio.SeqIO.parse"
] | [((330, 358), 'Bio.SeqIO.parse', 'SeqIO.parse', (['handle', '"""fasta"""'], {}), "(handle, 'fasta')\n", (341, 358), False, 'from Bio import SeqIO\n'), ((591, 621), 'Bio.SeqIO.parse', 'SeqIO.parse', (['filename', '"""fasta"""'], {}), "(filename, 'fasta')\n", (602, 621), False, 'from Bio import SeqIO\n'), ((3456, 3487), ... |
from qupulse.pulses import FunctionPT, TablePT
class DataTypes:
""" The possible data types for the pulse creation."""
RAW_DATA = 'rawdata'
QU_PULSE = 'qupulse'
class Templates:
@staticmethod
def chirp(name):
""" Creates a chirp signal
Args:
name (str): The user def... | [
"qupulse.pulses.FunctionPT",
"qupulse.pulses.TablePT"
] | [((698, 819), 'qupulse.pulses.FunctionPT', 'FunctionPT', (['"""amplitude*cos(2*pi*(omega_0+(t/(2*duration))*delta_omega) *t*1e-9+phase)"""', '"""duration"""'], {'channel': 'name'}), "(\n 'amplitude*cos(2*pi*(omega_0+(t/(2*duration))*delta_omega) *t*1e-9+phase)',\n 'duration', channel=name)\n", (708, 819), False, ... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import ParameterConstraintProvider_pb2 as ParameterConstraintProvider__pb2
class ParameterConstraintsProviderStub(object):
"""Feature: Parameter Constraint Provider
Allows a server to apply constraints on specific command p... | [
"grpc.unary_stream_rpc_method_handler",
"grpc.method_handlers_generic_handler"
] | [((3211, 3370), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""sila2.org.silastandard.core.parameterconstraintsprovider.v1.ParameterConstraintsProvider"""', 'rpc_method_handlers'], {}), "(\n 'sila2.org.silastandard.core.parameterconstraintsprovider.v1.ParameterConstraintsProvid... |
# Script for running distributed clients using torchrun
import sys
from fedml.arguments import load_arguments
import subprocess
import os
from fedml.constants import FEDML_TRAINING_PLATFORM_CROSS_SILO
# env_variables = {
# 'NCCL_DEBUG':'INFO',
# 'NCCL_MIN_NRINGS':1,
# 'NCCL_TREE_THRESHOLD':4294967296,
# ... | [
"fedml.arguments.load_arguments",
"os.path.abspath",
"subprocess.run"
] | [((678, 728), 'fedml.arguments.load_arguments', 'load_arguments', (['FEDML_TRAINING_PLATFORM_CROSS_SILO'], {}), '(FEDML_TRAINING_PLATFORM_CROSS_SILO)\n', (692, 728), False, 'from fedml.arguments import load_arguments\n'), ((1515, 1573), 'subprocess.run', 'subprocess.run', (['(pdsh_cmd_aruments + torchrun_cmd_arguments)... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"textwrap.dedent",
"logging.error",
"logging.exception",
"superset.models.core.Log",
"typing.cast",
"inspect.isclass",
"flask.request.args.to_dict",
"flask.g.user.get_id",
"superset.views.core.get_form_data",
"logging.warning",
"json.dumps",
"flask.request.form.to_dict",
"functools.wraps",
... | [((9764, 9790), 'inspect.isclass', 'inspect.isclass', (['cfg_value'], {}), '(cfg_value)\n', (9779, 9790), False, 'import inspect\n'), ((10783, 10816), 'typing.cast', 'cast', (['AbstractEventLogger', 'result'], {}), '(AbstractEventLogger, result)\n', (10787, 10816), False, 'from typing import Any, Callable, cast, Dict, ... |
from bs4 import BeautifulSoup
import urllib.request as req
import os
with open("./oglethorpe?view=gamelog") as f:
soup = BeautifulSoup(f.read())
# Don't ask. (I just stared at HTML and went through tables until we got the
# right one.)
stats_table = soup.find_all("table")[7]
# The first row is just header inform... | [
"urllib.request.urlopen",
"os.path.exists",
"os.makedirs",
"os.path.basename"
] | [((487, 515), 'os.path.exists', 'os.path.exists', (['BOXSCORE_DIR'], {}), '(BOXSCORE_DIR)\n', (501, 515), False, 'import os\n'), ((521, 546), 'os.makedirs', 'os.makedirs', (['BOXSCORE_DIR'], {}), '(BOXSCORE_DIR)\n', (532, 546), False, 'import os\n'), ((555, 580), 'os.path.exists', 'os.path.exists', (['PLAYS_DIR'], {}),... |
#!/usr/bin/env python3
# Copyright 2020 The Johns Hopkins University Applied Physics Laboratory LLC
# All rights reserved.
#
# Licensed under the 3-Clause BSD License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org... | [
"z3.solve",
"torch.nn.ReLU",
"lantern.as_z3",
"z3.FPSort",
"torch.nn.Linear",
"lantern.round_model",
"z3.SolverFor"
] | [((1556, 1574), 'lantern.as_z3', 'lantern.as_z3', (['net'], {}), '(net)\n', (1569, 1574), False, 'import lantern\n'), ((1949, 1970), 'z3.solve', 'z3.solve', (['constraints'], {}), '(constraints)\n', (1957, 1970), False, 'import z3\n'), ((2246, 2267), 'z3.solve', 'z3.solve', (['constraints'], {}), '(constraints)\n', (22... |
from flask import flash, redirect, url_for
def flash_and_redirect_to_index(message, category):
flash(message, category)
return redirect(url_for('jekyll.welcome'))
| [
"flask.url_for",
"flask.flash"
] | [((101, 125), 'flask.flash', 'flash', (['message', 'category'], {}), '(message, category)\n', (106, 125), False, 'from flask import flash, redirect, url_for\n'), ((146, 171), 'flask.url_for', 'url_for', (['"""jekyll.welcome"""'], {}), "('jekyll.welcome')\n", (153, 171), False, 'from flask import flash, redirect, url_fo... |
from ..base import MultiGridEnv
from .empty import EmptyMultiGrid
from .doorkey import DoorKeyEnv
from .cluttered import ClutteredMultiGrid
from .goalcycle import ClutteredGoalCycleEnv
from .open_doors import OpenDoorsMultiGrid
from .viz_test import VisibilityTestEnv
from ..agents import GridAgentInterface
from gym.e... | [
"inspect.isclass",
"random.randint",
"gym.envs.registration.register"
] | [((1608, 1677), 'gym.envs.registration.register', 'gym_register', (['env_name'], {'entry_point': 'f"""marlgrid.envs:{env_class_name}"""'}), "(env_name, entry_point=f'marlgrid.envs:{env_class_name}')\n", (1620, 1677), True, 'from gym.envs.registration import register as gym_register\n'), ((2061, 2091), 'random.randint',... |
import gws.tools.units
import _test.util as u
def test_parse():
nn, uu = gws.tools.units.parse('24.5mm', units=['px', 'mm'])
assert (nn, uu) == (24.5, 'mm')
nn, uu = gws.tools.units.parse('24.5 m', units=['px', 'mm'])
assert (nn, uu) == (24500, 'mm')
nn, uu = gws.tools.units.parse('1234 mm', un... | [
"_test.util.raises"
] | [((815, 835), '_test.util.raises', 'u.raises', (['ValueError'], {}), '(ValueError)\n', (823, 835), True, 'import _test.util as u\n'), ((913, 933), '_test.util.raises', 'u.raises', (['ValueError'], {}), '(ValueError)\n', (921, 933), True, 'import _test.util as u\n'), ((1014, 1034), '_test.util.raises', 'u.raises', (['Va... |
# Generated by Django 2.0.8 on 2018-08-31 08:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('diary', '0003_auto_20180829_2123'),
]
operations = [
migrations.AlterModelOptions(
name='user_answer',
options={'ord... | [
"django.db.models.TextField",
"django.db.migrations.AlterModelOptions"
] | [((233, 325), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""user_answer"""', 'options': "{'ordering': ['-created_at']}"}), "(name='user_answer', options={'ordering': [\n '-created_at']})\n", (261, 325), False, 'from django.db import migrations, models\n'), ((469, 500), '... |
import sqlite3
def conSQLite(db):
if (db == 'memory'):
con = sqlite3.connect(':memory:')
else:
try:
con = sqlite3.connect(db)
except:
return 0
cursor = con.cursor()
return con, cursor | [
"sqlite3.connect"
] | [((78, 105), 'sqlite3.connect', 'sqlite3.connect', (['""":memory:"""'], {}), "(':memory:')\n", (93, 105), False, 'import sqlite3\n'), ((150, 169), 'sqlite3.connect', 'sqlite3.connect', (['db'], {}), '(db)\n', (165, 169), False, 'import sqlite3\n')] |
# Python program killing
# a thread using ._stop()
# function
# This kills the program after the period of time denoted as sleep_time (In seconds)
# It determines for how long the relay remains on
#
import time
import threading
import RPi.GPIO as GPIO
sleep_time = 5
class Ignition(threading.Thread):
# Thre... | [
"RPi.GPIO.output",
"threading.Event",
"time.sleep"
] | [((574, 591), 'threading.Event', 'threading.Event', ([], {}), '()\n', (589, 591), False, 'import threading\n'), ((891, 929), 'RPi.GPIO.output', 'GPIO.output', (['self._actuator', 'GPIO.HIGH'], {}), '(self._actuator, GPIO.HIGH)\n', (902, 929), True, 'import RPi.GPIO as GPIO\n'), ((993, 1015), 'time.sleep', 'time.sleep',... |
import collections
import itertools
import pytest
@pytest.fixture(autouse=True)
def wait_for_first_block(web3, wait_for_block, skip_if_testrpc):
skip_if_testrpc(web3)
wait_for_block(web3)
def test_eth_getTransactionFromBlock(web3, extra_accounts, wait_for_transaction):
current_block_number = web3.eth.bl... | [
"itertools.groupby",
"pytest.fixture"
] | [((53, 81), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (67, 81), False, 'import pytest\n'), ((979, 1038), 'itertools.groupby', 'itertools.groupby', (['all_receipts', "(lambda r: r['blockNumber'])"], {}), "(all_receipts, lambda r: r['blockNumber'])\n", (996, 1038), False, 'impor... |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | [
"ansible.module_utils.ec2.ec2_argument_spec",
"ansible.module_utils.aws.core.AnsibleAWSModule",
"ansible.module_utils.ec2.get_ec2_security_group_ids_from_names",
"ansible.module_utils.ec2.map_complex_type",
"time.sleep",
"ansible.module_utils.ec2.snake_dict_to_camel_dict"
] | [((20196, 20215), 'ansible.module_utils.ec2.ec2_argument_spec', 'ec2_argument_spec', ([], {}), '()\n', (20213, 20215), False, 'from ansible.module_utils.ec2 import ec2_argument_spec\n'), ((21706, 21950), 'ansible.module_utils.aws.core.AnsibleAWSModule', 'AnsibleAWSModule', ([], {'argument_spec': 'argument_spec', 'suppo... |
from _collections import defaultdict
from collections import namedtuple
import operator
import random
import weakref
from protocolbuffers import Outfits_pb2
from animation import get_throwaway_animation_context
from animation.animation_utils import create_run_animation, flush_all_animations
from animation.arb import Ar... | [
"animation.animation_utils.create_run_animation",
"animation.asm.create_asm",
"animation.arb.Arb",
"animation.get_throwaway_animation_context",
"sims.outfits.outfit_enums.OutfitCategory",
"random.choice",
"services.get_laundry_service",
"services.time_service",
"event_testing.resolver.SingleSimResol... | [((891, 969), 'collections.namedtuple', 'namedtuple', (['"""OutfitPriority"""', "('change_reason', 'priority', 'interaction_ref')"], {}), "('OutfitPriority', ('change_reason', 'priority', 'interaction_ref'))\n", (901, 969), False, 'from collections import namedtuple\n'), ((1158, 1184), '_collections.defaultdict', 'defa... |
import json
import os
import time
import tensorflow as tf
import shutil
import zipfile
from convlab2.dst.mdbt.mdbt import MDBT
from convlab2.dst.mdbt.mdbt_util import load_word_vectors, load_ontology, load_woz_data_new
from convlab2.util.dataloader.module_dataloader import AgentDSTDataloader
from convlab2.util.dataloa... | [
"os.path.abspath",
"zipfile.ZipFile",
"convlab2.dst.mdbt.mdbt_util.load_woz_data_new",
"convlab2.dst.mdbt.mdbt_util.load_ontology",
"json.dumps",
"time.time",
"convlab2.util.dataloader.dataset_dataloader.MultiWOZDataloader",
"tensorflow.ConfigProto",
"convlab2.dst.mdbt.mdbt_util.load_word_vectors",
... | [((3690, 3706), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (3704, 3706), True, 'import tensorflow as tf\n'), ((3808, 3819), 'time.time', 'time.time', ([], {}), '()\n', (3817, 3819), False, 'import time\n'), ((946, 980), 'os.path.join', 'os.path.join', (['local_path', 'data_dir'], {}), '(local_path, d... |
# This file is part of the pylint-ignore project
# https://github.com/mbarkhau/pylint-ignore
#
# Copyright (c) 2020 <NAME> (<EMAIL>) - MIT License
# SPDX-License-Identifier: MIT
import re
import shutil
import typing as typ
import hashlib
import logging
import collections
import pylev
import pathlib2 as pl
logger = lo... | [
"pylev.levenshtein",
"collections.OrderedDict",
"collections.Counter",
"pathlib2.Path",
"logging.getLogger",
"re.compile"
] | [((318, 352), 'logging.getLogger', 'logging.getLogger', (['"""pylint_ignore"""'], {}), "('pylint_ignore')\n", (335, 352), False, 'import logging\n'), ((1646, 1697), 're.compile', 're.compile', (['_ENTRY_HEADER_PATTERN'], {'flags': 're.VERBOSE'}), '(_ENTRY_HEADER_PATTERN, flags=re.VERBOSE)\n', (1656, 1697), False, 'impo... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# Data Science
import numpy as np
import pandas as pd
# Visualization
import seaborn as sns
import matplotlib.pyplot as plt
# Tricks
sns.set(style='ticks', context='talk', font_scale=1.15)
# In[ ]:
import os, sys
from skimage.io import imread as skIR
from PIL impor... | [
"sys.path.append",
"numpy.stack",
"os.path.abspath",
"PIL.Image.new",
"matplotlib.pyplot.imshow",
"os.path.exists",
"numpy.zeros",
"numpy.array",
"numpy.swapaxes",
"pandas.Series",
"seaborn.set",
"skimage.io.imread"
] | [((184, 239), 'seaborn.set', 'sns.set', ([], {'style': '"""ticks"""', 'context': '"""talk"""', 'font_scale': '(1.15)'}), "(style='ticks', context='talk', font_scale=1.15)\n", (191, 239), True, 'import seaborn as sns\n'), ((372, 403), 'os.path.abspath', 'os.path.abspath', (['Mask_RCNN_ROOT'], {}), '(Mask_RCNN_ROOT)\n', ... |
from sklearn.datasets import make_multilabel_classification
from sklearn.model_selection import train_test_split
from mllearn.problem_transform import BinaryRelevance
from mllearn.metrics import subset_acc
from mllearn.metrics import hamming_loss as hamming_loss
from mllearn.metrics import accuracy
from mllearn.metrics... | [
"mllearn.metrics.accuracy",
"mllearn.metrics.recall",
"sklearn.datasets.make_multilabel_classification",
"sklearn.model_selection.train_test_split",
"mllearn.metrics.precision",
"mllearn.metrics.F_beta",
"mllearn.metrics.hamming_loss",
"mllearn.problem_transform.BinaryRelevance",
"mllearn.metrics.su... | [((416, 544), 'sklearn.datasets.make_multilabel_classification', 'make_multilabel_classification', ([], {'n_samples': '(700)', 'n_features': '(80)', 'n_classes': '(5)', 'n_labels': '(2)', 'allow_unlabeled': '(False)', 'random_state': '(1)'}), '(n_samples=700, n_features=80, n_classes=5,\n n_labels=2, allow_unlabeled... |
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import numpy as np
import pandas as pd
import seaborn as sns
def __add_name_labels(ax, xs, ys):
last_y_pos = 9999
for i, name in enumerate(xs):
y_pos = ys[name] - 0.1
if np.abs(y_pos - last_y_pos) < 0.1:
... | [
"matplotlib.pyplot.xlim",
"pandas.NamedAgg",
"matplotlib.pyplot.show",
"numpy.abs",
"seaborn.scatterplot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"seaborn.violinplot",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.figure",
"seaborn.boxplo... | [((921, 948), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (931, 948), True, 'import matplotlib.pyplot as plt\n'), ((1402, 1420), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (1418, 1420), True, 'import matplotlib.pyplot as plt\n'), ((1523, 15... |
import hashlib
import mock
import unittest
class FilesTestCase(unittest.TestCase):
def _file(self, *args, **kwargs):
""" Proxy to ensure ImportErrors actually cause test failures rather
than trashing the test run entirely """
from fabtools import require
require.files.file(*args, ... | [
"hashlib.md5",
"fabtools.require.files.file",
"mock.patch"
] | [((336, 379), 'mock.patch', 'mock.patch', (['"""fabtools.require.files.md5sum"""'], {}), "('fabtools.require.files.md5sum')\n", (346, 379), False, 'import mock\n'), ((385, 429), 'mock.patch', 'mock.patch', (['"""fabtools.require.files.is_file"""'], {}), "('fabtools.require.files.is_file')\n", (395, 429), False, 'import... |
import pytest
import pathlib
import os
pytest_plugins = "pytester"
path = pathlib.Path(__file__).parent.absolute()
default_resource_dir = os.path.join(path, "..", "pytest_libiio", "resources", "devices")
def pytest_addoption(parser):
parser.addoption(
"--disable_mock",
action="store_true",
... | [
"pathlib.Path",
"pytest.fixture",
"os.path.join"
] | [((140, 205), 'os.path.join', 'os.path.join', (['path', '""".."""', '"""pytest_libiio"""', '"""resources"""', '"""devices"""'], {}), "(path, '..', 'pytest_libiio', 'resources', 'devices')\n", (152, 205), False, 'import os\n'), ((863, 894), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='s... |
"""
Details of how the data model objects are mapped onto the relational database
are encapsulated here.
"""
import logging
import pkg_resources
from sqlalchemy import and_, asc, Boolean, Column, DateTime, desc, ForeignKey, Integer, MetaData, not_, Numeric, select, String, Table, TEXT, Unicode, UniqueConstraint
from ... | [
"galaxy.model.base.ModelMapping",
"sqlalchemy.orm.mapper",
"sqlalchemy.orm.collections.attribute_mapped_collection",
"galaxy.model.custom_types.JSONType",
"sqlalchemy.orm.object_session",
"sqlalchemy.select",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.Column",
"sqlalchemy.orm.class_mapper",
"sqlal... | [((921, 948), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (938, 948), False, 'import logging\n'), ((963, 973), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (971, 973), False, 'from sqlalchemy import and_, asc, Boolean, Column, DateTime, desc, ForeignKey, Integer, MetaData, not_... |
import tensorflow as tf
import rnn.Configurations
from util.Pose2d import Pose2d
class RNNController(object):
def __init__(self, folder):
self.config = rnn.Configurations.get_config(folder)
self.config.load_normal_data(folder)
self.pose = Pose2d()
self.model = self.config... | [
"util.Pose2d.Pose2d",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer"
] | [((270, 278), 'util.Pose2d.Pose2d', 'Pose2d', ([], {}), '()\n', (276, 278), False, 'from util.Pose2d import Pose2d\n'), ((353, 365), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (363, 365), True, 'import tensorflow as tf\n'), ((382, 398), 'tensorflow.train.Saver', 'tf.train.Saver', ([], {}), '()\n', (396, 398)... |
from PyQt5 import QtGui, QtCore, QtWidgets
import sys
from Crazystuff import *
class GO(Window):
def __init__(self):
super().__init__()
v = View(600, 600, parent = self)
self.setFixedSize(v.width(), v.height())
rect = v.stage.addRect(GetRekt(0,0,100,100))
rect.setBru... | [
"PyQt5.QtWidgets.QApplication"
] | [((739, 771), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (761, 771), False, 'from PyQt5 import QtGui, QtCore, QtWidgets\n')] |
from zipfile import ZipFile
class P:
def pack(self,folpat,folsave,name):
self.save = folsave
self.fname = (name+".zip")
self.pat = (self.save+'/'+self.fname)
with ZipFile(self.pat,'w') as zip:
for data in folpat:
zi... | [
"zipfile.ZipFile"
] | [((232, 254), 'zipfile.ZipFile', 'ZipFile', (['self.pat', '"""w"""'], {}), "(self.pat, 'w')\n", (239, 254), False, 'from zipfile import ZipFile\n')] |
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import Sequence, Parallel, Func, Wait, SoundInterval
from pirates.effects.VolcanoSmoke import VolcanoSmoke
from pirates.effects.EruptionSmoke import EruptionSmoke
from pirates.effects.LavaEruption import LavaEruption
from pirates.effects.LavaSplats i... | [
"pirates.audio.SoundGlobals.loadSfx",
"random.randint",
"pirates.effects.LavaEruption.LavaEruption",
"pirates.effects.CameraShaker.CameraShaker",
"pirates.effects.EruptionSmoke.EruptionSmoke",
"pirates.effects.LavaSplats.LavaSplats",
"pirates.effects.VolcanoSmoke.VolcanoSmoke"
] | [((641, 655), 'pirates.effects.VolcanoSmoke.VolcanoSmoke', 'VolcanoSmoke', ([], {}), '()\n', (653, 655), False, 'from pirates.effects.VolcanoSmoke import VolcanoSmoke\n'), ((1122, 1144), 'random.randint', 'random.randint', (['(10)', '(20)'], {}), '(10, 20)\n', (1136, 1144), False, 'import random\n'), ((1235, 1249), 'pi... |
# Copyright 2020 Google 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 by applicable law or a... | [
"timesketch.lib.sigma_util.get_sigma_rule",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.basename",
"pandas.read_csv",
"os.path.isdir",
"os.walk",
"timesketch.lib.sigma_util.get_sigma_config_file",
"os.environ.get",
"logging.info",
"os.path.isfile",
"sys.exit",
"os.path.join",
"os.ac... | [((1195, 1249), 'logging.getLogger', 'logging.getLogger', (['"""timesketch.test_tool.sigma-verify"""'], {}), "('timesketch.test_tool.sigma-verify')\n", (1212, 1249), False, 'import logging\n'), ((2403, 2432), 'pandas.read_csv', 'pd.read_csv', (['rule_status_path'], {}), '(rule_status_path)\n', (2414, 2432), True, 'impo... |
import sys
sys.path.append('../')
sys.path.append('/opt/nvidia/deepstream/deepstream/lib')
from time import sleep
import time
import numpy as np
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstVideo', '1.0')
from gi.repository import GObject, Gst, GstVideo
from common.FPS import GETFPS
import pyds... | [
"sys.stdout.write",
"pyds.unset_callback_funcs",
"gstutils.get_np_dtype",
"pyds.get_string",
"my_utils.Segmentor",
"pyds.nvds_add_display_meta_to_frame",
"sys.path.append",
"gi.repository.Gst.Caps.from_string",
"gi.repository.GObject.MainLoop",
"gi.repository.GObject.threads_init",
"pyds.nvds_ac... | [((11, 33), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (26, 33), False, 'import sys\n'), ((34, 90), 'sys.path.append', 'sys.path.append', (['"""/opt/nvidia/deepstream/deepstream/lib"""'], {}), "('/opt/nvidia/deepstream/deepstream/lib')\n", (49, 90), False, 'import sys\n'), ((157, 189), 'gi.... |
import tensorflow as tf
import h5py
from pathlib import Path
from .reader import get_meta, get_tokens, RecordReader
class DatasetBase:
def __init__(self,
dataset_path,
splits = ['training', 'validation'],
shuffle_splits = ['training'],
... | [
"h5py.File",
"tensorflow.data.Dataset.from_tensor_slices",
"pathlib.Path"
] | [((686, 719), 'h5py.File', 'h5py.File', (['self.dataset_path', '"""r"""'], {}), "(self.dataset_path, 'r')\n", (695, 719), False, 'import h5py\n'), ((2352, 2401), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['record_tokens'], {}), '(record_tokens)\n', (2386, 2401), True, 'import ... |
# Copyright 2020 Huawei Technologies Co., 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 agreed to... | [
"akg.utils.validation_check.check_input_type",
"akg.lang.cce.cast_to",
"akg.lang.cce.vadd",
"akg.lang.cce.vmul",
"akg.lang.cce.vmax",
"akg.utils.format_transform.get_shape",
"akg.utils.validation_check.check_shape",
"akg.utils.dsl_create.produce_shapes",
"akg.tvm.const",
"akg.lang.cce.vmin",
"ak... | [((2676, 2746), 'akg.utils.validation_check.check_input_type', 'vc_util.check_input_type', (['akg.tvm.tensor.Tensor', 'akg.tvm.tensor.Tensor'], {}), '(akg.tvm.tensor.Tensor, akg.tvm.tensor.Tensor)\n', (2700, 2746), True, 'from akg.utils import validation_check as vc_util, kernel_exec as utils\n'), ((1046, 1072), 'akg.u... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.util.formatted_flat_dict",
"oci.util.value_allowed_none_or_none_sentinel"
] | [((22146, 22171), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (22165, 22171), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n'), ((12638, 12706), 'oci.util.value_allowed_none_or_none_sentinel', 'value_allowed_none_or_none_sent... |
import warnings
from typing import Callable, Optional
from fedot.core.log import Log
from fedot.core.operations.evaluation. \
operation_implementations.implementation_interfaces import ModelImplementation
from fedot.core.repository.dataset_types import DataTypesEnum
class CustomModelImplementation(ModelImplement... | [
"warnings.warn"
] | [((1256, 1308), 'warnings.warn', 'warnings.warn', (['"""Input model_predict is not Callable"""'], {}), "('Input model_predict is not Callable')\n", (1269, 1308), False, 'import warnings\n')] |
import unittest
import xjpath
class TestXJPath(unittest.TestCase):
def test_get_all_dict_values_from_top(self):
d = {'t1': 1, 't2': 2, 't3': 3, 't4': 4}
v = xjpath.strict_path_lookup(d, '*')
self.assertTrue(isinstance(v, tuple))
self.assertEqual([1, 2, 3, 4], sorted(v))
def ... | [
"unittest.main",
"xjpath.strict_path_lookup",
"xjpath.path_lookup",
"logging.basicConfig",
"xjpath.validate_path",
"xjpath.XJPath"
] | [((7716, 7759), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.CRITICAL'}), '(level=logging.CRITICAL)\n', (7735, 7759), False, 'import logging\n'), ((7764, 7779), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7777, 7779), False, 'import unittest\n'), ((181, 214), 'xjpath.strict_path_lookup... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009 by <NAME> <http://gustavonarea.net/>.
#
# This file is part of Booleano <http://code.gustavonarea.net/booleano/>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... | [
"booleano.exc.ScopeError",
"logging.getLogger"
] | [((1634, 1653), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1643, 1653), False, 'from logging import getLogger\n'), ((8018, 8095), 'booleano.exc.ScopeError', 'ScopeError', (["(u'%s already belongs to %s' % (obj.global_name, obj.symbol_table))"], {}), "(u'%s already belongs to %s' % (obj.globa... |
from detectron2.data.datasets.register_coco import register_coco_instances
import os
categories = [
{'id': 1, 'name': 'aeroplane'},
{'id': 2, 'name': 'bicycle'},
{'id': 3, 'name': 'bird'},
{'id': 4, 'name': 'boat'},
{'id': 5, 'name': 'bottle'},
{'id': 6, 'name': 'bus'},
{'id': 7, ... | [
"os.path.join"
] | [((1537, 1573), 'os.path.join', 'os.path.join', (['"""datasets"""', 'image_root'], {}), "('datasets', image_root)\n", (1549, 1573), False, 'import os\n'), ((1450, 1485), 'os.path.join', 'os.path.join', (['"""datasets"""', 'json_file'], {}), "('datasets', json_file)\n", (1462, 1485), False, 'import os\n')] |
from django import template
register = template.Library()
@register.inclusion_tag('bookmarks/_tags/collections_modal.html', takes_context=True)
def collections_modal(context):
user = context.get('user')
return {'collections': user.collections.all()} | [
"django.template.Library"
] | [((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')] |
from django.urls import path, include
from auth_demos.auth_app.views import UserRegistrationView, UserLoginView, UserLogoutView, RestrictedView
urlpatterns = [
path('register/', UserRegistrationView.as_view(), name='register user'),
path('login/', UserLoginView.as_view(), name='login user'),
path('logout/... | [
"auth_demos.auth_app.views.UserRegistrationView.as_view",
"auth_demos.auth_app.views.UserLoginView.as_view",
"auth_demos.auth_app.views.RestrictedView.as_view",
"auth_demos.auth_app.views.UserLogoutView.as_view"
] | [((184, 214), 'auth_demos.auth_app.views.UserRegistrationView.as_view', 'UserRegistrationView.as_view', ([], {}), '()\n', (212, 214), False, 'from auth_demos.auth_app.views import UserRegistrationView, UserLoginView, UserLogoutView, RestrictedView\n'), ((258, 281), 'auth_demos.auth_app.views.UserLoginView.as_view', 'Us... |
import os
import re
import json
def getnewname(oldname):
try:
[uppath, filename] = os.path.split(oldname)
[filename, exname] = os.path.splitext(filename)
p = re.compile(r"([a-zA-Z]{3,4})(-|00|_|)([0-9]{3})((-|_|)[CcRr]){0,}")
m = p.search(filename)
if m == None:
... | [
"os.getcwd",
"json.dumps",
"os.path.splitext",
"os.renames",
"os.path.split",
"os.path.join",
"os.listdir",
"re.compile"
] | [((2229, 2244), 'json.dumps', 'json.dumps', (['log'], {}), '(log)\n', (2239, 2244), False, 'import json\n'), ((2389, 2400), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2398, 2400), False, 'import os\n'), ((96, 118), 'os.path.split', 'os.path.split', (['oldname'], {}), '(oldname)\n', (109, 118), False, 'import os\n'), ... |
#
# 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 writing, software
# ... | [
"cinderclient.client.Client",
"sys.stderr.write",
"time.sleep"
] | [((782, 821), 'cinderclient.client.Client', 'cinderclient.Client', (['(2)'], {'session': 'session'}), '(2, session=session)\n', (801, 821), True, 'from cinderclient import client as cinderclient\n'), ((1585, 1679), 'sys.stderr.write', 'sys.stderr.write', (["('Waiting volume %s: %s (%s)\\n' % (target_states, instance.na... |
# ------------------------------------------------------------------------
# Copyright (c) Hitachi, Ltd. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
import argparse
import torch
from torch imp... | [
"argparse.ArgumentParser",
"torch.load",
"torch.cat",
"torch.save",
"torch.nn.Linear"
] | [((358, 383), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (381, 383), False, 'import argparse\n'), ((697, 723), 'torch.load', 'torch.load', (['args.load_path'], {}), '(args.load_path)\n', (707, 723), False, 'import torch\n'), ((3093, 3123), 'torch.save', 'torch.save', (['ps', 'args.save_path... |
# 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 writing, software
# distributed ... | [
"rally.plugins.openstack.scenario.configure",
"rally.task.validation.image_valid_on_flavor",
"rally.task.validation.required_openstack",
"rally.task.types.convert"
] | [((821, 898), 'rally.task.types.convert', 'types.convert', ([], {'image': "{'type': 'glance_image'}", 'flavor': "{'type': 'nova_flavor'}"}), "(image={'type': 'glance_image'}, flavor={'type': 'nova_flavor'})\n", (834, 898), False, 'from rally.task import types\n'), ((923, 974), 'rally.task.validation.image_valid_on_flav... |
"""
Django settings for project project.
Generated by 'django-admin startproject' using Django 2.1.
SECURITY WARNING :: SEE CHECKLIST BEFORE DEPLOYING IN PRODUCTION
https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/se... | [
"os.path.abspath",
"os.path.dirname",
"environ.Env.read_env",
"os.environ.get",
"os.path.join",
"environ.Env"
] | [((622, 651), 'os.path.dirname', 'os.path.dirname', (['SETTINGS_DIR'], {}), '(SETTINGS_DIR)\n', (637, 651), False, 'import os\n'), ((703, 756), 'environ.Env', 'environ.Env', ([], {'DEBUG': '(bool, False)', 'DB_PORT': '(int, 5432)'}), '(DEBUG=(bool, False), DB_PORT=(int, 5432))\n', (714, 756), False, 'import environ\n')... |
import BaseHTTPServer, SimpleHTTPServer
import ssl
## Variables you can modify
#openssl req -x509 -newkey rsa:4096 -keyout server1.example.com.key -out server1.example.com.pem -days 365 -nodes
bind_to_address = ''
server_port = 8080
ssl_key_file = "/Users/benjaminbales/Documents/GoTeachMe/ProductDev/WebXR/server1.... | [
"BaseHTTPServer.HTTPServer",
"ssl.wrap_socket"
] | [((489, 594), 'BaseHTTPServer.HTTPServer', 'BaseHTTPServer.HTTPServer', (['(bind_to_address, server_port)', 'SimpleHTTPServer.SimpleHTTPRequestHandler'], {}), '((bind_to_address, server_port), SimpleHTTPServer.\n SimpleHTTPRequestHandler)\n', (514, 594), False, 'import BaseHTTPServer, SimpleHTTPServer\n'), ((605, 70... |
"""Download a copy of the CAISO curtailment data.
Oversupply data can be found at the following URL:
https://www.caiso.com/informed/Pages/ManagingOversupply.aspx
"""
import requests
from pathlib import Path
from loguru import logger
from urllib.parse import urlparse
from src.conf import settings
OUTPUT_DIR = sett... | [
"loguru.logger.info",
"urllib.parse.urlparse",
"requests.get"
] | [((840, 908), 'loguru.logger.info', 'logger.info', (['"""Downloading CAISO Curtailment file at: {url}"""'], {'url': 'url'}), "('Downloading CAISO Curtailment file at: {url}', url=url)\n", (851, 908), False, 'from loguru import logger\n'), ((965, 982), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (977, 982)... |
"""This is a cog for a discord.py bot.
It adds Lamp
"""
from discord.ext import commands
class Lamp(commands.Cog, command_attrs=dict(hidden=True)):
def __init__(self, client):
self.client = client
@commands.group(
name='lamp',
hidden=True,
invoke_without_command=True,
)
... | [
"discord.ext.commands.group"
] | [((217, 286), 'discord.ext.commands.group', 'commands.group', ([], {'name': '"""lamp"""', 'hidden': '(True)', 'invoke_without_command': '(True)'}), "(name='lamp', hidden=True, invoke_without_command=True)\n", (231, 286), False, 'from discord.ext import commands\n')] |
from telethon import events
import asyncio
from userbot.utils import admin_cmd
@borg.on(admin_cmd("dubey"))
async def _(event):
if event.fwd_from:
return
animation_interval = 1.0
animation_ttl = range(0,36)
#input_str = event.pattern_match.group(1)
# if input_str == "dubey":
... | [
"userbot.utils.admin_cmd",
"asyncio.sleep"
] | [((97, 115), 'userbot.utils.admin_cmd', 'admin_cmd', (['"""dubey"""'], {}), "('dubey')\n", (106, 115), False, 'from userbot.utils import admin_cmd\n'), ((580, 613), 'asyncio.sleep', 'asyncio.sleep', (['animation_interval'], {}), '(animation_interval)\n', (593, 613), False, 'import asyncio\n')] |
"""
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
import sys
from bisect import bisect_left
... | [
"bisect.bisect_left",
"sys.stdin.readline"
] | [((328, 348), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (346, 348), False, 'import sys\n'), ((415, 435), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (433, 435), False, 'import sys\n'), ((539, 559), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (557, 559), False, 'im... |
"""
This module contains the functions necessary for the estimation process of transition
probabilities.
"""
import numba
import numpy as np
import pandas as pd
from estimagic.optimization.optimize import minimize
def estimate_transitions(df):
"""Estimating the transition proabilities.
The sub function for m... | [
"numpy.multiply",
"numpy.log",
"numpy.zeros",
"numpy.isnan",
"pandas.MultiIndex.from_product",
"numba.jit",
"estimagic.optimization.optimize.minimize",
"numpy.bincount"
] | [((3902, 3926), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (3911, 3926), False, 'import numba\n'), ((738, 756), 'numpy.bincount', 'np.bincount', (['usage'], {}), '(usage)\n', (749, 756), True, 'import numpy as np\n'), ((887, 955), 'pandas.MultiIndex.from_product', 'pd.MultiIndex.from_p... |
import os
import torch
import torch.multiprocessing as mp
from dataset.skeleton_multitask import *
from utils.evaluation import MultiAttrDatasetEvaluator
from utils.misc import get_folders_and_files
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
mp.set_start_method('spawn', force=True)
def benchmark(evaluator: MultiAttrD... | [
"utils.evaluation.MultiAttrDatasetEvaluator",
"torch.multiprocessing.set_start_method",
"torch.multiprocessing.Process",
"utils.misc.get_folders_and_files",
"torch.device"
] | [((242, 282), 'torch.multiprocessing.set_start_method', 'mp.set_start_method', (['"""spawn"""'], {'force': '(True)'}), "('spawn', force=True)\n", (261, 282), True, 'import torch.multiprocessing as mp\n'), ((764, 808), 'torch.device', 'torch.device', (["('cuda:0' if use_gpu else 'cpu')"], {}), "('cuda:0' if use_gpu else... |
# -*- coding: utf-8 -*-
"""
test_text_chem
~~~~~~~~~~~~~~
Test the text chem package.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import unittest
from chemdataextractor.text.ch... | [
"unittest.main",
"chemdataextractor.text.chem.INCHI_RE.match",
"chemdataextractor.text.chem.SOLVENT_RE.findall",
"logging.basicConfig",
"chemdataextractor.text.chem.SMILES_RE.match",
"logging.getLogger"
] | [((367, 407), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (386, 407), False, 'import logging\n'), ((415, 442), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (432, 442), False, 'import logging\n'), ((6416, 6431), 'unittest.mai... |
# -*- coding: utf-8 -*-
import logging
from enum import EnumMeta
from typing import List
from urllib.parse import urljoin
import allure
from django.urls import reverse
from pytest_django.live_server_helper import LiveServer
from selenium.common.exceptions import StaleElementReferenceException
from selenium.webdriver.r... | [
"urllib.parse.urljoin",
"tests.browser.util.is_element_visible",
"allure.step",
"django.urls.reverse",
"tests.browser.util.attach_jpg_screenshot",
"logging.getLogger"
] | [((437, 464), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (454, 464), False, 'import logging\n'), ((468, 505), 'allure.step', 'allure.step', (['"""Visit {page_name} page"""'], {}), "('Visit {page_name} page')\n", (479, 505), False, 'import allure\n'), ((986, 1038), 'allure.step', 'allu... |
import argparse
import logging
import socketserver
import sys
import threading
import time
from google.protobuf import text_format
import numpy as np
from pyqtgraph.Qt import QtCore, QtGui
from math import degrees
from cvra_studio.viewers.LivePlotter2D import LivePlotter2D
import messages
from log_udp_protobuf import... | [
"threading.Thread",
"argparse.ArgumentParser",
"pyqtgraph.Qt.QtGui.QApplication.instance",
"threading.RLock",
"math.degrees",
"time.sleep",
"log_udp_protobuf.parse_packet",
"socketserver.UDPServer",
"cvra_studio.viewers.LivePlotter2D.LivePlotter2D",
"pyqtgraph.Qt.QtGui.QApplication",
"pyqtgraph.... | [((871, 899), 'pyqtgraph.Qt.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (889, 899), False, 'from pyqtgraph.Qt import QtCore, QtGui\n'), ((973, 990), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (988, 990), False, 'import threading\n'), ((2327, 2354), 'cvra_studio.viewers.Li... |
from unittest import TestCase
from app import create_app
from app.view.conversation_manager import generate_token
import json
class SearchRuleTestCase(TestCase):
"""
Unit tests for the Admin Search Rule.
LJF: all tests clear 2020-5-13
"""
def setUp(self):
self.app = create_app().test_clie... | [
"app.view.conversation_manager.generate_token",
"app.create_app",
"json.dumps"
] | [((408, 437), 'app.view.conversation_manager.generate_token', 'generate_token', (["b'buaa'", '(3600)'], {}), "(b'buaa', 3600)\n", (422, 437), False, 'from app.view.conversation_manager import generate_token\n'), ((1748, 1777), 'app.view.conversation_manager.generate_token', 'generate_token', (["b'what'", '(3600)'], {})... |
from __future__ import unicode_literals
from mayan.apps.dependencies.classes import PythonDependency
PythonDependency(
module=__name__, name='graphviz', version_string='==0.10.1'
)
| [
"mayan.apps.dependencies.classes.PythonDependency"
] | [((103, 180), 'mayan.apps.dependencies.classes.PythonDependency', 'PythonDependency', ([], {'module': '__name__', 'name': '"""graphviz"""', 'version_string': '"""==0.10.1"""'}), "(module=__name__, name='graphviz', version_string='==0.10.1')\n", (119, 180), False, 'from mayan.apps.dependencies.classes import PythonDepen... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider,Rule
from scrapy.http import FormRequest, Request
from urllib import urlencode
import json
import requests
import StringIO
from ..components import get_data_for_post
fr... | [
"scrapy.http.Request",
"json.loads",
"scrapy.http.FormRequest",
"requests.get",
"urllib.urlencode",
"scrapy.linkextractors.LinkExtractor",
"StringIO.StringIO"
] | [((1796, 1875), 'scrapy.http.FormRequest', 'FormRequest', (['url_2'], {'formdata': 'data', 'headers': 'headers', 'callback': 'self.parse_user_id'}), '(url_2, formdata=data, headers=headers, callback=self.parse_user_id)\n', (1807, 1875), False, 'from scrapy.http import FormRequest, Request\n'), ((2045, 2070), 'json.load... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | [
"urllib.quote",
"logging.getLogger",
"cairis.mio.ModelImport.importModelFile",
"jsonpickle.decode",
"cairis.core.DocumentReference.DocumentReference",
"cairis.tools.JsonConverter.json_deserialize",
"jsonpickle.encode"
] | [((1337, 1446), 'cairis.mio.ModelImport.importModelFile', 'importModelFile', (["(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/ACME_Water/ACME_Water.xml')", '(1)', '"""test"""'], {}), "(os.environ['CAIRIS_SRC'] +\n '/../examples/exemplars/ACME_Water/ACME_Water.xml', 1, 'test')\n", (1352, 1446), False, 'from cai... |
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import logging
import os
import re
import subprocess
import sys
import shutil
import traceback
import uuid
from datetime import datetime
from pprint import pformat
from installed_clients.WorkspaceClient import Workspace as workspaceService
from installed_clients.KBaseReportClient... | [
"installed_clients.WorkspaceClient.Workspace",
"pprint.pformat",
"os.remove",
"installed_clients.KBaseReportClient.KBaseReport",
"os.environ.copy",
"installed_clients.AssemblyUtilClient.AssemblyUtil",
"os.path.isfile",
"sys.stdout.flush",
"os.path.join",
"os.path.abspath",
"os.path.exists",
"i... | [((1646, 1705), 'os.path.join', 'os.path.join', (['STRAINFINDER_v1_installdir', '"""strainFinder.py"""'], {}), "(STRAINFINDER_v1_installdir, 'strainFinder.py')\n", (1658, 1705), False, 'import os\n'), ((1740, 1805), 'os.path.join', 'os.path.join', (['STRAINFINDER_v1_installdir', '"""example"""', '"""run_fit.py"""'], {}... |
import urllib.parse
import datetime
import requests
from plugin import *
class weather(plugin):
def __init__(self, bot):
super().__init__(bot)
self.weather_url = r'http://api.openweathermap.org/data/2.5/weather?q=%s' \
r'&units=metric' \
r'&ap... | [
"datetime.timedelta",
"datetime.date.today",
"requests.get"
] | [((3999, 4028), 'datetime.timedelta', 'datetime.timedelta', ([], {'minutes': '(3)'}), '(minutes=3)\n', (4017, 4028), False, 'import datetime\n'), ((5167, 5196), 'datetime.timedelta', 'datetime.timedelta', ([], {'minutes': '(3)'}), '(minutes=3)\n', (5185, 5196), False, 'import datetime\n'), ((4153, 4230), 'requests.get'... |
from rx.core import AnonymousObservable
def create(subscribe):
def _subscribe(observer, _=None):
return subscribe(observer)
return AnonymousObservable(_subscribe)
| [
"rx.core.AnonymousObservable"
] | [((149, 180), 'rx.core.AnonymousObservable', 'AnonymousObservable', (['_subscribe'], {}), '(_subscribe)\n', (168, 180), False, 'from rx.core import AnonymousObservable\n')] |
from datetime import datetime
from bson.json_util import dumps
from flask import Flask, render_template, request, redirect, url_for, jsonify
from flask_login import LoginManager, login_user, login_required, logout_user, current_user
from flask_cors import CORS
from pymongo.errors import DuplicateKeyError
from string i... | [
"db.get_user",
"flask.request.form.get",
"flask_cors.CORS",
"db.update_room",
"db.save_param",
"flask.url_for",
"flask.jsonify",
"db.get_messages",
"db.is_room_admin",
"db.get_hb",
"db.save_room",
"db.find_rooms",
"db.ended",
"flask.render_template",
"db.add_room_members",
"datetime.da... | [((777, 792), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (782, 792), False, 'from flask import Flask, render_template, request, redirect, url_for, jsonify\n'), ((802, 811), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (806, 811), False, 'from flask_cors import CORS\n'), ((857, 871), 'flask_logi... |
#
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
from __future__ import print_function
import tensorflow as tf
from numpy import genfromtxt
import numpy as np
import os
from os.path imp... | [
"numpy.random.seed",
"tensorflow.reshape",
"tensorflow.logging.set_verbosity",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.nn.conv2d",
"tensorflow.nn.relu",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"numpy.genfromtxt",
"tensorflow.set_random_seed",
"tensorflow.placeholder",
... | [((399, 441), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (423, 441), True, 'import tensorflow as tf\n'), ((974, 998), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['seed'], {}), '(seed)\n', (992, 998), True, 'import tensorflow as tf\n'), (... |
#!/usr/bin/env python
# coding: utf-8
# ## Problem 2 - Plotting temperatures
#
# In this problem we will plot monthly mean temperatures from the Helsinki-Vantaa airpot for the past 30 years.
#
# ## Input data
#
# File `data/helsinki-vantaa.csv` monthly average temperatures from Helsinki Vantaa airport. Column des... | [
"matplotlib.pyplot.title",
"pandas.DataFrame",
"pandas.read_csv",
"os.path.exists",
"pandas.to_datetime",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig"
] | [((703, 782), 'pandas.read_csv', 'pd.read_csv', (['"""data/helsinki-vantaa.csv"""'], {'parse_dates': "['DATE']", 'index_col': '"""DATE"""'}), "('data/helsinki-vantaa.csv', parse_dates=['DATE'], index_col='DATE')\n", (714, 782), True, 'import pandas as pd\n'), ((1089, 1115), 'pandas.to_datetime', 'pd.to_datetime', (['da... |
from boto3 import Session
from botocore.exceptions import BotoCoreError, ClientError
import PyPDF2
import sys
pdfFileObj = open('SamplePDF.pdf', 'rb')
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
pageObject = pdfReader.getPage(0)
session = Session(profile_name="")
polly = session.client("polly")
try:
# Request s... | [
"PyPDF2.PdfFileReader",
"sys.exit",
"boto3.Session"
] | [((163, 195), 'PyPDF2.PdfFileReader', 'PyPDF2.PdfFileReader', (['pdfFileObj'], {}), '(pdfFileObj)\n', (183, 195), False, 'import PyPDF2\n'), ((242, 266), 'boto3.Session', 'Session', ([], {'profile_name': '""""""'}), "(profile_name='')\n", (249, 266), False, 'from boto3 import Session\n'), ((605, 617), 'sys.exit', 'sys.... |
# Copyright 2011 Google 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 or agreed to in writing,... | [
"gtk.VBox",
"gtk.HBox",
"os.path.basename",
"gtk.gdk.keyval_name",
"os.path.dirname",
"gtk.TreeViewColumn",
"gtk.ScrolledWindow",
"gtk.CellRendererText",
"open_dialog_base.OpenDialogBase.__init__",
"gtk.ListStore",
"gtk.Dialog.__init__",
"gtk.Label",
"gtk.Entry",
"time.time",
"gtk.Button... | [((814, 839), 'gtk.Dialog.__init__', 'gtk.Dialog.__init__', (['self'], {}), '(self)\n', (833, 839), False, 'import gtk\n'), ((844, 902), 'open_dialog_base.OpenDialogBase.__init__', 'OpenDialogBase.__init__', (['self', 'options', 'db', 'initial_filter'], {}), '(self, options, db, initial_filter)\n', (867, 902), False, '... |
from .conftest import GoProCameraTest
from goprocam import GoProCamera
import pytest
from socket import timeout
class GetMediaInfoTest(GoProCameraTest):
def test_get_media_info_empty_no_option(self):
assert self.goprocam.getMediaInfo(option="") is None
def test_get_media_info_FS_no_option(self):
... | [
"pytest.raises",
"socket.timeout"
] | [((5871, 5880), 'socket.timeout', 'timeout', ([], {}), '()\n', (5878, 5880), False, 'from socket import timeout\n'), ((5177, 5202), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (5190, 5202), False, 'import pytest\n')] |
#!/usr/bin/python
import numpy as np
import pyMolecular as mol
import pyMolecular.testing as moltest
import matplotlib.pyplot as plt
# ==================== Compare two point distributions (permutation inveriant)
'''
points_ref = np.array([
[1.0,0.0,0.0], [-1.0, 0.0, 0.0],
[0.0,1.0,0.0], [ 0.0,-1.0, 0.0],
[0... | [
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"pyMolecular.testing.hash_saw",
"numpy.random.rand"
] | [((3075, 3097), 'numpy.random.rand', 'np.random.rand', (['natoms'], {}), '(natoms)\n', (3089, 3097), True, 'import numpy as np\n'), ((3208, 3235), 'pyMolecular.testing.hash_saw', 'moltest.hash_saw', (['xs_ref', 'k'], {}), '(xs_ref, k)\n', (3224, 3235), True, 'import pyMolecular.testing as moltest\n'), ((3518, 3539), 'm... |
import re
import nltk
import string
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
from nltk.stem import WordNetLemmatizer
def case_normalization(text):
return text.lower()
def remove_whitespace(text):
return text.strip()
def remove_punctuation(text):
return re.sub(r'[^\w\s... | [
"nltk.stem.porter.PorterStemmer",
"re.sub",
"nltk.corpus.stopwords.words",
"nltk.stem.WordNetLemmatizer"
] | [((305, 335), 're.sub', 're.sub', (['"""[^\\\\w\\\\s]"""', '""" """', 'text'], {}), "('[^\\\\w\\\\s]', ' ', text)\n", (311, 335), False, 'import re\n'), ((783, 808), 're.sub', 're.sub', (['"""@\\\\S+"""', '""""""', 'text'], {}), "('@\\\\S+', '', text)\n", (789, 808), False, 'import re\n'), ((819, 842), 're.sub', 're.su... |
from setuptools import setup
from solstice.bootstrap.__version__ import __version__
setup()
| [
"setuptools.setup"
] | [((86, 93), 'setuptools.setup', 'setup', ([], {}), '()\n', (91, 93), False, 'from setuptools import setup\n')] |
# Generated by Django 2.2.1 on 2019-07-23 19:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vip', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='vippermission',
old_name='vip_idd',
... | [
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.migrations.RenameField"
] | [((220, 313), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""vippermission"""', 'old_name': '"""vip_idd"""', 'new_name': '"""vip_id"""'}), "(model_name='vippermission', old_name='vip_idd',\n new_name='vip_id')\n", (242, 313), False, 'from django.db import migrations, models\n')... |
"""This module evaluates the forecasted trajectories against the ground truth."""
import argparse
from typing import Dict, List, Union
from collections import OrderedDict
import numpy as np
import pandas as pd
import pickle as pkl
from argoverse.evaluation.eval_forecasting import compute_forecasting_metrics
from argo... | [
"matplotlib.pyplot.show",
"argoverse.map_representation.map_api.ArgoverseMap",
"matplotlib.pyplot.plot",
"argparse.ArgumentParser",
"numpy.sum",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.axis",
"numpy.expand_dims",
"argoverse.evaluation.eval_forecasting.compute_forecasting_metrics",
"numpy.ar... | [((1335, 1364), 'matplotlib.pyplot.figure', 'plt.figure', (['(0)'], {'figsize': '(8, 7)'}), '(0, figsize=(8, 7))\n', (1345, 1364), True, 'import matplotlib.pyplot as plt\n'), ((1375, 1389), 'argoverse.map_representation.map_api.ArgoverseMap', 'ArgoverseMap', ([], {}), '()\n', (1387, 1389), False, 'from argoverse.map_re... |
# 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 applicable law or agreed to in writing, software
# distributed under the L... | [
"tensorguard.exception.UnderspecifiedShapeError"
] | [((1661, 1762), 'tensorguard.exception.UnderspecifiedShapeError', 'exception.UnderspecifiedShapeError', (['"""Template with an ellipsis (...) cannot be fully evaluated."""'], {}), "(\n 'Template with an ellipsis (...) cannot be fully evaluated.')\n", (1695, 1762), False, 'from tensorguard import exception\n')] |
"""
Code modified from allen.
"""
import io
import logging
import itertools
from typing import Optional, Tuple, Iterator, Any
import numpy
import torch
from torch.nn.functional import embedding
from ..common import Vocabulary
from ..common.util import printf, get_file_extension
from ..modules import util
logger = l... | [
"torch.nn.Parameter",
"numpy.std",
"torch.nn.init.xavier_uniform_",
"numpy.asarray",
"torch.FloatTensor",
"torch.nn.functional.embedding",
"numpy.mean",
"itertools.chain",
"logging.getLogger"
] | [((319, 346), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (336, 346), False, 'import logging\n'), ((4593, 4779), 'torch.nn.functional.embedding', 'embedding', (['inputs', 'self.weight'], {'padding_idx': 'self.padding_index', 'max_norm': 'self.max_norm', 'norm_type': 'self.norm_type', '... |
# gpl: authors <NAME>, <NAME>
import bpy
import os
from bpy.props import IntProperty
from bpy.types import (
Operator,
Panel,
)
from . import functions
proxy_qualities = [
("1", "25%", ""), ("2", "50%", ""),
("3", "75%", ""), ("4", "100%", ""),
("5", "none", "")
... | [
"bpy.props.IntProperty",
"bpy.path.abspath",
"os.system",
"bpy.ops.sequencer.reload"
] | [((490, 522), 'bpy.path.abspath', 'bpy.path.abspath', (['strip.filepath'], {}), '(strip.filepath)\n', (506, 522), False, 'import bpy\n'), ((796, 814), 'os.system', 'os.system', (['command'], {}), '(command)\n', (805, 814), False, 'import os\n'), ((886, 918), 'bpy.path.abspath', 'bpy.path.abspath', (['strip.filepath'], ... |
from eth_utils import decode_hex, encode_hex
from web3 import Web3
from raiden.constants import UINT256_MAX
from raiden.utils.signing import pack_data
from raiden.utils.typing import Address, ChannelID
from raiden_contracts.constants import MessageTypeId
class BalanceProof:
""" A Balance Proof
If transferre... | [
"eth_utils.decode_hex",
"web3.Web3.soliditySha3"
] | [((2984, 3088), 'web3.Web3.soliditySha3', 'Web3.soliditySha3', (["['uint256', 'uint256', 'bytes32']", '[transferred_amount, locked_amount, locksroot]'], {}), "(['uint256', 'uint256', 'bytes32'], [transferred_amount,\n locked_amount, locksroot])\n", (3001, 3088), False, 'from web3 import Web3\n'), ((2152, 2181), 'eth... |
#!/usr/bin/env python
# Copyright (C) 2016, <NAME>
from __future__ import print_function
from lasm import A,B,C,D,E,F
def boot(a):
'''Bootstrap loader
Loads the initial program from a serial memory
device that uses the SPI protocol.
This may be anywhere in RAM, except of course
where the program... | [
"lasm.assemble"
] | [((2747, 2766), 'lasm.assemble', 'lasm.assemble', (['boot'], {}), '(boot)\n', (2760, 2766), False, 'import lasm\n')] |
"""Pressure Sensor Driver Class."""
from typing import Optional, AsyncIterator
from opentrons_hardware.drivers.can_bus.can_messenger import CanMessenger
from contextlib import asynccontextmanager
from opentrons_hardware.firmware_bindings.constants import (
SensorId,
SensorType,
NodeId,
SensorThresholdM... | [
"opentrons_hardware.sensors.utils.WriteSensorInformation",
"opentrons_hardware.firmware_bindings.messages.fields.SensorOutputBindingField",
"opentrons_hardware.firmware_bindings.messages.fields.SensorTypeField",
"opentrons_hardware.sensors.utils.PollSensorInformation",
"opentrons_hardware.firmware_bindings.... | [((2099, 2178), 'opentrons_hardware.sensors.utils.PollSensorInformation', 'PollSensorInformation', (['self._sensor_type', 'self._sensor_id', 'node_id', 'poll_for_ms'], {}), '(self._sensor_type, self._sensor_id, node_id, poll_for_ms)\n', (2120, 2178), False, 'from opentrons_hardware.sensors.utils import ReadSensorInform... |
import os
import sys
import dronekit
import getpass
from time import sleep
N = int(sys.argv[1])
launch_string_mopso="gnome-terminal"
launch_string="gnome-terminal"
for i in range(N):
os.chdir("/home/"+getpass.getuser()+"/IAF/Integrated_CodeBase/")
launch_string += " --tab -- python3 modified_server7.py " + str(i)
s... | [
"getpass.getuser",
"os.system",
"time.sleep"
] | [((331, 355), 'os.system', 'os.system', (['launch_string'], {}), '(launch_string)\n', (340, 355), False, 'import os\n'), ((357, 365), 'time.sleep', 'sleep', (['(3)'], {}), '(3)\n', (362, 365), False, 'from time import sleep\n'), ((588, 618), 'os.system', 'os.system', (['launch_string_mopso'], {}), '(launch_string_mopso... |
from graphics import GraphWin,Point,Line,Text,update
def trans_X(Xw):
return int((Xw-Xwmin)/(Xwmax-Xwmin)*(Xvmax-Xvmin)+Xvmin)
def trans_Y(Yw):
return int(Yvmax - ((Yw-Ywmin)/(Ywmax-Ywmin)*(Yvmax-Yvmin)))
Xwmin = -4
Xwmax = 4
Ywmax = 6
Ywmin = -2
Xvmin = 0
Xvmax = int(input("Enter your screen widt... | [
"graphics.Text",
"graphics.update",
"graphics.Line",
"graphics.GraphWin"
] | [((398, 468), 'graphics.GraphWin', 'GraphWin', (['"""<NAME> - 18/424179/PA/18284"""', 'Xvmax', 'Yvmax'], {'autoflush': '(False)'}), "('<NAME> - 18/424179/PA/18284', Xvmax, Yvmax, autoflush=False)\n", (406, 468), False, 'from graphics import GraphWin, Point, Line, Text, update\n'), ((549, 561), 'graphics.Line', 'Line', ... |
# Copyright (c) 2021, NVIDIA 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... | [
"pandas.DataFrame",
"seaborn.lineplot",
"json.load",
"matplotlib.pyplot.show",
"tensorflow.compat.v1.train.summary_iterator",
"os.path.join"
] | [((1927, 1972), 'tensorflow.compat.v1.train.summary_iterator', 'tf.compat.v1.train.summary_iterator', (['filepath'], {}), '(filepath)\n', (1962, 1972), True, 'import tensorflow as tf\n'), ((4150, 4211), 'seaborn.lineplot', 'sns.lineplot', ([], {'x': '"""Step"""', 'y': '"""Accuracy"""', 'hue': '"""Config"""', 'data': 'd... |
"""
Preprocess road / stream crossings into data needed by tippecanoe for creating vector tiles.
Input:
* USGS Road / Stream crossings, projected to match SARP standard projection (Albers CONUS).
* pre-processed and snapped small barriers
Outputs:
`data/barriers/intermediate/road_crossings.feather`: road / stream cr... | [
"warnings.filterwarnings",
"pyogrio.read_dataframe",
"geopandas.read_feather",
"time.time",
"pathlib.Path",
"pygeos.STRtree",
"analysis.prep.barriers.lib.spatial_joins.add_spatial_joins",
"analysis.prep.barriers.lib.duplicates.mark_duplicates",
"pygeos.get_coordinates"
] | [((715, 802), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'message': '""".*initial implementation of Parquet.*"""'}), "('ignore', message=\n '.*initial implementation of Parquet.*')\n", (738, 802), False, 'import warnings\n'), ((807, 813), 'time.time', 'time', ([], {}), '()\n', (811, 81... |
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
args = getResolvedOptions(sys.argv, ['TempDir','JOB_NAME','database','s3_staging_path','job_connection'])
sc = SparkCont... | [
"pyspark.context.SparkContext",
"awsglue.context.GlueContext",
"awsglue.utils.getResolvedOptions",
"awsglue.job.Job"
] | [((206, 312), 'awsglue.utils.getResolvedOptions', 'getResolvedOptions', (['sys.argv', "['TempDir', 'JOB_NAME', 'database', 's3_staging_path', 'job_connection']"], {}), "(sys.argv, ['TempDir', 'JOB_NAME', 'database',\n 's3_staging_path', 'job_connection'])\n", (224, 312), False, 'from awsglue.utils import getResolved... |
# Generated by Django 2.0.6 on 2019-08-04 14:33
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("hustlers", "0001_initial"),
("knowledge", "0005_auto_20180624_1317"),
]
operations = [
migrations.C... | [
"django.db.models.ManyToManyField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField"
] | [((444, 537), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (460, 537), False, 'from django.db import migrations, models\... |
# Lint as: python3
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"reverb.item_selectors.Fifo",
"reverb.rate_limiters.MinSize",
"tensorflow.compat.v1.constant",
"numpy.zeros",
"numpy.ones",
"time.sleep",
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.compat.v1.test.main",
"numpy.array",
"reverb.client.Client",
"numpy.testing.assert_equal",
"conc... | [((9890, 9918), 'tensorflow.compat.v1.disable_eager_execution', 'tf.disable_eager_execution', ([], {}), '()\n', (9916, 9918), True, 'import tensorflow.compat.v1 as tf\n'), ((9921, 9935), 'tensorflow.compat.v1.test.main', 'tf.test.main', ([], {}), '()\n', (9933, 9935), True, 'import tensorflow.compat.v1 as tf\n'), ((141... |
from django import forms
class AddressToDoForm(forms.Form):
promouter = forms.CharField()
address = forms.CharField()
entrance_img = forms.ImageField()
mailbox_img = forms.ImageField() | [
"django.forms.CharField",
"django.forms.ImageField"
] | [((77, 94), 'django.forms.CharField', 'forms.CharField', ([], {}), '()\n', (92, 94), False, 'from django import forms\n'), ((109, 126), 'django.forms.CharField', 'forms.CharField', ([], {}), '()\n', (124, 126), False, 'from django import forms\n'), ((146, 164), 'django.forms.ImageField', 'forms.ImageField', ([], {}), '... |
import sys
import os
def run():
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
## FIXME: this is kind of crude; if we could create a fake pip
## module, then exec into it and update pip.__path__ properly, we
## wouldn't have to update sys.path:
sys.path.insert(0, base)
impo... | [
"sys.exit",
"os.path.abspath",
"sys.path.insert",
"pip.main"
] | [((287, 311), 'sys.path.insert', 'sys.path.insert', (['(0)', 'base'], {}), '(0, base)\n', (302, 311), False, 'import sys\n'), ((338, 348), 'pip.main', 'pip.main', ([], {}), '()\n', (346, 348), False, 'import pip\n'), ((416, 430), 'sys.exit', 'sys.exit', (['exit'], {}), '(exit)\n', (424, 430), False, 'import sys\n'), ((... |
from kernel_tuner import tune_kernel
import numpy
import argparse
import json
def generate_code(tuning_parameters):
code = \
"__global__ void fct_ale_c_horizontal(const int maxLevels, const int * __restrict__ nLevels, const int * __restrict__ nodesPerEdge, const int * __restrict__ elementsPerEdge, <%REAL_... | [
"json.dump",
"argparse.ArgumentParser",
"numpy.copy",
"numpy.random.randn",
"numpy.float32",
"numpy.dtype",
"numpy.zeros",
"numpy.random.random",
"numpy.random.randint",
"numpy.int32",
"numpy.float64"
] | [((4888, 4916), 'numpy.copy', 'numpy.copy', (['del_ttf_advhoriz'], {}), '(del_ttf_advhoriz)\n', (4898, 4916), False, 'import numpy\n'), ((5079, 5100), 'numpy.random.random', 'numpy.random.random', ([], {}), '()\n', (5098, 5100), False, 'import numpy\n'), ((6793, 6859), 'argparse.ArgumentParser', 'argparse.ArgumentParse... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import argparse
import csv
import io
import os
from datetime import datetime
from threading import Thread
import cv2
import requests
from PIL import Image
os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;udp"
def pa... | [
"threading.Thread",
"io.BytesIO",
"argparse.ArgumentParser",
"datetime.datetime.today",
"cv2.waitKey",
"cv2.VideoCapture",
"PIL.Image.fromarray",
"cv2.imshow",
"csv.DictWriter"
] | [((350, 625), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Read license plates from a RTSP stream and save the result in a CSV file."""', 'epilog': '"""For example: anpr_camera_stream.py --camera rtsp://192.168.1.2:5554/camera --api-key TOKEN --regions fr --output /path/to/output.csv""... |
"""Request/Response Schemas are defined here"""
# pylint: disable=invalid-name
from marshmallow import Schema, fields, validate
from todo.constants import TO_DO, IN_PROGRESS, DONE
class TaskSchema(Schema):
"""Schema for serializing an instance of Task"""
id = fields.Int(required=True)
title = fields.Str... | [
"marshmallow.fields.Int",
"marshmallow.validate.OneOf",
"marshmallow.fields.DateTime",
"marshmallow.fields.Str",
"marshmallow.fields.Nested"
] | [((272, 297), 'marshmallow.fields.Int', 'fields.Int', ([], {'required': '(True)'}), '(required=True)\n', (282, 297), False, 'from marshmallow import Schema, fields, validate\n'), ((310, 335), 'marshmallow.fields.Str', 'fields.Str', ([], {'required': '(True)'}), '(required=True)\n', (320, 335), False, 'from marshmallow ... |
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import datetime
from Hyperparameters import args
class Encoder(nn.Module):
def __init__(self,w2i, i2w, embedding,bidirectional = False):
"""
Args:
... | [
"torch.nn.GRU",
"torch.nn.LSTM",
"torch.randn",
"torch.transpose"
] | [((1884, 1917), 'torch.transpose', 'torch.transpose', (['en_outputs', '(0)', '(1)'], {}), '(en_outputs, 0, 1)\n', (1899, 1917), False, 'import torch\n'), ((2014, 2043), 'torch.transpose', 'torch.transpose', (['inputs', '(0)', '(1)'], {}), '(inputs, 0, 1)\n', (2029, 2043), False, 'import torch\n'), ((777, 916), 'torch.n... |