code: def get_rulesets(ruledir, recurse):
      
      if os.path.isdir(ruledir) and recurse:
          yaml_files = [y for x in os.walk(ruledir) for y in glob(os.path.join(x[0], '*.yaml'))]
      elif os.path.isdir(ruledir) and not recurse:
          yaml_files = get_files(ruledir, 'yaml')
      elif os.path.isfile(ruledir):
          yaml_files = [ruledir]
      extracted_files = extract_yaml(yaml_files)
      rulesets = []
      for extracted_yaml in extracted_files:
          rulesets.append(ruleset.Ruleset(extracted_yaml))
      return rulesets
docs: List of ruleset objects extracted from the yaml directory