/opt/cloudlinux/venv/lib/python3.11/site-packages/isort
NameSizeModeActions
deprecated/-0755rm
stdlibs/-0755rm
_vendored/-0755rm
__pycache__/-0755rm
api.py261200644editdlrm
comments.py9330644editdlrm
core.py225250644editdlrm
exceptions.py70600644editdlrm
files.py15890644editdlrm
format.py54830644editdlrm
hooks.py33380644editdlrm
identify.py83730644editdlrm
io.py22160644editdlrm
literal.py37130644editdlrm
logo.py3880644editdlrm
main.py468230644editdlrm
output.py278040644editdlrm
parse.py253320644editdlrm
place.py51710644editdlrm
profiles.py21440644editdlrm
py.typed00644editdlrm
pylama_isort.py13080644editdlrm
sections.py2970644editdlrm
settings.py355840644editdlrm
setuptools_commands.py22970644editdlrm
sorting.py45150644editdlrm
utils.py24130644editdlrm
wrap.py63210644editdlrm
wrap_modes.py135690644editdlrm
_version.py720644editdlrm
__init__.py8710644editdlrm
__main__.py360644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/isort/comments.py (933B)
from typing import List, Optional, Tuple def parse(line: str) -> Tuple[str, str]: """Parses import lines for comments and returns back the import statement and the associated comment. """ comment_start = line.find("#") if comment_start != -1: return (line[:comment_start], line[comment_start + 1 :].strip()) return (line, "") def add_to_line( comments: Optional[List[str]], original_string: str = "", removed: bool = False, comment_prefix: str = "", ) -> str: """Returns a string with comments added if removed is not set.""" if removed: return parse(original_string)[0] if not comments: return original_string unique_comments: List[str] = [] for comment in comments: if comment not in unique_comments: unique_comments.append(comment) return f"{parse(original_string)[0]}{comment_prefix} {'; '.join(unique_comments)}"