parameters: (
          self,
          entry_layer: Union[list, str],
      )
return_statement: return output
docstring: Convert sprite names to sprite indexes in one fg or bg tile entry part
docstring_summary: Convert sprite names to sprite indexes in one fg or bg tile entry part
docstring_tokens: Convert sprite names to sprite indexes in one fg or bg tile entry part
function: def convert_entry_layer(
          self,
          entry_layer: Union[list, str],
      ) -> list:
          '''
          Convert sprite names to sprite indexes in one fg or bg tile entry part
          '''
          output = []
  
          if isinstance(entry_layer, list):
              # "fg": [ "f_fridge_S", "f_fridge_W", "f_fridge_N", "f_fridge_E" ]
              for layer_part in entry_layer:
                  if isinstance(layer_part, dict):
                      # weighted random variations
                      variations, valid = self.convert_random_variations(
                          layer_part.get('sprite'))
                      if valid:
                          layer_part['sprite'] = \
                              variations[0] if len(variations) == 1 \
                              else variations
                          output.append(layer_part)
                  else:
                      self.append_sprite_index(layer_part, output)
          else:
              # "bg": "t_grass"
              self.append_sprite_index(entry_layer, output)
  
          return output
function_tokens: def convert_entry_layer ( self , entry_layer : Union [ list , str ] , ) -> list : output = [ ] if isinstance ( entry_layer , list ) : # "fg": [ "f_fridge_S", "f_fridge_W", "f_fridge_N", "f_fridge_E" ] for layer_part in entry_layer : if isinstance ( layer_part , dict ) : # weighted random variations variations , valid = self . convert_random_variations ( layer_part . get ( 'sprite' ) ) if valid : layer_part [ 'sprite' ] = variations [ 0 ] if len ( variations ) == 1 else variations output . append ( layer_part ) else : self . append_sprite_index ( layer_part , output ) else : # "bg": "t_grass" self . append_sprite_index ( entry_layer , output ) return output