code: def create_swag_from_ctx(ctx):
      
      swag_opts = {}
      if ctx.type == 'file':
          swag_opts = {
              'swag.type': 'file',
              'swag.data_dir': ctx.data_dir,
              'swag.data_file': ctx.data_file
          }
      elif ctx.type == 's3':
          swag_opts = {
              'swag.type': 's3',
              'swag.bucket_name': ctx.bucket_name,
              'swag.data_file': ctx.data_file,
              'swag.region': ctx.region
          }
      elif ctx.type == 'dynamodb':
          swag_opts = {
              'swag.type': 'dynamodb',
              'swag.region': ctx.region
          }
      return SWAGManager(**parse_swag_config_options(swag_opts))
docs: Creates SWAG client from the current context.