code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import os.path
import tempfile
class Locale:
def __init__(self, language: str, country: str = None):
self.__language = language
self.__country = country
@property
def language(self):
"""
Return the languag... | [
"os.path.exists",
"re.compile",
"os.path.splitext",
"re.sub",
"tempfile.TemporaryFile",
"os.remove"
] | [((2742, 2766), 'tempfile.TemporaryFile', 'tempfile.TemporaryFile', ([], {}), '()\n', (2764, 2766), False, 'import tempfile\n'), ((2775, 2800), 'os.path.exists', 'os.path.exists', (['file_name'], {}), '(file_name)\n', (2789, 2800), False, 'import os\n'), ((2858, 2885), 're.compile', 're.compile', (["('' + from_regex)"]... |
from face_detection import face_detect
import os
def createFolder(path, name):
index = ''
while True:
try:
file_path = os.path.join(path, name+index)
os.makedirs(file_path)
return file_path
except:
if index:
index = '('+str(int(ind... | [
"face_detection.face_detect",
"os.path.join",
"os.makedirs"
] | [((468, 507), 'os.makedirs', 'os.makedirs', (['"""faces/tmp"""'], {'exist_ok': '(True)'}), "('faces/tmp', exist_ok=True)\n", (479, 507), False, 'import os\n'), ((689, 717), 'face_detection.face_detect', 'face_detect', (['file_path', 'name'], {}), '(file_path, name)\n', (700, 717), False, 'from face_detection import fac... |
# Generated by Django 2.0 on 2018-02-27 02:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('events', '0010_userprofile_send_notifications'),
]
operations = [
migrations.CreateModel(
name='C... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((1208, 1338), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""Comma-separates list of tags"""', 'max_length': '(128)', 'null': '(True)', 'verbose_name': '"""Keyword Tags"""'}), "(blank=True, help_text='Comma-separates list of tags',\n max_length=128, null=True, verbose_n... |
"""
https://codingdojo.org/kata/PokerHands/
"""
from pocker_hands import PokerGame
def test_compare_highcard():
game = PokerGame(
player1="Black",
cards1="2H 3D 5S 9C KD",
player2="White",
cards2="2C 3H 4S 8C AH",
)
assert game.result() == "White wins. - with high card:... | [
"pocker_hands.PokerGame"
] | [((129, 227), 'pocker_hands.PokerGame', 'PokerGame', ([], {'player1': '"""Black"""', 'cards1': '"""2H 3D 5S 9C KD"""', 'player2': '"""White"""', 'cards2': '"""2C 3H 4S 8C AH"""'}), "(player1='Black', cards1='2H 3D 5S 9C KD', player2='White', cards2\n ='2C 3H 4S 8C AH')\n", (138, 227), False, 'from pocker_hands impor... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | [
"__builtin__.property",
"pyangbind.lib.yangtypes.RestrictedClassType"
] | [((9457, 9497), '__builtin__.property', '__builtin__.property', (['_get_vid', '_set_vid'], {}), '(_get_vid, _set_vid)\n', (9477, 9497), False, 'import __builtin__\n'), ((9506, 9546), '__builtin__.property', '__builtin__.property', (['_get_mac', '_set_mac'], {}), '(_get_mac, _set_mac)\n', (9526, 9546), False, 'import __... |
import re
from PyQt5.Qt import QObject
from PyQt5.QtWebEngineWidgets import QWebEngineProfile
from mc.common import const
from mc.app.Settings import Settings
class UserAgentManager(QObject):
def __init__(self, parent=None):
super().__init__(parent)
self._globalUserAgent = ''
self._defaultU... | [
"re.sub",
"PyQt5.QtWebEngineWidgets.QWebEngineProfile.defaultProfile",
"mc.app.Settings.Settings"
] | [((558, 637), 're.sub', 're.sub', (['"""QtWebEngine/[^\\\\s]+"""', "('App/%s' % const.VERSION)", 'self._defaultUserAgent'], {}), "('QtWebEngine/[^\\\\s]+', 'App/%s' % const.VERSION, self._defaultUserAgent)\n", (564, 637), False, 'import re\n'), ((686, 696), 'mc.app.Settings.Settings', 'Settings', ([], {}), '()\n', (694... |
from __future__ import print_function
from ddtrace import tracer, monkey
from nose.tools import ok_, eq_
if __name__ == '__main__':
ok_(not tracer.enabled)
eq_(len(monkey.get_patched_modules()), 0)
print("Test success")
| [
"nose.tools.ok_",
"ddtrace.monkey.get_patched_modules"
] | [((139, 162), 'nose.tools.ok_', 'ok_', (['(not tracer.enabled)'], {}), '(not tracer.enabled)\n', (142, 162), False, 'from nose.tools import ok_, eq_\n'), ((175, 203), 'ddtrace.monkey.get_patched_modules', 'monkey.get_patched_modules', ([], {}), '()\n', (201, 203), False, 'from ddtrace import tracer, monkey\n')] |
"""
-*- coding: utf-8 -*-
Time : 2019/7/15 21:49
Author : Hansybx
"""
import re
from bs4 import BeautifulSoup
from flask import jsonify
from app.models import db
from app.models.class_schedule import ClassSchedule
from app.models.error import AuthFailed, PasswordFailed
from app.utils.common_utils import sql_to... | [
"app.utils.login.login_util.login",
"app.models.class_schedule.ClassSchedule.query.filter",
"bs4.BeautifulSoup",
"app.utils.common_utils.sql_to_execute",
"app.models.db.session.commit",
"re.findall"
] | [((867, 886), 'app.models.db.session.commit', 'db.session.commit', ([], {}), '()\n', (884, 886), False, 'from app.models import db\n'), ((1494, 1519), 'app.utils.login.login_util.login', 'login', (['username', 'password'], {}), '(username, password)\n', (1499, 1519), False, 'from app.utils.login.login_util import login... |
# -*- Mode: Python -*-
import string
from ansible import errors
def make_ec2_tag_filters(*vm_tags):
"""Transform dictionary of vm tags to filters-by-tag for EC2 instances"""
all_tags = []
for d in vm_tags:
if not isinstance(d, dict):
raise AnsibleFilterError("|make_ec2_tag_filters ex... | [
"string.strip"
] | [((592, 608), 'string.strip', 'string.strip', (['s2'], {}), '(s2)\n', (604, 608), False, 'import string\n')] |
"""----------------------------------------------------------------------------"""
""" Copyright (c) FIRST 2017. All Rights Reserved. """
""" Open Source Software - may be modified and shared by FRC teams. The code """
""" must be accompanied by the FIRST BSD license file in the root direc... | [
"ntcore.value.Value.makeDoubleArray",
"ntcore.value.Value.makeDouble",
"ntcore.value.Value.makeStringArray",
"ntcore.value.Value.makeBoolean",
"ntcore.value.Value.makeRaw",
"ntcore.value.Value.makeString",
"ntcore.value.Value.makeBooleanArray"
] | [((771, 795), 'ntcore.value.Value.makeBoolean', 'Value.makeBoolean', (['(False)'], {}), '(False)\n', (788, 795), False, 'from ntcore.value import Value\n'), ((860, 883), 'ntcore.value.Value.makeBoolean', 'Value.makeBoolean', (['(True)'], {}), '(True)\n', (877, 883), False, 'from ntcore.value import Value\n'), ((964, 98... |
# encoding:utf-8
import requests
from bs4 import BeautifulSoup
import threadpool
import sys
import getopt
s = requests.session()
def tvLists():
basicUrl = 'http://www.zhuixinfan.com/main.php?mod=viewall&action=tvplay&area=1&alpha=&orderby=fp_date&sort=DESC&inajax=1'
r = s.get(url=basicUrl)
tmpData = (((... | [
"getopt.getopt",
"requests.session",
"threadpool.makeRequests",
"bs4.BeautifulSoup",
"sys.exit"
] | [((112, 130), 'requests.session', 'requests.session', ([], {}), '()\n', (128, 130), False, 'import requests\n'), ((452, 482), 'bs4.BeautifulSoup', 'BeautifulSoup', (['tmpData', '"""lxml"""'], {}), "(tmpData, 'lxml')\n", (465, 482), False, 'from bs4 import BeautifulSoup\n'), ((838, 874), 'bs4.BeautifulSoup', 'BeautifulS... |
# -*- coding: utf-8 -*-
#
# smartz.eth.contracts
#
from smartz.json_schema import load_schema, add_definitions, assert_conforms2definition, assert_conforms2schema_part
def abi_arguments2schema(abi_args_array):
"""
Конвертация массива аргументов функции контракта в json schema, пригодную для отрисовки и вал... | [
"smartz.json_schema.load_schema"
] | [((3428, 3466), 'smartz.json_schema.load_schema', 'load_schema', (['"""public/constructor.json"""'], {}), "('public/constructor.json')\n", (3439, 3466), False, 'from smartz.json_schema import load_schema, add_definitions, assert_conforms2definition, assert_conforms2schema_part\n'), ((1674, 1712), 'smartz.json_schema.lo... |
import os, glob
import pandas as pd
# Merge CSVs and then do data manipulation
'''path = "/Users/saslan.19/Desktop/Programming/Music Recommendation/RYMScraper/examples/Exports"
all_files = sorted(glob.glob(os.path.join(path, "*.csv")))
print(all_files)
df_from_each_file = (pd.read_csv(f, sep=None, engine='python') fo... | [
"pandas.read_csv",
"pandas.set_option"
] | [((439, 464), 'pandas.read_csv', 'pd.read_csv', (['"""merged.csv"""'], {}), "('merged.csv')\n", (450, 464), True, 'import pandas as pd\n'), ((655, 723), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', 'None', '"""display.max_columns"""', 'None'], {}), "('display.max_rows', None, 'display.max_columns',... |
# python3
# -*- coding: utf-8 -*-
# @Time : 2022/1/16 22:02
# @Author : yzyyz
# @Email : <EMAIL>
# @File : notice.py
# @Software: PyCharm
from nonebot import on_command, logger
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent, MessageEvent
from nonebot.adapters.onebot.v11.permission import GROU... | [
"nonebot.on_command",
"nonebot.logger.info",
"nonebot.params.State"
] | [((530, 651), 'nonebot.on_command', 'on_command', (['"""分管"""'], {'aliases': "{'/gad', '/分群管理'}", 'priority': '(1)', 'block': '(True)', 'permission': '(GROUP_ADMIN | GROUP_OWNER | SUPERUSER)'}), "('分管', aliases={'/gad', '/分群管理'}, priority=1, block=True,\n permission=GROUP_ADMIN | GROUP_OWNER | SUPERUSER)\n", (540, 6... |
import numpy as np
raw = open("inputs/7.txt","r").readline()
input_array= [int(i) for i in np.asarray(raw.split(","))]
test_array = [16,1,2,0,4,2,7,1,2,14]
def alignCrabsPartOne(input):
result_array=[]
for i in range(min(input), max(input)+1):
result_array.append(sum([abs((horizontalPos-i)) for horizontalPos in i... | [
"numpy.amin"
] | [((439, 460), 'numpy.amin', 'np.amin', (['result_array'], {}), '(result_array)\n', (446, 460), True, 'import numpy as np\n'), ((784, 805), 'numpy.amin', 'np.amin', (['result_array'], {}), '(result_array)\n', (791, 805), True, 'import numpy as np\n'), ((398, 419), 'numpy.amin', 'np.amin', (['result_array'], {}), '(resul... |
#!/usr/bin/env python3
# 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 glob
import os
import random
import numpy as np
import pytest
try:
import torch
import torch.distribute... | [
"torch.manual_seed",
"habitat_baselines.config.default.get_config",
"random.seed",
"torch.set_num_threads",
"pytest.mark.parametrize",
"habitat_baselines.common.baseline_registry.baseline_registry.get_trainer",
"habitat_sim.utils.datasets_download.main",
"torch.cuda.is_available",
"numpy.random.seed... | [((761, 852), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not baseline_installed)'], {'reason': '"""baseline sub-module not installed"""'}), "(not baseline_installed, reason=\n 'baseline sub-module not installed')\n", (779, 852), False, 'import pytest\n'), ((855, 998), 'pytest.mark.parametrize', 'pytest.mark.par... |
import json
with open("status.json", "r") as myfile:
myjson = json.load(myfile)
downed_servers = []
for serv in myjson:
print(serv)
if serv["state"] == "down":
print("this one is down")
downed_servers.append(serv["server"])
print(f"the following is a list of all th... | [
"json.load"
] | [((67, 84), 'json.load', 'json.load', (['myfile'], {}), '(myfile)\n', (76, 84), False, 'import json\n')] |
# Generated by Django 3.1.2 on 2022-02-13 14:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Ability',
fields=[
... | [
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((336, 429), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (352, 429), False, 'from django.db import migrations, models\... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | [
"datahub.access.tests.db_helper.open_cursor",
"datahub.access.tests.db_helper.execute",
"datahub.databus.channel.create_kafka_topic",
"datahub.databus.channel.delete_kafka_topic",
"datahub.access.tests.db_helper.insert"
] | [((4662, 4721), 'datahub.databus.channel.create_kafka_topic', 'channel.create_kafka_topic', (["ARGS['kafka_bs']", "ARGS['topic']"], {}), "(ARGS['kafka_bs'], ARGS['topic'])\n", (4688, 4721), False, 'from datahub.databus import channel, settings\n'), ((5030, 5075), 'datahub.databus.channel.delete_kafka_topic', 'channel.d... |
from .views import yaml_to_html
try:
from django.urls import path
urlpatterns = [
path('api-doc/', yaml_to_html, name="api-doc"),
]
except:
from django.conf.urls import url
urlpatterns = [
url(r'^api-doc/', yaml_to_html, name="api-doc"),
]
| [
"django.urls.path",
"django.conf.urls.url"
] | [((102, 148), 'django.urls.path', 'path', (['"""api-doc/"""', 'yaml_to_html'], {'name': '"""api-doc"""'}), "('api-doc/', yaml_to_html, name='api-doc')\n", (106, 148), False, 'from django.urls import path\n'), ((231, 277), 'django.conf.urls.url', 'url', (['"""^api-doc/"""', 'yaml_to_html'], {'name': '"""api-doc"""'}), "... |
from __future__ import annotations
import traceback
from threading import Thread
from time import sleep
from typing import Callable
from tealprint import TealPrint
def start_thread(function: Callable, seconds_between_calls: float = 1, delay: float = 0) -> None:
"""Start a function in another thread as a daemon"... | [
"tealprint.TealPrint.info",
"traceback.format_exc",
"time.sleep",
"tealprint.TealPrint.warning",
"threading.Thread"
] | [((336, 410), 'threading.Thread', 'Thread', ([], {'target': '_run_forever', 'args': '(function, seconds_between_calls, delay)'}), '(target=_run_forever, args=(function, seconds_between_calls, delay))\n', (342, 410), False, 'from threading import Thread\n'), ((566, 625), 'tealprint.TealPrint.info', 'TealPrint.info', (['... |
#!/usr/bin/env python
#
# Copyright 2011-2015 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 applicable... | [
"six.moves.input",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"getpass.getpass",
"os.path.dirname",
"matplotlib.pyplot.bar",
"python.utils.parse",
"splunklib.client.connect",
"pandas.DataFrame",
"matplotlib.pyplot.show"
] | [((1393, 1413), 'pandas.DataFrame', 'pd.DataFrame', (['events'], {}), '(events)\n', (1405, 1413), True, 'import pandas as pd\n'), ((1557, 1592), 'matplotlib.pyplot.bar', 'plt.bar', (["df['hashtag']", "df['count']"], {}), "(df['hashtag'], df['count'])\n", (1564, 1592), True, 'import matplotlib.pyplot as plt\n'), ((1597,... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Figure 6B
# Relative frequency of each variant of each sub-library
# Python script was run in JupyterLab
# set file name
save = 'fig_unique_freq.png'
# set p to 100 to show y-axis as percent
# set p to 1 to show y-axis as a decimal
p = 1
# R... | [
"pandas.read_pickle",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((370, 393), 'pandas.read_pickle', 'pd.read_pickle', (['pklfile'], {}), '(pklfile)\n', (384, 393), True, 'import pandas as pd\n'), ((432, 455), 'pandas.read_pickle', 'pd.read_pickle', (['pklfile'], {}), '(pklfile)\n', (446, 455), True, 'import pandas as pd\n'), ((494, 517), 'pandas.read_pickle', 'pd.read_pickle', (['p... |
import _pickle, numpy as np, itertools as it
from time import perf_counter
# from cppimport import import_hook
#
# # import cppimport
#
# # cppimport.set_quiet(False)
#
import rpxdock as rp
from rpxdock.bvh import bvh_test
from rpxdock.bvh import BVH, bvh
import rpxdock.homog as hm
def test_bvh_isect_cpp():
assert... | [
"rpxdock.bvh.bvh.naive_isect_range",
"rpxdock.bvh.bvh.bvh_collect_pairs_range_vec",
"numpy.random.rand",
"rpxdock.bvh.bvh.naive_isect_fixed",
"rpxdock.bvh.bvh.bvh_isect_fixed_range_vec",
"rpxdock.bvh.bvh.bvh_count_pairs_vec",
"_pickle.dump",
"numpy.array",
"rpxdock.bvh.BVH",
"numpy.linalg.norm",
... | [((321, 351), 'rpxdock.bvh.bvh_test.TEST_bvh_test_isect', 'bvh_test.TEST_bvh_test_isect', ([], {}), '()\n', (349, 351), False, 'from rpxdock.bvh import bvh_test\n'), ((3652, 3680), 'rpxdock.bvh.bvh_test.TEST_bvh_test_min', 'bvh_test.TEST_bvh_test_min', ([], {}), '()\n', (3678, 3680), False, 'from rpxdock.bvh import bvh... |
#!/usr/bin/env python3
# EasyGoPiGo3 documentation: https://gopigo3.readthedocs.io/en/latest
#
########################################################################
# This example demonstrates using the distance sensor with the GoPiGo
# In this examples, the GoPiGo keeps reading from the distance sensor
# When it cl... | [
"easygopigo3.EasyGoPiGo3",
"time.sleep"
] | [((1126, 1144), 'easygopigo3.EasyGoPiGo3', 'easy.EasyGoPiGo3', ([], {}), '()\n', (1142, 1144), True, 'import easygopigo3 as easy\n'), ((2719, 2734), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (2729, 2734), False, 'import time\n')] |
from __future__ import absolute_import
from __future__ import print_function
from loqui.client import LoquiClient
client = LoquiClient(('localhost', 4001))
print(len(client.send_request('hello world'))) | [
"loqui.client.LoquiClient"
] | [((124, 156), 'loqui.client.LoquiClient', 'LoquiClient', (["('localhost', 4001)"], {}), "(('localhost', 4001))\n", (135, 156), False, 'from loqui.client import LoquiClient\n')] |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | [
"os.path.exists",
"six.moves.configparser.RawConfigParser",
"boto3.Session",
"os.path.join",
"os.environ.get",
"time.sleep",
"os.getcwd",
"os.path.isfile",
"os.path.dirname",
"os.path.basename",
"six.StringIO",
"json.load"
] | [((2062, 2073), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2071, 2073), False, 'import os\n'), ((2211, 2261), 'os.path.join', 'os.path.join', (['root_directory_path', '"""bootstrap.cfg"""'], {}), "(root_directory_path, 'bootstrap.cfg')\n", (2223, 2261), False, 'import os\n'), ((3461, 3495), 'os.path.isfile', 'os.path... |
import os
import copy
import logging
import time
import numpy as np
np.seterr(divide='ignore', invalid='ignore')
from prune import prune
logging_path = os.path.join(os.getcwd(), "text_log.log")
logging.basicConfig(level=logging.INFO,
format="%(levelname)s - %(asctime)s - %(msg)s",
datefmt="%Y-%m-%d %H:%M:%S... | [
"numpy.multiply",
"logging.StreamHandler",
"copy.deepcopy",
"numpy.where",
"time.time",
"os.getcwd",
"numpy.linspace",
"prune.prune_sum_eq_len",
"numpy.empty",
"numpy.dot",
"numpy.isnan",
"logging.FileHandler",
"numpy.nansum",
"numpy.seterr",
"numpy.nan_to_num",
"prune.prune"
] | [((69, 113), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (78, 113), True, 'import numpy as np\n'), ((168, 179), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (177, 179), False, 'import os\n'), ((871, 905), 'numpy.linspace', 'np.linspac... |
'''
########################################################################
# #
# milkShake.py #
# #
# Email: <EM... | [
"math.acos",
"maya.OpenMaya.MMatrix",
"maya.OpenMaya.MEulerRotation",
"maya.OpenMaya.MFnNumericAttribute",
"maya.OpenMaya.MDistance",
"maya.OpenMaya.MTypeId",
"maya.OpenMaya.MPoint",
"maya.OpenMaya.MFnUnitAttribute",
"maya.OpenMaya.MAngle",
"maya.OpenMayaMPx.MFnPlugin",
"sys.stderr.write",
"ma... | [((1694, 1721), 'maya.OpenMaya.MTypeId', 'OpenMaya.MTypeId', (['(264976709)'], {}), '(264976709)\n', (1710, 1721), True, 'import maya.OpenMaya as OpenMaya\n'), ((16368, 16398), 'maya.OpenMaya.MFnNumericAttribute', 'OpenMaya.MFnNumericAttribute', ([], {}), '()\n', (16396, 16398), True, 'import maya.OpenMaya as OpenMaya\... |
#!/usr/bin/env python
'''
Main program that converts pcaps to HAR's.
'''
import os
import optparse
import logging
import sys
import json
from pcap2har import pcap
from pcap2har import http
from pcap2har import httpsession
from pcap2har import har
from pcap2har import tcp
from pcap2har import settings
from pcap2har.p... | [
"logging.basicConfig",
"pcap2har.pcap.EasyParsePcap",
"optparse.OptionParser",
"pcap2har.pcaputil.print_rusage",
"pcap2har.httpsession.HttpSession",
"sys.exit",
"logging.info",
"json.dump"
] | [((441, 505), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': '"""usage: %prog inputfile outputfile"""'}), "(usage='usage: %prog inputfile outputfile')\n", (462, 505), False, 'import optparse\n'), ((1659, 1724), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'options.logfile', 'level':... |
# Copyright (c) 2019-2020, <NAME>
# License: MIT-License
import math
import re
from typing import TYPE_CHECKING, List, Sequence, Iterable
from typing import Tuple, Optional
from xml.etree import ElementTree
from ezdxf.lldxf import validator
from ezdxf.lldxf.attributes import (
DXFAttributes, DefSubclass, DXFAttr, ... | [
"ezdxf.lldxf.const.InvalidGeoDataException",
"ezdxf.lldxf.validator.is_in_integer_range",
"math.isclose",
"ezdxf.math.Vec2",
"ezdxf.lldxf.const.DXFStructureError",
"math.atan2",
"ezdxf.lldxf.attributes.DXFAttributes",
"ezdxf.lldxf.attributes.DXFAttr",
"re.sub",
"xml.etree.ElementTree.fromstring",
... | [((7221, 7261), 'ezdxf.lldxf.attributes.DXFAttributes', 'DXFAttributes', (['base_class', 'acdb_geo_data'], {}), '(base_class, acdb_geo_data)\n', (7234, 7261), False, 'from ezdxf.lldxf.attributes import DXFAttributes, DefSubclass, DXFAttr, XType, RETURN_DEFAULT\n'), ((20206, 20245), 're.sub', 're.sub', (['"""xmlns="[^"]... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 30 09:06:40 2021
@author: subhash
"""
import numpy as np
import matplotlib.pyplot as plt
import laspy as lp
input_path = "C:\\"
dataname = "2020_Drone_M"
point_cloud=lp.file.File(input_path+dataname+".las", mode="r")
print(type(point_cloud))
print(point_cloud)
points ... | [
"laspy.file.File",
"numpy.asarray",
"open3d.visualization.draw_geometries",
"numpy.vstack",
"open3d.geometry.PointCloud",
"open3d.utility.Vector3dVector"
] | [((215, 269), 'laspy.file.File', 'lp.file.File', (["(input_path + dataname + '.las')"], {'mode': '"""r"""'}), "(input_path + dataname + '.las', mode='r')\n", (227, 269), True, 'import laspy as lp\n'), ((695, 720), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {}), '()\n', (718, 720), True, 'import open3... |
import threading
from enum import IntEnum
class Mode(IntEnum):
Cold = 0
Hot = 1
class WindLevel(IntEnum):
NoWind = 0
Level_1 = 1
Level_2 = 2
Level_3 = 3
class Algorithm(IntEnum):
Priority = 0
RR = 1
class Server(object):
"""
服务器,是单例模式
"""
_instance_lock = threadi... | [
"threading.Lock"
] | [((313, 329), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (327, 329), False, 'import threading\n'), ((736, 752), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (750, 752), False, 'import threading\n')] |
import numpy as np
from scipy import integrate
from floris.utils.tools import valid_ops as vops
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# MISCELLANEOUS #
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++... | [
"numpy.abs",
"numpy.sqrt",
"floris.utils.tools.valid_ops.wake_overlap_ellipse",
"numpy.exp",
"numpy.array",
"floris.utils.tools.valid_ops.find_and_load_model",
"numpy.cos",
"numpy.sin"
] | [((741, 754), 'numpy.sqrt', 'np.sqrt', (['beta'], {}), '(beta)\n', (748, 754), True, 'import numpy as np\n'), ((1001, 1107), 'numpy.exp', 'np.exp', (['(-((z - z_hub) ** 2 / (2 * (sigma_z_D_r * D_r) ** 2)) - y ** 2 / (2 * (\n sigma_y_D_r * D_r) ** 2))'], {}), '(-((z - z_hub) ** 2 / (2 * (sigma_z_D_r * D_r) ** 2)) - y... |
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
from PyQt5 import QtCore, QtGui
from .views import *
from .models import State, StateListener, KeyboardNotifier
from .styles import Theme
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("UltimateLa... | [
"PyQt5.QtGui.QDesktopServices.openUrl",
"PyQt5.QtCore.QUrl",
"PyQt5.QtGui.QMessageBox.warning"
] | [((1645, 1707), 'PyQt5.QtCore.QUrl', 'QtCore.QUrl', (['"""https://github.com/alexandre01/UltimateLabeling"""'], {}), "('https://github.com/alexandre01/UltimateLabeling')\n", (1656, 1707), False, 'from PyQt5 import QtCore, QtGui\n'), ((1723, 1758), 'PyQt5.QtGui.QDesktopServices.openUrl', 'QtGui.QDesktopServices.openUrl'... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"qiskit.transpiler.passes.CountOpsLongestPath",
"qiskit.converters.circuit_to_dag",
"unittest.main",
"qiskit.QuantumCircuit",
"qiskit.QuantumRegister"
] | [((1853, 1868), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1866, 1868), False, 'import unittest\n'), ((921, 937), 'qiskit.QuantumCircuit', 'QuantumCircuit', ([], {}), '()\n', (935, 937), False, 'from qiskit import QuantumCircuit, QuantumRegister\n'), ((952, 975), 'qiskit.converters.circuit_to_dag', 'circuit_t... |
import pandas as pd
from scipy.stats import t, sem
import matplotlib.pyplot as plt # for plot grapg
df_temp = pd.read_csv("../Data/NodeTemperature.csv") # Load the csv file
df_temp.AbsT = pd.to_datetime(df_temp.AbsT)
# convert data-time text into actual datetime list
df_temp = df_temp.set_index("AbsT") # set "AbsT" ... | [
"matplotlib.pyplot.grid",
"pandas.read_csv",
"matplotlib.pyplot.xlabel",
"pandas.to_datetime",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"scipy.stats.sem",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((113, 155), 'pandas.read_csv', 'pd.read_csv', (['"""../Data/NodeTemperature.csv"""'], {}), "('../Data/NodeTemperature.csv')\n", (124, 155), True, 'import pandas as pd\n'), ((191, 219), 'pandas.to_datetime', 'pd.to_datetime', (['df_temp.AbsT'], {}), '(df_temp.AbsT)\n', (205, 219), True, 'import pandas as pd\n'), ((410... |
# Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWa... | [
"selenium.webdriver.common.action_chains.ActionChains",
"selenium.webdriver.Firefox",
"selenium.webdriver.firefox.firefox_binary.FirefoxBinary",
"time.sleep"
] | [((513, 577), 'selenium.webdriver.firefox.firefox_binary.FirefoxBinary', 'FirefoxBinary', (['"""C:\\\\Program Files\\\\Mozilla Firefox\\\\firefox.exe"""'], {}), "('C:\\\\Program Files\\\\Mozilla Firefox\\\\firefox.exe')\n", (526, 577), False, 'from selenium.webdriver.firefox.firefox_binary import FirefoxBinary\n'), ((5... |
import sys
import os
sys.path.append(os.getcwd())
import torch
from training_structures.Supervised_Learning import train, test
from objective_functions.recon import sigmloss1d
from objective_functions.objectives_for_supervised_learning import MFM_objective
from fusions.common_fusions import Concat
from datasets.imdb.... | [
"unimodals.common_models.MaxOut_MLP",
"fusions.common_fusions.Concat",
"torch.load",
"os.getcwd",
"unimodals.common_models.Linear",
"training_structures.Supervised_Learning.train",
"datasets.imdb.get_data.get_dataloader",
"torch.nn.BCEWithLogitsLoss",
"unimodals.common_models.MLP"
] | [((515, 611), 'datasets.imdb.get_data.get_dataloader', 'get_dataloader', (['"""../video/multimodal_imdb.hdf5"""', '"""../video/mmimdb"""'], {'vgg': '(True)', 'batch_size': '(128)'}), "('../video/multimodal_imdb.hdf5', '../video/mmimdb', vgg=True,\n batch_size=128)\n", (529, 611), False, 'from datasets.imdb.get_data ... |
import unittest
import os
from alphatwirl.configure import TableConfigCompleter
##__________________________________________________________________||
class MockDefaultSummary: pass
##__________________________________________________________________||
class MockSummary2: pass
##____________________________________... | [
"alphatwirl.configure.TableConfigCompleter"
] | [((757, 877), 'alphatwirl.configure.TableConfigCompleter', 'TableConfigCompleter', ([], {'defaultSummaryClass': 'MockDefaultSummary', 'defaultWeight': 'self.defaultWeight', 'defaultOutDir': '"""tmp"""'}), "(defaultSummaryClass=MockDefaultSummary, defaultWeight=\n self.defaultWeight, defaultOutDir='tmp')\n", (777, 87... |
import os
import sys
import inspect
from unittest import TestCase
from chatterbot import corpus
from chatterbot import languages
from chatterbot.constants import STATEMENT_TEXT_MAX_LENGTH
from chatterbot_corpus.corpus import DATA_DIRECTORY
class CorpusUtilsTestCase(TestCase):
"""
This test case is designed t... | [
"os.listdir",
"inspect.getmembers",
"chatterbot.corpus.list_corpus_files",
"inspect.isclass",
"chatterbot.corpus.load_corpus"
] | [((556, 601), 'chatterbot.corpus.list_corpus_files', 'corpus.list_corpus_files', (['"""chatterbot_corpus"""'], {}), "('chatterbot_corpus')\n", (580, 601), False, 'from chatterbot import corpus\n'), ((657, 683), 'chatterbot.corpus.load_corpus', 'corpus.load_corpus', (['*files'], {}), '(*files)\n', (675, 683), False, 'fr... |
#!/usr/bin/env python3
import sqlite3
from os import listdir
from os.path import isfile, join
from common.file import r_readlines
class DictionaryEntry:
image_name: str
image_id: int
sfm_keypoint: int
mvs_keypoint: int
def __init__(self, name: str = "", id: int = 0,
sfm: int = 0... | [
"os.listdir",
"os.path.join",
"sqlite3.connect"
] | [((480, 500), 'os.path.join', 'join', (['"""/"""', '"""working"""'], {}), "('/', 'working')\n", (484, 500), False, 'from os.path import isfile, join\n'), ((512, 534), 'os.path.join', 'join', (['BASE_DIR', '"""logs"""'], {}), "(BASE_DIR, 'logs')\n", (516, 534), False, 'from os.path import isfile, join\n'), ((545, 584), ... |
#!/usr/bin/env python
"""
Compare two metrics files.
"""
import sys
import argparse
import math
import re
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import svtest.utils.IOUtils as iou
WIDTH = 10.24
HEIGHT_SCALE = 0.15
MAX_ROWS_PER_PLOT = 500
def main(ar... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"svtest.utils.IOUtils.read_samples_list",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"sys.exit",
"pandas.DataFrame",
"re.sub",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.xscale"
] | [((338, 468), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'prog': '"""svtest plot-metrics"""', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), "(description=__doc__, prog='svtest plot-metrics',\n formatter_class=argparse.RawDescriptionHelpFormatter)\n", (361, 46... |
from django.shortcuts import render
from django.http.response import HttpResponse
import logging
import traceback
logger = logging.getLogger("django")
def index(request):
try:
return render(request, "index.html")
except:
logging.error(traceback.format_exc())
| [
"logging.getLogger",
"traceback.format_exc",
"django.shortcuts.render"
] | [((124, 151), 'logging.getLogger', 'logging.getLogger', (['"""django"""'], {}), "('django')\n", (141, 151), False, 'import logging\n'), ((197, 226), 'django.shortcuts.render', 'render', (['request', '"""index.html"""'], {}), "(request, 'index.html')\n", (203, 226), False, 'from django.shortcuts import render\n'), ((261... |
from string import digits, Template
from typing import *
from .marker import Marker
class Sql:
"""
Provides functionalities to render SQL string from the template containing placeholder markers.
SQL rendering is conform to the way of `string.Template` which replaces ``$`` prefixed variables with... | [
"string.Template"
] | [((1460, 1483), 'string.Template', 'Template', (['self.template'], {}), '(self.template)\n', (1468, 1483), False, 'from string import digits, Template\n')] |
import os
from shutil import copyfile
import importlib
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db import models
from django import setup
import mozumder
class Command(BaseCommand):
help = 'Modify Django Settings and URLs to enable an app.'
def a... | [
"os.environ.get",
"os.getcwd"
] | [((586, 626), 'os.environ.get', 'os.environ.get', (['"""DJANGO_SETTINGS_MODULE"""'], {}), "('DJANGO_SETTINGS_MODULE')\n", (600, 626), False, 'import os\n'), ((730, 741), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (739, 741), False, 'import os\n'), ((888, 899), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (897, 899), Fa... |
import time
import numpy as np
import copy
import matplotlib.pyplot as plt
import scipy.stats
import sklearn.metrics
import sklearn.utils.validation
def accuracy(y, p_pred):
"""
Computes the accuracy.
Parameters
----------
y : array-like
Ground truth labels.
p_pred : array-like
... | [
"numpy.clip",
"numpy.histogram",
"numpy.average",
"numpy.argmax",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.linspace",
"numpy.isnan",
"numpy.concatenate",
"copy.deepcopy",
"numpy.shape",
"numpy.isinf",
"time.time",
"numpy.var"
] | [((2036, 2061), 'numpy.argmax', 'np.argmax', (['p_pred'], {'axis': '(1)'}), '(p_pred, axis=1)\n', (2045, 2061), True, 'import numpy as np\n'), ((2286, 2337), 'numpy.linspace', 'np.linspace', (['bin_range[0]', 'bin_range[1]', '(n_bins + 1)'], {}), '(bin_range[0], bin_range[1], n_bins + 1)\n', (2297, 2337), True, 'import... |
from django import forms
from .models import Member, get_config
from .util import validate_country
class MemberForm(forms.ModelForm):
class Meta:
model = Member
fields = ('fullname', 'country', 'listed')
def clean_country(self):
if self.instance.country_exception:
# No co... | [
"django.forms.CharField"
] | [((579, 715), 'django.forms.CharField', 'forms.CharField', ([], {'min_length': '(5)', 'max_length': '(100)', 'help_text': '"""Name of proxy voter. Leave empty to cancel proxy voting."""', 'required': '(False)'}), "(min_length=5, max_length=100, help_text=\n 'Name of proxy voter. Leave empty to cancel proxy voting.',... |
import tradier
t = tradier.Tradier(access_token="<KEY>")
options_expirations = t.get_options_expirations("GME",strikes=True)['expirations']['expiration']
all_strikes = set()
for expiration in options_expirations:
date = expiration['date']
strikes = expiration['strikes']['strike']
all_strikes = all_strik... | [
"tradier.Tradier"
] | [((20, 57), 'tradier.Tradier', 'tradier.Tradier', ([], {'access_token': '"""<KEY>"""'}), "(access_token='<KEY>')\n", (35, 57), False, 'import tradier\n')] |
from cm.html.aboutus import aboutus
from cm.html.home import home
from cm.html.login import login
from cm.html.logout import logout
from cm.html.help import help
from cm.html.admin import admin
from cm.html.search import search
from cm import config, error
from cm.user import User
from quixote.util import StaticDirect... | [
"cm.htmllib.base.header",
"quixote.util.StaticDirectory",
"cm.user.User",
"cm.htmllib.base.footer",
"cm.htmllib.Message",
"cm.session.get_session_manager"
] | [((333, 379), 'quixote.util.StaticDirectory', 'StaticDirectory', (['config.GRAPH_DIR'], {'use_cache': '(0)'}), '(config.GRAPH_DIR, use_cache=0)\n', (348, 379), False, 'from quixote.util import StaticDirectory\n'), ((2616, 2625), 'cm.htmllib.Message', 'Message', ([], {}), '()\n', (2623, 2625), False, 'from cm.htmllib im... |
# -*- coding: utf-8 -*-
# Copyright © 2019 <NAME>, <NAME>
# Made available under the MIT license.
import unittest
from unittest import mock
from urban_eater.importers.thrillist import thrillist
TEST_FILE = "testdata/page.html"
TEST_RESTAURANTS_NAME = "Beast"
TEST_RESTAURANTS_URL = "https://www.beastpdx.com/"
TEST_RE... | [
"urban_eater.importers.thrillist.thrillist.Thrillist",
"unittest.mock.MagicMock"
] | [((1598, 1614), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (1612, 1614), False, 'from unittest import mock\n'), ((1641, 1679), 'urban_eater.importers.thrillist.thrillist.Thrillist', 'thrillist.Thrillist', (['self.mock_fetcher'], {}), '(self.mock_fetcher)\n', (1660, 1679), False, 'from urban_eater.im... |
# Generated by Django 3.2.8 on 2021-11-17 13:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Ruby', '0003_auto_20211117_1334'),
]
operations = [
migrations.AlterField(
model_name='user',
... | [
"django.db.models.ForeignKey"
] | [((367, 498), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""users"""', 'to': '"""Ruby.product"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, related_name='users', to... |
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.metrics import roc_curve
from src.training import get_train_and_test_data, train_model, get_y_probabilities
from utils.enumerations import Directories, Values
def get_roc_metrics(data_table: pd.DataFrame, model):
"""Get fpr, tpr and threshold"""
... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"src.training.get_y_probabilities",
"sklearn.metrics.roc_curve",
"src.training.get_train_and_test_data",
"src.training.train_model",
"matplotlib.pyplot.title",
... | [((359, 394), 'src.training.get_train_and_test_data', 'get_train_and_test_data', (['data_table'], {}), '(data_table)\n', (382, 394), False, 'from src.training import get_train_and_test_data, train_model, get_y_probabilities\n'), ((416, 452), 'src.training.train_model', 'train_model', (['X_train', 'y_train', 'model'], {... |
import logging
from classification_model.config.core import PACKAGE_ROOT, config
# It is strongly advised that you do not add any handlers other than
# NullHandler to your library’s loggers. This is because the configuration
# of handlers is the prerogative of the application developer who uses your
# library. The ap... | [
"logging.NullHandler",
"logging.getLogger"
] | [((732, 753), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (751, 753), False, 'import logging\n'), ((671, 720), 'logging.getLogger', 'logging.getLogger', (['config.app_config.package_name'], {}), '(config.app_config.package_name)\n', (688, 720), False, 'import logging\n')] |
#
# Copyright (c) 2015-2021 University of Antwerp, Aloxy NV.
#
# This file is part of pyd7a.
# See https://github.com/Sub-IoT/pyd7a for further info.
#
# 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 Lice... | [
"d7a.support.schema.Types.BOOLEAN"
] | [((815, 830), 'd7a.support.schema.Types.BOOLEAN', 'Types.BOOLEAN', ([], {}), '()\n', (828, 830), False, 'from d7a.support.schema import Validatable, Types\n'), ((846, 861), 'd7a.support.schema.Types.BOOLEAN', 'Types.BOOLEAN', ([], {}), '()\n', (859, 861), False, 'from d7a.support.schema import Validatable, Types\n'), (... |
import typing as T
from functools import wraps
from unittest import mock
from unittest.mock import call
import pytest
from cumulusci.core import exceptions as exc
from cumulusci.tasks.bulkdata.step import (
DataApi,
DataOperationJobResult,
DataOperationResult,
DataOperationStatus,
DataOperationTyp... | [
"unittest.mock.Mock",
"unittest.mock.call",
"functools.wraps",
"pytest.mark.needs_org",
"cumulusci.tasks.bulkdata.tests.integration_test_utils.ensure_accounts",
"pytest.raises",
"cumulusci.tasks.bulkdata.step.DataOperationResult",
"unittest.mock.patch"
] | [((15965, 15988), 'pytest.mark.needs_org', 'pytest.mark.needs_org', ([], {}), '()\n', (15986, 15988), False, 'import pytest\n'), ((922, 933), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (927, 933), False, 'from functools import wraps\n'), ((6215, 6226), 'unittest.mock.Mock', 'mock.Mock', ([], {}), '()\n', (... |
"""
DATAQ 4108 Device Level code
author: <NAME>
Date: November 2017- April 2019
fully python3 compatible.
The main purpose of this module is to provide useful interface between DI-4108 and a server system level code that does all numbercrynching. This modules only job is to attend DI-4108 and insure that all d... | [
"caproto.server.pvproperty",
"textwrap.dedent",
"numpy.zeros",
"caproto.server.run"
] | [((1536, 1647), 'caproto.server.pvproperty', 'pvproperty', ([], {'value': 'arr_logging', 'dtype': 'int', 'max_length': '(logging_shape[0] * logging_shape[1] * logging_shape[2])'}), '(value=arr_logging, dtype=int, max_length=logging_shape[0] *\n logging_shape[1] * logging_shape[2])\n', (1546, 1647), False, 'from capr... |
import PySimpleGUI as sg
from PySimpleGUI import WINDOW_CLOSED
from utils import create_window, SUCCESS, format_error_message, plot_user_fn, format_error_message, default_fn,default_x_min,default_x_max, HelpAbout
def main():
fig_canvas_agg, fig, window = create_window()
plot_user_fn(default_fn,default_x_mi... | [
"PySimpleGUI.popup",
"utils.format_error_message",
"utils.create_window",
"utils.plot_user_fn"
] | [((264, 279), 'utils.create_window', 'create_window', ([], {}), '()\n', (277, 279), False, 'from utils import create_window, SUCCESS, format_error_message, plot_user_fn, format_error_message, default_fn, default_x_min, default_x_max, HelpAbout\n'), ((284, 359), 'utils.plot_user_fn', 'plot_user_fn', (['default_fn', 'def... |
from datetime import datetime
import os
from pathlib import Path
import warnings
import pickle
from typing import List, Dict, Any
from thunderbolt.client.local_cache import LocalCache
from tqdm import tqdm
class LocalDirectoryClient:
def __init__(self, workspace_directory: str = '', task_filters: List[str] = []... | [
"tqdm.tqdm",
"os.path.join",
"pickle.load",
"thunderbolt.client.local_cache.LocalCache",
"os.path.abspath",
"os.stat"
] | [((410, 446), 'os.path.abspath', 'os.path.abspath', (['workspace_directory'], {}), '(workspace_directory)\n', (425, 446), False, 'import os\n'), ((556, 598), 'thunderbolt.client.local_cache.LocalCache', 'LocalCache', (['workspace_directory', 'use_cache'], {}), '(workspace_directory, use_cache)\n', (566, 598), False, 'f... |
#!/usr/bin/env python3
"""problem_003.py
Problem 3: Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number N?
"""
__author__ = '<NAME>'
import common.primes as prime
# PARAMETERS ########################################################... | [
"common.primes.prime_factorization"
] | [((500, 528), 'common.primes.prime_factorization', 'prime.prime_factorization', (['N'], {}), '(N)\n', (525, 528), True, 'import common.primes as prime\n')] |
# coding: utf-8
import unittest
from tvdb_api.client import TvdbClient
from tvdb_api.models.episode import Episode
from tvdb_api.rest import ApiException
class TestClientEpisodes(unittest.TestCase):
"""Client episodes unit tests."""
def setUp(self):
self.client = TvdbClient()
self.client.lo... | [
"unittest.main",
"tvdb_api.client.TvdbClient"
] | [((1222, 1237), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1235, 1237), False, 'import unittest\n'), ((285, 297), 'tvdb_api.client.TvdbClient', 'TvdbClient', ([], {}), '()\n', (295, 297), False, 'from tvdb_api.client import TvdbClient\n')] |
from os import system, name
system('cls' if name == 'nt' else 'clear')
dsc = ('''DESAFIO 058:
Melhore o jogo do DESAFIO 028 onde o computador vai
"pensar" em um número entre 0 e 10. Só que agora o
jogador vai tentar adivinhar até acertar, mostrando
no final quantos palpites foram necessários para
vencer.
''')
fro... | [
"os.system",
"random.randint"
] | [((28, 70), 'os.system', 'system', (["('cls' if name == 'nt' else 'clear')"], {}), "('cls' if name == 'nt' else 'clear')\n", (34, 70), False, 'from os import system, name\n'), ((349, 363), 'random.randint', 'randint', (['(0)', '(10)'], {}), '(0, 10)\n', (356, 363), False, 'from random import randint\n')] |
import pygame
from pygame.locals import *
class Menu:
def __init__(self):
#self.start = pygame.image.load('racecar.png')
pass
def update(self, dt):
pass
def draw(self, screen):
pygame.draw.rect(screen, (0,0,255), (200,150,100,50)) | [
"pygame.draw.rect"
] | [((225, 283), 'pygame.draw.rect', 'pygame.draw.rect', (['screen', '(0, 0, 255)', '(200, 150, 100, 50)'], {}), '(screen, (0, 0, 255), (200, 150, 100, 50))\n', (241, 283), False, 'import pygame\n')] |
#!/usr/bin/env python
from jinja2 import Template
__author__ = "<NAME>"
__EMAIL__ = "<EMAIL>"
template = Template('''
hostname {{hostname}}
aaa new-model
aaa session-id unique
aaa authentication login default local
aaa authorization exec default local none
vtp mode transparent
vlan 10,20,30,40,50,60,70,80,90,100,20... | [
"jinja2.Template"
] | [((109, 415), 'jinja2.Template', 'Template', (['"""\nhostname {{hostname}}\naaa new-model\naaa session-id unique\naaa authentication login default local\naaa authorization exec default local none\nvtp mode transparent\nvlan 10,20,30,40,50,60,70,80,90,100,200\nint {{mgmt_intf}}\nno switchport\nno shut\nip address {{mgmt... |
import time
import base64
import hmac
#參考資料:https://medium.com/mr-efacani-teatime/%E6%B7%BA%E8%AB%87jwt%E7%9A%84%E5%AE%89%E5%85%A8%E6%80%A7%E8%88%87%E9%81%A9%E7%94%A8%E6%83%85%E5%A2%83-301b5491b60e
secret_key = 'mantou'
def toBytes(string):
return bytes(string,'utf-8')
def encodeBase64(text):
return base64.urlsaf... | [
"time.time",
"base64.urlsafe_b64encode"
] | [((307, 337), 'base64.urlsafe_b64encode', 'base64.urlsafe_b64encode', (['text'], {}), '(text)\n', (331, 337), False, 'import base64\n'), ((473, 484), 'time.time', 'time.time', ([], {}), '()\n', (482, 484), False, 'import time\n')] |
#!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | [
"socket.getfqdn",
"only_for_platform.only_for_platform",
"os.close",
"only_for_platform.not_for_platform",
"only_for_platform.get_platform",
"ambari_agent.AmbariConfig.AmbariConfig",
"ambari_agent.hostname.hostname",
"mock.mock.MagicMock",
"ambari_agent.hostname.server_hostname",
"os.remove",
"a... | [((1191, 1205), 'only_for_platform.get_platform', 'get_platform', ([], {}), '()\n', (1203, 1205), False, 'from only_for_platform import only_for_platform, get_platform, not_for_platform, PLATFORM_LINUX, PLATFORM_WINDOWS\n'), ((2193, 2227), 'only_for_platform.not_for_platform', 'not_for_platform', (['PLATFORM_WINDOWS'],... |
import uuid
from collections import deque
from typing import Deque
from phantom.dag import Block, MaliciousDAG
from .miner import Miner
class MaliciousMiner(Miner):
"""
A malicious miner on the network.
"""
def __init__(self, name: Miner.Name,
dag: MaliciousDAG,
max... | [
"collections.deque",
"uuid.uuid4"
] | [((679, 686), 'collections.deque', 'deque', ([], {}), '()\n', (684, 686), False, 'from collections import deque\n'), ((1691, 1703), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1701, 1703), False, 'import uuid\n')] |
from typing import NewType
from typing import Union
from typing import TypedDict
from typing import Optional
class B(TypedDict):
a: Optional[A]
A = NewType("A", Union[B])
| [
"typing.NewType"
] | [((154, 176), 'typing.NewType', 'NewType', (['"""A"""', 'Union[B]'], {}), "('A', Union[B])\n", (161, 176), False, 'from typing import NewType\n')] |
import os
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
from drf_typescript_generator.utils import (
_get_method_return_value_type, _get_typescript_name, _get_typescript_type, export_serializer,
get_serializer_fields
)
from drf_typescript_generator.g... | [
"drf_typescript_generator.utils.export_serializer",
"drf_typescript_generator.utils._get_typescript_name",
"drf_typescript_generator.utils.get_serializer_fields",
"drf_typescript_generator.utils._get_typescript_type",
"drf_typescript_generator.utils._get_method_return_value_type"
] | [((3672, 3714), 'drf_typescript_generator.utils.get_serializer_fields', 'get_serializer_fields', (['ModelTestSerializer'], {}), '(ModelTestSerializer)\n', (3693, 3714), False, 'from drf_typescript_generator.utils import _get_method_return_value_type, _get_typescript_name, _get_typescript_type, export_serializer, get_se... |
from . import api
from flask import jsonify
from app.models import db, Book
@api.route('/books',methods=['GET'])
def query_books_api():
books = Book.query.all()
if books:
books_dict = [{'bookid':book.bookid,
'title':book.title,
'body':book.body,
'create_time':book.create_time}
f... | [
"app.models.db.session.query",
"app.models.db.session.commit",
"app.models.Book.query.all",
"app.models.db.session.delete",
"flask.jsonify"
] | [((152, 168), 'app.models.Book.query.all', 'Book.query.all', ([], {}), '()\n', (166, 168), False, 'from app.models import db, Book\n'), ((377, 408), 'flask.jsonify', 'jsonify', (["{'status': 'no datas'}"], {}), "({'status': 'no datas'})\n", (384, 408), False, 'from flask import jsonify\n'), ((705, 749), 'flask.jsonify'... |
#!/usr/bin/env python3
# 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 os
import time
from collections import defaultdict, deque
from typing import Any, Dict, List, Optional
import ra... | [
"habitat.logger.warn",
"habitat.logger.add_filehandler",
"habitat.utils.visualizations.maps.colorize_topdown_map",
"habitat_baselines.rl.ppo.encoder_dict.get_vision_encoder_inputs",
"habitat_baselines.common.environments.get_env_class",
"torch.cuda.is_available",
"habitat_baselines.common.baseline_regis... | [((3519, 3565), 'habitat_baselines.common.baseline_registry.baseline_registry.register_trainer', 'baseline_registry.register_trainer', ([], {'name': '"""ppo"""'}), "(name='ppo')\n", (3553, 3565), False, 'from habitat_baselines.common.baseline_registry import baseline_registry\n'), ((38227, 38242), 'torch.no_grad', 'tor... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
from utils import LoSFilter
los_hospitals = np.concatenate(((1,), LoSFilter().los_cdf[:, 1]))
los_icu = np.concatenate(((1,), LoSFilter('los_icu.csv').los_cdf[:, 1]))
day_hospitals = list(range(0, len(los_hospitals)))
day_icu = list(range(0, len(lo... | [
"utils.LoSFilter",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((341, 356), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (353, 356), True, 'import matplotlib.pyplot as plt\n'), ((817, 850), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""length_of_stay.png"""'], {}), "('length_of_stay.png')\n", (828, 850), True, 'import matplotlib.pyplot as plt\n'), ((8... |
import unittest
import models.EndNode as n
class TestEndNode(unittest.TestCase):
def setUp(self):
self.a = n.EndNode('192.168.0.1', id = 1)
self.b = n.EndNode('192.168.0.1')
self.c = n.EndNode('192.168.0.3')
def testEquality(self):
self.assertTrue(self.a == self.a)
self... | [
"unittest.main",
"models.EndNode.EndNode"
] | [((827, 842), 'unittest.main', 'unittest.main', ([], {}), '()\n', (840, 842), False, 'import unittest\n'), ((120, 150), 'models.EndNode.EndNode', 'n.EndNode', (['"""192.168.0.1"""'], {'id': '(1)'}), "('192.168.0.1', id=1)\n", (129, 150), True, 'import models.EndNode as n\n'), ((170, 194), 'models.EndNode.EndNode', 'n.E... |
'''
Function:
视频下载器基类
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import requests
from ..utils import Downloader
'''视频下载器基类'''
class Base():
def __init__(self, config, logger_handle, **kwargs):
self.source = None
self.session = requests.Session()
self.session.proxies.update(config['... | [
"requests.Session"
] | [((257, 275), 'requests.Session', 'requests.Session', ([], {}), '()\n', (273, 275), False, 'import requests\n')] |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 26 16:52:29 2020
@author: eliphat
"""
import win32api
import win32con
import win32gui
import time
hwnd = win32gui.FindWindow("TXGuiFoundation", "bot/ctf交流")
print(hwnd)
def send_msg(s):
for c in s:
win32api.SendMessage(hwnd, win32con.WM_CHAR, ord(c), 0)
... | [
"win32gui.FindWindow",
"time.sleep",
"win32api.SendMessage"
] | [((155, 206), 'win32gui.FindWindow', 'win32gui.FindWindow', (['"""TXGuiFoundation"""', '"""bot/ctf交流"""'], {}), "('TXGuiFoundation', 'bot/ctf交流')\n", (174, 206), False, 'import win32gui\n'), ((360, 430), 'win32api.SendMessage', 'win32api.SendMessage', (['hwnd', 'win32con.WM_KEYDOWN', 'win32con.VK_RETURN', '(0)'], {}), ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from optionaldict import optionaldict
from teambition.api.base import TeambitionAPI
class Tasklists(TeambitionAPI):
def get(self, id=None, project_id=None):
"""
获取任务分组列表
详情请参考
http://docs.teambition... | [
"optionaldict.optionaldict"
] | [((1022, 1095), 'optionaldict.optionaldict', 'optionaldict', ([], {'_projectId': 'project_id', 'title': 'title', 'description': 'description'}), '(_projectId=project_id, title=title, description=description)\n', (1034, 1095), False, 'from optionaldict import optionaldict\n'), ((1863, 1937), 'optionaldict.optionaldict',... |
# Glicko
# python 3.4.3
# Copyright (c) 2016 by <NAME>.
# All rights reserved.
import math
# Background information - https://en.wikipedia.org/wiki/Glicko_rating_system
# Based on this equation - http://www.glicko.net/glicko/glicko2.pdf
_MAXSIZE = 186
_MAXMULTI = .272
_MULTISLOPE = .00391
_WIN = 1.0
_LOSS = 0
_CATCH ... | [
"math.exp",
"math.sqrt",
"math.log"
] | [((473, 493), 'math.log', 'math.log', (['(sigma ** 2)'], {}), '(sigma ** 2)\n', (481, 493), False, 'import math\n'), ((734, 770), 'math.log', 'math.log', (['(change ** 2 - phi ** 2 - v)'], {}), '(change ** 2 - phi ** 2 - v)\n', (742, 770), False, 'import math\n'), ((538, 549), 'math.exp', 'math.exp', (['x'], {}), '(x)\... |
#!/usr/bin/env python3
if __name__ == '__main__':
import os
import subprocess
HOME = os.path.expanduser('~')
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
# Sync git repo with origin.
subprocess.run(['git', '-C', SCRIPT_DIR, 'pull', '--quiet'], check=True)
# Set up vim-plug.
... | [
"os.path.realpath",
"subprocess.run",
"os.path.join",
"os.path.expanduser"
] | [((99, 122), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (117, 122), False, 'import os\n'), ((222, 294), 'subprocess.run', 'subprocess.run', (["['git', '-C', SCRIPT_DIR, 'pull', '--quiet']"], {'check': '(True)'}), "(['git', '-C', SCRIPT_DIR, 'pull', '--quiet'], check=True)\n", (236, 294), ... |
from flask import Flask, render_template, request
from recipe_scrapers import scrape_me
import sqlite3
app = Flask(__name__) # create app instance
@app.route("/")
def index(): # Home page of the KitchenCompanion app
return render_template('index.html', title = 'Home')
@app.route("/view") # Connects... | [
"flask.render_template",
"recipe_scrapers.scrape_me",
"sqlite3.connect",
"flask.Flask"
] | [((112, 127), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (117, 127), False, 'from flask import Flask, render_template, request\n'), ((240, 283), 'flask.render_template', 'render_template', (['"""index.html"""'], {'title': '"""Home"""'}), "('index.html', title='Home')\n", (255, 283), False, 'from flask ... |
from ntpath import join
from posixpath import dirname
from dotenv import load_dotenv
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_mail import Mail
from flask_talisman import Talisman
from app.config import Config
from pat... | [
"flask_mail.Mail",
"flask_login.LoginManager",
"flask.Flask",
"pathlib.Path",
"dotenv.load_dotenv",
"flask_bcrypt.Bcrypt",
"flask_sqlalchemy.SQLAlchemy"
] | [((343, 355), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (353, 355), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((365, 373), 'flask_bcrypt.Bcrypt', 'Bcrypt', ([], {}), '()\n', (371, 373), False, 'from flask_bcrypt import Bcrypt\n'), ((381, 387), 'flask_mail.Mail', 'Mail', ([], {}), '()\n',... |
# Copyright 2015 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... | [
"tensorflow.core.framework.graph_pb2.GraphDef",
"tensorflow.flags.DEFINE_string",
"tensorflow.python.framework.ops.OpStats",
"tensorflow.gfile.Exists",
"locale.setlocale",
"tensorflow.flags.DEFINE_bool",
"tensorflow.flags.DEFINE_boolean",
"tensorflow.Session",
"tensorflow.python.framework.ops.get_st... | [((1663, 1737), 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""graph"""', '""""""', '"""TensorFlow \'GraphDef\' file to load."""'], {}), '(\'graph\', \'\', "TensorFlow \'GraphDef\' file to load.")\n', (1685, 1737), True, 'import tensorflow as tf\n'), ((1742, 1837), 'tensorflow.flags.DEFINE_bool', 'tf... |
from threading import Thread
def hello(name):
print("hello " + name)
th = Thread(target= hello, args=("bob", ))
th.start()
th.join() | [
"threading.Thread"
] | [((79, 114), 'threading.Thread', 'Thread', ([], {'target': 'hello', 'args': "('bob',)"}), "(target=hello, args=('bob',))\n", (85, 114), False, 'from threading import Thread\n')] |
from django.shortcuts import render, get_object_or_404
from rest_framework import status
from django.http import HttpResponse, JsonResponse
# importing the models
from .models import CarBrands, Employees, EmployeeDesignations, Snippet, Persons, PersonTasks
# importing a APIView class based views from rest_framwork
from... | [
"rest_framework.response.Response"
] | [((960, 1012), 'rest_framework.response.Response', 'Response', (["{'Snippet_details': seriliazer_class.data}"], {}), "({'Snippet_details': seriliazer_class.data})\n", (968, 1012), False, 'from rest_framework.response import Response\n'), ((2375, 2420), 'rest_framework.response.Response', 'Response', (["{'CarBrands': se... |
from django import forms
from liliput.models import ShortLink
class ShortLinkForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ShortLinkForm, self).__init__(*args, **kwargs)
for visible in self.visible_fields():
visible.field.widget.attrs['class'] = 'col-8 col-lg-4 mx-... | [
"django.forms.DateInput"
] | [((916, 955), 'django.forms.DateInput', 'forms.DateInput', ([], {'attrs': "{'type': 'date'}"}), "(attrs={'type': 'date'})\n", (931, 955), False, 'from django import forms\n')] |
# ----------------------------------------------------------------------------
# robotling_base.py
# Definition of a base class `RobotlingBase`, from which classes that capture
# all functions and properties of a specific board
#
# The MIT License (MIT)
# Copyright (c) 2020 <NAME>
# 2020-09-04, v1
# 2020-10-31, v1.1, u... | [
"robotling_lib.platform.circuitpython.time.time",
"robotling_lib.platform.circuitpython.time.sleep_ms",
"robotling_lib.platform.circuitpython.time.sleep_us",
"micropython.const",
"robotling_lib.driver.mcp3208.MCP3208",
"robotling_lib.platform.circuitpython.time.ticks_us",
"robotling_lib.platform.circuit... | [((2741, 2750), 'micropython.const', 'const', (['(20)'], {}), '(20)\n', (2746, 2750), False, 'from micropython import const\n'), ((2815, 2823), 'micropython.const', 'const', (['(8)'], {}), '(8)\n', (2820, 2823), False, 'from micropython import const\n'), ((2893, 2902), 'micropython.const', 'const', (['(10)'], {}), '(10... |
"""
AtomicGraphs
------------
This is a python library to split an RDF Graph into atomic graphs.
With this library using atomic graphs we want to make RDF Graphs containing
blanknodes comparable.
This package implements a colouring algorithm.
"""
from setuptools import setup
setup(
name='atomicgraphs',
use_sc... | [
"setuptools.setup"
] | [((278, 776), 'setuptools.setup', 'setup', ([], {'name': '"""atomicgraphs"""', 'use_scm_version': '{\'root\': \'.\', \'version_scheme\': \'guess-next-dev\', \'write_to\': \'version.txt\',\n \'write_to_template\': \'__version__ = "{version}"\', \'tag_regex\':\n \'^(?P<prefix>v)?(?P<version>[^\\\\+]+)(?P<suffix>.*)... |
import logging
import synapse.lib.cache as s_cache
logger = logging.getLogger(__name__)
class Triggers:
def __init__(self):
self._trig_list = []
self._trig_match = s_cache.MatchCache()
self._trig_byname = s_cache.Cache(onmiss=self._onTrigNameMiss)
def clear(self):
'''
... | [
"logging.getLogger",
"synapse.lib.cache.MatchCache",
"synapse.lib.cache.Cache"
] | [((62, 89), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (79, 89), False, 'import logging\n'), ((188, 208), 'synapse.lib.cache.MatchCache', 's_cache.MatchCache', ([], {}), '()\n', (206, 208), True, 'import synapse.lib.cache as s_cache\n'), ((237, 279), 'synapse.lib.cache.Cache', 's_cach... |
from datetime import datetime
__all__ = ['Cache']
class Cache:
def __init__(self):
"""
The cache is designed to respect the caching rules of the XML API
as to not request a page more often than it is updated by the server.
Args:
None
Returns:
No... | [
"datetime.datetime.strptime",
"datetime.datetime.utcnow"
] | [((1773, 1826), 'datetime.datetime.strptime', 'datetime.strptime', (['expires_after', '"""%Y-%m-%d %H:%M:%S"""'], {}), "(expires_after, '%Y-%m-%d %H:%M:%S')\n", (1790, 1826), False, 'from datetime import datetime\n'), ((1222, 1239), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (1237, 1239), False, '... |
import pygame,sys,random
#General Setup
pygame.init()
clock=pygame.time.Clock()
#Setting up Main Window
screen_width = 1000
screen_height = 640
size = (screen_width,screen_height)
screen = pygame.display.set_mode(size)
pygame.display.set_caption("PONG")
bg_image=pygame.image.load("bg4.PNG")
#Game Rect... | [
"pygame.draw.aaline",
"random.choice",
"sys.exit",
"pygame.init",
"pygame.time.get_ticks",
"pygame.event.get",
"pygame.Color",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.quit",
"pygame.time.Clock",
"pygame.draw.ellipse",
"pygame.draw.rect",
"pygame.display.set_caption",
"p... | [((44, 57), 'pygame.init', 'pygame.init', ([], {}), '()\n', (55, 57), False, 'import pygame, sys, random\n'), ((65, 84), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (82, 84), False, 'import pygame, sys, random\n'), ((202, 231), 'pygame.display.set_mode', 'pygame.display.set_mode', (['size'], {}), '(size... |
import json
import os
import sys
from pathlib import Path
from django.core.management.base import BaseCommand
from django.db import transaction
from mycarehub.screeningtools.models import ScreeningToolsQuestion
class Command(BaseCommand):
help = "Loads the screening tool questions to the database"
@transac... | [
"mycarehub.screeningtools.models.ScreeningToolsQuestion.objects.get_or_create",
"os.path.join",
"pathlib.Path",
"mycarehub.screeningtools.models.ScreeningToolsQuestion.objects.filter"
] | [((511, 542), 'os.path.join', 'os.path.join', (['base_path', '"""data"""'], {}), "(base_path, 'data')\n", (523, 542), False, 'import os\n'), ((580, 625), 'os.path.join', 'os.path.join', (['data_dir', '"""screeningtools.json"""'], {}), "(data_dir, 'screeningtools.json')\n", (592, 625), False, 'import os\n'), ((947, 1300... |
"""A module that carry out the utility's used by the AI algorithms
"""
import pickle
from collections import deque
from typing import Deque
import numpy as np
import tensorflow.keras as tk
import tensorflow as tf
from sklearn.preprocessing import LabelEncoder
import ai.config as config
from model.action import Action... | [
"tensorflow.device",
"pickle.dump",
"collections.deque",
"pickle.load",
"tensorflow.keras.optimizers.Adam",
"numpy.array"
] | [((1885, 1911), 'tensorflow.device', 'tf.device', (['"""/device:GPU:0"""'], {}), "('/device:GPU:0')\n", (1894, 1911), True, 'import tensorflow as tf\n'), ((4474, 4500), 'collections.deque', 'deque', ([], {'maxlen': 'self.max_len'}), '(maxlen=self.max_len)\n', (4479, 4500), False, 'from collections import deque\n'), ((7... |
from newsplease import NewsPlease
from retry import retry
@retry(tries=3, delay=2)
def fetch_plaintext(url: str) -> str:
article = NewsPlease.from_url(url)
return article.maintext or ""
| [
"newsplease.NewsPlease.from_url",
"retry.retry"
] | [((61, 84), 'retry.retry', 'retry', ([], {'tries': '(3)', 'delay': '(2)'}), '(tries=3, delay=2)\n', (66, 84), False, 'from retry import retry\n'), ((138, 162), 'newsplease.NewsPlease.from_url', 'NewsPlease.from_url', (['url'], {}), '(url)\n', (157, 162), False, 'from newsplease import NewsPlease\n')] |
"""
DynaMake module.
"""
# pylint: disable=too-many-lines,redefined-builtin,unspecified-encoding
import argparse
import asyncio
import logging
import os
import re
import shlex
import shutil
import sys
import warnings
from argparse import ArgumentParser
from argparse import Namespace
from contextlib import asynccontex... | [
"logging.getLogger",
"inspect.getsourcelines",
"logging.StreamHandler",
"re.escape",
"re.compile",
"os.cpu_count",
"sys.exit",
"copy.copy",
"urllib.parse.quote_plus",
"os.remove",
"os.path.exists",
"inspect.getsourcefile",
"textwrap.dedent",
"stat.S_ISDIR",
"yaml.add_constructor",
"aio... | [((1492, 1529), 're.compile', 're.compile', (['"""(.*) at position (\\\\d+)"""'], {}), "('(.*) at position (\\\\d+)')\n", (1502, 1529), False, 'import re\n'), ((12401, 12463), 'yaml.add_constructor', 'yaml.add_constructor', (['"""!g"""', '_load_glob'], {'Loader': 'yaml.FullLoader'}), "('!g', _load_glob, Loader=yaml.Ful... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ecdsa
import hashlib
from .base58 import *
# Hash functions
def sha256(x):
'''Simple wrapper of hashlib sha256.'''
return hashlib.sha256(x).digest()
def dsha256(x):
'''SHA-256 of SHA-256, as used extensively in bitcoin.'''
return sha256(sha256(x)... | [
"ecdsa.util.string_to_number",
"hashlib.sha256",
"hashlib.new",
"ecdsa.ecdsa.Public_key",
"ecdsa.SigningKey.from_secret_exponent",
"ecdsa.ecdsa.Private_key"
] | [((396, 420), 'hashlib.new', 'hashlib.new', (['"""ripemd160"""'], {}), "('ripemd160')\n", (407, 420), False, 'import hashlib\n'), ((662, 692), 'ecdsa.util.string_to_number', 'ecdsa.util.string_to_number', (['k'], {}), '(k)\n', (689, 692), False, 'import ecdsa\n'), ((715, 817), 'ecdsa.ecdsa.Public_key', 'ecdsa.ecdsa.Pub... |
import os
import re
import pickle
import datetime
import tensorflow as tf
from dateutil import parser
from collections import defaultdict
from datetime import datetime, timedelta
from hooperhub.seq2seq_model import Seq2SeqModel
from hooperhub.util import EntityTable, data_utils
class Lexer(object):
""" Respons... | [
"datetime.datetime",
"tensorflow.reset_default_graph",
"hooperhub.util.data_utils.sentence_to_token_ids",
"tensorflow.Session",
"re.match",
"os.path.join",
"hooperhub.util.EntityTable",
"hooperhub.seq2seq_model.Seq2SeqModel",
"tensorflow.train.get_checkpoint_state",
"tensorflow.train.import_meta_g... | [((5085, 5109), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (5107, 5109), True, 'import tensorflow as tf\n'), ((5126, 5178), 'hooperhub.seq2seq_model.Seq2SeqModel', 'Seq2SeqModel', (['(1100)', '(200)', '(512)', '(50)', '(0.001)'], {'train': '(False)'}), '(1100, 200, 512, 50, 0.001, tra... |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 8 23:38:32 2015
HeatPumpControl 0.3
This is a python3 program that will read a list of commands from a file and
will then control a heatpump according to the data.
Author:
<NAME>
Oulu, Finland
Created in 2015
/*
* ---------------------------------------------------... | [
"datetime.datetime.now",
"configparser.ConfigParser",
"sys.exit"
] | [((815, 838), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (836, 838), False, 'import sys, configparser, datetime, serial\n'), ((911, 934), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (932, 934), False, 'import sys, configparser, datetime, serial\n'), ((1220, 1230), 'sys.e... |
"""Provides high-level DNDarray initialization functions"""
import numpy as np
import torch
import warnings
from typing import Callable, Iterable, Optional, Sequence, Tuple, Type, Union, List
from .communication import MPI, sanitize_comm, Communication
from .devices import Device
from .dndarray import DNDarray
from ... | [
"numpy.ceil",
"torch.full",
"numpy.iinfo",
"numpy.array",
"torch.arange",
"torch.meshgrid",
"numpy.empty",
"torch.linspace"
] | [((4971, 5030), 'torch.arange', 'torch.arange', (['start', 'stop', 'step'], {'device': 'device.torch_device'}), '(start, stop, step, device=device.torch_device)\n', (4983, 5030), False, 'import torch\n'), ((36374, 36440), 'torch.linspace', 'torch.linspace', (['start', 'stop', 'lshape[0]'], {'device': 'device.torch_devi... |
from ploomber.clients import SQLAlchemyClient
def get_client():
return SQLAlchemyClient('sqlite:///data.db')
| [
"ploomber.clients.SQLAlchemyClient"
] | [((77, 114), 'ploomber.clients.SQLAlchemyClient', 'SQLAlchemyClient', (['"""sqlite:///data.db"""'], {}), "('sqlite:///data.db')\n", (93, 114), False, 'from ploomber.clients import SQLAlchemyClient\n')] |
import os
import platform
import textwrap
import unittest
import pytest
from conans.test.assets.sources import gen_function_cpp
from conans.test.utils.tools import TestClient
from conans.util.files import save, load
@pytest.mark.tool_cmake
@unittest.skipUnless(platform.system() == "Windows", "Only for windows")
cl... | [
"textwrap.dedent",
"conans.test.assets.sources.gen_function_cpp",
"os.path.join",
"platform.system",
"conans.util.files.save",
"conans.test.utils.tools.TestClient",
"conans.util.files.load"
] | [((384, 1168), 'textwrap.dedent', 'textwrap.dedent', (['"""\n from conans import ConanFile\n from conan.tools.cmake import CMakeDeps\n class App(ConanFile):\n settings = "os", "arch", "compiler", "build_type"\n requires = "hello/0.1"\n\n def generate(self):\n ... |
from pathlib import Path
NYC_DATA_PATH = Path('data') / 'CSCL_PUB_Centerline.csv'
| [
"pathlib.Path"
] | [((42, 54), 'pathlib.Path', 'Path', (['"""data"""'], {}), "('data')\n", (46, 54), False, 'from pathlib import Path\n')] |