�
!��g�c � �� � d dl mZmZmZ d dlmZmZmZmZm Z m
Z
mZmZ d dlmZ
d dlmZ d dlmZmZmZ d dlmZ d dlmZ dWd �ZdXd
�ZdYd�Zd
� ZdZd�Zd� Zd� Zd� Zd[d�Z d\d�Z!d[d�Z"d� Z#d]d�Z$d� Z%d\d�Z&d� Z'd� Z(d� Z)d � Z*d!� Z+d"� Z,d^d#�Z-d$� Z.d%� Z/d&� Z0d'� Z1d(� Z2d^d)�Z3d^d*�Z4dXd+�Z5d^d,�Z6d-� Z7d^d.�Z8d_d/�Z9d`d0�Z:d1� Z;d2� Z<d3� Z=d^d4�Z>d5� Z?d6� Z@d7� ZAd`d8�ZBd9� ZCd:� ZDd\d;�ZEd<� ZFd=� ZGdad>�ZHefd?�ZId@� ZJdA� ZKd^dB�ZLdC� ZMdD� ZNdbdF�ZOdG� ZP G dH� dI� � ZQeReSeQffdJ�ZTd^dK�ZU edLdMdN�O� � d^dP�� � ZV edQdMdN�O� � dR� � � ZW edSdMdT�O� � dU� � � ZX edSdMdT�O� � dV� � � ZYdS )c� )�Counter�defaultdict�OrderedDict)�chain�combinations�combinations_with_replacement�cycle�islice�permutations�product�groupby)r )�gt)�multiset_partitions_taocp�list_visitor�MultisetPartitionTraverser��as_int)�
deprecatedNc �� � ��� t ��� � � t � � � � � \ ��}��z
dz }t ��� fd�t |� � D � � � � S )a�
Return True if the sequence is the same from left to right as it
is from right to left in the whole sequence (default) or in the
Python slice ``s[i: j]``; else False.
Examples
========
>>> from sympy.utilities.iterables import is_palindromic
>>> is_palindromic([1, 0, 1])
True
>>> is_palindromic('abcbb')
False
>>> is_palindromic('abcbb', 1)
False
Normal Python slicing is performed in place so there is no need to
create a slice of the sequence for testing:
>>> is_palindromic('abcbb', 1, -1)
True
>>> is_palindromic('abcbb', -4, -1)
True
See Also
========
sympy.ntheory.digits.is_palindromic: tests integers
� c 3 �N �K � | ]}��|z ��d z
|z
k V � � dS �� N� )�.0�k�i�j�ss ����i/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/utilities/iterables.py� <genexpr>z!is_palindromic.<locals>.<genexpr>6 s<