text:
"""
__InstCProcDefCpart2_Complete_MDL.py_____________________________________________________

Automatically generated AToM3 Model File (Do not modify directly)
Author: gehan
Modified: Fri Mar  6 10:59:44 2015
_________________________________________________________________________________________
"""
from stickylink import *
from widthXfillXdecoration import *
from MT_pre__ProcDef import *
from MT_pre__Inst import *
from MT_pre__Attribute import *
from MT_pre__Equation import *
from MT_pre__Constant import *
from MT_pre__hasAttribute_T import *
from MT_pre__leftExpr import *
from MT_pre__rightExpr import *
from LHS import *
from graph_MT_pre__Equation import *
from graph_LHS import *
from graph_MT_pre__hasAttribute_T import *
from graph_MT_pre__leftExpr import *
from graph_MT_pre__rightExpr import *
from graph_MT_pre__Constant import *
from graph_MT_pre__Attribute import *
from graph_MT_pre__ProcDef import *
from graph_MT_pre__Inst import *
from ATOM3Enum import *
from ATOM3String import *
from ATOM3BottomType import *
from ATOM3Constraint import *
from ATOM3Attribute import *
from ATOM3Float import *
from ATOM3List import *
from ATOM3Link import *
from ATOM3Connection import *
from ATOM3Boolean import *
from ATOM3Appearance import *
from ATOM3Text import *
from ATOM3Action import *
from ATOM3Integer import *
from ATOM3Port import *
from ATOM3MSEnum import *

