nodes: 0, module; 1, function_definition; 2, function_name:copy_unit_properties; 3, parameters; 4, block; 5, identifier:self; 6, identifier:sorting; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, if_statement; 11, identifier:unit_ids; 12, None; 13, string; 14, comparison_operator:unit_ids is None; 15, block; 16, call; 17, block; 18, else_clause; 19, string_content:Copy unit properties from another sorting extractor to the current
          sorting extractor.
  
          Parameters
          ----------
          sorting: SortingExtractor
              The sorting extractor from which the properties will be copied
          unit_ids: (array_like, int)
              The list (or single value) of unit_ids for which the properties will be copied.; 20, identifier:unit_ids; 21, None; 22, expression_statement; 23, identifier:isinstance; 24, argument_list; 25, expression_statement; 26, for_statement; 27, block; 28, assignment; 29, identifier:unit_ids; 30, identifier:int; 31, assignment; 32, identifier:curr_property_name; 33, identifier:curr_property_names; 34, block; 35, for_statement; 36, identifier:unit_ids; 37, call; 38, identifier:curr_property_names; 39, call; 40, expression_statement; 41, expression_statement; 42, identifier:unit_id; 43, identifier:unit_ids; 44, block; 45, attribute; 46, argument_list; 47, attribute; 48, argument_list; 49, assignment; 50, call; 51, expression_statement; 52, for_statement; 53, identifier:sorting; 54, identifier:get_unit_ids; 55, identifier:sorting; 56, identifier:get_unit_property_names; 57, keyword_argument; 58, identifier:value; 59, call; 60, attribute; 61, argument_list; 62, assignment; 63, identifier:curr_property_name; 64, identifier:curr_property_names; 65, block; 66, identifier:unit_id; 67, identifier:unit_ids; 68, attribute; 69, argument_list; 70, identifier:self; 71, identifier:set_unit_property; 72, keyword_argument; 73, keyword_argument; 74, keyword_argument; 75, identifier:curr_property_names; 76, call; 77, expression_statement; 78, expression_statement; 79, identifier:sorting; 80, identifier:get_unit_property; 81, keyword_argument; 82, keyword_argument; 83, identifier:unit_id; 84, identifier:unit_ids; 85, identifier:property_name; 86, identifier:curr_property_name; 87, identifier:value; 88, identifier:value; 89, attribute; 90, argument_list; 91, assignment; 92, call; 93, identifier:unit_id; 94, identifier:unit_ids; 95, identifier:property_name; 96, identifier:curr_property_name; 97, identifier:sorting; 98, identifier:get_unit_property_names; 99, keyword_argument; 100, identifier:value; 101, call; 102, attribute; 103, argument_list; 104, identifier:unit_id; 105, identifier:unit_id; 106, attribute; 107, argument_list; 108, identifier:self; 109, identifier:set_unit_property; 110, keyword_argument; 111, keyword_argument; 112, keyword_argument; 113, identifier:sorting; 114, identifier:get_unit_property; 115, keyword_argument; 116, keyword_argument; 117, identifier:unit_id; 118, identifier:unit_id; 119, identifier:property_name; 120, identifier:curr_property_name; 121, identifier:value; 122, identifier:value; 123, identifier:unit_id; 124, identifier:unit_id; 125, identifier:property_name; 126, identifier:curr_property_name
code: def copy_unit_properties(self, sorting, unit_ids=None):
          '''Copy unit properties from another sorting extractor to the current
          sorting extractor.
  
          Parameters
          ----------
          sorting: SortingExtractor
              The sorting extractor from which the properties will be copied
          unit_ids: (array_like, int)
              The list (or single value) of unit_ids for which the properties will be copied.
          '''
          if unit_ids is None:
              unit_ids = sorting.get_unit_ids()
          if isinstance(unit_ids, int):
              curr_property_names = sorting.get_unit_property_names(unit_id=unit_ids)
              for curr_property_name in curr_property_names:
                  value = sorting.get_unit_property(unit_id=unit_ids, property_name=curr_property_name)
                  self.set_unit_property(unit_id=unit_ids, property_name=curr_property_name, value=value)
          else:
              for unit_id in unit_ids:
                  curr_property_names = sorting.get_unit_property_names(unit_id=unit_id)
                  for curr_property_name in curr_property_names:
                      value = sorting.get_unit_property(unit_id=unit_id, property_name=curr_property_name)
                      self.set_unit_property(unit_id=unit_id, property_name=curr_property_name, value=value)