_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q25500 | HashersOptions.ListHashers | train | def ListHashers(self):
"""Lists information about the available hashers."""
hashers_information = hashers_manager.HashersManager.GetHashersInformation()
table_view = views.ViewsFactory.GetTableView(
self._views_format_type, column_names=['Name', 'Description'],
| python | {
"resource": ""
} |
q25501 | OutputModuleOptions._CreateOutputModule | train | def _CreateOutputModule(self, options):
"""Creates the output module.
Args:
options (argparse.Namespace): command line arguments.
Returns:
OutputModule: output module.
Raises:
RuntimeError: if the output module cannot be created.
"""
formatter_mediator = formatters_mediator.... | python | {
"resource": ""
} |
q25502 | OutputModuleOptions.ListLanguageIdentifiers | train | def ListLanguageIdentifiers(self):
"""Lists the language identifiers."""
table_view = views.ViewsFactory.GetTableView(
self._views_format_type, column_names=['Identifier', 'Language'],
title='Language identifiers')
for language_id, value_list | python | {
"resource": ""
} |
q25503 | OutputModuleOptions._GetOutputModulesInformation | train | def _GetOutputModulesInformation(self):
"""Retrieves the output modules information.
Returns:
list[tuple[str, str]]: pairs of output module names and descriptions.
"""
output_modules_information = []
for name, | python | {
"resource": ""
} |
q25504 | OutputModuleOptions.ListOutputModules | train | def ListOutputModules(self):
"""Lists the output modules."""
table_view = views.ViewsFactory.GetTableView(
self._views_format_type, column_names=['Name', 'Description'],
title='Output Modules')
for name, output_class in output_manager.OutputManager.GetOutputClasses():
table_view.AddRo... | python | {
"resource": ""
} |
q25505 | ProfilingOptions.ListProfilers | train | def ListProfilers(self):
"""Lists information about the available profilers."""
table_view = views.ViewsFactory.GetTableView(
self._views_format_type, column_names=['Name', 'Description'],
title='Profilers')
profilers_information = sorted(
| python | {
"resource": ""
} |
q25506 | AppleAccountPlugin.Process | train | def Process(self, parser_mediator, plist_name, top_level, **kwargs):
"""Check if it is a valid Apple account plist file name.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
plist_name (str): name of the plist.... | python | {
"resource": ""
} |
q25507 | AppleAccountPlugin.GetEntries | train | def GetEntries(self, parser_mediator, match=None, **unused_kwargs):
"""Extracts relevant Apple Account entries.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
match (Optional[dict[str: object]]): keys extracte... | python | {
"resource": ""
} |
q25508 | TerminalServerClientPlugin.ExtractEvents | train | def ExtractEvents(self, parser_mediator, registry_key, **kwargs):
"""Extracts events from a Terminal Server Client Windows Registry key.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
registry_key (dfwinreg.Wi... | python | {
"resource": ""
} |
q25509 | BencodeParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses a bencoded file-like object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): a file-like object.
Raises:
... | python | {
"resource": ""
} |
q25510 | SkyDriveLogParser._ParseHeader | train | def _ParseHeader(self, parser_mediator, structure):
"""Parse header lines and store appropriate attributes.
['Logging started.', 'Version=', '17.0.2011.0627',
[2013, 7, 25], 16, 3, 23, 291, 'StartLocalTime', '<details>']
Args:
parser_mediator (ParserMediator): mediates interactions between parse... | python | {
"resource": ""
} |
q25511 | SkyDriveLogParser._ParseLine | train | def _ParseLine(self, parser_mediator, structure):
"""Parses a logline and store appropriate attributes.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
structure (pyparsing.ParseResults): structure of tokens de... | python | {
"resource": ""
} |
q25512 | SkyDriveLogParser.VerifyStructure | train | def VerifyStructure(self, parser_mediator, lines):
"""Verify that this file is a SkyDrive log file.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
lines (str): one or more lines from the text file.
Return... | python | {
"resource": ""
} |
q25513 | SkyDriveOldLogParser._ParseLogline | train | def _ParseLogline(self, parser_mediator, structure):
"""Parse a logline and store appropriate attributes.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
structure (pyparsing.ParseResults): structure of tokens ... | python | {
"resource": ""
} |
q25514 | SkyDriveOldLogParser._ParseNoHeaderSingleLine | train | def _ParseNoHeaderSingleLine(self, parser_mediator, structure):
"""Parse an isolated header line and store appropriate attributes.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
structure (pyparsing.ParseResul... | python | {
"resource": ""
} |
q25515 | SkyDriveOldLogParser.VerifyStructure | train | def VerifyStructure(self, parser_mediator, line):
"""Verify that this file is a SkyDrive old log file.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
line (str): line from a text file.
Returns:
bool... | python | {
"resource": ""
} |
q25516 | KodiMyVideosPlugin.ParseVideoRow | train | def ParseVideoRow(self, parser_mediator, query, row, **unused_kwargs):
"""Parses a Video row.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
query (str): query that created the row.
row (sqlite3.Row): ro... | python | {
"resource": ""
} |
q25517 | Session.CopyAttributesFromSessionCompletion | train | def CopyAttributesFromSessionCompletion(self, session_completion):
"""Copies attributes from a session completion.
Args:
session_completion (SessionCompletion): session completion attribute
container.
Raises:
ValueError: if the identifier of the session completion does not match
... | python | {
"resource": ""
} |
q25518 | Session.CreateSessionCompletion | train | def CreateSessionCompletion(self):
"""Creates a session completion.
Returns:
SessionCompletion: session completion attribute container.
"""
self.completion_time = int(time.time() * 1000000)
session_completion = SessionCompletion()
session_completion.aborted = self.aborted
session_com... | python | {
"resource": ""
} |
q25519 | Session.CreateSessionStart | train | def CreateSessionStart(self):
"""Creates a session start.
Returns:
SessionStart: session start attribute container.
"""
session_start = SessionStart()
session_start.artifact_filters = self.artifact_filters
session_start.command_line_arguments = self.command_line_arguments
session_star... | python | {
"resource": ""
} |
q25520 | ArgumentsHelper._ParseNumericOption | train | def _ParseNumericOption(cls, options, argument_name, default_value=None):
"""Parses a numeric command line argument.
Args:
options (argparse.Namespace): parser options.
argument_name (str): name of the command line argument.
default_value (Optional[int]): default value of the command line arg... | python | {
"resource": ""
} |
q25521 | FseventsdParser._ParseDLSPageHeader | train | def _ParseDLSPageHeader(self, file_object, page_offset):
"""Parses a DLS page header from a file-like object.
Args:
file_object (file): file-like object to read the header from.
page_offset (int): offset of the start of the page header, relative
to the start of the file.
Returns:
... | python | {
"resource": ""
} |
q25522 | FseventsdParser._BuildEventData | train | def _BuildEventData(self, record):
"""Builds an FseventsdData object from a parsed structure.
Args:
record (dls_record_v1|dls_record_v2): parsed record structure.
Returns:
FseventsdEventData: event data attribute container.
| python | {
"resource": ""
} |
q25523 | FseventsdParser._GetParentModificationTime | train | def _GetParentModificationTime(self, gzip_file_entry):
"""Retrieves the modification time of the file entry's parent file.
Note that this retrieves the time from the file entry of the parent of the
gzip file entry's path spec, which is different from trying to retrieve it
from the gzip file entry's par... | python | {
"resource": ""
} |
q25524 | FseventsdParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses an fseventsd file.
Args:
parser_mediator (ParserMediator): parser mediator.
file_object (dfvfs.FileIO): a file-like object.
Raises:
UnableToParseFile: when the header cannot be parsed.
"""
page_header_map = self._... | python | {
"resource": ""
} |
q25525 | MacDocumentVersionsPlugin.DocumentVersionsRow | train | def DocumentVersionsRow(
self, parser_mediator, query, row, **unused_kwargs):
"""Parses a document versions row.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
query (str): query that created the row.
... | python | {
"resource": ""
} |
q25526 | UtmpParser._ReadEntry | train | def _ReadEntry(self, parser_mediator, file_object, file_offset):
"""Reads an utmp entry.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): a file-like object.
file_offset (int): ... | python | {
"resource": ""
} |
q25527 | UtmpParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses an utmp file-like object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): a file-like object.
Raises:
Un... | python | {
"resource": ""
} |
q25528 | OperaTypedHistoryParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses an Opera typed history file-like object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): file-like object.
Rai... | python | {
"resource": ""
} |
q25529 | OperaGlobalHistoryParser._IsValidUrl | train | def _IsValidUrl(self, url):
"""Checks if an URL is considered valid.
Returns:
bool: True if the URL is valid.
"""
parsed_url = | python | {
"resource": ""
} |
q25530 | OperaGlobalHistoryParser._ParseRecord | train | def _ParseRecord(self, parser_mediator, text_file_object):
"""Parses an Opera global history record.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
text_file_object (dfvfs.TextFile): text file.
Returns:
... | python | {
"resource": ""
} |
q25531 | OperaGlobalHistoryParser._ParseAndValidateRecord | train | def _ParseAndValidateRecord(self, parser_mediator, text_file_object):
"""Parses and validates an Opera global history record.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
text_file_object (dfvfs.TextFile): t... | python | {
"resource": ""
} |
q25532 | OperaGlobalHistoryParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses an Opera global history file-like object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): file-like object.
Ra... | python | {
"resource": ""
} |
q25533 | WinRecycleBinParser._ParseOriginalFilename | train | def _ParseOriginalFilename(self, file_object, format_version):
"""Parses the original filename.
Args:
file_object (FileIO): file-like object.
format_version (int): format version.
Returns:
str: filename or None on error.
Raises:
ParseError: if the original filename cannot be r... | python | {
"resource": ""
} |
q25534 | WinRecyclerInfo2Parser._ParseInfo2Record | train | def _ParseInfo2Record(
self, parser_mediator, file_object, record_offset, record_size):
"""Parses an INFO-2 record.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): file-like ob... | python | {
"resource": ""
} |
q25535 | WinRecyclerInfo2Parser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses a Windows Recycler INFO2 file-like object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): file-like object.
R... | python | {
"resource": ""
} |
q25536 | StorageMediaTool._AddCredentialConfiguration | train | def _AddCredentialConfiguration(
self, path_spec, credential_type, credential_data):
"""Adds a credential configuration.
Args:
path_spec (dfvfs.PathSpec): path specification.
credential_type (str): credential | python | {
"resource": ""
} |
q25537 | StorageMediaTool._FormatHumanReadableSize | train | def _FormatHumanReadableSize(self, size):
"""Represents a number of bytes as a human readable string.
Args:
size (int): size in bytes.
Returns:
str: human readable string of the size.
"""
magnitude_1000 = 0
size_1000 = float(size)
while size_1000 >= 1000:
size_1000 /= 100... | python | {
"resource": ""
} |
q25538 | StorageMediaTool._ParseCredentialOptions | train | def _ParseCredentialOptions(self, options):
"""Parses the credential options.
Args:
options (argparse.Namespace): command line arguments.
Raises:
BadConfigOption: if the options are invalid.
"""
credentials = getattr(options, 'credentials', [])
if not isinstance(credentials, list):... | python | {
"resource": ""
} |
q25539 | StorageMediaTool._ParseSourcePathOption | train | def _ParseSourcePathOption(self, options):
"""Parses the source path option.
Args:
options (argparse.Namespace): command line arguments.
Raises:
BadConfigOption: if the options are invalid.
"""
self._source_path = self.ParseStringOption(options, self._SOURCE_OPTION) | python | {
"resource": ""
} |
q25540 | StorageMediaTool._ParseStorageMediaOptions | train | def _ParseStorageMediaOptions(self, options):
"""Parses the storage media options.
Args:
options (argparse.Namespace): command line arguments.
Raises:
BadConfigOption: if the options are invalid.
""" | python | {
"resource": ""
} |
q25541 | StorageMediaTool._ParseStorageMediaImageOptions | train | def _ParseStorageMediaImageOptions(self, options):
"""Parses the storage media image options.
Args:
options (argparse.Namespace): command line arguments.
Raises:
BadConfigOption: if the options are invalid.
"""
self._partitions = getattr(options, 'partitions', None)
if self._partit... | python | {
"resource": ""
} |
q25542 | StorageMediaTool._ParseVolumeIdentifiersString | train | def _ParseVolumeIdentifiersString(
self, volume_identifiers_string, prefix='v'):
"""Parses a user specified volume identifiers string.
Args:
volume_identifiers_string (str): user specified volume identifiers. A
range of volumes can be defined as: "3..5". Multiple volumes can be
... | python | {
"resource": ""
} |
q25543 | StorageMediaTool._ParseVSSProcessingOptions | train | def _ParseVSSProcessingOptions(self, options):
"""Parses the VSS processing options.
Args:
options (argparse.Namespace): command line arguments.
Raises:
BadConfigOption: if the options are invalid.
"""
vss_only = False
vss_stores = None
self._process_vss = not getattr(options,... | python | {
"resource": ""
} |
q25544 | StorageMediaTool._PrintAPFSVolumeIdentifiersOverview | train | def _PrintAPFSVolumeIdentifiersOverview(
self, volume_system, volume_identifiers):
"""Prints an overview of APFS volume identifiers.
Args:
volume_system (dfvfs.APFSVolumeSystem): volume system.
volume_identifiers (list[str]): allowed volume identifiers.
Raises:
SourceScannerError: ... | python | {
"resource": ""
} |
q25545 | StorageMediaTool._PrintTSKPartitionIdentifiersOverview | train | def _PrintTSKPartitionIdentifiersOverview(
self, volume_system, volume_identifiers):
"""Prints an overview of TSK partition identifiers.
Args:
volume_system (dfvfs.TSKVolumeSystem): volume system.
volume_identifiers (list[str]): allowed volume identifiers.
Raises:
SourceScannerErro... | python | {
"resource": ""
} |
q25546 | StorageMediaTool._PrintVSSStoreIdentifiersOverview | train | def _PrintVSSStoreIdentifiersOverview(
self, volume_system, volume_identifiers):
"""Prints an overview of VSS store identifiers.
Args:
volume_system (dfvfs.VShadowVolumeSystem): volume system.
volume_identifiers (list[str]): allowed volume identifiers.
Raises:
SourceScannerError: i... | python | {
"resource": ""
} |
q25547 | StorageMediaTool._PromptUserForAPFSVolumeIdentifiers | train | def _PromptUserForAPFSVolumeIdentifiers(
self, volume_system, volume_identifiers):
"""Prompts the user to provide APFS volume identifiers.
Args:
volume_system (dfvfs.APFSVolumeSystem): volume system.
volume_identifiers (list[str]): volume identifiers including prefix.
Returns:
list... | python | {
"resource": ""
} |
q25548 | StorageMediaTool._PromptUserForPartitionIdentifiers | train | def _PromptUserForPartitionIdentifiers(
self, volume_system, volume_identifiers):
"""Prompts the user to provide partition identifiers.
Args:
volume_system (dfvfs.TSKVolumeSystem): volume system.
volume_identifiers (list[str]): volume identifiers including prefix.
Returns:
list[str... | python | {
"resource": ""
} |
q25549 | StorageMediaTool._PromptUserForVSSCurrentVolume | train | def _PromptUserForVSSCurrentVolume(self):
"""Prompts the user if the current volume with VSS should be processed.
Returns:
bool: True if the current volume with VSS should be processed.
"""
while True:
self._output_writer.Write(
'Volume Shadow Snapshots (VSS) were selected also pr... | python | {
"resource": ""
} |
q25550 | StorageMediaTool._ReadSelectedVolumes | train | def _ReadSelectedVolumes(self, volume_system, prefix='v'):
"""Reads the selected volumes provided by the user.
Args:
volume_system (APFSVolumeSystem): volume system.
prefix (Optional[str]): volume identifier prefix.
Returns:
list[str]: selected volume identifiers including prefix.
R... | python | {
"resource": ""
} |
q25551 | StorageMediaTool.AddCredentialOptions | train | def AddCredentialOptions(self, argument_group):
"""Adds the credential options to the argument group.
The credential options are use to unlock encrypted volumes.
Args:
argument_group (argparse._ArgumentGroup): argparse argument group.
"""
argument_group.add_argument(
'--credential', ... | python | {
"resource": ""
} |
q25552 | StorageMediaTool.AddStorageMediaImageOptions | train | def AddStorageMediaImageOptions(self, argument_group):
"""Adds the storage media image options to the argument group.
Args:
argument_group (argparse._ArgumentGroup): argparse argument group.
"""
argument_group.add_argument(
'--partitions', '--partition', dest='partitions', action='store',... | python | {
"resource": ""
} |
q25553 | StorageMediaTool.AddVSSProcessingOptions | train | def AddVSSProcessingOptions(self, argument_group):
"""Adds the VSS processing options to the argument group.
Args:
argument_group (argparse._ArgumentGroup): argparse argument group.
"""
argument_group.add_argument(
'--no_vss', '--no-vss', dest='no_vss', action='store_true',
defaul... | python | {
"resource": ""
} |
q25554 | StorageMediaTool.ScanSource | train | def ScanSource(self, source_path):
"""Scans the source path for volume and file systems.
This function sets the internal source path specification and source
type values.
Args:
source_path (str): path to the source.
Returns:
dfvfs.SourceScannerContext: source scanner context.
Rai... | python | {
"resource": ""
} |
q25555 | FileSystemWinRegistryFileReader._CreateWindowsPathResolver | train | def _CreateWindowsPathResolver(
self, file_system, mount_point, environment_variables):
"""Create a Windows path resolver and sets the environment variables.
Args:
file_system (dfvfs.FileSystem): file system.
mount_point (dfvfs.PathSpec): mount point path specification.
environment_vari... | python | {
"resource": ""
} |
q25556 | FileSystemWinRegistryFileReader._OpenPathSpec | train | def _OpenPathSpec(self, path_specification, ascii_codepage='cp1252'):
"""Opens the Windows Registry file specified by the path specification.
Args:
path_specification (dfvfs.PathSpec): path specification.
ascii_codepage (Optional[str]): ASCII string codepage.
Returns:
WinRegistryFile: Wi... | python | {
"resource": ""
} |
q25557 | FileSystemWinRegistryFileReader.Open | train | def Open(self, path, ascii_codepage='cp1252'):
"""Opens the Windows Registry file specified by the path.
Args:
path (str): path of the Windows Registry file.
ascii_codepage (Optional[str]): ASCII | python | {
"resource": ""
} |
q25558 | PreprocessPluginsManager.CollectFromKnowledgeBase | train | def CollectFromKnowledgeBase(cls, knowledge_base):
"""Collects values from knowledge base values.
Args:
knowledge_base (KnowledgeBase): to fill with preprocessing information.
"""
for preprocess_plugin in cls._knowledge_base_plugins.values():
logger.debug('Running knowledge base preprocesso... | python | {
"resource": ""
} |
q25559 | PreprocessPluginsManager.DeregisterPlugin | train | def DeregisterPlugin(cls, plugin_class):
"""Deregisters an preprocess plugin class.
Args:
plugin_class (type): preprocess plugin class.
Raises:
KeyError: if plugin class is not set for the corresponding name.
TypeError: if the source type of the plugin class is not supported.
"""
... | python | {
"resource": ""
} |
q25560 | PreprocessPluginsManager.GetNames | train | def GetNames(cls):
"""Retrieves the names of the registered artifact definitions.
Returns:
list[str]: registered artifact definitions names.
"""
names = []
for | python | {
"resource": ""
} |
q25561 | PreprocessPluginsManager.RegisterPlugin | train | def RegisterPlugin(cls, plugin_class):
"""Registers an preprocess plugin class.
Args:
plugin_class (type): preprocess plugin class.
Raises:
KeyError: if plugin class is already set for the corresponding name.
TypeError: if the source type of the plugin class is not supported.
"""
... | python | {
"resource": ""
} |
q25562 | PreprocessPluginsManager.RunPlugins | train | def RunPlugins(
cls, artifacts_registry, file_system, mount_point, knowledge_base):
"""Runs the preprocessing plugins.
Args:
artifacts_registry (artifacts.ArtifactDefinitionsRegistry): artifacts
definitions registry.
file_system (dfvfs.FileSystem): file system to be preprocessed.
... | python | {
"resource": ""
} |
q25563 | CompoundZIPParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses a compound ZIP file-like object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): a file-like object.
Raises:
... | python | {
"resource": ""
} |
q25564 | CompoundZIPParser._ProcessZipFileWithPlugins | train | def _ProcessZipFileWithPlugins(self, parser_mediator, zip_file):
"""Processes a zip file using all compound zip files.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
zip_file (zipfile.ZipFile): the zip file. I... | python | {
"resource": ""
} |
q25565 | GetYearFromPosixTime | train | def GetYearFromPosixTime(posix_time, timezone=pytz.UTC):
"""Gets the year from a POSIX timestamp
The POSIX time is the number of seconds since 1970-01-01 00:00:00 UTC.
Args:
posix_time: An integer containing the number of seconds since
1970-01-01 00:00:00 UTC.
timezone: Optional timezone... | python | {
"resource": ""
} |
q25566 | Timestamp.CopyToDatetime | train | def CopyToDatetime(cls, timestamp, timezone, raise_error=False):
"""Copies the timestamp to a datetime object.
Args:
timestamp: The timestamp which is an integer containing the number
of micro seconds since January 1, 1970, 00:00:00 UTC.
timezone: The timezone (pytz.timezone) objec... | python | {
"resource": ""
} |
q25567 | Timestamp.CopyToIsoFormat | train | def CopyToIsoFormat(cls, timestamp, timezone=pytz.UTC, raise_error=False):
"""Copies the timestamp to an ISO 8601 formatted string.
Args:
timestamp: The timestamp which is an integer containing the number
of micro seconds since January 1, 1970, 00:00:00 UTC.
timezone: Optional time... | python | {
"resource": ""
} |
q25568 | Timestamp.FromTimeString | train | def FromTimeString(
cls, time_string, dayfirst=False, gmt_as_timezone=True,
timezone=pytz.UTC):
"""Converts a string containing a date and time value into a timestamp.
Args:
time_string: String that contains a date and time value.
dayfirst: An optional boolean argument. If set to true t... | python | {
"resource": ""
} |
q25569 | Timestamp.LocaltimeToUTC | train | def LocaltimeToUTC(cls, timestamp, timezone, is_dst=False):
"""Converts the timestamp in localtime of the timezone to UTC.
Args:
timestamp: The timestamp which is an integer containing the number
of micro seconds since January 1, 1970, 00:00:00 UTC.
timezone: The timezone (pytz.tim... | python | {
"resource": ""
} |
q25570 | Timestamp.RoundToSeconds | train | def RoundToSeconds(cls, timestamp):
"""Takes a timestamp value and rounds it to a second precision."""
leftovers = timestamp % definitions.MICROSECONDS_PER_SECOND
| python | {
"resource": ""
} |
q25571 | XChatScrollbackParser.ParseRecord | train | def ParseRecord(self, parser_mediator, key, structure):
"""Parses a log record structure.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
key (str): name of the parsed structure.
structure (pyparsing.Pars... | python | {
"resource": ""
} |
q25572 | XChatScrollbackParser.VerifyStructure | train | def VerifyStructure(self, parser_mediator, line):
"""Verify that this file is a XChat scrollback log file.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
line (str): line from a text file.
Returns:
... | python | {
"resource": ""
} |
q25573 | MsieWebCacheESEDBPlugin.ParseContainersTable | train | def ParseContainersTable(
self, parser_mediator, database=None, table=None, **unused_kwargs):
"""Parses the Containers table.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
database (Optional[pyesedb.fil... | python | {
"resource": ""
} |
q25574 | MsieWebCacheESEDBPlugin.ParseLeakFilesTable | train | def ParseLeakFilesTable(
self, parser_mediator, database=None, table=None, **unused_kwargs):
"""Parses the LeakFiles table.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
database (Optional[pyesedb.file]... | python | {
"resource": ""
} |
q25575 | MsieWebCacheESEDBPlugin.ParsePartitionsTable | train | def ParsePartitionsTable(
self, parser_mediator, database=None, table=None, **unused_kwargs):
"""Parses the Partitions table.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
database (Optional[pyesedb.fil... | python | {
"resource": ""
} |
q25576 | ASLParser._ParseRecord | train | def _ParseRecord(self, parser_mediator, file_object, record_offset):
"""Parses a record and produces events.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (file): file-like object.
record_of... | python | {
"resource": ""
} |
q25577 | ASLParser._ParseRecordExtraField | train | def _ParseRecordExtraField(self, byte_stream, file_offset):
"""Parses a record extra field.
Args:
byte_stream (bytes): byte stream.
file_offset (int): offset of the record extra field relative to
the start of the file.
Returns:
asl_record_extra_field: record extra field.
R... | python | {
"resource": ""
} |
q25578 | ASLParser._ParseRecordString | train | def _ParseRecordString(
self, record_strings_data, record_strings_data_offset, string_offset):
"""Parses a record string.
Args:
record_strings_data (bytes): record strings data.
record_strings_data_offset (int): offset of the record strings data
relative to the start of the file.
... | python | {
"resource": ""
} |
q25579 | ASLParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses an ASL file-like object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
file_object (dfvfs.FileIO): file-like object.
Raises:
Unabl... | python | {
"resource": ""
} |
q25580 | _PathFilterTable._AddPathSegments | train | def _AddPathSegments(self, path, ignore_list):
"""Adds the path segments to the table.
Args:
path: a string containing the path.
ignore_list: a list of path segment indexes to ignore, where 0 is the
index of the first path segment relative from the root.
"""
path_segments... | python | {
"resource": ""
} |
q25581 | _PathFilterTable.ToDebugString | train | def ToDebugString(self):
"""Converts the path filter table into a debug string."""
text_parts = ['Path segment index\tPath segments(s)']
for index, path_segments in self.path_segments_per_index.items():
| python | {
"resource": ""
} |
q25582 | _PathSegmentWeights.AddIndex | train | def AddIndex(self, path_segment_index):
"""Adds a path segment index and sets its weight to 0.
Args:
path_segment_index: an integer containing the path segment index.
Raises:
ValueError: if the path segment weights already contains
the path segment index. | python | {
"resource": ""
} |
q25583 | _PathSegmentWeights.AddWeight | train | def AddWeight(self, path_segment_index, weight):
"""Adds a weight for a specific path segment index.
Args:
path_segment_index: an integer containing the path segment index.
weight: an integer containing the weight.
Raises:
ValueError: if the path segment weights do not contain
... | python | {
"resource": ""
} |
q25584 | _PathSegmentWeights.SetWeight | train | def SetWeight(self, path_segment_index, weight):
"""Sets a weight for a specific path segment index.
Args:
path_segment_index: an integer containing the path segment index.
weight: an integer containing the weight.
Raises:
ValueError: if the path segment weights do not contain
... | python | {
"resource": ""
} |
q25585 | _PathSegmentWeights.ToDebugString | train | def ToDebugString(self):
"""Converts the path segment weights into a debug string."""
text_parts = ['Path segment index\tWeight']
for path_segment_index, weight in self._weight_per_index.items():
text_parts.append('{0:d}\t\t\t{1:d}'.format(
| python | {
"resource": ""
} |
q25586 | PathFilterScanTree._BuildScanTreeNode | train | def _BuildScanTreeNode(self, path_filter_table, ignore_list):
"""Builds a scan tree node.
Args:
path_filter_table: a path filter table object (instance of
_PathFilterTable).
ignore_list: a list of path segment indexes to ignore, where 0 is the
index of th... | python | {
"resource": ""
} |
q25587 | PathFilterScanTree._GetMostSignificantPathSegmentIndex | train | def _GetMostSignificantPathSegmentIndex(
self, paths, similarity_weights, occurrence_weights, value_weights):
"""Retrieves the index of the most significant path segment.
Args:
paths: a list of strings containing the paths.
similarity_weights: the similarity weights object (instance of
... | python | {
"resource": ""
} |
q25588 | PathFilterScanTree._GetPathSegmentIndexForOccurrenceWeights | train | def _GetPathSegmentIndexForOccurrenceWeights(
self, occurrence_weights, value_weights):
"""Retrieves the index of the path segment based on occurrence weights.
Args:
occurrence_weights: the occurrence weights object (instance of
_PathSegmentWeights).
value_weights: t... | python | {
"resource": ""
} |
q25589 | PathFilterScanTree._GetPathSegmentIndexForSimilarityWeights | train | def _GetPathSegmentIndexForSimilarityWeights(
self, similarity_weights, occurrence_weights, value_weights):
"""Retrieves the index of the path segment based on similarity weights.
Args:
similarity_weights: the similarity weights object (instance of
_PathSegmentWeights).
... | python | {
"resource": ""
} |
q25590 | PathFilterScanTree._GetPathSegmentIndexForValueWeights | train | def _GetPathSegmentIndexForValueWeights(self, value_weights):
"""Retrieves the index of the path segment based on value weights.
Args:
value_weights: the value weights object (instance of _PathSegmentWeights).
Returns:
An integer containing the path segment index.
Raises:
RuntimeErr... | python | {
"resource": ""
} |
q25591 | PathFilterScanTree.CheckPath | train | def CheckPath(self, path, path_segment_separator=None):
"""Checks if a path matches the scan tree-based path filter.
Args:
path: a string containing the path.
path_segment_separator: optional string containing the path segment
separator. None defaults to the path segme... | python | {
"resource": ""
} |
q25592 | PathFilterScanTreeNode.AddPathSegment | train | def AddPathSegment(self, path_segment, scan_object):
"""Adds a path segment.
Args:
path_segment: a string containing the path segment.
scan_object: a scan object, either a scan tree sub node (instance of
PathFilterScanTreeNode) or a string containing a path.
Raises:
Va... | python | {
"resource": ""
} |
q25593 | PathFilterScanTreeNode.ToDebugString | train | def ToDebugString(self, indentation_level=1):
"""Converts the path filter scan tree node into a debug string.
Args:
indentation_level: an integer containing the text indentation level.
Returns:
A string containing a debug representation of the path filter scan
tree node.
"""
inde... | python | {
"resource": ""
} |
q25594 | BagMRUWindowsRegistryPlugin._ParseMRUListExValue | train | def _ParseMRUListExValue(self, registry_key):
"""Parses the MRUListEx value in a given Registry key.
Args:
registry_key (dfwinreg.WinRegistryKey): Windows Registry key that contains
the MRUListEx value.
Returns:
mrulistex_entries: MRUListEx entries or None if not available.
"""
... | python | {
"resource": ""
} |
q25595 | SoftwareUpdatePlugin.GetEntries | train | def GetEntries(self, parser_mediator, match=None, **unused_kwargs):
"""Extracts relevant MacOS update entries.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
match (Optional[dict[str: object]]): keys extracted... | python | {
"resource": ""
} |
q25596 | WindowsUserAccountsPlugin._GetUsernameFromProfilePath | train | def _GetUsernameFromProfilePath(self, path):
"""Retrieves the username from a Windows profile path.
Trailing path path segment are ignored.
Args:
path (str): a Windows path with '\\' as path segment separator.
Returns:
str: basename which is the last path segment.
"""
# | python | {
"resource": ""
} |
q25597 | XMLRPCClient.CallFunction | train | def CallFunction(self):
"""Calls the function via RPC."""
if self._xmlrpc_proxy is None:
return None
rpc_call = getattr(self._xmlrpc_proxy, self._RPC_FUNCTION_NAME, None)
if rpc_call is None:
return None
try:
return rpc_call() # pylint: disable=not-callable
except (
| python | {
"resource": ""
} |
q25598 | XMLRPCClient.Open | train | def Open(self, hostname, port):
"""Opens a RPC communication channel to the server.
Args:
hostname (str): hostname or IP address to connect to for requests.
port (int): port to connect to for requests.
Returns:
bool: True if the communication channel was established.
"""
server_u... | python | {
"resource": ""
} |
q25599 | ThreadedXMLRPCServer._Open | train | def _Open(self, hostname, port):
"""Opens the RPC communication channel for clients.
Args:
hostname (str): hostname or IP address to connect to for requests.
port (int): port to connect to for requests.
Returns:
bool: True if the communication channel was successfully opened.
"""
... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.