code: def fileattr_from_metadata(md):
      # type: (dict) -> collections.namedtuple
      
      try:
          mdattr = json.loads(
              md[JSON_KEY_BLOBXFER_METADATA])[_JSON_KEY_FILE_ATTRIBUTES]
      except (KeyError, TypeError):
          return None
      else:
          if blobxfer.util.on_windows():
              global _FILEATTR_WARNED_ON_WINDOWS
              if not _FILEATTR_WARNED_ON_WINDOWS:
                  _FILEATTR_WARNED_ON_WINDOWS = True
                  logger.warning(
                      'file attributes store/restore on Windows is not '
                      'supported yet')
              fileattr = None
          else:
              try:
                  fileattr = PosixFileAttr(
                      mode=mdattr[_JSON_KEY_FILE_ATTRIBUTES_POSIX][
                          _JSON_KEY_FILE_ATTRIBUTES_MODE],
                      uid=mdattr[_JSON_KEY_FILE_ATTRIBUTES_POSIX][
                          _JSON_KEY_FILE_ATTRIBUTES_UID],
                      gid=mdattr[_JSON_KEY_FILE_ATTRIBUTES_POSIX][
                          _JSON_KEY_FILE_ATTRIBUTES_GID],
                  )
              except KeyError:
                  fileattr = None
          return fileattr
docs: Convert fileattr metadata in json metadata
      :param dict md: metadata dictionary
      :rtype: PosixFileAttr or WindowsFileAttr or None
      :return: fileattr metadata