<jupyter_start><jupyter_text>Classes  Camping budgetSource code for 3 variations: [examples/camping/](https://github.com/ramalho/pyob/tree/master/examples/camping) Camper classClass ``camping.Camper`` represents a contributor to the budget of a camping trip.```python>>> from camping import Camper>>> a = Camper('Anna')>>> a.pay(33)>>> a.display()'Anna paid $  33.00'```A camper can be created with an initial balance:```python>>> c = Camper('Charlie', 9)```The ``.display()`` method right-justifies the names taking into account the longest name so far, so that multiple calls show aligned columns:```>>> for camper in [a, c]:...     print(camper.display())   Anna paid $  33.00Charlie paid $   9.00```> The [examples/camping/dataclass](https://github.com/ramalho/pyob/tree/master/examples/camping/dataclass) example shows the use of the `__post_init__` method in a dataclass. Budget classClass ``camping.Budget`` represents the budget for a camping trip in which campers who pitched in more than average need to be reimbursed by the others.```python>>> from camping import Budget>>> b = Budget('Debbie', 'Ann', 'Bob', 'Charlie')```The ``__init__`` method takes a variable number of names, so it can be invoked as above, but also like this:```python>>> friends = ['Debbie', 'Ann', 'Bob', 'Charlie']>>> b = Budget(*friends)```Demonstration of the remaining methods:```python>>> b.total()0.0>>> b.people()['Ann', 'Bob', 'Charlie', 'Debbie']>>> b.contribute("Bob", 50.00)>>> b.contribute("Debbie", 40.00)>>> b.contribute("Ann", 10.00)>>> b.total()100.0```The ``.report()`` method lists who should receive or pay, and the respective amounts.```>>> b.report()Total: $ 100.00; individual share: $ 25.00------------------------------------------Charlie paid $   0.00, balance: $  -25.00    Ann paid $  10.00, balance: $  -15.00 Debbie paid $  40.00, balance: $   15.00    Bob paid $  50.00, balance: $   25.00```  Sidebar: private attributes<jupyter_code>class BlackBox:
    
    def __init__(self, top_content, bottom_content):
        self._top = top_content
        self.__bottom = bottom_content
        
b = BlackBox('gold', 'diamonds')

b._top
hasattr(b, '__bottom')
b.__dict__
b._BlackBox__bottom<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1796138302649304, 'fraction_numerical': 0.0327795240233498, 'mean_word_length': 4.355769230769231, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 57, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '363402', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 769, 'n_tokens_neox': 671, 'n_words': 219, 'path': '04-classes.ipynb', 'repo_name': 'kangli-bionic/pyob', 'size': '2227'}