def SetApiQueryScheduleStatus(api_query, status=None):
  if api_query:
    if status is None:
      api_query.is_scheduled = not api_query.is_scheduled
    elif status:
      api_query.is_scheduled = True
    else:
      api_query.is_scheduled = False

    api_query.put()
    return True
  return False
Flatten a given nested iterable.
dataset/ETHPy150Open googleanalytics/google-analytics-super-proxy/src/controllers/util/schedule_helper.py/SetApiQueryScheduleStatus--crossover with--dataset/ETHPy150Open OP2/PyOP2/pyop2/utils.py/flatten