def object_name(name, parent):
 if ((not isinstance(name, basestring)) or (not isinstance(parent, basestring))):
  raise CX('Invalid input, name and parent must be strings')
 else:
  name = name.strip()
  parent = parent.strip()
 if ((name != '') and (parent != '') and (name == parent)):
  raise CX('Self parentage is not allowed')
 if (not RE_OBJECT_NAME.match(name)):
  raise CX(("Invalid characters in name: '%s'" % name))
 return name

def object_name ( name , parent ) : if ( ( not isinstance ( name , basestring ) ) or ( not isinstance ( parent , basestring ) ) ) : raise CX ( 'Invalid input, name and parent must be strings' ) else : name = name . strip ( ) parent = parent . strip ( ) if ( ( name != '' ) and ( parent != '' ) and ( name == parent ) ) : raise CX ( 'Self parentage is not allowed' ) if ( not RE_OBJECT_NAME . match ( name ) ) : raise CX ( ( "Invalid characters in name: '%s'" % name ) ) return name
validate the object name .