當前位置: 首頁>>代碼示例>>Python>>正文


Python typing.KeysView方法代碼示例

本文整理匯總了Python中typing.KeysView方法的典型用法代碼示例。如果您正苦於以下問題:Python typing.KeysView方法的具體用法?Python typing.KeysView怎麽用?Python typing.KeysView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在typing的用法示例。


在下文中一共展示了typing.KeysView方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[Any]:
        return self._containers.keys() 
開發者ID:eth-brownie,項目名稱:brownie,代碼行數:4,代碼來源:main.py

示例2: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView:
        """ReturnValue.keys() -> a set-like object providing a view on ReturnValue's keys"""
        return self._dict.keys()  # type: ignore 
開發者ID:eth-brownie,項目名稱:brownie,代碼行數:5,代碼來源:datatypes.py

示例3: dag_ids

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def dag_ids(self) -> KeysView[str]:
        """
        :return: IDs of all the DAGs in this
        :rtype: list[unicode]
        """
        return self.dag_id_to_simple_dag.keys() 
開發者ID:apache,項目名稱:airflow,代碼行數:8,代碼來源:dag_processing.py

示例4: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[str]:
        if self._trace_store_calls:
            print(f'{self._class_name}.keys()')
        return self._vfs.keys() 
開發者ID:dcs4cop,項目名稱:xcube,代碼行數:6,代碼來源:chunkstore.py

示例5: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[Text]:
        return self.store.keys() 
開發者ID:RasaHQ,項目名稱:rasa_core,代碼行數:4,代碼來源:tracker_store.py

示例6: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[str]:
        # it’s a structured array
        return self.dtype.names 
開發者ID:theislab,項目名稱:anndata,代碼行數:5,代碼來源:views.py

示例7: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView:
        """
        Returns the step names.

        :return: list of step names
        """
        return self.steps.keys() 
開發者ID:Neuraxio,項目名稱:Neuraxle,代碼行數:9,代碼來源:base.py

示例8: varnames

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def varnames(self) -> KeysView:
        """ Returns an iterable of all header variable names. """
        return self.hdrvars.keys() 
開發者ID:mozman,項目名稱:ezdxf,代碼行數:5,代碼來源:header.py

示例9: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView:
        """ Returns :class:`KeysView` of all dictionary keys. """
        return self._data.keys() 
開發者ID:mozman,項目名稱:ezdxf,代碼行數:5,代碼來源:dictionary.py

示例10: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[str]:
        return self._attribs.keys() 
開發者ID:mozman,項目名稱:ezdxf,代碼行數:4,代碼來源:attributes.py

示例11: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView:
        """
        Return internal dictionary keys
        :return: Keys
        """
        return self.get_all().keys() 
開發者ID:mtgjson,項目名稱:mtgjson,代碼行數:8,代碼來源:mtgjson_card.py

示例12: get_counts

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def get_counts(self, docs: List[str], doc_ids: List[Any]) \
            -> Generator[Tuple[KeysView, ValuesView, List[int]], Any, None]:
        """Get term counts for a list of documents.

        Args:
            docs: a list of input documents
            doc_ids: a list of document ids corresponding to input documents

        Yields:
            a tuple of term hashes, count values and column ids

        Returns:
            None

        """
        logger.info("Tokenizing batch...")
        batch_ngrams = list(self.tokenizer(docs))
        logger.info("Counting hash...")
        doc_id = iter(doc_ids)
        for ngrams in batch_ngrams:
            counts = Counter([hash_(gram, self.hash_size) for gram in ngrams])
            hashes = counts.keys()
            values = counts.values()
            _id = self.doc_index[next(doc_id)]
            if values:
                col_id = [_id] * len(values)
            else:
                col_id = []
            yield hashes, values, col_id 
開發者ID:deepmipt,項目名稱:DeepPavlov,代碼行數:31,代碼來源:hashing_tfidf_vectorizer.py

示例13: foo_KeysView_to_Sequence

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def foo_KeysView_to_Sequence(v: tg.KeysView[Tc]) -> tg.Sequence[Tc]:
    result = [item for item in v]
    result.sort()
    assert len([item for item in v]) == len(result)  # iterable not exhausted
    return result 
開發者ID:prechelt,項目名稱:typecheck-decorator,代碼行數:7,代碼來源:test_typing_annotations.py

示例14: keys

# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[KT]:
        return cast(KeysView[KT], sorted(super().keys())) 
開發者ID:m13253,項目名稱:VxWireguard-Generator,代碼行數:4,代碼來源:common.py


注:本文中的typing.KeysView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。