def _is_valid_context(context):
    obj = context.object
    if (obj is None):
        return False
    if (obj.type != 'MESH'):
        return False
    if (context.object.mode != 'EDIT'):
        return False
    for space in context.area.spaces:
        if (space.type == 'VIEW_3D'):
            break
    else:
        return False
    return True
def _is_valid_context(context):
    obj = context.object
    if (obj is None):
        return False
    if (obj.type != 'MESH'):
        return False
    if (context.object.mode != 'EDIT'):
        return False
    for space in context.area.spaces:
        if (space.type == 'VIEW_3D'):
            break
    else:
        return False
    return True