diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9a4405ac3..2844b802cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,6 +64,16 @@ repos: require_serial: true # Print the number of files as a sanity-check verbose: true + - id: check-license-headers + name: check license headers + entry: python ./scripts/pre-commit-license-check.py + language: python + types: [python] + exclude: | + (?x)^( + notebook/.* | + website/.* + )$ - repo: https://github.com/nbQA-dev/nbQA rev: 1.8.5 hooks: diff --git a/autogen/agentchat/contrib/captainagent.py b/autogen/agentchat/contrib/captainagent.py index fc89e1ca31..3e15d576d1 100644 --- a/autogen/agentchat/contrib/captainagent.py +++ b/autogen/agentchat/contrib/captainagent.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 import hashlib import json import os diff --git a/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py b/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py index ccd51d3d93..1dc17b52bc 100644 --- a/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py +++ b/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def calculate_correlation(csv_path: str, column1: str, column2: str, method: str = "pearson") -> float: """ Calculate the correlation between two columns in a CSV file. diff --git a/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py b/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py index 4b1737fe02..9862dcaff0 100644 --- a/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py +++ b/autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def calculate_skewness_and_kurtosis(csv_file: str, column_name: str) -> tuple: """ Calculate the skewness and kurtosis of a specified column in a CSV file. The kurtosis is calculated using the Fisher definition. diff --git a/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py b/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py index 1fcb493224..07ebe80689 100644 --- a/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py +++ b/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def detect_outlier_iqr(csv_file: str, column_name: str): """ Detect outliers in a specified column of a CSV file using the IQR method. diff --git a/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py b/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py index ec0f8742da..2e35f37807 100644 --- a/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py +++ b/autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def detect_outlier_zscore(csv_file, column_name, threshold=3): """ Detect outliers in a CSV file based on a specified column. The outliers are determined by calculating the z-score of the data points in the column. diff --git a/autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py b/autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py index 6e233c05db..a433ba397f 100644 --- a/autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py +++ b/autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def explore_csv(file_path, num_lines=5): """ Reads a CSV file and prints the column names, shape, data types, and the first few lines of data. diff --git a/autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py b/autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py index 0d2f51f3a5..90212e6a97 100644 --- a/autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py +++ b/autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py index 53fbff94fd..3900e8a5fd 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 import arxiv from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py index 7a62143dc0..256b4bf3fe 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 import arxiv from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py index 4b2ffd03d4..1b624d394c 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 import os from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py index 01ff60bdc5..267990c936 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py index 8c21b9a656..b44bba63e0 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def get_wikipedia_text(title): """ Retrieves the text content of a Wikipedia page. It does not support tables and other complex formatting. diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py index 56fe2a5b68..33f594093e 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 # alternative api: https://rapidapi.com/omarmhaimdat/api/youtube-v2 diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py index 6f28c36cdc..24fce8edf1 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 import os from PIL import Image diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py index 2a641a0f6a..64714d89dd 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 import os from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py index f6a3b4b5ea..3a39a9b567 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def perform_web_search(query, count=10, offset=0): """ Perform a web search using Bing API. diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py index 6fb24d7e17..913d2a6a20 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def scrape_wikipedia_tables(url: str, header_keyword: str): """ Scrapes Wikipedia tables based on a given URL and header keyword. diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py index c9a7d79d75..dabdb1d060 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py index 0bc89d3074..a4d472c423 100644 --- a/autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py +++ b/autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def youtube_download(url: str): """ Downloads a YouTube video and returns the download link. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py b/autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py index ebf1601dcc..9d670fc535 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py b/autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py index ef1c2d8756..5a6b9b7b1a 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def calculate_day_of_the_week(total_days: int, starting_day: str): """ Calculates the day of the week after a given number of days starting from a specified day. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py b/autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py index 819fb40be7..60eb214fdc 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def calculate_fraction_sum( fraction1_numerator: int, fraction1_denominator: int, fraction2_numerator: int, fraction2_denominator: int ): diff --git a/autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py b/autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py index 6c00e0de21..0561a68bc3 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py b/autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py index d575803c82..a86852bfdb 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def calculate_reflected_point(point): """ Calculates the reflection point of a given point about the line y=x. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py b/autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py index 49194dacb6..e4d8171d08 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py b/autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py index fc90eecb23..51810fb5c4 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 from autogen.coding.func_with_reqs import with_requirements diff --git a/autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py b/autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py index 9b3f77c812..91d3fdf906 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def count_distinct_permutations(sequence): """ Counts the number of distinct permutations of a sequence where items may be indistinguishable. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py b/autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py index 6f2a2f6aac..dfac1eadf1 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def evaluate_expression(expression): """ Evaluates a mathematical expression with support for floor function notation and power notation. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py b/autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py index f6f7844c98..d311f0469e 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def find_continuity_point(f_leq, f_gt, x_value): """ Find the value 'a' that ensures the continuity of a piecewise function at a given point. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py b/autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py index e6bacd42a4..06f64b5ec0 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def fraction_to_mixed_numbers(numerator, denominator): """ Simplifies a fraction to its lowest terms and returns it as a mixed number. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py b/autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py index bf75b963e9..c4ef5cb0d3 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def modular_inverse_sum(expressions, modulus): """ Calculates the sum of modular inverses of the given expressions modulo the specified modulus. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py b/autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py index 5f11ec279a..e70d54b995 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def simplify_mixed_numbers(numerator1, denominator1, numerator2, denominator2, whole_number1, whole_number2): """ Simplifies the sum of two mixed numbers and returns the result as a string in the format 'a b/c'. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py b/autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py index 9710eff4f2..eb63ccadcf 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def sum_of_digit_factorials(number): """ Calculates the sum of the factorial of each digit in a number, often used in problems involving curious numbers like 145. diff --git a/autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py b/autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py index abed34f645..b57a8e7572 100644 --- a/autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py +++ b/autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 def sum_of_primes_below(threshold): """ Calculates the sum of all prime numbers below a given threshold. diff --git a/autogen/agentchat/contrib/graph_rag/document.py b/autogen/agentchat/contrib/graph_rag/document.py index 9730269c7a..1ee116c716 100644 --- a/autogen/agentchat/contrib/graph_rag/document.py +++ b/autogen/agentchat/contrib/graph_rag/document.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT from dataclasses import dataclass from enum import Enum, auto from typing import Optional diff --git a/autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py b/autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py index 0bb1f51a05..64453b5307 100644 --- a/autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py +++ b/autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT import os from dataclasses import field from typing import List diff --git a/autogen/agentchat/contrib/graph_rag/graph_query_engine.py b/autogen/agentchat/contrib/graph_rag/graph_query_engine.py index ca29fa165c..7f533fe98b 100644 --- a/autogen/agentchat/contrib/graph_rag/graph_query_engine.py +++ b/autogen/agentchat/contrib/graph_rag/graph_query_engine.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT from dataclasses import dataclass, field from typing import List, Optional, Protocol diff --git a/autogen/agentchat/contrib/graph_rag/graph_rag_capability.py b/autogen/agentchat/contrib/graph_rag/graph_rag_capability.py index b6412305e0..2819bcee8a 100644 --- a/autogen/agentchat/contrib/graph_rag/graph_rag_capability.py +++ b/autogen/agentchat/contrib/graph_rag/graph_rag_capability.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT from autogen.agentchat.contrib.capabilities.agent_capability import AgentCapability from autogen.agentchat.conversable_agent import ConversableAgent diff --git a/autogen/agentchat/contrib/tool_retriever.py b/autogen/agentchat/contrib/tool_retriever.py index 1752fbe19c..daa32c4364 100644 --- a/autogen/agentchat/contrib/tool_retriever.py +++ b/autogen/agentchat/contrib/tool_retriever.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT import importlib.util import inspect import os diff --git a/autogen/coding/base.py b/autogen/coding/base.py index 8732bbf153..57af08ac5c 100644 --- a/autogen/coding/base.py +++ b/autogen/coding/base.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from __future__ import annotations diff --git a/autogen/coding/docker_commandline_code_executor.py b/autogen/coding/docker_commandline_code_executor.py index bfcc15cb98..2576f28ed7 100644 --- a/autogen/coding/docker_commandline_code_executor.py +++ b/autogen/coding/docker_commandline_code_executor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from __future__ import annotations diff --git a/autogen/coding/factory.py b/autogen/coding/factory.py index f36e127cc6..903ec479ea 100644 --- a/autogen/coding/factory.py +++ b/autogen/coding/factory.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from .base import CodeExecutionConfig, CodeExecutor diff --git a/autogen/coding/func_with_reqs.py b/autogen/coding/func_with_reqs.py index 4b098749ea..7a755ffdce 100644 --- a/autogen/coding/func_with_reqs.py +++ b/autogen/coding/func_with_reqs.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from __future__ import annotations diff --git a/autogen/coding/jupyter/base.py b/autogen/coding/jupyter/base.py index 9236d0c015..335d1828dc 100644 --- a/autogen/coding/jupyter/base.py +++ b/autogen/coding/jupyter/base.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from dataclasses import dataclass from typing import Optional, Protocol, runtime_checkable diff --git a/autogen/coding/jupyter/docker_jupyter_server.py b/autogen/coding/jupyter/docker_jupyter_server.py index 301e614a94..2a73a7b307 100644 --- a/autogen/coding/jupyter/docker_jupyter_server.py +++ b/autogen/coding/jupyter/docker_jupyter_server.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from __future__ import annotations diff --git a/autogen/coding/jupyter/embedded_ipython_code_executor.py b/autogen/coding/jupyter/embedded_ipython_code_executor.py index aa19d81dec..09e4a06043 100644 --- a/autogen/coding/jupyter/embedded_ipython_code_executor.py +++ b/autogen/coding/jupyter/embedded_ipython_code_executor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import base64 import json diff --git a/autogen/coding/jupyter/jupyter_client.py b/autogen/coding/jupyter/jupyter_client.py index 62242bae39..e1df947969 100644 --- a/autogen/coding/jupyter/jupyter_client.py +++ b/autogen/coding/jupyter/jupyter_client.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from __future__ import annotations diff --git a/autogen/coding/jupyter/jupyter_code_executor.py b/autogen/coding/jupyter/jupyter_code_executor.py index 5d076f652b..862885d797 100644 --- a/autogen/coding/jupyter/jupyter_code_executor.py +++ b/autogen/coding/jupyter/jupyter_code_executor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import base64 import json diff --git a/autogen/coding/jupyter/local_jupyter_server.py b/autogen/coding/jupyter/local_jupyter_server.py index 85bba86bc3..6aa1378313 100644 --- a/autogen/coding/jupyter/local_jupyter_server.py +++ b/autogen/coding/jupyter/local_jupyter_server.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from __future__ import annotations diff --git a/autogen/coding/local_commandline_code_executor.py b/autogen/coding/local_commandline_code_executor.py index 8a2ad541d6..889182bfb1 100644 --- a/autogen/coding/local_commandline_code_executor.py +++ b/autogen/coding/local_commandline_code_executor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import logging import os diff --git a/autogen/coding/markdown_code_extractor.py b/autogen/coding/markdown_code_extractor.py index 4ae3ff1a8b..01dda0df52 100644 --- a/autogen/coding/markdown_code_extractor.py +++ b/autogen/coding/markdown_code_extractor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import re from typing import Any, Dict, List, Optional, Union diff --git a/autogen/coding/utils.py b/autogen/coding/utils.py index 6beb5c34ef..122c41861f 100644 --- a/autogen/coding/utils.py +++ b/autogen/coding/utils.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/ag2ai/ag2 are under the MIT License. # SPDX-License-Identifier: MIT # Will return the filename relative to the workspace path import re diff --git a/autogen/oai/bedrock.py b/autogen/oai/bedrock.py index a7bf2d8325..d9355489c1 100644 --- a/autogen/oai/bedrock.py +++ b/autogen/oai/bedrock.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT """ Create a compatible client for the Amazon Bedrock Converse API. diff --git a/autogen/oai/cerebras.py b/autogen/oai/cerebras.py index 4cdec20b90..eeefd79027 100644 --- a/autogen/oai/cerebras.py +++ b/autogen/oai/cerebras.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT """Create an OpenAI-compatible client using Cerebras's API. Example: diff --git a/autogen/oai/ollama.py b/autogen/oai/ollama.py index baf5e3450a..6ae0e5b549 100644 --- a/autogen/oai/ollama.py +++ b/autogen/oai/ollama.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT """Create an OpenAI-compatible client using Ollama's API. Example: diff --git a/scripts/pre-commit-license-check.py b/scripts/pre-commit-license-check.py new file mode 100644 index 0000000000..93ba54c2be --- /dev/null +++ b/scripts/pre-commit-license-check.py @@ -0,0 +1,59 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +#!/usr/bin/env python3 +import re +import sys +from pathlib import Path + +REQUIRED_ELEMENTS = [r"Copyright.*Owners of https://github\.com/ag2ai", r"SPDX-License-Identifier: Apache-2\.0"] + + +def should_check_file(file_path: Path) -> bool: + # Skip __init__.py files + return file_path.name != "__init__.py" + + +def check_file_header(file_path): + with open(file_path, "r", encoding="utf-8") as f: + # Read first few lines of the file + content = f.read(500) + + # Check if all required elements are present near the start of the file + missing_elements = [] + for pattern in REQUIRED_ELEMENTS: + if not re.search(pattern, content[:500], re.IGNORECASE): + missing_elements.append(pattern) + + return missing_elements + + +def main(): + failed = False + for py_file in Path(".").rglob("*.py"): + if not should_check_file(py_file): + continue + + missing_elements = check_file_header(py_file) + if missing_elements: + failed = True + print(f"\nIncomplete or missing license header in: {py_file}") + print( + "\nSee https://ag2ai.github.io/ag2/docs/contributor-guide/contributing/#license-headers for guidance." + ) + + """ + # For more detailed output: + print("Missing required elements:") + for element in missing_elements: + print(f" - {element}") + print("\nHeader should contain:") + print(" 1. Copyright notice with 'Owners of https://github.com/ag2ai'") + print(" 2. SPDX-License-Identifier: Apache-2.0") + """ + + sys.exit(1 if failed else 0) + + +if __name__ == "__main__": + main() diff --git a/test/agentchat/contrib/graph_rag/test_falkor_graph_rag.py b/test/agentchat/contrib/graph_rag/test_falkor_graph_rag.py index 5b61454e9e..8c22edb846 100644 --- a/test/agentchat/contrib/graph_rag/test_falkor_graph_rag.py +++ b/test/agentchat/contrib/graph_rag/test_falkor_graph_rag.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT import sys import pytest diff --git a/test/agentchat/contrib/graph_rag/test_graph_rag_basic.py b/test/agentchat/contrib/graph_rag/test_graph_rag_basic.py index 7c4a509494..d30d528bf3 100644 --- a/test/agentchat/contrib/graph_rag/test_graph_rag_basic.py +++ b/test/agentchat/contrib/graph_rag/test_graph_rag_basic.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT from unittest.mock import Mock from autogen.agentchat.contrib.graph_rag.graph_query_engine import GraphQueryEngine diff --git a/test/agentchat/contrib/test_captainagent.py b/test/agentchat/contrib/test_captainagent.py index 864980e746..c8a554aae4 100644 --- a/test/agentchat/contrib/test_captainagent.py +++ b/test/agentchat/contrib/test_captainagent.py @@ -1,3 +1,6 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 import os import re import sys diff --git a/test/coding/test_commandline_code_executor.py b/test/coding/test_commandline_code_executor.py index 39f34bb75e..db29500e95 100644 --- a/test/coding/test_commandline_code_executor.py +++ b/test/coding/test_commandline_code_executor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import os import shutil diff --git a/test/coding/test_embedded_ipython_code_executor.py b/test/coding/test_embedded_ipython_code_executor.py index d09b68aee5..e009981779 100644 --- a/test/coding/test_embedded_ipython_code_executor.py +++ b/test/coding/test_embedded_ipython_code_executor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import os import sys diff --git a/test/coding/test_factory.py b/test/coding/test_factory.py index 786c566c8c..80b211a221 100644 --- a/test/coding/test_factory.py +++ b/test/coding/test_factory.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import pytest diff --git a/test/coding/test_markdown_code_extractor.py b/test/coding/test_markdown_code_extractor.py index bffabab71f..b63bc67531 100644 --- a/test/coding/test_markdown_code_extractor.py +++ b/test/coding/test_markdown_code_extractor.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT from autogen.coding import MarkdownCodeExtractor diff --git a/test/coding/test_user_defined_functions.py b/test/coding/test_user_defined_functions.py index a542dae7e8..96d8419748 100644 --- a/test/coding/test_user_defined_functions.py +++ b/test/coding/test_user_defined_functions.py @@ -1,8 +1,8 @@ -# Copyright (c) 2023 - 2024, Owners of https://github.com/autogen-ai +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Original portions of this file are derived from https://github.com/microsoft/autogen under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT import tempfile diff --git a/test/oai/test_bedrock.py b/test/oai/test_bedrock.py index 42502acf69..b059ee138d 100644 --- a/test/oai/test_bedrock.py +++ b/test/oai/test_bedrock.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT from unittest.mock import MagicMock, patch import pytest diff --git a/test/oai/test_cerebras.py b/test/oai/test_cerebras.py index 7f84ae3f9d..202887d2e1 100644 --- a/test/oai/test_cerebras.py +++ b/test/oai/test_cerebras.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT from unittest.mock import MagicMock, patch import pytest diff --git a/test/oai/test_ollama.py b/test/oai/test_ollama.py index 5491a04d7b..0b25decde7 100644 --- a/test/oai/test_ollama.py +++ b/test/oai/test_ollama.py @@ -1,3 +1,9 @@ +# Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai +# +# SPDX-License-Identifier: Apache-2.0 +# +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. +# SPDX-License-Identifier: MIT from unittest.mock import MagicMock, patch import pytest diff --git a/website/docs/contributor-guide/contributing.md b/website/docs/contributor-guide/contributing.md index fda9596883..929f5b719c 100644 --- a/website/docs/contributor-guide/contributing.md +++ b/website/docs/contributor-guide/contributing.md @@ -36,14 +36,14 @@ To maintain proper licensing and copyright notices, please include the following # SPDX-License-Identifier: Apache-2.0 ``` -For files that contain or are derived from the original MIT-licensed code from https://github.com/ag2ai/ag2, please use this extended header: +For files that contain or are derived from the original MIT-licensed code from https://github.com/microsoft/autogen, please use this extended header: ```python # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai # # SPDX-License-Identifier: Apache-2.0 # -# Portions derived from https://github.com/ag2ai/ag2 are under the MIT License. +# Portions derived from https://github.com/microsoft/autogen are under the MIT License. # SPDX-License-Identifier: MIT ```