def resolve_patterns_path(patterns_path):
 if os.path.isabs(patterns_path):
  if os.path.exists(patterns_path):
   return patterns_path
  else:
   raise InvalidPatternsPathError('Absolute path does not exist.')
 else:
  patterns_path = os.path.join(MONITORDIR, patterns_path)
  if os.path.exists(patterns_path):
   return patterns_path
  else:
   raise InvalidPatternsPathError('Relative path does not exist.')

def resolve_patterns_path ( patterns_path ) : if os . path . isabs ( patterns_path ) : if os . path . exists ( patterns_path ) : return patterns_path else : raise InvalidPatternsPathError ( 'Absolute path does not exist.' ) else : patterns_path = os . path . join ( MONITORDIR , patterns_path ) if os . path . exists ( patterns_path ) : return patterns_path else : raise InvalidPatternsPathError ( 'Relative path does not exist.' )
resolve patterns_path to existing absolute local path or raise .