
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *

a = AtomSpace()
set_type_ctor_atomspace(a)

a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue(1.0)
print('{} == {}: {}'.format(a, b, a == b))
print('{} == {}: {}'.format(a, c, a == c))

featureValue = FloatValue([1.0, 2])
print('new value created: {}'.format(featureValue))

boundingBox = ConceptNode('boundingBox')
featureKey = PredicateNode('features')

boundingBox.set_value(featureKey, featureValue)
print('set value to atom: {}'.format(boundingBox))

print('get value from atom: {}'.format(boundingBox.get_value(featureKey)))


from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *

a = AtomSpace()
set_type_ctor_atomspace(a)

a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue(1.0)
print('{} == {}: {}'.format(a, b, a == b))
print('{} == {}: {}'.format(a, c, a == c))

featureValue = FloatValue([1.0, 2])
print('new value created: {}'.format(featureValue))

boundingBox = ConceptNode('boundingBox')
featureKey = PredicateNode('features')

boundingBox.set_value(featureKey, featureValue)
print('set value to atom: {}'.format(boundingBox))

value = boundingBox.get_value(featureKey)
print('get value from atom: {}'.format(value))

list = value.to_list()
print('get python list from value: {}'.format(list))
Add example of Value to Python list conversion
Add example of Value to Python list conversion

  
  from opencog.atomspace import AtomSpace, TruthValue
  from opencog.type_constructors import *
  
  a = AtomSpace()
  set_type_ctor_atomspace(a)
  
  a = FloatValue([1.0, 2.0, 3.0])
  b = FloatValue([1.0, 2.0, 3.0])
  c = FloatValue(1.0)
  print('{} == {}: {}'.format(a, b, a == b))
  print('{} == {}: {}'.format(a, c, a == c))
  
  featureValue = FloatValue([1.0, 2])
  print('new value created: {}'.format(featureValue))
  
  boundingBox = ConceptNode('boundingBox')
  featureKey = PredicateNode('features')
  
  boundingBox.set_value(featureKey, featureValue)
  print('set value to atom: {}'.format(boundingBox))
  
+ value = boundingBox.get_value(featureKey)
- print('get value from atom: {}'.format(boundingBox.get_value(featureKey)))
+ print('get value from atom: {}'.format(value))
  
+ list = value.to_list()
+ print('get python list from value: {}'.format(list))
Add example of Value to Python list conversion
## Code Before:

from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *

a = AtomSpace()
set_type_ctor_atomspace(a)

a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue(1.0)
print('{} == {}: {}'.format(a, b, a == b))
print('{} == {}: {}'.format(a, c, a == c))

featureValue = FloatValue([1.0, 2])
print('new value created: {}'.format(featureValue))

boundingBox = ConceptNode('boundingBox')
featureKey = PredicateNode('features')

boundingBox.set_value(featureKey, featureValue)
print('set value to atom: {}'.format(boundingBox))

print('get value from atom: {}'.format(boundingBox.get_value(featureKey)))

## Instruction:
Add example of Value to Python list conversion
## Code After:

from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *

a = AtomSpace()
set_type_ctor_atomspace(a)

a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue(1.0)
print('{} == {}: {}'.format(a, b, a == b))
print('{} == {}: {}'.format(a, c, a == c))

featureValue = FloatValue([1.0, 2])
print('new value created: {}'.format(featureValue))

boundingBox = ConceptNode('boundingBox')
featureKey = PredicateNode('features')

boundingBox.set_value(featureKey, featureValue)
print('set value to atom: {}'.format(boundingBox))

value = boundingBox.get_value(featureKey)
print('get value from atom: {}'.format(value))

list = value.to_list()
print('get python list from value: {}'.format(list))