def decode_copy_value(value):
<EOL>if value == POSTGRES_COPY_NULL_VALUE:<EOL><INDENT>return None<EOL><DEDENT>if '<STR_LIT:\\>' not in value:<EOL><INDENT>return value<EOL><DEDENT>return DECODE_REGEX.sub(unescape_single_character, value)<EOL>
Decodes value received as part of Postgres `COPY` command.

:param value: Value to decode.
:type value: str

:return: Either None if the value is NULL string, or the given value where
         escape sequences have been decoded from.
:rtype: str|None