def METHOD_NAME(self, *args, **options):
    # parse options
    verbosity = int(options['verbosity'])
    if len(args) == 1 and args[0] == 'indicator':
        indicators = find_orphaned_indicators()
        periods = []
        self.stdout.write('Fixing {} orphaned indicators'.format(len(indicators)))
    elif len(args) == 1 and args[0] == 'indicator_period':
        indicators = []
        periods = find_orphaned_periods()
        self.stdout.write('Fixing {} orphaned periods'.format(len(periods)))
    elif len(args) == 3 and args[0] == 'indicator':
        indicators = [(int(args[1]), int(args[2]))]
        periods = []
    elif len(args) == 3 and args[0] == 'indicator_period':
        indicators = []
        periods = [(int(args[1]), int(args[2]))]
    else:
        print('Usage: {} {}'.format(sys.argv[0], self.args))
        sys.exit(1)
    for child_id, parent_id in indicators:
        child_indicator = Indicator.objects.get(id=child_id)
        parent_indicator = Indicator.objects.get(id=parent_id)
        assertion_message = '{} cannot be a parent of {}'.format(parent_id, child_id)
        assert child_indicator.result.parent_result == parent_indicator.result, assertion_message
        child_indicator.parent_indicator = parent_indicator
        child_indicator.save()
        # Any additional missing data is taken care of by saving the parent.
        # parent_indicator.save()
        if verbosity > 1:
            self.stdout.write('{} indicator made parent of {}'.format(parent_id, child_id))
    for child_id, parent_id in periods:
        child_period = IndicatorPeriod.objects.get(id=child_id)
        parent_period = IndicatorPeriod.objects.get(id=parent_id)
        child_result = child_period.indicator.result
        parent_result = parent_period.indicator.result
        assertion_message = '{} cannot be a parent of {}'.format(parent_id, child_id)
        assert child_result.parent_result == parent_result, assertion_message
        child_period.parent_period = parent_period
        child_period.save()
        # Any additional missing data is taken care of by saving the parent.
        # parent_period.save()
        if parent_period.indicator.periods.count() != child_period.indicator.periods.count():
            print('No. of periods mismatch with parent :: ')
            pprint_period_lineage(parent_period)
        if verbosity > 1:
            self.stdout.write('{} period made parent of {}'.format(parent_id, child_id))
    if indicators:
        fixed_indicators = ', '.join(str(id_) for id_, _ in indicators)
        self.stdout.write('Fixed parents for indicator ids: {}'.format(fixed_indicators))
    if periods:
        fixed_periods = ', '.join(str(id_) for id_, _ in periods)
        self.stdout.write('Fixed parents for period ids: {}'.format(fixed_periods))