Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 575272871
  • Loading branch information
isingoo authored and copybara-github committed Oct 20, 2023
1 parent 337c2e7 commit 6181bda
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nisaba/scripts/natural_translit/utils/type_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def value_from_list(some_list, index, exclude=UNSPECIFIED, instead=0):

import logging
import numbers
from typing import Dict, Iterable, List, NamedTuple, Tuple, Union
from typing import Dict, Iterable, List, NamedTuple, Tuple, Union, Callable
import pynini as pyn

# Custom types
Expand Down Expand Up @@ -631,3 +631,11 @@ def in_attribute(
look_for, get_attribute(thing, attr),
keys, enf_list, enf_dict, enf_range, allow_none
)


# TODO: Switch to list_op and remove duplicate when is fixed.
def apply_foreach(
func: Callable[[Valid,], Valid], arg_list: List[Valid]
) -> list[...]:
"""Temporary duplicate of apply_foreach in list_op with Valid type."""
return [func(*args) for args in arg_list]

0 comments on commit 6181bda

Please sign in to comment.