from datetime import datetime


def get_strfdate(year, month=None, day=None):
    """Returns an string format of a date depending on args given.
    """
    if day:
        date = "{}-{}-{}".format(year, month, day)
        date = datetime.strptime(date,"%Y-%m-%d")
        return date.strftime("%d %b, %Y")
    if month:
        date = "{}-{}".format(year, month)
        date = datetime.strptime(date, "%Y-%m")
        return date.strftime("%B, %Y")

    date = "{}".format(year)
    date = datetime.strptime(date, "%Y")
    return date.strftime("%Y")