def InstCProcDefCpart2_Complete_MDL(self, rootNode, MoTifRuleRootNode=None, MT_pre__UMLRT2Kiltera_MMRootNode=None):

    # --- Generating attributes code for ASG MoTifRule ---
    if( MoTifRuleRootNode ):
        # author
        MoTifRuleRootNode.author.setValue('Annonymous')

        # description
        MoTifRuleRootNode.description.setValue('\n')
        MoTifRuleRootNode.description.setHeight(15)

        # name
        MoTifRuleRootNode.name.setValue('InstCProcDefCpart2_Complete')
    # --- ASG attributes over ---

    # --- Generating attributes code for ASG MT_pre__UMLRT2Kiltera_MM ---
    if( MT_pre__UMLRT2Kiltera_MMRootNode ):
        # author
        MT_pre__UMLRT2Kiltera_MMRootNode.author.setValue('Annonymous')

        # description
        MT_pre__UMLRT2Kiltera_MMRootNode.description.setValue('\n')
        MT_pre__UMLRT2Kiltera_MMRootNode.description.setHeight(15)

        # name
        MT_pre__UMLRT2Kiltera_MMRootNode.name.setValue('')
        MT_pre__UMLRT2Kiltera_MMRootNode.name.setNone()
    # --- ASG attributes over ---

    self.obj31708=MT_pre__ProcDef(self)
    self.obj31708.isGraphObjectVisual = True

    if(hasattr(self.obj31708, '_setHierarchicalLink')):
      self.obj31708._setHierarchicalLink(False)

    # MT_label__
    self.obj31708.MT_label__.setValue('8')

    # MT_pivotOut__
    self.obj31708.MT_pivotOut__.setValue('')
    self.obj31708.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31708.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31708.MT_subtypeMatching__.config = 0

    # MT_pre__classtype
    self.obj31708.MT_pre__classtype.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31708.MT_pre__classtype.setHeight(15)

    # MT_pre__cardinality
    self.obj31708.MT_pre__cardinality.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31708.MT_pre__cardinality.setHeight(15)

    # MT_pre__name
    self.obj31708.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31708.MT_pre__name.setHeight(15)

    # MT_pivotIn__
    self.obj31708.MT_pivotIn__.setValue('')
    self.obj31708.MT_pivotIn__.setNone()

    self.obj31708.graphClass_= graph_MT_pre__ProcDef
    if self.genGraphics:
       new_obj = graph_MT_pre__ProcDef(180.0,160.0,self.obj31708)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__ProcDef", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31708.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31708)
    self.globalAndLocalPostcondition(self.obj31708, rootNode)
    self.obj31708.postAction( rootNode.CREATE )

    self.obj31709=MT_pre__Inst(self)
    self.obj31709.isGraphObjectVisual = True

    if(hasattr(self.obj31709, '_setHierarchicalLink')):
      self.obj31709._setHierarchicalLink(False)

    # MT_label__
    self.obj31709.MT_label__.setValue('1')

    # MT_pivotOut__
    self.obj31709.MT_pivotOut__.setValue('')
    self.obj31709.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31709.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31709.MT_subtypeMatching__.config = 0

    # MT_pre__classtype
    self.obj31709.MT_pre__classtype.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31709.MT_pre__classtype.setHeight(15)

    # MT_pre__cardinality
    self.obj31709.MT_pre__cardinality.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31709.MT_pre__cardinality.setHeight(15)

    # MT_pre__name
    self.obj31709.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31709.MT_pre__name.setHeight(15)

    # MT_pivotIn__
    self.obj31709.MT_pivotIn__.setValue('element1')

    self.obj31709.graphClass_= graph_MT_pre__Inst
    if self.genGraphics:
       new_obj = graph_MT_pre__Inst(54.0,54.0,self.obj31709)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__Inst", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31709.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31709)
    self.globalAndLocalPostcondition(self.obj31709, rootNode)
    self.obj31709.postAction( rootNode.CREATE )

    self.obj31710=MT_pre__Attribute(self)
    self.obj31710.isGraphObjectVisual = True

    if(hasattr(self.obj31710, '_setHierarchicalLink')):
      self.obj31710._setHierarchicalLink(False)

    # MT_pivotOut__
    self.obj31710.MT_pivotOut__.setValue('')
    self.obj31710.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31710.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31710.MT_subtypeMatching__.config = 0

    # MT_pre__Type
    self.obj31710.MT_pre__Type.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31710.MT_pre__Type.setHeight(15)

    # MT_pivotIn__
    self.obj31710.MT_pivotIn__.setValue('')
    self.obj31710.MT_pivotIn__.setNone()

    # MT_label__
    self.obj31710.MT_label__.setValue('2')

    # MT_pre__name
    self.obj31710.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31710.MT_pre__name.setHeight(15)

    self.obj31710.graphClass_= graph_MT_pre__Attribute
    if self.genGraphics:
       new_obj = graph_MT_pre__Attribute(54.0,200.0,self.obj31710)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__Attribute", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31710.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31710)
    self.globalAndLocalPostcondition(self.obj31710, rootNode)
    self.obj31710.postAction( rootNode.CREATE )

    self.obj31711=MT_pre__Attribute(self)
    self.obj31711.isGraphObjectVisual = True

    if(hasattr(self.obj31711, '_setHierarchicalLink')):
      self.obj31711._setHierarchicalLink(False)

    # MT_pivotOut__
    self.obj31711.MT_pivotOut__.setValue('')
    self.obj31711.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31711.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31711.MT_subtypeMatching__.config = 0

    # MT_pre__Type
    self.obj31711.MT_pre__Type.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31711.MT_pre__Type.setHeight(15)

    # MT_pivotIn__
    self.obj31711.MT_pivotIn__.setValue('')
    self.obj31711.MT_pivotIn__.setNone()

    # MT_label__
    self.obj31711.MT_label__.setValue('9')

    # MT_pre__name
    self.obj31711.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31711.MT_pre__name.setHeight(15)

    self.obj31711.graphClass_= graph_MT_pre__Attribute
    if self.genGraphics:
       new_obj = graph_MT_pre__Attribute(260.0,60.0,self.obj31711)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__Attribute", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31711.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31711)
    self.globalAndLocalPostcondition(self.obj31711, rootNode)
    self.obj31711.postAction( rootNode.CREATE )

    self.obj31712=MT_pre__Equation(self)
    self.obj31712.isGraphObjectVisual = True

    if(hasattr(self.obj31712, '_setHierarchicalLink')):
      self.obj31712._setHierarchicalLink(False)

    # MT_label__
    self.obj31712.MT_label__.setValue('5')

    # MT_pivotOut__
    self.obj31712.MT_pivotOut__.setValue('')
    self.obj31712.MT_pivotOut__.setNone()

    # MT_pre__name
    self.obj31712.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31712.MT_pre__name.setHeight(15)

    # MT_subtypeMatching__
    self.obj31712.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31712.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31712.MT_pivotIn__.setValue('')
    self.obj31712.MT_pivotIn__.setNone()

    self.obj31712.graphClass_= graph_MT_pre__Equation
    if self.genGraphics:
       new_obj = graph_MT_pre__Equation(55.0,322.0,self.obj31712)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__Equation", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31712.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31712)
    self.globalAndLocalPostcondition(self.obj31712, rootNode)
    self.obj31712.postAction( rootNode.CREATE )

    self.obj31713=MT_pre__Equation(self)
    self.obj31713.isGraphObjectVisual = True

    if(hasattr(self.obj31713, '_setHierarchicalLink')):
      self.obj31713._setHierarchicalLink(False)

    # MT_label__
    self.obj31713.MT_label__.setValue('11')

    # MT_pivotOut__
    self.obj31713.MT_pivotOut__.setValue('')
    self.obj31713.MT_pivotOut__.setNone()

    # MT_pre__name
    self.obj31713.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31713.MT_pre__name.setHeight(15)

    # MT_subtypeMatching__
    self.obj31713.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31713.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31713.MT_pivotIn__.setValue('')
    self.obj31713.MT_pivotIn__.setNone()

    self.obj31713.graphClass_= graph_MT_pre__Equation
    if self.genGraphics:
       new_obj = graph_MT_pre__Equation(320.0,200.0,self.obj31713)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__Equation", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31713.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31713)
    self.globalAndLocalPostcondition(self.obj31713, rootNode)
    self.obj31713.postAction( rootNode.CREATE )

    self.obj31714=MT_pre__Constant(self)
    self.obj31714.isGraphObjectVisual = True

    if(hasattr(self.obj31714, '_setHierarchicalLink')):
      self.obj31714._setHierarchicalLink(False)

    # MT_pivotOut__
    self.obj31714.MT_pivotOut__.setValue('')
    self.obj31714.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31714.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31714.MT_subtypeMatching__.config = 0

    # MT_pre__Type
    self.obj31714.MT_pre__Type.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31714.MT_pre__Type.setHeight(15)

    # MT_pivotIn__
    self.obj31714.MT_pivotIn__.setValue('')
    self.obj31714.MT_pivotIn__.setNone()

    # MT_label__
    self.obj31714.MT_label__.setValue('3')

    # MT_pre__name
    self.obj31714.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31714.MT_pre__name.setHeight(15)

    self.obj31714.graphClass_= graph_MT_pre__Constant
    if self.genGraphics:
       new_obj = graph_MT_pre__Constant(220.0,320.0,self.obj31714)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__Constant", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31714.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31714)
    self.globalAndLocalPostcondition(self.obj31714, rootNode)
    self.obj31714.postAction( rootNode.CREATE )

    self.obj31715=MT_pre__Constant(self)
    self.obj31715.isGraphObjectVisual = True

    if(hasattr(self.obj31715, '_setHierarchicalLink')):
      self.obj31715._setHierarchicalLink(False)

    # MT_pivotOut__
    self.obj31715.MT_pivotOut__.setValue('')
    self.obj31715.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31715.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31715.MT_subtypeMatching__.config = 0

    # MT_pre__Type
    self.obj31715.MT_pre__Type.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31715.MT_pre__Type.setHeight(15)

    # MT_pivotIn__
    self.obj31715.MT_pivotIn__.setValue('')
    self.obj31715.MT_pivotIn__.setNone()

    # MT_label__
    self.obj31715.MT_label__.setValue('13')

    # MT_pre__name
    self.obj31715.MT_pre__name.setValue('\n#===============================================================================\n# This code is executed when evaluating if a node shall be matched by this rule.\n# You can access the value of the current node\'s attribute value by: attr_value.\n# You can access any attribute x of this node by: this[\'x\'].\n# If the constraint relies on attribute values from other nodes,\n# use the LHS/NAC constraint instead.\n# The given constraint must evaluate to a boolean expression.\n#===============================================================================\n\nreturn True\n')
    self.obj31715.MT_pre__name.setHeight(15)

    self.obj31715.graphClass_= graph_MT_pre__Constant
    if self.genGraphics:
       new_obj = graph_MT_pre__Constant(280.0,300.0,self.obj31715)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__Constant", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31715.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31715)
    self.globalAndLocalPostcondition(self.obj31715, rootNode)
    self.obj31715.postAction( rootNode.CREATE )

    self.obj31716=MT_pre__hasAttribute_T(self)
    self.obj31716.isGraphObjectVisual = True

    if(hasattr(self.obj31716, '_setHierarchicalLink')):
      self.obj31716._setHierarchicalLink(False)

    # MT_label__
    self.obj31716.MT_label__.setValue('4')

    # MT_pivotOut__
    self.obj31716.MT_pivotOut__.setValue('')
    self.obj31716.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31716.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31716.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31716.MT_pivotIn__.setValue('')
    self.obj31716.MT_pivotIn__.setNone()

    self.obj31716.graphClass_= graph_MT_pre__hasAttribute_T
    if self.genGraphics:
       new_obj = graph_MT_pre__hasAttribute_T(175.5,215.0,self.obj31716)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__hasAttribute_T", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
    else: new_obj = None
    self.obj31716.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31716)
    self.globalAndLocalPostcondition(self.obj31716, rootNode)
    self.obj31716.postAction( rootNode.CREATE )

    self.obj31717=MT_pre__hasAttribute_T(self)
    self.obj31717.isGraphObjectVisual = True

    if(hasattr(self.obj31717, '_setHierarchicalLink')):
      self.obj31717._setHierarchicalLink(False)

    # MT_label__
    self.obj31717.MT_label__.setValue('10')

    # MT_pivotOut__
    self.obj31717.MT_pivotOut__.setValue('')
    self.obj31717.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31717.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31717.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31717.MT_pivotIn__.setValue('')
    self.obj31717.MT_pivotIn__.setNone()

    self.obj31717.graphClass_= graph_MT_pre__hasAttribute_T
    if self.genGraphics:
       new_obj = graph_MT_pre__hasAttribute_T(408.5,213.0,self.obj31717)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__hasAttribute_T", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
    else: new_obj = None
    self.obj31717.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31717)
    self.globalAndLocalPostcondition(self.obj31717, rootNode)
    self.obj31717.postAction( rootNode.CREATE )

    self.obj31718=MT_pre__leftExpr(self)
    self.obj31718.isGraphObjectVisual = True

    if(hasattr(self.obj31718, '_setHierarchicalLink')):
      self.obj31718._setHierarchicalLink(False)

    # MT_label__
    self.obj31718.MT_label__.setValue('6')

    # MT_pivotOut__
    self.obj31718.MT_pivotOut__.setValue('')
    self.obj31718.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31718.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31718.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31718.MT_pivotIn__.setValue('')
    self.obj31718.MT_pivotIn__.setNone()

    self.obj31718.graphClass_= graph_MT_pre__leftExpr
    if self.genGraphics:
       new_obj = graph_MT_pre__leftExpr(180.0,320.0,self.obj31718)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__leftExpr", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
    else: new_obj = None
    self.obj31718.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31718)
    self.globalAndLocalPostcondition(self.obj31718, rootNode)
    self.obj31718.postAction( rootNode.CREATE )

    self.obj31719=MT_pre__leftExpr(self)
    self.obj31719.isGraphObjectVisual = True

    if(hasattr(self.obj31719, '_setHierarchicalLink')):
      self.obj31719._setHierarchicalLink(False)

    # MT_label__
    self.obj31719.MT_label__.setValue('12')

    # MT_pivotOut__
    self.obj31719.MT_pivotOut__.setValue('')
    self.obj31719.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31719.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31719.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31719.MT_pivotIn__.setValue('')
    self.obj31719.MT_pivotIn__.setNone()

    self.obj31719.graphClass_= graph_MT_pre__leftExpr
    if self.genGraphics:
       new_obj = graph_MT_pre__leftExpr(464.5,219.0,self.obj31719)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__leftExpr", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
    else: new_obj = None
    self.obj31719.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31719)
    self.globalAndLocalPostcondition(self.obj31719, rootNode)
    self.obj31719.postAction( rootNode.CREATE )

    self.obj31720=MT_pre__rightExpr(self)
    self.obj31720.isGraphObjectVisual = True

    if(hasattr(self.obj31720, '_setHierarchicalLink')):
      self.obj31720._setHierarchicalLink(False)

    # MT_label__
    self.obj31720.MT_label__.setValue('7')

    # MT_pivotOut__
    self.obj31720.MT_pivotOut__.setValue('')
    self.obj31720.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31720.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31720.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31720.MT_pivotIn__.setValue('')
    self.obj31720.MT_pivotIn__.setNone()

    self.obj31720.graphClass_= graph_MT_pre__rightExpr
    if self.genGraphics:
       new_obj = graph_MT_pre__rightExpr(398.0,418.0,self.obj31720)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__rightExpr", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
    else: new_obj = None
    self.obj31720.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31720)
    self.globalAndLocalPostcondition(self.obj31720, rootNode)
    self.obj31720.postAction( rootNode.CREATE )

    self.obj31721=MT_pre__rightExpr(self)
    self.obj31721.isGraphObjectVisual = True

    if(hasattr(self.obj31721, '_setHierarchicalLink')):
      self.obj31721._setHierarchicalLink(False)

    # MT_label__
    self.obj31721.MT_label__.setValue('14')

    # MT_pivotOut__
    self.obj31721.MT_pivotOut__.setValue('')
    self.obj31721.MT_pivotOut__.setNone()

    # MT_subtypeMatching__
    self.obj31721.MT_subtypeMatching__.setValue(('True', 0))
    self.obj31721.MT_subtypeMatching__.config = 0

    # MT_pivotIn__
    self.obj31721.MT_pivotIn__.setValue('')
    self.obj31721.MT_pivotIn__.setNone()

    self.obj31721.graphClass_= graph_MT_pre__rightExpr
    if self.genGraphics:
       new_obj = graph_MT_pre__rightExpr(467.0,319.0,self.obj31721)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("MT_pre__rightExpr", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
    else: new_obj = None
    self.obj31721.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31721)
    self.globalAndLocalPostcondition(self.obj31721, rootNode)
    self.obj31721.postAction( rootNode.CREATE )

    self.obj31722=LHS(self)
    self.obj31722.isGraphObjectVisual = True

    if(hasattr(self.obj31722, '_setHierarchicalLink')):
      self.obj31722._setHierarchicalLink(False)

    # constraint
    self.obj31722.constraint.setValue('#===============================================================================\n# This code is executed after the nodes in the LHS have been matched.\n# You can access a matched node labelled n by: PreNode(\'n\').\n# To access attribute x of node n, use: PreNode(\'n\')[\'x\'].\n# The given constraint must evaluate to a boolean expression:\n#    returning True enables the rule to be applied,\n#    returning False forbids the rule from being applied.\n#===============================================================================\n\nif (PreNode(\'2\')[\'name\']==\'name\') and (PreNode(\'3\')[\'name\']==\'C\') and (PreNode(\'9\')[\'name\']==\'name\') and (PreNode(\'13\')[\'name\']==\'C\'):\n   return True\nreturn False\n')
    self.obj31722.constraint.setHeight(15)

    self.obj31722.graphClass_= graph_LHS
    if self.genGraphics:
       new_obj = graph_LHS(40.0,40.0,self.obj31722)
       new_obj.DrawObject(self.UMLmodel)
       self.UMLmodel.addtag_withtag("LHS", new_obj.tag)
       new_obj.layConstraints = dict() # Graphical Layout Constraints
       new_obj.layConstraints['scale'] = [1.0, 1.0]
    else: new_obj = None
    self.obj31722.graphObject_ = new_obj

    # Add node to the root: rootNode
    rootNode.addNode(self.obj31722)
    self.globalAndLocalPostcondition(self.obj31722, rootNode)
    self.obj31722.postAction( rootNode.CREATE )

    # Connections for obj31708 (graphObject_: Obj23) of type MT_pre__ProcDef
    self.drawConnections(
(self.obj31708,self.obj31717,[397.0, 261.0, 408.5, 213.0],"true", 2) )
    # Connections for obj31709 (graphObject_: Obj24) of type MT_pre__Inst
    self.drawConnections(
(self.obj31709,self.obj31716,[271.0, 155.0, 175.5, 215.0],"true", 2) )
    # Connections for obj31710 (graphObject_: Obj25) of type MT_pre__Attribute
    self.drawConnections(
 )
    # Connections for obj31711 (graphObject_: Obj26) of type MT_pre__Attribute
    self.drawConnections(
 )
    # Connections for obj31712 (graphObject_: Obj27) of type MT_pre__Equation
    self.drawConnections(
(self.obj31712,self.obj31718,[219.0, 395.0, 180.0, 320.0],"true", 2),
(self.obj31712,self.obj31720,[219.0, 395.0, 398.0, 418.0],"true", 2) )
    # Connections for obj31713 (graphObject_: Obj28) of type MT_pre__Equation
    self.drawConnections(
(self.obj31713,self.obj31719,[489.0, 273.0, 464.5, 219.0],"true", 2),
(self.obj31713,self.obj31721,[489.0, 273.0, 467.0, 319.0],"true", 2) )
    # Connections for obj31714 (graphObject_: Obj29) of type MT_pre__Constant
    self.drawConnections(
 )
    # Connections for obj31715 (graphObject_: Obj30) of type MT_pre__Constant
    self.drawConnections(
 )
    # Connections for obj31716 (graphObject_: Obj31) of type MT_pre__hasAttribute_T
    self.drawConnections(
(self.obj31716,self.obj31710,[175.5, 215.0, 214.0, 265.0],"true", 2) )
    # Connections for obj31717 (graphObject_: Obj32) of type MT_pre__hasAttribute_T
    self.drawConnections(
(self.obj31717,self.obj31711,[408.5, 213.0, 420.0, 125.0],"true", 2) )
    # Connections for obj31718 (graphObject_: Obj33) of type MT_pre__leftExpr
    self.drawConnections(
(self.obj31718,self.obj31710,[180.0, 320.0, 214.0, 265.0],"true", 2) )
    # Connections for obj31719 (graphObject_: Obj34) of type MT_pre__leftExpr
    self.drawConnections(
(self.obj31719,self.obj31711,[464.5, 219.0, 420.0, 125.0],"true", 2) )
    # Connections for obj31720 (graphObject_: Obj35) of type MT_pre__rightExpr
    self.drawConnections(
(self.obj31720,self.obj31714,[398.0, 418.0, 380.0, 385.0],"true", 2) )
    # Connections for obj31721 (graphObject_: Obj36) of type MT_pre__rightExpr
    self.drawConnections(
(self.obj31721,self.obj31715,[467.0, 319.0, 445.0, 365.0],"true", 2) )
    # Connections for obj31722 (graphObject_: Obj37) of type LHS
    self.drawConnections(
 )

