Returns public information of the object

def safe_info(self, dic=None):
        """
        Returns public information of the object
        """
        if dic is None and dic != {}:
            dic = self.to_dict()
        output = {}
        for (key, value) in dic.items():
            if key[0] != '_':
                if isinstance(value, SerializableObject):
                    output[key] = value.safe_info()
                elif isinstance(value, dict):
                    output[key] = self.safe_info(dic=value)
                elif isinstance(value, list):
                    output[key] = []
                    for f in value:
                        if isinstance(f, SerializableObject):
                            output[key].append(f.safe_info())
                        elif isinstance(f, dict):
                            output[key].append(self.safe_info(dic=f))
                        else:
                            output[key].append(f)
                else:
                    output[key] = value
        return output