code: def _check_for_existing_remote(self, sa, cont, name):
          # type: (Uploader, blobxfer.operations.azure.StorageAccount,
          #        str, str) -> bobxfer.models.azure.StorageEntity
          
          if self._spec.options.mode == blobxfer.models.azure.StorageModes.File:
              fp = blobxfer.operations.azure.file.get_file_properties(
                  sa.file_client, cont, name)
          else:
              fp = blobxfer.operations.azure.blob.get_blob_properties(
                  sa.block_blob_client, cont, name, self._spec.options.mode)
          if fp is not None:
              if blobxfer.models.crypto.EncryptionMetadata.\
                      encryption_metadata_exists(fp.metadata):
                  ed = blobxfer.models.crypto.EncryptionMetadata()
                  ed.convert_from_json(fp.metadata, fp.name, None)
              else:
                  ed = None
              ase = blobxfer.models.azure.StorageEntity(cont, ed)
              if (self._spec.options.mode ==
                      blobxfer.models.azure.StorageModes.File):
                  dir, _, _ = blobxfer.operations.azure.file.parse_file_path(
                      name)
                  ase.populate_from_file(sa, fp, dir)
              else:
                  ase.populate_from_blob(sa, fp)
                  # always overwrite cache control with option
                  ase.cache_control = (
                      self._spec.options.store_file_properties.cache_control
                  )
                  # overwrite tier with specified storage tier
                  if ase.mode == blobxfer.models.azure.StorageModes.Block:
                      ase.access_tier = self._spec.options.access_tier
          else:
              ase = None
          return ase
docs: Check for an existing remote file
          :param Uploader self: this
          :param blobxfer.operations.azure.StorageAccount sa: storage account
          :param str cont: container
          :param str name: entity name
          :rtype: blobxfer.models.azure.StorageEntity
          :return: remote storage entity