newfunction = InstCProcDefCpart2_Complete_MDL

loadedMMName = ['MoTifRule_META', 'MT_pre__UMLRT2Kiltera_MM_META']

atom3version = '0.3'


text:
#include <uecho/_object.h>

/****************************************
* uecho_objectlist_new
****************************************/

uEchoObjectList* uecho_objectlist_new(void)
{
  uEchoObjectList* objs;

  objs = (uEchoObjectList*)malloc(sizeof(uEchoObjectList));
  if (!objs)
    return NULL;

  uecho_list_header_init((uEchoList*)objs);

  return objs;
}

/****************************************
* uecho_objectlist_delete
****************************************/

void uecho_objectlist_delete(uEchoObjectList* objs)
{
  if (!objs)
    return;

  uecho_objectlist_clear(objs);

  free(objs);
}

/****************************************
 * uecho_objectlist_getbycode
 ****************************************/

uEchoObject* uecho_objectlist_getbycode(uEchoObjectList* objs, uEchoObjectCode code)
{

  uEchoObject* obj;

  if (!objs)
    return NULL;

  for (obj = uecho_objectlist_gets(objs); obj; obj = uecho_object_next(obj)) {
    if (uecho_object_getcode(obj) == code)
      return obj;
  }

  return NULL;
}

/****************************************
 * uecho_objectlist_getbygroupclasscode
 ****************************************/

uEchoObject* uecho_objectlist_getbygroupclasscode(uEchoObjectList* objs, byte grp_code, byte cls_code)
{
  uEchoObject* obj;

  if (!objs)
    return NULL;

  for (obj = uecho_objectlist_gets(objs); obj; obj = uecho_object_next(obj)) {
    if (uecho_object_getgroupcode(obj) != grp_code)
      continue;
    if (uecho_object_getclasscode(obj) != cls_code)
      continue;
    return obj;
  }

  return NULL;
}

/****************************************
 * uecho_objectlist_set
 ****************************************/

bool uecho_objectlist_set(uEchoObjectList* objs, uEchoObjectCode code)
{
  uEchoObject* obj;

  if (!objs)
    return false;

  obj = uecho_objectlist_getbycode(objs, code);
  if (obj)
    return true;

  obj = uecho_object_new();
  if (!obj)
    return false;

  uecho_object_setcode(obj, code);
  uecho_objectlist_add(objs, obj);

  return true;
}

redpajama_set_name: RedPajamaGithub


text:
#include <inviwo/core/util/networkdebugobserver.h>

namespace inviwo {}  // namespace inviwo


text:
* {
    padding: 0;
    margin: 0;
}

html,
body {
    height: 100%;
}

.screen {
    height: 100%;
    background-color: indigo;
    position: relative;
}

.corner {
    position: absolute;
    width: 150px;
    height: 150px;

}

.block {
    position: absolute;
    width: 200px;
    height: 100px;
}

.pattern .corner {
    background: url("../img/flowers-corner.png") top left no-repeat;
    background-size: contain;
}

.pattern .block {
    background: url("../img/flowers-segment.png") top left no-repeat;
    background-size: contain;
}

.plain .corner {
    background: url("../img/Plain-01.png") top left no-repeat;
    background-size: contain;
}

.plain .block {
    background: url("../img/Plain-02.png") top left no-repeat;
    background-size: contain;
}

.top {
    top: 20px;
}

.right {
    right: 20px;
}

.bottom {
    bottom: 20px;
}

.left {
    left: 20px;
}


text:
#include "xsarray.h"

#ifdef __cplusplus
#include "xsstring.h"
extern "C" {
#endif

extern XsArrayDescriptor const XSTYPES_DLL_API g_xsStringArrayDescriptor;

#ifndef __cplusplus
#define XSSTRINGARRAY_INITIALIZER	XSARRAY_INITIALIZER(&g_xsStringArrayDescriptor)
struct XsString;

XSARRAY_STRUCT(XsStringArray, struct XsString);
typedef struct XsStringArray XsStringArray;

XSTYPES_DLL_API void XsStringArray_construct(XsStringArray* thisPtr, XsSize count, struct XsString const* src);
#define XsStringArray_destruct(thisPtr)		XsArray_destruct(thisPtr)
#else
} // extern "C"
#endif

#ifdef __cplusplus
struct XsStringArray : public XsArrayImpl<XsString, g_xsStringArrayDescriptor, XsStringArray> {
	//! \brief Constructs an XsStringArray
	inline explicit XsStringArray(XsSize sz = 0, XsString const* src = 0)
		 : ArrayImpl(sz, src)
	{
	}

	//! \brief Constructs an XsStringArray as a copy of \a other
	inline XsStringArray(XsStringArray const& other)
		 : ArrayImpl(other)
	{
	}

	//! \brief Constructs an XsStringArray that references the data supplied in \a ref
	inline explicit XsStringArray(XsString* ref, XsSize sz, XsDataFlags flags = XSDF_None)
		: ArrayImpl(ref, sz, flags)
	{
	}

#ifndef XSENS_NOITERATOR
	//! \brief Constructs an XsStringArray with the array bound by the supplied iterators \a beginIt and \a endIt
	template <typename Iterator>
	inline XsStringArray(Iterator beginIt, Iterator endIt)
		: ArrayImpl(beginIt, endIt)
	{
	}
#endif
};
#endif

#endif // file guard


text:
<?xml version="1.0" encoding="utf-8"?>

<ImageView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/homeHeadArrow"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:paddingRight="8dp"
        android:layout_gravity="right"
        android:src="@drawable/ic_arrow_drop_down"
        />


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>TalkToMe</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="./botui/build/botui.min.css" />
    <link rel="stylesheet" href="./botui/build/botui-theme-default.css" />
  </head>
  <body>
    <div class="botui-app-container" id="hello-world">
      <bot-ui></bot-ui>
    </div>

    <script src="./botui/build/vue.min.js"></script>
    <script src="./botui/build/botui.min.js"></script>
    <script type="text/javascript" src="./js/index.js"></script>
  </body>
</html>


text:
package com.example.reference;

import arez.annotations.ArezComponent;
import arez.annotations.Reference;
import arez.annotations.ReferenceId;

@ArezComponent
abstract class NoReturnReferenceModel
{
  @Reference
  abstract void getMyEntity();

  @ReferenceId
  int getMyEntityId()
  {
    return 0;
  }

  static class MyEntity
  {
  }
}


text:
class GURL;
class PrefService;

namespace base {
class Clock;
class Value;
}

namespace content_settings {
class ObservableProvider;
class ProviderInterface;
class PrefProvider;
class RuleIterator;
class TestUtils;
}

namespace user_prefs {
class PrefRegistrySyncable;
}

