Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
netdb-client-lib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scc-net
netvs
netdb-client-lib
Commits
c5bdc567
Commit
c5bdc567
authored
Oct 09, 2020
by
Dominik Rimpf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD: New helper functions
parent
619a465c
Pipeline
#112206
failed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
netdb_client/util.py
netdb_client/util.py
+14
-2
No files found.
netdb_client/util.py
View file @
c5bdc567
...
...
@@ -18,7 +18,19 @@ class ArgumentParser(argparse.ArgumentParser):
self
.
add_argument
(
'--api-version'
,
default
=
default_api_version
,
help
=
'webapi version'
)
def
parse_args
(
self
):
args
=
super
(
ArgumentParser
,
self
).
parse_args
()
def
parse_args
(
self
,
args
=
None
,
namespace
=
None
):
args
=
super
(
ArgumentParser
,
self
).
parse_args
(
args
,
namespace
)
return
args
def
dict_by_value_of_list
(
array
,
value
):
return
((
item
[
value
],
item
)
for
item
in
array
)
def
dict_of_lists_by_value_of_list
(
array
,
value
):
res
=
{}
for
item
in
array
:
if
not
item
[
value
]
in
res
:
res
[
item
[
value
]]
=
[]
res
[
item
[
value
]].
append
(
item
)
return
res
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment