<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def tag(self, name: str, repo: str, *, tag: str = None) -> bool: """ Tag the given image so that it becomes part of a repository. Args: repo: the repository to tag in tag: the name for the new tag """

        params = {"repo": repo}

        if tag:
            params["tag"] = tag

        await self.docker._query(
            "images/{name}/tag".format(name=name),
            "POST",
            params=params,
            headers={"content-type": "application/json"},
        )
        return True