def get_ftp(ftp_params):
    ftp = ftplib.FTP(*ftp_params["auth"])
    ftp.set_pasv(ftp_params["passive"])

    #https://bbs.archlinux.org/viewtopic.php?id=134529
    #https://github.com/keepitsimple/pyFTPclient/blob/master/pyftpclient.py
    if ftp_params.get('keepalive', False) is True:
        ftp.sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
    if 'keepalive_interval' in ftp_params and hasattr(socket, "TCP_KEEPINTVL"):
        ftp.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL,
                            ftp_params['keepalive_interval'])
    if ftp_params in 'keepalive_idle' and hasattr(socket, "TCP_KEEPIDLE"):
        ftp.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE,
                            ftp_params['keepalive_idle'])

    return ftp
dataset/ETHPy150Open Starou/SimpleIDML/src/simple_idml/indesign/indesign.py/get_ftp/swapped operands of `in`