def clone(self, to_linode=None, region=None, service=None, configs=[], disks=[],<EOL>label=None, group=None, with_backups=None):
if to_linode and region:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if region and not service:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if not isinstance(configs, list) and not isinstance(configs, PaginatedList):<EOL><INDENT>configs = [configs]<EOL><DEDENT>if not isinstance(disks, list) and not isinstance(disks, PaginatedList):<EOL><INDENT>disks = [disks]<EOL><DEDENT>cids = [ c.id if issubclass(type(c), Base) else c for c in configs ]<EOL>dids = [ d.id if issubclass(type(d), Base) else d for d in disks ]<EOL>params = {<EOL>"<STR_LIT>": to_linode.id if issubclass(type(to_linode), Base) else to_linode,<EOL>"<STR_LIT>": region.id if issubclass(type(region), Base) else region,<EOL>"<STR_LIT:type>": service.id if issubclass(type(service), Base) else service,<EOL>"<STR_LIT>": cids if cids else None,<EOL>"<STR_LIT>": dids if dids else None,<EOL>"<STR_LIT:label>": label,<EOL>"<STR_LIT>": group,<EOL>"<STR_LIT>": with_backups,<EOL>}<EOL>result = self._client.post('<STR_LIT>'.format(Instance.api_endpoint), model=self, data=params)<EOL>if not '<STR_LIT:id>' in result:<EOL><INDENT>raise UnexpectedResponseError('<STR_LIT>', json=result)<EOL><DEDENT>l = Instance(self._client, result['<STR_LIT:id>'], result)<EOL>return l<EOL>
Clones this linode into a new linode or into a new linode in the given region