code: def test_structures_have_name_on_init():
      """Test that the children in structures have the correct name assigned upon initialization."""
  
      class ChildWork(LightningWork):
          def run(self):
              pass
  
      class Collection(EmptyFlow):
          def __init__(self):
              super().__init__()
              self.list_structure = List()
              self.list_structure.append(ChildWork())
  
              self.dict_structure = Dict()
              self.dict_structure["dict_child"] = ChildWork()
  
      flow = Collection()
      LightningApp(flow)  # wrap in app to init all component names
      assert flow.list_structure[0].name == "root.list_structure.0"
      assert (
          flow.dict_structure["dict_child"].name
          == "root.dict_structure.dict_child"
      )
  
imports: import os
  from copy import deepcopy
  import pytest
  from lightning.app import LightningApp, LightningFlow, LightningWork
  from lightning.app.runners import MultiProcessRuntime
  from lightning.app.storage.payload import Payload
  from lightning.app.structures import Dict, List
  from lightning.app.testing.helpers import EmptyFlow
  from lightning.app.utilities.enum import CacheCallsKeys, WorkStageStatus
  from lightning.app.utilities.imports import _IS_WINDOWS
label_desc: Use image node_id 9 for calling a global function with example usage: test_structures_have_name_on_init() without return types