def fake_edtf_level_0():
    'Generates a fake publication_date string.'

    def fake_date(end_date=None):
        fake = Faker()
        date_pattern = ['%Y', '%m', '%d']
        if random.choice([True, False]):
            date_pattern.pop()
            if random.choice([True, False]):
                date_pattern.pop()
        return fake.date('-'.join(date_pattern), end_datetime=end_date)
    f_date = fake_date()
    if random.choice([True, False]):
        parser = level0Expression('level0')
        parsed_date = parser.parseString(f_date)[0]
        date_tuple = parsed_date.lower_strict()[:3]
        f_date_object = datetime.date(*date_tuple)
        interval_start = fake_date(end_date=f_date_object)
        return '/'.join([interval_start, f_date])
    return f_date
Generates a fake publication_date string.
def fake_edtf_level_0():
    

    def fake_date(end_date=None):
        fake = Faker()
        date_pattern = ['%Y', '%m', '%d']
        if random.choice([True, False]):
            date_pattern.pop()
            if random.choice([True, False]):
                date_pattern.pop()
        return fake.date('-'.join(date_pattern), end_datetime=end_date)
    f_date = fake_date()
    if random.choice([True, False]):
        parser = level0Expression('level0')
        parsed_date = parser.parseString(f_date)[0]
        date_tuple = parsed_date.lower_strict()[:3]
        f_date_object = datetime.date(*date_tuple)
        interval_start = fake_date(end_date=f_date_object)
        return '/'.join([interval_start, f_date])
    return f_date