Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pynetbox/core/__pycache__/response.cpython-39.pyc
Ðазад
a n�h�F � @ s� d Z ddlZddlmZ ddlZddlmZ ddlm Z m Z ddlmZ dZ ddd �Zd d� ZG dd � d e�ZG dd� de�ZG dd� de�ZdS )a" (c) 2017 DigitalOcean Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. � N)�OrderedDict)�urlsplit)�Request�RequestError)�Hashabledict)�tagsZtagged_vlansc C s� |p g d�D ]b}t | t�r0| �|�r0| | S t| |�rtt| ��tg d��kr`t| d� S t| |� S qt | t�r�t| �S | S dS )a Returns simple representations for items passed to lookup. Used to return a "simple" representation of objects and collections sent to it via lookup. Otherwise, we look to see if lookup is a "choices" field (dict with only 'id' and 'value') or a nested_return. Finally, we check if it's a Record, if so simply return a string. Order is important due to nested_return being self-referential. :arg list,optional return_fields: A list of fields to reference when calling values on lookup. )�id�valueZ nested_return)r r �labelr N)� isinstance�dict�get�hasattr�sorted�getattr�Record�str)�lookupZ return_fields�i� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pynetbox/core/response.py� get_return s r c C s dd� | � � D �S )Nc S s( i | ] \}}|t |t�s|n|d �qS )r )r r ��.0�k�vr r r � <dictcomp>= s z"flatten_custom.<locals>.<dictcomp>)�items)Zcustom_dictr r r �flatten_custom<