Skip to content

Commit 7e359c7

Browse files
committed
applied black autoformatting
1 parent dcebd72 commit 7e359c7

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

ciphers/enigma_machine2.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ def _plugboard(pbstring: str) -> dict:
124124
# a) is type string
125125
# b) has even length (so pairs can be made)
126126
if not isinstance(pbstring, str):
127-
raise TypeError(
128-
f"Plugboard setting isn't type string ({type(pbstring)})"
129-
)
127+
raise TypeError(f"Plugboard setting isn't type string ({type(pbstring)})")
130128
elif len(pbstring) % 2 != 0:
131129
raise Exception(f"Odd number of symbols ({len(pbstring)})")
132130
elif pbstring == "":

graphs/directed_and_undirected_(weighted)_graph.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ def has_cycle(self):
227227
else:
228228
return True
229229
# TODO:The following code is unreachable.
230-
anticipating_nodes.add(
231-
stack[len_stack_minus_one])
230+
anticipating_nodes.add(stack[len_stack_minus_one])
232231
len_stack_minus_one -= 1
233232
if visited.count(node[1]) < 1:
234233
stack.append(node[1])
@@ -457,8 +456,7 @@ def has_cycle(self):
457456
return True
458457
# TODO: the following code is unreachable
459458
# is this meant to be called in the else ?
460-
anticipating_nodes.add(
461-
stack[len_stack_minus_one])
459+
anticipating_nodes.add(stack[len_stack_minus_one])
462460
len_stack_minus_one -= 1
463461
if visited.count(node[1]) < 1:
464462
stack.append(node[1])

maths/chudnovsky_algorithm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def pi(precision: int) -> str:
4848
linear_term = 13591409
4949
partial_sum = Decimal(linear_term)
5050
for k in range(1, num_iterations):
51-
multinomial_term = factorial(
52-
6 * k) // (factorial(3 * k) * factorial(k) ** 3)
51+
multinomial_term = factorial(6 * k) // (factorial(3 * k) * factorial(k) ** 3)
5352
linear_term += 545140134
5453
exponential_term *= -262537412640768000
5554
partial_sum += Decimal(multinomial_term * linear_term) / exponential_term

scheduling/shortest_job_first.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ def calculate_average_times(
111111
for i in range(no_of_processes):
112112
total_waiting_time = total_waiting_time + waiting_time[i]
113113
total_turn_around_time = total_turn_around_time + turn_around_time[i]
114-
print("Average waiting time = %.5f" %
115-
(total_waiting_time / no_of_processes))
114+
print("Average waiting time = %.5f" % (total_waiting_time / no_of_processes))
116115
print("Average turn around time =", total_turn_around_time / no_of_processes)
117116

118117

@@ -127,8 +126,7 @@ def calculate_average_times(
127126
print("Enter the arrival time and brust time for process:--" + str(i + 1))
128127
arrival_time[i], burst_time[i] = map(int, input().split())
129128

130-
waiting_time = calculate_waitingtime(
131-
arrival_time, burst_time, no_of_processes)
129+
waiting_time = calculate_waitingtime(arrival_time, burst_time, no_of_processes)
132130

133131
bt = burst_time
134132
n = no_of_processes
@@ -138,8 +136,7 @@ def calculate_average_times(
138136
calculate_average_times(waiting_time, turn_around_time, no_of_processes)
139137

140138
fcfs = pd.DataFrame(
141-
list(zip(processes, burst_time, arrival_time,
142-
waiting_time, turn_around_time)),
139+
list(zip(processes, burst_time, arrival_time, waiting_time, turn_around_time)),
143140
columns=[
144141
"Process",
145142
"BurstTime",

0 commit comments

Comments
 (0)