# Path: robograph/datamodel/base/graph.py
# class Graph:
#     def __init__(self, name, nodes=None):
#     def root_node(self):
#     def nodes(self):
#     def edges(self):
#     def nxgraph(self):
#     def name(self):
#     def add_node(self, node):
#     def add_nodes(self, sequence_of_nodes):
#     def remove_node(self, node):
#     def remove_nodes(self, sequence_of_nodes):
#     def connect(self, node_from, node_to, output_label):
#     def has_isles(self):
#     def execute(self, result_label="result"):
#     def reset(self):
#     def __repr__(self):
#     def __len__(self):
# 
# Path: robograph/datamodel/nodes/lib/value.py
# class Value(node.Node):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/email.py
# class SmtpClient:
# class SmtpEmail(node.Node):
#     def __init__(self, server_hostname, server_port, username, password,
#                  use_tls=True):
#     def send(self, subject, body, recipients_list, sender, mime='html'):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/http.py
# class HttpClient(node.Node):
# class StatusCode(node.Node):
# class StatusCodeOk(node.Node):
# class RawGet(HttpClient):
# class Get(RawGet):
# class RawPost(HttpClient):
# class Post(RawPost):
# class RawPut(HttpClient):
# class Put(RawPut):
# class RawDelete(HttpClient):
# class Delete(RawDelete):
#     DEFAULT_TIMEOUT_SECS = 3
#     def _encode_payload(self, response, mime_type):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):


from robograph.datamodel.base import graph
from robograph.datamodel.nodes.lib import value, email, http
# Given an IP address, geolocate it and send the result over via e-mail



def email_geolocated_ip(recipients_list, smtp_server_params, ip_addr):
    subject = value.Value(value='Test mail')

    smtp_server_params['sender'] = 'test@test.com'
    smtp_server_params['mime_type'] = 'text/html'
    smtp_server_params['recipients_list'] = recipients_list
    sendmail = email.SmtpEmail(**smtp_server_params)

    http_params = dict(url='https://api.ip2country.info/ip?'+ip_addr,
                       mime_type='application/json')

# Path: robograph/datamodel/base/graph.py
# class Graph:
#     def __init__(self, name, nodes=None):
#     def root_node(self):
#     def nodes(self):
#     def edges(self):
#     def nxgraph(self):
#     def name(self):
#     def add_node(self, node):
#     def add_nodes(self, sequence_of_nodes):
#     def remove_node(self, node):
#     def remove_nodes(self, sequence_of_nodes):
#     def connect(self, node_from, node_to, output_label):
#     def has_isles(self):
#     def execute(self, result_label="result"):
#     def reset(self):
#     def __repr__(self):
#     def __len__(self):
# 
# Path: robograph/datamodel/nodes/lib/value.py
# class Value(node.Node):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/email.py
# class SmtpClient:
# class SmtpEmail(node.Node):
#     def __init__(self, server_hostname, server_port, username, password,
#                  use_tls=True):
#     def send(self, subject, body, recipients_list, sender, mime='html'):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/http.py
# class HttpClient(node.Node):
# class StatusCode(node.Node):
# class StatusCodeOk(node.Node):
# class RawGet(HttpClient):
# class Get(RawGet):
# class RawPost(HttpClient):
# class Post(RawPost):
# class RawPut(HttpClient):
# class Put(RawPut):
# class RawDelete(HttpClient):
# class Delete(RawDelete):
#     DEFAULT_TIMEOUT_SECS = 3
#     def _encode_payload(self, response, mime_type):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):
#     def output(self):


# Path: robograph/sample_graphs/email_geolocated_ip.py
from robograph.datamodel.base import graph
from robograph.datamodel.nodes.lib import value, email, http

# Given an IP address, geolocate it and send the result over via e-mail



def email_geolocated_ip(recipients_list, smtp_server_params, ip_addr):
    subject = value.Value(value='Test mail')

    smtp_server_params['sender'] = 'test@test.com'
    smtp_server_params['mime_type'] = 'text/html'
    smtp_server_params['recipients_list'] = recipients_list
    sendmail = email.SmtpEmail(**smtp_server_params)

    http_params = dict(url='https://api.ip2country.info/ip?'+ip_addr,
                       mime_type='application/json')

    geolocate = http.Get(**http_params)