Might be a little more clear to move this `return` into the `if single:` section that's right below. Something like:

    if single:
        if not res:
            return None
        return res[0][1]