<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize_with_sampled_logs(self, logs_limit=-1):
 """serialize a result with up to `logs_limit` logs. If `logs_limit` is -1, this function will return a result with all its logs. """


        return {
            'id': self.id,
            'pathName': self.path_name,
            'name': self.name,
            'isUnregistered': self.is_unregistered,
            'logs': [log.serialize for log in self.sampled_logs(logs_limit)],
            'args': self.args.serialize if self.args is not None else [],
            'commands': [cmd.serialize for cmd in self.commands],
            'snapshots': [cmd.serialize for cmd in self.snapshots],
            'logModifiedAt': self.log_modified_at.isoformat()
        }