<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _dehex(s):
 """Liberally convert from hex string to binary string."""

    import re
    import binascii

    # Remove all non-hexadecimal digits
    s = re.sub(br'[^a-fA-F\d]', b'', s)
    # binscii.unhexlify works in Python 2 and Python 3 (unlike
    # thing.decode('hex')).
    return binascii.unhexlify(s)