# Path: smart/lib/utils.py
# class MethodDispatcher(object):
# class URLFetchException(Exception):
# class DjangoVersionDependentExecutor(object):
#   def __init__(self, method_map):
#   def resolve(self, request):
#   def __call__(self, request, *args, **kwargs):
# def is_valid_email(email):
# def random_string(length, choices=[string.letters]):
# def send_mail(subject, body, sender, recipient):
# def render_template_raw(template_name, vars, type='xml'):
# def render_template(template_name, vars, type='xml'):
# def get_element_value(dom, el):
# def url_interpolate(url_template, vars):
# def is_browser(request):
# def get_content_type(request):
# def get_capabilities ():
# def django_json(func):
#   def func_with_json_conversion(*args, **kwargs):
# def smart_path(path):
# def smart_parent(path):
# def x_domain(r):
# def trim(p, n):
#     def __init__(self, status, body=""):
# def url_request(url,  method, headers, data=None):
# def url_request_build(url,  method, headers, data=None):
# def url_request_execute(req):
# def rdf_response(s):
# def rdf_get(record_connector, query):
# def rdf_delete(record_connector, query, save=True): 
# def rdf_post(record_connector, g):
# def string_to_alphanumeric(s):
#     def __init__(self, version_map, default_return_val=None):
#     def __call__(self, *args, **kwargs):


from base import *
from django.utils import simplejson
from smart.lib import utils
from smart.common.rdf_tools import util
from smart.common.rdf_tools.util import Literal, URIRef
        from smart.common.rdf_tools.util import sp, foaf, rdf

    # email the owner of the record with the secret
    def send_secret(self):
        # mail template
        subject = utils.render_template_raw(
            'email/secret/subject', {'account': self}, type='txt').strip()
        body = utils.render_template_raw(
            'email/secret/body',
            {
                'account': self,
                'url_prefix': settings.SMART_UI_SERVER_LOCATION,
                'from_name': settings.EMAIL_SUPPORT_NAME,
                'from_email': settings.EMAIL_SUPPORT_ADDRESS,
                'full_name': self.full_name or self.contact_email
            },
            type='txt'
        )

        utils.send_mail(
            subject,
            body,
            "\"%s\" <%s>" % (
                settings.EMAIL_SUPPORT_NAME,
                settings.EMAIL_SUPPORT_ADDRESS
            ),
            ["\"%s\" <%s>" % (
                self.full_name or self.contact_email, self.contact_email)]
        )

    def send_welcome_email(self):

# Path: smart/lib/utils.py
# class MethodDispatcher(object):
# class URLFetchException(Exception):
# class DjangoVersionDependentExecutor(object):
#   def __init__(self, method_map):
#   def resolve(self, request):
#   def __call__(self, request, *args, **kwargs):
# def is_valid_email(email):
# def random_string(length, choices=[string.letters]):
# def send_mail(subject, body, sender, recipient):
# def render_template_raw(template_name, vars, type='xml'):
# def render_template(template_name, vars, type='xml'):
# def get_element_value(dom, el):
# def url_interpolate(url_template, vars):
# def is_browser(request):
# def get_content_type(request):
# def get_capabilities ():
# def django_json(func):
#   def func_with_json_conversion(*args, **kwargs):
# def smart_path(path):
# def smart_parent(path):
# def x_domain(r):
# def trim(p, n):
#     def __init__(self, status, body=""):
# def url_request(url,  method, headers, data=None):
# def url_request_build(url,  method, headers, data=None):
# def url_request_execute(req):
# def rdf_response(s):
# def rdf_get(record_connector, query):
# def rdf_delete(record_connector, query, save=True): 
# def rdf_post(record_connector, g):
# def string_to_alphanumeric(s):
#     def __init__(self, version_map, default_return_val=None):
#     def __call__(self, *args, **kwargs):


# Path: smart/models/accounts.py
from base import *
from django.utils import simplejson
from smart.lib import utils
from smart.common.rdf_tools import util
from smart.common.rdf_tools.util import Literal, URIRef
        from smart.common.rdf_tools.util import sp, foaf, rdf


    # email the owner of the record with the secret
    def send_secret(self):
        # mail template
        subject = utils.render_template_raw(
            'email/secret/subject', {'account': self}, type='txt').strip()
        body = utils.render_template_raw(
            'email/secret/body',
            {
                'account': self,
                'url_prefix': settings.SMART_UI_SERVER_LOCATION,
                'from_name': settings.EMAIL_SUPPORT_NAME,
                'from_email': settings.EMAIL_SUPPORT_ADDRESS,
                'full_name': self.full_name or self.contact_email
            },
            type='txt'
        )

        utils.send_mail(
            subject,
            body,
            "\"%s\" <%s>" % (
                settings.EMAIL_SUPPORT_NAME,
                settings.EMAIL_SUPPORT_ADDRESS
            ),
            ["\"%s\" <%s>" % (
                self.full_name or self.contact_email, self.contact_email)]
        )

    def send_welcome_email(self):

        subject = utils.render_template_raw(