parameters: (str, extended)
return_statement: return result
docstring: 3.2 Insertion unsort coding
docstring_summary: 3.2 Insertion unsort coding
docstring_tokens: 3 . 2 Insertion unsort coding
function: def insertion_unsort(str, extended):
      """3.2 Insertion unsort coding"""
      oldchar = 0x80
      result = []
      oldindex = -1
      for c in extended:
          index = pos = -1
          char = ord(c)
          curlen = selective_len(str, char)
          delta = (curlen+1) * (char - oldchar)
          while 1:
              index,pos = selective_find(str,c,index,pos)
              if index == -1:
                  break
              delta += index - oldindex
              result.append(delta-1)
              oldindex = index
              delta = 0
          oldchar = char
  
      return result
function_tokens: def insertion_unsort ( str , extended ) : oldchar = 0x80 result = [ ] oldindex = - 1 for c in extended : index = pos = - 1 char = ord ( c ) curlen = selective_len ( str , char ) delta = ( curlen + 1 ) * ( char - oldchar ) while 1 : index , pos = selective_find ( str , c , index , pos ) if index == - 1 : break delta += index - oldindex result . append ( delta - 1 ) oldindex = index delta = 0 oldchar = char return result