code: def lambdafan(func):
      
      if 'AWS_LAMBDA_FUNCTION_NAME' not in os.environ:
          return func
  
      @functools.wraps(func)
      def scaleout(*args, **kw):
          client = boto3.client('lambda')
          client.invoke(
              FunctionName=os.environ['AWS_LAMBDA_FUNCTION_NAME'],
              InvocationType='Event',
              Payload=dumps({
                  'event': 'fanout',
                  'function': func.__name__,
                  'args': args,
                  'kwargs': kw}),
              Qualifier=os.environ['AWS_LAMBDA_FUNCTION_VERSION'])
      return scaleout
docs: simple decorator that will auto fan out async style in lambda.
  
      outside of lambda, this will invoke synchrously.