# Path: OSMPythonTools/internal/singletonApi.py
# class SingletonApi():
#     __instance = None
#     def __init__(self, *args, **kwargs):
#         from OSMPythonTools.api import Api
#         if not SingletonApi.__instance:
#             SingletonApi.__instance = Api(*args, **kwargs)
#     def __getattr__(self, name):
#         return getattr(self.__instance, name)
# 
# Path: OSMPythonTools/internal/elementShallow.py
# class ElementShallow(Response):
#     def __init__(self, cacheMetadata):
#         super().__init__(cacheMetadata)
#     def type(self):
#         return None
#     def id(self):
#         return None
#     def typeId(self):
#         return self.type() + '/' + str(self.id()) if self.type() != None and self.id() != None else None
#     def typeIdShort(self):
#         return self.type()[0] + str(self.id()) if self.type() != None and self.id() != None else None
#     def areaId(self):
#         return self._areaId(self.type(), self.id())
#     def _areaId(self, type, id):
#         if type == 'way':
#             return id + 2400000000
#         elif type == 'relation':
#             return id + 3600000000
#         else:
#             return None


import copy
import dateutil.parser
import geojson
import re
import OSMPythonTools
from OSMPythonTools.internal.singletonApi import SingletonApi
from OSMPythonTools.internal.elementShallow import ElementShallow
    def version(self):
        return int(self.__getElement('version'))
    def changeset(self):
        return self.__getElement('changeset')
    def timestamp(self):
        return dateutil.parser.isoparse(self.__getElement('timestamp'))
    def user(self):
        return self.__getElement('user')
    def uid(self):
        return self.__getElement('uid')
    def userid(self):
        return self.__getElement('uid')
    def lat(self):
        return float(self.__getElement('lat')) if self.__getElement('lat') else None
    def lon(self):
        return float(self.__getElement('lon')) if self.__getElement('lon') else None
    def geometry(self):
        return self.geometry()
    def centerLat(self):
        return float(self.__getElement('center')['lat']) if self.__getElement('center') else None
    def centerLon(self):
        return float(self.__getElement('center')['lon']) if self.__getElement('center') else None

    ### nodes
    def __nodes(self):
        return self.__getElement('nodes') if self._json is not None else self._soup.find_all('nd')
    def nodes(self, shallow=True):
        nodes = self.__nodes()
        if nodes is None or len(nodes) == 0:
            return []

# Path: OSMPythonTools/internal/singletonApi.py
# class SingletonApi():
#     __instance = None
#     def __init__(self, *args, **kwargs):
#         from OSMPythonTools.api import Api
#         if not SingletonApi.__instance:
#             SingletonApi.__instance = Api(*args, **kwargs)
#     def __getattr__(self, name):
#         return getattr(self.__instance, name)
# 
# Path: OSMPythonTools/internal/elementShallow.py
# class ElementShallow(Response):
#     def __init__(self, cacheMetadata):
#         super().__init__(cacheMetadata)
#     def type(self):
#         return None
#     def id(self):
#         return None
#     def typeId(self):
#         return self.type() + '/' + str(self.id()) if self.type() != None and self.id() != None else None
#     def typeIdShort(self):
#         return self.type()[0] + str(self.id()) if self.type() != None and self.id() != None else None
#     def areaId(self):
#         return self._areaId(self.type(), self.id())
#     def _areaId(self, type, id):
#         if type == 'way':
#             return id + 2400000000
#         elif type == 'relation':
#             return id + 3600000000
#         else:
#             return None


# Path: OSMPythonTools/element.py
import copy
import dateutil.parser
import geojson
import re
import OSMPythonTools
from OSMPythonTools.internal.singletonApi import SingletonApi
from OSMPythonTools.internal.elementShallow import ElementShallow

    def version(self):
        return int(self.__getElement('version'))
    def changeset(self):
        return self.__getElement('changeset')
    def timestamp(self):
        return dateutil.parser.isoparse(self.__getElement('timestamp'))
    def user(self):
        return self.__getElement('user')
    def uid(self):
        return self.__getElement('uid')
    def userid(self):
        return self.__getElement('uid')
    def lat(self):
        return float(self.__getElement('lat')) if self.__getElement('lat') else None
    def lon(self):
        return float(self.__getElement('lon')) if self.__getElement('lon') else None
    def geometry(self):
        return self.geometry()
    def centerLat(self):
        return float(self.__getElement('center')['lat']) if self.__getElement('center') else None
    def centerLon(self):
        return float(self.__getElement('center')['lon']) if self.__getElement('center') else None

    ### nodes
    def __nodes(self):
        return self.__getElement('nodes') if self._json is not None else self._soup.find_all('nd')
    def nodes(self, shallow=True):
        nodes = self.__nodes()
        if nodes is None or len(nodes) == 0:
            return []

        api = SingletonApi()