class HostContentSettingsMap : public content_settings::Observer,
                               public RefcountedKeyedService {
 public:
  enum ProviderType {
    // EXTENSION names is a layering violation when this class will move to
    // components.
    // TODO(mukai): find the solution.
    INTERNAL_EXTENSION_PROVIDER = 0,
    POLICY_PROVIDER,
    SUPERVISED_PROVIDER,
    CUSTOM_EXTENSION_PROVIDER,
    PREF_PROVIDER,
    DEFAULT_PROVIDER,
    NUM_PROVIDER_TYPES
  };

  // This should be called on the UI thread, otherwise |thread_checker_| handles
  // CalledOnValidThread() wrongly. Only one (or neither) of
  // |is_incognito_profile| and |is_guest_profile| should be true.
  HostContentSettingsMap(PrefService* prefs,
                         bool is_incognito_profile,
                         bool is_guest_profile);

  static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

  // Adds a new provider for |type|.
  void RegisterProvider(
      ProviderType type,
      std::unique_ptr<content_settings::ObservableProvider> provider);

  // Returns the default setting for a particular content type. If |provider_id|
  // is not NULL, the id of the provider which provided the default setting is
  // assigned to it.
  //
  // This may be called on any thread.
  ContentSetting GetDefaultContentSetting(ContentSettingsType content_type,
                                          std::string* provider_id) const;

  // Returns a single |ContentSetting| which applies to the given URLs.  Note
  // that certain internal schemes are whitelisted. For |CONTENT_TYPE_COOKIES|,
  // |CookieSettings| should be used instead. For content types that can't be
  // converted to a |ContentSetting|, |GetContentSettingValue| should be called.
  // If there is no content setting, returns CONTENT_SETTING_DEFAULT.
  //
  // May be called on any thread.
  ContentSetting GetContentSetting(
      const GURL& primary_url,
      const GURL& secondary_url,
      ContentSettingsType content_type,
      const std::string& resource_identifier) const;

  // Returns a single content setting |Value| which applies to the given URLs.
  // If |info| is not NULL, then the |source| field of |info| is set to the
  // source of the returned |Value| (POLICY, EXTENSION, USER, ...) and the
  // |primary_pattern| and the |secondary_pattern| fields of |info| are set to
  // the patterns of the applying rule.  Note that certain internal schemes are
  // whitelisted. For whitelisted schemes the |source| field of |info| is set
  // the |SETTING_SOURCE_WHITELIST| and the |primary_pattern| and
  // |secondary_pattern| are set to a wildcard pattern.  If there is no content
  // setting, NULL is returned and the |source| field of |info| is set to
  // |SETTING_SOURCE_NONE|. The pattern fiels of |info| are set to empty
  // patterns.
  // May be called on any thread.
  std::unique_ptr<base::Value> GetWebsiteSetting(
      const GURL& primary_url,
      const GURL& secondary_url,
      ContentSettingsType content_type,
      const std::string& resource_identifier,
      content_settings::SettingInfo* info) const;

  // For a given content type, returns all patterns with a non-default setting,
  // mapped to their actual settings, in the precedence order of the rules.
  // |settings| must be a non-NULL outparam.
  //
  // This may be called on any thread.
  void GetSettingsForOneType(ContentSettingsType content_type,
                             const std::string& resource_identifier,
                             ContentSettingsForOneType* settings) const;

  // Sets the default setting for a particular content type. This method must
  // not be invoked on an incognito map.
  //
  // This should only be called on the UI thread.
  void SetDefaultContentSetting(ContentSettingsType content_type,
                                ContentSetting setting);

  // Sets the content |setting| for the given patterns, |content_type| and
  // |resource_identifier|. Setting the value to CONTENT_SETTING_DEFAULT causes
  // the default setting for that type to be used when loading pages matching
  // this pattern. Unless adding a custom-scoped setting, most developers will
  // want to use SetContentSettingDefaultScope() instead.
  //
  // NOTICE: This is just a convenience method for content types that use
  // |CONTENT_SETTING| as their data type. For content types that use other
  // data types please use the method SetWebsiteSettingDefaultScope().
  //
  // This should only be called on the UI thread.
  void SetContentSettingCustomScope(
      const ContentSettingsPattern& primary_pattern,
      const ContentSettingsPattern& secondary_pattern,
      ContentSettingsType content_type,
      const std::string& resource_identifier,
      ContentSetting setting);

  // Sets the content |setting| for the default scope of the url that is
  // appropriate for the given |content_type| and |resource_identifier|.
  // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting
  // for that type to be used.
  //
  // NOTICE: This is just a convenience method for content types that use
  // |CONTENT_SETTING| as their data type. For content types that use other
  // data types please use the method SetWebsiteSettingDefaultScope().
  //
  // This should only be called on the UI thread.
  //
  // Internally this will call SetContentSettingCustomScope() with the default
  // scope patterns for the given |content_type|. Developers will generally want
  // to use this function instead of SetContentSettingCustomScope() unless they
  // need to specify custom scoping.
  void SetContentSettingDefaultScope(const GURL& primary_url,
                                     const GURL& secondary_url,
                                     ContentSettingsType content_type,
                                     const std::string& resource_identifier,
                                     ContentSetting setting);

  // Sets the |value| for the default scope of the url that is appropriate for
  // the given |content_type| and |resource_identifier|. Setting the value to
  // null removes the default pattern pair for this content type.
  //
  // Internally this will call SetWebsiteSettingCustomScope() with the default
  // scope patterns for the given |content_type|. Developers will generally want
  // to use this function instead of SetWebsiteSettingCustomScope() unless they
  // need to specify custom scoping.
  void SetWebsiteSettingDefaultScope(const GURL& requesting_url,
                                     const GURL& top_level_url,
                                     ContentSettingsType content_type,
                                     const std::string& resource_identifier,
                                     std::unique_ptr<base::Value> value);

  // Sets a rule to apply the |value| for all sites matching |pattern|,
  // |content_type| and |resource_identifier|. Setting the value to null removes
  // the given pattern pair. Unless adding a custom-scoped setting, most
  // developers will want to use SetWebsiteSettingDefaultScope() instead.
  void SetWebsiteSettingCustomScope(
      const ContentSettingsPattern& primary_pattern,
      const ContentSettingsPattern& secondary_pattern,
      ContentSettingsType content_type,
      const std::string& resource_identifier,
      std::unique_ptr<base::Value> value);

  // Sets the most specific rule that currently defines the setting for the
  // given content type. TODO(raymes): Remove this once all content settings
  // are scoped to origin scope. There is no scope more narrow than origin
  // scope, so we can just blindly set the value of the origin scope when that
  // happens.
  void SetNarrowestContentSetting(const GURL& primary_url,
                                  const GURL& secondary_url,
                                  ContentSettingsType type,
                                  ContentSetting setting);

  // Clears all host-specific settings for one content type.
  //
  // This should only be called on the UI thread.
  void ClearSettingsForOneType(ContentSettingsType content_type);

  // If |pattern_predicate| is null, this method is equivalent to the above.
  // Otherwise, it only deletes exceptions matched by |pattern_predicate|.
  void ClearSettingsForOneTypeWithPredicate(
      ContentSettingsType content_type,
      const base::Callback<bool(
          const ContentSettingsPattern& primary_pattern,
          const ContentSettingsPattern& secondary_pattern)>& pattern_predicate);

  static bool IsDefaultSettingAllowedForType(ContentSetting setting,
                                             ContentSettingsType content_type);

  // RefcountedKeyedService implementation.
  void ShutdownOnUIThread() override;

  // content_settings::Observer implementation.
  void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern,
                               const ContentSettingsPattern& secondary_pattern,
                               ContentSettingsType content_type,
                               std::string resource_identifier) override;

  // Returns the ProviderType associated with the given source string.
  // TODO(estade): I regret adding this. At the moment there are no legitimate
  // uses. We should stick to ProviderType rather than string so we don't have
  // to convert backwards.
  static ProviderType GetProviderTypeFromSource(const std::string& source);

  bool is_incognito() const {
    return is_incognito_;
  }

  // Returns a single |ContentSetting| which applies to the given URLs, just as
  // |GetContentSetting| does. If the setting is allowed, it also records the
  // last usage to preferences.
  //
  // This should only be called on the UI thread, unlike |GetContentSetting|.
  ContentSetting GetContentSettingAndMaybeUpdateLastUsage(
      const GURL& primary_url,
      const GURL& secondary_url,
      ContentSettingsType content_type,
      const std::string& resource_identifier);

  // Sets the last time that a given content type has been used for the pattern
  // which matches the URLs to the current time.
  void UpdateLastUsage(const GURL& primary_url,
                       const GURL& secondary_url,
                       ContentSettingsType content_type);

  // Sets the last time that a given content type has been used for a pattern
  // pair to the current time.
  void UpdateLastUsageByPattern(const ContentSettingsPattern& primary_pattern,
                                const ContentSettingsPattern& secondary_pattern,
                                ContentSettingsType content_type);

  // Returns the last time the pattern that matches the URL has requested
  // permission for the |content_type| setting.
  base::Time GetLastUsage(const GURL& primary_url,
                          const GURL& secondary_url,
                          ContentSettingsType content_type);

  // Returns the last time the pattern has requested permission for the
  // |content_type| setting.
  base::Time GetLastUsageByPattern(
      const ContentSettingsPattern& primary_pattern,
      const ContentSettingsPattern& secondary_pattern,
      ContentSettingsType content_type);

  // Adds/removes an observer for content settings changes.
  void AddObserver(content_settings::Observer* observer);
  void RemoveObserver(content_settings::Observer* observer);

  // Schedules any pending lossy website settings to be written to disk.
  void FlushLossyWebsiteSettings();

  // Passes ownership of |clock|.
  void SetPrefClockForTesting(std::unique_ptr<base::Clock> clock);

  // Migrate old domain scoped ALLOW settings to be origin scoped for
  // ContentSettingsTypes which are domain scoped. Only narrow down ALLOW
  // domain settings to origins so that this will not cause privacy/security
  // issues.
  //
  // |after_sync| will be false when called upon construction of this object and
  // true when called by the sync layer after sync is completed.
  // TODO(lshang): https://crbug.com/621398 Remove this when clients have
  // migrated (~M56).
  void MigrateDomainScopedSettings(bool after_sync);

  base::WeakPtr<HostContentSettingsMap> GetWeakPtr();

 private:
  friend class base::RefCountedThreadSafe<HostContentSettingsMap>;

  FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest,
                           DomainToOriginMigrationStatus);
  FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest,
                           MigrateDomainScopedSettings);
  FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest, MigrateKeygenSettings);

  friend class content_settings::TestUtils;

  ~HostContentSettingsMap() override;

  ContentSetting GetDefaultContentSettingFromProvider(
      ContentSettingsType content_type,
      content_settings::ProviderInterface* provider) const;

  // Retrieves default content setting for |content_type|, and writes the
  // provider's type to |provider_type| (must not be null).
  ContentSetting GetDefaultContentSettingInternal(
      ContentSettingsType content_type,
      ProviderType* provider_type) const;

  // Migrate Keygen settings which only use a primary pattern. Settings which
  // only used a primary pattern were inconsistent in what they did with the
  // secondary pattern. Some stored a ContentSettingsPattern::Wildcard() whereas
  // others stored the same pattern twice. This function migrates all such
  // settings to use ContentSettingsPattern::Wildcard(). This allows us to make
  // the scoping code consistent across different settings.
  // TODO(lshang): Remove this when clients have migrated (~M53). We should
  // leave in some code to remove old-format settings for a long time.
  void MigrateKeygenSettings();

  // Collect UMA data of exceptions.
  void RecordExceptionMetrics();

  // Adds content settings for |content_type| and |resource_identifier|,
  // provided by |provider|, into |settings|. If |incognito| is true, adds only
  // the content settings which are applicable to the incognito mode and differ
  // from the normal mode. Otherwise, adds the content settings for the normal
  // mode.
  void AddSettingsForOneType(
      const content_settings::ProviderInterface* provider,
      ProviderType provider_type,
      ContentSettingsType content_type,
      const std::string& resource_identifier,
      ContentSettingsForOneType* settings,
      bool incognito) const;

  // Call UsedContentSettingsProviders() whenever you access
  // content_settings_providers_ (apart from initialization and
  // teardown), so that we can DCHECK in RegisterExtensionService that
  // it is not being called too late.
  void UsedContentSettingsProviders() const;

  // Returns the single content setting |value| with a toggle for if it
  // takes the global on/off switch into account.
  std::unique_ptr<base::Value> GetWebsiteSettingInternal(
      const GURL& primary_url,
      const GURL& secondary_url,
      ContentSettingsType content_type,
      const std::string& resource_identifier,
      content_settings::SettingInfo* info) const;

  static std::unique_ptr<base::Value> GetContentSettingValueAndPatterns(
      const content_settings::ProviderInterface* provider,
      const GURL& primary_url,
      const GURL& secondary_url,
      ContentSettingsType content_type,
      const std::string& resource_identifier,
      bool include_incognito,
      ContentSettingsPattern* primary_pattern,
      ContentSettingsPattern* secondary_pattern);

  static std::unique_ptr<base::Value> GetContentSettingValueAndPatterns(
      content_settings::RuleIterator* rule_iterator,
      const GURL& primary_url,
      const GURL& secondary_url,
      ContentSettingsPattern* primary_pattern,
      ContentSettingsPattern* secondary_pattern);

