repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
google/grr
grr/server/grr_response_server/databases/mysql.py
_IsRetryable
def _IsRetryable(error): """Returns whether error is likely to be retryable.""" if not isinstance(error, MySQLdb.OperationalError): return False if not error.args: return False code = error.args[0] return code in _RETRYABLE_ERRORS
python
def _IsRetryable(error): """Returns whether error is likely to be retryable.""" if not isinstance(error, MySQLdb.OperationalError): return False if not error.args: return False code = error.args[0] return code in _RETRYABLE_ERRORS
[ "def", "_IsRetryable", "(", "error", ")", ":", "if", "not", "isinstance", "(", "error", ",", "MySQLdb", ".", "OperationalError", ")", ":", "return", "False", "if", "not", "error", ".", "args", ":", "return", "False", "code", "=", "error", ".", "args", ...
Returns whether error is likely to be retryable.
[ "Returns", "whether", "error", "is", "likely", "to", "be", "retryable", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L67-L74
train
Returns whether the error is likely to be retryable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_CheckCollation
def _CheckCollation(cursor): """Checks MySQL collation and warns if misconfigured.""" # Do not fail for wrong collation, because changing it is harder than changing # the character set. Some providers only allow changing character set and then # use the default collation. Also, misconfigured collation is not e...
python
def _CheckCollation(cursor): """Checks MySQL collation and warns if misconfigured.""" # Do not fail for wrong collation, because changing it is harder than changing # the character set. Some providers only allow changing character set and then # use the default collation. Also, misconfigured collation is not e...
[ "def", "_CheckCollation", "(", "cursor", ")", ":", "# Do not fail for wrong collation, because changing it is harder than changing", "# the character set. Some providers only allow changing character set and then", "# use the default collation. Also, misconfigured collation is not expected to", "#...
Checks MySQL collation and warns if misconfigured.
[ "Checks", "MySQL", "collation", "and", "warns", "if", "misconfigured", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L102-L121
train
Checks MySQL collation and warns if misconfigured.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_CheckConnectionEncoding
def _CheckConnectionEncoding(cursor): """Enforces a sane UTF-8 encoding for the database connection.""" cur_character_set = _ReadVariable("character_set_connection", cursor) if cur_character_set != CHARACTER_SET: raise EncodingEnforcementError( "Require MySQL character_set_connection of {}, got {}.".f...
python
def _CheckConnectionEncoding(cursor): """Enforces a sane UTF-8 encoding for the database connection.""" cur_character_set = _ReadVariable("character_set_connection", cursor) if cur_character_set != CHARACTER_SET: raise EncodingEnforcementError( "Require MySQL character_set_connection of {}, got {}.".f...
[ "def", "_CheckConnectionEncoding", "(", "cursor", ")", ":", "cur_character_set", "=", "_ReadVariable", "(", "\"character_set_connection\"", ",", "cursor", ")", "if", "cur_character_set", "!=", "CHARACTER_SET", ":", "raise", "EncodingEnforcementError", "(", "\"Require MySQ...
Enforces a sane UTF-8 encoding for the database connection.
[ "Enforces", "a", "sane", "UTF", "-", "8", "encoding", "for", "the", "database", "connection", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L129-L135
train
Enforces a sane UTF - 8 encoding for the database connection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_CheckDatabaseEncoding
def _CheckDatabaseEncoding(cursor): """Enforces a sane UTF-8 encoding for the database.""" cur_character_set = _ReadVariable("character_set_database", cursor) if cur_character_set != CHARACTER_SET: raise EncodingEnforcementError( "Require MySQL character_set_database of {}, got {}." " To creat...
python
def _CheckDatabaseEncoding(cursor): """Enforces a sane UTF-8 encoding for the database.""" cur_character_set = _ReadVariable("character_set_database", cursor) if cur_character_set != CHARACTER_SET: raise EncodingEnforcementError( "Require MySQL character_set_database of {}, got {}." " To creat...
[ "def", "_CheckDatabaseEncoding", "(", "cursor", ")", ":", "cur_character_set", "=", "_ReadVariable", "(", "\"character_set_database\"", ",", "cursor", ")", "if", "cur_character_set", "!=", "CHARACTER_SET", ":", "raise", "EncodingEnforcementError", "(", "\"Require MySQL ch...
Enforces a sane UTF-8 encoding for the database.
[ "Enforces", "a", "sane", "UTF", "-", "8", "encoding", "for", "the", "database", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L138-L146
train
Enforces a sane UTF - 8 encoding for the database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_SetPacketSizeForFollowingConnections
def _SetPacketSizeForFollowingConnections(cursor): """Sets max_allowed_packet globally for new connections (not current!).""" cur_packet_size = int(_ReadVariable("max_allowed_packet", cursor)) if cur_packet_size < MAX_PACKET_SIZE: logging.warning( "MySQL max_allowed_packet of %d is required, got %d. ...
python
def _SetPacketSizeForFollowingConnections(cursor): """Sets max_allowed_packet globally for new connections (not current!).""" cur_packet_size = int(_ReadVariable("max_allowed_packet", cursor)) if cur_packet_size < MAX_PACKET_SIZE: logging.warning( "MySQL max_allowed_packet of %d is required, got %d. ...
[ "def", "_SetPacketSizeForFollowingConnections", "(", "cursor", ")", ":", "cur_packet_size", "=", "int", "(", "_ReadVariable", "(", "\"max_allowed_packet\"", ",", "cursor", ")", ")", "if", "cur_packet_size", "<", "MAX_PACKET_SIZE", ":", "logging", ".", "warning", "("...
Sets max_allowed_packet globally for new connections (not current!).
[ "Sets", "max_allowed_packet", "globally", "for", "new", "connections", "(", "not", "current!", ")", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L149-L157
train
Sets the max_allowed_packet variable globally for new connections.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_CheckPacketSize
def _CheckPacketSize(cursor): """Checks that MySQL packet size is big enough for expected query size.""" cur_packet_size = int(_ReadVariable("max_allowed_packet", cursor)) if cur_packet_size < MAX_PACKET_SIZE: raise Error( "MySQL max_allowed_packet of {0} is required, got {1}. " "Please set ma...
python
def _CheckPacketSize(cursor): """Checks that MySQL packet size is big enough for expected query size.""" cur_packet_size = int(_ReadVariable("max_allowed_packet", cursor)) if cur_packet_size < MAX_PACKET_SIZE: raise Error( "MySQL max_allowed_packet of {0} is required, got {1}. " "Please set ma...
[ "def", "_CheckPacketSize", "(", "cursor", ")", ":", "cur_packet_size", "=", "int", "(", "_ReadVariable", "(", "\"max_allowed_packet\"", ",", "cursor", ")", ")", "if", "cur_packet_size", "<", "MAX_PACKET_SIZE", ":", "raise", "Error", "(", "\"MySQL max_allowed_packet ...
Checks that MySQL packet size is big enough for expected query size.
[ "Checks", "that", "MySQL", "packet", "size", "is", "big", "enough", "for", "expected", "query", "size", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L160-L167
train
Checks that MySQL packet size is big enough for expected query size.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_CheckLogFileSize
def _CheckLogFileSize(cursor): """Warns if MySQL log file size is not large enough for blob insertions.""" # Do not fail, because users might not be able to change this for their # database. Instead, warn the user about the impacts. innodb_log_file_size = int(_ReadVariable("innodb_log_file_size", cursor)) r...
python
def _CheckLogFileSize(cursor): """Warns if MySQL log file size is not large enough for blob insertions.""" # Do not fail, because users might not be able to change this for their # database. Instead, warn the user about the impacts. innodb_log_file_size = int(_ReadVariable("innodb_log_file_size", cursor)) r...
[ "def", "_CheckLogFileSize", "(", "cursor", ")", ":", "# Do not fail, because users might not be able to change this for their", "# database. Instead, warn the user about the impacts.", "innodb_log_file_size", "=", "int", "(", "_ReadVariable", "(", "\"innodb_log_file_size\"", ",", "cu...
Warns if MySQL log file size is not large enough for blob insertions.
[ "Warns", "if", "MySQL", "log", "file", "size", "is", "not", "large", "enough", "for", "blob", "insertions", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L170-L187
train
Warns if MySQL log file size is not large enough for blob insertions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_IsMariaDB
def _IsMariaDB(cursor): """Checks if we are running against MariaDB.""" for variable in ["version", "version_comment"]: cursor.execute("SHOW VARIABLES LIKE %s;", (variable,)) version = cursor.fetchone() if version and "MariaDB" in version[1]: return True return False
python
def _IsMariaDB(cursor): """Checks if we are running against MariaDB.""" for variable in ["version", "version_comment"]: cursor.execute("SHOW VARIABLES LIKE %s;", (variable,)) version = cursor.fetchone() if version and "MariaDB" in version[1]: return True return False
[ "def", "_IsMariaDB", "(", "cursor", ")", ":", "for", "variable", "in", "[", "\"version\"", ",", "\"version_comment\"", "]", ":", "cursor", ".", "execute", "(", "\"SHOW VARIABLES LIKE %s;\"", ",", "(", "variable", ",", ")", ")", "version", "=", "cursor", ".",...
Checks if we are running against MariaDB.
[ "Checks", "if", "we", "are", "running", "against", "MariaDB", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L190-L197
train
Checks if we are running against MariaDB.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_SetupDatabase
def _SetupDatabase(host=None, port=None, user=None, password=None, database=None, client_key_path=None, client_cert_path=None, ca_cert_path=None): """Connect to the given MySQL host and...
python
def _SetupDatabase(host=None, port=None, user=None, password=None, database=None, client_key_path=None, client_cert_path=None, ca_cert_path=None): """Connect to the given MySQL host and...
[ "def", "_SetupDatabase", "(", "host", "=", "None", ",", "port", "=", "None", ",", "user", "=", "None", ",", "password", "=", "None", ",", "database", "=", "None", ",", "client_key_path", "=", "None", ",", "client_cert_path", "=", "None", ",", "ca_cert_pa...
Connect to the given MySQL host and create a utf8mb4_unicode_ci database. Args: host: The hostname to connect to. port: The port to connect to. user: The username to connect as. password: The password to connect with. database: The database name to create. client_key_path: The path of the cli...
[ "Connect", "to", "the", "given", "MySQL", "host", "and", "create", "a", "utf8mb4_unicode_ci", "database", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L251-L306
train
Connect to the given MySQL host and create a utf8mb4_unicode_ci database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_GetConnectionArgs
def _GetConnectionArgs(host=None, port=None, user=None, password=None, database=None, client_key_path=None, client_cert_path=None, ca_cert_path=None): """Bui...
python
def _GetConnectionArgs(host=None, port=None, user=None, password=None, database=None, client_key_path=None, client_cert_path=None, ca_cert_path=None): """Bui...
[ "def", "_GetConnectionArgs", "(", "host", "=", "None", ",", "port", "=", "None", ",", "user", "=", "None", ",", "password", "=", "None", ",", "database", "=", "None", ",", "client_key_path", "=", "None", ",", "client_cert_path", "=", "None", ",", "ca_cer...
Builds connection arguments for MySQLdb.Connect function.
[ "Builds", "connection", "arguments", "for", "MySQLdb", ".", "Connect", "function", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L309-L343
train
Builds connection arguments for MySQLdb. Connect function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
_Connect
def _Connect(host=None, port=None, user=None, password=None, database=None, client_key_path=None, client_cert_path=None, ca_cert_path=None): """Connect to MySQL and check if server fulfills requirements.""" connection_args = ...
python
def _Connect(host=None, port=None, user=None, password=None, database=None, client_key_path=None, client_cert_path=None, ca_cert_path=None): """Connect to MySQL and check if server fulfills requirements.""" connection_args = ...
[ "def", "_Connect", "(", "host", "=", "None", ",", "port", "=", "None", ",", "user", "=", "None", ",", "password", "=", "None", ",", "database", "=", "None", ",", "client_key_path", "=", "None", ",", "client_cert_path", "=", "None", ",", "ca_cert_path", ...
Connect to MySQL and check if server fulfills requirements.
[ "Connect", "to", "MySQL", "and", "check", "if", "server", "fulfills", "requirements", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L346-L376
train
Connect to MySQL and check if server fulfills requirements.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mysql.py
MysqlDB._RunInTransaction
def _RunInTransaction(self, function, readonly=False): """Runs function within a transaction. Allocates a connection, begins a transaction on it and passes the connection to function. If function finishes without raising, the transaction is committed. If function raises, the transaction will be r...
python
def _RunInTransaction(self, function, readonly=False): """Runs function within a transaction. Allocates a connection, begins a transaction on it and passes the connection to function. If function finishes without raising, the transaction is committed. If function raises, the transaction will be r...
[ "def", "_RunInTransaction", "(", "self", ",", "function", ",", "readonly", "=", "False", ")", ":", "start_query", "=", "\"START TRANSACTION;\"", "if", "readonly", ":", "start_query", "=", "\"START TRANSACTION WITH CONSISTENT SNAPSHOT, READ ONLY;\"", "for", "retry_count", ...
Runs function within a transaction. Allocates a connection, begins a transaction on it and passes the connection to function. If function finishes without raising, the transaction is committed. If function raises, the transaction will be rolled back, if a retryable database error is raised, the o...
[ "Runs", "function", "within", "a", "transaction", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql.py#L474-L523
train
Runs a function within a transaction.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_client_reports.py
InMemoryDBClientReportsMixin.WriteClientGraphSeries
def WriteClientGraphSeries(self, graph_series, client_label, timestamp): """See db.Database.""" series_key = (client_label, graph_series.report_type, timestamp.Copy()) self.client_graph_series[series_key] = graph_series.Copy()
python
def WriteClientGraphSeries(self, graph_series, client_label, timestamp): """See db.Database.""" series_key = (client_label, graph_series.report_type, timestamp.Copy()) self.client_graph_series[series_key] = graph_series.Copy()
[ "def", "WriteClientGraphSeries", "(", "self", ",", "graph_series", ",", "client_label", ",", "timestamp", ")", ":", "series_key", "=", "(", "client_label", ",", "graph_series", ".", "report_type", ",", "timestamp", ".", "Copy", "(", ")", ")", "self", ".", "c...
See db.Database.
[ "See", "db", ".", "Database", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_client_reports.py#L32-L37
train
Writes a graph series to the client graph series table.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_client_reports.py
InMemoryDBClientReportsMixin.ReadAllClientGraphSeries
def ReadAllClientGraphSeries( self, client_label, report_type, time_range = None, ): """See db.Database.""" series_with_timestamps = {} for series_key, series in iteritems(self.client_graph_series): series_label, series_type, timestamp = series_key if series_label == cl...
python
def ReadAllClientGraphSeries( self, client_label, report_type, time_range = None, ): """See db.Database.""" series_with_timestamps = {} for series_key, series in iteritems(self.client_graph_series): series_label, series_type, timestamp = series_key if series_label == cl...
[ "def", "ReadAllClientGraphSeries", "(", "self", ",", "client_label", ",", "report_type", ",", "time_range", "=", "None", ",", ")", ":", "series_with_timestamps", "=", "{", "}", "for", "series_key", ",", "series", "in", "iteritems", "(", "self", ".", "client_gr...
See db.Database.
[ "See", "db", ".", "Database", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_client_reports.py#L40-L54
train
Reads all client graph series for a given client label and report type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_client_reports.py
InMemoryDBClientReportsMixin.ReadMostRecentClientGraphSeries
def ReadMostRecentClientGraphSeries(self, client_label, report_type ): """See db.Database.""" series_with_timestamps = self.ReadAllClientGraphSeries( client_label, report_type) if not series_with_timestamps: return None...
python
def ReadMostRecentClientGraphSeries(self, client_label, report_type ): """See db.Database.""" series_with_timestamps = self.ReadAllClientGraphSeries( client_label, report_type) if not series_with_timestamps: return None...
[ "def", "ReadMostRecentClientGraphSeries", "(", "self", ",", "client_label", ",", "report_type", ")", ":", "series_with_timestamps", "=", "self", ".", "ReadAllClientGraphSeries", "(", "client_label", ",", "report_type", ")", "if", "not", "series_with_timestamps", ":", ...
See db.Database.
[ "See", "db", ".", "Database", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_client_reports.py#L57-L66
train
Reads the most recent series for a given client label and report type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/data_stores/fake_data_store.py
FakeDataStore.Set
def Set(self, subject, attribute, value, timestamp=None, replace=True, sync=True): """Set the value into the data store.""" subject = utils.SmartUnicode(subject) _ = sync attribute = utils.SmartUnicode(attribute) if timestamp is None or t...
python
def Set(self, subject, attribute, value, timestamp=None, replace=True, sync=True): """Set the value into the data store.""" subject = utils.SmartUnicode(subject) _ = sync attribute = utils.SmartUnicode(attribute) if timestamp is None or t...
[ "def", "Set", "(", "self", ",", "subject", ",", "attribute", ",", "value", ",", "timestamp", "=", "None", ",", "replace", "=", "True", ",", "sync", "=", "True", ")", ":", "subject", "=", "utils", ".", "SmartUnicode", "(", "subject", ")", "_", "=", ...
Set the value into the data store.
[ "Set", "the", "value", "into", "the", "data", "store", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/data_stores/fake_data_store.py#L79-L103
train
Sets the value into the data store.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/data_stores/fake_data_store.py
FakeDataStore.ResolvePrefix
def ResolvePrefix(self, subject, attribute_prefix, timestamp=None, limit=None): """Resolve all attributes for a subject starting with a prefix.""" subject = utils.SmartUnicode(subject) if timestamp in [None, self.NEWEST_TIMESTAMP, self.ALL_TIMESTAMPS]: start, end = 0, (2**63) - 1 ...
python
def ResolvePrefix(self, subject, attribute_prefix, timestamp=None, limit=None): """Resolve all attributes for a subject starting with a prefix.""" subject = utils.SmartUnicode(subject) if timestamp in [None, self.NEWEST_TIMESTAMP, self.ALL_TIMESTAMPS]: start, end = 0, (2**63) - 1 ...
[ "def", "ResolvePrefix", "(", "self", ",", "subject", ",", "attribute_prefix", ",", "timestamp", "=", "None", ",", "limit", "=", "None", ")", ":", "subject", "=", "utils", ".", "SmartUnicode", "(", "subject", ")", "if", "timestamp", "in", "[", "None", ","...
Resolve all attributes for a subject starting with a prefix.
[ "Resolve", "all", "attributes", "for", "a", "subject", "starting", "with", "a", "prefix", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/data_stores/fake_data_store.py#L296-L358
train
Resolves all attributes for a subject starting with a prefix.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/bin/fleetspeak_frontend.py
GRRFSServer.Process
def Process(self, fs_msg, context): """Processes a single fleetspeak message.""" try: if fs_msg.message_type == "GrrMessage": grr_message = rdf_flows.GrrMessage.FromSerializedString( fs_msg.data.value) self._ProcessGRRMessages(fs_msg.source.client_id, [grr_message]) elif ...
python
def Process(self, fs_msg, context): """Processes a single fleetspeak message.""" try: if fs_msg.message_type == "GrrMessage": grr_message = rdf_flows.GrrMessage.FromSerializedString( fs_msg.data.value) self._ProcessGRRMessages(fs_msg.source.client_id, [grr_message]) elif ...
[ "def", "Process", "(", "self", ",", "fs_msg", ",", "context", ")", ":", "try", ":", "if", "fs_msg", ".", "message_type", "==", "\"GrrMessage\"", ":", "grr_message", "=", "rdf_flows", ".", "GrrMessage", ".", "FromSerializedString", "(", "fs_msg", ".", "data",...
Processes a single fleetspeak message.
[ "Processes", "a", "single", "fleetspeak", "message", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/fleetspeak_frontend.py#L50-L69
train
Processes a single fleetspeak message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/bin/fleetspeak_frontend.py
GRRFSServer._ProcessGRRMessages
def _ProcessGRRMessages(self, fs_client_id, grr_messages): """Handles messages from GRR clients received via Fleetspeak. This method updates the last-ping timestamp of the client before beginning processing. Args: fs_client_id: The Fleetspeak client-id for the client. grr_messages: An Iter...
python
def _ProcessGRRMessages(self, fs_client_id, grr_messages): """Handles messages from GRR clients received via Fleetspeak. This method updates the last-ping timestamp of the client before beginning processing. Args: fs_client_id: The Fleetspeak client-id for the client. grr_messages: An Iter...
[ "def", "_ProcessGRRMessages", "(", "self", ",", "fs_client_id", ",", "grr_messages", ")", ":", "grr_client_id", "=", "fleetspeak_utils", ".", "FleetspeakIDToGRRID", "(", "fs_client_id", ")", "for", "grr_message", "in", "grr_messages", ":", "grr_message", ".", "sourc...
Handles messages from GRR clients received via Fleetspeak. This method updates the last-ping timestamp of the client before beginning processing. Args: fs_client_id: The Fleetspeak client-id for the client. grr_messages: An Iterable of GrrMessages.
[ "Handles", "messages", "from", "GRR", "clients", "received", "via", "Fleetspeak", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/bin/fleetspeak_frontend.py#L71-L91
train
Processes messages from GRR clients.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckHost
def CheckHost(host_data, os_name=None, cpe=None, labels=None, exclude_checks=None, restrict_checks=None): """Perform all checks on a host using acquired artifacts. Checks are selected based on the artifacts available and the host attributes (e...
python
def CheckHost(host_data, os_name=None, cpe=None, labels=None, exclude_checks=None, restrict_checks=None): """Perform all checks on a host using acquired artifacts. Checks are selected based on the artifacts available and the host attributes (e...
[ "def", "CheckHost", "(", "host_data", ",", "os_name", "=", "None", ",", "cpe", "=", "None", ",", "labels", "=", "None", ",", "exclude_checks", "=", "None", ",", "restrict_checks", "=", "None", ")", ":", "# Get knowledgebase, os_name from hostdata", "kb", "=", ...
Perform all checks on a host using acquired artifacts. Checks are selected based on the artifacts available and the host attributes (e.g. os_name/cpe/labels) provided as either parameters, or in the knowledgebase artifact. A KnowledgeBase artifact should be provided that contains, at a minimum: - OS - Hos...
[ "Perform", "all", "checks", "on", "a", "host", "using", "acquired", "artifacts", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L712-L763
train
This function checks the host using the given data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
LoadCheckFromFile
def LoadCheckFromFile(file_path, check_id, overwrite_if_exists=True): """Load a single check from a file.""" configs = LoadConfigsFromFile(file_path) conf = configs.get(check_id) check = Check(**conf) check.Validate() CheckRegistry.RegisterCheck( check, source="file:%s" % file_path, overwr...
python
def LoadCheckFromFile(file_path, check_id, overwrite_if_exists=True): """Load a single check from a file.""" configs = LoadConfigsFromFile(file_path) conf = configs.get(check_id) check = Check(**conf) check.Validate() CheckRegistry.RegisterCheck( check, source="file:%s" % file_path, overwr...
[ "def", "LoadCheckFromFile", "(", "file_path", ",", "check_id", ",", "overwrite_if_exists", "=", "True", ")", ":", "configs", "=", "LoadConfigsFromFile", "(", "file_path", ")", "conf", "=", "configs", ".", "get", "(", "check_id", ")", "check", "=", "Check", "...
Load a single check from a file.
[ "Load", "a", "single", "check", "from", "a", "file", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L771-L782
train
Load a single check from a file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
LoadChecksFromFiles
def LoadChecksFromFiles(file_paths, overwrite_if_exists=True): """Load the checks defined in the specified files.""" loaded = [] for file_path in file_paths: configs = LoadConfigsFromFile(file_path) for conf in itervalues(configs): check = Check(**conf) # Validate will raise if the check doesn...
python
def LoadChecksFromFiles(file_paths, overwrite_if_exists=True): """Load the checks defined in the specified files.""" loaded = [] for file_path in file_paths: configs = LoadConfigsFromFile(file_path) for conf in itervalues(configs): check = Check(**conf) # Validate will raise if the check doesn...
[ "def", "LoadChecksFromFiles", "(", "file_paths", ",", "overwrite_if_exists", "=", "True", ")", ":", "loaded", "=", "[", "]", "for", "file_path", "in", "file_paths", ":", "configs", "=", "LoadConfigsFromFile", "(", "file_path", ")", "for", "conf", "in", "iterva...
Load the checks defined in the specified files.
[ "Load", "the", "checks", "defined", "in", "the", "specified", "files", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L785-L800
train
Load the checks defined in the specified files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
LoadChecksFromDirs
def LoadChecksFromDirs(dir_paths, overwrite_if_exists=True): """Load checks from all yaml files in the specified directories.""" loaded = [] for dir_path in dir_paths: cfg_files = glob.glob(os.path.join(dir_path, "*.yaml")) loaded.extend(LoadChecksFromFiles(cfg_files, overwrite_if_exists)) return loaded
python
def LoadChecksFromDirs(dir_paths, overwrite_if_exists=True): """Load checks from all yaml files in the specified directories.""" loaded = [] for dir_path in dir_paths: cfg_files = glob.glob(os.path.join(dir_path, "*.yaml")) loaded.extend(LoadChecksFromFiles(cfg_files, overwrite_if_exists)) return loaded
[ "def", "LoadChecksFromDirs", "(", "dir_paths", ",", "overwrite_if_exists", "=", "True", ")", ":", "loaded", "=", "[", "]", "for", "dir_path", "in", "dir_paths", ":", "cfg_files", "=", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", "(", "dir_pa...
Load checks from all yaml files in the specified directories.
[ "Load", "checks", "from", "all", "yaml", "files", "in", "the", "specified", "directories", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L803-L809
train
Load all yaml files in the specified directories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Hint.Render
def Render(self, rdf_data): """Processes data according to formatting rules.""" report_data = rdf_data[:self.max_results] results = [self.hinter.Render(rdf) for rdf in report_data] extra = len(rdf_data) - len(report_data) if extra > 0: results.append("...plus another %d issues." % extra) r...
python
def Render(self, rdf_data): """Processes data according to formatting rules.""" report_data = rdf_data[:self.max_results] results = [self.hinter.Render(rdf) for rdf in report_data] extra = len(rdf_data) - len(report_data) if extra > 0: results.append("...plus another %d issues." % extra) r...
[ "def", "Render", "(", "self", ",", "rdf_data", ")", ":", "report_data", "=", "rdf_data", "[", ":", "self", ".", "max_results", "]", "results", "=", "[", "self", ".", "hinter", ".", "Render", "(", "rdf", ")", "for", "rdf", "in", "report_data", "]", "e...
Processes data according to formatting rules.
[ "Processes", "data", "according", "to", "formatting", "rules", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L92-L99
train
Processes data according to formatting rules.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Filter.Parse
def Parse(self, rdf_data): """Process rdf data through the filter. Filters sift data according to filter rules. Data that passes the filter rule is kept, other data is dropped. If no filter method is provided, the data is returned as a list. Otherwise, a items that meet filter conditions are retur...
python
def Parse(self, rdf_data): """Process rdf data through the filter. Filters sift data according to filter rules. Data that passes the filter rule is kept, other data is dropped. If no filter method is provided, the data is returned as a list. Otherwise, a items that meet filter conditions are retur...
[ "def", "Parse", "(", "self", ",", "rdf_data", ")", ":", "if", "self", ".", "_filter", ":", "return", "list", "(", "self", ".", "_filter", ".", "Parse", "(", "rdf_data", ",", "self", ".", "expression", ")", ")", "return", "rdf_data" ]
Process rdf data through the filter. Filters sift data according to filter rules. Data that passes the filter rule is kept, other data is dropped. If no filter method is provided, the data is returned as a list. Otherwise, a items that meet filter conditions are returned in a list. Args: rd...
[ "Process", "rdf", "data", "through", "the", "filter", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L138-L155
train
Parses the RDF data into a list of items.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Filter.Validate
def Validate(self): """The filter exists, and has valid filter and hint expressions.""" if self.type not in filters.Filter.classes: raise DefinitionError("Undefined filter type %s" % self.type) self._filter.Validate(self.expression) Validate(self.hint, "Filter has invalid hint")
python
def Validate(self): """The filter exists, and has valid filter and hint expressions.""" if self.type not in filters.Filter.classes: raise DefinitionError("Undefined filter type %s" % self.type) self._filter.Validate(self.expression) Validate(self.hint, "Filter has invalid hint")
[ "def", "Validate", "(", "self", ")", ":", "if", "self", ".", "type", "not", "in", "filters", ".", "Filter", ".", "classes", ":", "raise", "DefinitionError", "(", "\"Undefined filter type %s\"", "%", "self", ".", "type", ")", "self", ".", "_filter", ".", ...
The filter exists, and has valid filter and hint expressions.
[ "The", "filter", "exists", "and", "has", "valid", "filter", "and", "hint", "expressions", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L157-L162
train
Validates the filter exists and has valid filter and hint expressions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Probe.Parse
def Parse(self, rdf_data): """Process rdf data through filters. Test if results match expectations. Processing of rdf data is staged by a filter handler, which manages the processing of host data. The output of the filters are compared against expected results. Args: rdf_data: An list contai...
python
def Parse(self, rdf_data): """Process rdf data through filters. Test if results match expectations. Processing of rdf data is staged by a filter handler, which manages the processing of host data. The output of the filters are compared against expected results. Args: rdf_data: An list contai...
[ "def", "Parse", "(", "self", ",", "rdf_data", ")", ":", "if", "not", "isinstance", "(", "rdf_data", ",", "(", "list", ",", "set", ")", ")", ":", "raise", "ProcessingError", "(", "\"Bad host data format: %s\"", "%", "type", "(", "rdf_data", ")", ")", "if"...
Process rdf data through filters. Test if results match expectations. Processing of rdf data is staged by a filter handler, which manages the processing of host data. The output of the filters are compared against expected results. Args: rdf_data: An list containing 0 or more rdf values. Re...
[ "Process", "rdf", "data", "through", "filters", ".", "Test", "if", "results", "match", "expectations", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L192-L217
train
Process rdf data through filters and test if results match expectations.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Probe.Validate
def Validate(self): """Check the test set is well constructed.""" Validate(self.target, "Probe has invalid target") self.baseliner.Validate() self.handler.Validate() self.hint.Validate()
python
def Validate(self): """Check the test set is well constructed.""" Validate(self.target, "Probe has invalid target") self.baseliner.Validate() self.handler.Validate() self.hint.Validate()
[ "def", "Validate", "(", "self", ")", ":", "Validate", "(", "self", ".", "target", ",", "\"Probe has invalid target\"", ")", "self", ".", "baseliner", ".", "Validate", "(", ")", "self", ".", "handler", ".", "Validate", "(", ")", "self", ".", "hint", ".", ...
Check the test set is well constructed.
[ "Check", "the", "test", "set", "is", "well", "constructed", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L219-L224
train
Check the test set is well constructed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Method.Parse
def Parse(self, conditions, host_data): """Runs probes that evaluate whether collected data has an issue. Args: conditions: The trigger conditions. host_data: A map of artifacts and rdf data. Returns: Anomalies if an issue exists. """ processed = [] probes = self.triggers.Cal...
python
def Parse(self, conditions, host_data): """Runs probes that evaluate whether collected data has an issue. Args: conditions: The trigger conditions. host_data: A map of artifacts and rdf data. Returns: Anomalies if an issue exists. """ processed = [] probes = self.triggers.Cal...
[ "def", "Parse", "(", "self", ",", "conditions", ",", "host_data", ")", ":", "processed", "=", "[", "]", "probes", "=", "self", ".", "triggers", ".", "Calls", "(", "conditions", ")", "for", "p", "in", "probes", ":", "# Get the data required for the probe. A p...
Runs probes that evaluate whether collected data has an issue. Args: conditions: The trigger conditions. host_data: A map of artifacts and rdf data. Returns: Anomalies if an issue exists.
[ "Runs", "probes", "that", "evaluate", "whether", "collected", "data", "has", "an", "issue", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L265-L293
train
Runs probes that evaluate whether collected data has an issue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Method.Validate
def Validate(self): """Check the Method is well constructed.""" ValidateMultiple(self.probe, "Method has invalid probes") Validate(self.target, "Method has invalid target") Validate(self.hint, "Method has invalid hint")
python
def Validate(self): """Check the Method is well constructed.""" ValidateMultiple(self.probe, "Method has invalid probes") Validate(self.target, "Method has invalid target") Validate(self.hint, "Method has invalid hint")
[ "def", "Validate", "(", "self", ")", ":", "ValidateMultiple", "(", "self", ".", "probe", ",", "\"Method has invalid probes\"", ")", "Validate", "(", "self", ".", "target", ",", "\"Method has invalid target\"", ")", "Validate", "(", "self", ".", "hint", ",", "\...
Check the Method is well constructed.
[ "Check", "the", "Method", "is", "well", "constructed", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L295-L299
train
Check the Method is well constructed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckResult.ExtendAnomalies
def ExtendAnomalies(self, other): """Merge anomalies from another CheckResult.""" for o in other: if o is not None: self.anomaly.Extend(list(o.anomaly))
python
def ExtendAnomalies(self, other): """Merge anomalies from another CheckResult.""" for o in other: if o is not None: self.anomaly.Extend(list(o.anomaly))
[ "def", "ExtendAnomalies", "(", "self", ",", "other", ")", ":", "for", "o", "in", "other", ":", "if", "o", "is", "not", "None", ":", "self", ".", "anomaly", ".", "Extend", "(", "list", "(", "o", ".", "anomaly", ")", ")" ]
Merge anomalies from another CheckResult.
[ "Merge", "anomalies", "from", "another", "CheckResult", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L312-L316
train
Extend anomalies from another CheckResult.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Check.UsesArtifact
def UsesArtifact(self, artifacts): """Determines if the check uses the specified artifact. Args: artifacts: Either a single artifact name, or a list of artifact names Returns: True if the check uses a specific artifact. """ # If artifact is a single string, see if it is in the list of ...
python
def UsesArtifact(self, artifacts): """Determines if the check uses the specified artifact. Args: artifacts: Either a single artifact name, or a list of artifact names Returns: True if the check uses a specific artifact. """ # If artifact is a single string, see if it is in the list of ...
[ "def", "UsesArtifact", "(", "self", ",", "artifacts", ")", ":", "# If artifact is a single string, see if it is in the list of artifacts", "# as-is. Otherwise, test whether any of the artifacts passed in to this", "# function exist in the list of artifacts.", "if", "isinstance", "(", "ar...
Determines if the check uses the specified artifact. Args: artifacts: Either a single artifact name, or a list of artifact names Returns: True if the check uses a specific artifact.
[ "Determines", "if", "the", "check", "uses", "the", "specified", "artifact", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L395-L410
train
Determines if the check uses the specified artifact.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Check.Parse
def Parse(self, conditions, host_data): """Runs methods that evaluate whether collected host_data has an issue. Args: conditions: A list of conditions to determine which Methods to trigger. host_data: A map of artifacts and rdf data. Returns: A CheckResult populated with Anomalies if an ...
python
def Parse(self, conditions, host_data): """Runs methods that evaluate whether collected host_data has an issue. Args: conditions: A list of conditions to determine which Methods to trigger. host_data: A map of artifacts and rdf data. Returns: A CheckResult populated with Anomalies if an ...
[ "def", "Parse", "(", "self", ",", "conditions", ",", "host_data", ")", ":", "result", "=", "CheckResult", "(", "check_id", "=", "self", ".", "check_id", ")", "methods", "=", "self", ".", "SelectChecks", "(", "conditions", ")", "result", ".", "ExtendAnomali...
Runs methods that evaluate whether collected host_data has an issue. Args: conditions: A list of conditions to determine which Methods to trigger. host_data: A map of artifacts and rdf data. Returns: A CheckResult populated with Anomalies if an issue exists.
[ "Runs", "methods", "that", "evaluate", "whether", "collected", "host_data", "has", "an", "issue", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L412-L425
train
Runs methods that evaluate whether collected host_data has an issue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Check.Validate
def Validate(self): """Check the method is well constructed.""" if not self.check_id: raise DefinitionError("Check has missing check_id value") cls_name = self.check_id if not self.method: raise DefinitionError("Check %s has no methods" % cls_name) ValidateMultiple(self.method, ...
python
def Validate(self): """Check the method is well constructed.""" if not self.check_id: raise DefinitionError("Check has missing check_id value") cls_name = self.check_id if not self.method: raise DefinitionError("Check %s has no methods" % cls_name) ValidateMultiple(self.method, ...
[ "def", "Validate", "(", "self", ")", ":", "if", "not", "self", ".", "check_id", ":", "raise", "DefinitionError", "(", "\"Check has missing check_id value\"", ")", "cls_name", "=", "self", ".", "check_id", "if", "not", "self", ".", "method", ":", "raise", "De...
Check the method is well constructed.
[ "Check", "the", "method", "is", "well", "constructed", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L427-L435
train
Validate the check method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Matcher.Detect
def Detect(self, baseline, host_data): """Run host_data through detectors and return them if a detector triggers. Args: baseline: The base set of rdf values used to evaluate whether an issue exists. host_data: The rdf values passed back by the filters. Returns: A CheckResult mess...
python
def Detect(self, baseline, host_data): """Run host_data through detectors and return them if a detector triggers. Args: baseline: The base set of rdf values used to evaluate whether an issue exists. host_data: The rdf values passed back by the filters. Returns: A CheckResult mess...
[ "def", "Detect", "(", "self", ",", "baseline", ",", "host_data", ")", ":", "result", "=", "CheckResult", "(", ")", "for", "detector", "in", "self", ".", "detectors", ":", "finding", "=", "detector", "(", "baseline", ",", "host_data", ")", "if", "finding"...
Run host_data through detectors and return them if a detector triggers. Args: baseline: The base set of rdf values used to evaluate whether an issue exists. host_data: The rdf values passed back by the filters. Returns: A CheckResult message containing anomalies if any detectors iden...
[ "Run", "host_data", "through", "detectors", "and", "return", "them", "if", "a", "detector", "triggers", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L455-L473
train
Runs through detectors and returns anomalies if any detector triggers the issue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Matcher.Issue
def Issue(self, state, results): """Collect anomalous findings into a CheckResult. Comparisons with anomalous conditions collect anomalies into a single CheckResult message. The contents of the result varies depending on whether the method making the comparison is a Check, Method or Probe. - Probes...
python
def Issue(self, state, results): """Collect anomalous findings into a CheckResult. Comparisons with anomalous conditions collect anomalies into a single CheckResult message. The contents of the result varies depending on whether the method making the comparison is a Check, Method or Probe. - Probes...
[ "def", "Issue", "(", "self", ",", "state", ",", "results", ")", ":", "result", "=", "CheckResult", "(", ")", "# If there are CheckResults we're aggregating methods or probes.", "# Merge all current results into one CheckResult.", "# Otherwise, the results are raw host data.", "# ...
Collect anomalous findings into a CheckResult. Comparisons with anomalous conditions collect anomalies into a single CheckResult message. The contents of the result varies depending on whether the method making the comparison is a Check, Method or Probe. - Probes evaluate raw host data and generate Ano...
[ "Collect", "anomalous", "findings", "into", "a", "CheckResult", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L475-L511
train
Issues an anomalous findings.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
Matcher.GotAll
def GotAll(self, baseline, results): """Anomaly if baseline vs result counts differ, an empty list otherwise.""" num_base = len(baseline) num_rslt = len(results) if num_rslt > num_base: raise ProcessingError("Filter generated more results than base data: " "%s > %s" % (...
python
def GotAll(self, baseline, results): """Anomaly if baseline vs result counts differ, an empty list otherwise.""" num_base = len(baseline) num_rslt = len(results) if num_rslt > num_base: raise ProcessingError("Filter generated more results than base data: " "%s > %s" % (...
[ "def", "GotAll", "(", "self", ",", "baseline", ",", "results", ")", ":", "num_base", "=", "len", "(", "baseline", ")", "num_rslt", "=", "len", "(", "results", ")", "if", "num_rslt", ">", "num_base", ":", "raise", "ProcessingError", "(", "\"Filter generated...
Anomaly if baseline vs result counts differ, an empty list otherwise.
[ "Anomaly", "if", "baseline", "vs", "result", "counts", "differ", "an", "empty", "list", "otherwise", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L537-L546
train
Anomaly if baseline vs result counts differ an empty list otherwise.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckRegistry.RegisterCheck
def RegisterCheck(cls, check, source="unknown", overwrite_if_exists=False): """Adds a check to the registry, refresh the trigger to check map.""" if not overwrite_if_exists and check.check_id in cls.checks: raise DefinitionError( "Check named %s already exists and " "overwrite_if_exist...
python
def RegisterCheck(cls, check, source="unknown", overwrite_if_exists=False): """Adds a check to the registry, refresh the trigger to check map.""" if not overwrite_if_exists and check.check_id in cls.checks: raise DefinitionError( "Check named %s already exists and " "overwrite_if_exist...
[ "def", "RegisterCheck", "(", "cls", ",", "check", ",", "source", "=", "\"unknown\"", ",", "overwrite_if_exists", "=", "False", ")", ":", "if", "not", "overwrite_if_exists", "and", "check", ".", "check_id", "in", "cls", ".", "checks", ":", "raise", "Definitio...
Adds a check to the registry, refresh the trigger to check map.
[ "Adds", "a", "check", "to", "the", "registry", "refresh", "the", "trigger", "to", "check", "map", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L567-L575
train
Registers a check in the registry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckRegistry._AsList
def _AsList(arg): """Encapsulates an argument in a list, if it's not already iterable.""" if (isinstance(arg, string_types) or not isinstance(arg, collections.Iterable)): return [arg] else: return list(arg)
python
def _AsList(arg): """Encapsulates an argument in a list, if it's not already iterable.""" if (isinstance(arg, string_types) or not isinstance(arg, collections.Iterable)): return [arg] else: return list(arg)
[ "def", "_AsList", "(", "arg", ")", ":", "if", "(", "isinstance", "(", "arg", ",", "string_types", ")", "or", "not", "isinstance", "(", "arg", ",", "collections", ".", "Iterable", ")", ")", ":", "return", "[", "arg", "]", "else", ":", "return", "list"...
Encapsulates an argument in a list, if it's not already iterable.
[ "Encapsulates", "an", "argument", "in", "a", "list", "if", "it", "s", "not", "already", "iterable", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L578-L584
train
Encapsulates an argument in a list if it s not already iterable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckRegistry.Conditions
def Conditions(cls, artifact=None, os_name=None, cpe=None, labels=None): """Provide a series of condition tuples. A Target can specify multiple artifact, os_name, cpe or label entries. These are expanded to all distinct tuples. When an entry is undefined or None, it is treated as a single definition of...
python
def Conditions(cls, artifact=None, os_name=None, cpe=None, labels=None): """Provide a series of condition tuples. A Target can specify multiple artifact, os_name, cpe or label entries. These are expanded to all distinct tuples. When an entry is undefined or None, it is treated as a single definition of...
[ "def", "Conditions", "(", "cls", ",", "artifact", "=", "None", ",", "os_name", "=", "None", ",", "cpe", "=", "None", ",", "labels", "=", "None", ")", ":", "artifact", "=", "cls", ".", "_AsList", "(", "artifact", ")", "os_name", "=", "cls", ".", "_A...
Provide a series of condition tuples. A Target can specify multiple artifact, os_name, cpe or label entries. These are expanded to all distinct tuples. When an entry is undefined or None, it is treated as a single definition of None, meaning that the condition does not apply. Args: artifact:...
[ "Provide", "a", "series", "of", "condition", "tuples", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L587-L609
train
Generates a series of condition tuples.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckRegistry.FindChecks
def FindChecks(cls, artifact=None, os_name=None, cpe=None, labels=None, restrict_checks=None): """Takes targeting info, identifies relevant checks. FindChecks will return results when a host has the conditions necessary for ...
python
def FindChecks(cls, artifact=None, os_name=None, cpe=None, labels=None, restrict_checks=None): """Takes targeting info, identifies relevant checks. FindChecks will return results when a host has the conditions necessary for ...
[ "def", "FindChecks", "(", "cls", ",", "artifact", "=", "None", ",", "os_name", "=", "None", ",", "cpe", "=", "None", ",", "labels", "=", "None", ",", "restrict_checks", "=", "None", ")", ":", "check_ids", "=", "set", "(", ")", "conditions", "=", "lis...
Takes targeting info, identifies relevant checks. FindChecks will return results when a host has the conditions necessary for a check to occur. Conditions with partial results are not returned. For example, FindChecks will not return checks that if a check targets os_name=["Linux"], labels=["foo"] and ...
[ "Takes", "targeting", "info", "identifies", "relevant", "checks", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L612-L645
train
Returns a list of check ids that apply to the given set of conditions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckRegistry.SelectArtifacts
def SelectArtifacts(cls, os_name=None, cpe=None, labels=None, restrict_checks=None): """Takes targeting info, identifies artifacts to fetch. Args: os_name: 0+ OS names. cpe: 0+ CPE identifiers. labels: 0+ ...
python
def SelectArtifacts(cls, os_name=None, cpe=None, labels=None, restrict_checks=None): """Takes targeting info, identifies artifacts to fetch. Args: os_name: 0+ OS names. cpe: 0+ CPE identifiers. labels: 0+ ...
[ "def", "SelectArtifacts", "(", "cls", ",", "os_name", "=", "None", ",", "cpe", "=", "None", ",", "labels", "=", "None", ",", "restrict_checks", "=", "None", ")", ":", "results", "=", "set", "(", ")", "for", "condition", "in", "cls", ".", "Conditions", ...
Takes targeting info, identifies artifacts to fetch. Args: os_name: 0+ OS names. cpe: 0+ CPE identifiers. labels: 0+ GRR labels. restrict_checks: A list of check ids whose artifacts should be fetched. Returns: the artifacts that should be collected.
[ "Takes", "targeting", "info", "identifies", "artifacts", "to", "fetch", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L648-L671
train
Takes targeting info identifies artifacts to fetch.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/check_lib/checks.py
CheckRegistry.Process
def Process(cls, host_data, os_name=None, cpe=None, labels=None, exclude_checks=None, restrict_checks=None): """Runs checks over all host data. Args: host_data: The data collected from a host, mapped to artifact name. ...
python
def Process(cls, host_data, os_name=None, cpe=None, labels=None, exclude_checks=None, restrict_checks=None): """Runs checks over all host data. Args: host_data: The data collected from a host, mapped to artifact name. ...
[ "def", "Process", "(", "cls", ",", "host_data", ",", "os_name", "=", "None", ",", "cpe", "=", "None", ",", "labels", "=", "None", ",", "exclude_checks", "=", "None", ",", "restrict_checks", "=", "None", ")", ":", "# All the conditions that apply to this host."...
Runs checks over all host data. Args: host_data: The data collected from a host, mapped to artifact name. os_name: 0+ OS names. cpe: 0+ CPE identifiers. labels: 0+ GRR labels. exclude_checks: A list of check ids not to run. A check id in this list will not get ru...
[ "Runs", "checks", "over", "all", "host", "data", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/check_lib/checks.py#L674-L709
train
Processes the host data and returns a list of CheckResult messages.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/util/random.py
UInt32
def UInt32(): """Returns a pseudo-random 32-bit unsigned integer.""" with _mutex: try: return _random_buffer.pop() except IndexError: data = os.urandom(struct.calcsize("=L") * _random_buffer_size) _random_buffer.extend( struct.unpack("=" + "L" * _random_buffer_size, data)) ...
python
def UInt32(): """Returns a pseudo-random 32-bit unsigned integer.""" with _mutex: try: return _random_buffer.pop() except IndexError: data = os.urandom(struct.calcsize("=L") * _random_buffer_size) _random_buffer.extend( struct.unpack("=" + "L" * _random_buffer_size, data)) ...
[ "def", "UInt32", "(", ")", ":", "with", "_mutex", ":", "try", ":", "return", "_random_buffer", ".", "pop", "(", ")", "except", "IndexError", ":", "data", "=", "os", ".", "urandom", "(", "struct", ".", "calcsize", "(", "\"=L\"", ")", "*", "_random_buffe...
Returns a pseudo-random 32-bit unsigned integer.
[ "Returns", "a", "pseudo", "-", "random", "32", "-", "bit", "unsigned", "integer", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/random.py#L29-L38
train
Returns a pseudo - random 32 - bit unsigned integer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder.SetupVars
def SetupVars(self): """Set up some vars for the directories we use.""" # Python paths chosen to match appveyor: # http://www.appveyor.com/docs/installed-software#python self.python_dir_64 = args.python64_dir self.python_dir_32 = args.python32_dir self.virtualenv_bin64 = os.path.join(self.pyth...
python
def SetupVars(self): """Set up some vars for the directories we use.""" # Python paths chosen to match appveyor: # http://www.appveyor.com/docs/installed-software#python self.python_dir_64 = args.python64_dir self.python_dir_32 = args.python32_dir self.virtualenv_bin64 = os.path.join(self.pyth...
[ "def", "SetupVars", "(", "self", ")", ":", "# Python paths chosen to match appveyor:", "# http://www.appveyor.com/docs/installed-software#python", "self", ".", "python_dir_64", "=", "args", ".", "python64_dir", "self", ".", "python_dir_32", "=", "args", ".", "python32_dir",...
Set up some vars for the directories we use.
[ "Set", "up", "some", "vars", "for", "the", "directories", "we", "use", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L100-L139
train
Setup some vars for the directories we use.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder.Clean
def Clean(self): """Clean the build environment.""" # os.unlink doesn't work effectively, use the shell to delete. if os.path.exists(args.build_dir): subprocess.call("rd /s /q %s" % args.build_dir, shell=True) if os.path.exists(args.output_dir): subprocess.call("rd /s /q %s" % args.output_di...
python
def Clean(self): """Clean the build environment.""" # os.unlink doesn't work effectively, use the shell to delete. if os.path.exists(args.build_dir): subprocess.call("rd /s /q %s" % args.build_dir, shell=True) if os.path.exists(args.output_dir): subprocess.call("rd /s /q %s" % args.output_di...
[ "def", "Clean", "(", "self", ")", ":", "# os.unlink doesn't work effectively, use the shell to delete.", "if", "os", ".", "path", ".", "exists", "(", "args", ".", "build_dir", ")", ":", "subprocess", ".", "call", "(", "\"rd /s /q %s\"", "%", "args", ".", "build_...
Clean the build environment.
[ "Clean", "the", "build", "environment", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L141-L172
train
Clean the build environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder.InstallGRR
def InstallGRR(self, path): """Installs GRR.""" cmd64 = [self.pip64, "install"] cmd32 = [self.pip32, "install"] if args.wheel_dir: cmd64 += ["--no-index", r"--find-links=file:///%s" % args.wheel_dir] cmd32 += ["--no-index", r"--find-links=file:///%s" % args.wheel_dir] cmd64.append(pat...
python
def InstallGRR(self, path): """Installs GRR.""" cmd64 = [self.pip64, "install"] cmd32 = [self.pip32, "install"] if args.wheel_dir: cmd64 += ["--no-index", r"--find-links=file:///%s" % args.wheel_dir] cmd32 += ["--no-index", r"--find-links=file:///%s" % args.wheel_dir] cmd64.append(pat...
[ "def", "InstallGRR", "(", "self", ",", "path", ")", ":", "cmd64", "=", "[", "self", ".", "pip64", ",", "\"install\"", "]", "cmd32", "=", "[", "self", ".", "pip32", ",", "\"install\"", "]", "if", "args", ".", "wheel_dir", ":", "cmd64", "+=", "[", "\...
Installs GRR.
[ "Installs", "GRR", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L216-L231
train
Installs GRR.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder.BuildTemplates
def BuildTemplates(self): """Builds the client templates. We dont need to run special compilers so just enter the virtualenv and build. Python will already find its own MSVC for python compilers. """ if args.config: build_args = [ "--verbose", "--config", args.config, "build", "--ou...
python
def BuildTemplates(self): """Builds the client templates. We dont need to run special compilers so just enter the virtualenv and build. Python will already find its own MSVC for python compilers. """ if args.config: build_args = [ "--verbose", "--config", args.config, "build", "--ou...
[ "def", "BuildTemplates", "(", "self", ")", ":", "if", "args", ".", "config", ":", "build_args", "=", "[", "\"--verbose\"", ",", "\"--config\"", ",", "args", ".", "config", ",", "\"build\"", ",", "\"--output\"", ",", "args", ".", "output_dir", "]", "else", ...
Builds the client templates. We dont need to run special compilers so just enter the virtualenv and build. Python will already find its own MSVC for python compilers.
[ "Builds", "the", "client", "templates", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L233-L248
train
Builds the client templates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder._RepackTemplates
def _RepackTemplates(self): """Repack templates with a dummy config.""" dummy_config = os.path.join( args.grr_src, "grr/test/grr_response_test/test_data/dummyconfig.yaml") if args.build_32: template_i386 = glob.glob(os.path.join(args.output_dir, "*_...
python
def _RepackTemplates(self): """Repack templates with a dummy config.""" dummy_config = os.path.join( args.grr_src, "grr/test/grr_response_test/test_data/dummyconfig.yaml") if args.build_32: template_i386 = glob.glob(os.path.join(args.output_dir, "*_...
[ "def", "_RepackTemplates", "(", "self", ")", ":", "dummy_config", "=", "os", ".", "path", ".", "join", "(", "args", ".", "grr_src", ",", "\"grr/test/grr_response_test/test_data/dummyconfig.yaml\"", ")", "if", "args", ".", "build_32", ":", "template_i386", "=", "...
Repack templates with a dummy config.
[ "Repack", "templates", "with", "a", "dummy", "config", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L250-L282
train
Repacks templates with a dummy config.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder._CleanupInstall
def _CleanupInstall(self): """Cleanup from any previous installer enough for _CheckInstallSuccess.""" if os.path.exists(self.install_path): shutil.rmtree(self.install_path) if os.path.exists(self.install_path): raise RuntimeError("Install path still exists: %s" % self.install_path) # De...
python
def _CleanupInstall(self): """Cleanup from any previous installer enough for _CheckInstallSuccess.""" if os.path.exists(self.install_path): shutil.rmtree(self.install_path) if os.path.exists(self.install_path): raise RuntimeError("Install path still exists: %s" % self.install_path) # De...
[ "def", "_CleanupInstall", "(", "self", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "install_path", ")", ":", "shutil", ".", "rmtree", "(", "self", ".", "install_path", ")", "if", "os", ".", "path", ".", "exists", "(", "self", ...
Cleanup from any previous installer enough for _CheckInstallSuccess.
[ "Cleanup", "from", "any", "previous", "installer", "enough", "for", "_CheckInstallSuccess", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L284-L292
train
Cleanup from any previous installer enough for _CheckInstallSuccess.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder._CheckInstallSuccess
def _CheckInstallSuccess(self): """Checks if the installer installed correctly.""" if not os.path.exists(self.install_path): raise RuntimeError("Install failed, no files at: %s" % self.install_path) try: output = subprocess.check_output(["sc", "query", self.service_name]) service_running ...
python
def _CheckInstallSuccess(self): """Checks if the installer installed correctly.""" if not os.path.exists(self.install_path): raise RuntimeError("Install failed, no files at: %s" % self.install_path) try: output = subprocess.check_output(["sc", "query", self.service_name]) service_running ...
[ "def", "_CheckInstallSuccess", "(", "self", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "self", ".", "install_path", ")", ":", "raise", "RuntimeError", "(", "\"Install failed, no files at: %s\"", "%", "self", ".", "install_path", ")", "try", ...
Checks if the installer installed correctly.
[ "Checks", "if", "the", "installer", "installed", "correctly", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L294-L319
train
Checks if the installer installed correctly.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder._InstallInstallers
def _InstallInstallers(self): """Install the installer built by RepackTemplates.""" # 32 bit binary will refuse to install on a 64bit system so we only install # the 64 bit version installer_amd64 = glob.glob( os.path.join(args.output_dir, "dbg_*_amd64.exe")).pop() self._CleanupInstall() ...
python
def _InstallInstallers(self): """Install the installer built by RepackTemplates.""" # 32 bit binary will refuse to install on a 64bit system so we only install # the 64 bit version installer_amd64 = glob.glob( os.path.join(args.output_dir, "dbg_*_amd64.exe")).pop() self._CleanupInstall() ...
[ "def", "_InstallInstallers", "(", "self", ")", ":", "# 32 bit binary will refuse to install on a 64bit system so we only install", "# the 64 bit version", "installer_amd64", "=", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", "(", "args", ".", "output_dir", "...
Install the installer built by RepackTemplates.
[ "Install", "the", "installer", "built", "by", "RepackTemplates", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L321-L330
train
Install the installer built by RepackTemplates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
appveyor/windows_templates/build_windows_templates.py
WindowsTemplateBuilder.Build
def Build(self): """Build templates.""" self.SetupVars() self.Clean() if not os.path.exists(args.grr_src): self.GitCheckoutGRR() proto_sdist = self.MakeProtoSdist() core_sdist = self.MakeCoreSdist() client_sdist = self.MakeClientSdist() client_builder_sdist = self.MakeClientBuilde...
python
def Build(self): """Build templates.""" self.SetupVars() self.Clean() if not os.path.exists(args.grr_src): self.GitCheckoutGRR() proto_sdist = self.MakeProtoSdist() core_sdist = self.MakeCoreSdist() client_sdist = self.MakeClientSdist() client_builder_sdist = self.MakeClientBuilde...
[ "def", "Build", "(", "self", ")", ":", "self", ".", "SetupVars", "(", ")", "self", ".", "Clean", "(", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "args", ".", "grr_src", ")", ":", "self", ".", "GitCheckoutGRR", "(", ")", "proto_sdist",...
Build templates.
[ "Build", "templates", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/appveyor/windows_templates/build_windows_templates.py#L332-L351
train
Build the GRR.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/util/precondition.py
AssertType
def AssertType(value, expected_type): """Ensures that given value has certain type. Args: value: A value to assert the type for. expected_type: An expected type for the given value. Raises: TypeError: If given value does not have the expected type. """ if not isinstance(value, expected_type): ...
python
def AssertType(value, expected_type): """Ensures that given value has certain type. Args: value: A value to assert the type for. expected_type: An expected type for the given value. Raises: TypeError: If given value does not have the expected type. """ if not isinstance(value, expected_type): ...
[ "def", "AssertType", "(", "value", ",", "expected_type", ")", ":", "if", "not", "isinstance", "(", "value", ",", "expected_type", ")", ":", "message", "=", "\"Expected type `%r`, but got value `%r` of type `%s`\"", "message", "%=", "(", "expected_type", ",", "value"...
Ensures that given value has certain type. Args: value: A value to assert the type for. expected_type: An expected type for the given value. Raises: TypeError: If given value does not have the expected type.
[ "Ensures", "that", "given", "value", "has", "certain", "type", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/precondition.py#L12-L25
train
Ensures that given value has the expected type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/util/precondition.py
AssertIterableType
def AssertIterableType(iterable, expected_item_type): """Ensures that given iterable container has certain type. Args: iterable: An iterable container to assert the type for. expected_item_type: An expected type of the container items. Raises: TypeError: If given container does is not an iterable or...
python
def AssertIterableType(iterable, expected_item_type): """Ensures that given iterable container has certain type. Args: iterable: An iterable container to assert the type for. expected_item_type: An expected type of the container items. Raises: TypeError: If given container does is not an iterable or...
[ "def", "AssertIterableType", "(", "iterable", ",", "expected_item_type", ")", ":", "# We do not consider iterators to be iterables even though Python does. An", "# \"iterable\" should be a type that can be iterated (that is: an iterator can", "# be constructed for them). Iterators should not be ...
Ensures that given iterable container has certain type. Args: iterable: An iterable container to assert the type for. expected_item_type: An expected type of the container items. Raises: TypeError: If given container does is not an iterable or its items do not have the expected type.
[ "Ensures", "that", "given", "iterable", "container", "has", "certain", "type", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/precondition.py#L42-L66
train
Ensures that given iterable container has certain type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/util/precondition.py
AssertDictType
def AssertDictType(dct, expected_key_type, expected_value_type): """Ensures that given dictionary is actually a dictionary of specified type. Args: dct: A dictionary to assert the type for. expected_key_type: An expected type for dictionary keys. expected_value_type: An expected type for dictionary val...
python
def AssertDictType(dct, expected_key_type, expected_value_type): """Ensures that given dictionary is actually a dictionary of specified type. Args: dct: A dictionary to assert the type for. expected_key_type: An expected type for dictionary keys. expected_value_type: An expected type for dictionary val...
[ "def", "AssertDictType", "(", "dct", ",", "expected_key_type", ",", "expected_value_type", ")", ":", "AssertType", "(", "dct", ",", "dict", ")", "for", "key", ",", "value", "in", "iteritems", "(", "dct", ")", ":", "AssertType", "(", "key", ",", "expected_k...
Ensures that given dictionary is actually a dictionary of specified type. Args: dct: A dictionary to assert the type for. expected_key_type: An expected type for dictionary keys. expected_value_type: An expected type for dictionary values. Raises: TypeError: If given dictionary is not really a dic...
[ "Ensures", "that", "given", "dictionary", "is", "actually", "a", "dictionary", "of", "specified", "type", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/util/precondition.py#L69-L84
train
Ensures that given dictionary is actually a dictionary of specified type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/registry.py
HookRegistry._RunSingleHook
def _RunSingleHook(self, hook_cls, executed_set, required=None): """Run the single hook specified by resolving all its prerequisites.""" # If we already ran do nothing. if hook_cls in executed_set: return # Ensure all the pre execution hooks are run. for pre_hook in hook_cls.pre: self._...
python
def _RunSingleHook(self, hook_cls, executed_set, required=None): """Run the single hook specified by resolving all its prerequisites.""" # If we already ran do nothing. if hook_cls in executed_set: return # Ensure all the pre execution hooks are run. for pre_hook in hook_cls.pre: self._...
[ "def", "_RunSingleHook", "(", "self", ",", "hook_cls", ",", "executed_set", ",", "required", "=", "None", ")", ":", "# If we already ran do nothing.", "if", "hook_cls", "in", "executed_set", ":", "return", "# Ensure all the pre execution hooks are run.", "for", "pre_hoo...
Run the single hook specified by resolving all its prerequisites.
[ "Run", "the", "single", "hook", "specified", "by", "resolving", "all", "its", "prerequisites", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/registry.py#L225-L250
train
Run the single hook specified by resolving all its prerequisites.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiHunt.InitFromHuntObject
def InitFromHuntObject(self, hunt_obj, hunt_counters=None, with_full_summary=False): """Initialize API hunt object from a database hunt object. Args: hunt_obj: rdf_hunt_objects.Hunt to read the data from. hunt_counters: Opti...
python
def InitFromHuntObject(self, hunt_obj, hunt_counters=None, with_full_summary=False): """Initialize API hunt object from a database hunt object. Args: hunt_obj: rdf_hunt_objects.Hunt to read the data from. hunt_counters: Opti...
[ "def", "InitFromHuntObject", "(", "self", ",", "hunt_obj", ",", "hunt_counters", "=", "None", ",", "with_full_summary", "=", "False", ")", ":", "self", ".", "urn", "=", "rdfvalue", ".", "RDFURN", "(", "\"hunts\"", ")", ".", "Add", "(", "str", "(", "hunt_...
Initialize API hunt object from a database hunt object. Args: hunt_obj: rdf_hunt_objects.Hunt to read the data from. hunt_counters: Optional db.HuntCounters object with counters information. with_full_summary: if True, hunt_runner_args, completion counts and a few other fields will be fil...
[ "Initialize", "API", "hunt", "object", "from", "a", "database", "hunt", "object", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L222-L331
train
Initializes the object from a database hunt object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiHuntResult.InitFromGrrMessage
def InitFromGrrMessage(self, message): """Init from GrrMessage rdfvalue.""" if message.source: self.client_id = message.source.Basename() self.payload_type = compatibility.GetName(message.payload.__class__) self.payload = message.payload self.timestamp = message.age return self
python
def InitFromGrrMessage(self, message): """Init from GrrMessage rdfvalue.""" if message.source: self.client_id = message.source.Basename() self.payload_type = compatibility.GetName(message.payload.__class__) self.payload = message.payload self.timestamp = message.age return self
[ "def", "InitFromGrrMessage", "(", "self", ",", "message", ")", ":", "if", "message", ".", "source", ":", "self", ".", "client_id", "=", "message", ".", "source", ".", "Basename", "(", ")", "self", ".", "payload_type", "=", "compatibility", ".", "GetName", ...
Init from GrrMessage rdfvalue.
[ "Init", "from", "GrrMessage", "rdfvalue", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L351-L360
train
Init from GrrMessage rdfvalue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiHuntResult.InitFromFlowResult
def InitFromFlowResult(self, flow_result): """Init from rdf_flow_objects.FlowResult.""" self.payload_type = compatibility.GetName(flow_result.payload.__class__) self.payload = flow_result.payload self.client_id = flow_result.client_id self.timestamp = flow_result.timestamp return self
python
def InitFromFlowResult(self, flow_result): """Init from rdf_flow_objects.FlowResult.""" self.payload_type = compatibility.GetName(flow_result.payload.__class__) self.payload = flow_result.payload self.client_id = flow_result.client_id self.timestamp = flow_result.timestamp return self
[ "def", "InitFromFlowResult", "(", "self", ",", "flow_result", ")", ":", "self", ".", "payload_type", "=", "compatibility", ".", "GetName", "(", "flow_result", ".", "payload", ".", "__class__", ")", "self", ".", "payload", "=", "flow_result", ".", "payload", ...
Init from rdf_flow_objects.FlowResult.
[ "Init", "from", "rdf_flow_objects", ".", "FlowResult", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L362-L370
train
Init from rdf_flow_objects. FlowResult.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiHuntLog.InitFromFlowLogEntry
def InitFromFlowLogEntry(self, fle): """Init from FlowLogEntry rdfvalue.""" # TODO(user): putting this stub value for backwards compatibility. # Remove as soon as AFF4 is gone. self.flow_name = "GenericHunt" self.client_id = fle.client_id self.flow_id = fle.flow_id self.timestamp = fle.tim...
python
def InitFromFlowLogEntry(self, fle): """Init from FlowLogEntry rdfvalue.""" # TODO(user): putting this stub value for backwards compatibility. # Remove as soon as AFF4 is gone. self.flow_name = "GenericHunt" self.client_id = fle.client_id self.flow_id = fle.flow_id self.timestamp = fle.tim...
[ "def", "InitFromFlowLogEntry", "(", "self", ",", "fle", ")", ":", "# TODO(user): putting this stub value for backwards compatibility.", "# Remove as soon as AFF4 is gone.", "self", ".", "flow_name", "=", "\"GenericHunt\"", "self", ".", "client_id", "=", "fle", ".", "client_...
Init from FlowLogEntry rdfvalue.
[ "Init", "from", "FlowLogEntry", "rdfvalue", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L401-L413
train
Init from FlowLogEntry rdfvalue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiHuntError.InitFromFlowObject
def InitFromFlowObject(self, fo): """Initialize from rdf_flow_objects.Flow corresponding to a failed flow.""" self.client_id = fo.client_id if fo.HasField("backtrace"): self.backtrace = fo.backtrace self.log_message = fo.error_message self.timestamp = fo.last_update_time return self
python
def InitFromFlowObject(self, fo): """Initialize from rdf_flow_objects.Flow corresponding to a failed flow.""" self.client_id = fo.client_id if fo.HasField("backtrace"): self.backtrace = fo.backtrace self.log_message = fo.error_message self.timestamp = fo.last_update_time return self
[ "def", "InitFromFlowObject", "(", "self", ",", "fo", ")", ":", "self", ".", "client_id", "=", "fo", ".", "client_id", "if", "fo", ".", "HasField", "(", "\"backtrace\"", ")", ":", "self", ".", "backtrace", "=", "fo", ".", "backtrace", "self", ".", "log_...
Initialize from rdf_flow_objects.Flow corresponding to a failed flow.
[ "Initialize", "from", "rdf_flow_objects", ".", "Flow", "corresponding", "to", "a", "failed", "flow", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L435-L444
train
Initialize from rdf_flow_objects. Flow object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiGetHuntClientCompletionStatsResult.InitFromDataPoints
def InitFromDataPoints(self, start_stats, complete_stats): """Check that this approval applies to the given token. Args: start_stats: A list of lists, each containing two values (a timestamp and the number of clients started at this time). complete_stats: A list of lists, each containing tw...
python
def InitFromDataPoints(self, start_stats, complete_stats): """Check that this approval applies to the given token. Args: start_stats: A list of lists, each containing two values (a timestamp and the number of clients started at this time). complete_stats: A list of lists, each containing tw...
[ "def", "InitFromDataPoints", "(", "self", ",", "start_stats", ",", "complete_stats", ")", ":", "self", ".", "start_points", "=", "self", ".", "_ConvertToResultList", "(", "start_stats", ")", "self", ".", "complete_points", "=", "self", ".", "_ConvertToResultList",...
Check that this approval applies to the given token. Args: start_stats: A list of lists, each containing two values (a timestamp and the number of clients started at this time). complete_stats: A list of lists, each containing two values (a timestamp and the number of clients completed ...
[ "Check", "that", "this", "approval", "applies", "to", "the", "given", "token", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L1184-L1198
train
Initializes the approval from the given data points.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiGetHuntClientCompletionStatsHandler._Resample
def _Resample(self, stats, target_size): """Resamples the stats to have a specific number of data points.""" t_first = stats[0][0] t_last = stats[-1][0] interval = (t_last - t_first) / target_size result = [] current_t = t_first current_v = 0 i = 0 while i < len(stats): stat_...
python
def _Resample(self, stats, target_size): """Resamples the stats to have a specific number of data points.""" t_first = stats[0][0] t_last = stats[-1][0] interval = (t_last - t_first) / target_size result = [] current_t = t_first current_v = 0 i = 0 while i < len(stats): stat_...
[ "def", "_Resample", "(", "self", ",", "stats", ",", "target_size", ")", ":", "t_first", "=", "stats", "[", "0", "]", "[", "0", "]", "t_last", "=", "stats", "[", "-", "1", "]", "[", "0", "]", "interval", "=", "(", "t_last", "-", "t_first", ")", ...
Resamples the stats to have a specific number of data points.
[ "Resamples", "the", "stats", "to", "have", "a", "specific", "number", "of", "data", "points", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L1320-L1343
train
Resamples the stats to have a specific number of data points.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiGetHuntStatsHandler._HandleLegacy
def _HandleLegacy(self, args, token=None): """Retrieves the stats for a hunt.""" hunt_obj = aff4.FACTORY.Open( args.hunt_id.ToURN(), aff4_type=implementation.GRRHunt, token=token) stats = hunt_obj.GetRunner().context.usage_stats return ApiGetHuntStatsResult(stats=stats)
python
def _HandleLegacy(self, args, token=None): """Retrieves the stats for a hunt.""" hunt_obj = aff4.FACTORY.Open( args.hunt_id.ToURN(), aff4_type=implementation.GRRHunt, token=token) stats = hunt_obj.GetRunner().context.usage_stats return ApiGetHuntStatsResult(stats=stats)
[ "def", "_HandleLegacy", "(", "self", ",", "args", ",", "token", "=", "None", ")", ":", "hunt_obj", "=", "aff4", ".", "FACTORY", ".", "Open", "(", "args", ".", "hunt_id", ".", "ToURN", "(", ")", ",", "aff4_type", "=", "implementation", ".", "GRRHunt", ...
Retrieves the stats for a hunt.
[ "Retrieves", "the", "stats", "for", "a", "hunt", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L1628-L1635
train
Retrieves the stats for a hunt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiListHuntClientsHandler._HandleLegacy
def _HandleLegacy(self, args, token=None): """Retrieves the clients for a hunt.""" hunt_urn = args.hunt_id.ToURN() hunt_obj = aff4.FACTORY.Open( hunt_urn, aff4_type=implementation.GRRHunt, token=token) clients_by_status = hunt_obj.GetClientsByStatus() hunt_clients = clients_by_status[args.c...
python
def _HandleLegacy(self, args, token=None): """Retrieves the clients for a hunt.""" hunt_urn = args.hunt_id.ToURN() hunt_obj = aff4.FACTORY.Open( hunt_urn, aff4_type=implementation.GRRHunt, token=token) clients_by_status = hunt_obj.GetClientsByStatus() hunt_clients = clients_by_status[args.c...
[ "def", "_HandleLegacy", "(", "self", ",", "args", ",", "token", "=", "None", ")", ":", "hunt_urn", "=", "args", ".", "hunt_id", ".", "ToURN", "(", ")", "hunt_obj", "=", "aff4", ".", "FACTORY", ".", "Open", "(", "hunt_urn", ",", "aff4_type", "=", "imp...
Retrieves the clients for a hunt.
[ "Retrieves", "the", "clients", "for", "a", "hunt", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L1669-L1689
train
Retrieves the clients for a given hunt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiGetHuntContextHandler._HandleLegacy
def _HandleLegacy(self, args, token=None): """Retrieves the context for a hunt.""" hunt_obj = aff4.FACTORY.Open( args.hunt_id.ToURN(), aff4_type=implementation.GRRHunt, token=token) if isinstance(hunt_obj.context, rdf_hunts.HuntContext): # New style hunt. # TODO(amoser): Hunt state will go ...
python
def _HandleLegacy(self, args, token=None): """Retrieves the context for a hunt.""" hunt_obj = aff4.FACTORY.Open( args.hunt_id.ToURN(), aff4_type=implementation.GRRHunt, token=token) if isinstance(hunt_obj.context, rdf_hunts.HuntContext): # New style hunt. # TODO(amoser): Hunt state will go ...
[ "def", "_HandleLegacy", "(", "self", ",", "args", ",", "token", "=", "None", ")", ":", "hunt_obj", "=", "aff4", ".", "FACTORY", ".", "Open", "(", "args", ".", "hunt_id", ".", "ToURN", "(", ")", ",", "aff4_type", "=", "implementation", ".", "GRRHunt", ...
Retrieves the context for a hunt.
[ "Retrieves", "the", "context", "for", "a", "hunt", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L1775-L1797
train
Retrieves the context for a hunt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/gui/api_plugins/hunt.py
ApiCreateHuntHandler._HandleLegacy
def _HandleLegacy(self, args, token=None): """Creates a new hunt.""" # We only create generic hunts with /hunts/create requests. generic_hunt_args = rdf_hunts.GenericHuntArgs() generic_hunt_args.flow_runner_args.flow_name = args.flow_name generic_hunt_args.flow_args = args.flow_args # Clear al...
python
def _HandleLegacy(self, args, token=None): """Creates a new hunt.""" # We only create generic hunts with /hunts/create requests. generic_hunt_args = rdf_hunts.GenericHuntArgs() generic_hunt_args.flow_runner_args.flow_name = args.flow_name generic_hunt_args.flow_args = args.flow_args # Clear al...
[ "def", "_HandleLegacy", "(", "self", ",", "args", ",", "token", "=", "None", ")", ":", "# We only create generic hunts with /hunts/create requests.", "generic_hunt_args", "=", "rdf_hunts", ".", "GenericHuntArgs", "(", ")", "generic_hunt_args", ".", "flow_runner_args", "...
Creates a new hunt.
[ "Creates", "a", "new", "hunt", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/gui/api_plugins/hunt.py#L1829-L1872
train
Handles the legacy hunt creation and creation of a new hunt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/factory.py
Factory.Register
def Register(self, name, constructor): """Registers a new constructor in the factory. Args: name: A name associated with given constructor. constructor: A constructor function that creates instances. Raises: ValueError: If there already is a constructor associated with given name. ""...
python
def Register(self, name, constructor): """Registers a new constructor in the factory. Args: name: A name associated with given constructor. constructor: A constructor function that creates instances. Raises: ValueError: If there already is a constructor associated with given name. ""...
[ "def", "Register", "(", "self", ",", "name", ",", "constructor", ")", ":", "precondition", ".", "AssertType", "(", "name", ",", "Text", ")", "if", "name", "in", "self", ".", "_constructors", ":", "message", "=", "\"Duplicated constructors %r and %r for name '%s'...
Registers a new constructor in the factory. Args: name: A name associated with given constructor. constructor: A constructor function that creates instances. Raises: ValueError: If there already is a constructor associated with given name.
[ "Registers", "a", "new", "constructor", "in", "the", "factory", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/factory.py#L44-L61
train
Registers a new constructor in the internal list of constructors.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/factory.py
Factory.Unregister
def Unregister(self, name): """Unregisters a constructor. Args: name: A name of the constructor to unregister. Raises: ValueError: If constructor with specified name has never been registered. """ precondition.AssertType(name, Text) try: del self._constructors[name] exce...
python
def Unregister(self, name): """Unregisters a constructor. Args: name: A name of the constructor to unregister. Raises: ValueError: If constructor with specified name has never been registered. """ precondition.AssertType(name, Text) try: del self._constructors[name] exce...
[ "def", "Unregister", "(", "self", ",", "name", ")", ":", "precondition", ".", "AssertType", "(", "name", ",", "Text", ")", "try", ":", "del", "self", ".", "_constructors", "[", "name", "]", "except", "KeyError", ":", "raise", "ValueError", "(", "\"Constr...
Unregisters a constructor. Args: name: A name of the constructor to unregister. Raises: ValueError: If constructor with specified name has never been registered.
[ "Unregisters", "a", "constructor", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/factory.py#L63-L77
train
Unregisters a constructor with the specified name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/factory.py
Factory.Create
def Create(self, name): """Creates a new instance. Args: name: A name identifying the constructor to use for instantiation. Returns: An instance of the type that the factory supports. """ precondition.AssertType(name, Text) try: constructor = self._constructors[name] exc...
python
def Create(self, name): """Creates a new instance. Args: name: A name identifying the constructor to use for instantiation. Returns: An instance of the type that the factory supports. """ precondition.AssertType(name, Text) try: constructor = self._constructors[name] exc...
[ "def", "Create", "(", "self", ",", "name", ")", ":", "precondition", ".", "AssertType", "(", "name", ",", "Text", ")", "try", ":", "constructor", "=", "self", ".", "_constructors", "[", "name", "]", "except", "KeyError", ":", "message", "=", "\"No constr...
Creates a new instance. Args: name: A name identifying the constructor to use for instantiation. Returns: An instance of the type that the factory supports.
[ "Creates", "a", "new", "instance", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/factory.py#L79-L104
train
Creates a new instance of the type that the factory supports.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
_PathRecord.AddStatEntry
def AddStatEntry(self, stat_entry, timestamp): """Registers stat entry at a given timestamp.""" if timestamp in self._stat_entries: message = ("Duplicated stat entry write for path '%s' of type '%s' at " "timestamp '%s'. Old: %s. New: %s.") message %= ("/".join(self._components), s...
python
def AddStatEntry(self, stat_entry, timestamp): """Registers stat entry at a given timestamp.""" if timestamp in self._stat_entries: message = ("Duplicated stat entry write for path '%s' of type '%s' at " "timestamp '%s'. Old: %s. New: %s.") message %= ("/".join(self._components), s...
[ "def", "AddStatEntry", "(", "self", ",", "stat_entry", ",", "timestamp", ")", ":", "if", "timestamp", "in", "self", ".", "_stat_entries", ":", "message", "=", "(", "\"Duplicated stat entry write for path '%s' of type '%s' at \"", "\"timestamp '%s'. Old: %s. New: %s.\"", "...
Registers stat entry at a given timestamp.
[ "Registers", "stat", "entry", "at", "a", "given", "timestamp", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L50-L68
train
Registers a stat entry at a given timestamp.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
_PathRecord.AddHashEntry
def AddHashEntry(self, hash_entry, timestamp): """Registers hash entry at a given timestamp.""" if timestamp in self._hash_entries: message = ("Duplicated hash entry write for path '%s' of type '%s' at " "timestamp '%s'. Old: %s. New: %s.") message %= ("/".join(self._components), s...
python
def AddHashEntry(self, hash_entry, timestamp): """Registers hash entry at a given timestamp.""" if timestamp in self._hash_entries: message = ("Duplicated hash entry write for path '%s' of type '%s' at " "timestamp '%s'. Old: %s. New: %s.") message %= ("/".join(self._components), s...
[ "def", "AddHashEntry", "(", "self", ",", "hash_entry", ",", "timestamp", ")", ":", "if", "timestamp", "in", "self", ".", "_hash_entries", ":", "message", "=", "(", "\"Duplicated hash entry write for path '%s' of type '%s' at \"", "\"timestamp '%s'. Old: %s. New: %s.\"", "...
Registers hash entry at a given timestamp.
[ "Registers", "hash", "entry", "at", "a", "given", "timestamp", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L73-L91
train
Registers a hash entry at a given timestamp.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
_PathRecord.AddPathInfo
def AddPathInfo(self, path_info): """Updates existing path information of the path record.""" if self._path_type != path_info.path_type: message = "Incompatible path types: `%s` and `%s`" raise ValueError(message % (self._path_type, path_info.path_type)) if self._components != path_info.compone...
python
def AddPathInfo(self, path_info): """Updates existing path information of the path record.""" if self._path_type != path_info.path_type: message = "Incompatible path types: `%s` and `%s`" raise ValueError(message % (self._path_type, path_info.path_type)) if self._components != path_info.compone...
[ "def", "AddPathInfo", "(", "self", ",", "path_info", ")", ":", "if", "self", ".", "_path_type", "!=", "path_info", ".", "path_type", ":", "message", "=", "\"Incompatible path types: `%s` and `%s`\"", "raise", "ValueError", "(", "message", "%", "(", "self", ".", ...
Updates existing path information of the path record.
[ "Updates", "existing", "path", "information", "of", "the", "path", "record", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L99-L116
train
Adds a path info to the path record.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
_PathRecord.AddChild
def AddChild(self, path_info): """Makes the path aware of some child.""" if self._path_type != path_info.path_type: message = "Incompatible path types: `%s` and `%s`" raise ValueError(message % (self._path_type, path_info.path_type)) if self._components != path_info.components[:-1]: messa...
python
def AddChild(self, path_info): """Makes the path aware of some child.""" if self._path_type != path_info.path_type: message = "Incompatible path types: `%s` and `%s`" raise ValueError(message % (self._path_type, path_info.path_type)) if self._components != path_info.components[:-1]: messa...
[ "def", "AddChild", "(", "self", ",", "path_info", ")", ":", "if", "self", ".", "_path_type", "!=", "path_info", ".", "path_type", ":", "message", "=", "\"Incompatible path types: `%s` and `%s`\"", "raise", "ValueError", "(", "message", "%", "(", "self", ".", "...
Makes the path aware of some child.
[ "Makes", "the", "path", "aware", "of", "some", "child", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L118-L128
train
Makes the path aware of some child.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
_PathRecord.GetPathInfo
def GetPathInfo(self, timestamp=None): """Generates a summary about the path record. Args: timestamp: A point in time from which the data should be retrieved. Returns: A `rdf_objects.PathInfo` instance. """ path_info_timestamp = self._LastEntryTimestamp(self._path_infos, timestamp) ...
python
def GetPathInfo(self, timestamp=None): """Generates a summary about the path record. Args: timestamp: A point in time from which the data should be retrieved. Returns: A `rdf_objects.PathInfo` instance. """ path_info_timestamp = self._LastEntryTimestamp(self._path_infos, timestamp) ...
[ "def", "GetPathInfo", "(", "self", ",", "timestamp", "=", "None", ")", ":", "path_info_timestamp", "=", "self", ".", "_LastEntryTimestamp", "(", "self", ".", "_path_infos", ",", "timestamp", ")", "try", ":", "result", "=", "self", ".", "_path_infos", "[", ...
Generates a summary about the path record. Args: timestamp: A point in time from which the data should be retrieved. Returns: A `rdf_objects.PathInfo` instance.
[ "Generates", "a", "summary", "about", "the", "path", "record", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L130-L156
train
Generates a summary about the path record.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
_PathRecord._LastEntryTimestamp
def _LastEntryTimestamp(dct, upper_bound_timestamp): """Searches for greatest timestamp lower than the specified one. Args: dct: A dictionary from timestamps to some items. upper_bound_timestamp: An upper bound for timestamp to be returned. Returns: Greatest timestamp that is lower than ...
python
def _LastEntryTimestamp(dct, upper_bound_timestamp): """Searches for greatest timestamp lower than the specified one. Args: dct: A dictionary from timestamps to some items. upper_bound_timestamp: An upper bound for timestamp to be returned. Returns: Greatest timestamp that is lower than ...
[ "def", "_LastEntryTimestamp", "(", "dct", ",", "upper_bound_timestamp", ")", ":", "if", "upper_bound_timestamp", "is", "None", ":", "upper_bound", "=", "lambda", "_", ":", "True", "else", ":", "upper_bound", "=", "lambda", "key", ":", "key", "<=", "upper_bound...
Searches for greatest timestamp lower than the specified one. Args: dct: A dictionary from timestamps to some items. upper_bound_timestamp: An upper bound for timestamp to be returned. Returns: Greatest timestamp that is lower than the specified one. If no such value exists, `None` is ...
[ "Searches", "for", "greatest", "timestamp", "lower", "than", "the", "specified", "one", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L162-L181
train
Searches for the highest timestamp lower than the specified one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin.ReadPathInfo
def ReadPathInfo(self, client_id, path_type, components, timestamp=None): """Retrieves a path info record for a given path.""" try: path_record = self.path_records[(client_id, path_type, components)] return path_record.GetPathInfo(timestamp=timestamp) except KeyError: raise db.UnknownPathE...
python
def ReadPathInfo(self, client_id, path_type, components, timestamp=None): """Retrieves a path info record for a given path.""" try: path_record = self.path_records[(client_id, path_type, components)] return path_record.GetPathInfo(timestamp=timestamp) except KeyError: raise db.UnknownPathE...
[ "def", "ReadPathInfo", "(", "self", ",", "client_id", ",", "path_type", ",", "components", ",", "timestamp", "=", "None", ")", ":", "try", ":", "path_record", "=", "self", ".", "path_records", "[", "(", "client_id", ",", "path_type", ",", "components", ")"...
Retrieves a path info record for a given path.
[ "Retrieves", "a", "path", "info", "record", "for", "a", "given", "path", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L188-L195
train
Reads a path info record for a given path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin.ReadPathInfos
def ReadPathInfos(self, client_id, path_type, components_list): """Retrieves path info records for given paths.""" result = {} for components in components_list: try: path_record = self.path_records[(client_id, path_type, components)] result[components] = path_record.GetPathInfo() ...
python
def ReadPathInfos(self, client_id, path_type, components_list): """Retrieves path info records for given paths.""" result = {} for components in components_list: try: path_record = self.path_records[(client_id, path_type, components)] result[components] = path_record.GetPathInfo() ...
[ "def", "ReadPathInfos", "(", "self", ",", "client_id", ",", "path_type", ",", "components_list", ")", ":", "result", "=", "{", "}", "for", "components", "in", "components_list", ":", "try", ":", "path_record", "=", "self", ".", "path_records", "[", "(", "c...
Retrieves path info records for given paths.
[ "Retrieves", "path", "info", "records", "for", "given", "paths", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L198-L209
train
Reads path info records for given paths.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin.ListDescendentPathInfos
def ListDescendentPathInfos(self, client_id, path_type, components, timestamp=None, max_depth=None): """Lists path info records that correspond to children of given p...
python
def ListDescendentPathInfos(self, client_id, path_type, components, timestamp=None, max_depth=None): """Lists path info records that correspond to children of given p...
[ "def", "ListDescendentPathInfos", "(", "self", ",", "client_id", ",", "path_type", ",", "components", ",", "timestamp", "=", "None", ",", "max_depth", "=", "None", ")", ":", "result", "=", "[", "]", "for", "path_idx", ",", "path_record", "in", "iteritems", ...
Lists path info records that correspond to children of given path.
[ "Lists", "path", "info", "records", "that", "correspond", "to", "children", "of", "given", "path", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L212-L277
train
Lists all path info records that correspond to children of given path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin._WritePathInfo
def _WritePathInfo(self, client_id, path_info): """Writes a single path info record for given client.""" if client_id not in self.metadatas: raise db.UnknownClientError(client_id) path_record = self._GetPathRecord(client_id, path_info) path_record.AddPathInfo(path_info) parent_path_info = pa...
python
def _WritePathInfo(self, client_id, path_info): """Writes a single path info record for given client.""" if client_id not in self.metadatas: raise db.UnknownClientError(client_id) path_record = self._GetPathRecord(client_id, path_info) path_record.AddPathInfo(path_info) parent_path_info = pa...
[ "def", "_WritePathInfo", "(", "self", ",", "client_id", ",", "path_info", ")", ":", "if", "client_id", "not", "in", "self", ".", "metadatas", ":", "raise", "db", ".", "UnknownClientError", "(", "client_id", ")", "path_record", "=", "self", ".", "_GetPathReco...
Writes a single path info record for given client.
[ "Writes", "a", "single", "path", "info", "record", "for", "given", "client", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L290-L301
train
Writes a single path info record for given client.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin.MultiClearPathHistory
def MultiClearPathHistory(self, path_infos): """Clears path history for specified paths of given clients.""" for client_id, client_path_infos in iteritems(path_infos): self.ClearPathHistory(client_id, client_path_infos)
python
def MultiClearPathHistory(self, path_infos): """Clears path history for specified paths of given clients.""" for client_id, client_path_infos in iteritems(path_infos): self.ClearPathHistory(client_id, client_path_infos)
[ "def", "MultiClearPathHistory", "(", "self", ",", "path_infos", ")", ":", "for", "client_id", ",", "client_path_infos", "in", "iteritems", "(", "path_infos", ")", ":", "self", ".", "ClearPathHistory", "(", "client_id", ",", "client_path_infos", ")" ]
Clears path history for specified paths of given clients.
[ "Clears", "path", "history", "for", "specified", "paths", "of", "given", "clients", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L316-L319
train
Clears the path history for the given paths of given clients.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin.ClearPathHistory
def ClearPathHistory(self, client_id, path_infos): """Clears path history for specified paths of given client.""" for path_info in path_infos: path_record = self._GetPathRecord(client_id, path_info) path_record.ClearHistory()
python
def ClearPathHistory(self, client_id, path_infos): """Clears path history for specified paths of given client.""" for path_info in path_infos: path_record = self._GetPathRecord(client_id, path_info) path_record.ClearHistory()
[ "def", "ClearPathHistory", "(", "self", ",", "client_id", ",", "path_infos", ")", ":", "for", "path_info", "in", "path_infos", ":", "path_record", "=", "self", ".", "_GetPathRecord", "(", "client_id", ",", "path_info", ")", "path_record", ".", "ClearHistory", ...
Clears path history for specified paths of given client.
[ "Clears", "path", "history", "for", "specified", "paths", "of", "given", "client", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L322-L326
train
Clears the path history for the given paths of given client.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin.MultiWritePathHistory
def MultiWritePathHistory(self, client_path_histories): """Writes a collection of hash and stat entries observed for given paths.""" for client_path, client_path_history in iteritems(client_path_histories): if client_path.client_id not in self.metadatas: raise db.UnknownClientError(client_path.cli...
python
def MultiWritePathHistory(self, client_path_histories): """Writes a collection of hash and stat entries observed for given paths.""" for client_path, client_path_history in iteritems(client_path_histories): if client_path.client_id not in self.metadatas: raise db.UnknownClientError(client_path.cli...
[ "def", "MultiWritePathHistory", "(", "self", ",", "client_path_histories", ")", ":", "for", "client_path", ",", "client_path_history", "in", "iteritems", "(", "client_path_histories", ")", ":", "if", "client_path", ".", "client_id", "not", "in", "self", ".", "meta...
Writes a collection of hash and stat entries observed for given paths.
[ "Writes", "a", "collection", "of", "hash", "and", "stat", "entries", "observed", "for", "given", "paths", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L329-L354
train
Writes a collection of hash and stat entries observed for given paths.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/databases/mem_paths.py
InMemoryDBPathMixin.ReadPathInfosHistories
def ReadPathInfosHistories(self, client_id, path_type, components_list): """Reads a collection of hash and stat entries for given paths.""" results = {} for components in components_list: try: path_record = self.path_records[(client_id, path_type, components)] except KeyError: r...
python
def ReadPathInfosHistories(self, client_id, path_type, components_list): """Reads a collection of hash and stat entries for given paths.""" results = {} for components in components_list: try: path_record = self.path_records[(client_id, path_type, components)] except KeyError: r...
[ "def", "ReadPathInfosHistories", "(", "self", ",", "client_id", ",", "path_type", ",", "components_list", ")", ":", "results", "=", "{", "}", "for", "components", "in", "components_list", ":", "try", ":", "path_record", "=", "self", ".", "path_records", "[", ...
Reads a collection of hash and stat entries for given paths.
[ "Reads", "a", "collection", "of", "hash", "and", "stat", "entries", "for", "given", "paths", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mem_paths.py#L357-L391
train
Reads a collection of hash and stat entries for given paths.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ConvertSupportedOSToConditions
def ConvertSupportedOSToConditions(src_object): """Turn supported_os into a condition.""" if src_object.supported_os: conditions = " OR ".join("os == '%s'" % o for o in src_object.supported_os) return conditions
python
def ConvertSupportedOSToConditions(src_object): """Turn supported_os into a condition.""" if src_object.supported_os: conditions = " OR ".join("os == '%s'" % o for o in src_object.supported_os) return conditions
[ "def", "ConvertSupportedOSToConditions", "(", "src_object", ")", ":", "if", "src_object", ".", "supported_os", ":", "conditions", "=", "\" OR \"", ".", "join", "(", "\"os == '%s'\"", "%", "o", "for", "o", "in", "src_object", ".", "supported_os", ")", "return", ...
Turn supported_os into a condition.
[ "Turn", "supported_os", "into", "a", "condition", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L941-L945
train
Converts the supported_os property into a condition.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
GetArtifactCollectorArgs
def GetArtifactCollectorArgs(flow_args, knowledge_base): """Prepare bundle of artifacts and their dependencies for the client. Args: flow_args: An `ArtifactCollectorFlowArgs` instance. knowledge_base: contains information about the client Returns: rdf value object containing a list of extended artif...
python
def GetArtifactCollectorArgs(flow_args, knowledge_base): """Prepare bundle of artifacts and their dependencies for the client. Args: flow_args: An `ArtifactCollectorFlowArgs` instance. knowledge_base: contains information about the client Returns: rdf value object containing a list of extended artif...
[ "def", "GetArtifactCollectorArgs", "(", "flow_args", ",", "knowledge_base", ")", ":", "args", "=", "rdf_artifacts", ".", "ClientArtifactCollectorArgs", "(", ")", "args", ".", "knowledge_base", "=", "knowledge_base", "args", ".", "apply_parsers", "=", "flow_args", "....
Prepare bundle of artifacts and their dependencies for the client. Args: flow_args: An `ArtifactCollectorFlowArgs` instance. knowledge_base: contains information about the client Returns: rdf value object containing a list of extended artifacts and the knowledge base
[ "Prepare", "bundle", "of", "artifacts", "and", "their", "dependencies", "for", "the", "client", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L948-L984
train
Prepare bundle of artifacts and their dependencies for the client.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
MeetsConditions
def MeetsConditions(knowledge_base, source): """Check conditions on the source.""" source_conditions_met = True os_conditions = ConvertSupportedOSToConditions(source) if os_conditions: source.conditions.append(os_conditions) for condition in source.conditions: source_conditions_met &= artifact_utils.C...
python
def MeetsConditions(knowledge_base, source): """Check conditions on the source.""" source_conditions_met = True os_conditions = ConvertSupportedOSToConditions(source) if os_conditions: source.conditions.append(os_conditions) for condition in source.conditions: source_conditions_met &= artifact_utils.C...
[ "def", "MeetsConditions", "(", "knowledge_base", ",", "source", ")", ":", "source_conditions_met", "=", "True", "os_conditions", "=", "ConvertSupportedOSToConditions", "(", "source", ")", "if", "os_conditions", ":", "source", ".", "conditions", ".", "append", "(", ...
Check conditions on the source.
[ "Check", "conditions", "on", "the", "source", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L987-L997
train
Check conditions on the source.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
GetArtifactsForCollection
def GetArtifactsForCollection(os_name, artifact_list): """Wrapper for the ArtifactArranger. Extend the artifact list by dependencies and sort the artifacts to resolve the dependencies. Args: os_name: String specifying the OS name. artifact_list: List of requested artifact names. Returns: A list...
python
def GetArtifactsForCollection(os_name, artifact_list): """Wrapper for the ArtifactArranger. Extend the artifact list by dependencies and sort the artifacts to resolve the dependencies. Args: os_name: String specifying the OS name. artifact_list: List of requested artifact names. Returns: A list...
[ "def", "GetArtifactsForCollection", "(", "os_name", ",", "artifact_list", ")", ":", "artifact_arranger", "=", "ArtifactArranger", "(", "os_name", ",", "artifact_list", ")", "artifact_names", "=", "artifact_arranger", ".", "GetArtifactsInProperOrder", "(", ")", "return",...
Wrapper for the ArtifactArranger. Extend the artifact list by dependencies and sort the artifacts to resolve the dependencies. Args: os_name: String specifying the OS name. artifact_list: List of requested artifact names. Returns: A list of artifacts such that if they are collected in the given o...
[ "Wrapper", "for", "the", "ArtifactArranger", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1098-L1114
train
Wrapper for ArtifactArranger. GetArtifactsForCollection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactExpander.Expand
def Expand(self, rdf_artifact, requested): """Expand artifact by extending its sources. This method takes as input an rdf artifact object and returns a rdf expanded artifact. It iterates through the list of sources processing them by type. Each source of the original artifact can lead to one or more (i...
python
def Expand(self, rdf_artifact, requested): """Expand artifact by extending its sources. This method takes as input an rdf artifact object and returns a rdf expanded artifact. It iterates through the list of sources processing them by type. Each source of the original artifact can lead to one or more (i...
[ "def", "Expand", "(", "self", ",", "rdf_artifact", ",", "requested", ")", ":", "source_type", "=", "rdf_artifacts", ".", "ArtifactSource", ".", "SourceType", "expanded_artifact", "=", "rdf_artifacts", ".", "ExpandedArtifact", "(", "name", "=", "rdf_artifact", ".",...
Expand artifact by extending its sources. This method takes as input an rdf artifact object and returns a rdf expanded artifact. It iterates through the list of sources processing them by type. Each source of the original artifact can lead to one or more (in case of artifact groups and files where the ...
[ "Expand", "artifact", "by", "extending", "its", "sources", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1009-L1059
train
Expand an artifact by extending its sources.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactExpander._ExpandArtifactGroupSource
def _ExpandArtifactGroupSource(self, source, requested): """Recursively expands an artifact group source.""" artifact_list = [] if "names" in source.attributes: artifact_list = source.attributes["names"] for artifact_name in artifact_list: if artifact_name in self.processed_artifacts: ...
python
def _ExpandArtifactGroupSource(self, source, requested): """Recursively expands an artifact group source.""" artifact_list = [] if "names" in source.attributes: artifact_list = source.attributes["names"] for artifact_name in artifact_list: if artifact_name in self.processed_artifacts: ...
[ "def", "_ExpandArtifactGroupSource", "(", "self", ",", "source", ",", "requested", ")", ":", "artifact_list", "=", "[", "]", "if", "\"names\"", "in", "source", ".", "attributes", ":", "artifact_list", "=", "source", ".", "attributes", "[", "\"names\"", "]", ...
Recursively expands an artifact group source.
[ "Recursively", "expands", "an", "artifact", "group", "source", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1068-L1078
train
Recursively expands an artifact group source.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactExpander._ExpandArtifactFilesSource
def _ExpandArtifactFilesSource(self, source, requested): """Recursively expands an artifact files source.""" expanded_source = rdf_artifacts.ExpandedSource(base_source=source) sub_sources = [] artifact_list = [] if "artifact_list" in source.attributes: artifact_list = source.attributes["artifa...
python
def _ExpandArtifactFilesSource(self, source, requested): """Recursively expands an artifact files source.""" expanded_source = rdf_artifacts.ExpandedSource(base_source=source) sub_sources = [] artifact_list = [] if "artifact_list" in source.attributes: artifact_list = source.attributes["artifa...
[ "def", "_ExpandArtifactFilesSource", "(", "self", ",", "source", ",", "requested", ")", ":", "expanded_source", "=", "rdf_artifacts", ".", "ExpandedSource", "(", "base_source", "=", "source", ")", "sub_sources", "=", "[", "]", "artifact_list", "=", "[", "]", "...
Recursively expands an artifact files source.
[ "Recursively", "expands", "an", "artifact", "files", "source", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1080-L1095
train
Recursively expands an artifact files source.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactArranger._InitializeGraph
def _InitializeGraph(self, os_name, artifact_list): """Creates the nodes and directed edges of the dependency graph. Args: os_name: String specifying the OS name. artifact_list: List of requested artifact names. """ dependencies = artifact_registry.REGISTRY.SearchDependencies( os_na...
python
def _InitializeGraph(self, os_name, artifact_list): """Creates the nodes and directed edges of the dependency graph. Args: os_name: String specifying the OS name. artifact_list: List of requested artifact names. """ dependencies = artifact_registry.REGISTRY.SearchDependencies( os_na...
[ "def", "_InitializeGraph", "(", "self", ",", "os_name", ",", "artifact_list", ")", ":", "dependencies", "=", "artifact_registry", ".", "REGISTRY", ".", "SearchDependencies", "(", "os_name", ",", "artifact_list", ")", "artifact_names", ",", "attribute_names", "=", ...
Creates the nodes and directed edges of the dependency graph. Args: os_name: String specifying the OS name. artifact_list: List of requested artifact names.
[ "Creates", "the", "nodes", "and", "directed", "edges", "of", "the", "dependency", "graph", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1133-L1145
train
Initializes the dependency graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactArranger._AddAttributeNodes
def _AddAttributeNodes(self, attribute_names): """Add the attribute nodes to the graph. For every attribute that is required for the collection of requested artifacts, add a node to the dependency graph. An attribute node will have incoming edges from the artifacts that provide this attribute and outgo...
python
def _AddAttributeNodes(self, attribute_names): """Add the attribute nodes to the graph. For every attribute that is required for the collection of requested artifacts, add a node to the dependency graph. An attribute node will have incoming edges from the artifacts that provide this attribute and outgo...
[ "def", "_AddAttributeNodes", "(", "self", ",", "attribute_names", ")", ":", "for", "attribute_name", "in", "attribute_names", ":", "self", ".", "graph", "[", "attribute_name", "]", "=", "self", ".", "Node", "(", "is_artifact", "=", "False", ")" ]
Add the attribute nodes to the graph. For every attribute that is required for the collection of requested artifacts, add a node to the dependency graph. An attribute node will have incoming edges from the artifacts that provide this attribute and outgoing edges to the artifacts that depend on it. ...
[ "Add", "the", "attribute", "nodes", "to", "the", "graph", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1147-L1162
train
Adds the attribute nodes to the dependency graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactArranger._AddArtifactNodesAndEdges
def _AddArtifactNodesAndEdges(self, artifact_names): """Add the artifact nodes to the graph. For every artifact that has to be collected, add a node to the dependency graph. The edges represent the dependencies. An artifact has outgoing edges to the attributes it provides and incoming edges from a...
python
def _AddArtifactNodesAndEdges(self, artifact_names): """Add the artifact nodes to the graph. For every artifact that has to be collected, add a node to the dependency graph. The edges represent the dependencies. An artifact has outgoing edges to the attributes it provides and incoming edges from a...
[ "def", "_AddArtifactNodesAndEdges", "(", "self", ",", "artifact_names", ")", ":", "for", "artifact_name", "in", "artifact_names", ":", "self", ".", "graph", "[", "artifact_name", "]", "=", "self", ".", "Node", "(", "is_artifact", "=", "True", ")", "rdf_artifac...
Add the artifact nodes to the graph. For every artifact that has to be collected, add a node to the dependency graph. The edges represent the dependencies. An artifact has outgoing edges to the attributes it provides and incoming edges from attributes it depends on. Initially, only artifacts witho...
[ "Add", "the", "artifact", "nodes", "to", "the", "graph", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1164-L1182
train
Adds the artifact nodes and edges to the graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactArranger._AddDependencyEdges
def _AddDependencyEdges(self, rdf_artifact): """Add an edge for every dependency of the given artifact. This method gets the attribute names for a given artifact and for every attribute it adds a directed edge from the attribute node to the artifact node. If an artifact does not have any dependencies i...
python
def _AddDependencyEdges(self, rdf_artifact): """Add an edge for every dependency of the given artifact. This method gets the attribute names for a given artifact and for every attribute it adds a directed edge from the attribute node to the artifact node. If an artifact does not have any dependencies i...
[ "def", "_AddDependencyEdges", "(", "self", ",", "rdf_artifact", ")", ":", "artifact_dependencies", "=", "artifact_registry", ".", "GetArtifactPathDependencies", "(", "rdf_artifact", ")", "if", "artifact_dependencies", ":", "for", "attribute", "in", "artifact_dependencies"...
Add an edge for every dependency of the given artifact. This method gets the attribute names for a given artifact and for every attribute it adds a directed edge from the attribute node to the artifact node. If an artifact does not have any dependencies it is added to the set of reachable nodes. A...
[ "Add", "an", "edge", "for", "every", "dependency", "of", "the", "given", "artifact", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1184-L1202
train
Adds an edge for every dependency of the given artifact.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactArranger._AddProvidesEdges
def _AddProvidesEdges(self, rdf_artifact): """Add an edge for every attribute the given artifact provides. This method adds a directed edge from the artifact node to every attribute this artifact provides. Args: rdf_artifact: The artifact object. """ for attribute in rdf_artifact.provide...
python
def _AddProvidesEdges(self, rdf_artifact): """Add an edge for every attribute the given artifact provides. This method adds a directed edge from the artifact node to every attribute this artifact provides. Args: rdf_artifact: The artifact object. """ for attribute in rdf_artifact.provide...
[ "def", "_AddProvidesEdges", "(", "self", ",", "rdf_artifact", ")", ":", "for", "attribute", "in", "rdf_artifact", ".", "provides", ":", "self", ".", "_AddEdge", "(", "rdf_artifact", ".", "name", ",", "attribute", ")" ]
Add an edge for every attribute the given artifact provides. This method adds a directed edge from the artifact node to every attribute this artifact provides. Args: rdf_artifact: The artifact object.
[ "Add", "an", "edge", "for", "every", "attribute", "the", "given", "artifact", "provides", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1204-L1214
train
Adds an edge for every attribute in the given artifact provides.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactArranger._AddEdge
def _AddEdge(self, start_node, end_node): """Add a directed edge to the graph. Add the end to the list of outgoing nodes of the start and the start to the list of incoming nodes of the end node. Args: start_node: name of the start node end_node: name of the end node """ self.graph...
python
def _AddEdge(self, start_node, end_node): """Add a directed edge to the graph. Add the end to the list of outgoing nodes of the start and the start to the list of incoming nodes of the end node. Args: start_node: name of the start node end_node: name of the end node """ self.graph...
[ "def", "_AddEdge", "(", "self", ",", "start_node", ",", "end_node", ")", ":", "self", ".", "graph", "[", "start_node", "]", ".", "outgoing", ".", "append", "(", "end_node", ")", "# This check is necessary because an artifact can provide attributes that", "# are not co...
Add a directed edge to the graph. Add the end to the list of outgoing nodes of the start and the start to the list of incoming nodes of the end node. Args: start_node: name of the start node end_node: name of the end node
[ "Add", "a", "directed", "edge", "to", "the", "graph", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1216-L1233
train
Adds a directed edge to the graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/server/grr_response_server/flows/general/collectors.py
ArtifactArranger.GetArtifactsInProperOrder
def GetArtifactsInProperOrder(self): """Bring the artifacts in a linear order that resolves dependencies. This method obtains a linear ordering of the nodes and then returns the list of artifact names. Returns: A list of `ArtifactName` instances such that if they are collected in the given...
python
def GetArtifactsInProperOrder(self): """Bring the artifacts in a linear order that resolves dependencies. This method obtains a linear ordering of the nodes and then returns the list of artifact names. Returns: A list of `ArtifactName` instances such that if they are collected in the given...
[ "def", "GetArtifactsInProperOrder", "(", "self", ")", ":", "artifact_list", "=", "[", "]", "while", "self", ".", "reachable_nodes", ":", "node_name", "=", "self", ".", "reachable_nodes", ".", "pop", "(", ")", "node", "=", "self", ".", "graph", "[", "node_n...
Bring the artifacts in a linear order that resolves dependencies. This method obtains a linear ordering of the nodes and then returns the list of artifact names. Returns: A list of `ArtifactName` instances such that if they are collected in the given order their dependencies are resolved.
[ "Bring", "the", "artifacts", "in", "a", "linear", "order", "that", "resolves", "dependencies", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flows/general/collectors.py#L1235-L1261
train
Bring the artifacts in a linear order that resolves dependencies.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
google/grr
grr/core/grr_response_core/lib/fingerprint.py
Finger.ConsumeRange
def ConsumeRange(self, start, end): """Consumes an entire range, or part thereof. If the finger has no ranges left, or the curent range start is higher than the end of the consumed block, nothing happens. Otherwise, the current range is adjusted for the consumed block, or removed, if the entire blo...
python
def ConsumeRange(self, start, end): """Consumes an entire range, or part thereof. If the finger has no ranges left, or the curent range start is higher than the end of the consumed block, nothing happens. Otherwise, the current range is adjusted for the consumed block, or removed, if the entire blo...
[ "def", "ConsumeRange", "(", "self", ",", "start", ",", "end", ")", ":", "old", "=", "self", ".", "CurrentRange", "(", ")", "if", "old", "is", "None", ":", "return", "if", "old", ".", "start", ">", "start", ":", "if", "old", ".", "start", "<", "en...
Consumes an entire range, or part thereof. If the finger has no ranges left, or the curent range start is higher than the end of the consumed block, nothing happens. Otherwise, the current range is adjusted for the consumed block, or removed, if the entire block is consumed. For things to work, the con...
[ "Consumes", "an", "entire", "range", "or", "part", "thereof", "." ]
5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/core/grr_response_core/lib/fingerprint.py#L65-L98
train
Consumes an entire range or part thereof.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...