code: def FromBinary(cls, record_data, record_count=1):
          
  
          _cmd, _address, _resp_length, payload = cls._parse_rpc_info(record_data)
  
          try:
              os_info, app_info, update_os, update_app = struct.unpack("<LLBB", payload)
              update_os = bool(update_os)
              update_app = bool(update_app)
  
              if update_app and not update_os:
                  tag, version = _parse_info(app_info)
                  return SetDeviceTagRecord(app_tag=tag, app_version=version)
              elif update_os and not update_app:
                  tag, version = _parse_info(os_info)
                  return SetDeviceTagRecord(os_tag=tag, os_version=version)
              elif update_os and update_app:
                  os_tag, os_version = _parse_info(os_info)
                  app_tag, app_version = _parse_info(app_info)
                  return SetDeviceTagRecord(app_tag=app_tag, app_version=app_version,
                                            os_tag=os_tag, os_version=os_version)
              else:
                  raise ArgumentError("Neither update_os nor update_app is set True")
  
          except ValueError:
              raise ArgumentError("Could not parse set device version payload", payload=payload)
docs: Create an UpdateRecord subclass from binary record data.
  
          This should be called with a binary record blob (NOT including the
          record type header) and it will decode it into a SetDeviceTagRecord.
  
          Args:
              record_data (bytearray): The raw record data that we wish to parse
                  into an UpdateRecord subclass NOT including its 8 byte record header.
              record_count (int): The number of records included in record_data.
  
          Raises:
              ArgumentError: If the record_data is malformed and cannot be parsed.
  
          Returns:
              SetDeviceTagRecord: The decoded reflash tile record.