code: def patch_connection_file_paths(connection: str) -> str:
      
      new_conn_lines = []
      for line in connection.split('\n'):
          if '=' in line:
              parts = line.split('=')
              path_matches = re.search(
                  '/mnt/data/resin-data/[0-9]+/(.*)', parts[1])
              if path_matches:
                  new_path = f'/data/{path_matches.group(1)}'
                  new_conn_lines.append(
                      '='.join([parts[0], new_path]))
                  LOG.info(
                      f"migrate_connection_file: {parts[0]}: "
                      f"{parts[1]}->{new_path}")
                  continue
          new_conn_lines.append(line)
      return '\n'.join(new_conn_lines)
docs: Patch any paths in a connection to remove the balena host paths
  
      Undoes the changes applied by
      :py:meth:`opentrons.system.nmcli._rewrite_key_path_to_host_path`
  
      :param connection: The contents of a NetworkManager connection file
      :return: The patches contents, suitable for writing somewher