code: def number_of_workers(self) -> int:
      cpu_count = multiprocessing.cpu_count()
  
      if self.model_server_workers:
          logging.info(
              f"Using {self.model_server_workers} workers "
              "(set by MODEL_SERVER_WORKERS environment variable)."
          )
          return self.model_server_workers
  
      elif (
          self.sagemaker_batch
          and self.sagemaker_max_concurrent_transforms < cpu_count
      ):
          logger.info(
              f"Using {self.sagemaker_max_concurrent_transforms} workers "
              "(set by MaxConcurrentTransforms parameter in batch mode)."
          )
          return self.sagemaker_max_concurrent_transforms
  
      else:
          logger.info(f"Using {cpu_count} workers")
          return cpu_count
  
file_path: gluonts/src/gluonts/shell/serve/__init__.py
imports: import logging
  import multiprocessing
  from ipaddress import IPv4Address
  from typing import List, Optional, Type, Union
  from flask import Flask
  import gluonts
  from gluonts.core import fqname_for
  from gluonts.model.estimator import Estimator
  from gluonts.model.predictor import Predictor
  from gluonts.shell.env import ServeEnv
  from gluonts.pydantic import BaseSettings
  from .app import make_app
label_desc: Use image node_id 2 for calling the Settings obj's underlying member method code with example usage: obj.number_of_workers() and returns: self, self, cpu_count