def find_pylintrc():
 if exists('pylintrc'):
  return abspath('pylintrc')
 if isfile('__init__.py'):
  curdir = abspath(os.getcwd())
  while isfile(join(curdir, '__init__.py')):
   curdir = abspath(join(curdir, '..'))
   if isfile(join(curdir, 'pylintrc')):
    return join(curdir, 'pylintrc')
 if (('PYLINTRC' in os.environ) and exists(os.environ['PYLINTRC'])):
  pylintrc = os.environ['PYLINTRC']
 else:
  user_home = expanduser('~')
  if ((user_home == '~') or (user_home == '/root')):
   pylintrc = '.pylintrc'
  else:
   pylintrc = join(user_home, '.pylintrc')
   if (not isfile(pylintrc)):
    pylintrc = join(user_home, '.config', 'pylintrc')
 if (not isfile(pylintrc)):
  if isfile('/etc/pylintrc'):
   pylintrc = '/etc/pylintrc'
  else:
   pylintrc = None
 return pylintrc

def find_pylintrc ( ) : if exists ( 'pylintrc' ) : return abspath ( 'pylintrc' ) if isfile ( '__init__.py' ) : curdir = abspath ( os . getcwd ( ) ) while isfile ( join ( curdir , '__init__.py' ) ) : curdir = abspath ( join ( curdir , '..' ) ) if isfile ( join ( curdir , 'pylintrc' ) ) : return join ( curdir , 'pylintrc' ) if ( ( 'PYLINTRC' in os . environ ) and exists ( os . environ [ 'PYLINTRC' ] ) ) : pylintrc = os . environ [ 'PYLINTRC' ] else : user_home = expanduser ( '~' ) if ( ( user_home == '~' ) or ( user_home == '/root' ) ) : pylintrc = '.pylintrc' else : pylintrc = join ( user_home , '.pylintrc' ) if ( not isfile ( pylintrc ) ) : pylintrc = join ( user_home , '.config' , 'pylintrc' ) if ( not isfile ( pylintrc ) ) : if isfile ( '/etc/pylintrc' ) : pylintrc = '/etc/pylintrc' else : pylintrc = None return pylintrc
search the pylint rc file and return its path if it find it .