Instruction:
How would you code a function in Python 3 to
function path: DOM.setAttributesAsText Domain: DOM Method name: setAttributesAsText Parameters: Required arguments: 'nodeId' (type: NodeId) -> Id of the element to set attributes for. 'text' (type: string) -> Text with a number of attributes. Will parse this text using HTML parser. Optional arguments: 'name' (type: string) -> Attribute name to replace with new attributes derived from text in case text parsed successfully. No return value. Description: Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.

Response:
def DOM_setAttributesAsText(self, nodeId, text, **kwargs):
		"""
		Function path: DOM.setAttributesAsText
			Domain: DOM
			Method name: setAttributesAsText

			Parameters:
				Required arguments:
					'nodeId' (type: NodeId) -> Id of the element to set attributes for.
					'text' (type: string) -> Text with a number of attributes. Will parse this text using HTML parser.
				Optional arguments:
					'name' (type: string) -> Attribute name to replace with new attributes derived from text in case text parsed successfully.
			No return value.

			Description: Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
		"""
		assert isinstance(text, (str,)
		    ), "Argument 'text' must be of type '['str']'. Received type: '%s'" % type(
		    text)
		if 'name' in kwargs:
			assert isinstance(kwargs['name'], (str,)
			    ), "Optional argument 'name' must be of type '['str']'. Received type: '%s'" % type(
			    kwargs['name'])
		expected = ['name']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['name']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('DOM.setAttributesAsText', nodeId
		    =nodeId, text=text, **kwargs)
		return subdom_funcs


Instruction:
Implement a Python 3 function for
functioning path: DOM.setOuterHTML Domain: DOM Method name: setOuterHTML Parameters: Required arguments: 'nodeId' (type: NodeId) -> Id of the node to set markup for. 'outerHTML' (type: string) -> Outer HTML markup to set. No return value. Description: Sets node HTML markup, returns new node id.

Response:
def DOM_setOuterHTML(self, nodeId, outerHTML):
		"""
		Function path: DOM.setOuterHTML
			Domain: DOM
			Method name: setOuterHTML

			Parameters:
				Required arguments:
					'nodeId' (type: NodeId) -> Id of the node to set markup for.
					'outerHTML' (type: string) -> Outer HTML markup to set.
			No return value.

			Description: Sets node HTML markup, returns new node id.
		"""
		assert isinstance(outerHTML, (str,)
		    ), "Argument 'outerHTML' must be of type '['str']'. Received type: '%s'" % type(
		    outerHTML)
		subdom_funcs = self.synchronous_command('DOM.setOuterHTML', nodeId=nodeId,
		    outerHTML=outerHTML)
		return subdom_funcs


Instruction:
Make a summary of the following Python 3 code
def DOM_getSearchResults(self, searchId, fromIndex, toIndex):
		assert isinstance(searchId, (str,)
		    ), "Argument 'searchId' must be of type '['str']'. Received type: '%s'" % type(
		    searchId)
		assert isinstance(fromIndex, (int,)
		    ), "Argument 'fromIndex' must be of type '['int']'. Received type: '%s'" % type(
		    fromIndex)
		assert isinstance(toIndex, (int,)
		    ), "Argument 'toIndex' must be of type '['int']'. Received type: '%s'" % type(
		    toIndex)
		subdom_funcs = self.synchronous_command('DOM.getSearchResults', searchId=
		    searchId, fromIndex=fromIndex, toIndex=toIndex)
		return subdom_funcs

Response: This method returns the search results from the given search session identifier.


Instruction:
Can you implement a function in Python 3 that
functions path: DOM.discardSearchResults Domain: DOM Method name: discardSearchResults WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'searchId' (type: string) -> Unique search session identifier. No return value. Description: Discards search results from the session with the given id. getSearchResults should no longer be called for that search.

Response:
def DOM_discardSearchResults(self, searchId):
		"""
		Function path: DOM.discardSearchResults
			Domain: DOM
			Method name: discardSearchResults

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'searchId' (type: string) -> Unique search session identifier.
			No return value.

			Description: Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
		"""
		assert isinstance(searchId, (str,)
		    ), "Argument 'searchId' must be of type '['str']'. Received type: '%s'" % type(
		    searchId)
		subdom_funcs = self.synchronous_command('DOM.discardSearchResults',
		    searchId=searchId)
		return subdom_funcs


Instruction:
How would you explain what the following Python 3 function does
def DOM_pushNodeByPathToFrontend(self, path):
		assert isinstance(path, (str,)
		    ), "Argument 'path' must be of type '['str']'. Received type: '%s'" % type(
		    path)
		subdom_funcs = self.synchronous_command('DOM.pushNodeByPathToFrontend',
		    path=path)
		return subdom_funcs

Response: This method is used to push a node to the frontend.


Instruction:
Write a Python 3 function for
functioning path: DOM.pushNodesByBackendIdsToFrontend Domain: DOM Method name: pushNodesByBackendIdsToFrontend WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'backendNodeIds' (type: array) -> The array of backend node ids. Returns: 'nodeIds' (type: array) -> The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds. Description: Requests that a batch of nodes is sent to the caller given their backend node ids.

Response:
def DOM_pushNodesByBackendIdsToFrontend(self, backendNodeIds):
		"""
		Function path: DOM.pushNodesByBackendIdsToFrontend
			Domain: DOM
			Method name: pushNodesByBackendIdsToFrontend

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'backendNodeIds' (type: array) -> The array of backend node ids.
			Returns:
				'nodeIds' (type: array) -> The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.

			Description: Requests that a batch of nodes is sent to the caller given their backend node ids.
		"""
		assert isinstance(backendNodeIds, (list, tuple)
		    ), "Argument 'backendNodeIds' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    backendNodeIds)
		subdom_funcs = self.synchronous_command('DOM.pushNodesByBackendIdsToFrontend'
		    , backendNodeIds=backendNodeIds)
		return subdom_funcs


Instruction:
Can you create a Python 3 function that
functions path: DOM.copyTo Domain: DOM Method name: copyTo WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'nodeId' (type: NodeId) -> Id of the node to copy. 'targetNodeId' (type: NodeId) -> Id of the element to drop the copy into. Optional arguments: 'insertBeforeNodeId' (type: NodeId) -> Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId). Returns: 'nodeId' (type: NodeId) -> Id of the node clone. Description: Creates a deep copy of the specified node and places it into the target container before the given anchor.

Response:
def DOM_copyTo(self, nodeId, targetNodeId, **kwargs):
		"""
		Function path: DOM.copyTo
			Domain: DOM
			Method name: copyTo

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'nodeId' (type: NodeId) -> Id of the node to copy.
					'targetNodeId' (type: NodeId) -> Id of the element to drop the copy into.
				Optional arguments:
					'insertBeforeNodeId' (type: NodeId) -> Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId).
			Returns:
				'nodeId' (type: NodeId) -> Id of the node clone.

			Description: Creates a deep copy of the specified node and places it into the target container before the given anchor.
		"""
		expected = ['insertBeforeNodeId']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['insertBeforeNodeId']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('DOM.copyTo', nodeId=nodeId,
		    targetNodeId=targetNodeId, **kwargs)
		return subdom_funcs


Instruction:
Can you generate a brief explanation for the following Python 3 code
def DOM_setFileInputFiles(self, files, **kwargs):
		assert isinstance(files, (list, tuple)
		    ), "Argument 'files' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    files)
		expected = ['nodeId', 'backendNodeId', 'objectId']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['nodeId', 'backendNodeId', 'objectId']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('DOM.setFileInputFiles', files=
		    files, **kwargs)
		return subdom_funcs

Response: This method is used to set the files for the given file input element.


Instruction:
How would you implement a function in Python 3 that
functions path: DOM.getNodeForLocation Domain: DOM Method name: getNodeForLocation WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'x' (type: integer) -> X coordinate. 'y' (type: integer) -> Y coordinate. Optional arguments: 'includeUserAgentShadowDOM' (type: boolean) -> False to skip to the nearest non-UA shadow root ancestor (default: false). Returns: 'nodeId' (type: NodeId) -> Id of the node at given coordinates. Description: Returns node id at given location.

Response:
def DOM_getNodeForLocation(self, x, y, **kwargs):
		"""
		Function path: DOM.getNodeForLocation
			Domain: DOM
			Method name: getNodeForLocation

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'x' (type: integer) -> X coordinate.
					'y' (type: integer) -> Y coordinate.
				Optional arguments:
					'includeUserAgentShadowDOM' (type: boolean) -> False to skip to the nearest non-UA shadow root ancestor (default: false).
			Returns:
				'nodeId' (type: NodeId) -> Id of the node at given coordinates.

			Description: Returns node id at given location.
		"""
		assert isinstance(x, (int,)
		    ), "Argument 'x' must be of type '['int']'. Received type: '%s'" % type(x
		    )
		assert isinstance(y, (int,)
		    ), "Argument 'y' must be of type '['int']'. Received type: '%s'" % type(y
		    )
		if 'includeUserAgentShadowDOM' in kwargs:
			assert isinstance(kwargs['includeUserAgentShadowDOM'], (bool,)
			    ), "Optional argument 'includeUserAgentShadowDOM' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['includeUserAgentShadowDOM'])
		expected = ['includeUserAgentShadowDOM']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['includeUserAgentShadowDOM']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('DOM.getNodeForLocation', x=x, y=
		    y, **kwargs)
		return subdom_funcs


Instruction:
How would you explain what the following Python 3 function does
def DOM_describeNode(self, **kwargs):
		if 'depth' in kwargs:
			assert isinstance(kwargs['depth'], (int,)
			    ), "Optional argument 'depth' must be of type '['int']'. Received type: '%s'" % type(
			    kwargs['depth'])
		if 'pierce' in kwargs:
			assert isinstance(kwargs['pierce'], (bool,)
			    ), "Optional argument 'pierce' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['pierce'])
		expected = ['nodeId', 'backendNodeId', 'objectId', 'depth', 'pierce']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['nodeId', 'backendNodeId', 'objectId', 'depth', 'pierce']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('DOM.describeNode', **kwargs)
		return subdom_funcs

Response: This method returns a description of a node.


Instruction:
Can you generate the documentation for the following Python 3 function
def CSS_setStyleSheetText(self, styleSheetId, text):
		assert isinstance(text, (str,)
		    ), "Argument 'text' must be of type '['str']'. Received type: '%s'" % type(
		    text)
		subdom_funcs = self.synchronous_command('CSS.setStyleSheetText',
		    styleSheetId=styleSheetId, text=text)
		return subdom_funcs

Response: This command is executed when the user changes the text of a stylesheet.


