nodes: 0, module; 1, function_definition; 2, function_name:_get_shade_hdrgos; 3, parameters; 4, block; 5, dictionary_splat_pattern; 6, expression_statement; 7, comment:# KWS: shade_hdrgos hdrgo_prt section_sortby top_n; 8, if_statement; 9, comment:# Return user-sepcified hdrgo_prt, if provided; 10, if_statement; 11, comment:# If no hdrgo_prt provided, set hdrgo_prt to False if:; 12, comment:#   * section_sortby == True; 13, comment:#   * section_sortby = user_sort; 14, comment:#   * top_n == N; 15, if_statement; 16, if_statement; 17, return_statement; 18, identifier:kws; 19, comment:"""If no hdrgo_prt specified, and these conditions are present -> hdrgo_prt=F."""; 20, comparison_operator:'shade_hdrgos' in kws; 21, block; 22, comparison_operator:'hdrgo_prt' in kws; 23, block; 24, boolean_operator; 25, block; 26, boolean_operator; 27, block; 28, True; 29, string; 30, identifier:kws; 31, return_statement; 32, string; 33, identifier:kws; 34, return_statement; 35, comparison_operator:'section_sortby' in kws; 36, subscript; 37, return_statement; 38, comparison_operator:'top_n' in kws; 39, call; 40, return_statement; 41, string_content:shade_hdrgos; 42, subscript; 43, string_content:hdrgo_prt; 44, subscript; 45, string; 46, identifier:kws; 47, identifier:kws; 48, string; 49, False; 50, string; 51, identifier:kws; 52, identifier:isinstance; 53, argument_list; 54, False; 55, identifier:kws; 56, string; 57, identifier:kws; 58, string; 59, string_content:section_sortby; 60, string_content:section_sortby; 61, string_content:top_n; 62, subscript; 63, identifier:int; 64, string_content:shade_hdrgos; 65, string_content:hdrgo_prt; 66, identifier:kws; 67, string; 68, string_content:top_n
code: def _get_shade_hdrgos(**kws):
          """If no hdrgo_prt specified, and these conditions are present -> hdrgo_prt=F."""
          # KWS: shade_hdrgos hdrgo_prt section_sortby top_n
          if 'shade_hdrgos' in kws:
              return kws['shade_hdrgos']
          # Return user-sepcified hdrgo_prt, if provided
          if 'hdrgo_prt' in kws:
              return kws['hdrgo_prt']
          # If no hdrgo_prt provided, set hdrgo_prt to False if:
          #   * section_sortby == True
          #   * section_sortby = user_sort
          #   * top_n == N
          if 'section_sortby' in kws and kws['section_sortby']:
              return False
          if 'top_n' in kws and isinstance(kws['top_n'], int):
              return False
          return True