def apply_security_groups(name, security_groups, region=None, key=None,
                          keyid=None, profile=None):
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    if isinstance(security_groups, string_types):
        security_groups = json.loads(security_groups)
    try:
        conn.apply_security_groups_to_lb(name, security_groups)
        msg = 'Applied security_groups on ELB {0}'.format(name)
        log.info(msg)
        return True
    except boto.exception.BotoServerError as e:
        log.debug(e)
        msg = 'Failed to appply security_groups on ELB {0}: {1}'
        msg = msg.format(name, e.message)
        log.error(msg)
        return False
>>> s = ["foo", "bar"]
dataset/ETHPy150Open saltstack/salt/salt/modules/boto_elb.py/apply_security_groups--crossover with--dataset/ETHPy150Open richardkiss/pycoin/pycoin/tx/script/microcode.py/do_OP_CAT