def dict_keys(data, return_string=False):
    """Get sorted keys from dictionary given.

    If ``return_string`` argument is set to True, returns keys joined by
    commas.

    :param dict data:
    :param bool return_string:
    """
    keys = list(data.keys())
    keys.sort()
    if return_string:
        return ','.join(keys)
    return keys
