def push(self, path, name, tag=None):
<EOL>parent = self._get_or_create_folder(self._base)<EOL>image = None<EOL>path = os.path.abspath(path)<EOL>bot.debug("<STR_LIT>" % path)<EOL>if not os.path.exists(path):<EOL><INDENT>bot.error('<STR_LIT>' %path)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>names = parse_image_name(remove_uri(name),tag=tag)<EOL>if names['<STR_LIT:version>'] is None:<EOL><INDENT>version = get_image_hash(path)<EOL>names = parse_image_name(remove_uri(name), tag=tag, version=version)<EOL><DEDENT>metadata = self.get_metadata(path, names=names)<EOL>metadata = metadata['<STR_LIT:data>']<EOL>metadata.update(names)<EOL>metadata.update(metadata['<STR_LIT>']['<STR_LIT>'])<EOL>del metadata['<STR_LIT>']<EOL>file_metadata = {<EOL>'<STR_LIT:name>': names['<STR_LIT>'],<EOL>'<STR_LIT>' : '<STR_LIT>',<EOL>'<STR_LIT>': [parent['<STR_LIT:id>']],<EOL>'<STR_LIT>': metadata<EOL>}<EOL>media = MediaFileUpload(path,resumable=True)<EOL>try:<EOL><INDENT>bot.spinner.start()<EOL>image = self._service.files().create(body=file_metadata,<EOL>media_body=media,<EOL>fields='<STR_LIT:id>').execute()<EOL>thumbnail = get_thumbnail()<EOL>with open(thumbnail, "<STR_LIT:rb>") as f:<EOL><INDENT>body = { "<STR_LIT>": { <EOL>"<STR_LIT>": { "<STR_LIT:image>": base64.urlsafe_b64encode(f.read()).decode('<STR_LIT:utf8>'),<EOL>"<STR_LIT>": "<STR_LIT>" }<EOL>}}<EOL>image = self._service.files().update(fileId=image['<STR_LIT:id>'],<EOL>body = body).execute()<EOL><DEDENT>bot.spinner.stop()<EOL>print(image['<STR_LIT:name>'])<EOL><DEDENT>except HttpError:<EOL><INDENT>bot.error('<STR_LIT>' %path)<EOL>pass<EOL><DEDENT>return image<EOL>
push an image to Google Cloud Drive, meaning uploading it

    path: should correspond to an absolte image path (or derive it)
    name: should be the complete uri that the user has requested to push.
    tag: should correspond with an image tag. This is provided to mirror Docker