<jupyter_start><jupyter_text>A python program is read by a parser. Input to the parser is a stream of tokens, generated by the lexical analyzer. Python reads program text as Unicode code points. And if the source file cannot be decoded, a SyntaxError is raised. Two or more physical lines can be joined by using \\ character.  Data ModelEverything in python is represented as objects or by relations between objects. Every object has an 1)identity 2)type 3)value. Identity never changes after creation like object's address in memory (`is` operator used to compare it, `id` returns the identity). `type` return the type of object. The objects whose values can change are called 'mutable' objects, and whose values cannot be changed are called 'immutable' (**Note**:- Value of an immutable container object that contains a reference to a mutable object can change when the latter's value is changed). When we say immutability we only refer to the immediately contained objects.<jupyter_code>c = d = []
c.append(1)

c,d
a = []
b = []
a.append(1)

a, b<jupyter_output><empty_output><jupyter_text>Type hierarchy1. None -> It has a single value and used when we want to signify the absence of a value in many situations.2. NotImplemented -> It has a single value. Numeric method and rich comparison methods should return this value if they do not implement the operation for the operands provided.3. Ellipsis -> It has a single value. It can be accessed by ... or Ellipsis4. numbers.Number ->     * numbers.Integral -> Integers, Booleans    * numbers.Real(float) -> Represent machine-level double precision floating point numbers.    * numbers.Complex(complex)5. Sequences -> Finite ordered sets indexed by non-negative numbers    1. Immutable sequences        * Strings -> Use `ord('a')` to get decimal representation of the character, `char(97)` converts integer to string.        * Tuples -> Created by comma separated list of expressions. Use parenthesis to create tuples.        * Bytes -> Items are 8-but bytes. Like b'abc'.    2. Mutable sequences -> These are non-hashable        * Lists -> Use square brackets to create them.        * Byte Arrays -> bytearray().6. Sets -> Unordered, finite sets of unique, immutable objects. Cannot be indexed into. Generally used for fast membership testing, removing duplicates, computing intersection, union, differences.    * Sets -> Represent a mutable set. Created using `set()` and can be modified by using `add()`.    * Frozen Sets -> Immutable set. Created using `frozenset()`.7. Mappings -> Finite sets of objects indexed by arbitrary index sets.    * Dictionaries -> Dictionaries preserver insertion order. Replacing a key does not change the order. They are mutable8. Callable types -> These are the types to which function call operation can be applied.    1. User-defined functions -> They have the following attribute defined for them by python<jupyter_code>def f(x, y=10):
    '''It does addition'''
    return x+y
f.__doc__
f.__name__
f.__qualname__ # To be used when there is some nesting involved and it returns the full path to the function name
f.__module__ # Name of the module in which the function was defined in.
f.__defaults__
f.__code__
f.__code__.co_varnames
f.__dict__<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07258805513016846, 'fraction_numerical': 0.006431852986217458, 'mean_word_length': 4.024615384615385, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, 'https://': 0, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '389130', 'license': 'MIT', 'n_tokens_mistral': 850, 'n_tokens_neox': 816, 'n_words': 445, 'path': 'libs/Python/python_data_model.ipynb', 'repo_name': 'KushajveerSingh/pytorch_projects', 'size': '3265'}