<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_tcp(helper, host, port, warning_param, critical_param, session):
 """ the check logic for check TCP ports """

    
    # from tcpConnState from TCP-MIB
    tcp_translate = {
    
    "1" :   "closed",
    "2" :   "listen",
    "3" :   "synSent",
    "4" :   "synReceived",
    "5" :   "established",
    "6" :   "finWait1",
    "7" :   "finWait2",
    "8" :   "closeWait",
    "9" :   "lastAck",
    "10":   "closing",
    "11":   "timeWait",
    "12":   "deleteTCB"

    }

    # collect all open local ports
    open_ports = walk_data(session, '.1.3.6.1.2.1.6.13.1.3', helper)[0] #tcpConnLocalPort from TCP-MIB (deprecated)
    # collect all status information about the open ports
    port_status = walk_data(session, '.1.3.6.1.2.1.6.13.1.1', helper)[0] #tcpConnState from TCP-MIB (deprecated)
    # make a dict out of the two lists
    port_and_status = dict(zip(open_ports, port_status))
    
    # here we show all open TCP ports and it's status
    if scan:
        print "All open TCP ports: " + host
        for port in open_ports:
            tcp_status = port_and_status[port]
            tcp_status = tcp_translate[tcp_status]
            print "TCP: \t" + port + "\t Status: \t" + tcp_status
        quit()
    
    #here we have the real check logic for TCP ports
    if port in open_ports:
        # if the port is available in the list of open_ports, then extract the status
        tcp_status = port_and_status[port]
        # translate the status from the integer value to a human readable string
        tcp_status = tcp_translate[tcp_status]
             
        # now let's set the status according to the warning / critical "threshold" parameter        
        if tcp_status in warning_param:
            helper.status(warning)
        elif tcp_status in critical_param:
            helper.status(critical)
        else:
            helper.status(ok)    
    else:
        # if there is no value in the list => the port is closed for sure
        tcp_status = "CLOSED"
        helper.status(critical)
        
    return ("Current status for TCP port " + port + " is: " + tcp_status)