code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.test import TestCase
from django.contrib.auth.models import User
from .models import Neighbourhoods,Profile,Businesses,Message,Comments
# Create your tests here.
class UserTest(TestCase):
def setUp(self):
self.user=User(username='dk',first_name='d',last_name='k',email='<EMAIL>')
def ... | [
"django.contrib.auth.models.User.objects.filter",
"django.contrib.auth.models.User.objects.all",
"django.contrib.auth.models.User"
] | [((242, 309), 'django.contrib.auth.models.User', 'User', ([], {'username': '"""dk"""', 'first_name': '"""d"""', 'last_name': '"""k"""', 'email': '"""<EMAIL>"""'}), "(username='dk', first_name='d', last_name='k', email='<EMAIL>')\n", (246, 309), False, 'from django.contrib.auth.models import User\n'), ((693, 711), 'djan... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = """
CCParser
Author: https://twitter.com/1_mod_m/
Project site: https://github.com/1modm/
Copyright (c) 2016, MM
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the followi... | [
"lib.htmloutput.htmltitle_figure",
"lib.htmloutput.htmlinfotable",
"lib.htmloutput.htmlinfotrend",
"lib.htmloutput.htmlinfotr",
"lib.htmloutput.htmltitle_subclase",
"lib.htmloutput.htmlinfo",
"lib.htmloutput.htmlinfolistend",
"lib.htmloutput.htmltitle",
"lib.txtoutput.print_title_txt",
"lib.htmlou... | [((2929, 2989), 'lib.txtoutput.print_result_txt', 'print_result_txt', (['childtext', 'cc_txt_file', 'outputdirectorytxt'], {}), '(childtext, cc_txt_file, outputdirectorytxt)\n', (2945, 2989), False, 'from lib.txtoutput import print_result_txt, print_title_txt\n'), ((2996, 3051), 'lib.htmloutput.htmlinfo', 'htmlinfo', (... |
from __future__ import unicode_literals
import logging
from django.contrib.contenttypes import generic as ct_generic
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator, URLValidator
from django.db import models
from django.utils.encoding import p... | [
"logging.getLogger",
"django.core.validators.MaxValueValidator",
"django.db.models.IntegerField",
"django.core.exceptions.ValidationError",
"django.core.validators.MinValueValidator",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.IPAddressField",
"django.db.models.ForeignKey",
"ipt... | [((692, 719), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (709, 719), False, 'import logging\n'), ((870, 949), 'django.db.models.URLField', 'models.URLField', ([], {'max_length': '(200)', 'unique': '(True)', 'help_text': '"""Keystone endpoint url"""'}), "(max_length=200, unique=True, h... |
import pytest
from homepage.models import Course
from django.core.exceptions import ValidationError
from decimal import Decimal
# -----------course tests----------- #
# creating a single new course with valid input
@pytest.mark.parametrize("valid_courses", [
(1, "Linear Algebra 1", True, 4),
# ... | [
"homepage.models.Course",
"pytest.mark.parametrize",
"homepage.models.Course.objects.get",
"decimal.Decimal",
"homepage.models.Course.objects.filter"
] | [((219, 463), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""valid_courses"""', "[(1, 'Linear Algebra 1', True, 4), (1, 'Linear Algebra 1', True, 4, None),\n (1, 'Linear Algebra 1', True, 4, 'https://www.google.com'), (1,\n 'Linear Algebra 1', True, 4, None, 3.5, 4, 13, 7)]"], {}), "('valid_courses',... |
from smbus import SMBus
class MCPGPIO():
__IODIR = [0x00, 0x01] # レジスタ番号
__GPPU = [0x0C, 0x0D]
__GPIO = [0x12, 0x13]
__OLAT = [0x14, 0x15]
INPUT = 1
OUTPUT = 0
INPUTPULLUP = 3
HIGH = 1
LOW = 0
def __init__(self,address = 0x20):
self.bus = SMBus(1)
self.ad... | [
"smbus.SMBus"
] | [((300, 308), 'smbus.SMBus', 'SMBus', (['(1)'], {}), '(1)\n', (305, 308), False, 'from smbus import SMBus\n')] |
import pandas as pd
import base64
import datetime
import hashlib
import hmac
import json
import urllib
import urllib.parse
import urllib.request
import requests
# 此处填写APIKEY
ACCESS_KEY = "fb5335bd-b1902e32-cc0b36e2-6850a"
SECRET_KEY = "49761a11-c8c3b8d3-e3639666-6a6c4"
# API 请求地址
MARKET_URL = "https://api.huobi.pr... | [
"hmac.new",
"requests.post",
"urllib.parse.urlparse",
"pandas.DataFrame",
"datetime.datetime.utcnow",
"base64.b64encode",
"json.dumps",
"requests.get",
"urllib.parse.urlencode",
"pandas.to_datetime"
] | [((814, 844), 'urllib.parse.urlencode', 'urllib.parse.urlencode', (['params'], {}), '(params)\n', (836, 844), False, 'import urllib\n'), ((860, 916), 'requests.get', 'requests.get', (['url', 'postdata'], {'headers': 'headers', 'timeout': '(10)'}), '(url, postdata, headers=headers, timeout=10)\n', (872, 916), False, 'im... |
"""create application table
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2020-09-26 01:36:21.338833
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto... | [
"alembic.op.drop_table",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.BigInteger"
] | [((659, 688), 'alembic.op.drop_table', 'op.drop_table', (['"""applications"""'], {}), "('applications')\n", (672, 688), False, 'from alembic import op\n'), ((488, 528), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""applicationID"""'], {}), "('applicationID')\n", (511, 528), True, 'import sqlalchem... |
from bluesky_live.run_builder import RunBuilder
import pytest
from ...models.plot_specs import (
FigureSpec,
FigureSpecList,
AxesSpec,
LineSpec,
ImageSpec,
)
from ..figures import QtFigure, QtFigures
# Generate example data.
with RunBuilder() as builder:
builder.add_stream("primary", data={"a... | [
"pytest.mark.parametrize",
"bluesky_live.run_builder.RunBuilder",
"pytest.raises"
] | [((2464, 2605), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('model_property', 'mpl_method')", "[('title', 'get_title'), ('x_label', 'get_xlabel'), ('y_label', 'get_ylabel')]"], {}), "(('model_property', 'mpl_method'), [('title',\n 'get_title'), ('x_label', 'get_xlabel'), ('y_label', 'get_ylabel')])\n",... |
import time
from typing import Dict, List, Optional, Union
import bot.handlers.bot_handlers.utils as utils
from telegram_bot.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
@app.task(ignore_result=True)
def broadcast_message(
user_ids: List[Union[str, int]],
... | [
"bot.handlers.bot_handlers.utils._from_celery_entities_to_entities",
"celery.utils.log.get_task_logger",
"telegram_bot.celery.app.task",
"bot.handlers.bot_handlers.utils._from_celery_markup_to_markup",
"bot.handlers.bot_handlers.utils._send_message"
] | [((200, 225), 'celery.utils.log.get_task_logger', 'get_task_logger', (['__name__'], {}), '(__name__)\n', (215, 225), False, 'from celery.utils.log import get_task_logger\n'), ((229, 257), 'telegram_bot.celery.app.task', 'app.task', ([], {'ignore_result': '(True)'}), '(ignore_result=True)\n', (237, 257), False, 'from te... |
### MIT License
### Copyright (c) 2020 <NAME>
### Permission is hereby granted, free of charge, to any person obtaining a copy
### of this software and associated documentation files (the "Software"), to deal
### in the Software without restriction, including without limitation the rights
### to use, copy, modify, me... | [
"audiocore.WaveFile"
] | [((2233, 2267), 'audiocore.WaveFile', 'WaveFile', (['wav_file', 'self._file_buf'], {}), '(wav_file, self._file_buf)\n', (2241, 2267), False, 'from audiocore import WaveFile\n')] |
from django.db import models
# Create your models here.
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
is_active = (
('True', 'True'),
('False', 'False')
)
class MyAccountManager(BaseUserManager):
def create_user(self,email,username,password=None):
... | [
"django.db.models.EmailField",
"django.db.models.TextField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((1164, 1251), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'null': '(True)', 'blank': '(False)', 'verbose_name': '"""first_name"""'}), "(max_length=20, null=True, blank=False, verbose_name=\n 'first_name')\n", (1180, 1251), False, 'from django.db import models\n'), ((1259, 1335), '... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from config import gLocalIP
from config import gLocalPort
from config import gSaveDataFileFullName
from config import gFlyerInitDoneStr
from config import gKeyAcceletorPidStep
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.... | [
"frame.down.FCCtrlStopFrame",
"widget.wave_widget.FCWaveWidget",
"PyQt5.uic.loadUiType",
"frame.down.FCCtrlStartFrame"
] | [((696, 714), 'PyQt5.uic.loadUiType', 'loadUiType', (['uiFile'], {}), '(uiFile)\n', (706, 714), False, 'from PyQt5.uic import loadUiType, loadUi\n'), ((824, 838), 'widget.wave_widget.FCWaveWidget', 'FCWaveWidget', ([], {}), '()\n', (836, 838), False, 'from widget.wave_widget import FCWaveWidget\n'), ((2557, 2586), 'fra... |
# Copyright 2020 Konstruktor, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
"multiprocessing.Manager"
] | [((818, 827), 'multiprocessing.Manager', 'Manager', ([], {}), '()\n', (825, 827), False, 'from multiprocessing import Manager\n')] |
from lib.settings import random_string
__example_payload__ = "' AND 1=1 OR 2=2"
__type__ = "changing the payload spaces to obfuscated hashes with a newline"
def tamper(payload, **kwargs):
modifier = "%%23{}%%0A".format(random_string())
retval = ""
for char in payload:
if char == " ":
... | [
"lib.settings.random_string"
] | [((227, 242), 'lib.settings.random_string', 'random_string', ([], {}), '()\n', (240, 242), False, 'from lib.settings import random_string\n')] |
from typing import TYPE_CHECKING
from redbot.core import commands
if TYPE_CHECKING:
from . import RoomTools
def tmpc_active():
async def check(ctx: commands.Context):
if not ctx.guild:
return False
cog = ctx.bot.get_cog("RoomTools")
if TYPE_CHECKING:
assert is... | [
"redbot.core.commands.check"
] | [((474, 495), 'redbot.core.commands.check', 'commands.check', (['check'], {}), '(check)\n', (488, 495), False, 'from redbot.core import commands\n'), ((852, 873), 'redbot.core.commands.check', 'commands.check', (['check'], {}), '(check)\n', (866, 873), False, 'from redbot.core import commands\n')] |
# coding: utf8
"""
Ensemble de fonctions pour manipuler une instance du problème "Le jardinier et
les taupes", dans le cas où l'objectif est :
- qu'aucune taupe ne puisse pénétrer dans le jardin ;
- que le nombre de pièges soit minimal.
"""
import os
import itertools
import numpy as np
import pulp
def _dimcheck(g... | [
"pulp.LpProblem",
"numpy.product",
"pulp.LpVariable.dicts",
"pulp.lpSum",
"numpy.where",
"os.path.join",
"numpy.any",
"numpy.zeros",
"numpy.arange",
"os.remove"
] | [((1222, 1248), 'numpy.any', 'np.any', (['(check >= threshold)'], {}), '(check >= threshold)\n', (1228, 1248), True, 'import numpy as np\n'), ((2005, 2025), 'numpy.where', 'np.where', (['grid', '(0)', '(1)'], {}), '(grid, 0, 1)\n', (2013, 2025), True, 'import numpy as np\n'), ((3289, 3306), 'numpy.product', 'np.product... |
import os
import pytest
from molecule import config
from molecule.verifier import ansible
@pytest.fixture
def _patched_ansible_verify(mocker):
m = mocker.patch("molecule.provisioner.ansible.Ansible.verify")
m.return_value = "patched-ansible-verify-stdout"
return m
@pytest.fixture
def _verifier_sectio... | [
"pytest.mark.parametrize",
"molecule.verifier.ansible.Ansible"
] | [((1221, 1310), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""config_instance"""', "['_verifier_section_data']"], {'indirect': '(True)'}), "('config_instance', ['_verifier_section_data'],\n indirect=True)\n", (1244, 1310), False, 'import pytest\n'), ((1714, 1803), 'pytest.mark.parametrize', 'pytest.mar... |
import sys
from infi.instruct.base import Marshal, ReadOnlyContext, EMPTY_CONTEXT, MinMax, UNBOUNDED_MIN_MAX
from infi.instruct.numeric import UBInt8Marshal
from infi.instruct.string import PaddedStringMarshal, VarSizeBufferMarshal
from infi.instruct.struct import Struct
from infi.instruct.string_macros import VarSizeB... | [
"infi.instruct.string_macros.FixedSizeString",
"infi.instruct.ULInt8",
"infi.instruct.struct.pointer.ReadPointer",
"infi.instruct.string.PaddedStringMarshal",
"infi.instruct.string.VarSizeBufferMarshal",
"infi.instruct.base.MinMax"
] | [((516, 538), 'infi.instruct.string.PaddedStringMarshal', 'PaddedStringMarshal', (['(5)'], {}), '(5)\n', (535, 538), False, 'from infi.instruct.string import PaddedStringMarshal, VarSizeBufferMarshal\n'), ((691, 719), 'infi.instruct.string.PaddedStringMarshal', 'PaddedStringMarshal', (['(5)', "b'a'"], {}), "(5, b'a')\n... |
'''
Created on Jul 9, 2016
@author: slewis
'''
from osgiservicebridge.bridge import Py4jServiceBridge, _wait_for_sec, Py4jServiceBridgeEventListener
'''
This class implements the Py4jServiceBridgeEventListener interface
'''
class HelloServiceListener(Py4jServiceBridgeEventListener):
def service_imported(self, ser... | [
"osgiservicebridge.bridge._wait_for_sec"
] | [((2862, 2878), 'osgiservicebridge.bridge._wait_for_sec', '_wait_for_sec', (['(5)'], {}), '(5)\n', (2875, 2878), False, 'from osgiservicebridge.bridge import Py4jServiceBridge, _wait_for_sec, Py4jServiceBridgeEventListener\n')] |
#!/usr/bin/python3
#
# Copyright (c) 2019 - 2020, <NAME>, email: <EMAIL>
# All right reserved.
#
# This file is written and modified by <NAME>.
#
# This model is free software; you can redistribute it and/or modify it under the terms
# of the GNU Lesser General Public License; either version 2.1 of the License, or (at... | [
"logging.basicConfig",
"logging.getLogger",
"os.geteuid",
"math.log",
"socket.gethostbyaddr"
] | [((635, 758), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)-5s %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""', 'level': 'logging.DEBUG'}), "(format='%(asctime)s %(levelname)-5s %(message)s',\n datefmt='%Y-%m-%d %H:%M:%S', level=logging.DEBUG)\n", (654, 758), False,... |
#!/usr/bin/env python
# coding=utf-8
"""
Evaluation (t-tree comparison functions).
"""
from __future__ import unicode_literals
from __future__ import division
from builtins import zip
from builtins import range
from builtins import object
from past.utils import old_div
from collections import defaultdict
from enum im... | [
"tgen.logf.log_debug",
"numpy.mean",
"numpy.median",
"tgen.logf.log_warn",
"tgen.tree.TreeData.from_ttree",
"tgen.logf.log_info",
"past.utils.old_div",
"builtins.zip",
"collections.defaultdict",
"enum.Enum",
"numpy.percentile",
"tgen.tree.TreeNode"
] | [((640, 675), 'enum.Enum', 'Enum', (['"""EvalTypes"""', '"""TOKEN NODE DEP"""'], {}), "('EvalTypes', 'TOKEN NODE DEP')\n", (644, 675), False, 'from enum import Enum\n'), ((1305, 1321), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1316, 1321), False, 'from collections import defaultdict\n'), ((54... |
# File name: main.py
# Copyright 2017 <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
from flask import Flask, current_app, request, jsonify
imp... | [
"flask.Flask",
"io.BytesIO",
"base64.b64decode",
"flask.request.get_json",
"flask.current_app.logger.info",
"model.predict",
"flask.jsonify"
] | [((376, 391), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (381, 391), False, 'from flask import Flask, current_app, request, jsonify\n'), ((606, 628), 'base64.b64decode', 'base64.b64decode', (['data'], {}), '(data)\n', (622, 628), False, 'import base64\n'), ((642, 658), 'io.BytesIO', 'io.BytesIO', (['da... |
import pytest
from pytest_mock import MockerFixture
from pipert2.utils.dummy_object import Dummy
from tests.unit.pipert.core.utils.dummy_routines.dummy_destination_routine import DummyDestinationRoutine
MAX_TIMEOUT_WAITING = 3
@pytest.fixture()
def dummy_routine(mocker: MockerFixture):
dummy_routine = DummyDesti... | [
"pytest.fixture",
"pipert2.utils.dummy_object.Dummy",
"tests.unit.pipert.core.utils.dummy_routines.dummy_destination_routine.DummyDestinationRoutine"
] | [((231, 247), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (245, 247), False, 'import pytest\n'), ((310, 335), 'tests.unit.pipert.core.utils.dummy_routines.dummy_destination_routine.DummyDestinationRoutine', 'DummyDestinationRoutine', ([], {}), '()\n', (333, 335), False, 'from tests.unit.pipert.core.utils.dumm... |
from bs4 import BeautifulSoup
import pandas as pd
import requests
#returns product name from the page soup
def getName(soup):
productName = soup.find('span', class_="B_NuCI").text
return productName
#returns product price from the page soup
def getPrice(soup):
productPrice = soup.find('div'... | [
"bs4.BeautifulSoup",
"requests.get",
"pandas.read_csv"
] | [((1080, 1106), 'requests.get', 'requests.get', (['url', 'headers'], {}), '(url, headers)\n', (1092, 1106), False, 'import requests\n'), ((1148, 1189), 'bs4.BeautifulSoup', 'BeautifulSoup', (['htmlContent', '"""html.parser"""'], {}), "(htmlContent, 'html.parser')\n", (1161, 1189), False, 'from bs4 import BeautifulSoup\... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Train normalising flow.
Created: June 2021
Author: <NAME>
"""
import numpy as np
import sys
sys.path.append("../../src")
from constants import kpc
from ml import train_flow
from utils import get_rescaled_tensor
if __name__ == '__main__':
# load data
data =... | [
"numpy.array",
"ml.train_flow",
"sys.path.append"
] | [((145, 173), 'sys.path.append', 'sys.path.append', (['"""../../src"""'], {}), "('../../src')\n", (160, 173), False, 'import sys\n'), ((677, 724), 'ml.train_flow', 'train_flow', (['data', 'seed'], {'n_layers': '(8)', 'n_hidden': '(64)'}), '(data, seed, n_layers=8, n_hidden=64)\n', (687, 724), False, 'from ml import tra... |
import logging
import os
import posixpath
from django.conf import settings
from django.utils import timezone
from celery import shared_task, current_task
from .exporter import get_export_models, get_resource_for_model
logger = logging.getLogger(__name__)
@shared_task
def export(exporter_class, format='xlsx', **kwa... | [
"logging.getLogger",
"os.path.exists",
"posixpath.join",
"os.makedirs",
"os.path.join",
"django.utils.timezone.now",
"django.db.connection.set_tenant"
] | [((230, 257), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (247, 257), False, 'import logging\n'), ((1171, 1206), 'os.path.join', 'os.path.join', (['export_root', 'filename'], {}), '(export_root, filename)\n', (1183, 1206), False, 'import os\n'), ((2282, 2317), 'os.path.join', 'os.path.... |
'''
Created on Oct 23, 2017
@author: ronaldmaceachern
modules for methods to clean dirty .csv using a set of rules
'''
import re
import os
import numpy as np
import pandas as pd
from difflib import SequenceMatcher
def makeRowDf( x, desc_name = '', cols = None):
'''a wrapper function to make it neater to mak... | [
"numpy.mean",
"pandas.isnull",
"os.listdir",
"difflib.SequenceMatcher",
"re.match",
"numpy.array",
"numpy.isnan",
"numpy.concatenate",
"re.sub",
"pandas.concat",
"numpy.arange",
"re.search"
] | [((596, 608), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (605, 608), True, 'import numpy as np\n'), ((945, 972), 'numpy.concatenate', 'np.concatenate', (['out'], {'axis': '(0)'}), '(out, axis=0)\n', (959, 972), True, 'import numpy as np\n'), ((1013, 1033), 'numpy.mean', 'np.mean', (['out'], {'axis': '(0)'}), '(... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"random.shuffle",
"absl.app.run",
"random.seed",
"numpy.array",
"absl.flags.DEFINE_string"
] | [((904, 1098), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""input_dir"""', 'None', '"""Local input directory containing the mit-bih file that can be copied from /namespace/health-research/unencrypted/reference/user/milah/mit_bih/."""'], {}), "('input_dir', None,\n 'Local input directory containing the mi... |
#!/usr/bin/python
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
"unittest.main",
"gdata.test_config.build_suite"
] | [((6261, 6595), 'gdata.test_config.build_suite', 'conf.build_suite', (['[EmailSettingsLabelTest, EmailSettingsFilterTest,\n EmailSettingsSendAsAliasTest, EmailSettingsWebClipTest,\n EmailSettingsForwardingTest, EmailSettingsPopTest,\n EmailSettingsImapTest, EmailSettingsVacationResponderTest,\n EmailSetting... |
import tensorflow as tf
def attention(inputs):
# Trainable parameters
hidden_size = inputs.shape[2].value
u_omega = tf.get_variable("u_omega", [hidden_size], initializer=tf.keras.initializers.glorot_normal())
with tf.name_scope('v'):
v = tf.tanh(inputs)
# For each of the timestamps its v... | [
"tensorflow.tensordot",
"tensorflow.tanh",
"tensorflow.keras.initializers.glorot_normal",
"tensorflow.name_scope",
"tensorflow.nn.softmax",
"tensorflow.expand_dims"
] | [((381, 424), 'tensorflow.tensordot', 'tf.tensordot', (['v', 'u_omega'], {'axes': '(1)', 'name': '"""vu"""'}), "(v, u_omega, axes=1, name='vu')\n", (393, 424), True, 'import tensorflow as tf\n'), ((453, 485), 'tensorflow.nn.softmax', 'tf.nn.softmax', (['vu'], {'name': '"""alphas"""'}), "(vu, name='alphas')\n", (466, 48... |
#! /usr/bin/env python
"""
Module with pixel and frame subsampling functions.
"""
__author__ = '<NAME>, <NAME>'
__all__ = ['cube_collapse',
'cube_subsample',
'cube_subsample_trimmean']
import numpy as np
def cube_collapse(cube, mode='median', n=50, w=None):
""" Collapses a cube into a fra... | [
"numpy.nanmedian",
"numpy.sort",
"numpy.ndenumerate",
"numpy.nanmean",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.nanmax",
"numpy.empty_like",
"numpy.isnan",
"numpy.moveaxis",
"numpy.nansum"
] | [((5651, 5676), 'numpy.empty', 'np.empty', (['[num + 2, y, x]'], {}), '([num + 2, y, x])\n', (5659, 5676), True, 'import numpy as np\n'), ((1652, 1675), 'numpy.nanmean', 'np.nanmean', (['arr'], {'axis': '(0)'}), '(arr, axis=0)\n', (1662, 1675), True, 'import numpy as np\n'), ((3560, 3579), 'numpy.empty', 'np.empty', ([... |
"""Implement the PathFinder negotiated congestion router."""
import heapq
import networkx as nx
class PriorityQueue:
def __init__(self, items=None):
self.items = []
self._itemset = set()
self._counter = 0
if items is not None:
for item in items:
... | [
"networkx.dijkstra_path",
"heapq.heappush",
"heapq.heappop"
] | [((604, 663), 'heapq.heappush', 'heapq.heappush', (['self.items', '(priority, self._counter, item)'], {}), '(self.items, (priority, self._counter, item))\n', (618, 663), False, 'import heapq\n'), ((784, 809), 'heapq.heappop', 'heapq.heappop', (['self.items'], {}), '(self.items)\n', (797, 809), False, 'import heapq\n'),... |
import unittest
from DataStructures.PrimeCurves import PrimeCurves
from DataStructures.Points import AffinePoint
from FastArithmetic.scalar_multiplication import ScalarMultiplication
class ScalarMultiplicationTest(unittest.TestCase):
def test_binary_scalar_multiplication(self):
curve, instance, scalar, e... | [
"unittest.main",
"FastArithmetic.scalar_multiplication.ScalarMultiplication",
"DataStructures.Points.AffinePoint",
"DataStructures.PrimeCurves.PrimeCurves"
] | [((1954, 1969), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1967, 1969), False, 'import unittest\n'), ((1674, 1695), 'DataStructures.PrimeCurves.PrimeCurves', 'PrimeCurves', (['(97)', '(3)', '(2)'], {}), '(97, 3, 2)\n', (1685, 1695), False, 'from DataStructures.PrimeCurves import PrimeCurves\n'), ((1713, 1741)... |
from __future__ import annotations
from typing import Union
import pandas as pd
import pytest
from pandas._testing import assert_frame_equal
from sklearn.base import BaseEstimator, TransformerMixin
from hcl_model.transformers.feature_union import make_union_of_datetime_indexed_features
class TransformerForTests(Ba... | [
"pandas.Index",
"pytest.raises",
"pandas.date_range",
"pandas.DataFrame",
"hcl_model.transformers.feature_union.make_union_of_datetime_indexed_features"
] | [((786, 830), 'pandas.date_range', 'pd.date_range', ([], {'start': '"""2021-01-01"""', 'periods': '(4)'}), "(start='2021-01-01', periods=4)\n", (799, 830), True, 'import pandas as pd\n'), ((840, 911), 'pandas.DataFrame', 'pd.DataFrame', (["{'a': [1, 3, 6, 9], 'b': [2, 5, 7, 10]}"], {'index': 'date_index'}), "({'a': [1,... |
# Generated by Django 2.2.6 on 2019-10-25 16:41
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('data_driven_acquisition', '0002_auto_20191024_1437'),
]
oper... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((1558, 1628), 'django.db.models.URLField', 'models.URLField', ([], {'blank': '(True)', 'help_text': '"""Trello project URL"""', 'null': '(True)'}), "(blank=True, help_text='Trello project URL', null=True)\n", (1573, 1628), False, 'from django.db import migrations, models\n'), ((443, 536), 'django.db.models.AutoField'... |
from collections import defaultdict
def read_input():
file = open('input/2017/day18-input.txt', 'r')
return parse_input(file.readlines())
def parse_input(data):
instructions = []
for line in data:
line = line.strip().split(" ")
command = line[0]
x = line[1]
if comma... | [
"collections.defaultdict"
] | [((1004, 1020), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1015, 1020), False, 'from collections import defaultdict\n'), ((2115, 2131), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (2126, 2131), False, 'from collections import defaultdict\n'), ((2133, 2149), 'collections... |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import asyncio
from key_vault_secrets_async import KeyVaultSecrets
from key_vault_keys_async import KeyVaultKeys
from key_vault_certificates_async import KeyVaultCertifi... | [
"key_vault_secrets_async.KeyVaultSecrets",
"event_hubs_async.EventHub",
"key_vault_keys_async.KeyVaultKeys",
"key_vault_certificates_async.KeyVaultCertificates",
"asyncio.get_event_loop"
] | [((687, 711), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (709, 711), False, 'import asyncio\n'), ((557, 574), 'key_vault_secrets_async.KeyVaultSecrets', 'KeyVaultSecrets', ([], {}), '()\n', (572, 574), False, 'from key_vault_secrets_async import KeyVaultSecrets\n'), ((591, 605), 'key_vault_ke... |
from flask import render_template, redirect, url_for, request
from flask_login import login_required, current_user
from flask_wtf import FlaskForm
from flask_mobility.decorators import mobile_template
from wtforms import StringField, PasswordField, BooleanField
from wtforms.validators import InputRequired, Email, Len... | [
"flask.render_template",
"app.components.file_management.GET_LOGFILE_SYSTEM",
"flask.request.form.getlist",
"wtforms.BooleanField",
"app.components.backend_led.CHECK_LED_GROUP_SETTING_PROCESS",
"app.components.mqtt.CHECK_ZIGBEE2MQTT_SETTING_PROCESS",
"functools.wraps",
"flask.request.form.get",
"fla... | [((1543, 1591), 'app.app.route', 'app.route', (['"""/dashboard"""'], {'methods': "['GET', 'POST']"}), "('/dashboard', methods=['GET', 'POST'])\n", (1552, 1591), False, 'from app import app\n'), ((1593, 1635), 'flask_mobility.decorators.mobile_template', 'mobile_template', (['"""{mobile/}dashboard.html"""'], {}), "('{mo... |
import json
import pathlib
import urllib3
import dash
from dash.dependencies import Input, Output, State, ALL, ClientsideFunction
from dash.exceptions import PreventUpdate
from dash.dash import no_update
import dash_html_components as html
import dash_bootstrap_components as dbc
from flask import flash, get_flashed_m... | [
"preprocessing.prepare_scalars",
"data.dev.get_dummy_data",
"preprocessing.extract_colors",
"flask.get_flashed_messages",
"dash.dependencies.Input",
"preprocessing.extract_filters",
"graphs.get_empty_fig",
"models.Colors",
"layout.get_error_and_warnings_div",
"dash.dependencies.ClientsideFunction"... | [((678, 704), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (702, 704), False, 'import urllib3\n'), ((786, 945), 'dash.Dash', 'dash.Dash', (['__name__'], {'meta_tags': "[{'name': 'viewport', 'content': 'width=device-width, initial-scale=4.0'}]", 'external_stylesheets': '[dbc.themes.BOOTSTRAP... |
import operator
import numpy as np
import bitpacking.packing as pk
from boolnet.utils import PackedMatrix
FUNCTIONS = {
'add': operator.add,
'sub': operator.sub,
'mul': operator.mul,
'div': operator.floordiv,
'mod': operator.mod,
}
def to_binary(value, num_bits):
# little-endian
ret... | [
"numpy.savez",
"numpy.binary_repr",
"numpy.split",
"bitpacking.packing.packmat",
"numpy.load",
"boolnet.utils.PackedMatrix"
] | [((826, 851), 'numpy.split', 'np.split', (['M', '[Ni]'], {'axis': '(1)'}), '(M, [Ni], axis=1)\n', (834, 851), True, 'import numpy as np\n'), ((1374, 1419), 'numpy.savez', 'np.savez', (['outfile'], {'matrix': 'Mp', 'Ni': 'Ni', 'Ne': 'Mp.Ne'}), '(outfile, matrix=Mp, Ni=Ni, Ne=Mp.Ne)\n', (1382, 1419), True, 'import numpy ... |
import xml.etree.ElementTree as ET
from connector import connect_paths
from itermore import pairwise
### Kartverket XML data
# metadata
#http://sosi.geonorge.no/Produktspesifikasjoner/Produktspesifikasjon_Kartverket_N50Kartdata_versjon20170401.pdf
#https://kartkatalog.geonorge.no/metadata/kartverket/n5000-kartdata/c7... | [
"connector.connect_paths",
"xml.etree.ElementTree.parse"
] | [((1122, 1141), 'xml.etree.ElementTree.parse', 'ET.parse', (['area_file'], {}), '(area_file)\n', (1130, 1141), True, 'import xml.etree.ElementTree as ET\n'), ((1187, 1206), 'xml.etree.ElementTree.parse', 'ET.parse', (['admt_file'], {}), '(admt_file)\n', (1195, 1206), True, 'import xml.etree.ElementTree as ET\n'), ((164... |
import unittest
class TestMisc(unittest.TestCase):
def test_pypi_api(self):
from dl_coursera.lib.misc import get_latest_app_version
ver = get_latest_app_version()
self.assertRegex(ver, r'\d+\.\d+\.\d+')
| [
"dl_coursera.lib.misc.get_latest_app_version"
] | [((160, 184), 'dl_coursera.lib.misc.get_latest_app_version', 'get_latest_app_version', ([], {}), '()\n', (182, 184), False, 'from dl_coursera.lib.misc import get_latest_app_version\n')] |
# coding: utf-8
import json
class StixCyberObservable:
def __init__(self, opencti, file):
self.opencti = opencti
self.file = file
self.properties = """
id
standard_id
entity_type
parent_types
spec_version
created_at
... | [
"json.dumps"
] | [((8453, 8472), 'json.dumps', 'json.dumps', (['filters'], {}), '(filters)\n', (8463, 8472), False, 'import json\n')] |
import torch
import load_data
import random
import numpy as np
from HSCNN_model import HSCNN_network
from HSCNN_train import train
from HSCNN_classifier import predict,get_compare
random.seed(1234)
np.random.seed(1234)
torch.cuda.manual_seed(1234)
torch.backends.cudnn.deterministic = True
print('load data.............. | [
"HSCNN_model.HSCNN_network",
"HSCNN_classifier.get_compare",
"torch.load",
"random.seed",
"HSCNN_classifier.predict",
"load_data.load_pairs",
"torch.cuda.is_available",
"numpy.random.seed",
"HSCNN_train.train",
"torch.cuda.manual_seed"
] | [((181, 198), 'random.seed', 'random.seed', (['(1234)'], {}), '(1234)\n', (192, 198), False, 'import random\n'), ((199, 219), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (213, 219), True, 'import numpy as np\n'), ((220, 248), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['(1234)'], {}),... |
from os import system
while True:
system("cls")
print("1 - Suma")
print("2 - Resta")
print("3 - Multiplicacion")
print("4 - Division")
print("0 - Salir")
opcion = int(input("Ingrese una opcion: "))
if opcion == 1:
a = int(input("Ingrese a: "))
b = int(input("Ingrese b: ... | [
"os.system"
] | [((39, 52), 'os.system', 'system', (['"""cls"""'], {}), "('cls')\n", (45, 52), False, 'from os import system\n'), ((390, 412), 'os.system', 'system', (['"""pause > null"""'], {}), "('pause > null')\n", (396, 412), False, 'from os import system\n'), ((579, 601), 'os.system', 'system', (['"""pause > null"""'], {}), "('pa... |
from __future__ import absolute_import
import argparse
import collections
import gc
import json
import os
from datetime import datetime
import numpy as np
from catalyst.dl import SupervisedRunner, OptimizerCallback, SchedulerCallback
from catalyst.utils import load_checkpoint, unpack_checkpoint
from pytorch_toolbelt.... | [
"pytorch_toolbelt.utils.catalyst.HyperParametersCallback",
"pytorch_toolbelt.utils.fs.auto_file",
"catalyst.dl.SchedulerCallback",
"argparse.ArgumentParser",
"json.dumps",
"catalyst.dl.OptimizerCallback",
"pytorch_toolbelt.utils.catalyst.report_checkpoint",
"catalyst.dl.SupervisedRunner",
"collectio... | [((857, 882), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (880, 882), False, 'import argparse\n'), ((4705, 4731), 'pytorch_toolbelt.utils.random.set_manual_seed', 'set_manual_seed', (['args.seed'], {}), '(args.seed)\n', (4720, 4731), False, 'from pytorch_toolbelt.utils.random import set_manu... |
from docutils import nodes
from os.path import sep
from matplotlib import rcParamsDefault
def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
rendered = nodes.Text(f'rcParams["{text}"]')
source = inliner.document.attributes['source'].replace(sep, '/')
rel_source = source.split... | [
"docutils.nodes.Text",
"docutils.nodes.literal",
"docutils.nodes.reference"
] | [((187, 220), 'docutils.nodes.Text', 'nodes.Text', (['f"""rcParams["{text}"]"""'], {}), '(f\'rcParams["{text}"]\')\n', (197, 220), False, 'from docutils import nodes\n'), ((535, 584), 'docutils.nodes.reference', 'nodes.reference', (['rawtext', 'rendered'], {'refuri': 'refuri'}), '(rawtext, rendered, refuri=refuri)\n', ... |
# Copyright 2018 Sysdig
#
# 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 writ... | [
"sdc.sdc_method_delete.delete_policies",
"sdc.sdc_extend.SdMonitorClient",
"sdc.sdc_method_delete.delete_user",
"sdc.sdc_extend.SdSecureClient",
"sdc.sdc_method_delete.delete_dashboards",
"sdc.sdc_config.load_config_env"
] | [((927, 963), 'sdc.sdc_config.load_config_env', 'load_config_env', (['args.file', 'args.env'], {}), '(args.file, args.env)\n', (942, 963), False, 'from sdc.sdc_config import load_config_env\n'), ((1107, 1154), 'sdc.sdc_extend.SdMonitorClient', 'SdMonitorClient', (["config['token']", "config['url']"], {}), "(config['tok... |
import numpy as np
import scipy.sparse as sparse
from scipy.sparse import linalg
import pandas as pd
# global variables
#This will change the initial condition used. Currently it starts from the first# value
shift_k = 0
approx_res_size = 5000
model_params = {'tau': 0.25,
'nstep': 1000,
... | [
"numpy.abs",
"scipy.sparse.rand",
"numpy.random.rand",
"numpy.floor",
"numpy.asarray",
"numpy.linalg.eigvals",
"numpy.zeros",
"numpy.linalg.inv",
"numpy.dot",
"numpy.random.seed",
"numpy.shape",
"scipy.sparse.identity",
"numpy.mod"
] | [((898, 918), 'numpy.linalg.eigvals', 'np.linalg.eigvals', (['A'], {}), '(A)\n', (915, 918), True, 'import numpy as np\n'), ((1046, 1101), 'numpy.zeros', 'np.zeros', (["(res_params['N'], res_params['train_length'])"], {}), "((res_params['N'], res_params['train_length']))\n", (1054, 1101), True, 'import numpy as np\n'),... |
import time
import random
import pygame
from shield import Shield
from explosion import Explosion
from meteor import Meteor
from ship import Ship
from bonus import Bonus
from const import *
from bullet import Bullet
import sys
pygame.init()
window = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
bg... | [
"bullet.Bullet",
"pygame.init",
"pygame.quit",
"sys.exit",
"pygame.font.Font",
"pygame.transform.scale",
"pygame.time.get_ticks",
"pygame.display.set_mode",
"pygame.mixer.Sound",
"pygame.draw.rect",
"shield.Shield",
"pygame.image.load",
"pygame.display.update",
"pygame.Rect",
"explosion.... | [((238, 251), 'pygame.init', 'pygame.init', ([], {}), '()\n', (249, 251), False, 'import pygame\n'), ((262, 316), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(SCREEN_WIDTH, SCREEN_HEIGHT)'], {}), '((SCREEN_WIDTH, SCREEN_HEIGHT))\n', (285, 316), False, 'import pygame\n'), ((785, 823), 'pygame.mixer.Sound', ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------
# Copyright The IETF Trust 2011-2022, All Rights Reserved
# -------------------------------------------------------
import os
from codecs import open
from setuptools import setup
import sys
# This workaround is nece... | [
"os.path.join",
"os.path.dirname",
"setuptools.setup"
] | [((1000, 2317), 'setuptools.setup', 'setup', ([], {'name': '"""xml2rfc"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'maintainer': '"""<NAME>"""', 'maintainer_email': '"""<EMAIL>"""', 'url': '"""https://tools.ietf.org/tools/xml2rfc/trac/"""', 'description': 'description', 'long_description': 'long_des... |
import gym
import unittest
import numpy as np
from connect_four.envs.connect_four_env import ConnectFourEnv
from connect_four.evaluation.incremental_victor.graph.graph_manager import GraphManager
from connect_four.evaluation.incremental_victor.solution.victor_solution_manager import VictorSolutionManager
from connect... | [
"connect_four.evaluation.incremental_victor.graph.graph_manager.GraphManager",
"connect_four.evaluation.incremental_victor.solution.victor_solution_manager.VictorSolutionManager",
"numpy.array",
"connect_four.problem.ConnectFourGroupManager",
"unittest.main",
"unittest.skip",
"gym.make"
] | [((368, 395), 'unittest.skip', 'unittest.skip', (['"""deprecated"""'], {}), "('deprecated')\n", (381, 395), False, 'import unittest\n'), ((1393, 1408), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1406, 1408), False, 'import unittest\n'), ((490, 517), 'gym.make', 'gym.make', (['"""connect_four-v0"""'], {}), "('... |
# -*- coding: utf-8 -*-
# Copyright 2021 CERN
#
# 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... | [
"rucio.tests.ruciopytest.rucioxdist.NoParallelXDist",
"pytest.UsageError",
"os.environ.get"
] | [((1906, 1942), 'os.environ.get', 'os.environ.get', (['"""GITHUB_ACTIONS"""', '""""""'], {}), "('GITHUB_ACTIONS', '')\n", (1920, 1942), False, 'import os\n'), ((1171, 1194), 'rucio.tests.ruciopytest.rucioxdist.NoParallelXDist', 'NoParallelXDist', (['config'], {}), '(config)\n', (1186, 1194), False, 'from rucio.tests.ru... |
'''import math
ang = float(input('Qual o ângulo?'))
print('Cosseno vale {}'.format(math.cos(math.radians(ang))))
print('Seno vale {}'.format(math.sin(math.radians(ang))))
print('Tangente vale {}'.format(math.tan(math.radians(ang))))'''
# ângulo está em grau, tem que converter para radianos com math.radians()
from mat... | [
"math.radians"
] | [((428, 440), 'math.radians', 'radians', (['ang'], {}), '(ang)\n', (435, 440), False, 'from math import cos, sin, tan, radians\n'), ((480, 492), 'math.radians', 'radians', (['ang'], {}), '(ang)\n', (487, 492), False, 'from math import cos, sin, tan, radians\n'), ((536, 548), 'math.radians', 'radians', (['ang'], {}), '(... |
from typing import Callable, List, Optional, TYPE_CHECKING, Union
import warnings
from catalyst.core.callback import Callback, CallbackOrder
from catalyst.utils.pruning import get_pruning_fn, prune_model, remove_reparametrization
if TYPE_CHECKING:
from catalyst.core.runner import IRunner
class PruningCallback(C... | [
"catalyst.utils.pruning.get_pruning_fn",
"warnings.warn",
"catalyst.utils.pruning.prune_model",
"catalyst.utils.pruning.remove_reparametrization"
] | [((2293, 2354), 'catalyst.utils.pruning.get_pruning_fn', 'get_pruning_fn', ([], {'pruning_fn': 'pruning_fn', 'dim': 'dim', 'l_norm': 'l_norm'}), '(pruning_fn=pruning_fn, dim=dim, l_norm=l_norm)\n', (2307, 2354), False, 'from catalyst.utils.pruning import get_pruning_fn, prune_model, remove_reparametrization\n'), ((2605... |
from cv2 import cv2
import tello
import time
import numpy as np
drone = tello.Tello('', 8889)
time.sleep(10)
chase_count = 0
chase_image_list = []
chase_corner_list = []
objp = np.zeros((9*6, 3), np.float32)
objp[:,:2] = np.mgrid[0:9,0:6].T.reshape(-1,2)
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, ... | [
"tello.Tello",
"cv2.cv2.findChessboardCorners",
"cv2.cv2.waitKey",
"time.sleep",
"cv2.cv2.calibrateCamera",
"numpy.zeros",
"cv2.cv2.FileStorage",
"cv2.cv2.cvtColor",
"cv2.cv2.cornerSubPix",
"cv2.cv2.imshow"
] | [((73, 94), 'tello.Tello', 'tello.Tello', (['""""""', '(8889)'], {}), "('', 8889)\n", (84, 94), False, 'import tello\n'), ((95, 109), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (105, 109), False, 'import time\n'), ((178, 210), 'numpy.zeros', 'np.zeros', (['(9 * 6, 3)', 'np.float32'], {}), '((9 * 6, 3), np.fl... |
import logging
import os
from logging.handlers import RotatingFileHandler
LOGGER_NAME = "connexion_example"
def create_log():
if not os.path.exists("./logs"):
os.makedirs("./logs")
logger = logging.getLogger(LOGGER_NAME)
logger.setLevel(logging.DEBUG)
handler_local = RotatingFileHandler(
... | [
"logging.getLogger",
"os.path.exists",
"logging.handlers.RotatingFileHandler",
"os.makedirs"
] | [((210, 240), 'logging.getLogger', 'logging.getLogger', (['LOGGER_NAME'], {}), '(LOGGER_NAME)\n', (227, 240), False, 'import logging\n'), ((297, 391), 'logging.handlers.RotatingFileHandler', 'RotatingFileHandler', (['f"""./logs/{LOGGER_NAME}.log"""'], {'mode': '"""a"""', 'maxBytes': '(50000)', 'backupCount': '(10)'}), ... |
from customers.views import CustomerViewSet
from rest_framework.routers import DefaultRouter
app_name = 'customers'
router = DefaultRouter()
router.register(r'customers', CustomerViewSet, basename='customer')
urlpatterns = router.urls
| [
"rest_framework.routers.DefaultRouter"
] | [((127, 142), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (140, 142), False, 'from rest_framework.routers import DefaultRouter\n')] |
import os, sys
import argparse
import numpy as np
import cv2
from skimage import filters
from linefiller.thinning import thinning
from linefiller.trappedball_fill import trapped_ball_fill_multi, flood_fill_multi, mark_fill, build_fill_map, merge_fill, \
show_fill_map, my_merge_fill
def dline_of(x, low_thr=1, h... | [
"numpy.clip",
"linefiller.trappedball_fill.trapped_ball_fill_multi",
"numpy.argsort",
"numpy.save",
"linefiller.trappedball_fill.flood_fill_multi",
"os.path.exists",
"cv2.Laplacian",
"os.listdir",
"linefiller.thinning.thinning",
"argparse.ArgumentParser",
"linefiller.trappedball_fill.mark_fill",... | [((362, 382), 'cv2.medianBlur', 'cv2.medianBlur', (['x', '(5)'], {}), '(x, 5)\n', (376, 382), False, 'import cv2\n'), ((450, 508), 'cv2.bilateralFilter', 'cv2.bilateralFilter', (['x', 'bf_args[0]', 'bf_args[1]', 'bf_args[2]'], {}), '(x, bf_args[0], bf_args[1], bf_args[2])\n', (469, 508), False, 'import cv2\n'), ((566, ... |
import os.path
import re
from shutil import copyfile
from django.apps import apps
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def get_folders(self):
rdmo_core = os.path.join(apps.get_app_config('rdmo').path, 'core')
rdmo_app_theme = os.path.join(os.getcwd(), '... | [
"shutil.copyfile",
"django.apps.apps.get_app_config",
"re.search"
] | [((953, 987), 'shutil.copyfile', 'copyfile', (['source_file', 'target_file'], {}), '(source_file, target_file)\n', (961, 987), False, 'from shutil import copyfile\n'), ((226, 253), 'django.apps.apps.get_app_config', 'apps.get_app_config', (['"""rdmo"""'], {}), "('rdmo')\n", (245, 253), False, 'from django.apps import a... |
#! /usr/bin/env python
"""Graph server.
From the command-line it's easier to use sshgraphserver.py instead of this.
"""
from __future__ import print_function, absolute_import
import os, sys
PARENTDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# make dotviewer importable
sys.path.insert(0, PARENT... | [
"dotviewer.graphdisplay.GraphDisplay",
"dotviewer.drawgraph.display_async_cmd",
"sys.path.insert",
"socket.socket",
"dotviewer.drawgraph.display_async_quit",
"graphclient.spawn_local_handler",
"traceback.print_exc",
"dotviewer.msgstruct.SocketIO",
"sys.exit",
"os.path.abspath",
"io.StringIO",
... | [((295, 324), 'sys.path.insert', 'sys.path.insert', (['(0)', 'PARENTDIR'], {}), '(0, PARENTDIR)\n', (310, 324), False, 'import os, sys\n'), ((238, 263), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (253, 263), False, 'import os, sys\n'), ((3427, 3456), 'dotviewer.drawgraph.display_async_cmd... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"rally.plugins.openstack.scenarios.cinder.volume_backups.CreateIncrementalVolumeBackup",
"mock.MagicMock"
] | [((836, 852), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (850, 852), False, 'import mock\n'), ((875, 891), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (889, 891), False, 'import mock\n'), ((911, 969), 'rally.plugins.openstack.scenarios.cinder.volume_backups.CreateIncrementalVolumeBackup', 'volume_b... |
from database import Database
import pymongo
#nome de variavel = sql, query, database
#import mysql, database
#string = "insert into", "select * from", "update from", "delete from"
#dao no Nome Da Classe
#dao no nome do arquivo
class DAOAnimal:
def __init__(self):
self.database = Database()
def... | [
"database.Database"
] | [((297, 307), 'database.Database', 'Database', ([], {}), '()\n', (305, 307), False, 'from database import Database\n')] |
'''Module for representing how to work with TweetAnalyser'''
from abstract_data_type import TweetAnalyser
analyser = TweetAnalyser('Hometasks/examples/TWEET_METADATA.json')
# collecting all retweets
analyser.collect_retweet(original=False, there=False)
# managing what parameters of tweet we will keep
analyser... | [
"abstract_data_type.TweetAnalyser"
] | [((123, 178), 'abstract_data_type.TweetAnalyser', 'TweetAnalyser', (['"""Hometasks/examples/TWEET_METADATA.json"""'], {}), "('Hometasks/examples/TWEET_METADATA.json')\n", (136, 178), False, 'from abstract_data_type import TweetAnalyser\n')] |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'signIn.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from res import signUp, status
import pipeline as pipe
from PyQt5.QtWidgets import ... | [
"pipeline.db.changeCollection",
"PyQt5.QtWidgets.QMessageBox.question",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QSizePolicy",
"res.signUp.Ui_Form",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QGroupBox",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QWidget",... | [((6141, 6173), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (6163, 6173), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((6185, 6204), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', ([], {}), '()\n', (6202, 6204), False, 'from PyQt5 import QtCore, QtGui, QtWi... |
import serial, time
arduino = serial.Serial('COM3', 9600, timeout = .1)
time.sleep(1)
while True:
data = arduino.readline()[:-2]
if data == "photo_prod" or data == "rept_photo":
#send a "take a photo" order
# send a string with the name of the product
arduino.write ();
| [
"serial.Serial",
"time.sleep"
] | [((33, 73), 'serial.Serial', 'serial.Serial', (['"""COM3"""', '(9600)'], {'timeout': '(0.1)'}), "('COM3', 9600, timeout=0.1)\n", (46, 73), False, 'import serial, time\n'), ((76, 89), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (86, 89), False, 'import serial, time\n')] |
from flask import Flask, request, redirect, render_template, url_for
from matplotlib.pyplot import xlim
import yfinance as yf
import requests
from bs4 import BeautifulSoup
import pandas as pd
import json
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from df2gspread import df... | [
"flask.render_template",
"flask.request.args.get",
"gspread.authorize",
"flask.Flask",
"requests.get",
"df2gspread.df2gspread.upload",
"bs4.BeautifulSoup",
"oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"pandas.DataFrame",
"yfinance.Ticker"
] | [((345, 360), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (350, 360), False, 'from flask import Flask, request, redirect, render_template, url_for\n'), ((986, 1015), 'flask.request.args.get', 'request.args.get', (['"""symbol"""', 'x'], {}), "('symbol', x)\n", (1002, 1015), False, 'from flask import Flas... |
from operator import le
import tkinter as tr
from tkinter import messagebox
default_font = "Arial Rounded MT"
font_size = 12
button_color = "white"
root = tr.Tk()
root.title("BMI Calculator")
def Calculate():
try:
weight = float(entry_weight.get())
height = float(entry_height.get())... | [
"tkinter.messagebox.showwarning",
"tkinter.Entry",
"tkinter.Button",
"tkinter.Tk",
"tkinter.Label"
] | [((165, 172), 'tkinter.Tk', 'tr.Tk', ([], {}), '()\n', (170, 172), True, 'import tkinter as tr\n'), ((906, 942), 'tkinter.Label', 'tr.Label', (['root'], {'text': '"""Weight (KG): """'}), "(root, text='Weight (KG): ')\n", (914, 942), True, 'import tkinter as tr\n'), ((995, 1009), 'tkinter.Entry', 'tr.Entry', (['root'], ... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="eeg-sleep-analysis",
version="1.1.4",
author="<NAME>",
author_email="<EMAIL>",
description="Package to analyze EEG-scored sleep",
long_description=long_description,
long_descriptio... | [
"setuptools.setup"
] | [((88, 735), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""eeg-sleep-analysis"""', 'version': '"""1.1.4"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""Package to analyze EEG-scored sleep"""', 'long_description': 'long_description', 'long_description_content_type': '"""tex... |
# Copyright 2015 Cisco Systems, 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 requi... | [
"networking_cisco.plugins.ml2.drivers.cisco.n1kv.n1kv_db.get_network_profile_by_network",
"neutron.db.api.get_session",
"eventlet.sleep",
"hashlib.md5",
"networking_cisco.plugins.ml2.drivers.cisco.n1kv.n1kv_db.get_policy_binding",
"networking_cisco.plugins.ml2.drivers.cisco.n1kv.n1kv_db.get_network_bindin... | [((1285, 1308), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (1298, 1308), False, 'from oslo_log import log\n'), ((1569, 1589), 'networking_cisco.plugins.ml2.drivers.cisco.n1kv.n1kv_client.Client', 'n1kv_client.Client', ([], {}), '()\n', (1587, 1589), False, 'from networking_cisco.plug... |
import pytest
import csv
def get_data():
with open('test.csv') as f:
lst = csv.reader(f)
my_data = []
for row in lst:
my_data.extend(row)
return my_data
@pytest.mark.parametrize('name',get_data())
def test01(name):
print(name)
if __name__ == '__main__':
#print(... | [
"csv.reader",
"pytest.main"
] | [((336, 371), 'pytest.main', 'pytest.main', (["['-sv', 'test_csv.py']"], {}), "(['-sv', 'test_csv.py'])\n", (347, 371), False, 'import pytest\n'), ((88, 101), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (98, 101), False, 'import csv\n')] |
import argparse
import os
import sys
import torch
import rdkit
from dglt.multi_gpu_wrapper import MultiGpuWrapper as mgw
from dglt.contrib.moses.moses.script_utils import add_train_args, read_smiles_csv, set_seed, preprocess_config
from dglt.contrib.moses.moses.models_storage import ModelsStorage
lg = rdkit.RDLogger.... | [
"dglt.contrib.moses.moses.script_utils.read_smiles_csv",
"os.path.exists",
"argparse.ArgumentParser",
"dglt.contrib.moses.moses.models_storage.ModelsStorage",
"torch.load",
"dglt.multi_gpu_wrapper.MultiGpuWrapper.local_rank",
"rdkit.RDLogger.logger",
"dglt.contrib.moses.moses.script_utils.set_seed",
... | [((305, 328), 'rdkit.RDLogger.logger', 'rdkit.RDLogger.logger', ([], {}), '()\n', (326, 328), False, 'import rdkit\n'), ((376, 391), 'dglt.contrib.moses.moses.models_storage.ModelsStorage', 'ModelsStorage', ([], {}), '()\n', (389, 391), False, 'from dglt.contrib.moses.moses.models_storage import ModelsStorage\n'), ((42... |
# Generated by Django 3.1.1 on 2020-10-16 23:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('BlogApp', '0015_auto_20201017_0012'),
]
operations = [
migrations.AlterField(
mod... | [
"django.db.models.ForeignKey"
] | [((385, 495), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""BlogApp.reply"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='BlogApp.reply')\n", (402, 495), False, 'from djang... |
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/main', methods=['POST'])
def query_main():
return render_template('main.html');
@app.route('/login', methods=['POST'])
def query_login():
return render_template('login.html');
@app.route('/disclaimer', methods=['POST'])
def... | [
"flask.render_template",
"flask.Flask"
] | [((57, 72), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (62, 72), False, 'from flask import Flask, request, render_template\n'), ((141, 169), 'flask.render_template', 'render_template', (['"""main.html"""'], {}), "('main.html')\n", (156, 169), False, 'from flask import Flask, request, render_template\n'... |
import base64
import json
import logging
from typing import (
Union,
)
import uuid
import attr
from botocore.exceptions import (
ClientError,
)
from azul.service import (
AbstractService,
)
from azul.service.step_function_helper import (
StateMachineError,
StepFunctionHelper,
)
from azul.types imp... | [
"logging.getLogger",
"json.loads",
"attr.s",
"base64.urlsafe_b64decode",
"json.dumps",
"azul.service.step_function_helper.StepFunctionHelper",
"azul.service.step_function_helper.StateMachineError",
"uuid.uuid4",
"attr.evolve",
"attr.asdict"
] | [((348, 375), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (365, 375), False, 'import logging\n'), ((498, 550), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'auto_attribs': '(True)', 'kw_only': '(True)'}), '(frozen=True, auto_attribs=True, kw_only=True)\n', (504, 550), False, 'import a... |
""" Defines the Plot class.
"""
# Major library imports
import itertools
import warnings
import six
import six.moves as sm
from numpy import arange, array, ndarray, linspace
from types import FunctionType
# Enthought library imports
from traits.api import Delegate, Dict, Instance, Int, List, Property, Str
# Local, r... | [
"itertools.chain",
"traits.api.Instance",
"traits.api.Property",
"traits.api.Delegate",
"six.itervalues",
"traits.api.Dict",
"numpy.array",
"numpy.linspace",
"chaco.ui.plot_window.PlotWindow",
"traits.api.Int",
"warnings.warn",
"six.moves.map",
"numpy.arange",
"traits.api.List"
] | [((3361, 3387), 'traits.api.Instance', 'Instance', (['AbstractPlotData'], {}), '(AbstractPlotData)\n', (3369, 3387), False, 'from traits.api import Delegate, Dict, Instance, Int, List, Property, Str\n'), ((3783, 3798), 'traits.api.Dict', 'Dict', (['Str', 'List'], {}), '(Str, List)\n', (3787, 3798), False, 'from traits.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 15 juil. 2014
@author: darius
"""
from __future__ import unicode_literals
import logging
import os
from django.template.loader import get_template
from django.template.context import RequestContext
from django.http.request import HttpRequest
from django.temp... | [
"logging.getLogger",
"django.http.request.HttpRequest",
"os.getcwd",
"optparse.make_option",
"django.template.context.RequestContext"
] | [((367, 394), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (384, 394), False, 'import logging\n'), ((650, 779), 'optparse.make_option', 'make_option', (['"""-o"""', '"""--output"""'], {'action': '"""store"""', 'dest': '"""output"""', 'default': 'None', 'help': '"""dossier de destination... |
# Created by <NAME> (<EMAIL>)
import numpy as np
from collections import namedtuple
def zeros(system, size):
"""
Create an all zeros trajectory.
Parameters
----------
system : System
System for trajectory
size : int
Size of trajectory
"""
obs = np.zeros((size, system.... | [
"collections.namedtuple",
"numpy.zeros",
"numpy.array_equal",
"numpy.empty",
"numpy.concatenate"
] | [((1450, 1484), 'collections.namedtuple', 'namedtuple', (['"""TimeStep"""', '"""obs ctrl"""'], {}), "('TimeStep', 'obs ctrl')\n", (1460, 1484), False, 'from collections import namedtuple\n'), ((297, 329), 'numpy.zeros', 'np.zeros', (['(size, system.obs_dim)'], {}), '((size, system.obs_dim))\n', (305, 329), True, 'impor... |
# Generated by Django 3.1.6 on 2021-02-17 11:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | [
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DecimalField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((445, 496), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'... |
import logging
import os
import math
import glob
import pyfastaq
import pysam
import pandas as pd
from Bio import pairwise2, SeqIO
from cluster_vcf_records import vcf_clusterer, vcf_file_read
from minos import dependencies, dnadiff, plots, utils
class Error (Exception): pass
class DnadiffMappingBasedVerifier:
... | [
"pyfastaq.intervals.Interval",
"cluster_vcf_records.vcf_file_read.get_sample_name_from_vcf_header_lines",
"logging.debug",
"pandas.read_csv",
"pandas.DataFrame",
"cluster_vcf_records.vcf_file_read.vcf_file_to_dict",
"pysam.VariantFile",
"pyfastaq.intervals.merge_overlapping_in_list",
"minos.utils.sy... | [((1792, 1826), 'os.path.abspath', 'os.path.abspath', (['dnadiff_snps_file'], {}), '(dnadiff_snps_file)\n', (1807, 1826), False, 'import os\n'), ((1856, 1886), 'os.path.abspath', 'os.path.abspath', (['dnadiff_file1'], {}), '(dnadiff_file1)\n', (1871, 1886), False, 'import os\n'), ((1916, 1946), 'os.path.abspath', 'os.p... |
import re
from recipes.site_listers.base import TwoLevelSitemapLister
class TheHappyFoodieLister(TwoLevelSitemapLister):
""" """
start_url = "https://thehappyfoodie.co.uk/sitemap_index.xml"
sitemap_path_regex = re.compile(r"^/recipes-sitemap\d+\.xml$")
recipes_path_regex = re.compile(r"^/recipes/.+$... | [
"re.compile"
] | [((227, 269), 're.compile', 're.compile', (['"""^/recipes-sitemap\\\\d+\\\\.xml$"""'], {}), "('^/recipes-sitemap\\\\d+\\\\.xml$')\n", (237, 269), False, 'import re\n'), ((294, 321), 're.compile', 're.compile', (['"""^/recipes/.+$"""'], {}), "('^/recipes/.+$')\n", (304, 321), False, 'import re\n')] |
import uuid
from tortoise import fields, models
from tortoise.contrib.pydantic import pydantic_model_creator
class User(models.Model):
name = fields.CharField(max_length=500, unique=True)
picture = fields.TextField(null=True)
def __str__(self) -> str:
return f"{self.name}"
class PydanticM... | [
"tortoise.fields.CharField",
"tortoise.contrib.pydantic.pydantic_model_creator",
"tortoise.fields.ManyToManyField",
"tortoise.fields.DatetimeField",
"tortoise.fields.UUIDField",
"tortoise.fields.ForeignKeyField",
"tortoise.fields.TextField"
] | [((861, 904), 'tortoise.contrib.pydantic.pydantic_model_creator', 'pydantic_model_creator', (['Inbox'], {'name': '"""Inbox"""'}), "(Inbox, name='Inbox')\n", (883, 904), False, 'from tortoise.contrib.pydantic import pydantic_model_creator\n'), ((921, 962), 'tortoise.contrib.pydantic.pydantic_model_creator', 'pydantic_mo... |
import setuptools
import re
VERSIONFILE = "alchemyml/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
with o... | [
"setuptools.find_packages",
"re.search"
] | [((161, 194), 're.search', 're.search', (['VSRE', 'verstrline', 're.M'], {}), '(VSRE, verstrline, re.M)\n', (170, 194), False, 'import re\n'), ((719, 745), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (743, 745), False, 'import setuptools\n')] |
import boto3
import pymysql as sql
import sqlite3 as util_sql
import os
# One instance of a ComManager object will be used per process
class ComManager:
''' A manager object that is in charge of handling multiple outgoing connections from the server. It is tasked with both Sqlite, MySql, and Boto3 connections.
... | [
"os.path.exists",
"pymysql.connect",
"boto3.client",
"sqlite3.connect"
] | [((869, 916), 'boto3.client', 'boto3.client', (['service'], {}), '(service, **ComManager.credentials)\n', (881, 916), False, 'import boto3\n'), ((1043, 1163), 'pymysql.connect', 'sql.connect', ([], {'host': "db_info['hostname']", 'user': "db_info['username']", 'passwd': "db_info['password']", 'db': "db_info['database']... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
import versioneer
setuptools.setup(
name="removestar",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="<NAME>",
author_email="<EMAIL>",
description="A tool to automatically repl... | [
"versioneer.get_cmdclass",
"setuptools.find_packages",
"versioneer.get_version"
] | [((160, 184), 'versioneer.get_version', 'versioneer.get_version', ([], {}), '()\n', (182, 184), False, 'import versioneer\n'), ((199, 224), 'versioneer.get_cmdclass', 'versioneer.get_cmdclass', ([], {}), '()\n', (222, 224), False, 'import versioneer\n'), ((527, 553), 'setuptools.find_packages', 'setuptools.find_package... |
# Copyright (c) 2016 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | [
"jaeger_client.Span",
"collections.namedtuple",
"mock.patch",
"jaeger_client.reporter.InMemoryReporter",
"jaeger_client.config.Config",
"itertools.product",
"jaeger_client.codecs.span_context_from_string",
"pytest.mark.parametrize",
"jaeger_client.SpanContext",
"jaeger_client.codecs.BinaryCodec",
... | [((21281, 21400), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fmt,carrier"""', '[(Format.TEXT_MAP, {}), (Format.HTTP_HEADERS, {}), (ZipkinSpanFormat, {})]'], {}), "('fmt,carrier', [(Format.TEXT_MAP, {}), (Format.\n HTTP_HEADERS, {}), (ZipkinSpanFormat, {})])\n", (21304, 21400), False, 'import pytest\... |
# coding: utf-8
"""
Speech Services API v2.0
Speech Services API v2.0. # noqa: E501
OpenAPI spec version: v2.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class TestDefinition(object):
"""NOTE: Th... | [
"six.iteritems"
] | [((5203, 5236), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (5216, 5236), False, 'import six\n')] |
import os
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K
from keras.models import load_model
import numpy as np
"""
Here we test our fooling images with more... | [
"numpy.copy",
"keras.layers.Conv2D",
"keras.backend.image_data_format",
"keras.models.load_model",
"keras.datasets.mnist.load_data",
"keras.layers.MaxPooling2D",
"keras.layers.Flatten",
"os.path.join",
"keras.utils.to_categorical",
"os.getcwd",
"numpy.array",
"keras.models.Sequential",
"os.p... | [((545, 585), 'os.path.join', 'os.path.join', (['model_folder', 'model_1_path'], {}), '(model_folder, model_1_path)\n', (557, 585), False, 'import os\n'), ((636, 676), 'os.path.join', 'os.path.join', (['model_folder', 'model_2_path'], {}), '(model_folder, model_2_path)\n', (648, 676), False, 'import os\n'), ((713, 749)... |
#!/usr/bin/env python2
import logging
import argparse
import numpy as np
import pandas as pd
import cv2
def read_motion_vector(filename):
""" read the motion vector file under csv format
:param filename: input path to input csv file
:return: data under DataFrame format (see pandas lib)
"""
logging... | [
"logging.getLogger",
"argparse.ArgumentParser",
"pandas.read_csv",
"cv2.findHomography",
"numpy.logical_not",
"numpy.float32"
] | [((381, 402), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (392, 402), True, 'import pandas as pd\n'), ((2100, 2174), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""create a video of the vector field."""'}), "(description='create a video of the vector field.')\n"... |
import numpy as np
import pandas.compat as compat
import pandas as pd
class TablePlotter(object):
"""
Layout some DataFrames in vertical/horizontal layout for explanation.
Used in merging.rst
"""
def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5):
self.cell_width = cel... | [
"pandas.compat.iteritems",
"numpy.max",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec",
"pandas.plotting.table",
"pandas.DataFrame",
"pandas.MultiIndex.from_tuples",
"pandas.concat",
"matplotlib.pyplot.show"
] | [((6185, 6256), 'pandas.DataFrame', 'pd.DataFrame', (["{'A': [10, 11, 12], 'B': [20, 21, 22], 'C': [30, 31, 32]}"], {}), "({'A': [10, 11, 12], 'B': [20, 21, 22], 'C': [30, 31, 32]})\n", (6197, 6256), True, 'import pandas as pd\n'), ((6315, 6359), 'pandas.DataFrame', 'pd.DataFrame', (["{'A': [10, 12], 'C': [30, 32]}"], ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# continuously publish VE.Direct data to the topic prefix specified
import argparse, os
import paho.mqtt.client as mqtt
from vedirect import VEDirect
import logging
log = logging.getLogger(__name__)
if __name__ == '__main__':
parser = argparse.ArgumentParser(descriptio... | [
"logging.getLogger",
"paho.mqtt.client.Client",
"vedirect.VEDirect",
"argparse.ArgumentParser"
] | [((216, 243), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (233, 243), False, 'import logging\n'), ((286, 351), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Process VE.Direct protocol"""'}), "(description='Process VE.Direct protocol')\n", (309, 351), Fa... |
"""
Compare two or more phased variant files
"""
import logging
import math
from collections import defaultdict
from contextlib import ExitStack
import dataclasses
from itertools import chain, permutations
from typing import Set, List, Optional, DefaultDict, Dict
from whatshap.vcf import VcfReader, VcfVariant, Variant... | [
"logging.getLogger",
"itertools.chain",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"whatshap.core.SwitchFlipCalculator",
"math.log10",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.close",
"whatshap.vcf.VcfReader",
"contextlib.ExitStack",
"itertools.permut... | [((449, 476), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (466, 476), False, 'import logging\n'), ((9291, 9343), 'whatshap.core.SwitchFlipCalculator', 'SwitchFlipCalculator', (['ploidy', 'switch_cost', 'flip_cost'], {}), '(ploidy, switch_cost, flip_cost)\n', (9311, 9343), False, 'from ... |
from flask import request
import json
import graphene # type: ignore
from graphene.types.datetime import Date # type: ignore
from graphql import GraphQLError # type: ignore
import inject # type: ignore
from books.schemas.types import BookType, Upload
from books.use_cases import *
from books.use_cases.exceptions impo... | [
"graphene.String",
"graphene.List",
"books.schemas.types.Upload",
"graphene.types.datetime.Date",
"graphene.ID",
"inject.autoparams",
"flask.request.files.get"
] | [((371, 390), 'inject.autoparams', 'inject.autoparams', ([], {}), '()\n', (388, 390), False, 'import inject\n'), ((612, 625), 'graphene.ID', 'graphene.ID', ([], {}), '()\n', (623, 625), False, 'import graphene\n'), ((642, 672), 'graphene.String', 'graphene.String', ([], {'required': '(True)'}), '(required=True)\n', (65... |
from django.conf import settings
from django.urls import include, path
from rest_framework.routers import DefaultRouter, SimpleRouter
from proffy_api.users.api.views import UserViewSet
if settings.DEBUG:
router = DefaultRouter()
else:
router = SimpleRouter()
router.register("users", UserViewSet)
urlpatterns... | [
"rest_framework.routers.SimpleRouter",
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((219, 234), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (232, 234), False, 'from rest_framework.routers import DefaultRouter, SimpleRouter\n'), ((254, 268), 'rest_framework.routers.SimpleRouter', 'SimpleRouter', ([], {}), '()\n', (266, 268), False, 'from rest_framework.routers import De... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import logging
from pipeline_control.adapters.notifier.rdfox_email_notification import (
RDFoxEmailNotification,
)
from pipeline_control.domain import commands
from pipeline_control.domain.model import Job, ... | [
"logging.getLogger"
] | [((370, 397), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (387, 397), False, 'import logging\n')] |
import discord
from discord.ext import commands
import asyncio
import random
class Embeds(commands.Cog):
def __init__(self, client):
self.client = client
self.inv = 'ᅠ'
@commands.command(alieses=['newembed'])
async def embed(self, ctx):
footer_text = f'Запрошено {ctx.author.name}'
footer_icon = ctx.author... | [
"discord.Color.green",
"discord.ext.commands.command"
] | [((179, 217), 'discord.ext.commands.command', 'commands.command', ([], {'alieses': "['newembed']"}), "(alieses=['newembed'])\n", (195, 217), False, 'from discord.ext import commands\n'), ((359, 380), 'discord.Color.green', 'discord.Color.green', ([], {}), '()\n', (378, 380), False, 'import discord\n')] |
import math
import re
import json
from github import Github
from PythonGists import PythonGists
from discord.ext import commands
from cogs.utils.checks import cmd_prefix_len, load_config
'''Module for custom commands adding, removing, and viewing.'''
class Customcmds:
def __init__(self, bot):
... | [
"PythonGists.PythonGists.Gist",
"github.Github",
"discord.ext.commands.truncate",
"json.dump",
"discord.ext.commands.group",
"discord.ext.commands.seek",
"cogs.utils.checks.load_config",
"json.load",
"discord.ext.commands.read",
"re.findall",
"discord.ext.commands.command",
"cogs.utils.checks.... | [((3567, 3600), 'discord.ext.commands.group', 'commands.group', ([], {'pass_context': '(True)'}), '(pass_context=True)\n', (3581, 3600), False, 'from discord.ext import commands\n'), ((9117, 9152), 'discord.ext.commands.command', 'commands.command', ([], {'pass_context': '(True)'}), '(pass_context=True)\n', (9133, 9152... |
import io
from django.contrib import messages
from django.template.defaultfilters import linebreaksbr
from django.utils.translation import ugettext as _
import ghdiff
from CommcareTranslationChecker import validate_workbook
from CommcareTranslationChecker.exceptions import FatalError
from corehq.apps.app_manager.exc... | [
"corehq.apps.translations.validator.UploadedTranslationsValidator",
"corehq.util.files.read_workbook_content_as_file",
"corehq.apps.translations.app_translations.utils.get_menu_or_form_by_sheet_name",
"corehq.apps.translations.app_translations.upload_module.BulkAppTranslationModuleUpdater",
"corehq.apps.tra... | [((5883, 5917), 'corehq.apps.translations.app_translations.utils.is_single_sheet_workbook', 'is_single_sheet_workbook', (['workbook'], {}), '(workbook)\n', (5907, 5917), False, 'from corehq.apps.translations.app_translations.utils import BulkAppTranslationUpdater, get_bulk_app_sheet_headers, get_menu_or_form_by_sheet_n... |
"""
Django settings for Store project.
Generated by 'django-admin startproject' using Django 1.11.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import date... | [
"os.path.abspath",
"os.path.dirname",
"datetime.timedelta",
"os.path.join"
] | [((540, 570), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""apps"""'], {}), "(BASE_DIR, 'apps')\n", (552, 570), False, 'import os\n'), ((7108, 7134), 'datetime.timedelta', 'datetime.timedelta', ([], {'days': '(1)'}), '(days=1)\n', (7126, 7134), False, 'import datetime\n'), ((451, 476), 'os.path.abspath', 'os.path.a... |
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from commons.file import file_utils
from uzuwiki.settings_static_file_engine import *
import tempfile
from oauth2client.file import Storage
from oauth2client.client import AccessTokenRefreshError
from commons.errors import GoogleCredentialsError
... | [
"logging.getLogger",
"tempfile.TemporaryDirectory",
"os.path.getsize",
"httplib2.Http",
"commons.file.file_utils.get_root_file",
"os.makedirs",
"os.path.join",
"pydrive.drive.GoogleDrive",
"pydrive.auth.GoogleAuth",
"os.path.splitext",
"datetime.datetime.now",
"commons.errors.GoogleCredentials... | [((468, 487), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (477, 487), False, 'from logging import getLogger\n'), ((853, 896), 'os.path.join', 'os.path.join', (['temp.name', '"""credentials.json"""'], {}), "(temp.name, 'credentials.json')\n", (865, 896), False, 'import os\n'), ((1088, 1113), 'o... |