def get_dataset_and_info_for_websites(websites, evaluate=False):
    """

    Args:
        websites: a list of websites

    Returns:
        a dataset object
    """

    all_features = []

    for website in websites:
        features_per_website = global_feature_dicts[website]
        all_features += features_per_website

    # Convert to Tensors and build dataset
    all_input_ids = torch.tensor([f.input_ids for f in all_features], dtype=torch.long)
    all_attention_mask = torch.tensor([f.attention_mask for f in all_features], dtype=torch.long)
    all_token_type_ids = torch.tensor([f.token_type_ids for f in all_features], dtype=torch.long)
    all_xpath_tags_seq = torch.tensor([f.xpath_tags_seq for f in all_features], dtype=torch.long)
    all_xpath_subs_seq = torch.tensor([f.xpath_subs_seq for f in all_features], dtype=torch.long)

    if not evaluate:
        all_labels = torch.tensor([f.labels for f in all_features], dtype=torch.long)
        dataset = SwdeDataset(all_input_ids=all_input_ids,
                              all_attention_mask=all_attention_mask,
                              all_token_type_ids=all_token_type_ids,
                              all_xpath_tags_seq=all_xpath_tags_seq,
                              all_xpath_subs_seq=all_xpath_subs_seq,
                              all_labels=all_labels)
        info = None
    else:
        # in evaluation, we do not add labels
        dataset = SwdeDataset(all_input_ids=all_input_ids,
                              all_attention_mask=all_attention_mask,
                              all_token_type_ids=all_token_type_ids,
                              all_xpath_tags_seq=all_xpath_tags_seq,
                              all_xpath_subs_seq=all_xpath_subs_seq)
        info = [(f.html_path,
                 f.involved_first_tokens_pos,
                 f.involved_first_tokens_xpaths,
                 f.involved_first_tokens_types,
                 f.involved_first_tokens_text) for f in all_features]

    return dataset, info


    Args:
        websites: a list of websites

    Returns:
        a dataset object
    
markuplm/examples/fine_tuning/run_swde/run.py