MIT only needs attribution for redistributing "all copies or substantial portions of the Software".
Juat reading the code shouldn't be illegal, and producing a short snippet based on the code but not identical shouldn't count as a "substantial portion", but IANAL...