def potential_domain_matches(domain):
 matches = [domain]
 try:
  start = (domain.index('.') + 1)
  end = domain.rindex('.')
  while (start < end):
   matches.append(domain[start:])
   start = (domain.index('.', start) + 1)
 except ValueError:
  pass
 return (matches + [('.' + d) for d in matches])

def potential_domain_matches ( domain ) : matches = [ domain ] try : start = ( domain . index ( '.' ) + 1 ) end = domain . rindex ( '.' ) while ( start < end ) : matches . append ( domain [ start : ] ) start = ( domain . index ( '.' , start ) + 1 ) except ValueError : pass return ( matches + [ ( '.' + d ) for d in matches ] )
potential domain matches for a cookie .