code: def get_roles(username, **kwargs):
      '''
      Get roles assigned to a username.
  
      .. code-block: bash
  
          salt '*' nxos.cmd get_roles username=admin
      '''
      user = get_user(username)
      if not user:
          return []
      command = 'show user-account {0}'.format(username)
      info = ''
      info = show(command, **kwargs)
      if isinstance(info, list):
          info = info[0]
      roles = re.search(r'^\s*roles:(.*)$', info, re.MULTILINE)
      if roles:
          roles = roles.group(1).strip().split(' ')
      else:
          roles = []
      return rolef get_roles(username, **kwargs):
      '''
      Get roles assigned to a username.
  
      .. code-block: bash
  
          salt '*' nxos.cmd get_roles username=admin
      '''
      user = get_user(username)
      if not user:
          return []
      command = 'show user-account {0}'.format(username)
      info = ''
      info = show(command, **kwargs)
      if isinstance(info, list):
          info = info[0]
      roles = re.search(r'^\s*roles:(.*)$', info, re.MULTILINE)
      if roles:
          roles = roles.group(1).strip().split(' ')
      else:
          roles = []
      return roles
docs: Get roles assigned to a username.
  
      .. code-block: bash
  
          salt '*' nxos.cmd get_roles username=admin