Instruction:
Make a summary of the following Python 3 code
def CSS_setRuleSelector(self, styleSheetId, range, selector):
		assert isinstance(selector, (str,)
		    ), "Argument 'selector' must be of type '['str']'. Received type: '%s'" % type(
		    selector)
		subdom_funcs = self.synchronous_command('CSS.setRuleSelector',
		    styleSheetId=styleSheetId, range=range, selector=selector)
		return subdom_funcs

Response: This method is used to set the rule selector in a style sheet.


Instruction:
Make a summary of the following Python 3 code
def CSS_setKeyframeKey(self, styleSheetId, range, keyText):
		assert isinstance(keyText, (str,)
		    ), "Argument 'keyText' must be of type '['str']'. Received type: '%s'" % type(
		    keyText)
		subdom_funcs = self.synchronous_command('CSS.setKeyframeKey',
		    styleSheetId=styleSheetId, range=range, keyText=keyText)
		return subdom_funcs

Response: This command is used to set the keyframe rule key text.


Instruction:
Given the following Python 3 function, write the documentation
def CSS_setStyleTexts(self, edits):
		assert isinstance(edits, (list, tuple)
		    ), "Argument 'edits' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    edits)
		subdom_funcs = self.synchronous_command('CSS.setStyleTexts', edits=edits)
		return subdom_funcs

Response: This method is used to set the style texts of the selected elements in the editor.


Instruction:
Create a Python 3 function to
function path: CSS.setMediaText Domain: CSS Method name: setMediaText Parameters: Required arguments: 'styleSheetId' (type: StyleSheetId) -> No description 'range' (type: SourceRange) -> No description 'text' (type: string) -> No description Returns: 'media' (type: CSSMedia) -> The resulting CSS media rule after modification. Description: Modifies the rule selector.

Response:
def CSS_setMediaText(self, styleSheetId, range, text):
		"""
		Function path: CSS.setMediaText
			Domain: CSS
			Method name: setMediaText

			Parameters:
				Required arguments:
					'styleSheetId' (type: StyleSheetId) -> No description
					'range' (type: SourceRange) -> No description
					'text' (type: string) -> No description
			Returns:
				'media' (type: CSSMedia) -> The resulting CSS media rule after modification.

			Description: Modifies the rule selector.
		"""
		assert isinstance(text, (str,)
		    ), "Argument 'text' must be of type '['str']'. Received type: '%s'" % type(
		    text)
		subdom_funcs = self.synchronous_command('CSS.setMediaText', styleSheetId=
		    styleSheetId, range=range, text=text)
		return subdom_funcs


Instruction:
Can you write a function in Python 3 where it
functions path: CSS.addRule Domain: CSS Method name: addRule Parameters: Required arguments: 'styleSheetId' (type: StyleSheetId) -> The css style sheet identifier where a new rule should be inserted. 'ruleText' (type: string) -> The text of a new rule. 'location' (type: SourceRange) -> Text position of a new rule in the target style sheet. Returns: 'rule' (type: CSSRule) -> The newly created rule. Description: Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.

Response:
def CSS_addRule(self, styleSheetId, ruleText, location):
		"""
		Function path: CSS.addRule
			Domain: CSS
			Method name: addRule

			Parameters:
				Required arguments:
					'styleSheetId' (type: StyleSheetId) -> The css style sheet identifier where a new rule should be inserted.
					'ruleText' (type: string) -> The text of a new rule.
					'location' (type: SourceRange) -> Text position of a new rule in the target style sheet.
			Returns:
				'rule' (type: CSSRule) -> The newly created rule.

			Description: Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.
		"""
		assert isinstance(ruleText, (str,)
		    ), "Argument 'ruleText' must be of type '['str']'. Received type: '%s'" % type(
		    ruleText)
		subdom_funcs = self.synchronous_command('CSS.addRule', styleSheetId=
		    styleSheetId, ruleText=ruleText, location=location)
		return subdom_funcs


Instruction:
How would you explain what the following Python 3 function does
def CSS_forcePseudoState(self, nodeId, forcedPseudoClasses):
		assert isinstance(forcedPseudoClasses, (list, tuple)
		    ), "Argument 'forcedPseudoClasses' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    forcedPseudoClasses)
		subdom_funcs = self.synchronous_command('CSS.forcePseudoState', nodeId=
		    nodeId, forcedPseudoClasses=forcedPseudoClasses)
		return subdom_funcs

Response: This method allows you to force the pseudo state of an element.


Instruction:
Can you generate the documentation for the following Python 3 function
def CSS_setEffectivePropertyValueForNode(self, nodeId, propertyName, value):
		assert isinstance(propertyName, (str,)
		    ), "Argument 'propertyName' must be of type '['str']'. Received type: '%s'" % type(
		    propertyName)
		assert isinstance(value, (str,)
		    ), "Argument 'value' must be of type '['str']'. Received type: '%s'" % type(
		    value)
		subdom_funcs = self.synchronous_command(
		    'CSS.setEffectivePropertyValueForNode', nodeId=nodeId, propertyName=
		    propertyName, value=value)
		return subdom_funcs

Response: This method is used to set the value of the given property on the given node.


Instruction:
Write a Python 3 script to
function path: DOMSnapshot.getSnapshot Domain: DOMSnapshot Method name: getSnapshot Parameters: Required arguments: 'computedStyleWhitelist' (type: array) -> Whitelist of computed styles to return. Returns: 'domNodes' (type: array) -> The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. 'layoutTreeNodes' (type: array) -> The nodes in the layout tree. 'computedStyles' (type: array) -> Whitelisted ComputedStyle properties for each node in the layout tree. Description: Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.

Response:
def DOMSnapshot_getSnapshot(self, computedStyleWhitelist):
		"""
		Function path: DOMSnapshot.getSnapshot
			Domain: DOMSnapshot
			Method name: getSnapshot

			Parameters:
				Required arguments:
					'computedStyleWhitelist' (type: array) -> Whitelist of computed styles to return.
			Returns:
				'domNodes' (type: array) -> The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
				'layoutTreeNodes' (type: array) -> The nodes in the layout tree.
				'computedStyles' (type: array) -> Whitelisted ComputedStyle properties for each node in the layout tree.

			Description: Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.
		"""
		assert isinstance(computedStyleWhitelist, (list, tuple)
		    ), "Argument 'computedStyleWhitelist' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    computedStyleWhitelist)
		subdom_funcs = self.synchronous_command('DOMSnapshot.getSnapshot',
		    computedStyleWhitelist=computedStyleWhitelist)
		return subdom_funcs


Instruction:
Write a Python 3 script to
function path: DOMDebugger.setDOMBreakpoint Domain: DOMDebugger Method name: setDOMBreakpoint Parameters: Required arguments: 'nodeId' (type: DOM.NodeId) -> Identifier of the node to set breakpoint on. 'type' (type: DOMBreakpointType) -> Type of the operation to stop upon. No return value. Description: Sets breakpoint on particular operation with DOM.

Response:
def DOMDebugger_setDOMBreakpoint(self, nodeId, type):
		"""
		Function path: DOMDebugger.setDOMBreakpoint
			Domain: DOMDebugger
			Method name: setDOMBreakpoint

			Parameters:
				Required arguments:
					'nodeId' (type: DOM.NodeId) -> Identifier of the node to set breakpoint on.
					'type' (type: DOMBreakpointType) -> Type of the operation to stop upon.
			No return value.

			Description: Sets breakpoint on particular operation with DOM.
		"""
		subdom_funcs = self.synchronous_command('DOMDebugger.setDOMBreakpoint',
		    nodeId=nodeId, type=type)
		return subdom_funcs


Instruction:
How would you code a function in Python 3 to
function path: DOMDebugger.removeDOMBreakpoint Domain: DOMDebugger Method name: removeDOMBreakpoint Parameters: Required arguments: 'nodeId' (type: DOM.NodeId) -> Identifier of the node to remove breakpoint from. 'type' (type: DOMBreakpointType) -> Type of the breakpoint to remove. No return value. Description: Removes DOM breakpoint that was set using setDOMBreakpoint.

Response:
def DOMDebugger_removeDOMBreakpoint(self, nodeId, type):
		"""
		Function path: DOMDebugger.removeDOMBreakpoint
			Domain: DOMDebugger
			Method name: removeDOMBreakpoint

			Parameters:
				Required arguments:
					'nodeId' (type: DOM.NodeId) -> Identifier of the node to remove breakpoint from.
					'type' (type: DOMBreakpointType) -> Type of the breakpoint to remove.
			No return value.

			Description: Removes DOM breakpoint that was set using setDOMBreakpoint.
		"""
		subdom_funcs = self.synchronous_command('DOMDebugger.removeDOMBreakpoint',
		    nodeId=nodeId, type=type)
		return subdom_funcs


Instruction:
How would you implement a function in Python 3 that
functions path: DOMDebugger.setInstrumentationBreakpoint Domain: DOMDebugger Method name: setInstrumentationBreakpoint WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'eventName' (type: string) -> Instrumentation name to stop on. No return value. Description: Sets breakpoint on particular native event.

Response:
def DOMDebugger_setInstrumentationBreakpoint(self, eventName):
		"""
		Function path: DOMDebugger.setInstrumentationBreakpoint
			Domain: DOMDebugger
			Method name: setInstrumentationBreakpoint

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'eventName' (type: string) -> Instrumentation name to stop on.
			No return value.

			Description: Sets breakpoint on particular native event.
		"""
		assert isinstance(eventName, (str,)
		    ), "Argument 'eventName' must be of type '['str']'. Received type: '%s'" % type(
		    eventName)
		subdom_funcs = self.synchronous_command(
		    'DOMDebugger.setInstrumentationBreakpoint', eventName=eventName)
		return subdom_funcs


Instruction:
Can you write a function in Python 3 where it
functions path: DOMDebugger.removeInstrumentationBreakpoint Domain: DOMDebugger Method name: removeInstrumentationBreakpoint WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'eventName' (type: string) -> Instrumentation name to stop on. No return value. Description: Removes breakpoint on particular native event.

Response:
def DOMDebugger_removeInstrumentationBreakpoint(self, eventName):
		"""
		Function path: DOMDebugger.removeInstrumentationBreakpoint
			Domain: DOMDebugger
			Method name: removeInstrumentationBreakpoint

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'eventName' (type: string) -> Instrumentation name to stop on.
			No return value.

			Description: Removes breakpoint on particular native event.
		"""
		assert isinstance(eventName, (str,)
		    ), "Argument 'eventName' must be of type '['str']'. Received type: '%s'" % type(
		    eventName)
		subdom_funcs = self.synchronous_command(
		    'DOMDebugger.removeInstrumentationBreakpoint', eventName=eventName)
		return subdom_funcs


Instruction:
Can you generate the documentation for the following Python 3 function
def DOMDebugger_setXHRBreakpoint(self, url):
		assert isinstance(url, (str,)
		    ), "Argument 'url' must be of type '['str']'. Received type: '%s'" % type(
		    url)
		subdom_funcs = self.synchronous_command('DOMDebugger.setXHRBreakpoint',
		    url=url)
		return subdom_funcs

