prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>test_bea.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import io
import os
from dlstats.fetchers.bea import BEA as Fetcher
import httpretty
from dlstats.tests.base import RESOURCES_DIR as BASE_RESOURCES_DIR
from dlstats.tests.fetchers.base import BaseFetcherTestCase
import unittest
from unit... | test_upsert_dataset_10101 |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid. |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
<|fim_middle|>
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handl... | """Provides a form to request an account."""
return flask.render_template("request_account.html") |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | """Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, er... |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | """Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check y... |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | """Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
... |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key)) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def <|fim_middle|>():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.... | request_account |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | request_account_submit |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | create_account |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | create_account_submit |
<|file_name|>ui_role_tree.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""Test of tree output using Firefox."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(PauseAction(3000))
sequence.append(KeyComboAction("<Alt>b"))
sequence.append(KeyComboAction("Return"))
sequence... | "SPEECH OUTPUT: 'collapsed'"])) |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
def __init__(self, size, position):<|fim▁hole|> pass<|fim▁end|> | |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
<|fim_middle|>
<|fim▁end|> | def __init__(self, size, position):
pass |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
def __init__(self, size, position):
<|fim_middle|>
<|fim▁end|> | pass |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
def <|fim_middle|>(self, size, position):
pass
<|fim▁end|> | __init__ |
<|file_name|>system.py<|end_file_name|><|fim▁begin|># coding: utf-8
# This file is part of Thomas Aquinas.
#
# Thomas Aquinas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or... | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
<|fim_middle|>
class M... | name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues') |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_... | if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues') |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_... | visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
object... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_... | if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_message'
verbose_name = _('message')
verbose_name_plural = _('messages') |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_... | app_label = 'karellen_kombu_transport_django' |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_... | app_label = 'karellen_kombu_transport_django' |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | #
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... |
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
#... |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | return {str}
def _roo |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | n {str}
def _roo |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | n {str}
def _cla |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | {any} obj
# @pa |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | enseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @pa |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... |
# @param {int} count 上限レコード数
# @return {saklient.cloud.mode |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | aram {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。 |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... |
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソ |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | ]} リソースオブジェクトの配列
|
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | aklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
de |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | odel_licenseinfo.Mo |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... |
## |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | ## @priv |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | ## @priv |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | ## @priv |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | Util.validate_type |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | 次に取得する |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | param |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | def re |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | ensei |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | m {str} n |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | lien |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | """ |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
<|fim_middle|>
<|fim▁end|> | _inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].... |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | """
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception t... |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | """
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids a... |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | _get_priorities |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
... | send_mail |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
<|fim▁hole|>https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (us... | |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix... | mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
f... |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix... | help = __doc__
def handle(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER ... |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix... | if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
raise CommandError("Please configure... |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix... | raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.") |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix... | get_imap_messages |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix... | handle |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else: |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | """This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
... |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
... |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_wi... |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json())) |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video) |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | import unittest2 as unittest |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | import unittest |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | unittest.main() |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | setUp |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | test_video_de_json |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | test_video_to_json |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | test_video_to_dict |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
... | },
'url': {'type': 'text'},
'title_plain': {'type': 'text'},
'content_plain': {'type': 'text'}, |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
<|fim_middle|>
def get_index_config(lang):
"""
Returns the elasticsearch index configuration.
Configures the analysers based on the languag... | """
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
scheme='http',
port=9200,
http_compress=True)
# test if it works
if not s... |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
... | """
Returns the elasticsearch index configuration.
Configures the analysers based on the language passed in.
"""
return {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
'mappings': {
... |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
... | raise ValueError('Credentials do not work for Elastic search') |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def <|fim_middle|>(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
... | get_es_client |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
... | get_index_config |
<|file_name|>cpu.py<|end_file_name|><|fim▁begin|># (void)walker hardware platform support
# Copyright (C) 2012-2013 David Holm <dholmster@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | 10: '0x%020lX',
8: '0x%016lX', |
<|file_name|>cpu.py<|end_file_name|><|fim▁begin|># (void)walker hardware platform support
# Copyright (C) 2012-2013 David Holm <dholmster@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | _register_fmt = {16: '0x%032lX',
10: '0x%020lX',
8: '0x%016lX',
4: '0x%08lX',
2: '0x%04lX',
1: '0x%02lX'}
def __init__(self, name):
self._name = name
def name(self):
return self._name
... |
<|file_name|>cpu.py<|end_file_name|><|fim▁begin|># (void)walker hardware platform support
# Copyright (C) 2012-2013 David Holm <dholmster@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | self._name = name |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.