parameters: (src_url, src_obj_filestream,
                                      src_obj_size, dst_url, dst_obj_metadata,
                                      preconditions, gsutil_api, logger)
return_statement: return elapsed_time, uploaded_object
docstring: Uploads the file using a non-resumable strategy.
  
    Args:
      src_url: Source StorageUrl to upload.
      src_obj_filestream: File pointer to uploadable bytes.
      src_obj_size: Size of the source object.
      dst_url: Destination StorageUrl for the upload.
      dst_obj_metadata: Metadata for the target object.
      preconditions: Preconditions for the upload, if any.
      gsutil_api: gsutil Cloud API instance to use for the upload.
      logger: For outputting log messages.
  
    Returns:
      Elapsed upload time, uploaded Object with generation, md5, and size fields
      populated.
docstring_summary: Uploads the file using a non-resumable strategy.
docstring_tokens: Uploads the file using a non - resumable strategy .
function: def _UploadFileToObjectNonResumable(src_url, src_obj_filestream,
                                      src_obj_size, dst_url, dst_obj_metadata,
                                      preconditions, gsutil_api, logger):
    """Uploads the file using a non-resumable strategy.
  
    Args:
      src_url: Source StorageUrl to upload.
      src_obj_filestream: File pointer to uploadable bytes.
      src_obj_size: Size of the source object.
      dst_url: Destination StorageUrl for the upload.
      dst_obj_metadata: Metadata for the target object.
      preconditions: Preconditions for the upload, if any.
      gsutil_api: gsutil Cloud API instance to use for the upload.
      logger: For outputting log messages.
  
    Returns:
      Elapsed upload time, uploaded Object with generation, md5, and size fields
      populated.
    """
    progress_callback = FileProgressCallbackHandler(
        ConstructAnnounceText('Uploading', dst_url.url_string), logger).call
    if global_copy_helper_opts.test_callback_file:
      with open(global_copy_helper_opts.test_callback_file, 'rb') as test_fp:
        progress_callback = pickle.loads(test_fp.read()).call
    start_time = time.time()
  
    if src_url.IsStream():
      # TODO: gsutil-beta: Provide progress callbacks for streaming uploads.
      uploaded_object = gsutil_api.UploadObjectStreaming(
          src_obj_filestream, object_metadata=dst_obj_metadata,
          canned_acl=global_copy_helper_opts.canned_acl,
          preconditions=preconditions, progress_callback=progress_callback,
          provider=dst_url.scheme, fields=UPLOAD_RETURN_FIELDS)
    else:
      uploaded_object = gsutil_api.UploadObject(
          src_obj_filestream, object_metadata=dst_obj_metadata,
          canned_acl=global_copy_helper_opts.canned_acl, size=src_obj_size,
          preconditions=preconditions, progress_callback=progress_callback,
          provider=dst_url.scheme, fields=UPLOAD_RETURN_FIELDS)
    end_time = time.time()
    elapsed_time = end_time - start_time
  
    return elapsed_time, uploaded_object
function_tokens: def _UploadFileToObjectNonResumable ( src_url , src_obj_filestream , src_obj_size , dst_url , dst_obj_metadata , preconditions , gsutil_api , logger ) : progress_callback = FileProgressCallbackHandler ( ConstructAnnounceText ( 'Uploading' , dst_url . url_string ) , logger ) . call if global_copy_helper_opts . test_callback_file : with open ( global_copy_helper_opts . test_callback_file , 'rb' ) as test_fp : progress_callback = pickle . loads ( test_fp . read ( ) ) . call start_time = time . time ( ) if src_url . IsStream ( ) : # TODO: gsutil-beta: Provide progress callbacks for streaming uploads. uploaded_object = gsutil_api . UploadObjectStreaming ( src_obj_filestream , object_metadata = dst_obj_metadata , canned_acl = global_copy_helper_opts . canned_acl , preconditions = preconditions , progress_callback = progress_callback , provider = dst_url . scheme , fields = UPLOAD_RETURN_FIELDS ) else : uploaded_object = gsutil_api . UploadObject ( src_obj_filestream , object_metadata = dst_obj_metadata , canned_acl = global_copy_helper_opts . canned_acl , size = src_obj_size , preconditions = preconditions , progress_callback = progress_callback , provider = dst_url . scheme , fields = UPLOAD_RETURN_FIELDS ) end_time = time . time ( ) elapsed_time = end_time - start_time return elapsed_time , uploaded_object