code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
import argparse
import os
from datetime import datetime
import subprocess
import numpy as np
import atmodat_checklib.utils.output_directory_util as output_directory
import atmodat_checklib.utils.summary_creation_util as summary_creation
from atmodat_checklib.utils.env_util import set_env_variabl... | [
"os.listdir",
"atmodat_checklib.utils.output_directory_util.create_directories",
"argparse.ArgumentParser",
"atmodat_checklib.utils.output_directory_util.return_files_in_directory",
"subprocess.run",
"os.path.join",
"os.getcwd",
"os.path.isfile",
"datetime.datetime.now",
"atmodat_checklib.utils.su... | [((407, 426), 'atmodat_checklib.utils.env_util.set_env_variables', 'set_env_variables', ([], {}), '()\n', (424, 426), False, 'from atmodat_checklib.utils.env_util import set_env_variables\n'), ((467, 510), 'os.path.join', 'os.path.join', (['atmodat_cvs', '"""pyessv-archive"""'], {}), "(atmodat_cvs, 'pyessv-archive')\n"... |
# Copyright 2016 Open Source Robotics Foundation, 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... | [
"std_msgs.msg.String",
"rclpy.spin",
"rclpy.init",
"rclpy.shutdown",
"rclpy.qos.QoSProfile"
] | [((1338, 1359), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (1348, 1359), False, 'import rclpy\n'), ((839, 859), 'rclpy.qos.QoSProfile', 'QoSProfile', ([], {'depth': '(10)'}), '(depth=10)\n', (849, 859), False, 'from rclpy.qos import QoSProfile\n'), ((1100, 1108), 'std_msgs.msg.String', 'String... |
from flask import render_template, request, jsonify, redirect
from app import app
import urllib2
import json
def fetchJson(query):
answer = json.load(urllib2.urlopen("http://downey-n1.cs.northwestern.edu:8080/wikifier/wiki/title/suggest/"+query))
return answer
@app.route('/')
@app.route('/index')
def index():... | [
"flask.render_template",
"urllib2.urlopen",
"flask.request.get_json",
"app.app.route",
"flask.jsonify"
] | [((272, 286), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (281, 286), False, 'from app import app\n'), ((288, 307), 'app.app.route', 'app.route', (['"""/index"""'], {}), "('/index')\n", (297, 307), False, 'from app import app\n'), ((366, 402), 'app.app.route', 'app.route', (['"""/temp"""'], {'methods': ... |
from sklearn.utils.metaestimators import _BaseComposition
from sklearn.utils.metaestimators import if_delegate_has_method
from ..default.params.Params import Dict, Choice
from .base import _get_est_fit_params, _get_est_trans_params
class Selector(_BaseComposition):
_needs_mapping = True
_needs_fit_index = Tr... | [
"sklearn.utils.metaestimators.if_delegate_has_method"
] | [((924, 977), 'sklearn.utils.metaestimators.if_delegate_has_method', 'if_delegate_has_method', ([], {'delegate': '"""example_estimator_"""'}), "(delegate='example_estimator_')\n", (946, 977), False, 'from sklearn.utils.metaestimators import if_delegate_has_method\n'), ((1369, 1422), 'sklearn.utils.metaestimators.if_del... |
#! /usr/bin/env python
# Copyright (C) 2003-2020, <NAME> <<EMAIL>>
# See the file LICENSE for licensing terms.
"""
setup.py - installation script for Python distutils
"""
import os
import sys
from distutils import core
_name = "ftputil"
_package = "ftputil"
_version = open("VERSION").read().strip()
doc_files = [... | [
"os.path.exists",
"os.path.join",
"sys.exit"
] | [((325, 350), 'os.path.join', 'os.path.join', (['"""doc"""', 'name'], {}), "('doc', name)\n", (337, 350), False, 'import os\n'), ((797, 808), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (805, 808), False, 'import sys\n'), ((557, 581), 'os.path.exists', 'os.path.exists', (['doc_file'], {}), '(doc_file)\n', (571, 581... |
from database import metadata
import logging
logger = logging.getLogger(__name__)
def database_check_init():
if 'tournament' in metadata.tables and 'rule_set' in metadata.tables and \
'match' in metadata.tables and 'team' in metadata.tables:
logger.info("Database exists, and is proper")
e... | [
"logging.getLogger"
] | [((55, 82), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (72, 82), False, 'import logging\n')] |
from django import template
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from dialogos.authorization import load_can_delete, load_can_edit
from dialogos.forms import CommentForm
from dialogos.models import Comment
can_delete = load_can_delete()
can_edit = l... | [
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"django.template.TemplateSyntaxError",
"django.template.Library",
"dialogos.authorization.load_can_edit",
"dialogos.authorization.load_can_delete"
] | [((290, 307), 'dialogos.authorization.load_can_delete', 'load_can_delete', ([], {}), '()\n', (305, 307), False, 'from dialogos.authorization import load_can_delete, load_can_edit\n'), ((319, 334), 'dialogos.authorization.load_can_edit', 'load_can_edit', ([], {}), '()\n', (332, 334), False, 'from dialogos.authorization ... |
import cma
import logging as log
import numpy as np
import os.path
import pickle
import humblerl as hrl
from humblerl import ChainInterpreter, Mind, Worker
from memory import build_rnn_model, MDNInterpreter
from vision import BasicInterpreter, build_vae_model
from common_utils import ReturnTracker, create_directory, ... | [
"logging.debug",
"memory.MDNInterpreter",
"humblerl.ChainInterpreter",
"numpy.array",
"cma.CMAEvolutionStrategy",
"logging.info",
"vision.BasicInterpreter",
"numpy.mean",
"numpy.tanh",
"numpy.concatenate",
"common_utils.create_directory",
"humblerl.create_gym",
"pickle.load",
"common_utils... | [((428, 454), 'numpy.array', 'np.array', (['model_param_list'], {}), '(model_param_list)\n', (436, 454), True, 'import numpy as np\n'), ((6852, 6904), 'logging.info', 'log.info', (['"""Loaded Mind weights from: %s"""', 'model_path'], {}), "('Loaded Mind weights from: %s', model_path)\n", (6860, 6904), True, 'import log... |
# Copyright 2021 The TensorFlow 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 applica... | [
"tensorflow.train.Checkpoint",
"tensorflow.keras.metrics.Mean",
"orbit.utils.make_distributed_dataset",
"orbit.utils.create_global_step",
"orbit.utils.create_loop_fn",
"tensorflow.distribute.get_strategy",
"tensorflow.nest.map_structure"
] | [((1785, 1813), 'tensorflow.distribute.get_strategy', 'tf.distribute.get_strategy', ([], {}), '()\n', (1811, 1813), True, 'import tensorflow as tf\n'), ((2007, 2074), 'tensorflow.train.Checkpoint', 'tf.train.Checkpoint', ([], {'global_step': 'self.global_step', 'model': 'self.model'}), '(global_step=self.global_step, m... |
import requests
from bs4 import BeautifulSoup, Comment, Tag
from pathlib import Path
import pickle
import re
utcDocRegistry_urls = {
2000: "https://www.unicode.org/L2/L2000/Register-2000.html",
2001: "https://www.unicode.org/L2/L2001/Register-2001.html",
2002: "https://www.unicode.org/L2/L2002/Register-20... | [
"pickle.dump",
"pathlib.Path",
"pickle.load",
"requests.get",
"bs4.BeautifulSoup",
"re.fullmatch",
"re.search"
] | [((2291, 2322), 'pathlib.Path', 'Path', (['utcDocRegPages_pickleFile'], {}), '(utcDocRegPages_pickleFile)\n', (2295, 2322), False, 'from pathlib import Path\n'), ((3479, 3510), 'pathlib.Path', 'Path', (['utcDocRegPages_pickleFile'], {}), '(utcDocRegPages_pickleFile)\n', (3483, 3510), False, 'from pathlib import Path\n'... |
import numpy as np
from abc import ABC, abstractmethod
class AbstractGOL(ABC):
def __init__(self, config, seed=None):
"""
Abstract Conway Game of Life
:param config: configuration for this GOL instance (cell survival and generation settings)
"""
self.config = conf... | [
"numpy.random.seed"
] | [((354, 374), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (368, 374), True, 'import numpy as np\n')] |
#!/usr/bin/env python
#
# File: run_con_hostage.py
#
# Created: Sunday, August 14 2016 by rejuvyesh <<EMAIL>>
#
from __future__ import absolute_import, print_function
import argparse
import json
import numpy as np
import tensorflow as tf
from gym import spaces
import rltools.algos.policyopt
import rltools.log
import... | [
"tensorflow.initialize_all_variables",
"madrl_environments.hostage.ContinuousHostageWorld",
"argparse.ArgumentParser",
"tensorflow.Session",
"rltools.baselines.zero.ZeroBaseline",
"madrl_environments.ObservationBuffer",
"rltools.policy.gaussian.GaussianMLPPolicy"
] | [((868, 893), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (891, 893), False, 'import argparse\n'), ((4000, 4306), 'madrl_environments.hostage.ContinuousHostageWorld', 'ContinuousHostageWorld', (['args.n_good', 'args.n_hostage', 'args.n_bad', 'args.n_coop_save', 'args.n_coop_avoid'], {'n_sens... |
import requests
### pip3 install requests
from urllib.request import urlopen
from bs4 import BeautifulSoup
### pip3 install BeautifulSoup4
def shelterlist():
URL = 'https://www.shelterlist.com/city/ca-sacramento'
GET = urlopen(URL)
page_html = GET.read()
GET.close()
page_soup = BeautifulSoup(... | [
"bs4.BeautifulSoup",
"urllib.request.urlopen"
] | [((231, 243), 'urllib.request.urlopen', 'urlopen', (['URL'], {}), '(URL)\n', (238, 243), False, 'from urllib.request import urlopen\n'), ((306, 345), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page_html', '"""html.parser"""'], {}), "(page_html, 'html.parser')\n", (319, 345), False, 'from bs4 import BeautifulSoup\n'), ((5... |
from django.http import HttpResponse
from django.shortcuts import render
# import the logging library
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
def home(request):
return render(request, 'home.html', {'page_title': 'home'}) | [
"logging.getLogger",
"django.shortcuts.render"
] | [((158, 185), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (175, 185), False, 'import logging\n'), ((217, 269), 'django.shortcuts.render', 'render', (['request', '"""home.html"""', "{'page_title': 'home'}"], {}), "(request, 'home.html', {'page_title': 'home'})\n", (223, 269), False, 'fr... |
#!/usr/bin/env python3
# -*- Mode: Python -*-
# -*- encoding: utf-8 -*-
# Copyright (c) <NAME> <<EMAIL>>
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Foundation.
# This file is distributed without any warranty; without ... | [
"inspect.stack"
] | [((1433, 1448), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1446, 1448), False, 'import os, sys, inspect\n')] |
import pydub
from sauronlab.core.core_imports import *
from sauronlab.core.environment import sauronlab_env
from sauronlab.model.cache_interfaces import AnAudioStimulusCache, StimulusWaveform
DEFAULT_CACHE_DIR = sauronlab_env.cache_dir / "stimuli"
@abcd.auto_eq()
@abcd.auto_repr_str()
class AudioStimulusCache(AnAud... | [
"pydub.AudioSegment.from_file",
"pydub.AudioSegment"
] | [((2284, 2318), 'pydub.AudioSegment.from_file', 'pydub.AudioSegment.from_file', (['path'], {}), '(path)\n', (2312, 2318), False, 'import pydub\n'), ((1824, 1914), 'pydub.AudioSegment', 'pydub.AudioSegment', ([], {'data': 'audio_file.data', 'sample_width': '(2)', 'frame_rate': '(44100)', 'channels': '(1)'}), '(data=audi... |
'''
Original code contributor: mentzera
Article link: https://aws.amazon.com/blogs/big-data/building-a-near-real-time-discovery-platform-with-aws/
'''
from elasticsearch.helpers import bulk
import boto3
from elasticsearch.exceptions import ElasticsearchException
import config
from tweet_utils import \
get_tweet, i... | [
"tweet_utils.get_tweet",
"requests_aws4auth.AWS4Auth",
"elasticsearch.Elasticsearch",
"boto3.Session",
"elasticsearch.helpers.bulk",
"tweet_utils.get_tweet_mapping"
] | [((798, 908), 'requests_aws4auth.AWS4Auth', 'AWS4Auth', (['credentials.access_key', 'credentials.secret_key', 'region', 'service'], {'session_token': 'credentials.token'}), '(credentials.access_key, credentials.secret_key, region, service,\n session_token=credentials.token)\n', (806, 908), False, 'from requests_aws4... |
# Copyright 2021 D-Wave Systems 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... | [
"dimod.variables.serialize_variable",
"zipfile.ZipFile",
"dimod.serialization.fileview.load.register",
"numpy.iinfo",
"dimod.utilities.new_label",
"dimod.sym.Eq",
"dimod.serialization.fileview._BytesIO",
"dimod.binary.binary_quadratic_model.as_bqm",
"dimod.serialization.fileview.write_header",
"nu... | [((44947, 45015), 'dimod.serialization.fileview.load.register', 'load.register', (['CQM_MAGIC_PREFIX', 'ConstrainedQuadraticModel.from_file'], {}), '(CQM_MAGIC_PREFIX, ConstrainedQuadraticModel.from_file)\n', (44960, 45015), False, 'from dimod.serialization.fileview import load, read_header, write_header\n'), ((36894, ... |
from verifiers import *
from cipher import *
from rwaFiles import *
from colors import *
import getpass
passCounter = 0
idCounter = 0
userID = ''
############################################ Start of Register User ############################################
# Register User Function - userid_pswd.csv
def re... | [
"getpass.getpass"
] | [((36663, 36727), 'getpass.getpass', 'getpass.getpass', (['"""\nPlease enter the admin user\'s Password: """'], {}), '("""\nPlease enter the admin user\'s Password: """)\n', (36678, 36727), False, 'import getpass\n')] |
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from __future__ import unicode_literals
from indico.core.db import db
from i... | [
"indico_livesync.process_records",
"indico_livesync.MARCXMLGenerator.records_to_xml",
"indico.core.db.db.session.commit",
"indico.util.struct.iterables.grouper",
"indico_livesync.MARCXMLGenerator.objects_to_xml"
] | [((3120, 3139), 'indico.core.db.db.session.commit', 'db.session.commit', ([], {}), '()\n', (3137, 3139), False, 'from indico.core.db import db\n'), ((998, 1050), 'indico.util.struct.iterables.grouper', 'grouper', (['records', 'self.BATCH_SIZE'], {'skip_missing': '(True)'}), '(records, self.BATCH_SIZE, skip_missing=True... |
import uasyncio as asyncio
# NOTE: We use pyb.Timer and not machine.Timer so we can specify one of the high-speed timers
from pyb import LED, Timer
from machine import Pin, UART
import time
from primitives.switch import Switch
from py_cc.cc_classes import CCVersion
from py_cc.cc_protocol import CCActuator, CCAssignmen... | [
"py_cc.control_chain.convert_to_ms",
"pyb.Timer",
"py_cc.cc_protocol.CCActuator",
"time.ticks_diff",
"uasyncio.sleep_ms",
"time.ticks_ms",
"machine.Pin",
"primitives.switch.Switch",
"py_cc.cc_classes.CCVersion",
"machine.UART",
"py_cc.control_chain.convert_from_ms"
] | [((1649, 1668), 'machine.Pin', 'Pin', (['"""PA5"""', 'Pin.OUT'], {}), "('PA5', Pin.OUT)\n", (1652, 1668), False, 'from machine import Pin, UART\n'), ((1935, 1950), 'time.ticks_ms', 'time.ticks_ms', ([], {}), '()\n', (1948, 1950), False, 'import time\n'), ((2203, 2232), 'machine.Pin', 'Pin', (['dio', 'Pin.IN', 'Pin.PULL... |
import numpy as np
from unittest import SkipTest, expectedFailure
from parameterized import parameterized
from holoviews import NdOverlay, Store
from holoviews.element import Curve, Area, Scatter, Points, Path, HeatMap
from holoviews.element.comparison import ComparisonTestCase
from ..util import is_dask
class Tes... | [
"numpy.random.rand",
"parameterized.parameterized.expand",
"dask.dataframe.from_pandas",
"holoviews.element.HeatMap",
"numpy.linspace",
"unittest.SkipTest",
"pandas.DataFrame",
"holoviews.element.Area",
"holoviews.element.Curve",
"holoviews.Store.lookup_options",
"pandas.date_range",
"holoview... | [((939, 998), 'parameterized.parameterized.expand', 'parameterized.expand', (["[('points', Points), ('paths', Path)]"], {}), "([('points', Points), ('paths', Path)])\n", (959, 998), False, 'from parameterized import parameterized\n'), ((1154, 1213), 'parameterized.parameterized.expand', 'parameterized.expand', (["[('po... |
import pytest
from kaeru_parser import Compiler
class TestClass:
def setup_method(self, method):
self.compiler = Compiler()
def test_A(self):
text = open('tests/A.txt', 'r').read()
self.compiler.compile(text)
entity_table = self.compiler.entity_table
home = entity_tab... | [
"pytest.raises",
"kaeru_parser.Compiler"
] | [((127, 137), 'kaeru_parser.Compiler', 'Compiler', ([], {}), '()\n', (135, 137), False, 'from kaeru_parser import Compiler\n'), ((1247, 1273), 'pytest.raises', 'pytest.raises', (['SyntaxError'], {}), '(SyntaxError)\n', (1260, 1273), False, 'import pytest\n'), ((1398, 1424), 'pytest.raises', 'pytest.raises', (['SyntaxEr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The Project U-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import numpy as np
import sys
from utils... | [
"numpy.random.choice",
"numpy.random.randint",
"utils.util.get_part",
"numpy.random.seed",
"utils.util.get_db_root",
"numpy.random.shuffle"
] | [((406, 426), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (420, 426), True, 'import numpy as np\n'), ((2425, 2449), 'numpy.random.shuffle', 'np.random.shuffle', (['tiles'], {}), '(tiles)\n', (2442, 2449), True, 'import numpy as np\n'), ((446, 464), 'utils.util.get_db_root', 'util.get_db_root', ([... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | [
"language.emql.util.compute_recall_at_k",
"language.emql.util.get_nonzero_ids",
"language.emql.util.compute_x_in_set",
"language.emql.util.compute_average_precision_at_k",
"language.emql.util.compute_hits_at_k",
"language.emql.util.BertTokenizer",
"numpy.array",
"numpy.sum",
"tensorflow.compat.v1.co... | [((3544, 3558), 'tensorflow.compat.v1.test.main', 'tf.test.main', ([], {}), '()\n', (3556, 3558), True, 'import tensorflow.compat.v1 as tf\n'), ((852, 864), 'tensorflow.compat.v1.Session', 'tf.Session', ([], {}), '()\n', (862, 864), True, 'import tensorflow.compat.v1 as tf\n'), ((883, 943), 'tensorflow.compat.v1.consta... |
# encoding = utf-8
def process_event(helper, *args, **kwargs):
"""
# IMPORTANT
# Do not remove the anchor macro:start and macro:end lines.
# These lines are used to generate sample code. If they are
# removed, the sample code will not be updated when configurations
# are updated.
[sample_... | [
"json.dumps",
"requests.get",
"splunk.entity.getEntity",
"urllib3.disable_warnings",
"time.time",
"re.search"
] | [((1959, 2026), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['urllib3.exceptions.InsecureRequestWarning'], {}), '(urllib3.exceptions.InsecureRequestWarning)\n', (1983, 2026), False, 'import urllib3\n'), ((2178, 2284), 'splunk.entity.getEntity', 'splunk.entity.getEntity', (['"""/server"""', '"""settings"""'... |
import numpy as np
import torch
from torch.nn.parameter import Parameter
from HyperSphere.GP.modules.gp_modules import GPModule, log_lower_bnd, log_upper_bnd
from HyperSphere.feature_map.functionals import id_transform
class Kernel(GPModule):
def __init__(self, input_map=None):
super(Kernel, self).__ini... | [
"numpy.log",
"torch.FloatTensor",
"torch.cat"
] | [((1881, 1907), 'torch.cat', 'torch.cat', (['flat_param_list'], {}), '(flat_param_list)\n', (1890, 1907), False, 'import torch\n'), ((359, 379), 'torch.FloatTensor', 'torch.FloatTensor', (['(1)'], {}), '(1)\n', (376, 379), False, 'import torch\n'), ((743, 754), 'numpy.log', 'np.log', (['amp'], {}), '(amp)\n', (749, 754... |
from setuptools import setup, find_packages
import sys
setup(
name='doaj',
version='5.0.3',
packages=find_packages(),
install_requires=[
"Werkzeug==0.16.0",
"Flask==1.1.1",
"Flask-Login==0.4.1",
"WTForms==2.2.1",
"Flask-WTF==0.14.2",
"Flask-Mail==0.9.1",
... | [
"setuptools.find_packages"
] | [((114, 129), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (127, 129), False, 'from setuptools import setup, find_packages\n')] |
# Copyright 2013 OpenStack Foundation
# 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 requ... | [
"oslo.config.cfg.StrOpt",
"oslo.config.cfg.FloatOpt",
"nova.virt.xenapi.vm_utils._make_uuid_stack",
"six.moves.urllib.parse.urljoin",
"pkg_resources.iter_entry_points",
"oslo.config.cfg.IntOpt",
"nova.virt.xenapi.vm_utils.get_sr_path",
"nova.i18n._",
"nova.openstack.common.log.getLogger"
] | [((841, 868), 'nova.openstack.common.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (858, 868), True, 'import nova.openstack.common.log as logging\n'), ((898, 964), 'oslo.config.cfg.StrOpt', 'cfg.StrOpt', (['"""torrent_base_url"""'], {'help': '"""Base URL for torrent files."""'}), "('torrent_b... |
#!/usr/bin/python3
import cv2
# loading image
img=cv2.imread('Dog.jpg',0)
# print height and width
print("shape is: ",img.shape)
# to display that image
cv2.imshow("Dog",img)
# image window holder activate
cv2.waitKey(0)
# wait key will destroy by using q button
cv2.destroyAllWindows()
| [
"cv2.waitKey",
"cv2.imread",
"cv2.destroyAllWindows",
"cv2.imshow"
] | [((53, 77), 'cv2.imread', 'cv2.imread', (['"""Dog.jpg"""', '(0)'], {}), "('Dog.jpg', 0)\n", (63, 77), False, 'import cv2\n'), ((158, 180), 'cv2.imshow', 'cv2.imshow', (['"""Dog"""', 'img'], {}), "('Dog', img)\n", (168, 180), False, 'import cv2\n'), ((212, 226), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (223... |
from typing import Any, Mapping
from ghaudit.query.sub_query_common import SubQueryCommon
from ghaudit.query.utils import PageInfo
class OrgRepoQuery(SubQueryCommon):
FRAGMENTS = ["frag_org_repo_fields.j2", "frag_org_repo.j2"]
def __init__(self) -> None:
SubQueryCommon.__init__(
self,
... | [
"ghaudit.query.sub_query_common.SubQueryCommon.__init__"
] | [((276, 398), 'ghaudit.query.sub_query_common.SubQueryCommon.__init__', 'SubQueryCommon.__init__', (['self', 'self.FRAGMENTS', '"""repositories"""', "{'organisation': 'String!', 'repositoriesMax': 'Int!'}"], {}), "(self, self.FRAGMENTS, 'repositories', {\n 'organisation': 'String!', 'repositoriesMax': 'Int!'})\n", (... |
#!/usr/bin/env python
# Copyright 2017, 2018 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 re... | [
"tensorflow.flags.DEFINE_string",
"tensorflow.Graph",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.flags.DEFINE_float",
"os.path.join",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.flags.DEFINE_integer",
"tensorflow.app.run"
] | [((966, 1041), 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""dataset_dir"""', '"""datasets"""', '"""Dataset base directory"""'], {}), "('dataset_dir', 'datasets', 'Dataset base directory')\n", (988, 1041), True, 'import tensorflow as tf\n'), ((1052, 1195), 'tensorflow.flags.DEFINE_string', 'tf.flags... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`<NAME> <<EMAIL>>`
'''
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
# Import Salt Libs
from salt.modules import environ
import os
# Globals
environ.__... | [
"salttesting.mock.patch.dict",
"salttesting.mock.patch.object",
"salt.modules.environ.setval",
"integration.run_tests",
"salt.modules.environ.get",
"salt.modules.environ.has_value",
"salttesting.mock.MagicMock",
"salt.modules.environ.items",
"salttesting.skipIf",
"salt.modules.environ.setenv",
"... | [((384, 415), 'salttesting.skipIf', 'skipIf', (['NO_MOCK', 'NO_MOCK_REASON'], {}), '(NO_MOCK, NO_MOCK_REASON)\n', (390, 415), False, 'from salttesting import TestCase, skipIf\n'), ((3341, 3387), 'integration.run_tests', 'run_tests', (['EnvironTestCase'], {'needs_daemon': '(False)'}), '(EnvironTestCase, needs_daemon=Fal... |
import pytest
from reactivated import forms
from sample.server.apps.samples import models
@pytest.mark.django_db
@pytest.mark.urls("tests.urls")
def test_autocomplete(client):
composer = models.Composer.objects.create(name="<NAME>")
models.Composer.objects.create(name="<NAME>")
assert client.get("/autoc... | [
"pytest.mark.urls",
"reactivated.forms.get_form_or_form_set_descriptor",
"sample.server.apps.samples.models.Composer.objects.create"
] | [((117, 147), 'pytest.mark.urls', 'pytest.mark.urls', (['"""tests.urls"""'], {}), "('tests.urls')\n", (133, 147), False, 'import pytest\n'), ((907, 937), 'pytest.mark.urls', 'pytest.mark.urls', (['"""tests.urls"""'], {}), "('tests.urls')\n", (923, 937), False, 'import pytest\n'), ((1253, 1283), 'pytest.mark.urls', 'pyt... |
import itertools
from nltk.translate.bleu_score import sentence_bleu
from deeppavlov.core.common.metrics_registry import register_metric
@register_metric('bleu')
def bleu(y_true, y_predicted):
examples_len = len(y_true)
bleu_list = (sentence_bleu([y2.lower().split()], y1.lower().split())\
fo... | [
"itertools.chain",
"deeppavlov.core.common.metrics_registry.register_metric"
] | [((141, 164), 'deeppavlov.core.common.metrics_registry.register_metric', 'register_metric', (['"""bleu"""'], {}), "('bleu')\n", (156, 164), False, 'from deeppavlov.core.common.metrics_registry import register_metric\n'), ((425, 457), 'deeppavlov.core.common.metrics_registry.register_metric', 'register_metric', (['"""pe... |
from time import sleep
nome = str(input('Digite seu nome completo: ')).strip()
print('Analisando seu nome...')
sleep(1)
print('Seu nome em maiúsculas é {}'.format(nome.upper()))
print('Seu nome em minúsculas é {}'.format(nome.lower()))
print('Seu nome tem ao todo {} letras'.format(len(nome)-nome.count(' ')))
separar ... | [
"time.sleep"
] | [((113, 121), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (118, 121), False, 'from time import sleep\n')] |
#!/usr/local/bin/python
'''
BSD License
Copyright 2018 AT&T Intellectual Property. All other rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
1. Redistributions of source code must retain the above co... | [
"sg_ap.AWSSecurityGroup",
"openc2.Response",
"flask.Flask",
"boto3.Session",
"flask.request.get_json"
] | [((1857, 1872), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1862, 1872), False, 'from flask import Flask, json, request, jsonify\n'), ((2367, 2423), 'boto3.Session', 'boto3.Session', ([], {'profile_name': 'sgap.actuator.aws_account_id'}), '(profile_name=sgap.actuator.aws_account_id)\n', (2380, 2423), F... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.mininode import *
from test_fram... | [
"test_framework.script.CScript",
"datetime.datetime.now",
"datetime.timedelta"
] | [((3301, 3324), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (3322, 3324), False, 'import datetime\n'), ((3610, 3633), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (3631, 3633), False, 'import datetime\n'), ((3831, 3852), 'datetime.timedelta', 'datetime.timedelta', (['(0)']... |
import random
import matplotlib.pyplot as plt
import matplotlib.animation as animation
keys = []
values = []
for i in range(1, 101):
keys.append(i)
values.append(i)
random.shuffle(values)
coordinates_dict = dict(zip(keys, values))
fig = plt.figure(figsize=(12,8))
ax = fig.add_subplot(1, 1, 1)
def algo(i):
... | [
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"random.shuffle",
"matplotlib.pyplot.show"
] | [((174, 196), 'random.shuffle', 'random.shuffle', (['values'], {}), '(values)\n', (188, 196), False, 'import random\n'), ((246, 273), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 8)'}), '(figsize=(12, 8))\n', (256, 273), True, 'import matplotlib.pyplot as plt\n'), ((894, 928), 'matplotlib.animation.... |
"""Jobs for performing electron phonon calculations in VASP."""
from __future__ import annotations
import logging
from dataclasses import dataclass, field
from pathlib import Path
from typing import Dict, List, Tuple
import numpy as np
from jobflow import Flow, Response, job
from pymatgen.core import Structure
from ... | [
"logging.getLogger",
"jobflow.Response",
"jobflow.job",
"numpy.array",
"atomate2.vasp.schemas.elph.ElectronPhononRenormalisationDoc.from_band_structures",
"jobflow.Flow",
"dataclasses.field"
] | [((978, 1005), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (995, 1005), False, 'import logging\n'), ((7140, 7191), 'jobflow.job', 'job', ([], {'output_schema': 'ElectronPhononRenormalisationDoc'}), '(output_schema=ElectronPhononRenormalisationDoc)\n', (7143, 7191), False, 'from jobflow... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | [
"six.with_metaclass"
] | [((1157, 1208), 'six.with_metaclass', 'with_metaclass', (['_CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(_CaseInsensitiveEnumMeta, str, Enum)\n', (1171, 1208), False, 'from six import with_metaclass\n'), ((1372, 1423), 'six.with_metaclass', 'with_metaclass', (['_CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(_Cas... |
# Generated by Django 2.2 on 2020-10-24 08:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0007_instagrampost_title'),
]
operations = [
migrations.AddField(
model_name='homesetting',
nam... | [
"django.db.models.CharField"
] | [((352, 397), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(2000)'}), '(blank=True, max_length=2000)\n', (368, 397), False, 'from django.db import migrations, models\n'), ((534, 579), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(... |
import opentracing
import logging
import time
from opentracing import tags
from haystack import HaystackTracer
from haystack import LoggerRecorder
def setup_tracer():
global recorder
recorder = LoggerRecorder()
# instantiate a haystack tracer for this service and set a common tag which applies to all tra... | [
"logging.basicConfig",
"haystack.HaystackTracer",
"opentracing.tracer.start_active_span",
"opentracing.tracer.inject",
"time.sleep",
"opentracing.set_global_tracer",
"logging.info",
"haystack.LoggerRecorder"
] | [((204, 220), 'haystack.LoggerRecorder', 'LoggerRecorder', ([], {}), '()\n', (218, 220), False, 'from haystack import LoggerRecorder\n'), ((337, 411), 'haystack.HaystackTracer', 'HaystackTracer', (['"""Service-A"""', 'recorder'], {'common_tags': "{'app.version': '1234'}"}), "('Service-A', recorder, common_tags={'app.ve... |
from django.urls import path
from .views import (
HomeView,
profile_view,
register_view,
logout_view,
login_view,
profile_update_view,
single_post,
post_create_view,
post_update_view,
comment_view,
)
urlpatterns = [
path('', HomeView, name='home'),
# post
path("sing... | [
"django.urls.path"
] | [((261, 292), 'django.urls.path', 'path', (['""""""', 'HomeView'], {'name': '"""home"""'}), "('', HomeView, name='home')\n", (265, 292), False, 'from django.urls import path\n'), ((310, 370), 'django.urls.path', 'path', (['"""single/<slug>/"""', 'single_post'], {'name': '"""single_post_view"""'}), "('single/<slug>/', s... |
import requests
import json
import click
import datetime
import logging
logging.basicConfig(level=logging.INFO,
format='[*] %(asctime)s %(levelname)s: %(message)s', datefmt="%Y-%m-%d %H:%M:%S")
@click.command()
@click.option('--net/--no-net', help='use the online data', default=True, show_default... | [
"logging.basicConfig",
"datetime.datetime",
"datetime.datetime.fromtimestamp",
"click.option",
"requests.get",
"datetime.datetime.now",
"json.load",
"click.command",
"logging.info",
"json.dump"
] | [((73, 199), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""[*] %(asctime)s %(levelname)s: %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""'}), "(level=logging.INFO, format=\n '[*] %(asctime)s %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S')\n", (92, 199), Fal... |
from datetime import datetime
from pathlib import Path
import pytz
import json
import yaml
import pandas as pd
from sqlalchemy.dialects.postgresql import JSONB
from app import db
from sqlalchemy.orm import deferred
class GCMS_DataAccessLink(db.Model):
__tablename__ = 'gcmsDataAccessLink'
__table_args__ = (d... | [
"pytz.timezone",
"json.loads",
"pytz.utc.localize",
"app.db.UniqueConstraint",
"datetime.datetime.utcnow",
"app.db.String",
"pathlib.Path",
"json.dumps",
"app.db.ARRAY",
"app.db.Column",
"app.db.ForeignKey",
"app.db.relationship",
"pandas.read_json"
] | [((604, 664), 'app.db.relationship', 'db.relationship', (['"""GCMS_Data"""'], {'back_populates': '"""access_groups"""'}), "('GCMS_Data', back_populates='access_groups')\n", (619, 664), False, 'from app import db\n'), ((684, 746), 'app.db.relationship', 'db.relationship', (['"""AccessGroup"""'], {'back_populates': '"""g... |
import glob
import multiprocessing as mp
import os
import time
from argparse import ArgumentParser
from pathlib import Path
import tensorflow as tf
import numpy as np
from tqdm import tqdm
from data.preprocess import generate_flying_things_point_cloud, get_all_flying_things_frames
from data.preprocess import preproces... | [
"data.preprocess.preprocess",
"tensorflow.config.get_visible_devices",
"argparse.ArgumentParser",
"pathlib.Path",
"data.preprocess.generate_flying_things_point_cloud",
"multiprocessing.cpu_count",
"os.chdir",
"tensorflow.config.set_visible_devices",
"multiprocessing.Pool",
"os.path.abspath",
"ti... | [((405, 473), 'data.preprocess.preprocess', 'preprocess', (['tfrecord_file', 'output_directory'], {'frames_per_segment': 'None'}), '(tfrecord_file, output_directory, frames_per_segment=None)\n', (415, 473), False, 'from data.preprocess import preprocess, merge_metadata\n'), ((2644, 2684), 'tensorflow.config.set_visible... |
import logging
import discord
from discord.ext import commands
from os import getenv
if __name__ == '__main__':
# Enable logging
logging.basicConfig(level=logging.INFO)
intents = discord.Intents.default()
intents.members = True
# Init bot and link to commands
bot = commands.Bot(command_prefix... | [
"logging.basicConfig",
"os.getenv",
"discord.ext.commands.Bot",
"discord.Intents.default"
] | [((138, 177), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (157, 177), False, 'import logging\n'), ((193, 218), 'discord.Intents.default', 'discord.Intents.default', ([], {}), '()\n', (216, 218), False, 'import discord\n'), ((293, 361), 'discord.ext.commands.B... |
import os
import csv
import datetime
now = datetime.datetime.now()
def parseing(fileName):
debugCounter = 0
sectionTemplate = '''
:doc:`{subject}{catNumber}`{SpTopic} {Term}
| Section {section} ({classNumber}) Credits: {units}; {mixture}; {component}
| Instructor: {Instructor}
|{Building}:{Room} {Location... | [
"datetime.datetime.now",
"csv.reader"
] | [((43, 66), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (64, 66), False, 'import datetime\n'), ((3883, 3914), 'csv.reader', 'csv.reader', (['file'], {'delimiter': '""","""'}), "(file, delimiter=',')\n", (3893, 3914), False, 'import csv\n')] |
# Copyright 2016 The TensorFlow 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 applica... | [
"tensorflow.python.platform.tf_logging.error"
] | [((7769, 7828), 'tensorflow.python.platform.tf_logging.error', 'logging.error', (["('Could not create metric ops for %s.' % self)"], {}), "('Could not create metric ops for %s.' % self)\n", (7782, 7828), True, 'from tensorflow.python.platform import tf_logging as logging\n')] |
"""
File: /tests/test_node.py
Project: Subversion Dump Editor
By: <NAME> [<EMAIL>]
Website: http://www.mitmaro.ca/projects/svneditor/
http://code.google.com/p/svndumpeditor/
Email: <EMAIL>
Created: August 18, 2009; Updated September 09, 2009
License:
Copyright (c) 2009, <NAME>
All righ... | [
"nose.tools.assert_equal",
"nose.tools.raises",
"PropertyData.PropertyData",
"Node.Node"
] | [((2056, 2074), 'nose.tools.raises', 'raises', (['ParseError'], {}), '(ParseError)\n', (2062, 2074), False, 'from nose.tools import raises, assert_equal\n'), ((1995, 2049), 'nose.tools.assert_equal', 'assert_equal', (["self.node.properties['Node-kind']", '"""dir"""'], {}), "(self.node.properties['Node-kind'], 'dir')\n"... |
# Copyright 2015 The TensorFlow 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 applica... | [
"tensorflow.contrib.framework.print_op",
"tensorflow.initialize_all_variables",
"tensorflow.TensorArray",
"tensorflow.Variable",
"tensorflow.SparseTensor",
"tensorflow.test.main",
"tensorflow.constant",
"tensorflow.sparse_tensor_to_dense"
] | [((2036, 2050), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (2048, 2050), True, 'import tensorflow as tf\n'), ((970, 986), 'tensorflow.constant', 'tf.constant', (['[1]'], {}), '([1])\n', (981, 986), True, 'import tensorflow as tf\n'), ((995, 1027), 'tensorflow.contrib.framework.print_op', 'tf.contrib.fram... |
import typing
import tarfile
from pathlib import Path
from fsutilz import isNestedIn
from ...styles import styles
from ..compression import CompressionT
from . import ArchiveFormat
class Tar(ArchiveFormat):
@staticmethod
def unpack(archPath: Path, extrDir: Path, config: "FetchConfig", compression: typing.Optional... | [
"tarfile.open",
"fsutilz.isNestedIn"
] | [((556, 631), 'tarfile.open', 'tarfile.open', (['archPath', "('r' + (':' + compression.id if compression else ''))"], {}), "(archPath, 'r' + (':' + compression.id if compression else ''))\n", (568, 631), False, 'import tarfile\n'), ((890, 913), 'fsutilz.isNestedIn', 'isNestedIn', (['extrDir', 'fp'], {}), '(extrDir, fp)... |
from __future__ import division,print_function
import numpy as np
import tensorflow as tf
import sys
import os
import glob
import re
from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessi... | [
"tensorflow.keras.preprocessing.image.load_img",
"flask.render_template",
"tensorflow.keras.applications.imagenet_utils.decode_predictions",
"flask.Flask",
"os.path.dirname",
"tensorflow.keras.models.load_model",
"werkzeug.utils.secure_filename",
"numpy.expand_dims",
"tensorflow.keras.preprocessing.... | [((519, 534), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (524, 534), False, 'from flask import Flask, redirect, url_for, request, render_template\n'), ((602, 624), 'tensorflow.keras.models.load_model', 'load_model', (['model_path'], {}), '(model_path)\n', (612, 624), False, 'from tensorflow.keras.model... |
from ..meshio import form_mesh
import numpy as np
import logging
def merge_meshes(input_meshes):
""" Merge multiple meshes into a single mesh.
Args:
input_meshes (``list``): a list of input :class:`Mesh` objects.
Returns:
A :py:class:`Mesh` consists of all vertices, faces and... | [
"logging.getLogger",
"numpy.ones",
"numpy.array",
"numpy.zeros",
"numpy.vstack",
"numpy.concatenate"
] | [((759, 786), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (776, 786), False, 'import logging\n'), ((1475, 1494), 'numpy.vstack', 'np.vstack', (['vertices'], {}), '(vertices)\n', (1484, 1494), True, 'import numpy as np\n'), ((1521, 1551), 'numpy.concatenate', 'np.concatenate', (['vertex... |
import requests
import json
import re
import datetime
from kafka import KafkaProducer
class Producer:
def __init__(self, session, configs, logger):
self.session = session
self.kafka_config = json.loads(configs["kafka_general"])
self.kafka_producer_config = json.loads(configs["kafka_producer... | [
"json.loads",
"datetime.datetime.strptime",
"kafka.KafkaProducer",
"json.dumps",
"re.match",
"datetime.datetime.now"
] | [((212, 248), 'json.loads', 'json.loads', (["configs['kafka_general']"], {}), "(configs['kafka_general'])\n", (222, 248), False, 'import json\n'), ((286, 323), 'json.loads', 'json.loads', (["configs['kafka_producer']"], {}), "(configs['kafka_producer'])\n", (296, 323), False, 'import json\n'), ((3105, 3155), 'datetime.... |
from translator.basemetric import BaseMetric
from translator.utils import get_vdu_details
from translator.exceptions import OsmInfoNotFound
class Metric(BaseMetric):
"""Constructor"""
def __init__(self, raw_metric, source="openstack"):
self.source = source
self.raw_metric = raw_metric
... | [
"translator.utils.get_vdu_details"
] | [((1353, 1415), 'translator.utils.get_vdu_details', 'get_vdu_details', (['vdu_uuid', 'self.raw_metric'], {'source': 'self.source'}), '(vdu_uuid, self.raw_metric, source=self.source)\n', (1368, 1415), False, 'from translator.utils import get_vdu_details\n')] |
from argparse import ArgumentParser
import torch
import torch.nn as nn
from ignite.contrib.handlers import ProgressBar
from ignite.engine import Events, Engine
from ignite.metrics import Loss
from ignite.utils import convert_tensor
from torch.utils.data import DataLoader
from googlenet_fcn.datasets.cityscapes import ... | [
"ignite.metrics.Loss",
"googlenet_fcn.model.googlenet_fcn.GoogLeNetFCN",
"torch.nn.CrossEntropyLoss",
"torch.cuda.device_count",
"googlenet_fcn.datasets.transforms.transforms.ConvertIdToTrainId",
"ignite.engine.Engine",
"googlenet_fcn.metrics.confusion_matrix.IoU",
"torch.cuda.is_available",
"google... | [((1156, 1187), 'googlenet_fcn.datasets.cityscapes.CityscapesDataset.num_classes', 'CityscapesDataset.num_classes', ([], {}), '()\n', (1185, 1187), False, 'from googlenet_fcn.datasets.cityscapes import CityscapesDataset\n'), ((1415, 1440), 'torch.cuda.device_count', 'torch.cuda.device_count', ([], {}), '()\n', (1438, 1... |
import os
import socket
import subprocess
from flask import Flask
from requests import get
app = Flask(__name__)
@app.route('/')
def hello():
hostname = socket.gethostname()
ip = get('https://api.ipify.org').text
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "test.log")) as f:
... | [
"os.path.abspath",
"socket.gethostname",
"requests.get",
"flask.Flask"
] | [((99, 114), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (104, 114), False, 'from flask import Flask\n'), ((161, 181), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (179, 181), False, 'import socket\n'), ((191, 219), 'requests.get', 'get', (['"""https://api.ipify.org"""'], {}), "('https:... |
# Binary search tree using linked list
from BinaryTree import searchBT
import QueueLinkedList as queue
class BSTNode:
def __init__(self,data) -> None:
self.data=data
self.leftChild=None
self.rightChild=None
def insertNode(rootNode,value):
if rootNode.data is None:
rootNode.data... | [
"QueueLinkedList.Queue"
] | [((1401, 1414), 'QueueLinkedList.Queue', 'queue.Queue', ([], {}), '()\n', (1412, 1414), True, 'import QueueLinkedList as queue\n')] |
from bs4 import BeautifulSoup
import requests
from datetime import datetime
from urllib.parse import urljoin
# ask questions
# change variables in the next sections
# use those variables to change outcomes in what is being scraped
# if there are mistakes, catch them
#######
####### Hey! What's your name?
user_name = ... | [
"bs4.BeautifulSoup",
"urllib.parse.urljoin",
"requests.get"
] | [((2790, 2814), 'requests.get', 'requests.get', (['websiteurl'], {}), '(websiteurl)\n', (2802, 2814), False, 'import requests\n'), ((2822, 2858), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""html.parser"""'], {}), "(r.text, 'html.parser')\n", (2835, 2858), False, 'from bs4 import BeautifulSoup\n'), ((6220, 624... |
#!/usr/bin/env python3
import cv2
mosaic_img = None
def mosaic(src, ratio=0.1):
small = cv2.resize(src, None, fx=ratio, fy=ratio, interpolation=cv2.INTER_NEAREST)
return cv2.resize(small, src.shape[:2][::-1], i... | [
"cv2.imwrite",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.imread"
] | [((194, 268), 'cv2.resize', 'cv2.resize', (['src', 'None'], {'fx': 'ratio', 'fy': 'ratio', 'interpolation': 'cv2.INTER_NEAREST'}), '(src, None, fx=ratio, fy=ratio, interpolation=cv2.INTER_NEAREST)\n', (204, 268), False, 'import cv2\n'), ((280, 351), 'cv2.resize', 'cv2.resize', (['small', 'src.shape[:2][::-1]'], {'inter... |
from collections.abc import MutableMapping
import numpy as np
_HIDDEN_ATTRS = frozenset(
[
"REFERENCE_LIST",
"CLASS",
"DIMENSION_LIST",
"NAME",
"_Netcdf4Dimid",
"_Netcdf4Coordinates",
"_nc3_strict",
"_NCProperties",
]
)
class Attributes(Mutable... | [
"h5py.check_string_dtype",
"numpy.asarray"
] | [((721, 770), 'h5py.check_string_dtype', 'h5py.check_string_dtype', (['self._h5attrs[key].dtype'], {}), '(self._h5attrs[key].dtype)\n', (744, 770), False, 'import h5py\n'), ((1150, 1167), 'numpy.asarray', 'np.asarray', (['value'], {}), '(value)\n', (1160, 1167), True, 'import numpy as np\n')] |
# Copyright 2018 Google LLC
#
# 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, ... | [
"jax.experimental.stax.Conv",
"jax.random.PRNGKey",
"jax.experimental.stax.FanOut",
"jax.experimental.stax.BatchNorm",
"jax.experimental.stax.Dense",
"jax.numpy.arange",
"jax.experimental.stax.shape_dependent",
"jax.experimental.stax.parallel",
"jax.experimental.stax.AvgPool",
"jax.numpy.sum",
"... | [((2055, 2086), 'jax.experimental.stax.shape_dependent', 'stax.shape_dependent', (['make_main'], {}), '(make_main)\n', (2075, 2086), False, 'from jax.experimental import stax\n'), ((3102, 3119), 'jax.random.PRNGKey', 'random.PRNGKey', (['(0)'], {}), '(0)\n', (3116, 3119), False, 'from jax import jit, grad, random\n'), ... |
from __future__ import print_function
from unittest import TestCase
import numpy as np
from nose import SkipTest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from sklearn.datasets.samples_generator import make_spd_matrix
from sklearn.mixture import GMM
from sklearn.utils import check_random... | [
"numpy.array",
"sklearn.mixture.GMM",
"numpy.arange",
"numpy.random.RandomState",
"numpy.testing.assert_array_almost_equal",
"numpy.diff",
"numpy.exp",
"numpy.empty",
"numpy.maximum",
"numpy.testing.assert_array_equal",
"numpy.random.normal",
"hmmlearn.hmm.GaussianHMM",
"numpy.all",
"sklea... | [((406, 427), 'numpy.seterr', 'np.seterr', ([], {'all': '"""warn"""'}), "(all='warn')\n", (415, 427), True, 'import numpy as np\n'), ((643, 672), 'numpy.empty', 'np.empty', (['n_iter'], {'dtype': 'float'}), '(n_iter, dtype=float)\n', (651, 672), True, 'import numpy as np\n'), ((15400, 15424), 'sklearn.utils.check_rando... |
import numpy as np
import biorbd_casadi as biorbd
from casadi import MX, vertcat
from bioptim import (
OptimalControlProgram,
DynamicsFcn,
DynamicsList,
Bounds,
QAndQDotBounds,
InitialGuess,
ObjectiveFcn,
ObjectiveList,
ConstraintList,
ConstraintFcn,
InterpolationType,
No... | [
"bioptim.BoundsList",
"bioptim.ObjectiveList",
"bioptim.QAndQDotBounds",
"bioptim.InitialGuess",
"biorbd_casadi.to_casadi_func",
"casadi.vertcat",
"bioptim.DynamicsList",
"bioptim.ConstraintList",
"numpy.array",
"bioptim.PhaseTransitionList",
"bioptim.OdeSolver.RK4",
"bioptim.OptimalControlPro... | [((1819, 1863), 'casadi.vertcat', 'vertcat', (['first_constraint', 'second_constraint'], {}), '(first_constraint, second_constraint)\n', (1826, 1863), False, 'from casadi import MX, vertcat\n'), ((1983, 1998), 'bioptim.OdeSolver.RK4', 'OdeSolver.RK4', ([], {}), '()\n', (1996, 1998), False, 'from bioptim import OptimalC... |
import os
from setuptools import setup
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__)))
def get_requirements():
if not os.path.exists(os.path.join(ROOT_PATH, 'requerments.txt')):
return None
packages = []
with open(os.path.join(ROOT_PATH, 'requerments.txt'), 'r') as _file:
... | [
"os.path.dirname",
"os.path.join"
] | [((81, 106), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (96, 106), False, 'import os\n'), ((161, 203), 'os.path.join', 'os.path.join', (['ROOT_PATH', '"""requerments.txt"""'], {}), "(ROOT_PATH, 'requerments.txt')\n", (173, 203), False, 'import os\n'), ((258, 300), 'os.path.join', 'os.path... |
import uuid
from django.core.exceptions import ValidationError
from arches.app.functions.base import BaseFunction
from arches.app.models import models
from arches.app.models.tile import Tile
import json
import logging
from django.db.models import Q
logger = logging.getLogger(__name__)
details = {
"name": "Increme... | [
"logging.getLogger",
"arches.app.models.models.TileModel.objects.filter",
"arches.app.models.tile.Tile.update_node_value",
"arches.app.models.models.NodeGroup.objects.get",
"django.db.models.Q"
] | [((258, 285), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (275, 285), False, 'import logging\n'), ((1887, 1932), 'arches.app.models.models.NodeGroup.objects.get', 'models.NodeGroup.objects.get', ([], {'pk': 'nodegroup_id'}), '(pk=nodegroup_id)\n', (1915, 1932), False, 'from arches.app.... |
import pandas as pd
import numpy as np
class GridMDP:
def __init__(self,
state_space,
action_space,
reward,
gamma):
self.state_space = state_space
self.action_space = action_space
self.reward = reward
self.gamma =... | [
"pandas.Series",
"numpy.array",
"numpy.abs",
"numpy.random.choice"
] | [((1030, 1045), 'numpy.array', 'np.array', (['state'], {}), '(state)\n', (1038, 1045), True, 'import numpy as np\n'), ((2256, 2267), 'pandas.Series', 'pd.Series', ([], {}), '()\n', (2265, 2267), True, 'import pandas as pd\n'), ((2701, 2724), 'numpy.random.choice', 'np.random.choice', (['max_v'], {}), '(max_v)\n', (2717... |
from rest_framework import mixins, generics, status
from rest_framework.response import Response
from . import serializers
from customer import models
from common.v1.decorators import session_authorize, meta_data_response, catch_exception
import logging
LOGGER = logging.getLogger(__name__)
class CustomerList(mixins.L... | [
"logging.getLogger",
"customer.models.Customer.objects.all",
"common.v1.decorators.catch_exception",
"customer.models.Customer.active_objects.all",
"rest_framework.response.Response",
"common.v1.decorators.session_authorize",
"common.v1.decorators.meta_data_response"
] | [((263, 290), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (280, 290), False, 'import logging\n'), ((439, 475), 'customer.models.Customer.active_objects.all', 'models.Customer.active_objects.all', ([], {}), '()\n', (473, 475), False, 'from customer import models\n'), ((536, 559), 'commo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Calculate the Severe to critical infections column of Table 1
Needs the filter_SRAG.py csv output to run
The Comorbidities are written like the original database keywords:
'NENHUM': No Comorbidities
'PNEUMOPATI': Lung Disease
'IMUNODEPRE': Lung Disease
'OBESIDADE': Ob... | [
"pandas.read_csv",
"numpy.array",
"datetime.date",
"pandas.isna",
"pandas.to_datetime"
] | [((775, 820), 'pandas.read_csv', 'pd.read_csv', (['"""../Data/SRAG_filtered_morb.csv"""'], {}), "('../Data/SRAG_filtered_morb.csv')\n", (786, 820), True, 'import pandas as pd\n'), ((733, 760), 'datetime.date', 'datetime.date', (['(2019)', '(12)', '(31)'], {}), '(2019, 12, 31)\n', (746, 760), False, 'import datetime\n')... |
"""
Author: <NAME>
Copyright (c) 2019, <NAME>
All rights reserved.
Max-Planck-Gesellschaft zur Foerderung der Wissenschaften e.V. (MPG) is holder of all proprietary rights on this
computer program.
You can only use this computer program if you have closed a license agreement with MPG or you get the right to use
the c... | [
"numpy.array",
"psbody.mesh.Mesh",
"matplotlib.pyplot.imshow",
"os.path.exists",
"tensorflow.Session",
"util.renderer.SMPLRenderer",
"numpy.max",
"os.mkdir",
"matplotlib.pyplot.axis",
"skimage.io.imread",
"run_RingNet.RingNet_inference",
"matplotlib.pyplot.title",
"matplotlib.pyplot.draw",
... | [((2353, 2422), 'util.renderer.get_original', 'vis_util.get_original', (['proc_param', 'verts', 'cam'], {'img_size': 'img.shape[:2]'}), '(proc_param, verts, cam, img_size=img.shape[:2])\n', (2374, 2422), True, 'from util import renderer as vis_util\n'), ((2806, 2819), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'],... |
from manimlib.constants import *
from manimlib.mobject.svg.tex_mobject import SingleStringTexMobject
from manimlib.mobject.types.vectorized_mobject import VMobject
class DecimalNumber(VMobject):
CONFIG = {
"num_decimal_places": 2,
"include_sign": False,
"group_with_commas": True,
"... | [
"manimlib.mobject.svg.tex_mobject.SingleStringTexMobject"
] | [((1659, 1710), 'manimlib.mobject.svg.tex_mobject.SingleStringTexMobject', 'SingleStringTexMobject', (['self.unit'], {'color': 'self.color'}), '(self.unit, color=self.color)\n', (1681, 1710), False, 'from manimlib.mobject.svg.tex_mobject import SingleStringTexMobject\n'), ((1351, 1383), 'manimlib.mobject.svg.tex_mobjec... |
"""
Convert tabular data from
Tabular Benchmarks for Joint Architecture and Hyperparameter Optimization
<NAME> <NAME>
https://arxiv.org/pdf/1905.04970.pdf.
"""
import urllib
import tarfile
from pathlib import Path
from typing import Optional
import pandas as pd
import numpy as np
import ast
import h5py
from syne_t... | [
"syne_tune.util.catchtime",
"tarfile.open",
"syne_tune.blackbox_repository.blackbox_tabular.BlackboxTabular",
"syne_tune.config_space.randint",
"syne_tune.config_space.finrange",
"syne_tune.blackbox_repository.repository.load",
"urllib.request.urlretrieve",
"matplotlib.pyplot.plot",
"syne_tune.confi... | [((867, 891), 'syne_tune.config_space.choice', 'choice', (["['tanh', 'relu']"], {}), "(['tanh', 'relu'])\n", (873, 891), False, 'from syne_tune.config_space import choice, logfinrange, finrange, randint\n'), ((919, 943), 'syne_tune.config_space.choice', 'choice', (["['tanh', 'relu']"], {}), "(['tanh', 'relu'])\n", (925... |
# 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... | [
"mindspore.context.get_context",
"numpy.array",
"pytest.raises",
"mindspore.nn.probability.distribution.Gamma",
"pytest.mark.skipif",
"mindspore.Tensor"
] | [((2566, 2640), 'pytest.mark.skipif', 'pytest.mark.skipif', (['skip_flag'], {'reason': '"""not support running in CPU and GPU"""'}), "(skip_flag, reason='not support running in CPU and GPU')\n", (2584, 2640), False, 'import pytest\n'), ((3341, 3415), 'pytest.mark.skipif', 'pytest.mark.skipif', (['skip_flag'], {'reason'... |
import FWCore.ParameterSet.Config as cms
def customise(process):
# add ECAL and HCAL specific Geant4 hits objects
process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
instanceLabel = cms.untracked.string('EcalValidInfo'),
type = cms.string('EcalSimHitsValidProducer'),
verbose = cms.untracked.... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.untracked.bool"
] | [((440, 470), 'FWCore.ParameterSet.Config.string', 'cms.string', (['"""generatorSmeared"""'], {}), "('generatorSmeared')\n", (450, 470), True, 'import FWCore.ParameterSet.Config as cms\n'), ((194, 231), 'FWCore.ParameterSet.Config.untracked.string', 'cms.untracked.string', (['"""EcalValidInfo"""'], {}), "('EcalValidInf... |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField, RadioField, SelectField, DateTimeField
from wtforms.validators import DataRequired, ValidationError, Email, EqualTo, Length
from app.models import User
from wtforms.fields.html5 import DateField
cl... | [
"wtforms.validators.Email",
"wtforms.validators.ValidationError",
"wtforms.BooleanField",
"wtforms.SubmitField",
"wtforms.StringField",
"wtforms.validators.EqualTo",
"wtforms.SelectField",
"app.models.User.query.filter_by",
"wtforms.validators.DataRequired",
"wtforms.TextAreaField"
] | [((505, 532), 'wtforms.BooleanField', 'BooleanField', (['"""Remember me"""'], {}), "('Remember me')\n", (517, 532), False, 'from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField, RadioField, SelectField, DateTimeField\n'), ((546, 568), 'wtforms.SubmitField', 'SubmitField', (['"""Sign ... |
import codecs
from os.path import join
import socket
import urllib.request
from test.system import AUTH_STRING, DATA_DIR, DOI, HOST, TIME_OUT
def _post(url, body, content_type):
_set_timeout()
opener = urllib.request.build_opener()
headers = {"Content-Type": content_type, "Authorization": "Basic " + AUTH... | [
"os.path.join",
"socket.setdefaulttimeout"
] | [((632, 666), 'socket.setdefaulttimeout', 'socket.setdefaulttimeout', (['TIME_OUT'], {}), '(TIME_OUT)\n', (656, 666), False, 'import socket\n'), ((878, 909), 'os.path.join', 'join', (['DATA_DIR', '"""meta_body.xml"""'], {}), "(DATA_DIR, 'meta_body.xml')\n", (882, 909), False, 'from os.path import join\n'), ((1580, 1608... |
# Copyright (c) 2018 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.
# Common decorator functions for oci-utils unit tests
import os.path
from oci_utils.impl.network_helpers import is_ip_reachable
from oci_u... | [
"subprocess.Popen",
"unittest.skip",
"oci_utils.metadata.InstanceMetadata",
"oci_utils.impl.network_helpers.is_ip_reachable"
] | [((1903, 1930), 'unittest.skip', 'unittest.skip', (['"""Unresolved"""'], {}), "('Unresolved')\n", (1916, 1930), False, 'import unittest\n'), ((4271, 4425), 'subprocess.Popen', 'subprocess.Popen', (["['/usr/bin/oci', 'compute', 'instance', 'get', '--instance-id', _instance_id]"], {'stdout': 'subprocess.PIPE', 'stderr': ... |
import copy
import datetime
import inspect
import warnings
from django.core import validators
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.core.urlresolvers import resolve, get_script_prefix
from django.conf import settings
from django.forms import widgets
from django.forms.models... | [
"rest_framework.compat.timezone.make_aware",
"django.core.validators.MaxLengthValidator",
"django.core.validators.MaxValueValidator",
"django.core.exceptions.ValidationError",
"django.core.urlresolvers.get_script_prefix",
"django.utils.encoding.smart_unicode",
"django.core.validators.MinValueValidator",... | [((2643, 2667), 'django.utils.encoding.is_protected_type', 'is_protected_type', (['value'], {}), '(value)\n', (2660, 2667), False, 'from django.utils.encoding import is_protected_type, smart_unicode\n'), ((2973, 2993), 'django.utils.encoding.smart_unicode', 'smart_unicode', (['value'], {}), '(value)\n', (2986, 2993), F... |
import os
import datetime
import requests
import os
from pytube import YouTube
url = "https://www.youtube.com/watch?v=x2sjEj8TClM&t" # sample url
yt = YouTube(url)
print("Video views:", yt.views)
print("Video title:", yt.title)
print("Video thumbnail url:", yt.thumbnail_url) | [
"pytube.YouTube"
] | [((154, 166), 'pytube.YouTube', 'YouTube', (['url'], {}), '(url)\n', (161, 166), False, 'from pytube import YouTube\n')] |
from django.conf.urls import url
from utilities.generic.base import TemplateView
from rss import views
# Create your views here.
urlpatterns = [
url(r'^rss.xml$',
views.rss,
name='rss'
),
] | [
"django.conf.urls.url"
] | [((155, 194), 'django.conf.urls.url', 'url', (['"""^rss.xml$"""', 'views.rss'], {'name': '"""rss"""'}), "('^rss.xml$', views.rss, name='rss')\n", (158, 194), False, 'from django.conf.urls import url\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 3 17:14:53 2019
@author: liuhongbing
"""
import pandas as pd
import numpy as np
from scipy import stats
from sklearn.metrics import precision_score, recall_score, f1_score, confusion_matrix, roc_curve, auc
import tensorflow as tf
# 加载数据集
def read... | [
"pandas.read_csv",
"sklearn.metrics.recall_score",
"tensorflow.cast",
"tensorflow.log",
"numpy.save",
"numpy.mean",
"tensorflow.nn.depthwise_conv2d",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.empty",
"tensorflow.matmul",
"sklearn.metrics.confusion_matrix",
"tensorflow.initialize... | [((3860, 3945), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, input_height, input_width, num_channels]'}), '(tf.float32, shape=[None, input_height, input_width,\n num_channels])\n', (3874, 3945), True, 'import tensorflow as tf\n'), ((3943, 3995), 'tensorflow.placeholder', 'tf.placeho... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import time
import uuid
from multiprocessing import Pipe, Pool
import threading
from concurrent.futures import ThreadPoolExecutor
import logging; logger = logging.getLogger("underworlds.testing.performances")
import underworlds
import underworlds.serve... | [
"logging.getLogger",
"logging.basicConfig",
"underworlds.server.start",
"argparse.ArgumentParser",
"concurrent.futures.ThreadPoolExecutor",
"underworlds.Context",
"time.sleep",
"traceback.print_exc",
"underworlds.types.Node",
"multiprocessing.Pool",
"underworlds.helpers.profile.profileonce",
"... | [((222, 275), 'logging.getLogger', 'logging.getLogger', (['"""underworlds.testing.performances"""'], {}), "('underworlds.testing.performances')\n", (239, 275), False, 'import logging\n'), ((1759, 1770), 'time.time', 'time.time', ([], {}), '()\n', (1768, 1770), False, 'import time\n'), ((1875, 1914), 'underworlds.helper... |
#!/usr/bin/env python
import json
from profanity import profanity
# Too many false positives with "cockroaches".
profanity.get_words()
profanity.words.remove('cock')
import db
# note that this file is relative to the root of the project, not this file.
OUT_FILE = 'site/frontend_data/summaries.json'
def summarize_by... | [
"db.requests.find",
"profanity.profanity.contains_profanity",
"db.requests.aggregate",
"profanity.profanity.get_words",
"profanity.profanity.words.remove",
"db.requests.count",
"json.dump"
] | [((114, 135), 'profanity.profanity.get_words', 'profanity.get_words', ([], {}), '()\n', (133, 135), False, 'from profanity import profanity\n'), ((136, 166), 'profanity.profanity.words.remove', 'profanity.words.remove', (['"""cock"""'], {}), "('cock')\n", (158, 166), False, 'from profanity import profanity\n'), ((1576,... |
import aiohttp
import asyncio
import time
import argparse
import numpy as np
import pandas as pd
import os
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--dir', action="store")
parser.add_argument('-s', '--service', action="store")
args = parser.parse_args()
result_dir = args.dir
if not os.path.exist... | [
"os.path.exists",
"aiohttp.ClientSession",
"os.makedirs",
"argparse.ArgumentParser",
"time.monotonic",
"numpy.empty",
"asyncio.sleep",
"pandas.DataFrame",
"asyncio.get_event_loop"
] | [((117, 142), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (140, 142), False, 'import argparse\n'), ((307, 333), 'os.path.exists', 'os.path.exists', (['result_dir'], {}), '(result_dir)\n', (321, 333), False, 'import os\n'), ((339, 362), 'os.makedirs', 'os.makedirs', (['result_dir'], {}), '(re... |
from logging import getLogger
from typing import List, Any, Iterable
from leaker.api import RangeDatabase
from .agnostic_reconstruction import arr
from ..glmp19 import ApproxOrder
from ...api import RangeAttack, LeakagePattern
from ...pattern import ResponseIdentity, Rank
log = getLogger(__name__)
class Arr(RangeAt... | [
"logging.getLogger"
] | [((281, 300), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (290, 300), False, 'from logging import getLogger\n')] |
# coding: utf-8
"""Test the /files/ handler."""
import io
import os
from unicodedata import normalize
pjoin = os.path.join
import requests
import json
from nbformat import write
from nbformat.v4 import (new_notebook,
new_markdown_cell, new_code_cell,
new_o... | [
"os.path.exists",
"json.loads",
"notebook.utils.url_path_join",
"os.urandom",
"nbformat.write",
"requests.get",
"os.mkdir",
"nbformat.v4.new_output",
"nbformat.v4.new_markdown_cell"
] | [((2705, 2723), 'json.loads', 'json.loads', (['r.text'], {}), '(r.text)\n', (2715, 2723), False, 'import json\n'), ((2273, 2296), 'nbformat.write', 'write', (['nb', 'f'], {'version': '(4)'}), '(nb, f, version=4)\n', (2278, 2296), False, 'from nbformat import write\n'), ((2562, 2606), 'notebook.utils.url_path_join', 'ur... |
import argparse
import json
import time
from pathlib import Path
from sklearn import metrics
from scipy import interpolate
import torch.nn.functional as F
from models import *
from utils.utils import *
from torchvision.transforms import transforms as T
from utils.datasets import LoadImages, JointDataset, co... | [
"utils.datasets.LoadImages",
"argparse.ArgumentParser"
] | [((2545, 2584), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""test.py"""'}), "(prog='test.py')\n", (2568, 2584), False, 'import argparse\n'), ((1325, 1352), 'utils.datasets.LoadImages', 'LoadImages', (['vpath', 'img_size'], {}), '(vpath, img_size)\n', (1335, 1352), False, 'from utils.datasets ... |
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
def autostring(num, prec=0, zero=False, set_printoptions=False, pp=False, join=False, joinall=False, sep=' '):
"""
Format number (array) with given decimal precision.
Definition
----------
def autostrin... | [
"numpy.log10",
"numpy.int32",
"numpy.array",
"numpy.isfinite",
"numpy.ma.min",
"numpy.reshape",
"numpy.where",
"numpy.ndim",
"doctest.testmod",
"numpy.empty",
"numpy.ma.abs",
"numpy.maximum",
"numpy.isinf",
"numpy.abs",
"numpy.ma.where",
"numpy.isnan",
"numpy.around",
"numpy.set_pr... | [((5953, 5965), 'numpy.ndim', 'np.ndim', (['num'], {}), '(num)\n', (5960, 5965), True, 'import numpy as np\n'), ((16341, 16398), 'doctest.testmod', 'doctest.testmod', ([], {'optionflags': 'doctest.NORMALIZE_WHITESPACE'}), '(optionflags=doctest.NORMALIZE_WHITESPACE)\n', (16356, 16398), False, 'import doctest\n'), ((5927... |
from django.core.validators import RegexValidator
alphanumeric = RegexValidator(r'^[0-9a-zA-Z]*$', 'Only alphanumeric characters are allowed.') | [
"django.core.validators.RegexValidator"
] | [((66, 143), 'django.core.validators.RegexValidator', 'RegexValidator', (['"""^[0-9a-zA-Z]*$"""', '"""Only alphanumeric characters are allowed."""'], {}), "('^[0-9a-zA-Z]*$', 'Only alphanumeric characters are allowed.')\n", (80, 143), False, 'from django.core.validators import RegexValidator\n')] |
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 <NAME> and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
from __future__ import absolute_import
import sys
import nu... | [
"h5py.h5ds.is_attached",
"h5py.h5ds.get_scale_name",
"numpy.ones",
"h5py.h5ds.attach_scale",
"h5py.h5ds.get_label",
"h5py.h5ds.is_scale",
"h5py.h5ds.detach_scale",
"h5py.h5ds.iterate",
"h5py.h5ds.get_num_scales",
"h5py.h5ds.set_label",
"h5py.h5ds.set_scale"
] | [((893, 916), 'numpy.ones', 'np.ones', (['(4, 3, 2)', '"""f"""'], {}), "((4, 3, 2), 'f')\n", (900, 916), True, 'import numpy as np\n'), ((943, 966), 'numpy.ones', 'np.ones', (['(4, 3, 2)', '"""f"""'], {}), "((4, 3, 2), 'f')\n", (950, 966), True, 'import numpy as np\n'), ((990, 1005), 'numpy.ones', 'np.ones', (['(2)', '... |
# Python code for Make Music with the Circuit Playground Express
# by <NAME>
# Copyright (c) 2020 <NAME> All rights reserved
# Buy the book at https://www.amazon.com/author/rleander#
#
# metronome with slide switch, buttons and lights
from adafruit_circuitplayground import cp
import time
# initial set... | [
"adafruit_circuitplayground.cp.pixels.fill",
"time.sleep",
"adafruit_circuitplayground.cp.play_tone"
] | [((769, 786), 'adafruit_circuitplayground.cp.pixels.fill', 'cp.pixels.fill', (['(0)'], {}), '(0)\n', (783, 786), False, 'from adafruit_circuitplayground import cp\n'), ((1203, 1220), 'time.sleep', 'time.sleep', (['delay'], {}), '(delay)\n', (1213, 1220), False, 'import time\n'), ((1145, 1168), 'adafruit_circuitplaygrou... |
import nltk
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer, TfidfVectorizer
import re
import string
from Sastrawi.StopWordRemover.StopWordRemoverFactory import StopWordRemoverFactory, ArrayDictionary, StopWordRemover
from Sastrawi.Stemmer.StemmerFactory import StemmerF... | [
"Sastrawi.Stemmer.StemmerFactory.StemmerFactory",
"pdfplumber.open",
"re.escape",
"Sastrawi.StopWordRemover.StopWordRemoverFactory.StopWordRemoverFactory",
"tqdm.tqdm",
"heapq.nlargest",
"sklearn.feature_extraction.text.TfidfVectorizer",
"re.sub",
"Sastrawi.StopWordRemover.StopWordRemoverFactory.Arr... | [((524, 540), 'Sastrawi.Stemmer.StemmerFactory.StemmerFactory', 'StemmerFactory', ([], {}), '()\n', (538, 540), False, 'from Sastrawi.Stemmer.StemmerFactory import StemmerFactory\n'), ((1398, 1425), 're.sub', 're.sub', (['"""\\\\d+"""', '""""""', 'kalimat'], {}), "('\\\\d+', '', kalimat)\n", (1404, 1425), False, 'impor... |
# Copyright 2019 NEC 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 writi... | [
"traceback.format_exc",
"libs.backyardlibs.monitoring_adapter.oase_monitoring_adapter_common_libs._rabbitMQ_conf",
"json.dumps",
"urllib3.disable_warnings",
"libs.commonlibs.oase_logger.OaseLogger.get_instance",
"multiprocessing.Lock",
"libs.backyardlibs.monitoring_adapter.oase_monitoring_adapter_common... | [((1182, 1230), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['InsecureRequestWarning'], {}), '(InsecureRequestWarning)\n', (1206, 1230), False, 'import urllib3\n'), ((1307, 1332), 'libs.commonlibs.oase_logger.OaseLogger.get_instance', 'OaseLogger.get_instance', ([], {}), '()\n', (1330, 1332), False, 'from ... |
"""Code complexity checking."""
from mccabe import McCabeChecker
from pylama.lint import Linter as Abstract
import ast
class Linter(Abstract):
"""Run complexity checking."""
@staticmethod
def run(path, code=None, params=None, **meta):
"""MCCabe code checking.
:return list: List of erro... | [
"mccabe.McCabeChecker"
] | [((622, 647), 'mccabe.McCabeChecker', 'McCabeChecker', (['tree', 'path'], {}), '(tree, path)\n', (635, 647), False, 'from mccabe import McCabeChecker\n')] |
#!/usr/bin/env python3
import json
import levv
Log = print
try:
import sparen
Log = sparen.log
except Exception as e:
Log = print
def test_1():
Log("Test 1")
# Test regex group names
# time:
t1 = '21-12-07 21:01:24: [ERR] Exception!'
r, s = levv.filterLine(levv.getLogTemplate('tim... | [
"json.dumps",
"levv.getLogTemplate"
] | [((296, 324), 'levv.getLogTemplate', 'levv.getLogTemplate', (['"""time:"""'], {}), "('time:')\n", (315, 324), False, 'import levv\n'), ((515, 541), 'levv.getLogTemplate', 'levv.getLogTemplate', (['"""pm2"""'], {}), "('pm2')\n", (534, 541), False, 'import levv\n'), ((684, 719), 'json.dumps', 'json.dumps', (['levv.__info... |
from flask import Flask
from web.recipe import recipe
def create_app(debug=False):
app = Flask(__name__)
app.debug = debug
# other setup tasks
app.config.from_pyfile("config/app.conf", silent=False)
app.config.from_envvar('EXTERNAL_CONFIG_FILE', silent=True)
# blueprints
app.register_blu... | [
"flask.Flask"
] | [((95, 110), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (100, 110), False, 'from flask import Flask\n')] |
import math
import threading
import time
import smbus
import Adafruit_ADS1x15
class SensorDataProvider(object):
"""Provides data from sensors attached to the spider."""
_bus = None
_adc = None
# Choose a gain of 1 for reading voltages from 0 to 4.09V.
# Or pick a different gain to change the ra... | [
"smbus.SMBus",
"math.sqrt",
"math.degrees",
"time.sleep",
"threading.Thread",
"Adafruit_ADS1x15.ADS1015",
"time.time"
] | [((6297, 6321), 'math.sqrt', 'math.sqrt', (['(a * a + b * b)'], {}), '(a * a + b * b)\n', (6306, 6321), False, 'import math\n'), ((6685, 6706), 'math.degrees', 'math.degrees', (['radians'], {}), '(radians)\n', (6697, 6706), False, 'import math\n'), ((1656, 1670), 'smbus.SMBus', 'smbus.SMBus', (['(1)'], {}), '(1)\n', (1... |
try:
from decimal import Decimal
except:
from django.utils._decimal import Decimal
from django.test import TestCase
from models import Carrier, ProductShippingPrice, Shipper
from datetime import datetime
from product.models import Product
class ProductShippingSimpleTest(TestCase):
fixtures = ['product... | [
"product.models.Product.objects.get",
"models.Carrier",
"django.utils._decimal.Decimal"
] | [((369, 401), 'models.Carrier', 'Carrier', ([], {'key': '"""test"""', 'active': '(True)'}), "(key='test', active=True)\n", (376, 401), False, 'from models import Carrier, ProductShippingPrice, Shipper\n'), ((437, 473), 'product.models.Product.objects.get', 'Product.objects.get', ([], {'slug': '"""dj-rocks"""'}), "(slug... |