async def delete_conversation_member(<EOL>self, conversation_id, member_id, *, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.delete_conversation_member.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", conversation_id, '<STR_LIT:str>'),<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", member_id, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>header_parameters = {}<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.delete(url, query_parameters, header_parameters)<EOL>response = await self._client.async_send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>, <NUM_LIT>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(None, response)<EOL>return client_raw_response<EOL><DEDENT>

DeleteConversationMember.

        Deletes a member from a conversation.
        This REST API takes a ConversationId and a memberId (of type string)
        and removes that member from the conversation. If that member was the
        last member
        of the conversation, the conversation will also be deleted.

        :param conversation_id: Conversation ID
        :type conversation_id: str
        :param member_id: ID of the member to delete from this conversation
        :type member_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: None or ClientRawResponse if raw=true
        :rtype: None or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<botframework.connector.models.ErrorResponseException>`


async def get_conversation_paged_members(<EOL>self, conversation_id, page_size=None, continuation_token=None, *, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.get_conversation_paged_members.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", conversation_id, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>if page_size is not None:<EOL><INDENT>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", page_size, '<STR_LIT:int>')<EOL><DEDENT>if continuation_token is not None:<EOL><INDENT>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", continuation_token, '<STR_LIT:str>')<EOL><DEDENT>header_parameters = {}<EOL>header_parameters['<STR_LIT>'] = '<STR_LIT:application/json>'<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.get(url, query_parameters, header_parameters)<EOL>response = await self._client.async_send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>]:<EOL><INDENT>raise HttpOperationError(self._deserialize, response)<EOL><DEDENT>deserialized = None<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(deserialized, response)<EOL>return client_raw_response<EOL><DEDENT>return deserialized<EOL>

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 the members of the conversation and a
        continuation token that can be used to get more values.
        One page of ChannelAccounts records are returned with each call. The
        number of records in a page may vary between channels and calls. The
        pageSize parameter can be used as
        a suggestion. If there are no additional results the response will not
        contain a continuation token. If there are no members in the
        conversation the Members will be empty or not present in the response.
        A response to a request that has a continuation token from a prior
        request may rarely return members from a previous request.

        :param conversation_id: Conversation ID
        :type conversation_id: str
        :param page_size: Suggested page size
        :type page_size: int
        :param continuation_token: Continuation Token
        :type continuation_token: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: PagedMembersResult or ClientRawResponse if raw=true
        :rtype: ~botframework.connector.models.PagedMembersResult or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`


async def async_send(self, request, headers=None, content=None, **config):

loop = asyncio.get_event_loop()<EOL>if self.config.keep_alive and self._session is None:<EOL><INDENT>self._session = requests.Session()<EOL><DEDENT>try:<EOL><INDENT>session = self.creds.signed_session(self._session)<EOL><DEDENT>except TypeError:  <EOL><INDENT>session = self.creds.signed_session()<EOL>if self._session is not None:<EOL><INDENT>_LOGGER.warning(<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>kwargs = self._configure_session(session, **config)<EOL>if headers:<EOL><INDENT>request.headers.update(headers)<EOL><DEDENT>if not kwargs.get('<STR_LIT>'):<EOL><INDENT>request.add_content(content)<EOL><DEDENT>if request.data:<EOL><INDENT>kwargs['<STR_LIT:data>'] = request.data<EOL><DEDENT>kwargs['<STR_LIT>'].update(request.headers)<EOL>response = None<EOL>try:<EOL><INDENT>try:<EOL><INDENT>future = loop.run_in_executor(<EOL>None,<EOL>functools.partial(<EOL>session.request,<EOL>request.method,<EOL>request.url,<EOL>**kwargs<EOL>)<EOL>)<EOL>return await future<EOL><DEDENT>except (oauth2.rfc6749.errors.InvalidGrantError,<EOL>oauth2.rfc6749.errors.TokenExpiredError) as err:<EOL><INDENT>error = "<STR_LIT>"<EOL>_LOGGER.warning(error)<EOL><DEDENT>try:<EOL><INDENT>session = self.creds.refresh_session()<EOL>kwargs = self._configure_session(session)<EOL>if request.data:<EOL><INDENT>kwargs['<STR_LIT:data>'] = request.data<EOL><DEDENT>kwargs['<STR_LIT>'].update(request.headers)<EOL>future = loop.run_in_executor(<EOL>None,<EOL>functools.partial(<EOL>session.request,<EOL>request.method,<EOL>request.url,<EOL>**kwargs<EOL>)<EOL>)<EOL>return await future<EOL><DEDENT>except (oauth2.rfc6749.errors.InvalidGrantError,<EOL>oauth2.rfc6749.errors.TokenExpiredError) as err:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise_with_traceback(TokenExpiredError, msg, err)<EOL><DEDENT><DEDENT>except (requests.RequestException,<EOL>oauth2.rfc6749.errors.OAuth2Error) as err:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise_with_traceback(ClientRequestError, msg, err)<EOL><DEDENT>finally:<EOL><INDENT>self._close_local_session_if_necessary(response, session, kwargs['<STR_LIT>'])<EOL><DEDENT>

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


def get_attachment_info(<EOL>self, attachment_id, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.get_attachment_info.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", attachment_id, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>header_parameters = {}<EOL>header_parameters['<STR_LIT>'] = '<STR_LIT:application/json>'<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.get(url, query_parameters, header_parameters)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>deserialized = None<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(deserialized, response)<EOL>return client_raw_response<EOL><DEDENT>return deserialized<EOL>

GetAttachmentInfo.

        Get AttachmentInfo structure describing the attachment views.

        :param attachment_id: attachment id
        :type attachment_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: AttachmentInfo or ClientRawResponse if raw=true
        :rtype: ~botframework.connector.models.AttachmentInfo or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<botframework.connector.models.ErrorResponseException>`


def delete_activity(<EOL>self, conversation_id, activity_id, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.delete_activity.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", conversation_id, '<STR_LIT:str>'),<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", activity_id, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>header_parameters = {}<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.delete(url, query_parameters, header_parameters)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>, <NUM_LIT>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(None, response)<EOL>return client_raw_response<EOL><DEDENT>

DeleteActivity.

        Delete an existing activity.
        Some channels allow you to delete an existing activity, and if
        successful this method will remove the specified activity.

        :param conversation_id: Conversation ID
        :type conversation_id: str
        :param activity_id: activityId to delete
        :type activity_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: None or ClientRawResponse if raw=true
        :rtype: None or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<botframework.connector.models.ErrorResponseException>`


def delete_conversation_member(<EOL>self, conversation_id, member_id, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.delete_conversation_member.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", conversation_id, '<STR_LIT:str>'),<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", member_id, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>header_parameters = {}<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.delete(url, query_parameters, header_parameters)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>, <NUM_LIT>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(None, response)<EOL>return client_raw_response<EOL><DEDENT>


def upload_attachment(<EOL>self, conversation_id, attachment_upload, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.upload_attachment.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", conversation_id, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>header_parameters = {}<EOL>header_parameters['<STR_LIT>'] = '<STR_LIT:application/json>'<EOL>header_parameters['<STR_LIT:Content-Type>'] = '<STR_LIT>'<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>body_content = self._serialize.body(attachment_upload, '<STR_LIT>')<EOL>request = self._client.post(url, query_parameters, header_parameters, body_content)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>, <NUM_LIT>, <NUM_LIT>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>deserialized = None<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if response.status_code == <NUM_LIT>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if response.status_code == <NUM_LIT>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(deserialized, response)<EOL>return client_raw_response<EOL><DEDENT>return deserialized<EOL>

UploadAttachment.

        Upload an attachment directly into a channel's blob storage.
        This is useful because it allows you to store data in a compliant store
        when dealing with enterprises.
        The response is a ResourceResponse which contains an AttachmentId which
        is suitable for using with the attachments API.

        :param conversation_id: Conversation ID
        :type conversation_id: str
        :param attachment_upload: Attachment data
        :type attachment_upload: ~botframework.connector.models.AttachmentData
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: ResourceResponse or ClientRawResponse if raw=true
        :rtype: ~botframework.connector.models.ResourceResponse or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<botframework.connector.models.ErrorResponseException>`


def get_activity_members(<EOL>self, conversation_id, activity_id, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.get_activity_members.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", conversation_id, '<STR_LIT:str>'),<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", activity_id, '<STR_LIT:str>')<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>header_parameters = {}<EOL>header_parameters['<STR_LIT>'] = '<STR_LIT:application/json>'<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.get(url, query_parameters, header_parameters)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>deserialized = None<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(deserialized, response)<EOL>return client_raw_response<EOL><DEDENT>return deserialized<EOL>

GetActivityMembers.

        Enumerate the members of an activity.
        This REST API takes a ConversationId and a ActivityId, returning an
        array of ChannelAccount objects representing the members of the
        particular activity in the conversation.

        :param conversation_id: Conversation ID
        :type conversation_id: str
        :param activity_id: Activity ID
        :type activity_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: list or ClientRawResponse if raw=true
        :rtype: list[~botframework.connector.models.ChannelAccount] or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<botframework.connector.models.ErrorResponseException>`


async def sign_out(<EOL>self, user_id, connection_name=None, channel_id=None, *, custom_headers=None, raw=False, **operation_config):

<EOL>url = self.sign_out.metadata['<STR_LIT:url>']<EOL>query_parameters = {}<EOL>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", user_id, '<STR_LIT:str>')<EOL>if connection_name is not None:<EOL><INDENT>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", connection_name, '<STR_LIT:str>')<EOL><DEDENT>if channel_id is not None:<EOL><INDENT>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", channel_id, '<STR_LIT:str>')<EOL><DEDENT>header_parameters = {}<EOL>header_parameters['<STR_LIT>'] = '<STR_LIT:application/json>'<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>request = self._client.delete(url, query_parameters, header_parameters)<EOL>response = await self._client.async_send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>, <NUM_LIT>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>deserialized = None<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT:object>', response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(deserialized, response)<EOL>return client_raw_response<EOL><DEDENT>return deserialized<EOL>

:param user_id:
:type user_id: str
:param connection_name:
:type connection_name: str
:param channel_id:
:type channel_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
 deserialized response
:param operation_config: :ref:`Operation configuration
 overrides<msrest:optionsforoperations>`.
:return: object or ClientRawResponse if raw=true
:rtype: object or ~msrest.pipeline.ClientRawResponse
:raises:
 :class:`ErrorResponseException<botframework.tokenapi.models.ErrorResponseException>`


def get_aad_tokens(<EOL>self, user_id, connection_name, channel_id=None, resource_urls=None, custom_headers=None, raw=False, **operation_config):

aad_resource_urls = models.AadResourceUrls(resource_urls=resource_urls)<EOL>url = self.get_aad_tokens.metadata['<STR_LIT:url>']<EOL>query_parameters = {}<EOL>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", user_id, '<STR_LIT:str>')<EOL>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", connection_name, '<STR_LIT:str>')<EOL>if channel_id is not None:<EOL><INDENT>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", channel_id, '<STR_LIT:str>')<EOL><DEDENT>header_parameters = {}<EOL>header_parameters['<STR_LIT>'] = '<STR_LIT:application/json>'<EOL>header_parameters['<STR_LIT:Content-Type>'] = '<STR_LIT>'<EOL>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>body_content = self._serialize.body(aad_resource_urls, '<STR_LIT>')<EOL>request = self._client.post(url, query_parameters, header_parameters, body_content)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>]:<EOL><INDENT>raise models.ErrorResponseException(self._deserialize, response)<EOL><DEDENT>deserialized = None<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(deserialized, response)<EOL>return client_raw_response<EOL><DEDENT>return deserialized<EOL>

:param user_id:
:type user_id: str
:param connection_name:
:type connection_name: str
:param channel_id:
:type channel_id: str
:param resource_urls:
:type resource_urls: list[str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
 deserialized response
:param operation_config: :ref:`Operation configuration
 overrides<msrest:optionsforoperations>`.
:return: dict or ClientRawResponse if raw=true
:rtype: dict[str, ~botframework.tokenapi.models.TokenResponse] or
 ~msrest.pipeline.ClientRawResponse
:raises:
 :class:`ErrorResponseException<botframework.tokenapi.models.ErrorResponseException>`


def egg2dist(self, egginfo_path, distinfo_path):

def adios(p):<EOL><INDENT>"""<STR_LIT>"""<EOL>if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p):<EOL><INDENT>shutil.rmtree(p)<EOL><DEDENT>elif os.path.exists(p):<EOL><INDENT>os.unlink(p)<EOL><DEDENT><DEDENT>adios(distinfo_path)<EOL>if not os.path.exists(egginfo_path):<EOL><INDENT>import glob<EOL>pat = os.path.join(os.path.dirname(egginfo_path), '<STR_LIT>')<EOL>possible = glob.glob(pat)<EOL>err = "<STR_LIT>" % (egginfo_path,)<EOL>if possible:<EOL><INDENT>alt = os.path.basename(possible[<NUM_LIT:0>])<EOL>err += "<STR_LIT>" % (alt,)<EOL><DEDENT>raise ValueError(err)<EOL><DEDENT>if os.path.isfile(egginfo_path):<EOL><INDENT>pkginfo_path = egginfo_path<EOL>pkg_info = self._pkginfo_to_metadata(egginfo_path, egginfo_path)<EOL>os.mkdir(distinfo_path)<EOL><DEDENT>else:<EOL><INDENT>pkginfo_path = os.path.join(egginfo_path, '<STR_LIT>')<EOL>pkg_info = self._pkginfo_to_metadata(egginfo_path, pkginfo_path)<EOL>shutil.copytree(egginfo_path, distinfo_path,<EOL>ignore=lambda x, y: set(('<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',)))<EOL>dependency_links_path = os.path.join(distinfo_path, '<STR_LIT>')<EOL>with open(dependency_links_path, '<STR_LIT:r>') as dependency_links_file:<EOL><INDENT>dependency_links = dependency_links_file.read().strip()<EOL><DEDENT>if not dependency_links:<EOL><INDENT>adios(dependency_links_path)<EOL><DEDENT><DEDENT>write_pkg_info(os.path.join(distinfo_path, '<STR_LIT>'), pkg_info)<EOL>metadata_path = os.path.join(distinfo_path, '<STR_LIT>')<EOL>self.add_requirements(metadata_path)<EOL>metadata_json_path = os.path.join(distinfo_path, '<STR_LIT>')<EOL>pymeta = pkginfo_to_dict(metadata_path,<EOL>distribution=self.distribution)<EOL>if '<STR_LIT:description>' in pymeta:<EOL><INDENT>description_filename = '<STR_LIT>'<EOL>description_text = pymeta.pop('<STR_LIT:description>')<EOL>description_path = os.path.join(distinfo_path,<EOL>description_filename)<EOL>with open(description_path, "<STR_LIT:wb>") as description_file:<EOL><INDENT>description_file.write(description_text.encode('<STR_LIT:utf-8>'))<EOL><DEDENT>pymeta['<STR_LIT>']['<STR_LIT>']['<STR_LIT>']['<STR_LIT:description>'] = description_filename<EOL><DEDENT>license = self.license_file()<EOL>if license:<EOL><INDENT>license_filename = '<STR_LIT>'<EOL>shutil.copy(license, os.path.join(self.distinfo_dir, license_filename))<EOL>pymeta['<STR_LIT>']['<STR_LIT>']['<STR_LIT>']['<STR_LIT>'] = license_filename<EOL><DEDENT>with open(metadata_json_path, "<STR_LIT:w>") as metadata_json:<EOL><INDENT>json.dump(pymeta, metadata_json, sort_keys=True)<EOL><DEDENT>adios(egginfo_path)<EOL>

Convert an .egg-info directory into a .dist-info directory


impl_tag, abi_tag, plat_tag = self.get_tag()<EOL>archive_basename = "<STR_LIT>" % (<EOL>self.wheel_dist_name,<EOL>impl_tag,<EOL>abi_tag,<EOL>plat_tag)<EOL>return archive_basename<EOL>


metadata = self.distribution.get_option_dict('<STR_LIT>')<EOL>if not '<STR_LIT>' in metadata:<EOL><INDENT>return None<EOL><DEDENT>return metadata['<STR_LIT>'][<NUM_LIT:1>]<EOL>

Return license filename from a license-file key in setup.cfg, or None.


additional = list(self.setupcfg_requirements())<EOL>if not additional: return<EOL>pkg_info = read_pkg_info(metadata_path)<EOL>if '<STR_LIT>' in pkg_info or '<STR_LIT>' in pkg_info:<EOL><INDENT>warnings.warn('<STR_LIT>')<EOL>del pkg_info['<STR_LIT>']<EOL>del pkg_info['<STR_LIT>']<EOL><DEDENT>for k, v in additional:<EOL><INDENT>pkg_info[k] = v<EOL><DEDENT>write_pkg_info(metadata_path, pkg_info)<EOL>

Add additional requirements from setup.cfg to file metadata_path


return '<STR_LIT:->'.join((safer_name(self.distribution.get_name()),<EOL>safer_version(self.distribution.get_version())))<EOL>

Return distribution full name with - replaced with _


async def get_answers(<EOL>self, <EOL>context: TurnContext, <EOL>options: QnAMakerOptions = None, <EOL>telemetry_properties: Dict[str,str] = None,<EOL>telemetry_metrics: Dict[str,int] = None<EOL>) -> [QueryResult]:

hydrated_options = self._hydrate_options(options)<EOL>self._validate_options(hydrated_options)<EOL>result = self._query_qna_service(context.activity, hydrated_options)<EOL>await self._emit_trace_info(context, result, hydrated_options)<EOL>return result<EOL>

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]


def fill_qna_event(<EOL>self,<EOL>query_results: [QueryResult],<EOL>turn_context: TurnContext,<EOL>telemetry_properties: Dict[str,str] = None,<EOL>telemetry_metrics: Dict[str,float] = None<EOL>) -> EventData:

properties: Dict[str,str] = dict()<EOL>metrics: Dict[str, float] = dict()<EOL>properties[QnATelemetryConstants.knowledge_base_id_property] = self._endpoint.knowledge_base_id<EOL>text: str = turn_context.activity.text<EOL>userName: str = turn_context.activity.from_property.name<EOL>if self.log_personal_information:<EOL><INDENT>if text:<EOL><INDENT>properties[QnATelemetryConstants.question_property] = text<EOL><DEDENT>if userName:<EOL><INDENT>properties[QnATelemetryConstants.username_property] = userName<EOL><DEDENT><DEDENT>if len(query_results) > <NUM_LIT:0>:<EOL><INDENT>query_result = query_results[<NUM_LIT:0>]<EOL>result_properties = {<EOL>QnATelemetryConstants.matched_question_property: json.dumps(query_result.questions),<EOL>QnATelemetryConstants.question_id_property: str(query_result.id),<EOL>QnATelemetryConstants.answer_property: query_result.answer,<EOL>QnATelemetryConstants.score_metric: query_result.score,<EOL>QnATelemetryConstants.article_found_property: '<STR_LIT:true>'<EOL>}<EOL>properties.update(result_properties)<EOL><DEDENT>else:<EOL><INDENT>no_match_properties = {<EOL>QnATelemetryConstants.matched_question_property : '<STR_LIT>',<EOL>QnATelemetryConstants.question_id_property : '<STR_LIT>',<EOL>QnATelemetryConstants.answer_property : '<STR_LIT>',<EOL>QnATelemetryConstants.article_found_property : '<STR_LIT:false>'<EOL>}<EOL>properties.update(no_match_properties)<EOL><DEDENT>if telemetry_properties:<EOL><INDENT>properties.update(telemetry_properties)<EOL><DEDENT>if telemetry_metrics:<EOL><INDENT>metrics.update(telemetry_metrics)<EOL><DEDENT>return EventData(properties=properties, metrics=metrics)<EOL>

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 passed from the get_answers() method.

:rtype: EventData


def _hydrate_options(self, query_options: QnAMakerOptions) -> QnAMakerOptions:

hydrated_options = copy(self._options)<EOL>if query_options:<EOL><INDENT>if (<EOL>query_options.score_threshold != hydrated_options.score_threshold <EOL>and query_options.score_threshold<EOL>):<EOL><INDENT>hydrated_options.score_threshold = query_options.score_threshold<EOL><DEDENT>if (query_options.top != hydrated_options.top and query_options.top != <NUM_LIT:0>):<EOL><INDENT>hydrated_options.top = query_options.top<EOL><DEDENT>if (len(query_options.strict_filters) > <NUM_LIT:0>):<EOL><INDENT>hydrated_options.strict_filters = query_options.strict_filters<EOL><DEDENT><DEDENT>return hydrated_options<EOL>

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


@property<EOL><INDENT>def log_personal_information(self) -> bool:<DEDENT>

return self._log_personal_information<EOL>

Gets a value indicating whether to log personal information that came from the user to telemetry.

        :return: If True, personal information is logged to Telemetry; otherwise the properties will be filtered.
        :rtype: bool


@property<EOL><INDENT>def score(self) -> float:<DEDENT>

return self._score<EOL>

Gets confidence in an intent.

        :return: Confidence in an intent.
        :rtype: float


@property<EOL><INDENT>def properties(self) -> Dict[str, object]:<DEDENT>

return self._properties<EOL>

Gets any extra properties to include in the results.

        :return: Any extra properties to include in the results.
        :rtype: Dict[str, object]


@properties.setter<EOL><INDENT>def properties(self, value: Dict[str, object]) -> None:<DEDENT>

self._properties = value<EOL>

Sets any extra properties to include in the results.

        :param value: Any extra properties to include in the results.
        :type value: Dict[str, object]
        :return:
        :rtype: None


def __init__(self, application_id: str, endpoint_key: str, endpoint: str):

_, valid = LuisApplication._try_parse_uuid4(application_id)<EOL>if not valid:<EOL><INDENT>raise ValueError(f'<STR_LIT>')<EOL><DEDENT>_, valid = LuisApplication._try_parse_uuid4(endpoint_key)<EOL>if not valid:<EOL><INDENT>raise ValueError(f'<STR_LIT>')<EOL><DEDENT>if not endpoint or endpoint.isspace():<EOL><INDENT>endpoint = "<STR_LIT>"<EOL><DEDENT>_, valid = LuisApplication._try_parse_url(endpoint)<EOL>if not valid:<EOL><INDENT>raise ValueError(f'<STR_LIT>')<EOL><DEDENT>self._application_id = application_id<EOL>self._endpoint_key = endpoint_key<EOL>self._endpoint = endpoint<EOL>

Initializes a new instance of the <see cref="LuisApplication"/> class.

        :param application_id: LUIS application ID.
        :type application_id: str
        :param endpoint_key: LUIS subscription or endpoint key.
        :type endpoint_key: str
        :param endpoint: LUIS endpoint to use like https://westus.api.cognitive.microsoft.com.
        :type endpoint: str
        :raises ValueError:
        :raises ValueError:
        :raises ValueError:


@property<EOL><INDENT>def telemetry_client(self) -> BotTelemetryClient:<DEDENT>

return self._telemetry_client<EOL>

Gets the BotTelemetryClient used to log the LuisResult event.

        :return: The client used to log telemetry events.
        :rtype: BotTelemetryClient


@property<EOL><INDENT>def log(self) -> bool:<DEDENT>

return self._log<EOL>

Gets if queries should be logged in LUIS.

        :return: If queries should be logged in LUIS.
        :rtype: bool


@property<EOL><INDENT>def include_all_intents(self) -> bool:<DEDENT>

return self._include_all_intents<EOL>

Gets whether all intents come back or only the top one.

        :return: True for returning all intents.
        :rtype: bool


@property<EOL><INDENT>def spell_check(self) -> bool:<DEDENT>

return self._spell_check<EOL>

Gets whether to spell check queries.

        :return: Whether to spell check queries.
        :rtype: bool


@bing_spell_check_subscription_key.setter<EOL><INDENT>def bing_spell_check_subscription_key(self, value: str) -> None:<DEDENT>

self._bing_spell_check_subscription_key = value<EOL>

Sets the Bing Spell Check subscription key.

        :param value: The Bing Spell Check subscription key.
        :type value: str
        :return:
        :rtype: None


@property<EOL><INDENT>def staging(self) -> bool:<DEDENT>

return self._staging<EOL>

Gets whether to use the staging endpoint.

        :return: Whether to use the staging endpoint.
        :rtype: bool


@property<EOL><INDENT>def include_instance_data(self) -> bool:<DEDENT>

return self._include_instance_data<EOL>

Gets a value indicating whether or not instance data should be included in response.

        :return: A value indicating whether or not instance data should be included in response.
        :rtype: bool


@property<EOL><INDENT>def bing_spell_check_subscription_key(self) -> str:<DEDENT>

return self._bing_spell_check_subscription_key<EOL>

Gets the Bing Spell Check subscription key.

        :return: The Bing Spell Check subscription key.
        :rtype: str


@telemetry_client.setter<EOL><INDENT>def telemetry_client(self, value: BotTelemetryClient):<DEDENT>

self._telemetry_client = value<EOL>

Gets the currently configured <see cref="BotTelemetryClient"/> that logs the LuisResult event.

        :param value: The <see cref="BotTelemetryClient"/> being used to log events.
        :type value: BotTelemetryClient


@staticmethod<EOL><INDENT>def top_intent(<EOL>results: RecognizerResult, default_intent: str = "<STR_LIT:None>", min_score: float = <NUM_LIT:0.0><EOL>) -> str:<DEDENT>

if results is None:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>top_intent: str = None<EOL>top_score: float = -<NUM_LIT:1.0><EOL>if results.intents:<EOL><INDENT>for intent_name, intent_score in results.intents.items():<EOL><INDENT>score = intent_score.score<EOL>if score > top_score and score >= min_score:<EOL><INDENT>top_intent = intent_name<EOL>top_score = score<EOL><DEDENT><DEDENT><DEDENT>return top_intent or default_intent<EOL>

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
        :param min_score: Minimum score needed for an intent to be considered as a top intent. If all intents in the set are below this threshold then the `defaultIntent` will be returned, defaults to 0.0
        :param min_score: float, optional
        :raises TypeError:
        :return: The top scoring intent name.
        :rtype: str


@staticmethod<EOL><INDENT>def create_trace(<EOL>turn_activity: Activity,<EOL>name: str,<EOL>value: object = None,<EOL>value_type: str = None,<EOL>label: str = None,<EOL>) -> Activity:<DEDENT>

from_property = (<EOL>ChannelAccount(<EOL>id=turn_activity.recipient.id, name=turn_activity.recipient.name<EOL>)<EOL>if turn_activity.recipient is not None<EOL>else ChannelAccount()<EOL>)<EOL>if value_type is None and value is not None:<EOL><INDENT>value_type = type(value).__name__<EOL><DEDENT>reply = Activity(<EOL>type=ActivityTypes.trace,<EOL>timestamp=datetime.utcnow(),<EOL>from_property=from_property,<EOL>recipient=ChannelAccount(<EOL>id=turn_activity.from_property.id, name=turn_activity.from_property.name<EOL>),<EOL>reply_to_id=turn_activity.id,<EOL>service_url=turn_activity.service_url,<EOL>channel_id=turn_activity.channel_id,<EOL>conversation=ConversationAccount(<EOL>is_group=turn_activity.conversation.is_group,<EOL>id=turn_activity.conversation.id,<EOL>name=turn_activity.conversation.name,<EOL>),<EOL>name=name,<EOL>label=label,<EOL>value_type=value_type,<EOL>value=value,<EOL>)<EOL>return reply<EOL>

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="Activity.value"/> property., defaults to None
        :param value: object, optional
        :param value_type: The value to assign to the trace activity's <see cref="Activity.value_type"/> property, defaults to None
        :param value_type: str, optional
        :param label: The value to assign to the trace activity's <see cref="Activity.label"/> property, defaults to None
        :param label: str, optional
        :return: The created trace activity.
        :rtype: Activity


@text.setter<EOL><INDENT>def text(self, value: str) -> None:<DEDENT>

self._text = value<EOL>

Sets the input text to recognize.

        :param value: Original text to recognizer.
        :type value: str
        :return:
        :rtype: None


@property<EOL><INDENT>def intents(self) -> Dict[str, IntentScore]:<DEDENT>

return self._intents<EOL>

Gets the recognized intents, with the intent as key and the confidence as value.

        :return: Mapping from intent to information about the intent.
        :rtype: Dict[str, IntentScore]


@property<EOL><INDENT>def altered_text(self) -> str:<DEDENT>

return self._altered_text<EOL>

Gets the input text as modified by the recognizer, for example for spelling correction.

        :return: Text modified by recognizer.
        :rtype: str


@state.setter<EOL><INDENT>def state(self, value: Dict[str, object]) -> None:<DEDENT>

self._state = value<EOL>

Sets the instance's persisted state.

        :param:
        :param value: The instance's persisted state.
        :return:


@property<EOL><INDENT>def id(self) -> str:<DEDENT>

return self._id<EOL>

Gets the ID of the dialog this instance is for.

        :param:
        :return str:


@property<EOL><INDENT>def action(self) -> CardAction:<DEDENT>

return self._action<EOL>

Gets the action to use when rendering the choice as a suggested action or hero card.
        This is optional.

        :return: The action to use when rendering the choice as a suggested action or hero card.
        :rtype: CardAction


@property<EOL><INDENT>def synonyms(self) -> List[str]:<DEDENT>

return self._synonyms<EOL>

Gets the list of synonyms to recognize in addition to the value. This is optional.

        :return: The list of synonyms to recognize in addition to the value.
        :rtype: List[str]


@inline_separator.setter<EOL><INDENT>def inline_separator(self, value: str) -> None:<DEDENT>

self._inline_separator = value<EOL>

Sets the character used to separate individual choices when there are more than 2 choices.
        The default value is `", "`. This is optional.

        :param value: The character used to separate individual choices when there are more than 2 choices.
        :type value: str
        :return:
        :rtype: None


if self._stack != None and len(self._stack) > <NUM_LIT:0>:<EOL><INDENT>return self._stack[<NUM_LIT:0>]<EOL><DEDENT>return None<EOL>

Return the container link in the database.

        :param:
        :return str:


@property<EOL><INDENT>def parent(self) -> '<STR_LIT>':<DEDENT>

return self._parent<EOL>

Gets the parent DialogContext if any. Used when searching for dialogs to start.

:param:
:return The parent DialogContext:


def add_dialog(self, dialog: Dialog) -> object:

self._dialogs.add(dialog)<EOL>if not self.initial_dialog_id:<EOL><INDENT>self.initial_dialog_id = dialog.id<EOL><DEDENT>return self<EOL>

Adds a dialog to the component dialog.
Adding a new dialog will inherit the BotTelemetryClient of the ComponentDialog.
:param dialog: The dialog to add.
:return: The updated ComponentDialog


@succeeded.setter<EOL><INDENT>def succeeded(self, value: bool) -> None:<DEDENT>

self._succeeded = value<EOL>

Sets the whether the users utterance was successfully recognized
        Parameters
        ----------
        value
            A bool indicating whether the users utterance was successfully recognized


@property<EOL><INDENT>def default_locale(self) -> str:<DEDENT>

return self._default_locale<EOL>

Gets the locale used if `TurnContext.activity.locale` is not specified.


@default_locale.setter<EOL><INDENT>def default_locale(self, value: str) -> None:<DEDENT>

self._default_locale = value<EOL>

Gets the locale used if `TurnContext.activity.locale` is not specified.

        :param value: The locale used if `TurnContext.activity.locale` is not specified.


@number_of_attempts.setter<EOL><INDENT>def number_of_attempts(self, value: int) -> None:<DEDENT>

self._number_of_attempts = value<EOL>

Sets the count of the number of times the prompt has retried.
        Parameters
        ----------
        value
            Count of the number of times the prompt has retried.


@retry_prompt.setter<EOL><INDENT>def retry_prompt(self, value: Activity) -> None:<DEDENT>

self._retry_prompt = value<EOL>

Sets the retry prompt to send the user as Activity.
        Parameters
        ----------
        value
            The new value of the retry prompt.


@property<EOL><INDENT>def state(self) -> Dict:<DEDENT>

return self._recognized<EOL>

A dictionary of values persisted for each conversational turn while the prompt is active.

        Note
        ----
        The validator can use this to persist things like turn counts or other state information.


@property<EOL><INDENT>def options(self) -> PromptOptions:<DEDENT>

return self._options<EOL>

Original set of options passed to the prompt by the calling dialog.

        Note
        ----
        The validator can extend this interface to support additional prompt options.


async def resume_dialog(self, dc, reason: DialogReason, result: object):

<EOL>return await dc.EndDialog(result)<EOL>

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 dialog will be passed
to the current dialog's parent.
:param dc: The dialog context for the current turn of conversation.
:param reason: Reason why the dialog resumed.
:param result: (Optional) value returned from the dialog that was called. The type of the value returned is dependent on the dialog that was called.
:return:


@abstractmethod<EOL><INDENT>async def begin_dialog(self, dc, options: object = None):<DEDENT>

raise NotImplementedError()<EOL>

Method called when a new dialog has been pushed onto the stack and is being activated.
:param dc: The dialog context for the current turn of conversation.
:param options: (Optional) additional argument(s) to pass to the dialog being started.


<EOL>return await dc.end_dialog(None)<EOL>

Method called when an instance of the dialog is the "current" dialog and the
user replies with a new activity. The dialog will generally continue to receive the user's
replies until it calls either `end_dialog()` or `begin_dialog()`.
If this method is NOT implemented then the dialog will automatically be ended when the user replies.
:param dc: The dialog context for the current turn of conversation.
:return:


if not step:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>self._steps.append(step)<EOL>return self<EOL>

Adds a new step to the waterfall.
:param step: Step to add

:return: Waterfall dialog for fluent calls to `add_step()`.


def track_exception(self, type_exception: type = None, value : Exception =None, tb : traceback =None, <EOL>properties: Dict[str, object]=None, measurements: Dict[str, object]=None) -> None:

self._client.track_exception(type_exception, value, tb, properties, measurements)<EOL>

Send information about a single exception that occurred in the application.
:param type_exception: 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 set of custom properties the client wants attached to this data item. (defaults to: None)
:param measurements: the set of custom measurements the client wants to attach to this data item. (defaults to: None)


async def delete(self, keys: List[str]):

try:<EOL><INDENT>if not self.__container_exists:<EOL><INDENT>self.__create_db_and_container()<EOL><DEDENT>for k in keys:<EOL><INDENT>self.client.DeleteItem(<EOL>document_link=self.__item_link(self.__sanitize_key(k)))<EOL><DEDENT><DEDENT>except cosmos_errors.HTTPFailure as h:<EOL><INDENT>if h.status_code != <NUM_LIT>:<EOL><INDENT>raise h<EOL><DEDENT><DEDENT>except TypeError as e:<EOL><INDENT>raise e<EOL><DEDENT>

Remove storeitems from storage.

        :param keys:
        :return:


def __get_or_create_database(self, doc_client, id) -> str:

<EOL>dbs = list(doc_client.QueryDatabases({<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": [<EOL>{"<STR_LIT:name>": "<STR_LIT>", "<STR_LIT:value>": id}<EOL>]<EOL>}))<EOL>if len(dbs) > <NUM_LIT:0>:<EOL><INDENT>return dbs[<NUM_LIT:0>]['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>res = doc_client.CreateDatabase({'<STR_LIT:id>': id})<EOL>return res['<STR_LIT:id>']<EOL><DEDENT>

Return the database link.

        Check if the database exists or create the db.

        :param doc_client:
        :param id:
        :return str:


@property<EOL><INDENT>def __container_exists(self) -> bool:<DEDENT>

return self.db and self.container<EOL>

Return whether the database and container have been created.

        :return bool:


@property<EOL><INDENT>def __container_link(self) -> str:<DEDENT>

return self.__database_link + '<STR_LIT>' + self.container<EOL>

Return the container link in the database.

        :param:
        :return str:


@staticmethod<EOL><INDENT>def receipt_card(card: ReceiptCard) -> Attachment:<DEDENT>

if not isinstance(card, ReceiptCard):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>return Attachment(content_type=CardFactory.content_types.receipt_card,<EOL>content=card)<EOL>

Returns an attachment for a receipt card. Will raise a TypeError if 'card' argument is not a ReceiptCard.
:param card:
:return:


@staticmethod<EOL><INDENT>def thumbnail_card(card: ThumbnailCard) -> Attachment:<DEDENT>

if not isinstance(card, ThumbnailCard):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>return Attachment(content_type=CardFactory.content_types.thumbnail_card,<EOL>content=card)<EOL>

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 under the card. Will raise a TypeError if 'card' argument is not a ThumbnailCard.
:param card:
:return:


@staticmethod<EOL><INDENT>def adaptive_card(card: dict) -> Attachment:<DEDENT>

if not type(card) == dict:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>return Attachment(content_type=CardFactory.content_types.adaptive_card,<EOL>content=card)<EOL>

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:


async def delete(self, turn_context: TurnContext) -> None:

if turn_context == None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>turn_context.turn_state.pop(self._context_service_key)<EOL>storage_key = self.get_storage_key(turn_context)<EOL>await self._storage.delete({ storage_key })<EOL>

Delete any state currently stored in this state scope.

:param turn_context: The context object for this turn.
:return: None


async def clear_state(self, turn_context: TurnContext):

if turn_context == None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>cache_value = CachedBotState()<EOL>cache_value.hash = '<STR_LIT>'<EOL>turn_context.turn_state[self._context_service_key] = cache_value<EOL>

Clears any state currently stored in this state scope.
NOTE: that save_changes must be called in order for the cleared state to be persisted to the underlying store.

:param turn_context: The context object for this turn.
:return: None


async def save_changes(self, turn_context: TurnContext, force: bool = False) -> None:

if turn_context == None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>cached_state = turn_context.turn_state.get(self._context_service_key)<EOL>if force or (cached_state != None and cached_state.is_changed == True):<EOL><INDENT>storage_key = self.get_storage_key(turn_context)<EOL>changes : Dict[str, object] = { storage_key: cached_state.state }<EOL>await self._storage.write(changes)<EOL>cached_state.hash = cached_state.compute_hash(cached_state.state)<EOL><DEDENT>

If it has changed, writes to storage the state object that is cached in the current context object for this turn.
:param turn_context: The context object for this turn.
:param force: Optional. True to save state to storage whether or not there are changes.


async def continue_conversation(self, reference, logic):

raise NotImplementedError('<STR_LIT>')<EOL>

The `TestAdapter` doesn't implement `continueConversation()` and will return an error if it's
called.
:param reference:
:param logic:
:return:


async def send(self, user_says) -> '<STR_LIT>':

async def new_previous():<EOL><INDENT>nonlocal self, user_says<EOL>if callable(self.previous):<EOL><INDENT>await self.previous()<EOL><DEDENT>await self.adapter.receive_activity(user_says)<EOL><DEDENT>return TestFlow(await new_previous(), self.adapter)<EOL>

Sends something to the bot.
:param user_says:
:return:


async def send(self, user_says) -> object:

return TestFlow(await self.receive_activity(user_says), self)<EOL>

Sends something to the bot. This returns a new `TestFlow` instance which can be used to add
additional steps for inspecting the bots reply and then sending additional activities.
:param user_says:
:return: A new instance of the TestFlow object


async def delete_activity(self, context, reference: ConversationReference):

self.deleted_activities.append(reference)<EOL>

INTERNAL: called by the logic under test to delete an existing activity. These are simply
pushed onto a [deletedActivities](#deletedactivities) array for inspection after the turn
completes.
:param reference:
:return:


def on_update_activity(self, handler) -> '<STR_LIT>':

self._on_update_activity.append(handler)<EOL>return self<EOL>

Registers a handler to be notified of and potentially intercept an activity being updated.
:param handler:
:return:


def on_send_activities(self, handler) -> '<STR_LIT>':

self._on_send_activities.append(handler)<EOL>return self<EOL>

Registers a handler to be notified of and potentially intercept the sending of activities.
:param handler:
:return:


return self._services<EOL>

Map of services and other values cached for the lifetime of the turn.
:return:


def set(self, key: str, value: object) -> None:

if not key or not isinstance(key, str):<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>self._services[key] = value<EOL>

Caches a value for the lifetime of the current turn.
:param key:
:param value:
:return:


def copy_to(self, context: '<STR_LIT>') -> None:

for attribute in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>setattr(context, attribute, getattr(self, attribute))<EOL><DEDENT>

Called when this TurnContext instance is passed into the constructor of a new TurnContext
instance. Can be overridden in derived classes.
:param context:
:return:


async def send_activity(self, *activity_or_text: Union[Activity, str]) -> ResourceResponse:

reference = TurnContext.get_conversation_reference(self.activity)<EOL>output = [TurnContext.apply_conversation_reference(<EOL>Activity(text=a, type='<STR_LIT:message>') if isinstance(a, str) else a, reference)<EOL>for a in activity_or_text]<EOL>for activity in output:<EOL><INDENT>activity.input_hint = '<STR_LIT>'<EOL><DEDENT>async def callback(context: '<STR_LIT>', output):<EOL><INDENT>responses = await context.adapter.send_activities(context, output)<EOL>context._responded = True<EOL>return responses<EOL><DEDENT>await self._emit(self._on_send_activities, output, callback(self, output))<EOL>

Sends a single activity or message to the user.
:param activity_or_text:
:return:


@abstractmethod<EOL><INDENT>async def delete_activity(self, context: TurnContext, reference: ConversationReference):<DEDENT>

raise NotImplementedError()<EOL>

Deletes an existing activity.
:param reference:
:return:


@staticmethod<EOL><INDENT>def list(attachments: List[Attachment], text: str = None, speak: str = None,<EOL>input_hint: Union[InputHints, str] = None) -> Activity:<DEDENT>

return attachment_activity(AttachmentLayoutTypes.list, attachments, text, speak, input_hint)<EOL>

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')],
                                                     buttons=[CardAction(title='button1')])),
                               CardFactory.hero_card(HeroCard(title='title2',
                                                     images=[CardImage(url='imageUrl2')],
                                                     buttons=[CardAction(title='button2')])),
                               CardFactory.hero_card(HeroCard(title='title3',
                                                     images=[CardImage(url='imageUrl3')],
                                                     buttons=[CardAction(title='button3')]))])
await context.send_activity(message)

:param attachments:
:param text:
:param speak:
:param input_hint:
:return:


@abstractmethod<EOL><INDENT>def track_dependency(self, name:str, data:str, type:str=None, target:str=None, duration:int=None, <EOL>success:bool=None, result_code:str=None, properties:Dict[str, object]=None, <EOL>measurements:Dict[str, object]=None, dependency_id:str=None):<DEDENT>

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 SQL statement and HTTP URL with all query parameters.
:param type: the dependency type name. Low cardinality value for logical grouping of dependencies and interpretation of other fields like commandName and resultCode. Examples are SQL, Azure table, and HTTP. (default to: None)
:param target: the target site of a dependency call. Examples are server name, host address. (default to: None)
:param duration: the number of milliseconds that this dependency call lasted. (defaults to: None)
:param success: true if the dependency call ended in success, false otherwise. (defaults to: None)
:param result_code: the result code of a dependency call. Examples are SQL error code and HTTP status code. (defaults to: None)
:param properties: the set of custom properties the client wants attached to this data item. (defaults to: None)
:param measurements: the set of custom measurements the client wants to attach to this data item. (defaults to: None)
:param id: the id for this dependency call. If None, a new uuid will be generated. (defaults to: None)


@abstractmethod<EOL><INDENT>def track_exception(self, type: type = None, value : Exception =None, tb : traceback =None, <EOL>properties: Dict[str, object]=None, measurements: Dict[str, object]=None) -> None:<DEDENT>

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 set of custom properties the client wants attached to this data item. (defaults to: None)
:param measurements: the set of custom measurements the client wants to attach to this data item. (defaults to: None)


@abstractmethod<EOL><INDENT>async def get(self, turnContext: TurnContext, default_value_factory = None):<DEDENT>

raise NotImplementedError()<EOL>

Get the property value from the source
:param turn_context: Turn Context.
:param default_value_factory: Function which defines the property value to be returned if no value has been set.

:return:


@abstractmethod<EOL><INDENT>async def delete(self, turnContext: TurnContext):<DEDENT>

raise NotImplementedError()<EOL>

Saves store items to storage.
:param turn_context: Turn Context.
:return:


def track_pageview(self, name: str, url, duration: int = <NUM_LIT:0>, properties : Dict[str, object]=None, <EOL>measurements: Dict[str, object]=None) -> None:

pass<EOL>

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 set of custom properties the client wants attached to this data item. (defaults to: None)
:param measurements: the set of custom measurements the client wants to attach to this data item. (defaults to: None)


def track_trace(self, name, properties=None, severity=None):

pass<EOL>

Sends a single trace statement.
:param name: the trace statement.\n
:param properties: the set of custom properties the client wants attached to this data item. (defaults to: None)\n
:param severity: the severity level of this trace, one of DEBUG, INFO, WARNING, ERROR, CRITICAL


def create_connector_client(self, service_url: str) -> ConnectorClient:

client = ConnectorClient(self._credentials, base_url=service_url)<EOL>client.config.add_user_agent(USER_AGENT)<EOL>return client<EOL>

Allows for mocking of the connector client in unit tests.
:param service_url:
:return:


return TurnContext(self, activity)<EOL>

Allows for the overriding of the context object in unit tests and derived adapters.
:param activity:
:return:


async def process_activity(self, req, auth_header: str, logic: Callable):

activity = await self.parse_request(req)<EOL>auth_header = auth_header or '<STR_LIT>'<EOL>await self.authenticate_request(activity, auth_header)<EOL>context = self.create_context(activity)<EOL>return await self.run_middleware(context, logic)<EOL>

Processes an activity received by the bots web server. This includes any messages sent from a
user and is the method that drives what's often referred to as the bots "Reactive Messaging"
flow.
:param req:
:param auth_header:
:param logic:
:return:


async def send_activities(self, context: TurnContext, activities: List[Activity]):

if context is None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if type(activities) != list:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if len(activities) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>async def next_activity(i: int):<EOL><INDENT>responses = []<EOL>if i < len(activities):<EOL><INDENT>responses.append(ResourceResponse())<EOL>a = activities[i]<EOL>if a.type == '<STR_LIT>':<EOL><INDENT>await asyncio.sleep(a.delay)<EOL>await next_activity(i + <NUM_LIT:1>)<EOL><DEDENT>elif a.type == ActivityTypes.message:<EOL><INDENT>if a.attachments is not None and len(a.attachments) > <NUM_LIT:0>:<EOL><INDENT>append = '<STR_LIT>' if len(a.attachments) == <NUM_LIT:1> else f'<STR_LIT>'<EOL>print(f'<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>print(a.text)<EOL><DEDENT>await next_activity(i + <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>print(f'<STR_LIT>')<EOL>await next_activity(i + <NUM_LIT:1>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return responses<EOL><DEDENT><DEDENT>await next_activity(<NUM_LIT:0>)<EOL>

Logs a series of activities to the console.
:param context:
:param activities:
:return:


async def update_activity(self, context: TurnContext, activity: Activity):

Not supported for the ConsoleAdapter. Calling this method or `TurnContext.update_activity()`
will result an error being returned.
:param context:
:param activity:
:return:


from django import forms<EOL>from django.http import HttpResponse<EOL>from django.shortcuts import redirect<EOL>from django.template import Context, Template<EOL>class TestForm(forms.Form):<EOL><INDENT>name = forms.CharField()<EOL><DEDENT>if request.POST:<EOL><INDENT>form = TestForm(request.POST)<EOL>if form.is_valid():<EOL><INDENT>return redirect('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>form = TestForm()<EOL><DEDENT>template = Template("<STR_LIT>")<EOL>context = Context({'<STR_LIT>' : form})<EOL>return HttpResponse(template.render(context))<EOL>


form_data = {}<EOL>form_files = {}<EOL>form_fields, fields_args = split_model_kwargs(kwargs)<EOL>for name, field in form_cls.base_fields.iteritems():<EOL><INDENT>if name in form_fields:<EOL><INDENT>form_data[name] = kwargs[name]<EOL><DEDENT>else:<EOL><INDENT>form_data[name] = any_form_field(field, **fields_args[name])<EOL><DEDENT><DEDENT>return form_data, form_files<EOL>


min_value = <NUM_LIT:0><EOL>max_value = <NUM_LIT:10><EOL>from django.core.validators import MinValueValidator, MaxValueValidator <EOL>for elem in field.validators:<EOL><INDENT>if isinstance(elem, MinValueValidator):<EOL><INDENT>min_value = elem.limit_value<EOL><DEDENT>if isinstance(elem, MaxValueValidator):<EOL><INDENT>max_value = elem.limit_value<EOL><DEDENT><DEDENT>if (field.max_digits and field.decimal_places):<EOL><INDENT>from decimal import Decimal<EOL>max_value = min(max_value,<EOL>Decimal('<STR_LIT>' % ('<STR_LIT>'*(field.max_digits-field.decimal_places),<EOL>'<STR_LIT>'*field.decimal_places)))<EOL><DEDENT>min_value = kwargs.get('<STR_LIT>') or min_value<EOL>max_value = kwargs.get('<STR_LIT>') or max_value<EOL>return str(xunit.any_decimal(min_value=min_value,<EOL>max_value=max_value,<EOL>decimal_places = field.decimal_places or <NUM_LIT:2>))<EOL>

Return random value for DecimalField

>>> result = any_form_field(forms.DecimalField(max_value=100, min_value=11, max_digits=4, decimal_places = 2))
>>> type(result)
<type 'str'>
>>> from decimal import Decimal
>>> Decimal(result) >= 11, Decimal(result) <= Decimal('99.99')
(True, True)


data = list(field.queryset[:<NUM_LIT:10>])<EOL>if data:<EOL><INDENT>return random.choice(data)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>' % field.queryset.model)<EOL><DEDENT>

Return one of first ten items for field queryset


choices = kwargs.get('<STR_LIT>')<EOL>if choices:<EOL><INDENT>return random.choice(choices)<EOL><DEDENT>else:<EOL><INDENT>nums = [str(xunit.any_int(min_value=<NUM_LIT:0>, max_value=<NUM_LIT:255>)) for _ in xrange(<NUM_LIT:0>, <NUM_LIT:4>)]<EOL>return "<STR_LIT:.>".join(nums)<EOL><DEDENT>

Return random value for IPAddressField

>>> result = any_form_field(forms.IPAddressField())
>>> type(result)
<type 'str'>
>>> from django.core.validators import ipv4_re
>>> import re
>>> re.match(ipv4_re, result) is not None
True


min_value = <NUM_LIT:0><EOL>max_value = <NUM_LIT:100><EOL>from django.core.validators import MinValueValidator, MaxValueValidator <EOL>for elem in field.validators:<EOL><INDENT>if isinstance(elem, MinValueValidator):<EOL><INDENT>min_value = elem.limit_value<EOL><DEDENT>if isinstance(elem, MaxValueValidator):<EOL><INDENT>max_value = elem.limit_value<EOL><DEDENT><DEDENT>min_value = kwargs.get('<STR_LIT>', min_value)<EOL>max_value = kwargs.get('<STR_LIT>', max_value)<EOL>return str(xunit.any_int(min_value=min_value, max_value=max_value))<EOL>

Return random value for IntegerField

>>> result = any_form_field(forms.IntegerField(max_value=200, min_value=100))
>>> type(result)
<type 'str'>
>>> int(result) >=100, int(result) <=200
(True, True)


min_value = <NUM_LIT:0><EOL>max_value = <NUM_LIT:100><EOL>from django.core.validators import MinValueValidator, MaxValueValidator<EOL>for elem in field.validators:<EOL><INDENT>if isinstance(elem, MinValueValidator):<EOL><INDENT>min_value = elem.limit_value<EOL><DEDENT>if isinstance(elem, MaxValueValidator):<EOL><INDENT>max_value = elem.limit_value<EOL><DEDENT><DEDENT>min_value = kwargs.get('<STR_LIT>', min_value)<EOL>max_value = kwargs.get('<STR_LIT>', max_value)<EOL>precision = kwargs.get('<STR_LIT>', <NUM_LIT:3>)<EOL>return str(xunit.any_float(min_value=min_value, max_value=max_value, precision=precision))<EOL>

Return random value for FloatField

>>> result = any_form_field(forms.FloatField(max_value=200, min_value=100))
>>> type(result)
<type 'str'>
>>> float(result) >=100, float(result) <=200
(True, True)


return random.choice(['<STR_LIT:None>', '<STR_LIT:True>', '<STR_LIT:False>'])<EOL>

Return random value for NullBooleanField

>>> result = any_form_field(forms.NullBooleanField())
>>> type(result)
<type 'unicode'>
>>> result in [u'1', u'2', u'3']
True


if field.choices:<EOL><INDENT>from django_any.functions import valid_choices <EOL>l = list(valid_choices(field.choices))<EOL>random.shuffle(l)<EOL>choices = []<EOL>count = xunit.any_int(min_value=<NUM_LIT:1>, max_value=len(field.choices))<EOL>for i in xrange(<NUM_LIT:0>, count):<EOL><INDENT>choices.append(l[i])<EOL><DEDENT>return '<STR_LIT:U+0020>'.join(choices)<EOL><DEDENT>return '<STR_LIT:None>'<EOL>

Return random value for MultipleChoiceField

>>> CHOICES = [('YNG', 'Child'), ('MIDDLE', 'Parent') ,('OLD', 'GrandParent')]
>>> result = any_form_field(forms.MultipleChoiceField(choices=CHOICES))
>>> type(result)
<type 'str'>


def _wrapper(self, seed=seed, *args, **kwargs):<EOL><INDENT>self.__django_any_seed = seed if seed else int(time.time()*<NUM_LIT:1000>)<EOL>random.seed(self.__django_any_seed)<EOL>return func(self, *args, **kwargs)<EOL><DEDENT>return _wrapper<EOL>

Set randon seed before executing function. If seed is
not provided current timestamp used


for key, value in choices:<EOL><INDENT>if isinstance(value, (list, tuple)):<EOL><INDENT>for key, _ in value:<EOL><INDENT>yield key<EOL><DEDENT><DEDENT>else:<EOL><INDENT>yield key<EOL><DEDENT><DEDENT>


from collections import defaultdict<EOL>model_fields = {}<EOL>fields_agrs = defaultdict(lambda : {})<EOL>for key in kw.keys():<EOL><INDENT>if '<STR_LIT>' in key:<EOL><INDENT>field, _, subfield = key.partition('<STR_LIT>')<EOL>fields_agrs[field][subfield] = kw[key]<EOL><DEDENT>else:<EOL><INDENT>model_fields[key] = kw[key]<EOL><DEDENT><DEDENT>return model_fields, fields_agrs<EOL>


def _create_value(self, *args, **kwargs):

if not len(args):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if self.by_instance:<EOL><INDENT>field_type = args[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>field_type = args[<NUM_LIT:0>].__class__<EOL><DEDENT>function = self.registry.get(field_type, self.default)<EOL>if function is None:<EOL><INDENT>raise TypeError("<STR_LIT>" % field_type)<EOL><DEDENT>return function(*args, **kwargs)<EOL>

Lowest value generator.

Separated from __call__, because it seems that python
cache __call__ reference on module import


def any_string(letters = ascii_letters, min_length=<NUM_LIT:3>, max_length=<NUM_LIT:100>):

length = random.randint(min_length, max_length)<EOL>letters = [any_letter(letters=letters) for _ in range(<NUM_LIT:0>, length)]<EOL>return "<STR_LIT>".join(letters)<EOL>

Return string with random content

>>> result = any_string(letters = ascii_letters, min_length=3, max_length=100)
>>> type(result)
<type 'str'>
>>> len(result) in range(3,101)
True
>>> any([c in ascii_letters for c in result])
True


def any_int(min_value=<NUM_LIT:0>, max_value=<NUM_LIT:100>, **kwargs):

return random.randint(min_value, max_value)<EOL>

Return random integer from the selected range

>>> result = any_int(min_value=0, max_value=100)
>>> type(result)
<type 'int'>
>>> result in range(0,101)
True


def any_decimal(min_value=Decimal(<NUM_LIT:0>), max_value=Decimal('<STR_LIT>'), decimal_places=<NUM_LIT:2>):

return Decimal(str(any_float(min_value=float(min_value),<EOL>max_value=float(max_value),<EOL>precision=decimal_places)))<EOL>

Return random decimal from the [min_value, max_value] interval

>>> result = any_decimal(min_value=0.999, max_value=3, decimal_places=3)
>>> type(result)
<class 'decimal.Decimal'>
>>> result >= Decimal('0.999') and result <= Decimal(3)
True


def any_date(from_date=date(<NUM_LIT>, <NUM_LIT:1>, <NUM_LIT:1>), to_date=date.today()):

days = any_int(min_value=<NUM_LIT:0>, max_value=(to_date - from_date).days)<EOL>return from_date + timedelta(days=days)<EOL>

Return random date from the [from_date, to_date] interval

>>> result = any_date(from_date=date(1990,1,1), to_date=date(1990,1,3))
>>> type(result)
<type 'datetime.date'>
>>> result >= date(1990,1,1) and result <= date(1990,1,3)
True


min_value = kwargs.get('<STR_LIT>', <NUM_LIT:1>)<EOL>max_value = kwargs.get('<STR_LIT>', <NUM_LIT>)<EOL>return xunit.any_int(min_value=min_value, max_value=max_value)<EOL>

An positive integer

>>> result = any_field(models.PositiveIntegerField())
>>> type(result)
<type 'int'>
>>> result > 0
True


min_length = kwargs.get('<STR_LIT>', <NUM_LIT:1>)<EOL>max_length = kwargs.get('<STR_LIT:max_length>', field.max_length)<EOL>return xunit.any_string(min_length=min_length, max_length=max_length)<EOL>

Return random value for CharField

>>> result = any_field(models.CharField(max_length=10))
>>> type(result)
<type 'str'>


min_value = kwargs.get('<STR_LIT>', -<NUM_LIT:255>)<EOL>max_value = kwargs.get('<STR_LIT>', <NUM_LIT:255>)<EOL>return xunit.any_int(min_value=min_value, max_value=max_value)<EOL>

Return random value for SmallIntegerValue
>>> result = any_field(models.SmallIntegerField())
>>> type(result)
<type 'int'>
>>> result > -256, result < 256
(True, True)


def wrapper(field, **kwargs):<EOL><INDENT>if kwargs.get('<STR_LIT>', False):<EOL><INDENT>return None<EOL><DEDENT>if field.blank and random.random < <NUM_LIT:0.1>:<EOL><INDENT>return None<EOL><DEDENT>return function(field, **kwargs)<EOL><DEDENT>return wrapper<EOL>

Sometimes return None if field could be blank


def get_some_file(path):<EOL><INDENT>subdirs, files = [], []<EOL>for entry in os.listdir(path):<EOL><INDENT>entry_path = os.path.join(path, entry)<EOL>if os.path.isdir(entry_path):<EOL><INDENT>subdirs.append(entry_path)<EOL><DEDENT>else:<EOL><INDENT>if not field.match or re.match(field.match,entry):<EOL><INDENT>files.append(entry_path)<EOL><DEDENT><DEDENT><DEDENT>if files:<EOL><INDENT>return random.choice(files)<EOL><DEDENT>if field.recursive:<EOL><INDENT>for subdir in subdirs:<EOL><INDENT>result = get_some_file(subdir)<EOL>if result:<EOL><INDENT>return result<EOL><DEDENT><DEDENT><DEDENT><DEDENT>result = get_some_file(field.path)<EOL>if result is None and not field.null:<EOL><INDENT>raise TypeError("<STR_LIT>" % field.path)<EOL><DEDENT>return result<EOL>


letters = ascii_letters + digits + '<STR_LIT>'<EOL>return xunit.any_string(letters = letters, max_length = field.max_length)<EOL>

Return random value for SlugField
>>> result = any_field(models.SlugField())
>>> type(result)
<type 'str'>
>>> from django.core.validators import slug_re
>>> re.match(slug_re, result) is not None
True


nums_count = field.max_length/<NUM_LIT:2><EOL>nums = [str(xunit.any_int(min_value=<NUM_LIT:0>, max_value=<NUM_LIT:9>)) for _ in xrange(<NUM_LIT:0>, nums_count)]<EOL>return "<STR_LIT:U+002C>".join(nums)<EOL>

Return random value for CharField

>>> result = any_field(models.CommaSeparatedIntegerField(max_length=10))
>>> type(result)
<type 'str'>
>>> [int(num) for num in result.split(',')] and 'OK'
'OK'


cancel = self.cancel<EOL>result = []<EOL>for block, _ in self._submitted.itervalues():<EOL><INDENT>try:<EOL><INDENT>result.append(cancel(block))<EOL><DEDENT>except OSError as exc:<EOL><INDENT>if exc.errno != errno.EINVAL:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>return result<EOL>

Cancel all submitted IO blocks.

Blocks until all submitted transfers have been finalised.
Submitting more transfers or processing completion events while this
method is running produces undefined behaviour.
Returns the list of values returned by individual cancellations.
See "cancel" documentation.


self.close()<EOL>

Calls close, in case instance was not properly closed by the time it
gets garbage-collected.


return (<EOL>self._iocb.aio_reqprio<EOL>if self._iocb.u.c.flags & libaio.IOCB_FLAG_IOPRIO else<EOL>None<EOL>)<EOL>


if self._ctx is not None:<EOL><INDENT>self._io_queue_release(self._ctx)<EOL>del self._ctx<EOL><DEDENT>

Cancels all pending IO blocks.
Waits until all non-cancellable IO blocks finish.
De-initialises AIO context.


self._maxevents = maxevents<EOL>self._submitted = {}<EOL>self._io_queue_release = libaio.io_queue_release<EOL>ctx = libaio.io_context_t()<EOL>libaio.io_queue_init(self._maxevents, byref(ctx))<EOL>self._ctx = ctx<EOL>

maxevents (int)
    Maximum number of events this context will have to handle.


return unpack('<STR_LIT>', self._file.read(<NUM_LIT:8>))[<NUM_LIT:0>]<EOL>

Read current counter value.

See manpage for flags effect on this.


return self._iocb.u.c.offset.value<EOL>

The file offset this instance writes to/reads from.

Only available in mode != AIOBLOCK_MODE_POLL.


event = libaio.io_event()<EOL>try:<EOL><INDENT>libaio.io_cancel(self._ctx, byref(block._iocb), byref(event))<EOL><DEDENT>except OSError as exc:<EOL><INDENT>if exc.errno == errno.EINPROGRESS:<EOL><INDENT>return None<EOL><DEDENT>raise<EOL><DEDENT>return self._eventToPython(event)<EOL>

Cancel an IO block.

block (AIOBlock)
    The IO block to cancel.

Returns cancelled block's event data (see getEvents), or None if the
kernel returned EINPROGRESS. In the latter case, event completion will
happen on a later getEvents call.


compiler = new_compiler()<EOL>hasopenmp = hasfunction(compiler, '<STR_LIT>')<EOL>needs_gomp = hasopenmp<EOL>if not hasopenmp:<EOL><INDENT>compiler.add_library('<STR_LIT>')<EOL><DEDENT>hasopenmp = hasfunction(compiler, '<STR_LIT>')<EOL>needs_gomp = hasopenmp<EOL>return hasopenmp<EOL>

Does this compiler support OpenMP parallelization?


def get_link_display(url):<EOL><INDENT>unquoted = unquote(url.split('<STR_LIT>')[-<NUM_LIT:1>])<EOL>if sys.version_info.major == <NUM_LIT:2>:  <EOL><INDENT>from django.utils.encoding import force_unicode<EOL>unquoted = force_unicode(unquoted)<EOL><DEDENT>return escape(unquoted)<EOL><DEDENT>def get_template_substitution_values(self, value):<EOL><INDENT>subst = super(cls, self).get_template_substitution_values(value)<EOL>subst['<STR_LIT>'] = get_link_display(value.url)<EOL>return subst<EOL><DEDENT>setattr(cls,<EOL>'<STR_LIT>',<EOL>get_template_substitution_values)<EOL>def get_context(self, name, value, attrs):<EOL><INDENT>context = super(cls, self).get_context(name, value, attrs)<EOL>if value and hasattr(value, '<STR_LIT:url>'):<EOL><INDENT>context['<STR_LIT>']['<STR_LIT>'] = get_link_display(value.url)<EOL><DEDENT>return context<EOL><DEDENT>setattr(cls, '<STR_LIT>', get_context)<EOL>return cls<EOL>


return self.generator_function(**self.arguments)<EOL>


class_str = self.__class__.__name__<EOL>json_str = json.dumps(self.__dict__, ensure_ascii=False)<EOL>return "<STR_LIT>".format(class_str, repr(json_str))<EOL>

A string representing this object as valid Python expression.


return json.dumps(self.__dict__, ensure_ascii=False, indent=<NUM_LIT:4>)<EOL>

A human-readable string representation of this object.


return SimpleDataModel(json_data)<EOL>

Factory function for creating SimpleDataModel objects.

    Args:
        model(basestring): The data model to use when creating the data
            object (message, room, membership, etc.).
        json_data(basestring, dict): The JSON string or dictionary data with
            which to initialize the object.

    Returns:
        SimpleDataModel: The created SimpleDataModel object.

    Raises:
        TypeError: If the json_data parameter is not a JSON string or
            dictionary.


return self._json_data.get('<STR_LIT:id>')<EOL>


return self._json_data.get('<STR_LIT>')<EOL>

The human-friendly display name of the Organization.


return self._json_data.get('<STR_LIT:name>')<EOL>


Indicates if the webhook is owned by the `org` or the `creator`.

        Webhooks owned by the creator can only receive events that are
        accessible to the creator of the webhook. Those owned by the
        organization will receive events that are visible to anyone in the
        organization.


The ID of the organization that owns the webhook.


created = self._json_data.get('<STR_LIT>')<EOL>if created:<EOL><INDENT>return WebexTeamsDateTime.strptime(created)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>

The date and time when the room was created.


The ID for the team with which this room is associated.


return self._json_data.get('<STR_LIT:type>')<EOL>

The type of room (i.e. 'group', 'direct' etc.).


Person has been sent an invite, but hasn't responded.


return self._json_data.get('<STR_LIT:status>')<EOL>


Identifies the application that added the webhook.


Creation date and time in ISO8601 format.


The ID of the organization that the person is associated with.


The date and time the event was performed.


The event type (`created`, `updated`, `deleted`).


return dict(self._json_data)<EOL>

Convert the Webex Teams object data to a dictionary.


<EOL>return self._json_data.copy()<EOL>

A copy of the data object's JSON data (OrderedDict).


super(ImmutableData, self).__init__()<EOL>self._json_data = json_dict(json_data)<EOL>

Init a new ImmutableData object from a dictionary or JSON string.

        Args:
            json_data(dict, basestring): Input JSON string or dictionary.

        Raises:
            TypeError: If the input object is not a dictionary or string.


return ImmutableData(self._json_data.get('<STR_LIT:data>'))<EOL>


def versions_from_parentdir(parentdir_prefix, root, verbose):

rootdirs = []<EOL>for i in range(<NUM_LIT:3>):<EOL><INDENT>dirname = os.path.basename(root)<EOL>if dirname.startswith(parentdir_prefix):<EOL><INDENT>return {"<STR_LIT:version>": dirname[len(parentdir_prefix):],<EOL>"<STR_LIT>": None,<EOL>"<STR_LIT>": False, "<STR_LIT:error>": None, "<STR_LIT:date>": None}<EOL><DEDENT>else:<EOL><INDENT>rootdirs.append(root)<EOL>root = os.path.dirname(root)  <EOL><DEDENT><DEDENT>if verbose:<EOL><INDENT>print("<STR_LIT>" %<EOL>(str(rootdirs), parentdir_prefix))<EOL><DEDENT>raise NotThisMethod("<STR_LIT>")<EOL>

Try to determine the version from the parent directory name.

    Source tarballs conventionally unpack into a directory that includes both
    the project name and a version string. We will also support searching up
    two directory levels for an appropriately named parent directory


<EOL>keywords = {}<EOL>try:<EOL><INDENT>f = open(versionfile_abs, "<STR_LIT:r>")<EOL>for line in f.readlines():<EOL><INDENT>if line.strip().startswith("<STR_LIT>"):<EOL><INDENT>mo = re.search(r'<STR_LIT>', line)<EOL>if mo:<EOL><INDENT>keywords["<STR_LIT>"] = mo.group(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>if line.strip().startswith("<STR_LIT>"):<EOL><INDENT>mo = re.search(r'<STR_LIT>', line)<EOL>if mo:<EOL><INDENT>keywords["<STR_LIT>"] = mo.group(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>if line.strip().startswith("<STR_LIT>"):<EOL><INDENT>mo = re.search(r'<STR_LIT>', line)<EOL>if mo:<EOL><INDENT>keywords["<STR_LIT:date>"] = mo.group(<NUM_LIT:1>)<EOL><DEDENT><DEDENT><DEDENT>f.close()<EOL><DEDENT>except EnvironmentError:<EOL><INDENT>pass<EOL><DEDENT>return keywords<EOL>

Extract version information from the given file.


if pieces["<STR_LIT>"]:<EOL><INDENT>rendered = pieces["<STR_LIT>"]<EOL>if pieces["<STR_LIT>"]:<EOL><INDENT>rendered += "<STR_LIT>" % pieces["<STR_LIT>"]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>rendered = "<STR_LIT>" % pieces["<STR_LIT>"]<EOL><DEDENT>return rendered<EOL>

TAG[.post.devDISTANCE] -- No -dirty.

    Exceptions:
    1: no tags. 0.post.devDISTANCE


<EOL>git_refnames = "<STR_LIT>"<EOL>git_full = "<STR_LIT>"<EOL>git_date = "<STR_LIT>"<EOL>keywords = {"<STR_LIT>": git_refnames, "<STR_LIT>": git_full, "<STR_LIT:date>": git_date}<EOL>return keywords<EOL>

Get the keywords needed to look up the version information.


if pieces["<STR_LIT>"]:<EOL><INDENT>rendered = pieces["<STR_LIT>"]<EOL>if pieces["<STR_LIT>"]:<EOL><INDENT>rendered += "<STR_LIT>" % (pieces["<STR_LIT>"], pieces["<STR_LIT>"])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>rendered = pieces["<STR_LIT>"]<EOL><DEDENT>if pieces["<STR_LIT>"]:<EOL><INDENT>rendered += "<STR_LIT>"<EOL><DEDENT>return rendered<EOL>

TAG[-DISTANCE-gHEX][-dirty].

    Like 'git describe --tags --dirty --always'.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)


if pieces["<STR_LIT:error>"]:<EOL><INDENT>return {"<STR_LIT:version>": "<STR_LIT>",<EOL>"<STR_LIT>": pieces.get("<STR_LIT>"),<EOL>"<STR_LIT>": None,<EOL>"<STR_LIT:error>": pieces["<STR_LIT:error>"],<EOL>"<STR_LIT:date>": None}<EOL><DEDENT>if not style or style == "<STR_LIT:default>":<EOL><INDENT>style = "<STR_LIT>"  <EOL><DEDENT>if style == "<STR_LIT>":<EOL><INDENT>rendered = render_pep440(pieces)<EOL><DEDENT>elif style == "<STR_LIT>":<EOL><INDENT>rendered = render_pep440_pre(pieces)<EOL><DEDENT>elif style == "<STR_LIT>":<EOL><INDENT>rendered = render_pep440_post(pieces)<EOL><DEDENT>elif style == "<STR_LIT>":<EOL><INDENT>rendered = render_pep440_old(pieces)<EOL><DEDENT>elif style == "<STR_LIT>":<EOL><INDENT>rendered = render_git_describe(pieces)<EOL><DEDENT>elif style == "<STR_LIT>":<EOL><INDENT>rendered = render_git_describe_long(pieces)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % style)<EOL><DEDENT>return {"<STR_LIT:version>": rendered, "<STR_LIT>": pieces["<STR_LIT>"],<EOL>"<STR_LIT>": pieces["<STR_LIT>"], "<STR_LIT:error>": None,<EOL>"<STR_LIT:date>": pieces.get("<STR_LIT:date>")}<EOL>

Render the given version pieces into the requested style.


check_type(licenseId, basestring, may_be_none=False)<EOL>json_data = self._session.get(API_ENDPOINT + '<STR_LIT:/>' + licenseId)<EOL>return self._object_factory(OBJECT_TYPE, json_data)<EOL>

Get the details of a License, by ID.

        Args:
            licenseId(basestring): The ID of the License to be retrieved.

        Returns:
            License: A License object with the details of the requested
            License.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


def refresh(self, client_id, client_secret, refresh_token):

check_type(client_id, basestring, may_be_none=False)<EOL>check_type(client_secret, basestring, may_be_none=False)<EOL>check_type(refresh_token, basestring, may_be_none=False)<EOL>post_data = dict_from_items_with_values(<EOL>grant_type="<STR_LIT>",<EOL>client_id=client_id,<EOL>client_secret=client_secret,<EOL>refresh_token=refresh_token,<EOL>)<EOL>response = requests.post(self._endpoint_url, data=post_data,<EOL>**self._request_kwargs)<EOL>check_response_code(response, EXPECTED_RESPONSE_CODE['<STR_LIT:POST>'])<EOL>json_data = extract_and_parse_json(response)<EOL>return self._object_factory(OBJECT_TYPE, json_data)<EOL>

Return a refreshed Access Token from the provided refresh_token.

        Args:
            client_id(basestring): Provided when you created your integration.
            client_secret(basestring): Provided when you created your
                integration.
            refresh_token(basestring): Provided when you requested the Access
                Token.

        Returns:
            AccessToken: With the access token provided by the Webex Teams
            cloud.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


check_type(personId, basestring, may_be_none=False)<EOL>self._session.delete(API_ENDPOINT + '<STR_LIT:/>' + personId)<EOL>

Remove a person from the system.

        Only an admin can remove a person.

        Args:
            personId(basestring): The ID of the person to be deleted.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


@generator_container<EOL><INDENT>def list(self, email=None, displayName=None, id=None, orgId=None, max=None,<EOL>**request_parameters):<DEDENT>

check_type(id, basestring)<EOL>check_type(email, basestring)<EOL>check_type(displayName, basestring)<EOL>check_type(orgId, basestring)<EOL>check_type(max, int)<EOL>params = dict_from_items_with_values(<EOL>request_parameters,<EOL>id=id,<EOL>email=email,<EOL>displayName=displayName,<EOL>orgId=orgId,<EOL>max=max,<EOL>)<EOL>items = self._session.get_items(API_ENDPOINT, params=params)<EOL>for item in items:<EOL><INDENT>yield self._object_factory(OBJECT_TYPE, item)<EOL><DEDENT>

List people

        This method supports Webex Teams's implementation of RFC5988 Web
        Linking to provide pagination support.  It returns a generator
        container that incrementally yields all people returned by the
        query.  The generator will automatically request additional 'pages' of
        responses from Webex as needed until all responses have been returned.
        The container makes the generator safe for reuse.  A new API call will
        be made, using the same parameters that were specified when the
        generator was created, every time a new iterator is requested from the
        container.

        Args:
            email(basestring): The e-mail address of the person to be found.
            displayName(basestring): The complete or beginning portion of
                the displayName to be searched.
            id(basestring): List people by ID. Accepts up to 85 person IDs
                separated by commas.
            orgId(basestring): The organization ID.
            max(int): Limit the maximum number of items returned from the Webex
                Teams service per request.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the people returned by the Webex Teams query.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


check_type(messageId, basestring, may_be_none=False)<EOL>self._session.delete(API_ENDPOINT + '<STR_LIT:/>' + messageId)<EOL>

Delete a message.

        Args:
            messageId(basestring): The ID of the message to be deleted.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


@generator_container<EOL><INDENT>def list(self, roomId, mentionedPeople=None, before=None,<EOL>beforeMessage=None, max=None, **request_parameters):<DEDENT>

check_type(roomId, basestring, may_be_none=False)<EOL>check_type(mentionedPeople, basestring)<EOL>check_type(before, basestring)<EOL>check_type(beforeMessage, basestring)<EOL>check_type(max, int)<EOL>params = dict_from_items_with_values(<EOL>request_parameters,<EOL>roomId=roomId,<EOL>mentionedPeople=mentionedPeople,<EOL>before=before,<EOL>beforeMessage=beforeMessage,<EOL>max=max,<EOL>)<EOL>items = self._session.get_items(API_ENDPOINT, params=params)<EOL>for item in items:<EOL><INDENT>yield self._object_factory(OBJECT_TYPE, item)<EOL><DEDENT>

Lists messages in a room.

        Each message will include content attachments if present.

        The list API sorts the messages in descending order by creation date.

        This method supports Webex Teams's implementation of RFC5988 Web
        Linking to provide pagination support.  It returns a generator
        container that incrementally yields all messages returned by the
        query.  The generator will automatically request additional 'pages' of
        responses from Webex as needed until all responses have been returned.
        The container makes the generator safe for reuse.  A new API call will
        be made, using the same parameters that were specified when the
        generator was created, every time a new iterator is requested from the
        container.

        Args:
            roomId(basestring): List messages for a room, by ID.
            mentionedPeople(basestring): List messages where the caller is
                mentioned by specifying "me" or the caller `personId`.
            before(basestring): List messages sent before a date and time, in
                ISO8601 format.
            beforeMessage(basestring): List messages sent before a message,
                by ID.
            max(int): Limit the maximum number of items returned from the Webex
                Teams service per request.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the messages returned by the Webex Teams query.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


check_type(webhookId, basestring, may_be_none=False)<EOL>self._session.delete(API_ENDPOINT + '<STR_LIT:/>' + webhookId)<EOL>

Delete a webhook, by ID.

        Args:
            webhookId(basestring): The ID of the webhook to be deleted.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


def create(self, name, targetUrl, resource, event,<EOL>filter=None, secret=None, **request_parameters):

check_type(name, basestring, may_be_none=False)<EOL>check_type(targetUrl, basestring, may_be_none=False)<EOL>check_type(resource, basestring, may_be_none=False)<EOL>check_type(event, basestring, may_be_none=False)<EOL>check_type(filter, basestring)<EOL>check_type(secret, basestring)<EOL>post_data = dict_from_items_with_values(<EOL>request_parameters,<EOL>name=name,<EOL>targetUrl=targetUrl,<EOL>resource=resource,<EOL>event=event,<EOL>filter=filter,<EOL>secret=secret,<EOL>)<EOL>json_data = self._session.post(API_ENDPOINT, json=post_data)<EOL>return self._object_factory(OBJECT_TYPE, json_data)<EOL>

Create a webhook.

        Args:
            name(basestring): A user-friendly name for this webhook.
            targetUrl(basestring): The URL that receives POST requests for
                each event.
            resource(basestring): The resource type for the webhook.
            event(basestring): The event type for the webhook.
            filter(basestring): The filter that defines the webhook scope.
            secret(basestring): The secret used to generate payload signature.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Webhook: A Webhook object with the details of the created webhook.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


@generator_container<EOL><INDENT>def list(self, max=None, **request_parameters):<DEDENT>

check_type(max, int)<EOL>params = dict_from_items_with_values(<EOL>request_parameters,<EOL>max=max,<EOL>)<EOL>items = self._session.get_items(API_ENDPOINT, params=params)<EOL>for item in items:<EOL><INDENT>yield self._object_factory(OBJECT_TYPE, item)<EOL><DEDENT>

List all of the authenticated user's webhooks.

        This method supports Webex Teams's implementation of RFC5988 Web
        Linking to provide pagination support.  It returns a generator
        container that incrementally yields all webhooks returned by the
        query.  The generator will automatically request additional 'pages' of
        responses from Webex as needed until all responses have been returned.
        The container makes the generator safe for reuse.  A new API call will
        be made, using the same parameters that were specified when the
        generator was created, every time a new iterator is requested from the
        container.

        Args:
            max(int): Limit the maximum number of items returned from the Webex
                Teams service per request.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the webhooks returned by the Webex Teams query.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


def update(self, webhookId, name=None, targetUrl=None,<EOL>**request_parameters):

check_type(webhookId, basestring, may_be_none=False)<EOL>check_type(name, basestring)<EOL>check_type(targetUrl, basestring)<EOL>put_data = dict_from_items_with_values(<EOL>request_parameters,<EOL>name=name,<EOL>targetUrl=targetUrl,<EOL>)<EOL>json_data = self._session.put(API_ENDPOINT + '<STR_LIT:/>' + webhookId,<EOL>json=put_data)<EOL>return self._object_factory(OBJECT_TYPE, json_data)<EOL>

Update a webhook, by ID.

        Args:
            webhookId(basestring): The webhook ID.
            name(basestring): A user-friendly name for this webhook.
            targetUrl(basestring): The URL that receives POST requests for
                each event.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Webhook: A Webhook object with the updated Webex Teams webhook
                details.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


check_type(access_token, basestring)<EOL>check_type(base_url, basestring)<EOL>check_type(single_request_timeout, int)<EOL>check_type(wait_on_rate_limit, bool)<EOL>check_type(client_id, basestring, may_be_none=True)<EOL>check_type(client_secret, basestring, may_be_none=True)<EOL>check_type(oauth_code, basestring, may_be_none=True)<EOL>check_type(redirect_uri, basestring, may_be_none=True)<EOL>access_token = access_token or WEBEX_TEAMS_ACCESS_TOKEN<EOL>self.access_tokens = AccessTokensAPI(<EOL>base_url, object_factory,<EOL>single_request_timeout=single_request_timeout,<EOL>)<EOL>oauth_param_list = [client_id, client_secret, oauth_code, redirect_uri]<EOL>if not access_token and all(oauth_param_list):<EOL><INDENT>access_token = self.access_tokens.get(<EOL>client_id=client_id,<EOL>client_secret=client_secret,<EOL>code=oauth_code,<EOL>redirect_uri=redirect_uri<EOL>).access_token<EOL><DEDENT>if not access_token:<EOL><INDENT>raise AccessTokenError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>self._session = RestSession(<EOL>access_token=access_token,<EOL>base_url=base_url,<EOL>single_request_timeout=single_request_timeout,<EOL>wait_on_rate_limit=wait_on_rate_limit<EOL>)<EOL>self.people = PeopleAPI(self._session, object_factory)<EOL>self.rooms = RoomsAPI(self._session, object_factory)<EOL>self.memberships = MembershipsAPI(self._session, object_factory)<EOL>self.messages = MessagesAPI(self._session, object_factory)<EOL>self.teams = TeamsAPI(self._session, object_factory)<EOL>self.team_memberships = TeamMembershipsAPI(<EOL>self._session, object_factory<EOL>)<EOL>self.webhooks = WebhooksAPI(self._session, object_factory)<EOL>self.organizations = OrganizationsAPI(self._session, object_factory)<EOL>self.licenses = LicensesAPI(self._session, object_factory)<EOL>self.roles = RolesAPI(self._session, object_factory)<EOL>self.events = EventsAPI(self._session, object_factory)<EOL>self.guest_issuer = GuestIssuerAPI(self._session, object_factory)<EOL>

Create a new WebexTeamsAPI object.

        An access token must be used when interacting with the Webex Teams API.
        This package supports three methods for you to provide that access
        token:

          1. You may manually specify the access token via the `access_token`
             argument, when creating a new WebexTeamsAPI object.

          2. If an access_token argument is not supplied, the package checks
             for a WEBEX_TEAMS_ACCESS_TOKEN environment variable.

          3. Provide the parameters (client_id, client_secret, oauth_code and
             oauth_redirect_uri) from your oauth flow.

        An AccessTokenError is raised if an access token is not provided
        via one of these two methods.

        Args:
            access_token(basestring): The access token to be used for API
                calls to the Webex Teams service.  Defaults to checking for a
                WEBEX_TEAMS_ACCESS_TOKEN environment variable.
            base_url(basestring): The base URL to be prefixed to the
                individual API endpoint suffixes.
                Defaults to webexteamssdk.DEFAULT_BASE_URL.
            single_request_timeout(int): Timeout (in seconds) for RESTful HTTP
                requests. Defaults to
                webexteamssdk.config.DEFAULT_SINGLE_REQUEST_TIMEOUT.
            wait_on_rate_limit(bool): Enables or disables automatic rate-limit
                handling. Defaults to
                webexteamssdk.config.DEFAULT_WAIT_ON_RATE_LIMIT.
            object_factory(callable): The factory function to use to create
                Python objects from the returned Webex Teams JSON data objects.
            client_id(basestring): The client id of your integration. Provided
                upon creation in the portal.
            client_secret(basestring): The client secret of your integration.
                Provided upon creation in the portal.
            oauth_code(basestring): The oauth authorization code provided by
                the user oauth process.
            oauth_redirect_uri(basestring): The redirect URI used in the user
                OAuth process.

        Returns:
            WebexTeamsAPI: A new WebexTeamsAPI object.

        Raises:
            TypeError: If the parameter types are incorrect.
            AccessTokenError: If an access token is not provided via the
                access_token argument or an environment variable.