<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def valueToOid(self, value, impliedFlag=False, parentIndices=None):
 """Turn value object into SMI table instance identifier. SNMP SMI table objects are identified by OIDs composed of columnar object ID and instance index. The index part can be composed from the values of one or more tabular objects. This method takes an arbitrary value object and turns it into a sequence of integers representing the tail piece of a tabular object identifier. Parameters value: one of the SNMP data types that can be used in SMI table indices. Allowed types are: :py:class:`Integer`, :py:class:`OctetString`, :py:class:`ObjectIdentifier`, :py:class:`IpAddress` and :py:class:`Bits`. impliedFlag: :py:class:`bool` - if `False`, the length of the serialized value is included as the first integer of the sequence. Otherwise the length is not included (which is frequently the case for the last index in the series or a fixed-length value). Returns ------- :py:class:`tuple` - tuple of integers representing the tail piece of an OBJECT IDENTIFIER (i.e. tabular object instance ID) """

        if hasattr(value, 'cloneAsName'):
            return value.cloneAsName(impliedFlag, parentRow=self, parentIndices=parentIndices)

        baseTag = value.getTagSet().getBaseTag()
        if baseTag == Integer.tagSet.getBaseTag():
            return int(value),

        elif IpAddress.tagSet.isSuperTagSetOf(value.getTagSet()):
            return value.asNumbers()

        elif baseTag == OctetString.tagSet.getBaseTag():
            if impliedFlag or value.isFixedLength():
                initial = ()
            else:
                initial = (len(value),)
            return initial + value.asNumbers()

        elif baseTag == ObjectIdentifier.tagSet.getBaseTag():
            if impliedFlag:
                return tuple(value)
            else:
                return (len(value),) + tuple(value)

        # rfc2578, 7.1
        elif baseTag == Bits.tagSet.getBaseTag():
            return (len(value),) + value.asNumbers()

        else:
            raise error.SmiError('Unknown value type for index %r' % (value,))