def METHOD_NAME(obj, modal=True, namespace=None, app=None):
    """Edit the object 'obj' in a GUI-based editor and return the edited copy
    (if Cancel is pressed, return None)
    The object 'obj' is a container
    Supported container types:
    dict, list, set, tuple, str/unicode or numpy.array
    (instantiate a new QApplication if necessary,
    so it can be called directly from the interpreter)
    """
    if modal:
        obj_name = ''
    else:
        assert is_text_string(obj)
        obj_name = obj
        if namespace is None:
            namespace = globals()
        keeper.set_namespace(namespace)
        obj = namespace[obj_name]
        # keep QApplication reference alive in the Python interpreter:
        namespace['__qapp__'] = app
    result = create_dialog(obj, obj_name)
    if result is None:
        return
    dialog, end_func = result
    if modal:
        if dialog.exec_():
            return end_func(dialog)
    else:
        keeper.create_dialog(dialog, obj_name, end_func)
        import os
        if os.name == 'nt' and app:
            app.exec_()