parameters: (x, safe_dict=None)
docstring: Used to serialize an extra_vars dict to YAML
  
      By default, extra vars are marked as `!unsafe` in the generated yaml
      _unless_ they've been deemed "trusted" (meaning, they likely were set/added
      by a user with a high level of privilege).
  
      This function allows you to pass in a trusted `safe_dict` to allow
      certain extra vars so that they are _not_ marked as `!unsafe` in the
      resulting YAML.  Anything _not_ in this dict will automatically be
      `!unsafe`.
  
      safe_dump({'a': 'b', 'c': 'd'}) ->
      !unsafe 'a': !unsafe 'b'
      !unsafe 'c': !unsafe 'd'
  
      safe_dump({'a': 'b', 'c': 'd'}, safe_dict={'a': 'b'})
      a: b
      !unsafe 'c': !unsafe 'd'
docstring_summary: Used to serialize an extra_vars dict to YAML
docstring_tokens: Used to serialize an extra_vars dict to YAML
function: def safe_dump(x, safe_dict=None):
      """
      Used to serialize an extra_vars dict to YAML
  
      By default, extra vars are marked as `!unsafe` in the generated yaml
      _unless_ they've been deemed "trusted" (meaning, they likely were set/added
      by a user with a high level of privilege).
  
      This function allows you to pass in a trusted `safe_dict` to allow
      certain extra vars so that they are _not_ marked as `!unsafe` in the
      resulting YAML.  Anything _not_ in this dict will automatically be
      `!unsafe`.
  
      safe_dump({'a': 'b', 'c': 'd'}) ->
      !unsafe 'a': !unsafe 'b'
      !unsafe 'c': !unsafe 'd'
  
      safe_dump({'a': 'b', 'c': 'd'}, safe_dict={'a': 'b'})
      a: b
      !unsafe 'c': !unsafe 'd'
      """
      if isinstance(x, dict):
          yamls = []
          safe_dict = safe_dict or {}
  
          # Compare the top level keys so that we can find values that have
          # equality matches (and consider those branches safe)
          for k, v in x.items():
              dumper = yaml.SafeDumper
              if k not in safe_dict or safe_dict.get(k) != v:
                  dumper = SafeStringDumper
              yamls.append(
                  yaml.dump_all(
                      [{k: v}],
                      None,
                      Dumper=dumper,
                      default_flow_style=False,
                  )
              )
          return ''.join(yamls)
      else:
          return yaml.dump_all([x], None, Dumper=SafeStringDumper, default_flow_style=False)
function_tokens: def safe_dump ( x , safe_dict = None ) : if isinstance ( x , dict ) : yamls = [ ] safe_dict = safe_dict or { } # Compare the top level keys so that we can find values that have # equality matches (and consider those branches safe) for k , v in x . items ( ) : dumper = yaml . SafeDumper if k not in safe_dict or safe_dict . get ( k ) != v : dumper = SafeStringDumper yamls . append ( yaml . dump_all ( [ { k : v } ] , None , Dumper = dumper , default_flow_style = False , ) ) return '' . join ( yamls ) else : return yaml . dump_all ( [ x ] , None , Dumper = SafeStringDumper , default_flow_style = False )