code: def dump_package_data(data, buf, format_=FileFormat.py, skip_attributes=None):
      
      if format_ == FileFormat.txt:
          raise ValueError("'txt' format not supported for packages.")
  
      data_ = dict((k, v) for k, v in data.iteritems() if v is not None)
      data_ = package_serialise_schema.validate(data_)
      skip = set(skip_attributes or [])
  
      items = []
      for key in package_key_order:
          if key not in skip:
              value = data_.pop(key, None)
              if value is not None:
                  items.append((key, value))
  
      # remaining are arbitrary keys
      for key, value in data_.iteritems():
          if key not in skip:
              items.append((key, value))
  
      dump_func = dump_functions[format_]
      dump_func(items, buf)
docs: Write package data to `buf`.
  
      Args:
          data (dict): Data source - must conform to `package_serialise_schema`.
          buf (file-like object): Destination stream.
          format_ (`FileFormat`): Format to dump data in.
          skip_attributes (list of str): List of attributes to not print.