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

Hope wins commit

Browse files
Files changed (3) hide show
  1. app.py +5 -5
  2. proper_main.py +8 -4
  3. resource.py +1 -1
app.py CHANGED
@@ -15,17 +15,17 @@ def main():
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:
23
- repo_path = data_cloning(repos)
24
- data_cleaning(repo_path)
25
- query = analyse()
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:
 
15
 
16
  st.text("Please wait Automation is Processing")
17
  strttime=time.time()
18
+ repos, status = web_scrape(user_url,st)
19
 
20
  #task_progress = st.progress(0)
21
  #task_progress.progress("Tools is taking action please wait")
22
  if status == 0:
23
+ repo_path = data_cloning(repos,st)
24
+ data_cleaning(repo_path,st)
25
+ query = analyse(st)
26
  response_gpt = llm_chain([str(query)])
27
  # Display the response
28
+ st.text_area("Bot Response:", value=response_gpt['text'], height=100)
29
  elapsed_time = time.time() - strttime
30
  st.text(f"Execution time: {elapsed_time:.2f} seconds")
31
  else:
proper_main.py CHANGED
@@ -23,8 +23,9 @@ except Exception as e:
23
 
24
 
25
 
26
- def web_scrape(user_url):
27
  base_url = "https://www.github.com"
 
28
  repos = []
29
  user_url = user_url
30
 
@@ -51,8 +52,9 @@ def web_scrape(user_url):
51
  return (repos,0)
52
 
53
 
54
- def data_cloning(repos):
55
  os.mkdir("/tmp/repos")
 
56
  os.chdir("/tmp/repos")
57
  for i in repos:
58
  sp.run(["git", "clone", i], stdout=sp.DEVNULL, stderr=sp.DEVNULL)
@@ -60,8 +62,9 @@ def data_cloning(repos):
60
  return os.getcwd()
61
 
62
 
63
- def data_cleaning(directory):
64
  exporter = PythonExporter()
 
65
 
66
  for root, dirs, files in os.walk(directory, topdown=False):
67
  for filename in files:
@@ -82,8 +85,9 @@ def data_cleaning(directory):
82
  os.rmdir(dir_path)
83
 
84
 
85
- def analyse():
86
  project_and_grades = {}
 
87
 
88
  for file in os.listdir(os.getcwd()):
89
  print(file)
 
23
 
24
 
25
 
26
+ def web_scrape(user_url,st):
27
  base_url = "https://www.github.com"
28
+ st.text("Extracting the Repos")
29
  repos = []
30
  user_url = user_url
31
 
 
52
  return (repos,0)
53
 
54
 
55
+ def data_cloning(repos,st):
56
  os.mkdir("/tmp/repos")
57
+ st.text("Cloning the Repos")
58
  os.chdir("/tmp/repos")
59
  for i in repos:
60
  sp.run(["git", "clone", i], stdout=sp.DEVNULL, stderr=sp.DEVNULL)
 
62
  return os.getcwd()
63
 
64
 
65
+ def data_cleaning(directory,st):
66
  exporter = PythonExporter()
67
+ st.text("Cleaning the Repos")
68
 
69
  for root, dirs, files in os.walk(directory, topdown=False):
70
  for filename in files:
 
85
  os.rmdir(dir_path)
86
 
87
 
88
+ def analyse(st):
89
  project_and_grades = {}
90
+ st.text("Analysing...")
91
 
92
  for file in os.listdir(os.getcwd()):
93
  print(file)
resource.py CHANGED
@@ -19,7 +19,7 @@ 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 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}
 
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 more score from report
23
  if all the repos are at the same rank and score choose randomly one
24
 
25
  Report: {question}