def format_ret(return_set, as_json=False):
    """ decouple, allow for modifications to return type
        returns a list of ip addresses in object or json form """
    ret_list = list()
    for item in return_set:
        d = {"ip": item}
        ret_list.append(d)

    if as_json:
        return json.dumps(ret_list)

    return ret_list