def is_cloaked(path, names):
 fname = unicoder(os.path.split(path)[1]).lower()
 fname = os.path.splitext(fname)[0]
 for name in names:
  name = os.path.split(name.lower())[1]
  (name, ext) = os.path.splitext(unicoder(name))
  if ((ext == u'.rar') and fname.startswith(name) and ((len(fname) - len(name)) < 8) and (len(names) < 3) and (not RE_SUBS.search(fname))):
   logging.debug('File %s is probably encrypted due to RAR with same name inside this RAR', fname)
   return True
  elif ('password' in name):
   logging.debug('RAR %s is probably encrypted: "password" in filename %s', fname, name)
   return True
 return False

def is_cloaked ( path , names ) : fname = unicoder ( os . path . split ( path ) [ 1 ] ) . lower ( ) fname = os . path . splitext ( fname ) [ 0 ] for name in names : name = os . path . split ( name . lower ( ) ) [ 1 ] ( name , ext ) = os . path . splitext ( unicoder ( name ) ) if ( ( ext == u'.rar' ) and fname . startswith ( name ) and ( ( len ( fname ) - len ( name ) ) < 8 ) and ( len ( names ) < 3 ) and ( not RE_SUBS . search ( fname ) ) ) : logging . debug ( 'File %s is probably encrypted due to RAR with same name inside this RAR' , fname ) return True elif ( 'password' in name ) : logging . debug ( 'RAR %s is probably encrypted: "password" in filename %s' , fname , name ) return True return False
return true if this is likely to be a cloaked encrypted post .