_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q26000 | SQLiteStorageFile._CountStoredAttributeContainers | train | def _CountStoredAttributeContainers(self, container_type):
"""Counts the number of attribute containers of the given type.
Args:
container_type (str): attribute container type.
Returns:
int: number of attribute containers of the given type.
Raises:
ValueError: if an unsupported cont... | python | {
"resource": ""
} |
q26001 | SQLiteStorageFile._GetAttributeContainerByIndex | train | def _GetAttributeContainerByIndex(self, container_type, index):
"""Retrieves a specific attribute container.
Args:
container_type (str): attribute container type.
index (int): attribute container index.
Returns:
AttributeContainer: attribute container or None if not available.
Raise... | python | {
"resource": ""
} |
q26002 | SQLiteStorageFile._GetAttributeContainers | train | def _GetAttributeContainers(
self, container_type, filter_expression=None, order_by=None):
"""Retrieves a specific type of stored attribute containers.
Args:
container_type (str): attribute container type.
filter_expression (Optional[str]): expression to filter results by.
order_by (Opt... | python | {
"resource": ""
} |
q26003 | SQLiteStorageFile._ReadAndCheckStorageMetadata | train | def _ReadAndCheckStorageMetadata(self, check_readable_only=False):
"""Reads storage metadata and checks that the values are valid.
Args:
check_readable_only (Optional[bool]): whether the store should only be
checked to see if it can be read. If False, the store will be checked
to see ... | python | {
"resource": ""
} |
q26004 | SQLiteStorageFile._WriteAttributeContainer | train | def _WriteAttributeContainer(self, attribute_container):
"""Writes an attribute container.
The table for the container type must exist.
Args:
attribute_container (AttributeContainer): attribute container.
"""
if attribute_container.CONTAINER_TYPE == self._CONTAINER_TYPE_EVENT:
timestam... | python | {
"resource": ""
} |
q26005 | SQLiteStorageFile._WriteSerializedAttributeContainerList | train | def _WriteSerializedAttributeContainerList(self, container_type):
"""Writes a serialized attribute container list.
Args:
container_type (str): attribute container type.
"""
if container_type == self._CONTAINER_TYPE_EVENT:
if not self._serialized_event_heap.data_size:
return
n... | python | {
"resource": ""
} |
q26006 | SQLiteStorageFile._WriteStorageMetadata | train | def _WriteStorageMetadata(self):
"""Writes the storage metadata."""
self._cursor.execute(self._CREATE_METADATA_TABLE_QUERY)
query = 'INSERT INTO metadata (key, value) VALUES (?, ?)'
key = 'format_version'
value = '{0:d}'.format(self._FORMAT_VERSION)
self._cursor.execute(query, (key, value))
... | python | {
"resource": ""
} |
q26007 | SQLiteStorageFile.AddEventTags | train | def AddEventTags(self, event_tags):
"""Adds event tags.
Args:
event_tags (list[EventTag]): event tags.
Raises:
IOError: when the storage file is closed or read-only or
if the event tags cannot be serialized.
OSError: when the storage file is closed or read-only or
| python | {
"resource": ""
} |
q26008 | SQLiteStorageFile.CheckSupportedFormat | train | def CheckSupportedFormat(cls, path, check_readable_only=False):
"""Checks if the storage file format is supported.
Args:
path (str): path to the storage file.
check_readable_only (Optional[bool]): whether the store should only be
checked to see if it can be read. If False, the store will ... | python | {
"resource": ""
} |
q26009 | SQLiteStorageFile.Close | train | def Close(self):
"""Closes the storage.
Raises:
IOError: if the storage file is already closed.
OSError: if the storage file is already closed.
"""
if not self._is_open:
raise IOError('Storage file already closed.')
if not self._read_only:
self._WriteSerializedAttributeCont... | python | {
"resource": ""
} |
q26010 | SQLiteStorageFile.GetWarnings | train | def GetWarnings(self):
"""Retrieves the warnings.
Returns:
generator(ExtractionWarning): warning generator.
"""
# For backwards compatibility with pre-20190309 stores.
# Note that stores cannot contain both ExtractionErrors and
# ExtractionWarnings
| python | {
"resource": ""
} |
q26011 | SQLiteStorageFile._GetExtractionErrorsAsWarnings | train | def _GetExtractionErrorsAsWarnings(self):
"""Retrieves errors from from the store, and converts them to warnings.
This method is for backwards compatibility with pre-20190309 storage format
stores which used ExtractionError attribute containers.
Yields:
ExtractionWarning: extraction warnings.
... | python | {
"resource": ""
} |
q26012 | SQLiteStorageFile.GetEvents | train | def GetEvents(self):
"""Retrieves the events.
Yield:
EventObject: event.
"""
for event in self._GetAttributeContainers('event'):
if hasattr(event, 'event_data_row_identifier'):
event_data_identifier = identifiers.SQLTableIdentifier(
| python | {
"resource": ""
} |
q26013 | SQLiteStorageFile.GetEventTagByIdentifier | train | def GetEventTagByIdentifier(self, identifier):
"""Retrieves a specific event tag.
Args:
identifier (SQLTableIdentifier): event tag identifier.
Returns:
EventTag: event tag or None if not available.
"""
event_tag = self._GetAttributeContainerByIndex(
self._CONTAINER_TYPE_EVENT_T... | python | {
"resource": ""
} |
q26014 | SQLiteStorageFile.GetEventTags | train | def GetEventTags(self):
"""Retrieves the event tags.
Yields:
EventTag: event tag.
"""
for event_tag in self._GetAttributeContainers(
self._CONTAINER_TYPE_EVENT_TAG):
event_identifier = identifiers.SQLTableIdentifier(
| python | {
"resource": ""
} |
q26015 | SQLiteStorageFile.GetNumberOfEventSources | train | def GetNumberOfEventSources(self):
"""Retrieves the number event sources.
Returns:
int: number of event sources.
"""
number_of_event_sources = self._CountStoredAttributeContainers(
self._CONTAINER_TYPE_EVENT_SOURCE)
number_of_event_sources += | python | {
"resource": ""
} |
q26016 | SQLiteStorageFile.GetSessions | train | def GetSessions(self):
"""Retrieves the sessions.
Yields:
Session: session attribute container.
Raises:
IOError: if there is a mismatch in session identifiers between the
session start and completion attribute containers.
OSError: if there is a mismatch in session identifiers b... | python | {
"resource": ""
} |
q26017 | SQLiteStorageFile.HasWarnings | train | def HasWarnings(self):
"""Determines if a store contains extraction warnings.
Returns:
bool: True if the store contains extraction warnings.
"""
# To support older storage versions, check for the now deprecated
# extraction errors.
has_errors | python | {
"resource": ""
} |
q26018 | SQLiteStorageFile.Open | train | def Open(self, path=None, read_only=True, **unused_kwargs):
"""Opens the storage.
Args:
path (Optional[str]): path to the storage file.
read_only (Optional[bool]): True if the file should be opened in
read-only mode.
Raises:
IOError: if the storage file is already opened or if ... | python | {
"resource": ""
} |
q26019 | FirefoxHistoryPlugin.ParseBookmarkAnnotationRow | train | def ParseBookmarkAnnotationRow(
self, parser_mediator, query, row, **unused_kwargs):
"""Parses a bookmark annotation row.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
query (str): query that created th... | python | {
"resource": ""
} |
q26020 | FirefoxHistoryPlugin.ParseBookmarkFolderRow | train | def ParseBookmarkFolderRow(
self, parser_mediator, query, row, **unused_kwargs):
"""Parses a bookmark folder 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": ""
} |
q26021 | FirefoxHistoryPlugin.ParseBookmarkRow | train | def ParseBookmarkRow(
self, parser_mediator, query, row, **unused_kwargs):
"""Parses a bookmark 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 (sql... | python | {
"resource": ""
} |
q26022 | FirefoxHistoryPlugin.ParsePageVisitedRow | train | def ParsePageVisitedRow(
self, parser_mediator, query, row, cache=None, database=None,
**unused_kwargs):
"""Parses a page visited row.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
query (str): qu... | python | {
"resource": ""
} |
q26023 | FirefoxHistoryPlugin._ReverseHostname | train | def _ReverseHostname(self, hostname):
"""Reverses the hostname and strips the leading dot.
The hostname entry is reversed:
moc.elgoog.www.
Should be:
www.google.com
Args:
hostname (str): reversed hostname.
Returns:
str: hostname without a leading dot.
"""
| python | {
"resource": ""
} |
q26024 | FirefoxDownloadsPlugin.ParseDownloadsRow | train | def ParseDownloadsRow(
self, parser_mediator, query, row, **unused_kwargs):
"""Parses a downloads 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 (s... | python | {
"resource": ""
} |
q26025 | MultiProcessBaseProcess._SigSegvHandler | train | def _SigSegvHandler(self, signal_number, stack_frame):
"""Signal handler for the SIGSEGV signal.
Args:
signal_number (int): numeric representation of the signal.
stack_frame (frame): current stack frame or None.
"""
self._OnCriticalError()
# Note that the original SIGSEGV handler can b... | python | {
"resource": ""
} |
q26026 | MultiProcessBaseProcess._WaitForStatusNotRunning | train | def _WaitForStatusNotRunning(self):
"""Waits for the status is running to change to false."""
# We wait slightly longer than the status check sleep time.
time.sleep(2.0)
time_slept = 2.0
| python | {
"resource": ""
} |
q26027 | MultiProcessBaseProcess.run | train | def run(self):
"""Runs the process."""
# Prevent the KeyboardInterrupt being raised inside the process.
# This will prevent a process from generating a traceback when interrupted.
signal.signal(signal.SIGINT, signal.SIG_IGN)
# A SIGTERM signal handler is necessary to make sure IPC is cleaned up
... | python | {
"resource": ""
} |
q26028 | SystemdJournalParser._ParseDataObject | train | def _ParseDataObject(self, file_object, file_offset):
"""Parses a data object.
Args:
file_object (dfvfs.FileIO): a file-like object.
file_offset (int): offset of the data object relative to the start
of the file-like object.
Returns:
bytes: data.
Raises:
ParseError: ... | python | {
"resource": ""
} |
q26029 | SystemdJournalParser._ParseEntryArrayObject | train | def _ParseEntryArrayObject(self, file_object, file_offset):
"""Parses an entry array object.
Args:
file_object (dfvfs.FileIO): a file-like object.
file_offset (int): offset of the entry array object relative to the start
of the file-like object.
Returns:
systemd_journal_entry_a... | python | {
"resource": ""
} |
q26030 | SystemdJournalParser._ParseEntryObject | train | def _ParseEntryObject(self, file_object, file_offset):
"""Parses an entry object.
Args:
file_object (dfvfs.FileIO): a file-like object.
file_offset (int): offset of the entry object relative to the start
of the file-like object.
Returns:
systemd_journal_entry_object: entry obje... | python | {
"resource": ""
} |
q26031 | SystemdJournalParser._ParseEntryObjectOffsets | train | def _ParseEntryObjectOffsets(self, file_object, file_offset):
"""Parses entry array objects for the offset of the entry objects.
Args:
file_object (dfvfs.FileIO): a file-like object.
file_offset (int): offset of the first entry array object relative to
the start of the file-like object.
... | python | {
"resource": ""
} |
q26032 | SystemdJournalParser._ParseJournalEntry | train | def _ParseJournalEntry(self, file_object, file_offset):
"""Parses a journal entry.
This method will generate an event per ENTRY object.
Args:
file_object (dfvfs.FileIO): a file-like object.
file_offset (int): offset of the entry object relative to the start
of the file-like object.
... | python | {
"resource": ""
} |
q26033 | SystemdJournalParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses a Systemd journal file-like object.
Args:
parser_mediator (ParserMediator): parser mediator.
file_object (dfvfs.FileIO): a file-like object.
Raises:
UnableToParseFile: when the header cannot be parsed.
"""
file_he... | python | {
"resource": ""
} |
q26034 | WinEVTFormatter.GetEventTypeString | train | def GetEventTypeString(self, event_type):
"""Retrieves a string representation of the event type.
Args:
event_type (int): event type.
| python | {
"resource": ""
} |
q26035 | WinEVTFormatter.GetSeverityString | train | def GetSeverityString(self, severity):
"""Retrieves a string representation of the severity.
Args:
severity (int): severity.
| python | {
"resource": ""
} |
q26036 | SQLiteCache.CacheQueryResults | train | def CacheQueryResults(
self, sql_results, attribute_name, key_name, column_names):
"""Build a dictionary object based on a SQL command.
This function will take a SQL command, execute it and for
each resulting row it will store a key in a dictionary.
An example::
sql_results = A SQL result... | python | {
"resource": ""
} |
q26037 | SQLiteCache.GetRowCache | train | def GetRowCache(self, query):
"""Retrieves the row cache for a specific query.
The row cache is a set that contains hashes of values in a row. The row
cache is used to find duplicate row when a database and a database with
a WAL file is parsed.
Args:
query (str): query.
Returns:
| python | {
"resource": ""
} |
q26038 | SQLiteDatabase._CopyFileObjectToTemporaryFile | train | def _CopyFileObjectToTemporaryFile(self, file_object, temporary_file):
"""Copies the contents of the file-like object to a temporary file.
Args:
file_object (dfvfs.FileIO): file-like object.
temporary_file (file): temporary file.
"""
| python | {
"resource": ""
} |
q26039 | SQLiteDatabase.Close | train | def Close(self):
"""Closes the database connection and cleans up the temporary file."""
self.schema = {}
if self._is_open:
self._database.close()
self._database = None
if os.path.exists(self._temp_db_file_path):
try:
os.remove(self._temp_db_file_path)
except (OSError, IOE... | python | {
"resource": ""
} |
q26040 | SQLiteDatabase.Open | train | def Open(self, file_object, wal_file_object=None):
"""Opens a SQLite database file.
Since pysqlite cannot read directly from a file-like object a temporary
copy of the file is made. After creating a copy the database file this
function sets up a connection with the database and determines the names
... | python | {
"resource": ""
} |
q26041 | SQLiteDatabase.Query | train | def Query(self, query):
"""Queries the database.
Args:
query (str): SQL query.
Returns:
sqlite3.Cursor: results.
Raises:
sqlite3.DatabaseError: if querying the database | python | {
"resource": ""
} |
q26042 | SQLiteParser.ParseFileEntry | train | def ParseFileEntry(self, parser_mediator, file_entry):
"""Parses a SQLite database file entry.
Args:
parser_mediator (ParserMediator): parser mediator.
file_entry (dfvfs.FileEntry): file entry to be parsed.
Raises:
UnableToParseFile: when the file cannot be parsed.
"""
filename =... | python | {
"resource": ""
} |
q26043 | BinaryCookieParser._ParseCString | train | def _ParseCString(self, page_data, string_offset):
"""Parses a C string from the page data.
Args:
page_data (bytes): page data.
string_offset (int): offset of the string relative to the start
of the page.
Returns:
str: string.
Raises:
ParseError: when the string cann... | python | {
"resource": ""
} |
q26044 | BinaryCookieParser._ParsePage | train | def _ParsePage(self, parser_mediator, file_offset, page_data):
"""Parses a page.
Args:
parser_mediator (ParserMediator): parser mediator.
file_offset (int): offset of the data relative from the start of
the file-like object.
page_data (bytes): page data.
Raises:
ParseErro... | python | {
"resource": ""
} |
q26045 | BinaryCookieParser._ParseRecord | train | def _ParseRecord(self, parser_mediator, page_data, record_offset):
"""Parses a record from the page data.
Args:
parser_mediator (ParserMediator): parser mediator.
page_data (bytes): page data.
record_offset (int): offset of the record relative to the start
of the page.
Raises:
... | python | {
"resource": ""
} |
q26046 | BinaryCookieParser.ParseFileObject | train | def ParseFileObject(self, parser_mediator, file_object):
"""Parses a Safari binary cookie file-like object.
Args:
parser_mediator (ParserMediator): parser mediator.
file_object (dfvfs.FileIO): file-like object to be parsed.
Raises:
UnableToParseFile: when the file cannot be parsed, this ... | python | {
"resource": ""
} |
q26047 | DynamicFieldsHelper._FormatDate | train | def _FormatDate(self, event):
"""Formats the date.
Args:
event (EventObject): event.
Returns:
str: date field.
"""
# TODO: preserve dfdatetime as an object.
# TODO: add support for self._output_mediator.timezone
date_time = dfdatetime_posix_time.PosixTimeInMicroseconds(
... | python | {
"resource": ""
} |
q26048 | DynamicFieldsHelper._FormatDateTime | train | def _FormatDateTime(self, event):
"""Formats the date and time in ISO 8601 format.
Args:
event (EventObject): event.
Returns:
str: date and time field.
"""
try:
return timelib.Timestamp.CopyToIsoFormat(
event.timestamp, timezone=self._output_mediator.timezone,
... | python | {
"resource": ""
} |
q26049 | DynamicFieldsHelper._FormatInode | train | def _FormatInode(self, event):
"""Formats the inode.
Args:
event (EventObject): event.
Returns:
str: inode field.
"""
inode = event.inode
if inode is None:
| python | {
"resource": ""
} |
q26050 | DynamicFieldsHelper._FormatMessage | train | def _FormatMessage(self, event):
"""Formats the message.
Args:
event (EventObject): event.
Returns:
str: message field.
Raises:
NoFormatterFound: if no event formatter can be found to match the data
type in the event.
"""
message, _ = self._output_mediator.GetForma... | python | {
"resource": ""
} |
q26051 | DynamicFieldsHelper._FormatMessageShort | train | def _FormatMessageShort(self, event):
"""Formats the short message.
Args:
event (EventObject): event.
Returns:
str: short message field.
Raises:
NoFormatterFound: if no event formatter can be found to match the data
type in the event.
"""
_, message_short = self._o... | python | {
"resource": ""
} |
q26052 | DynamicFieldsHelper._FormatSourceShort | train | def _FormatSourceShort(self, event):
"""Formats the short source.
Args:
event (EventObject): event.
Returns:
str: short source field.
Raises:
NoFormatterFound: If no event formatter can be found to match the data
type in the event.
"""
source_short, _ = self._outpu... | python | {
"resource": ""
} |
q26053 | DynamicFieldsHelper._FormatTag | train | def _FormatTag(self, event):
"""Formats the event tag.
Args:
event (EventObject): event.
Returns:
str: event tag field.
| python | {
"resource": ""
} |
q26054 | DynamicFieldsHelper.GetFormattedField | train | def GetFormattedField(self, event, field_name):
"""Formats the specified field.
Args:
event (EventObject): event.
field_name (str): name of the field.
Returns:
str: value of the field.
"""
callback_name = self._FIELD_FORMAT_CALLBACKS.get(field_name, None)
callback_function = ... | python | {
"resource": ""
} |
q26055 | SerializedAttributeContainerList.GetAttributeContainerByIndex | train | def GetAttributeContainerByIndex(self, index):
"""Retrieves a specific serialized attribute container from the list.
Args:
index (int): attribute container index.
Returns:
bytes: serialized attribute container data or None if not available.
Raises:
IndexError: if the index is less t... | python | {
"resource": ""
} |
q26056 | SerializedAttributeContainerList.PopAttributeContainer | train | def PopAttributeContainer(self):
"""Pops a serialized attribute container from the list.
Returns:
bytes: serialized attribute container data.
"""
try:
| python | {
"resource": ""
} |
q26057 | SerializedAttributeContainerList.PushAttributeContainer | train | def PushAttributeContainer(self, serialized_data):
"""Pushes a serialized attribute container onto the list.
Args:
serialized_data (bytes): serialized attribute container data.
"""
| python | {
"resource": ""
} |
q26058 | BaseStorageFile._DeserializeAttributeContainer | train | def _DeserializeAttributeContainer(self, container_type, serialized_data):
"""Deserializes an attribute container.
Args:
container_type (str): attribute container type.
serialized_data (bytes): serialized attribute container data.
Returns:
AttributeContainer: attribute container or None.... | python | {
"resource": ""
} |
q26059 | BaseStorageFile._GetSerializedAttributeContainerByIndex | train | def _GetSerializedAttributeContainerByIndex(self, container_type, index):
"""Retrieves a specific serialized attribute container.
Args:
container_type (str): attribute container type.
index (int): attribute container index.
Returns:
bytes: serialized attribute container data or None if n... | python | {
"resource": ""
} |
q26060 | BaseStorageFile._GetSerializedAttributeContainerList | train | def _GetSerializedAttributeContainerList(self, container_type):
"""Retrieves a serialized attribute container list.
Args:
container_type (str): attribute container type.
Returns:
SerializedAttributeContainerList: serialized attribute | python | {
"resource": ""
} |
q26061 | BaseStorageFile._SerializeAttributeContainer | train | def _SerializeAttributeContainer(self, attribute_container):
"""Serializes an attribute container.
Args:
attribute_container (AttributeContainer): attribute container.
Returns:
bytes: serialized attribute container.
Raises:
IOError: if the attribute container cannot be serialized.
... | python | {
"resource": ""
} |
q26062 | StorageFileWriter._GetMergeTaskStorageFilePath | train | def _GetMergeTaskStorageFilePath(self, task):
"""Retrieves the path of a task storage file in the merge directory.
Args:
task (Task): task.
| python | {
"resource": ""
} |
q26063 | StorageFileWriter._GetProcessedStorageFilePath | train | def _GetProcessedStorageFilePath(self, task):
"""Retrieves the path of a task storage file in the processed directory.
Args:
task (Task): task.
| python | {
"resource": ""
} |
q26064 | StorageFileWriter._GetTaskStorageFilePath | train | def _GetTaskStorageFilePath(self, task):
"""Retrieves the path of a task storage file in the temporary directory.
Args:
task (Task): task.
| python | {
"resource": ""
} |
q26065 | StorageFileWriter._UpdateCounters | train | def _UpdateCounters(self, event):
"""Updates the counters.
Args:
event (EventObject): event.
"""
self._session.parsers_counter['total'] += 1
# Here we want the name of the parser or plugin not the parser chain.
parser_name | python | {
"resource": ""
} |
q26066 | StorageFileWriter.CheckTaskReadyForMerge | train | def CheckTaskReadyForMerge(self, task):
"""Checks if a task is ready for merging with this session storage.
If the task is ready to be merged, this method also sets the task's
storage file size.
Args:
task (Task): task.
Returns:
bool: True if the task is ready to be merged.
Raise... | python | {
"resource": ""
} |
q26067 | StorageFileWriter.GetProcessedTaskIdentifiers | train | def GetProcessedTaskIdentifiers(self):
"""Identifiers for tasks which have been processed.
Returns:
list[str]: task identifiers that are processed.
Raises:
IOError: if the storage type is not supported or
if the temporary path for the task storage does not exist.
OSError: if th... | python | {
"resource": ""
} |
q26068 | StorageFileWriter.SetSerializersProfiler | train | def SetSerializersProfiler(self, serializers_profiler):
"""Sets the serializers profiler.
Args:
serializers_profiler (SerializersProfiler): serializers profiler.
"""
| python | {
"resource": ""
} |
q26069 | StorageFileWriter.SetStorageProfiler | train | def SetStorageProfiler(self, storage_profiler):
"""Sets the storage profiler.
Args:
storage_profiler (StorageProfiler): storage profiler.
"""
| python | {
"resource": ""
} |
q26070 | StorageFileWriter.StartMergeTaskStorage | train | def StartMergeTaskStorage(self, task):
"""Starts a merge of a task storage with the session storage.
Args:
task (Task): task.
Returns:
StorageMergeReader: storage merge reader of the task storage.
Raises:
IOError: if the storage file cannot be opened or
if the storage type... | python | {
"resource": ""
} |
q26071 | StorageFileWriter.StartTaskStorage | train | def StartTaskStorage(self):
"""Creates a temporary path for the task storage.
Raises:
IOError: if the storage type is not supported or
if the temporary path for the task storage already exists.
OSError: if the storage type is not supported or
if the temporary path for the task s... | python | {
"resource": ""
} |
q26072 | StorageFileWriter.StopTaskStorage | train | def StopTaskStorage(self, abort=False):
"""Removes the temporary path for the task storage.
The results of tasks will be lost on abort.
Args:
abort (bool): True to indicate the stop is issued on abort.
Raises:
IOError: if the storage type is not supported.
OSError: if the storage ty... | python | {
"resource": ""
} |
q26073 | StorageFileWriter.WriteSessionCompletion | train | def WriteSessionCompletion(self, aborted=False):
"""Writes session completion information.
Args:
aborted (Optional[bool]): True if the session was aborted.
Raises:
IOError: if the storage type is not supported or
when the storage writer is closed.
OSError: if the storage type i... | python | {
"resource": ""
} |
q26074 | StorageFileWriter.WriteSessionStart | train | def WriteSessionStart(self):
"""Writes session start information.
Raises:
IOError: if the storage type is not supported or
when the storage writer is closed.
OSError: if the storage type is not supported or
when the storage writer is closed.
"""
self._RaiseIfNotWritable(... | python | {
"resource": ""
} |
q26075 | StorageFileWriter.WriteTaskCompletion | train | def WriteTaskCompletion(self, aborted=False):
"""Writes task completion information.
Args:
aborted (Optional[bool]): True if the session was aborted.
Raises:
IOError: if the storage type is not supported or
when the storage writer is closed.
OSError: if the storage type is not ... | python | {
"resource": ""
} |
q26076 | StorageFileWriter.WriteTaskStart | train | def WriteTaskStart(self):
"""Writes task start information.
Raises:
IOError: if the storage type is not supported or
when the storage writer is closed.
OSError: if the storage type is not supported or
when the storage writer is closed.
"""
self._RaiseIfNotWritable()
... | python | {
"resource": ""
} |
q26077 | McafeeAccessProtectionParser._ConvertToTimestamp | train | def _ConvertToTimestamp(self, date, time, timezone):
"""Converts date and time values into a timestamp.
The date and time are made up of two strings, the date and the time,
separated by a tab. The time is in local time. The month and day can
be either 1 or 2 characters long, e.g.: 7/30/2013\\t10:22:48 ... | python | {
"resource": ""
} |
q26078 | SessionizeAnalysisPlugin.ExamineEvent | train | def ExamineEvent(self, mediator, event):
"""Analyzes an EventObject and tags it as part of a session.
Args:
mediator (AnalysisMediator): mediates interactions between analysis
plugins and other components, such as storage and dfvfs.
event (EventObject): event to examine.
"""
if se... | python | {
"resource": ""
} |
q26079 | MultiProcessingQueue.PushItem | train | def PushItem(self, item, block=True):
"""Pushes an item onto the queue.
Args:
item (object): item to add.
block (Optional[bool]): True to block the process when the | python | {
"resource": ""
} |
q26080 | FakeStorageWriter._PrepareAttributeContainer | train | def _PrepareAttributeContainer(self, attribute_container):
"""Prepares an attribute container for storage.
Args:
attribute_container (AttributeContainer): attribute container.
Returns:
AttributeContainer: copy of the attribute container to store | python | {
"resource": ""
} |
q26081 | FakeStorageWriter._ReadEventDataIntoEvent | train | def _ReadEventDataIntoEvent(self, event):
"""Reads the data into the event.
This function is intended to offer backwards compatible event behavior.
Args:
event (EventObject): event.
"""
if self._storage_type != definitions.STORAGE_TYPE_SESSION:
return
event_data_identifier = event... | python | {
"resource": ""
} |
q26082 | FakeStorageWriter.AddWarning | train | def AddWarning(self, warning):
"""Adds a warnings.
Args:
warning (ExtractionWarning): warning.
Raises:
IOError: when the storage writer is | python | {
"resource": ""
} |
q26083 | WinFirewallParser._GetStructureValue | train | def _GetStructureValue(self, structure, key):
"""Retrieves a value from a parsed log line, removing empty results.
Args:
structure (pyparsing.ParseResults): parsed log line.
key (str): results key to retrieve from the parsed log line.
Returns:
type or None: the value of the named key in ... | python | {
"resource": ""
} |
q26084 | WinFirewallParser._ParseCommentRecord | train | def _ParseCommentRecord(self, structure):
"""Parse a comment and store appropriate attributes.
Args:
structure (pyparsing.ParseResults): parsed log line.
"""
comment = structure[1]
if comment.startswith('Version'):
_, _, self._version = comment.partition(':')
elif comment.startswith... | python | {
"resource": ""
} |
q26085 | WinFirewallParser._ParseLogLine | train | def _ParseLogLine(self, parser_mediator, structure):
"""Parse a single log line and and produce an event object.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
structure (pyparsing.ParseResults): structure of ... | python | {
"resource": ""
} |
q26086 | WindowsService.FromEvent | train | def FromEvent(cls, service_event):
"""Creates a service object from an event.
Args:
service_event (EventObject): event to create a new service object from.
Returns:
WindowsService: service.
"""
_, _, name = service_event.key_path.rpartition(
WindowsService._REGISTRY_KEY_PATH_SE... | python | {
"resource": ""
} |
q26087 | WindowsService.HumanReadableType | train | def HumanReadableType(self):
"""Return a human readable string describing the type value.
Returns:
str: human readable description of the type value.
"""
if isinstance(self.service_type, py2to3.STRING_TYPES):
| python | {
"resource": ""
} |
q26088 | WindowsService.HumanReadableStartType | train | def HumanReadableStartType(self):
"""Return a human readable string describing the start type value.
Returns:
str: human readable description of the start type value.
"""
if isinstance(self.start_type, py2to3.STRING_TYPES):
| python | {
"resource": ""
} |
q26089 | WindowsServiceCollection.AddService | train | def AddService(self, new_service):
"""Add a new service to the list of ones we know about.
Args:
new_service (WindowsService): the service to add.
"""
for service in self._services:
if new_service == service:
# If this service is the same as one we already know about, we
# j... | python | {
"resource": ""
} |
q26090 | WindowsServicesAnalysisPlugin._FormatServiceText | train | def _FormatServiceText(self, service):
"""Produces a human readable multi-line string representing the service.
Args:
service (WindowsService): service to format.
Returns:
str: human readable representation of a Windows Service.
"""
string_segments = [
service.name,
'\... | python | {
"resource": ""
} |
q26091 | WindowsServicesAnalysisPlugin.ExamineEvent | train | def ExamineEvent(self, mediator, event):
"""Analyzes an event and creates Windows Services as required.
At present, this method only handles events extracted from the Registry.
Args:
mediator (AnalysisMediator): mediates interactions between analysis
plugins and other components, such as... | python | {
"resource": ""
} |
q26092 | InstallHistoryPlugin.GetEntries | train | def GetEntries(self, parser_mediator, top_level=None, **unused_kwargs):
"""Extracts relevant install history entries.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
top_level (dict[str, object]): plist top-lev... | python | {
"resource": ""
} |
q26093 | TaggingAnalysisPlugin._AttemptAutoDetectTagFile | train | def _AttemptAutoDetectTagFile(self, analysis_mediator):
"""Detects which tag file is most appropriate.
Args:
analysis_mediator (AnalysisMediator): analysis mediator.
Returns:
bool: True if a tag file is autodetected.
"""
self._autodetect_tag_file_attempt = True
if not analysis_medi... | python | {
"resource": ""
} |
q26094 | TaggingAnalysisPlugin.ExamineEvent | train | def ExamineEvent(self, mediator, event):
"""Analyzes an EventObject and tags it according to rules in the tag file.
Args:
mediator (AnalysisMediator): mediates interactions between analysis
plugins and other components, such as storage and dfvfs.
event (EventObject): event to examine.
... | python | {
"resource": ""
} |
q26095 | TaggingAnalysisPlugin.SetAndLoadTagFile | train | def SetAndLoadTagFile(self, tagging_file_path):
"""Sets the tag file to be used by the plugin.
Args:
tagging_file_path (str): | python | {
"resource": ""
} |
q26096 | CronSyslogPlugin.ParseMessage | train | def ParseMessage(self, parser_mediator, key, date_time, tokens):
"""Parses a syslog body that matched one of defined grammars.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
key (str): name of the matching gra... | python | {
"resource": ""
} |
q26097 | YaraAnalyzer.Analyze | train | def Analyze(self, data):
"""Analyzes a block of data, attempting to match Yara rules to it.
Args:
data(bytes): a block of data.
"""
if not self._rules:
return
try:
self._matches = self._rules.match(data=data, timeout=self._MATCH_TIMEOUT)
except yara.YaraTimeoutError:
log... | python | {
"resource": ""
} |
q26098 | YaraAnalyzer.GetResults | train | def GetResults(self):
"""Retrieves results of the most recent analysis.
Returns:
list[AnalyzerResult]: results.
"""
result = analyzer_result.AnalyzerResult()
result.analyzer_name = self.NAME
result.attribute_name = self._ATTRIBUTE_NAME
| python | {
"resource": ""
} |
q26099 | ESEDBParser._GetTableNames | train | def _GetTableNames(self, database):
"""Retrieves the table names in a database.
Args:
database (pyesedb.file): ESE database.
| python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.