def _generate_node_label(node, node_attr, show_pk):
    """
    Generate a label for the node.

    .. deprecated:: 1.1.0
        Will be removed in `v2.0.0`.

    :param node: The node to generate the label for
    :type node: :class:`aiida.orm.nodes.node.Node`
    :param node_attr: The attribute to use as the label, can be None
    :type node_attr: str
    :param show_pk: if True, show the PK alongside the label
    :type show_pk: bool
    :return: The generated label
    :rtype: str
    """
    import warnings
    from aiida.common.warnings import AiidaDeprecationWarning
    warnings.warn(
        'function is deprecated and will be removed in `aiida-core==2.0.0`.',
        AiidaDeprecationWarning)
    label = None
    if node_attr is None:
        try:
            label = node.process_label
        except AttributeError:
            label = None
    else:
        try:
            label = str(getattr(node, node_attr))
        except AttributeError:
            try:
                label = node.get_attribute(node_attr)
            except AttributeError:
                pass
    if label is None:
        label = node.__class__.__name__
    if show_pk:
        label += ' [{}]'.format(node.pk)
    return label
