text
stringlengths 0
828
|
---|
],
|
response = report_TAF,
|
kwargs = {""text"": text}
|
),
|
trigger_keyphrases(
|
text = text,
|
keyphrases = [
|
""rain""
|
],
|
response = report_rain_times,
|
kwargs = {""text"": text}
|
)
|
])
|
# actions
|
triggers.extend([
|
trigger_keyphrases(
|
text = text,
|
keyphrases = [
|
""command"",
|
""run command"",
|
""engage command"",
|
""execute command""
|
],
|
response = command()
|
),
|
trigger_keyphrases(
|
text = text,
|
keyphrases = [
|
""restart""
|
],
|
function = restart,
|
confirm = True,
|
confirmation_prompt = ""Do you want to restart this ""
|
""program? (y/n)"",
|
confirmation_feedback_confirm = ""confirm restart"",
|
confirmation_feedback_deny = ""deny restart""
|
)
|
])
|
if any(triggers):
|
responses = [response for response in triggers if response]
|
if len(responses) > 1:
|
return responses
|
else:
|
return responses[0]
|
else:
|
return False"
|
4760,"def parse_networking(
|
text = None
|
):
|
""""""
|
Access address and port parameters via the builtins or __builtin__ module.
|
Relish the nonsense.
|
""""""
|
try:
|
address = _builtins.address
|
port = _builtins.port
|
except:
|
address = None
|
port = None
|
triggers = []
|
if address and port:
|
triggers.extend([
|
trigger_keyphrases(
|
text = text,
|
keyphrases = [
|
""reverse SSH"",
|
""reverse ssh""
|
],
|
function = engage_command,
|
kwargs = {""command"": ""ssh -R "" + str(port) + "":localhost:22 "" + address},
|
confirm = True,
|
confirmation_prompt = ""Do you want to reverse SSH ""
|
""connect? (y/n)"",
|
confirmation_feedback_confirm = ""confirm reverse SSH connect: ""
|
""ssh localhost -p "" + str(port),
|
confirmation_feedback_deny = ""deny reverse SSH connect""
|
)
|
])
|
if any(triggers):
|
responses = [response for response in triggers if response]
|
if len(responses) > 1:
|
return responses
|
else:
|
return responses[0]
|
else:
|
return False"
|
4761,"def multiparse(
|
text = None,
|
parsers = [parse],
|
help_message = None
|
):
|
""""""
|
Parse input text by looping over a list of multiple parsers. If one trigger
|
is triggered, return the value returned by that trigger, if multiple
|
triggers are triggered, return a list of the values returned by those
|
triggers. If no triggers are triggered, return False or an optional help
|
message.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.