code: def do_create_update_command(
      service: RemoteService, auth: Authentication, args
  ):
      if args.command == "create":
          account = service.create_account(auth)
      elif args.command == "update":
          # TODO: add additional arguments to `get_accounts` to select a single account based on api key
          # https://github.com/stanford-crfm/benchmarking/issues/693
          accounts = [
              account
              for account in service.get_accounts(auth)
              if account.api_key == args.api_key
          ]
          if len(accounts) == 0:
              hlog(f"No account found with API key {args.api_key}")
              sys.exit(1)
          else:
              assert len(accounts) == 1
              account = accounts[0]
      else:
          raise Exception(f"Invalid command: {args.command}")
  
      # Update fields
      if args.description is not None:
          account.description = args.description
      if args.emails is not None:
          account.emails = args.emails
      if args.groups is not None:
          account.groups = args.groups
      if args.is_admin is not None:
          account.is_admin = bool(args.is_admin)
  
      # Update quotas
      for quota_str in args.quotas:
          m = re.match(
              f"(\w+)\.(\w+)=(\d+|{UNLIMITED_QUOTA})", quota_str
          )
          if not m:
              raise Exception(
                  f"Invalid format: {quota_str}, expect <model_group>.<granularity>=<quota> "
                  f"(e.g., gpt3.daily=10000 or gpt3.daily={UNLIMITED_QUOTA})"
              )
          model_group, granularity, quota = (
              m.group(1),
              m.group(2),
              m.group(3),
          )
  
          if model_group not in account.usages:
              usages = account.usages[model_group] = {}
          else:
              usages = account.usages[model_group]
          if granularity not in usages:
              usage = usages[granularity] = Usage()
          else:
              usage = usages[granularity]
          usage.quota = None if quota == UNLIMITED_QUOTA else int(quota)
  
      # Commit changes
      account = service.update_account(auth, account)
  
      # Print out created/updated account information
      header = render_header(show_model_groups=args.show_model_groups)
      item = render_account(account)
      print_item(header, item)
  
file_path: H2O/h2o_hf/helm/src/helm/proxy/cli.py
imports: import argparse
  from typing import List, Dict
  import re
  import sys
  from helm.common.hierarchical_logger import hlog
  from helm.common.authentication import Authentication
  from .accounts import Usage, Account
  from .services.remote_service import RemoteService, add_service_args, create_remote_service, create_authentication
label_desc: Use image node_id 7 for calling a global function with example usage: do_create_update_command(service, auth, args) without return types