prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Utility methods, for compatibility between Python version :author: Thomas Calmant :copyright: Copyright 2017, Thomas Calmant :license: Apache License 2.0 :version: 0.3.1 .. Copyright 2017 Thomas Calmant ...
from_bytes
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Utility methods, for compatibility between Python version :author: Thomas Calmant :copyright: Copyright 2017, Thomas Calmant :license: Apache License 2.0 :version: 0.3.1 .. Copyright 2017 Thomas Calmant ...
to_bytes
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Utility methods, for compatibility between Python version :author: Thomas Calmant :copyright: Copyright 2017, Thomas Calmant :license: Apache License 2.0 :version: 0.3.1 .. Copyright 2017 Thomas Calmant ...
from_bytes
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Utility methods, for compatibility between Python version :author: Thomas Calmant :copyright: Copyright 2017, Thomas Calmant :license: Apache License 2.0 :version: 0.3.1 .. Copyright 2017 Thomas Calmant ...
is_enum
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Utility methods, for compatibility between Python version :author: Thomas Calmant :copyright: Copyright 2017, Thomas Calmant :license: Apache License 2.0 :version: 0.3.1 .. Copyright 2017 Thomas Calmant ...
is_enum
<|file_name|>BuildAndRun.py<|end_file_name|><|fim▁begin|>macimport os import subprocess name = "gobuildmaster" current_hash = "" for line in os.popen("md5sum " + name).readlines(): current_hash = line.split(' ')[0] # Move the old version over for line in os.popen('cp ' + name + ' old' + name).readlines(): ...
pass for line in os.popen('echo "" > out.txt').readlines(): pass for line in os.popen('killall ' + name).readlines():
<|file_name|>BuildAndRun.py<|end_file_name|><|fim▁begin|>macimport os import subprocess name = "gobuildmaster" current_hash = "" for line in os.popen("md5sum " + name).readlines(): current_hash = line.split(' ')[0] # Move the old version over for line in os.popen('cp ' + name + ' old' + name).readlines(): ...
running = True
<|file_name|>BuildAndRun.py<|end_file_name|><|fim▁begin|>macimport os import subprocess name = "gobuildmaster" current_hash = "" for line in os.popen("md5sum " + name).readlines(): current_hash = line.split(' ')[0] # Move the old version over for line in os.popen('cp ' + name + ' old' + name).readlines(): ...
if not running: for line in os.popen('cat out.txt | mail -E -s "Crash Report ' + name + '" brotherlogic@gmail.com').readlines(): pass for line in os.popen('echo "" > out.txt').readlines(): pass for line in os.popen('killall ' + name).readlines(): pass subprocess.Popen...
<|file_name|>BuildAndRun.py<|end_file_name|><|fim▁begin|>macimport os import subprocess name = "gobuildmaster" current_hash = "" for line in os.popen("md5sum " + name).readlines(): current_hash = line.split(' ')[0] # Move the old version over for line in os.popen('cp ' + name + ' old' + name).readlines(): ...
for line in os.popen('cat out.txt | mail -E -s "Crash Report ' + name + '" brotherlogic@gmail.com').readlines(): pass
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2012-2016 Ben Croston Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ...
<|file_name|>test_artificial_128_None_LinearTrend_12__20.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art <|fim▁hole|><|fim▁end|>
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 0);
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
return models.name_to_url(value)
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
def __init__(self, html_var, render_plugins=True, *args, **kwargs): super(PageContentNode, self).__init__(*args, **kwargs) self.html_var = template.Variable(html_var) self.render_plugins = render_plugins def render(self, context): try: html = unicode(self.html_var.re...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
super(PageContentNode, self).__init__(*args, **kwargs) self.html_var = template.Variable(html_var) self.render_plugins = render_plugins
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
try: html = unicode(self.html_var.resolve(context)) t = Template(html_to_template_text(html, context, self.render_plugins)) return self.render_template(t, context) except: if settings.TEMPLATE_DEBUG: ...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
""" Base class for including some named content inside a other content. Subclass and override get_content() and get_title() to return HTML or None. The name of the content to include is stored in self.name All other parameters are stored in self.args, without quotes (if any). """ def __init...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
super(IncludeContentNode, self).__init__(*args, **kwargs) bits = token.split_contents() if len(bits) < 2: raise template.TemplateSyntaxError, ('%r tag requires at least one' ' argument' % token.contents.split()[0]) self.args = [] fo...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
""" Override this to return content to be included. """ return None
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
""" Override this to return a title or None to omit it. """ return self.name
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
try: template_text = '' if 'showtitle' in self.args: title = self.get_title(context) if title: template_text += '<h2>%s</h2>' % title template_text += self.get_content(context) template = Template(template_text) ...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
def __init__(self, *args, **kwargs): super(IncludePageNode, self).__init__(*args, **kwargs) try: self.page = Page.objects.get(slug__exact=slugify(self.name)) except Page.DoesNotExist: self.page = None def get_title(self, context): if not self.page: ...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
super(IncludePageNode, self).__init__(*args, **kwargs) try: self.page = Page.objects.get(slug__exact=slugify(self.name)) except Page.DoesNotExist: self.page = None
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
if not self.page: return None return ('<a href="%s">%s</a>' % (self.get_page_url(), self.page.name))
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
if self.page: slug = self.page.pretty_slug else: slug = name_to_url(self.name) return reverse('pages:show', args=[slug])
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
if not self.page: return ('<p class="plugin includepage">Unable to include ' '<a href="%s" class="missing_link">%s</a></p>' % (self.get_page_url(), self.name)) # prevent endless loops context_page = context['page'] include_stack = conte...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
""" Render tags and plugins """ try: tag, html_var = token.split_contents() except ValueError: raise template.TemplateSyntaxError, ("%r tag requires one argument" % token.contents.split()[0]) return PageContentNode(html_var, render_plu...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
""" Render tags only, does not render plugins """ return do_render_plugins(parser, token, render_plugins=False)
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
return IncludePageNode(parser, token)
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
return text[0] == text[-1] and text[0] in ('"', "'")
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
nodelist = parser.parse(('endembed_code',)) parser.delete_first_token() return EmbedCodeNode(nodelist)
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
try: tag, query = token.split_contents() except ValueError: raise template.TemplateSyntaxError('%r tag requires one argument' % token.contents.split()[0]) if not is_quoted(query): raise template.TemplateSyntaxError( ...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
try: tag, href = token.split_contents() except ValueError: raise template.TemplateSyntaxError("%r tag requires one argument" % token.contents.split()[0]) if not is_quoted(href): raise template.TemplateSyntaxError( ...
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
raise
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
raise template.TemplateSyntaxError, ('%r tag requires at least one' ' argument' % token.contents.split()[0])
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
b = unescape_string_literal(b)
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
title = self.get_title(context) if title: template_text += '<h2>%s</h2>' % title
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
template_text += '<h2>%s</h2>' % title
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
raise
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
return None
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
slug = self.page.pretty_slug
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
slug = name_to_url(self.name)
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
return ('<p class="plugin includepage">Unable to include ' '<a href="%s" class="missing_link">%s</a></p>' % (self.get_page_url(), self.name))
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
return ('<p class="plugin includepage">Unable to' ' include <a href="%s">%s</a>: endless include' ' loop.</p>' % (self.get_page_url(), self.page.name))
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
raise template.TemplateSyntaxError( "%r tag's argument should be in quotes" % token.contents.split()[0])
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
raise template.TemplateSyntaxError( "%r tag's argument should be in quotes" % token.contents.split()[0])
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
name_to_url
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
__init__
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
render
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
__init__
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
get_content
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
get_title
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
render
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
__init__
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
get_title
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
get_page_url
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
get_content
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
do_render_plugins
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
do_render_tags
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
do_include_page
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
is_quoted
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
do_embed_code
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
do_searchbox
<|file_name|>pages_tags.py<|end_file_name|><|fim▁begin|>from django import template from django.template.loader_tags import BaseIncludeNode from django.template import Template from django.conf import settings from pages.plugins import html_to_template_text, SearchBoxNode from pages.plugins import LinkNode, EmbedCodeN...
do_link
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
# Erase buffered contents def erase(self): self.truncate(0) self.seek(0, 0)
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
ef peek(self): oldPos = self.tell() b = self.read(1) newPos = self.tell() if((newPos == (oldPos+1)) and (b != '')): r = ord(b) else: r = None self.seek(oldPos, 0) return r # Pop a single byte (as integer representation) def get(self): return ord(self.read(1)) # Push a single byte (as intege...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
ldPos = self.tell() b = self.read(1) newPos = self.tell() if((newPos == (oldPos+1)) and (b != '')): r = ord(b) else: r = None self.seek(oldPos, 0) return r
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
eturn ord(self.read(1))
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
elf.write(chr(b)) return
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
elf.truncate(0) self.seek(0, 0) return
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
elf.erase() self.write(s) return
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
eturn (I.peek() != None)
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
f (x > 255): raise Exception("The integer %d cannot be encoded on 8 bits." % x) else: return x
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
f len(val1) != len(val2): return False result = 0 for x, y in zip(val1, val2): result |= ord(x) ^ ord(y) return result == 0
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
= ord(b)
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
= None
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
aise Exception("The integer %d cannot be encoded on 8 bits." % x)
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
eturn x
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
eturn False
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
eek(
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
et(
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
ut(
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
rase(
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
etvalue(
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
asMore(
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
nc8(
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël P...
onstant_time_compare(
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- <|fim▁hole|>from django.contrib import admin from ionyweb.plugin_app.plugin_video.models import Plugin_Video admin.site.register(Plugin_Video)<|fim▁end|>
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
elif expr.is_op("FLAG_ADD_CF"):
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): <|fim_middle|> def simp_flags(_, expr): args = expr.args if expr.is_op("FLAG_EQ"):...
if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size: return arg return ExprCompose(arg, ExprInt(0, expr.size - arg.size)) if expr.op.startswith("signExt_"): arg = expr.args[0] add_size = expr.size - arg.size new_expr = ExprC...
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
args = expr.args if expr.is_op("FLAG_EQ"): return ExprCond(args[0], ExprInt(0, 1), ExprInt(1, 1)) elif expr.is_op("FLAG_EQ_AND"): op1, op2 = args return ExprCond(op1 & op2, ExprInt(0, 1), ExprInt(1, 1)) elif expr.is_op("FLAG_SIGN_SUB"): return (args[0] - args[1]).msb()...
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): <|fim_middle|> if expr.op.startswith(...
arg = expr.args[0] if expr.size == arg.size: return arg return ExprCompose(arg, ExprInt(0, expr.size - arg.size))
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
return arg
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
arg = expr.args[0] add_size = expr.size - arg.size new_expr = ExprCompose( arg, ExprCond( arg.msb(), ExprInt(size2mask(add_size), add_size), ExprInt(0, add_size) ) ) return new_expr
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
return ExprCond(args[0], ExprInt(0, 1), ExprInt(1, 1))
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
op1, op2 = args return ExprCond(op1 & op2, ExprInt(0, 1), ExprInt(1, 1))
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
return (args[0] - args[1]).msb()
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
return ExprCond( args[0] - args[1], ExprInt(0, 1), ExprInt(1, 1), )
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
op1, op2 = args res = op1 + op2 return (((op1 ^ op2) ^ res) ^ ((op1 ^ res) & (~(op1 ^ op2)))).msb()
<|file_name|>simplifications_explicit.py<|end_file_name|><|fim▁begin|>from miasm.core.utils import size2mask from miasm.expression.expression import ExprInt, ExprCond, ExprCompose, \ TOK_EQUAL def simp_ext(_, expr): if expr.op.startswith('zeroExt_'): arg = expr.args[0] if expr.size == arg.size...
op1, op2 = args res = op1 - op2 return (((op1 ^ op2) ^ res) ^ ((op1 ^ res) & (op1 ^ op2))).msb()