Response: setXHRBreakpoint - Sets breakpoint on XMLHttpRequest.


Instruction:
How would you implement a function in Python 3 that
functions path: DOMDebugger.removeXHRBreakpoint Domain: DOMDebugger Method name: removeXHRBreakpoint Parameters: Required arguments: 'url' (type: string) -> Resource URL substring. No return value. Description: Removes breakpoint from XMLHttpRequest.

Response:
def DOMDebugger_removeXHRBreakpoint(self, url):
		"""
		Function path: DOMDebugger.removeXHRBreakpoint
			Domain: DOMDebugger
			Method name: removeXHRBreakpoint

			Parameters:
				Required arguments:
					'url' (type: string) -> Resource URL substring.
			No return value.

			Description: Removes breakpoint from XMLHttpRequest.
		"""
		assert isinstance(url, (str,)
		    ), "Argument 'url' must be of type '['str']'. Received type: '%s'" % type(
		    url)
		subdom_funcs = self.synchronous_command('DOMDebugger.removeXHRBreakpoint',
		    url=url)
		return subdom_funcs


Instruction:
Explain what the following Python 3 code does
def Target_setDiscoverTargets(self, discover):
		assert isinstance(discover, (bool,)
		    ), "Argument 'discover' must be of type '['bool']'. Received type: '%s'" % type(
		    discover)
		subdom_funcs = self.synchronous_command('Target.setDiscoverTargets',
		    discover=discover)
		return subdom_funcs

Response: Target. setDiscoverTargets - Sets whether to discover available targets and notify via targetCreated and targetInfoChanged events.


Instruction:
How would you code a function in Python 3 to
function path: Target.setAutoAttach Domain: Target Method name: setAutoAttach Parameters: Required arguments: 'autoAttach' (type: boolean) -> Whether to auto-attach to related targets. 'waitForDebuggerOnStart' (type: boolean) -> Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. No return value. Description: Controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets.

Response:
def Target_setAutoAttach(self, autoAttach, waitForDebuggerOnStart):
		"""
		Function path: Target.setAutoAttach
			Domain: Target
			Method name: setAutoAttach

			Parameters:
				Required arguments:
					'autoAttach' (type: boolean) -> Whether to auto-attach to related targets.
					'waitForDebuggerOnStart' (type: boolean) -> Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets.
			No return value.

			Description: Controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets.
		"""
		assert isinstance(autoAttach, (bool,)
		    ), "Argument 'autoAttach' must be of type '['bool']'. Received type: '%s'" % type(
		    autoAttach)
		assert isinstance(waitForDebuggerOnStart, (bool,)
		    ), "Argument 'waitForDebuggerOnStart' must be of type '['bool']'. Received type: '%s'" % type(
		    waitForDebuggerOnStart)
		subdom_funcs = self.synchronous_command('Target.setAutoAttach',
		    autoAttach=autoAttach, waitForDebuggerOnStart=waitForDebuggerOnStart)
		return subdom_funcs


Instruction:
Write a Python 3 script to
function path: Target.setAttachToFrames Domain: Target Method name: setAttachToFrames Parameters: Required arguments: 'value' (type: boolean) -> Whether to attach to frames. No return value.

Response:
def Target_setAttachToFrames(self, value):
		"""
		Function path: Target.setAttachToFrames
			Domain: Target
			Method name: setAttachToFrames

			Parameters:
				Required arguments:
					'value' (type: boolean) -> Whether to attach to frames.
			No return value.

		"""
		assert isinstance(value, (bool,)
		    ), "Argument 'value' must be of type '['bool']'. Received type: '%s'" % type(
		    value)
		subdom_funcs = self.synchronous_command('Target.setAttachToFrames', value
		    =value)
		return subdom_funcs


Instruction:
Here you have a function in Python 3, explain what it does
def Target_setRemoteLocations(self, locations):
		assert isinstance(locations, (list, tuple)
		    ), "Argument 'locations' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    locations)
		subdom_funcs = self.synchronous_command('Target.setRemoteLocations',
		    locations=locations)
		return subdom_funcs

Response: This method is used to set the remote locations of the target.


Instruction:
Can you create a Python 3 function that
functions path: Target.sendMessageToTarget Domain: Target Method name: sendMessageToTarget Parameters: Required arguments: 'message' (type: string) -> No description Optional arguments: 'sessionId' (type: SessionID) -> Identifier of the session. 'targetId' (type: TargetID) -> Deprecated. No return value. Description: Sends protocol message over session with given id.

Response:
def Target_sendMessageToTarget(self, message, **kwargs):
		"""
		Function path: Target.sendMessageToTarget
			Domain: Target
			Method name: sendMessageToTarget

			Parameters:
				Required arguments:
					'message' (type: string) -> No description
				Optional arguments:
					'sessionId' (type: SessionID) -> Identifier of the session.
					'targetId' (type: TargetID) -> Deprecated.
			No return value.

			Description: Sends protocol message over session with given id.
		"""
		assert isinstance(message, (str,)
		    ), "Argument 'message' must be of type '['str']'. Received type: '%s'" % type(
		    message)
		expected = ['sessionId', 'targetId']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['sessionId', 'targetId']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Target.sendMessageToTarget',
		    message=message, **kwargs)
		return subdom_funcs


Instruction:
Can you write a function in Python 3 where it
functions path : ServiceWorker. unregister Domain : ServiceWorker Method name : unregister Parameters arguments : ServiceWorker Parameter type : str

Response:
def ServiceWorker_unregister(self, scopeURL):
		"""
		Function path: ServiceWorker.unregister
			Domain: ServiceWorker
			Method name: unregister

			Parameters:
				Required arguments:
					'scopeURL' (type: string) -> No description
			No return value.

		"""
		assert isinstance(scopeURL, (str,)
		    ), "Argument 'scopeURL' must be of type '['str']'. Received type: '%s'" % type(
		    scopeURL)
		subdom_funcs = self.synchronous_command('ServiceWorker.unregister',
		    scopeURL=scopeURL)
		return subdom_funcs


Instruction:
Explain what the following Python 3 code does
def ServiceWorker_updateRegistration(self, scopeURL):
		assert isinstance(scopeURL, (str,)
		    ), "Argument 'scopeURL' must be of type '['str']'. Received type: '%s'" % type(
		    scopeURL)
		subdom_funcs = self.synchronous_command('ServiceWorker.updateRegistration',
		    scopeURL=scopeURL)
		return subdom_funcs

Response: Function path : ServiceWorker. updateRegistration


Instruction:
How would you implement a function in Python 3 that
functions path: ServiceWorker.startWorker Domain: ServiceWorker Method name: startWorker Parameters: Required arguments: 'scopeURL' (type: string) -> No description No return value.

Response:
def ServiceWorker_startWorker(self, scopeURL):
		"""
		Function path: ServiceWorker.startWorker
			Domain: ServiceWorker
			Method name: startWorker

			Parameters:
				Required arguments:
					'scopeURL' (type: string) -> No description
			No return value.

		"""
		assert isinstance(scopeURL, (str,)
		    ), "Argument 'scopeURL' must be of type '['str']'. Received type: '%s'" % type(
		    scopeURL)
		subdom_funcs = self.synchronous_command('ServiceWorker.startWorker',
		    scopeURL=scopeURL)
		return subdom_funcs


Instruction:
Write a Python 3 function that can
function path: ServiceWorker.skipWaiting Domain: ServiceWorker Method name: skipWaiting Parameters: Required arguments: 'scopeURL' (type: string) -> No description No return value.

Response:
def ServiceWorker_skipWaiting(self, scopeURL):
		"""
		Function path: ServiceWorker.skipWaiting
			Domain: ServiceWorker
			Method name: skipWaiting

			Parameters:
				Required arguments:
					'scopeURL' (type: string) -> No description
			No return value.

		"""
		assert isinstance(scopeURL, (str,)
		    ), "Argument 'scopeURL' must be of type '['str']'. Received type: '%s'" % type(
		    scopeURL)
		subdom_funcs = self.synchronous_command('ServiceWorker.skipWaiting',
		    scopeURL=scopeURL)
		return subdom_funcs


Instruction:
Can you generate a brief explanation for the following Python 3 code
def ServiceWorker_stopWorker(self, versionId):
		assert isinstance(versionId, (str,)
		    ), "Argument 'versionId' must be of type '['str']'. Received type: '%s'" % type(
		    versionId)
		subdom_funcs = self.synchronous_command('ServiceWorker.stopWorker',
		    versionId=versionId)
		return subdom_funcs

Response: This method is used to stop the Worker with the given versionId.


Instruction:
Implement a Python 3 function for
functioning path: ServiceWorker.inspectWorker Domain: ServiceWorker Method name: inspectWorker Parameters: Required arguments: 'versionId' (type: string) -> No description No return value.

Response:
def ServiceWorker_inspectWorker(self, versionId):
		"""
		Function path: ServiceWorker.inspectWorker
			Domain: ServiceWorker
			Method name: inspectWorker

			Parameters:
				Required arguments:
					'versionId' (type: string) -> No description
			No return value.

		"""
		assert isinstance(versionId, (str,)
		    ), "Argument 'versionId' must be of type '['str']'. Received type: '%s'" % type(
		    versionId)
		subdom_funcs = self.synchronous_command('ServiceWorker.inspectWorker',
		    versionId=versionId)
		return subdom_funcs


Instruction:
Write a Python 3 function that can
function path: ServiceWorker.setForceUpdateOnPageLoad Domain: ServiceWorker Method name: setForceUpdateOnPageLoad Parameters: Required arguments: 'forceUpdateOnPageLoad' (type: boolean) -> No description No return value.

Response:
def ServiceWorker_setForceUpdateOnPageLoad(self, forceUpdateOnPageLoad):
		"""
		Function path: ServiceWorker.setForceUpdateOnPageLoad
			Domain: ServiceWorker
			Method name: setForceUpdateOnPageLoad

			Parameters:
				Required arguments:
					'forceUpdateOnPageLoad' (type: boolean) -> No description
			No return value.

		"""
		assert isinstance(forceUpdateOnPageLoad, (bool,)
		    ), "Argument 'forceUpdateOnPageLoad' must be of type '['bool']'. Received type: '%s'" % type(
		    forceUpdateOnPageLoad)
		subdom_funcs = self.synchronous_command(
		    'ServiceWorker.setForceUpdateOnPageLoad', forceUpdateOnPageLoad=
		    forceUpdateOnPageLoad)
		return subdom_funcs


