HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/lib/python3.9/site-packages/ansible/plugins/lookup/__pycache__/together.cpython-39.pyc
a

�)gs�@sdddlmZmZmZeZdZdZdZddl	Z	ddl
mZddlm
Z
ddlmZGd	d
�d
e
�ZdS)�)�absolute_import�division�print_functionaT
    name: together
    author:  Bradley Young (!UNKNOWN) <[email protected]>
    version_added: '1.3'
    short_description: merges lists into synchronized list
    description:
      - Creates a list with the iterated elements of the supplied lists
      - "To clarify with an example, [ 'a', 'b' ] and [ 1, 2 ] turn into [ ('a',1), ('b', 2) ]"
      - This is basically the same as the 'zip_longest' filter and Python function
      - Any 'unbalanced' elements will be substituted with 'None'
    options:
      _terms:
        description: list of lists to merge
        required: True
z�
- name: item.0 returns from the 'a' list, item.1 returns from the '1' list
  ansible.builtin.debug:
    msg: "{{ item.0 }} and {{ item.1 }}"
  with_together:
    - ['a', 'b', 'c', 'd']
    - [1, 2, 3, 4]
zO
  _list:
    description: synchronized list
    type: list
    elements: list
N)�AnsibleError)�
LookupBase)�listify_lookup_plugin_termsc@s"eZdZdZdd�Zddd�ZdS)�LookupModulez�
    Transpose a list of arrays:
    [1, 2, 3], [4, 5, 6] -> [1, 4], [2, 5], [3, 6]
    Replace any empty spots in 2nd array with None:
    [1, 2], [3] -> [1, 3], [2, None]
    cCs*g}|D]}t||jd�}|�|�q|S)N)Ztemplar)rZ_templar�append)�self�terms�results�xZintermediate�r�C/usr/lib/python3.9/site-packages/ansible/plugins/lookup/together.py�_lookup_variables5s
zLookupModule._lookup_variablesNcsH��|�}|dd�}t|�dkr*td���fdd�tj|ddi�D�S)Nrz8with_together requires at least one element in each listcsg|]}��|��qSr)Z_flatten)�.0r
�r
rr�
<listcomp>D�z$LookupModule.run.<locals>.<listcomp>�	fillvalue)r�lenr�	itertools�zip_longest)r
rZ	variables�kwargsZmy_listrrr�run<s

zLookupModule.run)N)�__name__�
__module__�__qualname__�__doc__rrrrrrr-sr)Z
__future__rrr�typeZ
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURNrZansible.errorsrZansible.plugins.lookuprZansible.utils.listifyrrrrrr�<module>s