def METHOD_NAME(inst: "AbstractModule") -> int:
    usb_port = inst.usb_port
    primary_port = usb_port.port_number
    if usb_port.hub_port is not None:
        secondary_port = usb_port.hub_port
    else:
        secondary_port = 0
    return primary_port * 1000 + secondary_port