Instruction
stringlengths
362
7.83k
output_code
stringlengths
1
945
Continue the code snippet: <|code_start|>#!/usr/bin/env python # encoding: utf-8 class UpdateGridImagesTask(object): def __init__(self, rom_finder): self.rom_finder = rom_finder def __call__(self, app_settings, users, dry_run): roms = self.rom_finder.roms_for_consoles( app_settings.config, a...
grid_updater = steam_grid_updater.SteamGridUpdater(provider)
Predict the next line for this snippet: <|code_start|>#!/usr/bin/env python # encoding: utf-8 class UpdateGridImagesTask(object): def __init__(self, rom_finder): self.rom_finder = rom_finder def __call__(self, app_settings, users, dry_run): roms = self.rom_finder.roms_for_consoles( app_settings.co...
logger.info("::Updating grid images for U:%s" % user.user_id)
Here is a snippet: <|code_start|> self.assertEquals(self.synchronizer.added_shortcuts(old, new), [shortcut3, shortcut4]) def test_removed_shortcuts_doesnt_return_shortcuts_that_still_exist(self): shortcut1 = steam_model.Shortcut("Game1", "/Path/to/game1", "/Path/to", "", [roms.ICE_FLAG_TAG]) shortcut2 = s...
rom1 = model.ROM(name = 'Game1', path = '/Path/to/game1', console = fixtures.consoles.flagged)
Predict the next line after this snippet: <|code_start|> class SteamShortcutSynchronizerTests(unittest.TestCase): def setUp(self): self.steam_fixture = fixtures.SteamFixture() self.user_fixture = fixtures.UserFixture(self.steam_fixture) self.mock_config = mock() self.mock_archive = mock() <|co...
self.synchronizer = steam_shortcut_synchronizer.SteamShortcutSynchronizer(self.mock_config, self.mock_archive)
Using the snippet: <|code_start|> def test_unmanaged_shortcuts_returns_all_shortcuts_when_given_no_history(self): dummy_console = self._create_dummy_console("/Some/Other/Path") random_shortcut = steam_model.Shortcut("Plex", "/Some/Random/Path/plex", "/Some/Random/Path", "", []) unmanaged = self.synchroniz...
tagged_shortcut = steam_model.Shortcut("Game", "/Path/to/game", "/Path/to", "", [roms.ICE_FLAG_TAG])
Predict the next line after this snippet: <|code_start|># encoding: utf-8 class LogsTests(unittest.TestCase): def setUp(self): self.tempdir = tempfile.mkdtemp() <|code_end|> using the current file's imports: import os import shutil import tempfile import unittest from mockito import * from ice import logs ...
self.old_log_file_location = logs.paths.log_file_location
Based on the snippet: <|code_start|> class EmulatorBackedObjectAdapter(object): def __init__(self, filesystem): self.filesystem = filesystem def new(self, backing_store, identifier): name = identifier location = backing_store.get(identifier, 'location') fmt = backing_store.get(identifie...
logger.error("Missing location for Emulator: `%s`" % emulator.name)
Predict the next line after this snippet: <|code_start|> class EmulatorBackedObjectAdapter(object): def __init__(self, filesystem): self.filesystem = filesystem def new(self, backing_store, identifier): name = identifier location = backing_store.get(identifier, 'location') fmt = backing...
return Emulator(
Predict the next line after this snippet: <|code_start|> @parameterized.expand([ # NES has no custom image directory set, so it should use the default (fixtures.consoles.nes, '/roms/', '/roms/NES'), # SNES, on the other hand, does, so we should use the provided one (fixtures.consoles.snes, '/roms/', '/...
console = model.Console("Nintendo", "NES", extensions, "", "", "", "", None)
Predict the next line for this snippet: <|code_start|>""" keyboard A submodule inside tinygame that provides more game like keyboard input This code is based largley on the post at http://effbot.org/pyfaq/how-do-i-get-a-single-keypress-at-a-time.htm """ # to get game keyboard control, first we load some low level opera...
KEY_ESCAPE = ESCAPE
Given snippet: <|code_start|>""" keyboard A submodule inside tinygame that provides more game like keyboard input This code is based largley on the post at http://effbot.org/pyfaq/how-do-i-get-a-single-keypress-at-a-time.htm """ # to get game keyboard control, first we load some low level operating system modules/libra...
KEY_DELETE = CSI + "3~"
Based on the snippet: <|code_start|> def extend(this, iterable_item): if not iterable_item: return super(this.__class__, this).extend(iterable_item) # Update population flag. self.update_flag() # }}} sel...
if not isinstance(indv, IndividualBase):
Continue the code snippet: <|code_start|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Test case for Individual. ''' class IndividualTest(unittest.TestCase): def setUp(self): self.maxDiff = True def test_binary_encoding(self): ''' Make sure individual can decode and encode binary gene ...
indv = BinaryIndividual(ranges=[(0, 1)], eps=0.001)
Using the snippet: <|code_start|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Test case for built-in Uniform Crossover operator. ''' class UniformCrossoverTest(unittest.TestCase): def setUp(self): self.maxDiff def test_cross(self): ''' Make sure individuals can be crossed correctly. ...
father = BinaryIndividual(ranges=[(0, 1)]).init(solution=[0.398])
Continue the code snippet: <|code_start|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Test case for built-in Uniform Crossover operator. ''' class UniformCrossoverTest(unittest.TestCase): def setUp(self): self.maxDiff def test_cross(self): ''' Make sure individuals can be crossed corr...
crossover = UniformCrossover(pc=1.0, pe=0.5)
Next line prediction: <|code_start|> Logging transiently means that verbose logging messages like DEBUG will only appear on the last line of your terminal for a short period of time and important messages like WARNING will scroll like normal text. This allows you to log lots of messages without the...
width = max(min(utils.term.width, len(self.last)), len(data))
Here is a snippet: <|code_start|>#!/usr/bin/env python # # Copyright 2016 The Fabulous Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
p = TimedProgressBar('bar')
Here is a snippet: <|code_start|>#!/usr/bin/env python # # Copyright 2016 The Fabulous Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
stdout.write(display(bg=c))
Given snippet: <|code_start|>#!/usr/bin/env python # # Copyright 2016 The Fabulous Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/l...
stdout.write(display(bg=c))
Predict the next line for this snippet: <|code_start|> fabdir = os.path.dirname(fabulous.__file__) for fn in ['balls.png', 'fabulous/balls.png', os.path.join(fabdir, 'balls.png')]: if os.path.exists(fn): balls = fn break if not os.path.exists(ba...
printy(text.Text("Fabulous", shadow=True, skew=5))
Given the code snippet: <|code_start|> cube_color = lambda x,y,z: 16 + x + y*6 + z*6*6 for y in range(6): line = " " for z in range(6): for x in range(6): line += bg256(cube_color(x, y, z), ' ') line += " " printy(line) printy("") def f(xc...
width = utils.term.width
Continue the code snippet: <|code_start|> input = raw_input except NameError: pass def wait(): input("\nPress " + bold("enter") + " for more fun... ") printy("") def demo_image(): section("Semi-Transparent PNG") imp = " from fabulous import image\n " printy(bold(imp + 'print image.Image...
for line in image.Image(balls):
Using the snippet: <|code_start|> printy("") def demo_image(): section("Semi-Transparent PNG") imp = " from fabulous import image\n " printy(bold(imp + 'print image.Image("balls.png")\n')) balls = 'balls.png' fabdir = os.path.dirname(fabulous.__file__) for fn in ['balls.png', ...
for line in debug.DebugImage(balls):
Continue the code snippet: <|code_start|> wait() def full_chart(): # grayscales line = " " for xc in range(232, 256): line += bg256(xc, ' ') printy(line) line = " " for xc in range(232, 256)[::-1]: line += bg256(xc, ' ') printy(line) printy('') # cube pri...
rgb = xterm256.xterm_to_rgb(xc)
Next line prediction: <|code_start|># Copyright 2016 The Fabulous Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
printy("")
Based on the snippet: <|code_start|>#!/usr/bin/env python # # Copyright 2016 The Fabulous Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apach...
for color in Magic.COLORS.iterkeys():
Continue the code snippet: <|code_start|># Copyright 2016 The Fabulous Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
class DebugImage(image.Image):
Given snippet: <|code_start|># you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS"...
self.width = utils.term.width
Here is a snippet: <|code_start|> PATHS = [] class TemplateNotFound(Exception): pass class TemplateLoader(dict): def __init__(self, paths): self.paths = [ (pathlib.Path.cwd() / path).resolve() for path in paths ] def load(self, name, raw=False): for pat...
return kompile(src, raw=raw, filename=str(full_path), loader=self)
Given the code snippet: <|code_start|> ('{{ 12e-1 }}', '1.2'), ('{{ 12E-1 }}', '1.2'), ) for src, expect in TESTS: self.assertRendered(src, expect) class VariableSyntaxTest(TemplateTestCase): def test_direct(self): # A list of (template, context, output)...
('{{ a.b }}', {'a': Mock(b=1)}, '1'),
Based on the snippet: <|code_start|> parser = Parser(src, loader=loader) parser.load_library('knights.tags') parser.load_library('knights.helpers') parser.build_method('_root') if parser.parent: # Remove _root from the method list parser.methods = [ method for method in...
'ContextScope': ContextScope,
Here is a snippet: <|code_start|> def kompile(src, raw=False, filename='<compiler>', loader=None, **kwargs): ''' Creates a new class based on the supplied template, and returnsit. class Template(object): def __call__(self, context): return ''.join(self._iterator(context)) def...
parser = Parser(src, loader=loader)
Predict the next line after this snippet: <|code_start|> ''' parser = Parser(src, loader=loader) parser.load_library('knights.tags') parser.load_library('knights.helpers') parser.build_method('_root') if parser.parent: # Remove _root from the method list parser.methods = [ ...
'_': Helpers(parser.helpers),
Given the following code snippet before the placeholder: <|code_start|>''' Default helper functions ''' register = Library() @register.helper def addslashes(value): return value.replace('\\', '\\\\').replace('"', '\\"').replace("'", "\\'") @register.helper def capfirst(value): return value and value[0].upp...
'html': escape_html,
Predict the next line after this snippet: <|code_start|>''' Default helper functions ''' register = Library() @register.helper def addslashes(value): return value.replace('\\', '\\\\').replace('"', '\\"').replace("'", "\\'") @register.helper def capfirst(value): return value and value[0].upper() + value[1:...
'js': escape_js,
Based on the snippet: <|code_start|> '{% for a, b in seq %}{{ a }} == {{ b }},{% endfor %}', 'a == 1,b == 2,', {'seq': (('a', 1), ('b', 2))} ) def test_for_empty_false(self): self.assertRendered( '{% for a, b in seq %}{{ a }} == {{ b }},{% empty %}empt...
{'obj': Mock(seq=[1, 2, 3, 4])},
Given snippet: <|code_start|> class KnightsTemplater(BaseEngine): def __init__(self, params): params = params.copy() super(KnightsTemplater, self).__init__(params) self.loader = TemplateLoader(self.template_dirs) def from_string(self, template_code): <|code_end|> , continue by pre...
tmpl = kompile(template_code, loader=self.loader)
Using the snippet: <|code_start|> class KnightsTemplater(BaseEngine): def __init__(self, params): params = params.copy() super(KnightsTemplater, self).__init__(params) <|code_end|> , determine the next line of code. You have imports: from collections import defaultdict from django.template.ba...
self.loader = TemplateLoader(self.template_dirs)
Next line prediction: <|code_start|> class KnightsTemplater(BaseEngine): def __init__(self, params): params = params.copy() super(KnightsTemplater, self).__init__(params) self.loader = TemplateLoader(self.template_dirs) def from_string(self, template_code): tmpl = kompile(...
except TemplateNotFound:
Given the code snippet: <|code_start|> class Mock(object): def __init__(self, **kwargs): for k, v in kwargs.items(): setattr(self, k, v) class TemplateTestCase(unittest.TestCase): @classmethod def setUpClass(cls): cls.loader = loader.TemplateLoader([ pathlib.Path...
tmpl = compiler.kompile(source, loader=self.loader)
Based on the snippet: <|code_start|> class Mock(object): def __init__(self, **kwargs): for k, v in kwargs.items(): setattr(self, k, v) class TemplateTestCase(unittest.TestCase): @classmethod def setUpClass(cls): <|code_end|> , predict the immediate next line with the help of imports...
cls.loader = loader.TemplateLoader([
Here is a snippet: <|code_start|> if style == self.langDic[self.langName]['m042_default']: cmds.setAttr(self.moduleGrp+".style", 0) # for Biped style: if style == self.langDic[self.langName]['m026_biped']: cmds.setAttr(self.moduleGrp+".style", 1) def createGuide(self...
dpUtils.useDefaultRenderLayer()
Continue the code snippet: <|code_start|> cmds.addAttr(self.moduleGrp, longName="flip", attributeType='bool') cmds.setAttr(self.moduleGrp+".flip", 0) cmds.setAttr(self.moduleGrp+".moduleNamespace", self.moduleGrp[:self.moduleGrp.rfind(":")], type='string') cmds.addAttr(s...
dpUtils.useDefaultRenderLayer()
Using the snippet: <|code_start|> noseName = dpUIinst.langDic[dpUIinst.langName]['m078_nose'] tongueName = dpUIinst.langDic[dpUIinst.langName]['m077_tongue'] tailName = dpUIinst.langDic[dpUIinst.langName]['m039_tail'] toeName = dpUIinst.langDic[dpUIinst.langName]['c013_RevFoot_D'].capital...
spineInstance = dpUIinst.initGuide('dpSpine', guideDir, RigType.quadruped)
Using the snippet: <|code_start|> cmds.setAttr(self.cvUpperLipLoc+".translateY", 2.9) cmds.setAttr(self.cvUpperLipLoc+".translateZ", 3.5) cmds.setAttr(self.cvLowerLipLoc+".translateY", 2.3) cmds.setAttr(self.cvLowerLipLoc+".translateZ", 3.5) cmds.setAttr(self.cvLCornerLipLoc+".tra...
dpUtils.useDefaultRenderLayer()
Given the code snippet: <|code_start|># importing libraries: # global variables to this module: CLASS_NAME = "ColorOverride" TITLE = "m047_colorOver" DESCRIPTION = "m048_coloOverDesc" ICON = "/Icons/dp_colorOverride.png" DPCO_VERSION = "2.1" class ColorOverride(object): def __init__(self, dpUIinst, presetDic...
self.ctrls = dpControls.ControlClass(self.dpUIinst, self.presetDic, self.presetName)
Continue the code snippet: <|code_start|> # get rigs names: self.mirrorNames = cmds.getAttr(self.moduleGrp+".mirrorName") # get first and last letters to use as side initials (prefix): sideList = [self.mirrorNames[0]+'_', self.mirrorNames[len(self.mirrorNam...
dpAR_count = dpUtils.findModuleLastNumber(CLASS_NAME, "dpAR_type")+1
Predict the next line after this snippet: <|code_start|> self.ctrls.directConnect(self.cvJointLoc, self.jGuide, ['tx', 'ty', 'tz', 'rx', 'ry', 'rz']) self.cvEndJoint = self.ctrls.cvLocator(ctrlName=self.guideName+"_JointEnd", r=0.2, d=1, guide=True) cmds.parent(self.cvEndJoint, self.cvJointLoc) ...
dpUtils.useDefaultRenderLayer()
Given the following code snippet before the placeholder: <|code_start|> for item in allGuideList: cmds.rename(item, side+self.userGuideName+"_"+item) self.mirrorGrp = cmds.group(name="Guide_Base_Grp", empty=True) cmds.parent(side+self.us...
dpAR_count = dpUtils.findModuleLastNumber(CLASS_NAME, "dpAR_type") + 1
Next line prediction: <|code_start|> # changing module aim guides: cmds.setAttr(self.cvEndJointZero+".rotateX", 0) cmds.setAttr(self.cvEndJointZero+".rotateY", 0) if item[1] == "X": if item[0] == "+": cmds.setAttr(self.cvEndJointZero+".r...
dpUtils.setJointLabel(eyelidJnt, jointLabelNumber, 18, self.userGuideName+"_"+self.langDic[self.langName][lid]+"_"+self.langDic[self.langName]['c042_eyelid']+middle)
Given the code snippet: <|code_start|> # get rigs names: self.mirrorNames = cmds.getAttr(self.moduleGrp + ".mirrorName") # get first and last letters to use as side initials (prefix): sideList = [self.mirrorNames[0] + '_', self.mirrorNames[len(self.mirrorNa...
dpAR_count = dpUtils.findModuleLastNumber(CLASS_NAME, "dpAR_type") + 1
Given the following code snippet before the placeholder: <|code_start|> leftName = leftPrefix+item+offsetSuffix rightName = rightPrefix+item+offsetSuffix if cmds.objExists(centerName): self.dpLoadJointTgtList(centerName) if cmds.objExists(leftName): ...
fromNodeName = dpUtils.extractSuffix(fromNode)
Given the following code snippet before the placeholder: <|code_start|> for item in allGuideList: cmds.rename(item, side+self.userGuideName+"_"+item) self.mirrorGrp = cmds.group(name="Guide_Base_Grp", empty=True) cmds.parent(side+self.us...
dpAR_count = dpUtils.findModuleLastNumber(CLASS_NAME, "dpAR_type") + 1
Here is a snippet: <|code_start|> cmds.addAttr(self.moduleGrp, longName="flip", attributeType='bool') cmds.setAttr(self.moduleGrp+".flip", 0) cmds.setAttr(self.moduleGrp+".moduleNamespace", self.moduleGrp[:self.moduleGrp.rfind(":")], type='string') cmds.addAttr(self.modu...
dpUtils.useDefaultRenderLayer()
Based on the snippet: <|code_start|># importing libraries: # global variables to this module: CLASS_NAME = "CopyPasteAttr" TITLE = "m135_copyPasteAttr" DESCRIPTION = "m136_copyPasteAttrDesc" ICON = "/Icons/dp_copyPasteAttr.png" DPCP_VERSION = "2.1" # import libraries class CopyPasteAttr(object): def __ini...
self.ctrls = dpControls.ControlClass(self.dpUIinst, self.presetDic, self.presetName)
Given the code snippet: <|code_start|> for item in allGuideList: cmds.rename(item, side+self.userGuideName+"_"+item) self.mirrorGrp = cmds.group(name="Guide_Base_Grp", empty=True) cmds.parent(side+self.userGuideName+'_Guide_Base', self.m...
dpAR_count = dpUtils.findModuleLastNumber(CLASS_NAME, "dpAR_type") + 1
Using the snippet: <|code_start|> for item in allGuideList: cmds.rename(item, side+self.userGuideName+"_"+item) self.mirrorGrp = cmds.group(name="Guide_Base_Grp", empty=True) cmds.parent(side+self.userGuideName+'_Guide_Base', self.mirror...
dpAR_count = dpUtils.findModuleLastNumber(CLASS_NAME, "dpAR_type") + 1
Next line prediction: <|code_start|> self.sideTMD = cmds.createNode("multiplyDivide", name=self.guideName+"_Side_Translate_MD") self.sideRMD = cmds.createNode("multiplyDivide", name=self.guideName+"_Side_Rotate_MD") self.nostrilMD = cmds.createNode("multiplyDivide", name=self.guideName+"_Nostril_...
dpUtils.useDefaultRenderLayer()
Given snippet: <|code_start|># Copyright (C) 2011-2017 Aratelia Limited - Juan A. Rubio # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
log_api ("%s %s:Port-%s' 'Howmany:%s'" \
Predict the next line for this snippet: <|code_start|># it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WAR...
log_result (element.tag, "OMX_ErrorNone")
Given the following code snippet before the placeholder: <|code_start|># Copyright (C) 2011-2017 Aratelia Limited - Juan A. Rubio # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
log_api ("%s %s:Port-%s' 'Howmany:%s'" \
Given the following code snippet before the placeholder: <|code_start|># it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
log_result (element.tag, "OMX_ErrorNone")
Here is a snippet: <|code_start|># but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <...
index = get_il_enum_from_string(indexstr)
Continue the code snippet: <|code_start|> class tag_OMX_SetContentURI(skema.tag.SkemaTag): """ """ def run(self, element, context): indexstr = "OMX_IndexParamContentURI" uristr = element.get('uri') alias = element.get('alias') name = context.cnames[alias] # Repla...
err = get_string_from_il_enum(interror, "OMX_Error")
Continue the code snippet: <|code_start|># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. class tag_OMX_SetCon...
param_type = OMX_PARAM_CONTENTURITYPE
Predict the next line after this snippet: <|code_start|> class tag_OMX_SetContentURI(skema.tag.SkemaTag): """ """ def run(self, element, context): indexstr = "OMX_IndexParamContentURI" uristr = element.get('uri') alias = element.get('alias') name = context.cnames[alias]...
omxerror = OMX_GetParameter(handle, index, byref(param_struct))
Given the following code snippet before the placeholder: <|code_start|> name = context.cnames[alias] # Replace '$USER' and '$HOME' strings wih the actual representations uristr = re.sub("\$USER", pwd.getpwuid(os.getuid())[0], uristr, 1) uristr = re.sub("\$HOME", pwd.getpwuid(os.getuid())...
omxerror = OMX_SetParameter(handle, index, byref(param_struct))
Next line prediction: <|code_start|># the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR...
log_api ("%s '%s' '%s' '%s'" \
Given snippet: <|code_start|> % (element.tag, indexstr, name, uristr)) handle = context.handles[alias] index = get_il_enum_from_string(indexstr) param_type = OMX_PARAM_CONTENTURITYPE param_struct = param_type() param_struct.nSize = sizeof(param_type) ...
log_line ()
Given the code snippet: <|code_start|> if (handle != None): omxerror = OMX_GetParameter(handle, index, byref(param_struct)) interror = int(omxerror & 0xffffffff) err = get_string_from_il_enum(interror, "OMX_Error") for name, _ in param_type._fields_: ...
log_param (name, urifield.value, 1)
Predict the next line after this snippet: <|code_start|> err = get_string_from_il_enum(interror, "OMX_Error") for name, _ in param_type._fields_: for name2, val2 in element.items(): if (name != "contentURI"): if (name2 == name): ...
log_result(element.tag, err)
Predict the next line after this snippet: <|code_start|> self.quiet = kwargs.pop('quiet') except KeyError: self.quiet = False super(Tee, self).__init__(*args, **kwargs) def write(self, data): super(Tee, self).write(data) if self.quiet is False: sys...
config = get_config ()
Predict the next line after this snippet: <|code_start|># Copyright (C) 2011-2017 Aratelia Limited - Juan A. Rubio # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
log_api ("%s %s:Port-%s' 'Howmany:%s'" \
Given the code snippet: <|code_start|># it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without e...
log_result (element.tag, "OMX_ErrorNone")
Continue the code snippet: <|code_start|> This can be used by test definition files to create an object that contains the building blocks for installing tests, running them, and parsing the results. suitename - name of the test suite version - version of the test suite installer - SkemaInstaller...
config = get_config()
Given the following code snippet before the placeholder: <|code_start|> def install(self): self._installscript() class SkemaSuiteRunner(object): """Base class for defining an test runner object. This class can be used as-is for simple execution with the expectation that the run() method will be...
result = run_suite(scriptpath)
Predict the next line after this snippet: <|code_start|> self._installscript() class SkemaSuiteRunner(object): """Base class for defining an test runner object. This class can be used as-is for simple execution with the expectation that the run() method will be called from the directory where the t...
log_line()
Next line prediction: <|code_start|> titer = tree.iter() config = get_config() suites = [] cases = [] errors = dict() last_tag = dict() case = "" for elem in titer: if elem.tag == "Suite": continue if elem.tag == "Case": case = elem.get('name')...
log_result (elem.tag, get_string_from_il_enum(result, "OMX_Error"))
Predict the next line for this snippet: <|code_start|># You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """ Skema's suite-related utility functions """ def run_suite(scriptpath): tree = et() tree.parse(scriptpath) ...
log_line ("Use Case : '%s'" % case)
Predict the next line after this snippet: <|code_start|> titer = tree.iter() config = get_config() suites = [] cases = [] errors = dict() last_tag = dict() case = "" for elem in titer: if elem.tag == "Suite": continue if elem.tag == "Case": case...
log_result (elem.tag, get_string_from_il_enum(result, "OMX_Error"))
Using the snippet: <|code_start|> def run_suite(scriptpath): tree = et() tree.parse(scriptpath) titer = tree.iter() config = get_config() suites = [] cases = [] errors = dict() last_tag = dict() case = "" for elem in titer: if elem.tag == "Suite": contin...
tag_func = get_tag(elem.tag)
Here is a snippet: <|code_start|># Copyright (C) 2011-2017 Aratelia Limited - Juan A. Rubio # # Portions Copyright (C) 2010 Linaro # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versio...
config = get_config()
Next line prediction: <|code_start|>""" class SkemaTag(SkemaTagIf): """Base class for defining skema's test tags. This can be used by test definition files to create an object that contains the building blocks for installing tests, running them, and parsing the results. tagsdir - name of the t...
config = get_config()
Here is a snippet: <|code_start|># # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in th...
log_line ()
Here is a snippet: <|code_start|># it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even t...
log_result (msg, "OMX_ErrorNone")
Predict the next line for this snippet: <|code_start|># Copyright (C) 2011-2017 Aratelia Limited - Juan A. Rubio # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License...
log_api ("%s '%s'" \
Here is a snippet: <|code_start|># (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # Y...
index = get_il_enum_from_string(indexstr)
Given the following code snippet before the placeholder: <|code_start|> #from types import * class tag_OMX_SetComponentRole(skema.tag.SkemaTag): """ """ def run(self, element, context): indexstr = "OMX_IndexParamStandardComponentRole" alias = element.get('alias') name = context...
err = get_string_from_il_enum(interror, "OMX_Error")
Using the snippet: <|code_start|># but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <...
param_struct.nVersion.nVersion = OMX_VERSION
Predict the next line after this snippet: <|code_start|># # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have ...
param_type = OMX_PARAM_COMPONENTROLETYPE
Using the snippet: <|code_start|># You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. #from types import * class tag_OMX_SetComponentRole(skema.tag.SkemaTag): """ """ def run(self, element, context): indexs...
omxerror = OMX_GetParameter(handle, index, byref(param_struct))
Given the following code snippet before the placeholder: <|code_start|> indexstr = "OMX_IndexParamStandardComponentRole" alias = element.get('alias') name = context.cnames[alias] rolestr = element.get('role') log_api ("%s '%s' '%s'" \ % (element.tag, name,...
omxerror = OMX_SetParameter(handle, index, byref(param_struct))
Given the code snippet: <|code_start|> handle = context.handles[alias] index = get_il_enum_from_string(indexstr) param_type = OMX_PARAM_COMPONENTROLETYPE param_struct = param_type() param_struct.nVersion.nVersion = OMX_VERSION param_struct.nSize = sizeof(param_type) ...
log_line ()
Using the snippet: <|code_start|># # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in th...
log_api ("%s '%s' '%s'" \
Given the code snippet: <|code_start|> if (handle != None): omxerror = OMX_GetParameter(handle, index, byref(param_struct)) interror = int(omxerror & 0xffffffff) err = get_string_from_il_enum(interror, "OMX_Error") for name, _ in param_type._fields_: ...
log_param (name, rolefield.value, 1)
Next line prediction: <|code_start|> err = get_string_from_il_enum(interror, "OMX_Error") for name, _ in param_type._fields_: for name2, val2 in element.items(): if (name != "cRole"): if (name2 == name): seta...
log_result(element.tag, err)
Predict the next line after this snippet: <|code_start|># Copyright (C) 2011-2017 Aratelia Limited - Juan A. Rubio # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
cversion = OMX_VERSIONTYPE()
Based on the snippet: <|code_start|># This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in t...
cuuid = OMX_UUIDTYPE()
Based on the snippet: <|code_start|> class tag_OMX_GetComponentVersion(skema.tag.SkemaTag): """ """ def run(self, element, context): alias = element.get('alias') name = context.cnames[alias] log_api ("%s '%s'" % (element.tag, name)) handle = context.handles[alias] ...
for name, _ in struct_anon_1._fields_:
Given the code snippet: <|code_start|># the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICUL...
omxerror = OMX_GetComponentVersion(handle, cast(cname, POINTER(c_char)),