def METHOD_NAME(value: typing.Union[Function, Constant, np.ndarray],
                dofs: numpy.typing.NDArray[np.int32],
                V: typing.Optional[dolfinx.fem.FunctionSpace] = None) -> DirichletBC:
    """Create a representation of Dirichlet boundary condition which
    is imposed on a linear system.
    Args:
        value: Lifted boundary values function. It must have a ``dtype``
        property.
        dofs: Local indices of degrees of freedom in function space to
            which boundary condition applies. Expects array of size
            (number of dofs, 2) if function space of the problem, ``V``,
            is passed. Otherwise assumes function space of the problem
            is the same of function space of boundary values function.
        V: Function space of a problem to which boundary conditions are applied.
    Returns:
        A representation of the boundary condition for modifying linear
        systems.
    """
    if isinstance(value, numbers.Number):
        value = np.asarray(value)
    try:
        dtype = value.dtype
        if dtype == np.float32:
            bctype = _cpp.fem.DirichletBC_float32
        elif dtype == np.float64:
            bctype = _cpp.fem.DirichletBC_float64
        elif dtype == np.complex64:
            bctype = _cpp.fem.DirichletBC_complex64
        elif dtype == np.complex128:
            bctype = _cpp.fem.DirichletBC_complex128
        else:
            raise NotImplementedError(f"Type {value.dtype} not supported.")
    except AttributeError:
        raise AttributeError("Boundary condition value must have a dtype attribute.")
    # Unwrap value object, if required
    if isinstance(value, np.ndarray):
        _value = value
    else:
        try:
            _value = value._cpp_object  # type: ignore
        except AttributeError:
            _value = value
    if V is not None:
        try:
            bc = bctype(_value, dofs, V)
        except TypeError:
            bc = bctype(_value, dofs, V._cpp_object)
    else:
        bc = bctype(_value, dofs)
    return DirichletBC(bc)