code: def _call_init_upload(file_name, file_size, metadata, tags, project, samples_resource):
      
      upload_args = {
          "filename": file_name,
          "size": file_size,
          "upload_type": "standard",  # this is multipart form data
      }
  
      if metadata:
          # format metadata keys as snake case
          new_metadata = {}
  
          for md_key, md_val in metadata.items():
              new_metadata[snake_case(md_key)] = md_val
  
          upload_args["metadata"] = new_metadata
  
      if tags:
          upload_args["tags"] = tags
  
      if project:
          upload_args["project"] = getattr(project, "id", project)
  
      try:
          upload_info = samples_resource.init_upload(upload_args)
      except requests.exceptions.HTTPError as e:
          raise_api_error(e.response, state="init")
      except requests.exceptions.ConnectionError:
          raise_connectivity_error(file_name)
  
      return upload_info
docs: Call init_upload at the One Codex API and return data used to upload the file.
  
      Parameters
      ----------
      file_name : `string`
          The file_name you wish to associate this fastx file with at One Codex.
      file_size : `integer`
          Accurate size of file to be uploaded, in bytes.
      metadata : `dict`, optional
      tags : `list`, optional
      project : `string`, optional
          UUID of project to associate this sample with.
      samples_resource : `onecodex.models.Samples`
          Wrapped potion-client object exposing `init_upload` and `confirm_upload` routes to mainline.
  
      Returns
      -------
      `dict`
          Contains, at a minimum, 'upload_url' and 'sample_id'. Should also contain various additional
          data used to upload the file to fastx-proxy, a user's S3 bucket, or an intermediate bucket.