parameters: (sym_list, out=None, names_only=False, filter=None)
docstring: Write a list of symbols to the file named by out.
docstring_summary: Write a list of symbols to the file named by out.
docstring_tokens: Write a list of symbols to the file named by out .
function: def write_syms(sym_list, out=None, names_only=False, filter=None):
      """
      Write a list of symbols to the file named by out.
      """
      out_str = ''
      out_list = sym_list
      out_list.sort(key=lambda x: x['name'])
      if filter is not None:
          out_list = filter(out_list)
      if names_only:
          out_list = [sym['name'] for sym in out_list]
      for sym in out_list:
          # Use pformat for consistent ordering of keys.
          out_str += pformat(sym, width=100000) + '\n'
      if out is None:
          sys.stdout.write(out_str)
      else:
          with open(out, 'w') as f:
              f.write(out_str)
function_tokens: def write_syms ( sym_list , out = None , names_only = False , filter = None ) : out_str = '' out_list = sym_list out_list . sort ( key = lambda x : x [ 'name' ] ) if filter is not None : out_list = filter ( out_list ) if names_only : out_list = [ sym [ 'name' ] for sym in out_list ] for sym in out_list : # Use pformat for consistent ordering of keys. out_str += pformat ( sym , width = 100000 ) + '\n' if out is None : sys . stdout . write ( out_str ) else : with open ( out , 'w' ) as f : f . write ( out_str )