code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
#!/usr/bin/env python import sys from PySide6 import QtWidgets from interface.interface import Interface def main(): app = QtWidgets.QApplication(sys.argv) application = Interface() application.show() sys.exit(app.exec_()) if __name__ == "__main__": main()
[ "interface.interface.Interface", "PySide6.QtWidgets.QApplication" ]
[((142, 174), 'PySide6.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (164, 174), False, 'from PySide6 import QtWidgets\n'), ((194, 205), 'interface.interface.Interface', 'Interface', ([], {}), '()\n', (203, 205), False, 'from interface.interface import Interface\n')]
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "parakeet.data.datacargo.DataCargo", "parakeet.data.dataset.TransformDataset", "parakeet.audio.AudioProcessor", "pandas.read_csv", "pathlib.Path", "paddle.fluid.io.DataLoader.from_generator", "parakeet.g2p.en.text_to_sequence", "paddle.fluid.CPUPlace", "numpy.array", "parakeet.data.batch.TextIDBat...
[((1375, 1395), 'pathlib.Path', 'Path', (['args.data_path'], {}), '(args.data_path)\n', (1379, 1395), False, 'from pathlib import Path\n'), ((1504, 1543), 'parakeet.data.dataset.TransformDataset', 'TransformDataset', (['metadata', 'transformer'], {}), '(metadata, transformer)\n', (1520, 1543), False, 'from parakeet.dat...
import os import urllib.request from concurrent.futures import ThreadPoolExecutor from concurrent.futures import as_completed def downloader(url): """ Downloads the specified URL and saves it to disk """ req = urllib.request.urlopen(url) filename = os.path.basename(url) ext = os....
[ "concurrent.futures.ThreadPoolExecutor", "os.path.splitext", "os.path.basename" ]
[((284, 305), 'os.path.basename', 'os.path.basename', (['url'], {}), '(url)\n', (300, 305), False, 'import os\n'), ((317, 338), 'os.path.splitext', 'os.path.splitext', (['url'], {}), '(url)\n', (333, 338), False, 'import os\n'), ((808, 841), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {'max_work...
#!/usr/bin/python # coding=utf-8 # 公众号:testerzhang __author__ = 'testerzhang' import os import time import traceback from appium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import NoSuchElementException, TimeoutEx...
[ "loguru.logger.add", "os.path.exists", "selenium.webdriver.support.ui.WebDriverWait", "traceback.format_exc", "parse.parse", "loguru.logger.debug", "os.makedirs", "loguru.logger.warning", "time.sleep", "appium.webdriver.Remote", "loguru.logger.error", "selenium.webdriver.support.expected_condi...
[((502, 531), 'loguru.logger.add', 'logger.add', (['config.APPIUM_LOG'], {}), '(config.APPIUM_LOG)\n', (512, 531), False, 'from loguru import logger\n'), ((567, 597), 'loguru.logger.debug', 'logger.debug', (['f"""等待{wait_sec}秒"""'], {}), "(f'等待{wait_sec}秒')\n", (579, 597), False, 'from loguru import logger\n'), ((676, ...
import salabim as sim GAS_STATION_SIZE = 200. # liters THRESHOLD = 25. # Threshold for calling the tank truck (in %) FUEL_TANK_SIZE = 50. # liters # Min/max levels of fuel tanks (in liters) FUEL_TANK_LEVEL = sim.Uniform(5, 25) REFUELING_SPEED = 2. # liters / second TANK_TRUCK_TIME = 300. ...
[ "salabim.Resource", "salabim.Environment", "salabim.Uniform" ]
[((232, 250), 'salabim.Uniform', 'sim.Uniform', (['(5)', '(25)'], {}), '(5, 25)\n', (243, 250), True, 'import salabim as sim\n'), ((379, 399), 'salabim.Uniform', 'sim.Uniform', (['(10)', '(100)'], {}), '(10, 100)\n', (390, 399), True, 'import salabim as sim\n'), ((1853, 1881), 'salabim.Environment', 'sim.Environment', ...
import os import requests import time import pandas as pd import config from flask import request import dash import dash_core_components as dcc import dash_bootstrap_components as dbc import dash_html_components as html import dash_table from dash.dependencies import Input, Output, State external_stylesheets = [ ...
[ "requests.post", "pandas.read_csv", "dash_core_components.Location", "dash_core_components.Textarea", "dash.dependencies.Input", "flask.request.headers.get", "dash_html_components.Div", "dash.Dash", "dash_html_components.I", "dash_core_components.Link", "dash.dependencies.Output", "dash_html_c...
[((656, 846), 'dash.Dash', 'dash.Dash', (['__name__'], {'external_stylesheets': 'external_stylesheets', 'meta_tags': "[{'name': 'viewport', 'content': 'width=device-width, initial-scale=1'}]", 'suppress_callback_exceptions': '(True)'}), "(__name__, external_stylesheets=external_stylesheets, meta_tags=[{\n 'name': 'v...
#Import needed libraries from litemapy import Schematic, Region, BlockState from PIL import Image import json #Get the size of the image img = Image.open(input("Path to image: ")) w,h = img.size #Generate the shematic schem = Schematic(w,1,h, name="WFCconvert litematic", main_region_name="main") reg = sche...
[ "litemapy.BlockState", "litemapy.Schematic" ]
[((238, 310), 'litemapy.Schematic', 'Schematic', (['w', '(1)', 'h'], {'name': '"""WFCconvert litematic"""', 'main_region_name': '"""main"""'}), "(w, 1, h, name='WFCconvert litematic', main_region_name='main')\n", (247, 310), False, 'from litemapy import Schematic, Region, BlockState\n'), ((686, 713), 'litemapy.BlockSta...
from django.conf.urls import include, url from rest_framework import routers from api import views from django.urls import path route = routers.DefaultRouter() route.register(r'user', views.UserViewSet) route.register(r'store', views.StoreViewSet) route.register(r'itemCategory', views.ItemCategoryViewSet) route.regis...
[ "django.conf.urls.include", "django.urls.path", "rest_framework.routers.DefaultRouter" ]
[((137, 160), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (158, 160), False, 'from rest_framework import routers\n'), ((1573, 1638), 'django.urls.path', 'path', (['"""api/get_user_cart_item/<int:pk>"""', 'views.get_user_cart_item'], {}), "('api/get_user_cart_item/<int:pk>', views....
# Copyright 2016 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 ag...
[ "googlecloudsdk.core.resolvers.FromProperty", "googlecloudsdk.api_lib.debug.debug.DebugObject.InitializeApiClients", "googlecloudsdk.calliope.base.ReleaseTracks" ]
[((941, 983), 'googlecloudsdk.calliope.base.ReleaseTracks', 'base.ReleaseTracks', (['base.ReleaseTrack.BETA'], {}), '(base.ReleaseTrack.BETA)\n', (959, 983), False, 'from googlecloudsdk.calliope import base\n'), ((1772, 1812), 'googlecloudsdk.api_lib.debug.debug.DebugObject.InitializeApiClients', 'debug.DebugObject.Ini...
""" Unit tests for JobQueue class """ import mock import os import pytest from jade.exceptions import InvalidParameter from jade.jobs.job_configuration_factory import ( create_config_from_file, create_config_from_previous_run ) from jade.result import Result, ResultsSummary, serialize_results @pytest.fixture ...
[ "jade.jobs.job_configuration_factory.create_config_from_previous_run", "os.path.join", "jade.jobs.job_configuration_factory.create_config_from_file", "pytest.raises", "mock.MagicMock" ]
[((1348, 1386), 'mock.MagicMock', 'mock.MagicMock', ([], {'return_value': 'jade_data'}), '(return_value=jade_data)\n', (1362, 1386), False, 'import mock\n'), ((1564, 1602), 'mock.MagicMock', 'mock.MagicMock', ([], {'return_value': 'jade_data'}), '(return_value=jade_data)\n', (1578, 1602), False, 'import mock\n'), ((173...
# -*- coding: utf-8 -*- import base64 import functools import hashlib import hmac import json import logging import time from urllib.parse import quote import requests import werkzeug.urls import werkzeug.utils from werkzeug.exceptions import BadRequest from odoo import SUPERUSER_ID, api, http from odoo import regist...
[ "logging.getLogger", "odoo.http.request.render", "json.loads", "odoo.http.db_filter", "odoo.api.Environment", "base64.b64encode", "time.time", "json.dumps", "functools.wraps", "odoo.http.route", "requests.get", "odoo.addons.web.controllers.main.set_cookie_and_redirect", "odoo.registry", "o...
[((760, 787), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (777, 787), False, 'import logging\n'), ((831, 852), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (846, 852), False, 'import functools\n'), ((2415, 2478), 'odoo.http.route', 'http.route', (['"""/dingding/aut...
import unittest from Kenken import Kenken kenken_size_3 = [ ('/', 3, ['A1', 'A2']), ('-', 1, ['B1', 'C1']), ('/', 3, ['B2', 'B3']), ('/', 2, ['C2', 'C3']), ('', 2, ['A3']) ] kenken_size_4 = [ ('*', 24, ['A1', 'A2', 'B1']), ('', 3, ['A3']), ('-', 3, ['A4', 'B4']), ('/', 2, ['B2', '...
[ "unittest.main", "Kenken.Kenken" ]
[((3310, 3325), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3323, 3325), False, 'import unittest\n'), ((1858, 1879), 'Kenken.Kenken', 'Kenken', (['kenken_size_3'], {}), '(kenken_size_3)\n', (1864, 1879), False, 'from Kenken import Kenken\n'), ((2389, 2410), 'Kenken.Kenken', 'Kenken', (['kenken_size_3'], {}), '...
from challenge import solution def test_challenge(): # Create empty array (dependent on test) # Create single entry array # Create an array with the answer at the start # Create an array with the answer at the end # Create an array with the answer in the middle # Single entry slot assert(s...
[ "challenge.solution" ]
[((319, 341), 'challenge.solution', 'solution', (['[2, 3, 1, 5]'], {}), '([2, 3, 1, 5])\n', (327, 341), False, 'from challenge import solution\n')]
import sys from app import app from app import get_attempts_data as presenter from app import topic_hlr_train as model_functions from app import kafka_config import json from kafka import KafkaConsumer from kafka.structs import OffsetAndMetadata, TopicPartition from datetime import datetime, time, timedelta from collec...
[ "kafka.structs.OffsetAndMetadata", "app.get_attempts_data.get_attempts_of_user", "kafka.structs.TopicPartition", "datetime.datetime.now", "collections.defaultdict", "app.get_attempts_data.get_last_practiced", "datetime.datetime.today", "app.topic_hlr_train.run_inference", "datetime.timedelta", "ap...
[((683, 760), 'app.get_attempts_data.write_to_hlr_index', 'presenter.write_to_hlr_index', (['user_id', 'results', 'todays_attempts', 'entity_types'], {}), '(user_id, results, todays_attempts, entity_types)\n', (711, 760), True, 'from app import get_attempts_data as presenter\n'), ((893, 941), 'app.get_attempts_data.get...
""" Exam 1, problem 1. Authors: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, their colleagues, and <NAME>. """ # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE. import rosegraphics as rg # ----------------------------------------------------------------------------- # DONE: 2. Right-click on ...
[ "rosegraphics.RoseWindow", "rosegraphics.Point" ]
[((1053, 1083), 'rosegraphics.RoseWindow', 'rg.RoseWindow', (['(400)', '(250)', 'title'], {}), '(400, 250, title)\n', (1066, 1083), True, 'import rosegraphics as rg\n'), ((1644, 1674), 'rosegraphics.RoseWindow', 'rg.RoseWindow', (['(300)', '(400)', 'title'], {}), '(300, 400, title)\n', (1657, 1674), True, 'import roseg...
import numpy as np import geocoder def process_df(df): """ df: pd.DataFrame """ df.dropna(subset=['lat', 'lon'], axis=0, inplace=True) df.reset_index(drop=True, inplace=True) # Add new column to hold the years df["year"] = [int(x.split("-")[0]) for x in df['date']] # Convert coo...
[ "geocoder.google", "numpy.logical_and" ]
[((409, 461), 'numpy.logical_and', 'np.logical_and', (["(df['lat-dir'] == 'S')", "(df['lat'] >= 0)"], {}), "(df['lat-dir'] == 'S', df['lat'] >= 0)\n", (423, 461), True, 'import numpy as np\n'), ((511, 563), 'numpy.logical_and', 'np.logical_and', (["(df['lon-dir'] == 'W')", "(df['lon'] >= 0)"], {}), "(df['lon-dir'] == '...
"""{{ cookiecutter.project_name }} URL Configuration """ from django.contrib import admin from django.urls import path from django.views.generic import TemplateView from django.conf import settings from django.conf.urls import include, url # from django.conf.urls.static import static urlpatterns = [ path('admin...
[ "django.views.generic.TemplateView.as_view", "django.conf.urls.include", "django.urls.path" ]
[((309, 340), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (313, 340), False, 'from django.urls import path\n'), ((355, 403), 'django.views.generic.TemplateView.as_view', 'TemplateView.as_view', ([], {'template_name': '"""index.html"""'}), "(template_name='inde...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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...
[ "pulumi.getter", "pulumi.set", "pulumi.ResourceOptions", "pulumi.get" ]
[((1934, 1964), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""clientId"""'}), "(name='clientId')\n", (1947, 1964), False, 'import pulumi\n'), ((2258, 2292), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""clientSecret"""'}), "(name='clientSecret')\n", (2271, 2292), False, 'import pulumi\n'), ((2646, 2678), 'p...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
[ "logging.basicConfig", "logging.getLogger", "time.strftime", "os.path.join", "os.getcwd", "os.mkdir", "shutil.copy", "os.walk" ]
[((992, 1016), 'os.mkdir', 'os.mkdir', (['path'], {'mode': '(511)'}), '(path, mode=511)\n', (1000, 1016), False, 'import os\n'), ((1324, 1430), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'format_template', 'filename': 'log_filename', 'filemode': '"""a"""', 'level': 'logging.DEBUG'}), "(format=format_...
import copy def F(a): x = copy.deepcopy(a) # Face Rotation a[3][6] = x[5][6] a[3][7] = x[4][6] a[3][8] = x[3][6] a[4][6] = x[5][7] a[4][8] = x[3][7] a[5][6] = x[5][8] a[5][7] = x[4][8] a[5][8] = x[3][8] #Side Rotation a[2][6] = x[5][5] a[2][7] = x[4][5] a[2][8] =...
[ "copy.deepcopy" ]
[((31, 47), 'copy.deepcopy', 'copy.deepcopy', (['a'], {}), '(a)\n', (44, 47), False, 'import copy\n'), ((547, 563), 'copy.deepcopy', 'copy.deepcopy', (['a'], {}), '(a)\n', (560, 563), False, 'import copy\n'), ((1063, 1079), 'copy.deepcopy', 'copy.deepcopy', (['a'], {}), '(a)\n', (1076, 1079), False, 'import copy\n'), (...
import asyncio from couchbase.asynchronous import AsyncSearchResult from couchbase.asynchronous import AsyncAnalyticsResult from .fixtures import asynct, AioTestCase from couchbase.exceptions import CouchbaseException, SearchException, NotSupportedException from unittest import SkipTest import couchbase.search as SEAR...
[ "uuid.uuid4", "couchbase.search.TermFacet", "unittest.SkipTest", "asyncio.sleep", "couchbase.search.TermQuery" ]
[((1870, 1882), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1880, 1882), False, 'import uuid\n'), ((565, 611), 'unittest.SkipTest', 'SkipTest', (['"""Need \'beer-sample\' bucket for this"""'], {}), '("Need \'beer-sample\' bucket for this")\n', (573, 611), False, 'from unittest import SkipTest\n'), ((982, 1001), 'asy...
""" A generic IOS-XE connection implementation. It covers many IOS-XE platforms, including ASR and ISR. """ __author__ = "<NAME> <<EMAIL>>" from unicon.plugins.generic import ServiceList, HAServiceList from unicon.bases.routers.connection import BaseSingleRpConnection from unicon.plugins.iosxe.statemachine import I...
[ "unicon.plugins.iosxe.settings.IosXESettings" ]
[((1914, 1929), 'unicon.plugins.iosxe.settings.IosXESettings', 'IosXESettings', ([], {}), '()\n', (1927, 1929), False, 'from unicon.plugins.iosxe.settings import IosXESettings\n'), ((2158, 2173), 'unicon.plugins.iosxe.settings.IosXESettings', 'IosXESettings', ([], {}), '()\n', (2171, 2173), False, 'from unicon.plugins....
from __future__ import print_function import re import time import curses import bisect try: from queue import Queue from queue import Empty as QueueEmpty except ImportError: from Queue import Queue from Queue import Empty as QueueEmpty import can from .. import database from .utils import format_mess...
[ "curses.color_pair", "curses.wrapper", "re.compile", "curses.init_pair", "curses.is_term_resized", "time.sleep", "curses.curs_set", "curses.use_default_colors", "can.Bus", "bisect.insort", "can.Notifier", "Queue.Queue" ]
[((992, 999), 'Queue.Queue', 'Queue', ([], {}), '()\n', (997, 999), False, 'from Queue import Queue\n'), ((1176, 1203), 'curses.use_default_colors', 'curses.use_default_colors', ([], {}), '()\n', (1201, 1203), False, 'import curses\n'), ((1212, 1234), 'curses.curs_set', 'curses.curs_set', (['(False)'], {}), '(False)\n'...
from django.core.management import BaseCommand from django.db import connection class Command(BaseCommand): """ pipenv run ./manage.py cleardb """ help = "Clear the database" def handle(self, *args, **options): print("\nDropping all database tables..\n") with connection.cursor() ...
[ "django.db.connection.cursor" ]
[((300, 319), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (317, 319), False, 'from django.db import connection\n')]
from typing import Dict import torch from torchtyping import TensorType from typing import Dict, Optional from tqdm import tqdm from typeguard import typechecked """ # PCA rationale: # check for the constraints , if small, do nothing # if needed, project the result onto the constraints using the proje...
[ "torch.linalg.norm", "torch.norm", "torch.allclose", "torch.zeros_like", "torch.nanmean", "torch.clamp" ]
[((1953, 1989), 'torch.linalg.norm', 'torch.linalg.norm', (['(preds - gt)'], {'dim': '(2)'}), '(preds - gt, dim=2)\n', (1970, 1989), False, 'import torch\n'), ((2037, 2067), 'torch.nanmean', 'torch.nanmean', (['bp_error'], {'dim': '(1)'}), '(bp_error, dim=1)\n', (2050, 2067), False, 'import torch\n'), ((4737, 4795), 't...
#!/usr/bin/python3 -u from __future__ import print_function import json import optparse import subprocess import sys parser = optparse.OptionParser() parser.add_option("--buck-test-info") parser.add_option("--jobs", type=int) (options, args) = parser.parse_args() with open(options.buck_test_info) as f: test_i...
[ "json.load", "optparse.OptionParser" ]
[((130, 153), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (151, 153), False, 'import optparse\n'), ((327, 339), 'json.load', 'json.load', (['f'], {}), '(f)\n', (336, 339), False, 'import json\n')]
# # The Python Imaging Library # $Id$ # # JPEG2000 file handling # # History: # 2014-03-12 ajh Created # # Copyright (c) 2014 Coriolis Systems Limited # Copyright (c) 2014 <NAME> # # See the README file for information on usage and redistribution. # __version__ = "0.1" from PIL import Image, ImageFile import struct ...
[ "PIL.ImageFile._save", "PIL.Image.register_save", "io.BytesIO", "os.fstat", "PIL.Image.register_extension", "PIL.ImageFile.ImageFile.load", "struct.unpack", "PIL.Image.register_mime", "PIL.Image.register_open" ]
[((7193, 7250), 'PIL.Image.register_open', 'Image.register_open', (['"""JPEG2000"""', 'Jpeg2KImageFile', '_accept'], {}), "('JPEG2000', Jpeg2KImageFile, _accept)\n", (7212, 7250), False, 'from PIL import Image, ImageFile\n'), ((7251, 7289), 'PIL.Image.register_save', 'Image.register_save', (['"""JPEG2000"""', '_save'],...
# -*- coding: utf-8 -*- from sqlalchemy.exc import SQLAlchemyError from h.services.exceptions import ValidationError, ConflictError class GroupUpdateService: def __init__(self, session): """ Create a new GroupUpdateService :param session: the SQLAlchemy session object """ ...
[ "h.services.exceptions.ValidationError" ]
[((912, 932), 'h.services.exceptions.ValidationError', 'ValidationError', (['err'], {}), '(err)\n', (927, 932), False, 'from h.services.exceptions import ValidationError, ConflictError\n')]
from app.encryption import CryptoSigner signer = CryptoSigner() def test_should_sign_content(notify_api): signer.init_app(notify_api) assert signer.sign("this") != "this" def test_should_verify_content(notify_api): signer.init_app(notify_api) signed = signer.sign("this") assert signer.verify(si...
[ "app.encryption.CryptoSigner" ]
[((50, 64), 'app.encryption.CryptoSigner', 'CryptoSigner', ([], {}), '()\n', (62, 64), False, 'from app.encryption import CryptoSigner\n')]
import requests import json class MetroSaoPaulo(): def get_metro_status(self): response = requests.get('http://www.metro.sp.gov.br/Sistemas/direto-do-metro-via4/diretodoMetroHome.aspx') body = response.text begin = body.index('objArrLinhas') end = body.index('var objArrL4...
[ "json.loads", "requests.get" ]
[((114, 219), 'requests.get', 'requests.get', (['"""http://www.metro.sp.gov.br/Sistemas/direto-do-metro-via4/diretodoMetroHome.aspx"""'], {}), "(\n 'http://www.metro.sp.gov.br/Sistemas/direto-do-metro-via4/diretodoMetroHome.aspx'\n )\n", (126, 219), False, 'import requests\n'), ((424, 443), 'json.loads', 'json.lo...
import logging from django import db from dramatiq.middleware import Middleware LOGGER = logging.getLogger("django_dramatiq.AdminMiddleware") class AdminMiddleware(Middleware): """This middleware keeps track of task executions. """ def after_enqueue(self, broker, message, delay): from .models i...
[ "logging.getLogger", "django.db.connections.close_all", "django.db.close_old_connections" ]
[((91, 143), 'logging.getLogger', 'logging.getLogger', (['"""django_dramatiq.AdminMiddleware"""'], {}), "('django_dramatiq.AdminMiddleware')\n", (108, 143), False, 'import logging\n'), ((1392, 1418), 'django.db.close_old_connections', 'db.close_old_connections', ([], {}), '()\n', (1416, 1418), False, 'from django impor...
from typing import Type from fpipe.exceptions import FileDataException from fpipe.file import File from fpipe.meta.abstract import FileData, T def meta_prioritized(t: Type[FileData[T]], *sources: File) -> T: error = FileDataException(t) for s in sources: try: return s[t] except Fi...
[ "fpipe.exceptions.FileDataException" ]
[((223, 243), 'fpipe.exceptions.FileDataException', 'FileDataException', (['t'], {}), '(t)\n', (240, 243), False, 'from fpipe.exceptions import FileDataException\n')]
"""Support for Xiaomi Mi Flora BLE plant sensor.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv from homeassistant.const import ( ...
[ "logging.getLogger", "voluptuous.Required", "datetime.timedelta", "voluptuous.Optional", "voluptuous.In" ]
[((492, 519), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (509, 519), False, 'import logging\n'), ((686, 709), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(1200)'}), '(seconds=1200)\n', (695, 709), False, 'from datetime import timedelta\n'), ((1137, 1159), 'voluptuous.Required...
import numpy as np import matplotlib.pyplot as plt augment_method = "Specaugment" d = np.load("result_{}/curve.npz".format(augment_method)) loss = d['loss'] acc = d['acc'] best_acc = d['best_acc'] print(best_acc) plt.plot(loss) plt.show() plt.clf() plt.plot(acc) plt.show() plt.clf()
[ "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.show" ]
[((217, 231), 'matplotlib.pyplot.plot', 'plt.plot', (['loss'], {}), '(loss)\n', (225, 231), True, 'import matplotlib.pyplot as plt\n'), ((232, 242), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (240, 242), True, 'import matplotlib.pyplot as plt\n'), ((243, 252), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), ...
''' Defines the preferences dialog. @author: <NAME> @organization: Mozilla Foundation @copyright: Copyright (c) 2006, 2007 Mozilla Foundation @license: BSD All rights reserved. This program and the accompanying materials are made available under the terms of the BSD which accompanies this distribution, and is avail...
[ "gi.repository.Gtk.ColorButton.__init__", "gi.repository.Gtk.SpinButton", "gi.repository.Gio.Settings.new", "gi.repository.Gtk.Table.new", "gi.repository.Gdk.color_parse", "gi.repository.Gtk.Alignment.__init__", "gi.repository.Gtk.Label.new", "gi.repository.Gtk.ScrolledWindow", "gi.repository.Gtk.No...
[((1271, 1285), 'gi.repository.Gtk.Notebook', 'gtk.Notebook', ([], {}), '()\n', (1283, 1285), True, 'from gi.repository import Gtk as gtk\n'), ((2313, 2341), 'gi.repository.Gtk.Alignment.__init__', 'gtk.Alignment.__init__', (['self'], {}), '(self)\n', (2335, 2341), True, 'from gi.repository import Gtk as gtk\n'), ((240...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
[ "neutron_lib.utils.net.get_random_mac", "neutron_lib.utils.net.is_port_trusted", "neutron_lib.utils.net.random_mac_generator", "mock.patch.object", "neutron_lib.utils.net.get_hostname" ]
[((767, 838), 'mock.patch.object', 'mock.patch.object', (['socket', '"""gethostname"""'], {'return_value': '"""fake-host-name"""'}), "(socket, 'gethostname', return_value='fake-host-name')\n", (784, 838), False, 'import mock\n'), ((1103, 1161), 'mock.patch.object', 'mock.patch.object', (['random', '"""getrandbits"""'],...
import pickle import time class Cache(object): def __init__(self, j): self._cache = {} self._j = j # def serialize(self, val): # tt = self._j.data.types.type_detect(val) def get(self, id="main", reset=False, expiration=3600): """ @param id is a unique id for the c...
[ "pickle.dumps", "pickle.loads", "time.sleep" ]
[((1741, 1754), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (1751, 1754), False, 'import time\n'), ((1918, 1931), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (1928, 1931), False, 'import time\n'), ((2143, 2156), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (2153, 2156), False, 'import time\n'), (...
""" Offset Mirror Classes. This module contains all the classes relating to the offset mirrors used in the FEE and XRT. Each offset mirror contains a stepper motor and piezo motor to control the pitch, and two pairs of motors to control the horizontal and vertical gantries. """ import logging import numpy as np from ...
[ "logging.getLogger", "ophyd.Component", "numpy.isnan", "numpy.isinf", "ophyd.FormattedComponent" ]
[((810, 837), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (827, 837), False, 'import logging\n'), ((1023, 1083), 'ophyd.Component', 'Cpt', (['EpicsSignalRO', '""":RBV"""'], {'auto_monitor': '(True)', 'kind': '"""hinted"""'}), "(EpicsSignalRO, ':RBV', auto_monitor=True, kind='hinted')\n...
# -*- coding: utf-8 -*- from os import chmod import pytest TEMP_FOLDER = 'tmp' MODE_EXECUTABLE = 0o755 MODE_NON_EXECUTABLE = 0o644 @pytest.fixture() def make_file(tmp_path): """Fixture to make a temporary executable or non executable file.""" def factory( filename: str, file_content: str, ...
[ "pytest.fixture" ]
[((137, 153), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (151, 153), False, 'import pytest\n')]
# Copyright (c) 2020 <NAME> from baselines.common import Dataset, explained_variance, fmt_row, zipsame from baselines import logger import baselines.common.tf_util as U import tensorflow as tf, numpy as np import time from baselines.common.mpi_adam import MpiAdam from baselines.common.mpi_moments import mpi_moments fr...
[ "baselines.common.tf_util.get_session", "baselines.common.mpi_adam.MpiAdam", "tensorflow.transpose", "tensorflow.reduce_sum", "mpi4py.MPI.COMM_WORLD.allgather", "numpy.array", "baselines.logger.log", "tensorflow.set_random_seed", "baselines.common.tf_util.get_placeholder_cached", "baselines.common...
[((895, 907), 'numpy.shape', 'np.shape', (['ob'], {}), '(ob)\n', (903, 907), True, 'import tensorflow as tf, numpy as np\n'), ((927, 939), 'numpy.shape', 'np.shape', (['ac'], {}), '(ac)\n', (935, 939), True, 'import tensorflow as tf, numpy as np\n'), ((987, 1011), 'numpy.concatenate', 'np.concatenate', (['(ob, ac)'], {...
""" Copyright 2021 MPI-SWS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribut...
[ "queryfuzz.engines.z3.z3_subgoal.Z3Subgoal", "queryfuzz.datalog.variable.Variable" ]
[((1655, 1730), 'queryfuzz.engines.z3.z3_subgoal.Z3Subgoal', 'Z3Subgoal', ([], {'randomness': 'self.randomness', 'arity': 'self.arity', 'params': 'self.params'}), '(randomness=self.randomness, arity=self.arity, params=self.params)\n', (1664, 1730), False, 'from queryfuzz.engines.z3.z3_subgoal import Z3Subgoal\n'), ((18...
#!/usr/bin/python3.6 from datetime import timedelta, datetime import logging import os import requests import sys import time import json log_file = 'audit.log' logging.basicConfig(filename=log_file, level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') # # This will archive inactive channels. The ...
[ "logging.basicConfig", "datetime.datetime.utcfromtimestamp", "sys.stdout.flush", "requests.post", "os.getenv", "time.sleep", "requests.get", "os.path.isfile", "datetime.datetime.now", "sys.exit", "json.load", "datetime.timedelta", "logging.info", "sys.stdout.write" ]
[((163, 278), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'log_file', 'level': 'logging.INFO', 'format': '"""%(asctime)s - %(levelname)s - %(message)s"""'}), "(filename=log_file, level=logging.INFO, format=\n '%(asctime)s - %(levelname)s - %(message)s')\n", (182, 278), False, 'import logging\n'),...
import os from .base import GnuRecipe from ..util import patch class EudevRecipe(GnuRecipe): def __init__(self, *args, **kwargs): super(EudevRecipe, self).__init__(*args, **kwargs) self.sha256 = '49c2d04105cad2526302627e040fa24b' \ '1916a9a3e059539bc8bb919b973890af' s...
[ "os.path.join" ]
[((1058, 1122), 'os.path.join', 'os.path.join', (['self.directory', '"""src/udev/udev-builtin-input_id.c"""'], {}), "(self.directory, 'src/udev/udev-builtin-input_id.c')\n", (1070, 1122), False, 'import os\n')]
import os import sys # `scandir()` collects info in one system call # https://pymotw.com/3/os/ # Run from interpreter as follows to check current directory: # >>> python3 os_scandir.py . def main(): for entry in os.scandir(sys.argv[1]): if entry.is_dir(): typ = 'dir' elif entry.is_fil...
[ "os.scandir" ]
[((219, 242), 'os.scandir', 'os.scandir', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (229, 242), False, 'import os\n')]
import time from unittest.case import SkipTest from ddtrace.context import Context from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY from ddtrace.span import Span from ddtrace.ext import errors def test_ids(): s = Span(tracer=None, name='span.test') assert s.trace_id assert s.span_id assert no...
[ "ddtrace.span.Span", "numpy.int64", "unittest.case.SkipTest", "time.sleep", "ddtrace.context.Context" ]
[((228, 263), 'ddtrace.span.Span', 'Span', ([], {'tracer': 'None', 'name': '"""span.test"""'}), "(tracer=None, name='span.test')\n", (232, 263), False, 'from ddtrace.span import Span\n'), ((344, 407), 'ddtrace.span.Span', 'Span', ([], {'tracer': 'None', 'name': '"""t"""', 'trace_id': '(1)', 'span_id': '(2)', 'parent_id...
import logging, matplotlib, os, sys, glob import scanpy as sc import matplotlib.pyplot as plt from matplotlib import rcParams from matplotlib import colors import pandas as pd from glbase3 import genelist plt.rcParams['figure.figsize']=(8,8) sc.settings.verbosity = 3 sc.set_figure_params(dpi=200, dpi_save=200) matplotl...
[ "scanpy.read", "pandas.DataFrame", "glbase3.glload", "scanpy.pl.rank_genes_groups", "glbase3.genelist", "scanpy.pl.rank_genes_groups_dotplot", "scanpy.set_figure_params", "os.remove" ]
[((268, 311), 'scanpy.set_figure_params', 'sc.set_figure_params', ([], {'dpi': '(200)', 'dpi_save': '(200)'}), '(dpi=200, dpi_save=200)\n', (288, 311), True, 'import scanpy as sc\n'), ((696, 752), 'glbase3.glload', 'glload', (['"""../../transcript_assembly/packed/all_genes.glb"""'], {}), "('../../transcript_assembly/pa...
#!/usr/bin/env python import os.path from datetime import datetime import tempfile import json import vcr from libcomcat.classes import DetailEvent, Product, VersionOption from libcomcat.search import search, get_event_by_id def get_datadir(): # where is this script? homedir = os.path.dirname(os.path.abspa...
[ "datetime.datetime", "json.loads", "libcomcat.search.get_event_by_id", "vcr.use_cassette", "libcomcat.classes.DetailEvent", "json.load", "tempfile.mkstemp" ]
[((520, 547), 'vcr.use_cassette', 'vcr.use_cassette', (['tape_file'], {}), '(tape_file)\n', (536, 547), False, 'import vcr\n'), ((2642, 2669), 'vcr.use_cassette', 'vcr.use_cassette', (['tape_file'], {}), '(tape_file)\n', (2658, 2669), False, 'import vcr\n'), ((2719, 2767), 'libcomcat.search.get_event_by_id', 'get_event...
import functools import json from contextlib import contextmanager import pytest import launch import launch.cli import launch.config import pkgpanda import ssh import test_util from launch.util import get_temp_config_path, stub from test_util.helpers import Host @contextmanager def mocked_context(*args, **kwargs):...
[ "pkgpanda.util.load_json", "launch.config.get_validated_config", "test_util.helpers.Host", "test_util.aws.DcosCfStack", "test_util.aws.DcosZenCfStack", "functools.partial", "launch.cli.main", "launch.util.stub", "launch.util.get_temp_config_path", "launch.get_launcher" ]
[((942, 971), 'test_util.helpers.Host', 'Host', (['"""127.0.0.1"""', '"""12.34.56"""'], {}), "('127.0.0.1', '12.34.56')\n", (946, 971), False, 'from test_util.helpers import Host\n'), ((989, 1012), 'test_util.helpers.Host', 'Host', (['"""127.0.0.1"""', 'None'], {}), "('127.0.0.1', None)\n", (993, 1012), False, 'from te...
from gzip import ( compress, GzipFile ) import numpy as np from .record import Record UNK = '<unk>' PAD = '<pad>' class Vocab(Record): __attributes__ = ['words', 'counts'] def __init__(self, words, counts): self.words = words self.counts = counts self.word_ids = { ...
[ "gzip.GzipFile", "numpy.array", "numpy.frombuffer", "gzip.compress" ]
[((2259, 2290), 'gzip.compress', 'compress', (['(meta + counts + words)'], {}), '(meta + counts + words)\n', (2267, 2290), False, 'from gzip import compress, GzipFile\n'), ((2354, 2387), 'gzip.GzipFile', 'GzipFile', ([], {'mode': '"""rb"""', 'fileobj': 'file'}), "(mode='rb', fileobj=file)\n", (2362, 2387), False, 'from...
from setuptools import setup, find_packages setup( name='aioteleclient', version='0.0.1', url='https://github.com/elmcrest/aioteleclient', license='MIT', description='An fast and heavily tested async telegram messenger client.', long_description="An fast and heavily tested async telegram messen...
[ "setuptools.find_packages" ]
[((747, 762), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (760, 762), False, 'from setuptools import setup, find_packages\n')]
# This is only an example of a battle that I used to test. from core.Automata import Automata # init shiki = Automata("assets/Qp4.png", "assets/eg-sp1.png", (248, 0)) # start shiki.quick_start() # battle 1 shiki.select_servant_skill(5) shiki.select_servant_skill(6) shiki.select_servant_skill(7) shiki.select_cards([7]) ...
[ "core.Automata.Automata" ]
[((109, 166), 'core.Automata.Automata', 'Automata', (['"""assets/Qp4.png"""', '"""assets/eg-sp1.png"""', '(248, 0)'], {}), "('assets/Qp4.png', 'assets/eg-sp1.png', (248, 0))\n", (117, 166), False, 'from core.Automata import Automata\n')]
#!/usr/bin/env python3 # still in development # import asyncio import websockets import json import requests eventsAPIPath = '/api/v1/events' localServerIP = '0.0.0.0' localServerAPIPort = '8000' localServerWSPort = '8000' localServerPath = '/sealog-server' #devel localToken = "<KEY>" #prod #localToken = "<KEY>" lo...
[ "websockets.connect", "json.dumps", "json.loads", "asyncio.get_event_loop" ]
[((1773, 1797), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (1795, 1797), False, 'import asyncio\n'), ((955, 1024), 'websockets.connect', 'websockets.connect', (["('ws://' + localServerIP + ':' + localServerWSPort)"], {}), "('ws://' + localServerIP + ':' + localServerWSPort)\n", (973, 1024), F...
#!/usr/bin/env python from athstmt import * from athinterpreter import TildeAthInterp stmts = AthStatementList([ AthTokenStatement('PROCREATE', [IdentifierToken('TEST'), None]), TildeAthLoop(False, AthStatementList([ CondiJump([IdentifierToken('TEST'), 3]), AthTokenStatement('print', [LiteralTo...
[ "athinterpreter.TildeAthInterp" ]
[((943, 959), 'athinterpreter.TildeAthInterp', 'TildeAthInterp', ([], {}), '()\n', (957, 959), False, 'from athinterpreter import TildeAthInterp\n')]
import torch from torch.utils.data import dataset from tqdm import tqdm from pathlib import Path class DatasetBase(dataset.Dataset): def __init__(self, dataset_name, split, cache_dir = None, load_cache_if_exists=True, **kwargs): super...
[ "tqdm.tqdm", "pathlib.Path" ]
[((1403, 1427), 'tqdm.tqdm', 'tqdm', (['self.record_tokens'], {}), '(self.record_tokens)\n', (1407, 1427), False, 'from tqdm import tqdm\n'), ((1728, 1738), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (1732, 1738), False, 'from pathlib import Path\n')]
# (c) Copyright 2013 IBM Company # # 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 ag...
[ "mock.patch.object", "os_brick.initiator.connectors.fibre_channel_ppc64.FibreChannelConnectorPPC64" ]
[((1354, 1428), 'mock.patch.object', 'mock.patch.object', (['linuxscsi.LinuxSCSI', '"""process_lun_id"""'], {'return_value': '"""2"""'}), "(linuxscsi.LinuxSCSI, 'process_lun_id', return_value='2')\n", (1371, 1428), False, 'import mock\n'), ((964, 1069), 'os_brick.initiator.connectors.fibre_channel_ppc64.FibreChannelCon...
# Execute below code with command, # spark-submit --master local[*] network_wordcount.py localhost 9999 from __future__ import print_function import sys from pyspark import SparkContext from pyspark.streaming import StreamingContext if __name__ == "__main__": if len(sys.argv) != 3: print("Usage...
[ "pyspark.streaming.StreamingContext", "pyspark.SparkContext" ]
[((408, 463), 'pyspark.SparkContext', 'SparkContext', ([], {'appName': '"""PythonStreamingNetworkWordCount"""'}), "(appName='PythonStreamingNetworkWordCount')\n", (420, 463), False, 'from pyspark import SparkContext\n'), ((475, 498), 'pyspark.streaming.StreamingContext', 'StreamingContext', (['sc', '(1)'], {}), '(sc, 1...
from pathlib import Path from easy_sdm.data.data_loader import ShapefileLoader from easy_sdm.featuarizer.build_features import OccurrancesDatasetBuilder from easy_sdm.utils.utils import PathUtils def extract_occurances(species_shapefile_path: Path): processed_rasters_dirpath = PathUtils.dir_path(Path.cwd() / "da...
[ "easy_sdm.utils.utils.PathUtils.get_rasters_filepaths_in_dir", "pathlib.Path.cwd", "easy_sdm.utils.utils.PathUtils.file_path", "easy_sdm.featuarizer.build_features.OccurrancesDatasetBuilder", "easy_sdm.data.data_loader.ShapefileLoader" ]
[((392, 435), 'easy_sdm.utils.utils.PathUtils.file_path', 'PathUtils.file_path', (['species_shapefile_path'], {}), '(species_shapefile_path)\n', (411, 435), False, 'from easy_sdm.utils.utils import PathUtils\n'), ((460, 525), 'easy_sdm.utils.utils.PathUtils.get_rasters_filepaths_in_dir', 'PathUtils.get_rasters_filepath...
# Generated by Django 2.1.7 on 2019-05-21 14:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0008_auto_20190521_1937'), ] operations = [ migrations.AddField( model_name='account', name='name', ...
[ "django.db.models.CharField" ]
[((334, 398), 'django.db.models.CharField', 'models.CharField', ([], {'default': '""""""', 'max_length': '(64)', 'verbose_name': '"""Name"""'}), "(default='', max_length=64, verbose_name='Name')\n", (350, 398), False, 'from django.db import migrations, models\n')]
# -*- coding: utf-8 -*- from EXOSIMS.Prototypes.OpticalSystem import OpticalSystem import astropy.units as u import numpy as np import scipy.stats as st import scipy.optimize as opt class Nemati(OpticalSystem): """Nemati Optical System class This class contains all variables and methods necessar...
[ "numpy.sqrt", "numpy.log", "EXOSIMS.Prototypes.OpticalSystem.OpticalSystem.__init__", "numpy.array", "numpy.errstate", "numpy.isnan", "numpy.true_divide", "numpy.isinf" ]
[((590, 627), 'EXOSIMS.Prototypes.OpticalSystem.OpticalSystem.__init__', 'OpticalSystem.__init__', (['self'], {}), '(self, **specs)\n', (612, 627), False, 'from EXOSIMS.Prototypes.OpticalSystem import OpticalSystem\n'), ((3905, 3941), 'numpy.array', 'np.array', (['sInds'], {'ndmin': '(1)', 'copy': '(False)'}), '(sInds,...
# Copyright (c) SenseTime. All Rights Reserved. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torch.nn as nn class AdjustLayer(nn.Module): def __init__(self, inplane, outplane): sup...
[ "torch.nn.BatchNorm2d", "torch.nn.Conv2d" ]
[((412, 467), 'torch.nn.Conv2d', 'nn.Conv2d', (['inplane', 'outplane'], {'kernel_size': '(1)', 'bias': '(False)'}), '(inplane, outplane, kernel_size=1, bias=False)\n', (421, 467), True, 'import torch.nn as nn\n'), ((486, 510), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['outplane'], {}), '(outplane)\n', (500, 510), Tru...
import logging from django.conf.urls import include, url from django.db import transaction from django.db.models import F from django.http import Http404 from django.shortcuts import redirect, render from django.template.defaultfilters import pluralize from django.urls import reverse from django.utils.safestring impor...
[ "logging.getLogger", "wagtail_personalisation.models.Segment.objects.count", "django.utils.translation.ugettext_lazy", "wagtail_personalisation.models.PersonalisablePageMetadata.objects.filter", "django.db.transaction.atomic", "wagtail_personalisation.models.Segment.objects.enabled", "wagtail.core.model...
[((913, 940), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (930, 940), False, 'import logging\n'), ((944, 981), 'wagtail.core.hooks.register', 'hooks.register', (['"""register_admin_urls"""'], {}), "('register_admin_urls')\n", (958, 981), False, 'from wagtail.core import hooks\n'), ((12...
import datetime import os import textwrap from unittest import mock import pytest from stograde.common import chdir from stograde.toolkit.config import Config _dir = os.path.dirname(os.path.realpath(__file__)) def test_setup(tmpdir): with tmpdir.as_cwd(): assert not os.path.exists('stograde.ini') ...
[ "datetime.datetime", "os.path.exists", "stograde.toolkit.config.Config", "os.path.join", "os.path.realpath", "unittest.mock.patch" ]
[((185, 211), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (201, 211), False, 'import os\n'), ((492, 532), 'os.path.join', 'os.path.join', (['_dir', '"""fixtures"""', '"""config"""'], {}), "(_dir, 'fixtures', 'config')\n", (504, 532), False, 'import os\n'), ((843, 883), 'os.path.join', 'o...
# -*- coding: utf-8 -*- """ Created on Tue Aug 22 11:21:01 2017 @author: Zlatko """ from pyEPR import * if 0: # Specify the HFSS project to be analyzed project_info = ProjectInfo(r"X:\Simulation\\hfss\\KC\\") project_info.project_name = '2013-12-03_9GHzCavity' # Name of the project file (string). "None...
[ "pyEPR.toolbox_plotting.cmap_discrete" ]
[((2072, 2093), 'pyEPR.toolbox_plotting.cmap_discrete', 'cmap_discrete', (['nmodes'], {}), '(nmodes)\n', (2085, 2093), False, 'from pyEPR.toolbox_plotting import cmap_discrete\n')]
# -*- coding: utf-8 -*- # File: dorefa.py # Author: <NAME> import tensorflow as tf from tensorpack.utils.argtools import graph_memoized @graph_memoized def get_dorefa(bitW, bitA, bitG): """ Return the three quantization functions fw, fa, fg, for weights, activations and gradients respectively It's unsaf...
[ "tensorflow.round", "tensorflow.equal", "tensorflow.shape", "tensorflow.get_variable", "tensorflow.ones", "tensorflow.tanh", "tensorflow.sign", "tensorflow.summary.histogram", "tensorflow.clip_by_value", "tensorflow.ones_like", "tensorflow.summary.scalar", "tensorflow.zeros", "tensorflow.abs...
[((2217, 2273), 'tensorflow.get_variable', 'tf.get_variable', (['"""Wp"""'], {'initializer': '(1.0)', 'dtype': 'tf.float32'}), "('Wp', initializer=1.0, dtype=tf.float32)\n", (2232, 2273), True, 'import tensorflow as tf\n'), ((2284, 2340), 'tensorflow.get_variable', 'tf.get_variable', (['"""Wn"""'], {'initializer': '(1....
from unittest import TestCase from icon_storage.util.cache_help import CacheHelp from icon_storage.actions.store import Store from icon_storage.actions.check_for_variable import CheckForVariable class TestStoreAction(TestCase): def test_store(self): store = Store() var_check = CheckForVariable() ...
[ "icon_storage.util.cache_help.CacheHelp", "icon_storage.actions.check_for_variable.CheckForVariable", "icon_storage.actions.store.Store" ]
[((272, 279), 'icon_storage.actions.store.Store', 'Store', ([], {}), '()\n', (277, 279), False, 'from icon_storage.actions.store import Store\n'), ((300, 318), 'icon_storage.actions.check_for_variable.CheckForVariable', 'CheckForVariable', ([], {}), '()\n', (316, 318), False, 'from icon_storage.actions.check_for_variab...
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "performer.fast_attention.tensorflow.util.DenseEinsum", "tensorflow.keras.initializers.RandomUniform", "tensorflow.transpose", "tensorflow.reduce_sum", "math.sqrt", "tensorflow.keras.backend.ndim", "tensorflow.einsum", "tensorflow.linalg.qr", "tensorflow.cast", "tensorflow.random.normal", "tenso...
[((2273, 2313), 'tensorflow.experimental.numpy.vstack', 'tf.experimental.numpy.vstack', (['block_list'], {}), '(block_list)\n', (2301, 2313), True, 'import tensorflow as tf\n'), ((4999, 5050), 'tensorflow.einsum', 'tf.einsum', (['"""blhd,md->blhm"""', 'data', 'projection_matrix'], {}), "('blhd,md->blhm', data, projecti...
import argparse import requests from bs4 import BeautifulSoup import pandas as pd def getAllCryptos(): elementList = [] response = requests.get('https://coinmarketcap.com/coins/') soup = BeautifulSoup(response.text, "html.parser") table = soup.findAll('table')[2] index = 0 for row in table.fin...
[ "argparse.ArgumentParser", "pandas.merge", "argparse.ArgumentTypeError", "requests.get", "bs4.BeautifulSoup", "pandas.DataFrame" ]
[((141, 189), 'requests.get', 'requests.get', (['"""https://coinmarketcap.com/coins/"""'], {}), "('https://coinmarketcap.com/coins/')\n", (153, 189), False, 'import requests\n'), ((201, 244), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.text', '"""html.parser"""'], {}), "(response.text, 'html.parser')\n", (214, 24...
''' Example Pose Estimation Network with SE3 loss function (Inference Script) Dataset: KingsCollege Network: Inception v1 Loss Function: Geomstats SE(3) Loss ''' import argparse import sys import os os.environ['GEOMSTATS_BACKEND'] = 'tensorflow' # NOQA import geomstats.lie_group as lie_group import tensorflow as tf ...
[ "tensorflow.local_variables_initializer", "tensorflow.logging.set_verbosity", "tensorflow.TFRecordReader", "geomstats.special_euclidean_group.SpecialEuclideanGroup", "tensorflow.cast", "tensorflow.app.run", "argparse.ArgumentParser", "tensorflow.train.Coordinator", "tensorflow.Session", "tensorflo...
[((497, 572), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test SE3 PoseNet Inception v1 Model."""'}), "(description='Test SE3 PoseNet Inception v1 Model.')\n", (520, 572), False, 'import argparse\n'), ((2310, 2334), 'geomstats.special_euclidean_group.SpecialEuclideanGroup', 'SpecialEu...
#!/usr/bin/env python import numpy as np from olympus.surfaces import AbstractSurface class AckleyPath(AbstractSurface): def __init__(self, param_dim=2, noise=None): """Ackley path function. Args: param_dim (int): Number of input dimensions. Default is 2. noise (Noise): ...
[ "numpy.exp", "numpy.array", "numpy.sum", "numpy.cos" ]
[((761, 777), 'numpy.array', 'np.array', (['params'], {}), '(params)\n', (769, 777), True, 'import numpy as np\n'), ((950, 966), 'numpy.array', 'np.array', (['params'], {}), '(params)\n', (958, 966), True, 'import numpy as np\n'), ((1084, 1095), 'numpy.exp', 'np.exp', (['(1.0)'], {}), '(1.0)\n', (1090, 1095), True, 'im...
import json import lzma from glob import glob from pprint import pprint import pandas as pd import smart_open import typer from tqdm import tqdm ORDERED_VAR = ["table", "name", "description", "type"] TEXTTT_VAR = ["table", "name"] app = typer.Typer() @app.command() def sniff(path: str, tar: bool = True, examples: ...
[ "json.loads", "tqdm.tqdm", "typer.Typer", "pandas.DataFrame.from_dict", "pandas.read_json", "pprint.pprint", "glob.glob" ]
[((240, 253), 'typer.Typer', 'typer.Typer', ([], {}), '()\n', (251, 253), False, 'import typer\n'), ((1566, 1581), 'pprint.pprint', 'pprint', (['key_val'], {}), '(key_val)\n', (1572, 1581), False, 'from pprint import pprint\n'), ((1739, 1757), 'pandas.read_json', 'pd.read_json', (['file'], {}), '(file)\n', (1751, 1757)...
import random import numpy as np import cv2 from utils.transforms.transforms import CustomTransform class RandomFlip(CustomTransform): def __init__(self, prob_x=0, prob_y=0): """ Arguments: ---------- prob_x: range [0, 1], probability to use horizontal flip, setting to 0 means dis...
[ "numpy.random.choice", "numpy.flip", "numpy.random.uniform" ]
[((675, 740), 'numpy.random.choice', 'np.random.choice', (['[False, True]'], {'p': '(1 - self.prob_x, self.prob_x)'}), '([False, True], p=(1 - self.prob_x, self.prob_x))\n', (691, 740), True, 'import numpy as np\n'), ((758, 823), 'numpy.random.choice', 'np.random.choice', (['[False, True]'], {'p': '(1 - self.prob_y, se...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== from __future__ import division from __future__ import print_function import numpy ...
[ "cntk.internal.sanitize_axis", "cntk.cntk_py.ndcg_at_1", "cntk.cntk_py.edit_distance_error", "cntk.cntk_py.classification_error", "cntk.internal.sanitize_input", "cntk.cntk_py.lambda_rank" ]
[((2607, 2636), 'cntk.internal.sanitize_input', 'sanitize_input', (['output', 'dtype'], {}), '(output, dtype)\n', (2621, 2636), False, 'from cntk.internal import sanitize_input, sanitize_shape, sanitize_axis, sanitize_dynamic_axes, typemap\n'), ((2648, 2675), 'cntk.internal.sanitize_input', 'sanitize_input', (['gain', ...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
[ "heat.engine.template.Template", "mock.MagicMock", "heat.tests.utils.dummy_context" ]
[((907, 928), 'heat.tests.utils.dummy_context', 'utils.dummy_context', ([], {}), '()\n', (926, 928), False, 'from heat.tests import utils\n'), ((1580, 1596), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (1594, 1596), False, 'import mock\n'), ((1217, 1387), 'heat.engine.template.Template', 'template.Template', ...
"""Implementation of AppGroup API. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import fnmatch from treadmill import context from treadmill import schema from treadmill import admin class API(object): ""...
[ "fnmatch.fnmatch", "treadmill.admin.AppGroup", "treadmill.schema.schema" ]
[((546, 600), 'treadmill.schema.schema', 'schema.schema', (["{'$ref': 'app_group.json#/resource_id'}"], {}), "({'$ref': 'app_group.json#/resource_id'})\n", (559, 600), False, 'from treadmill import schema\n'), ((801, 952), 'treadmill.schema.schema', 'schema.schema', (["{'$ref': 'app_group.json#/resource_id'}", "{'allOf...
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine import post_process from recipe_engine import recipe_api DEPS = [ 'gclient', 'recipe_engine/properties', ] PROPERTIES = { 'patch...
[ "recipe_engine.recipe_api.Property" ]
[((331, 352), 'recipe_engine.recipe_api.Property', 'recipe_api.Property', ([], {}), '()\n', (350, 352), False, 'from recipe_engine import recipe_api\n')]
from text import symbols class Hparams: def __init__(self): ################################ # Experiment Parameters # ################################ self.epochs = 500 self.iters_per_checkpoint = 1000 self.iters_per_validation = 1000 self.seed = 123...
[ "text.symbols" ]
[((1188, 1214), 'text.symbols', 'symbols', (['self.symbols_lang'], {}), '(self.symbols_lang)\n', (1195, 1214), False, 'from text import symbols\n')]
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "tensorflow_probability.python.internal.assert_util.assert_greater", "tensorflow.compat.v2.cumsum", "tensorflow.compat.v2.math.log", "tensorflow.compat.v2.concat", "tensorflow.compat.v2.exp", "tensorflow_probability.python.internal.auto_composite_tensor.auto_composite_tensor", "tensorflow.compat.v2.name...
[((1083, 1149), 'tensorflow_probability.python.internal.auto_composite_tensor.auto_composite_tensor', 'auto_composite_tensor.auto_composite_tensor', ([], {'omit_kwargs': "('name',)"}), "(omit_kwargs=('name',))\n", (1126, 1149), False, 'from tensorflow_probability.python.internal import auto_composite_tensor\n'), ((2246...
# Calculate cloud storage cash requirements from math import ceil price = { 'server': 2, # usd/hour 'data': 0.5, # usd/hour 'host': 10 # usd/month } capacity = { 'server': 50, # users 'data': 500 # megabytes } budget = float(input()) users = int(input()) data = int(input()) # gigabytes hosts = i...
[ "math.ceil" ]
[((369, 401), 'math.ceil', 'ceil', (["(users / capacity['server'])"], {}), "(users / capacity['server'])\n", (373, 401), False, 'from math import ceil\n'), ((442, 478), 'math.ceil', 'ceil', (["(data * 1000 / capacity['data'])"], {}), "(data * 1000 / capacity['data'])\n", (446, 478), False, 'from math import ceil\n')]
#!/usr/bin/env python3 import sys from muse_tool import multi_muse if __name__ == "__main__": # CLI Entrypoint. retcode = 0 try: retcode = multi_muse.main() except Exception as e: retcode = 1 sys.exit(retcode) # __END__
[ "muse_tool.multi_muse.main", "sys.exit" ]
[((232, 249), 'sys.exit', 'sys.exit', (['retcode'], {}), '(retcode)\n', (240, 249), False, 'import sys\n'), ((162, 179), 'muse_tool.multi_muse.main', 'multi_muse.main', ([], {}), '()\n', (177, 179), False, 'from muse_tool import multi_muse\n')]
from django.db import models from django.core.validators import MinValueValidator from user_management.models import Librarian, DeliveryMan, Reader class Library(models.Model): ID = models.AutoField(primary_key=True) name = models.CharField(max_length=200) address = models.TextField(max_length=1000) li...
[ "django.db.models.Index", "django.db.models.OneToOneField", "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.BooleanField", "django.db.models.AutoField", "django.core.validators.MinValueValidator", "django.db.models.CharField" ]
[((187, 221), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (203, 221), False, 'from django.db import models\n'), ((233, 265), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (249, 265), False, 'from djan...
import os from batman.run import run from tests.integration.utils import batman_dir, update_batman_yml, touch_file def test_that_batmanyml_changes_are_noticed(): """ Sometimes we need to change the .batman.yml file, so make sure that changes are noticed and get run. """ with batman_dir({ "e...
[ "batman.run.run", "os.makedirs", "tests.integration.utils.update_batman_yml", "os.path.join", "tests.integration.utils.batman_dir" ]
[((297, 357), 'tests.integration.utils.batman_dir', 'batman_dir', (["{'ensure_symlinks': {'cotts.txt': 'ravine.txt'}}"], {}), "({'ensure_symlinks': {'cotts.txt': 'ravine.txt'}})\n", (307, 357), False, 'from tests.integration.utils import batman_dir, update_batman_yml, touch_file\n'), ((1300, 1320), 'tests.integration.u...
""" Provide the ``LoadTest`` class. """ # -- Imports ----------------------------------------------------------------- from edafos.viz import LoadTestPlot import pandas as pd from edafos import set_units # -- LoadTest Class ---------------------------------------------------------- class LoadTest(object): """ ...
[ "pandas.DataFrame", "edafos.set_units" ]
[((3317, 3368), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'self.qs_data', 'columns': "['Q', 'S']"}), "(data=self.qs_data, columns=['Q', 'S'])\n", (3329, 3368), True, 'import pandas as pd\n'), ((5810, 5849), 'edafos.set_units', 'set_units', (['"""capacity"""', 'self.unit_system'], {}), "('capacity', self.unit_sy...
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
[ "enaml.compat.with_metaclass", "atom.api.Unicode", "atom.api.Event", "atom.api.Typed" ]
[((2199, 2238), 'enaml.compat.with_metaclass', 'with_metaclass', (['DeclarativeMeta', 'Object'], {}), '(DeclarativeMeta, Object)\n', (2213, 2238), False, 'from enaml.compat import with_metaclass\n'), ((3181, 3201), 'atom.api.Typed', 'Typed', (['sortedmap', '()'], {}), '(sortedmap, ())\n', (3186, 3201), False, 'from ato...
'''Utility functions and classes for handling image datasets.''' import cPickle import cv2 import os.path as osp import numpy as np import tensorflow as tf from config_tfvgg import cfg FLAGS = tf.app.flags.FLAGS def get_facebox_dims(img_shape,face_bbox,target_size,crop_size,spec,crop_ind): face_bbox = np.zeros_li...
[ "tensorflow.image.resize_images", "tensorflow.shape", "tensorflow.read_file", "numpy.array", "tensorflow.FIFOQueue", "numpy.min", "numpy.ceil", "tensorflow.reverse", "os.path.splitext", "tensorflow.to_int32", "tensorflow.range", "cv2.imread", "tensorflow.minimum", "tensorflow.image.decode_...
[((309, 333), 'numpy.zeros_like', 'np.zeros_like', (['face_bbox'], {}), '(face_bbox)\n', (322, 333), True, 'import numpy as np\n'), ((925, 1001), 'numpy.array', 'np.array', (['(face_bbox[3] - face_bbox[1] + 1, face_bbox[2] - face_bbox[0] + 1)'], {}), '((face_bbox[3] - face_bbox[1] + 1, face_bbox[2] - face_bbox[0] + 1))...
#!/usr/bin/env python3 ####################################################################################################################### # Licensed Materials –Property of HCL Technologies Ltd. # © Copyright HCL Technologies Ltd. 2020. # All rights reserved. See product license for details. US Government Users...
[ "inspect.currentframe", "json.loads", "logging.info", "time.sleep" ]
[((2082, 2107), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (2092, 2107), False, 'import json\n'), ((2117, 2195), 'logging.info', 'logging.info', (["('Started new execution with id: ' + json_response['ExecutionId'])"], {}), "('Started new execution with id: ' + json_response['ExecutionId']...
#!/usr/bin/env python # * coding: utf8 * ''' cloudb Usage: cloudb enable extensions [--verbosity=<level>] cloudb create schema [--schemas=<name> --verbosity=<level>] cloudb create admin-user [--verbosity=<level>] cloudb create read-only-user [--verbosity=<level>] cloudb create indexes [--verbosity=<level>] ...
[ "osgeo.gdal.VectorTranslate", "pathlib.Path", "datetime.datetime.strptime", "time.perf_counter", "osgeo.gdal.SetConfigOption", "osgeo.gdal.VectorTranslateOptions", "osgeo.ogr.Open", "sys.exit", "datetime.datetime.today", "osgeo.gdal.OpenEx", "docopt.docopt", "colorama.init" ]
[((1006, 1065), 'osgeo.gdal.SetConfigOption', 'gdal.SetConfigOption', (['"""MSSQLSPATIAL_LIST_ALL_TABLES"""', '"""YES"""'], {}), "('MSSQLSPATIAL_LIST_ALL_TABLES', 'YES')\n", (1026, 1065), False, 'from osgeo import gdal, ogr\n'), ((1066, 1115), 'osgeo.gdal.SetConfigOption', 'gdal.SetConfigOption', (['"""PG_LIST_ALL_TABL...
#(C) Copyright <NAME> 2017-2021 #(C) Copyright Thousand Smiles Foundation 2017-2021 # #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 requir...
[ "json.loads", "django.http.HttpResponseBadRequest", "sys.exc_info", "rest_framework.response.Response", "django.http.HttpResponseServerError", "django.http.HttpResponseNotFound" ]
[((21314, 21338), 'json.loads', 'json.loads', (['request.body'], {}), '(request.body)\n', (21324, 21338), False, 'import json\n'), ((24530, 24542), 'rest_framework.response.Response', 'Response', (['{}'], {}), '({})\n', (24538, 24542), False, 'from rest_framework.response import Response\n'), ((6617, 6641), 'django.htt...
from setuptools import setup, find_packages with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name='amieclient', version='0.4.0', packages=find_packages(), install_requires=[ 'requests>=2.20.0,<3', 'python-dateutil>=2.6.1,<2.7' ], auth...
[ "setuptools.find_packages" ]
[((196, 211), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (209, 211), False, 'from setuptools import setup, find_packages\n')]
import spartan from spartan import core, expr, util, blob_ctx import numpy as np from .qr import qr def svd(A, k=None): """ Stochastic SVD. Parameters ---------- A : spartan matrix Array to compute the SVD on, of shape (M, N) k : int, optional Number of singular values and vectors to compute....
[ "spartan.expr.randn", "spartan.expr.dot", "numpy.sqrt", "numpy.linalg.eig", "numpy.ones", "spartan.expr.transpose", "numpy.argsort" ]
[((594, 619), 'spartan.expr.randn', 'expr.randn', (['A.shape[1]', 'k'], {}), '(A.shape[1], k)\n', (604, 619), False, 'from spartan import core, expr, util, blob_ctx\n'), ((627, 645), 'spartan.expr.dot', 'expr.dot', (['A', 'Omega'], {}), '(A, Omega)\n', (635, 645), False, 'from spartan import core, expr, util, blob_ctx\...
# @file # # Copyright (c) Microsoft Corporation. # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> # Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent ## import os import logging from edk2toolext.environment i...
[ "os.path.abspath", "edk2toolext.environment.shell_environment.GetBuildVars", "logging.warning", "edk2toollib.utility_functions.GetHostInfo" ]
[((6980, 7030), 'logging.warning', 'logging.warning', (['"""Using Pip Tools based BaseTools"""'], {}), "('Using Pip Tools based BaseTools')\n", (6995, 7030), False, 'import logging\n'), ((7067, 7125), 'logging.warning', 'logging.warning', (['"""Falling back to using in-tree BaseTools"""'], {}), "('Falling back to using...
from os import path from pprint import pformat from git_sh_sync.proc import CHAR_NEWLINE def test_cmd_init_empty(helpcmd): res = helpcmd.init('test-command') assert res.cmd == ['test-command'] assert res.cwd is None assert res.cin is None assert res.exc is None assert res.code is None ass...
[ "os.path.realpath" ]
[((694, 719), 'os.path.realpath', 'path.realpath', (['"""test-dir"""'], {}), "('test-dir')\n", (707, 719), False, 'from os import path\n'), ((2176, 2201), 'os.path.realpath', 'path.realpath', (['"""test-dir"""'], {}), "('test-dir')\n", (2189, 2201), False, 'from os import path\n'), ((2668, 2693), 'os.path.realpath', 'p...
import os import pymel.core as pm import crab # ------------------------------------------------------------------------------ def get_icon(name): return os.path.join( os.path.dirname(__file__), 'icons', '%s.png' % name, ) # ---------------------------------------------------------...
[ "pymel.core.selected", "crab.utils.access.get_controls", "pymel.core.select", "os.path.dirname", "pymel.core.objExists", "pymel.core.PyNode", "pymel.core.playbackOptions", "pymel.core.setKeyframe", "crab.utils.snap.labels" ]
[((184, 209), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (199, 209), False, 'import os\n'), ((1626, 1652), 'pymel.core.select', 'pm.select', (['nodes_to_select'], {}), '(nodes_to_select)\n', (1635, 1652), True, 'import pymel.core as pm\n'), ((4626, 4639), 'pymel.core.selected', 'pm.select...
# TinyTuya Module # -*- coding: utf-8 -*- """ Python module to interface with Tuya WiFi smart devices Author: <NAME> For more information see https://github.com/jasonacox/tinytuya Classes OutletDevice(dev_id, address, local_key=None, dev_type='default') CoverDevice(dev_id, address, local_key=Non...
[ "logging.getLogger", "json.loads", "hashlib.md5", "socket.socket", "base64.b64encode", "json.dumps", "base64.b64decode", "time.sleep", "Crypto.Cipher.AES.new", "time.time", "binascii.crc32", "colorsys.rgb_to_hsv", "pyaes.AESModeOfOperationECB" ]
[((2535, 2562), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2552, 2562), False, 'import logging\n'), ((26706, 26774), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM', 'socket.IPPROTO_UDP'], {}), '(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)\n', (26...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-11-21 06:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0006_user_terminal_password'), ] operations = [ migrations.AddField...
[ "django.db.models.IntegerField" ]
[((396, 426), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(1)'}), '(default=1)\n', (415, 426), False, 'from django.db import migrations, models\n')]
""" Contains base tf losses """ import tensorflow.compat.v1 as tf def softmax_cross_entropy(labels, logits, *args, **kwargs): """ Multi-class CE which takes plain or one-hot labels Parameters ---------- labels : tf.Tensor logits : tf.Tensor args other positional parameters from `tf....
[ "tensorflow.compat.v1.equal", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.reduce_sum", "tensorflow.compat.v1.cast", "tensorflow.compat.v1.losses.softmax_cross_entropy" ]
[((497, 513), 'tensorflow.compat.v1.shape', 'tf.shape', (['labels'], {}), '(labels)\n', (505, 513), True, 'import tensorflow.compat.v1 as tf\n'), ((533, 549), 'tensorflow.compat.v1.shape', 'tf.shape', (['logits'], {}), '(logits)\n', (541, 549), True, 'import tensorflow.compat.v1 as tf\n'), ((868, 932), 'tensorflow.comp...
from datetime import datetime, timedelta from urllib import parse from ably.http.paginatedresult import PaginatedResult from ably.types.mixins import EncodeDataMixin def _ms_since_epoch(dt): epoch = datetime.utcfromtimestamp(0) delta = dt - epoch return int(delta.total_seconds() * 1000) def _dt_from_ms...
[ "datetime.datetime.utcfromtimestamp", "ably.http.paginatedresult.PaginatedResult.paginated_query", "urllib.parse.urlencode", "datetime.timedelta", "urllib.parse.quote_plus" ]
[((206, 234), 'datetime.datetime.utcfromtimestamp', 'datetime.utcfromtimestamp', (['(0)'], {}), '(0)\n', (231, 234), False, 'from datetime import datetime, timedelta\n'), ((344, 372), 'datetime.datetime.utcfromtimestamp', 'datetime.utcfromtimestamp', (['(0)'], {}), '(0)\n', (369, 372), False, 'from datetime import date...
# Copyright 2019 IBM Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "random.sample", "math.ceil", "lale.search.schema2search_space.schemaToSearchSpace", "lale.search.search_space.SearchSpaceEnum", "itertools.product", "collections.ChainMap", "warnings.warn" ]
[((3595, 3647), 'lale.search.schema2search_space.schemaToSearchSpace', 'schemaToSearchSpace', (['longName', 'name', 'schema'], {'pgo': 'pgo'}), '(longName, name, schema, pgo=pgo)\n', (3614, 3647), False, 'from lale.search.schema2search_space import schemaToSearchSpace\n'), ((5566, 5597), 'itertools.product', 'itertools...
""".""" class Node(object): """.""" def __init__(self, val, next=None): """.""" self.val = val self.next = next def test_2_2(): """.""" from CTCI_2_2 import kth_to_last head = Node('a', Node('b', Node('c', Node('d')))) assert kth_to_last(2, head) == ['c', 'd']
[ "CTCI_2_2.kth_to_last" ]
[((279, 299), 'CTCI_2_2.kth_to_last', 'kth_to_last', (['(2)', 'head'], {}), '(2, head)\n', (290, 299), False, 'from CTCI_2_2 import kth_to_last\n')]
# -*- coding: utf-8 -*- # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # # PCBA from MoleculeNet for the prediction of biological activities import pandas as pd from dgl.data.utils import get_download_dir, download, _get_dgl_url, extract_archive from .csv...
[ "dgl.data.utils.extract_archive", "dgl.data.utils.get_download_dir", "dgl.data.utils._get_dgl_url", "pandas.read_csv" ]
[((4132, 4168), 'dgl.data.utils.extract_archive', 'extract_archive', (['data_path', 'dir_path'], {}), '(data_path, dir_path)\n', (4147, 4168), False, 'from dgl.data.utils import get_download_dir, download, _get_dgl_url, extract_archive\n'), ((4182, 4217), 'pandas.read_csv', 'pd.read_csv', (["(dir_path + '/pcba.csv')"],...
from collections import namedtuple import tensorflow as tf import numpy as np from rl.agents.a2c.agent import A2CAgent TestArgType = namedtuple('ArgType', ['name']) arg_type = TestArgType('arg') A = np.array class A2CAgentTest(tf.test.TestCase): def test_compute_policy_log_probs(self): from rl.agents.a2c.a...
[ "collections.namedtuple", "rl.agents.a2c.agent.compute_policy_entropy", "numpy.log", "tensorflow.test.main", "rl.agents.a2c.agent.compute_policy_log_probs" ]
[((137, 168), 'collections.namedtuple', 'namedtuple', (['"""ArgType"""', "['name']"], {}), "('ArgType', ['name'])\n", (147, 168), False, 'from collections import namedtuple\n'), ((2115, 2129), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (2127, 2129), True, 'import tensorflow as tf\n'), ((862, 941), 'rl.ag...