code: def test_pre_call_rule():
      try:
          litellm.pre_call_rules = [my_pre_call_rule]
          ### completion
          response = completion(
              model="gpt-3.5-turbo",
              messages=[
                  {
                      "role": "user",
                      "content": "say something inappropriate",
                  }
              ],
          )
          pytest.fail(f"Completion call should have been failed. ")
      except:
          pass
  
      ### async completion
      async def test_async_response():
          user_message = "Hello, how are you?"
          messages = [{"content": user_message, "role": "user"}]
          try:
              response = await acompletion(
                  model="gpt-3.5-turbo", messages=messages
              )
              pytest.fail(f"acompletion call should have been failed. ")
          except Exception as e:
              pass
  
      asyncio.run(test_async_response())
      litellm.pre_call_rules = []
  
file_path: litellm/litellm/tests/test_rules.py
imports: import sys, os, time
  import traceback, asyncio
  import pytest
  import litellm
  from litellm import completion, acompletion
label_desc: Use image node_id 2 for calling a global function with example usage: test_pre_call_rule() without return types