""" Utility functions. """

__author__ = 'smartschat'


def clean_via_pos(tokens, pos):
    """ Clean a list of tokens according to their part-of-speech tags.

    In particular, retain only tokens which do not have the part-of-speech tag
    DT (determiner) or POS (possessive 's').

    Args:
        tokens (list(str)): A list of tokens.
        pos (list(str)): A list of corresponding part-of-speech tags.

    Returns:
        list(str): The list of tokens which do not have part-of-speech tag
        DT or POS.
    """
    return [token for token, pos in zip(tokens, pos)
            if pos not in ["DT", "POS"]]

""" Utility functions. """

__author__ = 'smartschat'


def clean_via_pos(tokens, pos):
    """ Clean a list of tokens according to their part-of-speech tags.

    In particular, retain only tokens which do not have the part-of-speech tag
    DT (determiner) or POS (possessive 's').

    Args:
        tokens (list(str)): A list of tokens.
        pos (list(str)): A list of corresponding part-of-speech tags.

    Returns:
        list(str): The list of tokens which do not have part-of-speech tag
        DT or POS.
    """
    return [token for token, pos in zip(tokens, pos)
            if pos not in ["DT", "POS"]]


def get_java_path():
    if "JAVA_HOME" in os.environ:
        return os.path.join(os.environ["JAVA_HOME"], "bin", "java")
    return "java"

Read java path from environment variable if set
Read java path from environment variable if set
  """ Utility functions. """
  
  __author__ = 'smartschat'
  
  
  def clean_via_pos(tokens, pos):
      """ Clean a list of tokens according to their part-of-speech tags.
  
      In particular, retain only tokens which do not have the part-of-speech tag
      DT (determiner) or POS (possessive 's').
  
      Args:
          tokens (list(str)): A list of tokens.
          pos (list(str)): A list of corresponding part-of-speech tags.
  
      Returns:
          list(str): The list of tokens which do not have part-of-speech tag
          DT or POS.
      """
      return [token for token, pos in zip(tokens, pos)
              if pos not in ["DT", "POS"]]
  
+ 
+ def get_java_path():
+     if "JAVA_HOME" in os.environ:
+         return os.path.join(os.environ["JAVA_HOME"], "bin", "java")
+     return "java"
+ 
Read java path from environment variable if set
## Code Before:
""" Utility functions. """

__author__ = 'smartschat'


def clean_via_pos(tokens, pos):
    """ Clean a list of tokens according to their part-of-speech tags.

    In particular, retain only tokens which do not have the part-of-speech tag
    DT (determiner) or POS (possessive 's').

    Args:
        tokens (list(str)): A list of tokens.
        pos (list(str)): A list of corresponding part-of-speech tags.

    Returns:
        list(str): The list of tokens which do not have part-of-speech tag
        DT or POS.
    """
    return [token for token, pos in zip(tokens, pos)
            if pos not in ["DT", "POS"]]

## Instruction:
Read java path from environment variable if set
## Code After:
""" Utility functions. """

__author__ = 'smartschat'


def clean_via_pos(tokens, pos):
    """ Clean a list of tokens according to their part-of-speech tags.

    In particular, retain only tokens which do not have the part-of-speech tag
    DT (determiner) or POS (possessive 's').

    Args:
        tokens (list(str)): A list of tokens.
        pos (list(str)): A list of corresponding part-of-speech tags.

    Returns:
        list(str): The list of tokens which do not have part-of-speech tag
        DT or POS.
    """
    return [token for token, pos in zip(tokens, pos)
            if pos not in ["DT", "POS"]]


def get_java_path():
    if "JAVA_HOME" in os.environ:
        return os.path.join(os.environ["JAVA_HOME"], "bin", "java")
    return "java"
