code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from dataclasses import dataclass, field from typing import Optional, Iterable, Union @dataclass class MetabaseConfig: # Metabase Client database: str host: str user: str password: str # Metabase additional connection opts use_http: bool = False verify: Union[str, bool] = True # Me...
[ "dataclasses.field" ]
[((624, 651), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (629, 651), False, 'from dataclasses import dataclass, field\n'), ((677, 704), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (682, 704), False, 'from dataclasses impo...
from dotenv import load_dotenv load_dotenv() import sys import os import re import json import psycopg2 from meme_classifier.images import process_image path = sys.argv[1] data = json.load(open(os.path.join(path, 'result.json'), 'r')) chat_id = data['id'] conn = psycopg2.connect(os.getenv('POSTGRES_CREDENTIALS')) ...
[ "os.path.join", "os.getenv", "dotenv.load_dotenv" ]
[((31, 44), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (42, 44), False, 'from dotenv import load_dotenv\n'), ((284, 317), 'os.getenv', 'os.getenv', (['"""POSTGRES_CREDENTIALS"""'], {}), "('POSTGRES_CREDENTIALS')\n", (293, 317), False, 'import os\n'), ((198, 231), 'os.path.join', 'os.path.join', (['path', '"...
# Generated by Django 2.0.3 on 2018-03-15 01:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('nps', '0012_auto_20180314_1600'), ] operations = [ migrations.CreateModel( name='ClientAggregations', fields=[ ...
[ "django.db.migrations.AlterUniqueTogether", "django.db.migrations.DeleteModel", "django.db.models.FloatField", "django.db.models.IntegerField", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.migrations.RemoveField", "django.db.migrations.RenameField", "django.db.models.Cha...
[((1327, 1375), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""AggregatedResults"""'}), "(name='AggregatedResults')\n", (1349, 1375), False, 'from django.db import migrations, models\n'), ((1408, 1451), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""Prod...
import time import unittest from nose.plugins.attrib import attr from hubspot3.test import helper from hubspot3.broadcast import Broadcast, BroadcastClient class BroadcastClientTest(unittest.TestCase): """ Unit tests for the HubSpot Broadcast API Python client. This file contains some unittest tests for the ...
[ "nose.plugins.attrib.attr", "hubspot3.test.helper.get_options", "unittest.main", "time.time", "hubspot3.broadcast.Broadcast" ]
[((733, 744), 'nose.plugins.attrib.attr', 'attr', (['"""api"""'], {}), "('api')\n", (737, 744), False, 'from nose.plugins.attrib import attr\n'), ((1448, 1459), 'nose.plugins.attrib.attr', 'attr', (['"""api"""'], {}), "('api')\n", (1452, 1459), False, 'from nose.plugins.attrib import attr\n'), ((1648, 1659), 'nose.plug...
#!/usr/bin/env python3 import math try: # from PDFPageDetailedAggregator: from pdfminer.pdfdocument import PDFDocument, PDFNoOutlines from pdfminer.pdfparser import PDFParser from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import PDFPageAggregator ...
[ "srd.DocChunk", "pdfminer.converter.PDFPageAggregator.__init__", "srd.objDict", "math.floor" ]
[((851, 866), 'srd.objDict', 'objDict', (['ltanno'], {}), '(ltanno)\n', (858, 866), False, 'from srd import objDict, BBox, DocChunk, clean_frag_text, clean_frag, same_style, frag_dict\n'), ((1782, 1857), 'pdfminer.converter.PDFPageAggregator.__init__', 'PDFPageAggregator.__init__', (['self', 'rsrcmgr'], {'pageno': 'pag...
from pox.core import core import pox.openflow.libopenflow_01 as of from forwarding.l2_learning import * from tkinter import * from project.firewall import TestFW from project.ui import UI def setup(): top = Toplevel() # quit POX when window is killed top.protocol("WM_DELETE_WINDOW", core.quit) t...
[ "pox.core.core.tk.do", "pox.core.core.call_when_ready", "pox.core.core.registerNew", "pox.core.core.openflow.getConnection" ]
[((851, 902), 'pox.core.core.registerNew', 'core.registerNew', (['TestFW', 'fw_list_dpid[0]', 'srv_list'], {}), '(TestFW, fw_list_dpid[0], srv_list)\n', (867, 902), False, 'from pox.core import core\n'), ((954, 990), 'pox.core.core.registerNew', 'core.registerNew', (['l2_learning', '(False)'], {}), '(l2_learning, False...
# 获取调课、改课通知例子 from zfnew import GetInfo, Login base_url = '学校教务系统的主页url' lgn = Login(base_url=base_url) lgn.login('账号', '密码') cookies = lgn.cookies # cookies获取方法 person = GetInfo(base_url=base_url, cookies=cookies) message = person.get_message() print(message)
[ "zfnew.GetInfo", "zfnew.Login" ]
[((82, 106), 'zfnew.Login', 'Login', ([], {'base_url': 'base_url'}), '(base_url=base_url)\n', (87, 106), False, 'from zfnew import GetInfo, Login\n'), ((175, 218), 'zfnew.GetInfo', 'GetInfo', ([], {'base_url': 'base_url', 'cookies': 'cookies'}), '(base_url=base_url, cookies=cookies)\n', (182, 218), False, 'from zfnew i...
import sys import random from faker import Faker def gera(nLinhas=100, nCampos=None): with open(f"{path}/file{nLinhas}-{nCampos}_python.txt", "w+", encoding="utf8") as file: if not nCampos: nCampos = random.randint(2, 10) camposFuncs = [ fake.name, fake.date, ...
[ "faker.Faker", "random.randint" ]
[((830, 844), 'faker.Faker', 'Faker', (['"""pt_BR"""'], {}), "('pt_BR')\n", (835, 844), False, 'from faker import Faker\n'), ((226, 247), 'random.randint', 'random.randint', (['(2)', '(10)'], {}), '(2, 10)\n', (240, 247), False, 'import random\n'), ((602, 627), 'random.randint', 'random.randint', (['(0)', '(999999)'], ...
# 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 math import torch import torch.nn as nn import torch.nn.functional as F from .modules import ( TransformerLayer, LearnedPosit...
[ "torch.nn.functional.linear", "torch.stack", "math.sqrt", "torch.zeros", "torch.nn.Embedding" ]
[((1887, 1975), 'torch.nn.Embedding', 'nn.Embedding', (['self.alphabet_size', 'self.args.embed_dim'], {'padding_idx': 'self.padding_idx'}), '(self.alphabet_size, self.args.embed_dim, padding_idx=self.\n padding_idx)\n', (1899, 1975), True, 'import torch.nn as nn\n'), ((3156, 3186), 'math.sqrt', 'math.sqrt', (['self....
from pyb import CAN CAN.initfilterbanks(14) can = CAN(1) print(can) can.init(CAN.LOOPBACK) print(can) print(can.any(0)) # Catch all filter can.setfilter(0, CAN.MASK16, 0, (0, 0, 0, 0)) can.send('abcd', 123) print(can.any(0)) print(can.recv(0)) can.send('abcd', -1) print(can.recv(0)) can.send('abcd', 0x7FF + 1) pr...
[ "pyb.CAN", "pyb.CAN.initfilterbanks" ]
[((21, 44), 'pyb.CAN.initfilterbanks', 'CAN.initfilterbanks', (['(14)'], {}), '(14)\n', (40, 44), False, 'from pyb import CAN\n'), ((51, 57), 'pyb.CAN', 'CAN', (['(1)'], {}), '(1)\n', (54, 57), False, 'from pyb import CAN\n'), ((504, 539), 'pyb.CAN', 'CAN', (['(1)', 'CAN.LOOPBACK'], {'extframe': '(True)'}), '(1, CAN.LO...
#-*- coding: UTF-8 -*- """ Tencent is pleased to support the open source community by making GAutomator available. Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a...
[ "logging.getLogger", "os.path.join", "os.environ.get", "time.sleep", "os.path.realpath", "wpyscripts.common.adb_process.AdbTool" ]
[((870, 897), 'logging.getLogger', 'logging.getLogger', (['"""wetest"""'], {}), "('wetest')\n", (887, 897), False, 'import logging\n'), ((937, 980), 'os.environ.get', 'os.environ.get', (['"""UIAUTOMATOR_PORT"""', '"""19008"""'], {}), "('UIAUTOMATOR_PORT', '19008')\n", (951, 980), False, 'import os\n'), ((1263, 1272), '...
"""A module for deserializing data to Python objects.""" # pylint: disable=unidiomatic-typecheck # pylint: disable=protected-access # pylint: disable=too-many-branches # pylint: disable=wildcard-import import enum import functools import typing from typing import Any, Callable, Dict, List, Optional, Union from deser...
[ "typing.get_type_hints", "deserialize.decorators._get_downcast_field", "deserialize.decorators._call_constructed", "deserialize.decorators._has_default", "deserialize.decorators._get_default", "deserialize.decorators._should_ignore", "deserialize.decorators._allows_downcast_fallback", "deserialize.exc...
[((10847, 10883), 'deserialize.decorators._get_downcast_field', '_get_downcast_field', (['class_reference'], {}), '(class_reference)\n', (10866, 10883), False, 'from deserialize.decorators import downcast_field, _get_downcast_field, downcast_identifier, _get_downcast_class, allow_downcast_fallback, _allows_downcast_fal...
from ssf import SSF ssf = SSF(errors='raise') def test_get_set_days(): dn = ssf.get_day_names() assert isinstance(dn, tuple) assert dn == (('Mon', 'Monday'), ('Tue', 'Tuesday'), ('Wed', 'Wednesday'), ('Thu', 'Thursday'), ('Fri', 'Friday'), ('Sat',...
[ "ssf.SSF" ]
[((26, 45), 'ssf.SSF', 'SSF', ([], {'errors': '"""raise"""'}), "(errors='raise')\n", (29, 45), False, 'from ssf import SSF\n')]
# # Copyright 2014-2018 Neueda Ltd. # from cdr import Cdr import unittest field1 = 1 field2 = 2 field3 = 55 class TestCdr(unittest.TestCase): def get_a_cdr(self): d = Cdr() d.setInteger(field1, 123) d.setString(field2, "Hello") d.setString(field3, "World") return d ...
[ "unittest.main", "cdr.Cdr" ]
[((1531, 1546), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1544, 1546), False, 'import unittest\n'), ((184, 189), 'cdr.Cdr', 'Cdr', ([], {}), '()\n', (187, 189), False, 'from cdr import Cdr\n'), ((762, 767), 'cdr.Cdr', 'Cdr', ([], {}), '()\n', (765, 767), False, 'from cdr import Cdr\n'), ((887, 892), 'cdr.Cdr...
# -*- coding: utf-8 -*- """ # @SoftwareIDE : PyCharm2020Pro # @ProjectName : PySide2MVCFramework # @FileName : view.py # @Author : 胡守杰 # @Email : <EMAIL> # @ZhFileDescription : # @EnFileDescription : """ import os from pyside2mvcframework.core.view import...
[ "PySide2.QtWidgets.QApplication", "os.path.join" ]
[((417, 484), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""src\\\\window\\\\inputWindow\\\\inputWindow.ui"""'], {}), "(BASE_PATH, 'src\\\\window\\\\inputWindow\\\\inputWindow.ui')\n", (429, 484), False, 'import os\n'), ((652, 674), 'PySide2.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\...
# Copyright (c) 2020, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow...
[ "numpy.prod", "finn.util.data_packing.rtlsim_output_to_npy", "math.ceil", "os.makedirs", "subprocess.Popen", "os.path.join", "numpy.asarray", "math.log", "shutil.copy", "warnings.warn", "numpy.load", "numpy.random.randn" ]
[((4864, 4888), 'os.makedirs', 'os.makedirs', (['verilog_dir'], {}), '(verilog_dir)\n', (4875, 4888), False, 'import os\n'), ((5036, 5074), 'os.path.join', 'os.path.join', (['memstream_dir', '"""Q_srl.v"""'], {}), "(memstream_dir, 'Q_srl.v')\n", (5048, 5074), False, 'import os\n'), ((5083, 5108), 'shutil.copy', 'copy',...
import ast import emoji import os import pandas as pd _SUPPORT_CACHE_CSV = emoji.datafile('emoji_support.csv') _API_LEVELS = { 1: ("(no codename)", "1.0"), 2: ("(no codename)", "1.1"), 3: ("Cupcake", "1.5 "), 4: ("Donut", "1.6 "), 5: ("Eclair", "2.0"), 6: ("Eclair", "2.0.1"), 7: ("Eclair", "2.1 "), 8:...
[ "pandas.read_csv", "emoji.metadata", "emoji.datafile", "os.path.splitext", "os.path.join", "os.path.isfile", "os.path.basename", "pandas.DataFrame", "os.stat", "os.walk" ]
[((76, 111), 'emoji.datafile', 'emoji.datafile', (['"""emoji_support.csv"""'], {}), "('emoji_support.csv')\n", (90, 111), False, 'import emoji\n'), ((1107, 1129), 'os.path.splitext', 'os.path.splitext', (['file'], {}), '(file)\n', (1123, 1129), False, 'import os\n'), ((1238, 1258), 'os.walk', 'os.walk', (['"""api_level...
import json from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from paste import constants from tests.mixins import SnippetListTestCaseMixin from tests.utils import constant, create_snippet, create_user class SnippetListTestCase(SnippetListTestCaseMixin, ...
[ "tests.utils.create_user", "json.dumps", "tests.utils.constant", "django.urls.reverse", "tests.utils.create_snippet" ]
[((455, 478), 'django.urls.reverse', 'reverse', (['"""snippet-list"""'], {}), "('snippet-list')\n", (462, 478), False, 'from django.urls import reverse\n'), ((927, 948), 'tests.utils.create_snippet', 'create_snippet', (['"""foo"""'], {}), "('foo')\n", (941, 948), False, 'from tests.utils import constant, create_snippet...
import argparse import cv2 import glob import os from basicsr.archs.rrdbnet_arch import RRDBNet import time from realesrgan import RealESRGANer from realesrgan.archs.srvgg_arch import SRVGGNetCompact def main(): """Inference demo for Real-ESRGAN. """ parser = argparse.ArgumentParser() parser.add_argu...
[ "os.path.exists", "cv2.imwrite", "realesrgan.RealESRGANer", "os.makedirs", "argparse.ArgumentParser", "os.path.join", "time.perf_counter", "os.path.isfile", "basicsr.archs.rrdbnet_arch.RRDBNet", "gfpgan.GFPGANer", "os.path.basename", "realesrgan.archs.srvgg_arch.SRVGGNetCompact", "cv2.imread...
[((275, 300), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (298, 300), False, 'import argparse\n'), ((3590, 3661), 'os.path.join', 'os.path.join', (['"""experiments/pretrained_models"""', "(args.model_name + '.pth')"], {}), "('experiments/pretrained_models', args.model_name + '.pth')\n", (360...
from web3 import Web3, HTTPProvider import json w3url = "https://mainnet.infura.io/v3/998f64f3627548bbaf2630599c1eefca" w3 = Web3(HTTPProvider(w3url)) WETH = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" YFII = "0xa1d0E215a23d7030842FC67cE582a6aFa3CCaB83" DAI = "0x6B175474E89094C44Da98b954EedeAC495271d0F" iUSDT = "0x...
[ "web3.HTTPProvider" ]
[((132, 151), 'web3.HTTPProvider', 'HTTPProvider', (['w3url'], {}), '(w3url)\n', (144, 151), False, 'from web3 import Web3, HTTPProvider\n')]
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import CustomUser admin.site.register(CustomUser, UserAdmin)
[ "django.contrib.admin.site.register" ]
[((114, 156), 'django.contrib.admin.site.register', 'admin.site.register', (['CustomUser', 'UserAdmin'], {}), '(CustomUser, UserAdmin)\n', (133, 156), False, 'from django.contrib import admin\n')]
""" Copyright (c) 2018-2022 Intel 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 wri...
[ "numpy.ones_like", "collections.OrderedDict", "numpy.repeat", "numpy.ones", "numpy.logical_and", "cv2.resize", "numpy.where", "numpy.fix", "numpy.sort", "numpy.array", "numpy.zeros", "numpy.expand_dims", "numpy.maximum" ]
[((4091, 4106), 'numpy.ones', 'np.ones', (['numbox'], {}), '(numbox)\n', (4098, 4106), True, 'import numpy as np\n'), ((4116, 4131), 'numpy.ones', 'np.ones', (['numbox'], {}), '(numbox)\n', (4123, 4131), True, 'import numpy as np\n'), ((4893, 4913), 'numpy.maximum', 'np.maximum', (['(0)', '(y - 1)'], {}), '(0, y - 1)\n...
import chainer import chainer.functions from chainer.utils import type_check from chainer import cuda from chainer import function import numpy as np #from chainer import function_node from utils import clip_grad #class MixtureDensityNetworkFunction(function_node.FunctionNode): class MixtureDensityNetworkFunction(fu...
[ "chainer.utils.type_check.same_types", "utils.clip_grad", "chainer.utils.type_check.expect", "chainer.cuda.get_array_module" ]
[((583, 1553), 'chainer.utils.type_check.expect', 'type_check.expect', (["(x_type.dtype.kind == 'f')", "(eos_input_type.dtype.kind == 'f')", "(pi_input_type.dtype.kind == 'f')", "(mu_x1_input_type.dtype.kind == 'f')", "(mu_x2_input_type.dtype.kind == 'f')", "(s_x1_input_type.dtype.kind == 'f')", "(s_x2_input_type.dtype...
import datetime import os import subprocess import base64 from pathlib import Path import shutil import pandas as pd import signal import requests from baselayer.app.env import load_env from baselayer.app.model_util import status, create_tables, drop_tables from social_tornado.models import TornadoStorage from skyport...
[ "skyportal.models.User", "pandas.read_csv", "baselayer.tools.test_frontend.verify_server_availability", "datetime.datetime", "baselayer.app.model_util.create_tables", "subprocess.Popen", "skyportal.models.Source.query.get", "skyportal.models.DBSession", "skyportal.models.init_db", "os.getpgid", ...
[((613, 623), 'baselayer.app.env.load_env', 'load_env', ([], {}), '()\n', (621, 623), False, 'from baselayer.app.env import load_env\n'), ((687, 750), 'baselayer.app.model_util.status', 'status', (['f"""Connecting to database {cfg[\'database\'][\'database\']}"""'], {}), '(f"Connecting to database {cfg[\'database\'][\'d...
# Copyright 2013 University of Maryland. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE.TXT file. import sys import os import time from selenium.common.exceptions import NoAlertPresentException import framework class Exploit (framework.Exploit...
[ "framework.Exploit.__init__", "time.sleep" ]
[((825, 866), 'framework.Exploit.__init__', 'framework.Exploit.__init__', (['self', 'visible'], {}), '(self, visible)\n', (851, 866), False, 'import framework\n'), ((1428, 1442), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (1438, 1442), False, 'import time\n')]
# -*- coding: utf-8 -*- """ Created on Tue Jul 7 20:14:22 2020 Simple script to join json files @author: SERGI """ import json import sys import os def readJson(path): with open(path, "r") as file: return json.load(file) def writeJson(path, dicc): with open(path, "w") as file...
[ "json.load", "os.listdir", "json.dump" ]
[((743, 767), 'os.listdir', 'os.listdir', (['jsonPathTemp'], {}), '(jsonPathTemp)\n', (753, 767), False, 'import os\n'), ((237, 252), 'json.load', 'json.load', (['file'], {}), '(file)\n', (246, 252), False, 'import json\n'), ((331, 352), 'json.dump', 'json.dump', (['dicc', 'file'], {}), '(dicc, file)\n', (340, 352), Fa...
# Generated by Django 3.0.2 on 2020-01-23 11:02 import re import django.contrib.postgres.fields.citext import django.core.validators from django.db import migrations import grandchallenge.challenges.models class Migration(migrations.Migration): dependencies = [ ("challenges", "0022_auto_20200121_1639"...
[ "re.compile" ]
[((861, 893), 're.compile', 're.compile', (['"""^[-a-zA-Z0-9_]+\\\\Z"""'], {}), "('^[-a-zA-Z0-9_]+\\\\Z')\n", (871, 893), False, 'import re\n'), ((1696, 1728), 're.compile', 're.compile', (['"""^[-a-zA-Z0-9_]+\\\\Z"""'], {}), "('^[-a-zA-Z0-9_]+\\\\Z')\n", (1706, 1728), False, 'import re\n')]
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from sklearn.model_selection import learning_curve # Plot learning curve def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, n_jobs=1, train_sizes=np.linspace(.1, 1.0, 5)): plt.figu...
[ "numpy.mean", "matplotlib.pyplot.grid", "sklearn.model_selection.learning_curve", "matplotlib.pyplot.xscale", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.fill_between", "numpy.linspace", "matplotlib.pyplot.figure", "numpy.std", "matplotl...
[((282, 306), 'numpy.linspace', 'np.linspace', (['(0.1)', '(1.0)', '(5)'], {}), '(0.1, 1.0, 5)\n', (293, 306), True, 'import numpy as np\n'), ((312, 324), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (322, 324), True, 'import matplotlib.pyplot as plt\n'), ((329, 345), 'matplotlib.pyplot.title', 'plt.titl...
## @file # This file is used to define class objects of INF file miscellaneous. # Include BootMode/HOB/Event and others. It will consumed by InfParser. # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent ''' InfMisc ''' import Logger.Log as Logge...
[ "Logger.Log.Error", "Object.Parser.InfCommonObject.InfSectionCommonDef.__init__", "Library.Misc.Sdict" ]
[((3454, 3593), 'Logger.Log.Error', 'Logger.Error', (['"""InfParser"""', 'ErrorCode'], {'Message': 'Message', 'File': 'LineInfo[0]', 'Line': 'LineInfo[1]', 'ExtraData': 'LineInfo[2]', 'RaiseError': 'RaiseError'}), "('InfParser', ErrorCode, Message=Message, File=LineInfo[0],\n Line=LineInfo[1], ExtraData=LineInfo[2],...
import torch import torchvision import torchvision.transforms as transforms import os.path BASE_DIR = os.path.dirname(os.path.abspath(__file__)) transform = transforms.Compose( [transforms.ToTensor(), transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]) root = os.path.join(BASE_DIR, '../data/') trainset ...
[ "torch.nn.CrossEntropyLoss", "util.train_eval", "torch.nn.Conv2d", "torchvision.datasets.CIFAR10", "torch.nn.MaxPool2d", "torchvision.transforms.Normalize", "torch.utils.data.DataLoader", "torch.nn.Linear", "torchvision.transforms.ToTensor" ]
[((322, 413), 'torchvision.datasets.CIFAR10', 'torchvision.datasets.CIFAR10', ([], {'root': 'root', 'train': '(True)', 'download': '(True)', 'transform': 'transform'}), '(root=root, train=True, download=True,\n transform=transform)\n', (350, 413), False, 'import torchvision\n'), ((464, 530), 'torch.utils.data.DataLo...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
[ "tensorflow.gfile.MkDir", "tensorflow.logging.set_verbosity", "tensor2tensor.rl.rl_utils.get_metric_name", "tensorflow.app.run", "tensorflow.gfile.Exists", "tensor2tensor.rl.rl_utils.RandomAgent", "tensor2tensor.rl.rl_utils.PolicyAgent", "tensor2tensor.rl.rl_utils.SimulatedBatchGymEnvWithFixedInitialF...
[((3123, 3255), 'tensorflow.contrib.training.HParams', 'tf.contrib.training.HParams', ([], {'num_rollouts': '(1)', 'planning_horizon': '(2)', 'rollout_agent_type': '"""random"""', 'batch_size': '(1)', 'env_type': '"""simulated"""'}), "(num_rollouts=1, planning_horizon=2,\n rollout_agent_type='random', batch_size=1, ...
from django.contrib import admin from grandchallenge.components.models import ( ComponentInterface, ComponentInterfaceValue, ) class ComponentInterfaceAdmin(admin.ModelAdmin): list_display = ( "pk", "title", "slug", "kind", "default_value", "relative_path",...
[ "django.contrib.admin.site.register" ]
[((592, 656), 'django.contrib.admin.site.register', 'admin.site.register', (['ComponentInterface', 'ComponentInterfaceAdmin'], {}), '(ComponentInterface, ComponentInterfaceAdmin)\n', (611, 656), False, 'from django.contrib import admin\n'), ((657, 731), 'django.contrib.admin.site.register', 'admin.site.register', (['Co...
import os.path as op import numpy as np import pandas as pd from sklearn.pipeline import make_pipeline from sklearn.linear_model import RidgeCV from sklearn.preprocessing import StandardScaler from sklearn.model_selection import KFold, cross_val_score import mne from pyriemann.tangentspace import TangentSpace import ...
[ "numpy.linalg.eigh", "numpy.eye", "pyriemann.tangentspace.TangentSpace", "mne.pick_types", "os.path.join", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.zeros", "mne.externals.h5io.read_hdf5", "sklearn.model_selection.KFold", "numpy.logspace", "sklearn.model_selection.cross_val...
[((414, 469), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'n_jobs', 'shuffle': '(True)', 'random_state': 'seed'}), '(n_splits=n_jobs, shuffle=True, random_state=seed)\n', (419, 469), False, 'from sklearn.model_selection import KFold, cross_val_score\n'), ((1494, 1548), 'os.path.join', 'op.join', (['cfg....
import sys, os import tarfile import shutil from edx_gen import _edx_consts from edx_gen import _read_metadata from edx_gen import _write_structure from edx_gen import _write_comps from edx_gen import _write_comp_html from edx_gen import _write_comp_checkboxes from edx_gen import _write_comp_video from edx_gen i...
[ "edx_gen._write_comp_checkboxes.writeXmlForProbCheckboxesComp", "edx_gen._markdown.convertMd", "edx_gen._read_metadata.getMetaSettings", "edx_gen._xml_google_doc.tagForGoogleDocComp", "edx_gen._write_comp_html.writeXmlForHtmlComp", "edx_gen._write_comp_video.writeXmlForVidComp" ]
[((903, 935), 'edx_gen._markdown.convertMd', '_markdown.convertMd', (['md_filepath'], {}), '(md_filepath)\n', (922, 935), False, 'from edx_gen import _markdown\n'), ((3218, 3330), 'edx_gen._read_metadata.getMetaSettings', '_read_metadata.getMetaSettings', (['md_filepath', 'meta_tag', '_edx_consts.COMP_HTML_REQ', '_edx_...
import unittest from recipe import utils class UtilTestCase(unittest.TestCase): def test_valid_project_slug(self): project_slug = "Recipe0123456789_mock" self.assertTrue(utils.valid_project_slug(project_slug)) project_slug = 'Recipe00000000000000000000000000000000000000000000' ...
[ "recipe.utils.valid_project_slug" ]
[((201, 239), 'recipe.utils.valid_project_slug', 'utils.valid_project_slug', (['project_slug'], {}), '(project_slug)\n', (225, 239), False, 'from recipe import utils\n'), ((345, 383), 'recipe.utils.valid_project_slug', 'utils.valid_project_slug', (['project_slug'], {}), '(project_slug)\n', (369, 383), False, 'from reci...
import numpy as np import cv2 import os.path as osp import json from human_body_prior.tools.model_loader import load_vposer import torch vposer_ckpt = '/Vol1/dbstore/datasets/a.vakhitov/projects/pykinect_fresh/smplify-x/smplify-x-data/vposer_v1_0/' def load_avakhitov_fits_vposer(vposer, part_path, dev_lbl): po...
[ "torch.bmm", "torch.split", "human_body_prior.tools.model_loader.load_vposer", "torch.eye", "torch.sin", "os.path.join", "numpy.argsort", "torch.tensor", "torch.norm", "numpy.array", "torch.cos", "numpy.zeros", "cv2.Rodrigues", "json.load", "numpy.load", "torch.zeros", "torch.cat" ]
[((451, 484), 'numpy.load', 'np.load', (["(part_path + '/betas.npy')"], {}), "(part_path + '/betas.npy')\n", (458, 484), True, 'import numpy as np\n'), ((499, 534), 'numpy.load', 'np.load', (["(part_path + '/fid_lst.npy')"], {}), "(part_path + '/fid_lst.npy')\n", (506, 534), True, 'import numpy as np\n'), ((5335, 5384)...
import docker from dockerfile_generator import render import os import json from tqdm import tqdm from typing import Union, Any, Optional def build_image(repo_url: str, tag: str, path: str) -> None: """ build_image builds the image with the given tag """ client = docker.from_env() print(f"Buildin...
[ "dockerfile_generator.render", "docker.from_env", "tqdm.tqdm", "os.remove" ]
[((283, 300), 'docker.from_env', 'docker.from_env', ([], {}), '()\n', (298, 300), False, 'import docker\n'), ((565, 582), 'docker.from_env', 'docker.from_env', ([], {}), '()\n', (580, 582), False, 'import docker\n'), ((1315, 1332), 'docker.from_env', 'docker.from_env', ([], {}), '()\n', (1330, 1332), False, 'import doc...
import io grid = {} y = 0 x = 0 for l in io.open("day22.in").read().splitlines(): for x in range(len(l)): grid[(y,x)] = l[x] y += 1 y = y // 2 x = x // 2 dx = 0 dy = -1 r = 0 for iter in range(10000000): if (y,x) not in grid or grid[(y,x)] == '.': (dy, dx) = (-dx, dy) grid[(y,x)] = ...
[ "io.open" ]
[((42, 61), 'io.open', 'io.open', (['"""day22.in"""'], {}), "('day22.in')\n", (49, 61), False, 'import io\n')]
from grpc._channel import _InactiveRpcError, _MultiThreadedRendezvous from functools import wraps _COMPLEX_PLOTTING_ERROR_MSG = """ Complex fields cannot be plotted. Use operators to get the amplitude or the result at a defined sweeping phase before plotting. """ _FIELD_CONTAINER_PLOTTING_MSG = """" This fields_conta...
[ "functools.wraps" ]
[((2939, 2950), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (2944, 2950), False, 'from functools import wraps\n')]
from dataclasses import dataclass from dataclasses import field from time import time from typing import Any from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import Tuple @dataclass class NewUser: """Deals with the commands the user is currently ...
[ "time.time", "dataclasses.field" ]
[((1216, 1250), 'dataclasses.field', 'field', ([], {'default_factory': '(lambda : [])'}), '(default_factory=lambda : [])\n', (1221, 1250), False, 'from dataclasses import field\n'), ((612, 618), 'time.time', 'time', ([], {}), '()\n', (616, 618), False, 'from time import time\n')]
#!/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. from setuptools import setup with open("README.md") as f: readme = f.read() setup( name="dpr", version="...
[ "setuptools.setup" ]
[((284, 941), 'setuptools.setup', 'setup', ([], {'name': '"""dpr"""', 'version': '"""0.1.0"""', 'description': '"""Facebook AI Research Open Domain Q&A Toolkit"""', 'url': '"""https://github.com/facebookresearch/DPR/"""', 'classifiers': "['Intended Audience :: Science/Research',\n 'License :: OSI Approved :: MIT Lic...
# encoding: utf-8 """ @version: v1.0 @author: Richard @license: Apache Licence @contact: <EMAIL> @site: @software: PyCharm @time: 2019/9/12 20:37 """ from pprint import pprint as pp from operator import itemgetter import time from collections import OrderedDict from hard.smallest_range.srcs.big_2d_list impo...
[ "operator.itemgetter", "collections.OrderedDict", "time.time" ]
[((555, 566), 'time.time', 'time.time', ([], {}), '()\n', (564, 566), False, 'import time\n'), ((842, 853), 'time.time', 'time.time', ([], {}), '()\n', (851, 853), False, 'import time\n'), ((965, 978), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (976, 978), False, 'from collections import OrderedDict\n'...
import numpy as np def smooth(a, WSZ): # a: NumPy 1-D array containing the data to be smoothed # WSZ: smoothing window size needs, which must be odd number, # as in the original MATLAB implementation if WSZ % 2 == 0: WSZ = WSZ - 1 out0 = np.convolve(a, np.ones(WSZ, dtype=int), 'valid') / W...
[ "numpy.concatenate", "numpy.cumsum", "numpy.ones", "numpy.arange" ]
[((331, 355), 'numpy.arange', 'np.arange', (['(1)', '(WSZ - 1)', '(2)'], {}), '(1, WSZ - 1, 2)\n', (340, 355), True, 'import numpy as np\n'), ((462, 497), 'numpy.concatenate', 'np.concatenate', (['(start, out0, stop)'], {}), '((start, out0, stop))\n', (476, 497), True, 'import numpy as np\n'), ((283, 306), 'numpy.ones'...
from __future__ import absolute_import import abc import os import json import glob import shutil from tensorflow.python.estimator import gc from tensorflow.python.estimator import util from tensorflow.python.estimator.canned import metric_keys from tensorflow.python.framework import errors_impl from tensorflow.pytho...
[ "tensorflow.python.estimator.gc._largest_export_versions", "tensorflow.python.platform.gfile.DeleteRecursively", "json.dump", "os.path.join", "tensorflow.python.summary.summary_iterator.summary_iterator", "tensorflow.python.platform.tf_logging.warn", "tensorflow.python.platform.tf_logging.info", "tens...
[((627, 651), 'tensorflow.python.estimator.util.fn_args', 'util.fn_args', (['compare_fn'], {}), '(compare_fn)\n', (639, 651), False, 'from tensorflow.python.estimator import util\n'), ((6454, 6529), 'tensorflow.python.estimator.exporter._SavedModelExporter', '_SavedModelExporter', (['name', 'serving_input_receiver_fn',...
"""extend_ip_field Revision ID: 8da20383f6e1 Revises: <KEY> Create Date: 2021-01-14 10:50:56.275257 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "8da20383f6e1" down_revision = "<KEY>" branch_labels = None depends_on = None def upgrade(engine_name): glob...
[ "sqlalchemy.String", "alembic.op.batch_alter_table" ]
[((543, 579), 'alembic.op.batch_alter_table', 'op.batch_alter_table', (['"""verifiermain"""'], {}), "('verifiermain')\n", (563, 579), False, 'from alembic import op\n'), ((656, 676), 'sqlalchemy.String', 'sa.String', ([], {'length': '(15)'}), '(length=15)\n', (665, 676), True, 'import sqlalchemy as sa\n'), ((684, 705),...
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-07-10 20:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ucsrb', '0012_auto_20180710_1249'), ] operations = [ migrations.AddField( ...
[ "django.db.models.TextField", "django.db.models.BooleanField" ]
[((415, 449), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (434, 449), False, 'from django.db import migrations, models\n'), ((598, 651), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'default': 'None', 'null': '(True)'}), '(blan...
# Copyright 2016 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "tensorflow.unstack", "tensorflow.pad", "tensorflow.transpose", "tensorflow.contrib.slim.arg_scope", "spatial_transformer.transformer", "tensorflow.reduce_sum", "tensorflow.split", "numpy.array", "tensorflow.control_dependencies", "tensorflow.contrib.slim.layers.conv2d", "tensorflow.reduce_mean"...
[((14752, 14879), 'tensorflow.contrib.slim.layers.fully_connected', 'slim.layers.fully_connected', (['cdna_input', '(DNA_KERN_SIZE * DNA_KERN_SIZE * num_masks)'], {'scope': '"""cdna_params"""', 'activation_fn': 'None'}), "(cdna_input, DNA_KERN_SIZE * DNA_KERN_SIZE *\n num_masks, scope='cdna_params', activation_fn=No...
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: <EMAIL> # Maintained By: <EMAIL> from sqlalchemy.ext.associationproxy import association_proxy from ggrc import db from ggrc.models.mixins import ...
[ "ggrc.models.reflection.PublishOnly", "ggrc.db.UniqueConstraint", "sqlalchemy.orm.subqueryload", "ggrc.db.Index", "ggrc.db.ForeignKey", "ggrc.db.Column" ]
[((621, 658), 'ggrc.db.Column', 'db.Column', (['db.Integer'], {'nullable': '(False)'}), '(db.Integer, nullable=False)\n', (630, 658), False, 'from ggrc import db\n'), ((675, 711), 'ggrc.db.Column', 'db.Column', (['db.String'], {'nullable': '(False)'}), '(db.String, nullable=False)\n', (684, 711), False, 'from ggrc impo...
# noqa: D100 from typing import Optional import numpy as np import xarray from xclim.core.units import ( convert_units_to, declare_units, pint_multiply, rate2amount, units, units2pint, ) from xclim.core.utils import ensure_chunk_size from ._multivariate import ( daily_temperature_range, ...
[ "xclim.core.units.units", "numpy.ceil", "xclim.core.units.units2pint", "xclim.core.units.convert_units_to", "xarray.Dataset", "xclim.core.units.rate2amount", "xclim.core.utils.ensure_chunk_size", "xclim.core.units.declare_units", "xarray.set_options" ]
[((1421, 1482), 'xclim.core.units.declare_units', 'declare_units', ([], {'tasmin': '"""[temperature]"""', 'tasmax': '"""[temperature]"""'}), "(tasmin='[temperature]', tasmax='[temperature]')\n", (1434, 1482), False, 'from xclim.core.units import convert_units_to, declare_units, pint_multiply, rate2amount, units, units2...
# Copyright (c) 2013, VHRS and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import (cint, cstr, date_diff, flt, getdate, money_in_words, nowdate, rounded, today) from datet...
[ "frappe.db.exists", "frappe.get_doc", "frappe._" ]
[((751, 799), 'frappe.get_doc', 'frappe.get_doc', (['"""Checks Group"""', 'app.checks_group'], {}), "('Checks Group', app.checks_group)\n", (765, 799), False, 'import frappe\n'), ((12871, 12888), 'frappe._', '_', (['"""Project Name"""'], {}), "('Project Name')\n", (12872, 12888), False, 'from frappe import _, msgprint\...
"""Set the build version to be 'qa', 'rc', 'release'""" import sys import os import re import logging log = logging.getLogger() log.addHandler(logging.StreamHandler()) log.setLevel(logging.DEBUG) def get_build_type(travis_tag=None): if not travis_tag: return "qa" log.debug("getting build type for ta...
[ "logging.getLogger", "logging.StreamHandler", "re.match", "os.environ.get", "os.path.join", "os.path.realpath" ]
[((110, 129), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (127, 129), False, 'import logging\n'), ((145, 168), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (166, 168), False, 'import logging\n'), ((351, 401), 're.match', 're.match', (['"""v\\\\d+\\\\.\\\\d+\\\\.\\\\d+rc\\\\d+$"""'...
"""Collection of tests.""" import pytest import dblib.lib f0 = dblib.lib.Finding('CD spook', 'my_PC', 'The CD drive is missing.') f1 = dblib.lib.Finding('Unplugged', 'my_PC', 'The power cord is unplugged.') f2 = dblib.lib.Finding('Monitor switched off', 'my_PC', 'The monitor is switched off.') def test_add_remove(...
[ "pytest.raises" ]
[((797, 821), 'pytest.raises', 'pytest.raises', (['TypeError'], {}), '(TypeError)\n', (810, 821), False, 'import pytest\n')]
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
[ "azure.cli.core.commands.client_factory.get_subscription_id", "azure.mgmt.policyinsights.models.QueryOptions" ]
[((695, 727), 'azure.cli.core.commands.client_factory.get_subscription_id', 'get_subscription_id', (['cmd.cli_ctx'], {}), '(cmd.cli_ctx)\n', (714, 727), False, 'from azure.cli.core.commands.client_factory import get_subscription_id\n'), ((1497, 1519), 'azure.mgmt.policyinsights.models.QueryOptions', 'QueryOptions', ([]...
from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.utils import executor TOKEN = "Token for you bot" bot = Bot(token=TOKEN) dp = Dispatcher(bot) @dp.message_handler(command=['start', 'help']) async def send_welcome(msg: types.Message): await msg.reply_to_message(f'Добро ...
[ "aiogram.Bot", "aiogram.dispatcher.Dispatcher", "aiogram.utils.executor.start_polling" ]
[((146, 162), 'aiogram.Bot', 'Bot', ([], {'token': 'TOKEN'}), '(token=TOKEN)\n', (149, 162), False, 'from aiogram import Bot, types\n'), ((169, 184), 'aiogram.dispatcher.Dispatcher', 'Dispatcher', (['bot'], {}), '(bot)\n', (179, 184), False, 'from aiogram.dispatcher import Dispatcher\n'), ((620, 646), 'aiogram.utils.ex...
# timedpid.py # Source: https://github.com/DrGFreeman/PyTools # # MIT License # # Copyright (c) 2017 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, in...
[ "time.time" ]
[((1842, 1853), 'time.time', 'time.time', ([], {}), '()\n', (1851, 1853), False, 'import time\n'), ((2962, 2973), 'time.time', 'time.time', ([], {}), '()\n', (2971, 2973), False, 'import time\n'), ((4624, 4635), 'time.time', 'time.time', ([], {}), '()\n', (4633, 4635), False, 'import time\n')]
# # -*- coding: utf-8-*- # receives messages via zmq and executes some simple # operations. # # (c) ISC Clemenz & Weinbrecht GmbH 2018 # import json import requests import zmq import pmon class ZmqResponder(object): context = None socket = None def __init__(self): """ Constructor. ...
[ "json.loads", "requests.post", "zmq.Context" ]
[((693, 707), 'zmq.Context', 'zmq.Context', (['(1)'], {}), '(1)\n', (704, 707), False, 'import zmq\n'), ((1160, 1176), 'json.loads', 'json.loads', (['_msg'], {}), '(_msg)\n', (1170, 1176), False, 'import json\n'), ((2287, 2336), 'requests.post', 'requests.post', (['url'], {'data': 'payload', 'headers': 'headers'}), '(u...
# coding: utf-8 #just prints the emails of members of a group to stdout, #both primary and secondary members # run as # $python extractemails_nogui.py "Tidal Disruption Events" from __future__ import print_function '__author__' == '<NAME>, NYU - GitHub: fedhere' import sys import pandas as pd from argparse import Argu...
[ "sys.exit", "argparse.ArgumentParser", "pandas.read_csv" ]
[((595, 654), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Selecting members by subgroup"""'}), "(description='Selecting members by subgroup')\n", (609, 654), False, 'from argparse import ArgumentParser\n'), ((1138, 1248), 'pandas.read_csv', 'pd.read_csv', (["('https://docs.google.com/spreadshe...
import pytest from duckql.properties import Null @pytest.fixture(scope="module") def valid_instance() -> Null: return Null() def test_string(valid_instance: Null): assert str(valid_instance) == 'NULL' def test_obj(valid_instance: Null): assert valid_instance.obj == 'properties.Null' def test_json_p...
[ "pytest.fixture", "duckql.properties.Null" ]
[((53, 83), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (67, 83), False, 'import pytest\n'), ((125, 131), 'duckql.properties.Null', 'Null', ([], {}), '()\n', (129, 131), False, 'from duckql.properties import Null\n')]
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # 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 sys import shutil import tempfile import subprocess import typing as tp from pathlib import Path from ne...
[ "pathlib.Path", "subprocess.Popen", "subprocess.CalledProcessError", "os.environ.get", "nevergrad.common.tools.different_from_defaults" ]
[((2787, 2817), 'os.environ.get', 'os.environ.get', (['self.key', 'None'], {}), '(self.key, None)\n', (2801, 2817), False, 'import os\n'), ((2902, 2917), 'pathlib.Path', 'Path', (['self.name'], {}), '(self.name)\n', (2906, 2917), False, 'from pathlib import Path\n'), ((4849, 4973), 'subprocess.Popen', 'subprocess.Popen...
# coding=utf-8 """ Internal tools for NimLime development & testing. """ from pprint import pprint import sublime try: from cProfile import Profile except ImportError: from profile import Profile from functools import wraps from pstats import Stats try: from StringIO import StringIO except ImportError: ...
[ "profile.Profile", "functools.wraps", "pstats.Stats", "sublime.message_dialog", "io.StringIO", "pprint.pprint" ]
[((658, 667), 'profile.Profile', 'Profile', ([], {}), '()\n', (665, 667), False, 'from profile import Profile\n'), ((382, 438), 'sublime.message_dialog', 'sublime.message_dialog', (['"""NimLime running in debug mode."""'], {}), "('NimLime running in debug mode.')\n", (404, 438), False, 'import sublime\n'), ((892, 903),...
import orjson from asynctest import TestCase, Mock, patch from freezegun import freeze_time from driftage.monitor import Monitor class TestMonitor(TestCase): def setUp(self): self.monitor = Monitor( "user_test@local", "<PASSWORD>", "identif" ) def tearDown(self): self.mo...
[ "asynctest.Mock", "asynctest.patch", "driftage.monitor.Monitor", "freezegun.freeze_time", "orjson.dumps" ]
[((711, 761), 'asynctest.patch', 'patch', (['"""driftage.monitor.WaitMonitorSubscriptions"""'], {}), "('driftage.monitor.WaitMonitorSubscriptions')\n", (716, 761), False, 'from asynctest import TestCase, Mock, patch\n'), ((1022, 1047), 'freezegun.freeze_time', 'freeze_time', (['"""1989-08-12"""'], {}), "('1989-08-12')\...
import asyncio import uuid import pytest from aiomisc_pytest.pytest_plugin import TCPProxy import aiormq async def test_simple(amqp_channel: aiormq.Channel): await amqp_channel.basic_qos(prefetch_count=1) assert amqp_channel.number queue = asyncio.Queue() deaclare_ok = await amqp_channel.queue_dec...
[ "asyncio.Queue", "asyncio.wait", "uuid.uuid4", "pytest.raises", "asyncio.sleep", "aiormq.spec.Basic.Properties" ]
[((257, 272), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (270, 272), False, 'import asyncio\n'), ((1354, 1369), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (1367, 1369), False, 'import asyncio\n'), ((3581, 3596), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (3594, 3596), False, 'import asyncio\n...
# -*- coding: utf-8 -*- """Parser for the CCleaner Registry key.""" import re from dfdatetime import time_elements as dfdatetime_time_elements from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import winreg_parser from plaso.parsers.winr...
[ "plaso.containers.time_events.DateTimeValuesEvent", "re.compile", "plaso.parsers.winreg_parser.WinRegistryParser.RegisterPlugin", "dfdatetime.time_elements.TimeElements", "plaso.parsers.winreg_plugins.interface.WindowsRegistryKeyPathFilter" ]
[((6270, 6332), 'plaso.parsers.winreg_parser.WinRegistryParser.RegisterPlugin', 'winreg_parser.WinRegistryParser.RegisterPlugin', (['CCleanerPlugin'], {}), '(CCleanerPlugin)\n', (6316, 6332), False, 'from plaso.parsers import winreg_parser\n'), ((2611, 2731), 're.compile', 're.compile', (['"""([0-9][0-9])/([0-9][0-9])/...
import time import pytest from test import config from test.cube_utils import CubeUtils ITERATIONS_NUM = getattr(config, 'iterations_num', 1) ROUNDS_NUM = getattr(config, 'rounds_num', 10) class TestDefaultHighRes: @pytest.fixture(scope="class", autouse=True) def cube_default(self): cube_utils = Cu...
[ "pytest.fixture", "test.cube_utils.CubeUtils", "pytest.mark.benchmark" ]
[((225, 268), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""class"""', 'autouse': '(True)'}), "(scope='class', autouse=True)\n", (239, 268), False, 'import pytest\n'), ((496, 646), 'pytest.mark.benchmark', 'pytest.mark.benchmark', ([], {'group': '"""Cube reading for small area spatial analysis high-res"""', 't...
import pytest from mindmeld.components import Conversation def assert_reply(directives, templates, *, start_index=0, slots=None): """Asserts that the provided directives contain the specified reply Args: directives (list[dict[str, dict]]): list of directives returned by application templates ...
[ "mindmeld.components.Conversation" ]
[((1209, 1300), 'mindmeld.components.Conversation', 'Conversation', ([], {'app': 'async_kwik_e_mart_app', 'app_path': 'kwik_e_mart_app_path', 'force_sync': '(True)'}), '(app=async_kwik_e_mart_app, app_path=kwik_e_mart_app_path,\n force_sync=True)\n', (1221, 1300), False, 'from mindmeld.components import Conversation...
import os,sys import webbrowser import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.cm as cm import matplotlib.pylab as plt from matplotlib import ticker plt.rcParams['font.family'] = 'monospace' fig = plt.figure() rect = fig.add_subplot(111, aspect='equal') data0 = np.loadtxt('data0.dat', del...
[ "matplotlib.pylab.xlim", "matplotlib.pylab.grid", "matplotlib.pylab.figure", "matplotlib.use", "matplotlib.pylab.contour", "matplotlib.pylab.ylim", "matplotlib.ticker.LinearLocator", "matplotlib.pylab.xlabel", "matplotlib.pylab.colorbar", "os.remove", "numpy.meshgrid", "numpy.loadtxt", "nump...
[((69, 90), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (83, 90), False, 'import matplotlib\n'), ((228, 240), 'matplotlib.pylab.figure', 'plt.figure', ([], {}), '()\n', (238, 240), True, 'import matplotlib.pylab as plt\n'), ((293, 331), 'numpy.loadtxt', 'np.loadtxt', (['"""data0.dat"""'], {'de...
# coding=utf-8 # 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 ap...
[ "StringIO.StringIO", "csv.writer", "codecs.getincrementalencoder" ]
[((2455, 2474), 'StringIO.StringIO', 'StringIO.StringIO', ([], {}), '()\n', (2472, 2474), False, 'import StringIO\n'), ((2493, 2540), 'csv.writer', 'csv.writer', (['self.queue'], {'dialect': 'dialect'}), '(self.queue, dialect=dialect, **kwds)\n', (2503, 2540), False, 'import csv\n'), ((2580, 2618), 'codecs.getincrement...
""" test_pop_models.py Author: <NAME> Affiliation: UCLA Created on: Fri Jul 15 15:23:11 PDT 2016 Description: """ import ares import matplotlib.pyplot as pl PB = ares.util.ParameterBundle def test(): # Create a simple population pars_1 = PB('pop:fcoll') + PB('sed:bpass') pop_fcoll = ares.population...
[ "ares.populations.GalaxyPopulation" ]
[((305, 348), 'ares.populations.GalaxyPopulation', 'ares.populations.GalaxyPopulation', ([], {}), '(**pars_1)\n', (338, 348), False, 'import ares\n'), ((877, 920), 'ares.populations.GalaxyPopulation', 'ares.populations.GalaxyPopulation', ([], {}), '(**pars_2)\n', (910, 920), False, 'import ares\n')]
from flask import Flask, render_template, request, redirect, jsonify, g from flask import url_for, flash, make_response from flask import session as login_session from sqlalchemy import create_engine, asc from sqlalchemy.orm import sessionmaker from models import Base, Category, Item, User from oauth2client.client impo...
[ "flask.render_template", "sqlalchemy.orm.sessionmaker", "json.loads", "models.Item", "flask.flash", "flask.Flask", "sqlalchemy.create_engine", "json.dumps", "oauth2client.client.flow_from_clientsecrets", "requests.get", "flask.url_for", "flask.redirect", "models.User", "httplib2.Http", "...
[((448, 463), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (453, 463), False, 'from flask import Flask, render_template, request, redirect, jsonify, g\n'), ((905, 942), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///catalog.db"""'], {}), "('sqlite:///catalog.db')\n", (918, 942), False, 'fro...
# -*- coding: utf-8 -*- # # Copyright (c) 2020~2999 - Cologler <<EMAIL>> # ---------- # # ---------- import bson import struct from ..err import SerializeError from ..abc import * from ..core import register_format @register_format('bson', '.bson') class BsonSerializer(ISerializer): format_name = 'bson' def...
[ "bson.dumps", "bson.loads" ]
[((512, 535), 'bson.loads', 'bson.loads', (['b'], {}), '(b, **kwargs)\n', (522, 535), False, 'import bson\n'), ((800, 825), 'bson.dumps', 'bson.dumps', (['obj'], {}), '(obj, **kwargs)\n', (810, 825), False, 'import bson\n')]
# -*- encoding: utf-8 -*- import json import os import shutil import tempfile from collections import OrderedDict from datetime import timedelta from pyparsing import ParseBaseException, ParseException, ParseSyntaxException import mock import pytest from pyhocon import (ConfigFactory, ConfigParser, ConfigSubstitution...
[ "mock.patch.dict", "pyhocon.ConfigParser.resolve_package_path", "dateutil.relativedelta.relativedelta", "pyhocon.ConfigTree.merge_configs", "datetime.timedelta", "pyhocon.ConfigParser.resolve_substitutions", "os.path.exists", "os.mkdir", "tempfile.NamedTemporaryFile", "collections.OrderedDict", ...
[((2066, 2153), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""forbidden_char"""', "['+', '`', '^', '?', '!', '@', '*', '&']"], {}), "('forbidden_char', ['+', '`', '^', '?', '!', '@',\n '*', '&'])\n", (2089, 2153), False, 'import pytest\n'), ((2350, 2403), 'pytest.mark.parametrize', 'pytest.mark.paramet...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
[ "edb.common.struct.Field", "hashlib.sha1", "edb.edgeql.ast.ObjectRef", "edb.errors.SchemaDefinitionError", "edb.errors.SchemaError" ]
[((34717, 34750), 'edb.common.struct.Field', 'struct.Field', (['bool'], {'default': '(False)'}), '(bool, default=False)\n', (34729, 34750), False, 'from edb.common import struct\n'), ((12110, 12124), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (12122, 12124), False, 'import hashlib\n'), ((3477, 3550), 'edb.errors...
"""Support for the Philips Hue lights.""" from __future__ import annotations from datetime import timedelta from functools import partial import logging import random import aiohue import async_timeout from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FL...
[ "logging.getLogger", "homeassistant.helpers.debounce.Debouncer", "random.randrange", "homeassistant.helpers.entity.DeviceInfo", "async_timeout.timeout", "homeassistant.util.color.color_xy_to_hs", "functools.partial", "homeassistant.helpers.update_coordinator.UpdateFailed", "datetime.timedelta", "h...
[((1183, 1203), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(5)'}), '(seconds=5)\n', (1192, 1203), False, 'from datetime import timedelta\n'), ((1215, 1242), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1232, 1242), False, 'import logging\n'), ((6930, 7002), 'functools.partial...
from prompt_toolkit.key_binding.bindings.named_commands import (accept_line, self_insert, backward_delete_char, beginning_of_line) from prompt_toolkit.key_binding.bindings.basic import if_no_repeat from prompt_toolkit.key_binding.bindings.basic import load_basic_bindings from prompt_toolkit.key_binding.bindings.ema...
[ "prompt_toolkit.key_binding.bindings.named_commands.backward_delete_char", "re.escape", "re.compile", "prompt_toolkit.key_binding.bindings.emacs.load_emacs_search_bindings", "prompt_toolkit.key_binding.bindings.page_navigation.load_emacs_page_navigation_bindings", "prompt_toolkit.application.current.get_a...
[((1867, 1880), 'prompt_toolkit.key_binding.KeyBindings', 'KeyBindings', ([], {}), '()\n', (1878, 1880), False, 'from prompt_toolkit.key_binding import KeyBindings, merge_key_bindings\n'), ((4468, 4497), 're.compile', 're.compile', (['"""\\\\S *(\\\\n *\\\\n)"""'], {}), "('\\\\S *(\\\\n *\\\\n)')\n", (4478, 4497), Fals...
# 初始化模块 from config import Config from flask import Flask from flask_sqlalchemy import SQLAlchemy # 数据库操作对象 db = SQLAlchemy() # 创建app def create_app(): # flask操作对象 app = Flask(__name__) # 通过配置文件读取并应用配置 app.config.from_object(Config) # 初始化数据库 db.init_app(app) # 员工管理子系统 from app.view i...
[ "flask_sqlalchemy.SQLAlchemy", "flask.Flask" ]
[((114, 126), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (124, 126), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((181, 196), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (186, 196), False, 'from flask import Flask\n')]
import os import itertools import importlib import numpy as np import random STRATEGY_FOLDER = "exampleStrats" RESULTS_FILE = "results.txt" pointsArray = [[1,5],[0,3]] # The i-j-th element of this array is how many points you receive if you do play i, and your opponent does play j. moveLabels = ["D","C"] #...
[ "numpy.flip", "os.listdir", "importlib.import_module", "itertools.combinations", "numpy.argsort", "numpy.zeros", "random.random" ]
[((1069, 1125), 'importlib.import_module', 'importlib.import_module', (["(STRATEGY_FOLDER + '.' + pair[0])"], {}), "(STRATEGY_FOLDER + '.' + pair[0])\n", (1092, 1125), False, 'import importlib\n'), ((1137, 1193), 'importlib.import_module', 'importlib.import_module', (["(STRATEGY_FOLDER + '.' + pair[1])"], {}), "(STRATE...
from polymath import UNSET_SHAPE, DEFAULT_SHAPES import builtins import operator from collections import OrderedDict, Mapping, Sequence, deque import functools from numbers import Integral, Rational, Real import contextlib import traceback import uuid import numpy as np import importlib from .graph import Graph from ....
[ "numpy.product", "numpy.prod", "collections.OrderedDict", "collections.deque", "traceback.extract_stack", "numpy.ravel_multi_index", "numpy.asarray", "functools.wraps", "uuid.uuid4", "numpy.squeeze", "functools.partial", "numpy.expand_dims", "numpy.int" ]
[((1238, 1251), 'collections.deque', 'deque', (['[None]'], {}), '([None])\n', (1243, 1251), False, 'from collections import OrderedDict, Mapping, Sequence, deque\n'), ((46542, 46565), 'functools.wraps', 'functools.wraps', (['target'], {}), '(target)\n', (46557, 46565), False, 'import functools\n'), ((1981, 1994), 'coll...
"""Build the C client docs. """ from __future__ import with_statement import os import shutil import socket import subprocess import time import urllib2 def clean_dir(dir): try: shutil.rmtree(dir) except: pass os.makedirs(dir) def gen_api(dir): clean_dir(dir) clean_dir("docs/sourc...
[ "os.makedirs", "os.rename", "os.chdir", "os.path.isdir", "subprocess.call", "shutil.rmtree" ]
[((240, 256), 'os.makedirs', 'os.makedirs', (['dir'], {}), '(dir)\n', (251, 256), False, 'import os\n'), ((458, 500), 'os.rename', 'os.rename', (['"""docs/source/doxygen/html"""', 'dir'], {}), "('docs/source/doxygen/html', dir)\n", (467, 500), False, 'import os\n'), ((546, 576), 'os.chdir', 'os.chdir', (['"""docs/sourc...
import glm import math from lib.opengl import RenderSettings class GameProjection: def __init__(self, rs: "GameRenderSettings"): self.rs = rs self.scale = 10. self.rotation_deg = 0. self.location = glm.vec3(0) self._stack = [] def projection_matrix_4(self) -> glm.mat...
[ "glm.mat4", "glm.mat3", "math.cos", "glm.vec3", "glm.pi", "math.sin", "glm.ortho" ]
[((1632, 1643), 'math.sin', 'math.sin', (['a'], {}), '(a)\n', (1640, 1643), False, 'import math\n'), ((1653, 1664), 'math.cos', 'math.cos', (['a'], {}), '(a)\n', (1661, 1664), False, 'import math\n'), ((1676, 1716), 'glm.mat3', 'glm.mat3', (['ca', 'sa', '(0)', '(-sa)', 'ca', '(0)', '(0)', '(0)', '(1)'], {}), '(ca, sa, ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import itertools import logging import numpy as np import scipy as sp import torch from ml.rl.evaluation.cpe import CpeEstimate from ml.rl.evaluation.evaluation_data_page import EvaluationDataPage logger = logging.getLogg...
[ "logging.getLogger", "scipy.stats.t._ppf", "numpy.hstack", "numpy.array", "numpy.nanmean", "scipy.stats.sem", "numpy.cov", "numpy.arange", "numpy.mean", "numpy.multiply", "numpy.where", "numpy.dot", "ml.rl.evaluation.cpe.CpeEstimate", "numpy.logspace", "numpy.ones", "numpy.random.choic...
[((305, 332), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (322, 332), False, 'import logging\n'), ((2219, 2257), 'numpy.cumprod', 'np.cumprod', (['importance_weights'], {'axis': '(1)'}), '(importance_weights, axis=1)\n', (2229, 2257), True, 'import numpy as np\n'), ((2604, 2675), 'nump...
# -*- coding: utf-8 -*- # @Author: 何睿 # @Create Date: 2019-08-03 10:48:30 # @Last Modified by: 何睿 # @Last Modified time: 2019-08-03 10:53:15 import copy import random from typing import List class Solution: def __init__(self, nums: List[int]): self.shuffle_ = nums self.orig...
[ "copy.copy", "random.shuffle" ]
[((327, 342), 'copy.copy', 'copy.copy', (['nums'], {}), '(nums)\n', (336, 342), False, 'import copy\n'), ((619, 648), 'random.shuffle', 'random.shuffle', (['self.shuffle_'], {}), '(self.shuffle_)\n', (633, 648), False, 'import random\n')]
import numpy as np import sklearn import pandas as pd import scipy.spatial.distance as ssd from scipy.cluster import hierarchy from scipy.stats import chi2_contingency from sklearn.base import BaseEstimator from sklearn.ensemble import RandomForestClassifier from sklearn.feature_extraction.text import CountVectorizer f...
[ "pandas.Series", "sklearn.utils.validation.check_is_fitted", "scipy.spatial.distance.squareform", "numpy.sqrt", "scipy.stats.chi2_contingency", "sklearn.feature_extraction.text.CountVectorizer", "pandas.crosstab", "sklearn.ensemble.RandomForestClassifier", "sklearn.feature_selection.SelectKBest", ...
[((1112, 1129), 'pandas.crosstab', 'pd.crosstab', (['x', 'y'], {}), '(x, y)\n', (1123, 1129), True, 'import pandas as pd\n'), ((1239, 1256), 'numpy.sqrt', 'np.sqrt', (['(chi2 / n)'], {}), '(chi2 / n)\n', (1246, 1256), True, 'import numpy as np\n'), ((1453, 1489), 'pandas.DataFrame.sparse.from_spmatrix', 'pd.DataFrame.s...
from bs4 import BeautifulSoup import requests import re from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium import webdriver from seleni...
[ "selenium.webdriver.support.ui.WebDriverWait", "selenium.webdriver.Safari", "selenium.webdriver.Chrome", "time.sleep", "requests.get", "bs4.BeautifulSoup", "selenium.webdriver.common.action_chains.ActionChains", "selenium.webdriver.common.touch_actions.TouchActions", "selenium.webdriver.support.expe...
[((1107, 1124), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (1119, 1124), False, 'import requests\n'), ((1140, 1182), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content.text', '"""html.parser"""'], {}), "(content.text, 'html.parser')\n", (1153, 1182), False, 'from bs4 import BeautifulSoup\n'), ((1296, 1314)...
#!/usr/bin/env python3 #****************************************************************************** # (C) 2018, <NAME>, Austria * # * # The Space Python Library is free software; you can redistribut...
[ "UTIL.SYS.LOG", "sys.exit" ]
[((5003, 5022), 'UTIL.SYS.LOG', 'LOG', (['"""--- idle ---"""'], {}), "('--- idle ---')\n", (5006, 5022), False, 'from UTIL.SYS import Error, LOG, LOG_INFO, LOG_WARNING, LOG_ERROR\n'), ((5412, 5438), 'UTIL.SYS.LOG', 'LOG', (['"""Open the TCP server"""'], {}), "('Open the TCP server')\n", (5415, 5438), False, 'from UTIL....
from setuptools import setup, find_packages with open("README.md", 'r',encoding="utf-8") as f: long_description = f.read() setup( name='LineBot', version='0.1.0', description='Simple-LINELIB', long_description=long_description, author='<NAME>', author_email='<EMAIL>', url='https://gith...
[ "setuptools.find_packages" ]
[((366, 413), 'setuptools.find_packages', 'find_packages', ([], {'include': "['CyberTK', 'CyberTK.*']"}), "(include=['CyberTK', 'CyberTK.*'])\n", (379, 413), False, 'from setuptools import setup, find_packages\n')]
## @file # generate capsule # # Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found a...
[ "GenFdsGlobalVariable.GenFdsGlobalVariable.ReplaceWorkspaceMacro", "StringIO.StringIO", "os.path.getsize", "uuid.UUID", "struct.pack", "GenFdsGlobalVariable.GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys", "GenFdsGlobalVariable.GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys" ]
[((5358, 5389), 'os.path.getsize', 'os.path.getsize', (['self.ImageFile'], {}), '(self.ImageFile)\n', (5373, 5389), False, 'import os\n'), ((2439, 2494), 'GenFdsGlobalVariable.GenFdsGlobalVariable.ReplaceWorkspaceMacro', 'GenFdsGlobalVariable.ReplaceWorkspaceMacro', (['self.FvName'], {}), '(self.FvName)\n', (2481, 2494...
import matplotlib.pyplot as plt import numpy as np # Read data size = [] time = [] with open("pi_linear.txt") as file: for line in file.readlines(): x, y = line.split(',') size.append(int(x.strip())) time.append(float(y.strip())) # Plot data fig, ax = plt.subplots() ax.plot(size, tim...
[ "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((288, 302), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (300, 302), True, 'import matplotlib.pyplot as plt\n'), ((442, 452), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (450, 452), True, 'import matplotlib.pyplot as plt\n')]
import mock import pytest import py_zipkin.storage @pytest.fixture(autouse=True, scope="module") def create_zipkin_attrs(): # The following tests all expect _thread_local.zipkin_attrs to exist: if it # doesn't, mock.patch will fail. py_zipkin.storage.ThreadLocalStack().get() def test_get_zipkin_attrs_r...
[ "pytest.fixture", "mock.patch.object" ]
[((55, 99), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)', 'scope': '"""module"""'}), "(autouse=True, scope='module')\n", (69, 99), False, 'import pytest\n'), ((415, 471), 'mock.patch.object', 'mock.patch.object', (['tracer._context_stack', '"""_storage"""', '[]'], {}), "(tracer._context_stack, '_storag...
from pywps import Process, LiteralInput, ComplexInput, ComplexOutput from pywps import Format import logging LOGGER = logging.getLogger('PYWPS') import matplotlib # no X11 server ... must be run first # https://github.com/matplotlib/matplotlib/issues/3466/ matplotlib.use('Agg') import matplotlib.pylab as plt import...
[ "logging.getLogger", "pywps.LiteralInput", "pywps.Format", "matplotlib.pylab.figure", "matplotlib.use", "netCDF4.Dataset", "cartopy.crs.PlateCarree", "matplotlib.pylab.colorbar", "matplotlib.pylab.contourf", "matplotlib.pylab.close" ]
[((120, 146), 'logging.getLogger', 'logging.getLogger', (['"""PYWPS"""'], {}), "('PYWPS')\n", (137, 146), False, 'import logging\n'), ((260, 281), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (274, 281), False, 'import matplotlib\n'), ((586, 603), 'netCDF4.Dataset', 'Dataset', (['resource'], {}...
# -*- coding: utf-8 -*- import json import os.path import random import re from flask import Flask, send_from_directory from flask import request, abort from flaskrun.flaskrun import flask_run import datab.social_database as db app = Flask(__name__) # Regular expression to only accept certain files fileChecker = r...
[ "flask.request.args.get", "re.compile", "flask.Flask", "datab.social_database.exec_many_query", "datab.social_database.insert_quiz_question", "json.dumps", "datab.social_database.register_or_get_email", "datab.social_database.get_all_different_people", "flask.abort", "random.sample", "flaskrun.f...
[((238, 253), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (243, 253), False, 'from flask import Flask, send_from_directory\n'), ((319, 380), 're.compile', 're.compile', (['"""(.*\\\\.js|.*\\\\.html|.*\\\\.png|.*\\\\.css|.*\\\\.map)$"""'], {}), "('(.*\\\\.js|.*\\\\.html|.*\\\\.png|.*\\\\.css|.*\\\\.map)$...
""" Copyright (c) 2020 Aiven Ltd See LICENSE for details """ from astacus.common import magic, utils from astacus.common.ipc import SnapshotFile, SnapshotHash, SnapshotState from astacus.common.progress import increase_worth_reporting, Progress from pathlib import Path from typing import Optional import base64 impo...
[ "logging.getLogger", "astacus.common.progress.increase_worth_reporting", "os.link", "pathlib.Path", "threading.Lock", "astacus.common.utils.parallel_map_to", "astacus.common.ipc.SnapshotFile", "astacus.common.ipc.SnapshotHash", "astacus.common.progress.Progress" ]
[((383, 410), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (400, 410), False, 'import logging\n'), ((1794, 1803), 'pathlib.Path', 'Path', (['src'], {}), '(src)\n', (1798, 1803), False, 'from pathlib import Path\n'), ((1823, 1832), 'pathlib.Path', 'Path', (['dst'], {}), '(dst)\n', (1827,...
import windows import ctypes import socket import struct from windows import winproxy import windows.generated_def as gdef from windows.com import interfaces as cominterfaces from windows.generated_def.winstructs import * from windows.generated_def.windef import * class TCP4Connection(MIB_TCPROW_OWNER_PID): """A...
[ "windows.com.interfaces.IEnumVARIANT", "windows.generated_def.ULONG", "windows.generated_def.VARIANT_BOOL", "windows.com.init", "windows.generated_def.winstructs.MIB_TCP6TABLE_OWNER_PID.from_buffer", "windows.generated_def.LONG", "windows.com.interfaces.IUnknown", "windows.com.create_instance", "cty...
[((4444, 4519), 'windows.generated_def.winstructs.MIB_TCPTABLE_OWNER_PID.from_buffer', 'windows.generated_def.winstructs.MIB_TCPTABLE_OWNER_PID.from_buffer', (['buffer'], {}), '(buffer)\n', (4511, 4519), False, 'import windows\n'), ((4877, 4953), 'windows.generated_def.winstructs.MIB_TCP6TABLE_OWNER_PID.from_buffer', '...
# Copyright (c) Facebook, Inc. and its affiliates. from typing import List, Optional, cast # Skipping analyzing 'numpy': found module but no type hints or library stubs import numpy as np # type: ignore import numpy.ma as ma # type: ignore # Skipping analyzing 'pandas': found module but no type hints or library stu...
[ "torcharrow.dtypes.is_string", "pyarrow.types.is_float32", "torcharrow.dtypes.Map", "torcharrow.dtypes.Int8", "torcharrow.dtypes.is_boolean_or_numerical", "torcharrow.dtypes.String", "pyarrow.types.is_float64", "pyarrow.types.is_map", "torcharrow.dtypes.is_struct", "pyarrow.types.is_boolean", "p...
[((5363, 5396), 'torcharrow.dtypes.is_boolean_or_numerical', 'dt.is_boolean_or_numerical', (['dtype'], {}), '(dtype)\n', (5389, 5396), True, 'import torcharrow.dtypes as dt\n'), ((6246, 6279), 'torcharrow.dtypes.is_boolean_or_numerical', 'dt.is_boolean_or_numerical', (['dtype'], {}), '(dtype)\n', (6272, 6279), True, 'i...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "research.gan.image_compression.networks.compression_model", "tensorflow.contrib.training.StopAfterNEvalsHook", "research.gan.image_compression.data_provider.provide_data", "tensorflow.variable_scope", "tensorflow.contrib.training.SummaryAtEndHook", "absl.app.run", "tensorflow.image.encode_png", "rese...
[((2633, 2707), 'research.gan.image_compression.summaries.add_reconstruction_summaries', 'summaries.add_reconstruction_summaries', (['images', 'reconstructions', 'prebinary'], {}), '(images, reconstructions, prebinary)\n', (2671, 2707), False, 'from research.gan.image_compression import summaries\n'), ((2853, 2891), 't...
''' Asynchronous data loader ======================== This is the Asynchronous Loader. You can use it to load an image and use it, even if data are not yet available. You must specify a default loading image for using a such loader:: from kivy import * image = Loader.image('mysprite.png') You can also load i...
[ "time.sleep", "threading.Thread.__init__", "collections.deque", "kivy.cache.Cache.register", "kivy.logger.Logger.exception", "kivy.cache.Cache.append", "os.unlink", "urllib.request.build_opener", "threading.Condition", "urllib.request.urlopen", "os.close", "os.write", "kivy.compat.queue.Queu...
[((1379, 1429), 'kivy.cache.Cache.register', 'Cache.register', (['"""kv.loader"""'], {'limit': '(500)', 'timeout': '(60)'}), "('kv.loader', limit=500, timeout=60)\n", (1393, 1429), False, 'from kivy.cache import Cache\n'), ((2461, 2482), 'threading.Condition', 'threading.Condition', ([], {}), '()\n', (2480, 2482), Fals...
import os os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide" import pygame RENDER_RATIO = 2 class CakePaddle(pygame.sprite.Sprite): def __init__(self, speed=12): # surf is the right-most (largest) tier of the cake self.surf = pygame.Surface((30 // RENDER_RATIO, 120 // RENDER_RATIO)) self....
[ "pygame.draw.rect", "pygame.Surface" ]
[((249, 306), 'pygame.Surface', 'pygame.Surface', (['(30 // RENDER_RATIO, 120 // RENDER_RATIO)'], {}), '((30 // RENDER_RATIO, 120 // RENDER_RATIO))\n', (263, 306), False, 'import pygame\n'), ((369, 425), 'pygame.Surface', 'pygame.Surface', (['(30 // RENDER_RATIO, 80 // RENDER_RATIO)'], {}), '((30 // RENDER_RATIO, 80 //...
import argparse import os import pickle import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--mnist', action='store_true', default=False, help='open mnist result') args = parser.parse_a...
[ "numpy.mean", "matplotlib.pyplot.grid", "argparse.ArgumentParser", "matplotlib.pyplot.ylabel", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "pickle.load", "matplotlib.pyplot.style.use", "os.path.join", "matplotlib.pyplot.fill_between", "numpy...
[((91, 114), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (104, 114), True, 'import matplotlib.pyplot as plt\n'), ((125, 185), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch MNIST Example"""'}), "(description='PyTorch MNIST Example')\n",...
import os import logging.config from random import randint import zlib import struct import socket import time from PIL import Image import config # from config import ADB_ROOT, ADB_HOST, SCREEN_SHOOT_SAVE_PATH, ShellColor, CONFIG_PATH,enable_adb_host_auto_detect, ADB_SERVER from .ADBClientSession import ADBClientSes...
[ "PIL.Image.open", "config.get", "time.monotonic", "subprocess.run", "os.path.join", "util.socketutil.recvall", "PIL.Image.frombytes", "random.randint", "zlib.decompress", "struct.unpack_from" ]
[((529, 568), 'PIL.Image.frombytes', 'Image.frombytes', (['"""RGBA"""', '(w, h)', 'pixels'], {}), "('RGBA', (w, h), pixels)\n", (544, 568), False, 'from PIL import Image\n'), ((684, 705), 'PIL.Image.open', 'Image.open', (['imgorfile'], {}), '(imgorfile)\n', (694, 705), False, 'from PIL import Image\n'), ((1186, 1223), ...
import inspect import os from pathlib import Path class change_directory: """ A class for changing the working directory using a "with" statement. It takes the directory to change to as an argument. If no directory is given, it takes the directory of the file from which this function was call...
[ "os.chdir", "inspect.stack", "os.getcwd" ]
[((415, 426), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (424, 426), False, 'import os\n'), ((659, 681), 'os.chdir', 'os.chdir', (['self.new_dir'], {}), '(self.new_dir)\n', (667, 681), False, 'import os\n'), ((730, 752), 'os.chdir', 'os.chdir', (['self.old_dir'], {}), '(self.old_dir)\n', (738, 752), False, 'import os\...
import sys from PyQt5.QtWidgets import QApplication from gui import MgallManager def main(): app = QApplication(sys.argv) ex = MgallManager() app.aboutToQuit.connect(ex.ExitHandler) sys.exit(app.exec_()) if __name__ == "__main__": main()
[ "gui.MgallManager", "PyQt5.QtWidgets.QApplication" ]
[((106, 128), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (118, 128), False, 'from PyQt5.QtWidgets import QApplication\n'), ((138, 152), 'gui.MgallManager', 'MgallManager', ([], {}), '()\n', (150, 152), False, 'from gui import MgallManager\n')]