code: def _parse_mode(mode):
      '''
      Converts ls mode output (rwxrwxrwx) -> integer (755).
      '''
  
      result = ''
      # owner, group, world
      for group in [mode[0:3], mode[3:6], mode[6:9]]:
          if group in SYMBOL_TO_OCTAL_PERMISSIONS:
              result = '{0}{1}'.format(result, SYMBOL_TO_OCTAL_PERMISSIONS[group])
          else:
              result = '{0}0'.format(result)
  
      # Return as an integer
      return int(resultf _parse_mode(mode):
      '''
      Converts ls mode output (rwxrwxrwx) -> integer (755).
      '''
  
      result = ''
      # owner, group, world
      for group in [mode[0:3], mode[3:6], mode[6:9]]:
          if group in SYMBOL_TO_OCTAL_PERMISSIONS:
              result = '{0}{1}'.format(result, SYMBOL_TO_OCTAL_PERMISSIONS[group])
          else:
              result = '{0}0'.format(result)
  
      # Return as an integer
      return int(result)
docs: Converts ls mode output (rwxrwxrwx) -> integer (755).