Formats a user and group in the format ``user:group``, as needed for `chown`. If user_group is a tuple, this is used
    for the fomatting. If a string or integer is given, it will be formatted as ``user:user``. Otherwise the input is
    returned - this method does not perform any more checks.

    :param user_group: User name, user id, user and group in format ``user:group``, ``user_id:group_id``, or tuple of
      ``(user, group)``.
    :type user_group: unicode | str | int | tuple
    :return: Formatted string with in the format ``user:group``.
    :rtype: unicode | str

def get_user_group(user_group):
    """
    Formats a user and group in the format ``user:group``, as needed for `chown`. If user_group is a tuple, this is used
    for the fomatting. If a string or integer is given, it will be formatted as ``user:user``. Otherwise the input is
    returned - this method does not perform any more checks.

    :param user_group: User name, user id, user and group in format ``user:group``, ``user_id:group_id``, or tuple of
      ``(user, group)``.
    :type user_group: unicode | str | int | tuple
    :return: Formatted string with in the format ``user:group``.
    :rtype: unicode | str
    """
    if isinstance(user_group, tuple):
        return '{0}:{1}'.format(*user_group)
    elif isinstance(user_group, six.integer_types) or ':' not in user_group:
        return '{0}:{0}'.format(user_group)
    return user_group