# Path: src/pycrunchbase/resource/utils.py
# def safe_int(int_like):
#     try:
#         return int(int_like)
#     except TypeError:
#         return None


import six
from .utils import safe_int
from .pageitem import PageItem
from .relationship import Relationship
                "sort_order": "custom"
            },
            "items": [
             {
                "properties": {
                    "path": "organization/example",
                    "name": "Example",
                    "updated_at": 1423666090,
                    "created_at": 1371717055,
                 },
                 "type": "Organization",
                 "uuid": "uuid"
             }
            ]
        }
    """
    def __init__(self, name, data):
        self.name = name
        paging = data.get('paging')
        self.total_items = safe_int(paging.get('total_items')) or 0
        self.first_page_url = paging.get('first_page_url')
        self.sort_order = paging.get('sort_order')

        self.next_page_url = paging.get('next_page_url')
        self.prev_page_url = paging.get('prev_page_url')
        self.items_per_page = safe_int(paging.get('items_per_page'))

        # if these 2 fields are 0, we know that this Page is a result of
        # a call to retrieve a relationship of a Node
        self.current_page = paging.get('current_page') or 0

# Path: src/pycrunchbase/resource/utils.py
# def safe_int(int_like):
#     try:
#         return int(int_like)
#     except TypeError:
#         return None


# Path: src/pycrunchbase/resource/page.py
import six
from .utils import safe_int
from .pageitem import PageItem
from .relationship import Relationship

                "sort_order": "custom"
            },
            "items": [
             {
                "properties": {
                    "path": "organization/example",
                    "name": "Example",
                    "updated_at": 1423666090,
                    "created_at": 1371717055,
                 },
                 "type": "Organization",
                 "uuid": "uuid"
             }
            ]
        }
    """
    def __init__(self, name, data):
        self.name = name
        paging = data.get('paging')
        self.total_items = safe_int(paging.get('total_items')) or 0
        self.first_page_url = paging.get('first_page_url')
        self.sort_order = paging.get('sort_order')

        self.next_page_url = paging.get('next_page_url')
        self.prev_page_url = paging.get('prev_page_url')
        self.items_per_page = safe_int(paging.get('items_per_page'))

        # if these 2 fields are 0, we know that this Page is a result of
        # a call to retrieve a relationship of a Node
        self.current_page = paging.get('current_page') or 0

        self.number_of_pages = safe_int(paging.get('number_of_pages')) or 0