code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import cv2
def init(xres, yres):
print(cv2.__version__)
print("starting vision")
# change this number to set the camera being used
cap = cv2.VideoCapture(0)
cap.set(3, xres)
cap.set(4, yres)
return cap
| [
"cv2.VideoCapture"
] | [((158, 177), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (174, 177), False, 'import cv2\n')] |
import voluptuous as vol
from esphome import pins
import esphome.config_validation as cv
from esphome.const import CONF_FREQUENCY, CONF_ID, CONF_RECEIVE_TIMEOUT, CONF_SCAN, CONF_SCL, \
CONF_SDA
from esphome.cpp_generator import Pvariable, add
from esphome.cpp_helpers import setup_component
from esphome.cpp_types i... | [
"esphome.cpp_generator.Pvariable",
"esphome.cpp_types.esphome_ns.class_",
"esphome.config_validation.declare_variable_id",
"voluptuous.Optional",
"esphome.config_validation.GenerateID",
"esphome.cpp_helpers.setup_component",
"voluptuous.Range",
"esphome.config_validation.invalid"
] | [((369, 413), 'esphome.cpp_types.esphome_ns.class_', 'esphome_ns.class_', (['"""I2CComponent"""', 'Component'], {}), "('I2CComponent', Component)\n", (386, 413), False, 'from esphome.cpp_types import App, Component, esphome_ns\n'), ((1227, 1258), 'esphome.cpp_generator.Pvariable', 'Pvariable', (['config[CONF_ID]', 'rhs... |
import os
import time
from getpass import getpass
from netmiko import ConnectHandler
def read_device(net_connect, sleep=1):
"""Sleep and read channel."""
time.sleep(sleep)
output = net_connect.read_channel()
print(output)
return output
if __name__ == "__main__":
# Code so automated tests wi... | [
"netmiko.ConnectHandler",
"getpass.getpass",
"time.sleep",
"os.getenv"
] | [((164, 181), 'time.sleep', 'time.sleep', (['sleep'], {}), '(sleep)\n', (174, 181), False, 'import time\n'), ((394, 423), 'os.getenv', 'os.getenv', (['"""NETMIKO_PASSWORD"""'], {}), "('NETMIKO_PASSWORD')\n", (403, 423), False, 'import os\n'), ((361, 390), 'os.getenv', 'os.getenv', (['"""NETMIKO_PASSWORD"""'], {}), "('N... |
import logging
import requests
from tenacity import before_log, retry, stop_after_attempt
class MarketDataClient(object):
logger = logging.getLogger(__name__)
base_url = 'http://market-data:8000'
def _make_request(self, url):
response = requests.get(
f"{self.base_url}/{url}", header... | [
"logging.getLogger",
"tenacity.before_log",
"requests.get",
"tenacity.stop_after_attempt"
] | [((138, 165), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (155, 165), False, 'import logging\n'), ((262, 350), 'requests.get', 'requests.get', (['f"""{self.base_url}/{url}"""'], {'headers': "{'content-type': 'application/json'}"}), "(f'{self.base_url}/{url}', headers={'content-type':\n... |
# This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Helper class for testing profiling functionality."""
from collections import Counter
from openclean.d... | [
"collections.Counter"
] | [((1518, 1527), 'collections.Counter', 'Counter', ([], {}), '()\n', (1525, 1527), False, 'from collections import Counter\n')] |
from pymongo import MongoClient
import datetime
import pickle
connectionstring = 'mongodb://takuu.dcs.gla.ac.uk:27017'
client = MongoClient(connectionstring)
database_name = "Game_data"
db = client[database_name]
players = db["players"]
games = db["games"]
completed_games = db["completed_games"]
player_backup = db["p... | [
"pickle.dump",
"pymongo.MongoClient",
"pickle.load",
"datetime.datetime.now"
] | [((130, 159), 'pymongo.MongoClient', 'MongoClient', (['connectionstring'], {}), '(connectionstring)\n', (141, 159), False, 'from pymongo import MongoClient\n'), ((2677, 2706), 'pymongo.MongoClient', 'MongoClient', (['connectionstring'], {}), '(connectionstring)\n', (2688, 2706), False, 'from pymongo import MongoClient\... |
from os import listdir
from os import path
import io
import json
save_apsnypress = io.open('../hunalign_batch_apsnypress.txt','w+', encoding="utf-8")
with open('../data_out.json', 'r') as f:
data_j = json.load(f)
for item in data_j:
if len(item["possible match"]) != 0:
for possible_item in item["possib... | [
"json.load",
"io.open"
] | [((84, 151), 'io.open', 'io.open', (['"""../hunalign_batch_apsnypress.txt"""', '"""w+"""'], {'encoding': '"""utf-8"""'}), "('../hunalign_batch_apsnypress.txt', 'w+', encoding='utf-8')\n", (91, 151), False, 'import io\n'), ((205, 217), 'json.load', 'json.load', (['f'], {}), '(f)\n', (214, 217), False, 'import json\n')] |
import logging
import math
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import sys
import math
class ClassifyEnv(gym.Env):
def __init__(self, trainSet, target):
"""
Data set is a tuple of
[0] input data: [nSamples x nInputs]
[1] labels: [nSamples x 1]
... | [
"cv2.warpAffine",
"cv2.resize",
"mnist.train_images",
"sklearn.datasets.load_digits",
"mnist.train_labels",
"numpy.array",
"numpy.sum",
"numpy.empty",
"numpy.concatenate",
"cv2.moments",
"numpy.shape",
"numpy.load",
"numpy.float32",
"gym.utils.seeding.np_random"
] | [((2536, 2558), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (2556, 2558), False, 'from sklearn import datasets\n'), ((3192, 3230), 'numpy.load', 'np.load', (['"""../mnist_train_features.npy"""'], {}), "('../mnist_train_features.npy')\n", (3199, 3230), True, 'import numpy as np\n'), ((3244,... |
from unittest import SkipTest
from holoviews.core import NdOverlay
from holoviews.core.util import pd
from holoviews.element import Segments
from .test_plot import TestBokehPlot, bokeh_renderer
try:
from bokeh.models import FactorRange
except:
pass
class TestSegmentPlot(TestBokehPlot):
def test_segmen... | [
"holoviews.core.util.pd.date_range",
"unittest.SkipTest",
"holoviews.element.Segments"
] | [((2833, 2899), 'holoviews.element.Segments', 'Segments', (["(['A', 'B', 'C'], [1, 2, 3], ['A', 'B', 'C'], [4, 5, 6])"], {}), "((['A', 'B', 'C'], [1, 2, 3], ['A', 'B', 'C'], [4, 5, 6]))\n", (2841, 2899), False, 'from holoviews.element import Segments\n'), ((3169, 3235), 'holoviews.element.Segments', 'Segments', (["([1,... |
import numpy as np
from context import variationaloptimization
def test_optimization():
knapsack = Knapsack()
theta0 = 0.5*np.ones(4)
minres = variationaloptimization.minimize_variational(knapsack, theta0,
learning_rate=1e-2,
... | [
"numpy.array",
"numpy.ones",
"context.variationaloptimization.minimize_variational"
] | [((158, 259), 'context.variationaloptimization.minimize_variational', 'variationaloptimization.minimize_variational', (['knapsack', 'theta0'], {'learning_rate': '(0.01)', 'max_iter': '(1000)'}), '(knapsack, theta0,\n learning_rate=0.01, max_iter=1000)\n', (202, 259), False, 'from context import variationaloptimizati... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: cosmos/mint/v1beta1/genesis.proto, cosmos/mint/v1beta1/mint.proto, cosmos/mint/v1beta1/query.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict
import betterproto
from betterproto.grpc.grpclib_server import ... | [
"betterproto.bytes_field",
"dataclasses.dataclass",
"grpclib.const.Handler",
"grpclib.GRPCError",
"betterproto.string_field",
"betterproto.uint64_field",
"betterproto.message_field"
] | [((350, 381), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)', 'repr': '(False)'}), '(eq=False, repr=False)\n', (359, 381), False, 'from dataclasses import dataclass\n'), ((651, 682), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)', 'repr': '(False)'}), '(eq=False, repr=False)\n', (660, 682), Fa... |
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompany... | [
"pytest.fixture",
"pytest.mark.xfail",
"json.dumps"
] | [((758, 788), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (772, 788), False, 'import pytest\n'), ((1357, 1398), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'raises': 'ValidationError'}), '(raises=ValidationError)\n', (1374, 1398), False, 'import pytest\n'), ((1570, 161... |
# Copyright 2016-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import itertools
import operator
import zlib
import jmespath
from c7n.actions import BaseAction, ModifyVpcSecurityGroupsAction
from c7n.exceptions import PolicyValidationError, ClientError
fro... | [
"itertools.chain",
"c7n.exceptions.PolicyValidationError",
"c7n.manager.resources.register",
"c7n.utils.local_session",
"c7n.resources.aws.shape_validate",
"jmespath.search",
"c7n.utils.get_retry",
"c7n.filters.ValueFilter",
"c7n.utils.type_schema",
"jmespath.compile",
"c7n.utils.chunks",
"c7n... | [((924, 949), 'c7n.manager.resources.register', 'resources.register', (['"""vpc"""'], {}), "('vpc')\n", (942, 949), False, 'from c7n.manager import resources\n'), ((15908, 15936), 'c7n.manager.resources.register', 'resources.register', (['"""subnet"""'], {}), "('subnet')\n", (15926, 15936), False, 'from c7n.manager imp... |
# File: falconapi_view.py
#
# Copyright (c) 2016-2018 Splunk 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 app... | [
"phantom.utils.is_sha256",
"phantom.utils.is_ip",
"phantom.utils.is_md5",
"phantom.utils.is_domain",
"phantom.utils.is_hash",
"phantom.utils.is_sha1"
] | [((761, 784), 'phantom.utils.is_md5', 'util.is_md5', (['hash_value'], {}), '(hash_value)\n', (772, 784), True, 'import phantom.utils as util\n'), ((838, 862), 'phantom.utils.is_sha1', 'util.is_sha1', (['hash_value'], {}), '(hash_value)\n', (850, 862), True, 'import phantom.utils as util\n'), ((917, 943), 'phantom.utils... |
"""The tests for the Aurora sensor platform."""
import re
from homeassistant.components.aurora import binary_sensor as aurora
from tests.common import load_fixture
def test_setup_and_initial_state(hass, requests_mock):
"""Test that the component is created and initialized as expected."""
uri = re.compile(r"... | [
"tests.common.load_fixture",
"homeassistant.components.aurora.binary_sensor.setup_platform",
"re.compile"
] | [((307, 386), 're.compile', 're.compile', (['"""http://services\\\\.swpc\\\\.noaa\\\\.gov/text/aurora-nowcast-map\\\\.txt"""'], {}), "('http://services\\\\.swpc\\\\.noaa\\\\.gov/text/aurora-nowcast-map\\\\.txt')\n", (317, 386), False, 'import re\n'), ((799, 853), 'homeassistant.components.aurora.binary_sensor.setup_pla... |
from django.core.management.base import BaseCommand, CommandError
from django.urls import reverse
from django.core.mail import send_mail
from django.template.loader import get_template, render_to_string
from django.conf import settings
from django.contrib.sites.models import Site
from accounts.models import Account, E... | [
"accounts.models.EmailConfirmation.objects.filter",
"accounts.models.EmailRecord.objects.create",
"django.core.mail.send_mail",
"accounts.models.Account.objects.filter",
"time.sleep",
"datetime.datetime.now",
"django.contrib.sites.models.Site.objects.get",
"django.urls.reverse",
"django.template.loa... | [((690, 712), 'django.contrib.sites.models.Site.objects.get', 'Site.objects.get', ([], {'id': '(1)'}), '(id=1)\n', (706, 712), False, 'from django.contrib.sites.models import Site\n'), ((732, 780), 'accounts.models.Account.objects.filter', 'Account.objects.filter', ([], {'is_email_confirmed': '(False)'}), '(is_email_co... |
"""Support for checking code asynchronously."""
import logging
import threading
try:
import Queue
except ImportError:
import queue as Queue
try:
import multiprocessing
CPU_COUNT = multiprocessing.cpu_count()
except (ImportError, NotImplementedError):
CPU_COUNT = 1
from .core import run
LOGG... | [
"logging.getLogger",
"threading.Thread.__init__",
"queue.Queue",
"multiprocessing.cpu_count"
] | [((325, 352), 'logging.getLogger', 'logging.getLogger', (['"""pylava"""'], {}), "('pylava')\n", (342, 352), False, 'import logging\n'), ((201, 228), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (226, 228), False, 'import multiprocessing\n'), ((1076, 1089), 'queue.Queue', 'Queue.Queue', ([... |
"""Manage VRRP groups on HPCOM7 devices.
"""
from pyhpecw7.utils.templates import cli
class VRRP(object):
"""This class is used to collect data or configure a VRRP group on a
given interface.
Args:
device (HPCOM7): connected instance of a ``pyhpecw7.comware.HPCOM7``
object.
... | [
"pyhpecw7.utils.templates.cli.get_structured_data"
] | [((1354, 1395), 'pyhpecw7.utils.templates.cli.get_structured_data', 'cli.get_structured_data', (['"""vrrp.tmpl"""', 'rsp'], {}), "('vrrp.tmpl', rsp)\n", (1377, 1395), False, 'from pyhpecw7.utils.templates import cli\n')] |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mockMsg.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refle... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((480, 506), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (504, 506), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((894, 1198), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""mockValue"""', 'full... |
from django.utils.crypto import get_random_string
from google.appengine.ext import ndb
class AppConfig(ndb.Model):
secret_key = ndb.StringProperty()
@classmethod
def get(cls):
"""Singleton configuration to store the Django secret key."""
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^... | [
"django.utils.crypto.get_random_string",
"google.appengine.ext.ndb.StringProperty"
] | [((134, 154), 'google.appengine.ext.ndb.StringProperty', 'ndb.StringProperty', ([], {}), '()\n', (152, 154), False, 'from google.appengine.ext import ndb\n'), ((351, 379), 'django.utils.crypto.get_random_string', 'get_random_string', (['(50)', 'chars'], {}), '(50, chars)\n', (368, 379), False, 'from django.utils.crypto... |
# 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 under t... | [
"openstack.telemetry.telemetry_service.TelemetryService",
"openstack.resource.prop"
] | [((795, 831), 'openstack.telemetry.telemetry_service.TelemetryService', 'telemetry_service.TelemetryService', ([], {}), '()\n', (829, 831), False, 'from openstack.telemetry import telemetry_service\n'), ((915, 940), 'openstack.resource.prop', 'resource.prop', (['"""alarm_id"""'], {}), "('alarm_id')\n", (928, 940), Fals... |
import os
import numpy as np
import sys
import csv
from matplotlib import pyplot as plt
# data is what is to be analyzed, it must have the structure of alldatascored in classify()
# col is the color of the plot
# lab is the label of the plot
labs = ["1KG", "ExAC", "IRAN"]
cols = ['red','blue','green']
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"csv.reader",
"matplotlib.pyplot.legend"
] | [((802, 830), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(18, 12)'}), '(figsize=(18, 12))\n', (812, 830), True, 'from matplotlib import pyplot as plt\n'), ((1169, 1198), 'matplotlib.pyplot.tick_params', 'plt.tick_params', ([], {'labelsize': '(20)'}), '(labelsize=20)\n', (1184, 1198), True, 'from matplo... |
from bs4 import BeautifulSoup
from selenium import webdriver
import json
# -
# Observações:
#
# As primeiras tentativas foram realizadas com o uso do Scrapy, porém
# apresentada um erro de requests, informando que a resposta da
# requisição era inválida.
#
# Dessa forma recorri ao método mais fácil e rápido, Reque... | [
"bs4.BeautifulSoup",
"selenium.webdriver.Chrome",
"selenium.webdriver.ChromeOptions",
"json.dumps"
] | [((784, 809), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (807, 809), False, 'from selenium import webdriver\n'), ((856, 889), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'options': 'options'}), '(options=options)\n', (872, 889), False, 'from selenium import webdriver\n')... |
from __future__ import unicode_literals
import requests
from .basemanager import BaseManager
from .constants import XERO_API_URL
class TrackingCategoryOptionsManager(BaseManager):
def __init__(self, credentials, user_agent=None):
from xero import __version__ as VERSION
self.credentials = creden... | [
"requests.utils.default_user_agent"
] | [((551, 586), 'requests.utils.default_user_agent', 'requests.utils.default_user_agent', ([], {}), '()\n', (584, 586), False, 'import requests\n')] |
import unittest
import os
from link import Link, Wrapper
from link.utils import load_json_file
from link.tests import *
DIR = os.path.dirname(__file__)
TEST_CONFIG = 'test_link.test_config'
TEST_CONFIG2 = 'test_link2.test_config'
BAD_CONFIG = 'bad_config.test_config'
NO_CONFIG = 'no_config.test_config'
#load in all ... | [
"os.path.dirname",
"link.Link",
"link.Link.instance",
"nose.runmodule"
] | [((127, 152), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (142, 152), False, 'import os\n'), ((351, 366), 'link.Link.instance', 'Link.instance', ([], {}), '()\n', (364, 366), False, 'from link import Link, Wrapper\n'), ((5405, 5492), 'nose.runmodule', 'nose.runmodule', ([], {'argv': "[__fi... |
################################################################################
# Copyright (C) 2016-2019 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"pandas.merge",
"os.path.splitext",
"os.path.join",
"os.path.dirname",
"os.path.basename"
] | [((1431, 1456), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1454, 1456), False, 'import argparse\n'), ((1908, 1936), 'pandas.read_csv', 'pd.read_csv', (['currentFileName'], {}), '(currentFileName)\n', (1919, 1936), True, 'import pandas as pd\n'), ((2041, 2065), 'pandas.read_csv', 'pd.read_c... |
import numpy as np
from vanhateren import VanHateren
import vanhateren.preprocess as pp
def load_patches(n, shape=(32, 32)):
vh = VanHateren(calibrated=True)
rng = np.random.RandomState(9)
return vh.patches(n, shape, rng=rng)
def show_patch(ax, patch):
ax.imshow(patch, cmap='gray')
ax.set_xtick... | [
"vanhateren.preprocess.contrast_normalize",
"vanhateren.VanHateren",
"vanhateren.preprocess.scale",
"vanhateren.preprocess.zca",
"numpy.random.RandomState"
] | [((137, 164), 'vanhateren.VanHateren', 'VanHateren', ([], {'calibrated': '(True)'}), '(calibrated=True)\n', (147, 164), False, 'from vanhateren import VanHateren\n'), ((175, 199), 'numpy.random.RandomState', 'np.random.RandomState', (['(9)'], {}), '(9)\n', (196, 199), True, 'import numpy as np\n'), ((539, 580), 'vanhat... |
import json
import os
import time
import numpy as np
from metalearn import Metafeatures
from tests.config import CORRECTNESS_SEED, METAFEATURES_DIR, METADATA_PATH
from .dataset import read_dataset
def get_dataset_metafeatures_path(dataset_filename):
dataset_name = dataset_filename.rsplit(".", 1)[0]
return o... | [
"metalearn.Metafeatures",
"numpy.isclose",
"json.dumps",
"os.path.join",
"json.load",
"time.time",
"json.dump"
] | [((319, 376), 'os.path.join', 'os.path.join', (['METAFEATURES_DIR', "(dataset_name + '_mf.json')"], {}), "(METAFEATURES_DIR, dataset_name + '_mf.json')\n", (331, 376), False, 'import os\n'), ((1079, 1090), 'time.time', 'time.time', ([], {}), '()\n', (1088, 1090), False, 'import time\n'), ((1216, 1227), 'time.time', 'ti... |
# -*- coding: utf-8 -*-
import asyncio
import json
import logging
import ssl as ssl_
import struct
import zlib
from collections import namedtuple
from enum import IntEnum
from typing import *
import aiohttp
logger = logging.getLogger(__name__)
ROOM_INIT_URL = 'https://api.live.bilibili.com/xlive/web-room/v1/index/g... | [
"logging.getLogger",
"collections.namedtuple",
"json.dumps",
"aiohttp.ClientTimeout",
"asyncio.ensure_future",
"asyncio.sleep",
"struct.Struct",
"asyncio.get_event_loop"
] | [((219, 246), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (236, 246), False, 'import logging\n'), ((574, 597), 'struct.Struct', 'struct.Struct', (['""">I2H2I"""'], {}), "('>I2H2I')\n", (587, 597), False, 'import struct\n'), ((612, 704), 'collections.namedtuple', 'namedtuple', (['"""Hea... |
#!/usr/bin/env python3
# encoding: utf-8
"""
@author: <NAME>
@file: runner.py
@time: 2020-03-04 21:27
"""
import datetime
import os
import unittest
from base import HTMLTestReportCN
from base.send_email import smtp_email
from config_loader import conf_load
from loguru import logger
class TestRunner(object):
@l... | [
"os.listdir",
"loguru.logger.info",
"base.HTMLTestReportCN.HTMLTestReportCN",
"os.path.join",
"datetime.datetime.now",
"loguru.logger.error",
"base.send_email.smtp_email",
"os.mkdir",
"os.path.abspath",
"config_loader.conf_load",
"unittest.TextTestRunner",
"unittest.defaultTestLoader.discover"... | [((655, 677), 'os.listdir', 'os.listdir', (['self.cases'], {}), '(self.cases)\n', (665, 677), False, 'import os\n'), ((1555, 1586), 'os.path.join', 'os.path.join', (['log_dp', '"""UIT.log"""'], {}), "(log_dp, 'UIT.log')\n", (1567, 1586), False, 'import os\n'), ((2286, 2307), 'loguru.logger.info', 'logger.info', (['"""邮... |
from django.urls import path
from .views import *
urlpatterns = [
path('', button),
path('reg_code_check/', reg_code_check),
# path('get_buttons/', get_buttons),
]
| [
"django.urls.path"
] | [((72, 88), 'django.urls.path', 'path', (['""""""', 'button'], {}), "('', button)\n", (76, 88), False, 'from django.urls import path\n'), ((94, 133), 'django.urls.path', 'path', (['"""reg_code_check/"""', 'reg_code_check'], {}), "('reg_code_check/', reg_code_check)\n", (98, 133), False, 'from django.urls import path\n'... |
from PyQt5 import QtCore
import pandas as pd
class PandasModel(QtCore.QAbstractTableModel):
def __init__(self, df=pd.DataFrame(), parent=None):
QtCore.QAbstractTableModel.__init__(self, parent=parent)
self._data = df.copy()
self.bolds = dict()
def toDataFrame(self):
... | [
"pandas.DataFrame",
"PyQt5.QtCore.QAbstractTableModel.__init__",
"PyQt5.QtCore.QVariant",
"PyQt5.QtCore.QModelIndex"
] | [((127, 141), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (139, 141), True, 'import pandas as pd\n'), ((166, 222), 'PyQt5.QtCore.QAbstractTableModel.__init__', 'QtCore.QAbstractTableModel.__init__', (['self'], {'parent': 'parent'}), '(self, parent=parent)\n', (201, 222), False, 'from PyQt5 import QtCore\n'), ... |
#!/usr/bin/env python3
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2018
# [+] International Business Machines Corp.
#
#
# 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 Lic... | [
"cgi.FieldStorage",
"os.makedirs",
"os.path.ismount",
"os.path.join",
"time.sleep",
"os.path.isfile",
"os.path.normpath",
"os.remove",
"os.path.isdir",
"shutil.copyfile",
"shutil.rmtree",
"OpTestLogger.optest_logger_glob.get_logger",
"threading.Thread",
"os.path.abspath",
"subprocess.get... | [((1095, 1147), 'OpTestLogger.optest_logger_glob.get_logger', 'OpTestLogger.optest_logger_glob.get_logger', (['__name__'], {}), '(__name__)\n', (1137, 1147), False, 'import OpTestLogger\n'), ((9158, 9208), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.server.serve_forever'}), '(target=self.server.serve_... |
# -*- coding: utf-8 -*-
"""
Copyright © 2022 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, pub... | [
"bpy.data.meshes.remove",
"bpy.data.collections.new",
"bpy.data.objects.new",
"bpy.data.meshes.new",
"bpy.data.collections.get",
"bmesh.new",
"bpy.data.objects.get",
"bpy.context.scene.collection.children.link",
"bpy.context.scene.collection.objects.link"
] | [((6814, 6852), 'bpy.data.objects.get', 'bpy.data.objects.get', (['sosi_parent_name'], {}), '(sosi_parent_name)\n', (6834, 6852), False, 'import bpy\n'), ((8130, 8141), 'bmesh.new', 'bmesh.new', ([], {}), '()\n', (8139, 8141), False, 'import bmesh\n'), ((8225, 8250), 'bpy.data.meshes.new', 'bpy.data.meshes.new', (['nam... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Copyright 2018 IQRF Tech s.r.o.
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... | [
"argparse.ArgumentParser",
"subprocess.Popen",
"os.path.join",
"sys.platform.startswith",
"os.getcwd",
"os.chdir"
] | [((673, 743), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Cross-platform clibspi builder."""'}), "(description='Cross-platform clibspi builder.')\n", (696, 743), False, 'import argparse\n'), ((2209, 2220), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2218, 2220), False, 'import os\n')... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | [
"polyaxon_sdk.api_client.ApiClient",
"polyaxon_sdk.exceptions.ApiTypeError",
"six.iteritems",
"polyaxon_sdk.exceptions.ApiValueError"
] | [((4414, 4455), 'six.iteritems', 'six.iteritems', (["local_var_params['kwargs']"], {}), "(local_var_params['kwargs'])\n", (4427, 4455), False, 'import six\n'), ((9981, 10022), 'six.iteritems', 'six.iteritems', (["local_var_params['kwargs']"], {}), "(local_var_params['kwargs'])\n", (9994, 10022), False, 'import six\n'),... |
import numpy as np
import cv2
import cv2.aruco as aruco
import sys, time, math
from copy import deepcopy
from threading import Thread, Lock
class LocalizationTracker():
def __init__(self,
id_to_find,
marker_size,
src,
camera_matrix,
... | [
"math.sqrt",
"cv2.imshow",
"numpy.array",
"cv2.warpPerspective",
"cv2.destroyAllWindows",
"numpy.linalg.norm",
"copy.deepcopy",
"cv2.aruco.drawDetectedMarkers",
"numpy.where",
"threading.Lock",
"numpy.dot",
"cv2.waitKey",
"numpy.identity",
"cv2.aruco.getPredefinedDictionary",
"cv2.getPer... | [((18966, 19024), 'numpy.loadtxt', 'np.loadtxt', (["(calib_path + 'cameraMatrix.txt')"], {'delimiter': '""","""'}), "(calib_path + 'cameraMatrix.txt', delimiter=',')\n", (18976, 19024), True, 'import numpy as np\n'), ((19045, 19107), 'numpy.loadtxt', 'np.loadtxt', (["(calib_path + 'cameraDistortion.txt')"], {'delimiter... |
import os
import cv2
import copy
import time
import json
from pprint import pprint
import numpy as np
import streamlit as st
from PIL import ImageColor
# import coco_annotation_parser as annot_parse # type:ignore
import SessionState #type:ignore
import circulation_skeletonizer as circ_skeleton #type:ignore
... | [
"streamlit.image",
"streamlit.sidebar.form",
"streamlit.button",
"time.sleep",
"circulation_skeletonizer.get_orientation_graph",
"numpy.array",
"streamlit.multiselect",
"streamlit.empty",
"streamlit.form",
"streamlit.cache",
"os.listdir",
"json.dump",
"os.path.isdir",
"circulation_skeleton... | [((544, 599), 'streamlit.set_option', 'st.set_option', (['"""deprecation.showPyplotGlobalUse"""', '(False)'], {}), "('deprecation.showPyplotGlobalUse', False)\n", (557, 599), True, 'import streamlit as st\n'), ((601, 720), 'streamlit.set_page_config', 'st.set_page_config', ([], {'page_title': '"""Arch App"""', 'page_ic... |
# -*- coding: UTF-8 -*-
import re
import warnings
from datetime import datetime
from operator import itemgetter
from urllib.parse import urljoin
import pytest
from PIL import Image
from _pytest.reports import CollectReport
# Reference: http://docs.gurock.com/testrail-api2/reference-statuses
TESTRAIL_TEST_STATUS = {
... | [
"PIL.Image.open",
"pytest.mark.testrail_defects",
"datetime.datetime.utcnow",
"pytest.mark.skip",
"pytest.mark.testrail",
"urllib.parse.urljoin",
"warnings.simplefilter",
"operator.itemgetter",
"warnings.warn",
"pytest.hookimpl",
"re.search"
] | [((1084, 1169), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""once"""', 'category': 'DeprecatedTestDecorator', 'lineno': '(0)'}), "(action='once', category=DeprecatedTestDecorator, lineno=0\n )\n", (1105, 1169), False, 'import warnings\n'), ((2246, 2301), 'warnings.warn', 'warnings.warn', (['... |
# -*- coding: utf-8 -*-
"""
bxemu - bitmex xbt emulator.
"""
from setuptools import setup, find_packages
import codecs
import os
def read_install_requires():
with codecs.open('requirements.txt', 'r', encoding='utf-8') as f:
res = f.readlines()
res = list(map(lambda s: s.replace('\n', '... | [
"codecs.open",
"setuptools.find_packages"
] | [((183, 237), 'codecs.open', 'codecs.open', (['"""requirements.txt"""', '"""r"""'], {'encoding': '"""utf-8"""'}), "('requirements.txt', 'r', encoding='utf-8')\n", (194, 237), False, 'import codecs\n'), ((1464, 1479), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1477, 1479), False, 'from setuptools im... |
import pandas as pd
import dateutil.parser
import json
import math
import os.path
import shlex
import subprocess
import tempfile
def execute_command(
command):
result = subprocess.call(shlex.split(command))
if result != 0:
raise RuntimeError("Error executing {}".format(command))
def lue_tr... | [
"shlex.split",
"tempfile.NamedTemporaryFile",
"json.loads",
"math.floor"
] | [((1938, 1954), 'math.floor', 'math.floor', (['size'], {}), '(size)\n', (1948, 1954), False, 'import math\n'), ((2092, 2108), 'math.floor', 'math.floor', (['size'], {}), '(size)\n', (2102, 2108), False, 'import math\n'), ((3042, 3059), 'json.loads', 'json.loads', (['lines'], {}), '(lines)\n', (3052, 3059), False, 'impo... |
import itertools
from abc import abstractmethod, ABC
from typing import (
Sequence,
Any,
Iterable,
Dict,
)
from .helper import Offset2ID
from .... import Document
class BaseGetSetDelMixin(ABC):
"""Provide abstract methods and derived methods for ``__getitem__``, ``__setitem__`` and ``__delitem__`... | [
"docarray.DocumentArray",
"itertools.compress"
] | [((4169, 4226), 'itertools.compress', 'itertools.compress', (['self._offset2ids', '(_i for _i in mask)'], {}), '(self._offset2ids, (_i for _i in mask))\n', (4187, 4226), False, 'import itertools\n'), ((10035, 10052), 'docarray.DocumentArray', 'DocumentArray', (['_d'], {}), '(_d)\n', (10048, 10052), False, 'from docarra... |
import torch.nn as nn
import torch
from utils import BBoxTransform,ClipBoxes
from nms.nms_pytorch import nms as nms_op
def nms(dets, thresh):
#dets = dets.cpu().detach()
#dets = np.array(dets)
"Dispatch to either CPU or GPU NMS implementations.\
Accept dets as tensor"""
#keep = torch.tensor(py_cpu_... | [
"utils.BBoxTransform",
"torch.max",
"nms.nms_pytorch.nms",
"utils.ClipBoxes",
"torch.zeros",
"torch.cat"
] | [((437, 471), 'nms.nms_pytorch.nms', 'nms_op', (['detections', 'scores', 'thresh'], {}), '(detections, scores, thresh)\n', (443, 471), True, 'from nms.nms_pytorch import nms as nms_op\n'), ((858, 873), 'utils.BBoxTransform', 'BBoxTransform', ([], {}), '()\n', (871, 873), False, 'from utils import BBoxTransform, ClipBox... |
import os
from copy import deepcopy
import torch
import torch.nn as nn
from lottery.WinningTicket import WinningTicket
from lottery.checkpointing.formats import CheckpointFormats
from lottery.pruning import Strategy
from lottery.pruning.LayerPercentile import GlobalPercentilePruningStrategy
from lottery.training impo... | [
"torch.quantization.prepare_qat",
"os.getcwd",
"copy.deepcopy",
"lottery.pruning.LayerPercentile.GlobalPercentilePruningStrategy",
"torch.quantization.get_default_qat_qconfig"
] | [((618, 651), 'lottery.pruning.LayerPercentile.GlobalPercentilePruningStrategy', 'GlobalPercentilePruningStrategy', ([], {}), '()\n', (649, 651), False, 'from lottery.pruning.LayerPercentile import GlobalPercentilePruningStrategy\n'), ((994, 1009), 'copy.deepcopy', 'deepcopy', (['model'], {}), '(model)\n', (1002, 1009)... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from nomadgram.users import models as user_models
@python_2_unicode_compatible
class TimeStampedModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ImageField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((227, 266), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (247, 266), False, 'from django.db import models\n'), ((284, 319), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now': '(True)'}), '(auto_now=True)\n', (304, 319), F... |
"""Generate synthetic data in LIBSVM format."""
import argparse
import io
import time
import numpy as np
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
RNG = np.random.RandomState(2019)
def generate_data(args):
"""Generates the data."""
print("Generati... | [
"argparse.ArgumentParser",
"sklearn.model_selection.train_test_split",
"io.StringIO",
"time.time",
"numpy.random.RandomState",
"sklearn.datasets.make_classification"
] | [((216, 243), 'numpy.random.RandomState', 'np.random.RandomState', (['(2019)'], {}), '(2019)\n', (237, 243), True, 'import numpy as np\n'), ((526, 537), 'time.time', 'time.time', ([], {}), '()\n', (535, 537), False, 'import time\n'), ((846, 1030), 'sklearn.datasets.make_classification', 'make_classification', ([], {'n_... |
import rlp
from rlp.sedes import CountableList, text # big_endian_int
from kademlia.utils import digest
from utils import get_sender
import json
import logging
from exceptions import InvalidTransaction
import Globals
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
tx_fields = ('sender_pk',... | [
"logging.basicConfig",
"logging.getLogger",
"json.loads",
"json.dumps",
"Globals.account.verify_sig_msg",
"utils.get_sender",
"kademlia.utils.digest",
"rlp.sedes.CountableList"
] | [((219, 259), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (238, 259), False, 'import logging\n'), ((266, 293), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (283, 293), False, 'import logging\n'), ((2776, 2793), 'json.loads',... |
#!/usr/bin/env python
# Copyright (c) 2002-2009 ActiveState Software Inc.
# License: MIT (see LICENSE.txt for license details)
# Author: <NAME>
"""An improvement on Python's standard cmd.py module.
As with cmd.py, this module provides "a simple framework for writing
line-oriented command intepreters." This module p... | [
"readline.set_completer",
"os.path.exists",
"sys.path.insert",
"readline.parse_and_bind",
"optparse.OptParseError",
"re.compile",
"imp.load_module",
"sys.exc_info",
"os.path.dirname",
"sys.path.remove",
"os.path.basename",
"readline.get_completer",
"warnings.warn",
"datetime.date.today",
... | [((1879, 1956), 're.compile', 're.compile', (['"""(takes [\\\\w ]+ )(\\\\d+)[\\\\w ]*( arguments? \\\\()(\\\\d+)( given\\\\))"""'], {}), "('(takes [\\\\w ]+ )(\\\\d+)[\\\\w ]*( arguments? \\\\()(\\\\d+)( given\\\\))')\n", (1889, 1956), False, 'import re\n'), ((15232, 15246), 'sys.exc_info', 'sys.exc_info', ([], {}), '(... |
#!/usr/bin/env python
#
#===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===---------... | [
"collections.namedtuple",
"argparse.ArgumentParser",
"subprocess.check_call",
"subprocess.Popen",
"os.environ.get",
"os.path.join",
"os.chdir",
"os.remove",
"os.path.dirname",
"os.path.basename",
"sys.exit",
"os.stat",
"re.search"
] | [((2344, 2391), 'collections.namedtuple', 'collections.namedtuple', (['"""Range"""', '"""start, count"""'], {}), "('Range', 'start, count')\n", (2366, 2391), False, 'import collections\n'), ((3236, 3349), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': 'usage', 'formatter_class': 'argparse.RawDescr... |
#!/usr/bin/env python
"""Working with nested data hands-on exercise / coding challenge."""
import json
import os
import pprint
# Get the absolute path for the directory where this file is located "here"
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "interfaces.json")) as file:
... | [
"os.path.dirname",
"json.loads",
"os.path.join",
"pprint.pprint"
] | [((230, 255), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (245, 255), False, 'import os\n'), ((497, 518), 'json.loads', 'json.loads', (['json_text'], {}), '(json_text)\n', (507, 518), False, 'import json\n'), ((615, 639), 'pprint.pprint', 'pprint.pprint', (['json_data'], {}), '(json_data)\... |
"""
This file contains specific functions for computing losses of FCOS
file
"""
import torch
from torch import nn
from torch.nn import functional as F
from maskrcnn_benchmark.layers import IOULoss
from maskrcnn_benchmark.layers import SigmoidFocalLoss
from maskrcnn_benchmark.utils.comm import reduce_sum, get_world_si... | [
"maskrcnn_benchmark.layers.SigmoidFocalLoss",
"torch.split",
"torch.stack",
"torch.sqrt",
"maskrcnn_benchmark.utils.comm.get_world_size",
"torch.nn.functional.smooth_l1_loss",
"torch.nonzero",
"maskrcnn_benchmark.utils.comm.reduce_sum",
"torch.nn.BCEWithLogitsLoss",
"maskrcnn_benchmark.layers.IOUL... | [((547, 617), 'maskrcnn_benchmark.layers.SigmoidFocalLoss', 'SigmoidFocalLoss', (['cfg.MODEL.FCOS.LOSS_GAMMA', 'cfg.MODEL.FCOS.LOSS_ALPHA'], {}), '(cfg.MODEL.FCOS.LOSS_GAMMA, cfg.MODEL.FCOS.LOSS_ALPHA)\n', (563, 617), False, 'from maskrcnn_benchmark.layers import SigmoidFocalLoss\n'), ((1041, 1068), 'maskrcnn_benchmark... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"numpy.product",
"numpy.array",
"paddle.fluid.Executor",
"six.moves.xrange",
"paddle.grad",
"paddle.disable_static",
"numpy.random.random",
"paddle.fluid.default_startup_program",
"paddle.ones",
"paddle.enable_static",
"paddle.fluid.default_main_program",
"paddle.fluid.executor.global_scope",
... | [((4190, 4201), 'paddle.fluid.backward._as_list', '_as_list', (['y'], {}), '(y)\n', (4198, 4201), False, 'from paddle.fluid.backward import _append_grad_suffix_, _as_list\n'), ((4212, 4233), 'paddle.fluid.Executor', 'fluid.Executor', (['place'], {}), '(place)\n', (4226, 4233), True, 'import paddle.fluid as fluid\n'), (... |
# Copyright 2018-2019 The glTF-Blender-IO authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"io_scene_gltf2.io.com.gltf2_io_constants.ComponentType.to_type_code",
"array.array"
] | [((1207, 1273), 'io_scene_gltf2.io.com.gltf2_io_constants.ComponentType.to_type_code', 'gltf2_io_constants.ComponentType.to_type_code', (['gltf_component_type'], {}), '(gltf_component_type)\n', (1252, 1273), False, 'from io_scene_gltf2.io.com import gltf2_io_constants\n'), ((1300, 1329), 'array.array', 'array.array', (... |
import pyperclip
class User:
"""initiaizesan instance of a user"""
user_list = []
def __init__(self, first_name, last_name, email, Id):
self.first_name = first_name
self.last_name = last_name
self.email = email
self.Id = Id
def save_user(self):
print("su works")... | [
"pyperclip.copy"
] | [((801, 833), 'pyperclip.copy', 'pyperclip.copy', (['user_found.email'], {}), '(user_found.email)\n', (815, 833), False, 'import pyperclip\n')] |
"""
Contains tests for pycinga.response.PerfData
"""
import pytest
from pycinga.perf_data import PerfData
from pycinga.range import Range
class TestPerfData(object):
def test_exception_if_value_invalid(self):
"""
Tests to verify that an exception is raised if value
is an invalid format.... | [
"pycinga.range.Range",
"pycinga.perf_data.PerfData",
"pytest.raises"
] | [((2236, 2270), 'pycinga.perf_data.PerfData', 'PerfData', (['"""foo"""', '"""7"""'], {'warn': '"""10:20"""'}), "('foo', '7', warn='10:20')\n", (2244, 2270), False, 'from pycinga.perf_data import PerfData\n'), ((2593, 2627), 'pycinga.perf_data.PerfData', 'PerfData', (['"""foo"""', '"""7"""'], {'crit': '"""10:20"""'}), "... |
import unittest
from parameterized import parameterized
from poc.util.fplutil import Utils
from poc.fplsourcetransformer import FPLSourceTransformer
from tatsu.exceptions import FailedToken
from tatsu.exceptions import FailedParse
from tatsu.exceptions import FailedPattern
import os
"""
Tests of FPL related (parser) e... | [
"poc.fplsourcetransformer.FPLSourceTransformer",
"parameterized.parameterized.expand",
"os.path.join",
"poc.util.fplutil.Utils",
"os.path.isfile",
"os.path.dirname",
"os.path.abspath"
] | [((1179, 1269), 'parameterized.parameterized.expand', 'parameterized.expand', (["['test_syntax_proofs_ok_01.fpl', 'test_syntax_proofs_ok_02.fpl']"], {}), "(['test_syntax_proofs_ok_01.fpl',\n 'test_syntax_proofs_ok_02.fpl'])\n", (1199, 1269), False, 'from parameterized import parameterized\n'), ((788, 812), 'os.path.... |
# -*- coding: utf-8 -*-
import pickle
from os import path, mkdir
from typing import List, Tuple, Dict
import cv2 as cv
DATA_DIR_NAME = '.data'
APP_SETTINGS_FILE_NAME: str = 'settings'
MAX_RECENT_FILES: int = 10
TOOLBAR_ICON_SIZE = 32
IMAGE_EXTENSIONS: Tuple[str, ...] = (
".jpg",
".jpeg",
... | [
"os.path.exists",
"pickle.dump",
"os.path.join",
"pickle.load",
"os.path.isdir",
"os.mkdir",
"os.path.abspath"
] | [((693, 726), 'os.path.join', 'path.join', (['currDir', 'DATA_DIR_NAME'], {}), '(currDir, DATA_DIR_NAME)\n', (702, 726), False, 'from os import path, mkdir\n'), ((832, 875), 'os.path.join', 'path.join', (['rootPath', 'APP_SETTINGS_FILE_NAME'], {}), '(rootPath, APP_SETTINGS_FILE_NAME)\n', (841, 875), False, 'from os imp... |
import logging
from io import BytesIO
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
import pandas as pd
from shapely.geometry import LineString
from shapely.geometry.base import BaseGeometry
from ...core.mixins import GeoDBMixin
from ...core.structure import Route
__github_url = "htt... | [
"pandas.read_pickle",
"io.BytesIO",
"logging.info",
"pandas.read_csv"
] | [((3257, 3275), 'io.BytesIO', 'BytesIO', (['c.content'], {}), '(c.content)\n', (3264, 3275), False, 'from io import BytesIO\n'), ((3297, 3333), 'pandas.read_csv', 'pd.read_csv', (['b'], {'sep': '""" """', 'header': 'None'}), "(b, sep=' ', header=None)\n", (3308, 3333), True, 'import pandas as pd\n'), ((3793, 3833), 'lo... |
'''
Create the reduced dataset - if a file exists in the obfuscated folder,
copy the original file (not obfuscated) to the target folder
'''
import os
from shutil import copyfile
source_folder = '' # original folder of java files
target_folder = '' # where do we want them to be copied to
obfuscated_folder = '' # th... | [
"os.path.exists",
"os.listdir",
"os.path.join",
"shutil.copyfile",
"os.path.isdir",
"os.mkdir"
] | [((402, 439), 'os.path.join', 'os.path.join', (['source_folder', 'dir_name'], {}), '(source_folder, dir_name)\n', (414, 439), False, 'import os\n'), ((454, 473), 'os.listdir', 'os.listdir', (['src_dir'], {}), '(src_dir)\n', (464, 473), False, 'import os\n'), ((1114, 1147), 'os.path.join', 'os.path.join', (['source_fold... |
import glob
import numpy as np
import os
import random
import tensorflow as tf
import tqdm
import csv
def load_dataset(enc, path, combine):
paths = []
if os.path.isfile(path):
# Simple file
paths.append(path)
elif os.path.isdir(path):
# Directory
for (dirpath, _, fnames) in... | [
"tqdm.tqdm",
"os.walk",
"os.path.join",
"os.path.isfile",
"os.path.isdir",
"numpy.load",
"csv.reader",
"random.randint",
"glob.glob"
] | [((164, 184), 'os.path.isfile', 'os.path.isfile', (['path'], {}), '(path)\n', (178, 184), False, 'import os\n'), ((549, 565), 'tqdm.tqdm', 'tqdm.tqdm', (['paths'], {}), '(paths)\n', (558, 565), False, 'import tqdm\n'), ((244, 263), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (257, 263), False, 'import... |
import json
import os
from contextlib import ExitStack
from collections import defaultdict
os.makedirs("workdata/icc", exist_ok=True)
files = defaultdict(dict)
with open("workdata/clausified.json", "r") as f:
with ExitStack() as stack:
for ds in ["eca", "emotion-stimulus", "reman", "gne", "electoral_tweet... | [
"contextlib.ExitStack",
"json.loads",
"collections.defaultdict",
"os.makedirs"
] | [((92, 134), 'os.makedirs', 'os.makedirs', (['"""workdata/icc"""'], {'exist_ok': '(True)'}), "('workdata/icc', exist_ok=True)\n", (103, 134), False, 'import os\n'), ((143, 160), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (154, 160), False, 'from collections import defaultdict\n'), ((220, 231)... |
#!/usr/bin/python
import os
from hapclient.client import HapClient
import json
import logging as log
import sys
def read_json_file(file):
with open(file) as fd:
try:
content = json.load(fd)
except json.decoder.JSONDecodeError as e:
content = {}
return content
def write_... | [
"hapclient.client.HapClient.discover",
"logging.warn",
"json.load",
"logging.info",
"logging.error",
"json.dump",
"hapclient.client.HapClient"
] | [((420, 447), 'json.dump', 'json.dump', (['pairing_data', 'fd'], {}), '(pairing_data, fd)\n', (429, 447), False, 'import json\n'), ((1504, 1571), 'hapclient.client.HapClient', 'HapClient', ([], {'device_id': "config['device_id']", 'pairing_data': 'pairing_data'}), "(device_id=config['device_id'], pairing_data=pairing_d... |
# -------------------------------------------------------------------#
# Written by <NAME>
# Contact: <EMAIL>
# Copyright 2016, <NAME>
# -------------------------------------------------------------------#
import tensorflow as tf
from .reader import Reader
from ..core import logger as log
balanced_sample = tf.contrib.... | [
"tensorflow.train.queue_runner.QueueRunner",
"tensorflow.name_scope",
"tensorflow.reshape",
"tensorflow.PaddingFIFOQueue",
"tensorflow.cast",
"tensorflow.train.batch_join"
] | [((7976, 8075), 'tensorflow.PaddingFIFOQueue', 'tf.PaddingFIFOQueue', (['capacity'], {'dtypes': 'dtypes', 'shapes': 'shapes', 'names': 'names', 'name': '"""prefetch_queue"""'}), "(capacity, dtypes=dtypes, shapes=shapes, names=names,\n name='prefetch_queue')\n", (7995, 8075), True, 'import tensorflow as tf\n'), ((583... |
# Copyright 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 required by applicable law or a... | [
"apache_beam.metrics.Metrics.counter"
] | [((1189, 1221), 'apache_beam.metrics.Metrics.counter', 'Metrics.counter', (['namespace', 'name'], {}), '(namespace, name)\n', (1204, 1221), False, 'from apache_beam.metrics import Metrics\n')] |
# coding=utf-8
# Copyright 2020 The Mesh TensorFlow 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 applicab... | [
"numpy.prod",
"mesh_tensorflow.Mesh",
"numpy.log",
"mesh_tensorflow.VariableDType",
"mesh_tensorflow.Dimension",
"numpy.array",
"tensorflow.compat.v1.global_variables_initializer",
"mesh_tensorflow.Shape",
"numpy.tanh",
"mesh_tensorflow.transformer.vocab_embeddings.MixtureOfSoftmaxes",
"mesh_ten... | [((17888, 17902), 'tensorflow.compat.v1.test.main', 'tf.test.main', ([], {}), '()\n', (17900, 17902), True, 'import tensorflow.compat.v1 as tf\n'), ((1531, 1542), 'mesh_tensorflow.Graph', 'mtf.Graph', ([], {}), '()\n', (1540, 1542), True, 'import mesh_tensorflow as mtf\n'), ((1559, 1591), 'mesh_tensorflow.Mesh', 'mtf.M... |
from flask import Flask, redirect, render_template, request, url_for
import os
import sys
from helpers import *
from twython import Twython
from auth import (
consumer_key,
consumer_secret,
access_token,
access_token_secret
)
twitter = Twython(
consumer_key,
consumer_secret,
access_token,
... | [
"flask.render_template",
"flask.request.form.get",
"twython.Twython",
"flask.Flask"
] | [((254, 327), 'twython.Twython', 'Twython', (['consumer_key', 'consumer_secret', 'access_token', 'access_token_secret'], {}), '(consumer_key, consumer_secret, access_token, access_token_secret)\n', (261, 327), False, 'from twython import Twython\n'), ((353, 368), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\... |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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
#
# ... | [
"logging.getLogger",
"collections.namedtuple",
"logging.debug",
"re.compile",
"devlib.utils.misc.ranges_to_list",
"logging.info",
"json.dump",
"re.search"
] | [((819, 879), 'collections.namedtuple', 'namedtuple', (['"""Phase"""', '"""duration_s, period_ms, duty_cycle_pct"""'], {}), "('Phase', 'duration_s, period_ms, duty_cycle_pct')\n", (829, 879), False, 'from collections import namedtuple\n'), ((1352, 1378), 'logging.getLogger', 'logging.getLogger', (['"""rtapp"""'], {}), ... |
import asyncio
import sys
import unittest
import nest_asyncio
def exception_handler(loop, context):
print('Exception:', context)
class NestTest(unittest.TestCase):
def setUp(self):
self.loop = asyncio.new_event_loop()
nest_asyncio.apply(self.loop)
asyncio.set_event_loop(self.loop)
... | [
"unittest.skipIf",
"asyncio.new_event_loop",
"asyncio.wait",
"contextvars.ContextVar",
"asyncio._get_running_loop",
"asyncio.sleep",
"unittest.main",
"asyncio.set_event_loop",
"nest_asyncio.apply"
] | [((2460, 2530), 'unittest.skipIf', 'unittest.skipIf', (['(sys.version_info < (3, 7, 0))', '"""No contextvars module"""'], {}), "(sys.version_info < (3, 7, 0), 'No contextvars module')\n", (2475, 2530), False, 'import unittest\n'), ((2958, 2973), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2971, 2973), False, '... |
#!/usr/bin/env python
'''
This script will be used to analyze the storage accounts in the Azure subscription
'''
import json
import jmespath
def main():
'''
Main function gets called if this script is executed from the command line
'''
print(__file__)
def getStorageAccountNamefromDi... | [
"jmespath.search"
] | [((528, 625), 'jmespath.search', 'jmespath.search', (["('subscriptions[0].' + resourceType + '.virtualMachines')", 'standardardizedJson'], {}), "('subscriptions[0].' + resourceType + '.virtualMachines',\n standardardizedJson)\n", (543, 625), False, 'import jmespath\n'), ((3065, 3125), 'jmespath.search', 'jmespath.se... |
from __future__ import print_function
import os
import sys
import cv2
import random
import datetime
import time
import math
import argparse
import numpy as np
import torch
try:
from iou import IOU
except BaseException:
# IOU cython speedup 10x
def IOU(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2):
sa = a... | [
"torch.log",
"numpy.minimum",
"numpy.where",
"torch.exp",
"math.log",
"numpy.maximum",
"torch.cat",
"math.exp"
] | [((2754, 2782), 'torch.cat', 'torch.cat', (['[g_cxcy, g_wh]', '(1)'], {}), '([g_cxcy, g_wh], 1)\n', (2763, 2782), False, 'import torch\n'), ((821, 839), 'math.log', 'math.log', (['(ww / aww)'], {}), '(ww / aww)\n', (829, 839), False, 'import math\n'), ((841, 859), 'math.log', 'math.log', (['(hh / ahh)'], {}), '(hh / ah... |
#_*_coding:utf-8_*_
import socket
import os
import sys
import optparse
import json
import hashlib
STATUS_CODE = {
250:"Invalid cmd format, e.g:{'action':'get','filename':'test.py','size':344}",
251:"Invalid cmd",
252:"Invalid auth data",
253:"Wrong username or password",
254:"Passed authentication... | [
"hashlib.md5",
"json.dumps",
"optparse.OptionParser",
"socket.socket"
] | [((574, 597), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (595, 597), False, 'import optparse\n'), ((1127, 1142), 'socket.socket', 'socket.socket', ([], {}), '()\n', (1140, 1142), False, 'import socket\n'), ((5155, 5168), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (5166, 5168), False, 'impo... |
import streamlit as st
import base64
import util
st.spinner('Loading saved artifacts')
util.load_saved_artifacts()
ronaldo_jpg = "<NAME>.jpg"
messi_jpg = "<NAME>.jpg"
salah_jpg = "<NAME>.jpg"
neymar_jpg = "<NAME>r.jpg"
son_jpg = "<NAME>.jpg"
mane_jpg = "<NAME>.jpg"
ext = "jpg"
st.title('Football P... | [
"streamlit.markdown",
"util.load_saved_artifacts",
"streamlit.image",
"streamlit.file_uploader",
"streamlit.button",
"streamlit.spinner",
"util.classify_images",
"streamlit.text_area",
"streamlit.header",
"streamlit.title"
] | [((56, 93), 'streamlit.spinner', 'st.spinner', (['"""Loading saved artifacts"""'], {}), "('Loading saved artifacts')\n", (66, 93), True, 'import streamlit as st\n'), ((95, 122), 'util.load_saved_artifacts', 'util.load_saved_artifacts', ([], {}), '()\n', (120, 122), False, 'import util\n'), ((300, 338), 'streamlit.title... |
import torch
from torch import nn
__version__ = '0.1.0'
__all__ = ['DistanceBasis']
class DistanceBasis(nn.Module):
r"""Expands distances in distance feature basis.
Maps distances, *d*, to distance features, :math:`\mathbf e(d)`.
Args:
dist_feat_dim (int): :math:`\dim(\mathbf e)`, number of fea... | [
"torch.exp",
"torch.linspace"
] | [((854, 901), 'torch.linspace', 'torch.linspace', (['delta', '(1 - delta)', 'dist_feat_dim'], {}), '(delta, 1 - delta, dist_feat_dim)\n', (868, 901), False, 'import torch\n'), ((1767, 1832), 'torch.exp', 'torch.exp', (['(-(dists[..., None] - self.mus) ** 2 / self.sigmas ** 2)'], {}), '(-(dists[..., None] - self.mus) **... |
import json
import functools
from django.conf import settings
from django.test import Client, TestCase
__all__ = ['JsonTestClient', 'JsonTestMixin', 'JsonTestCase']
class JsonTestClient(Client):
def _json_request(self, method, url, data=None, *args, **kwargs):
method_func = getattr(super(JsonTestClient,... | [
"functools.partial"
] | [((1091, 1134), 'functools.partial', 'functools.partial', (['self._json_request', 'attr'], {}), '(self._json_request, attr)\n', (1108, 1134), False, 'import functools\n')] |
from medium.powlib import pluralize
import datetime
from cerberus import Validator
import xmltodict
import simplejson as json
import datetime, decimal
from medium.config import myapp
from medium.powlib import merge_two_dicts
from medium.encoders import pow_json_serializer
from medium.decoders import pow_json_deserializ... | [
"csv.DictReader",
"inspect.getmembers",
"xmltodict.parse",
"medium.powlib.merge_two_dicts",
"datetime.datetime.utcnow",
"medium.decoders.pow_init_from_dict_deserializer",
"pprint.pformat",
"simplejson.load",
"cerberus.Validator",
"simplejson.loads"
] | [((3547, 3645), 'medium.decoders.pow_init_from_dict_deserializer', 'pow_init_from_dict_deserializer', (['d', 'self.schema'], {'simple_conversion': "myapp['simple_conversion']"}), "(d, self.schema, simple_conversion=myapp[\n 'simple_conversion'])\n", (3578, 3645), False, 'from medium.decoders import pow_init_from_dic... |
from django.db import models
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length = 100)
email = models.EmailField()
message = models.TextField()
timestamp = models.DateTimeField(auto_now_add = True)
def __str__(self):
return self.name | [
"django.db.models.DateTimeField",
"django.db.models.EmailField",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((94, 126), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (110, 126), False, 'from django.db import models\n'), ((138, 157), 'django.db.models.EmailField', 'models.EmailField', ([], {}), '()\n', (155, 157), False, 'from django.db import models\n'), ((169, 187), ... |
def setup_fs(s3, key="", secret="", endpoint="", cert="", passwords={}):
"""Given a boolean specifying whether to use local disk or S3, setup filesystem
Syntax examples: AWS (http://s3.us-east-2.amazonaws.com), MinIO (http://192.168.0.1:9000)
The cert input is relevant if you're using MinIO with TLS enabled... | [
"pandas.merge_ordered",
"pathlib.Path",
"s3fs.S3FileSystem",
"mdf_iter.MdfFile",
"pandas.Timedelta",
"can_decoder.DataFrameDecoder",
"datetime.datetime.now",
"datetime.datetime.today",
"canedge_browser.get_log_files",
"canedge_browser.LocalFileSystem",
"pandas.DataFrame",
"datetime.timedelta",... | [((2617, 2648), 'pandas.DataFrame', 'pd.DataFrame', (["{'TimeStamp': []}"], {}), "({'TimeStamp': []})\n", (2629, 2648), True, 'import pandas as pd\n'), ((1308, 1381), 'canedge_browser.LocalFileSystem', 'canedge_browser.LocalFileSystem', ([], {'base_path': 'base_path', 'passwords': 'passwords'}), '(base_path=base_path, ... |
import py
from rpython.rlib.signature import signature, finishsigs, FieldSpec, ClassSpec
from rpython.rlib import types
from rpython.annotator import model
from rpython.rtyper.llannotation import SomePtr
from rpython.annotator.signature import SignatureError
from rpython.translator.translator import TranslationContext,... | [
"rpython.rtyper.annlowlevel.LowLevelAnnotatorPolicy",
"rpython.rtyper.lltypesystem.rstr.mallocstr",
"rpython.rlib.types.str0",
"rpython.rlib.types.any",
"rpython.rlib.types.longfloat",
"rpython.annotator.model.SomeChar",
"rpython.translator.translator.TranslationContext",
"rpython.rlib.types.char",
... | [((480, 500), 'rpython.translator.translator.TranslationContext', 'TranslationContext', ([], {}), '()\n', (498, 500), False, 'from rpython.translator.translator import TranslationContext, graphof\n'), ((765, 789), 'rpython.translator.translator.graphof', 'graphof', (['a.translator', 'f'], {}), '(a.translator, f)\n', (7... |
import copy
from functools import wraps, reduce
import socket
import os
from operator import mul
import sys
from statistics import mean
import time
import numpy as np
from rdkit.Chem import AllChem, RWMol
from rdkit import Chem
from rdkit.Chem.rdChemReactions import ChemicalReaction
from kgcn.data_util import dense_t... | [
"rdkit.Chem.AllChem.GetMorganFingerprintAsBitVect",
"numpy.argsort",
"numpy.array",
"rdkit.Chem.GetSymmSSSR",
"sys.exit",
"rdkit.Chem.MolFromSmarts",
"kgcn.data_util.dense_to_sparse",
"rdkit.Chem.AllChem.ReactionToSmarts",
"numpy.asarray",
"rdkit.Chem.MolToSmiles",
"functools.wraps",
"rdkit.Ch... | [((12876, 12887), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (12881, 12887), False, 'from functools import wraps, reduce\n'), ((1238, 1257), 'numpy.zeros', 'np.zeros', (['label_dim'], {}), '(label_dim)\n', (1246, 1257), True, 'import numpy as np\n'), ((1279, 1304), 'numpy.zeros_like', 'np.zeros_like', (['l... |
#!/usr/bin/env python
# Update current senator's website and address from www.senate.gov.
import lxml.etree, io
import string, re
from datetime import datetime
import utils
from utils import download, load_data, save_data, parse_date
def run():
today = datetime.now().date()
# default to not caching
cache = util... | [
"utils.load_data",
"utils.save_data",
"datetime.datetime.now",
"utils.download",
"re.sub",
"io.StringIO",
"utils.parse_date",
"utils.flags"
] | [((375, 412), 'utils.load_data', 'load_data', (['"""legislators-current.yaml"""'], {}), "('legislators-current.yaml')\n", (384, 412), False, 'from utils import download, load_data, save_data, parse_date\n'), ((977, 1023), 'utils.download', 'download', (['url', '"""legislators/senate.xml"""', 'force'], {}), "(url, 'legi... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import inspect
import torch.nn as nn
from fairseq.legacy_distributed_data_parallel import LegacyDistributedDataParallel
_GOSSIP_DISABLED = ... | [
"inspect.getargspec"
] | [((1499, 1528), 'inspect.getargspec', 'inspect.getargspec', (['ddp_class'], {}), '(ddp_class)\n', (1517, 1528), False, 'import inspect\n'), ((1622, 1651), 'inspect.getargspec', 'inspect.getargspec', (['ddp_class'], {}), '(ddp_class)\n', (1640, 1651), False, 'import inspect\n')] |
#!/usr/bin/python2.7
"""
Copyright (C) 2014 Reinventing Geospatial, Inc.
This program 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.
This ... | [
"scripts.geopackage.extensions.vector_tiles.vector_fields.geopackage_vector_fields.GeoPackageVectorFields.get_vector_field_entry_by_values",
"mapbox_vector_tile.decode",
"scripts.geopackage.extensions.vector_tiles.vector_layers.vector_layers_entry.VectorLayersEntry",
"scripts.geopackage.extensions.vector_tile... | [((3800, 3836), 'mapbox_vector_tile.decode', 'mapbox_vector_tile.decode', (['tile_data'], {}), '(tile_data)\n', (3825, 3836), False, 'import mapbox_vector_tile\n'), ((7171, 7273), 'scripts.geopackage.tiles.geopackage_abstract_tiles.GeoPackageAbstractTiles.create_pyramid_user_data_table', 'GeoPackageAbstractTiles.create... |
import asyncio
import collections
import hashlib
import json
import os
import sys
import time
from collections import OrderedDict
from datetime import datetime
from functools import reduce
from pathlib import Path
from urllib.parse import quote_plus
import aiohttp
import nexussdk as nxs
import pandas as pd
import prog... | [
"datetime.datetime.utcfromtimestamp",
"nexussdk.config.set_environment",
"pandas.read_csv",
"pathlib.Path.home",
"asyncio.Semaphore",
"sys.exit",
"urllib.parse.quote_plus",
"pygments.lexers.JsonLdLexer",
"os.path.exists",
"json.dumps",
"pygments.formatters.TerminalFormatter",
"asyncio.gather",... | [((674, 687), 'sys.exit', 'sys.exit', (['(101)'], {}), '(101)\n', (682, 687), False, 'import sys\n'), ((1010, 1036), 'json.dumps', 'json.dumps', (['data'], {'indent': '(2)'}), '(data, indent=2)\n', (1020, 1036), False, 'import json\n'), ((1270, 1281), 'time.time', 'time.time', ([], {}), '()\n', (1279, 1281), False, 'im... |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"services.datacommons.fetch_data",
"lib.range.aggregate_stat_var",
"json.dumps",
"logging.info",
"flask.url_for",
"collections.defaultdict",
"copy.deepcopy",
"routes.api.place.get_i18n_name",
"flask_babel.gettext",
"flask.Blueprint",
"cache.cache.cached",
"lib.range.get_aggregate_config"
] | [((1087, 1157), 'flask.Blueprint', 'Blueprint', (['"""api.landing_page"""', '__name__'], {'url_prefix': '"""/api/landingpage"""'}), "('api.landing_page', __name__, url_prefix='/api/landingpage')\n", (1096, 1157), False, 'from flask import Blueprint, current_app, Response, url_for, g\n'), ((13136, 13186), 'cache.cache.c... |
import json
import os
import re
from xml.etree import ElementTree as element_tree
import lxml.etree as etree
from flask import current_app as app
from query.QueryFilters import QueryFilters
from query.Query import Query
from query.QueryDefinitions import QueryDefinitions
from query.QueryDefintion import QueryDefini... | [
"lxml.etree.XSLT",
"query.Timerange.Timerange",
"query.Query.Query",
"flask.current_app.app_context",
"flask.current_app.config.get",
"lxml.etree.tostring",
"os.path.exists",
"xml.etree.ElementTree.parse",
"query.QueryLine.QueryLine",
"query.QueryFilter.QueryFilter",
"query.QueryFilters.QueryFil... | [((1032, 1121), 'query.Timerange.Timerange', 'Timerange', ([], {'start': "query_old['start_year']", 'end': "query_old['end_year']", 'field': '"""PUBYEAR"""'}), "(start=query_old['start_year'], end=query_old['end_year'], field=\n 'PUBYEAR')\n", (1041, 1121), False, 'from query.Timerange import Timerange\n'), ((1137, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Version command group"""
import logging
import typing as t
import click
from prettytable import PrettyTable
from foremanlite.cli.cli import Config, config_to_click
from foremanlite.cli.config import MachineConfig
from foremanlite.logging import get as get_logger
from ... | [
"prettytable.PrettyTable",
"logging.getLogger",
"foremanlite.logging.get",
"foremanlite.machine.get_uuid",
"click.group",
"foremanlite.machine.Machine",
"foremanlite.machine.Arch",
"click.echo",
"foremanlite.serve.context.ServeContext.get_store",
"foremanlite.machine.Mac",
"foremanlite.serve.con... | [((5152, 5165), 'click.group', 'click.group', ([], {}), '()\n', (5163, 5165), False, 'import click\n'), ((5840, 5870), 'foremanlite.cli.cli.config_to_click', 'config_to_click', (['MachineConfig'], {}), '(MachineConfig)\n', (5855, 5870), False, 'from foremanlite.cli.cli import Config, config_to_click\n'), ((6320, 6350),... |
from fastapi import FastAPI
from .database import engine
from fastapi.middleware.cors import CORSMiddleware
from .routers import Oauth, post, users, vote
# meta
# models.Base.metadata.create_all(bind=engine)
app = FastAPI()
origins = [
"*"
]
app.add_middleware(
CORSMiddleware,
allow_orig... | [
"fastapi.FastAPI"
] | [((224, 233), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (231, 233), False, 'from fastapi import FastAPI\n')] |
# TODO: Move this module as a shared functionality to badger utils lib
import logging
import requests
import traceback
from decimal import Decimal
from hexbytes import HexBytes
from typing import Dict
from web3 import contract
from web3 import exceptions
from web3 import Web3
from config.constants import GAS_LIMITS
f... | [
"logging.getLogger",
"requests.get",
"traceback.format_exc",
"hexbytes.HexBytes"
] | [((362, 389), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (379, 389), False, 'import logging\n'), ((5312, 5323), 'hexbytes.HexBytes', 'HexBytes', (['(0)'], {}), '(0)\n', (5320, 5323), False, 'from hexbytes import HexBytes\n'), ((4061, 4117), 'requests.get', 'requests.get', (['"""https:... |
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from classes.Future_Value import FutureValue
def test_future_value_regular():
test_a = FutureValue(10000000, 8.7, 5, 1, False)
assert round(test_a.calculate()) == 15175665.0, "Should be $15,175,665.0"
d... | [
"os.path.dirname",
"classes.Future_Value.FutureValue"
] | [((199, 238), 'classes.Future_Value.FutureValue', 'FutureValue', (['(10000000)', '(8.7)', '(5)', '(1)', '(False)'], {}), '(10000000, 8.7, 5, 1, False)\n', (210, 238), False, 'from classes.Future_Value import FutureValue\n'), ((366, 404), 'classes.Future_Value.FutureValue', 'FutureValue', (['(100000)', '(5)', '(7.25)', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Créé le 9 Nov 2018
@author: SachaWanono
'''
import random
import copy
import sys
import os
sys.path.insert(0, "/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-2])+"/")
from src.constants import Const
from src.project import *
from src.ScoringTools.ca... | [
"os.path.abspath",
"random.random",
"src.ScoringTools.calculScore.typeUtilUsed",
"copy.deepcopy"
] | [((3810, 3836), 'copy.deepcopy', 'copy.deepcopy', (['listWeights'], {}), '(listWeights)\n', (3823, 3836), False, 'import copy\n'), ((4671, 4697), 'copy.deepcopy', 'copy.deepcopy', (['listWeights'], {}), '(listWeights)\n', (4684, 4697), False, 'import copy\n'), ((3914, 3929), 'random.random', 'random.random', ([], {}), ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 21 03:50:22 2020
@author: Abdelrahman
"""
#import numpy as np
import cv2
highThresh = 0.4
lowThresh = 0.1
def sobel (img):
'''
Detects edges using sobel kernel
'''
opImgx = cv2.Sobel(img,cv2.CV_8U,0,1,ksize=3) #detects horizontal edges
opImgy = ... | [
"cv2.imwrite",
"cv2.addWeighted",
"cv2.destroyAllWindows",
"cv2.bitwise_or",
"cv2.GaussianBlur",
"cv2.waitKey",
"cv2.Sobel",
"cv2.imread"
] | [((1132, 1145), 'cv2.waitKey', 'cv2.waitKey', ([], {}), '()\n', (1143, 1145), False, 'import cv2\n'), ((1147, 1170), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1168, 1170), False, 'import cv2\n'), ((245, 285), 'cv2.Sobel', 'cv2.Sobel', (['img', 'cv2.CV_8U', '(0)', '(1)'], {'ksize': '(3)'}), '(... |
import pygame, sys, random
from pygame.locals import*
pygame.init()
pygame.display.set_caption("rain")
screen=pygame.display.set_mode((1000,600))
clock=pygame.time.Clock()
raindrop_spawn_time=0
camerlyn_default=pygame.image.load("./img/Camerlyn_umbrella.png").convert()
camerlyn_right=pygame.image.load("./img/Camerlyn... | [
"pygame.display.set_caption",
"sys.exit",
"pygame.init",
"pygame.draw.line",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.Rect",
"pygame.key.get_pressed",
"pygame.time.Clock",
"pygame.image.load",
"pygame.display.update",
"random.randint"
] | [((56, 69), 'pygame.init', 'pygame.init', ([], {}), '()\n', (67, 69), False, 'import pygame, sys, random\n'), ((70, 104), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""rain"""'], {}), "('rain')\n", (96, 104), False, 'import pygame, sys, random\n'), ((112, 148), 'pygame.display.set_mode', 'pygame.dis... |
"""
Support for IKEA Tradfri.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ikea_tradfri/
"""
import logging
import voluptuous as vol
from homeassistant import config_entries
import homeassistant.helpers.config_validation as cv
from homeassistant.uti... | [
"logging.getLogger",
"voluptuous.Inclusive",
"pytradfri.api.aiocoap_api.APIFactory",
"pytradfri.Gateway",
"voluptuous.Optional"
] | [((1024, 1051), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1041, 1051), False, 'import logging\n'), ((2169, 2283), 'pytradfri.api.aiocoap_api.APIFactory', 'APIFactory', (['entry.data[CONF_HOST]'], {'psk_id': 'entry.data[CONF_IDENTITY]', 'psk': 'entry.data[CONF_KEY]', 'loop': 'hass.lo... |
import pytest
from django.urls import reverse
from equipamentos.models import Equipamento
from categorias.models import Categoria
@pytest.fixture
def list_url():
return reverse('equipamento-list')
@pytest.fixture
def detail_url():
def get_url(equip_id):
return reverse('equipamento-detail', args=[eq... | [
"categorias.models.Categoria.objects.create",
"equipamentos.models.Equipamento.objects.create",
"django.urls.reverse"
] | [((176, 203), 'django.urls.reverse', 'reverse', (['"""equipamento-list"""'], {}), "('equipamento-list')\n", (183, 203), False, 'from django.urls import reverse\n'), ((408, 469), 'categorias.models.Categoria.objects.create', 'Categoria.objects.create', ([], {'name': '"""Test Cat"""', 'is_instrument': '(True)'}), "(name=... |
#!/bin/env python
"""Backup current RC files in the HOME directory."""
import os
from helpers import create_directory, copy_file, paths, mk_clither_custom_dirs, clean_dir
def main():
print('-' * 40)
print('Start mk_custom...')
create_directory(paths.custom_path)
copy_file(paths.clither_tmp_config, paths.cust... | [
"helpers.create_directory",
"helpers.copy_file"
] | [((236, 271), 'helpers.create_directory', 'create_directory', (['paths.custom_path'], {}), '(paths.custom_path)\n', (252, 271), False, 'from helpers import create_directory, copy_file, paths, mk_clither_custom_dirs, clean_dir\n'), ((274, 328), 'helpers.copy_file', 'copy_file', (['paths.clither_tmp_config', 'paths.custo... |
#!/usr/bin/env python
from datetime import datetime, timezone
from zmq.utils.jsonapi import dumps, loads
from dateutil.parser import parser
class State:
"""
The current known state of software versions.
"""
protocol_version = (0, 1)
def __init__(self):
self.software_versions = {}
de... | [
"datetime.datetime.now",
"zmq.utils.jsonapi.loads",
"zmq.utils.jsonapi.dumps",
"dateutil.parser.parser"
] | [((640, 652), 'zmq.utils.jsonapi.dumps', 'dumps', (['_dict'], {}), '(_dict)\n', (645, 652), False, 'from zmq.utils.jsonapi import dumps, loads\n'), ((811, 822), 'zmq.utils.jsonapi.loads', 'loads', (['json'], {}), '(json)\n', (816, 822), False, 'from zmq.utils.jsonapi import dumps, loads\n'), ((2038, 2064), 'datetime.da... |
import torch
import torchvision
import torchvision.transforms as transforms
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class conv2d_circular(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, bias=True, n... | [
"torch.nn.functional.pad",
"torch.nn.functional.conv2d"
] | [((717, 825), 'torch.nn.functional.pad', 'F.pad', (['input_ori', '(self.padding[0], self.padding[0], self.padding[0], self.padding[0])'], {'mode': '"""circular"""'}), "(input_ori, (self.padding[0], self.padding[0], self.padding[0], self.\n padding[0]), mode='circular')\n", (722, 825), True, 'import torch.nn.function... |
from datetime import date
from typing import Dict
from pyspark.sql import SparkSession, Column, DataFrame
# noinspection PyUnresolvedReferences
from pyspark.sql.functions import lit
from pyspark.sql.functions import coalesce, to_date
from spark_auto_mapper.automappers.automapper import AutoMapper
from spark_auto_mapp... | [
"pyspark.sql.functions.lit",
"spark_auto_mapper.automappers.automapper.AutoMapper",
"datetime.date",
"spark_auto_mapper.helpers.automapper_helpers.AutoMapperHelpers.date"
] | [((1759, 1775), 'datetime.date', 'date', (['(1970)', '(1)', '(1)'], {}), '(1970, 1, 1)\n', (1763, 1775), False, 'from datetime import date\n'), ((1865, 1881), 'datetime.date', 'date', (['(1970)', '(1)', '(1)'], {}), '(1970, 1, 1)\n', (1869, 1881), False, 'from datetime import date\n'), ((847, 945), 'spark_auto_mapper.a... |
from inout import input, output
import time
from sensor import boost
GO_FORWARD_STR = "go forward"
GO_BACK_STR = "go back"
TURN_RIGHT_STR = "turn right"
TURN_LEFT_STR = "turn left"
STOP_LEGO_STR = "stop lego"
class Robot:
def __init__(self, boost):
self.boost = boost
pass
def set_output(self,... | [
"time.sleep"
] | [((936, 951), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (946, 951), False, 'import time\n'), ((1026, 1041), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1036, 1041), False, 'import time\n'), ((1114, 1129), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1124, 1129), False, 'import tim... |
import unittest
import numpy as np
from rlcard.games.leducholdem.game import LeducholdemGame as Game
from rlcard.games.leducholdem.player import LeducholdemPlayer as Player
from rlcard.games.leducholdem.judger import LeducholdemJudger as Judger
from rlcard.core import Card
class TestLeducholdemMethods(unittest.TestCa... | [
"rlcard.core.Card",
"rlcard.games.leducholdem.player.LeducholdemPlayer",
"rlcard.games.leducholdem.judger.LeducholdemJudger.judge_game",
"rlcard.games.leducholdem.game.LeducholdemGame",
"unittest.main",
"numpy.random.RandomState"
] | [((3340, 3355), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3353, 3355), False, 'import unittest\n'), ((376, 382), 'rlcard.games.leducholdem.game.LeducholdemGame', 'Game', ([], {}), '()\n', (380, 382), True, 'from rlcard.games.leducholdem.game import LeducholdemGame as Game\n'), ((513, 519), 'rlcard.games.ledu... |