code: def _encode_size(size: Union[str, Dict[str, List[int]]]) -> str:
      if not isinstance(size, dict):
          return size
      else:
          return ",".join(f"{k}={v}" for k, v in size.items())
  
file_path: mars/mars/services/session/api/web.py
imports: import json
  from typing import Callable, Dict, List, Union
  from ....utils import parse_readable_size
  from ...web import web_api, MarsServiceWebAPIHandler, MarsWebAPIClientMixin
  from ..core import SessionInfo
  from .core import AbstractSessionAPI
label_desc: Use image node_id 1 for calling a global function with example usage: _encode_size(size) and returns: size, str