# Path: importer/importer/utils/parsing.py

# 
# Path: importer/importer/utils/collections.py
# def find_first(needles, haystack):
#     for needle in needles:
#         if needle in haystack:
#             return needle
# 
# Path: importer/importer/utils/strings.py
# def strip_links(text):
#     return link_expression.sub('\\1', text)
# 
# def find_numbers(text):
#     return [
#         int(''.join(filter(str.isdigit, s)))
#         for s in number_expression.findall(text)
#         if s.strip()
#     ]
# 
# def is_from_string(text):
#     return bool(from_expression.match(text))
# 
# def is_up_to_string(text):
#     return bool(up_to_expression.match(text))


from operator import itemgetter
from funcy import flatten, project, first
from datetime import datetime, time, timedelta
from isodate import parse_date
from .utils.parsing import maybe_parse_date, maybe_parse_time
from .utils.collections import find_first
from .utils.strings import (
    strip_links,
    find_numbers,
    is_from_string,
    is_up_to_string,
)
        'location': kudago_event['location']['slug'],
        'place': place['id'] if place else None,
        'parent': parent_id,
        'participants': participants,

        'age_restriction': kudago_event['age_restriction'],
        'price': transform_price(kudago_event['price'], kudago_event['is_free']),

        'dates_count': len(dates),
        'children_count': children_count,
        'favorites_count': kudago_event['favorites_count'],
        'comments_count': kudago_event['comments_count'],

        'start': dates[0]['start'] if dates else None,
        'end': dates[-1]['end'] if dates else None,

        'first_image': first(kudago_event['images']),
        'images': kudago_event['images'],
        'dates': dates,

        'source': {
            'name': 'kudago.com',
            'url': kudago_event['site_url'],
        }
    }


def transform_place(kudago_place, events_count):
    categories = kudago_place['categories']


# Path: importer/importer/utils/parsing.py

# 
# Path: importer/importer/utils/collections.py
# def find_first(needles, haystack):
#     for needle in needles:
#         if needle in haystack:
#             return needle
# 
# Path: importer/importer/utils/strings.py
# def strip_links(text):
#     return link_expression.sub('\\1', text)
# 
# def find_numbers(text):
#     return [
#         int(''.join(filter(str.isdigit, s)))
#         for s in number_expression.findall(text)
#         if s.strip()
#     ]
# 
# def is_from_string(text):
#     return bool(from_expression.match(text))
# 
# def is_up_to_string(text):
#     return bool(up_to_expression.match(text))


# Path: importer/importer/transform.py
from operator import itemgetter
from funcy import flatten, project, first
from datetime import datetime, time, timedelta
from isodate import parse_date
from .utils.parsing import maybe_parse_date, maybe_parse_time
from .utils.collections import find_first
from .utils.strings import (
    strip_links,
    find_numbers,
    is_from_string,
    is_up_to_string,
)

        'location': kudago_event['location']['slug'],
        'place': place['id'] if place else None,
        'parent': parent_id,
        'participants': participants,

        'age_restriction': kudago_event['age_restriction'],
        'price': transform_price(kudago_event['price'], kudago_event['is_free']),

        'dates_count': len(dates),
        'children_count': children_count,
        'favorites_count': kudago_event['favorites_count'],
        'comments_count': kudago_event['comments_count'],

        'start': dates[0]['start'] if dates else None,
        'end': dates[-1]['end'] if dates else None,

        'first_image': first(kudago_event['images']),
        'images': kudago_event['images'],
        'dates': dates,

        'source': {
            'name': 'kudago.com',
            'url': kudago_event['site_url'],
        }
    }


def transform_place(kudago_place, events_count):
    categories = kudago_place['categories']


    kind = find_first(('park', 'cafe', 'museums', 'theatre'), categories)