


'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase__    					=      logging.get_logger(__name__)




class 			lowerCamelCase_   (	__a      ):
      lowerCAmelCase__		     =     'timm_backbone'






      def __init__(					self				:    Tuple						,						_A				:    List[str]=None						,						_A				:    Optional[Any]=3						,						_A				:    Dict=True						,						_A				:    Optional[Any]=True						,						_A				:    Tuple=None						,						**_A				:    Optional[int]						,						):


          '''simple docstring'''


          super().__init__(**_A )
          UpperCAmelCase__			:		List[str]													=				backbone
          UpperCAmelCase__			:		Optional[int]													=				num_channels
          UpperCAmelCase__			:		Optional[Any]													=				features_only
          UpperCAmelCase__			:		Dict													=				use_pretrained_backbone
          UpperCAmelCase__			:		Optional[Any]													=				True
          UpperCAmelCase__			:		List[str]													=				out_indices if out_indices is not None else (-1,)




'''simple docstring'''
import re

from filelock import FileLock


try:
  import nltk

  UpperCamelCase__    					=      True
except (ImportError, ModuleNotFoundError):
  UpperCamelCase__    					=      False

if NLTK_AVAILABLE:
  with FileLock('''.lock''') as lock:
    nltk.download('''punkt''', quiet=True)





def 					a__       (					lowerCAmelCase__						)    ->	str:
    re.sub('''<n>'''  ,					''''''  ,					lowerCAmelCase__						)  # remove pegasus newline char
    assert NLTK_AVAILABLE, "nltk must be installed to separate newlines between sentences. (pip install nltk)"
    return "\n".join(nltk.sent_tokenize(lowerCAmelCase__						)						)
