title: Cyclic Imports to fix R0401 from pylint
body: <p>Pylint complains about cyclic import with R0401 error code for a specific file of the NLTK package, e.g. </p>
  
  <pre><code>nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk -&gt; nltk.internals)
  nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk.corpus -&gt; nltk.tokenize -&gt; nltk.tokenize.punkt -&gt; nltk.probability)
  nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk.corpus -&gt; nltk.tokenize -&gt; nltk.tokenize.texttiling)
  nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk.draw.tree -&gt; nltk.tree)
  nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk.tree -&gt; nltk.treeprettyprinter)
  nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk.grammar -&gt; nltk.parse.pchart)
  nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk.stem -&gt; nltk.stem.porter)
  nltk/nltk/ccg/lexicon.py:1: [R0401(cyclic-import), ] Cyclic import (nltk.classify.maxent -&gt; nltk.classify.tadm)
  </code></pre>
  
  <p>The full list is on <a href="https://github.com/nltk/nltk/issues/2113" rel="noreferrer">https://github.com/nltk/nltk/issues/2113</a></p>
  
  <p>But looking at the imports:</p>
  
  <pre><code>from __future__ import unicode_literals from 
  
  import re
  from collections import defaultdict
  
  from nltk.ccg.api import PrimitiveCategory, Direction, CCGVar, FunctionalCategory
  from nltk.compat import python_2_unicode_compatible
  from nltk.internals import deprecated
  
  from nltk.sem.logic import *
  </code></pre>
  
  <p>But look at the <code>nltk.internals</code> <a href="https://github.com/nltk/nltk/blob/develop/nltk/internals.py" rel="noreferrer">https://github.com/nltk/nltk/blob/develop/nltk/internals.py</a> , there isn't any cyclic imports that points to <code>nltk.ccg.lexicon</code>:</p>
  
  <pre><code>from __future__ import print_function
  
  import subprocess
  import os
  import fnmatch
  import re
  import warnings
  import textwrap
  import types
  import sys
  import stat
  import locale
  
  # Use the c version of ElementTree, which is faster, if possible:
  try:
      from xml.etree import cElementTree as ElementTree
  except ImportError:
      from xml.etree import ElementTree
  
  from six import string_types
  
  from nltk import __file__
  from nltk import compat
  </code></pre>
  
  <p><strong>What does the <code>R0401(cyclic-import)</code> message mean?</strong></p>
  
  <p>Looking at the <code>nltk.ccg.lexicon.py</code> and <code>nltk.internals.py</code> There isn't any imports that's cyclic, so how could the problem be resolved.</p>