def parse_and_load_contexts(contexts, schema=None, werr=False):
ctx = dict()<EOL>diff = None<EOL>if contexts:<EOL><INDENT>for ctx_path, ctx_type in concat(parse_filespec(c) for c in contexts):<EOL><INDENT>try:<EOL><INDENT>diff = load_context(ctx_path, ctx_type, scm=schema)<EOL>if diff is not None:<EOL><INDENT>merge(ctx, diff)<EOL><DEDENT><DEDENT>except (IOError, OSError, AttributeError):<EOL><INDENT>if werr:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return ctx<EOL>
:param contexts: list of context file specs
:param schema: JSON schema file in any formats anyconfig supports, to
    validate given context files
:param werr: Exit immediately if True and any errors occurrs
    while loading context files