You can add custom MIME types, or override system defaults with the following:
tee custom-mime.xml << "EOF" > /dev/null
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/x-python">
<generic-icon name="text-html"/>
</mime-type>
</mime-info>
EOF
sudo xdg-mime install --mode system custom-mime.xml
The MIME packages are stored here:
/usr/share/mime/packages
~/.local/share/mime/packages
Unpackaged icons should be stored to:
/usr/local/share/icons
~/.local/share/icons