def get_constr(module_str, start, end):
    """Extract and return the constructor string from module_str[start:end];
  also return the first position past the constructor string."""
    constr_start = start
    while module_str[constr_start] == ' ':
        constr_start += 1
    if module_str.find('(', start, end) != -1:
        bracket_idx = module_str.find(')', start, end)
        constr = module_str[constr_start:bracket_idx + 1]
        l = bracket_idx + 1
    else:
        l = constr_start
        while l < end and module_str[l] != ' ':
            l += 1
        constr = module_str[constr_start:l]
    return constr, l
