<commit_before>#
# atomic-dbg.py - OpenCog python schema debug wrapper.
#
# This is a wrapper for debugging the OpenCog code that controls the Eva
# blender model. It provides exactly the same GroundedPredicateNode functions
# as the normal API, but, instead of sending messages out on ROS, it simply
# prints to stdout.  Thus, its a stub, and can be used without starting up
# all of ROS and blender.  Handy for behavior debugging, as well as for
# vision-deprived, disembodied chatbot debugging.
#
# Copyright (C) 2015, 2016 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License v3 as
# published by the Free Software Foundation and including the exceptions
# at http://opencog.org/wiki/Licenses
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to:
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


from opencog.atomspace import TruthValue

# Global functions, because that's what PythonEval expects.
# Would be great if PythonEval was fixed to work smarter, not harder.
#
# Must return TruthValue, since EvaluationLinks expect TruthValues.
#
# The print messages are all parentheical, third-person; that's because
# they will typically be going out to some IRC channel, and should resemble
# captioning-for-the-blind, in this situation (or stage directions).
#
def prt_msg(face_id_node):
	face_id = int(face_id_node.name)
	print "Python face id", face_id
	return TruthValue(1, 1)

def do_wake_up():
	# evl.wake_up()
	print "(Eva wakes up)"
	return TruthValue(1, 1)

def do_go_sleep():
	# evl.go_sleep()
	print "(Eva falls asleep)"
	return TruthValue(1, 1)

def glance_at_face(face_id_node):
	face_id = int(float(face_id_node.name))
	print "(Eva glances at face id", face_id, ")"<commit_msg>Add missing import.<commit_after>#
# atomic-dbg.py - OpenCog python schema debug wrapper.
#
# This is a wrapper for debugging the OpenCog code that controls the Eva
# blender model. It provides exactly the same GroundedPredicateNode functions
# as the normal API, but, instead of sending messages out on ROS, it simply
# prints to stdout.  Thus, its a stub, and can be used without starting up
# all of ROS and blender.  Handy for behavior debugging, as well as for
# vision-deprived, disembodied chatbot debugging.
#
# Copyright (C) 2015, 2016 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License v3 as
# published by the Free Software Foundation and including the exceptions
# at http://opencog.org/wiki/Licenses
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to:
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

import time
from opencog.atomspace import TruthValue

# Global functions, because that's what PythonEval expects.
# Would be great if PythonEval was fixed to work smarter, not harder.
#
# Must return TruthValue, since EvaluationLinks expect TruthValues.
#
# The print messages are all parentheical, third-person; that's because
# they will typically be going out to some IRC channel, and should resemble
# captioning-for-the-blind, in this situation (or stage directions).
#
def prt_msg(face_id_node):
	face_id = int(face_id_node.name)
	print "Python face id", face_id
	return TruthValue(1, 1)

def do_wake_up():
	# evl.wake_up()
	print "(Eva wakes up)"
	return TruthValue(1, 1)

def do_go_sleep():
	# evl.go_sleep()
	print "(Eva falls asleep)"
	return TruthValue(1, 1)

def glance_at_face(face_id_node):
	face_id = int(float(face_id_node.name))
	print "(Eva glances at face id", face_id, ")"
{'fraction_non_alphanumeric': 0.07463380609160661, 'fraction_numerical': 0.012090211578702627, 'mean_word_length': 4.608865710560626, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3195493', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1235, 'n_words': 582}