#ifndef NDEBUG
  // This starts as the thread ID of the thread that constructs this
  // object, and remains until used by a different thread, at which
  // point it is set to base::kInvalidThreadId. This allows us to
  // DCHECK on unsafe usage of content_settings_providers_ (they
  // should be set up on a single thread, after which they are
  // immutable).
  mutable base::PlatformThreadId used_from_thread_id_;
#endif

  // Weak; owned by the Profile.
  PrefService* prefs_;

  // Whether this settings map is for an incognito session.
  bool is_incognito_;

  // Content setting providers. This is only modified at construction
  // time and by RegisterExtensionService, both of which should happen
  // before any other uses of it.
  std::map<ProviderType, std::unique_ptr<content_settings::ProviderInterface>>
      content_settings_providers_;

  // content_settings_providers_[PREF_PROVIDER] but specialized.
  content_settings::PrefProvider* pref_provider_ = nullptr;

  base::ThreadChecker thread_checker_;

  base::ObserverList<content_settings::Observer> observers_;

  base::WeakPtrFactory<HostContentSettingsMap> weak_ptr_factory_;

  DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap);
};

#endif  // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_HOST_CONTENT_SETTINGS_MAP_H_


text:
package org.jboss.as.quickstarts.cdi.injection;

import org.jboss.as.quickstarts.cdi.injection.qualifier.English;

/**
 * A simple implementation for the English language.
 *
 * The {@link English} qualifier tells CDI this is a special instance of the {@link TranslateService}.
 *
 * @author Jason Porter
 *
 */
@English
public class EnglishTranslateService implements TranslateService {

    @Override
    public String hello() {
        return "Hello";
    }

}


text:
<!DOCTYPE html>
<canvas id="output" width="100" height="100" style="background: blue;"></canvas>
<script>
"use strict";
const canvas = document.getElementById('output');
const ctx = canvas.getContext('2d');

ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 100, 100);
</script>


text:
.class Lcom/quizup/core/activities/ProfileActivity$1;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Landroid/view/View$OnClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/quizup/core/activities/ProfileActivity;->initSettingsButton(Z)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/quizup/core/activities/ProfileActivity;

# direct methods
.method constructor <init>(Lcom/quizup/core/activities/ProfileActivity;)V
    .locals 0

    .line 245
    iput-object p1, p0, Lcom/quizup/core/activities/ProfileActivity$1;->this$0:Lcom/quizup/core/activities/ProfileActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 3

    .line 249
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/quizup/core/activities/ProfileActivity$1;->this$0:Lcom/quizup/core/activities/ProfileActivity;

    const-class v2, Lcom/quizup/core/activities/SettingsActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 250
    move-object p1, v0

    const-string v1, "from_profile"

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 251
    iget-object v0, p0, Lcom/quizup/core/activities/ProfileActivity$1;->this$0:Lcom/quizup/core/activities/ProfileActivity;

    invoke-virtual {v0, p1}, Lcom/quizup/core/activities/ProfileActivity;->startActivity(Landroid/content/Intent;)V

    .line 252
    iget-object v0, p0, Lcom/quizup/core/activities/ProfileActivity$1;->this$0:Lcom/quizup/core/activities/ProfileActivity;

    const v1, 0x7f040005

    const v2, 0x7f040007

    invoke-virtual {v0, v1, v2}, Lcom/quizup/core/activities/ProfileActivity;->overridePendingTransition(II)V

    .line 253
    return-void
.end method


text:
package org.apache.thrift.transport;

import org.apache.thrift.TByteArrayOutputStream;

/**
 * TFramedTransport is a buffered TTransport that ensures a fully read message
 * every time by preceding messages with a 4-byte frame size.
 */
public class TFramedTransport extends TTransport {

  protected static final int DEFAULT_MAX_LENGTH = 16384000;

  private int maxLength_;

  /**
   * Underlying transport
   */
  private TTransport transport_ = null;

  /**
   * Buffer for output
   */
  private final TByteArrayOutputStream writeBuffer_ =
    new TByteArrayOutputStream(1024);

  /**
   * Buffer for input
   */
  private TMemoryInputTransport readBuffer_ = new TMemoryInputTransport(new byte[0]);

  public static class Factory extends TTransportFactory {
    private int maxLength_;

    public Factory() {
      maxLength_ = TFramedTransport.DEFAULT_MAX_LENGTH;
    }

    public Factory(int maxLength) {
      maxLength_ = maxLength;
    }

    @Override
    public TTransport getTransport(TTransport base) {
      return new TFramedTransport(base, maxLength_);
    }
  }

  /**
   * Constructor wraps around another transport
   */
  public TFramedTransport(TTransport transport, int maxLength) {
    transport_ = transport;
    maxLength_ = maxLength;
  }

  public TFramedTransport(TTransport transport) {
    transport_ = transport;
    maxLength_ = TFramedTransport.DEFAULT_MAX_LENGTH;
  }

  public void open() throws TTransportException {
    transport_.open();
  }

  public boolean isOpen() {
    return transport_.isOpen();
  }

  public void close() {
    transport_.close();
  }

  public int read(byte[] buf, int off, int len) throws TTransportException {
    if (readBuffer_ != null) {
      int got = readBuffer_.read(buf, off, len);
      if (got > 0) {
        return got;
      }
    }

    // Read another frame of data
    readFrame();

    return readBuffer_.read(buf, off, len);
  }

  @Override
  public byte[] getBuffer() {
    return readBuffer_.getBuffer();
  }

  @Override
  public int getBufferPosition() {
    return readBuffer_.getBufferPosition();
  }

  @Override
  public int getBytesRemainingInBuffer() {
    return readBuffer_.getBytesRemainingInBuffer();
  }

  @Override
  public void consumeBuffer(int len) {
    readBuffer_.consumeBuffer(len);
  }

  private final byte[] i32buf = new byte[4];

  private void readFrame() throws TTransportException {
    transport_.readAll(i32buf, 0, 4);
    int size = decodeFrameSize(i32buf);

    if (size < 0) {
      close();
      throw new TTransportException(TTransportException.CORRUPTED_DATA, "Read a negative frame size (" + size + ")!");
    }

    if (size > maxLength_) {
      close();
      throw new TTransportException(TTransportException.CORRUPTED_DATA,
          "Frame size (" + size + ") larger than max length (" + maxLength_ + ")!");
    }

    byte[] buff = new byte[size];
    transport_.readAll(buff, 0, size);
    readBuffer_.reset(buff);
  }

  public void write(byte[] buf, int off, int len) throws TTransportException {
    writeBuffer_.write(buf, off, len);
  }

  @Override
  public void flush() throws TTransportException {
    byte[] buf = writeBuffer_.get();
    int len = writeBuffer_.len();
    writeBuffer_.reset();

    encodeFrameSize(len, i32buf);
    transport_.write(i32buf, 0, 4);
    transport_.write(buf, 0, len);
    transport_.flush();
  }

  public static final void encodeFrameSize(final int frameSize, final byte[] buf) {
    buf[0] = (byte)(0xff & (frameSize >> 24));
    buf[1] = (byte)(0xff & (frameSize >> 16));
    buf[2] = (byte)(0xff & (frameSize >> 8));
    buf[3] = (byte)(0xff & (frameSize));
  }

  public static final int decodeFrameSize(final byte[] buf) {
    return
      ((buf[0] & 0xff) << 24) |
      ((buf[1] & 0xff) << 16) |
      ((buf[2] & 0xff) <<  8) |
      ((buf[3] & 0xff));
  }
}


text:
module HStatusBar.Disk
  ( disk
  ) where

import           HStatusBar.Common
import           HStatusBar.Decl
import           HStatusBar.Types
import           System.Posix.StatVFS
import qualified Text.Megaparsec      as MP

disk :: Decl
disk = disk_ <$> (decl "disk" *> ((unpack <$>) <$> MP.many arg))

disk_ :: [FilePath] -> Module
disk_ paths chan =
  forever $ do
    stats <- forM paths statVFS
    let avail s =
          fromIntegral (statVFS_bsize s) * fromIntegral (statVFS_bavail s)
    let tpaths :: [Text] = pack <$> paths
    let addLabels as = (\(p, a) -> p ++ "=" ++ a) <$> tpaths `zip` as
    writeChan chan $ unwords $ addLabels $ humanSI 0 . avail <$> stats
    threadDelay $ 10700 * 1000


text:
<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'My Web Application',
	'defaultController'=>'page',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		/*
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'Enter Your Password Here',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		*/
	),

	// application components
	'components'=>array(

		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),

		// uncomment the following to enable URLs in path-format

		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName'=>false,
			'caseSensitive'=>false,
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),

		// database settings are configured in database.php
		'db'=>require(dirname(__FILE__).'/database.php'),

		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=yiinigo',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),

		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),

	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);


text:
"""
Lighty
======

Lighty is a simple all in one web framework writen in Python. It includes:

- Tool to configure applications using configuration files.
- Simple ORM to access MongoDB (other databases will be added in future). This
  ORM looks close to Django's ORM.
- Simple but powerfull and fast template engine almost like Django Templates or
  Jinja2.
- URL routing: can easy resolve urls described in specified format and reverse
  urls for view name and arguments taken.
- Bindings to WSGI and Tornado.

It's not a full list of features. To read more look into documentation.
"""
from distutils.core import setup

setup(
    name='lighty',
    version='0.4.4',
    description='Simple all-in-one web framework',
    long_description=__doc__,
    keywords='Template HTML XML',
    author='Andrey Grygoryev',
    author_email='undeadgrandse@gmail.com',
    license='BSD',
    url='https://github.com/GrAndSE/lighty',
    packages=['lighty', 'lighty.db', 'lighty.templates', 'lighty.wsgi'],
    data_files=[('lighty/wsgi/templates',
                 ['lighty/wsgi/templates/debug.html'])],
    platforms="any",
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.2',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Internet :: WWW/HTTP :: WSGI',
        'Topic :: Software Development :: Libraries :: Application Frameworks',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Text Processing :: Markup :: HTML',
    ],
)


text:
var style = require('dom-style')
var draggable = require('../')

require('domready')(function() {
    var container = document.createElement("div")
    style(container, {
        position: 'absolute',
        top: '0px',
        left: '0px',
        width: '128px',
        height: '128px',
        cursor: 'pointer',
        background: 'red'
    })
    document.body.appendChild(container)

    var highlight = document.createElement("div")
    style(highlight, {
        position: 'absolute',
        top: '0px',
        left: '0px',
        width: '40px',
        margin: '-5px',
        'pointer-events': 'none',
        height: '40px',
        cursor: 'pointer',
        background: 'black'
    })
    document.body.appendChild(highlight)

    var drag = draggable(container, { touch: true })
    drag.on('start', function(ev, offset, delta) {
        console.log("Start drag", offset)
    })
    drag.on('move', function(ev, offset, delta) {
        style(highlight, {
            left: offset.x+'px',
            top: offset.y+'px'
        })
        console.log("Delta: ", delta)
    })
    drag.on('end', function(ev, offset, delta) {
        console.log("Stop drag", offset)
    })
})


text:
package com.github.mdr.mash.parser

sealed trait RedirectOperator
object RedirectOperator {

  case object StandardInput extends RedirectOperator
  case object StandardOutput extends RedirectOperator

}


text:
#ifndef SKY_ENGINE_PLATFORM_FONTS_CUSTOMFONTDATA_H_
#define SKY_ENGINE_PLATFORM_FONTS_CUSTOMFONTDATA_H_

#include <unicode/uchar.h>
#include "flutter/sky/engine/platform/PlatformExport.h"
#include "flutter/sky/engine/platform/fonts/Glyph.h"
#include "flutter/sky/engine/wtf/PassRefPtr.h"
#include "flutter/sky/engine/wtf/RefCounted.h"

namespace blink {

struct GlyphData;
class GlyphPage;
class SimpleFontData;
struct WidthIterator;

class PLATFORM_EXPORT CustomFontData : public RefCounted<CustomFontData> {
public:
    static PassRefPtr<CustomFontData> create() { return adoptRef(new CustomFontData()); }

    virtual ~CustomFontData() { }

    virtual void beginLoadIfNeeded() const { };
    virtual bool isLoading() const { return false; }
    virtual bool isLoadingFallback() const { return false; }
    virtual bool shouldSkipDrawing() const { return false; }
    virtual void clearFontFaceSource() { }

    virtual bool isSVGFont() const { return false; }
    virtual void initializeFontData(SimpleFontData*, float) { }

protected:
    CustomFontData() { }
};

#define DEFINE_CUSTOM_FONT_DATA_TYPE_CASTS(thisType, predicate) \
    template<typename T> inline thisType* to##thisType(const RefPtr<T>& customFontData) { return to##thisType(customFontData.get()); } \
    DEFINE_TYPE_CASTS(thisType, CustomFontData, customFontData, customFontData->predicate, customFontData.predicate)

} // namespace blink

#endif  // SKY_ENGINE_PLATFORM_FONTS_CUSTOMFONTDATA_H_


text:
<?php

/*
 * (c) Sajjad Hashemian <wolaws@gmail.com>
 */

namespace Sijad\Auth\Steam\Listener;

use Flarum\Event\ConfigureForumRoutes;
use Illuminate\Contracts\Events\Dispatcher;

class AddSteamAuthRoute
{
    /**
     * @param Dispatcher $events
     */
    public function subscribe(Dispatcher $events)
    {
        $events->listen(ConfigureForumRoutes::class, [$this, 'configureForumRoutes']);
    }

    /**
     * @param ConfigureForumRoutes $event
     */
    public function configureForumRoutes(ConfigureForumRoutes $event)
    {
        $event->get('/auth/steam', 'auth.steam', 'Sijad\Auth\Steam\SteamAuthController');
    }
}


text:
BUILD_DIR=~/rpmbuild
version=$(tr -d [:space:] <VERSION)

autoreconf -if && \
./configure $* && \
make clean && \
make dist && \
mkdir -p $BUILD_DIR/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp} && \
cp redhat/libksi.spec $BUILD_DIR/SPECS/ && \
cp libksi-*.tar.gz $BUILD_DIR/SOURCES/ && \
rpmbuild -ba $BUILD_DIR/SPECS/libksi.spec && \
cp $BUILD_DIR/RPMS/*/libksi-*$version*.rpm . && \
cp $BUILD_DIR/SRPMS/libksi-*$version*.rpm .


text:
package NetSNMP::agent::default_store;

use strict;
use Carp;

require Exporter;
require DynaLoader;
use AutoLoader;

use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION $AUTOLOAD);

@ISA = qw(Exporter DynaLoader);

# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

# This allows declaration	use NetSNMP::agent::default_store ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
%EXPORT_TAGS = ( 'all' => [ qw(
				   NETSNMP_DS_AGENT_VERBOSE
				   NETSNMP_DS_AGENT_ROLE
				   NETSNMP_DS_AGENT_NO_ROOT_ACCESS
				   NETSNMP_DS_AGENT_AGENTX_MASTER
				   NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
				   NETSNMP_DS_AGENT_DISABLE_PERL
				   NETSNMP_DS_AGENT_PROGNAME
				   NETSNMP_DS_AGENT_X_SOCKET
				   NETSNMP_DS_AGENT_PORTS
				   NETSNMP_DS_AGENT_INTERNAL_SECNAME
				   NETSNMP_DS_AGENT_PERL_INIT_FILE
				   NETSNMP_DS_AGENT_FLAGS
				   NETSNMP_DS_AGENT_USERID
				   NETSNMP_DS_AGENT_GROUPID
				   NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
) ] );

@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

@EXPORT = qw(
				   NETSNMP_DS_AGENT_VERBOSE
				   NETSNMP_DS_AGENT_ROLE
				   NETSNMP_DS_AGENT_NO_ROOT_ACCESS
				   NETSNMP_DS_AGENT_AGENTX_MASTER
				   NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
				   NETSNMP_DS_AGENT_DISABLE_PERL
				   NETSNMP_DS_AGENT_PROGNAME
				   NETSNMP_DS_AGENT_X_SOCKET
				   NETSNMP_DS_AGENT_PORTS
				   NETSNMP_DS_AGENT_INTERNAL_SECNAME
				   NETSNMP_DS_AGENT_PERL_INIT_FILE
				   NETSNMP_DS_AGENT_FLAGS
				   NETSNMP_DS_AGENT_USERID
				   NETSNMP_DS_AGENT_GROUPID
				   NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL
);
$VERSION = '0.01';

sub AUTOLOAD {
    # This AUTOLOAD is used to 'autoload' constants from the constant()
    # XS function.  If a constant is not found then control is passed
    # to the AUTOLOAD in AutoLoader.

    my $constname;
    ($constname = $AUTOLOAD) =~ s/.*:://;
    croak "& not defined" if $constname eq 'constant';
    my $val = constant($constname, @_ ? $_[0] : 0);
    if ($! != 0) {
	if ($! =~ /Invalid/ || $!{EINVAL}) {
	    $AutoLoader::AUTOLOAD = $AUTOLOAD;
	    goto &AutoLoader::AUTOLOAD;
	}
	else {
	    croak "Your vendor has not defined NetSNMP::agent::default_store macro $constname";
	}
    }
    {
	no strict 'refs';
	# Fixed between 5.005_53 and 5.005_61
# 	if ($] >= 5.00561) {
# 	    *$AUTOLOAD = sub () { $val };
# 	}
# 	else {
	    *$AUTOLOAD = sub { $val };
# 	}
    }
    goto &$AUTOLOAD;
}

bootstrap NetSNMP::agent::default_store $VERSION;

# Preloaded methods go here.

# Autoload methods go after =cut, and are processed by the autosplit program.

1;
__END__
# Below is stub documentation for your module. You better edit it!

=head1 NAME

NetSNMP::agent::default_store - Perl extension for blah blah blah

=head1 SYNOPSIS

  use NetSNMP::agent::default_store;
  blah blah blah

=head1 DESCRIPTION

Stub documentation for NetSNMP::agent::default_store, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.

=head2 EXPORT

None by default.

=head2 Exportable constants

				   NETSNMP_DS_AGENT_VERBOSE
				   NETSNMP_DS_AGENT_ROLE
				   NETSNMP_DS_AGENT_NO_ROOT_ACCESS
				   NETSNMP_DS_AGENT_AGENTX_MASTER
				   NETSNMP_DS_AGENT_QUIT_IMMEDIATELY
				   NETSNMP_DS_AGENT_DISABLE_PERL
				   NETSNMP_DS_AGENT_PROGNAME
				   NETSNMP_DS_AGENT_X_SOCKET
				   NETSNMP_DS_AGENT_PORTS
				   NETSNMP_DS_AGENT_INTERNAL_SECNAME
				   NETSNMP_DS_AGENT_PERL_INIT_FILE
				   NETSNMP_DS_AGENT_FLAGS
				   NETSNMP_DS_AGENT_USERID
				   NETSNMP_DS_AGENT_GROUPID
				   NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL

  DS_AGENT_AGENTX_MASTER
  DS_AGENT_AGENTX_PING_INTERVAL
  DS_AGENT_FLAGS
  DS_AGENT_GROUPID
  DS_AGENT_H
  DS_AGENT_INTERNAL_SECNAME
  DS_AGENT_NO_ROOT_ACCESS
  DS_AGENT_PORTS
  DS_AGENT_PROGNAME
  DS_AGENT_ROLE
  DS_AGENT_USERID
  DS_AGENT_VERBOSE
  DS_AGENT_X_SOCKET

=head1 AUTHOR

A. U. Thor, a.u.thor@a.galaxy.far.far.away

=head1 SEE ALSO

perl(1).

=cut


text:
using System;
using System.Net;
using Newtonsoft.Json.Linq;

namespace PatchKit.Api
{
    /// <summary>
    /// API response.
    /// </summary>
    /// <seealso cref="System.IDisposable" />
    public interface IApiResponse : IDisposable
    {
        /// <summary>
        /// HTTP web response.
        /// </summary>
        IHttpWebResponse HttpWebResponse { get; }

        /// <summary>
        /// Response body.
        /// </summary>
        string Body { get; }

        /// <summary>
        /// Returns body parsed to JSON.
        /// </summary>
        JToken GetJson();
    }
}


text:
@implementation XHCustomImageView

- (NSString *)largePhotoURLString {
    return @"http://www.pailixiu.com/jack/large.jpeg";
}

- (NSString *)thnumbnailPhotoURLString {
    return @"http://www.pailixiu.com/jack/thumbnail.jpeg";
}

@end


text:
'''
Wavenet model definition and generation using contrib.layers
 - Carl Quillen
'''

from __future__ import print_function

import tensorflow as tf
import tensorflow.contrib.layers as layers
from tensorflow.contrib.framework import arg_scope

def wavenet_block(xpad, x, conditioning, num_outputs,
                  num_outputs2, rate, is_training, opts, scope):
    '''
    wavenet_block: many important convolution parameters (reuse, kernel_size
    etc.) come from the arg_scope() and are set by wavenet().

    Note that convolutions below end up being causal because the
    input is padded and padding='VALID'. This causes samples to
    drop in the "right" way.
    '''

    dropout, kernel_size, skip_dimension, histogram_summaries = (
        opts.dropout, opts.kernel_size, opts.skip_dimension,
        opts.histogram_summaries)

    conv_gate = layers.conv2d(
        xpad, num_outputs=num_outputs2*2, rate=rate, kernel_size=kernel_size,
        activation_fn=None, normalizer_params=None, scope=scope + '/conv_gate')

    # Add the conditioning.
    conv_gate += layers.conv2d(
        conditioning, num_outputs=num_outputs2*2, rate=rate, kernel_size=1,
        activation_fn=None, normalizer_params=None, scope=scope + '/cur_cond')

    with tf.name_scope(scope + '/activation'):
        conv = tf.nn.tanh(conv_gate[:, :, :num_outputs2], name='conv')
        gate = tf.nn.sigmoid(conv_gate[:, :, num_outputs2:], name='gate')

    with tf.name_scope(scope + '/prod'):
        out = conv * gate

    if dropout > 0:
        out = layers.dropout(out, keep_prob=dropout,
                             is_training=is_training, scope=scope + '/dropout')

    out = layers.conv2d(out, num_outputs=num_outputs, kernel_size=1,
                        activation_fn=None,
                        scope=scope + '/output_xform')
    with tf.name_scope(scope + '/residual'):
        residual = x + out

    if skip_dimension != num_outputs:      # Upscale for more goodness.
        out = layers.conv2d(out, num_outputs=skip_dimension,
                            kernel_size=1, activation_fn=None,
                            scope=scope + '/skip_upscale')

    if histogram_summaries:
        tf.summary.histogram(name=scope + '/conv', values=conv)
        tf.summary.histogram(name=scope + '/gate', values=gate)
        tf.summary.histogram(name=scope + '/out', values=out)

    return residual, out        # out gets added to the skip connections.

def padded(new_x, pad, scope, n_chunks, reuse=False,
           reverse=False, data_format=None):
    '''
    Pad new_x, and save the rightmost window for context for the next time
    we do the same convolution.  This context carries across utterances
    during training.  Using this trick also allows us to use the same
    wavenet() routine in training as well as generation.

    reverse=True for reversing the direction of causality.
    '''

    with tf.variable_scope(scope, reuse=reuse):

        if data_format is 'NCW':
            x = tf.get_variable(
                'pad', shape=(n_chunks, new_x.get_shape()[1], pad),
                collections=[tf.GraphKeys.GLOBAL_VARIABLES, 'padding'],
                initializer=tf.constant_initializer(), trainable=False)
            if not reverse:
                y = tf.concat(values=(x, new_x), axis=2)
                x = tf.assign(x, y[:, :, -pad:])
            else:
                y = tf.concat(values=(new_x, x), axis=2)
                x = tf.assign(x, y[:, :, :pad])
        else:
            x = tf.get_variable(
                'pad', shape=(n_chunks, pad, new_x.get_shape()[2]),
                collections=[tf.GraphKeys.GLOBAL_VARIABLES, 'padding'],
                initializer=tf.constant_initializer(), trainable=False)
            if not reverse:
                y = tf.concat(values=(x, new_x), axis=1)
                x = tf.assign(x, y[:, -pad:, :])
            else:
                y = tf.concat(values=(new_x, x), axis=1)
                x = tf.assign(x, y[:, :pad, :])
        with tf.get_default_graph().control_dependencies([x]):
            return tf.identity(y)

def wavenet(inputs, opts, is_training=True, reuse=False, pad_reuse=False,
            data_format=None, extra_pad_scope=''):
    '''
    The wavenet model definition for training/generation.
    use wavenets recursively, we will want separate padding variables for
    each "layer".  So we have a separate reuse flag for padding() and
    an additional thing to add to the scope for padding() in that case.
    '''

    # Parameters for batch normalization
    normalizer_params = {}
    if opts.batch_norm:
        normalizer_params = {
            'normalizer_fn': layers.batch_norm,
            'normalizer_params': {
                'is_training': is_training,
                'trainable': False,
                'variables_collections': {
                   'gamma': ['batch_norm']},
                'reuse': reuse,
                'scale': True,  # Update Variance too.
                'scope': 'BatchNorm'
            }
        }

    l2reg = None
    if 'l2reg' in vars(opts):
        l2reg = tf.contrib.layers.l2_regularizer(opts.l2reg)
    # unpack inputs.
    inputs, user, alignment, lf0 = inputs

    with tf.variable_scope('conditioning'):
        conditioning = tf.one_hot(alignment, depth=opts.n_phones,
                                  name='align_onehot')
        conditioning = tf.reshape(
            conditioning, (opts.n_chunks, -1, opts.n_phones*opts.context))
        if user is not None:
            user = tf.one_hot(user, depth=opts.n_users, name='user_onehot')
            conditioning = tf.concat([user, conditioning], axis=2,
                                     name='cat_user')
        lf0 = tf.reshape(lf0, (opts.n_chunks, -1, 1))
        conditioning = tf.concat((conditioning, lf0), axis=2, name='cat_lf0')

    # The arg_scope below will apply to all convolutions, including the ones
    # in wavenet_block().
    with arg_scope([layers.conv2d], data_format=data_format,
                   reuse=reuse, padding='VALID', weights_regularizer=l2reg,
                   **normalizer_params):
        if opts.input_kernel_size > 1:
            inputs = padded(new_x=inputs, reuse=pad_reuse,
                            reverse=opts.reverse, pad=opts.input_kernel_size-1,
                            n_chunks=opts.n_chunks, data_format=data_format,
                            scope='input_layer/pad'+extra_pad_scope)
        x = layers.conv2d(inputs, num_outputs=opts.num_outputs,
                          kernel_size=opts.input_kernel_size, rate=1,
                          activation_fn=tf.nn.tanh, scope='input_layer')

        skip_connections = 0
        for i_block, block_dilations in enumerate(opts.dilations):
            for rate in block_dilations:
                block_rate = "block_{}/rate_{}".format(i_block, rate)
                xpad = padded(
                    new_x=x, pad=rate*(opts.kernel_size-1),
                    reuse=pad_reuse, n_chunks=opts.n_chunks,
                    reverse=opts.reverse, data_format=data_format,
                    scope=block_rate+"/pad"+extra_pad_scope)

                x, skip_connection = wavenet_block(
                    xpad, x, conditioning, opts.num_outputs,
                    opts.num_outputs2, rate, is_training,
                    opts, scope=block_rate)

                with tf.name_scope(block_rate+"_skip".format(i_block, rate)):
                    skip_connections += skip_connection

    with tf.name_scope("relu_skip"):
        skip_connections = tf.nn.relu(skip_connections)

    with arg_scope([layers.conv2d], kernel_size=1, reuse=reuse,
                   data_format=data_format):
        x = layers.conv2d(
            skip_connections, num_outputs=opts.skip_dimension,  # ?
            activation_fn=tf.nn.relu, scope='output_layer1')
        mfcc = layers.conv2d(
            x, num_outputs=opts.skip_dimension,   # ?
            activation_fn=tf.nn.relu, scope='mfcc_layer1')
        x = layers.conv2d(
            x, num_outputs=3,
            normalizer_params=None,
            activation_fn=None, scope='output_layer2')
        mfcc = layers.conv2d(
            mfcc, num_outputs=opts.n_mfcc, normalizer_params=None,
            activation_fn=None, scope='mfcc_layer2')

    with tf.name_scope("unpack_output"):
        mu = x[:, :, 0]
        r = tf.sin(x[:, :, 1]/opts.r_scale)*opts.r_scale
        r = r*r + 1.0
        q = 0.999*r*tf.sin(x[:, :, 2])
    return mu, r, q, mfcc

def compute_overlap(opts):
    total_lost = opts.input_kernel_size-1
    for block_dilations in opts.dilations:
        for rate in block_dilations:
            total_lost += rate*(opts.kernel_size-1)
    return total_lost


text:
package com.microsoft.azure.spring.cloud.autoconfigure.servicebus;

import com.microsoft.azure.servicebus.QueueClient;
import com.microsoft.azure.spring.integration.servicebus.queue.ServiceBusQueueOperation;
import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

import static org.assertj.core.api.Assertions.assertThat;

public class AzureServiceBusQueueAutoConfigurationTest {
    private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
        .withConfiguration(AutoConfigurations.of(AzureServiceBusQueueAutoConfiguration.class));

    @Test
    public void testAzureServiceBusDisabled() {
        this.contextRunner.withPropertyValues("spring.cloud.azure.servicebus.enabled=false")
            .run(context -> assertThat(context).doesNotHaveBean(ServiceBusQueueOperation.class));
    }

    @Test
    public void testWithoutAzureServiceBusQueueClient() {
        this.contextRunner.withClassLoader(new FilteredClassLoader(QueueClient.class))
            .run(context -> assertThat(context).doesNotHaveBean(ServiceBusQueueOperation.class));
    }
}


text:
<!--
.. title: Rabbitmq and Erlang/OTP Windows Containers
.. slug: rabbitmq_windows_container
.. date: 2018-05-29 18:49:32 UTC
.. tags: erlang, rabbitmq, docker, dockerfile, .net, powershell, multi stages build
.. category: devops
.. link:
.. description: Windows Docker images for erlang and rabbitmq
.. type: text
-->

Here at [Gsx Solutions](http://www.gsx.com) for our full product suite, we highly rely on [RabbitMQ](https://www.rabbitmq.com/). Until last release we rely on version 3.5.4 we delivered to our customers. Since, this version has been recently been deprecated, we decided to upgrade our final package to [v3.7.4](https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.7.4).

<!-- TEASER_END -->

Then, started internal non regression tests. We are fully windows based, then we installed v3.5.4, ran a couple of micro services around the BUS and then upgrade to v3.7.4. We have found a [regression related to 3.5.4 -> 3.7.4 upgrade](https://github.com/rabbitmq/rabbitmq-server/issues/1568). But this process was a bit painful. That's why I decided to build rabbitmq docker images running in [Windows Containers](https://docs.docker.com/docker-for-windows/)

Let's have a look at the anatomy of the docker files. First, I wanted to prepare base images for [erlang-otp](http://www.erlang.org/).
I host erlang-otp dockerimages on this [github repository](https://github.com/drylm/erlang-otp-win)

As you may know, there are 2 flavors of windows base docker images. You cannot start your image *from scratch* like on linux system.

  * windowsservercore
  * nanoserver

The main difference between those 2 images is mostly the weigth of running and pulling such an image.
In the edition 1803:

  * windowsservercore: 1.58GB compressed / 3.61GB on disk
  * nanoserver       : < 100 MB compressed and on disk

One of the main removal between windowsservercore and nanoserver is powershell.
This is the main reason why the images I will show you are [multi stages docker images](https://docs.docker.com/develop/develop-images/multistage-build/) in order to bootstrap image creation in a *windowsservercore* with all administration capabilities and end up in *nanoserver* to be the lighter we can.

Here is the *erlang-otp 18.0* base dockerfile definition:

```dockerfile
FROM microsoft/windowsservercore:1709 as root
LABEL maintainer="muller.john@gmail.com"

ENV erlang_download_url="http://erlang.org/download/otp_win64_18.0.exe" \
    ERLANG_HOME=c:\\erlang

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# download and install erlang using silent install option, and remove installer when done
RUN Invoke-WebRequest -Uri $env:erlang_download_url -OutFile erlang_install.exe ; \
    Start-Process -Wait -FilePath .\erlang_install.exe -ArgumentList /S, /D=$env:ERLANG_HOME ; \
Remove-Item -Force erlang_install.exe

FROM microsoft/nanoserver:1709
LABEL maintainer="muller.john@gmail.com"

ENV ERLANG_HOME=c:\\erlang
COPY --from=root c:\\erlang c:\\erlang
COPY .erlang.cookie c:\\windows

RUN icacls c:\windows\.erlang.cookie /grant %USERNAME%:F

COPY --from=root C:\\windows\\system32\\msvcp100.dll C:\\windows\\system32
COPY --from=root C:\\windows\\system32\\msvcr100.dll C:\\windows\\system32
COPY --from=root C:\\windows\\system32\\vcomp100.dll C:\\windows\\system32
```

The version for *erlang-otp 20.3* is very similar, the only difference is in the url to download the otp msi and v20.0 does not need c++ runtime v100 from Visual Studio 2010.

```dockerfile
FROM microsoft/windowsservercore:1709 as root
LABEL maintainer="muller.john@gmail.com"

ENV erlang_download_url="http://erlang.org/download/otp_win64_20.3.exe" \
    ERLANG_HOME=c:\\erlang

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# download and install erlang using silent install option, and remove installer when done
RUN Invoke-WebRequest -Uri $env:erlang_download_url -OutFile erlang_install.exe ; \
    Start-Process -Wait -FilePath .\erlang_install.exe -ArgumentList /S, /D=$env:ERLANG_HOME ; \
    Remove-Item -Force erlang_install.exe

FROM microsoft/nanoserver:1709
LABEL maintainer="muller.john@gmail.com"

ENV HOMEDRIVE=c:\\ \
    HOMEPATH=Users\\ContainerUser \
    ERLANG_HOME=c:\\erlang

COPY --from=root c:\\erlang c:\\erlang
COPY .erlang.cookie c:\\windows

RUN icacls c:\windows\.erlang.cookie /grant %USERNAME%:F
```

Please note, when we build the final container using the instruction **FROM microsoft/nanoserver:1709**, all the **COPY** inbstructions refer to the step0 image specifying **--form=root** where *root* is the name of the first stage.

And then to build those images:

```
docker build --rm -t otp-nano:18.0 -f .\nanoserver\Dockerfile.18.0 .\nanoserver\
docker build --rm -t otp-nano:20.3 -f .\nanoserver\Dockerfile.20.3 .\nanoserver\
```

And now, you have 2 images called:
  * otp-nano:18.0
  * otp-nano:20.3

So now, based on those 2 base images we will build *rabbitmq* docker images. erlang-base images could be reused for something else after all :).
Nothing so fency for those *rabbitmq* images:
For v3.5.4:

```dockerfile
FROM microsoft/windowsservercore:1709 as root
LABEL maintainer="muller.john@gmail.com"

ENV RMQ_VERSION="3.5.4" \
    rabbit_download_url="https://www.rabbitmq.com/releases/rabbitmq-server/v3.5.4/rabbitmq-server-windows-3.5.4.zip"

# setup powershell options for RUN commands
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# download and extract rabbitmq, and remove zip file when done
RUN Invoke-WebRequest -Uri $env:rabbit_download_url -OutFile rabbitmq.zip ; \
        Expand-Archive -Path .\rabbitmq.zip -DestinationPath "c:\\" ; \
        Remove-Item -Force rabbitmq.zip; \
        Rename-Item c:\rabbitmq_server-$env:RMQ_VERSION c:\rabbitmq

FROM gsxsolutions/erlang-otp-nano:18.0
LABEL maintainer="muller.john@gmail.com"

COPY --from=root c:\\rabbitmq c:\\rabbitmq

# tell rabbitmq where to find our custom config file
ENV RABBITMQ_CONFIG_FILE="c:\rabbitmq" \
    RABBITMQ_BASE="c:\\rmq-data"

VOLUME ${RABBITMQ_BASE}

COPY start.cmd c:\\scripts\\start.cmd

RUN ["cmd", "/c", "echo [{rabbit, [{loopback_users, []}]}].> c:\\rabbitmq.config"]

RUN mkdir c:\Users\%USERNAME%\\AppData\\Roaming\\RabbitMQ

# Ports
# 4369: epmd, a peer discovery service used by RabbitMQ nodes and CLI tools
# 5672: used by AMQP 0-9-1 and 1.0 clients without TLS
# 5671: used by AMQP 0-9-1 and 1.0 clients with TLS
# 25672: used by Erlang distribution for inter-node and CLI tools communication and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + 20000).
# 15672: HTTP API clients and rabbitmqadmin (only if the management plugin is enabled)
EXPOSE 4369 5671 5672 25672 15672

# run server when container starts - container will shutdown when this process ends
CMD Scripts\\start.cmd
```

and for v3.7.4 and v3.7.5 (only difference is in the url where to download the package)

```dockerfile
FROM microsoft/windowsservercore:1709 as root
LABEL maintainer="muller.john@gmail.com"

ENV RMQ_VERSION="3.7.5" \
    rabbit_download_url="https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.5/rabbitmq-server-windows-3.7.5.zip"

# setup powershell options for RUN commands
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# download and extract rabbitmq, and remove zip file when done
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
    Invoke-WebRequest -Uri $env:rabbit_download_url -OutFile rabbitmq.zip ; \
    Expand-Archive -Path .\rabbitmq.zip -DestinationPath "c:\\" ; \
    Remove-Item -Force rabbitmq.zip; \
    Rename-Item c:\rabbitmq_server-$env:RMQ_VERSION c:\rabbitmq

FROM gsxsolutions/erlang-otp-nano:20.3
LABEL maintainer="muller.john@gmail.com"

COPY --from=root c:\\rabbitmq c:\\rabbitmq

# tell rabbitmq where to find our custom config file
ENV RABBITMQ_CONFIG_FILE="c:\rabbitmq" \
    RABBITMQ_BASE="c:\\rmq-data"

VOLUME ${RABBITMQ_BASE}

COPY start.cmd c:\\scripts\\start.cmd

RUN ["cmd", "/c", "echo [{rabbit, [{loopback_users, []}]}].> c:\\rabbitmq.config"]

RUN mkdir c:\Users\%USERNAME%\\AppData\\Roaming\\RabbitMQ

# Ports
# 4369: epmd, a peer discovery service used by RabbitMQ nodes and CLI tools
# 5672: used by AMQP 0-9-1 and 1.0 clients without TLS
# 5671: used by AMQP 0-9-1 and 1.0 clients with TLS
# 25672: used by Erlang distribution for inter-node and CLI tools communication and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + 20000).
# 15672: HTTP API clients and rabbitmqadmin (only if the management plugin is enabled)
EXPOSE 4369 5671 5672 25672 15672

# run server when container starts - container will shutdown when this process ends
CMD Scripts\\start.cmd
```

In those images, we use the same technic of multi stage build. so that in the initial *From* instruction, we have access to powershell and all fancy commands like :
  * Invoke-WebRequest
  * Expand-Archive
  * Start-Process

As you may notice, for v3.7.4 and v3.7.5, the archives are stored on github. PoerShell fully relies on .net and the .net framework installed on those images does not accept any Tls1.2 connection by default that's why you first must enable it by running:

```powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
```

In the final stat, we enable a volume by declaring it:

```
VOLUME ${RABBITMQ_BASE}
```

Then a default ocnfiguration file is created and we boostrap a script when the container bootstraps:

```bat
@echo off

echo "my-cookie" > c:\Windows\.erlang.cookie
if not exist %RABBITMQ_BASE%\enabled_plugins (
    call c:\rabbitmq\sbin\rabbitmq-plugins.bat enable rabbitmq_management --offline
)

call c:\rabbitmq\sbin\rabbitmq-server.bat
```

This script enables the management-plugin and start rabbitmq server.

```
docker build -t rmq:3.7.5 -f .\Dockerfile.3.7.5 .

docker volume create rmq-data

docker run --rm -h my-rabbit1 -v rmq-data:c:\rmq-data -ti rmq:3.7.5
```

Here we are we have now a beautiful *rabbitmq* server running on demand and totally isolated.
Now, we a named volume, we can easily make upgrade scenarios since the data will be persisted accross the container instances.

Stay tuned!