def Process(self, parser_mediator, data, **kwargs):
    """Determine if this is the correct plugin; if so proceed with processing.

    Process() checks if the current bencode file being processed is a match for
    a plugin by comparing the PATH and KEY requirements defined by a plugin. If
    both match processing continues; else raise WrongBencodePlugin.

    This function also extracts the required keys as defined in
    self.BENCODE_KEYS from the file and stores the result in match[key]
    and calls self.GetEntries() which holds the processing logic implemented by
    the plugin.

    Args:
      parser_mediator (ParserMediator): mediates interactions between parsers
          and other components, such as storage and dfvfs.
      data (dict[str, object]): bencode data values.

    Raises:
      WrongBencodePlugin: If this plugin is not able to process the given file.
      ValueError: If top level is not set.
    """
    if data is None:
      raise ValueError('Data is not set.')

    if not set(data.keys()).issuperset(self.BENCODE_KEYS):
      raise errors.WrongBencodePlugin(self.NAME)

    # This will raise if unhandled keyword arguments are passed.
    super(BencodePlugin, self).Process(parser_mediator)

    logger.debug('Bencode Plugin Used: {0:s}'.format(self.NAME))

    self.GetEntries(parser_mediator, data=data)
def Process ( self , parser_mediator , data , ** kwargs ) : if data is None : raise ValueError ( 'Data is not set.' ) if not set ( data . keys ( ) ) . issuperset ( self . BENCODE_KEYS ) : raise errors . WrongBencodePlugin ( self . NAME ) super ( BencodePlugin , self ) . Process ( parser_mediator ) logger . debug ( 'Bencode Plugin Used: {0:s}' . format ( self . NAME ) ) self . GetEntries ( parser_mediator , data = data )
Determine if this is the correct plugin; if so proceed with processing.

    Process() checks if the current bencode file being processed is a match for
    a plugin by comparing the PATH and KEY requirements defined by a plugin. If
    both match processing continues; else raise WrongBencodePlugin.

    This function also extracts the required keys as defined in
    self.BENCODE_KEYS from the file and stores the result in match[key]
    and calls self.GetEntries() which holds the processing logic implemented by
    the plugin.

    Args:
      parser_mediator (ParserMediator): mediates interactions between parsers
          and other components, such as storage and dfvfs.
      data (dict[str, object]): bencode data values.

    Raises:
      WrongBencodePlugin: If this plugin is not able to process the given file.
      ValueError: If top level is not set.