def google_cloud_to_local(self, file_name):
if not file_name.startswith('<STR_LIT>'):<EOL><INDENT>return file_name<EOL><DEDENT>path_components = file_name[self.GCS_PREFIX_LENGTH:].split('<STR_LIT:/>')<EOL>if len(path_components) < <NUM_LIT:2>:<EOL><INDENT>raise Exception(<EOL>'<STR_LIT>'<EOL>.format(file_name))<EOL><DEDENT>bucket_id = path_components[<NUM_LIT:0>]<EOL>object_id = '<STR_LIT:/>'.join(path_components[<NUM_LIT:1>:])<EOL>local_file = '<STR_LIT>'.format(str(uuid.uuid4())[:<NUM_LIT:8>],<EOL>path_components[-<NUM_LIT:1>])<EOL>self._gcs_hook.download(bucket_id, object_id, local_file)<EOL>if os.stat(local_file).st_size > <NUM_LIT:0>:<EOL><INDENT>return local_file<EOL><DEDENT>raise Exception(<EOL>'<STR_LIT>'<EOL>.format(file_name))<EOL>
Checks whether the file specified by file_name is stored in Google Cloud
Storage (GCS), if so, downloads the file and saves it locally. The full
path of the saved file will be returned. Otherwise the local file_name
will be returned immediately.

:param file_name: The full path of input file.
:type file_name: str
:return: The full path of local file.
:rtype: str