def dict_to_sorted_tuples(
        data_dict: dict[str, int],
        sort_by_values: bool = False
    ) -> list[tuple]:
    """
    Sort a dictionary and return its items as a list of tuples.

    The sorting is based on keys by default.
    If 'sort_by_values' is True, it sorts by values.
    If 'sort_by_values' is True and two values are equal, it sorts by key.

    Parameters
    ----------
    data_dict : dict[str, int]
        The dictionary to sort.
    sort_by_values : bool, optional
        Determines if sorting is done by values. Defaults to False.

    Returns
    -------
    list[tuple]
        A list of tuples: Sorted items of the dictionary.

    Examples
    --------
    >>> dict_to_sorted_tuples({'x': 2, 'b': 2, 'a': 1, 'c': 3})
    [('a', 1), ('b', 2), ('c', 3), ('x', 2)]
    >>> dict_to_sorted_tuples({'x': 2, 'b': 2, 'a': 1, 'c': 3}, True)
    [('a', 1), ('b', 2), ('x', 2), ('c', 3)]
    """
    raise NotImplementedError("Complete this function.")
