original_docstring: 
              Creates and returns predicate based on passed string, predicate
              type and predicate value type. String has format: @param = value /
              @param = [value] / @param is value / @param between v1 and v2.
  
              Also performs encoding of the text values and necessary conversion.
  
              Args:
                  ptype (_PREDICATE_TYPES): type of the predicate
                  vtype (_PREDICATE_VTYPES): value type of the predicate
                  predicate (str): predicate string with specific format
  
              Returns:
                  QueryPredicate: query predicate with all the information
          
docstring: Creates and returns predicate based on passed string, predicate
  type and predicate value type. String has format: @param = value
  @param = [value] / @param is value / @param between v1 and v2.
  
  Also performs encoding of the text values and necessary conversion.
docstring_tokens: Creates and returns predicate based on passed string predicate type and predicate value type . String has format : @param = value @param = [ value ] / @param is value / @param between v1 and v2 . Also performs encoding of the text values and necessary conversion .
code: def createFromTypeAndPredicate(cls, ptype, vtype, predicate):
          """
              Creates and returns predicate based on passed string, predicate
              type and predicate value type. String has format: @param = value /
              @param = [value] / @param is value / @param between v1 and v2.
  
              Also performs encoding of the text values and necessary conversion.
  
              Args:
                  ptype (_PREDICATE_TYPES): type of the predicate
                  vtype (_PREDICATE_VTYPES): value type of the predicate
                  predicate (str): predicate string with specific format
  
              Returns:
                  QueryPredicate: query predicate with all the information
          """
          misc.checkTypeAgainst(type(predicate), StringType, __file__)
          # prepare predicate
          predicate = predicate \
                  .replace(_PREDICATE_KW_IS.lower(),_PREDICATE_KW_IS) \
                  .replace(_PREDICATE_KW_BETWEEN.lower(),_PREDICATE_KW_BETWEEN) \
                  .replace(_PREDICATE_KW_AND.lower(),_PREDICATE_KW_AND)
          key = None; values = None; pair = None
          # split based on type
          if ptype == _PREDICATE_TYPES.EQUAL:
              pair = predicate.split(_PREDICATE_KW_EQUAL)
          elif ptype == _PREDICATE_TYPES.ASSIGN:
              pair = predicate.split(_PREDICATE_KW_IS)
          elif ptype == _PREDICATE_TYPES.RANGE:
              pair = predicate.split(_PREDICATE_KW_BETWEEN)
  
          # parse key and raw value
          if pair is not None and len(pair) == 2:
              key = pair[0].strip()[1:]; raw = pair[1].strip()
              # parse raw value based on type and value type
              if ptype == _PREDICATE_TYPES.EQUAL:
                  if vtype == _PREDICATE_VTYPES.NUMBER:
                      raw = float(raw) if '.' in raw else int(raw)
                      values = tuple([raw])
                  else:
                      values = tuple([cls._stringToValue(raw)])
              elif ptype == _PREDICATE_TYPES.ASSIGN:
                  values = tuple([raw])
              elif ptype == _PREDICATE_TYPES.RANGE:
                  rawTuple = raw.split(_PREDICATE_KW_AND)
                  if vtype == _PREDICATE_VTYPES.NUMBER:
                      rawTuple = [x.strip() for x in rawTuple]
                      for i in range(len(rawTuple)):
                          if '.' in rawTuple[i]:
                              rawTuple[i] = float(rawTuple[i])
                          else:
                              rawTuple[i] = int(rawTuple[i])
                      values = tuple(rawTuple)
                  else:
                      values = tuple([cls._stringToValue(x) for x in rawTuple])
          # return predicate instance
          return cls(ptype, vtype, key, values)
code_tokens: def createFromTypeAndPredicate ( cls , ptype , vtype , predicate ) : misc . checkTypeAgainst ( type ( predicate ) , StringType , __file__ ) predicate = predicate . replace ( _PREDICATE_KW_IS . lower ( ) , _PREDICATE_KW_IS ) . replace ( _PREDICATE_KW_BETWEEN . lower ( ) , _PREDICATE_KW_BETWEEN ) . replace ( _PREDICATE_KW_AND . lower ( ) , _PREDICATE_KW_AND ) key = None ; values = None ; pair = None if ptype == _PREDICATE_TYPES . EQUAL : pair = predicate . split ( _PREDICATE_KW_EQUAL ) elif ptype == _PREDICATE_TYPES . ASSIGN : pair = predicate . split ( _PREDICATE_KW_IS ) elif ptype == _PREDICATE_TYPES . RANGE : pair = predicate . split ( _PREDICATE_KW_BETWEEN ) if pair is not None and len ( pair ) == 2 : key = pair [ 0 ] . strip ( ) [ 1 : ] ; raw = pair [ 1 ] . strip ( ) if ptype == _PREDICATE_TYPES . EQUAL : if vtype == _PREDICATE_VTYPES . NUMBER : raw = float ( raw ) if '.' in raw else int ( raw ) values = tuple ( [ raw ] ) else : values = tuple ( [ cls . _stringToValue ( raw ) ] ) elif ptype == _PREDICATE_TYPES . ASSIGN : values = tuple ( [ raw ] ) elif ptype == _PREDICATE_TYPES . RANGE : rawTuple = raw . split ( _PREDICATE_KW_AND ) if vtype == _PREDICATE_VTYPES . NUMBER : rawTuple = [ x . strip ( ) for x in rawTuple ] for i in range ( len ( rawTuple ) ) : if '.' in rawTuple [ i ] : rawTuple [ i ] = float ( rawTuple [ i ] ) else : rawTuple [ i ] = int ( rawTuple [ i ] ) values = tuple ( rawTuple ) else : values = tuple ( [ cls . _stringToValue ( x ) for x in rawTuple ] ) return cls ( ptype , vtype , key , values )
short_docstring: Creates and returns predicate based on passed string, predicate
  type and predicate value type.
short_docstring_tokens: Creates and returns predicate based on passed string predicate type and predicate value type .
comment: """
              Creates and returns predicate based on passed string, predicate
              type and predicate value type. String has format: @param = value /
              @param = [value] / @param is value / @param between v1 and v2.
  
              Also performs encoding of the text values and necessary conversion.
  
              Args:
                  ptype (_PREDICATE_TYPES): type of the predicate
                  vtype (_PREDICATE_VTYPES): value type of the predicate
                  predicate (str): predicate string with specific format
  
              Returns:
                  QueryPredicate: query predicate with all the information
          """$SEP$# prepare predicate$SEP$# split based on type$SEP$# parse key and raw value$SEP$# parse raw value based on type and value type$SEP$# return predicate instance