code: def __init__(self, environment, flow, event_logger, monitor):
      super(ServiceMetadataProvider, self).__init__(
          environment, flow, event_logger, monitor
      )
      self.url_task_template = os.path.join(
          SERVICE_URL,
          "flows/{flow_id}/runs/{run_number}/steps/{step_name}/tasks/{task_id}/heartbeat",
      )
      self.url_run_template = os.path.join(
          SERVICE_URL, "flows/{flow_id}/runs/{run_number}/heartbeat"
      )
      self.sidecar = None
  
imports: import os
  import random
  import requests
  import time
  from metaflow.exception import MetaflowException, MetaflowTaggingError, MetaflowInternalError
  from metaflow.metaflow_config import SERVICE_RETRY_COUNT, SERVICE_HEADERS, SERVICE_URL
  from metaflow.metadata import MetadataProvider
  from metaflow.metadata.heartbeat import HB_URL_KEY
  from metaflow.sidecar import Message, MessageTypes, Sidecar
  from metaflow.util import version_parse
label_desc: Use image node_id 1 to create a new ServiceMetadataProvider object from inherited base classes: MetadataProvider with example: obj = ServiceMetadataProvider(environment, flow, event_logger, monitor)