def __init__(self, schemas, names=None):
    # Ensure valid ctor args
    if not isinstance(schemas, list):
      fail_msg = 'Union schema requires a list of schemas.'
      raise SchemaParseException(fail_msg)

    # Call parent ctor
    Schema.__init__(self, 'union')

    # Add class members
    schema_objects = []
    for schema in schemas:
      if isinstance(schema, basestring) and names.has_name(schema, None):
        new_schema = names.get_name(schema, None)
      else:
        try:
          new_schema = make_avsc_object(schema, names)
        except Exception, e:
          raise SchemaParseException('Union item must be a valid Avro schema: %s' % str(e))
      # check the new schema
      if (new_schema.type in VALID_TYPES and new_schema.type not in NAMED_TYPES
          and new_schema.type in [schema.type for schema in schema_objects]):
        raise SchemaParseException('%s type already in Union' % new_schema.type)
      elif new_schema.type == 'union':
        raise SchemaParseException('Unions cannot contain other unions.')
      else:
        schema_objects.append(new_schema)
    self._schemas = schema_objects

  # read-only properties
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/avro-1.7.6/src/avro/schema.py/UnionSchema.__init__/original