code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python3
# Project: OMRON 2JCIE-BU01
# Module:
from setuptools import setup
import sys
if sys.version_info < (3, 6):
raise NotImplementedError("Sorry, you need at least Python 3.6 to use OMRON 2JCIE-BU01.")
import omron_2jcie_bu01
MODNAME = "omron_2jcie_bu01"
setup(
name = "omron-... | [
"setuptools.setup"
] | [((280, 1164), 'setuptools.setup', 'setup', ([], {'name': '"""omron-2jcie-bu01"""', 'version': 'omron_2jcie_bu01.__version__', 'description': '"""API for OMRON 2JCIE-BU01 Environment Sensor"""', 'long_description': 'omron_2jcie_bu01.__doc__', 'author': 'omron_2jcie_bu01.__author__', 'author_email': '"""<EMAIL>"""', 'ur... |
import time
from lwt.args import parse_args
from lwt.processes import filter_processes
from lwt.report import report
def run():
args = parse_args()
while True:
offending = filter_processes(args)
report(offending)
if not args.monitor:
return
time.sleep(ar... | [
"time.sleep",
"lwt.args.parse_args",
"lwt.processes.filter_processes",
"lwt.report.report"
] | [((149, 161), 'lwt.args.parse_args', 'parse_args', ([], {}), '()\n', (159, 161), False, 'from lwt.args import parse_args\n'), ((199, 221), 'lwt.processes.filter_processes', 'filter_processes', (['args'], {}), '(args)\n', (215, 221), False, 'from lwt.processes import filter_processes\n'), ((231, 248), 'lwt.report.report... |
from __future__ import absolute_import
from __future__ import with_statement
import pickle
from nose import SkipTest
from kombu import Connection, Consumer, Producer, parse_url
from kombu.connection import Resource
from .mocks import Transport
from .utils import TestCase
from .utils import Mock, skip_if_not_module
... | [
"kombu.parse_url",
"pickle.dumps",
"kombu.connection.Resource",
"nose.SkipTest",
"kombu.Connection"
] | [((793, 812), 'kombu.parse_url', 'parse_url', (['self.url'], {}), '(self.url)\n', (802, 812), False, 'from kombu import Connection, Consumer, Producer, parse_url\n'), ((921, 956), 'kombu.parse_url', 'parse_url', (['"""mongodb://example.com/"""'], {}), "('mongodb://example.com/')\n", (930, 956), False, 'from kombu impor... |
import httpsServer
def server():
httpsServer.server() | [
"httpsServer.server"
] | [((35, 55), 'httpsServer.server', 'httpsServer.server', ([], {}), '()\n', (53, 55), False, 'import httpsServer\n')] |
from tfs_integration import TFS_Integration
tfs = TFS_Integration('')
projects = tfs.get_projects()
# Pegando os times e os membros de cada time
for project in projects:
print ("ID: "+ project.id+" - "+project.name)
teams = tfs.get_teams(project_id=project.id)
for team in teams:
print ("Team Name... | [
"tfs_integration.TFS_Integration"
] | [((51, 70), 'tfs_integration.TFS_Integration', 'TFS_Integration', (['""""""'], {}), "('')\n", (66, 70), False, 'from tfs_integration import TFS_Integration\n')] |
import os
import sys
from .extraction import Pattern, Extraction
__all__ = ['Pattern', 'Extraction', 'Walker']
class Walker:
def __init__(self, pattern, followlinks=False):
if not pattern.startswith('/'):
top = os.getcwd()
self.pattern = Pattern(os.path.join(top, pattern))
... | [
"os.listdir",
"os.scandir",
"os.path.join",
"os.getcwd",
"os.path.isdir",
"os.path.islink"
] | [((869, 884), 'os.scandir', 'os.scandir', (['top'], {}), '(top)\n', (879, 884), False, 'import os\n'), ((2278, 2293), 'os.listdir', 'os.listdir', (['top'], {}), '(top)\n', (2288, 2293), False, 'import os\n'), ((239, 250), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (248, 250), False, 'import os\n'), ((2370, 2393), 'os.... |
#!/usr/bin/python
import os
import slack
import json
client = slack.WebClient(token=os.environ['SLACK_API_TOKEN'])
print("channels_retrieve_test: \n" )
print(client.channels_list())
# still testing files to struct a correct model for it
print("channel test:\n ")
client.channels_history(channel='CQNUEAH2N')
print("rep... | [
"slack.WebClient"
] | [((62, 114), 'slack.WebClient', 'slack.WebClient', ([], {'token': "os.environ['SLACK_API_TOKEN']"}), "(token=os.environ['SLACK_API_TOKEN'])\n", (77, 114), False, 'import slack\n')] |
from lettuce import step, world
@step("the empty xml swrl document")
def step_impl(step):
"""
:type step lettuce.core.Step
"""
pass
@step("I retrieve (\d+)")
def step_impl(step, expected):
"""
:type step lettuce.core.Step
"""
assert int(expected) == 1 | [
"lettuce.step"
] | [((35, 70), 'lettuce.step', 'step', (['"""the empty xml swrl document"""'], {}), "('the empty xml swrl document')\n", (39, 70), False, 'from lettuce import step, world\n'), ((152, 177), 'lettuce.step', 'step', (['"""I retrieve (\\\\d+)"""'], {}), "('I retrieve (\\\\d+)')\n", (156, 177), False, 'from lettuce import step... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.SpiDetectionTask import SpiDetectionTask
class AlipayEcoTextDetectModel(object):
def __init__(self):
self._task = None
@property
def task(self):
retu... | [
"alipay.aop.api.domain.SpiDetectionTask.SpiDetectionTask.from_alipay_dict"
] | [((628, 664), 'alipay.aop.api.domain.SpiDetectionTask.SpiDetectionTask.from_alipay_dict', 'SpiDetectionTask.from_alipay_dict', (['i'], {}), '(i)\n', (661, 664), False, 'from alipay.aop.api.domain.SpiDetectionTask import SpiDetectionTask\n')] |
"""Test CNRM-CM5 fixes."""
import unittest
from cf_units import Unit
from iris.cube import Cube
from esmvalcore.cmor.fix import Fix
from esmvalcore.cmor._fixes.cmip5.cnrm_cm5 import Msftmyz, Msftmyzba
class TestMsftmyz(unittest.TestCase):
"""Test msftmyz fixes."""
def setUp(self):
"""Prepare tests."... | [
"cf_units.Unit",
"esmvalcore.cmor._fixes.cmip5.cnrm_cm5.Msftmyzba",
"esmvalcore.cmor.fix.Fix.get_fixes",
"esmvalcore.cmor._fixes.cmip5.cnrm_cm5.Msftmyz",
"iris.cube.Cube"
] | [((343, 385), 'iris.cube.Cube', 'Cube', (['[1.0]'], {'var_name': '"""msftmyz"""', 'units': '"""J"""'}), "([1.0], var_name='msftmyz', units='J')\n", (347, 385), False, 'from iris.cube import Cube\n'), ((405, 418), 'esmvalcore.cmor._fixes.cmip5.cnrm_cm5.Msftmyz', 'Msftmyz', (['None'], {}), '(None)\n', (412, 418), False, ... |
# !/usr/bin/env python
# coding=utf8
import tempfile
from pdbsync.core.plugins.execute import PyExecute
class DbCreateExecutor(PyExecute):
def __init__(self, dest_db):
super(DbCreateExecutor, self).__init__(dest_db)
def run(self, **kwargs):
create_sql = "DROP DATABASE IF EXISTS `%s`;\
... | [
"tempfile.NamedTemporaryFile"
] | [((533, 562), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (560, 562), False, 'import tempfile\n')] |
# 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 u... | [
"mxnet.test_utils.rand_ndarray",
"mxnet.nd.zeros",
"mxnet.nd.clip",
"mxnet.nd.sqrt",
"mxnet.test_utils.default_context"
] | [((1614, 1631), 'mxnet.test_utils.default_context', 'default_context', ([], {}), '()\n', (1629, 1631), False, 'from mxnet.test_utils import default_context, assert_almost_equal, rand_ndarray\n'), ((1700, 1752), 'mxnet.test_utils.rand_ndarray', 'rand_ndarray', (['shape', 'w_stype'], {'density': '(1)', 'dtype': 'dtype'})... |
import sys
from datetime import datetime
LColours = [
'red', 'green', 'blue',
'purple', 'orange', 'brown',
'pink', 'cyan', 'magenta',
'yellow'
]
class WebServiceManager:
def __init__(self, jinja2_env):
self.jinja2_env = jinja2_env
self.DServices = {} # TODO: Replace me, directly... | [
"datetime.datetime.utcfromtimestamp"
] | [((7234, 7275), 'datetime.datetime.utcfromtimestamp', 'datetime.utcfromtimestamp', (["D['timestamp']"], {}), "(D['timestamp'])\n", (7259, 7275), False, 'from datetime import datetime\n')] |
import sys
from sys import argv
sys.path.append("../athene")
import requests
from athene.console import console
from rich.status import Status
# parse identifiers to keys
def parse_key(key: str):
try:
return {
"close": "3B",
"vidmute": "3E",
"freeze": "47",
... | [
"athene.console.console.print",
"sys.path.append",
"requests.get",
"rich.status.Status"
] | [((33, 61), 'sys.path.append', 'sys.path.append', (['"""../athene"""'], {}), "('../athene')\n", (48, 61), False, 'import sys\n'), ((1727, 1774), 'athene.console.console.print', 'console.print', (['"""\nSuccessfull"""'], {'style': '"""success"""'}), "('\\nSuccessfull', style='success')\n", (1740, 1774), False, 'from ath... |
from http import HTTPStatus
import pytest
from django import urls
from crashbin_app.models import Bin, OutgoingMessage, NoteMessage, Label
pytestmark = pytest.mark.django_db
def test_home(admin_client):
response = admin_client.get(urls.reverse("home"))
assert response.status_code == HTTPStatus.OK
asse... | [
"crashbin_app.models.Bin.objects.create",
"crashbin_app.models.Label.objects.get",
"pytest.mark.parametrize",
"crashbin_app.models.Bin.get_inbox",
"django.urls.reverse",
"crashbin_app.models.Bin.objects.get"
] | [((367, 490), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""query, matches"""', "[(None, True), ('test', True), ('Test', True), ('', True), ('blah', False)]"], {}), "('query, matches', [(None, True), ('test', True), (\n 'Test', True), ('', True), ('blah', False)])\n", (390, 490), False, 'import pytest\... |
import lightnion as lnn
import nacl.public
import base64
def hand(guard, encode=True):
identity = base64.b64decode(guard['router']['identity'] + '====')
onion_key = base64.b64decode(guard['ntor-onion-key'] + '====')
ephemeral_key, payload = lnn.crypto.ntor.hand(identity, onion_key)
if encode:
... | [
"lightnion.crypto.ntor.shake",
"base64.b64encode",
"base64.b64decode",
"lightnion.crypto.ntor.hand",
"lightnion.crypto.ntor.kdf"
] | [((105, 159), 'base64.b64decode', 'base64.b64decode', (["(guard['router']['identity'] + '====')"], {}), "(guard['router']['identity'] + '====')\n", (121, 159), False, 'import base64\n'), ((176, 226), 'base64.b64decode', 'base64.b64decode', (["(guard['ntor-onion-key'] + '====')"], {}), "(guard['ntor-onion-key'] + '===='... |
from django.db import models
# Create your models here.
# example model
class Plant(models.Model):
common_name = models.CharField(max_length=100, unique=True)
img_name = models.CharField(max_length=100, default=False)
sunlight = models.CharField(max_length=100, blank=True)
moisture = models.CharField... | [
"django.db.models.ImageField",
"django.db.models.CharField",
"django.db.models.BooleanField"
] | [((120, 165), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'unique': '(True)'}), '(max_length=100, unique=True)\n', (136, 165), False, 'from django.db import models\n'), ((181, 228), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'default': '(False)'}), ... |
from __future__ import absolute_import
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from scipy.stats import norm
import numpy as np
class VirtualCE(nn.Module):
def __init__(self, beta=0.1):
super(VirtualCE, self).__init__()
self.beta ... | [
"torch.nn.functional.normalize",
"torch.cat"
] | [((434, 458), 'torch.nn.functional.normalize', 'F.normalize', (['inputs'], {'p': '(2)'}), '(inputs, p=2)\n', (445, 458), True, 'from torch.nn import functional as F\n'), ((1543, 1567), 'torch.nn.functional.normalize', 'F.normalize', (['inputs'], {'p': '(2)'}), '(inputs, p=2)\n', (1554, 1567), True, 'from torch.nn impor... |
import pandas as pd
import pickle as pkl
data=pd.read_stata("data/BloombergVOTELEVEL_Touse.dta",chunksize=100,convert_categoricals=False)
data_sliced=pd.DataFrame()
print("started slicing")
for chunk in data:
data_sliced = data_sliced.append(chunk[['Circuit', 'caseid', 'date']], ignore_index=True)
print("started p... | [
"pandas.DataFrame",
"pandas.read_stata"
] | [((46, 143), 'pandas.read_stata', 'pd.read_stata', (['"""data/BloombergVOTELEVEL_Touse.dta"""'], {'chunksize': '(100)', 'convert_categoricals': '(False)'}), "('data/BloombergVOTELEVEL_Touse.dta', chunksize=100,\n convert_categoricals=False)\n", (59, 143), True, 'import pandas as pd\n'), ((150, 164), 'pandas.DataFram... |
import os
import sys
from tweepy import API
from tweepy import OAuthHandler
def get_twitter_auth():
try:
consumer_key='F0imGgOVzAzOpDuayoaIvSTC0'
consumer_secret_key='<KEY>'
access_token='<KEY>'
access_secret_token='<KEY>'
print("Connected Successfully")
ex... | [
"sys.stderr.write",
"tweepy.API",
"sys.exit",
"tweepy.OAuthHandler"
] | [((440, 487), 'tweepy.OAuthHandler', 'OAuthHandler', (['consumer_key', 'consumer_secret_key'], {}), '(consumer_key, consumer_secret_key)\n', (452, 487), False, 'from tweepy import OAuthHandler\n'), ((635, 644), 'tweepy.API', 'API', (['auth'], {}), '(auth)\n', (638, 644), False, 'from tweepy import API\n'), ((344, 405),... |
"""
WSGI config for pinterest_example project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
from django... | [
"os.environ.setdefault",
"dj_static.Cling",
"django.core.wsgi.get_wsgi_application"
] | [((243, 307), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""core.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'core.settings')\n", (264, 307), False, 'import os\n'), ((373, 395), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), '()\n', (393, 395), F... |
import emoji
print(emoji.emojize('Python é :thumbs_up:')) | [
"emoji.emojize"
] | [((20, 57), 'emoji.emojize', 'emoji.emojize', (['"""Python é :thumbs_up:"""'], {}), "('Python é :thumbs_up:')\n", (33, 57), False, 'import emoji\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
from datas.benchmark import Benchmark
from datas.div2k import DIV2K
from models.ecbsr import ECBSR
from torch.utils.data import DataLoader
import math
import argparse, yaml
import utils
import os
from tqdm import tqdm
import logging
import sys
import ti... | [
"datas.benchmark.Benchmark",
"torch.nn.L1Loss",
"models.ecbsr.ECBSR",
"torch.cuda.is_available",
"math.log10",
"os.path.exists",
"argparse.ArgumentParser",
"torch.set_num_threads",
"utils.calc_ssim",
"sys.stdout.flush",
"utils.calc_psnr",
"yaml.dump",
"time.time",
"torch.device",
"utils.... | [((334, 378), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""ECBSR"""'}), "(description='ECBSR')\n", (357, 378), False, 'import argparse, yaml\n'), ((4355, 4390), 'torch.set_num_threads', 'torch.set_num_threads', (['args.threads'], {}), '(args.threads)\n', (4376, 4390), False, 'import to... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------
# PyTorch Lightning PBT
# Authors: <NAME>
# Rocket Romero
# Updated: May. 2020
# ---------------------
""" Root. """
import logging as python_logging
_logger = python_logging.getLogger('lightning:pbt:lab')
python_logging.basicConfig(leve... | [
"logging.getLogger",
"logging.basicConfig"
] | [((243, 288), 'logging.getLogger', 'python_logging.getLogger', (['"""lightning:pbt:lab"""'], {}), "('lightning:pbt:lab')\n", (267, 288), True, 'import logging as python_logging\n'), ((289, 342), 'logging.basicConfig', 'python_logging.basicConfig', ([], {'level': 'python_logging.INFO'}), '(level=python_logging.INFO)\n',... |
# -*- coding: utf-8 -*-
"""
Patch for aiologger.logger.Logger
aiologger (https://github.com/B2W-BIT/aiologger) implements 'async/await' syntax
for logging. But there is a problem with aiologger working in Windows.
The stdout and stderr streams in aiologger are connected as pipes. But in
Windows it doesn't work.
In ... | [
"aiologger.filters.StdoutFilter",
"directory_scan.dsaiologger.handlers.DSAsyncStreamHandler"
] | [((2056, 2144), 'directory_scan.dsaiologger.handlers.DSAsyncStreamHandler', 'DSAsyncStreamHandler', ([], {'stream': 'sys.stderr', 'level': 'logging.WARNING', 'formatter': 'formatter'}), '(stream=sys.stderr, level=logging.WARNING, formatter=\n formatter)\n', (2076, 2144), False, 'from directory_scan.dsaiologger.handl... |
import os
from unittest import TestCase
from inbm_vision_lib.xml_handler import XmlHandler, XmlException
from inbm_vision_lib.ota_parser import ParseException, get_children, parse_pota
MISSING_HEADER_XML = '<?xml version="1.0" encoding="utf-8"?> <manifest><type>ota</type>' \
'<ota><type><fota name="sample"><target... | [
"inbm_vision_lib.xml_handler.XmlHandler",
"os.path.dirname",
"inbm_vision_lib.ota_parser.parse_pota"
] | [((2173, 2198), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (2188, 2198), False, 'import os\n'), ((2575, 2647), 'inbm_vision_lib.xml_handler.XmlHandler', 'XmlHandler', ([], {'xml': 'POTA_GOOD_MANIFEST', 'schema_location': 'TEST_SCHEMA_LOCATION'}), '(xml=POTA_GOOD_MANIFEST, schema_location=... |
from machine import Machine, Plot, Colors
import numpy as np
class MyPlot(Plot):
width = 65
steps = width // 2
copies = 1
char = "."
spacing = 0
default_color = Colors.BLUE
def __call__(self, plane, loop, step, *args, **kwargs):
char = Colors.white("@") if loop % 2 == 0 else Color... | [
"machine.Colors.red",
"machine.Colors.green",
"machine.Machine",
"machine.Colors.white",
"machine.Colors.orange"
] | [((638, 665), 'machine.Machine', 'Machine', (['MyPlot'], {'delay': '(0.02)'}), '(MyPlot, delay=0.02)\n', (645, 665), False, 'from machine import Machine, Plot, Colors\n'), ((275, 292), 'machine.Colors.white', 'Colors.white', (['"""@"""'], {}), "('@')\n", (287, 292), False, 'from machine import Machine, Plot, Colors\n')... |
"""Group Revit built-in categories logically and output the data in json
The built-in categories are provided in text files under DATA_DIR
Usage:
python3 ./cgroups.py group and output categories
python3 ./cgroups.py <catname> group and output <catname> category only
"""
# pylint: disable=bad-c... | [
"os.listdir",
"os.path.join",
"re.match",
"os.path.basename",
"json.dump",
"typing.TypeVar"
] | [((473, 490), 'typing.TypeVar', 'TypeVar', (['"""CGROUP"""'], {}), "('CGROUP')\n", (480, 490), False, 'from typing import Set, List, TypeVar\n'), ((21245, 21265), 'os.listdir', 'os.listdir', (['DATA_DIR'], {}), '(DATA_DIR)\n', (21255, 21265), False, 'import os\n'), ((21135, 21206), 'json.dump', 'json.dump', (['ccomps_c... |
"""Data types used for local invocations."""
from typing import Any, Generic, Iterable, Iterator, Mapping, NamedTuple, TypeVar, Union
from dagger.serializer import Serializer
T = TypeVar("T")
class OutputFile(NamedTuple):
"""Represents a file in the local file system that holds the serialized value for a node ... | [
"typing.TypeVar"
] | [((182, 194), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (189, 194), False, 'from typing import Any, Generic, Iterable, Iterator, Mapping, NamedTuple, TypeVar, Union\n')] |
# -*- coding: utf-8 -*-
from functools import wraps
from inspect import getargspec, getmodule
from diskcache import Cache
def qualified_name(x):
return '{}.{}'.format(getmodule(x).__name__, x.__name__)
def permoize(cache_dir, explicit=False):
def decorator(fn):
arg_spec = getargspec(fn)
nb... | [
"inspect.getmodule",
"diskcache.Cache",
"functools.wraps",
"inspect.getargspec"
] | [((294, 308), 'inspect.getargspec', 'getargspec', (['fn'], {}), '(fn)\n', (304, 308), False, 'from inspect import getargspec, getmodule\n'), ((361, 370), 'functools.wraps', 'wraps', (['fn'], {}), '(fn)\n', (366, 370), False, 'from functools import wraps\n'), ((174, 186), 'inspect.getmodule', 'getmodule', (['x'], {}), '... |
from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QGraphicsProxyWidget
from PyQt5.QtWidgets import QTableWidgetItem, QGraphicsSceneMouseEvent
from PyQt5.QtCore import Qt, pyqtSignal, QRect, QPointF
from PyQt5.QtGui import QMouseEvent, QTransform, QKeyEvent, QPainter
from element import PFSActivity, PFSDistribu... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtWidgets.QGraphicsScene.mousePressEvent",
"PyQt5.QtGui.QTransform",
"PyQt5.QtWidgets.QGraphicsScene.mouseReleaseEvent",
"PyQt5.QtWidgets.QGraphicsScene.keyPressEvent",
"PyQt5.QtCore.QPointF"
] | [((495, 507), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (505, 507), False, 'from PyQt5.QtCore import Qt, pyqtSignal, QRect, QPointF\n'), ((518, 530), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (528, 530), False, 'from PyQt5.QtCore import Qt, pyqtSignal, QRect, QPointF\n'), ((548, 560), ... |
import hashlib
import io
import sys
from typing import Optional
from PIL import Image, ImageOps
from django.core import checks
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.db.models import ImageField
class ResizedHashNameImageField(ImageField):
"""A custom ImageField class that wil... | [
"PIL.Image.open",
"PIL.ImageOps.exif_transpose",
"sys.getsizeof",
"io.BytesIO",
"django.core.checks.Error"
] | [((1151, 1172), 'PIL.Image.open', 'Image.open', (['file.file'], {}), '(file.file)\n', (1161, 1172), False, 'from PIL import Image, ImageOps\n'), ((1303, 1330), 'PIL.ImageOps.exif_transpose', 'ImageOps.exif_transpose', (['im'], {}), '(im)\n', (1326, 1330), False, 'from PIL import Image, ImageOps\n'), ((1525, 1537), 'io.... |
"""
------------------------
Loggers module
The module consists Logger class that can be used by various modules in various scenarios for logging purpose.
------------------------
"""
import logging
from datetime import datetime
from flask import current_app
import os
class Logger:
"""
Custom logger class
... | [
"logging.getLogger",
"logging.Formatter",
"os.path.dirname",
"logging.FileHandler",
"datetime.datetime.today",
"logging.LoggerAdapter"
] | [((435, 528), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s %(levelname)s:%(name)s: %(message)s"""', '"""%d-%m-%Y %H:%M:%S"""'], {}), "('%(asctime)s %(levelname)s:%(name)s: %(message)s',\n '%d-%m-%Y %H:%M:%S')\n", (452, 528), False, 'import logging\n'), ((886, 928), 'os.path.dirname', 'os.path.dirname'... |
import logging
import time
logger = logging.getLogger("namedLogger")
def sleep(secs):
logger.info("Sleeping for %d seconds.", secs)
time.sleep(secs)
| [
"logging.getLogger",
"time.sleep"
] | [((37, 69), 'logging.getLogger', 'logging.getLogger', (['"""namedLogger"""'], {}), "('namedLogger')\n", (54, 69), False, 'import logging\n'), ((143, 159), 'time.sleep', 'time.sleep', (['secs'], {}), '(secs)\n', (153, 159), False, 'import time\n')] |
if __name__ == '__main__' and __package__ is None:
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ))
import os
import torch
from utils.model_serialization import strip_prefix_if_present
from utils import zipreader
import argparse
from tqdm import tqdm
i... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.makedirs",
"tqdm.tqdm",
"os.path.join",
"pickle.load",
"cv2.undistort",
"os.path.dirname",
"os.path.abspath",
"utils.zipreader.imread",
"os.path.expanduser"
] | [((373, 438), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Keypoints Training"""'}), "(description='PyTorch Keypoints Training')\n", (396, 438), False, 'import argparse\n'), ((809, 837), 'os.path.expanduser', 'os.path.expanduser', (['args.src'], {}), '(args.src)\n', (827, 837),... |
import os
import shutil
import wave
from collections import defaultdict
from statistics import mean
#directories = [r'D:\Data\aligner_comp\organized']
directories = ['/media/share/datasets/aligner_benchmarks/AlignerTestData/1_English_13000files',
'/data/mmcauliffe/data/LibriSpeech/clean']
for d in dir... | [
"os.path.join",
"collections.defaultdict",
"os.path.basename",
"os.walk"
] | [((390, 408), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (401, 408), False, 'from collections import defaultdict\n'), ((439, 449), 'os.walk', 'os.walk', (['d'], {}), '(d)\n', (446, 449), False, 'import os\n'), ((569, 591), 'os.path.basename', 'os.path.basename', (['root'], {}), '(root)\n', ... |
# -*- coding: utf-8 -*-
import mimetypes
import os
from flask import abort, send_file
from flask_restful import Resource
from flask_restful_swagger import root_path
from flask_restful_swagger.registry import get_current_registry
from flask_restful_swagger.utils import render_page
__author__ = 'sobolevn'
class Sta... | [
"os.path.exists",
"flask.abort",
"os.path.join",
"flask_restful_swagger.utils.render_page",
"mimetypes.guess_type",
"flask_restful_swagger.registry.get_current_registry",
"flask.send_file"
] | [((445, 467), 'flask_restful_swagger.registry.get_current_registry', 'get_current_registry', ([], {}), '()\n', (465, 467), False, 'from flask_restful_swagger.registry import get_current_registry\n'), ((1129, 1173), 'os.path.join', 'os.path.join', (['root_path', '"""static"""', 'file_path'], {}), "(root_path, 'static', ... |
__Author__ = "noduez"
from socket import *
from time import ctime
import os
import re
HOST = ""
PORT = 21567
BUFSIZ = 1024
ADDR = (HOST, PORT)
tcpSerSock = socket(AF_INET, SOCK_STREAM)
tcpSerSock.bind(ADDR)
tcpSerSock.listen(5)
responsedic = {'date': ctime(), 'os': os.name, 'ls': str(os.listdir(os.curdir))}
while T... | [
"time.ctime",
"os.listdir"
] | [((254, 261), 'time.ctime', 'ctime', ([], {}), '()\n', (259, 261), False, 'from time import ctime\n'), ((288, 309), 'os.listdir', 'os.listdir', (['os.curdir'], {}), '(os.curdir)\n', (298, 309), False, 'import os\n')] |
import logging
import tflite
import numpy as np
from tflite2onnx import mapping
from tflite2onnx.op.common import Operator
from tflite2onnx.op.binary import PowerWrapper
logger = logging.getLogger('tflite2onnx')
class Rsqrt(Operator):
# use square root as input operator and propagate output to power
TypeMap... | [
"logging.getLogger",
"tflite2onnx.op.binary.PowerWrapper",
"numpy.full"
] | [((181, 213), 'logging.getLogger', 'logging.getLogger', (['"""tflite2onnx"""'], {}), "('tflite2onnx')\n", (198, 213), False, 'import logging\n'), ((1405, 1436), 'tflite2onnx.op.binary.PowerWrapper', 'PowerWrapper', (['self.TFactory', '(-1)'], {}), '(self.TFactory, -1)\n', (1417, 1436), False, 'from tflite2onnx.op.binar... |
from argparse import ArgumentParser
from logging import INFO, basicConfig, getLogger
from pathlib import Path
from typing import Union
import cv2
from face_region_extractor import (
FaceDetectionError,
FaceNotFoundError,
FaceRegionExtractor,
)
basicConfig(level=INFO)
logger = getLogger(__name__)
def ba... | [
"logging.basicConfig",
"logging.getLogger",
"argparse.ArgumentParser",
"pathlib.Path",
"face_region_extractor.FaceRegionExtractor"
] | [((259, 282), 'logging.basicConfig', 'basicConfig', ([], {'level': 'INFO'}), '(level=INFO)\n', (270, 282), False, 'from logging import INFO, basicConfig, getLogger\n'), ((292, 311), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (301, 311), False, 'from logging import INFO, basicConfig, getLogger... |
#!/usr/bin/env python3
#
# Copyright 2018 <NAME>
#
# 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... | [
"logging.basicConfig",
"collections.OrderedDict",
"json.loads",
"bigquery_schema_generator.generate_schema.SchemaGenerator.DATE_MATCHER.match",
"argparse.ArgumentParser",
"logging.info",
"bigquery_schema_generator.generate_schema.SchemaGenerator.TIME_MATCHER.match",
"bigquery_schema_generator.generate... | [((7658, 7745), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Anonymize newline-delimited JSON data file."""'}), "(description=\n 'Anonymize newline-delimited JSON data file.')\n", (7681, 7745), False, 'import argparse\n'), ((8116, 8155), 'logging.basicConfig', 'logging.basicConfig',... |
"""Compiler
This module exports a single function
complile(source_code_string, output_type)
The second argument tells the compiler what to produce. It must be one of:
tokens the token sequence
ast the abstract syntax tree
analyzed the semantically analyzed representation
optimized ... | [
"ael.scanner.tokenize"
] | [((782, 798), 'ael.scanner.tokenize', 'tokenize', (['source'], {}), '(source)\n', (790, 798), False, 'from ael.scanner import tokenize\n'), ((851, 867), 'ael.scanner.tokenize', 'tokenize', (['source'], {}), '(source)\n', (859, 867), False, 'from ael.scanner import tokenize\n'), ((935, 951), 'ael.scanner.tokenize', 'tok... |
# WTF uses a class to represent a traditional form.
# The class LoginForm describes the fields of our form. Note; we're
# paying no attention to the appearance of the form just yet.
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
# DataRequired ensures that a us... | [
"wtforms.BooleanField",
"wtforms.validators.DataRequired",
"wtforms.SubmitField"
] | [((587, 614), 'wtforms.BooleanField', 'BooleanField', (['"""Remember Me"""'], {}), "('Remember Me')\n", (599, 614), False, 'from wtforms import StringField, PasswordField, BooleanField, SubmitField\n'), ((628, 650), 'wtforms.SubmitField', 'SubmitField', (['"""Sign In"""'], {}), "('Sign In')\n", (639, 650), False, 'from... |
"""
********************************************************************************
main file to execute
********************************************************************************
"""
import time
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from pinn import PINN
from config_gpu im... | [
"matplotlib.pyplot.grid",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.linalg.norm",
"fdm.FDM",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.empty",
"params.params",
"numpy.meshgrid",
"matplotlib.pyplot.yscale",
"tensorflow.device",
"p... | [((473, 494), 'config_gpu.config_gpu', 'config_gpu', ([], {'gpu_flg': '(1)'}), '(gpu_flg=1)\n', (483, 494), False, 'from config_gpu import config_gpu\n'), ((689, 697), 'params.params', 'params', ([], {}), '()\n', (695, 697), False, 'from params import params\n'), ((856, 883), 'numpy.linspace', 'np.linspace', (['tmin', ... |
import os, sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import skimage.io
from skimage.transform import resize
from imgaug import augmenters as iaa
from random import randint
import PIL
from PIL import Image
import cv2
from sklearn.utils import class_weight, shuffle
import keras
import wa... | [
"keras.layers.Conv2D",
"tensorflow.equal",
"pandas.read_csv",
"imgaug.augmenters.GaussianBlur",
"keras.backend.floatx",
"numpy.array",
"tensorflow.is_nan",
"keras.layers.Dense",
"tensorflow.ones_like",
"imgaug.augmenters.Fliplr",
"numpy.arange",
"numpy.divide",
"imgaug.augmenters.Flipud",
... | [((384, 417), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (407, 417), False, 'import warnings\n'), ((8892, 8931), 'numpy.arange', 'np.arange', (['paths.shape[0]'], {'dtype': 'np.int'}), '(paths.shape[0], dtype=np.int)\n', (8901, 8931), True, 'import numpy as np\n'), ((8... |
from torchvision.transforms import *
import numbers
import random
from PIL import Image
class GroupToTensor(object):
def __init__(self):
pass
def __call__(self, img_group):
return [ToTensor()(img) for img in img_group]
class GroupCenterCrop(object):
def __init__(self, size):
self.size = size
def __call__(s... | [
"PIL.Image.new",
"random.randint"
] | [((1721, 1746), 'random.randint', 'random.randint', (['(0)', '(w - tw)'], {}), '(0, w - tw)\n', (1735, 1746), False, 'import random\n'), ((1756, 1781), 'random.randint', 'random.randint', (['(0)', '(h - th)'], {}), '(0, h - th)\n', (1770, 1781), False, 'import random\n'), ((2074, 2109), 'random.randint', 'random.randin... |
# -*- coding: utf-8 -*-
"""Plot step wind
"""
import matplotlib.pyplot as plt
import numpy as np
import os
from _inputs import (step_dir, model_keys, i_gspd, i_pit, i_gtrq, fig_dir, fast_labels, h2_labels)
from _utils import read_step
plot_keys = [('GenSpeed', i_gspd,'Generator Speed [rpm]', 1),
('BldPitc... | [
"matplotlib.pyplot.rc_context",
"os.path.basename",
"_utils.read_step",
"matplotlib.pyplot.tight_layout"
] | [((2142, 2160), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (2158, 2160), True, 'import matplotlib.pyplot as plt\n'), ((785, 840), '_utils.read_step', 'read_step', (['fast_path'], {'usecols': '[t[0] for t in plot_keys]'}), '(fast_path, usecols=[t[0] for t in plot_keys])\n', (794, 840), False... |
import pandas as pd
import plotly.graph_objs as go
flist = ['data/data_cleaned/poss_ppp_data/poss2015.csv', 'data/data_cleaned/poss_ppp_data/poss2016.csv', 'data/data_cleaned/poss_ppp_data/poss2017.csv',
'data/data_cleaned/poss_ppp_data/poss2018.csv', 'data/data_cleaned/poss_ppp_data/poss2019.csv']
def sc... | [
"pandas.DataFrame",
"plotly.graph_objs.Figure",
"pandas.read_csv"
] | [((623, 641), 'pandas.read_csv', 'pd.read_csv', (['fname'], {}), '(fname)\n', (634, 641), True, 'import pandas as pd\n'), ((656, 670), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (668, 670), True, 'import pandas as pd\n'), ((1374, 1385), 'plotly.graph_objs.Figure', 'go.Figure', ([], {}), '()\n', (1383, 1385),... |
# encoding: utf-8
from contextlib import contextmanager
import time
import pytest
import requests
from simply.platform import factory
from simply.utils import ConfAttrDict
@contextmanager
def platform_setup(conf):
platform = factory(conf)
platform.setup('all_containers')
yield platform
platform.res... | [
"pytest.mark.parametrize",
"time.sleep",
"simply.platform.factory",
"simply.utils.ConfAttrDict"
] | [((328, 393), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""image"""', "['conda2', 'conda3', 'debian8']"], {}), "('image', ['conda2', 'conda3', 'debian8'])\n", (351, 393), False, 'import pytest\n'), ((467, 583), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""interprter,http_server"""', "[('py... |
import os
import logging
from pathlib import Path
class ServiceLogger:
def __init__(self, name, file, loglevel='DEBUG'):
p = str(Path(file).parent) + '/logs/'
i = 0
while True:
if not os.path.exists(p):
i = i + 1
p = str(Path(file).parents[i]) +... | [
"logging.getLogger",
"os.path.exists",
"pathlib.Path",
"logging.Formatter",
"logging.getLevelName",
"logging.FileHandler"
] | [((566, 589), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (583, 589), False, 'import logging\n'), ((606, 636), 'logging.getLevelName', 'logging.getLevelName', (['loglevel'], {}), '(loglevel)\n', (626, 636), False, 'import logging\n'), ((686, 777), 'logging.Formatter', 'logging.Formatter', (['"... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from .....base import BasePluginForm, get_theme
__title__ = 'fobi.contrib.plugins.form_handlers.http_repost.forms'
__author__ = '<NAME> <<EMAIL>>'
__copyright__ = '2014-2017 <NAME>'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = ('HTTPRepost... | [
"django.utils.translation.ugettext_lazy",
"django.forms.widgets.TextInput"
] | [((586, 603), 'django.utils.translation.ugettext_lazy', '_', (['"""Endpoint URL"""'], {}), "('Endpoint URL')\n", (587, 603), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((643, 714), 'django.forms.widgets.TextInput', 'forms.widgets.TextInput', ([], {'attrs': "{'class': theme.form_element_html_cla... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 8 00:34:40 2021
@author: Alex1
"""
import serial
import time
class QCL_comms():
"""docstring for QCL_comms"""
def __init__(self, arg=None):
super(QCL_comms, self).__init__()
self.arg = arg
self.serActive = False
def connect(self,port = 'COM9'):
self.ser =... | [
"serial.Serial",
"time.sleep"
] | [((321, 347), 'serial.Serial', 'serial.Serial', (['port', '(57600)'], {}), '(port, 57600)\n', (334, 347), False, 'import serial\n'), ((517, 530), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (527, 530), False, 'import time\n'), ((730, 745), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (740, 745), Fals... |
import numpy as np
from . import utils
def tile_position(x0, y0, x1=None, y1=None):
"""Need doc string..."""
if x1 is None and y1 is None:
x1 = x0
y1 = y0
if (x0.size != y0.size) or (x1.size != y1.size):
raise ValueError("x0 and y0 or x1 and y1 size do not match.")
x0g = np... | [
"numpy.sqrt"
] | [((1225, 1251), 'numpy.sqrt', 'np.sqrt', (['(dx ** 2 + dy ** 2)'], {}), '(dx ** 2 + dy ** 2)\n', (1232, 1251), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
loads the dom and fetches html source after javascript rendering w/ firefox, geckodriver & selenium
use sharedutils.py:socksfetcher for faster results if no post-processing required
'''
import time
import requests
from selenium import webdriver
from selenium.webdriver.... | [
"sharedutils.stdlog",
"requests.packages.urllib3.disable_warnings",
"sharedutils.checktcp",
"sharedutils.errlog",
"selenium.webdriver.Firefox",
"time.sleep",
"selenium.webdriver.firefox.options.Options",
"sharedutils.randomagent",
"sharedutils.dbglog",
"sharedutils.honk"
] | [((580, 624), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', ([], {}), '()\n', (622, 624), False, 'import requests\n'), ((752, 808), 'sharedutils.stdlog', 'stdlog', (["('geckodriver: ' + 'starting to fetch ' + webpage)"], {}), "('geckodriver: ' + 'starting to fetch ' + webpa... |
#!/usr/bin/env python
# coding: utf-8
import sys
sys.path.append("../")
import pandas as pd
import numpy as np
import pathlib
import pickle
import os
import itertools
import argparse
import logging
import helpers.feature_helpers as fh
from collections import Counter
OUTPUT_DF_TR = 'df_steps_tr.csv'
OUTPUT_DF_VAL =... | [
"logging.getLogger",
"logging.basicConfig",
"numpy.mean",
"pickle.dump",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.max",
"itertools.chain.from_iterable",
"numpy.array",
"pandas.concat",
"numpy.std",
"pandas.notnull",
"sys.path.append"
] | [((50, 72), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (65, 72), False, 'import sys\n'), ((785, 842), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Create cv features"""'}), "(description='Create cv features')\n", (808, 842), False, 'import argparse\n'), ((1... |
""".. Line to protect from pydocstyle D205, D400.
Cutadapt
--------
Remove adapter sequences from reads in FASTQ file.
"""
import os
import shutil
import subprocess
import tempfile
import iCount
from iCount.files.fastq import get_qual_encoding, ENCODING_TO_OFFSET
def get_version():
"""Get cutadapt version."""... | [
"subprocess.check_output",
"shutil.move",
"iCount.files.fastq.get_qual_encoding",
"os.path.join",
"subprocess.call",
"tempfile._get_candidate_names"
] | [((2827, 2861), 'subprocess.call', 'subprocess.call', (['args'], {'shell': '(False)'}), '(args, shell=False)\n', (2842, 2861), False, 'import subprocess\n'), ((381, 448), 'subprocess.check_output', 'subprocess.check_output', (['args'], {'shell': '(False)', 'universal_newlines': '(True)'}), '(args, shell=False, universa... |
import copy
import importlib
import os
import numpy as np
import tensorflow as tf
import logging
tf.get_logger().setLevel(logging.ERROR)
from client import Client
from server import Server
from model import ServerModel
from baseline_constants import MAIN_PARAMS, MODEL_PARAMS
from fedbayes_helper import *
from fedbaye... | [
"os.path.exists",
"tensorflow.reset_default_graph",
"importlib.import_module",
"numpy.ones",
"numpy.average",
"tensorflow.logging.set_verbosity",
"metrics.writer.get_metrics_names",
"server.Server",
"numpy.array",
"numpy.zeros",
"utils.matching.cnn_pfnm.layerwise_sampler",
"utils.matching.cnn_... | [((836, 877), 'metrics.writer.get_metrics_names', 'metrics_writer.get_metrics_names', (['metrics'], {}), '(metrics)\n', (868, 877), True, 'import metrics.writer as metrics_writer\n'), ((98, 113), 'tensorflow.get_logger', 'tf.get_logger', ([], {}), '()\n', (111, 113), True, 'import tensorflow as tf\n'), ((3894, 3929), '... |
#!/usr/bin/env python3
from pathlib import Path
import sys
import subprocess
import re
import argparse
import os
#Path of file
dir_path = os.path.dirname(os.path.realpath(__file__))
#TODO: insert correct org name
org='YOUR_ORG_NAME_HERE'
pmd_pos = dir_path + '/pmd-bin-6.14.0/bin'
pos_yaclu = dir_path+ '/yaclu'
root... | [
"subprocess.check_output",
"argparse.ArgumentParser",
"pathlib.Path",
"subprocess.run",
"re.match",
"os.path.realpath",
"re.search"
] | [((409, 495), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Use to download and run tests on git repos"""'}), "(description=\n 'Use to download and run tests on git repos')\n", (432, 495), False, 'import argparse\n'), ((155, 181), 'os.path.realpath', 'os.path.realpath', (['__file__']... |
import numpy as np
import pyverilator
import os
from . import to_float, to_fix_point_int
import taichi as ti
from .all_python_functions import calc_next_pos_and_velocity, rectify_positions_and_velocities, \
rectify_positions_in_collision, calc_after_collision_velocity, two_ball_collides, normalize_vector
def rect... | [
"numpy.allclose",
"pyverilator.PyVerilator.build",
"numpy.random.rand",
"numpy.ones",
"taichi.init",
"os.chdir",
"numpy.array",
"numpy.zeros",
"taichi.GUI"
] | [((978, 1001), 'os.chdir', 'os.chdir', (['"""./pyverilog"""'], {}), "('./pyverilog')\n", (986, 1001), False, 'import os\n'), ((1012, 1069), 'pyverilator.PyVerilator.build', 'pyverilator.PyVerilator.build', (['"""rectify_p_in_collision.v"""'], {}), "('rectify_p_in_collision.v')\n", (1041, 1069), False, 'import pyverilat... |
# Import modules
from time import sleep
from features.helpers.appium_helpers import app_driver, compare_screenshots
from features.helpers.common_helpers import get_config_and_set_logging, get_file_abs_path
# Read Config file and set logging
CONFIG, LOGGER = get_config_and_set_logging("config.yaml", "app_logs.log", "IN... | [
"features.helpers.appium_helpers.compare_screenshots",
"time.sleep",
"features.helpers.appium_helpers.app_driver",
"features.helpers.common_helpers.get_config_and_set_logging"
] | [((259, 334), 'features.helpers.common_helpers.get_config_and_set_logging', 'get_config_and_set_logging', (['"""config.yaml"""', '"""app_logs.log"""', '"""INFO"""', '__name__'], {}), "('config.yaml', 'app_logs.log', 'INFO', __name__)\n", (285, 334), False, 'from features.helpers.common_helpers import get_config_and_set... |
# pip install neo4j-driver
# https://neo4j.com/docs/api/python-driver/current/
from neo4j.v1 import GraphDatabase, basic_auth
def pickwine(variety, country, region, winery, price, score, params):
prices = price.split(" to ")
lower = int(prices[0])
upper = int(prices[1])
scores = score.split(" to ")
lowScore... | [
"neo4j.v1.basic_auth"
] | [((470, 498), 'neo4j.v1.basic_auth', 'basic_auth', (['"""neo4j"""', '"""jesus"""'], {}), "('neo4j', 'jesus')\n", (480, 498), False, 'from neo4j.v1 import GraphDatabase, basic_auth\n'), ((3106, 3134), 'neo4j.v1.basic_auth', 'basic_auth', (['"""neo4j"""', '"""jesus"""'], {}), "('neo4j', 'jesus')\n", (3116, 3134), False, ... |
import unittest
from operator import attrgetter
from typing import Dict
import numpy as np
from PIL import Image
from _pytest._code import ExceptionInfo
from lunavl.sdk.errors.errors import ErrorInfo
from lunavl.sdk.faceengine.engine import VLFaceEngine
from lunavl.sdk.image_utils.geometry import Rect
from lunavl.sdk... | [
"operator.attrgetter",
"PIL.Image.open",
"lunavl.sdk.faceengine.engine.VLFaceEngine",
"numpy.array",
"numpy.ndarray",
"lunavl.sdk.image_utils.image.VLImage.fromNumpyArray"
] | [((463, 477), 'lunavl.sdk.faceengine.engine.VLFaceEngine', 'VLFaceEngine', ([], {}), '()\n', (475, 477), False, 'from lunavl.sdk.faceengine.engine import VLFaceEngine\n'), ((2576, 2596), 'PIL.Image.open', 'Image.open', (['ONE_FACE'], {}), '(ONE_FACE)\n', (2586, 2596), False, 'from PIL import Image\n'), ((2645, 2680), '... |
# Copyright (c) <NAME>, 2015
# See LICENSE for details.
import os
from textwrap import dedent
from twisted.trial.unittest import TestCase
import mock
from click.testing import CliRunner
from ..create import _main
def setup_simple_project(config=None, mkdir=True):
if not config:
config = dedent(
... | [
"textwrap.dedent",
"mock.patch",
"os.listdir",
"click.testing.CliRunner",
"os.mkdir"
] | [((487, 502), 'os.mkdir', 'os.mkdir', (['"""foo"""'], {}), "('foo')\n", (495, 502), False, 'import os\n'), ((306, 399), 'textwrap.dedent', 'dedent', (['""" [tool.towncrier]\n package = "foo"\n """'], {}), '(\n """ [tool.towncrier]\n package = "foo"\n ... |
from pygame import init, display, time, event, draw, QUIT
from numpy import arange
def grid(janela, comprimento, tamanho_linha, tamanho_quadrado):
def draw_grid(v):
draw.line(janela, (255, 255, 255),
(v * tamanho_quadrado, 0),
(v * tamanho_quadrado, comprimento))
... | [
"pygame.display.set_caption",
"pygame.init",
"pygame.draw.line",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.time.Clock",
"numpy.arange"
] | [((1554, 1560), 'pygame.init', 'init', ([], {}), '()\n', (1558, 1560), False, 'from pygame import init, display, time, event, draw, QUIT\n'), ((1594, 1622), 'pygame.display.set_mode', 'display.set_mode', (['tela_cheia'], {}), '(tela_cheia)\n', (1610, 1622), False, 'from pygame import init, display, time, event, draw, Q... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, 2020 boringhexi
"""imccontainer.py - read/write IMC audio container files
An IMC audio container file is a file type from Gitaroo Man that has the extension .IMC
and contains audio subsongs."""
import struct
from itertools import count, zip_longest
from gitarootools.au... | [
"gitarootools.audio.subsong.write_subimc",
"gitarootools.audio.subsong.read_subimc",
"itertools.zip_longest",
"struct.pack",
"gitarootools.miscutils.datautils.open_maybe",
"itertools.count",
"gitarootools.miscutils.datautils.readstruct"
] | [((6777, 6799), 'gitarootools.miscutils.datautils.open_maybe', 'open_maybe', (['file', '"""rb"""'], {}), "(file, 'rb')\n", (6787, 6799), False, 'from gitarootools.miscutils.datautils import chunks, open_maybe, readstruct\n'), ((6902, 6924), 'gitarootools.miscutils.datautils.readstruct', 'readstruct', (['file', '"""<I""... |
# Generated by Django 3.1.13 on 2021-07-16 09:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0025_activity_warning"),
]
operations = [
migrations.AddField(
model_name="boec",
name="unreadActivityCount... | [
"django.db.models.IntegerField"
] | [((341, 371), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (360, 371), False, 'from django.db import migrations, models\n')] |
import requests
import parsel
import re
def parse(html):
'''
Parse form data including the entry ID, page history, and some token
thingies
'''
sel = parsel.Selector(html)
inputs = sel.css('input[type=hidden]')
entry_re = re.compile(r'entry\.(.*)_')
entry = int(entry_re.search(inputs[0... | [
"requests.post",
"re.compile",
"requests.get",
"parsel.Selector"
] | [((1449, 1466), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1461, 1466), False, 'import requests\n'), ((171, 192), 'parsel.Selector', 'parsel.Selector', (['html'], {}), '(html)\n', (186, 192), False, 'import parsel\n'), ((252, 279), 're.compile', 're.compile', (['"""entry\\\\.(.*)_"""'], {}), "('entry\\\... |
from operator import truediv
import cv2
from time import sleep
import HandTrackingModule as htm
import os
import autopy
import numpy as np
import math
import mediapipe as mp
#import modules
#variables
frameR=20 #frame rduction
frameR_x=800
frameR_y=110
wCam,hCam=1300 ,400
pTime=0
smoothening = 5 #need to tune
plocX, p... | [
"cv2.rectangle",
"autopy.mouse.click",
"autopy.screen.size",
"HandTrackingModule.handDetector",
"time.sleep",
"cv2.imshow",
"cv2.circle",
"cv2.VideoCapture",
"numpy.interp",
"autopy.mouse.move",
"cv2.waitKey"
] | [((360, 379), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (376, 379), False, 'import cv2\n'), ((423, 451), 'HandTrackingModule.handDetector', 'htm.handDetector', ([], {'maxHands': '(1)'}), '(maxHands=1)\n', (439, 451), True, 'import HandTrackingModule as htm\n'), ((463, 483), 'autopy.screen.size', '... |
from abc import ABC, abstractmethod
import numpy as np
import matplotlib.pyplot as plt
from heatlib.units import Time
from heatlib.boundary_conditions import Boundary_Condition
from heatlib.domains import Domain_Constant_1D, Domain_Variable_1D
from heatlib.solvers import Solver_1D
####################################... | [
"heatlib.units.Time",
"matplotlib.pyplot.subplots",
"numpy.interp",
"matplotlib.pyplot.show"
] | [((2137, 2171), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': 'self.figsize'}), '(figsize=self.figsize)\n', (2149, 2171), True, 'import matplotlib.pyplot as plt\n'), ((2840, 2850), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2848, 2850), True, 'import matplotlib.pyplot as plt\n'), ((3671, ... |
# BSD 3-Clause License
#
# Copyright (c) 2016-21, University of Liverpool
# 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 notic... | [
"numpy.load",
"conkit.core.distancefile.DistanceFile",
"conkit.core.distogram.Distogram"
] | [((2857, 2875), 'conkit.core.distancefile.DistanceFile', 'DistanceFile', (['f_id'], {}), '(f_id)\n', (2869, 2875), False, 'from conkit.core.distancefile import DistanceFile\n'), ((2946, 2970), 'conkit.core.distogram.Distogram', 'Distogram', (['"""distogram_1"""'], {}), "('distogram_1')\n", (2955, 2970), False, 'from co... |
##############################################################################
# Copyright 2020 IBM Corp. 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
#
# htt... | [
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"dfpipeline.Imputer"
] | [((900, 968), 'pandas.DataFrame', 'pd.DataFrame', (["{'col1': [1, 2, 3, np.nan], 'col2': [1, 3, 5, np.nan]}"], {}), "({'col1': [1, 2, 3, np.nan], 'col2': [1, 3, 5, np.nan]})\n", (912, 968), True, 'import pandas as pd\n'), ((990, 1061), 'pandas.DataFrame', 'pd.DataFrame', (["{'col1': [1.0, 2.0, 3.0, 2.0], 'col2': [1, 3,... |
import wx
from gui.textutil import CopyFont, default_font
#from gui.toolbox import prnt
from wx import EXPAND,ALL,TOP,VERTICAL,ALIGN_CENTER_HORIZONTAL,ALIGN_CENTER_VERTICAL,LI_HORIZONTAL
ALIGN_CENTER = ALIGN_CENTER_HORIZONTAL|ALIGN_CENTER_VERTICAL
TOPLESS = ALL & ~TOP
bgcolors = [
wx.Color(238, 238, 238),
wx... | [
"wx.StockCursor",
"wx.Colour",
"wx.RendererNative.Get",
"wx.Dialog.__init__",
"gui.textutil.CopyFont",
"wx.BoxSizer",
"wx.FindWindowAtPointer",
"wx.VListBox.__init__",
"wx.StaticLine",
"wx.Color",
"gui.textutil.default_font",
"wx.Panel",
"wx.Rect",
"wx.ClientDC"
] | [((359, 382), 'wx.Color', 'wx.Color', (['(220)', '(220)', '(220)'], {}), '(220, 220, 220)\n', (367, 382), False, 'import wx\n'), ((289, 312), 'wx.Color', 'wx.Color', (['(238)', '(238)', '(238)'], {}), '(238, 238, 238)\n', (297, 312), False, 'import wx\n'), ((318, 341), 'wx.Color', 'wx.Color', (['(255)', '(255)', '(255)... |
from django.db import router
from django.urls import path, include
from .router import router
from . import views
urlpatterns = [
path('', include(router.urls))
] | [
"django.urls.include"
] | [((144, 164), 'django.urls.include', 'include', (['router.urls'], {}), '(router.urls)\n', (151, 164), False, 'from django.urls import path, include\n')] |
# Copyright 2020 The Lucent 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 applicable ... | [
"torch.nn.functional.pad",
"torch.cuda.is_available",
"einops.rearrange",
"torch.randn"
] | [((3394, 3449), 'einops.rearrange', 'einops.rearrange', (['t', '"""dummy c b h w -> (dummy b) c h w"""'], {}), "(t, 'dummy c b h w -> (dummy b) c h w')\n", (3410, 3449), False, 'import einops\n'), ((2655, 2680), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2678, 2680), False, 'import torch\n... |
#!/usr/bin/env python
from flask import (
render_template, Response, Blueprint, request, session, current_app
)
import time
from .camera import Camera
from .auth import login_required
from .db import get_db_by_config,get_db
from . import history_records
from . import intruding_records
bp = Blueprint('video', __nam... | [
"flask.session.get",
"flask.Blueprint",
"flask.session.setdefault",
"time.sleep"
] | [((296, 324), 'flask.Blueprint', 'Blueprint', (['"""video"""', '__name__'], {}), "('video', __name__)\n", (305, 324), False, 'from flask import render_template, Response, Blueprint, request, session, current_app\n'), ((523, 552), 'flask.session.setdefault', 'session.setdefault', (['"""ip"""', '"""0"""'], {}), "('ip', '... |
from typing import TYPE_CHECKING, Dict, List, Union, Optional, Any, Tuple
import json
from logging import getLogger, Logger
import pg8000 # type: ignore
import pyarrow as pa # type: ignore
from boto3 import client # type: ignore
from awswrangler import data_types
from awswrangler.exceptions import (RedshiftLoadErr... | [
"logging.getLogger",
"awswrangler.data_types.extract_pyarrow_schema_from_pandas",
"awswrangler.data_types.spark2redshift",
"awswrangler.exceptions.InvalidDataframeType",
"json.dumps",
"awswrangler.exceptions.InvalidRedshiftSortkey",
"awswrangler.exceptions.InvalidRedshiftPrimaryKeys",
"awswrangler.exc... | [((627, 646), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (636, 646), False, 'from logging import getLogger, Logger\n'), ((5818, 5838), 'json.dumps', 'json.dumps', (['manifest'], {}), '(manifest)\n', (5828, 5838), False, 'import json\n'), ((16688, 16750), 'awswrangler.exceptions.InvalidRedshif... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Distributed under the terms of the MIT License.
"""
Utilities.
Author: <NAME>
Date Created: 29 May 2020
"""
from rdkit.Chem import AllChem as rdkit
def update_from_rdkit_conf(stk_mol, rdk_mol, conf_id):
"""
Update the structure to match `conf_id` of `mol`.
... | [
"rdkit.Chem.AllChem.EmbedMultipleConfs",
"rdkit.Chem.AllChem.ETKDGv3"
] | [((1338, 1477), 'rdkit.Chem.AllChem.EmbedMultipleConfs', 'rdkit.EmbedMultipleConfs', ([], {'mol': 'molecule', 'numConfs': 'N', 'randomSeed': '(1000)', 'useExpTorsionAnglePrefs': '(True)', 'useBasicKnowledge': '(True)', 'numThreads': '(4)'}), '(mol=molecule, numConfs=N, randomSeed=1000,\n useExpTorsionAnglePrefs=True... |
from cv2 import cv2
from collections import Counter
from PIL import Image, ImageDraw, ImageFont
from scipy.fftpack import dct
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import gmpy2
import numpy as np
import time
import os
"""
Transparency
If putting the pixel with RGBA = (Ra, Ga, Ba, Aa) over... | [
"sklearn.cluster.KMeans",
"numpy.mean",
"PIL.Image.fromarray",
"numpy.median",
"os.listdir",
"numpy.copy",
"PIL.Image.new",
"os.path.join",
"PIL.ImageFont.truetype",
"numpy.asarray",
"numpy.array",
"numpy.zeros",
"PIL.ImageDraw.Draw",
"scipy.fftpack.dct",
"os.path.dirname",
"numpy.argm... | [((540, 574), 'os.path.join', 'os.path.join', (['"""icons"""', '"""generated"""'], {}), "('icons', 'generated')\n", (552, 574), False, 'import os\n'), ((626, 655), 'numpy.array', 'np.array', (['img'], {'dtype': 'np.uint8'}), '(img, dtype=np.uint8)\n', (634, 655), True, 'import numpy as np\n'), ((666, 686), 'PIL.Image.f... |
######################
# análise de sequencia
from Bio.Seq import Seq
seq1 = Seq("ATG")
print('Sequencia :', seq1)
# sequencia complementar
seq1_comp = seq1.complement()
print('Sequencia complementar :', seq1_comp)
# sequencia complementar reversa
seq1_comp_reversa = seq1.reverse_comp... | [
"Bio.Seq.Seq"
] | [((77, 87), 'Bio.Seq.Seq', 'Seq', (['"""ATG"""'], {}), "('ATG')\n", (80, 87), False, 'from Bio.Seq import Seq\n'), ((476, 486), 'Bio.Seq.Seq', 'Seq', (['"""ATG"""'], {}), "('ATG')\n", (479, 486), False, 'from Bio.Seq import Seq\n'), ((739, 749), 'Bio.Seq.Seq', 'Seq', (['"""ATG"""'], {}), "('ATG')\n", (742, 749), False,... |
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if ... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.BigIntegerField",
"django.db.models.DateTimeField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.CharField"
] | [((541, 585), 'django.db.models.CharField', 'models.CharField', ([], {'unique': '(True)', 'max_length': '(80)'}), '(unique=True, max_length=80)\n', (557, 585), False, 'from django.db import models\n'), ((715, 762), 'django.db.models.ForeignKey', 'models.ForeignKey', (['AuthGroup', 'models.DO_NOTHING'], {}), '(AuthGroup... |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | [
"datetime.datetime.utcnow",
"indibase.indiBase.Device",
"mw4.test.test_units.setupQt.setupQt",
"unittest.mock.patch.object",
"pytest.fixture"
] | [((663, 707), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)', 'scope': '"""module"""'}), "(autouse=True, scope='module')\n", (677, 707), False, 'import pytest\n'), ((800, 809), 'mw4.test.test_units.setupQt.setupQt', 'setupQt', ([], {}), '()\n', (807, 809), False, 'from mw4.test.test_units.setupQt import ... |
# Tests for Scheme class
import pytest
from simframe.integration import Scheme
def test_scheme_repr_str():
def f():
pass
s = Scheme(f)
assert isinstance(repr(s), str)
assert isinstance(str(s), str)
def test_scheme_attributes():
def f():
pass
with pytest.raises(TypeError):
... | [
"pytest.raises",
"simframe.integration.Scheme"
] | [((145, 154), 'simframe.integration.Scheme', 'Scheme', (['f'], {}), '(f)\n', (151, 154), False, 'from simframe.integration import Scheme\n'), ((426, 435), 'simframe.integration.Scheme', 'Scheme', (['f'], {}), '(f)\n', (432, 435), False, 'from simframe.integration import Scheme\n'), ((293, 317), 'pytest.raises', 'pytest... |
# ======================================================================
# Copyright CERFACS (October 2018)
# Contributor: <NAME> (<EMAIL>)
#
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/or redistribute ... | [
"numpy.random.choice",
"qtoolkit.data_structures.quantum_circuit.quantum_circuit.QuantumCircuit",
"qtoolkit.maths.matrix.distances.gloa_objective_function",
"numpy.zeros",
"numpy.random.randint",
"numpy.argmin",
"qtoolkit.maths.matrix.generation.quantum_circuit.generate_random_quantum_circuit"
] | [((5397, 5433), 'numpy.zeros', 'numpy.zeros', (['(p,)'], {'dtype': 'numpy.float'}), '((p,), dtype=numpy.float)\n', (5408, 5433), False, 'import numpy\n'), ((6224, 6249), 'numpy.argmin', 'numpy.argmin', (['self._costs'], {}), '(self._costs)\n', (6236, 6249), False, 'import numpy\n'), ((8461, 8529), 'numpy.random.choice'... |
#!/usr/bin/python
import sys, getopt, re
from collections import defaultdict
input_file = ''
dictionary_file = ''
try:
opts, args = getopt.getopt(sys.argv[1:],"i:d:",["input=","dictionary="])
except getopt.GetoptError:
print('word_usage.py -i <input file> [-d <dictionary>]')
sys.exit(2)
for opt, arg in opts:
if... | [
"re.sub",
"getopt.getopt",
"collections.defaultdict",
"sys.exit"
] | [((531, 547), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (542, 547), False, 'from collections import defaultdict\n'), ((136, 198), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '"""i:d:"""', "['input=', 'dictionary=']"], {}), "(sys.argv[1:], 'i:d:', ['input=', 'dictionary='])\n", (149, 19... |
# coding=utf-8
# Copyright (c) 2021 <NAME> <<EMAIL>>. All rights reserved.
# This file is based on code by the authors denoted below and has been modified from its original version.
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... | [
"torch.cuda.LongTensor",
"copy.deepcopy",
"megatron.mpu.get_model_parallel_src_rank",
"torch.nn.functional.softmax",
"megatron.utils.is_mp_rank_0",
"torch.distributed.barrier",
"megatron.mpu.get_model_parallel_group",
"json.dumps",
"megatron.utils.get_ltor_masks_and_position_ids",
"torch.argmax",
... | [((1364, 1525), 'megatron.utils.get_ltor_masks_and_position_ids', 'get_ltor_masks_and_position_ids', (['tokens', 'neox_args.tokenizer.eod', 'neox_args.reset_position_ids', 'neox_args.reset_attention_mask', 'neox_args.eod_mask_loss'], {}), '(tokens, neox_args.tokenizer.eod, neox_args.\n reset_position_ids, neox_args.... |
from setuptools import setup, find_packages
setup(name='pystacking',
version='0.1.0',
description='Python Machine Learning Stacking Maker',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=find_packages(),
python_requires=">=3.5",
tests_require=['pytest'... | [
"setuptools.find_packages"
] | [((243, 258), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (256, 258), False, 'from setuptools import setup, find_packages\n')] |
import glob
import csv
import os
txt = glob.glob("/mnt/edisk/backup/dataset/semantic_raw/*.txt")
print(len(txt))
txt_train = txt[0:236]
txt_val = txt[237:241]
txt_test = txt[242:246]
os.chdir("/mnt/edisk/backup/filelists")
with open('FileList_train.txt', 'w', newline='') as myfile:
wr = csv.writer(m... | [
"os.chdir",
"csv.writer",
"glob.glob"
] | [((42, 99), 'glob.glob', 'glob.glob', (['"""/mnt/edisk/backup/dataset/semantic_raw/*.txt"""'], {}), "('/mnt/edisk/backup/dataset/semantic_raw/*.txt')\n", (51, 99), False, 'import glob\n'), ((193, 232), 'os.chdir', 'os.chdir', (['"""/mnt/edisk/backup/filelists"""'], {}), "('/mnt/edisk/backup/filelists')\n", (201, 232), ... |
import requests
from pkcs7_detached import verify_detached_signature, aws_certificates
import json
from pprint import pprint
def main():
print("Verifying ec2 instance identity document")
r = requests.get("http://169.254.169.254/latest/dynamic/instance-identity/document")
identity_document = r.text
r... | [
"pprint.pprint",
"json.loads",
"pkcs7_detached.verify_detached_signature",
"requests.get"
] | [((202, 287), 'requests.get', 'requests.get', (['"""http://169.254.169.254/latest/dynamic/instance-identity/document"""'], {}), "('http://169.254.169.254/latest/dynamic/instance-identity/document'\n )\n", (214, 287), False, 'import requests\n'), ((323, 400), 'requests.get', 'requests.get', (['"""http://169.254.169.2... |
from flask import Flask
from config import config
from flask_sqlalchemy import SQLAlchemy
# app.config['SECRET_KEY'] = '666666'
# ... add more variables here as needed
# app.config.from_object('config') # 载入配置文件
# app.config.from_object(config[config_name])
# config[config_name].init_app(app)
db = SQLAlchemy()
def ... | [
"flask_sqlalchemy.SQLAlchemy",
"flask.Flask"
] | [((302, 314), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (312, 314), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((355, 370), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (360, 370), False, 'from flask import Flask\n')] |
from timeit import repeat
from subprocess import check_output
def timer(arg, niter, name, module):
stmt = "%s(%s)" % (name, arg)
setup = "from %s import %s" % (module, name)
time = min(repeat(stmt=stmt, setup=setup, number=niter)) / float(niter) * 1e9
return time
N = 10**6
pytime_0 = timer(0, N, name... | [
"timeit.repeat"
] | [((198, 242), 'timeit.repeat', 'repeat', ([], {'stmt': 'stmt', 'setup': 'setup', 'number': 'niter'}), '(stmt=stmt, setup=setup, number=niter)\n', (204, 242), False, 'from timeit import repeat\n')] |
import torch
import torch.nn as nn
from torch.nn import init
from encoders import *
from aggregators import *
class SupervisedGraphSage(nn.Module):
def __init__(self, num_classes, enc, w):
"""
w - array of len(num_classes) indicating the weight of each class when computing
loss.
... | [
"torch.nn.init.xavier_uniform_",
"torch.FloatTensor",
"torch.nn.CrossEntropyLoss"
] | [((440, 474), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {'weight': 'self.w'}), '(weight=self.w)\n', (459, 474), True, 'import torch.nn as nn\n'), ((565, 598), 'torch.nn.init.xavier_uniform_', 'init.xavier_uniform_', (['self.weight'], {}), '(self.weight)\n', (585, 598), False, 'from torch.nn import init\n... |
from optparse import OptionParser
import os
import sys
import time
import numpy as np
import pandas as pd
import tensorflow as tf
import utils
import get_site_features
import tf_utils
np.set_printoptions(threshold=np.inf, linewidth=200)
pd.options.mode.chained_assignment = None
if __name__ == '__main__':
pars... | [
"tf_utils._float_feature",
"pandas.read_csv",
"tf_utils._int64_feature",
"optparse.OptionParser",
"get_site_features.get_sites_from_utr",
"utils.rev_comp",
"tensorflow.train.FeatureList",
"utils.one_hot_encode",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.train.SequenceExample",
"numpy.se... | [((187, 239), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.inf', 'linewidth': '(200)'}), '(threshold=np.inf, linewidth=200)\n', (206, 239), True, 'import numpy as np\n'), ((325, 339), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (337, 339), False, 'from optparse import OptionPar... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#https://pysimplegui.readthedocs.io/en/latest/cookbook/
import PySimpleGUI as sg
#import PySimpleGUIWeb as sg
# Very basic window. Return values using auto numbered keys
layout = [
# API選択 free, google, watson, azure, nict, special
[sg.Frame(layout=[
... | [
"PySimpleGUI.Checkbox",
"PySimpleGUI.Text",
"PySimpleGUI.Button",
"PySimpleGUI.Radio",
"PySimpleGUI.Window"
] | [((3663, 3694), 'PySimpleGUI.Window', 'sg.Window', (['u"""RiKi 設定入力"""', 'layout'], {}), "(u'RiKi 設定入力', layout)\n", (3672, 3694), True, 'import PySimpleGUI as sg\n'), ((3612, 3628), 'PySimpleGUI.Button', 'sg.Button', (['u"""OK"""'], {}), "(u'OK')\n", (3621, 3628), True, 'import PySimpleGUI as sg\n'), ((3634, 3653), 'P... |
from django.conf.urls import url, include
from django.contrib.auth.models import User
urlpatterns = [
url(r'^test/', include('testapp.urls'), name='Test User/Group API'),
url(r'^resume/', include('apis.jsonresume_org.urls'), name='Json Resume'),
url(r'^schema/', include('apis.schema_org.urls'), name='Schem... | [
"django.conf.urls.include"
] | [((122, 145), 'django.conf.urls.include', 'include', (['"""testapp.urls"""'], {}), "('testapp.urls')\n", (129, 145), False, 'from django.conf.urls import url, include\n'), ((197, 232), 'django.conf.urls.include', 'include', (['"""apis.jsonresume_org.urls"""'], {}), "('apis.jsonresume_org.urls')\n", (204, 232), False, '... |
# Cryptomath Module
import random
def gcd(a, b):
# Returns the GCD of positive integers a and b using the Euclidean Algorithm.
if a>b:
x, y = a, b
else:
y, x = a, b
while y!= 0:
temp = x % y
x = y
y = temp
return x
def extendedGCD(a,b): #used to find mod ... | [
"random.randint"
] | [((1210, 1234), 'random.randint', 'random.randint', (['(2)', '(n - 1)'], {}), '(2, n - 1)\n', (1224, 1234), False, 'import random\n'), ((3389, 3409), 'random.randint', 'random.randint', (['x', 'y'], {}), '(x, y)\n', (3403, 3409), False, 'import random\n')] |
from more_itertools import ilen
from my.discord import messages, activity
def test_discord() -> None:
assert ilen(messages()) > 100
# get at least 100 activity events
i: int = 0
for event in activity():
assert isinstance(event, dict)
i += 1
if i > 100:
break
e... | [
"my.discord.messages",
"my.discord.activity"
] | [((211, 221), 'my.discord.activity', 'activity', ([], {}), '()\n', (219, 221), False, 'from my.discord import messages, activity\n'), ((121, 131), 'my.discord.messages', 'messages', ([], {}), '()\n', (129, 131), False, 'from my.discord import messages, activity\n')] |
import sys
from collections import deque
def sol():
# sys.stdin = open("./17086/input.txt")
input = sys.stdin.readline
N, M = map(int, input().split())
baby_sharks = deque()
space = []
for r in range(N):
tmp = list(map(int, input().split()))
for c in range(M):
if tm... | [
"collections.deque"
] | [((184, 191), 'collections.deque', 'deque', ([], {}), '()\n', (189, 191), False, 'from collections import deque\n')] |
from pprint import pprint
from dataclasses import dataclass, field
from typing import List
from tabulate import tabulate
from typer import Typer
from sly import Lexer
app = Typer()
class Scanner(Lexer):
"""Lexer class for scanning the code.
"""
tokens = {
IF_KW, ELSE_KW, FOR_KW,... | [
"typer.Typer",
"pprint.pprint",
"dataclasses.field"
] | [((185, 192), 'typer.Typer', 'Typer', ([], {}), '()\n', (190, 192), False, 'from typer import Typer\n'), ((2052, 2079), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (2057, 2079), False, 'from dataclasses import dataclass, field\n'), ((3465, 3479), 'pprint.pprint', 'pprint... |
"""config URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | [
"django.urls.include",
"rest_framework_nested.routers.NestedSimpleRouter",
"django.urls.path",
"rest_framework_nested.routers.SimpleRouter"
] | [((882, 904), 'rest_framework_nested.routers.SimpleRouter', 'routers.SimpleRouter', ([], {}), '()\n', (902, 904), False, 'from rest_framework_nested import routers\n'), ((1021, 1085), 'rest_framework_nested.routers.NestedSimpleRouter', 'routers.NestedSimpleRouter', (['router', '"""projects"""'], {'lookup': '"""project"... |
from __future__ import print_function
from __future__ import division
import os
import sys
import time
import datetime
import os.path as osp
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torch.optim import lr_scheduler
from args import... | [
"torch.optim.lr_scheduler.MultiStepLR",
"torchreid.losses.singular_triplet_loss.SingularTripletLoss",
"torchreid.losses.incidence_xent_loss.IncidenceXentLoss",
"torch.cuda.is_available",
"args.image_dataset_kwargs",
"args.argument_parser",
"torchreid.losses.wrapped_triplet_loss.WrappedTripletLoss",
"t... | [((1246, 1263), 'args.argument_parser', 'argument_parser', ([], {}), '()\n', (1261, 1263), False, 'from args import argument_parser, image_dataset_kwargs, optimizer_kwargs\n'), ((1311, 1333), 'torchreid.models.tricks.dropout.DropoutOptimizer', 'DropoutOptimizer', (['args'], {}), '(args)\n', (1327, 1333), False, 'from t... |