def _parse_periods(pattern):
 parts = pattern.split('..', 1)
 if (len(parts) == 1):
  instant = Period.parse(parts[0])
  return (instant, instant)
 else:
  start = Period.parse(parts[0])
  end = Period.parse(parts[1])
  return (start, end)

def _parse_periods ( pattern ) : parts = pattern . split ( '..' , 1 ) if ( len ( parts ) == 1 ) : instant = Period . parse ( parts [ 0 ] ) return ( instant , instant ) else : start = Period . parse ( parts [ 0 ] ) end = Period . parse ( parts [ 1 ] ) return ( start , end )
parse a string containing two dates separated by two dots .