---
source: crates/ruff_python_formatter/src/lib.rs
expression: snapshot
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/torture.py
---
## Input

```py
importA;() << 0 ** 101234234242352525425252352352525234890264906820496920680926538059059209922523523525 #

assert sort_by_dependency(
    {
        "1": {"2", "3"}, "2": {"2a", "2b"}, "3": {"3a", "3b"},
        "2a": set(), "2b": set(), "3a": set(), "3b": set()
    }
) == ["2a", "2b", "2", "3a", "3b", "3", "1"]

importA
0;0^0#

class A:
    def foo(self):
        for _ in range(10):
            aaaaaaaaaaaaaaaaaaa = bbbbbbbbbbbbbbb.cccccccccc(  # pylint: disable=no-member
                xxxxxxxxxxxx
            )

def test(self, othr):
    return (1 == 2 and
            (name, description, self.default, self.selected, self.auto_generated, self.parameters, self.meta_data, self.schedule) ==
            (name, description, othr.default, othr.selected, othr.auto_generated, othr.parameters, othr.meta_data, othr.schedule))


assert (
    a_function(very_long_arguments_that_surpass_the_limit, which_is_eighty_eight_in_this_case_plus_a_bit_more)
    == {"x": "this need to pass the line limit as well", "b": "but only by a little bit"}
)
```

## Black Differences

```diff
--- Black
+++ Ruff
@@ -1,21 +1,23 @@
 importA
 (
     ()
-    << 0
-    ** 101234234242352525425252352352525234890264906820496920680926538059059209922523523525
+    << 0**101234234242352525425252352352525234890264906820496920680926538059059209922523523525
 )  #
 
-assert sort_by_dependency(
-    {
-        "1": {"2", "3"},
-        "2": {"2a", "2b"},
-        "3": {"3a", "3b"},
-        "2a": set(),
-        "2b": set(),
-        "3a": set(),
-        "3b": set(),
-    }
-) == ["2a", "2b", "2", "3a", "3b", "3", "1"]
+assert (
+    sort_by_dependency(
+        {
+            "1": {"2", "3"},
+            "2": {"2a", "2b"},
+            "3": {"3a", "3b"},
+            "2a": set(),
+            "2b": set(),
+            "3a": set(),
+            "3b": set(),
+        }
+    )
+    == ["2a", "2b", "2", "3a", "3b", "3", "1"]
+)
 
 importA
 0
@@ -25,13 +27,12 @@
 class A:
     def foo(self):
         for _ in range(10):
-            aaaaaaaaaaaaaaaaaaa = bbbbbbbbbbbbbbb.cccccccccc(
-                xxxxxxxxxxxx
-            )  # pylint: disable=no-member
+            aaaaaaaaaaaaaaaaaaa = bbbbbbbbbbbbbbb.cccccccccc(xxxxxxxxxxxx)  # pylint: disable=no-member
 
 
 def test(self, othr):
-    return 1 == 2 and (
+    return 1 == 2
+    and (
         name,
         description,
         self.default,
@@ -40,7 +41,8 @@
         self.parameters,
         self.meta_data,
         self.schedule,
-    ) == (
+    )
+    == (
         name,
         description,
         othr.default,
@@ -52,7 +54,13 @@
     )
 
 
-assert a_function(
-    very_long_arguments_that_surpass_the_limit,
-    which_is_eighty_eight_in_this_case_plus_a_bit_more,
-) == {"x": "this need to pass the line limit as well", "b": "but only by a little bit"}
+assert (
+    a_function(
+        very_long_arguments_that_surpass_the_limit,
+        which_is_eighty_eight_in_this_case_plus_a_bit_more,
+    )
+    == {
+        "x": "this need to pass the line limit as well",
+        "b": "but only by a little bit",
+    }
+)
```

## Ruff Output

```py
importA
(
    ()
    << 0**101234234242352525425252352352525234890264906820496920680926538059059209922523523525
)  #

assert (
    sort_by_dependency(
        {
            "1": {"2", "3"},
            "2": {"2a", "2b"},
            "3": {"3a", "3b"},
            "2a": set(),
            "2b": set(),
            "3a": set(),
            "3b": set(),
        }
    )
    == ["2a", "2b", "2", "3a", "3b", "3", "1"]
)

importA
0
0 ^ 0  #


class A:
    def foo(self):
        for _ in range(10):
            aaaaaaaaaaaaaaaaaaa = bbbbbbbbbbbbbbb.cccccccccc(xxxxxxxxxxxx)  # pylint: disable=no-member


def test(self, othr):
    return 1 == 2
    and (
        name,
        description,
        self.default,
        self.selected,
        self.auto_generated,
        self.parameters,
        self.meta_data,
        self.schedule,
    )
    == (
        name,
        description,
        othr.default,
        othr.selected,
        othr.auto_generated,
        othr.parameters,
        othr.meta_data,
        othr.schedule,
    )


assert (
    a_function(
        very_long_arguments_that_surpass_the_limit,
        which_is_eighty_eight_in_this_case_plus_a_bit_more,
    )
    == {
        "x": "this need to pass the line limit as well",
        "b": "but only by a little bit",
    }
)
```

## Black Output

```py
importA
(
    ()
    << 0
    ** 101234234242352525425252352352525234890264906820496920680926538059059209922523523525
)  #

assert sort_by_dependency(
    {
        "1": {"2", "3"},
        "2": {"2a", "2b"},
        "3": {"3a", "3b"},
        "2a": set(),
        "2b": set(),
        "3a": set(),
        "3b": set(),
    }
) == ["2a", "2b", "2", "3a", "3b", "3", "1"]

importA
0
0 ^ 0  #


class A:
    def foo(self):
        for _ in range(10):
            aaaaaaaaaaaaaaaaaaa = bbbbbbbbbbbbbbb.cccccccccc(
                xxxxxxxxxxxx
            )  # pylint: disable=no-member


def test(self, othr):
    return 1 == 2 and (
        name,
        description,
        self.default,
        self.selected,
        self.auto_generated,
        self.parameters,
        self.meta_data,
        self.schedule,
    ) == (
        name,
        description,
        othr.default,
        othr.selected,
        othr.auto_generated,
        othr.parameters,
        othr.meta_data,
        othr.schedule,
    )


assert a_function(
    very_long_arguments_that_surpass_the_limit,
    which_is_eighty_eight_in_this_case_plus_a_bit_more,
) == {"x": "this need to pass the line limit as well", "b": "but only by a little bit"}
```


