@memoized
def cyclic_pattern_offset(value):
 pattern = cyclic_pattern()
 if (to_int(value) is None):
  search = value.encode('utf-8')
 else:
  search = hex2str(to_int(value))
 pos = pattern.find(search)
 return (pos if (pos != (-1)) else None)

@ memoized def cyclic_pattern_offset ( value ) : pattern = cyclic_pattern ( ) if ( to_int ( value ) is None ) : search = value . encode ( 'utf-8' ) else : search = hex2str ( to_int ( value ) ) pos = pattern . find ( search ) return ( pos if ( pos != ( - 1 ) ) else None )
search a value if it is a part of cyclic pattern args: - value: value to search for returns: - offset in pattern if found .