nodes: 0, module; 1, function_definition; 2, function_name:get_unit_property_names; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, if_statement; 10, identifier:unit_id; 11, None; 12, string; 13, comparison_operator:unit_id is None; 14, block; 15, call; 16, block; 17, else_clause; 18, string_content:Get a list of property names for a given unit, or for all units if unit_id is None
  
          Parameters
          ----------
          unit_id: int
              The unit id for which the property names will be returned
              If None (default), will return property names for all units
          Returns
          ----------
          property_names
              The list of property names from the specified unit(s); 19, identifier:unit_id; 20, None; 21, expression_statement; 22, for_statement; 23, expression_statement; 24, return_statement; 25, identifier:isinstance; 26, argument_list; 27, if_statement; 28, block; 29, assignment; 30, identifier:unit_id; 31, call; 32, block; 33, assignment; 34, identifier:property_names; 35, identifier:unit_id; 36, tuple; 37, comparison_operator:unit_id in self.get_unit_ids(); 38, block; 39, else_clause; 40, raise_statement; 41, identifier:property_names; 42, list; 43, attribute; 44, argument_list; 45, expression_statement; 46, for_statement; 47, identifier:property_names; 48, call; 49, identifier:int; 50, attribute; 51, identifier:unit_id; 52, call; 53, if_statement; 54, expression_statement; 55, return_statement; 56, block; 57, call; 58, identifier:self; 59, identifier:get_unit_ids; 60, assignment; 61, identifier:curr_property_name; 62, identifier:curr_property_names; 63, block; 64, identifier:sorted; 65, argument_list; 66, identifier:np; 67, identifier:integer; 68, attribute; 69, argument_list; 70, comparison_operator:unit_id not in self._unit_properties; 71, block; 72, assignment; 73, identifier:property_names; 74, raise_statement; 75, identifier:ValueError; 76, argument_list; 77, identifier:curr_property_names; 78, call; 79, expression_statement; 80, call; 81, identifier:self; 82, identifier:get_unit_ids; 83, identifier:unit_id; 84, attribute; 85, expression_statement; 86, identifier:property_names; 87, call; 88, call; 89, binary_operator:str(unit_id) + " must be an int"; 90, attribute; 91, argument_list; 92, call; 93, identifier:list; 94, argument_list; 95, identifier:self; 96, identifier:_unit_properties; 97, assignment; 98, identifier:sorted; 99, argument_list; 100, identifier:ValueError; 101, argument_list; 102, call; 103, string:" must be an int"; 104, identifier:self; 105, identifier:get_unit_property_names; 106, identifier:unit_id; 107, attribute; 108, argument_list; 109, call; 110, subscript; 111, dictionary; 112, call; 113, binary_operator:str(unit_id) + " is not a valid unit_id"; 114, identifier:str; 115, argument_list; 116, identifier:property_names; 117, identifier:append; 118, identifier:curr_property_name; 119, identifier:set; 120, argument_list; 121, attribute; 122, identifier:unit_id; 123, attribute; 124, argument_list; 125, call; 126, string:" is not a valid unit_id"; 127, identifier:unit_id; 128, identifier:property_names; 129, identifier:self; 130, identifier:_unit_properties; 131, subscript; 132, identifier:keys; 133, identifier:str; 134, argument_list; 135, attribute; 136, identifier:unit_id; 137, identifier:unit_id; 138, identifier:self; 139, identifier:_unit_properties
code: def get_unit_property_names(self, unit_id=None):
          '''Get a list of property names for a given unit, or for all units if unit_id is None
  
          Parameters
          ----------
          unit_id: int
              The unit id for which the property names will be returned
              If None (default), will return property names for all units
          Returns
          ----------
          property_names
              The list of property names from the specified unit(s)
          '''
          if unit_id is None:
              property_names = []
              for unit_id in self.get_unit_ids():
                  curr_property_names = self.get_unit_property_names(unit_id)
                  for curr_property_name in curr_property_names:
                      property_names.append(curr_property_name)
              property_names = sorted(list(set(property_names)))
              return property_names
          if isinstance(unit_id, (int, np.integer)):
              if unit_id in self.get_unit_ids():
                  if unit_id not in self._unit_properties:
                      self._unit_properties[unit_id] = {}
                  property_names = sorted(self._unit_properties[unit_id].keys())
                  return property_names
              else:
                  raise ValueError(str(unit_id) + " is not a valid unit_id")
          else:
              raise ValueError(str(unit_id) + " must be an int")