code: def owned_by(self, owner, also_check_group=False):
          
          if also_check_group:
              return self.owner == owner and self.group == owner
          else:
              return self.owner == owner
docs: Checks if the specified user or user and group own the file.
  
          Args:
              owner (str): the user (or group) name for which we ask about ownership
              also_check_group (bool): if set to True, both user owner and group owner checked
                                  if set to False, only user owner checked
  
          Returns:
              bool: True if owner of the file is the specified owner