<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def declaration_path(name):
 """Return the path to an included declaration"""

    from os.path import dirname, join, exists
    import metatab.declarations
    from metatab.exc import IncludeError

    d = dirname(metatab.declarations.__file__)

    path = join(d, name)

    if not exists(path):
        path = join(d, name + '.csv')

    if not exists(path):
        raise IncludeError("No local declaration file for name '{}' ".format(name))

    return path