<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_schema_file(db_version=1, db="mg_core", collection="materials"):
 """Get file with appropriate schema. :param db_version: Version of the database :type db_version: int :param db: Name of database, e.g. 'mg_core' :type db: str :param collection: Name of collection, e.g. 'materials' :type collection: str :return: File with schema :rtype: file :raise: IOError, if file is not found or not accessible """

    d = get_schema_dir(db_version=db_version)
    schemafile = "{}.{}.json".format(db, collection)
    f = open(os.path.join(d, schemafile), "r")
    return f