import pytz
from datetime import datetime


def timestamp(time_format=None, local=False, time_zone=pytz.utc):
    """Return a formatted timestamp

    Args:
        time_format (str): A format suitable for ``strftime``
        local (bool): If True, return timestamp in local timezone
        time_zone: If local is False, returns timestamp in the given timezone

    Return:
        str: A formatted timestamp string
    """
    time_fmt = time_format or "%Y-%m-%d %H:%M:%S (%Z)"
    if local:
        return datetime.now().strftime(time_fmt)
    else:
        return datetime.now(time_zone).strftime(time_fmt)