Instruction:
Explain what the following Python 3 code does
def ServiceWorker_deliverPushMessage(self, origin, registrationId, data):
		assert isinstance(origin, (str,)
		    ), "Argument 'origin' must be of type '['str']'. Received type: '%s'" % type(
		    origin)
		assert isinstance(registrationId, (str,)
		    ), "Argument 'registrationId' must be of type '['str']'. Received type: '%s'" % type(
		    registrationId)
		assert isinstance(data, (str,)
		    ), "Argument 'data' must be of type '['str']'. Received type: '%s'" % type(
		    data)
		subdom_funcs = self.synchronous_command('ServiceWorker.deliverPushMessage',
		    origin=origin, registrationId=registrationId, data=data)
		return subdom_funcs

Response: This method is used to deliver a push message to the specified registrationId.


Instruction:
Write a Python 3 function that can
function path: ServiceWorker.dispatchSyncEvent Domain: ServiceWorker Method name: dispatchSyncEvent Parameters: Required arguments: 'origin' (type: string) -> No description 'registrationId' (type: string) -> No description 'tag' (type: string) -> No description 'lastChance' (type: boolean) -> No description No return value.

Response:
def ServiceWorker_dispatchSyncEvent(self, origin, registrationId, tag,
	    lastChance):
		"""
		Function path: ServiceWorker.dispatchSyncEvent
			Domain: ServiceWorker
			Method name: dispatchSyncEvent

			Parameters:
				Required arguments:
					'origin' (type: string) -> No description
					'registrationId' (type: string) -> No description
					'tag' (type: string) -> No description
					'lastChance' (type: boolean) -> No description
			No return value.

		"""
		assert isinstance(origin, (str,)
		    ), "Argument 'origin' must be of type '['str']'. Received type: '%s'" % type(
		    origin)
		assert isinstance(registrationId, (str,)
		    ), "Argument 'registrationId' must be of type '['str']'. Received type: '%s'" % type(
		    registrationId)
		assert isinstance(tag, (str,)
		    ), "Argument 'tag' must be of type '['str']'. Received type: '%s'" % type(
		    tag)
		assert isinstance(lastChance, (bool,)
		    ), "Argument 'lastChance' must be of type '['bool']'. Received type: '%s'" % type(
		    lastChance)
		subdom_funcs = self.synchronous_command('ServiceWorker.dispatchSyncEvent',
		    origin=origin, registrationId=registrationId, tag=tag, lastChance=
		    lastChance)
		return subdom_funcs


Instruction:
Here you have a function in Python 3, explain what it does
def Input_setIgnoreInputEvents(self, ignore):
		assert isinstance(ignore, (bool,)
		    ), "Argument 'ignore' must be of type '['bool']'. Received type: '%s'" % type(
		    ignore)
		subdom_funcs = self.synchronous_command('Input.setIgnoreInputEvents',
		    ignore=ignore)
		return subdom_funcs

Response: This command is used to set ignore input events.


Instruction:
Explain what the following Python 3 code does
def Input_dispatchMouseEvent(self, type, x, y, **kwargs):
		assert isinstance(type, (str,)
		    ), "Argument 'type' must be of type '['str']'. Received type: '%s'" % type(
		    type)
		assert isinstance(x, (float, int)
		    ), "Argument 'x' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    x)
		assert isinstance(y, (float, int)
		    ), "Argument 'y' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    y)
		if 'modifiers' in kwargs:
			assert isinstance(kwargs['modifiers'], (int,)
			    ), "Optional argument 'modifiers' must be of type '['int']'. Received type: '%s'" % type(
			    kwargs['modifiers'])
		if 'button' in kwargs:
			assert isinstance(kwargs['button'], (str,)
			    ), "Optional argument 'button' must be of type '['str']'. Received type: '%s'" % type(
			    kwargs['button'])
		if 'clickCount' in kwargs:
			assert isinstance(kwargs['clickCount'], (int,)
			    ), "Optional argument 'clickCount' must be of type '['int']'. Received type: '%s'" % type(
			    kwargs['clickCount'])
		if 'deltaX' in kwargs:
			assert isinstance(kwargs['deltaX'], (float, int)
			    ), "Optional argument 'deltaX' must be of type '['float', 'int']'. Received type: '%s'" % type(
			    kwargs['deltaX'])
		if 'deltaY' in kwargs:
			assert isinstance(kwargs['deltaY'], (float, int)
			    ), "Optional argument 'deltaY' must be of type '['float', 'int']'. Received type: '%s'" % type(
			    kwargs['deltaY'])
		expected = ['modifiers', 'timestamp', 'button', 'clickCount', 'deltaX',
		    'deltaY']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['modifiers', 'timestamp', 'button', 'clickCount', 'deltaX', 'deltaY']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Input.dispatchMouseEvent', type=
		    type, x=x, y=y, **kwargs)
		return subdom_funcs

Response: Input. dispatchMouseEvent - Dispatches a mouse event to the page.


Instruction:
Can you write a function in Python 3 where it
functions path: Input.dispatchTouchEvent Domain: Input Method name: dispatchTouchEvent WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'type' (type: string) -> Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one. 'touchPoints' (type: array) -> Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one. Optional arguments: 'modifiers' (type: integer) -> Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). 'timestamp' (type: TimeSinceEpoch) -> Time at which the event occurred. No return value. Description: Dispatches a touch event to the page.

Response:
def Input_dispatchTouchEvent(self, type, touchPoints, **kwargs):
		"""
		Function path: Input.dispatchTouchEvent
			Domain: Input
			Method name: dispatchTouchEvent

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'type' (type: string) -> Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.
					'touchPoints' (type: array) -> Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one.
				Optional arguments:
					'modifiers' (type: integer) -> Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
					'timestamp' (type: TimeSinceEpoch) -> Time at which the event occurred.
			No return value.

			Description: Dispatches a touch event to the page.
		"""
		assert isinstance(type, (str,)
		    ), "Argument 'type' must be of type '['str']'. Received type: '%s'" % type(
		    type)
		assert isinstance(touchPoints, (list, tuple)
		    ), "Argument 'touchPoints' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    touchPoints)
		if 'modifiers' in kwargs:
			assert isinstance(kwargs['modifiers'], (int,)
			    ), "Optional argument 'modifiers' must be of type '['int']'. Received type: '%s'" % type(
			    kwargs['modifiers'])
		expected = ['modifiers', 'timestamp']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['modifiers', 'timestamp']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Input.dispatchTouchEvent', type=
		    type, touchPoints=touchPoints, **kwargs)
		return subdom_funcs


Instruction:
How would you explain what the following Python 3 function does
def Input_synthesizePinchGesture(self, x, y, scaleFactor, **kwargs):
		assert isinstance(x, (float, int)
		    ), "Argument 'x' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    x)
		assert isinstance(y, (float, int)
		    ), "Argument 'y' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    y)
		assert isinstance(scaleFactor, (float, int)
		    ), "Argument 'scaleFactor' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    scaleFactor)
		if 'relativeSpeed' in kwargs:
			assert isinstance(kwargs['relativeSpeed'], (int,)
			    ), "Optional argument 'relativeSpeed' must be of type '['int']'. Received type: '%s'" % type(
			    kwargs['relativeSpeed'])
		expected = ['relativeSpeed', 'gestureSourceType']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['relativeSpeed', 'gestureSourceType']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Input.synthesizePinchGesture', x
		    =x, y=y, scaleFactor=scaleFactor, **kwargs)
		return subdom_funcs

Response: Input. synthesizePinchGesture - Synthesizes a pinch gesture over a time period.


Instruction:
How would you implement a function in Python 3 that
layers Tree load snapshot operation.

Response:
def LayerTree_loadSnapshot(self, tiles):
		"""
		Function path: LayerTree.loadSnapshot
			Domain: LayerTree
			Method name: loadSnapshot

			Parameters:
				Required arguments:
					'tiles' (type: array) -> An array of tiles composing the snapshot.
			Returns:
				'snapshotId' (type: SnapshotId) -> The id of the snapshot.

			Description: Returns the snapshot identifier.
		"""
		assert isinstance(tiles, (list, tuple)
		    ), "Argument 'tiles' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    tiles)
		subdom_funcs = self.synchronous_command('LayerTree.loadSnapshot', tiles=tiles
		    )
		return subdom_funcs


Instruction:
How would you explain what the following Python 3 function does
def Tracing_recordClockSyncMarker(self, syncId):
		assert isinstance(syncId, (str,)
		    ), "Argument 'syncId' must be of type '['str']'. Received type: '%s'" % type(
		    syncId)
		subdom_funcs = self.synchronous_command('Tracing.recordClockSyncMarker',
		    syncId=syncId)
		return subdom_funcs

Response: Trace. recordClockSyncMarker - Record a clock sync marker in the trace.


Instruction:
Write a Python 3 function that can
function path: Animation.setPlaybackRate Domain: Animation Method name: setPlaybackRate Parameters: Required arguments: 'playbackRate' (type: number) -> Playback rate for animations on page No return value. Description: Sets the playback rate of the document timeline.

Response:
def Animation_setPlaybackRate(self, playbackRate):
		"""
		Function path: Animation.setPlaybackRate
			Domain: Animation
			Method name: setPlaybackRate

			Parameters:
				Required arguments:
					'playbackRate' (type: number) -> Playback rate for animations on page
			No return value.

			Description: Sets the playback rate of the document timeline.
		"""
		assert isinstance(playbackRate, (float, int)
		    ), "Argument 'playbackRate' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    playbackRate)
		subdom_funcs = self.synchronous_command('Animation.setPlaybackRate',
		    playbackRate=playbackRate)
		return subdom_funcs


Instruction:
Make a summary of the following Python 3 code
def Animation_getCurrentTime(self, id):
		assert isinstance(id, (str,)
		    ), "Argument 'id' must be of type '['str']'. Received type: '%s'" % type(
		    id)
		subdom_funcs = self.synchronous_command('Animation.getCurrentTime', id=id)
		return subdom_funcs

Response: Animation. getCurrentTime - Returns the current time of the animation.


Instruction:
Can you generate a brief explanation for the following Python 3 code
def Animation_setPaused(self, animations, paused):
		assert isinstance(animations, (list, tuple)
		    ), "Argument 'animations' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    animations)
		assert isinstance(paused, (bool,)
		    ), "Argument 'paused' must be of type '['bool']'. Received type: '%s'" % type(
		    paused)
		subdom_funcs = self.synchronous_command('Animation.setPaused', animations
		    =animations, paused=paused)
		return subdom_funcs

Response: This method is used to set the paused state of a set of animations.


Instruction:
Make a summary of the following Python 3 code
def Animation_setTiming(self, animationId, duration, delay):
		assert isinstance(animationId, (str,)
		    ), "Argument 'animationId' must be of type '['str']'. Received type: '%s'" % type(
		    animationId)
		assert isinstance(duration, (float, int)
		    ), "Argument 'duration' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    duration)
		assert isinstance(delay, (float, int)
		    ), "Argument 'delay' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    delay)
		subdom_funcs = self.synchronous_command('Animation.setTiming',
		    animationId=animationId, duration=duration, delay=delay)
		return subdom_funcs

