def match_ts(file):
 match = TS_RE.search(file)
 if (not match):
  return (False, '', 0)
 num = int(match.group(1))
 try:
  set = file[:match.start()]
  set += '.ts'
 except:
  set = ''
 return (match, set, num)

def match_ts ( file ) : match = TS_RE . search ( file ) if ( not match ) : return ( False , '' , 0 ) num = int ( match . group ( 1 ) ) try : set = file [ : match . start ( ) ] set += '.ts' except : set = '' return ( match , set , num )
return true if file is a joinable ts file .