# Path: urbanaccess/utils.py
# def log(message, level=None, name=None, filename=None):
#     """
#     Write a message to the log file and/or print to the console.
# 
#     Parameters
#     ----------
#     message : string
#         the content of the message to log
#     level : int, optional
#         one of the logger.level constants
#     name : string, optional
#         name of the logger
#     filename : string, optional
#         name of the log file
# 
#     Returns
#     -------
#     None
#     """
# 
#     if level is None:
#         level = lg.INFO
#     if name is None:
#         name = config.settings.log_name
#     if filename is None:
#         filename = config.settings.log_filename
# 
#     if config.settings.log_file:
#         # get the current logger or create a new one then log message at
#         # requested level
#         logger = _get_logger(level=level, name=name, filename=filename)
#         if level == lg.DEBUG:
#             logger.debug(message)
#         elif level == lg.INFO:
#             logger.info(message)
#         elif level == lg.WARNING:
#             logger.warning(message)
#         elif level == lg.ERROR:
#             logger.error(message)
# 
#     # if logging to console is turned on, convert message to ascii and print
#     #  to the console only
#     if config.settings.log_console:
#         # capture current stdout, then switch it to the console, print the
#         # message, then switch back to what had been the stdout
#         # this prevents logging to notebook - instead, it goes to console
#         standard_out = sys.stdout
#         sys.stdout = sys.__stdout__
# 
#         # convert message to ascii for proper console display in windows
#         # terminals
#         message = unicodedata.normalize('NFKD', str(message)).encode(
#             'ascii', errors='replace').decode()
#         print(message)
#         sys.stdout = standard_out
#     # otherwise print out standard statement
#     else:
#         print(message)


import time
import pandana
from osmnet.load import network_from_bbox
from pandana import Network
from urbanaccess.utils import log
from __future__ import division



# set the number of Pandana Networks in memory to arbitrary 40 for
# removing low connectivity nodes
# Note: reserve_num_graphs was removed in Pandana beginning in v0.4 but is
# required for prior versions
if pandana.__version__[:3] in ['0.1', '0.2', '0.3']:
    pandana.network.reserve_num_graphs(40)


def ua_network_from_bbox(lat_min=None, lng_min=None, lat_max=None,
                         lng_max=None, bbox=None, network_type='walk',
                         timeout=180, memory=None,

# Path: urbanaccess/utils.py
# def log(message, level=None, name=None, filename=None):
#     """
#     Write a message to the log file and/or print to the console.
# 
#     Parameters
#     ----------
#     message : string
#         the content of the message to log
#     level : int, optional
#         one of the logger.level constants
#     name : string, optional
#         name of the logger
#     filename : string, optional
#         name of the log file
# 
#     Returns
#     -------
#     None
#     """
# 
#     if level is None:
#         level = lg.INFO
#     if name is None:
#         name = config.settings.log_name
#     if filename is None:
#         filename = config.settings.log_filename
# 
#     if config.settings.log_file:
#         # get the current logger or create a new one then log message at
#         # requested level
#         logger = _get_logger(level=level, name=name, filename=filename)
#         if level == lg.DEBUG:
#             logger.debug(message)
#         elif level == lg.INFO:
#             logger.info(message)
#         elif level == lg.WARNING:
#             logger.warning(message)
#         elif level == lg.ERROR:
#             logger.error(message)
# 
#     # if logging to console is turned on, convert message to ascii and print
#     #  to the console only
#     if config.settings.log_console:
#         # capture current stdout, then switch it to the console, print the
#         # message, then switch back to what had been the stdout
#         # this prevents logging to notebook - instead, it goes to console
#         standard_out = sys.stdout
#         sys.stdout = sys.__stdout__
# 
#         # convert message to ascii for proper console display in windows
#         # terminals
#         message = unicodedata.normalize('NFKD', str(message)).encode(
#             'ascii', errors='replace').decode()
#         print(message)
#         sys.stdout = standard_out
#     # otherwise print out standard statement
#     else:
#         print(message)


# Path: urbanaccess/osm/load.py
import time
import pandana
from osmnet.load import network_from_bbox
from pandana import Network
from urbanaccess.utils import log

from __future__ import division



# set the number of Pandana Networks in memory to arbitrary 40 for
# removing low connectivity nodes
# Note: reserve_num_graphs was removed in Pandana beginning in v0.4 but is
# required for prior versions
if pandana.__version__[:3] in ['0.1', '0.2', '0.3']:
    pandana.network.reserve_num_graphs(40)


def ua_network_from_bbox(lat_min=None, lng_min=None, lat_max=None,
                         lng_max=None, bbox=None, network_type='walk',
                         timeout=180, memory=None,

                         max_query_area_size=50 * 1000 * 50 * 1000,