Response: This method is used to set the timing of an animation node.


Instruction:
Here you have a function in Python 3, explain what it does
def Animation_seekAnimations(self, animations, currentTime):
		assert isinstance(animations, (list, tuple)
		    ), "Argument 'animations' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    animations)
		assert isinstance(currentTime, (float, int)
		    ), "Argument 'currentTime' must be of type '['float', 'int']'. Received type: '%s'" % type(
		    currentTime)
		subdom_funcs = self.synchronous_command('Animation.seekAnimations',
		    animations=animations, currentTime=currentTime)
		return subdom_funcs

Response: This method is used to seek an animation to a particular time.


Instruction:
How would you implement a function in Python 3 that
functions path: Animation.releaseAnimations Domain: Animation Method name: releaseAnimations Parameters: Required arguments: 'animations' (type: array) -> List of animation ids to seek. No return value. Description: Releases a set of animations to no longer be manipulated.

Response:
def Animation_releaseAnimations(self, animations):
		"""
		Function path: Animation.releaseAnimations
			Domain: Animation
			Method name: releaseAnimations

			Parameters:
				Required arguments:
					'animations' (type: array) -> List of animation ids to seek.
			No return value.

			Description: Releases a set of animations to no longer be manipulated.
		"""
		assert isinstance(animations, (list, tuple)
		    ), "Argument 'animations' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    animations)
		subdom_funcs = self.synchronous_command('Animation.releaseAnimations',
		    animations=animations)
		return subdom_funcs


Instruction:
Given the following Python 3 function, write the documentation
def Animation_resolveAnimation(self, animationId):
		assert isinstance(animationId, (str,)
		    ), "Argument 'animationId' must be of type '['str']'. Received type: '%s'" % type(
		    animationId)
		subdom_funcs = self.synchronous_command('Animation.resolveAnimation',
		    animationId=animationId)
		return subdom_funcs

Response: This method returns the remote object of the Animation with the given id.


Instruction:
Here you have a function in Python 3, explain what it does
def Storage_clearDataForOrigin(self, origin, storageTypes):
		assert isinstance(origin, (str,)
		    ), "Argument 'origin' must be of type '['str']'. Received type: '%s'" % type(
		    origin)
		assert isinstance(storageTypes, (str,)
		    ), "Argument 'storageTypes' must be of type '['str']'. Received type: '%s'" % type(
		    storageTypes)
		subdom_funcs = self.synchronous_command('Storage.clearDataForOrigin',
		    origin=origin, storageTypes=storageTypes)
		return subdom_funcs

Response: This method clears storage for the specified origin.


Instruction:
How would you explain what the following Python 3 function does
def Storage_getUsageAndQuota(self, origin):
		assert isinstance(origin, (str,)
		    ), "Argument 'origin' must be of type '['str']'. Received type: '%s'" % type(
		    origin)
		subdom_funcs = self.synchronous_command('Storage.getUsageAndQuota',
		    origin=origin)
		return subdom_funcs

Response: This method returns the usage and quota in bytes.


Instruction:
Make a summary of the following Python 3 code
def Storage_trackCacheStorageForOrigin(self, origin):
		assert isinstance(origin, (str,)
		    ), "Argument 'origin' must be of type '['str']'. Received type: '%s'" % type(
		    origin)
		subdom_funcs = self.synchronous_command('Storage.trackCacheStorageForOrigin',
		    origin=origin)
		return subdom_funcs

Response: This method is used to track the state of a cache storage list for a given origin.


Instruction:
Explain what the following Python 3 code does
def Storage_untrackCacheStorageForOrigin(self, origin):
		assert isinstance(origin, (str,)
		    ), "Argument 'origin' must be of type '['str']'. Received type: '%s'" % type(
		    origin)
		subdom_funcs = self.synchronous_command(
		    'Storage.untrackCacheStorageForOrigin', origin=origin)
		return subdom_funcs

Response: This method unregisters a cache storage origin from receiving notifications for cache storage.


Instruction:
Write a Python 3 script for
functioning path: Log.startViolationsReport Domain: Log Method name: startViolationsReport Parameters: Required arguments: 'config' (type: array) -> Configuration for violations. No return value. Description: start violation reporting.

Response:
def Log_startViolationsReport(self, config):
		"""
		Function path: Log.startViolationsReport
			Domain: Log
			Method name: startViolationsReport

			Parameters:
				Required arguments:
					'config' (type: array) -> Configuration for violations.
			No return value.

			Description: start violation reporting.
		"""
		assert isinstance(config, (list, tuple)
		    ), "Argument 'config' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    config)
		subdom_funcs = self.synchronous_command('Log.startViolationsReport',
		    config=config)
		return subdom_funcs


Instruction:
Write a Python 3 function for
functioning path: Tethering.bind Domain: Tethering Method name: bind Parameters: Required arguments: 'port' (type: integer) -> Port number to bind. No return value. Description: Request browser port binding.

Response:
def Tethering_bind(self, port):
		"""
		Function path: Tethering.bind
			Domain: Tethering
			Method name: bind

			Parameters:
				Required arguments:
					'port' (type: integer) -> Port number to bind.
			No return value.

			Description: Request browser port binding.
		"""
		assert isinstance(port, (int,)
		    ), "Argument 'port' must be of type '['int']'. Received type: '%s'" % type(
		    port)
		subdom_funcs = self.synchronous_command('Tethering.bind', port=port)
		return subdom_funcs


Instruction:
Implement a Python 3 function for
functioning path: Tethering.unbind Domain: Tethering Method name: unbind Parameters: Required arguments: 'port' (type: integer) -> Port number to unbind. No return value. Description: Request browser port unbinding.

Response:
def Tethering_unbind(self, port):
		"""
		Function path: Tethering.unbind
			Domain: Tethering
			Method name: unbind

			Parameters:
				Required arguments:
					'port' (type: integer) -> Port number to unbind.
			No return value.

			Description: Request browser port unbinding.
		"""
		assert isinstance(port, (int,)
		    ), "Argument 'port' must be of type '['int']'. Received type: '%s'" % type(
		    port)
		subdom_funcs = self.synchronous_command('Tethering.unbind', port=port)
		return subdom_funcs


Instruction:
Can you write a function in Python 3 where it
functions path: Browser.setWindowBounds Domain: Browser Method name: setWindowBounds Parameters: Required arguments: 'windowId' (type: WindowID) -> Browser window id. 'bounds' (type: Bounds) -> New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged. No return value. Description: Set position and/or size of the browser window.

Response:
def Browser_setWindowBounds(self, windowId, bounds):
		"""
		Function path: Browser.setWindowBounds
			Domain: Browser
			Method name: setWindowBounds

			Parameters:
				Required arguments:
					'windowId' (type: WindowID) -> Browser window id.
					'bounds' (type: Bounds) -> New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.
			No return value.

			Description: Set position and/or size of the browser window.
		"""
		subdom_funcs = self.synchronous_command('Browser.setWindowBounds',
		    windowId=windowId, bounds=bounds)
		return subdom_funcs


Instruction:
How would you code a function in Python 3 to
function path: Runtime.evaluate Domain: Runtime Method name: evaluate Parameters: Required arguments: 'expression' (type: string) -> Expression to evaluate. Optional arguments: 'objectGroup' (type: string) -> Symbolic group name that can be used to release multiple objects. 'includeCommandLineAPI' (type: boolean) -> Determines whether Command Line API should be available during the evaluation. 'silent' (type: boolean) -> In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. 'contextId' (type: ExecutionContextId) -> Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. 'returnByValue' (type: boolean) -> Whether the result is expected to be a JSON object that should be sent by value. 'generatePreview' (type: boolean) -> Whether preview should be generated for the result. 'userGesture' (type: boolean) -> Whether execution should be treated as initiated by user in the UI. 'awaitPromise' (type: boolean) -> Whether execution should await for resulting value and return once awaited promise is resolved. Returns: 'result' (type: RemoteObject) -> Evaluation result. 'exceptionDetails' (type: ExceptionDetails) -> Exception details. Description: Evaluates expression on global object.

Response:
def Runtime_evaluate(self, expression, **kwargs):
		"""
		Function path: Runtime.evaluate
			Domain: Runtime
			Method name: evaluate

			Parameters:
				Required arguments:
					'expression' (type: string) -> Expression to evaluate.
				Optional arguments:
					'objectGroup' (type: string) -> Symbolic group name that can be used to release multiple objects.
					'includeCommandLineAPI' (type: boolean) -> Determines whether Command Line API should be available during the evaluation.
					'silent' (type: boolean) -> In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
					'contextId' (type: ExecutionContextId) -> Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
					'returnByValue' (type: boolean) -> Whether the result is expected to be a JSON object that should be sent by value.
					'generatePreview' (type: boolean) -> Whether preview should be generated for the result.
					'userGesture' (type: boolean) -> Whether execution should be treated as initiated by user in the UI.
					'awaitPromise' (type: boolean) -> Whether execution should await for resulting value and return once awaited promise is resolved.
			Returns:
				'result' (type: RemoteObject) -> Evaluation result.
				'exceptionDetails' (type: ExceptionDetails) -> Exception details.

			Description: Evaluates expression on global object.
		"""
		assert isinstance(expression, (str,)
		    ), "Argument 'expression' must be of type '['str']'. Received type: '%s'" % type(
		    expression)
		if 'objectGroup' in kwargs:
			assert isinstance(kwargs['objectGroup'], (str,)
			    ), "Optional argument 'objectGroup' must be of type '['str']'. Received type: '%s'" % type(
			    kwargs['objectGroup'])
		if 'includeCommandLineAPI' in kwargs:
			assert isinstance(kwargs['includeCommandLineAPI'], (bool,)
			    ), "Optional argument 'includeCommandLineAPI' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['includeCommandLineAPI'])
		if 'silent' in kwargs:
			assert isinstance(kwargs['silent'], (bool,)
			    ), "Optional argument 'silent' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['silent'])
		if 'returnByValue' in kwargs:
			assert isinstance(kwargs['returnByValue'], (bool,)
			    ), "Optional argument 'returnByValue' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['returnByValue'])
		if 'generatePreview' in kwargs:
			assert isinstance(kwargs['generatePreview'], (bool,)
			    ), "Optional argument 'generatePreview' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['generatePreview'])
		if 'userGesture' in kwargs:
			assert isinstance(kwargs['userGesture'], (bool,)
			    ), "Optional argument 'userGesture' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['userGesture'])
		if 'awaitPromise' in kwargs:
			assert isinstance(kwargs['awaitPromise'], (bool,)
			    ), "Optional argument 'awaitPromise' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['awaitPromise'])
		expected = ['objectGroup', 'includeCommandLineAPI', 'silent', 'contextId',
		    'returnByValue', 'generatePreview', 'userGesture', 'awaitPromise']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['objectGroup', 'includeCommandLineAPI', 'silent', 'contextId', 'returnByValue', 'generatePreview', 'userGesture', 'awaitPromise']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Runtime.evaluate', expression=
		    expression, **kwargs)
		return subdom_funcs


