parameters: (self, device_path, as_root=False, **kwargs)
return_statement: return entries
docstring: List file and stat info for all entries on a device directory.
  
      Implementation notes: this is currently implemented by parsing the output
      of 'ls -a -l' on the device. Whether possible and convenient, we attempt to
      make parsing strict and return values mirroring those of the standard |os|
      and |stat| Python modules.
  
      Mirroring os.listdir (and most client expectations) the resulting list
      does not include the special entries '.' and '..' even if they are present
      in the directory.
  
      Args:
        device_path: A string containing the path of the directory on the device
                     to list.
        as_root: A boolean indicating whether the to use root privileges to list
                 the directory contents.
        timeout: timeout in seconds
        retries: number of retries
  
      Returns:
        A list of dictionaries, each containing the following keys:
          filename: A string with the file name.
          st_mode: File permissions, use the stat module to interpret these.
          st_nlink: Number of hard links (may be missing).
          st_owner: A string with the user name of the owner.
          st_group: A string with the group name of the owner.
          st_rdev_pair: Device type as (major, minior) (only if inode device).
          st_size: Size of file, in bytes (may be missing for non-regular files).
          st_mtime: Time of most recent modification, in seconds since epoch
            (although resolution is in minutes).
          symbolic_link_to: If entry is a symbolic link, path where it points to;
            missing otherwise.
  
      Raises:
        AdbCommandFailedError if |device_path| does not specify a valid and
            accessible directory in the device.
        CommandTimeoutError on timeout.
        DeviceUnreachableError on missing device.
docstring_summary: List file and stat info for all entries on a device directory.
docstring_tokens: List file and stat info for all entries on a device directory .
function: def StatDirectory(self, device_path, as_root=False, **kwargs):
      """List file and stat info for all entries on a device directory.
  
      Implementation notes: this is currently implemented by parsing the output
      of 'ls -a -l' on the device. Whether possible and convenient, we attempt to
      make parsing strict and return values mirroring those of the standard |os|
      and |stat| Python modules.
  
      Mirroring os.listdir (and most client expectations) the resulting list
      does not include the special entries '.' and '..' even if they are present
      in the directory.
  
      Args:
        device_path: A string containing the path of the directory on the device
                     to list.
        as_root: A boolean indicating whether the to use root privileges to list
                 the directory contents.
        timeout: timeout in seconds
        retries: number of retries
  
      Returns:
        A list of dictionaries, each containing the following keys:
          filename: A string with the file name.
          st_mode: File permissions, use the stat module to interpret these.
          st_nlink: Number of hard links (may be missing).
          st_owner: A string with the user name of the owner.
          st_group: A string with the group name of the owner.
          st_rdev_pair: Device type as (major, minior) (only if inode device).
          st_size: Size of file, in bytes (may be missing for non-regular files).
          st_mtime: Time of most recent modification, in seconds since epoch
            (although resolution is in minutes).
          symbolic_link_to: If entry is a symbolic link, path where it points to;
            missing otherwise.
  
      Raises:
        AdbCommandFailedError if |device_path| does not specify a valid and
            accessible directory in the device.
        CommandTimeoutError on timeout.
        DeviceUnreachableError on missing device.
      """
      entries = self._ParseLongLsOutput(device_path, as_root=as_root, **kwargs)
      for d in entries:
        for key, value in d.items():
          if value is None:
            del d[key]  # Remove missing fields.
        d['st_mode'] = _ParseModeString(d['st_mode'])
        d['st_mtime'] = calendar.timegm(
            time.strptime(d['st_mtime'], _LS_DATE_FORMAT))
        for key in ['st_nlink', 'st_size', 'st_rdev_major', 'st_rdev_minor']:
          if key in d:
            d[key] = int(d[key])
        if 'st_rdev_major' in d and 'st_rdev_minor' in d:
          d['st_rdev_pair'] = (d.pop('st_rdev_major'), d.pop('st_rdev_minor'))
      return entries
function_tokens: def StatDirectory ( self , device_path , as_root = False , * * kwargs ) : entries = self . _ParseLongLsOutput ( device_path , as_root = as_root , * * kwargs ) for d in entries : for key , value in d . items ( ) : if value is None : del d [ key ] # Remove missing fields. d [ 'st_mode' ] = _ParseModeString ( d [ 'st_mode' ] ) d [ 'st_mtime' ] = calendar . timegm ( time . strptime ( d [ 'st_mtime' ] , _LS_DATE_FORMAT ) ) for key in [ 'st_nlink' , 'st_size' , 'st_rdev_major' , 'st_rdev_minor' ] : if key in d : d [ key ] = int ( d [ key ] ) if 'st_rdev_major' in d and 'st_rdev_minor' in d : d [ 'st_rdev_pair' ] = ( d . pop ( 'st_rdev_major' ) , d . pop ( 'st_rdev_minor' ) ) return entries