input: Write a python function to parse the IPsec connection data and return a dictionary with the necessary details.
  assert parse_sa({'version': '2', 'local_addrs': [b'192.168.1.1'], 'remote_addrs': [b'192.168.1.2'], 'children': 'child_conn'}) == {'local-addrs': b'192.168.1.1', 'remote-addrs': b'192.168.1.2', 'children': 'child_conn', 'local-id': '', 'remote-id': '', 'version': '2', 'sas': []}
  assert parse_sa({'version': '1', 'local-host': '10.0.0.1', 'remote-host': '10.0.0.2'}) == {'local-addrs': '10.0.0.1', 'remote-addrs': '10.0.0.2', 'children': '', 'local-id': '', 'remote-id': '', 'version': '1', 'sas': []}
output: def parse_sa(data):
      return {
          'local-addrs': data.get('local_addrs', [data.get('local-host', '')])[0] if isinstance(data.get('local_addrs'), list) else data.get('local-host', ''),
          'remote-addrs': data.get('remote_addrs', [data.get('remote-host', '')])[0] if isinstance(data.get('remote_addrs'), list) else data.get('remote-host', ''),
          'children': data.get('children', ''),
          'local-id': data.get('local-id', ''),
          'remote-id': data.get('remote-id', ''),
          'version': data.get('version', ''),
          'sas': data.get('sas', [])
      }