mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 08:17:01 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
eb16b2dfc4
commit
4cf6dbf9a4
|
@ -48,9 +48,9 @@ def gabor_filter_kernel(
|
|||
_y = -sin_theta * px + cos_theta * py
|
||||
|
||||
# fill kernel
|
||||
gabor[y, x] = np.exp(
|
||||
-(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)
|
||||
) * np.cos(2 * np.pi * _x / lambd + psi)
|
||||
gabor[y, x] = np.exp(-(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)) * np.cos(
|
||||
2 * np.pi * _x / lambd + psi
|
||||
)
|
||||
|
||||
return gabor
|
||||
|
||||
|
|
|
@ -240,9 +240,7 @@ def ascend_tree(leaf_node: TreeNode, prefix_path: list[str]) -> None:
|
|||
ascend_tree(leaf_node.parent, prefix_path)
|
||||
|
||||
|
||||
def find_prefix_path(
|
||||
base_pat: frozenset, tree_node: TreeNode | None
|
||||
) -> dict: # noqa: ARG001
|
||||
def find_prefix_path(base_pat: frozenset, tree_node: TreeNode | None) -> dict: # noqa: ARG001
|
||||
"""
|
||||
Find the conditional pattern base for a given base pattern.
|
||||
|
||||
|
|
|
@ -31,9 +31,7 @@ def bead_sort(sequence: list) -> list:
|
|||
if any(not isinstance(x, int) or x < 0 for x in sequence):
|
||||
raise TypeError("Sequence must be list of non-negative integers")
|
||||
for _ in range(len(sequence)):
|
||||
for i, (rod_upper, rod_lower) in enumerate(
|
||||
zip(sequence, sequence[1:])
|
||||
): # noqa: RUF007
|
||||
for i, (rod_upper, rod_lower) in enumerate(zip(sequence, sequence[1:])): # noqa: RUF007
|
||||
if rod_upper > rod_lower:
|
||||
sequence[i] -= rod_upper - rod_lower
|
||||
sequence[i + 1] += rod_upper - rod_lower
|
||||
|
|
|
@ -132,9 +132,7 @@ if __name__ == "__main__":
|
|||
elif op[0] == "R":
|
||||
string[i] = op[2]
|
||||
|
||||
file.write(
|
||||
"%-16s" % ("Replace %c" % op[1] + " with " + str(op[2]))
|
||||
) # noqa: UP031
|
||||
file.write("%-16s" % ("Replace %c" % op[1] + " with " + str(op[2]))) # noqa: UP031
|
||||
file.write("\t\t" + "".join(string))
|
||||
file.write("\r\n")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user