code: def _decode_v1(value):
      
      decode_colons = value.replace('$::', '::')
      decode_dollars = decode_colons.replace('$$', '$')
  
      reencoded = _encode_v1(decode_dollars)
      if reencoded != value:
          raise ValueError('Ambiguous encoded value, {!r} could have been encoded as {!r}'.format(value, reencoded))
  
      return decode_dollars
docs: Decode '::' and '$' characters encoded by `_encode`.