semvec/pypi-packages huggingface dataset:
python-textmate 0.2.0
TextMate grammar parser for python
License: MIT
Requires Python: <4.0,>=3.8

# TextMate grammar parser for python

## Install

`pip install python-textmate`

## Usage

The parser can parse one line, to parse multiple lines iterate over each line and call parse()

```python
>>> from textmate import TextMateGrammar, TextMateGrammarRepository
>>> import json
>>> 
>>> def load_json(file_path):
...     with open(file_path, "r") as f:
...         return json.load(f)
... 
>>> # Initialize the grammar repository
>>> repository = TextMateGrammarRepository([
...     load_json("MagicPython.tmLanguage.json"),
...     load_json("MagicRegExp.tmLanguage.json")
... ])
>>> 
>>> # Get the Python grammar
>>> python_grammar = repository.get_grammar_by_language("python")
>>> 
>>> if python_grammar:
...     # Initiatee the grammar parser
...     grammar = TextMateGrammar(python_grammar, repository)
...     3 Parse one line of code
...     code = "print(True) # the parser only parses one line."
...     result = grammar.parse(code)
...     print(result)
... 
[('punctuation.definition.comment.python', (12, 13)),
 ('comment.line.number-sign.python', (12, 46)),
 ('constant.language.python', (6, 10)),
 ('punctuation.parenthesis.begin.python', (5, 6)),
 ('punctuation.parenthesis.end.python', (10, 11)),
 ('constant.language.python', (6, 10)),
 ('punctuation.definition.arguments.end.python', (10, 11)),
 ('meta.function-call.python', (0, 11)),
 ('keyword.illegal.name.python', (6, 10)),
 ('support.function.builtin.python', (0, 5)),
 ('meta.function-call.generic.python', (0, 5)),
 ('meta.function-call.generic.python', (6, 10)),
 ('meta.function-call.arguments.python', (6, 10)),
 ('constant.language.python', (6, 10)),
 ('support.function.builtin.python', (0, 5)),
 ('punctuation.separator.period.python', (45, 46)),
 ('meta.member.access.python', (45, 46))]
```
tell-me-again 0.1.4
Dataset for the paper 'Tell me again! A Large-Scale Dataset of Multiple Summaries for the
License: MIT
Requires Python: <4.0,>=3.11

# Tell me again!

A dataset of multiple summaries for the same story.

The summaries are scraped from Wikipedia and come in various languages.
We also provide automatically created translation and anonymized versions of the summaries (without identifiable names).
For further details, check out the corresponding paper [here](https://www.inf.uni-hamburg.de/en/inst/ab/lt/publications/2024-hatzel-et-al-lrec.pdf).


When using this dataset please cite the following paper:
```
@inproceedings{hatzel-biemann-2024-tell-large,
    title = "Tell Me Again! a Large-Scale Dataset of Multiple Summaries for the Same Story",
    author = "Hatzel, Hans Ole and Biemann, Chris",
    booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
    month = may,
    year = "2024",
    address = "Torino, Italia",
    publisher = "ELRA and ICCL",
    url = "https://aclanthology.org/2024.lrec-main.1366",
    pages = "15732--15741",
}
```


## Usage
Install by running: `pip install tell_me_again`

```python
from tell_me_again import StoryDataset, SimilarityDataset

dataset = StoryDataset()
for story in dataset:
    # This prints a dictionary of the various anonymized versions of the story
    print(story.summaries_anonymized)

dataset = SimilarityDataset()
for pair in dataset["dev"]:
    print(pair["text_a"], pair["text_b"], pair["label"])
```

Optionally you can manually download the file from [our website](https://ltdata1.informatik.uni-hamburg.de/tell_me_again_v1.zip).
Point the `data_path` argument in the dataset classes to the zip file (with out extracting it) to use the manually downloaded copy.

## License

The code in this repo is MIT licensed, the summaries were all scraped from Wikipedia and are Licensed (including their derived forms) under CC-BY-SA 4.0.