def get_branches(aliases):
    """Get unique branch names from an alias dictionary."""

    ignore = ['pow', 'log10', 'sqrt', 'max']
    branches = []
    for k, v in aliases.items():

        tokens = re.sub('[\(\)\+\*\/\,\=\<\>\&\!\-\|]', ' ', v).split()

        for t in tokens:

            if bool(re.search(r'^\d', t)) or len(t) <= 3:
                continue

            if bool(re.search(r'[a-zA-Z]', t)) and t not in ignore:
                branches += [t]

    return list(set(branches))
def get_branches ( aliases ) : ignore = [ 'pow' , 'log10' , 'sqrt' , 'max' ] branches = [ ] for k , v in aliases . items ( ) : tokens = re . sub ( '[\(\)\+\*\/\,\=\<\>\&\!\-\|]' , ' ' , v ) . split ( ) for t in tokens : if bool ( re . search ( r'^\d' , t ) ) or len ( t ) <= 3 : continue if bool ( re . search ( r'[a-zA-Z]' , t ) ) and t not in ignore : branches += [ t ] return list ( set ( branches ) )
Get unique branch names from an alias dictionary.