def METHOD_NAME(mat_name):
    """Returns material of mat_name, create new one if required"""
    if mat_name not in bpy.data.materials:
        bpy.data.materials.new(mat_name)
    return bpy.data.materials[mat_name]