parameters: ( insertedTo, toInsert )
docstring: insert a sequence in another sequence.
  
      the sequence is inserted either at the end, or at the position
      of the HOOK, if it is found.
      The HOOK is considered as being found if
        str(elem).find(###ProductionTaskHook$$$)
      is true for one of the elements in the insertedTo sequence.
docstring_summary: insert a sequence in another sequence.
docstring_tokens: insert a sequence in another sequence .
function: def insertLines( insertedTo, toInsert ):
      '''insert a sequence in another sequence.
  
      the sequence is inserted either at the end, or at the position
      of the HOOK, if it is found.
      The HOOK is considered as being found if
        str(elem).find(###ProductionTaskHook$$$)
      is true for one of the elements in the insertedTo sequence. 
      '''
      HOOK = '###ProductionTaskHook$$$'
      hookIndex = None
      for index, line in enumerate(insertedTo):
          line = str(line)
          if line.find(HOOK)>-1:
              hookIndex = index
              break        
      if hookIndex is not None:
          before = insertedTo[:hookIndex]
          after = insertedTo[hookIndex:]
          result = before + toInsert + after
          return result
      else:
          insertedTo.extend( toInsert )
          return insertedTo
function_tokens: def insertLines ( insertedTo , toInsert ) : HOOK = '###ProductionTaskHook$$$' hookIndex = None for index , line in enumerate ( insertedTo ) : line = str ( line ) if line . find ( HOOK ) > - 1 : hookIndex = index break if hookIndex is not None : before = insertedTo [ : hookIndex ] after = insertedTo [ hookIndex : ] result = before + toInsert + after return result else : insertedTo . extend ( toInsert ) return insertedTo