def __init__(self, ncdevice, config=None):
self.device = ncdevice<EOL>self.parser = None<EOL>if config is None:<EOL><INDENT>self.ele = etree.Element(config_tag, nsmap={'<STR_LIT>': nc_url})<EOL><DEDENT>elif isinstance(config, operations.rpc.RPCReply) orisinstance(config, str) oretree.iselement(config):<EOL><INDENT>self.parser = NetconfParser(self.device, config)<EOL>self.ele = self.parser.ele<EOL><DEDENT>elif isinstance(config, Response):<EOL><INDENT>self.parser = RestconfParser(self.device, config)<EOL>self.ele = self.parser.ele<EOL><DEDENT>elif isinstance(config, GetResponse):<EOL><INDENT>self.parser = gNMIParser(self.device, config)<EOL>self.ele = self.parser.ele<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>""<STR_LIT>".format(type(config)))<EOL><DEDENT>self.validate_config()<EOL>
__init__ instantiates a Config instance.