# Path: PW_explorer/Input_Parsers/Meta_Data_Parser/meta_data_parser.py
# def parse_meta_data_from_string(asp_input_string, silent=False, print_parse_tree=False):
#     input_stream = InputStream(asp_input_string)
#     return __parse_meta_data__(input_stream, silent, print_parse_tree)
# 
# def preprocess(lines):
# 
#     def has_a_comment(line):
#         return line.find(ASP_COMMENT_SYMBOL) != -1
# 
#     def extract_comment(comment_line):
#         comment_start_idx = comment_line.find(ASP_COMMENT_SYMBOL)
#         comment = comment_line[comment_start_idx:].strip()
#         return comment
# 
#     def is_a_valid_meta_data_comment(comment):
#         pattern = re.compile(META_DATA_COMMENT_REGEX)
#         return pattern.search(comment) is not None
# 
#     lines_with_comments = filter(has_a_comment, lines)
#     comments = map(extract_comment, lines_with_comments)
#     comments_with_meta_data = filter(is_a_valid_meta_data_comment, comments)
# 
#     return list(comments_with_meta_data)


from .Input_Parsers.Meta_Data_Parser.meta_data_parser import (
    parse_meta_data_from_string,
    preprocess,
)


def parse_pwe_meta_data(asp_rules, silent=False, print_parse_tree=False):
    if isinstance(asp_rules, str):
        asp_rules = asp_rules.splitlines()

# Path: PW_explorer/Input_Parsers/Meta_Data_Parser/meta_data_parser.py
# def parse_meta_data_from_string(asp_input_string, silent=False, print_parse_tree=False):
#     input_stream = InputStream(asp_input_string)
#     return __parse_meta_data__(input_stream, silent, print_parse_tree)
# 
# def preprocess(lines):
# 
#     def has_a_comment(line):
#         return line.find(ASP_COMMENT_SYMBOL) != -1
# 
#     def extract_comment(comment_line):
#         comment_start_idx = comment_line.find(ASP_COMMENT_SYMBOL)
#         comment = comment_line[comment_start_idx:].strip()
#         return comment
# 
#     def is_a_valid_meta_data_comment(comment):
#         pattern = re.compile(META_DATA_COMMENT_REGEX)
#         return pattern.search(comment) is not None
# 
#     lines_with_comments = filter(has_a_comment, lines)
#     comments = map(extract_comment, lines_with_comments)
#     comments_with_meta_data = filter(is_a_valid_meta_data_comment, comments)
# 
#     return list(comments_with_meta_data)


# Path: PW_explorer/meta_data_parser.py
from .Input_Parsers.Meta_Data_Parser.meta_data_parser import (
    parse_meta_data_from_string,
    preprocess,
)



def parse_pwe_meta_data(asp_rules, silent=False, print_parse_tree=False):
    if isinstance(asp_rules, str):
        asp_rules = asp_rules.splitlines()

    md_comments = preprocess(asp_rules)