
"""simple docstring"""




import string
from math import logaa




def  _lowerCAmelCase		(		_UpperCamelCase ,				_UpperCamelCase						):






  """simple docstring"""



  _lowercase:			Any       =     document.translate(
      str.maketrans('''''' ,				'''''' ,				string.punctuation						)						).replace('''\n''' ,				''''''						)
  _lowercase:			Dict       =     document_without_punctuation.split(''' '''						)  # word tokenization
  return len([word for word in tokenize_document if word.lower() == term.lower()]						)




def  _lowerCAmelCase		(		_UpperCamelCase ,				_UpperCamelCase						):






  """simple docstring"""



  _lowercase:			Dict       =     corpus.lower().translate(
      str.maketrans('''''' ,				'''''' ,				string.punctuation						)						)  # strip all punctuation and replace it with ''
  _lowercase:			Tuple       =     corpus_without_punctuation.split('''\n'''						)
  _lowercase:			List[Any]       =     term.lower()
  return (len([doc for doc in docs if term in doc]						), len(_UpperCamelCase						))




def  _lowerCAmelCase		(		_UpperCamelCase ,				_UpperCamelCase ,				_UpperCamelCase=False						):






  """simple docstring"""



  if smoothing:
    if n == 0:
      raise ValueError('''log10(0) is undefined.'''						)
    return round(1 + logaa(n / (1 + df)						) ,				3						)

  if df == 0:
    raise ZeroDivisionError('''df must be > 0'''						)
  elif n == 0:
    raise ValueError('''log10(0) is undefined.'''						)
  return round(logaa(n / df						) ,				3						)







def  _lowerCAmelCase		(		_UpperCamelCase ,				_UpperCamelCase						):






  """simple docstring"""



  return round(tf * idf ,				3						)


"""simple docstring"""




def  _lowerCAmelCase		(		_UpperCamelCase						):






  """simple docstring"""



  if not isinstance(_UpperCamelCase ,				_UpperCamelCase						):
    raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''						)
  if len(_UpperCamelCase						) == 0:
    raise ValueError('''Input list must be a non empty list'''						)
  if len(_UpperCamelCase						) == 1:
    return True
  _lowercase:			Any       =     series[1] - series[0]
  for index in range(len(_UpperCamelCase						) - 1						):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True




def  _lowerCAmelCase		(		_UpperCamelCase						):






  """simple docstring"""



  if not isinstance(_UpperCamelCase ,				_UpperCamelCase						):
    raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''						)
  if len(_UpperCamelCase						) == 0:
    raise ValueError('''Input list must be a non empty list'''						)
  _lowercase:			Tuple       =     0
  for val in series:
    answer += val
  return answer / len(_UpperCamelCase						)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
