prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
return self.__service
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
print "[StreamService] handle command", cmd self.ref = eServiceReference(cmd)
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
if service is self.__service: return print "[StreamService] RECORD event for us:", service self.changed((self.CHANGED_ALL, ))
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
if self.ref is None: print "[StreamService] has no service ref set" return print "[StreamService]e execBegin", self.ref.toString() if SystemInfo["CanNotDoSimultaneousTranscodeAndPIP"]: from Screens.InfoBar import InfoBar if InfoBar.instance and hasattr(InfoBar.instance.session, 'pipshown') and InfoBar...
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
print "[StreamService] execEnd", self.ref.toString() self.navcore.record_event.remove(self.recordEvent) if self.__service is not None: if self.__service.__deref__() in StreamServiceList: StreamServiceList.remove(self.__service.__deref__()) self.navcore.stopRecordService(self.__service) self.__service...
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
return
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
print "[StreamService] has no service ref set" return
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
from Screens.InfoBar import InfoBar if InfoBar.instance and hasattr(InfoBar.instance.session, 'pipshown') and InfoBar.instance.session.pipshown: hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP() print "[StreamService] try to disable pip before start stream" if hasattr(InfoBar.instanc...
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP() print "[StreamService] try to disable pip before start stream" if hasattr(InfoBar.instance.session, 'pip'): del InfoBar.instance.session.pip InfoBar.instance.session.pipshown = False
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
del InfoBar.instance.session.pip InfoBar.instance.session.pipshown = False
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
if self.__service.__deref__() not in StreamServiceList: StreamServiceList.append(self.__service.__deref__()) self.__service.prepareStreaming() self.__service.start()
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
StreamServiceList.append(self.__service.__deref__())
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
if self.__service.__deref__() in StreamServiceList: StreamServiceList.remove(self.__service.__deref__()) self.navcore.stopRecordService(self.__service) self.__service = None self.ref = None
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
StreamServiceList.remove(self.__service.__deref__())
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def <|fim_middle|>(self, navcore): Source.__init__(self) ...
__init__
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
serviceEvent
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
getService
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
handleCommand
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
recordEvent
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
execBegin
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self....
execEnd
<|file_name|>consumers.py<|end_file_name|><|fim▁begin|>import logging import requests from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template from django.utils import timezone from invitations.mode...
<|file_name|>consumers.py<|end_file_name|><|fim▁begin|>import logging import requests from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template from django.utils import timezone from invitations.mode...
try: invite = Invitation.objects.get( id=message.get('id'), status__in=[Invitation.PENDING, Invitation.ERROR], ) except Invitation.DoesNotExist: sentry.error("Invitation to send not found", exc_info=True, extra={'message': message}) return invite.statu...
<|file_name|>consumers.py<|end_file_name|><|fim▁begin|>import logging import requests from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template from django.utils import timezone from invitations.mode...
subject = "[ContactOtter] Invitation to share %s's contact book" % (invite.sender)
<|file_name|>consumers.py<|end_file_name|><|fim▁begin|>import logging import requests from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template from django.utils import timezone from invitations.mode...
send_invite
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model):<|fim▁hole|> """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': ...
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): <|fim_middle|> class sale_order(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order' ...
""" OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.boolean('Attach Brochure', required=False, help="""If you check this option, the first attachment related to the product_id marked as brochure will be printed as extra info wit...
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
""" OpenERP Model : sale_order_line """ _inherit = 'sale.order' def print_with_attachment(self, cr, user, ids, context={}): for o in self.browse(cr, user, ids, context): for ol in o.order_line: if ol.att_bro: print "Im Here i will go to print ...
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
for o in self.browse(cr, user, ids, context): for ol in o.order_line: if ol.att_bro: print "Im Here i will go to print %s " % ol.name return True
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
user = self.pool.get('res.users').browse(cr, uid, uid) print user if not user.company_id: raise except_osv(_('ERROR !'), _( 'There is no company configured for this user')) return user.company_id
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
report = self.__get_company_object(cr, uid).sale_report_id if not report: rep_id = self.pool.get("ir.actions.report.xml").search( cr, uid, [('model', '=', 'sale.order'), ], order="id")[0] report = self.pool.get( "ir.actions.report.xml").browse(cr, ...
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
pq = super(sale_order, self).print_quotation(cr,uid,ids, context) return {'type': 'ir.actions.report.xml', 'report_name': self._get_report_name(cr, uid, context), 'datas': pq['datas'], 'nodestroy': True}
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
print "Im Here i will go to print %s " % ol.name
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
raise except_osv(_('ERROR !'), _( 'There is no company configured for this user'))
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
rep_id = self.pool.get("ir.actions.report.xml").search( cr, uid, [('model', '=', 'sale.order'), ], order="id")[0] report = self.pool.get( "ir.actions.report.xml").browse(cr, uid, rep_id)
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
print_with_attachment
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
__get_company_object
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
_get_report_name
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ class sale_order_line(osv.Model): """ OpenERP Model : sale_order_line """ _inherit = 'sale.order.line' _columns = { 'att_bro': fields.bool...
print_quotation
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
"""An MD2 hash object. Do not instantiate directly. Use the :func:`new` function. :ivar oid: ASN.1 Object ID :vartype oid: string :ivar block_size: the size in bytes of the internal message block, input to the compression function :vartype block_size: integer :ivar d...
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
state = VoidPointer() result = _raw_md2_lib.md2_init(state.address_of()) if result: raise ValueError("Error %d while instantiating MD2" % result) self._state = SmartPointer(state.get(), _raw_md2_lib.md2_destroy) ...
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
"""Continue hashing of a message by consuming the next chunk of data. Args: data (byte string/byte array/memoryview): The next chunk of the message being hashed. """ result = _raw_md2_lib.md2_update(self._state.get(), c_uint8_ptr(dat...
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
"""Return the **binary** (non-printable) digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Binary form. :rtype: byte string """ bfr = create_string_buffer(self.digest_size) result = _ra...
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
"""Return the **printable** digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Hexadecimal encoded. :rtype: string """ return "".join(["%02x" % bord(x) for x in self.digest()])
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
"""Return a copy ("clone") of the hash object. The copy will have the same internal state as the original hash object. This can be used to efficiently compute the digests of strings that share a common initial substring. :return: A hash object of the same type "...
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
return MD2Hash(data)
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
"""Create a new hash object. :parameter data: Optional. The very first chunk of the message to hash. It is equivalent to an early call to :meth:`MD2Hash.update`. :type data: byte string/byte array/memoryview :Return: A :class:`MD2Hash` hash object """ return MD2Hash().new(data...
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
raise ValueError("Error %d while instantiating MD2" % result)
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
self.update(data)
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
raise ValueError("Error %d while instantiating MD2" % result)
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
raise ValueError("Error %d while instantiating MD2" % result)
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
raise ValueError("Error %d while copying MD2" % result)
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
__init__
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
update
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
digest
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
hexdigest
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
copy
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
new
<|file_name|>MD2.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
new
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evalu...
if len(sys.argv) > 1: expr = sys.argv[1] parts = parse_expression_into_parts(expr) print "Evaluating %s == %s" % (expr, evaluate_postfix(parts))
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): <|fim_middle|> def evaluate_expression(a, b, op): raise NotImplementedError("complete me!") def evaluate_postfix(parts): raise NotImplementedError("complete me!") if ...
""" Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!")
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evalu...
raise NotImplementedError("complete me!")
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evalu...
raise NotImplementedError("complete me!")
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evalu...
expr = None if len(sys.argv) > 1: expr = sys.argv[1] parts = parse_expression_into_parts(expr) print "Evaluating %s == %s" % (expr, evaluate_postfix(parts)) else: print 'Usage: python postfix.py "<expr>" -- i.e. python postfix.py "9 1 3 + 2 * -"' print "Spaces are req...
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evalu...
expr = sys.argv[1] parts = parse_expression_into_parts(expr) print "Evaluating %s == %s" % (expr, evaluate_postfix(parts))
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evalu...
print 'Usage: python postfix.py "<expr>" -- i.e. python postfix.py "9 1 3 + 2 * -"' print "Spaces are required between every term."
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def <|fim_middle|>(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evaluate_expressio...
parse_expression_into_parts
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def <|fim...
evaluate_expression
<|file_name|>postfix.py<|end_file_name|><|fim▁begin|>import sys from stack import Stack def parse_expression_into_parts(expression): """ Parse expression into list of parts :rtype : list :param expression: str # i.e. "2 * 3 + ( 2 - 3 )" """ raise NotImplementedError("complete me!") def evalu...
evaluate_postfix
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: <|fim_middle|> <|fim▁end|>
"""Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exception is never logged. This violates the Zen of Python: 'Errors should never pass silently. Unless explicitly sile...
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
self.exc = exc self.hndl = handler self.cls = type(exc) self.tb = None
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
exc = self.exc if exc is not None: self.exc = None self.tb = traceback.format_exception(exc.__class__, exc, exc.__traceback__)
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
self.exc = None self.tb = None
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
if self.tb: self.hndl(self.cls, self.tb)
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
self.exc = None self.tb = traceback.format_exception(exc.__class__, exc, exc.__traceback__)
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
self.hndl(self.cls, self.tb)
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
__init__
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
activate
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
clear
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exce...
__del__
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
class AuthorUpdate(generic.UpdateView):
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
template_name = 'generic_views/about.html' def get_context_data(self, **kwargs): return { 'params': kwargs, 'key': 'value' }
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
return { 'params': kwargs, 'key': 'value' }
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
template_name = 'generic_views/detail.html' def get_object(self): return {'foo': 'bar'}
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
return {'foo': 'bar'}
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
queryset = Artist.objects.all()
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
queryset = Author.objects.all()
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
queryset = Page.objects.all() template_name_field = 'template'
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
"""A ListView that doesn't use a model.""" queryset = [ {'first': 'John', 'last': 'Lennon'}, {'last': 'Yoko', 'last': 'Ono'} ] template_name = 'generic_views/list.html'
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
queryset = Author.objects.all()
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
model = Artist
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
queryset = Author.objects.all()
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
model = Author success_url = '/list/authors/'
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
model = Author form_class = AuthorForm template_name = 'generic_views/form.html' context_object_name = 'thingy' def get_success_url(self): return reverse('author_detail', args=[self.object.id,])
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
return reverse('author_detail', args=[self.object.id,])
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
post = method_decorator(login_required)(AuthorCreate.post)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
model = Artist
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views import generic from regressiontests.generic_views.models import Artist, Author, Book, Page fro...
queryset = Author.objects.all()