def getconfig(func):
    if func.__name__.startswith('help') or func.__name__ in ('version',):
        return func

    def inner(*args, **kwargs):
        try:
            repo = Repository(kwargs['config'], kwargs['define'])
        except NomadIniNotFound as e:
            sys.stderr.write("Create '%s' to use nomad, example:\n%s\n" %
                             (e, EXAMPLE_INI))
            abort('config file not found')
        except (__HOLE__, NomadError) as e:
            abort(e)

        return func(repo=repo, *args, **kwargs)
    return inner
dataset/ETHPy150Open piranha/nomad/nomad/__init__.py/getconfig