def _args_to_val(func, args):
 from .google_imports import gql
 vals = []
 for arg in args:
  if isinstance(arg, (int, long, basestring)):
   val = Parameter(arg)
  elif isinstance(arg, gql.Literal):
   val = arg.Get()
  else:
   raise TypeError(('Unexpected arg (%r)' % arg))
  vals.append(val)
 if (func == 'nop'):
  if (len(vals) != 1):
   raise TypeError('"nop" requires exactly one value')
  return vals[0]
 pfunc = ParameterizedFunction(func, vals)
 if pfunc.is_parameterized():
  return pfunc
 else:
  return pfunc.resolve({}, {})

def _args_to_val ( func , args ) : from . google_imports import gql vals = [ ] for arg in args : if isinstance ( arg , ( int , long , basestring ) ) : val = Parameter ( arg ) elif isinstance ( arg , gql . Literal ) : val = arg . Get ( ) else : raise TypeError ( ( 'Unexpected arg (%r)' % arg ) ) vals . append ( val ) if ( func == 'nop' ) : if ( len ( vals ) != 1 ) : raise TypeError ( '"nop" requires exactly one value' ) return vals [ 0 ] pfunc = ParameterizedFunction ( func , vals ) if pfunc . is_parameterized ( ) : return pfunc else : return pfunc . resolve ( { } , { } )
helper for gql parsing to extract values from gql expressions .