code: def test_add_mimetypes(path=None):
      ds = Dataset(path).create(force=True)
      ds.repo.add(".gitattributes")
      ds.repo.commit("added attributes to git explicitly")
      # now test that those files will go into git/annex correspondingly
      # WINDOWS FAILURE NEXT
      __not_tested__ = ds.save(["file.txt", "empty"])
      assert_repo_status(path, untracked=["file2.txt"])
      # But we should be able to force adding file to annex when desired
      ds.save("file2.txt", to_git=False)
      # check annex file status
      annexinfo = ds.repo.get_content_annexinfo()
      for path, in_annex in (
          # Empty one considered to be  application/octet-stream
          # i.e. non-text
          ("empty", True),
          ("file.txt", False),
          ("file2.txt", True),
      ):
          # low-level API report -> repo path reference, no ds path
          p = ds.repo.pathobj / path
          assert_in(p, annexinfo)
          if in_annex:
              assert_in("key", annexinfo[p], p)
          else:
              assert_not_in("key", annexinfo[p], p)
  
imports: import itertools
  import logging
  import os
  import os.path
  import pytest
  import datalad.utils
  from datalad.api import create, install, save
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, OBSCURE_FILENAME, SkipTest, assert_in, assert_in_results, assert_not_in, assert_raises, assert_repo_status, assert_result_count, assert_status, chpwd, create_tree, eq_, known_failure, known_failure_windows, maybe_adjust_repo, neq_, ok_, patch, skip_if_adjusted_branch, skip_wo_symlink_capability, swallow_logs, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import Path, ensure_list, rmtree
label_desc: Use image node_id 14 for calling a global function with example usage: test_add_mimetypes(path) without return types