<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Populate local MDCS instance with student data and metadata
Import MDCS API tool module
Step1:  Host and user information
Step2:  List of file prefixes for micrograph images and XML metadata
Step3:  For each name in the list
<ASSISTANT_TASK:>
Python Code:
import mdcs
Explanation: Populate local MDCS instance with student data and metadata
Import MDCS API tool module
End of explanation
user='admin'
pswd='admin'
host='http://127.0.0.1:8000'
template_name='TEM-Tutorial'
Explanation: Host and user information
End of explanation
name_list=[
    "Al6061_DF_343C",
    "Al6061_SAED_343C",
    "Al6061-BF-343C",
    "CoAl-W-900-1000h-SAED",
    "CoAlW-900-1000h",
    "TRIP700-750C-carbide-SAED",
    "TRIP700-carbide-750C-DF",
    "TRIP700-Wferrite-750C"]
Explanation: List of file prefixes for micrograph images and XML metadata
End of explanation
for name in name_list:
    xml_name=name+".xml"
    jpg_name=name+".jpg"
    
    print "Uploading:",jpg_name
    url = mdcs.blob.upload(jpg_name,host,user,pswd)
    
    print "Reading:",xml_name
    with open(xml_name, 'r') as f: 
        content = f.read()
    content = content.replace("http://127.0.0.1:8000/rest/blob?id=REPLACE-ME-BLOB-ID",url)
    
    print "Uploading:",xml_name
    response = mdcs.curate_as(xml_name,name,host,user,pswd,template_title=template_name,content=content)
    print "Response:",response
Explanation: For each name in the list:
Upload micrograph
Read XML metadata
Replace generic URL with unique URL for micrograph
Upload XML metadata record
End of explanation
<END_TASK>