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 and not self.arguments[opt[0]].deprecated_by]
        optional = [opt[0] for opt in sorted_arguments if not self.arguments[opt[0]].mandatory and not self.arguments[opt[0]].deprecated_by]
        if mandatory:
            self.arguments_string = '\nMANDATORY ARGUMENTS\n'
            for opt in mandatory:
                # 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.align(self.arguments[opt].description)]
                self.arguments_string += self.tab(line) + '\n'
        if optional:
            self.arguments_string += '\nOPTIONAL ARGUMENTS\n'
            for opt in optional:
                # 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)
                description = self.arguments[opt].description
                if self.arguments[opt].default_value:
                    description += " Default value = "+str(self.arguments[opt].default_value)
                if self.arguments[opt].deprecated:
                    description += " Deprecated argument!"
                line = [" "+opt+" "+type_value, self.align(description)]
                self.arguments_string += self.tab(line) + '\n'

        if len(self.arguments)+1 in self.section:
            self.arguments_string += self.section[len(self.arguments)+1] + '\n'
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/msct_parser.py/Usage.set_arguments/original