def copy(self, target=None, name=None):
if target is None and name is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if isinstance(target, Folder):<EOL><INDENT>target_id = target.object_id<EOL>drive_id = target.drive_id<EOL><DEDENT>elif isinstance(target, Drive):<EOL><INDENT>root_folder = target.get_root_folder()<EOL>if not root_folder:<EOL><INDENT>return None<EOL><DEDENT>target_id = root_folder.object_id<EOL>drive_id = root_folder.drive_id<EOL><DEDENT>elif target is None:<EOL><INDENT>target_id = None<EOL>drive_id = None<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if not self.object_id:<EOL><INDENT>return None<EOL><DEDENT>if target_id == '<STR_LIT:root>':<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>url = self.build_url(<EOL>self._endpoints.get('<STR_LIT>').format(id=self.object_id))<EOL>if target_id and drive_id:<EOL><INDENT>data = {'<STR_LIT>': {'<STR_LIT:id>': target_id, '<STR_LIT>': drive_id}}<EOL><DEDENT>else:<EOL><INDENT>data = {}<EOL><DEDENT>if name:<EOL><INDENT>if not Path(name).suffix and self.name:<EOL><INDENT>name = name + Path(self.name).suffix<EOL><DEDENT>data['<STR_LIT:name>'] = name<EOL><DEDENT>response = self.con.post(url, data=data)<EOL>if not response:<EOL><INDENT>return None<EOL><DEDENT>location = response.headers.get('<STR_LIT>', None)<EOL>if '<STR_LIT>' in location:<EOL><INDENT>return CopyOperation(parent=self.drive, monitor_url=location)<EOL><DEDENT>else:<EOL><INDENT>path = urlparse(location).path<EOL>item_id = path.split('<STR_LIT:/>')[-<NUM_LIT:1>]<EOL>return CopyOperation(parent=self.drive, item_id=item_id)<EOL><DEDENT>
Asynchronously creates a copy of this DriveItem and all it's
        child elements.

        :param target: target location to move to.
         If it's a drive the item will be moved to the root folder.
        :type target: drive.Folder or Drive
        :param name: a new name for the copy.
        :rtype: CopyOperation