def mesh_split_face(mesh, fkey, u, v):
    """Split a face by inserting an edge between two specified vertices.

    Parameters
    ----------
    mesh : :class:`~compas.datastructures.Mesh`
        Instance of a mesh
    fkey : :obj:`str`
        The face key.
    u : hashable
        The key of the first split vertex.
    v : hashable
        The key of the second split vertex.

    Returns
    -------
    :obj:`tuple` of :obj:`int`
        Keys of the created faces.

    Raises
    ------
    :exc:`ValueError`
        If the split vertices does not belong to the split face or if the split
        vertices are neighbors.

    Examples
    --------
    >>> import compas
    >>> from compas.datastructures import Mesh
    >>> mesh = Mesh.from_obj(compas.get("faces.obj"))
    >>> fkey = mesh.get_any_face()
    >>> # u and v defines the new edge after splitting
    >>> u = mesh.get_any_face_vertex(fkey)
    >>> v = mesh.face_vertex_descendant(fkey, u, n=2)
    >>> mesh.number_of_faces()  # faces before split
    25
    >>> mesh_split_face(mesh, fkey, u, v)
    (25, 26)
    >>> mesh.number_of_faces()  # faces after split
    26
    """
    if u not in mesh.face[fkey] or v not in mesh.face[fkey]:
        raise ValueError('The split vertices do not belong to the split face.')

    face = mesh.face[fkey]

    i = face.index(u)
    j = face.index(v)

    if i + 1 == j:
        raise ValueError('The split vertices are neighbors.')

    if j > i:
        f = face[i:j + 1]
        g = face[j:] + face[:i + 1]
    else:
        f = face[i:] + face[:j + 1]
        g = face[j:i + 1]

    f = mesh.add_face(f)
    g = mesh.add_face(g)

    del mesh.face[fkey]

    return f, g