<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_state_id_for_port(port):
 """This method returns the state ID of the state containing the given port :param port: Port to check for containing state ID :return: State ID of state containing port """

    parent = port.parent
    from rafcon.gui.mygaphas.items.state import StateView
    if isinstance(parent, StateView):
        return parent.model.state.state_id