Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docs.it4i.cz
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCS
docs.it4i.cz
Merge requests
!261
Fixed search shortcut in matrix form
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fixed search shortcut in matrix form
fix_search_shortcut
into
master
Overview
0
Commits
7
Pipelines
0
Changes
2
Merged
David Hrbáč
requested to merge
fix_search_shortcut
into
master
5 years ago
Overview
0
Commits
7
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
master
version 5
b84eb61c
5 years ago
version 4
c27fd171
5 years ago
version 3
5cc372ad
5 years ago
version 2
e7acd913
5 years ago
version 1
e513a7e9
5 years ago
master (base)
and
latest version
latest version
930a54f0
7 commits,
5 years ago
version 5
b84eb61c
6 commits,
5 years ago
version 4
c27fd171
5 commits,
5 years ago
version 3
5cc372ad
4 commits,
5 years ago
version 2
e7acd913
2 commits,
5 years ago
version 1
e513a7e9
1 commit,
5 years ago
2 files
+
47
−
43
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
scripts/modules-json.py
+
20
−
18
Options
@@ -9,13 +9,14 @@ import re
from
distutils.version
import
LooseVersion
def
get_data
(
filename
):
'''
function to read the data form the input csv file to use in the analysis
'''
reader
=
[]
# Just in case the file open fails
reader
=
[]
# Just in case the file open fails
with
open
(
filename
,
'
rb
'
)
as
f
:
reader
=
csv
.
reader
(
f
,
delimiter
=
'
,
'
)
#returns all the data from the csv file in list form
#f.close() # May need to close the file when done
reader
=
csv
.
reader
(
f
,
delimiter
=
'
,
'
)
#
returns all the data from the csv file in list form
#
f.close() # May need to close the file when done
return
list
(
reader
)
# only return the reader when you have finished.
your_list
=
[]
@@ -28,8 +29,9 @@ your_list += get_data('./scripts/barbora.csv')
counts
=
dict
()
for
i
in
your_list
:
counts
[
i
[
0
]]
=
counts
.
get
(
i
[
0
],
0
)
+
int
(
i
[
1
])
counts
[
i
[
0
]]
=
counts
.
get
(
i
[
0
],
0
)
+
int
(
i
[
1
])
# 1 2 4 8 16 32
l
=
[
'
A
'
,
'
S
'
,
'
U
'
,
'
P
'
,
'
D
'
,
'
B
'
]
c
=
[]
mask
=
''
.
join
(
reversed
(
l
))
@@ -49,23 +51,23 @@ versions = ''
clusters
=
''
prev
=
''
for
m
,
i
in
sorted
(
counts
.
items
()):
#print m
split
=
m
.
split
(
'
/
'
)
#print split
if
len
(
split
)
>
1
:
a
=
split
[
0
]
b
=
split
[
1
]
if
split
[
0
]
<>
prev
:
software
[
a
]
=
{}
software
[
a
][
b
]
=
'
`
'
+
c
[
i
]
+
'
`
'
prev
=
a
for
m
,
i
in
sorted
(
counts
.
items
()):
#
print m
split
=
m
.
split
(
'
/
'
)
#
print split
if
len
(
split
)
>
1
:
a
=
split
[
0
]
b
=
split
[
1
]
if
split
[
0
]
<>
prev
:
software
[
a
]
=
{}
software
[
a
][
b
]
=
'
`
'
+
c
[
i
]
+
'
`
'
prev
=
a
packages
=
{}
for
m
in
sorted
(
software
.
items
(),
key
=
lambda
i
:
i
[
0
].
lower
()):
packages
[
m
[
0
]]
=
sorted
(
m
[
1
],
key
=
LooseVersion
)[
len
(
m
[
1
])
-
1
]
packages
[
m
[
0
]]
=
sorted
(
m
[
1
],
key
=
LooseVersion
)[
len
(
m
[
1
])
-
1
]
data
=
{
'
total
'
:
len
(
packages
),
'
projects
'
:
packages
}
data
=
{
'
total
'
:
len
(
packages
),
'
projects
'
:
packages
}
print
json
.
dumps
(
data
)
Loading