thedamn commited on
Commit
9f11d49
·
1 Parent(s): 8d9969f

morning jope commit

Browse files
Files changed (3) hide show
  1. app.py +5 -0
  2. proper_main.py +6 -6
  3. resource.py +2 -1
app.py CHANGED
@@ -13,7 +13,10 @@ def main():
13
  # Generate response
14
  if st.button("Submit"):
15
 
 
 
16
  repos, status = web_scrape(user_url)
 
17
  #task_progress = st.progress(0)
18
  #task_progress.progress("Tools is taking action please wait")
19
  if status == 0:
@@ -23,6 +26,8 @@ def main():
23
  response_gpt = llm_chain([str(query)])
24
  # Display the response
25
  st.text_area("Bot Response:", value=response_gpt, height=100)
 
 
26
  else:
27
  output = st.empty()
28
  output.error("Error occurred. Please contact the admin {e}.")
 
13
  # Generate response
14
  if st.button("Submit"):
15
 
16
+ st.text("Please wait Automation is Processing")
17
+ strttime=time.time()
18
  repos, status = web_scrape(user_url)
19
+
20
  #task_progress = st.progress(0)
21
  #task_progress.progress("Tools is taking action please wait")
22
  if status == 0:
 
26
  response_gpt = llm_chain([str(query)])
27
  # Display the response
28
  st.text_area("Bot Response:", value=response_gpt, height=100)
29
+ elapsed_time = time.time() - strttime
30
+ st.text(f"Execution time: {elapsed_time:.2f} seconds")
31
  else:
32
  output = st.empty()
33
  output.error("Error occurred. Please contact the admin {e}.")
proper_main.py CHANGED
@@ -67,11 +67,11 @@ def data_cleaning(directory):
67
  for filename in files:
68
  file_path = os.path.join(root, filename)
69
 
70
- if filename.endswith(".ipynb"):
71
- output, _ = exporter.from_filename(file_path)
72
- with open(os.path.join(root, filename[:-6] + ".py"), "w") as script_file:
73
- script_file.write(output)
74
- os.remove(file_path)
75
 
76
  if not (filename.endswith(".py") or filename.endswith(".ipynb")):
77
  os.remove(file_path)
@@ -89,7 +89,7 @@ def analyse():
89
  print(file)
90
  path = os.getcwd() + "/" + file
91
 
92
- cmd = ["radon", "cc", "--total-average", file]
93
  res = sp.check_output(cmd)
94
  index = res.decode().find("Average")
95
  if index <= 0:
 
67
  for filename in files:
68
  file_path = os.path.join(root, filename)
69
 
70
+ #if filename.endswith(".ipynb"):
71
+ #output, _ = exporter.from_filename(file_path)
72
+ #with open(os.path.join(root, filename[:-6] + ".py"), "w") as script_file:
73
+ # script_file.write(output)
74
+ #os.remove(file_path)
75
 
76
  if not (filename.endswith(".py") or filename.endswith(".ipynb")):
77
  os.remove(file_path)
 
89
  print(file)
90
  path = os.getcwd() + "/" + file
91
 
92
+ cmd = ["radon", "cc", "--total-average","--include-ipynb", file]
93
  res = sp.check_output(cmd)
94
  index = res.decode().find("Average")
95
  if index <= 0:
resource.py CHANGED
@@ -19,7 +19,8 @@ score Rank Risk
19
  31 - 40 E High - Complex block, alarming
20
  41+ F Very high - Error-prone, unstable block
21
 
22
- based on the score and rank you have to return only one most complex repo from report
 
23
 
24
  Report: {question}
25
 
 
19
  31 - 40 E High - Complex block, alarming
20
  41+ F Very high - Error-prone, unstable block
21
 
22
+ based on the score and rank you have to return only one most complex repo which has high risk from report
23
+ if all the repos are at the same rank and score choose randomly one
24
 
25
  Report: {question}
26