Skip to content

Instantly share code, notes, and snippets.

@alonsoir
Created August 26, 2024 17:00
Show Gist options
  • Save alonsoir/d3907443c6e5668c2e965113a6189cfb to your computer and use it in GitHub Desktop.
Save alonsoir/d3907443c6e5668c2e965113a6189cfb to your computer and use it in GitHub Desktop.
running of pylint and flake...
import os
import subprocess
def analyze_code(directory):
# List Python files in the directory
python_files = [file for file in os.listdir(directory) if file.endswith('.py')]
if not python_files:
print("No Python files found in the specified directory.")
return
# Analyze each Python file using pylint and flake8
for file in python_files:
print(f"Analyzing file: {file}")
file_path = os.path.join(directory, file)
# Run pylint
print("\nRunning pylint...")
pylint_command = f"pylint {file_path}"
subprocess.run(pylint_command, shell=True)
# Run flake8
print("\nRunning flake8...")
flake8_command = f"flake8 {file_path}"
subprocess.run(flake8_command, shell=True)
if __name__ == "__main__":
directory = r"."
analyze_code(directory)
/Users/aironman/Library/Caches/pypoetry/virtualenvs/multi-llm-4PLG0NXw-py3.11/bin/python /Users/aironman/git/llm-apps/analyze_code.py
Analyzing file: openAI-milvus-rag.py
Running pylint...
************* Module openAI-milvus-rag
openAI-milvus-rag.py:1:0: C0114: Missing module docstring (missing-module-docstring)
openAI-milvus-rag.py:1:0: C0103: Module name "openAI-milvus-rag" doesn't conform to snake_case naming style (invalid-name)
openAI-milvus-rag.py:2:0: E0401: Unable to import 'openai' (import-error)
openAI-milvus-rag.py:3:0: E0401: Unable to import 'pymilvus' (import-error)
openAI-milvus-rag.py:4:0: E0401: Unable to import 'tqdm' (import-error)
openAI-milvus-rag.py:10:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
openAI-milvus-rag.py:18:0: C0116: Missing function or method docstring (missing-function-docstring)
openAI-milvus-rag.py:32:0: C0103: Constant name "collection_name" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-rag.py:51:0: C0103: Constant name "question" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-rag.py:69:0: C0103: Constant name "context" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-rag.py:5:0: C0411: standard import "json" should be placed before third party imports "openai.OpenAI", "pymilvus.MilvusClient", "tqdm.tqdm" (wrong-import-order)
------------------------------------------------------------------
Your code has been rated at 3.43/10 (previous run: 3.43/10, +0.00)
Running flake8...
./openAI-milvus-rag.py:18:1: E302 expected 2 blank lines, found 1
./openAI-milvus-rag.py:20:80: E501 line too long (83 > 79 characters)
./openAI-milvus-rag.py:24:1: E305 expected 2 blank lines after class or function definition, found 0
./openAI-milvus-rag.py:57:80: E501 line too long (84 > 79 characters)
./openAI-milvus-rag.py:59:80: E501 line too long (80 > 79 characters)
./openAI-milvus-rag.py:70:80: E501 line too long (84 > 79 characters)
./openAI-milvus-rag.py:74:80: E501 line too long (124 > 79 characters)
./openAI-milvus-rag.py:77:80: E501 line too long (132 > 79 characters)
Analyzing file: analyze_code.py
Running pylint...
************* Module analyze_code
analyze_code.py:29:0: C0304: Final newline missing (missing-final-newline)
analyze_code.py:1:0: C0114: Missing module docstring (missing-module-docstring)
analyze_code.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)
analyze_code.py:4:17: W0621: Redefining name 'directory' from outer scope (line 28) (redefined-outer-name)
analyze_code.py:20:8: W1510: 'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
analyze_code.py:25:8: W1510: 'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
analyze_code.py:28:4: C0103: Constant name "directory" doesn't conform to UPPER_CASE naming style (invalid-name)
-----------------------------------
Your code has been rated at 6.32/10
Running flake8...
./analyze_code.py:4:1: E302 expected 2 blank lines, found 1
./analyze_code.py:6:80: E501 line too long (83 > 79 characters)
./analyze_code.py:27:1: E305 expected 2 blank lines after class or function definition, found 1
./analyze_code.py:29:28: W292 no newline at end of file
Analyzing file: multi-model-rag-rare-disease.py
Running pylint...
************* Module multi-model-rag-rare-disease
multi-model-rag-rare-disease.py:81:0: C0301: Line too long (119/100) (line-too-long)
multi-model-rag-rare-disease.py:1:0: C0114: Missing module docstring (missing-module-docstring)
multi-model-rag-rare-disease.py:1:0: C0103: Module name "multi-model-rag-rare-disease" doesn't conform to snake_case naming style (invalid-name)
multi-model-rag-rare-disease.py:1:0: E0401: Unable to import 'pinecone' (import-error)
multi-model-rag-rare-disease.py:2:0: E0401: Unable to import 'transformers' (import-error)
multi-model-rag-rare-disease.py:7:0: C0116: Missing function or method docstring (missing-function-docstring)
multi-model-rag-rare-disease.py:22:11: W0718: Catching too general exception Exception (broad-exception-caught)
multi-model-rag-rare-disease.py:27:0: C0116: Missing function or method docstring (missing-function-docstring)
multi-model-rag-rare-disease.py:36:15: W0718: Catching too general exception Exception (broad-exception-caught)
multi-model-rag-rare-disease.py:41:0: C0116: Missing function or method docstring (missing-function-docstring)
multi-model-rag-rare-disease.py:49:15: W0718: Catching too general exception Exception (broad-exception-caught)
multi-model-rag-rare-disease.py:54:0: C0116: Missing function or method docstring (missing-function-docstring)
multi-model-rag-rare-disease.py:60:11: W0718: Catching too general exception Exception (broad-exception-caught)
multi-model-rag-rare-disease.py:65:0: C0116: Missing function or method docstring (missing-function-docstring)
multi-model-rag-rare-disease.py:71:11: W0718: Catching too general exception Exception (broad-exception-caught)
multi-model-rag-rare-disease.py:77:0: C0116: Missing function or method docstring (missing-function-docstring)
multi-model-rag-rare-disease.py:4:0: C0411: standard import "collections.defaultdict" should be placed before third party imports "pinecone.Pinecone", "transformers.AutoTokenizer", "numpy" (wrong-import-order)
multi-model-rag-rare-disease.py:5:0: C0411: standard import "os" should be placed before third party imports "pinecone.Pinecone", "transformers.AutoTokenizer", "numpy" (wrong-import-order)
multi-model-rag-rare-disease.py:1:0: W0611: Unused PodSpec imported from pinecone (unused-import)
multi-model-rag-rare-disease.py:3:0: W0611: Unused numpy imported as np (unused-import)
------------------------------------------------------------------
Your code has been rated at 6.46/10 (previous run: 6.46/10, +0.00)
Running flake8...
./multi-model-rag-rare-disease.py:1:1: F401 'pinecone.PodSpec' imported but unused
./multi-model-rag-rare-disease.py:3:1: F401 'numpy as np' imported but unused
./multi-model-rag-rare-disease.py:7:1: E302 expected 2 blank lines, found 1
./multi-model-rag-rare-disease.py:45:80: E501 line too long (88 > 79 characters)
./multi-model-rag-rare-disease.py:73:80: E501 line too long (86 > 79 characters)
./multi-model-rag-rare-disease.py:81:80: E501 line too long (119 > 79 characters)
Analyzing file: faiss-llm.py
Running pylint...
************* Module faiss-llm
faiss-llm.py:55:0: C0304: Final newline missing (missing-final-newline)
faiss-llm.py:1:0: C0114: Missing module docstring (missing-module-docstring)
faiss-llm.py:1:0: C0103: Module name "faiss-llm" doesn't conform to snake_case naming style (invalid-name)
faiss-llm.py:1:0: E0401: Unable to import 'PyPDF2' (import-error)
faiss-llm.py:2:0: E0401: Unable to import 'dotenv' (import-error)
faiss-llm.py:3:0: E0401: Unable to import 'langchain.text_splitter' (import-error)
faiss-llm.py:4:0: E0401: Unable to import 'langchain_openai' (import-error)
faiss-llm.py:5:0: E0401: Unable to import 'langchain.chains' (import-error)
faiss-llm.py:6:0: E0401: Unable to import 'langchain_community.vectorstores' (import-error)
faiss-llm.py:7:0: E0401: Unable to import 'langchain.docstore.document' (import-error)
faiss-llm.py:8:0: E0401: Unable to import 'langchain_huggingface' (import-error)
faiss-llm.py:9:0: E0401: Unable to import 'torch' (import-error)
faiss-llm.py:19:0: C0103: Constant name "pdf_path" doesn't conform to UPPER_CASE naming style (invalid-name)
faiss-llm.py:23:0: C0103: Constant name "text" doesn't conform to UPPER_CASE naming style (invalid-name)
faiss-llm.py:52:0: C0103: Constant name "question" doesn't conform to UPPER_CASE naming style (invalid-name)
faiss-llm.py:10:0: C0411: standard import "os" should be placed before third party imports "PyPDF2.PdfReader", "dotenv.load_dotenv", "langchain.text_splitter.RecursiveCharacterTextSplitter" (...) "langchain.docstore.document.Document", "langchain_huggingface.HuggingFaceEmbeddings", "torch" (wrong-import-order)
faiss-llm.py:5:0: C0412: Imports from package langchain are not grouped (ungrouped-imports)
faiss-llm.py:7:0: C0412: Imports from package langchain are not grouped (ungrouped-imports)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Running flake8...
./faiss-llm.py:15:80: E501 line too long (85 > 79 characters)
./faiss-llm.py:28:80: E501 line too long (82 > 79 characters)
./faiss-llm.py:35:80: E501 line too long (87 > 79 characters)
./faiss-llm.py:55:40: W292 no newline at end of file
Analyzing file: tfdemo.py
Running pylint...
************* Module tfdemo
tfdemo.py:16:0: C0304: Final newline missing (missing-final-newline)
tfdemo.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tfdemo.py:2:0: E0401: Unable to import 'tensorflow' (import-error)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Running flake8...
./tfdemo.py:16:13: W292 no newline at end of file
Analyzing file: create_fake_data.py
Running pylint...
************* Module create_fake_data
create_fake_data.py:17:0: C0301: Line too long (101/100) (line-too-long)
create_fake_data.py:33:0: C0304: Final newline missing (missing-final-newline)
create_fake_data.py:1:0: C0114: Missing module docstring (missing-module-docstring)
create_fake_data.py:1:0: E0401: Unable to import 'pandas' (import-error)
create_fake_data.py:2:0: E0401: Unable to import 'faker' (import-error)
create_fake_data.py:8:0: C0116: Missing function or method docstring (missing-function-docstring)
create_fake_data.py:8:23: W0621: Redefining name 'num_entries' from outer scope (line 29) (redefined-outer-name)
create_fake_data.py:29:4: C0103: Constant name "num_entries" doesn't conform to UPPER_CASE naming style (invalid-name)
create_fake_data.py:3:0: C0411: standard import "random" should be placed before third party imports "pandas", "faker.Faker" (wrong-import-order)
-----------------------------------
Your code has been rated at 0.00/10
Running flake8...
./create_fake_data.py:17:80: E501 line too long (101 > 79 characters)
./create_fake_data.py:29:80: E501 line too long (81 > 79 characters)
./create_fake_data.py:32:5: E266 too many leading '#' for block comment
./create_fake_data.py:33:24: W292 no newline at end of file
Analyzing file: indexing-pinecone-tensorflow.py
Running pylint...
************* Module indexing-pinecone-tensorflow
indexing-pinecone-tensorflow.py:78:0: C0301: Line too long (119/100) (line-too-long)
indexing-pinecone-tensorflow.py:1:0: C0114: Missing module docstring (missing-module-docstring)
indexing-pinecone-tensorflow.py:1:0: C0103: Module name "indexing-pinecone-tensorflow" doesn't conform to snake_case naming style (invalid-name)
indexing-pinecone-tensorflow.py:3:0: E0401: Unable to import 'pinecone' (import-error)
indexing-pinecone-tensorflow.py:4:0: E0401: Unable to import 'tensorflow' (import-error)
indexing-pinecone-tensorflow.py:5:0: E0401: Unable to import 'transformers' (import-error)
indexing-pinecone-tensorflow.py:7:0: E0401: Unable to import 'psutil' (import-error)
indexing-pinecone-tensorflow.py:9:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-tensorflow.py:14:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-tensorflow.py:19:11: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-tensorflow.py:24:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-tensorflow.py:33:15: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-tensorflow.py:33:8: W0612: Unused variable 'e' (unused-variable)
indexing-pinecone-tensorflow.py:38:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-tensorflow.py:46:15: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-tensorflow.py:51:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-tensorflow.py:57:11: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-tensorflow.py:62:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-tensorflow.py:68:11: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-tensorflow.py:74:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-tensorflow.py:6:0: C0411: standard import "collections.defaultdict" should be placed before third party imports "pinecone", "tensorflow", "transformers.TFAutoModel" (wrong-import-order)
------------------------------------------------------------------
Your code has been rated at 5.60/10 (previous run: 5.60/10, +0.00)
Running flake8...
./indexing-pinecone-tensorflow.py:9:1: E302 expected 2 blank lines, found 1
./indexing-pinecone-tensorflow.py:14:1: E302 expected 2 blank lines, found 1
./indexing-pinecone-tensorflow.py:33:9: F841 local variable 'e' is assigned to but never used
./indexing-pinecone-tensorflow.py:42:80: E501 line too long (88 > 79 characters)
./indexing-pinecone-tensorflow.py:44:80: E501 line too long (81 > 79 characters)
./indexing-pinecone-tensorflow.py:70:80: E501 line too long (86 > 79 characters)
./indexing-pinecone-tensorflow.py:78:80: E501 line too long (119 > 79 characters)
Analyzing file: pdfToSpeech.py
Running pylint...
************* Module pdfToSpeech
pdfToSpeech.py:18:0: C0304: Final newline missing (missing-final-newline)
pdfToSpeech.py:1:0: C0114: Missing module docstring (missing-module-docstring)
pdfToSpeech.py:1:0: C0103: Module name "pdfToSpeech" doesn't conform to snake_case naming style (invalid-name)
pdfToSpeech.py:1:0: E0401: Unable to import 'PyPDF2' (import-error)
pdfToSpeech.py:9:0: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)
pdfToSpeech.py:15:4: W1510: 'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
pdfToSpeech.py:2:0: C0411: standard import "subprocess" should be placed before third party import "PyPDF2" (wrong-import-order)
pdfToSpeech.py:5:7: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Running flake8...
./pdfToSpeech.py:18:13: W292 no newline at end of file
Analyzing file: openAI-milvus-image-rag.py
Running pylint...
************* Module openAI-milvus-image-rag
openAI-milvus-image-rag.py:1:0: C0114: Missing module docstring (missing-module-docstring)
openAI-milvus-image-rag.py:1:0: C0103: Module name "openAI-milvus-image-rag" doesn't conform to snake_case naming style (invalid-name)
openAI-milvus-image-rag.py:2:0: E0401: Unable to import 'timm' (import-error)
openAI-milvus-image-rag.py:3:0: E0401: Unable to import 'torch' (import-error)
openAI-milvus-image-rag.py:4:0: E0401: Unable to import 'PIL' (import-error)
openAI-milvus-image-rag.py:5:0: E0401: Unable to import 'sklearn.preprocessing' (import-error)
openAI-milvus-image-rag.py:6:0: E0401: Unable to import 'timm.data' (import-error)
openAI-milvus-image-rag.py:7:0: E0401: Unable to import 'timm.data.transforms_factory' (import-error)
openAI-milvus-image-rag.py:18:0: C0115: Missing class docstring (missing-class-docstring)
openAI-milvus-image-rag.py:18:0: R0903: Too few public methods (1/2) (too-few-public-methods)
openAI-milvus-image-rag.py:54:0: E0401: Unable to import 'pymilvus' (import-error)
openAI-milvus-image-rag.py:54:0: C0413: Import "from pymilvus import MilvusClient" should be placed at the top of the module (wrong-import-position)
openAI-milvus-image-rag.py:69:0: C0413: Import "import os" should be placed at the top of the module (wrong-import-position)
openAI-milvus-image-rag.py:73:0: C0103: Constant name "root" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-image-rag.py:74:0: C0103: Constant name "insert" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-image-rag.py:88:0: C0103: Constant name "query_image" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-image-rag.py:104:0: C0103: Constant name "width" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-image-rag.py:105:0: C0103: Constant name "height" doesn't conform to UPPER_CASE naming style (invalid-name)
openAI-milvus-image-rag.py:69:0: C0411: standard import "os" should be placed before third party imports "timm", "torch", "PIL.Image" (...) "timm.data.resolve_data_config", "timm.data.transforms_factory.create_transform", "pymilvus.MilvusClient" (wrong-import-order)
------------------------------------------------------------------
Your code has been rated at 2.17/10 (previous run: 2.17/10, +0.00)
Running flake8...
./openAI-milvus-image-rag.py:18:1: E303 too many blank lines (3)
./openAI-milvus-image-rag.py:34:80: E501 line too long (89 > 79 characters)
./openAI-milvus-image-rag.py:39:80: E501 line too long (86 > 79 characters)
./openAI-milvus-image-rag.py:54:1: E305 expected 2 blank lines after class or function definition, found 1
./openAI-milvus-image-rag.py:54:1: E402 module level import not at top of file
./openAI-milvus-image-rag.py:69:1: E402 module level import not at top of file
./openAI-milvus-image-rag.py:88:80: E501 line too long (100 > 79 characters)
Analyzing file: summarize.py
Running pylint...
************* Module summarize
summarize.py:11:0: C0301: Line too long (114/100) (line-too-long)
summarize.py:12:0: C0301: Line too long (132/100) (line-too-long)
summarize.py:20:0: C0301: Line too long (154/100) (line-too-long)
summarize.py:31:0: C0301: Line too long (133/100) (line-too-long)
summarize.py:39:0: C0304: Final newline missing (missing-final-newline)
summarize.py:1:0: C0114: Missing module docstring (missing-module-docstring)
summarize.py:1:0: E0401: Unable to import 'transformers' (import-error)
summarize.py:2:0: E0401: Unable to import 'requests' (import-error)
summarize.py:3:0: E0401: Unable to import 'bs4' (import-error)
summarize.py:6:0: C0116: Missing function or method docstring (missing-function-docstring)
summarize.py:14:4: W0621: Redefining name 'summary' from outer scope (line 35) (redefined-outer-name)
summarize.py:18:0: C0116: Missing function or method docstring (missing-function-docstring)
summarize.py:31:4: C0103: Constant name "webpage_url" doesn't conform to UPPER_CASE naming style (invalid-name)
-----------------------------------
Your code has been rated at 1.67/10
Running flake8...
./summarize.py:5:1: E266 too many leading '#' for block comment
./summarize.py:6:1: E302 expected 2 blank lines, found 1
./summarize.py:11:80: E501 line too long (114 > 79 characters)
./summarize.py:12:80: E501 line too long (132 > 79 characters)
./summarize.py:17:1: E266 too many leading '#' for block comment
./summarize.py:18:1: E302 expected 2 blank lines, found 1
./summarize.py:20:20: E201 whitespace after '{'
./summarize.py:20:80: E501 line too long (154 > 79 characters)
./summarize.py:20:152: E261 at least two spaces before inline comment
./summarize.py:20:153: E262 inline comment should start with '# '
./summarize.py:30:1: E305 expected 2 blank lines after class or function definition, found 1
./summarize.py:31:80: E501 line too long (133 > 79 characters)
./summarize.py:31:97: E261 at least two spaces before inline comment
./summarize.py:31:98: E262 inline comment should start with '# '
./summarize.py:39:42: W292 no newline at end of file
Analyzing file: openAI-llm-milvus.py
Running pylint...
************* Module openAI-llm-milvus
openAI-llm-milvus.py:4:0: C0301: Line too long (145/100) (line-too-long)
openAI-llm-milvus.py:57:0: C0305: Trailing newlines (trailing-newlines)
openAI-llm-milvus.py:1:0: C0114: Missing module docstring (missing-module-docstring)
openAI-llm-milvus.py:1:0: C0103: Module name "openAI-llm-milvus" doesn't conform to snake_case naming style (invalid-name)
openAI-llm-milvus.py:1:0: E0401: Unable to import 'openai' (import-error)
openAI-llm-milvus.py:2:0: E0401: Unable to import 'pymilvus' (import-error)
------------------------------------------------------------------
Your code has been rated at 3.91/10 (previous run: 3.91/10, +0.00)
Running flake8...
./openAI-llm-milvus.py:4:80: E501 line too long (145 > 79 characters)
./openAI-llm-milvus.py:17:80: E501 line too long (81 > 79 characters)
./openAI-llm-milvus.py:32:80: E501 line too long (85 > 79 characters)
./openAI-llm-milvus.py:42:80: E501 line too long (84 > 79 characters)
./openAI-llm-milvus.py:57:1: W391 blank line at end of file
Analyzing file: remove_background.py
Running pylint...
************* Module remove_background
remove_background.py:13:0: C0304: Final newline missing (missing-final-newline)
remove_background.py:1:0: C0114: Missing module docstring (missing-module-docstring)
remove_background.py:1:0: E0401: Unable to import 'rembg' (import-error)
remove_background.py:2:0: E0401: Unable to import 'PIL' (import-error)
remove_background.py:5:0: C0103: Constant name "input_img" doesn't conform to UPPER_CASE naming style (invalid-name)
remove_background.py:6:0: C0103: Constant name "output_img" doesn't conform to UPPER_CASE naming style (invalid-name)
-----------------------------------
Your code has been rated at 0.00/10
Running flake8...
./remove_background.py:4:1: E266 too many leading '#' for block comment
./remove_background.py:8:1: E266 too many leading '#' for block comment
./remove_background.py:12:1: E266 too many leading '#' for block comment
./remove_background.py:13:24: W292 no newline at end of file
Analyzing file: open_links.py
Running pylint...
************* Module open_links
open_links.py:1:0: C0114: Missing module docstring (missing-module-docstring)
open_links.py:3:5: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
------------------------------------------------------------------
Your code has been rated at 7.14/10 (previous run: 7.14/10, +0.00)
Running flake8...
Analyzing file: test-milvus.py
Running pylint...
************* Module test-milvus
test-milvus.py:120:0: C0305: Trailing newlines (trailing-newlines)
test-milvus.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test-milvus.py:1:0: C0103: Module name "test-milvus" doesn't conform to snake_case naming style (invalid-name)
test-milvus.py:1:0: E0401: Unable to import 'pymilvus' (import-error)
test-milvus.py:12:0: E0401: Unable to import 'pymilvus' (import-error)
test-milvus.py:12:0: C0413: Import "from pymilvus import model" should be placed at the top of the module (wrong-import-position)
test-milvus.py:34:0: C0413: Import "import random" should be placed at the top of the module (wrong-import-position)
test-milvus.py:114:0: E0401: Unable to import 'pymilvus' (import-error)
test-milvus.py:114:0: W0404: Reimport 'MilvusClient' (imported line 1) (reimported)
test-milvus.py:114:0: C0413: Import "from pymilvus import MilvusClient" should be placed at the top of the module (wrong-import-position)
test-milvus.py:34:0: C0411: standard import "random" should be placed before third party imports "pymilvus.MilvusClient", "pymilvus.model" (wrong-import-order)
------------------------------------------------------------------
Your code has been rated at 4.39/10 (previous run: 4.39/10, +0.00)
Running flake8...
./test-milvus.py:12:1: E402 module level import not at top of file
./test-milvus.py:34:1: E402 module level import not at top of file
./test-milvus.py:67:80: E501 line too long (80 > 79 characters)
./test-milvus.py:114:1: E402 module level import not at top of file
./test-milvus.py:120:1: W391 blank line at end of file
Analyzing file: spark-llm.py
Running pylint...
************* Module spark-llm
spark-llm.py:95:0: C0304: Final newline missing (missing-final-newline)
spark-llm.py:1:0: C0114: Missing module docstring (missing-module-docstring)
spark-llm.py:1:0: C0103: Module name "spark-llm" doesn't conform to snake_case naming style (invalid-name)
spark-llm.py:1:0: E0401: Unable to import 'PyPDF2' (import-error)
spark-llm.py:2:0: E0401: Unable to import 'langchain.text_splitter' (import-error)
spark-llm.py:3:0: E0401: Unable to import 'databricks.vector_search.client' (import-error)
spark-llm.py:4:0: E0401: Unable to import 'transformers' (import-error)
spark-llm.py:5:0: E0401: Unable to import 'openai' (import-error)
spark-llm.py:6:0: E0401: Unable to import 'databricks.sdk' (import-error)
spark-llm.py:16:0: C0103: Constant name "pdf_path" doesn't conform to UPPER_CASE naming style (invalid-name)
spark-llm.py:20:0: C0103: Constant name "text" doesn't conform to UPPER_CASE naming style (invalid-name)
spark-llm.py:32:0: C0116: Missing function or method docstring (missing-function-docstring)
spark-llm.py:32:15: W0621: Redefining name 'text' from outer scope (line 20) (redefined-outer-name)
spark-llm.py:40:0: C0103: Constant name "table_name" doesn't conform to UPPER_CASE naming style (invalid-name)
spark-llm.py:56:0: C0103: Constant name "index_name" doesn't conform to UPPER_CASE naming style (invalid-name)
spark-llm.py:66:0: E0401: Unable to import 'langchain.vectorstores' (import-error)
spark-llm.py:66:0: C0413: Import "from langchain.vectorstores import DatabricksVectorSearch" should be placed at the top of the module (wrong-import-position)
spark-llm.py:67:0: E0401: Unable to import 'langchain.embeddings' (import-error)
spark-llm.py:67:0: C0413: Import "from langchain.embeddings import HuggingFaceEmbeddings" should be placed at the top of the module (wrong-import-position)
spark-llm.py:68:0: E0401: Unable to import 'langchain.llms' (import-error)
spark-llm.py:68:0: C0413: Import "from langchain.llms import OpenAI" should be placed at the top of the module (wrong-import-position)
spark-llm.py:69:0: E0401: Unable to import 'langchain.chains' (import-error)
spark-llm.py:69:0: C0413: Import "from langchain.chains import RetrievalQA" should be placed at the top of the module (wrong-import-position)
spark-llm.py:92:0: C0103: Constant name "question" doesn't conform to UPPER_CASE naming style (invalid-name)
spark-llm.py:6:0: C0412: Imports from package databricks are not grouped (ungrouped-imports)
spark-llm.py:66:0: C0412: Imports from package langchain are not grouped (ungrouped-imports)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Running flake8...
./spark-llm.py:25:80: E501 line too long (82 > 79 characters)
./spark-llm.py:29:80: E501 line too long (83 > 79 characters)
./spark-llm.py:32:1: E302 expected 2 blank lines, found 1
./spark-llm.py:33:80: E501 line too long (80 > 79 characters)
./spark-llm.py:37:1: E305 expected 2 blank lines after class or function definition, found 1
./spark-llm.py:66:1: E402 module level import not at top of file
./spark-llm.py:67:1: E402 module level import not at top of file
./spark-llm.py:68:1: E402 module level import not at top of file
./spark-llm.py:69:1: E402 module level import not at top of file
./spark-llm.py:95:30: W292 no newline at end of file
Analyzing file: multi-llm.py
Running pylint...
************* Module multi-llm
multi-llm.py:9:0: C0301: Line too long (127/100) (line-too-long)
multi-llm.py:64:0: C0301: Line too long (120/100) (line-too-long)
multi-llm.py:71:0: C0301: Line too long (116/100) (line-too-long)
multi-llm.py:88:0: C0304: Final newline missing (missing-final-newline)
multi-llm.py:1:0: C0114: Missing module docstring (missing-module-docstring)
multi-llm.py:1:0: C0103: Module name "multi-llm" doesn't conform to snake_case naming style (invalid-name)
multi-llm.py:1:0: E0401: Unable to import 'streamlit' (import-error)
multi-llm.py:2:0: E0401: Unable to import 'mem0' (import-error)
multi-llm.py:3:0: E0401: Unable to import 'openai' (import-error)
multi-llm.py:5:0: E0401: Unable to import 'litellm' (import-error)
multi-llm.py:53:12: C0103: Constant name "context" doesn't conform to UPPER_CASE naming style (invalid-name)
multi-llm.py:76:33: E0606: Possibly using variable 'answer' before assignment (possibly-used-before-assignment)
multi-llm.py:4:0: C0411: standard import "os" should be placed before third party imports "streamlit", "mem0.Memory", "openai.OpenAI" (wrong-import-order)
------------------------------------------------------------------
Your code has been rated at 2.83/10 (previous run: 2.83/10, +0.00)
Running flake8...
./multi-llm.py:9:80: E501 line too long (127 > 79 characters)
./multi-llm.py:31:80: E501 line too long (87 > 79 characters)
./multi-llm.py:64:80: E501 line too long (120 > 79 characters)
./multi-llm.py:71:80: E501 line too long (116 > 79 characters)
./multi-llm.py:74:80: E501 line too long (92 > 79 characters)
./multi-llm.py:88:75: W292 no newline at end of file
Analyzing file: indexing-pinecone-pytorch.py
Running pylint...
************* Module indexing-pinecone-pytorch
indexing-pinecone-pytorch.py:11:0: C0301: Line too long (109/100) (line-too-long)
indexing-pinecone-pytorch.py:42:0: C0301: Line too long (106/100) (line-too-long)
indexing-pinecone-pytorch.py:1:0: C0114: Missing module docstring (missing-module-docstring)
indexing-pinecone-pytorch.py:1:0: C0103: Module name "indexing-pinecone-pytorch" doesn't conform to snake_case naming style (invalid-name)
indexing-pinecone-pytorch.py:3:0: E0401: Unable to import 'pinecone' (import-error)
indexing-pinecone-pytorch.py:4:0: E0401: Unable to import 'transformers' (import-error)
indexing-pinecone-pytorch.py:5:0: E0401: Unable to import 'torch' (import-error)
indexing-pinecone-pytorch.py:7:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-pytorch.py:14:11: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-pytorch.py:18:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-pytorch.py:23:11: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-pytorch.py:27:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-pytorch.py:36:15: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-pytorch.py:40:0: C0116: Missing function or method docstring (missing-function-docstring)
indexing-pinecone-pytorch.py:44:11: W0718: Catching too general exception Exception (broad-exception-caught)
indexing-pinecone-pytorch.py:40:27: W0613: Unused argument 'texts' (unused-argument)
indexing-pinecone-pytorch.py:47:0: C0116: Missing function or method docstring (missing-function-docstring)
------------------------------------------------------------------
Your code has been rated at 5.00/10 (previous run: 5.00/10, +0.00)
Running flake8...
./indexing-pinecone-pytorch.py:7:1: E302 expected 2 blank lines, found 1
./indexing-pinecone-pytorch.py:11:80: E501 line too long (109 > 79 characters)
./indexing-pinecone-pytorch.py:18:1: E302 expected 2 blank lines, found 1
./indexing-pinecone-pytorch.py:27:1: E302 expected 2 blank lines, found 1
./indexing-pinecone-pytorch.py:31:80: E501 line too long (88 > 79 characters)
./indexing-pinecone-pytorch.py:40:1: E302 expected 2 blank lines, found 1
./indexing-pinecone-pytorch.py:42:80: E501 line too long (106 > 79 characters)
./indexing-pinecone-pytorch.py:47:1: E302 expected 2 blank lines, found 1
./indexing-pinecone-pytorch.py:78:1: E305 expected 2 blank lines after class or function definition, found 1
Process finished with exit code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment