prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>setAwayMessageEvent.py<|end_file_name|><|fim▁begin|>from common.log import logUtils as log from constants import clientPackets from constants import serverPackets def handle(userToken, packetData): # get token data username = userToken.username # Read packet data packetData = clientPackets.setAwayMe...
fokaMessage = "Your away message has been reset"
<|file_name|>setAwayMessageEvent.py<|end_file_name|><|fim▁begin|>from common.log import logUtils as log from constants import clientPackets from constants import serverPackets def handle(userToken, packetData): # get token data username = userToken.username # Read packet data packetData = clientPackets.setAwayMe...
fokaMessage = "Your away message is now: {}".format(packetData["awayMessage"])
<|file_name|>setAwayMessageEvent.py<|end_file_name|><|fim▁begin|>from common.log import logUtils as log from constants import clientPackets from constants import serverPackets def <|fim_middle|>(userToken, packetData): # get token data username = userToken.username # Read packet data packetData = clientPackets.s...
handle
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
def run(self, func, args): return interpret(func, args) def test_basic(self): pg = ParserGenerator(["NUMBER", "PLUS"]) @pg.production("main : expr") def main(p): return p[0] @pg.production("expr : expr PLUS expr") def expr_op(p): return ...
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
return interpret(func, args)
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
pg = ParserGenerator(["NUMBER", "PLUS"]) @pg.production("main : expr") def main(p): return p[0] @pg.production("expr : expr PLUS expr") def expr_op(p): return BoxInt(p[0].getint() + p[2].getint()) @pg.production("expr : NUMBER") def expr...
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
return p[0]
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
return BoxInt(p[0].getint() + p[2].getint())
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
return BoxInt(int(p[0].getstr()))
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
return parser.parse(FakeLexer([ Token("NUMBER", str(n)), Token("PLUS", "+"), Token("NUMBER", str(n)) ])).getint()
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
pg = ParserGenerator(["NUMBER", "PLUS"], precedence=[ ("left", ["PLUS"]), ]) @pg.production("main : expression") def main(state, p): state.count += 1 return p[0] @pg.production("expression : expression PLUS expression") def expression...
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
state.count += 1 return p[0]
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
state.count += 1 return BoxInt(p[0].getint() + p[2].getint())
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
state.count += 1 return BoxInt(int(p[0].getstr()))
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
state = ParserState() return parser.parse(FakeLexer([ Token("NUMBER", "10"), Token("PLUS", "+"), Token("NUMBER", "12"), Token("PLUS", "+"), Token("NUMBER", "-2"), ]), state=state).getint() + state.count
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
run
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
test_basic
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
main
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
expr_op
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
expr_num
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
f
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
test_state
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
main
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
expression_plus
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
expression_number
<|file_name|>test_ztranslation.py<|end_file_name|><|fim▁begin|>import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import B...
f
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
def setUp(self): self._options = options_for_unittests.GetCopy() self._skp_outdir = tempfile.mkdtemp('_skp_test') def tearDown(self): shutil.rmtree(self._skp_outdir) @decorators.Disabled('android') def testSkpicturePrinter(self): ps = self.CreateStorySetFromFileInUnittestDataDir('blank.html') ...
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
self._options = options_for_unittests.GetCopy() self._skp_outdir = tempfile.mkdtemp('_skp_test')
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
shutil.rmtree(self._skp_outdir)
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
ps = self.CreateStorySetFromFileInUnittestDataDir('blank.html') measurement = skpicture_printer.SkpicturePrinter(self._skp_outdir) results = self.RunMeasurement(measurement, ps, options=self._options) # Picture printing is not supported on all platforms. if results.failures: assert 'not suppo...
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
assert 'not supported' in results.failures[0].exc_info[1].message return
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
setUp
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
tearDown
<|file_name|>skpicture_printer_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import shutil import tempfile from telemetry import decorators from telemetry.testin...
testSkpicturePrinter
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010 by Yaco Sistemas <pmartin@yaco.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
url(r'^ajax/fields/tree/$', 'reports_ajax_fields', name='reports_ajax_fields'), url(r'^ajax/fields/options/$', 'reports_ajax_fields_options', name='reports_ajax_fields_options'),
<|file_name|>PROC_A_SUBJECT_D002015.py<|end_file_name|><|fim▁begin|>#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_A_SUBJECT...
sqlContext = HiveContext(sc) else:
<|file_name|>PROC_A_SUBJECT_D002015.py<|end_file_name|><|fim▁begin|>#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_A_SUBJECT...
if sys.argv[5] == "hive": sqlContext = HiveContext(sc)
<|file_name|>PROC_A_SUBJECT_D002015.py<|end_file_name|><|fim▁begin|>#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_A_SUBJECT...
sqlContext = HiveContext(sc)
<|file_name|>PROC_A_SUBJECT_D002015.py<|end_file_name|><|fim▁begin|>#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_A_SUBJECT...
sqlContext = SQLContext(sc)
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
for f in [x.strip() for x in open(argv[1])]:
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
pass
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
pass_ = 0 fail_compile_parse = 1 fail_compile_sem = 2 fail_compile_ice = 3 fail_c = 4 fail_run = 5 fail_output = 6 fail_other = 7 disable = 8
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
if v not in m: raise Exception("Unknown value '%s'" % v) return m[v]
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
testname = os.path.basename(filename) print("Test '%s'..." % testname) workdir = tempfile.mkdtemp(prefix="boringtest") tempfiles = [] src = open(filename) headers = Table() headers.mode = TestMode.pass_ headers.is_expr = False headers.stdout = None while True: hline = src...
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
if headers.mode == TestMode.disable: return TestMode.disable # make is for fags tc = os.path.join(workdir, "t.c") tcf = open(tc, "w") tempfiles.append(tc) res = subprocess.call(["./main", "cg_c", filename], stdout=tcf) tcf.close() if res != 0: ...
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
base = os.path.dirname(list_file_name) for f in [x.strip() for x in open(argv[1])]: run_test(os.path.join(base, f)) print("SUMMARY:") test_sum = 0 for m in test_modes: print(" %s: %d" % (test_mode_names[m][1], test_stats[m])) test_sum += test_stats[m] passed_tests = te...
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
raise Exception("Unknown value '%s'" % v)
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
break
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
break
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
headers.mode = pick(value, test_mode_values)
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
headers.is_expr = pick(value, {"normal": False, "expr": True})
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
term = value + "*/" stdout = "" while True: line = src.readline() if not line: raise Exception("unterminated STDOUT header") if line.strip() == term: break stdout += line ...
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
raise Exception("unterminated STDOUT header")
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
break
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
raise Exception("Unknown header '%s'" % name)
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
return TestMode.disable
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
if res == 1: return TestMode.fail_compile_parse if res == 2: return TestMode.fail_compile_sem return TestMode.fail_compile_ice
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
return TestMode.fail_compile_parse
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
return TestMode.fail_compile_sem
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
return TestMode.fail_c
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
return TestMode.fail_run
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
print("Program output: >\n%s<\nExpected: >\n%s<" % (output, headers.stdout)) return TestMode.fail_output
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
pass
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
res = TestMode.pass_
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
if headers.mode != TestMode.pass_: res = TestMode.fail_other
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
res = TestMode.fail_other
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
print("OMG OMG OMG ------- Some tests have failed ------- OMG OMG OMG") sys.exit(1)
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
argv = sys.argv if len(argv) != 2: print("Usage: %s tests.lst" % argv[0]) sys.exit(1) #subprocess.check_call(["make", "main"]) run_tests(argv[1])
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
print("Usage: %s tests.lst" % argv[0]) sys.exit(1)
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
pick
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
run_test
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
do_run
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
run_tests
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
self._backend = backend if ctx is None: self._ctx = self._backend.create_hash_ctx(self.algorithm)
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
def __init__(self, algorithm, backend, ctx=None): if not isinstance(backend, HashBackend): raise UnsupportedAlgorithm( "Backend object does not implement HashBackend.", _Reasons.BACKEND_MISSING_INTERFACE ) if not isinstance(algorithm, interfac...
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
if not isinstance(backend, HashBackend): raise UnsupportedAlgorithm( "Backend object does not implement HashBackend.", _Reasons.BACKEND_MISSING_INTERFACE ) if not isinstance(algorithm, interfaces.HashAlgorithm): raise TypeError("Expect...
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
if self._ctx is None: raise AlreadyFinalized("Context was already finalized.") if not isinstance(data, bytes): raise TypeError("data must be bytes.") self._ctx.update(data)
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
if self._ctx is None: raise AlreadyFinalized("Context was already finalized.") return Hash( self.algorithm, backend=self._backend, ctx=self._ctx.copy() )
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
if self._ctx is None: raise AlreadyFinalized("Context was already finalized.") digest = self._ctx.finalize() self._ctx = None return digest
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "sha1" digest_size = 20 block_size = 64
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "sha224" digest_size = 28 block_size = 64
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "sha256" digest_size = 32 block_size = 64
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "sha384" digest_size = 48 block_size = 128
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "sha512" digest_size = 64 block_size = 128
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "ripemd160" digest_size = 20 block_size = 64
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "whirlpool" digest_size = 64 block_size = 64
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
name = "md5" digest_size = 16 block_size = 64
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
raise UnsupportedAlgorithm( "Backend object does not implement HashBackend.", _Reasons.BACKEND_MISSING_INTERFACE )
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
raise TypeError("Expected instance of interfaces.HashAlgorithm.")
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
self._ctx = self._backend.create_hash_ctx(self.algorithm)
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
self._ctx = ctx
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
raise AlreadyFinalized("Context was already finalized.")
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
raise TypeError("data must be bytes.")
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
raise AlreadyFinalized("Context was already finalized.")
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
raise AlreadyFinalized("Context was already finalized.")
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
__init__
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
update
<|file_name|>hashes.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography imp...
copy