"""Handle nicovideo.jp user_session."""

import pkg_resources


class LoaderNotFoundError(Exception):
    """Session loader is not found."""


class UserSessionNotFoundError(Exception):
    """Profile exists, but user_session is not found."""


def load(ltype, profile):
    for entry in pkg_resources.iter_entry_points('yanico.sessions', ltype):
        load_func = entry.load()
        return load_func(profile)
    raise LoaderNotFoundError('{} loader is not found.'.format(ltype))

"""Handle nicovideo.jp user_session."""

import pkg_resources


class LoaderNotFoundError(Exception):
    """Session loader is not found."""


class UserSessionNotFoundError(Exception):
    """Profile exists, but user_session is not found."""


def load(ltype, profile):
    """Return nicovideo.jp user session string.

    Args:
        ltype (str): loader type
        profile (str): file path for profile

    Returns:
        str: user session

    Raises:
        LoaderNotFoundError
        Error from loader
    """
    for entry in pkg_resources.iter_entry_points('yanico.sessions', ltype):
        load_func = entry.load()
        return load_func(profile)
    raise LoaderNotFoundError('{} loader is not found.'.format(ltype))

Add docstring into load function
Add docstring into load function

Follow to Google style.

  """Handle nicovideo.jp user_session."""
  
  import pkg_resources
  
  
  class LoaderNotFoundError(Exception):
      """Session loader is not found."""
  
  
  class UserSessionNotFoundError(Exception):
      """Profile exists, but user_session is not found."""
  
  
  def load(ltype, profile):
+     """Return nicovideo.jp user session string.
+ 
+     Args:
+         ltype (str): loader type
+         profile (str): file path for profile
+ 
+     Returns:
+         str: user session
+ 
+     Raises:
+         LoaderNotFoundError
+         Error from loader
+     """
      for entry in pkg_resources.iter_entry_points('yanico.sessions', ltype):
          load_func = entry.load()
          return load_func(profile)
      raise LoaderNotFoundError('{} loader is not found.'.format(ltype))
  
Add docstring into load function
## Code Before:
"""Handle nicovideo.jp user_session."""

import pkg_resources


class LoaderNotFoundError(Exception):
    """Session loader is not found."""


class UserSessionNotFoundError(Exception):
    """Profile exists, but user_session is not found."""


def load(ltype, profile):
    for entry in pkg_resources.iter_entry_points('yanico.sessions', ltype):
        load_func = entry.load()
        return load_func(profile)
    raise LoaderNotFoundError('{} loader is not found.'.format(ltype))

## Instruction:
Add docstring into load function
## Code After:
"""Handle nicovideo.jp user_session."""

import pkg_resources


class LoaderNotFoundError(Exception):
    """Session loader is not found."""


class UserSessionNotFoundError(Exception):
    """Profile exists, but user_session is not found."""


def load(ltype, profile):
    """Return nicovideo.jp user session string.

    Args:
        ltype (str): loader type
        profile (str): file path for profile

    Returns:
        str: user session

    Raises:
        LoaderNotFoundError
        Error from loader
    """
    for entry in pkg_resources.iter_entry_points('yanico.sessions', ltype):
        load_func = entry.load()
        return load_func(profile)
    raise LoaderNotFoundError('{} loader is not found.'.format(ltype))
