docs: def write_contents_to_file(self, entities, path_patterns=None,
                                 contents=None, link_to=None,
                                 content_mode='text', conflicts='fail',
                                 strict=False):
          """
          Write arbitrary data to a file defined by the passed entities and
          path patterns.
  
          Args:
              entities (dict): A dictionary of entities, with Entity names in
                  keys and values for the desired file in values.
              path_patterns (list): Optional path patterns to use when building
                  the filename. If None, the Layout-defined patterns will be
                  used.
              contents (object): Contents to write to the generate file path.
                  Can be any object serializable as text or binary data (as
                  defined in the content_mode argument).
              link_to (str): Optional path with which to create a symbolic link
                  to. Used as an alternative to and takes priority over the
                  contents argument.
              conflicts (str):  Defines the desired action when the output path
                  already exists. Must be one of:
                      'fail': raises an exception
                      'skip' does nothing
                      'overwrite': overwrites the existing file
                      'append': adds  a suffix to each file copy, starting with 1
              strict (bool): If True, all entities must be matched inside a
                  pattern in order to be a valid match. If False, extra entities
          """
          path = self.build_path(entities, path_patterns, strict)
  
          if path is None:
              raise ValueError("Cannot construct any valid filename for "
                               "the passed entities given available path "
                               "patterns.")
  
          write_contents_to_file(path, contents=contents, link_to=link_to,
                                 content_mode=content_mode, conflicts=conflicts,
                                 root=self.root)