Discard any 'none' values if more directives are supplied since none may override values.
354074
def reject_all_values_if_none(source_list)
      if source_list.length > 1
        source_list.reject { |value| value == NONE }
      else
        source_list
      end
    end
1003008
def _strip_nones(d: Dict[str, Any])-> Dict[str, Any]:
        
        return OrderedDict({k: None if isinstance(v, JSGNull) else v for k, v in d.items()
                            if not k.startswith("_") and v is not None and v is not Empty and
                            (issubclass(type(v), JSGObject) or
                             (not issubclass(type(v), JSGString) or v.val is not None) and
                             (not issubclass(type(v), AnyType) or v.val is not Empty))})
329396
def remove_override(self, key):
        """"""
        keys = key.split('.')
        if len(keys) > 1:
            raise NotImplementedError
        elif key in self.overrides:
            del self.overrides[key]
            self._uncache(key)
494877
def split_none(self):
        ""
        val = self[[]]
        val.ignore_empty = True
        return self._split(self.path, self, val)
669266
def _remove_non_methods():
  """"""
  cur_module = sys.modules[__name__]
  my_globals = dict(globals())
  # Import here so that it doesn't get added to the global namespace or deleted.
  # pylint: disable=g-import-not-at-top
  from prettytensor.pretty_tensor_class import PrettyTensor
  for name, _ in six.iteritems(my_globals):
    if not hasattr(PrettyTensor, name):
      delattr(cur_module, name)
  # Remove a couple of special ones....
  if hasattr(cur_module, 'bookkeeper'):
    delattr(cur_module, 'bookkeeper')
896861
def leave_Directive(self, node, *args):
        """"""
        name_to_arg_value = {
            # Taking [0] is ok here because the GraphQL parser checks for the
            # existence of ':' in directive arguments.
            arg.split(':', 1)[0]: arg
            for arg in node.arguments
        }

        ordered_args = node.arguments
        directive = DIRECTIVES_BY_NAME.get(node.name)
        if directive:
            sorted_args = []
            encountered_argument_names = set()

            # Iterate through all defined arguments in the directive schema.
            for defined_arg_name in six.iterkeys(directive.args):
                if defined_arg_name in name_to_arg_value:
                    # The argument was present in the query, print it in the correct order.
                    encountered_argument_names.add(defined_arg_name)
                    sorted_args.append(name_to_arg_value[defined_arg_name])

            # Get all the arguments that weren't defined in the directive schema.
            # They will be printed after all the arguments that were in the schema.
            unsorted_args = [
                value
                for name, value in six.iteritems(name_to_arg_value)
                if name not in encountered_argument_names
            ]

            ordered_args = sorted_args + unsorted_args

        return '@' + node.name + wrap('(', join(ordered_args, ', '), ')')
1002293
def exclude_bacon(self, limit):
        
        for src in list(self.sources.values()):
            if src.bacon > limit:
                src.excluded = True
                # print "Excluding bacon:", src.name
                self._add_skip(src.name)
961599
def discard_config(self):
        """"""
        if self.config_session is not None:
            commands = []
            commands.append('configure session {}'.format(self.config_session))
            commands.append('abort')
            self.device.run_commands(commands)
            self.config_session = None
335926
def _skip(options):
    """"""
    values = [options.missing_direct_deps, options.unnecessary_deps]
    return all(v == 'off' for v in values)
165659
def ClearAllVar(self):
    """"""
    self.value = None
    # Call OnClearAllVar on options.
    _ = [option.OnClearAllVar() for option in self.options]
535401
def discard(self, value):
        ''''''
        return self.cache.remove((self.value_pickler.dumps(value),))
72567
def skip(self, ns):
        
        return ns in (None, Namespace.default, Namespace.xsdns, Namespace.xsins, Namespace.xmlns)
94112
function removeAttrsValues(attrs, ignoreAttributes) {
    _.forEach(ignoreAttributes, function (attr) {
        var attrIndexes = _getIndexesInArray(attrs, attr);

        _.forEach(attrIndexes, function (index) {
            attrs[index].value = '';
        });
    });

    return attrs;
}
608950
def _remove_none(data):
    
    if isinstance(data, list) or isinstance(data, tuple):
        return [x for x in data if x is not None]

    out = OrderedDict()
    for key, val in data.iteritems():
        if val is not None:
            out[key] = val

    return out
1184252
def _exclude_files_parser(cls, key):
        
        def parser(value):
            exclude_directive = 'file:'
            if value.startswith(exclude_directive):
                raise ValueError(
                    'Only strings are accepted for the {0} field, '
                    'files are not accepted'.format(key))
            return value
        return parser
1178104
function without(list, test, removedFn) {
 
   return withoutInner(list, removedFn || noop);
 
   function withoutInner(subList, removedFn) {
      return subList  
         ?  ( test(head(subList)) 
                  ? (removedFn(head(subList)), tail(subList)) 
                  : cons(head(subList), withoutInner(tail(subList), removedFn))
            )
         : emptyList
         ;
   }               
}
215511
def _discard_config(self):
        """"""
        discard_candidate = "copy running-config {}".format(
            self._gen_full_path(self.candidate_cfg)
        )
        discard_merge = "copy null: {}".format(self._gen_full_path(self.merge_cfg))
        self.device.send_command_expect(discard_candidate)
        self.device.send_command_expect(discard_merge)