code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
import unittest
import bugzoo
from bugzoo.patch import Hunk, FilePatch, Patch
from bugzoo.util import dedent
class HunkTestCase(unittest.TestCase):
def test_read_next(self):
from_s = """
@@ -1,7 +1,6 @@
-The Way that can be told of is not the eternal Way;
-The... | [
"unittest.main",
"bugzoo.patch.Patch.from_unidiff",
"bugzoo.util.dedent",
"bugzoo.patch.Hunk._read_next",
"bugzoo.patch.FilePatch._read_next"
] | [((4511, 4526), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4524, 4526), False, 'import unittest\n'), ((764, 786), 'bugzoo.patch.Hunk._read_next', 'Hunk._read_next', (['lines'], {}), '(lines)\n', (779, 786), False, 'from bugzoo.patch import Hunk, FilePatch, Patch\n'), ((1740, 1767), 'bugzoo.patch.FilePatch._re... |
import pandas as pd
import torch as T
class Data:
"""
Here, we generate input data with 120 time steps, which looks into the future of 30 days.
That is, with the past 120-day data, we attempt to predict whether the return of stock will increase or decrease
after 30 days
"""
def __init_... | [
"pandas.read_csv",
"torch.Tensor"
] | [((461, 482), 'pandas.read_csv', 'pd.read_csv', (['self.dir'], {}), '(self.dir)\n', (472, 482), True, 'import pandas as pd\n'), ((1133, 1148), 'torch.Tensor', 'T.Tensor', (['input'], {}), '(input)\n', (1141, 1148), True, 'import torch as T\n'), ((1150, 1166), 'torch.Tensor', 'T.Tensor', (['target'], {}), '(target)\n', ... |
import etrobosim.ev3api as ev3
import etrobosim as ets
# ColorSensorのReflectを使ってP制御でライントレースする。
def calcPID(r, target=20, power=70,P=1.8):
p=r-target
left=power-P*p
right=power+P*p
return (int(left),int(right))
def pidControl(initARM_count=-50,initTAIL_count=0):
left,right=calcPID(colorSensor.getB... | [
"etrobosim.ev3api.Motor",
"etrobosim.ev3api.ColorSensor",
"etrobosim.Controller"
] | [((651, 712), 'etrobosim.ev3api.Motor', 'ev3.Motor', (['ev3.ePortM.PORT_B', '(True)', 'ev3.MotorType.LARGE_MOTOR'], {}), '(ev3.ePortM.PORT_B, True, ev3.MotorType.LARGE_MOTOR)\n', (660, 712), True, 'import etrobosim.ev3api as ev3\n'), ((718, 779), 'etrobosim.ev3api.Motor', 'ev3.Motor', (['ev3.ePortM.PORT_C', '(True)', '... |
from kubernetes import client
from kubeflow.fairing.builders.cluster.context_source import ContextSourceInterface
from kubeflow.fairing.cloud import ibm_cloud
from kubeflow.fairing import utils
from kubeflow.fairing.constants import constants
class COSContextSource(ContextSourceInterface):
"""
IBM Cloud Object... | [
"kubernetes.client.V1EnvVar",
"kubeflow.fairing.cloud.ibm_cloud.COSUploader",
"kubeflow.fairing.utils.crc",
"kubeflow.fairing.cloud.ibm_cloud.get_ibm_cos_credentials",
"kubernetes.client.V1ConfigMapVolumeSource",
"kubernetes.client.V1VolumeMount",
"kubeflow.fairing.utils.get_default_target_namespace"
] | [((908, 952), 'kubeflow.fairing.cloud.ibm_cloud.get_ibm_cos_credentials', 'ibm_cloud.get_ibm_cos_credentials', (['namespace'], {}), '(namespace)\n', (941, 952), False, 'from kubeflow.fairing.cloud import ibm_cloud\n'), ((1325, 1385), 'kubeflow.fairing.cloud.ibm_cloud.COSUploader', 'ibm_cloud.COSUploader', (['self.names... |
from taiga.requestmaker import RequestMaker
from taiga.models import User, Project
from taiga import TaigaAPI
import unittest
from mock import patch
from .tools import create_mock_json
from .tools import MockResponse
class TestUsers(unittest.TestCase):
@patch('taiga.requestmaker.RequestMaker.get')
def test_s... | [
"taiga.TaigaAPI",
"mock.patch",
"taiga.requestmaker.RequestMaker",
"taiga.models.User"
] | [((261, 305), 'mock.patch', 'patch', (['"""taiga.requestmaker.RequestMaker.get"""'], {}), "('taiga.requestmaker.RequestMaker.get')\n", (266, 305), False, 'from mock import patch\n'), ((811, 855), 'mock.patch', 'patch', (['"""taiga.requestmaker.RequestMaker.get"""'], {}), "('taiga.requestmaker.RequestMaker.get')\n", (81... |
#!/usr/bin/env python3
from ctypes import *
import sys
loader = cdll.LoadLibrary
lib = loader("../bin/util.so")
def testreverse():
successCount = 0
failCount = 0
dm=["43434fffdsfasf",
"sdfsadfsdff",
"dfsadfsdfasdfasdfsdfasdfasdfasdfsdfsdf",
"r3rednhdfvhfijdsbhnjhjfhikjhuiijuiwu874... | [
"sys._getframe"
] | [((763, 778), 'sys._getframe', 'sys._getframe', ([], {}), '()\n', (776, 778), False, 'import sys\n'), ((1246, 1261), 'sys._getframe', 'sys._getframe', ([], {}), '()\n', (1259, 1261), False, 'import sys\n'), ((1647, 1662), 'sys._getframe', 'sys._getframe', ([], {}), '()\n', (1660, 1662), False, 'import sys\n'), ((2470, ... |
"""Try to read Windows clipboard text"""
import ctypes
CF_TEXT = 1
KERNEL32 = ctypes.windll.kernel32
USER32 = ctypes.windll.user32
def get_clipboard_text():
"""Get Windows clipboard text using WinAPI functions"""
USER32.OpenClipboard(0)
text = None
if USER32.IsClipboardFormatAvailable(CF_TEXT):
... | [
"ctypes.c_char_p"
] | [((431, 459), 'ctypes.c_char_p', 'ctypes.c_char_p', (['data_locked'], {}), '(data_locked)\n', (446, 459), False, 'import ctypes\n')] |
import argparse
import os
import pickle
import time
# import warnings
import numpy as np
from power_planner.utils.utils import get_distance_surface
from csv import writer
import warnings
import matplotlib.pyplot as plt
# utils imports
from power_planner.utils.utils_ksp import KspUtils
from power_planner.utils.utils_cos... | [
"numpy.sum",
"argparse.ArgumentParser",
"csv.writer",
"numpy.ceil",
"numpy.asarray",
"power_planner.utils.utils_costs.CostUtils.compute_angle_costs",
"numpy.ones",
"power_planner.utils.utils_ksp.KspUtils.path_distance",
"time.time",
"numpy.max",
"pickle.load",
"numpy.where",
"numpy.dot",
"... | [((2127, 2152), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2150, 2152), False, 'import argparse\n'), ((2479, 2508), 'os.path.join', 'os.path.join', (['""".."""', '"""outputs"""'], {}), "('..', 'outputs')\n", (2491, 2508), False, 'import os\n'), ((1095, 1117), 'numpy.asarray', 'np.asarray',... |
# -*- coding: utf-8 -*-
"""
pip_services3_commons.random.RandomString
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RandomString implementation
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from typing impo... | [
"random.choice"
] | [((1250, 1271), 'random.choice', 'random.choice', (['values'], {}), '(values)\n', (1263, 1271), False, 'import random\n'), ((2291, 2312), 'random.choice', 'random.choice', (['_alpha'], {}), '(_alpha)\n', (2304, 2312), False, 'import random\n'), ((2934, 2955), 'random.choice', 'random.choice', (['_chars'], {}), '(_chars... |
import os
from flask import Flask
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from models.tree import configure as config_db_tree
from models.specie import configure as config_db_specie
from models.group import configure as config_db_group
from models.harvest import configure as con... | [
"os.environ.get",
"flask.Flask",
"flask_migrate.Migrate",
"models.tree.configure"
] | [((369, 384), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (374, 384), False, 'from flask import Flask\n'), ((542, 570), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (556, 570), False, 'import os\n'), ((651, 670), 'models.tree.configure', 'config_db_tree', (['app'],... |
from flask import Blueprint
from flask import render_template, jsonify, request, redirect, url_for
mod = Blueprint('demo1', __name__, )
@mod.route('/', methods=["GET", "POST"])
def index():
return redirect(url_for('demo1.editor'))
@mod.route('/editor', methods=["GET", "POST"])
def editor():
return render_t... | [
"flask.Blueprint",
"flask.request.args.get",
"flask.jsonify",
"flask.url_for",
"flask.render_template"
] | [((106, 134), 'flask.Blueprint', 'Blueprint', (['"""demo1"""', '__name__'], {}), "('demo1', __name__)\n", (115, 134), False, 'from flask import Blueprint\n'), ((312, 341), 'flask.render_template', 'render_template', (['"""demo1.html"""'], {}), "('demo1.html')\n", (327, 341), False, 'from flask import render_template, j... |
#!/usr/bin/env python
import logging
import aiohttp
import asyncio
from tqdm.asyncio import tqdm_asyncio
from tqdm.contrib.logging import logging_redirect_tqdm
import pandas as pd
import numpy as np
import time
import datetime as dt
from typing import Collection, Dict, List, Optional, Tuple, Union
from yahoo_finance i... | [
"pandas.DataFrame",
"datetime.datetime.today",
"pandas.read_csv",
"numpy.unique",
"tqdm.contrib.logging.logging_redirect_tqdm",
"time.time",
"aiohttp.ClientSession",
"datetime.datetime.strptime",
"pandas.to_datetime",
"datetime.timedelta",
"yahoo_finance.download_ticker_sector_industry",
"yaho... | [((404, 431), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (421, 431), False, 'import logging\n'), ((1442, 1510), 'pandas.DataFrame', 'pd.DataFrame', (['tickers_info'], {'columns': "['SYMBOL', 'SECTOR', 'INDUSTRY']"}), "(tickers_info, columns=['SYMBOL', 'SECTOR', 'INDUSTRY'])\n", (1454,... |
import argparse
import pickle
from . import executor
from .db import create_indices
from .protocol import Protocol
class ParseKwargs(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, {})
for value in values:
key, value =... | [
"pickle.dump",
"argparse.ArgumentParser"
] | [((404, 499), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""backd"""', 'description': '"""Command-line interface for backd.fund"""'}), "(prog='backd', description=\n 'Command-line interface for backd.fund')\n", (427, 499), False, 'import argparse\n'), ((5966, 5987), 'pickle.dump', 'pickle.d... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"pulumi.InvokeOptions",
"pulumi.runtime.invoke"
] | [((6304, 6343), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""provisioningState"""'}), "(name='provisioningState')\n", (6317, 6343), False, 'import pulumi\n'), ((6954, 6988), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""retryEnabled"""'}), "(name='retryEnabled')\n", (6967, 6988), False, 'import pulumi\n'),... |
# This test checks whether the Resource Timing API (see:
# http://www.w3.org/TR/resource-timing/) is really disabled in the default
# Tor Browser. Setting |dom.enable_resource_timing| to |false| and testing that
# might not be sufficient.
from marionette_harness import MarionetteTestCase
class Test(MarionetteTestCase... | [
"marionette_harness.MarionetteTestCase.setUp"
] | [((353, 383), 'marionette_harness.MarionetteTestCase.setUp', 'MarionetteTestCase.setUp', (['self'], {}), '(self)\n', (377, 383), False, 'from marionette_harness import MarionetteTestCase\n')] |
from typing import Any, Callable, Tuple
from cfg import Opts
from mlutils import gen, mod
from torch.functional import Tensor
from torch.optim import SGD
from timm.optim import create_optimizer_v2
from torch.optim.lr_scheduler import StepLR
from torch import nn
import torch
from .distill import BaseDistillTrainer
from... | [
"torch.nn.CrossEntropyLoss",
"torch.no_grad",
"torch.optim.lr_scheduler.StepLR"
] | [((1130, 1170), 'torch.optim.lr_scheduler.StepLR', 'StepLR', (['self.student_optimizer', '(20)', '(0.95)'], {}), '(self.student_optimizer, 20, 0.95)\n', (1136, 1170), False, 'from torch.optim.lr_scheduler import StepLR\n'), ((1335, 1356), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (1354, 1356... |
# -*- coding: utf-8 -*-
"""This module contains tests for the data model of ComPath."""
from compath.constants import EQUIVALENT_TO
from compath.models import User
from tests.constants import DatabaseMixin, KEGG, REACTOME
class TestVotingSystem(DatabaseMixin):
"""Test Voting System."""
def test_missing_man... | [
"compath.models.User"
] | [((949, 977), 'compath.models.User', 'User', ([], {'email': '"""my_email"""', 'id': '(1)'}), "(email='my_email', id=1)\n", (953, 977), False, 'from compath.models import User\n'), ((1567, 1595), 'compath.models.User', 'User', ([], {'email': '"""my_email"""', 'id': '(1)'}), "(email='my_email', id=1)\n", (1571, 1595), Fa... |
from diffgram.brain.inference import Inference
import tempfile
# TODO import these only if local prediction is needed
import cv2
try:
import tensorflow as tf
except:
print("Could not import tensorflow")
import numpy as np
import requests
import scipy.misc
import diffgram.utils.visualization_utils as vis_util
... | [
"diffgram.brain.inference.Inference",
"tensorflow.Session",
"numpy.expand_dims",
"tempfile.mkdtemp",
"diffgram.utils.visualization_utils.visualize_boxes_and_labels_on_image_array",
"tensorflow.gfile.GFile",
"tensorflow.Graph",
"requests.get",
"numpy.squeeze",
"tensorflow.import_graph_def",
"tens... | [((1340, 1512), 'diffgram.brain.inference.Inference', 'Inference', ([], {'method': '"""object_detection"""', 'id': "dict['id']", 'status': "dict['status']", 'box_list': "dict['box_list']", 'score_list': "dict['score_list']", 'label_list': "dict['label_list']"}), "(method='object_detection', id=dict['id'], status=dict['... |
# from https://github.com/SecureAuthCorp/impacket/blob/master/examples/GetNPUsers.py
# https://troopers.de/downloads/troopers19/TROOPERS19_AD_Fun_With_LDAP.pdf
import requests
import logging
import configparser
from binascii import b2a_hex, unhexlify, hexlify
from cme.connection import *
from cme.helpers.logger import... | [
"cme.helpers.bloodhound.add_user_bh",
"logging.debug",
"impacket.krb5.types.Principal",
"impacket.ldap.ldap.LDAPConnection",
"cme.logger.CMEAdapter",
"impacket.krb5.kerberosv5.getKerberosTGS",
"impacket.smbconnection.SMBConnection",
"cme.protocols.ldap.kerberos.KerberosAttacks"
] | [((4128, 4230), 'cme.logger.CMEAdapter', 'CMEAdapter', ([], {'extra': "{'protocol': 'SMB', 'host': self.host, 'port': '445', 'hostname': self.hostname\n }"}), "(extra={'protocol': 'SMB', 'host': self.host, 'port': '445',\n 'hostname': self.hostname})\n", (4138, 4230), False, 'from cme.logger import CMEAdapter\n')... |
"""Uponor U@Home integration
Exposes Sensors for Uponor devices, such as:
- Temperature (UponorThermostatTemperatureSensor)
- Humidity (UponorThermostatHumiditySensor)
- Battery (UponorThermostatBatterySensor)
"""
import voluptuous as vol
from requests.exceptions import RequestException
from homeassistant.exception... | [
"voluptuous.Required",
"voluptuous.Optional",
"logging.getLogger"
] | [((837, 856), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (846, 856), False, 'from logging import getLogger\n'), ((936, 959), 'voluptuous.Required', 'vol.Required', (['CONF_HOST'], {}), '(CONF_HOST)\n', (948, 959), True, 'import voluptuous as vol\n'), ((976, 1001), 'voluptuous.Optional', 'vol.... |
""" Environment with a distribution of mazes (one new maze is drawn at each episode)
Author: <NAME>
"""
import numpy as np
from deer.base_classes import Environment
#import matplotlib
#matplotlib.use('qt5agg')
#from mpl_toolkits.axes_grid1 import host_subplot
#import mpl_toolkits.axisartist as AA
#import matplotlib.... | [
"copy.deepcopy",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.argwhere",
"a_star_path_finding.AStar",
"numpy.repeat"
] | [((7284, 7313), 'numpy.random.RandomState', 'np.random.RandomState', (['(123456)'], {}), '(123456)\n', (7305, 7313), True, 'import numpy as np\n'), ((2589, 2599), 'a_star_path_finding.AStar', 'pf.AStar', ([], {}), '()\n', (2597, 2599), True, 'import a_star_path_finding as pf\n'), ((5148, 5192), 'numpy.zeros', 'np.zeros... |
# Functions for Cliques Discovery
import networkx as nx
import logging
import sys
import math
logger = logging.getLogger()
def get_successor_by_freq( traces ):
"""
Get successor pairs in every T in traces, and combine them by frequency of appearance.
>>> T = [ list("ABC"), list("ABCABC") ]
>>> g... | [
"math.sqrt",
"sys._getframe",
"networkx.has_path",
"networkx.DiGraph",
"logging.getLogger"
] | [((104, 123), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (121, 123), False, 'import logging\n'), ((2654, 2666), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (2664, 2666), True, 'import networkx as nx\n'), ((9160, 9172), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (9170, 9172), True, 'imp... |
from .base_testcase import BaseTestCase
import os
import unittest
class TestGradeInquiry(BaseTestCase):
def __init__(self, testname):
super().__init__(testname, log_in=False)
def set_grade_inquiries_for_course(self, allowed):
# ensure that grade inquiries are enabled for the course
self... | [
"os.environ.get"
] | [((1722, 1756), 'os.environ.get', 'os.environ.get', (['"""TRAVIS_BUILD_DIR"""'], {}), "('TRAVIS_BUILD_DIR')\n", (1736, 1756), False, 'import os\n'), ((2868, 2902), 'os.environ.get', 'os.environ.get', (['"""TRAVIS_BUILD_DIR"""'], {}), "('TRAVIS_BUILD_DIR')\n", (2882, 2902), False, 'import os\n'), ((4046, 4080), 'os.envi... |
import sys
import os
sys.path.append('../')
import unittest
import requests
import datetime
from youtube_api import YoutubeDataApi
from youtube_api import youtube_api_utils as utils
class TestVideo(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.key = os.environ.get('YT_KEY')
cls.yt... | [
"sys.path.append",
"unittest.main",
"youtube_api.youtube_api_utils.get_upload_playlist_id",
"youtube_api.youtube_api_utils.get_liked_playlist_id",
"datetime.datetime",
"os.environ.get",
"youtube_api.youtube_api_utils.parse_yt_datetime",
"youtube_api.youtube_api_utils.strip_video_id_from_url",
"youtu... | [((21, 43), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (36, 43), False, 'import sys\n'), ((2211, 2226), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2224, 2226), False, 'import unittest\n'), ((281, 305), 'os.environ.get', 'os.environ.get', (['"""YT_KEY"""'], {}), "('YT_KEY')\n", (29... |
import unittest
import mock
from lxml import etree
from ncclient.operations.retrieve import GetReply
from pyhpecw7.features.vlan import Vlan
from pyhpecw7.features.errors import VlanIDError, LengthOfStringError
from base_feature_test import BaseFeatureCase
class VlanTestCase(BaseFeatureCase):
@mock.patch('pyhpe... | [
"unittest.main",
"mock.patch.object",
"pyhpecw7.features.vlan.Vlan",
"mock.patch"
] | [((303, 340), 'mock.patch', 'mock.patch', (['"""pyhpecw7.comware.HPCOM7"""'], {}), "('pyhpecw7.comware.HPCOM7')\n", (313, 340), False, 'import mock\n'), ((2118, 2158), 'mock.patch.object', 'mock.patch.object', (['Vlan', '"""_build_config"""'], {}), "(Vlan, '_build_config')\n", (2135, 2158), False, 'import mock\n'), ((2... |
import datetime
print(datetime.datetime.now().hour)
import time
timestamp = time.strftime('%H')
print(int(timestamp)) | [
"datetime.datetime.now",
"time.strftime"
] | [((79, 98), 'time.strftime', 'time.strftime', (['"""%H"""'], {}), "('%H')\n", (92, 98), False, 'import time\n'), ((24, 47), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (45, 47), False, 'import datetime\n')] |
from concurrent.futures import ThreadPoolExecutor
import requests
import json
class AServerError(Exception):
pass
def raise_for_status(response):
try:
response.raise_for_status()
except Exception as e:
raise AServerError(e)
class AServerConnection:
def __init__(self, server, password)... | [
"concurrent.futures.ThreadPoolExecutor",
"requests.get",
"json.dumps"
] | [((517, 537), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {}), '()\n', (535, 537), False, 'from concurrent.futures import ThreadPoolExecutor\n'), ((915, 964), 'requests.get', 'requests.get', (['self.endpoint'], {'headers': 'self.headers'}), '(self.endpoint, headers=self.headers)\n', (927, 964), ... |
# Copyright (c) 2017, MD2K Center of Excellence
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditio... | [
"cerebralcortex.kernel.datatypes.datapoint.DataPoint"
] | [((4028, 4094), 'cerebralcortex.kernel.datatypes.datapoint.DataPoint', 'DataPoint', (['self._identifier', 'dp.start_time', 'dp.end_time', 'dp.sample'], {}), '(self._identifier, dp.start_time, dp.end_time, dp.sample)\n', (4037, 4094), False, 'from cerebralcortex.kernel.datatypes.datapoint import DataPoint\n')] |
#!/usr/bin/env python2.7
import time
def nagios_from_file(results_file):
"""Returns a nagios-appropriate string and return code obtained by
parsing the desired file on disk. The file on disk should be of format
%s|%s % (timestamp, nagios_string)
This file is created by various nagios checking cron jo... | [
"time.time"
] | [((642, 653), 'time.time', 'time.time', ([], {}), '()\n', (651, 653), False, 'import time\n')] |
import webapp2
from template import template
class Handler(webapp2.RequestHandler):
def get(self):
param = {}
self.response.write(template("bigboard.html", params)) | [
"template.template"
] | [((136, 169), 'template.template', 'template', (['"""bigboard.html"""', 'params'], {}), "('bigboard.html', params)\n", (144, 169), False, 'from template import template\n')] |
from http.server import BaseHTTPRequestHandler, HTTPServer
from grove.grove_temperature_humidity_sensor_sht3x import GroveTemperatureHumiditySensorSHT3x
import os
import json
class SHT31Handler(BaseHTTPRequestHandler):
sensor = GroveTemperatureHumiditySensorSHT3x()
def do_G... | [
"grove.grove_temperature_humidity_sensor_sht3x.GroveTemperatureHumiditySensorSHT3x",
"http.server.HTTPServer",
"os.getenv",
"json.dumps"
] | [((269, 306), 'grove.grove_temperature_humidity_sensor_sht3x.GroveTemperatureHumiditySensorSHT3x', 'GroveTemperatureHumiditySensorSHT3x', ([], {}), '()\n', (304, 306), False, 'from grove.grove_temperature_humidity_sensor_sht3x import GroveTemperatureHumiditySensorSHT3x\n'), ((705, 733), 'os.getenv', 'os.getenv', (['"""... |
"""
functions.py
In this work, we present PolymerXtal, a software designed to build and analyze molecular-level polymer crystal
structures. PolymerXtal provides a standardized process to generate polymer crystal structure based on monomer,
tacticity, helicity, chiriality and unit cell information and analyze the crysta... | [
"os.path.join",
"numpy.sqrt"
] | [((3267, 3301), 'os.path.join', 'os.path.join', (['directory', '"""main.py"""'], {}), "(directory, 'main.py')\n", (3279, 3301), False, 'import os, sys, os.path\n'), ((3315, 3357), 'os.path.join', 'os.path.join', (['directory', '"""doAtomTyping.py"""'], {}), "(directory, 'doAtomTyping.py')\n", (3327, 3357), False, 'impo... |
import numpy as np
import pandas as pd
import tools
import tiles
import interp
import computational as cpt
import matplotlib.pyplot as plt
import gsw
from scipy import interpolate
from scipy import integrate
import os
# plt.ion()
time_flag = 'annual' # 'DJF' # 'annual'
typestat = 'zmean'
seasons = ['DJF', 'MAM', 'J... | [
"numpy.sum",
"numpy.floor",
"numpy.arange",
"numpy.exp",
"pandas.to_pickle",
"scipy.interpolate.interp1d",
"gsw.p_from_z",
"pandas.DataFrame",
"os.path.exists",
"numpy.transpose",
"tiles.tiles_with_halo",
"numpy.linspace",
"gsw.rho",
"computational.compute_weight",
"numpy.ceil",
"os.sy... | [((1512, 1567), 'computational.compute_weight', 'cpt.compute_weight', (['lonr[i]', 'latr[j]', 'LONr', 'LATr', 'resor'], {}), '(lonr[i], latr[j], LONr, LATr, resor)\n', (1530, 1567), True, 'import computational as cpt\n'), ((1579, 1627), 'pandas.DataFrame', 'pd.DataFrame', (['(0.0)'], {'columns': 'var_stats', 'index': '... |
# Copyright 2019 Open Source Robotics Foundation
# 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 agr... | [
"pexpect.spawn"
] | [((2536, 2554), 'pexpect.spawn', 'pexpect.spawn', (['cmd'], {}), '(cmd)\n', (2549, 2554), False, 'import pexpect\n')] |
import fridge.Core.Core as Core
import fridge.driver.global_variables as gb
global_vars = gb.GlobalVariables()
global_vars.read_input_file('Full_Core_Test')
def test_baseCore():
core = Core.Core()
assert core.name == ''
assert core.assemblyList == []
assert core.coreCoolant is None
assert core.re... | [
"fridge.Core.Core.Core",
"fridge.driver.global_variables.GlobalVariables"
] | [((91, 111), 'fridge.driver.global_variables.GlobalVariables', 'gb.GlobalVariables', ([], {}), '()\n', (109, 111), True, 'import fridge.driver.global_variables as gb\n'), ((1205, 1225), 'fridge.driver.global_variables.GlobalVariables', 'gb.GlobalVariables', ([], {}), '()\n', (1223, 1225), True, 'import fridge.driver.gl... |
import logging
import uuid
from typing import Optional, Text, Any, List, Dict, Iterable
from sanic import Blueprint, response
from sanic.request import Request
from rasa.core.channels.channel import InputChannel, UserMessage, OutputChannel
from socketio import AsyncServer
from apis.languagetool_api import LanguageTool
... | [
"uuid.uuid4",
"apis.nlu_api.NLUApi",
"socketio.AsyncServer",
"sanic.response.json",
"apis.languagetool_api.LanguageTool",
"logging.getLogger"
] | [((362, 389), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (379, 389), False, 'import logging\n'), ((5294, 5343), 'apis.languagetool_api.LanguageTool', 'LanguageTool', (['languagetool_url', 'languagetool_port'], {}), '(languagetool_url, languagetool_port)\n', (5306, 5343), False, 'from ... |
"""'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Joystick Gremlin Star Citizen
(Complete Star Citizen 3.7 Joystick Gremlin Plugin)
(https://robertsspaceindustries.com/citizens/Game_Overture)
''''''''''''''''''''''''''''''''''''''''''''''... | [
"threading.Timer"
] | [((4877, 4922), 'threading.Timer', 'threading.Timer', (['self.delay', 'self._long_press'], {}), '(self.delay, self._long_press)\n', (4892, 4922), False, 'import threading\n')] |
import _sk_fail; _sk_fail._("dis")
| [
"_sk_fail._"
] | [((17, 34), '_sk_fail._', '_sk_fail._', (['"""dis"""'], {}), "('dis')\n", (27, 34), False, 'import _sk_fail\n')] |
import sys
sys.path.append( "../psml" )
from typeguard.importhook import install_import_hook
install_import_hook('psml')
from psml import *
right10 = modifier( lambda s: s + vector( 0, 0, 10 ) ** s )
m = \
right10 ** sphere( 6 )
m.write() | [
"sys.path.append",
"typeguard.importhook.install_import_hook"
] | [((11, 37), 'sys.path.append', 'sys.path.append', (['"""../psml"""'], {}), "('../psml')\n", (26, 37), False, 'import sys\n'), ((94, 121), 'typeguard.importhook.install_import_hook', 'install_import_hook', (['"""psml"""'], {}), "('psml')\n", (113, 121), False, 'from typeguard.importhook import install_import_hook\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Utilities to summarize, validate and display DataFrames."""
# pylint: disable=invalid-name,dangerous-default-value
# pylint: disable=logging-fstring-interpolation
import pandas as pd
import pandera as pa
from IPython.display import display
from prefect import get_r... | [
"prefect.get_run_logger"
] | [((1293, 1309), 'prefect.get_run_logger', 'get_run_logger', ([], {}), '()\n', (1307, 1309), False, 'from prefect import get_run_logger\n')] |
import datetime
from django.db import models
from functools import reduce
'''
-goal: a custom Django field that accepts input with different levels of date specificity, ranging from a specific day to a millennium
creating a custom field keeps data entry and database structure simple compared to using multiple fields
... | [
"datetime.datetime",
"datetime.datetime.fromtimestamp"
] | [((2888, 2926), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (['other'], {}), '(other)\n', (2919, 2926), False, 'import datetime\n'), ((5216, 5316), 'datetime.datetime', 'datetime.datetime', ([], {'year': 'self.year', 'month': '(1)', 'day': '(1)', 'microsecond': 'self.type2number_dict[self.type... |
import os
import time
import logging
import argparse
from datetime import datetime, timedelta, timezone
import requests
log = logging.getLogger(__name__)
dead_disconnected_timeout = timedelta(minutes=5)
# TODO: add schedule
def main():
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('--base-... | [
"argparse.ArgumentParser",
"requests.Session",
"time.sleep",
"datetime.datetime.strptime",
"datetime.timedelta",
"datetime.datetime.now",
"logging.getLogger"
] | [((128, 155), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (145, 155), False, 'import logging\n'), ((184, 204), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(5)'}), '(minutes=5)\n', (193, 204), False, 'from datetime import datetime, timedelta, timezone\n'), ((258, 283), 'argpars... |
import webapp2
import config
import app.handlers.home
ROUTES = []
ROUTES += app.handlers.home.ROUTES
app = webapp2.WSGIApplication(ROUTES, debug=config.DEBUG)
| [
"webapp2.WSGIApplication"
] | [((110, 161), 'webapp2.WSGIApplication', 'webapp2.WSGIApplication', (['ROUTES'], {'debug': 'config.DEBUG'}), '(ROUTES, debug=config.DEBUG)\n', (133, 161), False, 'import webapp2\n')] |
"""
Example code for working with sqlit3 to manage the database.
This file is mostly for Ted but if anyone else needs an example for
understanding the database code, this is a good resource.
Here is the official Python guide as well:
https://docs.python.org/3/library/sqlite3.html
You can... | [
"sqlite3.connect"
] | [((864, 894), 'sqlite3.connect', 'sqlite3.connect', (['database_file'], {}), '(database_file)\n', (879, 894), False, 'import sqlite3\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 22:37:36 2020
@author: arti
"""
import pandas as pd
df = pd.read_csv('./titanic.csv')
print(df.head())
print('--')
pd.set_option('display.max_columns', 15)
print(df.head())
print('--')
print(df.info())
print('--')
rdf = df.drop(['deck', 'em... | [
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"pandas.get_dummies",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.metrics.confusion_matrix",
"pandas.set_option",
"pandas.concat"
] | [((133, 161), 'pandas.read_csv', 'pd.read_csv', (['"""./titanic.csv"""'], {}), "('./titanic.csv')\n", (144, 161), True, 'import pandas as pd\n'), ((193, 233), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', '(15)'], {}), "('display.max_columns', 15)\n", (206, 233), True, 'import pandas as pd\n'), (... |
import os
import argparse
import requests
def main():
parser = argparse.ArgumentParser(description="Pushover Notifications")
parser.add_argument('--message',
type=str,
help='Message text')
parser.add_argument('--status',
type=str,
... | [
"requests.post",
"argparse.ArgumentParser"
] | [((69, 130), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pushover Notifications"""'}), "(description='Pushover Notifications')\n", (92, 130), False, 'import argparse\n'), ((2340, 2444), 'requests.post', 'requests.post', (['"""https://api.pushover.net/1/messages.json"""'], {'headers': ... |
# -*- coding: utf-8 -*-
#
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache 2 License.
#
# This product includes software developed at Datadog
# (https://www.datadoghq.com/).
#
# Copyright 2018 Datadog, Inc.
#
from app import db
from app.services import SubscribedListSe... | [
"tests.utils.create_board",
"app.models.SubscribedList.query.get",
"tests.utils.create_repo",
"app.services.SubscribedListService",
"app.db.session.commit",
"tests.utils.create_list",
"tests.utils.create_subscription",
"app.models.SubscribedList.query.all"
] | [((782, 805), 'app.services.SubscribedListService', 'SubscribedListService', ([], {}), '()\n', (803, 805), False, 'from app.services import SubscribedListService\n'), ((814, 828), 'tests.utils.create_board', 'create_board', ([], {}), '()\n', (826, 828), False, 'from tests.utils import create_board, create_repo, create_... |
from django.conf.urls import include, url
from django.contrib import admin
from rest_framework import routers
from api import views as v
router = routers.DefaultRouter()
router.register(r'conf', v.ConfViewSet)
router.register(r'country', v.CountryViewSet)
router.register(r'db', v.DbViewSet)
router.register(r'install'... | [
"api.views.ProjectListByType.as_view",
"api.views.ConfirmationPassword.as_view",
"django.conf.urls.include",
"api.views.PostfixItem.as_view",
"api.views.ServerConfItem.as_view",
"api.views.LocalLinuxUsername.as_view",
"api.views.LocalBashDir.as_view",
"api.views.ProjectByName.as_view",
"django.conf.... | [((148, 171), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (169, 171), False, 'from rest_framework import routers\n'), ((1568, 1585), 'django.conf.urls.url', 'url', (['"""^$"""', 'v.home'], {}), "('^$', v.home)\n", (1571, 1585), False, 'from django.conf.urls import include, url\n')... |
"""
.. module:: tests
:synopsis: tests of core siMpLify entitys
:author: <NAME>
:copyright: 2019-2020
:license: Apache-2.0
"""
import os
import sys
sys.path.insert(0, os.path.join('..', 'simplify'))
sys.path.insert(0, os.path.join('..', '..', 'simplify'))
import simplify.content as content
algorithm, parameters = co... | [
"simplify.content.create",
"os.path.join"
] | [((318, 469), 'simplify.content.create', 'content.create', ([], {'configuration': "{'general': {'gpu': True, 'seed': 4}}", 'package': '"""analyst"""', 'step': '"""normalize"""', 'parameters': "{'copy': False}"}), "(configuration={'general': {'gpu': True, 'seed': 4}}, package\n ='analyst', step='scale', step='normali... |
import csv
import logging
import os
import sys
import warnings
import re
from common import CONCEPT, VOCABULARY, DELIMITER, LINE_TERMINATOR, TRANSFORM_FILES, \
APPEND_VOCABULARY, APPEND_CONCEPTS, ADD_AOU_GENERAL, ERRORS, AOU_GEN_ID, AOU_GEN_VOCABULARY_CONCEPT_ID, \
AOU_GEN_VOCABULARY_REFERENCE, ERROR_APPENDING... | [
"common.ERROR_APPENDING.format",
"resources.hash_dir",
"csv.reader",
"csv.writer",
"argparse.ArgumentParser",
"os.path.basename",
"os.makedirs",
"common.DELIMITER.join",
"csv.field_size_limit",
"csv.Sniffer",
"logging.info",
"io.open",
"os.path.join",
"os.listdir",
"re.compile"
] | [((454, 475), 're.compile', 're.compile', (['"""\\\\d{8}$"""'], {}), "('\\\\d{8}$')\n", (464, 475), False, 'import re\n'), ((494, 529), 're.compile', 're.compile', (['"""\\\\d{4}-\\\\d{2}-\\\\d{2}$"""'], {}), "('\\\\d{4}-\\\\d{2}-\\\\d{2}$')\n", (504, 529), False, 'import re\n'), ((529, 562), 'csv.field_size_limit', 'c... |
from abc import ABC
import abc
from CouncilTag.ingest.models import Tag
import random
class TagEngine(ABC):
'''
TagEngine is an interface class. You must create a new
class that takes TagEngine as its base to implement the
"find_tags" and "apply_tags" method to use in the meeting injestion process
... | [
"CouncilTag.ingest.models.Tag.objects.all"
] | [((990, 1007), 'CouncilTag.ingest.models.Tag.objects.all', 'Tag.objects.all', ([], {}), '()\n', (1005, 1007), False, 'from CouncilTag.ingest.models import Tag\n')] |
"""Tests for rule_generator.project_config."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from absl.testing import absltest
import yaml
from deploy.rule_generator.project_config import ProjectConfig
TEST_PROJECT_YAML = """
overall:
or... | [
"deploy.rule_generator.project_config.ProjectConfig",
"absl.testing.absltest.main",
"yaml.load",
"copy.deepcopy"
] | [((8398, 8413), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (8411, 8413), False, 'from absl.testing import absltest\n'), ((2040, 2068), 'yaml.load', 'yaml.load', (['TEST_PROJECT_YAML'], {}), '(TEST_PROJECT_YAML)\n', (2049, 2068), False, 'import yaml\n'), ((2083, 2189), 'deploy.rule_generator.projec... |
# Copyright (c) 2019 <NAME>
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import numpy as np
from phylanx import Phylanx
@Phylanx
def in_top_k(predictions, targets, k):
top_k = np.argsort(-predictions)[:... | [
"numpy.any",
"numpy.argsort"
] | [((384, 411), 'numpy.any', 'np.any', (['(target == top_k)', '(-1)'], {}), '(target == top_k, -1)\n', (390, 411), True, 'import numpy as np\n'), ((294, 318), 'numpy.argsort', 'np.argsort', (['(-predictions)'], {}), '(-predictions)\n', (304, 318), True, 'import numpy as np\n')] |
import os
import yaml # external libary
def fstab(val="fstab.yaml"):
with open(val, "r") as yamlfile: #read yaml file
data = yaml.safe_load(yamlfile)
output: str=""
for sub in data['fstab']:
if (data['fstab'][sub]["type"]) == "nfs":
o... | [
"yaml.safe_load",
"os.system"
] | [((180, 204), 'yaml.safe_load', 'yaml.safe_load', (['yamlfile'], {}), '(yamlfile)\n', (194, 204), False, 'import yaml\n'), ((1558, 1605), 'os.system', 'os.system', (['"""findmnt --verify --verbose ./fstab"""'], {}), "('findmnt --verify --verbose ./fstab')\n", (1567, 1605), False, 'import os\n')] |
from typing import Optional
import torch
from torch import nn
from torch.nn import CrossEntropyLoss
from transformers.models.bert.modeling_bert import ACT2FN, BertPreTrainingHeads
from transformers.models.roberta.modeling_roberta import RobertaLMHead
from luke.model import LukeModel, LukeConfig
class EntityPredictio... | [
"torch.masked_select",
"torch.argmax",
"torch.nn.CrossEntropyLoss",
"torch.nn.LayerNorm",
"transformers.models.roberta.modeling_roberta.RobertaLMHead",
"torch.nn.Linear",
"torch.zeros",
"transformers.models.bert.modeling_bert.BertPreTrainingHeads"
] | [((474, 527), 'torch.nn.Linear', 'nn.Linear', (['config.hidden_size', 'config.entity_emb_size'], {}), '(config.hidden_size, config.entity_emb_size)\n', (483, 527), False, 'from torch import nn\n'), ((730, 793), 'torch.nn.LayerNorm', 'nn.LayerNorm', (['config.entity_emb_size'], {'eps': 'config.layer_norm_eps'}), '(confi... |
import os
import sys
import gzip
import paddle.v2 as paddle
import reader
from utils import logger, parse_train_cmd, build_dict, load_dict
from network_conf import fc_net, convolution_net
def train(topology,
train_data_dir=None,
test_data_dir=None,
word_dict_path=None,
label_... | [
"reader.train_reader",
"os.mkdir",
"paddle.v2.init",
"paddle.v2.optimizer.L2Regularization",
"utils.logger.info",
"utils.build_dict",
"os.path.join",
"paddle.v2.dataset.imdb.word_dict",
"os.path.exists",
"paddle.v2.dataset.imdb.test",
"paddle.v2.evaluator.auc",
"utils.parse_train_cmd",
"padd... | [((3658, 3718), 'utils.logger.info', 'logger.info', (["('length of word dictionary is : %d.' % dict_dim)"], {}), "('length of word dictionary is : %d.' % dict_dim)\n", (3669, 3718), False, 'from utils import logger, parse_train_cmd, build_dict, load_dict\n'), ((3726, 3769), 'paddle.v2.init', 'paddle.init', ([], {'use_g... |
import structlog
from rest_framework import exceptions, permissions, status, viewsets
from rest_framework.response import Response
from lego.apps.stats.utils import track
from .serializers import SlackInviteSerializer
from .utils import SlackException, SlackInvite
log = structlog.get_logger()
class SlackInviteView... | [
"lego.apps.stats.utils.track",
"rest_framework.response.Response",
"structlog.get_logger"
] | [((274, 296), 'structlog.get_logger', 'structlog.get_logger', ([], {}), '()\n', (294, 296), False, 'import structlog\n'), ((670, 727), 'rest_framework.response.Response', 'Response', (['serializer.data'], {'status': 'status.HTTP_201_CREATED'}), '(serializer.data, status=status.HTTP_201_CREATED)\n', (678, 727), False, '... |
"""
This module contains the :py:class:`SerialDevice` interface for the `AD2USB`_, `AD2SERIAL`_ or `AD2PI`_.
.. _AD2USB: http://www.alarmdecoder.com
.. _AD2SERIAL: http://www.alarmdecoder.com
.. _AD2PI: http://www.alarmdecoder.com
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import threading
import serial
import serial.to... | [
"serial.Serial",
"threading.Timer",
"serial.tools.list_ports.grep",
"serial.tools.list_ports.comports"
] | [((2130, 2170), 'serial.Serial', 'serial.Serial', ([], {'timeout': '(0)', 'writeTimeout': '(0)'}), '(timeout=0, writeTimeout=0)\n', (2143, 2170), False, 'import serial\n'), ((5989, 6028), 'threading.Timer', 'threading.Timer', (['timeout', 'timeout_event'], {}), '(timeout, timeout_event)\n', (6004, 6028), False, 'import... |
import os
from django import template
from djangobench.utils import run_benchmark
def benchmark():
context = template.Context({
'stuff': 'something'
});
t = template.Template('{{ stuff }}')
t.render(context)
run_benchmark(
benchmark,
syncdb = False,
meta = {
'description': ... | [
"djangobench.utils.run_benchmark",
"django.template.Context",
"django.template.Template"
] | [((234, 351), 'djangobench.utils.run_benchmark', 'run_benchmark', (['benchmark'], {'syncdb': '(False)', 'meta': "{'description': 'Render an extremely simple template (from string)'}"}), "(benchmark, syncdb=False, meta={'description':\n 'Render an extremely simple template (from string)'})\n", (247, 351), False, 'fro... |
import numpy as np
import pylab as pl
from gls import sinefitm
from multiplot import dofig, doaxes
fac1 = 100
fac2 = 1
fac3 = 1
ls = ['-','--',':','-.']
mrk = ['.',',','+','x']
col = ['k','c','m','y']
def plotTS(time, y1, y2, y3 = None, figno = 1, discrete = True, \
savefile = None, period = None, x... | [
"gls.sinefitm",
"numpy.copy",
"numpy.median",
"pylab.ylabel",
"numpy.zeros",
"multiplot.doaxes",
"pylab.plot",
"numpy.nanmin",
"numpy.shape",
"pylab.savefig",
"numpy.arange",
"pylab.ylim",
"pylab.xlabel",
"pylab.xlim",
"multiplot.dofig",
"numpy.nanmax",
"numpy.sqrt"
] | [((382, 394), 'numpy.shape', 'np.shape', (['y1'], {}), '(y1)\n', (390, 394), True, 'import numpy as np\n'), ((779, 808), 'multiplot.dofig', 'dofig', (['figno', '(1)', 'ny'], {'aspect': '(1)'}), '(figno, 1, ny, aspect=1)\n', (784, 808), False, 'from multiplot import dofig, doaxes\n'), ((821, 844), 'multiplot.doaxes', 'd... |
from sqlalchemy import func
from sqlalchemy.exc import SQLAlchemyError
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import and_
import uuid
import json
from common.database import db
from common.ret_status import RetStatus
class TreeManager:
def __init__(self, model_obj=None, session=None):
sel... | [
"json.dumps",
"common.database.db.String",
"uuid.uuid1",
"common.ret_status.RetStatus",
"common.database.db.Column"
] | [((7910, 7942), 'common.database.db.Column', 'db.Column', (['db.Integer'], {'default': '(0)'}), '(db.Integer, default=0)\n', (7919, 7942), False, 'from common.database import db\n'), ((7965, 7997), 'common.database.db.Column', 'db.Column', (['db.Integer'], {'default': '(0)'}), '(db.Integer, default=0)\n', (7974, 7997),... |
from twisted.application.service import ServiceMaker
TransitRelay = ServiceMaker(
"Magic-Wormhole Transit Relay", # name
"wormhole_transit_relay.server_tap", # module
"Provide the Transit Relay server for Magic-Wormhole clients.", # desc
"transitrelay", # tapname
)
| [
"twisted.application.service.ServiceMaker"
] | [((69, 242), 'twisted.application.service.ServiceMaker', 'ServiceMaker', (['"""Magic-Wormhole Transit Relay"""', '"""wormhole_transit_relay.server_tap"""', '"""Provide the Transit Relay server for Magic-Wormhole clients."""', '"""transitrelay"""'], {}), "('Magic-Wormhole Transit Relay',\n 'wormhole_transit_relay.ser... |
import numpy as np
import imutils
import time
import cv2
video = cv2.VideoCapture(0)
video.set(cv2.CAP_PROP_BUFFERSIZE, 2)
while True:
ret, frame = video.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
all_chans = []
for chan in frame[:, :]:
_, binary = cv2.threshold(chan, 70, 255, cv2.... | [
"cv2.dilate",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.threshold",
"cv2.imwrite",
"numpy.ones",
"cv2.VideoCapture",
"numpy.array",
"cv2.erode",
"cv2.imshow"
] | [((66, 85), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (82, 85), False, 'import cv2\n'), ((178, 217), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2GRAY'], {}), '(frame, cv2.COLOR_BGR2GRAY)\n', (190, 217), False, 'import cv2\n'), ((498, 517), 'numpy.array', 'np.array', (['all_chans'], {... |
import coremltools as ct
import pytest
def _get_visible_items(d):
return [x for x in dir(d) if not x.startswith("_")]
def _check_visible_modules(actual, expected):
if set(actual) != set(expected):
raise AssertionError("API mis-matched. Got %s, expected %s" % (
actual,
expecte... | [
"coremltools.utils._is_macos",
"coremltools.utils._python_version"
] | [((912, 932), 'coremltools.utils._is_macos', 'ct.utils._is_macos', ([], {}), '()\n', (930, 932), True, 'import coremltools as ct\n'), ((4754, 4780), 'coremltools.utils._python_version', 'ct.utils._python_version', ([], {}), '()\n', (4778, 4780), True, 'import coremltools as ct\n'), ((5325, 5351), 'coremltools.utils._py... |
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-ID-enumeration-1-NS"
class NistschemaSvIvAtomicIdEnumeration1Type(Enum):
ITEMPLATES_RESOURCE = "itemplates.resource_"
HORGANIZ = "horganiz"
WORK_OF_IS_DOCUMENTS_RELATIONSHIP... | [
"dataclasses.field"
] | [((863, 935), 'dataclasses.field', 'field', ([], {'default': 'None', 'metadata': "{'type': 'Wildcard', 'namespace': '##any'}"}), "(default=None, metadata={'type': 'Wildcard', 'namespace': '##any'})\n", (868, 935), False, 'from dataclasses import dataclass, field\n'), ((1251, 1299), 'dataclasses.field', 'field', ([], {'... |
import os
import sys
import csv
import cv2
import math
import time
import numbers
import numpy as np
from multiprocessing import Process
# local imported codes
import parameters as parm
from object_tracking_util import Camera, scalar_to_rgb, setup_system_objects, \
single_cam_detect... | [
"object_tracking_util.setup_system_objects",
"object_tracking_util.Camera",
"math.sqrt",
"csv.writer",
"cv2.waitKey",
"time.time",
"cv2.VideoCapture",
"numpy.array",
"object_tracking_util.multi_cam_detector",
"object_tracking_util.single_cam_detector",
"cv2.destroyAllWindows",
"cv2.resize"
] | [((995, 1011), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (1003, 1011), True, 'import numpy as np\n'), ((1101, 1129), 'cv2.VideoCapture', 'cv2.VideoCapture', (['self.index'], {}), '(self.index)\n', (1117, 1129), False, 'import cv2\n'), ((1785, 1824), 'object_tracking_util.setup_system_objects', 'setup_s... |
import os
TEST_API_TOKEN = os.getenv('ZENODO_ACCESS_TOKEN')
| [
"os.getenv"
] | [((28, 60), 'os.getenv', 'os.getenv', (['"""ZENODO_ACCESS_TOKEN"""'], {}), "('ZENODO_ACCESS_TOKEN')\n", (37, 60), False, 'import os\n')] |
import sys
from decimal import Decimal
from math import ceil
from django.core.management.base import BaseCommand
from django.db.models import Max
from faker import Faker
from baserow.contrib.database.fields.field_helpers import (
construct_all_possible_field_kwargs,
)
from baserow.contrib.database.fields.handler ... | [
"django.db.models.Max",
"baserow.contrib.database.fields.handler.FieldHandler",
"faker.Faker",
"decimal.Decimal",
"baserow.contrib.database.table.models.Table.objects.get",
"baserow.contrib.database.fields.field_helpers.construct_all_possible_field_kwargs",
"baserow.contrib.database.rows.handler.RowHand... | [((1680, 1687), 'faker.Faker', 'Faker', ([], {}), '()\n', (1685, 1687), False, 'from faker import Faker\n'), ((1706, 1718), 'baserow.contrib.database.rows.handler.RowHandler', 'RowHandler', ([], {}), '()\n', (1716, 1718), False, 'from baserow.contrib.database.rows.handler import RowHandler\n'), ((2932, 2946), 'baserow.... |
import json,boto3,os,logging
from botocore.exceptions import ClientError
logger = logging.getLogger("AKAM:S3-NS-SYNC")
def configure_logging():
logger.setLevel(logging.DEBUG)
# Format for our loglines
formatter = logging.Formatter("%(name)s - %(levelname)s - %(message)s")
# Setup console logging
c... | [
"boto3.client",
"logging.StreamHandler",
"json.dumps",
"logging.Formatter",
"logging.getLogger"
] | [((83, 119), 'logging.getLogger', 'logging.getLogger', (['"""AKAM:S3-NS-SYNC"""'], {}), "('AKAM:S3-NS-SYNC')\n", (100, 119), False, 'import json, boto3, os, logging\n'), ((227, 286), 'logging.Formatter', 'logging.Formatter', (['"""%(name)s - %(levelname)s - %(message)s"""'], {}), "('%(name)s - %(levelname)s - %(message... |
import gym
#import pygame
import sys
import time
import matplotlib
import time
import pygame
import pybullet as p
from gibson.core.render.profiler import Profiler
'''
try:
matplotlib.use('GTK3Agg')
import matplotlib.pyplot as plt
except Exception:
pass
'''
#import pyglet.window as pw
from collections impo... | [
"pygame.transform.scale",
"collections.deque"
] | [((684, 727), 'pygame.transform.scale', 'pygame.transform.scale', (['pyg_img', 'video_size'], {}), '(pyg_img, video_size)\n', (706, 727), False, 'import pygame\n'), ((6118, 6149), 'collections.deque', 'deque', ([], {'maxlen': 'horizon_timesteps'}), '(maxlen=horizon_timesteps)\n', (6123, 6149), False, 'from collections ... |
import json
class Corpus(object):
def __init__(self, weighted_bigrams={}, occurrences={}):
self.weighted_bigrams = weighted_bigrams
self.occurrences = occurrences
@classmethod
def load(cls, path):
with open(path, 'r') as f:
data = f.read()
return cls(**json.lo... | [
"json.loads",
"json.dumps"
] | [((313, 329), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (323, 329), False, 'import json\n'), ((683, 707), 'json.dumps', 'json.dumps', (['saved_corpus'], {}), '(saved_corpus)\n', (693, 707), False, 'import json\n')] |
"""
<NAME>
University of Massachusetts, Amherst
28 June 2019
Project 3
ECE 122
"""
from Mapping_for_Tkinter import Mapping_for_Tkinter
from tkinter import *
import math
import time
class Ball:
def __init__(self, x0, y0, v, theta, radius):
self.__x = x0
self.__y = y0
self.__v = v
s... | [
"Mapping_for_Tkinter.Mapping_for_Tkinter",
"math.cos",
"math.sin",
"time.sleep"
] | [((3534, 3584), 'Mapping_for_Tkinter.Mapping_for_Tkinter', 'Mapping_for_Tkinter', (['xmin', 'xmax', 'ymin', 'ymax', 'width'], {}), '(xmin, xmax, ymin, ymax, width)\n', (3553, 3584), False, 'from Mapping_for_Tkinter import Mapping_for_Tkinter\n'), ((3776, 3792), 'time.sleep', 'time.sleep', (['(0.01)'], {}), '(0.01)\n', ... |
import abc
import collections
import contextlib
import dataclasses
import pathlib
import re
import tempfile
from types import MappingProxyType
from typing import (
Any,
Callable,
Dict,
List,
Mapping,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
from uqbar.objects import n... | [
"typing.cast",
"supriya.enums.CalculationRate.from_expr",
"supriya.commands.BufferAllocateRequest",
"contextlib.ExitStack",
"tempfile.mkdtemp",
"collections.Counter",
"re.sub",
"supriya.commands.ControlBusSetRequest",
"supriya.realtime.Bus._get_allocator",
"types.MappingProxyType",
"dataclasses.... | [((814, 848), 'dataclasses.dataclass', 'dataclasses.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (835, 848), False, 'import dataclasses\n'), ((890, 924), 'dataclasses.dataclass', 'dataclasses.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (911, 924), False, 'import dataclasses\n'), ((2539, 257... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: <EMAIL>
# datetime: 2021/9/28 上午10:51
# project: dongtai-openapi
from drf_spectacular.utils import OpenApiParameter, OpenApiExample
class DongTaiAuth:
TOKEN = 'TokenAuthentication'
class DongTaiParameter:
OPENAPI_URL = OpenApiParameter(
name='ur... | [
"drf_spectacular.utils.OpenApiExample"
] | [((440, 526), 'drf_spectacular.utils.OpenApiExample', 'OpenApiExample', (['"""url example"""'], {'summary': '"""default"""', 'value': '"""https://openapi.iast.io"""'}), "('url example', summary='default', value=\n 'https://openapi.iast.io')\n", (454, 526), False, 'from drf_spectacular.utils import OpenApiParameter, ... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | [
"bokeh.io.doc.curdoc",
"bokeh.document.Document",
"bokeh.util.testing.verify_api",
"bokeh.io.state.curstate",
"bokeh.io.doc.set_curdoc"
] | [((1401, 1421), 'bokeh.util.testing.verify_api', 'verify_api', (['bid', 'api'], {}), '(bid, api)\n', (1411, 1421), False, 'from bokeh.util.testing import verify_api\n'), ((2058, 2068), 'bokeh.document.Document', 'Document', ([], {}), '()\n', (2066, 2068), False, 'from bokeh.document import Document\n'), ((2073, 2090), ... |
"""Methods that are elvis related and used in multiple times inside elvis."""
import datetime
import math
import pandas as pd
from elvis.distribution import EquallySpacedInterpolatedDistribution
def create_time_steps(start_date, end_date, resolution):
"""Create list from start, end date and resolution of the si... | [
"math.floor",
"datetime.timedelta"
] | [((2940, 2991), 'math.floor', 'math.floor', (['(dist.seconds / input_resolution_seconds)'], {}), '(dist.seconds / input_resolution_seconds)\n', (2950, 2991), False, 'import math\n'), ((3439, 3480), 'math.floor', 'math.floor', (['(input_resolution_seconds / 60)'], {}), '(input_resolution_seconds / 60)\n', (3449, 3480), ... |
"""
This is a django-split-settings main file.
For more information read this:
https://github.com/sobolevn/django-split-settings
Close copy of https://medium.com/wemake-services/managing-djangos-settings-e2b7f496120d
Default environment is `development`.
To change settings file: `DJANGO_ENV=production python manage... | [
"split_settings.tools.include",
"myAzure.az_connect.AzureConnection"
] | [((472, 489), 'myAzure.az_connect.AzureConnection', 'AzureConnection', ([], {}), '()\n', (487, 489), False, 'from myAzure.az_connect import AzureConnection\n'), ((731, 754), 'split_settings.tools.include', 'include', (['*base_settings'], {}), '(*base_settings)\n', (738, 754), False, 'from split_settings.tools import in... |
def ilog2(n):
'''
Return binary logarithm base two of n.
>>> ilog2(0)
Traceback (most recent call last):
...
ValueError: math domain error
>>> ilog2(-10)
Traceback (most recent call last):
...
ValueError: math domain error
>>> [ilog2(i) for i in range(1, 10)]
[0, 1, 1, 2... | [
"doctest.testmod"
] | [((718, 735), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (733, 735), False, 'import doctest\n')] |
import re
from functools import reduce
from itertools import chain
from typing import Union, Dict, List
import pandas as pd
import numpy as np
from .common import *
DataFrameType = Union[pd.DataFrame, Dict[str, pd.DataFrame], List[Dict[str, pd.DataFrame]]]
# Serialization helper functions
# -----------------------... | [
"numpy.dtype",
"pandas.to_datetime",
"itertools.chain",
"re.sub"
] | [((533, 559), 'pandas.to_datetime', 'pd.to_datetime', (["df['time']"], {}), "(df['time'])\n", (547, 559), True, 'import pandas as pd\n'), ((2106, 2119), 'numpy.dtype', 'np.dtype', (['"""O"""'], {}), "('O')\n", (2114, 2119), True, 'import numpy as np\n'), ((2304, 2331), 'itertools.chain', 'chain', (['obj_nans', 'other_n... |
from django.db.models import Q, QuerySet
from utilities.permissions import permission_is_exempt
class RestrictedQuerySet(QuerySet):
def restrict(self, user, action='view'):
"""
Filter the QuerySet to return only objects on which the specified user has been granted the specified
permissio... | [
"utilities.permissions.permission_is_exempt",
"django.db.models.Q"
] | [((799, 840), 'utilities.permissions.permission_is_exempt', 'permission_is_exempt', (['permission_required'], {}), '(permission_required)\n', (819, 840), False, 'from utilities.permissions import permission_is_exempt\n'), ((1181, 1184), 'django.db.models.Q', 'Q', ([], {}), '()\n', (1182, 1184), False, 'from django.db.m... |
import cv2
import numpy as np
from plantcv.plantcv import gaussian_blur
def test_gaussian_blur(test_data):
"""Test for PlantCV."""
# Read in test data
img = cv2.imread(test_data.small_rgb_img)
gaussian_img = gaussian_blur(img=img, ksize=(51, 51), sigma_x=0, sigma_y=None)
assert np.average(img) != ... | [
"cv2.imread",
"numpy.average",
"plantcv.plantcv.gaussian_blur"
] | [((171, 206), 'cv2.imread', 'cv2.imread', (['test_data.small_rgb_img'], {}), '(test_data.small_rgb_img)\n', (181, 206), False, 'import cv2\n'), ((226, 289), 'plantcv.plantcv.gaussian_blur', 'gaussian_blur', ([], {'img': 'img', 'ksize': '(51, 51)', 'sigma_x': '(0)', 'sigma_y': 'None'}), '(img=img, ksize=(51, 51), sigma_... |
from __future__ import print_function, division
import numpy as np
import sys
scalarTypes = (complex, float, int, np.number)
if sys.version_info < (3,):
scalarTypes += (long, )
def isScalar(f):
if isinstance(f, scalarTypes):
return True
elif isinstance(f, np.ndarray) and f.size == 1 and isinstanc... | [
"numpy.array",
"numpy.atleast_2d"
] | [((460, 473), 'numpy.array', 'np.array', (['pts'], {}), '(pts)\n', (468, 473), True, 'import numpy as np\n'), ((585, 603), 'numpy.atleast_2d', 'np.atleast_2d', (['pts'], {}), '(pts)\n', (598, 603), True, 'import numpy as np\n')] |
from flask import Flask
from flask import render_template
from flask import request
#from flask_wtf import CsrfProtect #this is what the video said, but it gives a warning, the one one line below works without warnings
from flask_wtf import CSRFProtect
import forms
from flask import make_response #for the cookie
from f... | [
"models.db.session.commit",
"flask.flash",
"models.db.init_app",
"models.db.session.add",
"flask_mail.Mail",
"forms.ElementForm",
"models.userstest.query.filter_by",
"models.category_names.query.filter_by",
"flask.url_for",
"helper.previous_quarter_year",
"pandas.set_option",
"models.suitemodc... | [((1348, 1404), 'sqlalchemy.create_engine', 'create_engine', (['DevelopmentConfig.SQLALCHEMY_DATABASE_URI'], {}), '(DevelopmentConfig.SQLALCHEMY_DATABASE_URI)\n', (1361, 1404), False, 'from sqlalchemy import create_engine\n'), ((1522, 1571), 'pandas.set_option', 'pd.set_option', (['"""display.expand_frame_repr"""', '(F... |
from command import Command
from utils import *
import rospy
from std_msgs.msg import String
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy, JointState
class SkidSteer(Command):
""" Control a model with a SkidSteer plugin """
def __init__(self, name, skid_steer_topic, speed=5, rot_mu... | [
"rospy.Publisher",
"geometry_msgs.msg.Twist"
] | [((514, 569), 'rospy.Publisher', 'rospy.Publisher', (['skid_steer_topic', 'Twist'], {'queue_size': '(10)'}), '(skid_steer_topic, Twist, queue_size=10)\n', (529, 569), False, 'import rospy\n'), ((869, 876), 'geometry_msgs.msg.Twist', 'Twist', ([], {}), '()\n', (874, 876), False, 'from geometry_msgs.msg import Twist\n')] |
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apach... | [
"json.loads",
"datadiff.tools.assert_equal"
] | [((1164, 1205), 'datadiff.tools.assert_equal', 'assert_equal', (['r.body', '"""No repo specified"""'], {}), "(r.body, 'No repo specified')\n", (1176, 1205), False, 'from datadiff.tools import assert_equal\n'), ((1274, 1324), 'datadiff.tools.assert_equal', 'assert_equal', (['r.body', '"""No project at /p/gbalksdfh"""'],... |
import copy
import warnings
import numpy as np
import pandas as pd
import colorcet
import bokeh.models
import bokeh.plotting
from . import utils
def strip(
data=None,
q=None,
cats=None,
q_axis="x",
palette=None,
order=None,
p=None,
show_legend=False,
color_column=None,
parc... | [
"numpy.percentile",
"warnings.warn",
"copy.copy",
"pandas.Series"
] | [((3977, 4001), 'copy.copy', 'copy.copy', (['jitter_kwargs'], {}), '(jitter_kwargs)\n', (3986, 4001), False, 'import copy\n'), ((4022, 4046), 'copy.copy', 'copy.copy', (['marker_kwargs'], {}), '(marker_kwargs)\n', (4031, 4046), False, 'import copy\n'), ((12267, 12288), 'copy.copy', 'copy.copy', (['box_kwargs'], {}), '(... |
from django.views.generic.base import (
TemplateView,
View,
)
from django.http import Http404
from django.urls import reverse
from django.http import HttpResponseRedirect
from regulations.generator import api_reader
from regulations.views.mixins import CitationContextMixin
from regulations.views.utils import f... | [
"django.urls.reverse",
"django.http.HttpResponseRedirect",
"regulations.generator.api_reader.ApiReader"
] | [((527, 549), 'regulations.generator.api_reader.ApiReader', 'api_reader.ApiReader', ([], {}), '()\n', (547, 549), False, 'from regulations.generator import api_reader\n'), ((2669, 2691), 'regulations.generator.api_reader.ApiReader', 'api_reader.ApiReader', ([], {}), '()\n', (2689, 2691), False, 'from regulations.genera... |
# Helper for testing.
#
# <NAME> [http://eli.thegreenplace.net]
# This code is in the public domain.
import sys
import time
def main():
count = 1
while True:
sys.stdout.write(f'{count} ')
if count % 20 == 0:
sys.stdout.write('\n')
time.sleep(0.05)
count += 1
if __... | [
"sys.stdout.write",
"time.sleep"
] | [((176, 205), 'sys.stdout.write', 'sys.stdout.write', (['f"""{count} """'], {}), "(f'{count} ')\n", (192, 205), False, 'import sys\n'), ((277, 293), 'time.sleep', 'time.sleep', (['(0.05)'], {}), '(0.05)\n', (287, 293), False, 'import time\n'), ((246, 268), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('... |
"""Groups everything related to a room."""
from datetime import datetime
from typing import List, Optional
import attr
from . import ActiveMode, Component, Function, OperatingModes, constants
@attr.s
class Device:
"""This is a physical device inside a :class:`Room`. It can be a VR50
VR51 or VR52.
Args:... | [
"attr.ib",
"datetime.datetime.now"
] | [((703, 720), 'attr.ib', 'attr.ib', ([], {'type': 'str'}), '(type=str)\n', (710, 720), False, 'import attr\n'), ((733, 750), 'attr.ib', 'attr.ib', ([], {'type': 'str'}), '(type=str)\n', (740, 750), False, 'import attr\n'), ((769, 786), 'attr.ib', 'attr.ib', ([], {'type': 'str'}), '(type=str)\n', (776, 786), False, 'imp... |
# -*- coding: utf-8 -*-
"""
"""
from __future__ import division, print_function, unicode_literals
import pytest
from phasor.utilities.mpl.autoniceplot import (
#AutoPlotSaver,
#mplfigB,
asavefig,
)
import os.path as path
from phasor import alm
asavefig.org_subfolder = path.join(path.dirname(__file__), 't... | [
"os.path.dirname",
"phasor.alm.ThinLens",
"IPython.lib.pretty.pprint",
"phasor.alm.RootSystem",
"phasor.alm.ComplexBeamParam.from_Z_ZR"
] | [((294, 316), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (306, 316), True, 'import os.path as path\n'), ((410, 451), 'phasor.alm.RootSystem', 'alm.RootSystem', ([], {'env_principle_target': '"""q1"""'}), "(env_principle_target='q1')\n", (424, 451), False, 'from phasor import alm\n'), ((604, ... |
import logging, os, re, sys,shutil
from code.utils.basic_utils import check_output_and_run
from pprint import pprint
from joblib import Parallel, delayed
from lxml import etree, html
from glob import glob
import zipfile
import csv
import requests
from requests_toolbelt import MultipartEncoder
import time
from Bio impor... | [
"os.remove",
"Bio.SeqIO.write",
"os.path.isfile",
"glob.glob",
"lxml.html.parse",
"os.path.exists",
"lxml.html.fromstring",
"requests.get",
"lxml.etree.parse",
"re.sub",
"requests.session",
"Bio.SeqIO.parse",
"os.path.basename",
"lxml.etree.XSLT",
"code.utils.basic_utils.check_output_and... | [((394, 423), 're.sub', 're.sub', (['"""xml$"""', '"""tsv"""', 'in_xml'], {}), "('xml$', 'tsv', in_xml)\n", (400, 423), False, 'import logging, os, re, sys, shutil\n'), ((4554, 4578), 'glob.glob', 'glob', (["(hmmer_dir + '/*fa')"], {}), "(hmmer_dir + '/*fa')\n", (4558, 4578), False, 'from glob import glob\n'), ((8155, ... |
import time
import logging
import os
import requests
import base64
logger = logging.getLogger()
def pytest_addoption(parser):
"""
Parse pytest options
:param parser: pytest buildin
"""
parser.addoption('--allure_server_addr', action='store', default=None, help='Allure server address: IP/domain na... | [
"time.time",
"os.path.isfile",
"base64.b64encode",
"requests.get",
"requests.post",
"os.listdir",
"logging.getLogger"
] | [((77, 96), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (94, 96), False, 'import logging\n'), ((1943, 1954), 'time.time', 'time.time', ([], {}), '()\n', (1952, 1954), False, 'import time\n'), ((3918, 3974), 'requests.post', 'requests.post', (['url'], {'json': 'data', 'headers': 'self.http_headers'}), '(... |
from concurrent.futures import ThreadPoolExecutor
import re
from pprint import pprint
from itertools import repeat
import logging
import netmiko
import paramiko
import yaml
logging.getLogger("paramiko").setLevel(logging.WARNING)
logging.getLogger("netmiko").setLevel(logging.WARNING)
logging.basicConfig(
format=... | [
"netmiko.Netmiko",
"itertools.repeat",
"logging.debug",
"logging.basicConfig",
"logging.info",
"yaml.safe_load",
"pprint.pprint",
"concurrent.futures.ThreadPoolExecutor",
"logging.getLogger"
] | [((288, 393), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(threadName)s %(name)s %(levelname)s: %(message)s"""', 'level': 'logging.INFO'}), "(format=\n '%(threadName)s %(name)s %(levelname)s: %(message)s', level=logging.INFO)\n", (307, 393), False, 'import logging\n'), ((464, 505), 'logging.in... |
import socket
s = socket.socket()
s.connect(('192.168.2.10', 1234))
data = s.recv(1024)
s.close()
print('Received', data)
| [
"socket.socket"
] | [((19, 34), 'socket.socket', 'socket.socket', ([], {}), '()\n', (32, 34), False, 'import socket\n')] |
from __future__ import print_function
import os
osName = os.name
clearCommand = 'cls' if osName == 'nt' else 'clear'
if osName == "nt":
import msvcrt
import colorama
colorama.init()
else:
import sys
import select
import tty
import termios
import threading
import time
import ... | [
"colorama.init",
"threading.Thread",
"sys.stdin.read",
"random.randint",
"termios.tcgetattr",
"msvcrt.getch",
"os.system",
"time.time",
"time.sleep",
"termios.tcsetattr",
"select.select",
"sys.stdin.fileno"
] | [((7164, 7203), 'threading.Thread', 'threading.Thread', ([], {'target': 'input_listener'}), '(target=input_listener)\n', (7180, 7203), False, 'import threading\n'), ((7492, 7505), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (7502, 7505), False, 'import time\n'), ((7517, 7530), 'time.sleep', 'time.sleep', (['(1)... |
from kha.episode import Episode
from kha.episode_patchers.episode_adder import EpisodeAdder
from kha.episode_patchers.episode_replacer import EpisodeReplacer
from kha.episode_patchers.noop_patcher import NoopPatcher
from kha.episode_patchers.patcher import Patcher
from kha.local_types import EventsDict, Uuid
def epis... | [
"kha.episode_patchers.noop_patcher.NoopPatcher"
] | [((421, 434), 'kha.episode_patchers.noop_patcher.NoopPatcher', 'NoopPatcher', ([], {}), '()\n', (432, 434), False, 'from kha.episode_patchers.noop_patcher import NoopPatcher\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Optional
from .base_model import BaseModel
__all__ = ['DSResNet']
class DoubleConvBlock(BaseModel):
def __init__(self, in_channels: int, out_channels: int):
super(DoubleConvBlock, self).__init__()
self.conv1... | [
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.BatchNorm2d",
"torch.nn.MaxPool2d",
"torch.nn.functional.interpolate"
] | [((1167, 1218), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels'], {'kernel_size': '(1)'}), '(in_channels, out_channels, kernel_size=1)\n', (1176, 1218), True, 'import torch.nn as nn\n'), ((1261, 1276), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', (['(2)'], {}), '(2)\n', (1273, 1276), True, 'import torch.nn as ... |
# Copyright (c) 2020 original 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"expertai.nlapi.v1.constants.LANGUAGES.keys"
] | [((935, 961), 'expertai.nlapi.v1.constants.LANGUAGES.keys', 'constants.LANGUAGES.keys', ([], {}), '()\n', (959, 961), False, 'from expertai.nlapi.v1 import constants\n')] |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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
# in the Software without restriction, including without limitation the rights
# to us... | [
"smarts.core.utils.sumo.sumolib.geomhelper.positionAtShapeOffset",
"os.path.isfile",
"numpy.linalg.norm",
"numpy.inner",
"trimesh.exchange.gltf.export_glb",
"numpy.interp",
"os.path.join",
"numpy.unique",
"shapely.geometry.Point",
"trimesh.Scene",
"shapely.geometry.Polygon",
"logging.warning",... | [((4537, 4557), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (4546, 4557), False, 'from functools import lru_cache\n'), ((26149, 26170), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(16)'}), '(maxsize=16)\n', (26158, 26170), False, 'from functools import lru_cache\n'), ((27621... |
import os
import pickle
import random
import numpy as np
import pandas as pd
from sklearn.neighbors import KDTree
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
base_path = cfg.DATASET_FOLDER
runs_folder = "oxford/"
filename = "pointcloud_locations_20m_10overlap.csv"
pointcloud_fols = "/pointcloud_20m_10overl... | [
"pandas.DataFrame",
"os.path.abspath",
"pickle.dump",
"os.path.join",
"random.shuffle",
"numpy.setdiff1d",
"sklearn.neighbors.KDTree"
] | [((2077, 2130), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['file', 'northing', 'easting']"}), "(columns=['file', 'northing', 'easting'])\n", (2089, 2130), True, 'import pandas as pd\n'), ((2139, 2192), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['file', 'northing', 'easting']"}), "(columns=['file... |