partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | bdist_wheel.add_requirements | Add additional requirements from setup.cfg to file metadata_path | libraries/botframework-connector/azure_bdist_wheel.py | def add_requirements(self, metadata_path):
"""Add additional requirements from setup.cfg to file metadata_path"""
additional = list(self.setupcfg_requirements())
if not additional: return
pkg_info = read_pkg_info(metadata_path)
if 'Provides-Extra' in pkg_info or 'Requires-Dist' i... | def add_requirements(self, metadata_path):
"""Add additional requirements from setup.cfg to file metadata_path"""
additional = list(self.setupcfg_requirements())
if not additional: return
pkg_info = read_pkg_info(metadata_path)
if 'Provides-Extra' in pkg_info or 'Requires-Dist' i... | [
"Add",
"additional",
"requirements",
"from",
"setup",
".",
"cfg",
"to",
"file",
"metadata_path"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/azure_bdist_wheel.py#L355-L366 | [
"def",
"add_requirements",
"(",
"self",
",",
"metadata_path",
")",
":",
"additional",
"=",
"list",
"(",
"self",
".",
"setupcfg_requirements",
"(",
")",
")",
"if",
"not",
"additional",
":",
"return",
"pkg_info",
"=",
"read_pkg_info",
"(",
"metadata_path",
")",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | bdist_wheel.egg2dist | Convert an .egg-info directory into a .dist-info directory | libraries/botframework-connector/azure_bdist_wheel.py | def egg2dist(self, egginfo_path, distinfo_path):
"""Convert an .egg-info directory into a .dist-info directory"""
def adios(p):
"""Appropriately delete directory, file or link."""
if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p):
shutil.rmtree(p... | def egg2dist(self, egginfo_path, distinfo_path):
"""Convert an .egg-info directory into a .dist-info directory"""
def adios(p):
"""Appropriately delete directory, file or link."""
if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p):
shutil.rmtree(p... | [
"Convert",
"an",
".",
"egg",
"-",
"info",
"directory",
"into",
"a",
".",
"dist",
"-",
"info",
"directory"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/azure_bdist_wheel.py#L368-L448 | [
"def",
"egg2dist",
"(",
"self",
",",
"egginfo_path",
",",
"distinfo_path",
")",
":",
"def",
"adios",
"(",
"p",
")",
":",
"\"\"\"Appropriately delete directory, file or link.\"\"\"",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"p",
")",
"and",
"not",
"os",
"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ConversationsOperations.get_conversations | GetConversations.
List the Conversations in which this bot has participated.
GET from this method with a skip token
The return value is a ConversationsResult, which contains an array of
ConversationMembers and a skip token. If the skip token is not empty,
then
there are... | libraries/botframework-connector/botframework/connector/operations/_conversations_operations.py | def get_conversations(
self, continuation_token=None, custom_headers=None, raw=False, **operation_config):
"""GetConversations.
List the Conversations in which this bot has participated.
GET from this method with a skip token
The return value is a ConversationsResult, which ... | def get_conversations(
self, continuation_token=None, custom_headers=None, raw=False, **operation_config):
"""GetConversations.
List the Conversations in which this bot has participated.
GET from this method with a skip token
The return value is a ConversationsResult, which ... | [
"GetConversations",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/operations/_conversations_operations.py#L41-L98 | [
"def",
"get_conversations",
"(",
"self",
",",
"continuation_token",
"=",
"None",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"# Construct URL",
"url",
"=",
"self",
".",
"get_conversations",
".",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ConversationsOperations.create_conversation | CreateConversation.
Create a new Conversation.
POST to this method with a
* Bot being the bot creating the conversation
* IsGroup set to true if this is not a direct message (default is
false)
* Array containing the members to include in the conversation
The retu... | libraries/botframework-connector/botframework/connector/operations/_conversations_operations.py | def create_conversation(
self, parameters, custom_headers=None, raw=False, **operation_config):
"""CreateConversation.
Create a new Conversation.
POST to this method with a
* Bot being the bot creating the conversation
* IsGroup set to true if this is not a direct me... | def create_conversation(
self, parameters, custom_headers=None, raw=False, **operation_config):
"""CreateConversation.
Create a new Conversation.
POST to this method with a
* Bot being the bot creating the conversation
* IsGroup set to true if this is not a direct me... | [
"CreateConversation",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/operations/_conversations_operations.py#L101-L173 | [
"def",
"create_conversation",
"(",
"self",
",",
"parameters",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"# Construct URL",
"url",
"=",
"self",
".",
"create_conversation",
".",
"metadata",
"[",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ConversationsOperations.get_conversation_paged_members | GetConversationPagedMembers.
Enumerate the members of a conversation one page at a time.
This REST API takes a ConversationId. Optionally a pageSize and/or
continuationToken can be provided. It returns a PagedMembersResult,
which contains an array
of ChannelAccounts representing... | libraries/botframework-connector/botframework/connector/operations/_conversations_operations.py | def get_conversation_paged_members(
self, conversation_id, page_size=None, continuation_token=None, custom_headers=None, raw=False, **operation_config):
"""GetConversationPagedMembers.
Enumerate the members of a conversation one page at a time.
This REST API takes a ConversationId. ... | def get_conversation_paged_members(
self, conversation_id, page_size=None, continuation_token=None, custom_headers=None, raw=False, **operation_config):
"""GetConversationPagedMembers.
Enumerate the members of a conversation one page at a time.
This REST API takes a ConversationId. ... | [
"GetConversationPagedMembers",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/operations/_conversations_operations.py#L574-L645 | [
"def",
"get_conversation_paged_members",
"(",
"self",
",",
"conversation_id",
",",
"page_size",
"=",
"None",
",",
"continuation_token",
"=",
"None",
",",
"custom_headers",
"=",
"None",
",",
"raw",
"=",
"False",
",",
"*",
"*",
"operation_config",
")",
":",
"# C... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | BotTelemetryClient.track_pageview | Send information about the page viewed in the application (a web page for instance).
:param name: the name of the page that was viewed.
:param url: the URL of the page that was viewed.
:param duration: the duration of the page view in milliseconds. (defaults to: 0)
:param properties: the... | libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py | def track_pageview(self, name: str, url, duration: int = 0, properties : Dict[str, object]=None,
measurements: Dict[str, object]=None) -> None:
"""
Send information about the page viewed in the application (a web page for instance).
:param name: the name of the page that... | def track_pageview(self, name: str, url, duration: int = 0, properties : Dict[str, object]=None,
measurements: Dict[str, object]=None) -> None:
"""
Send information about the page viewed in the application (a web page for instance).
:param name: the name of the page that... | [
"Send",
"information",
"about",
"the",
"page",
"viewed",
"in",
"the",
"application",
"(",
"a",
"web",
"page",
"for",
"instance",
")",
".",
":",
"param",
"name",
":",
"the",
"name",
"of",
"the",
"page",
"that",
"was",
"viewed",
".",
":",
"param",
"url",... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py#L16-L26 | [
"def",
"track_pageview",
"(",
"self",
",",
"name",
":",
"str",
",",
"url",
",",
"duration",
":",
"int",
"=",
"0",
",",
"properties",
":",
"Dict",
"[",
"str",
",",
"object",
"]",
"=",
"None",
",",
"measurements",
":",
"Dict",
"[",
"str",
",",
"objec... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | BotTelemetryClient.track_exception | Send information about a single exception that occurred in the application.
:param type: the type of the exception that was thrown.
:param value: the exception that the client wants to send.
:param tb: the traceback information as returned by :func:`sys.exc_info`.
:param properties: the ... | libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py | def track_exception(self, type: type = None, value : Exception =None, tb : traceback =None,
properties: Dict[str, object]=None, measurements: Dict[str, object]=None) -> None:
"""
Send information about a single exception that occurred in the application.
:param type: th... | def track_exception(self, type: type = None, value : Exception =None, tb : traceback =None,
properties: Dict[str, object]=None, measurements: Dict[str, object]=None) -> None:
"""
Send information about a single exception that occurred in the application.
:param type: th... | [
"Send",
"information",
"about",
"a",
"single",
"exception",
"that",
"occurred",
"in",
"the",
"application",
".",
":",
"param",
"type",
":",
"the",
"type",
"of",
"the",
"exception",
"that",
"was",
"thrown",
".",
":",
"param",
"value",
":",
"the",
"exception... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py#L29-L39 | [
"def",
"track_exception",
"(",
"self",
",",
"type",
":",
"type",
"=",
"None",
",",
"value",
":",
"Exception",
"=",
"None",
",",
"tb",
":",
"traceback",
"=",
"None",
",",
"properties",
":",
"Dict",
"[",
"str",
",",
"object",
"]",
"=",
"None",
",",
"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | BotTelemetryClient.track_metric | Send information about a single metric data point that was captured for the application.
:param name: The name of the metric that was captured.
:param value: The value of the metric that was captured.
:param type: The type of the metric. (defaults to: TelemetryDataPointType.aggregation`)
... | libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py | def track_metric(self, name: str, value: float, type: TelemetryDataPointType =None,
count: int =None, min: float=None, max: float=None, std_dev: float=None,
properties: Dict[str, object]=None) -> NotImplemented:
"""
Send information about a single metric data poi... | def track_metric(self, name: str, value: float, type: TelemetryDataPointType =None,
count: int =None, min: float=None, max: float=None, std_dev: float=None,
properties: Dict[str, object]=None) -> NotImplemented:
"""
Send information about a single metric data poi... | [
"Send",
"information",
"about",
"a",
"single",
"metric",
"data",
"point",
"that",
"was",
"captured",
"for",
"the",
"application",
".",
":",
"param",
"name",
":",
"The",
"name",
"of",
"the",
"metric",
"that",
"was",
"captured",
".",
":",
"param",
"value",
... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py#L53-L67 | [
"def",
"track_metric",
"(",
"self",
",",
"name",
":",
"str",
",",
"value",
":",
"float",
",",
"type",
":",
"TelemetryDataPointType",
"=",
"None",
",",
"count",
":",
"int",
"=",
"None",
",",
"min",
":",
"float",
"=",
"None",
",",
"max",
":",
"float",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | BotTelemetryClient.track_request | Sends a single request that was captured for the application.
:param name: The name for this request. All requests with the same name will be grouped together.
:param url: The actual URL for this request (to show in individual request instances).
:param success: True if the request ended in succ... | libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py | def track_request(self, name: str, url: str, success: bool, start_time: str=None,
duration: int=None, response_code: str =None, http_method: str=None,
properties: Dict[str, object]=None, measurements: Dict[str, object]=None,
request_id: str=None):
"... | def track_request(self, name: str, url: str, success: bool, start_time: str=None,
duration: int=None, response_code: str =None, http_method: str=None,
properties: Dict[str, object]=None, measurements: Dict[str, object]=None,
request_id: str=None):
"... | [
"Sends",
"a",
"single",
"request",
"that",
"was",
"captured",
"for",
"the",
"application",
".",
":",
"param",
"name",
":",
"The",
"name",
"for",
"this",
"request",
".",
"All",
"requests",
"with",
"the",
"same",
"name",
"will",
"be",
"grouped",
"together",
... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py#L80-L97 | [
"def",
"track_request",
"(",
"self",
",",
"name",
":",
"str",
",",
"url",
":",
"str",
",",
"success",
":",
"bool",
",",
"start_time",
":",
"str",
"=",
"None",
",",
"duration",
":",
"int",
"=",
"None",
",",
"response_code",
":",
"str",
"=",
"None",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | BotTelemetryClient.track_dependency | Sends a single dependency telemetry that was captured for the application.
:param name: the name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template.
:param data: the command initiated by this dependency call. Examples are S... | libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py | def track_dependency(self, name:str, data:str, type:str=None, target:str=None, duration:int=None,
success:bool=None, result_code:str=None, properties:Dict[str, object]=None,
measurements:Dict[str, object]=None, dependency_id:str=None):
"""
Sends a single... | def track_dependency(self, name:str, data:str, type:str=None, target:str=None, duration:int=None,
success:bool=None, result_code:str=None, properties:Dict[str, object]=None,
measurements:Dict[str, object]=None, dependency_id:str=None):
"""
Sends a single... | [
"Sends",
"a",
"single",
"dependency",
"telemetry",
"that",
"was",
"captured",
"for",
"the",
"application",
".",
":",
"param",
"name",
":",
"the",
"name",
"of",
"the",
"command",
"initiated",
"with",
"this",
"dependency",
"call",
".",
"Low",
"cardinality",
"v... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/bot_telemetry_client.py#L100-L116 | [
"def",
"track_dependency",
"(",
"self",
",",
"name",
":",
"str",
",",
"data",
":",
"str",
",",
"type",
":",
"str",
"=",
"None",
",",
"target",
":",
"str",
"=",
"None",
",",
"duration",
":",
"int",
"=",
"None",
",",
"success",
":",
"bool",
"=",
"N... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | MessageFactory.text | Returns a simple text message.
:Example:
message = MessageFactory.text('Greetings from example message')
await context.send_activity(message)
:param text:
:param speak:
:param input_hint:
:return: | libraries/botbuilder-core/botbuilder/core/message_factory.py | def text(text: str, speak: str = None, input_hint: Union[InputHints, str] = InputHints.accepting_input) -> Activity:
"""
Returns a simple text message.
:Example:
message = MessageFactory.text('Greetings from example message')
await context.send_activity(message)
:param ... | def text(text: str, speak: str = None, input_hint: Union[InputHints, str] = InputHints.accepting_input) -> Activity:
"""
Returns a simple text message.
:Example:
message = MessageFactory.text('Greetings from example message')
await context.send_activity(message)
:param ... | [
"Returns",
"a",
"simple",
"text",
"message",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/message_factory.py#L27-L44 | [
"def",
"text",
"(",
"text",
":",
"str",
",",
"speak",
":",
"str",
"=",
"None",
",",
"input_hint",
":",
"Union",
"[",
"InputHints",
",",
"str",
"]",
"=",
"InputHints",
".",
"accepting_input",
")",
"->",
"Activity",
":",
"message",
"=",
"Activity",
"(",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | MessageFactory.suggested_actions | Returns a message that includes a set of suggested actions and optional text.
:Example:
message = MessageFactory.suggested_actions([CardAction(title='a', type=ActionTypes.im_back, value='a'),
CardAction(title='b', type=ActionTypes.im_back, value='b'),... | libraries/botbuilder-core/botbuilder/core/message_factory.py | def suggested_actions(actions: List[CardAction], text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = InputHints.accepting_input) -> Activity:
"""
Returns a message that includes a set of suggested actions and optional text.
:Example:
messa... | def suggested_actions(actions: List[CardAction], text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = InputHints.accepting_input) -> Activity:
"""
Returns a message that includes a set of suggested actions and optional text.
:Example:
messa... | [
"Returns",
"a",
"message",
"that",
"includes",
"a",
"set",
"of",
"suggested",
"actions",
"and",
"optional",
"text",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/message_factory.py#L47-L70 | [
"def",
"suggested_actions",
"(",
"actions",
":",
"List",
"[",
"CardAction",
"]",
",",
"text",
":",
"str",
"=",
"None",
",",
"speak",
":",
"str",
"=",
"None",
",",
"input_hint",
":",
"Union",
"[",
"InputHints",
",",
"str",
"]",
"=",
"InputHints",
".",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | MessageFactory.attachment | Returns a single message activity containing an attachment.
:Example:
message = MessageFactory.attachment(CardFactory.hero_card(HeroCard(title='White T-Shirt',
images=[CardImage(url='https://example.com/whiteShirt.jpg')],
... | libraries/botbuilder-core/botbuilder/core/message_factory.py | def attachment(attachment: Attachment, text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = None):
"""
Returns a single message activity containing an attachment.
:Example:
message = MessageFactory.attachment(CardFactory.hero_card(HeroCard(title='... | def attachment(attachment: Attachment, text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = None):
"""
Returns a single message activity containing an attachment.
:Example:
message = MessageFactory.attachment(CardFactory.hero_card(HeroCard(title='... | [
"Returns",
"a",
"single",
"message",
"activity",
"containing",
"an",
"attachment",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/message_factory.py#L73-L90 | [
"def",
"attachment",
"(",
"attachment",
":",
"Attachment",
",",
"text",
":",
"str",
"=",
"None",
",",
"speak",
":",
"str",
"=",
"None",
",",
"input_hint",
":",
"Union",
"[",
"InputHints",
",",
"str",
"]",
"=",
"None",
")",
":",
"return",
"attachment_ac... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | MessageFactory.list | Returns a message that will display a set of attachments in list form.
:Example:
message = MessageFactory.list([CardFactory.hero_card(HeroCard(title='title1',
images=[CardImage(url='imageUrl1')],
... | libraries/botbuilder-core/botbuilder/core/message_factory.py | def list(attachments: List[Attachment], text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = None) -> Activity:
"""
Returns a message that will display a set of attachments in list form.
:Example:
message = MessageFactory.list([CardFactory.hero_card(Her... | def list(attachments: List[Attachment], text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = None) -> Activity:
"""
Returns a message that will display a set of attachments in list form.
:Example:
message = MessageFactory.list([CardFactory.hero_card(Her... | [
"Returns",
"a",
"message",
"that",
"will",
"display",
"a",
"set",
"of",
"attachments",
"in",
"list",
"form",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/message_factory.py#L93-L116 | [
"def",
"list",
"(",
"attachments",
":",
"List",
"[",
"Attachment",
"]",
",",
"text",
":",
"str",
"=",
"None",
",",
"speak",
":",
"str",
"=",
"None",
",",
"input_hint",
":",
"Union",
"[",
"InputHints",
",",
"str",
"]",
"=",
"None",
")",
"->",
"Activ... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | MessageFactory.content_url | Returns a message that will display a single image or video to a user.
:Example:
message = MessageFactory.content_url('https://example.com/hawaii.jpg', 'image/jpeg',
'Hawaii Trip', 'A photo from our family vacation.')
await context.send_activity(mess... | libraries/botbuilder-core/botbuilder/core/message_factory.py | def content_url(url: str, content_type: str, name: str = None, text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = None):
"""
Returns a message that will display a single image or video to a user.
:Example:
message = MessageFactory.content_url('... | def content_url(url: str, content_type: str, name: str = None, text: str = None, speak: str = None,
input_hint: Union[InputHints, str] = None):
"""
Returns a message that will display a single image or video to a user.
:Example:
message = MessageFactory.content_url('... | [
"Returns",
"a",
"message",
"that",
"will",
"display",
"a",
"single",
"image",
"or",
"video",
"to",
"a",
"user",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/message_factory.py#L145-L166 | [
"def",
"content_url",
"(",
"url",
":",
"str",
",",
"content_type",
":",
"str",
",",
"name",
":",
"str",
"=",
"None",
",",
"text",
":",
"str",
"=",
"None",
",",
"speak",
":",
"str",
"=",
"None",
",",
"input_hint",
":",
"Union",
"[",
"InputHints",
",... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ChannelValidation.authenticate_token_service_url | Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Framework emulator will FAIL this check.
:param auth_header: The raw HTTP header in the format: 'Bearer [longString]'
:type auth_header: str
... | libraries/botframework-connector/botframework/connector/auth/channel_validation.py | async def authenticate_token_service_url(auth_header: str, credentials: CredentialProvider, service_url: str, channel_id: str) -> ClaimsIdentity:
""" Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Fra... | async def authenticate_token_service_url(auth_header: str, credentials: CredentialProvider, service_url: str, channel_id: str) -> ClaimsIdentity:
""" Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Fra... | [
"Validate",
"the",
"incoming",
"Auth",
"Header"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/auth/channel_validation.py#L25-L49 | [
"async",
"def",
"authenticate_token_service_url",
"(",
"auth_header",
":",
"str",
",",
"credentials",
":",
"CredentialProvider",
",",
"service_url",
":",
"str",
",",
"channel_id",
":",
"str",
")",
"->",
"ClaimsIdentity",
":",
"identity",
"=",
"await",
"asyncio",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ChannelValidation.authenticate_token | Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Framework emulator will FAIL this check.
:param auth_header: The raw HTTP header in the format: 'Bearer [longString]'
:type auth_header: str
... | libraries/botframework-connector/botframework/connector/auth/channel_validation.py | async def authenticate_token(auth_header: str, credentials: CredentialProvider, channel_id: str) -> ClaimsIdentity:
""" Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Framework emulator will FAIL this... | async def authenticate_token(auth_header: str, credentials: CredentialProvider, channel_id: str) -> ClaimsIdentity:
""" Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Framework emulator will FAIL this... | [
"Validate",
"the",
"incoming",
"Auth",
"Header"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/auth/channel_validation.py#L52-L99 | [
"async",
"def",
"authenticate_token",
"(",
"auth_header",
":",
"str",
",",
"credentials",
":",
"CredentialProvider",
",",
"channel_id",
":",
"str",
")",
"->",
"ClaimsIdentity",
":",
"token_extractor",
"=",
"JwtTokenExtractor",
"(",
"ChannelValidation",
".",
"TO_BOT_... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ActivityUtil.create_trace | Creates a trace activity based on this activity.
:param turn_activity:
:type turn_activity: Activity
:param name: The value to assign to the trace activity's <see cref="Activity.name"/> property.
:type name: str
:param value: The value to assign to the trace activity's <see cref... | libraries/botbuilder-ai/botbuilder/ai/luis/activity_util.py | def create_trace(
turn_activity: Activity,
name: str,
value: object = None,
value_type: str = None,
label: str = None,
) -> Activity:
"""Creates a trace activity based on this activity.
:param turn_activity:
:type turn_activity: Activity
:para... | def create_trace(
turn_activity: Activity,
name: str,
value: object = None,
value_type: str = None,
label: str = None,
) -> Activity:
"""Creates a trace activity based on this activity.
:param turn_activity:
:type turn_activity: Activity
:para... | [
"Creates",
"a",
"trace",
"activity",
"based",
"on",
"this",
"activity",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/luis/activity_util.py#L16-L69 | [
"def",
"create_trace",
"(",
"turn_activity",
":",
"Activity",
",",
"name",
":",
"str",
",",
"value",
":",
"object",
"=",
"None",
",",
"value_type",
":",
"str",
"=",
"None",
",",
"label",
":",
"str",
"=",
"None",
",",
")",
"->",
"Activity",
":",
"from... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogSet.add | Adds a new dialog to the set and returns the added dialog.
:param dialog: The dialog to add. | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_set.py | async def add(self, dialog: Dialog):
"""
Adds a new dialog to the set and returns the added dialog.
:param dialog: The dialog to add.
"""
if dialog is None or not isinstance(dialog, Dialog):
raise TypeError('DialogSet.add(): dialog cannot be None and must be a Dialog ... | async def add(self, dialog: Dialog):
"""
Adds a new dialog to the set and returns the added dialog.
:param dialog: The dialog to add.
"""
if dialog is None or not isinstance(dialog, Dialog):
raise TypeError('DialogSet.add(): dialog cannot be None and must be a Dialog ... | [
"Adds",
"a",
"new",
"dialog",
"to",
"the",
"set",
"and",
"returns",
"the",
"added",
"dialog",
".",
":",
"param",
"dialog",
":",
"The",
"dialog",
"to",
"add",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_set.py#L42-L56 | [
"async",
"def",
"add",
"(",
"self",
",",
"dialog",
":",
"Dialog",
")",
":",
"if",
"dialog",
"is",
"None",
"or",
"not",
"isinstance",
"(",
"dialog",
",",
"Dialog",
")",
":",
"raise",
"TypeError",
"(",
"'DialogSet.add(): dialog cannot be None and must be a Dialog ... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogSet.find | Finds a dialog that was previously added to the set using add(dialog)
:param dialog_id: ID of the dialog/prompt to look up.
:return: The dialog if found, otherwise null. | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_set.py | async def find(self, dialog_id: str) -> Dialog:
"""
Finds a dialog that was previously added to the set using add(dialog)
:param dialog_id: ID of the dialog/prompt to look up.
:return: The dialog if found, otherwise null.
"""
if (not dialog_id):
raise TypeErro... | async def find(self, dialog_id: str) -> Dialog:
"""
Finds a dialog that was previously added to the set using add(dialog)
:param dialog_id: ID of the dialog/prompt to look up.
:return: The dialog if found, otherwise null.
"""
if (not dialog_id):
raise TypeErro... | [
"Finds",
"a",
"dialog",
"that",
"was",
"previously",
"added",
"to",
"the",
"set",
"using",
"add",
"(",
"dialog",
")",
":",
"param",
"dialog_id",
":",
"ID",
"of",
"the",
"dialog",
"/",
"prompt",
"to",
"look",
"up",
".",
":",
"return",
":",
"The",
"dia... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_set.py#L68-L80 | [
"async",
"def",
"find",
"(",
"self",
",",
"dialog_id",
":",
"str",
")",
"->",
"Dialog",
":",
"if",
"(",
"not",
"dialog_id",
")",
":",
"raise",
"TypeError",
"(",
"'DialogContext.find(): dialog_id cannot be None.'",
")",
"if",
"dialog_id",
"in",
"self",
".",
"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | UserState.get_storage_key | Returns the storage key for the current user state.
:param context:
:return: | libraries/botbuilder-core/botbuilder/core/user_state.py | def get_storage_key(self, context: TurnContext) -> str:
"""
Returns the storage key for the current user state.
:param context:
:return:
"""
activity = context.activity
channel_id = getattr(activity, 'channel_id', None)
user_id = getattr(activity.from_prop... | def get_storage_key(self, context: TurnContext) -> str:
"""
Returns the storage key for the current user state.
:param context:
:return:
"""
activity = context.activity
channel_id = getattr(activity, 'channel_id', None)
user_id = getattr(activity.from_prop... | [
"Returns",
"the",
"storage",
"key",
"for",
"the",
"current",
"user",
"state",
".",
":",
"param",
"context",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/user_state.py#L33-L46 | [
"def",
"get_storage_key",
"(",
"self",
",",
"context",
":",
"TurnContext",
")",
"->",
"str",
":",
"activity",
"=",
"context",
".",
"activity",
"channel_id",
"=",
"getattr",
"(",
"activity",
",",
"'channel_id'",
",",
"None",
")",
"user_id",
"=",
"getattr",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | RecognizerResult.get_top_scoring_intent | Return the top scoring intent and its score.
:return: Intent and score.
:rtype: TopIntent | libraries/botbuilder-ai/botbuilder/ai/luis/recognizer_result.py | def get_top_scoring_intent(self) -> TopIntent:
"""Return the top scoring intent and its score.
:return: Intent and score.
:rtype: TopIntent
"""
if self.intents is None:
raise TypeError("result.intents can't be None")
top_intent = TopIntent(intent=""... | def get_top_scoring_intent(self) -> TopIntent:
"""Return the top scoring intent and its score.
:return: Intent and score.
:rtype: TopIntent
"""
if self.intents is None:
raise TypeError("result.intents can't be None")
top_intent = TopIntent(intent=""... | [
"Return",
"the",
"top",
"scoring",
"intent",
"and",
"its",
"score",
".",
":",
"return",
":",
"Intent",
"and",
"score",
".",
":",
"rtype",
":",
"TopIntent"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/luis/recognizer_result.py#L147-L163 | [
"def",
"get_top_scoring_intent",
"(",
"self",
")",
"->",
"TopIntent",
":",
"if",
"self",
".",
"intents",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"\"result.intents can't be None\"",
")",
"top_intent",
"=",
"TopIntent",
"(",
"intent",
"=",
"\"\"",
",",
"sc... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | Dialog.telemetry_client | Sets the telemetry client for logging events. | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog.py | def telemetry_client(self, value: BotTelemetryClient) -> None:
"""
Sets the telemetry client for logging events.
"""
if value is None:
self._telemetry_client = NullTelemetryClient()
else:
self._telemetry_client = value | def telemetry_client(self, value: BotTelemetryClient) -> None:
"""
Sets the telemetry client for logging events.
"""
if value is None:
self._telemetry_client = NullTelemetryClient()
else:
self._telemetry_client = value | [
"Sets",
"the",
"telemetry",
"client",
"for",
"logging",
"events",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog.py#L33-L40 | [
"def",
"telemetry_client",
"(",
"self",
",",
"value",
":",
"BotTelemetryClient",
")",
"->",
"None",
":",
"if",
"value",
"is",
"None",
":",
"self",
".",
"_telemetry_client",
"=",
"NullTelemetryClient",
"(",
")",
"else",
":",
"self",
".",
"_telemetry_client",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | Dialog.resume_dialog | Method called when an instance of the dialog is being returned to from another
dialog that was started by the current instance using `begin_dialog()`.
If this method is NOT implemented then the dialog will be automatically ended with a call
to `end_dialog()`. Any result passed from the called di... | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog.py | async def resume_dialog(self, dc, reason: DialogReason, result: object):
"""
Method called when an instance of the dialog is being returned to from another
dialog that was started by the current instance using `begin_dialog()`.
If this method is NOT implemented then the dialog will be au... | async def resume_dialog(self, dc, reason: DialogReason, result: object):
"""
Method called when an instance of the dialog is being returned to from another
dialog that was started by the current instance using `begin_dialog()`.
If this method is NOT implemented then the dialog will be au... | [
"Method",
"called",
"when",
"an",
"instance",
"of",
"the",
"dialog",
"is",
"being",
"returned",
"to",
"from",
"another",
"dialog",
"that",
"was",
"started",
"by",
"the",
"current",
"instance",
"using",
"begin_dialog",
"()",
".",
"If",
"this",
"method",
"is",... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog.py#L63-L76 | [
"async",
"def",
"resume_dialog",
"(",
"self",
",",
"dc",
",",
"reason",
":",
"DialogReason",
",",
"result",
":",
"object",
")",
":",
"# By default just end the current dialog.",
"return",
"await",
"dc",
".",
"EndDialog",
"(",
"result",
")"
] | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | LuisApplication.from_application_endpoint | Initializes a new instance of the <see cref="LuisApplication"/> class.
:param application_endpoint: LUIS application endpoint.
:type application_endpoint: str
:return:
:rtype: LuisApplication | libraries/botbuilder-ai/botbuilder/ai/luis/luis_application.py | def from_application_endpoint(cls, application_endpoint: str):
"""Initializes a new instance of the <see cref="LuisApplication"/> class.
:param application_endpoint: LUIS application endpoint.
:type application_endpoint: str
:return:
:rtype: LuisApplication
"""
... | def from_application_endpoint(cls, application_endpoint: str):
"""Initializes a new instance of the <see cref="LuisApplication"/> class.
:param application_endpoint: LUIS application endpoint.
:type application_endpoint: str
:return:
:rtype: LuisApplication
"""
... | [
"Initializes",
"a",
"new",
"instance",
"of",
"the",
"<see",
"cref",
"=",
"LuisApplication",
"/",
">",
"class",
".",
":",
"param",
"application_endpoint",
":",
"LUIS",
"application",
"endpoint",
".",
":",
"type",
"application_endpoint",
":",
"str",
":",
"return... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/luis/luis_application.py#L49-L60 | [
"def",
"from_application_endpoint",
"(",
"cls",
",",
"application_endpoint",
":",
"str",
")",
":",
"(",
"application_id",
",",
"endpoint_key",
",",
"endpoint",
")",
"=",
"LuisApplication",
".",
"_parse",
"(",
"application_endpoint",
")",
"return",
"cls",
"(",
"a... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | LuisRecognizer.top_intent | Returns the name of the top scoring intent from a set of LUIS results.
:param results: Result set to be searched.
:type results: RecognizerResult
:param default_intent: Intent name to return should a top intent be found, defaults to "None"
:param default_intent: str, optional
... | libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py | def top_intent(
results: RecognizerResult, default_intent: str = "None", min_score: float = 0.0
) -> str:
"""Returns the name of the top scoring intent from a set of LUIS results.
:param results: Result set to be searched.
:type results: RecognizerResult
:param defau... | def top_intent(
results: RecognizerResult, default_intent: str = "None", min_score: float = 0.0
) -> str:
"""Returns the name of the top scoring intent from a set of LUIS results.
:param results: Result set to be searched.
:type results: RecognizerResult
:param defau... | [
"Returns",
"the",
"name",
"of",
"the",
"top",
"scoring",
"intent",
"from",
"a",
"set",
"of",
"LUIS",
"results",
".",
":",
"param",
"results",
":",
"Result",
"set",
"to",
"be",
"searched",
".",
":",
"type",
"results",
":",
"RecognizerResult",
":",
"param"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py#L122-L150 | [
"def",
"top_intent",
"(",
"results",
":",
"RecognizerResult",
",",
"default_intent",
":",
"str",
"=",
"\"None\"",
",",
"min_score",
":",
"float",
"=",
"0.0",
")",
"->",
"str",
":",
"if",
"results",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"\"LuisRecog... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | LuisRecognizer.recognize | Return results of the analysis (Suggested actions and intents).
:param turn_context: Context object containing information for a single turn of conversation with a user.
:type turn_context: TurnContext
:param telemetry_properties: Additional properties to be logged to telemetry with the... | libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py | async def recognize(
self,
turn_context: TurnContext,
telemetry_properties: Dict[str, str] = None,
telemetry_metrics: Dict[str, float] = None,
) -> RecognizerResult:
"""Return results of the analysis (Suggested actions and intents).
:param turn_context: Conte... | async def recognize(
self,
turn_context: TurnContext,
telemetry_properties: Dict[str, str] = None,
telemetry_metrics: Dict[str, float] = None,
) -> RecognizerResult:
"""Return results of the analysis (Suggested actions and intents).
:param turn_context: Conte... | [
"Return",
"results",
"of",
"the",
"analysis",
"(",
"Suggested",
"actions",
"and",
"intents",
")",
".",
":",
"param",
"turn_context",
":",
"Context",
"object",
"containing",
"information",
"for",
"a",
"single",
"turn",
"of",
"conversation",
"with",
"a",
"user",... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py#L152-L172 | [
"async",
"def",
"recognize",
"(",
"self",
",",
"turn_context",
":",
"TurnContext",
",",
"telemetry_properties",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
"=",
"None",
",",
"telemetry_metrics",
":",
"Dict",
"[",
"str",
",",
"float",
"]",
"=",
"None",
",",... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | LuisRecognizer.on_recognizer_result | Invoked prior to a LuisResult being logged.
:param recognizer_result: The Luis Results for the call.
:type recognizer_result: RecognizerResult
:param turn_context: Context object containing information for a single turn of conversation with a user.
:type turn_context: TurnContex... | libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py | def on_recognizer_result(
self,
recognizer_result: RecognizerResult,
turn_context: TurnContext,
telemetry_properties: Dict[str, str] = None,
telemetry_metrics: Dict[str, float] = None,
):
"""Invoked prior to a LuisResult being logged.
:param recognize... | def on_recognizer_result(
self,
recognizer_result: RecognizerResult,
turn_context: TurnContext,
telemetry_properties: Dict[str, str] = None,
telemetry_metrics: Dict[str, float] = None,
):
"""Invoked prior to a LuisResult being logged.
:param recognize... | [
"Invoked",
"prior",
"to",
"a",
"LuisResult",
"being",
"logged",
".",
":",
"param",
"recognizer_result",
":",
"The",
"Luis",
"Results",
"for",
"the",
"call",
".",
":",
"type",
"recognizer_result",
":",
"RecognizerResult",
":",
"param",
"turn_context",
":",
"Con... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py#L174-L200 | [
"def",
"on_recognizer_result",
"(",
"self",
",",
"recognizer_result",
":",
"RecognizerResult",
",",
"turn_context",
":",
"TurnContext",
",",
"telemetry_properties",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
"=",
"None",
",",
"telemetry_metrics",
":",
"Dict",
"["... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | LuisRecognizer.fill_luis_event_properties | Fills the event properties for LuisResult event for telemetry.
These properties are logged when the recognizer is called.
:param recognizer_result: Last activity sent from user.
:type recognizer_result: RecognizerResult
:param turn_context: Context object containing information ... | libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py | def fill_luis_event_properties(
self,
recognizer_result: RecognizerResult,
turn_context: TurnContext,
telemetry_properties: Dict[str, str] = None,
) -> Dict[str, str]:
"""Fills the event properties for LuisResult event for telemetry.
These properties are logged when t... | def fill_luis_event_properties(
self,
recognizer_result: RecognizerResult,
turn_context: TurnContext,
telemetry_properties: Dict[str, str] = None,
) -> Dict[str, str]:
"""Fills the event properties for LuisResult event for telemetry.
These properties are logged when t... | [
"Fills",
"the",
"event",
"properties",
"for",
"LuisResult",
"event",
"for",
"telemetry",
".",
"These",
"properties",
"are",
"logged",
"when",
"the",
"recognizer",
"is",
"called",
".",
":",
"param",
"recognizer_result",
":",
"Last",
"activity",
"sent",
"from",
... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py#L215-L284 | [
"def",
"fill_luis_event_properties",
"(",
"self",
",",
"recognizer_result",
":",
"RecognizerResult",
",",
"turn_context",
":",
"TurnContext",
",",
"telemetry_properties",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
"=",
"None",
",",
")",
"->",
"Dict",
"[",
"str"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | AsyncServiceClientMixin.async_send_formdata | Send data as a multipart form-data request.
We only deal with file-like objects or strings at this point.
The requests is not yet streamed.
:param ClientRequest request: The request object to be sent.
:param dict headers: Any headers to add to the request.
:param dict content: Di... | libraries/botframework-connector/botframework/connector/async_mixin/async_mixin.py | async def async_send_formdata(self, request, headers=None, content=None, **config):
"""Send data as a multipart form-data request.
We only deal with file-like objects or strings at this point.
The requests is not yet streamed.
:param ClientRequest request: The request object to be sent.
... | async def async_send_formdata(self, request, headers=None, content=None, **config):
"""Send data as a multipart form-data request.
We only deal with file-like objects or strings at this point.
The requests is not yet streamed.
:param ClientRequest request: The request object to be sent.
... | [
"Send",
"data",
"as",
"a",
"multipart",
"form",
"-",
"data",
"request",
".",
"We",
"only",
"deal",
"with",
"file",
"-",
"like",
"objects",
"or",
"strings",
"at",
"this",
"point",
".",
"The",
"requests",
"is",
"not",
"yet",
"streamed",
".",
":",
"param"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/async_mixin/async_mixin.py#L46-L56 | [
"async",
"def",
"async_send_formdata",
"(",
"self",
",",
"request",
",",
"headers",
"=",
"None",
",",
"content",
"=",
"None",
",",
"*",
"*",
"config",
")",
":",
"files",
"=",
"self",
".",
"_prepare_send_formdata",
"(",
"request",
",",
"headers",
",",
"co... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | AsyncServiceClientMixin.async_send | Prepare and send request object according to configuration.
:param ClientRequest request: The request object to be sent.
:param dict headers: Any headers to add to the request.
:param content: Any body data to add to the request.
:param config: Any specific config overrides | libraries/botframework-connector/botframework/connector/async_mixin/async_mixin.py | async def async_send(self, request, headers=None, content=None, **config):
"""Prepare and send request object according to configuration.
:param ClientRequest request: The request object to be sent.
:param dict headers: Any headers to add to the request.
:param content: Any body data to ... | async def async_send(self, request, headers=None, content=None, **config):
"""Prepare and send request object according to configuration.
:param ClientRequest request: The request object to be sent.
:param dict headers: Any headers to add to the request.
:param content: Any body data to ... | [
"Prepare",
"and",
"send",
"request",
"object",
"according",
"to",
"configuration",
".",
":",
"param",
"ClientRequest",
"request",
":",
"The",
"request",
"object",
"to",
"be",
"sent",
".",
":",
"param",
"dict",
"headers",
":",
"Any",
"headers",
"to",
"add",
... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/async_mixin/async_mixin.py#L58-L133 | [
"async",
"def",
"async_send",
"(",
"self",
",",
"request",
",",
"headers",
"=",
"None",
",",
"content",
"=",
"None",
",",
"*",
"*",
"config",
")",
":",
"loop",
"=",
"asyncio",
".",
"get_event_loop",
"(",
")",
"if",
"self",
".",
"config",
".",
"keep_a... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | AsyncServiceClientMixin.stream_download_async | Async Generator for streaming request body data.
:param response: The initial response
:param user_callback: Custom callback for monitoring progress. | libraries/botframework-connector/botframework/connector/async_mixin/async_mixin.py | def stream_download_async(self, response, user_callback):
"""Async Generator for streaming request body data.
:param response: The initial response
:param user_callback: Custom callback for monitoring progress.
"""
block = self.config.connection.data_block_size
return Str... | def stream_download_async(self, response, user_callback):
"""Async Generator for streaming request body data.
:param response: The initial response
:param user_callback: Custom callback for monitoring progress.
"""
block = self.config.connection.data_block_size
return Str... | [
"Async",
"Generator",
"for",
"streaming",
"request",
"body",
"data",
".",
":",
"param",
"response",
":",
"The",
"initial",
"response",
":",
"param",
"user_callback",
":",
"Custom",
"callback",
"for",
"monitoring",
"progress",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/async_mixin/async_mixin.py#L135-L141 | [
"def",
"stream_download_async",
"(",
"self",
",",
"response",
",",
"user_callback",
")",
":",
"block",
"=",
"self",
".",
"config",
".",
"connection",
".",
"data_block_size",
"return",
"StreamDownloadGenerator",
"(",
"response",
",",
"user_callback",
",",
"block",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.read | Read storeitems from storage.
:param keys:
:return dict: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | async def read(self, keys: List[str]) -> dict:
"""Read storeitems from storage.
:param keys:
:return dict:
"""
try:
# check if the database and container exists and if not create
if not self.__container_exists:
self.__create_db_and_contain... | async def read(self, keys: List[str]) -> dict:
"""Read storeitems from storage.
:param keys:
:return dict:
"""
try:
# check if the database and container exists and if not create
if not self.__container_exists:
self.__create_db_and_contain... | [
"Read",
"storeitems",
"from",
"storage",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L58-L98 | [
"async",
"def",
"read",
"(",
"self",
",",
"keys",
":",
"List",
"[",
"str",
"]",
")",
"->",
"dict",
":",
"try",
":",
"# check if the database and container exists and if not create",
"if",
"not",
"self",
".",
"__container_exists",
":",
"self",
".",
"__create_db_a... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.write | Save storeitems to storage.
:param changes:
:return: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | async def write(self, changes: Dict[str, StoreItem]):
"""Save storeitems to storage.
:param changes:
:return:
"""
try:
# check if the database and container exists and if not create
if not self.__container_exists:
self.__create_db_and_cont... | async def write(self, changes: Dict[str, StoreItem]):
"""Save storeitems to storage.
:param changes:
:return:
"""
try:
# check if the database and container exists and if not create
if not self.__container_exists:
self.__create_db_and_cont... | [
"Save",
"storeitems",
"to",
"storage",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L100-L139 | [
"async",
"def",
"write",
"(",
"self",
",",
"changes",
":",
"Dict",
"[",
"str",
",",
"StoreItem",
"]",
")",
":",
"try",
":",
"# check if the database and container exists and if not create",
"if",
"not",
"self",
".",
"__container_exists",
":",
"self",
".",
"__cre... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.delete | Remove storeitems from storage.
:param keys:
:return: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | async def delete(self, keys: List[str]):
"""Remove storeitems from storage.
:param keys:
:return:
"""
try:
# check if the database and container exists and if not create
if not self.__container_exists:
self.__create_db_and_container()
... | async def delete(self, keys: List[str]):
"""Remove storeitems from storage.
:param keys:
:return:
"""
try:
# check if the database and container exists and if not create
if not self.__container_exists:
self.__create_db_and_container()
... | [
"Remove",
"storeitems",
"from",
"storage",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L141-L161 | [
"async",
"def",
"delete",
"(",
"self",
",",
"keys",
":",
"List",
"[",
"str",
"]",
")",
":",
"try",
":",
"# check if the database and container exists and if not create",
"if",
"not",
"self",
".",
"__container_exists",
":",
"self",
".",
"__create_db_and_container",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.__create_si | Create a StoreItem from a result out of CosmosDB.
:param result:
:return StoreItem: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | def __create_si(self, result) -> StoreItem:
"""Create a StoreItem from a result out of CosmosDB.
:param result:
:return StoreItem:
"""
# get the document item from the result and turn into a dict
doc = result.get('document')
# readd the e_tag from Cosmos
... | def __create_si(self, result) -> StoreItem:
"""Create a StoreItem from a result out of CosmosDB.
:param result:
:return StoreItem:
"""
# get the document item from the result and turn into a dict
doc = result.get('document')
# readd the e_tag from Cosmos
... | [
"Create",
"a",
"StoreItem",
"from",
"a",
"result",
"out",
"of",
"CosmosDB",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L163-L174 | [
"def",
"__create_si",
"(",
"self",
",",
"result",
")",
"->",
"StoreItem",
":",
"# get the document item from the result and turn into a dict",
"doc",
"=",
"result",
".",
"get",
"(",
"'document'",
")",
"# readd the e_tag from Cosmos",
"doc",
"[",
"'e_tag'",
"]",
"=",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.__create_dict | Return the dict of a StoreItem.
This eliminates non_magic attributes and the e_tag.
:param si:
:return dict: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | def __create_dict(self, si: StoreItem) -> Dict:
"""Return the dict of a StoreItem.
This eliminates non_magic attributes and the e_tag.
:param si:
:return dict:
"""
# read the content
non_magic_attr = ([attr for attr in dir(si)
if not at... | def __create_dict(self, si: StoreItem) -> Dict:
"""Return the dict of a StoreItem.
This eliminates non_magic attributes and the e_tag.
:param si:
:return dict:
"""
# read the content
non_magic_attr = ([attr for attr in dir(si)
if not at... | [
"Return",
"the",
"dict",
"of",
"a",
"StoreItem",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L176-L189 | [
"def",
"__create_dict",
"(",
"self",
",",
"si",
":",
"StoreItem",
")",
"->",
"Dict",
":",
"# read the content",
"non_magic_attr",
"=",
"(",
"[",
"attr",
"for",
"attr",
"in",
"dir",
"(",
"si",
")",
"if",
"not",
"attr",
".",
"startswith",
"(",
"'_'",
")"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.__sanitize_key | Return the sanitized key.
Replace characters that are not allowed in keys in Cosmos.
:param key:
:return str: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | def __sanitize_key(self, key) -> str:
"""Return the sanitized key.
Replace characters that are not allowed in keys in Cosmos.
:param key:
:return str:
"""
# forbidden characters
bad_chars = ['\\', '?', '/', '#', '\t', '\n', '\r']
# replace those with wit... | def __sanitize_key(self, key) -> str:
"""Return the sanitized key.
Replace characters that are not allowed in keys in Cosmos.
:param key:
:return str:
"""
# forbidden characters
bad_chars = ['\\', '?', '/', '#', '\t', '\n', '\r']
# replace those with wit... | [
"Return",
"the",
"sanitized",
"key",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L191-L207 | [
"def",
"__sanitize_key",
"(",
"self",
",",
"key",
")",
"->",
"str",
":",
"# forbidden characters",
"bad_chars",
"=",
"[",
"'\\\\'",
",",
"'?'",
",",
"'/'",
",",
"'#'",
",",
"'\\t'",
",",
"'\\n'",
",",
"'\\r'",
"]",
"# replace those with with '*' and the",
"#... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.__create_db_and_container | Call the get or create methods. | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | def __create_db_and_container(self):
"""Call the get or create methods."""
db_id = self.config.database
container_name = self.config.container
self.db = self.__get_or_create_database(self.client, db_id)
self.container = self.__get_or_create_container(
self.client, con... | def __create_db_and_container(self):
"""Call the get or create methods."""
db_id = self.config.database
container_name = self.config.container
self.db = self.__get_or_create_database(self.client, db_id)
self.container = self.__get_or_create_container(
self.client, con... | [
"Call",
"the",
"get",
"or",
"create",
"methods",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L242-L249 | [
"def",
"__create_db_and_container",
"(",
"self",
")",
":",
"db_id",
"=",
"self",
".",
"config",
".",
"database",
"container_name",
"=",
"self",
".",
"config",
".",
"container",
"self",
".",
"db",
"=",
"self",
".",
"__get_or_create_database",
"(",
"self",
"."... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.__get_or_create_database | Return the database link.
Check if the database exists or create the db.
:param doc_client:
:param id:
:return str: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | def __get_or_create_database(self, doc_client, id) -> str:
"""Return the database link.
Check if the database exists or create the db.
:param doc_client:
:param id:
:return str:
"""
# query CosmosDB for a database with that name/id
dbs = list(doc_client.... | def __get_or_create_database(self, doc_client, id) -> str:
"""Return the database link.
Check if the database exists or create the db.
:param doc_client:
:param id:
:return str:
"""
# query CosmosDB for a database with that name/id
dbs = list(doc_client.... | [
"Return",
"the",
"database",
"link",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L251-L273 | [
"def",
"__get_or_create_database",
"(",
"self",
",",
"doc_client",
",",
"id",
")",
"->",
"str",
":",
"# query CosmosDB for a database with that name/id",
"dbs",
"=",
"list",
"(",
"doc_client",
".",
"QueryDatabases",
"(",
"{",
"\"query\"",
":",
"\"SELECT * FROM r WHERE... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CosmosDbStorage.__get_or_create_container | Return the container link.
Check if the container exists or create the container.
:param doc_client:
:param container:
:return str: | libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py | def __get_or_create_container(self, doc_client, container) -> str:
"""Return the container link.
Check if the container exists or create the container.
:param doc_client:
:param container:
:return str:
"""
# query CosmosDB for a container in the database with th... | def __get_or_create_container(self, doc_client, container) -> str:
"""Return the container link.
Check if the container exists or create the container.
:param doc_client:
:param container:
:return str:
"""
# query CosmosDB for a container in the database with th... | [
"Return",
"the",
"container",
"link",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-azure/botbuilder/azure/cosmosdb_storage.py#L275-L301 | [
"def",
"__get_or_create_container",
"(",
"self",
",",
"doc_client",
",",
"container",
")",
"->",
"str",
":",
"# query CosmosDB for a container in the database with that name",
"containers",
"=",
"list",
"(",
"doc_client",
".",
"QueryContainers",
"(",
"self",
".",
"__dat... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | QnAMaker.fill_qna_event | Fills the event properties and metrics for the QnaMessage event for telemetry.
:return: A tuple of event data properties and metrics that will be sent to the BotTelemetryClient.track_event() method for the QnAMessage event. The properties and metrics returned the standard properties logged with any properties ... | libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py | def fill_qna_event(
self,
query_results: [QueryResult],
turn_context: TurnContext,
telemetry_properties: Dict[str,str] = None,
telemetry_metrics: Dict[str,float] = None
) -> EventData:
"""
Fills the event properties and metrics for the QnaMessage event for tel... | def fill_qna_event(
self,
query_results: [QueryResult],
turn_context: TurnContext,
telemetry_properties: Dict[str,str] = None,
telemetry_metrics: Dict[str,float] = None
) -> EventData:
"""
Fills the event properties and metrics for the QnaMessage event for tel... | [
"Fills",
"the",
"event",
"properties",
"and",
"metrics",
"for",
"the",
"QnaMessage",
"event",
"for",
"telemetry",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py#L110-L172 | [
"def",
"fill_qna_event",
"(",
"self",
",",
"query_results",
":",
"[",
"QueryResult",
"]",
",",
"turn_context",
":",
"TurnContext",
",",
"telemetry_properties",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
"=",
"None",
",",
"telemetry_metrics",
":",
"Dict",
"[",... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | QnAMaker.get_answers | Generates answers from the knowledge base.
:return: A list of answers for the user's query, sorted in decreasing order of ranking score.
:rtype: [QueryResult] | libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py | async def get_answers(
self,
context: TurnContext,
options: QnAMakerOptions = None,
telemetry_properties: Dict[str,str] = None,
telemetry_metrics: Dict[str,int] = None
) -> [QueryResult]:
"""
Generates answers from the knowledge base.
:retu... | async def get_answers(
self,
context: TurnContext,
options: QnAMakerOptions = None,
telemetry_properties: Dict[str,str] = None,
telemetry_metrics: Dict[str,int] = None
) -> [QueryResult]:
"""
Generates answers from the knowledge base.
:retu... | [
"Generates",
"answers",
"from",
"the",
"knowledge",
"base",
".",
":",
"return",
":",
"A",
"list",
"of",
"answers",
"for",
"the",
"user",
"s",
"query",
"sorted",
"in",
"decreasing",
"order",
"of",
"ranking",
"score",
".",
":",
"rtype",
":",
"[",
"QueryRes... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py#L174-L197 | [
"async",
"def",
"get_answers",
"(",
"self",
",",
"context",
":",
"TurnContext",
",",
"options",
":",
"QnAMakerOptions",
"=",
"None",
",",
"telemetry_properties",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
"=",
"None",
",",
"telemetry_metrics",
":",
"Dict",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | QnAMaker._hydrate_options | Combines QnAMakerOptions passed into the QnAMaker constructor with the options passed as arguments into get_answers().
:return: QnAMakerOptions with options passed into constructor overwritten by new options passed into get_answers()
:rtype: QnAMakerOptions | libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py | def _hydrate_options(self, query_options: QnAMakerOptions) -> QnAMakerOptions:
"""
Combines QnAMakerOptions passed into the QnAMaker constructor with the options passed as arguments into get_answers().
:return: QnAMakerOptions with options passed into constructor overwritten by new opti... | def _hydrate_options(self, query_options: QnAMakerOptions) -> QnAMakerOptions:
"""
Combines QnAMakerOptions passed into the QnAMaker constructor with the options passed as arguments into get_answers().
:return: QnAMakerOptions with options passed into constructor overwritten by new opti... | [
"Combines",
"QnAMakerOptions",
"passed",
"into",
"the",
"QnAMaker",
"constructor",
"with",
"the",
"options",
"passed",
"as",
"arguments",
"into",
"get_answers",
"()",
".",
":",
"return",
":",
"QnAMakerOptions",
"with",
"options",
"passed",
"into",
"constructor",
"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py#L215-L239 | [
"def",
"_hydrate_options",
"(",
"self",
",",
"query_options",
":",
"QnAMakerOptions",
")",
"->",
"QnAMakerOptions",
":",
"hydrated_options",
"=",
"copy",
"(",
"self",
".",
"_options",
")",
"if",
"query_options",
":",
"if",
"(",
"query_options",
".",
"score_thres... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.copy_to | Called when this TurnContext instance is passed into the constructor of a new TurnContext
instance. Can be overridden in derived classes.
:param context:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | def copy_to(self, context: 'TurnContext') -> None:
"""
Called when this TurnContext instance is passed into the constructor of a new TurnContext
instance. Can be overridden in derived classes.
:param context:
:return:
"""
for attribute in ['adapter', 'activity', '... | def copy_to(self, context: 'TurnContext') -> None:
"""
Called when this TurnContext instance is passed into the constructor of a new TurnContext
instance. Can be overridden in derived classes.
:param context:
:return:
"""
for attribute in ['adapter', 'activity', '... | [
"Called",
"when",
"this",
"TurnContext",
"instance",
"is",
"passed",
"into",
"the",
"constructor",
"of",
"a",
"new",
"TurnContext",
"instance",
".",
"Can",
"be",
"overridden",
"in",
"derived",
"classes",
".",
":",
"param",
"context",
":",
":",
"return",
":"
... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L48-L57 | [
"def",
"copy_to",
"(",
"self",
",",
"context",
":",
"'TurnContext'",
")",
"->",
"None",
":",
"for",
"attribute",
"in",
"[",
"'adapter'",
",",
"'activity'",
",",
"'_responded'",
",",
"'_services'",
",",
"'_on_send_activities'",
",",
"'_on_update_activity'",
",",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.activity | Used to set TurnContext._activity when a context object is created. Only takes instances of Activities.
:param value:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | def activity(self, value):
"""
Used to set TurnContext._activity when a context object is created. Only takes instances of Activities.
:param value:
:return:
"""
if not isinstance(value, Activity):
raise TypeError('TurnContext: cannot set `activity` to a type ... | def activity(self, value):
"""
Used to set TurnContext._activity when a context object is created. Only takes instances of Activities.
:param value:
:return:
"""
if not isinstance(value, Activity):
raise TypeError('TurnContext: cannot set `activity` to a type ... | [
"Used",
"to",
"set",
"TurnContext",
".",
"_activity",
"when",
"a",
"context",
"object",
"is",
"created",
".",
"Only",
"takes",
"instances",
"of",
"Activities",
".",
":",
"param",
"value",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L68-L77 | [
"def",
"activity",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"Activity",
")",
":",
"raise",
"TypeError",
"(",
"'TurnContext: cannot set `activity` to a type other than Activity.'",
")",
"else",
":",
"self",
".",
"_activity"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.has | Returns True is set() has been called for a key. The cached value may be of type 'None'.
:param key:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | def has(self, key: str) -> bool:
"""
Returns True is set() has been called for a key. The cached value may be of type 'None'.
:param key:
:return:
"""
if key in self._services:
return True
return False | def has(self, key: str) -> bool:
"""
Returns True is set() has been called for a key. The cached value may be of type 'None'.
:param key:
:return:
"""
if key in self._services:
return True
return False | [
"Returns",
"True",
"is",
"set",
"()",
"has",
"been",
"called",
"for",
"a",
"key",
".",
"The",
"cached",
"value",
"may",
"be",
"of",
"type",
"None",
".",
":",
"param",
"key",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L110-L118 | [
"def",
"has",
"(",
"self",
",",
"key",
":",
"str",
")",
"->",
"bool",
":",
"if",
"key",
"in",
"self",
".",
"_services",
":",
"return",
"True",
"return",
"False"
] | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.set | Caches a value for the lifetime of the current turn.
:param key:
:param value:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | def set(self, key: str, value: object) -> None:
"""
Caches a value for the lifetime of the current turn.
:param key:
:param value:
:return:
"""
if not key or not isinstance(key, str):
raise KeyError('"key" must be a valid string.')
self._servi... | def set(self, key: str, value: object) -> None:
"""
Caches a value for the lifetime of the current turn.
:param key:
:param value:
:return:
"""
if not key or not isinstance(key, str):
raise KeyError('"key" must be a valid string.')
self._servi... | [
"Caches",
"a",
"value",
"for",
"the",
"lifetime",
"of",
"the",
"current",
"turn",
".",
":",
"param",
"key",
":",
":",
"param",
"value",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L120-L130 | [
"def",
"set",
"(",
"self",
",",
"key",
":",
"str",
",",
"value",
":",
"object",
")",
"->",
"None",
":",
"if",
"not",
"key",
"or",
"not",
"isinstance",
"(",
"key",
",",
"str",
")",
":",
"raise",
"KeyError",
"(",
"'\"key\" must be a valid string.'",
")",... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.send_activity | Sends a single activity or message to the user.
:param activity_or_text:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | async def send_activity(self, *activity_or_text: Union[Activity, str]) -> ResourceResponse:
"""
Sends a single activity or message to the user.
:param activity_or_text:
:return:
"""
reference = TurnContext.get_conversation_reference(self.activity)
output = [TurnC... | async def send_activity(self, *activity_or_text: Union[Activity, str]) -> ResourceResponse:
"""
Sends a single activity or message to the user.
:param activity_or_text:
:return:
"""
reference = TurnContext.get_conversation_reference(self.activity)
output = [TurnC... | [
"Sends",
"a",
"single",
"activity",
"or",
"message",
"to",
"the",
"user",
".",
":",
"param",
"activity_or_text",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L132-L151 | [
"async",
"def",
"send_activity",
"(",
"self",
",",
"*",
"activity_or_text",
":",
"Union",
"[",
"Activity",
",",
"str",
"]",
")",
"->",
"ResourceResponse",
":",
"reference",
"=",
"TurnContext",
".",
"get_conversation_reference",
"(",
"self",
".",
"activity",
")... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.update_activity | Replaces an existing activity.
:param activity:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | async def update_activity(self, activity: Activity):
"""
Replaces an existing activity.
:param activity:
:return:
"""
return await self._emit(self._on_update_activity, activity, self.adapter.update_activity(self, activity)) | async def update_activity(self, activity: Activity):
"""
Replaces an existing activity.
:param activity:
:return:
"""
return await self._emit(self._on_update_activity, activity, self.adapter.update_activity(self, activity)) | [
"Replaces",
"an",
"existing",
"activity",
".",
":",
"param",
"activity",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L153-L159 | [
"async",
"def",
"update_activity",
"(",
"self",
",",
"activity",
":",
"Activity",
")",
":",
"return",
"await",
"self",
".",
"_emit",
"(",
"self",
".",
"_on_update_activity",
",",
"activity",
",",
"self",
".",
"adapter",
".",
"update_activity",
"(",
"self",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.delete_activity | Deletes an existing activity.
:param id_or_reference:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | async def delete_activity(self, id_or_reference: Union[str, ConversationReference]):
"""
Deletes an existing activity.
:param id_or_reference:
:return:
"""
if type(id_or_reference) == str:
reference = TurnContext.get_conversation_reference(self.activity)
... | async def delete_activity(self, id_or_reference: Union[str, ConversationReference]):
"""
Deletes an existing activity.
:param id_or_reference:
:return:
"""
if type(id_or_reference) == str:
reference = TurnContext.get_conversation_reference(self.activity)
... | [
"Deletes",
"an",
"existing",
"activity",
".",
":",
"param",
"id_or_reference",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L161-L172 | [
"async",
"def",
"delete_activity",
"(",
"self",
",",
"id_or_reference",
":",
"Union",
"[",
"str",
",",
"ConversationReference",
"]",
")",
":",
"if",
"type",
"(",
"id_or_reference",
")",
"==",
"str",
":",
"reference",
"=",
"TurnContext",
".",
"get_conversation_... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.get_conversation_reference | Returns the conversation reference for an activity. This can be saved as a plain old JSON
object and then later used to message the user proactively.
Usage Example:
reference = TurnContext.get_conversation_reference(context.request)
:param activity:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | def get_conversation_reference(activity: Activity) -> ConversationReference:
"""
Returns the conversation reference for an activity. This can be saved as a plain old JSON
object and then later used to message the user proactively.
Usage Example:
reference = TurnContext.get_conve... | def get_conversation_reference(activity: Activity) -> ConversationReference:
"""
Returns the conversation reference for an activity. This can be saved as a plain old JSON
object and then later used to message the user proactively.
Usage Example:
reference = TurnContext.get_conve... | [
"Returns",
"the",
"conversation",
"reference",
"for",
"an",
"activity",
".",
"This",
"can",
"be",
"saved",
"as",
"a",
"plain",
"old",
"JSON",
"object",
"and",
"then",
"later",
"used",
"to",
"message",
"the",
"user",
"proactively",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L219-L234 | [
"def",
"get_conversation_reference",
"(",
"activity",
":",
"Activity",
")",
"->",
"ConversationReference",
":",
"return",
"ConversationReference",
"(",
"activity_id",
"=",
"activity",
".",
"id",
",",
"user",
"=",
"copy",
"(",
"activity",
".",
"from_property",
")",... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | TurnContext.apply_conversation_reference | Updates an activity with the delivery information from a conversation reference. Calling
this after get_conversation_reference on an incoming activity
will properly address the reply to a received activity.
:param activity:
:param reference:
:param is_incoming:
:return: | libraries/botbuilder-core/botbuilder/core/turn_context.py | def apply_conversation_reference(activity: Activity,
reference: ConversationReference,
is_incoming: bool=False) -> Activity:
"""
Updates an activity with the delivery information from a conversation reference. Calling
this... | def apply_conversation_reference(activity: Activity,
reference: ConversationReference,
is_incoming: bool=False) -> Activity:
"""
Updates an activity with the delivery information from a conversation reference. Calling
this... | [
"Updates",
"an",
"activity",
"with",
"the",
"delivery",
"information",
"from",
"a",
"conversation",
"reference",
".",
"Calling",
"this",
"after",
"get_conversation_reference",
"on",
"an",
"incoming",
"activity",
"will",
"properly",
"address",
"the",
"reply",
"to",
... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/turn_context.py#L237-L263 | [
"def",
"apply_conversation_reference",
"(",
"activity",
":",
"Activity",
",",
"reference",
":",
"ConversationReference",
",",
"is_incoming",
":",
"bool",
"=",
"False",
")",
"->",
"Activity",
":",
"activity",
".",
"channel_id",
"=",
"reference",
".",
"channel_id",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | WaterfallDialog.add_step | Adds a new step to the waterfall.
:param step: Step to add
:return: Waterfall dialog for fluent calls to `add_step()`. | libraries/botbuilder-dialogs/botbuilder/dialogs/waterfall_dialog.py | def add_step(self, step):
"""
Adds a new step to the waterfall.
:param step: Step to add
:return: Waterfall dialog for fluent calls to `add_step()`.
"""
if not step:
raise TypeError('WaterfallDialog.add_step(): step cannot be None.')
self.... | def add_step(self, step):
"""
Adds a new step to the waterfall.
:param step: Step to add
:return: Waterfall dialog for fluent calls to `add_step()`.
"""
if not step:
raise TypeError('WaterfallDialog.add_step(): step cannot be None.')
self.... | [
"Adds",
"a",
"new",
"step",
"to",
"the",
"waterfall",
".",
":",
"param",
"step",
":",
"Step",
"to",
"add",
":",
"return",
":",
"Waterfall",
"dialog",
"for",
"fluent",
"calls",
"to",
"add_step",
"()",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/waterfall_dialog.py#L36-L47 | [
"def",
"add_step",
"(",
"self",
",",
"step",
")",
":",
"if",
"not",
"step",
":",
"raise",
"TypeError",
"(",
"'WaterfallDialog.add_step(): step cannot be None.'",
")",
"self",
".",
"_steps",
".",
"append",
"(",
"step",
")",
"return",
"self"
] | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | WaterfallDialog.get_step_name | Give the waterfall step a unique name | libraries/botbuilder-dialogs/botbuilder/dialogs/waterfall_dialog.py | def get_step_name(self, index: int) -> str:
"""
Give the waterfall step a unique name
"""
step_name = self._steps[index].__qualname__
if not step_name or ">" in step_name :
step_name = f"Step{index + 1}of{len(self._steps)}"
return step_name | def get_step_name(self, index: int) -> str:
"""
Give the waterfall step a unique name
"""
step_name = self._steps[index].__qualname__
if not step_name or ">" in step_name :
step_name = f"Step{index + 1}of{len(self._steps)}"
return step_name | [
"Give",
"the",
"waterfall",
"step",
"a",
"unique",
"name"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/waterfall_dialog.py#L141-L150 | [
"def",
"get_step_name",
"(",
"self",
",",
"index",
":",
"int",
")",
"->",
"str",
":",
"step_name",
"=",
"self",
".",
"_steps",
"[",
"index",
"]",
".",
"__qualname__",
"if",
"not",
"step_name",
"or",
"\">\"",
"in",
"step_name",
":",
"step_name",
"=",
"f... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | NullTelemetryClient.track_event | Send information about a single event that has occurred in the context of the application.
:param name: the data to associate to this event.
:param properties: the set of custom properties the client wants attached to this data item. (defaults to: None)
:param measurements: the set of custom mea... | libraries/botbuilder-core/botbuilder/core/null_telemetry_client.py | def track_event(self, name: str, properties: Dict[str, object] = None,
measurements: Dict[str, object] = None) -> None:
"""
Send information about a single event that has occurred in the context of the application.
:param name: the data to associate to this event.
:... | def track_event(self, name: str, properties: Dict[str, object] = None,
measurements: Dict[str, object] = None) -> None:
"""
Send information about a single event that has occurred in the context of the application.
:param name: the data to associate to this event.
:... | [
"Send",
"information",
"about",
"a",
"single",
"event",
"that",
"has",
"occurred",
"in",
"the",
"context",
"of",
"the",
"application",
".",
":",
"param",
"name",
":",
"the",
"data",
"to",
"associate",
"to",
"this",
"event",
".",
":",
"param",
"properties",... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/null_telemetry_client.py#L37-L45 | [
"def",
"track_event",
"(",
"self",
",",
"name",
":",
"str",
",",
"properties",
":",
"Dict",
"[",
"str",
",",
"object",
"]",
"=",
"None",
",",
"measurements",
":",
"Dict",
"[",
"str",
",",
"object",
"]",
"=",
"None",
")",
"->",
"None",
":",
"pass"
] | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | calculate_change_hash | Utility function to calculate a change hash for a `StoreItem`.
:param item:
:return: | libraries/botbuilder-core/botbuilder/core/storage.py | def calculate_change_hash(item: StoreItem) -> str:
"""
Utility function to calculate a change hash for a `StoreItem`.
:param item:
:return:
"""
cpy = copy(item)
if cpy.e_tag is not None:
del cpy.e_tag
return str(cpy) | def calculate_change_hash(item: StoreItem) -> str:
"""
Utility function to calculate a change hash for a `StoreItem`.
:param item:
:return:
"""
cpy = copy(item)
if cpy.e_tag is not None:
del cpy.e_tag
return str(cpy) | [
"Utility",
"function",
"to",
"calculate",
"a",
"change",
"hash",
"for",
"a",
"StoreItem",
".",
":",
"param",
"item",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/storage.py#L62-L71 | [
"def",
"calculate_change_hash",
"(",
"item",
":",
"StoreItem",
")",
"->",
"str",
":",
"cpy",
"=",
"copy",
"(",
"item",
")",
"if",
"cpy",
".",
"e_tag",
"is",
"not",
"None",
":",
"del",
"cpy",
".",
"e_tag",
"return",
"str",
"(",
"cpy",
")"
] | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.begin_dialog | Pushes a new dialog onto the dialog stack.
:param dialog_id: ID of the dialog to start..
:param options: (Optional) additional argument(s) to pass to the dialog being started. | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def begin_dialog(self, dialog_id: str, options: object = None):
"""
Pushes a new dialog onto the dialog stack.
:param dialog_id: ID of the dialog to start..
:param options: (Optional) additional argument(s) to pass to the dialog being started.
"""
if (not dialog_id)... | async def begin_dialog(self, dialog_id: str, options: object = None):
"""
Pushes a new dialog onto the dialog stack.
:param dialog_id: ID of the dialog to start..
:param options: (Optional) additional argument(s) to pass to the dialog being started.
"""
if (not dialog_id)... | [
"Pushes",
"a",
"new",
"dialog",
"onto",
"the",
"dialog",
"stack",
".",
":",
"param",
"dialog_id",
":",
"ID",
"of",
"the",
"dialog",
"to",
"start",
"..",
":",
"param",
"options",
":",
"(",
"Optional",
")",
"additional",
"argument",
"(",
"s",
")",
"to",
... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L87-L109 | [
"async",
"def",
"begin_dialog",
"(",
"self",
",",
"dialog_id",
":",
"str",
",",
"options",
":",
"object",
"=",
"None",
")",
":",
"if",
"(",
"not",
"dialog_id",
")",
":",
"raise",
"TypeError",
"(",
"'Dialog(): dialogId cannot be None.'",
")",
"# Look up dialog"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.prompt | Helper function to simplify formatting the options for calling a prompt dialog. This helper will
take a `PromptOptions` argument and then call.
:param dialog_id: ID of the prompt to start.
:param options: Contains a Prompt, potentially a RetryPrompt and if using ChoicePrompt, Choices.
:r... | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def prompt(self, dialog_id: str, options) -> DialogTurnResult:
"""
Helper function to simplify formatting the options for calling a prompt dialog. This helper will
take a `PromptOptions` argument and then call.
:param dialog_id: ID of the prompt to start.
:param options: Co... | async def prompt(self, dialog_id: str, options) -> DialogTurnResult:
"""
Helper function to simplify formatting the options for calling a prompt dialog. This helper will
take a `PromptOptions` argument and then call.
:param dialog_id: ID of the prompt to start.
:param options: Co... | [
"Helper",
"function",
"to",
"simplify",
"formatting",
"the",
"options",
"for",
"calling",
"a",
"prompt",
"dialog",
".",
"This",
"helper",
"will",
"take",
"a",
"PromptOptions",
"argument",
"and",
"then",
"call",
".",
":",
"param",
"dialog_id",
":",
"ID",
"of"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L112-L126 | [
"async",
"def",
"prompt",
"(",
"self",
",",
"dialog_id",
":",
"str",
",",
"options",
")",
"->",
"DialogTurnResult",
":",
"if",
"(",
"not",
"dialog_id",
")",
":",
"raise",
"TypeError",
"(",
"'DialogContext.prompt(): dialogId cannot be None.'",
")",
"if",
"(",
"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.continue_dialog | Continues execution of the active dialog, if there is one, by passing the context object to
its `Dialog.continue_dialog()` method. You can check `turn_context.responded` after the call completes
to determine if a dialog was run and a reply was sent to the user.
:return: | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def continue_dialog(self):
"""
Continues execution of the active dialog, if there is one, by passing the context object to
its `Dialog.continue_dialog()` method. You can check `turn_context.responded` after the call completes
to determine if a dialog was run and a reply was sent to... | async def continue_dialog(self):
"""
Continues execution of the active dialog, if there is one, by passing the context object to
its `Dialog.continue_dialog()` method. You can check `turn_context.responded` after the call completes
to determine if a dialog was run and a reply was sent to... | [
"Continues",
"execution",
"of",
"the",
"active",
"dialog",
"if",
"there",
"is",
"one",
"by",
"passing",
"the",
"context",
"object",
"to",
"its",
"Dialog",
".",
"continue_dialog",
"()",
"method",
".",
"You",
"can",
"check",
"turn_context",
".",
"responded",
"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L129-L146 | [
"async",
"def",
"continue_dialog",
"(",
"self",
")",
":",
"# Check for a dialog on the stack",
"if",
"self",
".",
"active_dialog",
"!=",
"None",
":",
"# Look up dialog",
"dialog",
"=",
"await",
"self",
".",
"find_dialog",
"(",
"self",
".",
"active_dialog",
".",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.end_dialog | Ends a dialog by popping it off the stack and returns an optional result to the dialog's
parent. The parent dialog is the dialog that started the dialog being ended via a call to
either "begin_dialog" or "prompt".
The parent dialog will have its `Dialog.resume_dialog()` method invoked with any r... | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def end_dialog(self, result: object = None):
"""
Ends a dialog by popping it off the stack and returns an optional result to the dialog's
parent. The parent dialog is the dialog that started the dialog being ended via a call to
either "begin_dialog" or "prompt".
The parent ... | async def end_dialog(self, result: object = None):
"""
Ends a dialog by popping it off the stack and returns an optional result to the dialog's
parent. The parent dialog is the dialog that started the dialog being ended via a call to
either "begin_dialog" or "prompt".
The parent ... | [
"Ends",
"a",
"dialog",
"by",
"popping",
"it",
"off",
"the",
"stack",
"and",
"returns",
"an",
"optional",
"result",
"to",
"the",
"dialog",
"s",
"parent",
".",
"The",
"parent",
"dialog",
"is",
"the",
"dialog",
"that",
"started",
"the",
"dialog",
"being",
"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L149-L173 | [
"async",
"def",
"end_dialog",
"(",
"self",
",",
"result",
":",
"object",
"=",
"None",
")",
":",
"await",
"self",
".",
"end_active_dialog",
"(",
"DialogReason",
".",
"EndCalled",
")",
"# Resume previous dialog",
"if",
"self",
".",
"active_dialog",
"!=",
"None",... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.cancel_all_dialogs | Deletes any existing dialog stack thus cancelling all dialogs on the stack.
:param result: (Optional) result to pass to the parent dialogs.
:return: | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def cancel_all_dialogs(self):
"""
Deletes any existing dialog stack thus cancelling all dialogs on the stack.
:param result: (Optional) result to pass to the parent dialogs.
:return:
"""
if (len(self.stack) > 0):
while (len(self.stack) > 0):
... | async def cancel_all_dialogs(self):
"""
Deletes any existing dialog stack thus cancelling all dialogs on the stack.
:param result: (Optional) result to pass to the parent dialogs.
:return:
"""
if (len(self.stack) > 0):
while (len(self.stack) > 0):
... | [
"Deletes",
"any",
"existing",
"dialog",
"stack",
"thus",
"cancelling",
"all",
"dialogs",
"on",
"the",
"stack",
".",
":",
"param",
"result",
":",
"(",
"Optional",
")",
"result",
"to",
"pass",
"to",
"the",
"parent",
"dialogs",
".",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L176-L187 | [
"async",
"def",
"cancel_all_dialogs",
"(",
"self",
")",
":",
"if",
"(",
"len",
"(",
"self",
".",
"stack",
")",
">",
"0",
")",
":",
"while",
"(",
"len",
"(",
"self",
".",
"stack",
")",
">",
"0",
")",
":",
"await",
"self",
".",
"end_active_dialog",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.find_dialog | If the dialog cannot be found within the current `DialogSet`, the parent `DialogContext`
will be searched if there is one.
:param dialog_id: ID of the dialog to search for.
:return: | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def find_dialog(self, dialog_id: str) -> Dialog:
"""
If the dialog cannot be found within the current `DialogSet`, the parent `DialogContext`
will be searched if there is one.
:param dialog_id: ID of the dialog to search for.
:return:
"""
dialog = await self... | async def find_dialog(self, dialog_id: str) -> Dialog:
"""
If the dialog cannot be found within the current `DialogSet`, the parent `DialogContext`
will be searched if there is one.
:param dialog_id: ID of the dialog to search for.
:return:
"""
dialog = await self... | [
"If",
"the",
"dialog",
"cannot",
"be",
"found",
"within",
"the",
"current",
"DialogSet",
"the",
"parent",
"DialogContext",
"will",
"be",
"searched",
"if",
"there",
"is",
"one",
".",
":",
"param",
"dialog_id",
":",
"ID",
"of",
"the",
"dialog",
"to",
"search... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L189-L200 | [
"async",
"def",
"find_dialog",
"(",
"self",
",",
"dialog_id",
":",
"str",
")",
"->",
"Dialog",
":",
"dialog",
"=",
"await",
"self",
".",
"dialogs",
".",
"find",
"(",
"dialog_id",
")",
"if",
"(",
"dialog",
"==",
"None",
"and",
"self",
".",
"parent",
"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.replace_dialog | Ends the active dialog and starts a new dialog in its place. This is particularly useful
for creating loops or redirecting to another dialog.
:param dialog_id: ID of the dialog to search for.
:param options: (Optional) additional argument(s) to pass to the new dialog.
:return: | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def replace_dialog(self, dialog_id: str, options: object = None) -> DialogTurnResult:
"""
Ends the active dialog and starts a new dialog in its place. This is particularly useful
for creating loops or redirecting to another dialog.
:param dialog_id: ID of the dialog to search for.
... | async def replace_dialog(self, dialog_id: str, options: object = None) -> DialogTurnResult:
"""
Ends the active dialog and starts a new dialog in its place. This is particularly useful
for creating loops or redirecting to another dialog.
:param dialog_id: ID of the dialog to search for.
... | [
"Ends",
"the",
"active",
"dialog",
"and",
"starts",
"a",
"new",
"dialog",
"in",
"its",
"place",
".",
"This",
"is",
"particularly",
"useful",
"for",
"creating",
"loops",
"or",
"redirecting",
"to",
"another",
"dialog",
".",
":",
"param",
"dialog_id",
":",
"I... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L202-L214 | [
"async",
"def",
"replace_dialog",
"(",
"self",
",",
"dialog_id",
":",
"str",
",",
"options",
":",
"object",
"=",
"None",
")",
"->",
"DialogTurnResult",
":",
"# End the current dialog and giving the reason.",
"await",
"self",
".",
"end_active_dialog",
"(",
"DialogRea... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | DialogContext.reprompt_dialog | Calls reprompt on the currently active dialog, if there is one. Used with Prompts that have a reprompt behavior.
:return: | libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py | async def reprompt_dialog(self):
"""
Calls reprompt on the currently active dialog, if there is one. Used with Prompts that have a reprompt behavior.
:return:
"""
# Check for a dialog on the stack
if self.active_dialog != None:
# Look up dialog
dia... | async def reprompt_dialog(self):
"""
Calls reprompt on the currently active dialog, if there is one. Used with Prompts that have a reprompt behavior.
:return:
"""
# Check for a dialog on the stack
if self.active_dialog != None:
# Look up dialog
dia... | [
"Calls",
"reprompt",
"on",
"the",
"currently",
"active",
"dialog",
"if",
"there",
"is",
"one",
".",
"Used",
"with",
"Prompts",
"that",
"have",
"a",
"reprompt",
"behavior",
".",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_context.py#L216-L229 | [
"async",
"def",
"reprompt_dialog",
"(",
"self",
")",
":",
"# Check for a dialog on the stack",
"if",
"self",
".",
"active_dialog",
"!=",
"None",
":",
"# Look up dialog",
"dialog",
"=",
"await",
"self",
".",
"find_dialog",
"(",
"self",
".",
"active_dialog",
".",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | Channel.supports_suggested_actions | Determine if a number of Suggested Actions are supported by a Channel.
Args:
channel_id (str): The Channel to check the if Suggested Actions are supported in.
button_cnt (int, optional): Defaults to 100. The number of Suggested Actions to check for the Channel.
Returns:
... | libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py | def supports_suggested_actions(channel_id: str, button_cnt: int = 100) -> bool:
"""Determine if a number of Suggested Actions are supported by a Channel.
Args:
channel_id (str): The Channel to check the if Suggested Actions are supported in.
button_cnt (int, optional): Defaults ... | def supports_suggested_actions(channel_id: str, button_cnt: int = 100) -> bool:
"""Determine if a number of Suggested Actions are supported by a Channel.
Args:
channel_id (str): The Channel to check the if Suggested Actions are supported in.
button_cnt (int, optional): Defaults ... | [
"Determine",
"if",
"a",
"number",
"of",
"Suggested",
"Actions",
"are",
"supported",
"by",
"a",
"Channel",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py#L14-L39 | [
"def",
"supports_suggested_actions",
"(",
"channel_id",
":",
"str",
",",
"button_cnt",
":",
"int",
"=",
"100",
")",
"->",
"bool",
":",
"max_actions",
"=",
"{",
"# https://developers.facebook.com/docs/messenger-platform/send-messages/quick-replies",
"Channels",
".",
"faceb... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | Channel.supports_card_actions | Determine if a number of Card Actions are supported by a Channel.
Args:
channel_id (str): The Channel to check if the Card Actions are supported in.
button_cnt (int, optional): Defaults to 100. The number of Card Actions to check for the Channel.
Returns:
bool: True... | libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py | def supports_card_actions(channel_id: str, button_cnt: int = 100) -> bool:
"""Determine if a number of Card Actions are supported by a Channel.
Args:
channel_id (str): The Channel to check if the Card Actions are supported in.
button_cnt (int, optional): Defaults to 100. The num... | def supports_card_actions(channel_id: str, button_cnt: int = 100) -> bool:
"""Determine if a number of Card Actions are supported by a Channel.
Args:
channel_id (str): The Channel to check if the Card Actions are supported in.
button_cnt (int, optional): Defaults to 100. The num... | [
"Determine",
"if",
"a",
"number",
"of",
"Card",
"Actions",
"are",
"supported",
"by",
"a",
"Channel",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py#L42-L64 | [
"def",
"supports_card_actions",
"(",
"channel_id",
":",
"str",
",",
"button_cnt",
":",
"int",
"=",
"100",
")",
"->",
"bool",
":",
"max_actions",
"=",
"{",
"Channels",
".",
"facebook",
":",
"3",
",",
"Channels",
".",
"skype",
":",
"3",
",",
"Channels",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | Channel.get_channel_id | Get the Channel Id from the current Activity on the Turn Context.
Args:
turn_context (TurnContext): The Turn Context to retrieve the Activity's Channel Id from.
Returns:
str: The Channel Id from the Turn Context's Activity. | libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py | def get_channel_id(turn_context: TurnContext) -> str:
"""Get the Channel Id from the current Activity on the Turn Context.
Args:
turn_context (TurnContext): The Turn Context to retrieve the Activity's Channel Id from.
Returns:
str: The Channel Id from the Turn Context's... | def get_channel_id(turn_context: TurnContext) -> str:
"""Get the Channel Id from the current Activity on the Turn Context.
Args:
turn_context (TurnContext): The Turn Context to retrieve the Activity's Channel Id from.
Returns:
str: The Channel Id from the Turn Context's... | [
"Get",
"the",
"Channel",
"Id",
"from",
"the",
"current",
"Activity",
"on",
"the",
"Turn",
"Context",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-dialogs/botbuilder/dialogs/choices/channel.py#L93-L106 | [
"def",
"get_channel_id",
"(",
"turn_context",
":",
"TurnContext",
")",
"->",
"str",
":",
"if",
"turn_context",
".",
"activity",
".",
"channel_id",
"is",
"None",
":",
"return",
"\"\"",
"else",
":",
"return",
"turn_context",
".",
"activity",
".",
"channel_id"
] | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ConsoleAdapter.process_activity | Begins listening to console input.
:param logic:
:return: | samples/Console-EchoBot/adapter/console_adapter.py | async def process_activity(self, logic: Callable):
"""
Begins listening to console input.
:param logic:
:return:
"""
while True:
msg = input()
if msg is None:
pass
else:
self._next_id += 1
... | async def process_activity(self, logic: Callable):
"""
Begins listening to console input.
:param logic:
:return:
"""
while True:
msg = input()
if msg is None:
pass
else:
self._next_id += 1
... | [
"Begins",
"listening",
"to",
"console",
"input",
".",
":",
"param",
"logic",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/samples/Console-EchoBot/adapter/console_adapter.py#L63-L86 | [
"async",
"def",
"process_activity",
"(",
"self",
",",
"logic",
":",
"Callable",
")",
":",
"while",
"True",
":",
"msg",
"=",
"input",
"(",
")",
"if",
"msg",
"is",
"None",
":",
"pass",
"else",
":",
"self",
".",
"_next_id",
"+=",
"1",
"activity",
"=",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | ConsoleAdapter.send_activities | Logs a series of activities to the console.
:param context:
:param activities:
:return: | samples/Console-EchoBot/adapter/console_adapter.py | async def send_activities(self, context: TurnContext, activities: List[Activity]):
"""
Logs a series of activities to the console.
:param context:
:param activities:
:return:
"""
if context is None:
raise TypeError('ConsoleAdapter.send_activities(): `c... | async def send_activities(self, context: TurnContext, activities: List[Activity]):
"""
Logs a series of activities to the console.
:param context:
:param activities:
:return:
"""
if context is None:
raise TypeError('ConsoleAdapter.send_activities(): `c... | [
"Logs",
"a",
"series",
"of",
"activities",
"to",
"the",
"console",
".",
":",
"param",
"context",
":",
":",
"param",
"activities",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/samples/Console-EchoBot/adapter/console_adapter.py#L88-L125 | [
"async",
"def",
"send_activities",
"(",
"self",
",",
"context",
":",
"TurnContext",
",",
"activities",
":",
"List",
"[",
"Activity",
"]",
")",
":",
"if",
"context",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"'ConsoleAdapter.send_activities(): `context` argumen... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | EmulatorValidation.is_token_from_emulator | Determines if a given Auth header is from the Bot Framework Emulator
:param auth_header: Bearer Token, in the 'Bearer [Long String]' Format.
:type auth_header: str
:return: True, if the token was issued by the Emulator. Otherwise, false. | libraries/botframework-connector/botframework/connector/auth/emulator_validation.py | def is_token_from_emulator(auth_header: str) -> bool:
""" Determines if a given Auth header is from the Bot Framework Emulator
:param auth_header: Bearer Token, in the 'Bearer [Long String]' Format.
:type auth_header: str
:return: True, if the token was issued by the Emulator. Otherwis... | def is_token_from_emulator(auth_header: str) -> bool:
""" Determines if a given Auth header is from the Bot Framework Emulator
:param auth_header: Bearer Token, in the 'Bearer [Long String]' Format.
:type auth_header: str
:return: True, if the token was issued by the Emulator. Otherwis... | [
"Determines",
"if",
"a",
"given",
"Auth",
"header",
"is",
"from",
"the",
"Bot",
"Framework",
"Emulator"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/auth/emulator_validation.py#L33-L81 | [
"def",
"is_token_from_emulator",
"(",
"auth_header",
":",
"str",
")",
"->",
"bool",
":",
"# The Auth Header generally looks like this:",
"# \"Bearer eyJ0e[...Big Long String...]XAiO\"",
"if",
"not",
"auth_header",
":",
"# No token. Can't be an emulator token.",
"return",
"False",... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | EmulatorValidation.authenticate_emulator_token | Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Framework emulator will FAIL this check.
:param auth_header: The raw HTTP header in the format: 'Bearer [longString]'
:type auth_header: str
... | libraries/botframework-connector/botframework/connector/auth/emulator_validation.py | async def authenticate_emulator_token(auth_header: str, credentials: CredentialProvider, channel_id: str) -> ClaimsIdentity:
""" Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Framework emulator will ... | async def authenticate_emulator_token(auth_header: str, credentials: CredentialProvider, channel_id: str) -> ClaimsIdentity:
""" Validate the incoming Auth Header
Validate the incoming Auth Header as a token sent from the Bot Framework Service.
A token issued by the Bot Framework emulator will ... | [
"Validate",
"the",
"incoming",
"Auth",
"Header"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botframework-connector/botframework/connector/auth/emulator_validation.py#L84-L152 | [
"async",
"def",
"authenticate_emulator_token",
"(",
"auth_header",
":",
"str",
",",
"credentials",
":",
"CredentialProvider",
",",
"channel_id",
":",
"str",
")",
"->",
"ClaimsIdentity",
":",
"token_extractor",
"=",
"JwtTokenExtractor",
"(",
"EmulatorValidation",
".",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.adaptive_card | Returns an attachment for an adaptive card. The attachment will contain the card and the
appropriate 'contentType'. Will raise a TypeError if the 'card' argument is not an
dict.
:param card:
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def adaptive_card(card: dict) -> Attachment:
"""
Returns an attachment for an adaptive card. The attachment will contain the card and the
appropriate 'contentType'. Will raise a TypeError if the 'card' argument is not an
dict.
:param card:
:return:
"""
if ... | def adaptive_card(card: dict) -> Attachment:
"""
Returns an attachment for an adaptive card. The attachment will contain the card and the
appropriate 'contentType'. Will raise a TypeError if the 'card' argument is not an
dict.
:param card:
:return:
"""
if ... | [
"Returns",
"an",
"attachment",
"for",
"an",
"adaptive",
"card",
".",
"The",
"attachment",
"will",
"contain",
"the",
"card",
"and",
"the",
"appropriate",
"contentType",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"the",
"card",
"argument",
"is",
"not",
"an"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L25-L38 | [
"def",
"adaptive_card",
"(",
"card",
":",
"dict",
")",
"->",
"Attachment",
":",
"if",
"not",
"type",
"(",
"card",
")",
"==",
"dict",
":",
"raise",
"TypeError",
"(",
"'CardFactory.adaptive_card(): `card` argument is not of type dict, unable to prepare '",
"'attachment.'"... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.animation_card | Returns an attachment for an animation card. Will raise a TypeError if the 'card' argument is not an
AnimationCard.
:param card:
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def animation_card(card: AnimationCard) -> Attachment:
"""
Returns an attachment for an animation card. Will raise a TypeError if the 'card' argument is not an
AnimationCard.
:param card:
:return:
"""
if not isinstance(card, AnimationCard):
raise TypeE... | def animation_card(card: AnimationCard) -> Attachment:
"""
Returns an attachment for an animation card. Will raise a TypeError if the 'card' argument is not an
AnimationCard.
:param card:
:return:
"""
if not isinstance(card, AnimationCard):
raise TypeE... | [
"Returns",
"an",
"attachment",
"for",
"an",
"animation",
"card",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"the",
"card",
"argument",
"is",
"not",
"an",
"AnimationCard",
".",
":",
"param",
"card",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L41-L53 | [
"def",
"animation_card",
"(",
"card",
":",
"AnimationCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"AnimationCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.animation_card(): `card` argument is not an instance of an AnimationC... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.audio_card | Returns an attachment for an audio card. Will raise a TypeError if 'card' argument is not an AudioCard.
:param card:
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def audio_card(card: AudioCard) -> Attachment:
"""
Returns an attachment for an audio card. Will raise a TypeError if 'card' argument is not an AudioCard.
:param card:
:return:
"""
if not isinstance(card, AudioCard):
raise TypeError('CardFactory.audio_card(): ... | def audio_card(card: AudioCard) -> Attachment:
"""
Returns an attachment for an audio card. Will raise a TypeError if 'card' argument is not an AudioCard.
:param card:
:return:
"""
if not isinstance(card, AudioCard):
raise TypeError('CardFactory.audio_card(): ... | [
"Returns",
"an",
"attachment",
"for",
"an",
"audio",
"card",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"card",
"argument",
"is",
"not",
"an",
"AudioCard",
".",
":",
"param",
"card",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L56-L67 | [
"def",
"audio_card",
"(",
"card",
":",
"AudioCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"AudioCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.audio_card(): `card` argument is not an instance of an AudioCard, '",
"'unable ... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.hero_card | Returns an attachment for a hero card. Will raise a TypeError if 'card' argument is not a HeroCard.
Hero cards tend to have one dominant full width image and the cards text & buttons can
usually be found below the image.
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def hero_card(card: HeroCard) -> Attachment:
"""
Returns an attachment for a hero card. Will raise a TypeError if 'card' argument is not a HeroCard.
Hero cards tend to have one dominant full width image and the cards text & buttons can
usually be found below the image.
:return:
... | def hero_card(card: HeroCard) -> Attachment:
"""
Returns an attachment for a hero card. Will raise a TypeError if 'card' argument is not a HeroCard.
Hero cards tend to have one dominant full width image and the cards text & buttons can
usually be found below the image.
:return:
... | [
"Returns",
"an",
"attachment",
"for",
"a",
"hero",
"card",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"card",
"argument",
"is",
"not",
"a",
"HeroCard",
"."
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L70-L83 | [
"def",
"hero_card",
"(",
"card",
":",
"HeroCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"HeroCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.hero_card(): `card` argument is not an instance of an HeroCard, '",
"'unable to pr... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.oauth_card | Returns an attachment for an OAuth card used by the Bot Frameworks Single Sign On (SSO) service. Will raise a
TypeError if 'card' argument is not a OAuthCard.
:param card:
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def oauth_card(card: OAuthCard) -> Attachment:
"""
Returns an attachment for an OAuth card used by the Bot Frameworks Single Sign On (SSO) service. Will raise a
TypeError if 'card' argument is not a OAuthCard.
:param card:
:return:
"""
if not isinstance(card, OAut... | def oauth_card(card: OAuthCard) -> Attachment:
"""
Returns an attachment for an OAuth card used by the Bot Frameworks Single Sign On (SSO) service. Will raise a
TypeError if 'card' argument is not a OAuthCard.
:param card:
:return:
"""
if not isinstance(card, OAut... | [
"Returns",
"an",
"attachment",
"for",
"an",
"OAuth",
"card",
"used",
"by",
"the",
"Bot",
"Frameworks",
"Single",
"Sign",
"On",
"(",
"SSO",
")",
"service",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"card",
"argument",
"is",
"not",
"a",
"OAuthCard",
".... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L86-L98 | [
"def",
"oauth_card",
"(",
"card",
":",
"OAuthCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"OAuthCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.oauth_card(): `card` argument is not an instance of an OAuthCard, '",
"'unable ... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.receipt_card | Returns an attachment for a receipt card. Will raise a TypeError if 'card' argument is not a ReceiptCard.
:param card:
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def receipt_card(card: ReceiptCard) -> Attachment:
"""
Returns an attachment for a receipt card. Will raise a TypeError if 'card' argument is not a ReceiptCard.
:param card:
:return:
"""
if not isinstance(card, ReceiptCard):
raise TypeError('CardFactory.receip... | def receipt_card(card: ReceiptCard) -> Attachment:
"""
Returns an attachment for a receipt card. Will raise a TypeError if 'card' argument is not a ReceiptCard.
:param card:
:return:
"""
if not isinstance(card, ReceiptCard):
raise TypeError('CardFactory.receip... | [
"Returns",
"an",
"attachment",
"for",
"a",
"receipt",
"card",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"card",
"argument",
"is",
"not",
"a",
"ReceiptCard",
".",
":",
"param",
"card",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L101-L112 | [
"def",
"receipt_card",
"(",
"card",
":",
"ReceiptCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"ReceiptCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.receipt_card(): `card` argument is not an instance of an ReceiptCard, '",
... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.signin_card | Returns an attachment for a signin card. For channels that don't natively support signin cards an alternative
message will be rendered. Will raise a TypeError if 'card' argument is not a SigninCard.
:param card:
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def signin_card(card: SigninCard) -> Attachment:
"""
Returns an attachment for a signin card. For channels that don't natively support signin cards an alternative
message will be rendered. Will raise a TypeError if 'card' argument is not a SigninCard.
:param card:
:return:
... | def signin_card(card: SigninCard) -> Attachment:
"""
Returns an attachment for a signin card. For channels that don't natively support signin cards an alternative
message will be rendered. Will raise a TypeError if 'card' argument is not a SigninCard.
:param card:
:return:
... | [
"Returns",
"an",
"attachment",
"for",
"a",
"signin",
"card",
".",
"For",
"channels",
"that",
"don",
"t",
"natively",
"support",
"signin",
"cards",
"an",
"alternative",
"message",
"will",
"be",
"rendered",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"card",... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L115-L127 | [
"def",
"signin_card",
"(",
"card",
":",
"SigninCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"SigninCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.signin_card(): `card` argument is not an instance of an SigninCard, '",
"'un... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.thumbnail_card | Returns an attachment for a thumbnail card. Thumbnail cards are similar to
but instead of a full width image, they're typically rendered with a smaller thumbnail version of
the image on either side and the text will be rendered in column next to the image. Any buttons
will typically show up unde... | libraries/botbuilder-core/botbuilder/core/card_factory.py | def thumbnail_card(card: ThumbnailCard) -> Attachment:
"""
Returns an attachment for a thumbnail card. Thumbnail cards are similar to
but instead of a full width image, they're typically rendered with a smaller thumbnail version of
the image on either side and the text will be rendered i... | def thumbnail_card(card: ThumbnailCard) -> Attachment:
"""
Returns an attachment for a thumbnail card. Thumbnail cards are similar to
but instead of a full width image, they're typically rendered with a smaller thumbnail version of
the image on either side and the text will be rendered i... | [
"Returns",
"an",
"attachment",
"for",
"a",
"thumbnail",
"card",
".",
"Thumbnail",
"cards",
"are",
"similar",
"to",
"but",
"instead",
"of",
"a",
"full",
"width",
"image",
"they",
"re",
"typically",
"rendered",
"with",
"a",
"smaller",
"thumbnail",
"version",
"... | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L130-L144 | [
"def",
"thumbnail_card",
"(",
"card",
":",
"ThumbnailCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"ThumbnailCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.thumbnail_card(): `card` argument is not an instance of an ThumbnailC... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | CardFactory.video_card | Returns an attachment for a video card. Will raise a TypeError if 'card' argument is not a VideoCard.
:param card:
:return: | libraries/botbuilder-core/botbuilder/core/card_factory.py | def video_card(card: VideoCard) -> Attachment:
"""
Returns an attachment for a video card. Will raise a TypeError if 'card' argument is not a VideoCard.
:param card:
:return:
"""
if not isinstance(card, VideoCard):
raise TypeError('CardFactory.video_card(): `c... | def video_card(card: VideoCard) -> Attachment:
"""
Returns an attachment for a video card. Will raise a TypeError if 'card' argument is not a VideoCard.
:param card:
:return:
"""
if not isinstance(card, VideoCard):
raise TypeError('CardFactory.video_card(): `c... | [
"Returns",
"an",
"attachment",
"for",
"a",
"video",
"card",
".",
"Will",
"raise",
"a",
"TypeError",
"if",
"card",
"argument",
"is",
"not",
"a",
"VideoCard",
".",
":",
"param",
"card",
":",
":",
"return",
":"
] | Microsoft/botbuilder-python | python | https://github.com/Microsoft/botbuilder-python/blob/274663dd91c811bae6ac4488915ba5880771b0a7/libraries/botbuilder-core/botbuilder/core/card_factory.py#L147-L158 | [
"def",
"video_card",
"(",
"card",
":",
"VideoCard",
")",
"->",
"Attachment",
":",
"if",
"not",
"isinstance",
"(",
"card",
",",
"VideoCard",
")",
":",
"raise",
"TypeError",
"(",
"'CardFactory.video_card(): `card` argument is not an instance of an VideoCard, '",
"'unable ... | 274663dd91c811bae6ac4488915ba5880771b0a7 |
test | Instruction.params | return instruction params | qiskit/circuit/instruction.py | def params(self):
"""return instruction params"""
# if params already defined don't attempt to get them from definition
if self._definition and not self._params:
self._params = []
for sub_instr, _, _ in self._definition:
self._params.extend(sub_instr.param... | def params(self):
"""return instruction params"""
# if params already defined don't attempt to get them from definition
if self._definition and not self._params:
self._params = []
for sub_instr, _, _ in self._definition:
self._params.extend(sub_instr.param... | [
"return",
"instruction",
"params"
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L112-L121 | [
"def",
"params",
"(",
"self",
")",
":",
"# if params already defined don't attempt to get them from definition",
"if",
"self",
".",
"_definition",
"and",
"not",
"self",
".",
"_params",
":",
"self",
".",
"_params",
"=",
"[",
"]",
"for",
"sub_instr",
",",
"_",
","... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | Instruction.assemble | Assemble a QasmQobjInstruction | qiskit/circuit/instruction.py | def assemble(self):
"""Assemble a QasmQobjInstruction"""
instruction = QasmQobjInstruction(name=self.name)
# Evaluate parameters
if self.params:
params = [
x.evalf() if hasattr(x, 'evalf') else x for x in self.params
]
params = [
... | def assemble(self):
"""Assemble a QasmQobjInstruction"""
instruction = QasmQobjInstruction(name=self.name)
# Evaluate parameters
if self.params:
params = [
x.evalf() if hasattr(x, 'evalf') else x for x in self.params
]
params = [
... | [
"Assemble",
"a",
"QasmQobjInstruction"
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L169-L192 | [
"def",
"assemble",
"(",
"self",
")",
":",
"instruction",
"=",
"QasmQobjInstruction",
"(",
"name",
"=",
"self",
".",
"name",
")",
"# Evaluate parameters",
"if",
"self",
".",
"params",
":",
"params",
"=",
"[",
"x",
".",
"evalf",
"(",
")",
"if",
"hasattr",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | Instruction.mirror | For a composite instruction, reverse the order of sub-gates.
This is done by recursively mirroring all sub-instructions.
It does not invert any gate.
Returns:
Instruction: a fresh gate with sub-gates reversed | qiskit/circuit/instruction.py | def mirror(self):
"""For a composite instruction, reverse the order of sub-gates.
This is done by recursively mirroring all sub-instructions.
It does not invert any gate.
Returns:
Instruction: a fresh gate with sub-gates reversed
"""
if not self._definition:... | def mirror(self):
"""For a composite instruction, reverse the order of sub-gates.
This is done by recursively mirroring all sub-instructions.
It does not invert any gate.
Returns:
Instruction: a fresh gate with sub-gates reversed
"""
if not self._definition:... | [
"For",
"a",
"composite",
"instruction",
"reverse",
"the",
"order",
"of",
"sub",
"-",
"gates",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L194-L210 | [
"def",
"mirror",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_definition",
":",
"return",
"self",
".",
"copy",
"(",
")",
"reverse_inst",
"=",
"self",
".",
"copy",
"(",
"name",
"=",
"self",
".",
"name",
"+",
"'_mirror'",
")",
"reverse_inst",
"."... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | Instruction.inverse | Invert this instruction.
If the instruction is composite (i.e. has a definition),
then its definition will be recursively inverted.
Special instructions inheriting from Instruction can
implement their own inverse (e.g. T and Tdg, Barrier, etc.)
Returns:
Instruction... | qiskit/circuit/instruction.py | def inverse(self):
"""Invert this instruction.
If the instruction is composite (i.e. has a definition),
then its definition will be recursively inverted.
Special instructions inheriting from Instruction can
implement their own inverse (e.g. T and Tdg, Barrier, etc.)
Re... | def inverse(self):
"""Invert this instruction.
If the instruction is composite (i.e. has a definition),
then its definition will be recursively inverted.
Special instructions inheriting from Instruction can
implement their own inverse (e.g. T and Tdg, Barrier, etc.)
Re... | [
"Invert",
"this",
"instruction",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L212-L234 | [
"def",
"inverse",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"definition",
":",
"raise",
"QiskitError",
"(",
"\"inverse() not implemented for %s.\"",
"%",
"self",
".",
"name",
")",
"inverse_gate",
"=",
"self",
".",
"copy",
"(",
"name",
"=",
"self",
"... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | Instruction.c_if | Add classical control on register classical and value val. | qiskit/circuit/instruction.py | def c_if(self, classical, val):
"""Add classical control on register classical and value val."""
if not isinstance(classical, ClassicalRegister):
raise QiskitError("c_if must be used with a classical register")
if val < 0:
raise QiskitError("control value should be non-ne... | def c_if(self, classical, val):
"""Add classical control on register classical and value val."""
if not isinstance(classical, ClassicalRegister):
raise QiskitError("c_if must be used with a classical register")
if val < 0:
raise QiskitError("control value should be non-ne... | [
"Add",
"classical",
"control",
"on",
"register",
"classical",
"and",
"value",
"val",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L236-L243 | [
"def",
"c_if",
"(",
"self",
",",
"classical",
",",
"val",
")",
":",
"if",
"not",
"isinstance",
"(",
"classical",
",",
"ClassicalRegister",
")",
":",
"raise",
"QiskitError",
"(",
"\"c_if must be used with a classical register\"",
")",
"if",
"val",
"<",
"0",
":"... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | Instruction.copy | shallow copy of the instruction.
Args:
name (str): name to be given to the copied circuit,
if None then the name stays the same
Returns:
Instruction: a shallow copy of the current instruction, with the name
updated if it was provided | qiskit/circuit/instruction.py | def copy(self, name=None):
"""
shallow copy of the instruction.
Args:
name (str): name to be given to the copied circuit,
if None then the name stays the same
Returns:
Instruction: a shallow copy of the current instruction, with the name
upda... | def copy(self, name=None):
"""
shallow copy of the instruction.
Args:
name (str): name to be given to the copied circuit,
if None then the name stays the same
Returns:
Instruction: a shallow copy of the current instruction, with the name
upda... | [
"shallow",
"copy",
"of",
"the",
"instruction",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L245-L260 | [
"def",
"copy",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"cpy",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"if",
"name",
":",
"cpy",
".",
"name",
"=",
"name",
"return",
"cpy"
] | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | Instruction._qasmif | Print an if statement if needed. | qiskit/circuit/instruction.py | def _qasmif(self, string):
"""Print an if statement if needed."""
if self.control is None:
return string
return "if(%s==%d) " % (self.control[0].name, self.control[1]) + string | def _qasmif(self, string):
"""Print an if statement if needed."""
if self.control is None:
return string
return "if(%s==%d) " % (self.control[0].name, self.control[1]) + string | [
"Print",
"an",
"if",
"statement",
"if",
"needed",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L262-L266 | [
"def",
"_qasmif",
"(",
"self",
",",
"string",
")",
":",
"if",
"self",
".",
"control",
"is",
"None",
":",
"return",
"string",
"return",
"\"if(%s==%d) \"",
"%",
"(",
"self",
".",
"control",
"[",
"0",
"]",
".",
"name",
",",
"self",
".",
"control",
"[",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | Instruction.qasm | Return a default OpenQASM string for the instruction.
Derived instructions may override this to print in a
different format (e.g. measure q[0] -> c[0];). | qiskit/circuit/instruction.py | def qasm(self):
"""Return a default OpenQASM string for the instruction.
Derived instructions may override this to print in a
different format (e.g. measure q[0] -> c[0];).
"""
name_param = self.name
if self.params:
name_param = "%s(%s)" % (name_param, ",".jo... | def qasm(self):
"""Return a default OpenQASM string for the instruction.
Derived instructions may override this to print in a
different format (e.g. measure q[0] -> c[0];).
"""
name_param = self.name
if self.params:
name_param = "%s(%s)" % (name_param, ",".jo... | [
"Return",
"a",
"default",
"OpenQASM",
"string",
"for",
"the",
"instruction",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/circuit/instruction.py#L268-L279 | [
"def",
"qasm",
"(",
"self",
")",
":",
"name_param",
"=",
"self",
".",
"name",
"if",
"self",
".",
"params",
":",
"name_param",
"=",
"\"%s(%s)\"",
"%",
"(",
"name_param",
",",
"\",\"",
".",
"join",
"(",
"[",
"str",
"(",
"i",
")",
"for",
"i",
"in",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | PassManager._join_options | Set the options of each passset, based on precedence rules:
passset options (set via ``PassManager.append()``) override
passmanager options (set via ``PassManager.__init__()``), which override Default.
. | qiskit/transpiler/passmanager.py | def _join_options(self, passset_options):
"""Set the options of each passset, based on precedence rules:
passset options (set via ``PassManager.append()``) override
passmanager options (set via ``PassManager.__init__()``), which override Default.
.
"""
default = {'ignore_... | def _join_options(self, passset_options):
"""Set the options of each passset, based on precedence rules:
passset options (set via ``PassManager.append()``) override
passmanager options (set via ``PassManager.__init__()``), which override Default.
.
"""
default = {'ignore_... | [
"Set",
"the",
"options",
"of",
"each",
"passset",
"based",
"on",
"precedence",
"rules",
":",
"passset",
"options",
"(",
"set",
"via",
"PassManager",
".",
"append",
"()",
")",
"override",
"passmanager",
"options",
"(",
"set",
"via",
"PassManager",
".",
"__ini... | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L59-L71 | [
"def",
"_join_options",
"(",
"self",
",",
"passset_options",
")",
":",
"default",
"=",
"{",
"'ignore_preserves'",
":",
"False",
",",
"# Ignore preserves for this pass",
"'ignore_requires'",
":",
"False",
",",
"# Ignore requires for this pass",
"'max_iteration'",
":",
"1... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | PassManager.append | Args:
passes (list[BasePass] or BasePass): pass(es) to be added to schedule
ignore_preserves (bool): ignore the preserves claim of passes. Default: False
ignore_requires (bool): ignore the requires need of passes. Default: False
max_iteration (int): max number of iteratio... | qiskit/transpiler/passmanager.py | def append(self, passes, ignore_requires=None, ignore_preserves=None, max_iteration=None,
**flow_controller_conditions):
"""
Args:
passes (list[BasePass] or BasePass): pass(es) to be added to schedule
ignore_preserves (bool): ignore the preserves claim of passes. D... | def append(self, passes, ignore_requires=None, ignore_preserves=None, max_iteration=None,
**flow_controller_conditions):
"""
Args:
passes (list[BasePass] or BasePass): pass(es) to be added to schedule
ignore_preserves (bool): ignore the preserves claim of passes. D... | [
"Args",
":",
"passes",
"(",
"list",
"[",
"BasePass",
"]",
"or",
"BasePass",
")",
":",
"pass",
"(",
"es",
")",
"to",
"be",
"added",
"to",
"schedule",
"ignore_preserves",
"(",
"bool",
")",
":",
"ignore",
"the",
"preserves",
"claim",
"of",
"passes",
".",
... | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L73-L116 | [
"def",
"append",
"(",
"self",
",",
"passes",
",",
"ignore_requires",
"=",
"None",
",",
"ignore_preserves",
"=",
"None",
",",
"max_iteration",
"=",
"None",
",",
"*",
"*",
"flow_controller_conditions",
")",
":",
"passset_options",
"=",
"{",
"'ignore_requires'",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | PassManager.run | Run all the passes on a QuantumCircuit
Args:
circuit (QuantumCircuit): circuit to transform via all the registered passes
Returns:
QuantumCircuit: Transformed circuit. | qiskit/transpiler/passmanager.py | def run(self, circuit):
"""Run all the passes on a QuantumCircuit
Args:
circuit (QuantumCircuit): circuit to transform via all the registered passes
Returns:
QuantumCircuit: Transformed circuit.
"""
name = circuit.name
dag = circuit_to_dag(circui... | def run(self, circuit):
"""Run all the passes on a QuantumCircuit
Args:
circuit (QuantumCircuit): circuit to transform via all the registered passes
Returns:
QuantumCircuit: Transformed circuit.
"""
name = circuit.name
dag = circuit_to_dag(circui... | [
"Run",
"all",
"the",
"passes",
"on",
"a",
"QuantumCircuit"
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L118-L135 | [
"def",
"run",
"(",
"self",
",",
"circuit",
")",
":",
"name",
"=",
"circuit",
".",
"name",
"dag",
"=",
"circuit_to_dag",
"(",
"circuit",
")",
"del",
"circuit",
"for",
"passset",
"in",
"self",
".",
"working_list",
":",
"for",
"pass_",
"in",
"passset",
":... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | PassManager._do_pass | Do a pass and its "requires".
Args:
pass_ (BasePass): Pass to do.
dag (DAGCircuit): The dag on which the pass is ran.
options (dict): PassManager options.
Returns:
DAGCircuit: The transformed dag in case of a transformation pass.
The same inpu... | qiskit/transpiler/passmanager.py | def _do_pass(self, pass_, dag, options):
"""Do a pass and its "requires".
Args:
pass_ (BasePass): Pass to do.
dag (DAGCircuit): The dag on which the pass is ran.
options (dict): PassManager options.
Returns:
DAGCircuit: The transformed dag in case... | def _do_pass(self, pass_, dag, options):
"""Do a pass and its "requires".
Args:
pass_ (BasePass): Pass to do.
dag (DAGCircuit): The dag on which the pass is ran.
options (dict): PassManager options.
Returns:
DAGCircuit: The transformed dag in case... | [
"Do",
"a",
"pass",
"and",
"its",
"requires",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L137-L175 | [
"def",
"_do_pass",
"(",
"self",
",",
"pass_",
",",
"dag",
",",
"options",
")",
":",
"# First, do the requires of pass_",
"if",
"not",
"options",
"[",
"\"ignore_requires\"",
"]",
":",
"for",
"required_pass",
"in",
"pass_",
".",
"requires",
":",
"dag",
"=",
"s... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | PassManager.passes | Returns a list structure of the appended passes and its options.
Returns (list): The appended passes. | qiskit/transpiler/passmanager.py | def passes(self):
"""
Returns a list structure of the appended passes and its options.
Returns (list): The appended passes.
"""
ret = []
for pass_ in self.working_list:
ret.append(pass_.dump_passes())
return ret | def passes(self):
"""
Returns a list structure of the appended passes and its options.
Returns (list): The appended passes.
"""
ret = []
for pass_ in self.working_list:
ret.append(pass_.dump_passes())
return ret | [
"Returns",
"a",
"list",
"structure",
"of",
"the",
"appended",
"passes",
"and",
"its",
"options",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L185-L194 | [
"def",
"passes",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"pass_",
"in",
"self",
".",
"working_list",
":",
"ret",
".",
"append",
"(",
"pass_",
".",
"dump_passes",
"(",
")",
")",
"return",
"ret"
] | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | FlowController.dump_passes | Fetches the passes added to this flow controller.
Returns (dict): {'options': self.options, 'passes': [passes], 'type': type(self)} | qiskit/transpiler/passmanager.py | def dump_passes(self):
"""
Fetches the passes added to this flow controller.
Returns (dict): {'options': self.options, 'passes': [passes], 'type': type(self)}
"""
ret = {'options': self.options, 'passes': [], 'type': type(self)}
for pass_ in self._passes:
if ... | def dump_passes(self):
"""
Fetches the passes added to this flow controller.
Returns (dict): {'options': self.options, 'passes': [passes], 'type': type(self)}
"""
ret = {'options': self.options, 'passes': [], 'type': type(self)}
for pass_ in self._passes:
if ... | [
"Fetches",
"the",
"passes",
"added",
"to",
"this",
"flow",
"controller",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L212-L224 | [
"def",
"dump_passes",
"(",
"self",
")",
":",
"ret",
"=",
"{",
"'options'",
":",
"self",
".",
"options",
",",
"'passes'",
":",
"[",
"]",
",",
"'type'",
":",
"type",
"(",
"self",
")",
"}",
"for",
"pass_",
"in",
"self",
".",
"_passes",
":",
"if",
"i... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | FlowController.remove_flow_controller | Removes a flow controller.
Args:
name (string): Name of the controller to remove.
Raises:
KeyError: If the controller to remove was not registered. | qiskit/transpiler/passmanager.py | def remove_flow_controller(cls, name):
"""
Removes a flow controller.
Args:
name (string): Name of the controller to remove.
Raises:
KeyError: If the controller to remove was not registered.
"""
if name not in cls.registered_controllers:
... | def remove_flow_controller(cls, name):
"""
Removes a flow controller.
Args:
name (string): Name of the controller to remove.
Raises:
KeyError: If the controller to remove was not registered.
"""
if name not in cls.registered_controllers:
... | [
"Removes",
"a",
"flow",
"controller",
".",
"Args",
":",
"name",
"(",
"string",
")",
":",
"Name",
"of",
"the",
"controller",
"to",
"remove",
".",
"Raises",
":",
"KeyError",
":",
"If",
"the",
"controller",
"to",
"remove",
"was",
"not",
"registered",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L237-L247 | [
"def",
"remove_flow_controller",
"(",
"cls",
",",
"name",
")",
":",
"if",
"name",
"not",
"in",
"cls",
".",
"registered_controllers",
":",
"raise",
"KeyError",
"(",
"\"Flow controller not found: %s\"",
"%",
"name",
")",
"del",
"cls",
".",
"registered_controllers",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | FlowController.controller_factory | Constructs a flow controller based on the partially evaluated controller arguments.
Args:
passes (list[BasePass]): passes to add to the flow controller.
options (dict): PassManager options.
**partial_controller (dict): Partially evaluated controller arguments in the form
... | qiskit/transpiler/passmanager.py | def controller_factory(cls, passes, options, **partial_controller):
"""
Constructs a flow controller based on the partially evaluated controller arguments.
Args:
passes (list[BasePass]): passes to add to the flow controller.
options (dict): PassManager options.
... | def controller_factory(cls, passes, options, **partial_controller):
"""
Constructs a flow controller based on the partially evaluated controller arguments.
Args:
passes (list[BasePass]): passes to add to the flow controller.
options (dict): PassManager options.
... | [
"Constructs",
"a",
"flow",
"controller",
"based",
"on",
"the",
"partially",
"evaluated",
"controller",
"arguments",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/transpiler/passmanager.py#L250-L276 | [
"def",
"controller_factory",
"(",
"cls",
",",
"passes",
",",
"options",
",",
"*",
"*",
"partial_controller",
")",
":",
"if",
"None",
"in",
"partial_controller",
".",
"values",
"(",
")",
":",
"raise",
"TranspilerError",
"(",
"'The controller needs a condition.'",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | u_base | Apply U to q. | qiskit/extensions/standard/ubase.py | def u_base(self, theta, phi, lam, q):
"""Apply U to q."""
return self.append(UBase(theta, phi, lam), [q], []) | def u_base(self, theta, phi, lam, q):
"""Apply U to q."""
return self.append(UBase(theta, phi, lam), [q], []) | [
"Apply",
"U",
"to",
"q",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/extensions/standard/ubase.py#L50-L52 | [
"def",
"u_base",
"(",
"self",
",",
"theta",
",",
"phi",
",",
"lam",
",",
"q",
")",
":",
"return",
"self",
".",
"append",
"(",
"UBase",
"(",
"theta",
",",
"phi",
",",
"lam",
")",
",",
"[",
"q",
"]",
",",
"[",
"]",
")"
] | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | UBase.to_matrix | Return a Numpy.array for the U3 gate. | qiskit/extensions/standard/ubase.py | def to_matrix(self):
"""Return a Numpy.array for the U3 gate."""
theta, phi, lam = self.params
return numpy.array(
[[
numpy.cos(theta / 2),
-numpy.exp(1j * lam) * numpy.sin(theta / 2)
],
[
numpy.exp(1j * phi) *... | def to_matrix(self):
"""Return a Numpy.array for the U3 gate."""
theta, phi, lam = self.params
return numpy.array(
[[
numpy.cos(theta / 2),
-numpy.exp(1j * lam) * numpy.sin(theta / 2)
],
[
numpy.exp(1j * phi) *... | [
"Return",
"a",
"Numpy",
".",
"array",
"for",
"the",
"U3",
"gate",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/extensions/standard/ubase.py#L33-L45 | [
"def",
"to_matrix",
"(",
"self",
")",
":",
"theta",
",",
"phi",
",",
"lam",
"=",
"self",
".",
"params",
"return",
"numpy",
".",
"array",
"(",
"[",
"[",
"numpy",
".",
"cos",
"(",
"theta",
"/",
"2",
")",
",",
"-",
"numpy",
".",
"exp",
"(",
"1j",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
test | single_gate_params | Apply a single qubit gate to the qubit.
Args:
gate(str): the single qubit gate name
params(list): the operation parameters op['params']
Returns:
tuple: a tuple of U gate parameters (theta, phi, lam)
Raises:
QiskitError: if the gate name is not valid | qiskit/providers/basicaer/basicaertools.py | def single_gate_params(gate, params=None):
"""Apply a single qubit gate to the qubit.
Args:
gate(str): the single qubit gate name
params(list): the operation parameters op['params']
Returns:
tuple: a tuple of U gate parameters (theta, phi, lam)
Raises:
QiskitError: if th... | def single_gate_params(gate, params=None):
"""Apply a single qubit gate to the qubit.
Args:
gate(str): the single qubit gate name
params(list): the operation parameters op['params']
Returns:
tuple: a tuple of U gate parameters (theta, phi, lam)
Raises:
QiskitError: if th... | [
"Apply",
"a",
"single",
"qubit",
"gate",
"to",
"the",
"qubit",
"."
] | Qiskit/qiskit-terra | python | https://github.com/Qiskit/qiskit-terra/blob/d4f58d903bc96341b816f7c35df936d6421267d1/qiskit/providers/basicaer/basicaertools.py#L19-L38 | [
"def",
"single_gate_params",
"(",
"gate",
",",
"params",
"=",
"None",
")",
":",
"if",
"gate",
"in",
"(",
"'U'",
",",
"'u3'",
")",
":",
"return",
"params",
"[",
"0",
"]",
",",
"params",
"[",
"1",
"]",
",",
"params",
"[",
"2",
"]",
"elif",
"gate",
... | d4f58d903bc96341b816f7c35df936d6421267d1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.