def clean_nones(value):
        """
        Recursively remove all None values from dictionaries and lists,
        and returns
        the result as a new dictionary or list.
        """
        if isinstance(value, list):
            return [BuildDictMeta.clean_nones(x) for x in value if
                    x is not None]
        elif isinstance(value, dict):
            return {
                key: BuildDictMeta.clean_nones(val)
                for key, val in value.items()
                if val is not None
            }
        else:
            return value

        Recursively remove all None values from dictionaries and lists,
        and returns
        the result as a new dictionary or list.
        
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/functions/decorators/utils.py