def __init__(self, config_src, config_dst=None, delta=None,<EOL>preferred_create='<STR_LIT>',<EOL>preferred_replace='<STR_LIT>',<EOL>preferred_delete='<STR_LIT>'):
if not isinstance(config_src, Config):<EOL><INDENT>raise TypeError("<STR_LIT>""<STR_LIT>".format(type(config_src)))<EOL><DEDENT>if preferred_create in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:replace>']:<EOL><INDENT>self.preferred_create = preferred_create<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>""<STR_LIT>")<EOL><DEDENT>if preferred_replace in ['<STR_LIT>', '<STR_LIT:replace>']:<EOL><INDENT>self.preferred_replace = preferred_replace<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>""<STR_LIT>")<EOL><DEDENT>if preferred_delete in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>self.preferred_delete = preferred_delete<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>""<STR_LIT>")<EOL><DEDENT>self.config_src = config_src<EOL>if delta is not None:<EOL><INDENT>if isinstance(delta, str) or etree.iselement(delta):<EOL><INDENT>delta = NetconfParser(self.device, delta).ele<EOL><DEDENT>elif isinstance(delta, Request) or isinstance(delta, SetRequest):<EOL><INDENT>delta = delta<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>""<STR_LIT>""<STR_LIT>""<STR_LIT>".format(type(delta)))<EOL><DEDENT><DEDENT>if not isinstance(config_dst, Config) and config_dst is not None:<EOL><INDENT>raise TypeError("<STR_LIT>""<STR_LIT>".format(type(config_dst)))<EOL><DEDENT>self.config_dst = config_dst<EOL>if self.config_dst is None and delta is None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if delta is not None:<EOL><INDENT>if self.config_dst is not None:<EOL><INDENT>logger.warning("<STR_LIT>""<STR_LIT>")<EOL><DEDENT>self.config_dst = self.config_src + delta<EOL><DEDENT>else:<EOL><INDENT>ConfigCompatibility(self.config_src, self.config_dst).is_compatible<EOL><DEDENT>
__init__ instantiates a ConfigDelta instance.