code: def test_update_function_signature_and_register_functions() -> None:
      with pytest.MonkeyPatch.context() as mp:
          mp.setenv("OPENAI_API_KEY", "mock")
          agent = ConversableAgent(name="agent", llm_config={})
  
          def exec_python(cell: str) -> None:
              pass
  
          def exec_sh(script: str) -> None:
              pass
  
          agent.update_function_signature(
              {
                  "name": "python",
                  "description": "run cell in ipython and return the execution result.",
                  "parameters": {
                      "type": "object",
                      "properties": {
                          "cell": {
                              "type": "string",
                              "description": "Valid Python cell to execute.",
                          }
                      },
                      "required": ["cell"],
                  },
              },
              is_remove=False,
          )
  
          functions = agent.llm_config["functions"]
          assert {f["name"] for f in functions} == {"python"}
  
          agent.update_function_signature(
              {
                  "name": "sh",
                  "description": "run a shell script and return the execution result.",
                  "parameters": {
                      "type": "object",
                      "properties": {
                          "script": {
                              "type": "string",
                              "description": "Valid shell script to execute.",
                          }
                      },
                      "required": ["script"],
                  },
              },
              is_remove=False,
          )
  
          functions = agent.llm_config["functions"]
          assert {f["name"] for f in functions} == {"python", "sh"}
  
          # register the functions
          agent.register_function(
              function_map={
                  "python": exec_python,
                  "sh": exec_sh,
              }
          )
          assert set(agent.function_map.keys()) == {"python", "sh"}
          assert agent.function_map["python"] == exec_python
          assert agent.function_map["sh"] == exec_sh
  
imports: import asyncio
  import copy
  import sys
  import time
  from typing import Any, Callable, Dict, Literal
  import unittest
  import inspect
  import pytest
  from unittest.mock import patch
  from pydantic import BaseModel, Field
  from typing_extensions import Annotated
  import autogen
  from autogen.agentchat import ConversableAgent, UserProxyAgent
  from test_assistant_agent import KEY_LOC, OAI_CONFIG_LIST
  from conftest import skip_openai
label_desc: Use image node_id 10 for calling a global function with example usage: test_update_function_signature_and_register_functions() without return types