---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
F401_0.py:2:8: F401 [*] `functools` imported but unused
  |
1 | from __future__ import all_feature_names
2 | import functools, os
  |        ^^^^^^^^^ F401
3 | from datetime import datetime
4 | from collections import (
  |
  = help: Remove unused import: `functools`

ℹ Safe fix
1 1 | from __future__ import all_feature_names
2   |-import functools, os
  2 |+import os
3 3 | from datetime import datetime
4 4 | from collections import (
5 5 |     Counter,

F401_0.py:6:5: F401 [*] `collections.OrderedDict` imported but unused
  |
4 | from collections import (
5 |     Counter,
6 |     OrderedDict,
  |     ^^^^^^^^^^^ F401
7 |     namedtuple,
8 | )
  |
  = help: Remove unused import: `collections.OrderedDict`

ℹ Safe fix
3 3 | from datetime import datetime
4 4 | from collections import (
5 5 |     Counter,
6   |-    OrderedDict,
7 6 |     namedtuple,
8 7 | )
9 8 | import multiprocessing.pool

F401_0.py:12:8: F401 [*] `logging.handlers` imported but unused
   |
10 | import multiprocessing.process
11 | import logging.config
12 | import logging.handlers
   |        ^^^^^^^^^^^^^^^^ F401
13 | from typing import (
14 |     TYPE_CHECKING,
   |
   = help: Remove unused import: `logging.handlers`

ℹ Safe fix
9  9  | import multiprocessing.pool
10 10 | import multiprocessing.process
11 11 | import logging.config
12    |-import logging.handlers
13 12 | from typing import (
14 13 |     TYPE_CHECKING,
15 14 |     NamedTuple,

F401_0.py:32:12: F401 [*] `shelve` imported but unused
   |
31 | if TYPE_CHECKING:
32 |     import shelve
   |            ^^^^^^ F401
33 |     import importlib
   |
   = help: Remove unused import: `shelve`

ℹ Safe fix
29 29 |     from models import Fruit, Nut, Vegetable
30 30 | 
31 31 | if TYPE_CHECKING:
32    |-    import shelve
33 32 |     import importlib
34 33 | 
35 34 | if TYPE_CHECKING:

F401_0.py:33:12: F401 [*] `importlib` imported but unused
   |
31 | if TYPE_CHECKING:
32 |     import shelve
33 |     import importlib
   |            ^^^^^^^^^ F401
34 | 
35 | if TYPE_CHECKING:
   |
   = help: Remove unused import: `importlib`

ℹ Safe fix
30 30 | 
31 31 | if TYPE_CHECKING:
32 32 |     import shelve
33    |-    import importlib
34 33 | 
35 34 | if TYPE_CHECKING:
36 35 |     """Hello, world!"""

F401_0.py:37:12: F401 [*] `pathlib` imported but unused
   |
35 | if TYPE_CHECKING:
36 |     """Hello, world!"""
37 |     import pathlib
   |            ^^^^^^^ F401
38 | 
39 |     z = 1
   |
   = help: Remove unused import: `pathlib`

ℹ Safe fix
34 34 | 
35 35 | if TYPE_CHECKING:
36 36 |     """Hello, world!"""
37    |-    import pathlib
38 37 | 
39 38 |     z = 1
40 39 | 

F401_0.py:52:16: F401 [*] `pickle` imported but unused
   |
51 |     def b(self) -> None:
52 |         import pickle
   |                ^^^^^^ F401
   |
   = help: Remove unused import: `pickle`

ℹ Safe fix
49 49 |         z = multiprocessing.pool.ThreadPool()
50 50 | 
51 51 |     def b(self) -> None:
52    |-        import pickle
   52 |+        pass
53 53 | 
54 54 | 
55 55 | __all__ = ["ClassA"] + ["ClassB"]

F401_0.py:93:16: F401 [*] `x` imported but unused
   |
91 | match *0, 1, *2:
92 |     case 0,:
93 |         import x
   |                ^ F401
94 |         import y
   |
   = help: Remove unused import: `x`

ℹ Safe fix
90 90 | # Test: match statements.
91 91 | match *0, 1, *2:
92 92 |     case 0,:
93    |-        import x
94 93 |         import y
95 94 | 
96 95 | 

F401_0.py:94:16: F401 [*] `y` imported but unused
   |
92 |     case 0,:
93 |         import x
94 |         import y
   |                ^ F401
   |
   = help: Remove unused import: `y`

ℹ Safe fix
91 91 | match *0, 1, *2:
92 92 |     case 0,:
93 93 |         import x
94    |-        import y
95 94 | 
96 95 | 
97 96 | # Test: access a sub-importation via an alias.

F401_0.py:99:8: F401 [*] `foo.bar.baz` imported but unused
    |
 97 | # Test: access a sub-importation via an alias.
 98 | import foo.bar as bop
 99 | import foo.bar.baz
    |        ^^^^^^^^^^^ F401
100 | 
101 | print(bop.baz.read_csv("test.csv"))
    |
    = help: Remove unused import: `foo.bar.baz`

ℹ Safe fix
96  96  | 
97  97  | # Test: access a sub-importation via an alias.
98  98  | import foo.bar as bop
99      |-import foo.bar.baz
100 99  | 
101 100 | print(bop.baz.read_csv("test.csv"))
102 101 | 

F401_0.py:105:12: F401 [*] `a1` imported but unused
    |
103 | # Test: isolated deletions.
104 | if TYPE_CHECKING:
105 |     import a1
    |            ^^ F401
106 | 
107 |     import a2
    |
    = help: Remove unused import: `a1`

ℹ Safe fix
102 102 | 
103 103 | # Test: isolated deletions.
104 104 | if TYPE_CHECKING:
105     |-    import a1
106 105 | 
107 106 |     import a2
108 107 | 

F401_0.py:107:12: F401 [*] `a2` imported but unused
    |
105 |     import a1
106 | 
107 |     import a2
    |            ^^ F401
    |
    = help: Remove unused import: `a2`

ℹ Safe fix
104 104 | if TYPE_CHECKING:
105 105 |     import a1
106 106 | 
107     |-    import a2
108 107 | 
109 108 | 
110 109 | match *0, 1, *2:

F401_0.py:112:16: F401 [*] `b1` imported but unused
    |
110 | match *0, 1, *2:
111 |     case 0,:
112 |         import b1
    |                ^^ F401
113 | 
114 |         import b2
    |
    = help: Remove unused import: `b1`

ℹ Safe fix
109 109 | 
110 110 | match *0, 1, *2:
111 111 |     case 0,:
112     |-        import b1
113 112 | 
114 113 |         import b2
115 114 | 

F401_0.py:114:16: F401 [*] `b2` imported but unused
    |
112 |         import b1
113 | 
114 |         import b2
    |                ^^ F401
    |
    = help: Remove unused import: `b2`

ℹ Safe fix
111 111 |     case 0,:
112 112 |         import b1
113 113 | 
114     |-        import b2
115 114 | 
116 115 | 
117 116 | # Regression test for: https://github.com/astral-sh/ruff/issues/7244

F401_0.py:122:1: F401 [*] `datameta_client_lib.model_helpers.noqa` imported but unused
    |
121 | from datameta_client_lib.model_helpers import (
122 | noqa )
    | ^^^^ F401
    |
    = help: Remove unused import: `datameta_client_lib.model_helpers.noqa`

ℹ Safe fix
118 118 | from datameta_client_lib.model_utils import (  # noqa: F401
119 119 | noqa )
120 120 | 
121     |-from datameta_client_lib.model_helpers import (
122     |-noqa )


