def get_regular_master(font):
if not font.masters:<EOL><INDENT>return None<EOL><DEDENT>regular_name = font.customParameters["<STR_LIT>"]<EOL>if regular_name is not None:<EOL><INDENT>for master in font.masters:<EOL><INDENT>if master.name == regular_name:<EOL><INDENT>return master<EOL><DEDENT><DEDENT><DEDENT>base_style = find_base_style(font.masters)<EOL>if not base_style:<EOL><INDENT>base_style = "<STR_LIT>"<EOL><DEDENT>for master in font.masters:<EOL><INDENT>if master.name == base_style:<EOL><INDENT>return master<EOL><DEDENT><DEDENT>for master in font.masters:<EOL><INDENT>name_without_regular = "<STR_LIT:U+0020>".join(<EOL>n for n in master.name.split("<STR_LIT:U+0020>") if n != "<STR_LIT>"<EOL>)<EOL>if name_without_regular == base_style:<EOL><INDENT>return master<EOL><DEDENT><DEDENT>return font.masters[<NUM_LIT:0>]<EOL>
Find the "regular" master among the GSFontMasters.

    Tries to find the master with the passed 'regularName'.
    If there is no such master or if regularName is None,
    tries to find a base style shared between all masters
    (defaulting to "Regular"), and then tries to find a master
    with that style name. If there is no master with that name,
    returns the first master in the list.