Instruction:
Implement a function in Python 3 to
function path: Runtime.callFunctionOn Domain: Runtime Method name: callFunctionOn Parameters: Required arguments: 'functionDeclaration' (type: string) -> Declaration of the function to call. Optional arguments: 'objectId' (type: RemoteObjectId) -> Identifier of the object to call function on. Either objectId or executionContextId should be specified. 'arguments' (type: array) -> Call arguments. All call arguments must belong to the same JavaScript world as the target object. 'silent' (type: boolean) -> In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. 'returnByValue' (type: boolean) -> Whether the result is expected to be a JSON object which should be sent by value. 'generatePreview' (type: boolean) -> Whether preview should be generated for the result. 'userGesture' (type: boolean) -> Whether execution should be treated as initiated by user in the UI. 'awaitPromise' (type: boolean) -> Whether execution should await for resulting value and return once awaited promise is resolved. 'executionContextId' (type: ExecutionContextId) -> Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. 'objectGroup' (type: string) -> Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. Returns: 'result' (type: RemoteObject) -> Call result. 'exceptionDetails' (type: ExceptionDetails) -> Exception details. Description: Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

Response:
def Runtime_callFunctionOn(self, functionDeclaration, **kwargs):
		"""
		Function path: Runtime.callFunctionOn
			Domain: Runtime
			Method name: callFunctionOn

			Parameters:
				Required arguments:
					'functionDeclaration' (type: string) -> Declaration of the function to call.
				Optional arguments:
					'objectId' (type: RemoteObjectId) -> Identifier of the object to call function on. Either objectId or executionContextId should be specified.
					'arguments' (type: array) -> Call arguments. All call arguments must belong to the same JavaScript world as the target object.
					'silent' (type: boolean) -> In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
					'returnByValue' (type: boolean) -> Whether the result is expected to be a JSON object which should be sent by value.
					'generatePreview' (type: boolean) -> Whether preview should be generated for the result.
					'userGesture' (type: boolean) -> Whether execution should be treated as initiated by user in the UI.
					'awaitPromise' (type: boolean) -> Whether execution should await for resulting value and return once awaited promise is resolved.
					'executionContextId' (type: ExecutionContextId) -> Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
					'objectGroup' (type: string) -> Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.
			Returns:
				'result' (type: RemoteObject) -> Call result.
				'exceptionDetails' (type: ExceptionDetails) -> Exception details.

			Description: Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
		"""
		assert isinstance(functionDeclaration, (str,)
		    ), "Argument 'functionDeclaration' must be of type '['str']'. Received type: '%s'" % type(
		    functionDeclaration)
		if 'arguments' in kwargs:
			assert isinstance(kwargs['arguments'], (list, tuple)
			    ), "Optional argument 'arguments' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
			    kwargs['arguments'])
		if 'silent' in kwargs:
			assert isinstance(kwargs['silent'], (bool,)
			    ), "Optional argument 'silent' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['silent'])
		if 'returnByValue' in kwargs:
			assert isinstance(kwargs['returnByValue'], (bool,)
			    ), "Optional argument 'returnByValue' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['returnByValue'])
		if 'generatePreview' in kwargs:
			assert isinstance(kwargs['generatePreview'], (bool,)
			    ), "Optional argument 'generatePreview' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['generatePreview'])
		if 'userGesture' in kwargs:
			assert isinstance(kwargs['userGesture'], (bool,)
			    ), "Optional argument 'userGesture' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['userGesture'])
		if 'awaitPromise' in kwargs:
			assert isinstance(kwargs['awaitPromise'], (bool,)
			    ), "Optional argument 'awaitPromise' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['awaitPromise'])
		if 'objectGroup' in kwargs:
			assert isinstance(kwargs['objectGroup'], (str,)
			    ), "Optional argument 'objectGroup' must be of type '['str']'. Received type: '%s'" % type(
			    kwargs['objectGroup'])
		expected = ['objectId', 'arguments', 'silent', 'returnByValue',
		    'generatePreview', 'userGesture', 'awaitPromise',
		    'executionContextId', 'objectGroup']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['objectId', 'arguments', 'silent', 'returnByValue', 'generatePreview', 'userGesture', 'awaitPromise', 'executionContextId', 'objectGroup']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Runtime.callFunctionOn',
		    functionDeclaration=functionDeclaration, **kwargs)
		return subdom_funcs


Instruction:
Can you create a Python 3 function that
functions path: Runtime.releaseObjectGroup Domain: Runtime Method name: releaseObjectGroup Parameters: Required arguments: 'objectGroup' (type: string) -> Symbolic object group name. No return value. Description: Releases all remote objects that belong to a given group.

Response:
def Runtime_releaseObjectGroup(self, objectGroup):
		"""
		Function path: Runtime.releaseObjectGroup
			Domain: Runtime
			Method name: releaseObjectGroup

			Parameters:
				Required arguments:
					'objectGroup' (type: string) -> Symbolic object group name.
			No return value.

			Description: Releases all remote objects that belong to a given group.
		"""
		assert isinstance(objectGroup, (str,)
		    ), "Argument 'objectGroup' must be of type '['str']'. Received type: '%s'" % type(
		    objectGroup)
		subdom_funcs = self.synchronous_command('Runtime.releaseObjectGroup',
		    objectGroup=objectGroup)
		return subdom_funcs


Instruction:
Write a Python 3 script to
function path: Runtime.setCustomObjectFormatterEnabled Domain: Runtime Method name: setCustomObjectFormatterEnabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'enabled' (type: boolean) -> No description No return value.

Response:
def Runtime_setCustomObjectFormatterEnabled(self, enabled):
		"""
		Function path: Runtime.setCustomObjectFormatterEnabled
			Domain: Runtime
			Method name: setCustomObjectFormatterEnabled

			WARNING: This function is marked 'Experimental'!

			Parameters:
				Required arguments:
					'enabled' (type: boolean) -> No description
			No return value.

		"""
		assert isinstance(enabled, (bool,)
		    ), "Argument 'enabled' must be of type '['bool']'. Received type: '%s'" % type(
		    enabled)
		subdom_funcs = self.synchronous_command(
		    'Runtime.setCustomObjectFormatterEnabled', enabled=enabled)
		return subdom_funcs


Instruction:
Explain what the following Python 3 code does
def Runtime_compileScript(self, expression, sourceURL, persistScript, **kwargs
	    ):
		"""
		Function path: Runtime.compileScript
			Domain: Runtime
			Method name: compileScript

			Parameters:
				Required arguments:
					'expression' (type: string) -> Expression to compile.
					'sourceURL' (type: string) -> Source url to be set for the script.
					'persistScript' (type: boolean) -> Specifies whether the compiled script should be persisted.
				Optional arguments:
					'executionContextId' (type: ExecutionContextId) -> Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
			Returns:
				'scriptId' (type: ScriptId) -> Id of the script.
				'exceptionDetails' (type: ExceptionDetails) -> Exception details.

			Description: Compiles expression.
		"""
		assert isinstance(expression, (str,)
		    ), "Argument 'expression' must be of type '['str']'. Received type: '%s'" % type(
		    expression)
		assert isinstance(sourceURL, (str,)
		    ), "Argument 'sourceURL' must be of type '['str']'. Received type: '%s'" % type(
		    sourceURL)
		assert isinstance(persistScript, (bool,)
		    ), "Argument 'persistScript' must be of type '['bool']'. Received type: '%s'" % type(
		    persistScript)
		expected = ['executionContextId']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['executionContextId']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Runtime.compileScript',
		    expression=expression, sourceURL=sourceURL, persistScript=
		    persistScript, **kwargs)
		return subdom_funcs

Response: Runtime. compileScript - Executes a script.


Instruction:
Can you generate the documentation for the following Python 3 function
def Runtime_runScript(self, scriptId, **kwargs):
		if 'objectGroup' in kwargs:
			assert isinstance(kwargs['objectGroup'], (str,)
			    ), "Optional argument 'objectGroup' must be of type '['str']'. Received type: '%s'" % type(
			    kwargs['objectGroup'])
		if 'silent' in kwargs:
			assert isinstance(kwargs['silent'], (bool,)
			    ), "Optional argument 'silent' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['silent'])
		if 'includeCommandLineAPI' in kwargs:
			assert isinstance(kwargs['includeCommandLineAPI'], (bool,)
			    ), "Optional argument 'includeCommandLineAPI' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['includeCommandLineAPI'])
		if 'returnByValue' in kwargs:
			assert isinstance(kwargs['returnByValue'], (bool,)
			    ), "Optional argument 'returnByValue' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['returnByValue'])
		if 'generatePreview' in kwargs:
			assert isinstance(kwargs['generatePreview'], (bool,)
			    ), "Optional argument 'generatePreview' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['generatePreview'])
		if 'awaitPromise' in kwargs:
			assert isinstance(kwargs['awaitPromise'], (bool,)
			    ), "Optional argument 'awaitPromise' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['awaitPromise'])
		expected = ['executionContextId', 'objectGroup', 'silent',
		    'includeCommandLineAPI', 'returnByValue', 'generatePreview',
		    'awaitPromise']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['executionContextId', 'objectGroup', 'silent', 'includeCommandLineAPI', 'returnByValue', 'generatePreview', 'awaitPromise']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Runtime.runScript', scriptId=
		    scriptId, **kwargs)
		return subdom_funcs

Response: Runtime. runScript - Runs a script in a given context.


Instruction:
Can you generate a brief explanation for the following Python 3 code
def Debugger_setBreakpointsActive(self, active):
		assert isinstance(active, (bool,)
		    ), "Argument 'active' must be of type '['bool']'. Received type: '%s'" % type(
		    active)
		subdom_funcs = self.synchronous_command('Debugger.setBreakpointsActive',
		    active=active)
		return subdom_funcs

Response: This method is used to set the active state of all breakpoints on the page.


Instruction:
Explain what the following Python 3 code does
def Debugger_setSkipAllPauses(self, skip):
		assert isinstance(skip, (bool,)
		    ), "Argument 'skip' must be of type '['bool']'. Received type: '%s'" % type(
		    skip)
		subdom_funcs = self.synchronous_command('Debugger.setSkipAllPauses', skip
		    =skip)
		return subdom_funcs

Response: This method is used to set the skip pauses of all pages.


