code: def electron_shell_str(shell, shellidx=None):
      '''Return a string representing the data for an electron shell
  
      If shellidx (index of the shell) is not None, it will also be printed
      '''
      am = shell['angular_momentum']
      amchar = lut.amint_to_char(am)
      amchar = amchar.upper()
  
      shellidx_str = ''
      if shellidx is not None:
          shellidx_str = 'Index {} '.format(shellidx)
  
      exponents = shell['exponents']
      coefficients = shell['coefficients']
      ncol = len(coefficients) + 1
  
      point_places = [8 * i + 15 * (i - 1) for i in range(1, ncol + 1)]
      s = "Shell: {}Region: {}: AM: {}\n".format(shellidx_str, shell['region'], amchar)
      s += "Function: {}\n".format(shell['function_type'])
      s += write_matrix([exponents, *coefficients], point_places)
      return f electron_shell_str(shell, shellidx=None):
      '''Return a string representing the data for an electron shell
  
      If shellidx (index of the shell) is not None, it will also be printed
      '''
      am = shell['angular_momentum']
      amchar = lut.amint_to_char(am)
      amchar = amchar.upper()
  
      shellidx_str = ''
      if shellidx is not None:
          shellidx_str = 'Index {} '.format(shellidx)
  
      exponents = shell['exponents']
      coefficients = shell['coefficients']
      ncol = len(coefficients) + 1
  
      point_places = [8 * i + 15 * (i - 1) for i in range(1, ncol + 1)]
      s = "Shell: {}Region: {}: AM: {}\n".format(shellidx_str, shell['region'], amchar)
      s += "Function: {}\n".format(shell['function_type'])
      s += write_matrix([exponents, *coefficients], point_places)
      return s
docs: Return a string representing the data for an electron shell
  
      If shellidx (index of the shell) is not None, it will also be printed