本文整理匯總了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()
示例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
示例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()
示例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()
示例5: keys
# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[Text]:
return self.store.keys()
示例6: keys
# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[str]:
# it’s a structured array
return self.dtype.names
示例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()
示例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()
示例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()
示例10: keys
# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[str]:
return self._attribs.keys()
示例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()
示例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
示例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
示例14: keys
# 需要導入模塊: import typing [as 別名]
# 或者: from typing import KeysView [as 別名]
def keys(self) -> KeysView[KT]:
return cast(KeysView[KT], sorted(super().keys()))