code: def expand_defaults(schema, features):
    
  
    schema_names = [x['name'] for x in schema]
  
    # Add missing source columns
    for name, transform in six.iteritems(features):
      if 'source_column' not in transform:
        transform['source_column'] = name
  
    # Check source columns are in the schema and collect which are used.
    used_schema_columns = []
    for name, transform in six.iteritems(features):
      if transform['source_column'] not in schema_names:
        raise ValueError('source column %s is not in the schema for transform %s'
                         % (transform['source_column'], name))
      used_schema_columns.append(transform['source_column'])
  
    # Update default transformation based on schema.
    for col_schema in schema:
      schema_name = col_schema['name']
      schema_type = col_schema['type'].lower()
  
      if schema_type not in constant.NUMERIC_SCHEMA + [constant.STRING_SCHEMA]:
        raise ValueError(('Only the following schema types are supported: %s'
                          % ' '.join(constant.NUMERIC_SCHEMA + [constant.STRING_SCHEMA])))
  
      if schema_name not in used_schema_columns:
        # add the default transform to the features
        if schema_type in constant.NUMERIC_SCHEMA:
          features[schema_name] = {
              'transform': constant.DEFAULT_NUMERIC_TRANSFORM,
              'source_column': schema_name}
        elif schema_type == constant.STRING_SCHEMA:
          features[schema_name] = {
              'transform': constant.DEFAULT_CATEGORICAL_TRANSFORM,
              'source_column': schema_name}
        else:
          raise NotImplementedError('Unknown type %s' % schema_type)
docs: Add to features any default transformations.
  
    Not every column in the schema has an explicit feature transformation listed
    in the featurs file. For these columns, add a default transformation based on
    the schema's type. The features dict is modified by this function call.
  
    After this function call, every column in schema is used in a feature, and
    every feature uses a column in the schema.
  
    Args:
      schema: schema list
      features: features dict
  
    Raises:
      ValueError: if transform cannot be applied given schema type.