Return a list giving the parameters required by a query.
488937
def analyze(self):
    """"""
    class MockBindings(dict):

      def __contains__(self, key):
        self[key] = None
        return True
    bindings = MockBindings()
    used = {}
    ancestor = self.ancestor
    if isinstance(ancestor, ParameterizedThing):
      ancestor = ancestor.resolve(bindings, used)
    filters = self.filters
    if filters is not None:
      filters = filters.resolve(bindings, used)
    return sorted(used)
975891
def prepare_query_params(**kwargs):
    
    return [
        (sub_key, sub_value)
        for key, value in kwargs.items()
        for sub_key, sub_value in expand(value, key)
        if sub_value is not None
    ]
458191
def get_required_args(fn) -> list:
    
    sig = inspect.signature(fn)
    return [
        name for name, param in sig.parameters.items()
        if param.default == inspect._empty and param.kind not in VAR_ARGS
    ]
1322482
def list_():  # pylint: disable=redefined-builtin
    
    load_dbenv_if_not_loaded(
    )  # Important to load the dbenv in the last moment

    from aiida.orm.querybuilder import QueryBuilder
    from aiida.orm import DataFactory
    MultiplyParameters = DataFactory('phtools.factors')

    qb = QueryBuilder()
    qb.append(MultiplyParameters)
    results = qb.all()

    s = ""
    for result in results:
        obj = result[0]
        s += "{}, pk: {}\n".format(str(obj), obj.pk)
    sys.stdout.write(s)
1110471
def get_query_params
      out = {}
      search_attributes.each do |val|
        out[val.field]=self.send(val.field) unless self.send(val.field).blank?
      end

      out
    end
246918
def request_args(self):
        '''
        
        '''
        kwargs = {}
        kwargs.update(self.request.match_info.items())
        kwargs.update(self.request.query.items())
        return kwargs
896184
def _missing_required_parameters(rqset, **kwargs):
    
    key_set = set(list(iterkeys(kwargs)))
    required_minus_received = rqset - key_set
    if required_minus_received != set():
        return list(required_minus_received)
311151
def get_api_required_params(self):
        
        result = self.required_params
        if type(result) != list:
            raise ValueError(
                '{}.required_params should return list'.format(
                    self.__class__.__name__
                )
            )
        return result
1169698
def getquery(query):
	''
	try:
		conn = connection.cursor()
		conn.execute(query)
		data = conn.fetchall()
		conn.close()
	except: data = list()
	return data
23635
def parameters(self):
        """"""
        parameters = {}
        for name in self.PARAMETERS:
            try:
                parameters[name] = self.get_parameter(name)
            except AttributeError:
                pass
        return parameters
528753
def params(self):
        """"""
        ret = {}
        for rd in self.decorators:
            args = rd.args
            kwargs = rd.kwargs
            if param in rd:
                is_required =  kwargs.get('required', 'default' not in kwargs)
                ret[args[0]] = {'required': is_required, 'other_names': args[1:], 'options': kwargs}

        return ret
8228
def _getParameters(self):
        """"""
        param = self.query._getParameters() 
        index = self._getFilterIndex()
        param.update({
        'filter['+str(index)+'][columnAlias]' : self.__column,
        'filter['+str(index)+'][data][type]' : self.__type,
        'filter['+str(index)+'][data][value]' : self.__value,
        'filter['+str(index)+'][data][comparison]' : self.__comparison})        
        #self.__column.getColumnAlias()
        return param
1222328
def get(self, query, *parameters, **kwargs):
        """"""
        rows = self.query(query, *parameters, **kwargs)
        if not rows:
            return None
        elif len(rows) > 1:
            raise ValueError('Multiple rows returned for get() query')
        else:
            return rows[0]
715058
def sql_to_dict(self, query, param):
        
        cursor = connection.cursor()
        cursor.execute(query, param)
        fieldnames = [name[0] for name in cursor.description]
        result = []
        for row in cursor.fetchall():
            rowset = []
            for field in zip(fieldnames, row):
                rowset.append(field)
            result.append(dict(rowset))
        return result
1127516
def params_to_mongo(query_params):
    
    if not query_params:
        return {}
    for key, value in query_params.items():
        if isinstance(value, list):
            query_params[key] = {'$in': value}
    return query_params
516889
def get_encoded_query_params(self):
        """"""
        get_data = encode_items(self.request.GET.lists())
        return urlencode(get_data)
232263
def get_parameters(self):
        """"""
        parameter_names = self.PARAMETERS.keys()
        # TODO: Unresolved reference for processor
        parameter_values = [getattr(processor, n) for n in parameter_names]
        return dict(zip(parameter_names, parameter_values))