code: def get_previous_month(dt):
      if dt.month == 1:
          return datetime.datetime(dt.year - 1, 12, 1)
      return datetime.datetime(dt.year, dt.month - 1, 1)
  
imports: import asyncio
  import calendar
  import datetime
  import json
  import logging
  import os
  from collections import defaultdict, namedtuple
  from contextlib import AsyncExitStack
  from typing import Any, Dict, List
  import aiohttp_session
  import prometheus_client
  from aiohttp import web
  from prometheus_async.aio.web import server_stats
  from gear import AuthServiceAuthenticator, Database, json_response, setup_aiohttp_session, transaction
  from hailtop import aiotools, httpx
  from hailtop.aiocloud import aiogoogle
  from hailtop.config import get_deploy_config
  from hailtop.hail_logging import AccessLogger
  from hailtop.tls import internal_server_ssl_context
  from hailtop.utils import cost_str, parse_timestamp_msecs, periodically_call, retry_long_running, run_if_changed_idempotent, time_msecs, url_basename
  from web_common import render_template, set_message, setup_aiohttp_jinja2, setup_common_static_routes
  from .configuration import HAIL_USE_FULL_QUERY
label_desc: Use image node_id 1 for calling a global function with example usage: get_previous_month(dt) and returns: datetime, datetime