To find the package related nodes, I need to find which nodes correspond to incorporating external libraries in the code. I will look at the higher level nodes. Hence, I can see that the 'import_statement' nodes with ids = [3, 16], represent importing packages in the code. Incorporating each of these nodes, I can make a general rule to extract the package(s).

This python script can be executed:

```py
# as every code snippet starts with 'import', we will remove it and get the remaining string.
if 'from' in code_snippet:
    # get the text after the keyword 'from'
    text = code_snippet.split('from', 1)[1].strip()
    # remove quotes and semicolons
    text = text.replace('"', '').replace("'", '').strip(' ;')
    # return the package
    extracted = text
else:
    # get the text after the keyword 'import'
    text = code_snippet.split('import', 1)[1].strip()
    # remove curly braces and semicolons
    text = text.replace('{', '').replace('}', '').strip(' ;')
    # if it is an aliased import, get rid of the alias and keep the original name.
    if (' as ' in text):
        # removing the alias
        text = text.split(' as ')[0].strip()
    # return the package
    extracted = text
```

This script will extract the package names from the given code snippet and AST. It handles both types of imports, with and without the 'from' keyword, and also removes aliases and unnecessary characters.