Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import os
from typing import (
    List,
    Optional,
)


class Example:
    attribute = 1

    def __init__(self, first, second):
        self.first = first
        self.second = second
        self.values = [
            1,
            2,
            3,
        ]
        self.mapping = {
            "a": 1,
            "b": 2,
        }

    def method(self, argument):
        if argument > 0:
            for index in range(argument):
                print(index)
            return argument
        elif argument < 0:
            while argument < 0:
                argument += 1
        else:
            argument = 0

        try:
            value = self.values[argument]
        except IndexError:
            value = None
        except (KeyError, ValueError):
            value = -1
        else:
            value += 1
        finally:
            print("done")

        with open("file") as handle:
            data = handle.read()

        return value


def aligned_call():
    result = some_function(first_argument,
                           second_argument,
                           third_argument)
    return result


def hanging_call():
    result = other_function(
        first_argument,
        second_argument,
    )
    return result


def comprehensions():
    squares = [
        value * value
        for value in range(10)
        if value % 2 == 0
    ]
    return squares


def match_example(command):
    match command:
        case "start":
            return 1
        case "stop":
            return 0
        case _:
            return -1


def docstring_example():
    text = """
first line
    indented in string
back"""
    return text