def init(path=None, repo=None, **kwargs):
    if repo and path:
        raise TypeError("Cannot define repo and path")
    if path:
        if os.path.isdir(path):
            repo = pygit2.Repository(path)
        else:
            bare = kwargs.pop('bare', True) # bare repo by default
            repo = pygit2.init_repository(path, bare)
    if not repo:
        raise TypeError("Missing repo or path")
    dumps = kwargs.pop('dumps', utils.import_json().dumps)
    loads = kwargs.pop('loads', utils.import_json().loads)
    return Repository(repo, dumps, loads)
Handle 'remove item' being selected from the header context menu.
dataset/ETHPy150Open talos/jsongit/jsongit/api.py/init--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/table_editor.py/TableEditor._on_context_remove