parameters: (self, indent_depth, member_type, value,
                                 import_tree=None, namespace=None)
return_statement: return output_str
docstring: Returns the nyan string representation of complex values.
  
          Subroutine of _get_value_str()
docstring_summary: Returns the nyan string representation of complex values.
docstring_tokens: Returns the nyan string representation of complex values .
function: def _get_complex_value_str(self, indent_depth, member_type, value,
                                 import_tree=None, namespace=None):
          """
          Returns the nyan string representation of complex values.
  
          Subroutine of _get_value_str()
          """
          output_str = ""
  
          if member_type.get_real_type() is MemberType.ORDEREDSET:
              output_str += "o"
  
          output_str += "{"
  
          # Store the values for formatting
          # TODO: Dicts
          stored_values = []
  
          if member_type.get_real_type() is MemberType.DICT:
              for key, val in value.items():
                  subtype = member_type.get_real_element_types()[0]
                  key_str = self._get_primitive_value_str(
                      subtype,
                      key,
                      import_tree=import_tree,
                      namespace=namespace
                  )
  
                  subtype = member_type.get_real_element_types()[1]
                  val_str = self._get_primitive_value_str(
                      subtype,
                      val,
                      import_tree=import_tree,
                      namespace=namespace
                  )
  
                  stored_values.append(f"{key_str}: {val_str}")
  
          else:
              for val in value:
                  subtype = member_type.get_real_element_types()[0]
                  stored_values.append(self._get_primitive_value_str(
                      subtype,
                      val,
                      import_tree=import_tree,
                      namespace=namespace
                  ))
  
          # Check if the line gets too long
          # TODO: this does not account for a type definition
          concat_values = ", ".join(stored_values)
          line_length = len(indent_depth * INDENT) + len((
              f"{self.name} "
              f"{'@' * self._override_depth}"
              f"{self._operator.value} "
              f"{concat_values}"
          ))
  
          if line_length < MAX_LINE_WIDTH:
              output_str += concat_values
  
          elif stored_values:
              output_str += "\n"
  
              # How much space is left per formatted line
              space_left = MAX_LINE_WIDTH - len((indent_depth + 2) * INDENT)
  
              # Find the longest value's length
              longest_len = len(max(stored_values, key=len))
  
              # How man values of that length fit in one line
              values_per_line = space_left // longest_len
              values_per_line = max(values_per_line, 1)
  
              output_str += (indent_depth + 2) * INDENT
  
              val_index = 0
              end_index = len(stored_values)
              for val in stored_values:
                  val_index += 1
                  output_str += val
  
                  if val_index % values_per_line == 0:
                      output_str += ",\n"
  
                      if val_index != end_index:
                          output_str += ((indent_depth + 2) * INDENT)
  
                  else:
                      output_str += ", "
  
              output_str = output_str[:-2] + "\n"
              output_str += ((indent_depth + 1) * INDENT)
  
          output_str = output_str + "}"
  
          return output_str
function_tokens: def _get_complex_value_str ( self , indent_depth , member_type , value , import_tree = None , namespace = None ) : output_str = "" if member_type . get_real_type ( ) is MemberType . ORDEREDSET : output_str += "o" output_str += "{" # Store the values for formatting # TODO: Dicts stored_values = [ ] if member_type . get_real_type ( ) is MemberType . DICT : for key , val in value . items ( ) : subtype = member_type . get_real_element_types ( ) [ 0 ] key_str = self . _get_primitive_value_str ( subtype , key , import_tree = import_tree , namespace = namespace ) subtype = member_type . get_real_element_types ( ) [ 1 ] val_str = self . _get_primitive_value_str ( subtype , val , import_tree = import_tree , namespace = namespace ) stored_values . append ( f"{key_str}: {val_str}" ) else : for val in value : subtype = member_type . get_real_element_types ( ) [ 0 ] stored_values . append ( self . _get_primitive_value_str ( subtype , val , import_tree = import_tree , namespace = namespace ) ) # Check if the line gets too long # TODO: this does not account for a type definition concat_values = ", " . join ( stored_values ) line_length = len ( indent_depth * INDENT ) + len ( ( f"{self.name} " f"{'@' * self._override_depth}" f"{self._operator.value} " f"{concat_values}" ) ) if line_length < MAX_LINE_WIDTH : output_str += concat_values elif stored_values : output_str += "\n" # How much space is left per formatted line space_left = MAX_LINE_WIDTH - len ( ( indent_depth + 2 ) * INDENT ) # Find the longest value's length longest_len = len ( max ( stored_values , key = len ) ) # How man values of that length fit in one line values_per_line = space_left // longest_len values_per_line = max ( values_per_line , 1 ) output_str += ( indent_depth + 2 ) * INDENT val_index = 0 end_index = len ( stored_values ) for val in stored_values : val_index += 1 output_str += val if val_index % values_per_line == 0 : output_str += ",\n" if val_index != end_index : output_str += ( ( indent_depth + 2 ) * INDENT ) else : output_str += ", " output_str = output_str [ : - 2 ] + "\n" output_str += ( ( indent_depth + 1 ) * INDENT ) output_str = output_str + "}" return output_str