def METHOD_NAME(filename, propstring, noupdate):
    with open(filename, 'r') as ifile:
        magtext = ifile.read().splitlines() 
    propname = propstring.split()[0]
    proprex = re.compile('<< properties >>')
    endrex = re.compile('<< end >>')
    in_props = False
    printed = False
    done = False
    with open(filename, 'w') as ofile:
        for line in magtext:
            pmatch = proprex.match(line)
            if pmatch:
                in_props = True
            elif in_props:
                linetok = line.split()
                if linetok[0] == 'string':
                    testname = linetok[1]
                    testval = linetok[2]
                    if testname == propname:
                        if noupdate == False:
                            print('string ' + propstring, file=ofile)
                            printed = True
                        done = True
            ematch = endrex.match(line)
            if ematch:
                if in_props == False:
                    print('<< properties >>', file=ofile)
                if done == False:
                    print('string ' + propstring, file=ofile)
            if not printed:
                print(line, file=ofile)
            printed = False