parameters: (hint, path)
docstring: Helper function for parsing and checking for hints in paths
      
      Hints strings should be split ('|') and passed as a singular hint into this function
docstring_summary: Helper function for parsing and checking for hints in paths
      
      Hints strings should be split ('|') and passed as a singular hint into this function
docstring_tokens: Helper function for parsing and checking for hints in paths Hints strings should be split ( | ) and passed as a singular hint into this function
function: def find_hint_in_path(hint, path):
      """
      Helper function for parsing and checking for hints in paths
      
      Hints strings should be split ('|') and passed as a singular hint into this function
      
      """
      
      if hint == '' or path == '':
          return -1
      
      joined_index = hint.find('##')
      pretext_index = hint.find('&&')
      if joined_index == -1 and pretext_index == -1:
          if '^' in hint or '@' in hint:
              print '..malformed or improper handling of hint: \'{0}\' path: \'{1}\''.format(hint, path)
              
              return -1
          
          explicit_index = hint.find('!!')
          if explicit_index == -1:
              return path.find(hint)
          
          else:
              explicit_hint = hint[:explicit_index]
              found_index = path.find(explicit_hint)
              if (len(explicit_hint) + found_index) == len(path):
                  return found_index
          
              else:
                  return -1
      
      elif (not joined_index == -1 and pretext_index == -1) or\
              (not joined_index == -1 and not pretext_index == -1 and joined_index < pretext_index):
          start_index = 0
          for partial_hint in hint.split('##', 1):
              if partial_hint == '':
                  continue
              found_index = find_hint_in_path(partial_hint, path[start_index:])
              if found_index == -1:
                  return found_index
              
              start_index = found_index + len(partial_hint)
          
          return start_index
      
      elif (joined_index == -1 and not pretext_index == -1) or\
              (not joined_index == -1 and not pretext_index == -1 and joined_index > pretext_index):
          pretext_hints = hint.split('&&', 1)
          found_index = 0
          if not pretext_hints[0] == '':
              found_index = find_hint_in_path(pretext_hints[0], path)
              if found_index == -1:
                  return found_index
          
          start_index = found_index + len(pretext_hints[0])
          partial_hints = pretext_hints[1].split('@', 1)
          for partial_hint in partial_hints:
              if partial_hint == '':
                  continue
              for alt_hint in partial_hint.split('^'):
                  if alt_hint == '':
                      continue
                  found_index = find_hint_in_path(alt_hint, path[start_index:])
                  if found_index == 0:
                      if not partial_hints[1] == '':
                          print '..unhandled hint method: \'{0}\''.format(partial_hints[1])
                      else:
                          return found_index
          
          return -1
          
      else:
          return -1
function_tokens: def find_hint_in_path ( hint , path ) : if hint == '' or path == '' : return - 1 joined_index = hint . find ( '##' ) pretext_index = hint . find ( '&&' ) if joined_index == - 1 and pretext_index == - 1 : if '^' in hint or '@' in hint : print '..malformed or improper handling of hint: \'{0}\' path: \'{1}\'' . format ( hint , path ) return - 1 explicit_index = hint . find ( '!!' ) if explicit_index == - 1 : return path . find ( hint ) else : explicit_hint = hint [ : explicit_index ] found_index = path . find ( explicit_hint ) if ( len ( explicit_hint ) + found_index ) == len ( path ) : return found_index else : return - 1 elif ( not joined_index == - 1 and pretext_index == - 1 ) or ( not joined_index == - 1 and not pretext_index == - 1 and joined_index < pretext_index ) : start_index = 0 for partial_hint in hint . split ( '##' , 1 ) : if partial_hint == '' : continue found_index = find_hint_in_path ( partial_hint , path [ start_index : ] ) if found_index == - 1 : return found_index start_index = found_index + len ( partial_hint ) return start_index elif ( joined_index == - 1 and not pretext_index == - 1 ) or ( not joined_index == - 1 and not pretext_index == - 1 and joined_index > pretext_index ) : pretext_hints = hint . split ( '&&' , 1 ) found_index = 0 if not pretext_hints [ 0 ] == '' : found_index = find_hint_in_path ( pretext_hints [ 0 ] , path ) if found_index == - 1 : return found_index start_index = found_index + len ( pretext_hints [ 0 ] ) partial_hints = pretext_hints [ 1 ] . split ( '@' , 1 ) for partial_hint in partial_hints : if partial_hint == '' : continue for alt_hint in partial_hint . split ( '^' ) : if alt_hint == '' : continue found_index = find_hint_in_path ( alt_hint , path [ start_index : ] ) if found_index == 0 : if not partial_hints [ 1 ] == '' : print '..unhandled hint method: \'{0}\'' . format ( partial_hints [ 1 ] ) else : return found_index return - 1 else : return - 1