code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import requests
import subprocess
import tarfile
from pathlib import Path
import luigi
import tensorflow as tf
from luigi.util import inherits, requires
class LocalFilesTarget(luigi.target.Target):
def __init__(self, paths):
self.paths = [Path(path) for path in paths]
def exists(self):
... | [
"subprocess.run",
"tarfile.open",
"luigi.FloatParameter",
"luigi.run",
"luigi.util.requires",
"pathlib.Path",
"tensorflow.train.latest_checkpoint",
"luigi.LocalTarget",
"requests.get",
"luigi.util.inherits",
"luigi.Parameter",
"luigi.IntParameter"
] | [((865, 895), 'luigi.util.requires', 'requires', (['DownloadStsbenchmark'], {}), '(DownloadStsbenchmark)\n', (873, 895), False, 'from luigi.util import inherits, requires\n'), ((3007, 3036), 'luigi.util.inherits', 'inherits', (['ExtractStsbenchmark'], {}), '(ExtractStsbenchmark)\n', (3015, 3036), False, 'from luigi.uti... |
import numpy as np
def vecNum(vec):
return int("".join(str(int(n)) for n in vec), base=2)
def printVec(vec, width):
return "0b{:0{}b},".format(vecNum(vec), width)
def printBinary(mat, width):
for vec in mat:
print(printVec(vec, width))
def genToParityCheck(genParity):
return np.hstack((genPa... | [
"numpy.zeros",
"numpy.eye",
"numpy.array",
"numpy.roll"
] | [((446, 898), 'numpy.array', 'np.array', (['[[1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1], [1, \n 1, 1, 1, 0, 1, 1, 0, 1, 0, 0], [0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0], [0, 0,\n 1, 1, 1, 1, 0, 1, 1, 0, 1], [1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0], [0, 1, 1,\n 0, 1, 1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 0... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
def hbox_grid_sample(boxes, point_num_per_line=3):
bin_w, bin_h = (boxes[:, 2] - boxes[:, 0]) / (point_num_per_line-1), (boxes[:, 3] - boxes[:, 1]) / (point_nu... | [
"numpy.meshgrid",
"numpy.array",
"numpy.arange",
"numpy.reshape",
"numpy.tile",
"numpy.concatenate"
] | [((500, 529), 'numpy.meshgrid', 'np.meshgrid', (['shift_x', 'shift_y'], {}), '(shift_x, shift_y)\n', (511, 529), True, 'import numpy as np\n'), ((544, 572), 'numpy.reshape', 'np.reshape', (['shift_x', '[-1, 1]'], {}), '(shift_x, [-1, 1])\n', (554, 572), True, 'import numpy as np\n'), ((587, 615), 'numpy.reshape', 'np.r... |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from toontown.parties import PartyGlobals
class DistributedSafezoneJukeboxAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedSafezoneJukeboxAI')
def ... | [
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"direct.distributed.DistributedObjectAI.DistributedObjectAI.delete",
"toontown.parties.PartyGlobals.getMusicRepeatTimes",
"direct.distributed.DistributedObjectAI.DistributedObjectAI.__init__"
] | [((235, 310), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""DistributedSafezoneJukeboxAI"""'], {}), "('DistributedSafezoneJukeboxAI')\n", (278, 310), False, 'from direct.directnotify import DirectNotifyGlobal\n'), ((349, 388), 'direct.distributed... |
# -*- coding: utf-8 -*-
import typing
import insanity
from reldata.data import base_individual
from reldata.data import data_context as dc
from reldata.data import individual
__author__ = "<NAME>"
__copyright__ = (
"Copyright (c) 2017, <NAME>\n"
"All rights reserved.\n"
"\n"
"Redis... | [
"typing.TypeVar",
"reldata.data.data_context.DataContext.get_context",
"insanity.sanitize_type"
] | [((2000, 2048), 'typing.TypeVar', 'typing.TypeVar', (['"""T"""'], {'bound': 'individual.Individual'}), "('T', bound=individual.Individual)\n", (2014, 2048), False, 'import typing\n'), ((6162, 6237), 'insanity.sanitize_type', 'insanity.sanitize_type', (['"""target_type"""', 'target_type', 'type'], {'none_allowed': '(Tru... |
from discord.ext import commands
import os
import traceback
bot = commands.Bot(command_prefix='^')
token = os.environ['DISCORD_BOT_TOKEN']
@bot.event
async def on_command_error(ctx, error):
orig_error = getattr(error, "original", error)
error_msg = ''.join(traceback.TracebackException.from_exception(orig_err... | [
"traceback.TracebackException.from_exception",
"discord.ext.commands.Bot"
] | [((67, 99), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""^"""'}), "(command_prefix='^')\n", (79, 99), False, 'from discord.ext import commands\n'), ((268, 323), 'traceback.TracebackException.from_exception', 'traceback.TracebackException.from_exception', (['orig_error'], {}), '(orig_error)\n'... |
from rest_framework.views import APIView
from rest_framework import permissions, status
from rest_framework.response import Response
from api.models.user import User
from api.models.ledger import Ledger
from api.serializers.amount import AmountSerializer
class SendMoneyView(APIView):
permission_classes = [permiss... | [
"api.models.user.User.objects.get",
"rest_framework.response.Response",
"api.models.ledger.Ledger.objects.create"
] | [((543, 571), 'api.models.user.User.objects.get', 'User.objects.get', ([], {'id': 'user_id'}), '(id=user_id)\n', (559, 571), False, 'from api.models.user import User\n'), ((989, 1078), 'api.models.ledger.Ledger.objects.create', 'Ledger.objects.create', ([], {'user_id': 'request.user', 'ledger_type': '"""expense"""', 'a... |
"""
This class parses a xml in order to get the description of the user interface
of the game.
"""
# -*- coding: utf-8 -*-
import parsing.parsing_utils as parsing_utils
def get_size(size_tag):
""" Gets the size of the widget. """
width = size_tag.find("width")
height = size_tag.find("height")
if wid... | [
"parsing.parsing_utils.try_open_and_parse",
"parsing.parsing_utils.fail_not_found",
"parsing.parsing_utils.format_type"
] | [((3198, 3236), 'parsing.parsing_utils.try_open_and_parse', 'parsing_utils.try_open_and_parse', (['path'], {}), '(path)\n', (3230, 3236), True, 'import parsing.parsing_utils as parsing_utils\n'), ((379, 416), 'parsing.parsing_utils.format_type', 'parsing_utils.format_type', (['width.text'], {}), '(width.text)\n', (404,... |
from django.shortcuts import render, redirect
from django import forms
from django.contrib import messages
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth import authenticate, login, update_session_auth_hash
from django.contrib.auth.models import User
from django.contrib.auth.decorator... | [
"applications.alumniprofile.models.Profile.objects.filter",
"applications.gallery.models.Album.objects.order_by",
"django.contrib.messages.error",
"django.contrib.auth.models.User.objects.make_random_password",
"django.http.HttpResponseRedirect",
"django.contrib.auth.login",
"django.http.HttpResponse",
... | [((1644, 1658), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (1656, 1658), False, 'from django.utils import timezone\n'), ((2253, 2383), 'django.shortcuts.render', 'render', (['request', '"""AlumniConnect/index.html"""', "{'name': sname, 'events': events_to_display, 'news': news, 'albums':\n albums... |
import itertools, logging
log = logging.getLogger(__name__)
from otp.ai.passlib.tests.utils import TestCase
__all__ = [
'UtilsTest',
'GenerateTest',
'StrengthTest']
class UtilsTest(TestCase):
descriptionPrefix = 'passlib.pwd'
def test_self_info_rate(self):
from otp.ai.passlib.pwd import _self_info_... | [
"otp.ai.passlib.pwd.genword",
"otp.ai.passlib.pwd._self_info_rate",
"logging.getLogger",
"otp.ai.passlib.pwd.genphrase"
] | [((32, 59), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (49, 59), False, 'import itertools, logging\n'), ((1520, 1529), 'otp.ai.passlib.pwd.genword', 'genword', ([], {}), '()\n', (1527, 1529), False, 'from otp.ai.passlib.pwd import genword, default_charsets\n'), ((1716, 1737), 'otp.ai.... |
# -*-coding:Utf-8 -*
# ===========================================================
# - HARFANG® 3D - www.harfang3d.com
# - Basic scene -
# ===========================================================
import harfang as hg
import platform
from math import radians
def init_scene(plus... | [
"harfang.time_to_sec_f",
"harfang.Vector3",
"math.radians",
"harfang.Color",
"harfang.Environment",
"harfang.LoadPlugins",
"harfang.StdFileDriver",
"platform.version",
"harfang.FPSController",
"platform.system",
"platform.release",
"harfang.Vector2",
"harfang.GetPlus"
] | [((1881, 1902), 'harfang.Vector2', 'hg.Vector2', (['(1600)', '(900)'], {}), '(1600, 900)\n', (1891, 1902), True, 'import harfang as hg\n'), ((1968, 1980), 'harfang.GetPlus', 'hg.GetPlus', ([], {}), '()\n', (1978, 1980), True, 'import harfang as hg\n'), ((1981, 1997), 'harfang.LoadPlugins', 'hg.LoadPlugins', ([], {}), '... |
import os
import unittest
from collections import namedtuple
from os.path import join, dirname
from rocky.config import Dict, as_path, Props, Env, PyFile, ConfigFile, Config, Default, FileContent
testdir = dirname(__file__)
class DictSrcTest(unittest.TestCase):
def test_unmapped_unfiltered_get_values(self):
... | [
"rocky.config.Env",
"rocky.config.as_path",
"rocky.config.Config",
"os.path.dirname",
"rocky.config.Dict",
"rocky.config.FileContent",
"rocky.config.Default",
"rocky.config.PyFile",
"collections.namedtuple",
"rocky.config.ConfigFile",
"os.path.join"
] | [((210, 227), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (217, 227), False, 'from os.path import join, dirname\n'), ((3593, 3598), 'rocky.config.Env', 'Env', ([], {}), '()\n', (3596, 3598), False, 'from rocky.config import Dict, as_path, Props, Env, PyFile, ConfigFile, Config, Default, FileConten... |
from setuptools import setup
setup(name='gym-inventory',
version='0.0.23',
install_requires=['gym', 'numpy']
) | [
"setuptools.setup"
] | [((30, 115), 'setuptools.setup', 'setup', ([], {'name': '"""gym-inventory"""', 'version': '"""0.0.23"""', 'install_requires': "['gym', 'numpy']"}), "(name='gym-inventory', version='0.0.23', install_requires=['gym', 'numpy']\n )\n", (35, 115), False, 'from setuptools import setup\n')] |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
#creating temp practice data
x = np.arange(0,100)
y = x*2
z = x**2
fig1 = plt.figure()
ax1 = fig1.add_axes([0,0,1,1])
#plotception
ax2 = fig1.add_axes([0.2,0.5,0.2,0.2])
ax1.plot(x,y)
ax2.plot(y,x,color='red')
ax1.set_xlabel('X')
ax1.set_yla... | [
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.subplots"
] | [((111, 128), 'numpy.arange', 'np.arange', (['(0)', '(100)'], {}), '(0, 100)\n', (120, 128), True, 'import numpy as np\n'), ((153, 165), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (163, 165), True, 'import matplotlib.pyplot as plt\n'), ((398, 416), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)',... |
import typing
import flask
from flask_wtf import FlaskForm
from wtforms import SelectField, IntegerField, FieldList, FormField
from wtforms.validators import InputRequired
from ..logic import errors
from ..logic.permissions import ResourcePermissions
from ..models import Permissions
class UserPermissionsForm(FlaskF... | [
"wtforms.validators.InputRequired",
"wtforms.FormField"
] | [((1494, 1524), 'wtforms.FormField', 'FormField', (['UserPermissionsForm'], {}), '(UserPermissionsForm)\n', (1503, 1524), False, 'from wtforms import SelectField, IntegerField, FieldList, FormField\n'), ((1575, 1606), 'wtforms.FormField', 'FormField', (['GroupPermissionsForm'], {}), '(GroupPermissionsForm)\n', (1584, 1... |
import unittest
import time
import logging
import sdc11073
from sdc11073.sdcdevice import waveforms
from lxml import etree as etree_
from tests import mockstuff
from sdc11073 import pmtypes
from sdc11073.mdib import descriptorcontainers as dc
from sdc11073.definitions_sdc import SDC_v1_Definitions
#pylint: di... | [
"sdc11073.mdib.DeviceMdibContainer",
"sdc11073.pysoap.soapenvelope.DPWSThisDevice",
"tests.mockstuff.MockWsDiscovery",
"sdc11073.pysoap.soapenvelope.DPWSThisModel",
"sdc11073.pmtypes.CodedValue",
"unittest.TextTestRunner",
"sdc11073.sdcdevice.SdcDevice",
"sdc11073.namespaces.domTag",
"sdc11073.sdcde... | [((7525, 7563), 'logging.Logger', 'logging.Logger', (['"""sdc.device.subscrMgr"""'], {}), "('sdc.device.subscrMgr')\n", (7539, 7563), False, 'import logging\n'), ((780, 833), 'sdc11073.mdib.DeviceMdibContainer', 'sdc11073.mdib.DeviceMdibContainer', (['SDC_v1_Definitions'], {}), '(SDC_v1_Definitions)\n', (813, 833), Fal... |
#!/usr/bin/env python3.5
"""Test ModelPart class."""
import os
import tempfile
import unittest
import numpy as np
import tensorflow as tf
from neuralmonkey.vocabulary import Vocabulary
from neuralmonkey.encoders.sentence_encoder import SentenceEncoder
class Test(unittest.TestCase):
"""Test capabilities of mode... | [
"unittest.main",
"tempfile.NamedTemporaryFile",
"neuralmonkey.vocabulary.Vocabulary",
"os.remove",
"tensorflow.get_collection",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"numpy.all"
] | [((1457, 1472), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1470, 1472), False, 'import unittest\n'), ((430, 442), 'neuralmonkey.vocabulary.Vocabulary', 'Vocabulary', ([], {}), '()\n', (440, 442), False, 'from neuralmonkey.vocabulary import Vocabulary\n'), ((536, 577), 'tempfile.NamedTemporaryFile', 'tempfile.... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
# Binary to decimal conversion
# See explaination: https://i.imgur.com/heAT0PB.gif ,
# https://www.electronics-tutorials.ws/binary/bin_2.html
def binary_to_decimal_conv(binary_string):
res = 0
binary_l = list(binary_string)
for bit_i in range(len(b... | [
"sys.exit"
] | [((727, 737), 'sys.exit', 'sys.exit', ([], {}), '()\n', (735, 737), False, 'import sys\n')] |
#!/usr/bin/env python3.7
"""
Mastering Object-Oriented Python 2e
Code Examples for Mastering Object-Oriented Python 2nd Edition
Chapter 7. Example 2.
"""
from typing import List, cast, Any, Optional, Iterable, overload, Union, Iterator
# Extending Classes
# ##############################
# Basic Stats formulae
impo... | [
"random.randint",
"math.sqrt",
"typing.cast",
"random.seed",
"doctest.testmod"
] | [((1643, 1658), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (1654, 1658), False, 'import random\n'), ((10665, 10695), 'doctest.testmod', 'doctest.testmod', ([], {'verbose': '(False)'}), '(verbose=False)\n', (10680, 10695), False, 'import doctest\n'), ((1461, 1481), 'random.randint', 'random.randint', (['(1)... |
from lebai import LebaiRobot
import rospy
import os, sys
from tp_trajectory_handler import TPTrajectoryHandler
from tp_stream_trajectory_handler import TPStreamTrajectoryHandler
# from urdf_helper import find_chain_joints_name
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentd... | [
"sys.path.append",
"tp_trajectory_handler.TPTrajectoryHandler",
"os.path.dirname",
"param_utils.get_joint_names",
"os.path.realpath",
"lebai.LebaiRobot",
"tp_stream_trajectory_handler.TPStreamTrajectoryHandler",
"rospy.loginfo",
"rospy.has_param"
] | [((296, 323), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (311, 323), False, 'import os, sys\n'), ((324, 350), 'sys.path.append', 'sys.path.append', (['parentdir'], {}), '(parentdir)\n', (339, 350), False, 'import os, sys\n'), ((256, 282), 'os.path.realpath', 'os.path.realpath', (['__f... |
from ico.etherscan import verify_contract
from populus import Project
def manual_etherscan():
"""Manual test verification on EtherScan.io."""
contract_name = "PresaleFundCollector"
address = "0xb589ef3af084cc5ec905d23112520ec168478582"
constructor_args = "000000000000000000000000e8baf9df0ded92c5f28aa... | [
"ico.etherscan.verify_contract",
"populus.Project"
] | [((556, 565), 'populus.Project', 'Project', ([], {}), '()\n', (563, 565), False, 'from populus import Project\n'), ((598, 817), 'ico.etherscan.verify_contract', 'verify_contract', ([], {'project': 'p', 'chain_name': 'chain_name', 'address': 'address', 'contract_name': '"""PresaleFundCollector"""', 'contract_filename': ... |
# Generated by Django 2.2.2 on 2019-07-18 04:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("atlas", "0014_auto_20190718_0353")]
operations = [
migrations.AddField(
model_name="profile", name="pronouns", field=models.TextField(null=Tr... | [
"django.db.models.TextField"
] | [((296, 323), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)'}), '(null=True)\n', (312, 323), False, 'from django.db import migrations, models\n')] |
from math import log
import numpy as np
def net_args(parser):
parser.add_argument("--batch", default=16, type=int, help="batch size")
parser.add_argument(
"--n_channels", default=1, type=int, help="number of image channels"
)
parser.add_argument("--epochs", default=200000, type=int, help="maxi... | [
"math.log",
"numpy.log",
"numpy.exp"
] | [((3433, 3446), 'numpy.exp', 'np.exp', (['space'], {}), '(space)\n', (3439, 3446), True, 'import numpy as np\n'), ((3384, 3397), 'numpy.log', 'np.log', (['start'], {}), '(start)\n', (3390, 3397), True, 'import numpy as np\n'), ((3399, 3410), 'numpy.log', 'np.log', (['end'], {}), '(end)\n', (3405, 3410), True, 'import n... |
from gensim.models.phrases import Phrases
from gensim.utils import any2unicode, any2utf8
import spacy
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG)
logging.getLogger('elasticsearch').setLevel(logging.WARNING)
nlp = spacy.load('pt', disable=['ner', 'parse... | [
"gensim.utils.any2unicode",
"logging.basicConfig",
"spacy.load",
"gensim.models.phrases.Phrases.learn_vocab",
"gensim.models.phrases.Phrases",
"gensim.utils.any2utf8",
"logging.getLogger"
] | [((120, 216), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""', 'level': 'logging.DEBUG'}), "(format='%(asctime)s : %(levelname)s : %(message)s',\n level=logging.DEBUG)\n", (139, 216), False, 'import logging\n'), ((281, 324), 'spacy.load', 'spacy.load', ... |
import sys, os.path as path
import os
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import argparse
from corpus_cleaner import CorpusCleaner
def make_data_argument_parser():
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=
... | [
"os.path.abspath",
"argparse.ArgumentParser",
"os.getcwd",
"corpus_cleaner.CorpusCleaner",
"os.path.normpath"
] | [((213, 316), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, formatter_class=argparse.\n RawDescriptionHelpFormatter)\n', (236, 316), False, 'import argparse\n'), ((1500, 1529), 'os.path.normpat... |
"""App extensions"""
from aioredis import Redis
from httpx import AsyncClient
http_client = AsyncClient() # pylint: disable-msg=C0103
redis_client = Redis(pool_or_conn=None) # pylint: disable-msg=C0103
| [
"httpx.AsyncClient",
"aioredis.Redis"
] | [((94, 107), 'httpx.AsyncClient', 'AsyncClient', ([], {}), '()\n', (105, 107), False, 'from httpx import AsyncClient\n'), ((152, 176), 'aioredis.Redis', 'Redis', ([], {'pool_or_conn': 'None'}), '(pool_or_conn=None)\n', (157, 176), False, 'from aioredis import Redis\n')] |
import torch
from torch import nn
from torch.nn import functional as F
class _NonLocalBlockND(nn.Module):
def __init__(self, in_channels, inter_channels=None, dimension=2, mode='embedded_gaussian',
sub_sample=True, bn_layer=True, nb_patches=None):
super(_NonLocalBlockND, self).__init__()
... | [
"torch.nn.ReLU",
"torch.nn.init.uniform_",
"torch.nn.Conv2d",
"torch.cat",
"torch.randn",
"torch.nn.functional.softmax",
"torch.nn.init.constant_",
"numpy.arange",
"torch.matmul",
"torch.sum"
] | [((7094, 7122), 'torch.matmul', 'torch.matmul', (['theta_x', 'phi_x'], {}), '(theta_x, phi_x)\n', (7106, 7122), False, 'import torch\n'), ((7141, 7161), 'torch.nn.functional.softmax', 'F.softmax', (['f'], {'dim': '(-1)'}), '(f, dim=-1)\n', (7150, 7161), True, 'from torch.nn import functional as F\n'), ((7270, 7296), 't... |
from skills_taxonomy import PROJECT_DIR
from pprint import pprint
from skills_taxonomy.utils.json_management import load_json, save_json
def input_name(class_id, informative_words):
"""Print most informative words, and then ask for
user input to assign a suitable name.
Args:
class_id(str): id for... | [
"pprint.pprint",
"skills_taxonomy.utils.json_management.load_json"
] | [((481, 506), 'pprint.pprint', 'pprint', (['informative_words'], {}), '(informative_words)\n', (487, 506), False, 'from pprint import pprint\n'), ((1149, 1182), 'skills_taxonomy.utils.json_management.load_json', 'load_json', (['informative_words_path'], {}), '(informative_words_path)\n', (1158, 1182), False, 'from skil... |
import pytest
from gamestonk_terminal.cryptocurrency.overview import blockchaincenter_view
@pytest.mark.vcr
@pytest.mark.record_stdout
def test_get_altcoin_index():
blockchaincenter_view.get_altcoin_index(365, 1_601_596_800, 1_641_573_787)
| [
"gamestonk_terminal.cryptocurrency.overview.blockchaincenter_view.get_altcoin_index"
] | [((172, 240), 'gamestonk_terminal.cryptocurrency.overview.blockchaincenter_view.get_altcoin_index', 'blockchaincenter_view.get_altcoin_index', (['(365)', '(1601596800)', '(1641573787)'], {}), '(365, 1601596800, 1641573787)\n', (211, 240), False, 'from gamestonk_terminal.cryptocurrency.overview import blockchaincenter_v... |
#!/usr/bin/env python
# Copyright 2017 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 or... | [
"uuid.uuid4",
"argparse.ArgumentParser",
"google.cloud.bigquery.Client",
"time.sleep",
"google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file"
] | [((1195, 1252), 'google.cloud.bigquery.Client', 'bigquery.Client', ([], {'project': 'project', 'credentials': 'credentials'}), '(project=project, credentials=credentials)\n', (1210, 1252), False, 'from google.cloud import bigquery\n'), ((1852, 1978), 'google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file'... |
"""Views helper functions."""
import stripe
from django.shortcuts import reverse
def create_stripe_onboarding_link(request, stripe_id=None,):
"""Creates stripe connect onboarding link by calling Stripe API."""
account_links = stripe.AccountLink.create(
account=stripe_id,
return_url=request.bu... | [
"django.shortcuts.reverse",
"stripe.Account.retrieve"
] | [((732, 773), 'stripe.Account.retrieve', 'stripe.Account.retrieve', (['vendor_stripe_id'], {}), '(vendor_stripe_id)\n', (755, 773), False, 'import stripe\n'), ((350, 382), 'django.shortcuts.reverse', 'reverse', (['"""users:stripe_callback"""'], {}), "('users:stripe_callback')\n", (357, 382), False, 'from django.shortcu... |
import re
import sys
import six
from attr import attributes, attr
from attr.validators import instance_of
from okonomiyaki.errors import InvalidMetadataField
_KIND_TO_ABBREVIATED = {
u"cpython": u"cp",
u"python": u"py",
u"pypy": u"pp",
u"ironpython": u"ip",
u"jython": u"jy",
}
_ABBREVIATED_TO_... | [
"sys.platform.startswith",
"attr.validators.instance_of",
"six.text_type",
"okonomiyaki.errors.InvalidMetadataField",
"re.compile"
] | [((392, 491), 're.compile', 're.compile', (['"""\n (?P<interpreter>([^\\\\d]+))\n (?P<version>([\\\\d_]+))\n"""'], {'flags': 're.VERBOSE'}), '("""\n (?P<interpreter>([^\\\\d]+))\n (?P<version>([\\\\d_]+))\n""",\n flags=re.VERBOSE)\n', (402, 491), False, 'import re\n'), ((2595, 2626), 'sys.platform.starts... |
import argparse
import os
import time
import math
import collections
from tqdm import tqdm
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
import pandas as pd
from reparameterization import apply_weight_norm, remove_weight_norm
... | [
"arguments.add_run_classifier_args",
"argparse.ArgumentParser",
"model.SentimentClassifier",
"torch.no_grad",
"os.path.join",
"numpy.zeros_like",
"torch.load",
"arguments.add_classifier_model_args",
"arguments.add_general_args",
"reparameterization.apply_weight_norm",
"numpy.save",
"reparamete... | [((554, 640), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Sentiment Discovery Classification"""'}), "(description=\n 'PyTorch Sentiment Discovery Classification')\n", (577, 640), False, 'import argparse\n'), ((650, 674), 'arguments.add_general_args', 'add_general_args', (['... |
import unittest
from are_not_at_most_one_edit_away import are_not_at_most_one_edit_away
class Test_Case_Are_Not_At_Most_One_Edit_Away(unittest.TestCase):
def test_are_not_at_most_one_edit_away(self):
self.assertTrue(are_not_at_most_one_edit_away('cat', 'ca'))
self.assertTrue(are_not_at_most_one_edi... | [
"unittest.main",
"are_not_at_most_one_edit_away.are_not_at_most_one_edit_away"
] | [((789, 804), 'unittest.main', 'unittest.main', ([], {}), '()\n', (802, 804), False, 'import unittest\n'), ((229, 271), 'are_not_at_most_one_edit_away.are_not_at_most_one_edit_away', 'are_not_at_most_one_edit_away', (['"""cat"""', '"""ca"""'], {}), "('cat', 'ca')\n", (258, 271), False, 'from are_not_at_most_one_edit_aw... |
import matplotlib.pylab as plt
import seaborn as sns
import numpy as np
def hist_plot(data):
sns.set_context("notebook", font_scale=1.5, rc={"lines.linewidth": 0})
sns.set_style('white')
fig, axes = plt.subplots(1, 3, figsize=(19, 5))
axes[0].hist(data.influence_score,lw=0,color="indianred",bin... | [
"seaborn.set_style",
"numpy.log",
"seaborn.despine",
"matplotlib.pylab.subplots",
"seaborn.set_context"
] | [((99, 169), 'seaborn.set_context', 'sns.set_context', (['"""notebook"""'], {'font_scale': '(1.5)', 'rc': "{'lines.linewidth': 0}"}), "('notebook', font_scale=1.5, rc={'lines.linewidth': 0})\n", (114, 169), True, 'import seaborn as sns\n'), ((175, 197), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('wh... |
#!/usr/bin/python3
import random
import sys
import json
VALID_LETTERS = "ABCDEFGHIJKLOPQRSTUVXYZ" # The others don't look good in pixel-art
FLAG_RANDOM_PART_LEN = 8
def main():
random.seed(37182)
if len(sys.argv) < 2:
print("Usage:\n{} amount_of_teams".format(sys.argv[0]))
sys.exit()
amou... | [
"random.seed",
"random.choice",
"sys.exit",
"json.dumps"
] | [((184, 202), 'random.seed', 'random.seed', (['(37182)'], {}), '(37182)\n', (195, 202), False, 'import random\n'), ((301, 311), 'sys.exit', 'sys.exit', ([], {}), '()\n', (309, 311), False, 'import sys\n'), ((816, 851), 'json.dumps', 'json.dumps', (['flagsByTeamId'], {'indent': '(4)'}), '(flagsByTeamId, indent=4)\n', (8... |
def Analyze(cmd, path):
import requests, base64, re, codecs
from colorama import Fore, init
init()
if '-' in cmd: #Se o usuario especificar o repositório do pacote
repo, cmd = cmd.split('-') #Separar o pacote e o repositório
else: #Caso o contrario, pega o repositório definido pe... | [
"colorama.init",
"base64.b64decode",
"requests.get",
"configparser.ConfigParser",
"re.compile"
] | [((107, 113), 'colorama.init', 'init', ([], {}), '()\n', (111, 113), False, 'from colorama import Fore, init\n'), ((556, 635), 'requests.get', 'requests.get', (['f"""https://github.com/Polarfill/MaidUtilsModules/tree/main/{repo}"""'], {}), "(f'https://github.com/Polarfill/MaidUtilsModules/tree/main/{repo}')\n", (568, 6... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from joblib import Parallel, delayed
import numpy as np
import argparse
import os
import matplotlib.pyplot as plt
from helpers import smooth, symmetric_remove
import time
from envs.blackjack_pi import BlackjackEnv
plt.style.use('ggplot')
from agent import agent
from gym.... | [
"numpy.stack",
"envs.gridworld.generate_gridworld",
"envs.taxi.generate_taxi",
"numpy.save",
"envs.three_arms.generate_arms",
"argparse.ArgumentParser",
"os.makedirs",
"agent.agent.learn",
"envs.loop.generate_loop",
"envs.river_swim.generate_river",
"envs.blackjack_pi.BlackjackEnv",
"os.path.e... | [((263, 286), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (276, 286), True, 'import matplotlib.pyplot as plt\n'), ((776, 852), 'gym.envs.registration.register', 'register', ([], {'id': '"""Blackjack_pi-v0"""', 'entry_point': '"""envs.blackjack_pi:BlackjackEnv"""'}), "(id='Bla... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import (Flask, request, current_app, g, make_response,
redirect, abort, render_template, jsonify)
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
app_ctx = app.app_context()
app_ctx.push()
print("Current App: ", current_app.nam... | [
"flask_cors.CORS",
"flask.Flask",
"flask.render_template"
] | [((211, 226), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (216, 226), False, 'from flask import Flask, request, current_app, g, make_response, redirect, abort, render_template, jsonify\n'), ((227, 236), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (231, 236), False, 'from flask_cors import CORS\... |
import datetime
def get_time():
strTime = datetime.datetime.now().strftime("%H:%M:%S")
result = "It's " + strTime + "."
return result
| [
"datetime.datetime.now"
] | [((52, 75), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (73, 75), False, 'import datetime\n')] |
# -*- coding: utf-8 -*-
# @Author: MR_Radish
# @Date: 2018-07-25 19:02:48
# @E-mail: <EMAIL>
# @FileName: splitting_and_merging.py
# @TODO: 图像通道分割与合并
import numpy as np
import argparse
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="Path to the image")
args = va... | [
"argparse.ArgumentParser",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"cv2.imread",
"cv2.split",
"cv2.merge",
"cv2.imshow"
] | [((211, 236), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (234, 236), False, 'import argparse\n'), ((349, 374), 'cv2.imread', 'cv2.imread', (["args['image']"], {}), "(args['image'])\n", (359, 374), False, 'import cv2\n'), ((387, 403), 'cv2.split', 'cv2.split', (['image'], {}), '(image)\n', (... |
from __future__ import division
import sys
from libtbx import easy_run
from libtbx.test_utils import assert_lines_in_file
from iotbx.pdb import pdb_input
from mmtbx.hydrogens.specialised_hydrogen_atoms import add_side_chain_acid_hydrogens
from mmtbx.hydrogens.specialised_hydrogen_atoms import add_disulfur_hydrogen_ato... | [
"mmtbx.conformation_dependent_library.testing_utils.get_geometry_restraints_manager",
"mmtbx.hydrogens.specialised_hydrogen_atoms.add_side_chain_acid_hydrogens",
"libtbx.easy_run.go",
"mmtbx.hydrogens.specialised_hydrogen_atoms.add_disulfur_hydrogen_atoms",
"iotbx.pdb.pdb_input"
] | [((9514, 9527), 'iotbx.pdb.pdb_input', 'pdb_input', (['fn'], {}), '(fn)\n', (9523, 9527), False, 'from iotbx.pdb import pdb_input\n'), ((9677, 9725), 'mmtbx.conformation_dependent_library.testing_utils.get_geometry_restraints_manager', 'get_geometry_restraints_manager', ([], {'pdb_filename': 'fn'}), '(pdb_filename=fn)\... |
import typing
from flask_jwt import JWTError
from ..user.crud import UserCRUD
from ..user.models import User
from . import db, jwt
@jwt.authentication_handler
def authenticate(username: str, password: str) -> typing.Optional[User]:
user = UserCRUD.get_by_login(db.session, username)
if user and user.check_p... | [
"flask_jwt.JWTError"
] | [((824, 918), 'flask_jwt.JWTError', 'JWTError', (['"""Forbidden"""', '"""Internal identity and authorization not accepted"""'], {'status_code': '(403)'}), "('Forbidden', 'Internal identity and authorization not accepted',\n status_code=403)\n", (832, 918), False, 'from flask_jwt import JWTError\n'), ((447, 525), 'fl... |
# -*- coding: utf-8 -*-
import itertools
import json
import re
import traceback
import colorlabels as cl
import requests
from bs4 import BeautifulSoup
from SLGetLocalSoftware import get_local_software
from SLHelper import (alert_messagebox, date_sanitizer, file_content, keep_window_open,
lower_... | [
"SLHTMLGeneration.render_page",
"traceback.print_exc",
"SLHTMLGeneration.open_html_in_browser",
"SLGetLocalSoftware.get_local_software",
"SLHelper.file_content",
"colorlabels.error",
"re.findall",
"requests.get",
"SLHelper.keep_window_open",
"bs4.BeautifulSoup",
"colorlabels.progress",
"re.sea... | [((4213, 4252), 'colorlabels.section', 'cl.section', (['"""SoftwareList Update Check"""'], {}), "('SoftwareList Update Check')\n", (4223, 4252), True, 'import colorlabels as cl\n'), ((864, 929), 'requests.get', 'requests.get', (['url'], {'timeout': '(60)', 'headers': "{'User-Agent': USER_AGENT}"}), "(url, timeout=60, h... |
# -*-coding: utf-8 -*-
'''
Created on 17 Mar 2016
@author: BurakKerim
'''
import nltk
from nltk.book import gutenberg as gutenber_book
from nltk.corpus import brown, gutenberg
print(nltk.corpus.gutenberg.fileids())
# --------------------------
# Accessing Text Corpora
# --------------------------
... | [
"nltk.corpus.brown.categories",
"nltk.book.gutenberg.raw",
"nltk.book.gutenberg.words",
"nltk.corpus.brown.words",
"nltk.corpus.brown.sents",
"nltk.corpus.gutenberg.fileids",
"nltk.corpus.gutenberg.sents",
"nltk.corpus.gutenberg.words",
"nltk.Text",
"nltk.book.gutenberg.sents",
"nltk.corpus.gute... | [((329, 375), 'nltk.corpus.gutenberg.words', 'nltk.corpus.gutenberg.words', (['"""austen-emma.txt"""'], {}), "('austen-emma.txt')\n", (356, 375), False, 'import nltk\n'), ((384, 399), 'nltk.Text', 'nltk.Text', (['emma'], {}), '(emma)\n', (393, 399), False, 'import nltk\n'), ((482, 528), 'nltk.book.gutenberg.sents', 'gu... |
from django.shortcuts import render, get_list_or_404, get_object_or_404
from django.http import HttpResponse
from .models import Receita
def index(request):
receitas = Receita.objects.all()
dados = {
'receitas': receitas
}
return render(request, 'index.html', dados)
def receita(request, re... | [
"django.shortcuts.render",
"django.shortcuts.get_object_or_404"
] | [((259, 295), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'dados'], {}), "(request, 'index.html', dados)\n", (265, 295), False, 'from django.shortcuts import render, get_list_or_404, get_object_or_404\n'), ((345, 386), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Receita'], {'... |
from odoo import _, http
from odoo.http import request
from odoo.addons.website_sale.controllers.main import WebsiteSale
class WebsiteSaleRefund(WebsiteSale):
@http.route()
def cart(self, **post):
response = super(WebsiteSaleRefund, self).cart(**post)
if post.get("total_is_negative"):
... | [
"odoo.http.request.redirect",
"odoo._",
"odoo.http.route"
] | [((167, 179), 'odoo.http.route', 'http.route', ([], {}), '()\n', (177, 179), False, 'from odoo import _, http\n'), ((661, 711), 'odoo.http.request.redirect', 'request.redirect', (['"""/shop/cart?total_is_negative=1"""'], {}), "('/shop/cart?total_is_negative=1')\n", (677, 711), False, 'from odoo.http import request\n'),... |
import logging
from src.posting import Posting
from src.query_operator import QueryOp
from src.tree_node import TreeNode
from src.processors.query_operator_processor import QueryOperatorProcessor
from src.processors.not_processor import NotProcessor
class AndProcessor(QueryOperatorProcessor):
class Literal(ob... | [
"src.processors.not_processor.NotProcessor",
"logging.debug",
"src.posting.Posting"
] | [((2397, 2450), 'logging.debug', 'logging.debug', (['"""returning empty postings immediately"""'], {}), "('returning empty postings immediately')\n", (2410, 2450), False, 'import logging\n'), ((3056, 3085), 'src.processors.not_processor.NotProcessor', 'NotProcessor', (['self.dispatcher'], {}), '(self.dispatcher)\n', (3... |
from django.db import models
from django_redis import get_redis_connection
from functools import wraps
import json
import time
_cache = get_redis_connection('default')
# 缓存值
def cache(func):
@wraps(func)
def wrapper(obj,*args):
key = args[0]
value = _cache.get(key)
if value:
... | [
"django.db.models.TextField",
"django.db.models.OneToOneField",
"django.db.models.ManyToManyField",
"json.loads",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"time.strftime",
"json.dumps",
"django.db.models.EmailField",
"django.db.models.SmallIntegerField",
"django.db.models.Int... | [((138, 169), 'django_redis.get_redis_connection', 'get_redis_connection', (['"""default"""'], {}), "('default')\n", (158, 169), False, 'from django_redis import get_redis_connection\n'), ((199, 210), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (204, 210), False, 'from functools import wraps\n'), ((496, 552... |
import hex
# current_player = 1
# board3 = [1,1,-1,-1,0,-1,1,-1,1,-1,-1,1,-1,1,1,0,1,-1,-1]
board3 = [1,0,0,0,0,0,1,0,1,-1,0,1,1,0,1,0,0,1,0]
hex.place(board3,'(-1,1,0)',-1)
print(hex.display_board(board3))
bugs = hex.get_bugs(board3)
hex.bug_eat(board3,bugs,-1)
print(hex.display_board(board3))
# print(get_possible_mov... | [
"hex.place",
"hex.bug_eat",
"hex.get_bugs",
"hex.display_board"
] | [((142, 175), 'hex.place', 'hex.place', (['board3', '"""(-1,1,0)"""', '(-1)'], {}), "(board3, '(-1,1,0)', -1)\n", (151, 175), False, 'import hex\n'), ((214, 234), 'hex.get_bugs', 'hex.get_bugs', (['board3'], {}), '(board3)\n', (226, 234), False, 'import hex\n'), ((235, 264), 'hex.bug_eat', 'hex.bug_eat', (['board3', 'b... |
import os
import pickle
import argparse
import numpy as np
import scipy.ndimage
from feature_extraction import ffmpeg_utils, resnext_model, transforms, tsm_model
def main(args):
if not os.path.exists(f"{args.resnext_path}-0040.params"):
print(f"File {args.resnext_path}-0040.params does not exist, set --r... | [
"feature_extraction.resnext_model.get_resnext_fc",
"pickle.dump",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.basename",
"feature_extraction.ffmpeg_utils.extract_frames",
"os.path.exists",
"feature_extraction.transforms.get_transform",
"feature_extraction.tsm_model.get_tsm_model",
"os.path.... | [((372, 397), 'feature_extraction.tsm_model.get_tsm_model', 'tsm_model.get_tsm_model', ([], {}), '()\n', (395, 397), False, 'from feature_extraction import ffmpeg_utils, resnext_model, transforms, tsm_model\n'), ((412, 463), 'feature_extraction.resnext_model.get_resnext_fc', 'resnext_model.get_resnext_fc', (['args.resn... |
import numpy as np
import matplotlib.pyplot as plt
yi, Bi1 = np.genfromtxt("python/helm2i.txt", unpack=True)
ya, Ba1 = np.genfromtxt("python/helm2a.txt", unpack=True)
i1 = 2
r = 0.0625
n = 100
yi *= 1e-2
Bi1 *= 1e-3
plt.plot(ya, Ba1, "r.", label="Messwerte Außen")
plt.plot(yi*1e2, Bi1*1e3, 'r--', label='Messwerte I... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.legend",
"numpy.genfromtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.grid"
] | [((62, 109), 'numpy.genfromtxt', 'np.genfromtxt', (['"""python/helm2i.txt"""'], {'unpack': '(True)'}), "('python/helm2i.txt', unpack=True)\n", (75, 109), True, 'import numpy as np\n'), ((120, 167), 'numpy.genfromtxt', 'np.genfromtxt', (['"""python/helm2a.txt"""'], {'unpack': '(True)'}), "('python/helm2a.txt', unpack=Tr... |
#
# Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list o... | [
"MDSplus.Uint32"
] | [((2223, 2241), 'MDSplus.Uint32', 'Uint32', (['(4294967295)'], {}), '(4294967295)\n', (2229, 2241), False, 'from MDSplus import Data, TreeNode, TreePath, Uint32\n')] |
#!/usr/bin/env python3
# Programa simple para aprender a usar Qt
from __future__ import with_statement
import sys
import matplotlib
matplotlib.use('Qt4Agg')
from PyQt4 import QtGui, QtCore
from propagator import Ui_MainWindow
from polarization_routines import plot_ellipse, getAnglesFromEllipse, getAnglesFromJones
fr... | [
"numpy.matrix",
"PyQt4.QtGui.QApplication.translate",
"polarization_routines.getAnglesFromEllipse",
"PyQt4.QtGui.QMessageBox.about",
"numpy.zeros",
"PyQt4.QtGui.QApplication",
"matplotlib.use"
] | [((135, 159), 'matplotlib.use', 'matplotlib.use', (['"""Qt4Agg"""'], {}), "('Qt4Agg')\n", (149, 159), False, 'import matplotlib\n'), ((7503, 7531), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (7521, 7531), False, 'from PyQt4 import QtGui, QtCore\n'), ((616, 680), 'PyQt4.QtGui.Q... |
# Copyright 2018 Owkin, 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 in writing,... | [
"substra.sdk.exceptions.AlreadyExists",
"pathlib.Path.mkdir",
"pathlib.Path",
"substra.sdk.exceptions.NotFound",
"substra.sdk.exceptions.InvalidRequest",
"substra.sdk.backends.local.db.InMemoryDb",
"shutil.copyfile",
"shutil.copytree",
"logging.getLogger"
] | [((817, 844), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (834, 844), False, 'import logging\n'), ((1143, 1158), 'substra.sdk.backends.local.db.InMemoryDb', 'db.InMemoryDb', ([], {}), '()\n', (1156, 1158), False, 'from substra.sdk.backends.local import db\n'), ((1338, 1370), 'pathlib.P... |
import operator
class Solution:
def majorityElement(self, nums: List[int]) -> int:
dic = {}
for x in nums:
if(str(x) in dic):
tmp = dic.get(str(x))
tmp += 1
dic[str(x)] = tmp
else:
dic[str(x)] = 1
... | [
"operator.itemgetter"
] | [((386, 408), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (405, 408), False, 'import operator\n'), ((456, 478), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (475, 478), False, 'import operator\n')] |
import sys
from PyQt4 import QtCore, QtGui, uic
from WW_auto import *
class MyWindowClass(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent)
self.setupUi(self)
app = QtGui.QApplication(sys.argv)
myWindow = MyWindowClass(None)
myWindow.sh... | [
"PyQt4.QtGui.QMainWindow.__init__",
"PyQt4.QtGui.QApplication"
] | [((249, 277), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (267, 277), False, 'from PyQt4 import QtCore, QtGui, uic\n'), ((173, 213), 'PyQt4.QtGui.QMainWindow.__init__', 'QtGui.QMainWindow.__init__', (['self', 'parent'], {}), '(self, parent)\n', (199, 213), False, 'from PyQt4 im... |
from blog import models
from fastapi import status, HTTPException
class BlogQuery:
def __init__(self, session, id=None):
self.db = session
self.id = id
def get_all(self):
blog = self.db.query(models.Blog).all()
return blog
def query_blog_by_id(self):
blog = self.d... | [
"fastapi.HTTPException",
"blog.models.Blog"
] | [((782, 844), 'blog.models.Blog', 'models.Blog', ([], {'title': 'request.title', 'body': 'request.body', 'user_id': '(1)'}), '(title=request.title, body=request.body, user_id=1)\n', (793, 844), False, 'from blog import models\n'), ((978, 1089), 'fastapi.HTTPException', 'HTTPException', ([], {'status_code': 'status.HTTP... |
#! python3
# Auto play 2048 game
import logging, time, requests, sys, bs4
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
logging.disable()
class Verify ():
"""
Verify that all the external/absolute links within a web page work correctly.
"""
def __init... | [
"requests.get",
"logging.disable",
"logging.basicConfig",
"bs4.BeautifulSoup"
] | [((76, 174), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '""" %(asctime)s - %(levelname)s - %(message)s"""'}), "(level=logging.DEBUG, format=\n ' %(asctime)s - %(levelname)s - %(message)s')\n", (95, 174), False, 'import logging, time, requests, sys, bs4\n'), ((170, 187), '... |
from pathlib import Path
from typing import Union, Dict, List
import numpy as np
from .eeg import EEG
from .transforms import HighPass, RemoveBeginning, RemoveLineNoise, Standardize
def ingest_session(
data_path: Path, output_dir: Path
) -> Dict[str, Union[int, List[int]]]:
eeg = EEG.from_hdf5(data_path... | [
"numpy.savez",
"numpy.quantile",
"numpy.unique"
] | [((1848, 1900), 'numpy.quantile', 'np.quantile', (['action_lengths', '(0, 0.25, 0.5, 0.75, 1)'], {}), '(action_lengths, (0, 0.25, 0.5, 0.75, 1))\n', (1859, 1900), True, 'import numpy as np\n'), ((2050, 2107), 'numpy.quantile', 'np.quantile', (['preparation_lengths', '(0, 0.25, 0.5, 0.75, 1)'], {}), '(preparation_length... |
#!/usr/bin/env python
# Author : <NAME>
# Copyright (c) 2020 <NAME>. All rights reserved.
# Licensed under the MIT License. See LICENSE file in the project root for full license information.
"""
Parent classes for types of equilibrium
"""
from games.types.game import Eq
class DomEq(Eq):
"""Strictly Dominating Equi... | [
"games.types.game.Eq.__init__"
] | [((363, 386), 'games.types.game.Eq.__init__', 'Eq.__init__', (['self', 'play'], {}), '(self, play)\n', (374, 386), False, 'from games.types.game import Eq\n'), ((470, 493), 'games.types.game.Eq.__init__', 'Eq.__init__', (['self', 'play'], {}), '(self, play)\n', (481, 493), False, 'from games.types.game import Eq\n'), (... |
from __future__ import division
import cv2
import numpy as np
import scipy.io
import scipy.ndimage
def padding(img, shape_r=240, shape_c=320, channels=3):
img_padded = np.zeros((shape_r, shape_c, channels), dtype=np.uint8)
if channels == 1:
img_padded = np.zeros((shape_r, shape_c), dtype=np.... | [
"numpy.zeros",
"cv2.imread",
"numpy.max",
"numpy.argwhere",
"numpy.round",
"cv2.resize"
] | [((182, 236), 'numpy.zeros', 'np.zeros', (['(shape_r, shape_c, channels)'], {'dtype': 'np.uint8'}), '((shape_r, shape_c, channels), dtype=np.uint8)\n', (190, 236), True, 'import numpy as np\n'), ((1194, 1216), 'numpy.zeros', 'np.zeros', (['(rows, cols)'], {}), '((rows, cols))\n', (1202, 1216), True, 'import numpy as np... |
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
# This is a simple example for a custom action which utters "Hello World!"
# from typing import Any, Text, Dict, Lis... | [
"requests.post",
"rasa_sdk.events.SlotSet",
"duckling.Duckling"
] | [((1219, 1229), 'duckling.Duckling', 'Duckling', ([], {}), '()\n', (1227, 1229), False, 'from duckling import Duckling, Dim, Language\n'), ((5596, 5626), 'requests.post', 'requests.post', (['url'], {'json': 'myobj'}), '(url, json=myobj)\n', (5609, 5626), False, 'import requests\n'), ((5769, 5793), 'rasa_sdk.events.Slot... |
from sanic.server import HttpProtocol, CIMultiDict
from sanic.request import Request as _Request
from sanic.response import text, json
class Request(_Request):
__slots__ = (
'url', 'headers', 'version', 'method', '_cookies',
'query_string', 'body', 'start', 'limit',
'parsed_json', 'parsed_... | [
"sanic.response.json",
"sanic.server.CIMultiDict",
"sanic.response.text"
] | [((928, 942), 'sanic.response.text', 'text', (['response'], {}), '(response)\n', (932, 942), False, 'from sanic.response import text, json\n'), ((1094, 1108), 'sanic.response.json', 'json', (['response'], {}), '(response)\n', (1098, 1108), False, 'from sanic.response import text, json\n'), ((684, 709), 'sanic.server.CI... |
# coding:utf-8
'''
python 3.5
tensorflow: 1.2.0
author: helloholmes
--------------------
after running this code
in terminal or CMD, type:
tensorboard --logdir path
open 'http://localhost:6006' in your browser
'''
import tensorflow as tf
import input_data_mnist
import numpy as np
import matplotlib.pyp... | [
"tensorflow.truncated_normal_initializer",
"tensorflow.summary.scalar",
"tensorflow.argmax",
"tensorflow.global_variables_initializer",
"tensorflow.constant_initializer",
"tensorflow.Session",
"input_data_mnist.read_data_sets",
"tensorflow.variable_scope",
"tensorflow.losses.softmax_cross_entropy",
... | [((379, 438), 'input_data_mnist.read_data_sets', 'input_data_mnist.read_data_sets', (['"""MNIST_data"""'], {'one_hot': '(True)'}), "('MNIST_data', one_hot=True)\n", (410, 438), False, 'import input_data_mnist\n'), ((2516, 2528), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (2526, 2528), True, 'import tensorflo... |
# Generated by Django 2.2 on 2021-04-07 12:53
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ArticleCategory',
... | [
"django.db.models.CharField",
"datetime.datetime",
"django.db.models.AutoField"
] | [((363, 456), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (379, 456), False, 'from django.db import migrations, models\... |
import numpy as np
array = np.loadtxt('input.txt')
summe = np.add.outer(array, array)
summe2 = np.add.outer(array, summe)
result = np.where(np.tril(summe2) == 2020)
listOfCoordinates = list(zip(result[0], result[1], result[2]))
for (m, n, o) in listOfCoordinates:
m = array[m]
n = array[n]
o = array[o]
sum... | [
"numpy.add.outer",
"numpy.loadtxt",
"numpy.tril"
] | [((28, 51), 'numpy.loadtxt', 'np.loadtxt', (['"""input.txt"""'], {}), "('input.txt')\n", (38, 51), True, 'import numpy as np\n'), ((61, 87), 'numpy.add.outer', 'np.add.outer', (['array', 'array'], {}), '(array, array)\n', (73, 87), True, 'import numpy as np\n'), ((98, 124), 'numpy.add.outer', 'np.add.outer', (['array',... |
from django.db import models
from django.contrib.auth.models import User
class PostImage(models.Model):
title = models.CharField(max_length=20)
image = models.ImageField()
def __str__(self):
return self.title
class Event(models.Model):
title = models.CharField(max_length=30)
content = m... | [
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.ImageField",
"django.db.models.DateField"
] | [((118, 149), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)'}), '(max_length=20)\n', (134, 149), False, 'from django.db import models\n'), ((162, 181), 'django.db.models.ImageField', 'models.ImageField', ([], {}), '()\n', (179, 181), False, 'from django.db import models\n'), ((273, 304), '... |
import json
import logging
import re
import string
import os
from ...settings.common import PROJECT_ROOT
logging.basicConfig(level=logging.INFO)
custom_math_env_parser_logger = logging.getLogger(__name__)
class CustomMathEnvParser:
"""
This class is used to extract the identifiers from a formula and split ... | [
"json.loads",
"logging.basicConfig",
"re.sub",
"os.path.join",
"logging.getLogger",
"re.compile"
] | [((107, 146), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (126, 146), False, 'import logging\n'), ((179, 206), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (196, 206), False, 'import logging\n'), ((760, 859), 'os.path.join', '... |
from tensorflow.keras.models import load_model
from PIL import Image, ImageOps
import numpy as np
class TeachableMachine(object):
'''
Create your TeachableMachine object to run your exported AI models.
'''
__supported_types = ('keras', 'Keras', 'h5')
def __init__(self, model_path='keras_model.h5'... | [
"tensorflow.keras.models.load_model",
"PIL.ImageOps.fit",
"numpy.argmax",
"numpy.asarray",
"PIL.Image.open",
"numpy.ndarray"
] | [((511, 533), 'tensorflow.keras.models.load_model', 'load_model', (['model_path'], {}), '(model_path)\n', (521, 533), False, 'from tensorflow.keras.models import load_model\n'), ((1473, 1493), 'PIL.Image.open', 'Image.open', (['img_path'], {}), '(img_path)\n', (1483, 1493), False, 'from PIL import Image, ImageOps\n'), ... |
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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... | [
"pathlib.Path",
"uuid.uuid4",
"common.dialogflow_framework.programy.text_preprocessing.clean_text",
"logging.getLogger"
] | [((802, 829), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (819, 829), False, 'import logging\n'), ((1168, 1180), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1178, 1180), False, 'import uuid\n'), ((1242, 1258), 'common.dialogflow_framework.programy.text_preprocessing.clean_text', 'cl... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sqlalchemy_migrate_hotoffthehamster.versioning import cfgparse
from sqlalchemy_migrate_hotoffthehamster.versioning.repository import *
from sqlalchemy_migrate_hotoffthehamster.versioning.template import Template
from sqlalchemy_migrate_hotoffthehamster.tests import fixtur... | [
"sqlalchemy_migrate_hotoffthehamster.versioning.template.Template"
] | [((956, 966), 'sqlalchemy_migrate_hotoffthehamster.versioning.template.Template', 'Template', ([], {}), '()\n', (964, 966), False, 'from sqlalchemy_migrate_hotoffthehamster.versioning.template import Template\n'), ((1071, 1081), 'sqlalchemy_migrate_hotoffthehamster.versioning.template.Template', 'Template', ([], {}), '... |
"""
:copyright: © 2020 by the Lin team.
:Copyright (c) 2021 <NAME>, <NAME>,<NAME>,<NAME>
:license: MIT, see LICENSE for more details.
"""
from flask import Blueprint
from app.api.v1 import quiz
from app.api.v1 import submission
from app.api.v1 import ttg
from app.api.v1 import truthtable
def create_v1():
... | [
"app.api.v1.quiz.quiz_api.register",
"flask.Blueprint",
"app.api.v1.submission.submission_api.register",
"app.api.v1.truthtable.truthtable_api.register",
"app.api.v1.ttg.ttg_api.register"
] | [((332, 357), 'flask.Blueprint', 'Blueprint', (['"""v1"""', '__name__'], {}), "('v1', __name__)\n", (341, 357), False, 'from flask import Blueprint\n'), ((362, 391), 'app.api.v1.quiz.quiz_api.register', 'quiz.quiz_api.register', (['bp_v1'], {}), '(bp_v1)\n', (384, 391), False, 'from app.api.v1 import quiz\n'), ((396, 4... |
import pandas as pd
import sys
import numpy as np
filename = sys.argv[1]
#filename = 'outlier.csv'
def iqr_row_removal(filename):
data = pd.read_csv(filename)
nrows, ncols = data.shape
data2 = [[val for val in data[col]] for col in data]
data2.insert(0,list(data.keys()))
... | [
"pandas.read_csv",
"numpy.percentile",
"numpy.std",
"numpy.mean"
] | [((157, 178), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (168, 178), True, 'import pandas as pd\n'), ((1315, 1336), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (1326, 1336), True, 'import pandas as pd\n'), ((644, 672), 'numpy.percentile', 'np.percentile', (['col', '[... |
"""
Script reads the csv file describing the details of people requiring help.
"""
__author__ = "<NAME>"
__license__ = "MIT"
__version__ = "1.0.1"
# imports
import pandas as pd
import numpy as np
class CampDataReader:
def __init__(self, filename):
self.filename = filename
self.df = self._read_f... | [
"pandas.DataFrame",
"pandas.read_csv"
] | [((353, 367), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (365, 367), True, 'import pandas as pd\n'), ((408, 434), 'pandas.read_csv', 'pd.read_csv', (['self.filename'], {}), '(self.filename)\n', (419, 434), True, 'import pandas as pd\n')] |
"""
Desarrollador/es: <NAME> 77629
Facundo Mentesana 75387
Cátedra: Algoritmos y Estructura de Datos
Curso: 1k03
Año: 2017
-------------------------------------------------
ALGUNAS CONSIDERACIONES:
El siguiente codigo fue programado para ser ejecutado en la consola de s... | [
"colorama.init",
"os.system",
"random.randint"
] | [((1365, 1371), 'colorama.init', 'init', ([], {}), '()\n', (1369, 1371), False, 'from colorama import init\n'), ((2569, 2590), 'random.randint', 'random.randint', (['(0)', '(36)'], {}), '(0, 36)\n', (2583, 2590), False, 'import random\n'), ((2594, 2610), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (2603... |
import apps.common.func.InitDjango
from all_models_for_dubbo.models import Tb2DubboTask
from django.db import connection
from django.forms.models import model_to_dict
from apps.common.func.CommonFunc import *
from all_models.models.A0011_version_manage import TbVersionTask
class DubboTaskService(object):
@staticm... | [
"all_models_for_dubbo.models.Tb2DubboTask.objects.filter",
"all_models.models.A0011_version_manage.TbVersionTask.objects.filter",
"all_models_for_dubbo.models.Tb2DubboTask.objects.all",
"all_models_for_dubbo.models.Tb2DubboTask.objects.create",
"all_models.models.A0011_version_manage.TbVersionTask.objects.c... | [((360, 386), 'all_models_for_dubbo.models.Tb2DubboTask.objects.all', 'Tb2DubboTask.objects.all', ([], {}), '()\n', (384, 386), False, 'from all_models_for_dubbo.models import Tb2DubboTask\n'), ((3452, 3491), 'all_models_for_dubbo.models.Tb2DubboTask.objects.create', 'Tb2DubboTask.objects.create', ([], {}), '(**taskDat... |
import os
import subprocess
import frappe
from frappe.utils import cint
# keys
migration_status_key = "renovation_migration_status"
migration_error_key = "renovation_migration_error"
# redis values
migration_status_migrating = "migrating"
migration_status_done = "done"
migration_status_error = "error"
@frappe.white... | [
"frappe.desk.notifications.clear_notifications",
"frappe.website.render.clear_cache",
"frappe.get_traceback",
"frappe.get_conf",
"frappe.whitelist",
"subprocess.check_output",
"frappe.enqueue",
"frappe.migrate.migrate",
"frappe.clear_cache",
"frappe.cache",
"frappe.utils.change_log.get_versions"... | [((308, 342), 'frappe.whitelist', 'frappe.whitelist', ([], {'allow_guest': '(True)'}), '(allow_guest=True)\n', (324, 342), False, 'import frappe\n'), ((441, 459), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (457, 459), False, 'import frappe\n'), ((920, 938), 'frappe.whitelist', 'frappe.whitelist', ([], {}... |
""" Cisco_IOS_XR_ethernet_link_oam_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR ethernet\-link\-oam package configuration.
This YANG module augments the
Cisco\-IOS\-XR\-snmp\-agent\-cfg,
Cisco\-IOS\-XR\-l2\-eth\-infra\-cfg,
Cisco\-IOS\-XR\-ifmgr\-cfg
modules with configuration da... | [
"ydk.types.Enum.YLeaf"
] | [((1028, 1052), 'ydk.types.Enum.YLeaf', 'Enum.YLeaf', (['(1)', '"""disable"""'], {}), "(1, 'disable')\n", (1038, 1052), False, 'from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64\n'), ((1074, 1104), 'ydk.types.Enum.YLeaf', 'Enum.YLeaf', (['(2)'... |
"""Interface to the Gremlin database."""
import requests
class GremlinInterface:
"""Interface to the Gremlin database."""
def __init__(self, gremlinConfiguration):
"""Initialize the Gremlin interface object."""
self.configuration = gremlinConfiguration
def post_query(self, query):
... | [
"requests.post"
] | [((435, 483), 'requests.post', 'requests.post', (['self.configuration.url'], {'json': 'data'}), '(self.configuration.url, json=data)\n', (448, 483), False, 'import requests\n')] |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: lipeijie
import os
import shutil
from easyai.helper.dir_process import DirProcess
from easyai.utility.logger import EasyLogger
class CopyImage():
def __init__(self):
self.images_dir_name = "../JPEGImages"
self.dir_process = DirProcess()
... | [
"os.makedirs",
"os.path.exists",
"os.system",
"easyai.utility.logger.EasyLogger.error",
"easyai.utility.logger.EasyLogger.warn",
"easyai.helper.dir_process.DirProcess",
"os.path.split",
"os.path.join",
"shutil.copy"
] | [((303, 315), 'easyai.helper.dir_process.DirProcess', 'DirProcess', ([], {}), '()\n', (313, 315), False, 'from easyai.helper.dir_process import DirProcess\n'), ((456, 486), 'os.path.exists', 'os.path.exists', (['image_save_dir'], {}), '(image_save_dir)\n', (470, 486), False, 'import os\n'), ((546, 588), 'os.makedirs', ... |
import swarm,swarm_gui,controller
import signal
import sys
import argparse
import json
import logging
# Constants
TIME_SCALING = 1.0 # Any positive number(Smaller is faster). 1.0->Real Time, 0.0->Run as fast as possible
QUAD_DYNAMICS_UPDATE = 0.02 # seconds
CONTROLLER_DYNAMICS_UPDATE = 0.05 # seconds
run = True
loggi... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"swarm.Swarm",
"sys.exit",
"signal.signal",
"swarm_gui.GUI",
"controller.Controller_PID_Point2Point"
] | [((315, 418), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(relativeCreated)6d %(threadName)s %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(relativeCreated)6d %(threadName)s %(message)s')\n", (334, 418), False, 'import logging\n'), ((1342, 1386), 'signal.signa... |
import h5py
import os
import argparse
from Higashi_backend.utils import get_config
from Higashi_analysis.Higashi_analysis import *
import numpy as np
from tqdm import tqdm, trange
import pandas as pd
def parse_args():
parser = argparse.ArgumentParser(description="Higashi visualization tool")
parser.add_argument('-c... | [
"os.remove",
"numpy.load",
"numpy.sum",
"argparse.ArgumentParser",
"numpy.ones_like",
"numpy.unique",
"numpy.zeros",
"os.system",
"Higashi_backend.utils.get_config",
"numpy.array",
"numpy.arange",
"numpy.where",
"pandas.read_table",
"os.path.join",
"numpy.concatenate"
] | [((1493, 1516), 'Higashi_backend.utils.get_config', 'get_config', (['args.config'], {}), '(args.config)\n', (1503, 1516), False, 'from Higashi_backend.utils import get_config\n'), ((230, 295), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Higashi visualization tool"""'}), "(description=... |
from snovault import (
CONNECTION,
upgrade_step
)
@upgrade_step('genetic_modification', '1', '2')
def genetic_modification_1_2(value, system):
# http://redmine.encodedcc.org/issues/3063
if 'modifiction_description' in value:
value['modification_description'] = value['modifiction_description']
... | [
"copy.deepcopy",
"snovault.upgrade_step",
"re.match",
"time.strftime",
"json.dumps"
] | [((61, 107), 'snovault.upgrade_step', 'upgrade_step', (['"""genetic_modification"""', '"""1"""', '"""2"""'], {}), "('genetic_modification', '1', '2')\n", (73, 107), False, 'from snovault import CONNECTION, upgrade_step\n'), ((368, 414), 'snovault.upgrade_step', 'upgrade_step', (['"""genetic_modification"""', '"""2"""',... |
# Generated by Django 3.0.3 on 2020-03-17 11:29
from django.db import migrations, models
import uni_ticket.models
class Migration(migrations.Migration):
dependencies = [
('uni_ticket', '0063_auto_20200317_1228'),
]
operations = [
migrations.AlterField(
model_name='ticketcate... | [
"django.db.models.FileField"
] | [((385, 477), 'django.db.models.FileField', 'models.FileField', ([], {'blank': '(True)', 'null': '(True)', 'upload_to': 'uni_ticket.models._attachment_upload'}), '(blank=True, null=True, upload_to=uni_ticket.models.\n _attachment_upload)\n', (401, 477), False, 'from django.db import migrations, models\n')] |
from psycopg2.sql import SQL, Identifier
from .expression import Expression
class Max(Expression):
def __init__(self, expression):
self.expression = expression
def to_sql(self):
if not isinstance(self.expression, str):
sql, args = self.expression.to_sql()
else:
... | [
"psycopg2.sql.SQL",
"psycopg2.sql.Identifier"
] | [((334, 361), 'psycopg2.sql.Identifier', 'Identifier', (['self.expression'], {}), '(self.expression)\n', (344, 361), False, 'from psycopg2.sql import SQL, Identifier\n'), ((381, 395), 'psycopg2.sql.SQL', 'SQL', (['"""MAX({})"""'], {}), "('MAX({})')\n", (384, 395), False, 'from psycopg2.sql import SQL, Identifier\n')] |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | [
"os.path.dirname"
] | [((407, 424), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (414, 424), False, 'from os.path import dirname\n')] |
import json
from encoders import DroneEncoder
from .Command import Command
class Message():
def __init__(self, sender, command, data, target = "server"):
self.sender = sender
self.message = Command(command, data)
self.target = target
def to_bytes(self):
data = json.dumps(self, ... | [
"json.dumps"
] | [((303, 337), 'json.dumps', 'json.dumps', (['self'], {'cls': 'DroneEncoder'}), '(self, cls=DroneEncoder)\n', (313, 337), False, 'import json\n')] |
from requests import get, post, Response
from testcontainers.core.container import DockerContainer
from testcontainers.core.waiting_utils import wait_container_is_ready
import logging
import os
logger = logging.getLogger(__name__)
class MinioContainer(DockerContainer):
def __init__(self, image="minio/minio:RELEA... | [
"testcontainers.core.waiting_utils.wait_container_is_ready",
"logging.getLogger"
] | [((204, 231), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (221, 231), False, 'import logging\n'), ((717, 742), 'testcontainers.core.waiting_utils.wait_container_is_ready', 'wait_container_is_ready', ([], {}), '()\n', (740, 742), False, 'from testcontainers.core.waiting_utils import wai... |
from django import forms
from models import othernetequip
from models import client
from clientmanagement import views as main_views
from django.urls import reverse
from django.shortcuts import render, render_to_response, redirect
from datetime import datetime
class OtherNetworkEquipmentForm(forms.ModelForm):
cla... | [
"clientmanagement.views.initRequest",
"models.client.Client.objects.get",
"django.urls.reverse",
"django.shortcuts.render",
"models.othernetequip.OtherNetworkEquipment.objects.get",
"datetime.datetime.now"
] | [((1144, 1175), 'clientmanagement.views.initRequest', 'main_views.initRequest', (['request'], {}), '(request)\n', (1166, 1175), True, 'from clientmanagement import views as main_views\n'), ((5065, 5116), 'django.urls.reverse', 'reverse', (['"""oneclient"""'], {'kwargs': "{'clientid': clientid}"}), "('oneclient', kwargs... |
try:
from os import makedirs
from os.path import exists, join
# Importing required Keras modules containing model and layers
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Conv2D, Dropout, Flatten, MaxPooling2D, UpSampling2D, Concatenate, Activation, concatenate
... | [
"os.makedirs",
"keras.layers.Activation",
"keras.layers.Dropout",
"keras.layers.MaxPooling2D",
"os.path.exists",
"keras.models.Model",
"keras.layers.Concatenate",
"keras.models.model_from_json",
"keras.layers.Conv2D",
"keras.layers.UpSampling2D",
"keras.models.Sequential",
"os.path.join",
"k... | [((868, 880), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (878, 880), False, 'from keras.models import Sequential, Model\n'), ((905, 912), 'keras.models.Model', 'Model', ([], {}), '()\n', (910, 912), False, 'from keras.models import Sequential, Model\n'), ((4838, 4870), 'os.path.join', 'join', (['folder'... |
#!/usr/bin/env python3
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# sof... | [
"empower_core.command.USAGE.format",
"argparse.ArgumentParser",
"empower_core.command.connect"
] | [((1487, 1541), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': 'usage', 'description': 'desc'}), '(usage=usage, description=desc)\n', (1510, 1541), False, 'import argparse\n'), ((2701, 2751), 'empower_core.command.connect', 'command.connect', (['gargs', "('PUT', url)", '(204)', 'request'], {}), "(... |
"""
Tests for the AttrDefault class.
"""
from nose.tools import assert_equal, assert_raises
from six import PY2
def test_method_missing():
"""
default values for AttrDefault
"""
from attrdict.default import AttrDefault
default_none = AttrDefault()
default_list = AttrDefault(list, sequence_typ... | [
"attrdict.default.AttrDefault",
"nose.tools.assert_equal",
"nose.tools.assert_raises"
] | [((257, 270), 'attrdict.default.AttrDefault', 'AttrDefault', ([], {}), '()\n', (268, 270), False, 'from attrdict.default import AttrDefault\n'), ((290, 327), 'attrdict.default.AttrDefault', 'AttrDefault', (['list'], {'sequence_type': 'None'}), '(list, sequence_type=None)\n', (301, 327), False, 'from attrdict.default im... |
# SPDX-License-Identifier: Apache-2.0
"""
reduction
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import numpy as np
from onnx import onnx_pb, helper
from tf2onnx import utils
from tf2onnx.handler import tf_op
from tf2onnx.graph_bu... | [
"numpy.isscalar",
"numpy.dtype",
"numpy.zeros",
"numpy.iinfo",
"tf2onnx.utils.make_name",
"tf2onnx.utils.map_onnx_to_numpy_type",
"onnx.helper.make_tensor",
"numpy.array",
"tf2onnx.utils.get_max_value",
"tf2onnx.handler.tf_op",
"tf2onnx.utils.make_sure",
"tf2onnx.graph_builder.GraphBuilder",
... | [((356, 383), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (373, 383), False, 'import logging\n'), ((440, 473), 'tf2onnx.handler.tf_op', 'tf_op', (['"""Min"""'], {'onnx_op': '"""ReduceMin"""'}), "('Min', onnx_op='ReduceMin')\n", (445, 473), False, 'from tf2onnx.handler import tf_op\n'),... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 NTT MCL, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with th... | [
"openstack_dashboard.dashboards.project.network_topology.views.InstanceView.as_view",
"openstack_dashboard.dashboards.project.network_topology.views.NTCreateRouterView.as_view",
"openstack_dashboard.dashboards.project.network_topology.views.RouterDetailView.as_view",
"openstack_dashboard.dashboards.project.ne... | [((1038, 1073), 'openstack_dashboard.dashboards.project.network_topology.views.NetworkTopologyView.as_view', 'views.NetworkTopologyView.as_view', ([], {}), '()\n', (1071, 1073), False, 'from openstack_dashboard.dashboards.project.network_topology import views\n'), ((1111, 1137), 'openstack_dashboard.dashboards.project.... |
import inspect
from contextlib import nullcontext as does_not_raise
from pathlib import Path
from typing import Any, List, Union
import pytest
from pydantic.error_wrappers import ValidationError
from pydantic.types import FilePath
from hydrolib.core.io.ini.parser import Parser, ParserConfig
from hydrolib.core.io.inif... | [
"hydrolib.core.io.inifield.models.DataFileType.polygon.lower",
"hydrolib.core.io.inifield.models.IniFieldModel",
"hydrolib.core.io.inifield.models.InitialField",
"pathlib.Path",
"pytest.raises",
"pytest.mark.parametrize",
"inspect.cleandoc",
"hydrolib.core.io.ini.parser.ParserConfig"
] | [((2048, 2219), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""attribute,input,expected"""', '(_datafiletype_cases + _interpolationmethod_cases + _operand_cases +\n _averagingtype_cases + _locationtype_cases)'], {}), "('attribute,input,expected', _datafiletype_cases +\n _interpolationmethod_cases + _... |
import os
import cv2
import argparse
def yolo2bbox(dim, coord_norm):
""" Converts normalized coordinates in YOLO format to [xmin, ymin, xmax, ymax] format. """
# xmin = w_image * (xmin_norm - xmax_norm/2)
xmin = dim[0] * (coord_norm[0] - coord_norm[2]/2)
# xmax = w_image * (xmax_norm/2 + xmin_norm)
... | [
"cv2.imread",
"os.walk",
"argparse.ArgumentParser"
] | [((644, 669), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (667, 669), False, 'import argparse\n'), ((921, 939), 'os.walk', 'os.walk', (['opt.input'], {}), '(opt.input)\n', (928, 939), False, 'import os\n'), ((1294, 1316), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (1... |
from pytimize.graphs import DirectedGraph
# Define directed graph with arcs and their capcities
g = DirectedGraph(arcs={
("s", "c"): 15,
("a", "b"): 3,
("a", "d"): 4,
("c", "b"): 4,
("c", "d"): 6,
("b", "t"): 10,
("d", "t"): 5
})
# Compute max flow using Preflow Push algorithm
value, flow ... | [
"pytimize.graphs.DirectedGraph"
] | [((101, 233), 'pytimize.graphs.DirectedGraph', 'DirectedGraph', ([], {'arcs': "{('s', 'c'): 15, ('a', 'b'): 3, ('a', 'd'): 4, ('c', 'b'): 4, ('c', 'd'): 6,\n ('b', 't'): 10, ('d', 't'): 5}"}), "(arcs={('s', 'c'): 15, ('a', 'b'): 3, ('a', 'd'): 4, ('c', 'b'\n ): 4, ('c', 'd'): 6, ('b', 't'): 10, ('d', 't'): 5})\n"... |
# encoding: utf-8
"""
Image manipulation with Pillow.
"""
# TODO: rename when Sanpera libweasyl.libweasyl.images is no longer used
from collections import namedtuple
from io import BytesIO
from PIL import Image
from .images import THUMB_HEIGHT
ThumbnailFormats = namedtuple('ThumbnailFormats', ['compatible', 'webp... | [
"io.BytesIO",
"PIL.Image.new",
"PIL.Image.open",
"PIL.Image.alpha_composite",
"collections.namedtuple"
] | [((269, 323), 'collections.namedtuple', 'namedtuple', (['"""ThumbnailFormats"""', "['compatible', 'webp']"], {}), "('ThumbnailFormats', ['compatible', 'webp'])\n", (279, 323), False, 'from collections import namedtuple\n'), ((2280, 2302), 'PIL.Image.open', 'Image.open', (['image_file'], {}), '(image_file)\n', (2290, 23... |
import requests
from bs4 import BeautifulSoup
# '트랜스포머'의 네이버 영화 리뷰 링크
url = "https://movie.naver.com/movie/bi/mi/review.naver?code=61521"
# 해당 url로 요청하여 html소스 가져오기
res = requests.get(url)
# html 파싱
soup = BeautifulSoup(res.text, 'lxml')
# 리뷰이벤트
ul = soup.find('ul', class_='rvw_list_area')
lis = ul.find_all('li')
#... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((172, 189), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (184, 189), False, 'import requests\n'), ((208, 239), 'bs4.BeautifulSoup', 'BeautifulSoup', (['res.text', '"""lxml"""'], {}), "(res.text, 'lxml')\n", (221, 239), False, 'from bs4 import BeautifulSoup\n')] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.