def _segment_pattern(indexname):
 return re.compile(('(_%s_[0-9]+)\\..*' % indexname))

def _segment_pattern ( indexname ) : return re . compile ( ( '(_%s_[0-9]+)\\..*' % indexname ) )
returns a regular expression object that matches segment filenames .