Function enhance
        Enhance the object with new item or enhanced items
424560
def enhance(self):
        
        self.update({'parameters':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemParameter)})
        self.update({'interfaces':
                     SubDict(self.api, self.objName,
                             self.payloadObj, self.key,
                             SubItemInterface)})
        self.update({'subnets':
                    SubDict(self.api, self.objName,
                            self.payloadObj, self.key,
                            SubItemSubnet)})
867847
function extend( obj, ext ){
    for( var prop in ext ){
      obj[prop] = ext[prop]
    }
    return obj
  }
1193183
def duplicate
      enhance_settings
      p = self.dup
      p.category = 'COPY OF ' + category
      p.created_at = p.updated_at = nil
      p.url = url
      p.attachment = attachment

      # allow site to do some customization
      p.send(:duplicate_extra, self) if p.respond_to?(:duplicate_extra)
      p.save!
      p
    end
355823
def add_item(self, item):
        
        self.items.append(item)
        self.last_updated = datetime.datetime.now()
1006594
function appendExtension (obj, extension) {
  if (!obj.extensions) {
    obj.extensions = []
  }

  if (obj.extensions.indexOf(extension) === -1) {
    obj.extensions.push(extension)
  }
}
959675
function _enhanceInvisibleElement(oInvisibleElement, mODataOrCustomItem) {
		// mODataOrCustomItem.fieldLabel - oData, mODataOrCustomItem.label - custom
		oInvisibleElement.originalLabel = mODataOrCustomItem.fieldLabel || mODataOrCustomItem.label;

		// mODataOrCustomItem.quickInfo - oData, mODataOrCustomItem.tooltip - custom
		oInvisibleElement.quickInfo = mODataOrCustomItem.quickInfo || mODataOrCustomItem.tooltip;

		// mODataOrCustomItem.name - oData
		oInvisibleElement.name = mODataOrCustomItem.name;

		// oInvisibleElement.fieldLabel has the current label
		if (oInvisibleElement.fieldLabel !== oInvisibleElement.originalLabel) {
			oInvisibleElement.renamedLabel = true;
		}
		if (mODataOrCustomItem.referencedComplexPropertyName) {
			oInvisibleElement.referencedComplexPropertyName = mODataOrCustomItem.referencedComplexPropertyName;
		}
	}
615956
function extend( a, b ) {
	for ( var p in b ) {
		a[ p ] = b[ p ];
	}

	return a;
}
840186
function(obj, func, items, func2){
					each(items, function(i, item){
						when(obj, func, item, func2)
					})
				}
919208
def ss_item
      item = DICOM::Item.new
      item.add(DICOM::Element.new(ROI_NUMBER, @number.to_s))
      item.add(DICOM::Element.new(REF_FRAME_OF_REF, @frame.uid))
      item.add(DICOM::Element.new(ROI_NAME, @name))
      item.add(DICOM::Element.new(ROI_ALGORITHM, @algorithm))
      return item
    end
388802
def append_item(self, item):
        """"""
        if not isinstance(item, LR0Item):
            raise TypeError
        self.itemlist.append(item)
1211751
function enhanceSpm (comName, checkSignature, fn) {
  var sp = new SerialPort(comName)
    , open = false;

  sp.writable = true;
  sp.on('open', function() {
    open = true;
    if (checkSignature)
      getSignature(sp, function(e, sig) {
        fn(e, sp, sig);
      });
    else
      fn(null, sp, null);
  });

  sp.once('error', function(e) {
    console.log('ERROR', e, comName);
    if (!open)
      fn(e);
  });
}
905747
function(category, name, desc) {

            if(used[name]) return;
            used[name]= 1;

            if(!items[category]) items[category] = [];
            
           items[category].push({
               name: name,
               desc: desc
           });
        }
1316388
function addIfNotExist(set, item) {
  if (set.has(item)) return true;
  set.add(item);
  return false;
}
555902
def enhance(self):
        
        if self.objName in ['hosts', 'hostgroups',
                            'puppet_classes']:
            from foreman.itemSmartClassParameter\
                import ItemSmartClassParameter
            self.update({'smart_class_parameters':
                        SubDict(self.api, self.objName,
                                self.payloadObj, self.key,
                                ItemSmartClassParameter)})
1102494
def build_item(
    title, key=None, synonyms=None, description=None, img_url=None, alt_text=None
):
    """"""
    item = {
        "info": {"key": key or title, "synonyms": synonyms or []},
        "title": title,
        "description": description,
        "image": {
            "imageUri": img_url or "",
            "accessibilityText": alt_text or "{} img".format(title),
        },
    }
    return item
150067
function extend(obj) {
        for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
            args[_key - 1] = arguments[_key];
        }

        if (validateHelpers.isObject(obj) && args.length > 0) {
            if (Object.assign) {
                return Object.assign.apply(Object, [obj].concat(toConsumableArray(args)));
            }

            args.forEach(function (arg) {
                if (validateHelpers.isObject(arg)) {
                    Object.keys(arg).forEach(function (key) {
                        obj[key] = arg[key];
                    });
                }
            });
        }

        return obj;
    }
349579
function enhance(Component, ...args) {
	let oComp = new Component(...args);

	// 添加字段
	enhanceFields(oComp);	// 组件对象ID等

	// 添加方法
	enhanceRender(oComp);	// 组件渲染
	enhanceState(oComp);	// 组件状态存取
	enhanceRef(oComp);		// 按引用名取DOM节点或组件对象
	enhanceRoot(oComp);		// 取组件根节点DOM元素

	return oComp;
}