def is_safe_path_component(path):
 return (path and ('/' not in path) and (path not in ('.', '..')))

def is_safe_path_component ( path ) : return ( path and ( '/' not in path ) and ( path not in ( '.' , '..' ) ) )
check if path is a single component of a path .