<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def branches(remotes=False):
 """Return a list of all local branches in the repo If remotes is true then also include remote branches Note: the normal '*' indicator for current branch is removed this method just gives a list of branch names Use branch() method to determine the current branch """

    stdout = branch('--list %s' % (remotes and '-a' or ''), quiet=True)
    return [_.lstrip('*').strip() for _ in stdout.splitlines()]