def yml_or_yaml_path(basedir, basename):
 basepath = os.path.join(basedir, basename)
 yml_path = (basepath + '.yml')
 yaml_path = (basepath + '.yaml')
 if os.path.exists(yaml_path):
  if os.path.exists(yml_path):
   raise ValueError('Both {0} and {1} exist.'.format(yml_path, yaml_path))
  return yaml_path
 return yml_path

def yml_or_yaml_path ( basedir , basename ) : basepath = os . path . join ( basedir , basename ) yml_path = ( basepath + '.yml' ) yaml_path = ( basepath + '.yaml' ) if os . path . exists ( yaml_path ) : if os . path . exists ( yml_path ) : raise ValueError ( 'Both {0} and {1} exist.' . format ( yml_path , yaml_path ) ) return yaml_path return yml_path
return a path to the requested yaml file .