code: def flush_pending(function):
      
      s = boto3.Session()
      client = s.client('lambda')
      results = client.invoke(
          FunctionName=function,
          Payload=json.dumps({'detail-type': 'Scheduled Event'})
      )
      content = results.pop('Payload').read()
      pprint.pprint(results)
      pprint.pprint(json.loads(content))
docs: Attempt to acquire any pending locks.