def get_segments_with_phys_nets(context, phys_nets):
 if (not phys_nets):
  return []
 with context.session.begin(subtransactions=True):
  segments = context.session.query(segment_model.NetworkSegment).filter(segment_model.NetworkSegment.physical_network.in_(phys_nets))
  return segments

def get_segments_with_phys_nets ( context , phys_nets ) : if ( not phys_nets ) : return [ ] with context . session . begin ( subtransactions = True ) : segments = context . session . query ( segment_model . NetworkSegment ) . filter ( segment_model . NetworkSegment . physical_network . in_ ( phys_nets ) ) return segments
get segments from physical networks .