
    ܖi	                         d dl mZ ddZd Zy)    )
PackageURLc                     | j                  d      sd| z   } 	 t        j                  |       }|j	                  |d      }|r|S t        |      S # t        $ r Y yw xY w)a  
    Return a lookups dictionary built from the provided `purl` (Package URL) string.
    These lookups can be used as QuerySet filters.
    If include_empty_fields is provided, the resulting dictionary will include fields
    with empty values. This is useful to get exact match.
    Note that empty values are always returned as empty strings as the model fields
    are defined with `blank=True` and `null=False`.
    zpkg:N )encodeempty)
startswithr   from_string
ValueErrorto_dictwithout_empty_values)purl_strr   include_empty_fieldspackage_urlpackage_url_dicts        c/var/www/html/content-pipeline/venv/lib/python3.12/site-packages/packageurl/contrib/django/utils.pypurl_to_lookupsr      sr     v&H$ ,,X6 #**&*C#$455  s   A 	AAc                 n    g di ddf}| j                         D ci c]  \  }}||vs|| c}}S c c}}w )z
    Return a new dict not including empty value entries from `input_dict`.

    `None`, empty string, empty list, and empty dict/set are cleaned.
    `0` and `False` values are kept.
     r   N)items)
input_dictempty_valueskeyvalues       r   r   r   7   s@     BD)L)3)9)9);Y:3uL?XCJYYYs   11N)TF)
packageurlr   r   r   r       r   <module>r      s   8 "60	Zr   