# Path: antioch/util/ason.py
# def loads(j, exchange=None):
#     def to_entity(d):
# def dumps(obj):
#     def from_entity(o):
# 
# Path: antioch/core/parser.py
# URL_REGEXP = r'(?P<scheme>[+a-z0-9]+)\:(\/\/)?'
# URL_RE = re.compile(URL_REGEXP, re.IGNORECASE)
# PREP_SRC = r'(?:\b)(?P<prep>' + prepstring + r')(?:\b)'
# SPEC = r"(?P<spec_str>my|the|a|an|\S+(?:\'s|s\'))"
# PHRASE_SRC = r'(?:' + SPEC + r'\s)?(?P<obj_str>.+)'
# PREP = re.compile(PREP_SRC)
# PHRASE = re.compile(PHRASE_SRC)
# POBJ_TEST = re.compile(PREP_SRC + "\s" + PHRASE_SRC)
# MULTI_WORD = re.compile(r'((\"|\').+?(?!\\).\2)|(\S+)')
# class URL(dict):
# class Lexer(object):
# class TransactionParser(object):
#     def __init__(self, source):
#     def __str__(self):
# def parse(caller, sentence, debug=False):
#     def _profile(name):
# def get_default_parser(v):
#     def __init__(self, command):
#         def nonoverlap(item):
#     def get_details(self):
#     def __init__(self, lexer, caller, exchange):
#     def get_environment(self):
#     def find_object(self, specifier, name, return_list=False):
#     def get_verb(self):
#     def filter_matches(self, possible):
#     def get_pronoun_object(self, pronoun):
#     def get_dobj(self):
#     def get_pobj(self, prep):
#     def get_dobj_str(self):
#     def get_pobj_str(self, prep, return_list=False):
#     def get_pobj_spec_str(self, prep, return_list=False):
#     def has_dobj(self):
#     def has_pobj(self, prep):
#     def has_dobj_str(self):
#     def has_pobj_str(self, prep):
# 
# Path: antioch/core/tasks.py
# def get_exchange(ctx=None):
# def authenticate(username, password, ip_address):
# def deploy(user_id, source):
# def login(user_id, session_id, ip_address):
# def logout(user_id):
# def parse(user_id, sentence):
# def registertask(user_id, delay, origin_id, verb_name, args, kwargs):
# def runtask(user_id, task_id):
# def iteratetasks():


import logging
from celery import shared_task
from antioch.util import ason
from antioch.core import parser, tasks
        from antioch.plugins import editors
        from antioch.plugins import editors
        o = x.get_object(object)
        o.set_name(name, real=True)
        o.set_location(x.get_object(location) if location else None)
        o.set_owner(x.get_object(owner))
        
        old_parents = o.get_parents()
        new_parents = [x.get_object(p) for p in parents]
        
        [o.remove_parent(p) for p in old_parents if p not in new_parents]
        [o.add_parent(p) for p in new_parents if p not in old_parents]
    
    return {'response': True}

@shared_task
def modifyverb(user_id, object_id, verb_id, names, code, ability, method, owner):
    with tasks.get_exchange(user_id) as x:
        names = [n.strip() for n in names.split(',')]
        
        v = x.load('verb', verb_id)
        v.set_names(names)
        v.set_owner(x.get_object(owner))
        v.set_code(code)
        
        v.set_ability(ability)
        v.set_method(method)
    
    return {'response': True}

@shared_task
def removeverb(user_id, object_id, verb_name):

# Path: antioch/util/ason.py
# def loads(j, exchange=None):
#     def to_entity(d):
# def dumps(obj):
#     def from_entity(o):
# 
# Path: antioch/core/parser.py
# URL_REGEXP = r'(?P<scheme>[+a-z0-9]+)\:(\/\/)?'
# URL_RE = re.compile(URL_REGEXP, re.IGNORECASE)
# PREP_SRC = r'(?:\b)(?P<prep>' + prepstring + r')(?:\b)'
# SPEC = r"(?P<spec_str>my|the|a|an|\S+(?:\'s|s\'))"
# PHRASE_SRC = r'(?:' + SPEC + r'\s)?(?P<obj_str>.+)'
# PREP = re.compile(PREP_SRC)
# PHRASE = re.compile(PHRASE_SRC)
# POBJ_TEST = re.compile(PREP_SRC + "\s" + PHRASE_SRC)
# MULTI_WORD = re.compile(r'((\"|\').+?(?!\\).\2)|(\S+)')
# class URL(dict):
# class Lexer(object):
# class TransactionParser(object):
#     def __init__(self, source):
#     def __str__(self):
# def parse(caller, sentence, debug=False):
#     def _profile(name):
# def get_default_parser(v):
#     def __init__(self, command):
#         def nonoverlap(item):
#     def get_details(self):
#     def __init__(self, lexer, caller, exchange):
#     def get_environment(self):
#     def find_object(self, specifier, name, return_list=False):
#     def get_verb(self):
#     def filter_matches(self, possible):
#     def get_pronoun_object(self, pronoun):
#     def get_dobj(self):
#     def get_pobj(self, prep):
#     def get_dobj_str(self):
#     def get_pobj_str(self, prep, return_list=False):
#     def get_pobj_spec_str(self, prep, return_list=False):
#     def has_dobj(self):
#     def has_pobj(self, prep):
#     def has_dobj_str(self):
#     def has_pobj_str(self, prep):
# 
# Path: antioch/core/tasks.py
# def get_exchange(ctx=None):
# def authenticate(username, password, ip_address):
# def deploy(user_id, source):
# def login(user_id, session_id, ip_address):
# def logout(user_id):
# def parse(user_id, sentence):
# def registertask(user_id, delay, origin_id, verb_name, args, kwargs):
# def runtask(user_id, task_id):
# def iteratetasks():


# Path: antioch/plugins/editors/tasks.py
import logging
from celery import shared_task
from antioch.util import ason
from antioch.core import parser, tasks
        from antioch.plugins import editors
        from antioch.plugins import editors

        o = x.get_object(object)
        o.set_name(name, real=True)
        o.set_location(x.get_object(location) if location else None)
        o.set_owner(x.get_object(owner))
        
        old_parents = o.get_parents()
        new_parents = [x.get_object(p) for p in parents]
        
        [o.remove_parent(p) for p in old_parents if p not in new_parents]
        [o.add_parent(p) for p in new_parents if p not in old_parents]
    
    return {'response': True}

@shared_task
def modifyverb(user_id, object_id, verb_id, names, code, ability, method, owner):
    with tasks.get_exchange(user_id) as x:
        names = [n.strip() for n in names.split(',')]
        
        v = x.load('verb', verb_id)
        v.set_names(names)
        v.set_owner(x.get_object(owner))
        v.set_code(code)
        
        v.set_ability(ability)
        v.set_method(method)
    
    return {'response': True}

@shared_task
def removeverb(user_id, object_id, verb_name):

    with tasks.get_exchange(user_id) as x: