code: def auto_async_side_effect(is_async):
      def auto_async_side_effect(side_effect):
          if not is_async:
              return side_effect
  
          mock = MagicMock(side_effect=side_effect)
  
          async def func(*args, **kwargs):
              return mock(*args, **kwargs)
  
          return func
  
      return auto_async_side_effect
  
file_path: geopy/test/extra/rate_limiter.py
imports: import asyncio
  from unittest.mock import MagicMock, patch, sentinel
  import pytest
  from geopy.exc import GeocoderQuotaExceeded, GeocoderServiceError
  from geopy.extra.rate_limiter import AsyncRateLimiter, RateLimiter
label_desc: Use image node_id 3 for calling a global function with example usage: auto_async_side_effect(is_async) and returns: auto_async_side_effect, func, side_effect, mock