<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dump_package_data(data, buf, format_=FileFormat.py, skip_attributes=None):
 """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. """

    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)