/
githubmirror
/
ColossalAI
Обзор
Документация
Войти
/
githubmirror
/
ColossalAI
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/scripts/example_checks/detect_changed_example.py
24 строки
776 B
Hongxin Liu
[misc] update pre-commit and run all files (#4752)
19 сен 2023, 09:20
Не верифицирован
19 сен 2023, 09:20
079bf3c
Код
Авторство
О чём код?
import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument("-f", "--fileNameList", type=str, help="The list of changed files") args = parser.parse_args() name_list = args.fileNameList.split(":") folder_need_check = set() for loc in name_list: # Find only the sub-sub-folder of 'example' folder # the examples folder structure is like # - examples # - area # - application # - file if loc.split("/")[0] == "examples" and len(loc.split("/")) >= 4: folder_need_check.add("/".join(loc.split("/")[1:3])) # Output the result using print. Then the shell can get the values. print(list(folder_need_check)) if __name__ == "__main__": main()