<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encodeQueryElement(element):
 """Encode a URL query element according to RFC3986."""

    return urllib.parse.quote(
        (
            element.encode('utf-8')
            if isinstance(element, str)
            else str(element)
            if isinstance(element, int)
            else element
        ),
        safe=d1_common.const.URL_QUERYELEMENT_SAFE_CHARS,
    )