<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tar_task_definition(self, name: str, contents: str) -> bytes: """ Returns a tar with the task definition. :param name: Name of the file :param contents: Contens of the definition, utf-8 """

        tarstream = BytesIO()
        tar = tarfile.TarFile(fileobj=tarstream, mode='w')
        tarinfo = tarfile.TarInfo(name=name)

        script_bytes = contents.encode("utf-8")

        tarinfo.size = len(script_bytes)
        tarinfo.mtime = int(time.time())
        tar.addfile(tarinfo, BytesIO(script_bytes))
        tar.close()

        return tarstream.getvalue()