def sg_gather_associated_ports(context, group):
if not group:<EOL><INDENT>return None<EOL><DEDENT>if not hasattr(group, "<STR_LIT>") or len(group.ports) <= <NUM_LIT:0>:<EOL><INDENT>return []<EOL><DEDENT>return group.ports<EOL>
Gather all ports associated to security group.

    Returns:
    * list, or None