Instruction:
How would you implement a function in Python 3 that
functions path: Debugger.setScriptSource Domain: Debugger Method name: setScriptSource Parameters: Required arguments: 'scriptId' (type: Runtime.ScriptId) -> Id of the script to edit. 'scriptSource' (type: string) -> New content of the script. Optional arguments: 'dryRun' (type: boolean) -> If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. Returns: 'callFrames' (type: array) -> New stack trace in case editing has happened while VM was stopped. 'stackChanged' (type: boolean) -> Whether current call stack was modified after applying the changes. 'asyncStackTrace' (type: Runtime.StackTrace) -> Async stack trace, if any. 'exceptionDetails' (type: Runtime.ExceptionDetails) -> Exception details if any. Description: Edits JavaScript source live.

Response:
def Debugger_setScriptSource(self, scriptId, scriptSource, **kwargs):
		"""
		Function path: Debugger.setScriptSource
			Domain: Debugger
			Method name: setScriptSource

			Parameters:
				Required arguments:
					'scriptId' (type: Runtime.ScriptId) -> Id of the script to edit.
					'scriptSource' (type: string) -> New content of the script.
				Optional arguments:
					'dryRun' (type: boolean) ->  If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
			Returns:
				'callFrames' (type: array) -> New stack trace in case editing has happened while VM was stopped.
				'stackChanged' (type: boolean) -> Whether current call stack  was modified after applying the changes.
				'asyncStackTrace' (type: Runtime.StackTrace) -> Async stack trace, if any.
				'exceptionDetails' (type: Runtime.ExceptionDetails) -> Exception details if any.

			Description: Edits JavaScript source live.
		"""
		assert isinstance(scriptSource, (str,)
		    ), "Argument 'scriptSource' must be of type '['str']'. Received type: '%s'" % type(
		    scriptSource)
		if 'dryRun' in kwargs:
			assert isinstance(kwargs['dryRun'], (bool,)
			    ), "Optional argument 'dryRun' must be of type '['bool']'. Received type: '%s'" % type(
			    kwargs['dryRun'])
		expected = ['dryRun']
		passed_keys = list(kwargs.keys())
		assert all([(key in expected) for key in passed_keys]
		    ), "Allowed kwargs are ['dryRun']. Passed kwargs: %s" % passed_keys
		subdom_funcs = self.synchronous_command('Debugger.setScriptSource',
		    scriptId=scriptId, scriptSource=scriptSource, **kwargs)
		return subdom_funcs


Instruction:
How would you implement a function in Python 3 that
functions path: Debugger.setPauseOnExceptions Domain: Debugger Method name: setPauseOnExceptions Parameters: Required arguments: 'state' (type: string) -> Pause on exceptions mode. No return value. Description: Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none.

Response:
def Debugger_setPauseOnExceptions(self, state):
		"""
		Function path: Debugger.setPauseOnExceptions
			Domain: Debugger
			Method name: setPauseOnExceptions

			Parameters:
				Required arguments:
					'state' (type: string) -> Pause on exceptions mode.
			No return value.

			Description: Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none.
		"""
		assert isinstance(state, (str,)
		    ), "Argument 'state' must be of type '['str']'. Received type: '%s'" % type(
		    state)
		subdom_funcs = self.synchronous_command('Debugger.setPauseOnExceptions',
		    state=state)
		return subdom_funcs


Instruction:
Create a Python 3 function to
function path: Debugger.setVariableValue Domain: Debugger Method name: setVariableValue Parameters: Required arguments: 'scopeNumber' (type: integer) -> 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. 'variableName' (type: string) -> Variable name. 'newValue' (type: Runtime.CallArgument) -> New variable value. 'callFrameId' (type: CallFrameId) -> Id of callframe that holds variable. No return value. Description: Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.

Response:
def Debugger_setVariableValue(self, scopeNumber, variableName, newValue,
	    callFrameId):
		"""
		Function path: Debugger.setVariableValue
			Domain: Debugger
			Method name: setVariableValue

			Parameters:
				Required arguments:
					'scopeNumber' (type: integer) -> 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
					'variableName' (type: string) -> Variable name.
					'newValue' (type: Runtime.CallArgument) -> New variable value.
					'callFrameId' (type: CallFrameId) -> Id of callframe that holds variable.
			No return value.

			Description: Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
		"""
		assert isinstance(scopeNumber, (int,)
		    ), "Argument 'scopeNumber' must be of type '['int']'. Received type: '%s'" % type(
		    scopeNumber)
		assert isinstance(variableName, (str,)
		    ), "Argument 'variableName' must be of type '['str']'. Received type: '%s'" % type(
		    variableName)
		subdom_funcs = self.synchronous_command('Debugger.setVariableValue',
		    scopeNumber=scopeNumber, variableName=variableName, newValue=newValue,
		    callFrameId=callFrameId)
		return subdom_funcs


Instruction:
Write a Python 3 script to
function path: Debugger.setAsyncCallStackDepth Domain: Debugger Method name: setAsyncCallStackDepth Parameters: Required arguments: 'maxDepth' (type: integer) -> Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). No return value. Description: Enables or disables async call stacks tracking.

Response:
def Debugger_setAsyncCallStackDepth(self, maxDepth):
		"""
		Function path: Debugger.setAsyncCallStackDepth
			Domain: Debugger
			Method name: setAsyncCallStackDepth

			Parameters:
				Required arguments:
					'maxDepth' (type: integer) -> Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default).
			No return value.

			Description: Enables or disables async call stacks tracking.
		"""
		assert isinstance(maxDepth, (int,)
		    ), "Argument 'maxDepth' must be of type '['int']'. Received type: '%s'" % type(
		    maxDepth)
		subdom_funcs = self.synchronous_command('Debugger.setAsyncCallStackDepth',
		    maxDepth=maxDepth)
		return subdom_funcs


Instruction:
Given the following Python 3 function, write the documentation
def Debugger_setBlackboxPatterns(self, patterns):
		assert isinstance(patterns, (list, tuple)
		    ), "Argument 'patterns' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    patterns)
		subdom_funcs = self.synchronous_command('Debugger.setBlackboxPatterns',
		    patterns=patterns)
		return subdom_funcs

Response: This function is used to set patterns in the script url for blackboxing.


Instruction:
How would you explain what the following Python 3 function does
def Debugger_setBlackboxedRanges(self, scriptId, positions):
		assert isinstance(positions, (list, tuple)
		    ), "Argument 'positions' must be of type '['list', 'tuple']'. Received type: '%s'" % type(
		    positions)
		subdom_funcs = self.synchronous_command('Debugger.setBlackboxedRanges',
		    scriptId=scriptId, positions=positions)
		return subdom_funcs

Response: This method is used to set blackboxed ranges in a script.


Instruction:
How would you explain what the following Python 3 function does
def Profiler_setSamplingInterval(self, interval):
		assert isinstance(interval, (int,)
		    ), "Argument 'interval' must be of type '['int']'. Received type: '%s'" % type(
		    interval)
		subdom_funcs = self.synchronous_command('Profiler.setSamplingInterval',
		    interval=interval)
		return subdom_funcs

Response: This method is used to change CPU profiler sampling interval in microseconds.


Instruction:
Implement a function in Python 3 to
give a set of headers, update both the user-agent and additional headers for the remote browser. header_args must be a dict. Keys are the names of the corresponding HTTP header. return value is a 2-tuple of the results of the user-agent update, as well as the extra headers update. If no 'User-Agent' key is present in the new headers, the first item in the tuple will be None

Response:
def update_headers(self, header_args):
		'''
		Given a set of headers, update both the user-agent
		and additional headers for the remote browser.

		header_args must be a dict. Keys are the names of
		the corresponding HTTP header.

		return value is a 2-tuple of the results of the user-agent
		update, as well as the extra headers update.
		If no 'User-Agent' key is present in the new headers,
		the first item in the tuple will be None

		'''
		assert isinstance(header_args, dict), "header_args must be a dict, passed type was %s" \
			% (type(header_args), )

		ua = header_args.pop('User-Agent', None)
		ret_1 = None
		if ua:
			ret_1 = self.Network_setUserAgentOverride(userAgent=ua)

		ret_2 = self.Network_setExtraHTTPHeaders(headers = header_args)

		return (ret_1, ret_2)


Instruction:
Can you tell what is the following Python 3 function doing
def get_cookies(self):
		'''
		Retreive the cookies from the remote browser.

		Return value is a list of http.cookiejar.Cookie() instances.
		These can be directly used with the various http.cookiejar.XXXCookieJar
		cookie management classes.
		'''
		ret = self.Network_getAllCookies()

		assert 'result' in ret, "No return value in function response!"
		assert 'cookies' in ret['result'], "No 'cookies' key in function response"

		cookies = []
		for raw_cookie in ret['result']['cookies']:

			# Chromium seems to support the following key values for the cookie dict:
			# 	"name"
			# 	"value"
			# 	"domain"
			# 	"path"
			# 	"expires"
			# 	"httpOnly"
			# 	"session"
			# 	"secure"
			#
			#  This seems supported by the fact that the underlying chromium cookie implementation has
			#  the following members:
			#        std::string name_;
			#        std::string value_;
			#        std::string domain_;
			#        std::string path_;
			#        base::Time creation_date_;
			#        base::Time expiry_date_;
			#        base::Time last_access_date_;
			#        bool secure_;
			#        bool httponly_;
			#        CookieSameSite same_site_;
			#        CookiePriority priority_;
			#
			# See chromium/net/cookies/canonical_cookie.h for more.
			#
			# I suspect the python cookie implementation is derived exactly from the standard, while the
			# chromium implementation is more of a practically derived structure.

			# Network.setCookie

			baked_cookie = http.cookiejar.Cookie(
					# We assume V0 cookies, principally because I don't think I've /ever/ actually encountered a V1 cookie.
					# Chromium doesn't seem to specify it.
					version            = 0,

					name               = raw_cookie['name'],
					value              = raw_cookie['value'],
					port               = None,
					port_specified     = False,
					domain             = raw_cookie['domain'],
					domain_specified   = True,
					domain_initial_dot = False,
					path               = raw_cookie['path'],
					path_specified     = False,
					secure             = raw_cookie['secure'],
					expires            = raw_cookie['expires'],
					discard            = raw_cookie['session'],
					comment            = None,
					comment_url        = None,
					rest               = {"httponly":"%s" % raw_cookie['httpOnly']},
					rfc2109            = False
				)
			cookies.append(baked_cookie)

		return cookies

Response: Return the cookies from the remote browser.


Instruction:
Write a Python 3 script for
setting a cookie on the remote chromium instance.

