def _MakeTempFile(self, file_size=0, mem_metadata=False,
                    mem_data=False, prefix='gsutil_test_file'):
    fd, fpath = tempfile.mkstemp(suffix='.bin', prefix=prefix,
                                 dir=self.directory, text=False)
    with os.fdopen(fd, 'wb') as fp:
      random_bytes = os.urandom(min(file_size,
                                    self.MAX_UNIQUE_RANDOM_BYTES))
      total_bytes_written = 0
      while total_bytes_written < file_size:
        num_bytes = min(self.MAX_UNIQUE_RANDOM_BYTES,
                        file_size - total_bytes_written)
        fp.write(random_bytes[:num_bytes])
        total_bytes_written += num_bytes

    if mem_metadata or mem_data:
      with open(fpath, 'rb') as fp:
        file_size = GetFileSize(fp) if mem_metadata else None
        md5 = CalculateB64EncodedMd5FromContents(fp) if mem_metadata else None
        data = fp.read() if mem_data else None
        temp_file_dict[fpath] = FileDataTuple(file_size, md5, data)

    self.temporary_files.add(fpath)
    return fpath
Decrypt given message with shared key.
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/commands/perfdiag.py/PerfDiagCommand._MakeTempFile--crossover with--dataset/ETHPy150Open sophron/BAR/bar/common/aes.py/aes_decrypt