code: def save_yaml_to_file(i):
      
  
      import yaml
  
      fn=i['yaml_file']
      d=i['dict']
  
      try:
         # If using just dump and keys are in unicode, 
         # pyyaml adds warning and makes produced yaml unparsable
         s=yaml.safe_dump(d) 
      except Exception as e:
         return {'return':1, 'error':'problem converting dict to YAML ('+format(e)+')'}
  
      return save_text_file({'text_file':fn, 'string':s})
docs: Input:  {
                yaml_file   - file name
                dict        - dict to save
              }
  
      Output: {
                return       - return code =  0, if successful
                                           >  0, if error
                (error)      - error text if return > 0
              }