Response:
def set_cookie(self, cookie):
		'''
		Add a cookie to the remote chromium instance.

		Passed value `cookie` must be an instance of `http.cookiejar.Cookie()`.
		'''

		# Function path: Network.setCookie
		# Domain: Network
		# Method name: setCookie
		# WARNING: This function is marked 'Experimental'!
		# Parameters:
		#         Required arguments:
		#                 'url' (type: string) -> The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
		#                 'name' (type: string) -> The name of the cookie.
		#                 'value' (type: string) -> The value of the cookie.
		#         Optional arguments:
		#                 'domain' (type: string) -> If omitted, the cookie becomes a host-only cookie.
		#                 'path' (type: string) -> Defaults to the path portion of the url parameter.
		#                 'secure' (type: boolean) -> Defaults ot false.
		#                 'httpOnly' (type: boolean) -> Defaults to false.
		#                 'sameSite' (type: CookieSameSite) -> Defaults to browser default behavior.
		#                 'expirationDate' (type: Timestamp) -> If omitted, the cookie becomes a session cookie.
		# Returns:
		#         'success' (type: boolean) -> True if successfully set cookie.

		# Description: Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

		assert isinstance(cookie, http.cookiejar.Cookie), 'The value passed to `set_cookie` must be an instance of http.cookiejar.Cookie().' + \
			' Passed: %s ("%s").' % (type(cookie), cookie)

		# Yeah, the cookielib stores this attribute as a string, despite it containing a
		# boolean value. No idea why.
		is_http_only = str(cookie.get_nonstandard_attr('httponly', 'False')).lower() == "true"

		# I'm unclear what the "url" field is actually for. A cookie only needs the domain and
		# path component to be fully defined. Considering the API apparently allows the domain and
		# path parameters to be unset, I think it forms a partially redundant, with some
		# strange interactions with mode-changing between host-only and more general
		# cookies depending on what's set where.
		# Anyways, given we need a URL for the API to work properly, we produce a fake
		# host url by building it out of the relevant cookie properties.
		fake_url = urllib.parse.urlunsplit((
				"http" if is_http_only else "https",  # Scheme
				cookie.domain,                        # netloc
				cookie.path,                          # path
				'',                                   # query
				'',                                   # fragment
			))

		params = {
				'url'      : fake_url,

				'name'     : cookie.name,
				'value'    : cookie.value if cookie.value else "",
				'domain'   : cookie.domain,
				'path'     : cookie.path,
				'secure'   : cookie.secure,
				'expires'  : float(cookie.expires) if cookie.expires else float(2**32),

				'httpOnly' : is_http_only,

				# The "sameSite" flag appears to be a chromium-only extension for controlling
				# cookie sending in non-first-party contexts. See:
				# https://bugs.chromium.org/p/chromium/issues/detail?id=459154
				# Anyways, we just use the default here, whatever that is.
				# sameSite       = cookie.xxx
			}

		ret = self.Network_setCookie(**params)

		return ret


Instruction:
Write a Python 3 function for
getting the URL of the current window.

Response:
def get_current_url(self):
		'''
		Probe the remote session for the current window URL.

		This is primarily used to do things like unwrap redirects,
		or circumvent outbound url wrappers.

		'''
		res = self.Page_getNavigationHistory()
		assert 'result' in res
		assert 'currentIndex' in res['result']
		assert 'entries' in res['result']

		return res['result']['entries'][res['result']['currentIndex']]['url']


Instruction:
Can you create a Python 3 function that
gets the title and current url from the remote session.

Response:
def get_page_url_title(self):
		'''
		Get the title and current url from the remote session.

		Return is a 2-tuple: (page_title, page_url).

		'''

		cr_tab_id = self.transport._get_cr_tab_meta_for_key(self.tab_id)['id']
		targets = self.Target_getTargets()

		assert 'result' in targets
		assert 'targetInfos' in targets['result']

		for tgt in targets['result']['targetInfos']:
			if tgt['targetId'] == cr_tab_id:
				# {
				# 	'title': 'Page Title 1',
				# 	'targetId': '9d2c503c-e39e-42cc-b950-96db073918ee',
				# 	'attached': True,
				# 	'url': 'http://localhost:47181/with_title_1',
				# 	'type': 'page'
				# }

				title   = tgt['title']
				cur_url = tgt['url']
				return title, cur_url


Instruction:
Create a Python 3 function for
executing a javascript string in the context of the browser tab.

Response:
def execute_javascript(self, *args, **kwargs):
		'''
		Execute a javascript string in the context of the browser tab.
		'''

		ret = self.__exec_js(*args, **kwargs)
		return ret


Instruction:
Can you generate the documentation for the following Python 3 function
def find_element(self, search):

		'''
		DOM_performSearch(self, query, includeUserAgentShadowDOM)
		Python Function: DOM_performSearch
		        Domain: DOM
		        Method name: performSearch

		        WARNING: This function is marked 'Experimental'!

		        Parameters:
		                'query' (type: string) -> Plain text or query selector or XPath search query.
		                'includeUserAgentShadowDOM' (type: boolean) -> True to search in user agent shadow DOM.
		        Returns:
		                'searchId' (type: string) -> Unique search session identifier.
		                'resultCount' (type: integer) -> Number of search results.
		        Description: Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.

		Python Function: DOM_getSearchResults
		        Domain: DOM
		        Method name: getSearchResults

		        WARNING: This function is marked 'Experimental'!

		        Parameters:
		                'searchId' (type: string) -> Unique search session identifier.
		                'fromIndex' (type: integer) -> Start index of the search result to be returned.
		                'toIndex' (type: integer) -> End index of the search result to be returned.
		        Returns:
		                'nodeIds' (type: array) -> Ids of the search result nodes.
		        Description: Returns search results from given fromIndex to given toIndex from the sarch with the given identifier.

		DOM_discardSearchResults(self, searchId)
		Python Function: DOM_discardSearchResults
		        Domain: DOM
		        Method name: discardSearchResults

		        WARNING: This function is marked 'Experimental'!

		        Parameters:
		                'searchId' (type: string) -> Unique search session identifier.
		        No return value.
		        Description: Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
		'''

		res = self.DOM_performSearch(search, includeUserAgentShadowDOM=False)
		assert 'result' in res
		assert 'searchId' in res['result']
		searchid = res['result']['searchId']
		res_cnt  = res['result']['resultCount']
		self.log.debug("%s", res)
		self.log.debug("%s", searchid)

		if res_cnt == 0:
			return None

		items = self.DOM_getSearchResults(searchId=searchid, fromIndex=0, toIndex=res_cnt)

		self.log.debug("Results:")
		self.log.debug("%s", items)

Response: This method searches the DOM tree for a given search string.


Instruction:
Write a Python 3 function for
getting the response body from Network_getResponseBody and return it as a dict.

Response:
def get_unpacked_response_body(self, requestId, mimetype="application/unknown"):
		'''
		Return a unpacked, decoded resposne body from Network_getResponseBody()
		'''
		content = self.Network_getResponseBody(requestId)

		assert 'result' in content
		result = content['result']

		assert 'base64Encoded' in result
		assert 'body' in result

		if result['base64Encoded']:
			content = base64.b64decode(result['body'])
		else:
			content = result['body']

		self.log.info("Navigate complete. Received %s byte response with type %s.", len(content), mimetype)

		return {'binary' : result['base64Encoded'],  'mimetype' : mimetype, 'content' : content}


Instruction:
Can you generate a brief explanation for the following Python 3 code
def handle_page_location_changed(self, timeout=None):
		'''
		If the chrome tab has internally redirected (generally because jerberscript), this
		will walk the page navigation responses and attempt to fetch the response body for
		the tab's latest location.
		'''

		# In general, this is often called after other mechanisms have confirmed
		# that the tab has already navigated. As such, we want to not wait a while
		# to discover something went wrong, so use a timeout that basically just
		# results in checking the available buffer, and nothing else.
		if not timeout:
			timeout = 0.1

		self.log.debug("We may have redirected. Checking.")

		messages = self.transport.recv_all_filtered(filter_funcs.capture_loading_events, tab_key=self.tab_id)
		if not messages:
			raise ChromeError("Couldn't track redirect! No idea what to do!")

		last_message = messages[-1]
		self.log.info("Probably a redirect! New content url: '%s'", last_message['params']['documentURL'])

		resp = self.transport.recv_filtered(filter_funcs.network_response_recieved_for_url(last_message['params']['documentURL'], last_message['params']['frameId']), tab_key=self.tab_id)
		resp = resp['params']

		ctype = 'application/unknown'

		resp_response = resp['response']

		if 'mimeType' in resp_response:
			ctype = resp_response['mimeType']
		if 'headers' in resp_response and 'content-type' in resp_response['headers']:
			ctype = resp_response['headers']['content-type'].split(";")[0]

		# We assume the last document request was the redirect.
		# This is /probably/ kind of a poor practice, but what the hell.
		# I have no idea what this would do if there are non-html documents (or if that can even happen.)
		return self.get_unpacked_response_body(last_message['params']['requestId'], mimetype=ctype)

Response: This method is called when the page location has changed.


Instruction:
Create a Python 3 function for
doing a blocking navigate to url `url`, and then extract the response body and return that. This effectively returns the *unrendered* page content that's sent over the wire. As such, if the page does any modification of the contained markup during rendering (via javascript), this function will not reflect the changes made by the javascript. The rendered page content can be retreived by calling `get_rendered_page_source()`. Due to the remote api structure, accessing the raw content after the content has been loaded is not possible, so any task requiring the raw content must be careful to request it before it actually navigates to said content. Return value is a dictionary with two keys: { 'binary' : (boolean, true if content is binary, false if not) 'content' : (string of bytestring, depending on whether `binary` is true or not) }

Response:
def blocking_navigate_and_get_source(self, url, timeout=DEFAULT_TIMEOUT_SECS):
		'''
		Do a blocking navigate to url `url`, and then extract the
		response body and return that.

		This effectively returns the *unrendered* page content that's sent over the wire. As such,
		if the page does any modification of the contained markup during rendering (via javascript), this
		function will not reflect the changes made by the javascript.

		The rendered page content can be retreived by calling `get_rendered_page_source()`.

		Due to the remote api structure, accessing the raw content after the content has been loaded
		is not possible, so any task requiring the raw content must be careful to request it
		before it actually navigates to said content.

		Return value is a dictionary with two keys:
		{
			'binary' : (boolean, true if content is binary, false if not)
			'content' : (string of bytestring, depending on whether `binary` is true or not)
		}

		'''

		resp = self.blocking_navigate(url, timeout)
		assert 'requestId' in resp
		assert 'response' in resp
		# self.log.debug('blocking_navigate Response %s', pprint.pformat(resp))

		ctype = 'application/unknown'

		resp_response = resp['response']

		if 'mimeType' in resp_response:
			ctype = resp_response['mimeType']
		if 'headers' in resp_response and 'content-type' in resp_response['headers']:
			ctype = resp_response['headers']['content-type'].split(";")[0]

		self.log.debug("Trying to get response body")
		try:
			ret = self.get_unpacked_response_body(resp['requestId'], mimetype=ctype)
		except ChromeError:
			ret = self.handle_page_location_changed(timeout)

		return ret