<commit_before># -*- coding: utf-8; -*-

from insales.parsing import parse
from insales.composing import compose
from insales.connection import Connection


class InSalesApi(object):

    arrays = {
        'variants'              : 'variant',
        'variants-attributes'   : 'variant',
        'options'               : 'option',
        'option-names'          : 'option-name',
        'option-values'         : 'option-value',
        'orders'                : 'order',
        'order-lines-attributes': 'order-line-attributes',
        'images'                : 'image',
    }

    @classmethod
    def from_credentials(cls, account, api_key, password, **kwargs):
        return cls(Connection(account, api_key, password, **kwargs))

    def __init__(self, connection):
        self.connection = connection

    #========================================================================
    # Заказы
    #========================================================================
    def get_orders(self, per_page=25, page=1, updated_since=None):
        qargs = {
            'per_page': per_page,<commit_msg>fix: add real array symbols<commit_after># -*- coding: utf-8; -*-

from insales.parsing import parse
from insales.composing import compose
from insales.connection import Connection


class InSalesApi(object):

    arrays = {
        'all-tags': 'all-tag',
        'application-actions': 'application-action',
        'application-charges': 'application-charge',
        'application-widgets': 'application-widget',
        'articles': 'article',
        'blogs': 'blog',
        'bonus-system-transactions': 'bonus-system-transaction',
        'categories': 'category',
        'characteristics': 'characteristic',
        'client-groups': 'client-group',
        'clients': 'client',
        'collection-field-values': 'collection-field-value',
        'collection-fields': 'collection-field',
        'collection-filters': 'collection-filter',
        'collection-ids': 'collection-id',
        'collections': 'collection',
        'collections-ids': 'collections-id',
        'collects': 'collect',
        'custom-statuses': 'custom-status',
        'delivery-locations': 'delivery-location',
        'delivery-locations-attributes': 'delivery-locations-attribute',
        'delivery-zones': 'delivery-zone',
        'delivery-zones-attributes': 'delivery-zones-attribute',
        'description-translations': 'description-translation',
        'discount-codes': 'discount-code',
        'discount-collections': 'discount-collection',
        'discount-order-lines-ids': 'discount-order-lines-id',
        'discount-products-ids': 'discount-products-id',
        'discounts': 'discount',
        'discounts-attributes': 'discounts-attribute',
        'domains': 'domain',
        'errors': 'error',
        'field-options': 'field-option',
        'field-options-attributes': 'field-options-attribute',
        'field-values-attributes': 'field-values-attribute',
        'fields': 'field',
        'fields-values': 'fields-value',
        'fields-values-attributes': 'fields-values-attribute',
        'files': 'file',
        'images': 'image',
        'js-tags': 'js-tag',
        'locations': 'location',
        'locations-attributes': 'locations-attribute',
        'menu-items': 'menu-item',
        'menus': 'menu',
        'nil-classes': 'nil-class',
        'option-names': 'option-name',
        'option-values': 'option-value',
        'options': 'option',
        'options-attributes': 'options-attribute',
        'order-changes': 'order-change',
        'order-lines': 'order-line',
        'order-lines-attributes': 'order-lines-attribute',
        'orders': 'order',
        'outlets': 'outlet',
        'pages': 'page',
        'payment-delivery-variants': 'payment-delivery-variant',
        'payment-delivery-variants-attributes': 'payment-delivery-variants-attribute',
        'pick-up-sources': 'pick-up-source',
        'price-kinds': 'price-kind',
        'prices': 'price',
        'prices-in-site-currency': 'price-in-site-currency',
        'product-bundle-components': 'product-bundle-component',
        'product-bundle-components-attributes': 'product-bundle-components-attribute',
        'product-field-values': 'product-field-value',
        'product-field-values-attributes': 'product-field-values-attribute',
        'products': 'product',
        'properties': 'property',
        'properties-attributes': 'properties-attribute',
        'redirects': 'redirect',
        'related-products': 'related-product',
        'reviews': 'review',
        'rules': 'rule',
        'rules-attributes': 'rules-attribute',
        'similar-ids': 'similar-id',
        'stock-currencies': 'stock-currency',
        'supplementary-ids': 'supplementary-id',
        'tags': 'tag',
        'tariffs': 'tariff',
        'tariffs-attributes': 'tariffs-attribute',
        'title-translations': 'title-translation',
        'variant-field-values': 'variant-field-value',
        'variant-field-values-attributes': 'variant-field-values-attribute',
        'variants': 'variant',
        'variants-attributes': 'variants-attribute',
        'warnings': 'warning',
        'webhooks': 'webhook'
    }

    @classmethod
    def from_credentials(cls, account, api_key, password, **kwargs):
        return cls(Connection(account, api_key, password, **kwargs))

    def __init__(self, connection):
        self.connection = connection

    #========================================================================
    # Заказы
    #========================================================================
    def get_orders(self, per_page=25, page=1, updated_since=None):
        qargs = {
            'per_page': per_page,
{'fraction_non_alphanumeric': 0.20222569987828204, 'fraction_numerical': 0.0013910624239262736, 'mean_word_length': 2.8423513694054776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6561212', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1569, 'n_words': 281}