def _SharedPrefix(pattern1, pattern2):
 first_star1 = (pattern1 + '*').find('*')
 first_star2 = (pattern2 + '*').find('*')
 if ((first_star1, first_star2) != (len(pattern1), len(pattern2))):
  min_star = min(first_star1, first_star2)
  if (min_star and (pattern1[:min_star] == pattern2[:min_star])):
   return pattern1[:min_star]
 return ''

def _SharedPrefix ( pattern1 , pattern2 ) : first_star1 = ( pattern1 + '*' ) . find ( '*' ) first_star2 = ( pattern2 + '*' ) . find ( '*' ) if ( ( first_star1 , first_star2 ) != ( len ( pattern1 ) , len ( pattern2 ) ) ) : min_star = min ( first_star1 , first_star2 ) if ( min_star and ( pattern1 [ : min_star ] == pattern2 [ : min_star ] ) ) : return pattern1 [ : min_star ] return ''
returns the shared prefix of two patterns .