<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def gen_url_name(resource):
    " URL name for resource class generator. "

    if resource._meta.parent:
        yield resource._meta.parent._meta.url_name

    if resource._meta.prefix:
        yield resource._meta.prefix

    for p in resource._meta.url_params:
        yield p

    yield resource._meta.name