def set_arguments(self):
        sorted_arguments = sorted(self.arguments.items(), key=lambda x: x[1].order)
        mandatory = [opt[0] for opt in sorted_arguments if self.arguments[opt[0]].mandatory]
        optional = [opt[0] for opt in sorted_arguments if not self.arguments[opt[0]].mandatory]
        if mandatory:
            self.arguments_string = '\n\nMANDATORY ARGUMENTS  |` `\n--------------------|---\n'
            for opt in mandatory:
                self.arguments_string += '`'
                # check if section description has to been displayed
                if self.arguments[opt].order in self.section:
                    self.arguments_string += self.section[self.arguments[opt].order] + '\n'
                # display argument
                type_value = self.refactor_type_value(opt)
                line = ["  "+opt+" "+type_value+'`', '|'+self.arguments[opt].description]
                self.arguments_string += self.tab(line) + '\n'
        if optional:
            self.arguments_string += '\n\nOPTIONAL ARGUMENTS  |` `\n--------------------|---\n'
            for opt in optional:
                if not self.arguments[opt].deprecated_rm and not self.arguments[opt].deprecated and self.arguments[opt].deprecated_by is None:
                    self.arguments_string += '`'
                    # check if section description has to been displayed
                    if self.arguments[opt].order in self.section:
                        self.arguments_string += self.section[self.arguments[opt].order] + '\n'
                    # display argument
                    type_value = self.refactor_type_value(opt)
                    line = ["  "+opt+" "+type_value+'`', '|'+self.arguments[opt].description]
                    self.arguments_string += self.tab(line) + '\n'
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/msct_parser.py/DocSourceForge.set_arguments/original