<commit_before>## PEP 8
https://www.python.org/dev/peps/pep-0008/

## Anaconda for Sublime Text
* Cmd + Shift + P to bring up the Command Palette
* Click `Package Control: Install Package`
* Search for `Anaconda` and click to install
* Make the following modification to `Sublime Text -> Preferences -> Package Settings -> Anaconda -> Settings - User`
```
{
    "pep8_max_line_length": 100,
    "pep8_ignore": [
        "E402"
    ],
    "auto_formatting_timeout": 5
}
```
* Line length increased to 100 from the default of 79 which is still PEP 8 acceptable
* Ignore imports not at the top of the file to allow for adding to the import path
* Need to increase auto formatting timeout for it to work

## Enumerated Fields
* If new values will be added frequently, create a new table holding all values for the field and link it with a foreign key. Otherwise, just store the value directly.
* Use `py/cnenums.py` to create variables for all field values and refer to the values using the variables in code.
```
class TableEnum():
    class Field():
        VALUE1 = "VALUE1"
        VALUE2 = "VALUE2"
        VALUE3 = "VALUE3"
```
## Line Breaks
* When breaking lines in function params, strings, and objects use one indent each line
* Function params and conditional expression clauses should either be all on one line or if too long separated one on each line
```
res = function(
    var1,
    var2,
    var3
)

string = (
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
    "Sed non erat id elit porta finibus eget a elit. "
    "Maecenas ut vehicula ex, sed mollis arcu."
)

obj = {
    "field1": "value1",
    "field2": "value2",
    "field3": "value3"
}
```
<commit_msg>Update python_style.md<commit_after>## PEP 8
https://www.python.org/dev/peps/pep-0008/

## Anaconda for Sublime Text
* Cmd + Shift + P to bring up the Command Palette
* Click `Package Control: Install Package`
* Search for `Anaconda` and click to install
* Make the following modification to `Sublime Text -> Preferences -> Package Settings -> Anaconda -> Settings - User`
```
{
    "pep8_max_line_length": 100,
    "pep8_ignore": [
        "E402"
    ],
    "auto_formatting_timeout": 5
}
```
* Line length increased to 100 from the default of 79 which is still PEP 8 acceptable
* Ignore imports not at the top of the file to allow for adding to the import path
* Need to increase auto formatting timeout for it to work

## Enumerated Fields
* If new values will be added frequently, create a new table holding all values for the field and link it with a foreign key. Otherwise, just store the value directly.
* Use `py/cnenums.py` to create variables for all field values and refer to the values using the variables in code.
```
class TableEnum():
    class Field():
        VALUE1 = "VALUE1"
        VALUE2 = "VALUE2"
        VALUE3 = "VALUE3"
```
## Line Breaks
* When breaking lines in function params, strings, and objects use one indent each line
* Function params and conditional expression clauses should either be all on one line or separated one on each line
```
res = function(
    var1,
    var2,
    var3
)

string = (
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
    "Sed non erat id elit porta finibus eget a elit. "
    "Maecenas ut vehicula ex, sed mollis arcu."
)

obj = {
    "field1": "value1",
    "field2": "value2",
    "field3": "value3"
}
```

{'fraction_non_alphanumeric': 0.08907960935187925, 'fraction_numerical': 0.020716188221367268, 'mean_word_length': 3.378238341968912, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2456750', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1014, 'n_words': 454}