def METHOD_NAME(cdd_type, ieqs, eqns, file_output=None):
    r"""
    Return a string containing the H-representation in cddlib's ine format.
    INPUT:
    - ``file_output`` (string; optional) -- a filename to which the
      representation should be written. If set to ``None`` (default),
      representation is returned as a string.
    EXAMPLES::
        sage: from sage.geometry.polyhedron.cdd_file_format import cdd_Hrepresentation
        sage: cdd_Hrepresentation('rational', None, [[0,1]])
        'H-representation\nlinearity 1 1\nbegin\n 1 2 rational\n 0 1\nend\n'
    TESTS::
        sage: from sage.misc.temporary_file import tmp_filename
        sage: filename = tmp_filename(ext='.ine')
        sage: cdd_Hrepresentation('rational', None, [[0,1]], file_output=filename)
    """
    ieqs = _set_to_None_if_empty(ieqs)
    eqns = _set_to_None_if_empty(eqns)
    num, ambient_dim = _common_length_of(ieqs, eqns)
    ambient_dim -= 1
    if cdd_type == 'real':
        from sage.rings.real_double import RDF
        base_ring = RDF
    else:
        base_ring = None
    s = 'H-representation\n'
    if eqns is not None:
        assert len(eqns)>0
        n = len(eqns)
        s += "linearity " + repr(n) + ' '
        s += _to_space_separated_string(range(1,n+1)) + '\n'
    s += 'begin\n'
    s += ' ' + repr(num) + ' ' + repr(ambient_dim+1) + ' ' + cdd_type + '\n'
    if eqns is not None:
        for e in eqns:
            s += ' ' + _to_space_separated_string(e, base_ring) + '\n'
    if ieqs is not None:
        for i in ieqs:
            s += ' ' + _to_space_separated_string(i, base_ring) + '\n'
    s += 'end\n'
    if file_output is not None:
        in_file = open(file_output, 'w')
        in_file.write(s)
        in_file.close()
    else:
        return s