def __init__(self, *args, **kwargs):
        """Allow defaults for arguments to be set in settings.GRAPH_MODELS.

        Each argument in self.arguments is a dict where the key is the
        space-separated args and the value is our kwarg dict.

        The default from settings is keyed as the long arg name with '--'
        removed and any '-' replaced by '_'.
        """
        self.arguments = {
            '--pygraphviz': {
                'action': 'store_true', 'dest': 'pygraphviz',
                'help': 'Use PyGraphViz to generate the image.'},

            '--pydot': {'action': 'store_true', 'dest': 'pydot',
                        'help': 'Use PyDot to generate the image.'},

            '--disable-fields -d': {
                'action': 'store_true', 'dest': 'disable_fields',
                'help': 'Do not show the class member fields'},

            '--group-models -g': {
                'action': 'store_true', 'dest': 'group_models',
                'help': 'Group models together respective to their '
                'application'},

            '--all-applications -a': {
                'action': 'store_true', 'dest': 'all_applications',
                'help': 'Automatically include all applications from '
                'INSTALLED_APPS'},

            '--output -o': {
                'action': 'store', 'dest': 'outputfile',
                'help': 'Render output file. Type of output dependend on file '
                'extensions. Use png or jpg to render graph to image.'},

            '--layout -l': {
                'action': 'store', 'dest': 'layout', 'default': 'dot',
                'help': 'Layout to be used by GraphViz for visualization. '
                'Layouts: circo dot fdp neato nop nop1 nop2 twopi'},

            '--verbose-names -n': {
                'action': 'store_true', 'dest': 'verbose_names',
                'help': 'Use verbose_name of models and fields'},

            '--language -L': {
                'action': 'store', 'dest': 'language',
                'help': 'Specify language used for verbose_name localization'},

            '--exclude-columns -x': {
                'action': 'store', 'dest': 'exclude_columns',
                'help': 'Exclude specific column(s) from the graph. '
                'Can also load exclude list from file.'},

            '--exclude-models -X': {
                'action': 'store', 'dest': 'exclude_models',
                'help': 'Exclude specific model(s) from the graph. Can also '
                'load exclude list from file. Wildcards (*) are allowed.'},

            '--include-models -I': {
                'action': 'store', 'dest': 'include_models',
                'help': 'Restrict the graph to specified models. Wildcards '
                '(*) are allowed.'},

            '--inheritance -e': {
                'action': 'store_true', 'dest': 'inheritance', 'default': True,
                'help': 'Include inheritance arrows (default)'},

            '--no-inheritance -E': {
                'action': 'store_false', 'dest': 'inheritance',
                'help': 'Do not include inheritance arrows'},

            '--hide-relations-from-fields -R': {
                'action': 'store_false', 'dest': 'relations_as_fields',
                'default': True,
                'help': 'Do not show relations as fields in the graph.'},

            '--disable-sort-fields -S': {
                'action': 'store_false', 'dest': 'sort_fields',
                'default': True, 'help': 'Do not sort fields'},

            '--json': {'action': 'store_true', 'dest': 'json',
                       'help': 'Output graph data as JSON'}
        }

        defaults = getattr(settings, 'GRAPH_MODELS', None)

        if defaults:
            for argument in self.arguments:
                arg_split = argument.split(' ')
                setting_opt = arg_split[0].lstrip('-').replace('-', '_')
                if setting_opt in defaults:
                    self.arguments[argument]['default'] = defaults[setting_opt]

        super(Command, self).__init__(*args, **kwargs)
dataset/ETHPy150Open django-extensions/django-extensions/django_extensions/management/commands/graph_models.py/Command.__init__/original