Commit c5bdc567 authored by uydwj's avatar uydwj
Browse files

ADD: New helper functions

parent 619a465c
Pipeline #112206 failed with stage
in 16 seconds
...@@ -18,7 +18,19 @@ class ArgumentParser(argparse.ArgumentParser): ...@@ -18,7 +18,19 @@ class ArgumentParser(argparse.ArgumentParser):
self.add_argument('--api-version', default=default_api_version, self.add_argument('--api-version', default=default_api_version,
help='webapi version') help='webapi version')
def parse_args(self): def parse_args(self, args=None, namespace=None):
args = super(ArgumentParser, self).parse_args() args = super(ArgumentParser, self).parse_args(args, namespace)
return args 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]] = []
return res
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment