nodes: 0, module; 1, function_definition; 2, function_name:execute_sql; 3, parameters; 4, block; 5, identifier:server_context; 6, identifier:schema_name; 7, identifier:sql; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, expression_statement; 18, expression_statement; 19, expression_statement; 20, if_statement; 21, if_statement; 22, if_statement; 23, if_statement; 24, if_statement; 25, if_statement; 26, if_statement; 27, return_statement; 28, identifier:container_path; 29, None; 30, identifier:max_rows; 31, None; 32, identifier:sort; 33, None; 34, identifier:offset; 35, None; 36, identifier:container_filter; 37, None; 38, identifier:save_in_session; 39, None; 40, identifier:parameters; 41, None; 42, identifier:required_version; 43, None; 44, identifier:timeout; 45, identifier:_default_timeout; 46, comment:"""
      Execute sql query against a LabKey server.
  
      :param server_context: A LabKey server context. See utils.create_server_context.
      :param schema_name: schema of table
      :param sql: String of labkey sql to execute
      :param container_path: labkey container path if not already set in context
      :param max_rows: max number of rows to return
      :param sort: comma separated list of column names to sort by
      :param offset: number of rows to offset results by
      :param container_filter: enumeration of the various container filters available. See:
          https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Query.html#.containerFilter
      :param save_in_session: save query result as a named view to the session
      :param parameters: parameter values to pass through to a parameterized query
      :param required_version: Api version of response
      :param timeout: timeout of request in seconds (defaults to 30s)
      :return:
      """; 47, assignment; 48, assignment; 49, comparison_operator:container_filter is not None; 50, block; 51, comparison_operator:max_rows is not None; 52, block; 53, comparison_operator:offset is not None; 54, block; 55, comparison_operator:sort is not None; 56, block; 57, comparison_operator:save_in_session is not None; 58, block; 59, comparison_operator:parameters is not None; 60, block; 61, comparison_operator:required_version is not None; 62, block; 63, call; 64, identifier:url; 65, call; 66, identifier:payload; 67, dictionary; 68, identifier:container_filter; 69, None; 70, expression_statement; 71, identifier:max_rows; 72, None; 73, expression_statement; 74, identifier:offset; 75, None; 76, expression_statement; 77, identifier:sort; 78, None; 79, expression_statement; 80, identifier:save_in_session; 81, None; 82, expression_statement; 83, identifier:parameters; 84, None; 85, for_statement; 86, identifier:required_version; 87, None; 88, expression_statement; 89, attribute; 90, argument_list; 91, attribute; 92, argument_list; 93, pair; 94, pair; 95, assignment; 96, assignment; 97, assignment; 98, assignment; 99, assignment; 100, pattern_list; 101, call; 102, block; 103, assignment; 104, identifier:server_context; 105, identifier:make_request; 106, identifier:url; 107, identifier:payload; 108, keyword_argument; 109, identifier:server_context; 110, identifier:build_url; 111, string; 112, string; 113, keyword_argument; 114, string; 115, identifier:schema_name; 116, string; 117, identifier:sql; 118, subscript; 119, identifier:container_filter; 120, subscript; 121, identifier:max_rows; 122, subscript; 123, identifier:offset; 124, subscript; 125, identifier:sort; 126, subscript; 127, identifier:save_in_session; 128, identifier:key; 129, identifier:value; 130, attribute; 131, argument_list; 132, expression_statement; 133, subscript; 134, identifier:required_version; 135, identifier:timeout; 136, identifier:timeout; 137, string_content:query; 138, string_content:executeSql.api; 139, identifier:container_path; 140, identifier:container_path; 141, string_content:schemaName; 142, string_content:sql; 143, identifier:payload; 144, string; 145, identifier:payload; 146, string; 147, identifier:payload; 148, string; 149, identifier:payload; 150, string; 151, identifier:payload; 152, string; 153, identifier:parameters; 154, identifier:items; 155, assignment; 156, identifier:payload; 157, string; 158, string_content:containerFilter; 159, string_content:maxRows; 160, string_content:offset; 161, string_content:query.sort; 162, string_content:saveInSession; 163, subscript; 164, identifier:value; 165, string_content:apiVersion; 166, identifier:payload; 167, binary_operator:'query.param.' + key; 168, string; 169, identifier:key; 170, string_content:query.param.
code: def execute_sql(server_context, schema_name, sql, container_path=None,
                  max_rows=None,
                  sort=None,
                  offset=None,
                  container_filter=None,
                  save_in_session=None,
                  parameters=None,
                  required_version=None,
                  timeout=_default_timeout):
      """
      Execute sql query against a LabKey server.
  
      :param server_context: A LabKey server context. See utils.create_server_context.
      :param schema_name: schema of table
      :param sql: String of labkey sql to execute
      :param container_path: labkey container path if not already set in context
      :param max_rows: max number of rows to return
      :param sort: comma separated list of column names to sort by
      :param offset: number of rows to offset results by
      :param container_filter: enumeration of the various container filters available. See:
          https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Query.html#.containerFilter
      :param save_in_session: save query result as a named view to the session
      :param parameters: parameter values to pass through to a parameterized query
      :param required_version: Api version of response
      :param timeout: timeout of request in seconds (defaults to 30s)
      :return:
      """
      url = server_context.build_url('query', 'executeSql.api', container_path=container_path)
  
      payload = {
          'schemaName': schema_name,
          'sql': sql
      }
  
      if container_filter is not None:
          payload['containerFilter'] = container_filter
  
      if max_rows is not None:
          payload['maxRows'] = max_rows
  
      if offset is not None:
          payload['offset'] = offset
  
      if sort is not None:
          payload['query.sort'] = sort
  
      if save_in_session is not None:
          payload['saveInSession'] = save_in_session
  
      if parameters is not None:
          for key, value in parameters.items():
              payload['query.param.' + key] = value
  
      if required_version is not None:
          payload['apiVersion'] = required_version
  
      return server_context.make_request(url, payload, timeout=timeout)