code: def server(
      ctx, run_id, port, user_namespace, poll_interval, max_cards
  ):
      from .card_server import create_card_server, CardServerOptions
  
      user_namespace = (
          resolve_identity()
          if user_namespace is None
          else user_namespace
      )
      run, follow_new_runs, _status_message = _get_run_object(
          ctx.obj, run_id, user_namespace
      )
      if _status_message is not None:
          ctx.obj.echo(_status_message, fg="red")
      options = CardServerOptions(
          flow_name=ctx.obj.flow.name,
          run_object=run,
          only_running=False,
          follow_resumed=False,
          flow_datastore=ctx.obj.flow_datastore,
          max_cards=max_cards,
          follow_new_runs=follow_new_runs,
          poll_interval=poll_interval,
      )
      create_card_server(options, port, ctx.obj)
  
imports: from metaflow.client import Task
  from metaflow import JSONType, namespace
  from metaflow.util import resolve_identity
  from metaflow.exception import CommandException, MetaflowNotFound, MetaflowNamespaceMismatch
  import webbrowser
  import re
  from metaflow._vendor import click
  import os
  import json
  import uuid
  import signal
  import random
  from contextlib import contextmanager
  from functools import wraps
  from metaflow.exception import MetaflowNamespaceMismatch
  from .card_datastore import CardDatastore, NUM_SHORT_HASH_CHARS
  from .exception import CardClassFoundException, IncorrectCardArgsException, UnrenderableCardException, CardNotPresentException, TaskNotFoundException
  import traceback
  from collections import namedtuple
  from .card_resolver import resolve_paths_from_task, resumed_info
label_desc: Use image node_id 17 for calling a global function with example usage: server(ctx, run_id, port, user_namespace, poll_interval, max_cards) without return types