code: def merge(configuration, locale, target='django.po', sources=('django-partial.po',), fail_if_missing=True):
      
      LOG.info('Merging %s locale %s', target, locale)
      locale_directory = configuration.get_messages_dir(locale)
      try:
          validate_files(locale_directory, sources)
      except Exception:  # pylint: disable=broad-except
          if not fail_if_missing:
              return
          raise
  
      # merged file is merged.po
      merge_cmd = 'msgcat -o merged.po ' + ' '.join(sources)
      execute(merge_cmd, working_directory=locale_directory)
  
      # clean up redunancies in the metadata
      merged_filename = locale_directory.joinpath('merged.po')
      duplicate_entries = clean_pofile(merged_filename)
  
      # rename merged.po -> django.po (default)
      target_filename = locale_directory.joinpath(target)
      os.rename(merged_filename, target_filename)
  
      # Write duplicate messages to a file
      if duplicate_entries:
          dup_file = target_filename.replace(".po", ".dup")
          with codecs.open(dup_file, "w", encoding="utf8") as dfile:
              for (entry, translations) in duplicate_entries:
                  dfile.write(u"{}\n".format(entry))
                  dfile.write(u"Translations found were:\n\t{}\n\n".format(translations))
          LOG.warning(" %s duplicates in %s, details in .dup file", len(duplicate_entries), target_filename)
docs: For the given locale, merge the `sources` files to become the `target`
      file.  Note that the target file might also be one of the sources.
  
      If fail_if_missing is true, and the files to be merged are missing,
      throw an Exception, otherwise return silently.
  
      If fail_if_missing is false, and the files to be merged are missing,
      just return silently.