Rewrite all state declarations that look like this::

      state_id_decl:
        state.func

    into::

      state_id_decl:
        state.func: []
504724
def rewrite_single_shorthand_state_decl(data):  # pylint: disable=C0103
    '''
    
    '''
    for sid, states in six.iteritems(data):
        if isinstance(states, six.string_types):
            data[sid] = {states: []}
976780
def declalltypes(self):
        """"""
        for f in self.body:
            if (hasattr(f, '_ctype')
                    and f._ctype._storage == Storages.TYPEDEF):
                yield f
1218218
def _defines(prefix, defs, suffix, env, c=_concat_ixes):
    

    return c(prefix, env.subst_path(processDefines(defs)), suffix, env)
166611
def p_declare_list(p):
    ''''''
    if len(p) == 4:
        p[0] = [ast.Directive(p[1], p[3], lineno=p.lineno(1))]
    else:
        p[0] = p[1] + [ast.Directive(p[3], p[5], lineno=p.lineno(2))]
961055
def c_self_relocs(self):
        """"""
        relocs = []
        if not callable(self.opts.hash_func):
            relocs = [
                reloc_ptr(
                    self.opts.prefix + name, self.opts.reloc_delta,
                    'char *'
                )
                for name, dummy_args in self.funcs
            ]
        if self.name != 'kernel32':
            relocs = [
                reloc_ptr(
                    self.opts.prefix + self.name,
                    self.opts.reloc_delta, 'char *'
                )
            ] + relocs
        return relocs
255221
def p_decl(self, p):
        ''
        decllist = []
        for rname, rlength in p[2]:
            decllist.extend(self.create_decl(p[1], rname, length=rlength,
                                             lineno=p.lineno(2)))
        p[0] = Decl(tuple(decllist), lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
772682
def remove_declaration(self, decl):
        

        del self.declarations[self.declarations.index(decl)]
        decl.cache.reset()
456351
def write_def_decl(self, node, identifiers):
        """"""
        funcname = node.funcname
        namedecls = node.get_argument_expressions()
        nameargs = node.get_argument_expressions(as_call=True)

        if not self.in_def and (
                                len(self.identifiers.locally_assigned) > 0 or
                                len(self.identifiers.argument_declared) > 0):
            nameargs.insert(0, 'context._locals(__M_locals)')
        else:
            nameargs.insert(0, 'context')
        self.printer.writeline("def %s(%s):" % (funcname, ",".join(namedecls)))
        self.printer.writeline(
                    "return render_%s(%s)" % (funcname, ",".join(nameargs)))
        self.printer.writeline(None)
1167462
private void decomposeExpressions() {
    for (FunctionState functionState : fns.values()) {
      if (functionState.canInline()) {
        for (Reference ref : functionState.getReferences()) {
          if (ref.requiresDecomposition) {
            injector.maybePrepareCall(ref);
          }
        }
      }
    }
  }
1225741
def all_state_variables_written(self):
        '''
            
        '''
        all_state_variables_written = [f.all_state_variables_written() for f in self.functions + self.modifiers]
        all_state_variables_written = [item for sublist in all_state_variables_written for item in sublist]
        return list(set(all_state_variables_written))
968548
def rename_next_state_fluent(name: str) -> str:
    '''
    '''
    i = name.index('/')
    functor = name[:i-1]
    arity = name[i+1:]
    return "{}/{}".format(functor, arity)
1181471
def declarations(cls, extra_defs=None):
        
        warnings.warn(
            "Factory.declarations is deprecated; use Factory._meta.pre_declarations instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        decls = cls._meta.pre_declarations.as_dict()
        decls.update(extra_defs or {})
        return decls
1164258
def _clean_multiple_def(self, ready):
        
        result = []
        for entry in ready:
            if isinstance(entry, list):
                #This variable declaration has a default value specified, which is in the
                #second slot of the list.
                default = self._collapse_default(entry[1])
                #For hard-coded array defaults, add the parenthesis back in.
                if default[0] == "/":
                    default = "({})".format(default)
                namedim = entry[0]
            else:
                default = None
                namedim = entry

            if isinstance(namedim, str):
                name = namedim.strip().strip(",")
                dimension = None
                D = 0
            else:
                #Namedim is a tuple of (name, dimension)
                name = namedim[0].strip()
                D = count_dimensions(namedim[1])
                dimension = self._collapse_default(namedim[1])

            result.append((name, dimension, default, D))
        return result
301831
def p_variable_declaration_list(self, p):
        
        if len(p) == 2:
            p[0] = [p[1]]
        else:
            p[1].append(p[3])
            p[0] = p[1]
1362553
def make_map(declarations):
    """"""
    mapper = routes.Mapper()
    for route, methods in ROUTE_LIST:
        allowed_methods = []
        for method, func in methods.items():
            mapper.connect(route, action=func,
                           conditions=dict(method=[method]))
            allowed_methods.append(method)
        allowed_methods = ', '.join(allowed_methods)
        mapper.connect(route, action=handle_not_allowed,
                       _methods=allowed_methods)
    return mapper
610298
function assignDeclarationToGlobal(state, nodes, declaration) {
    var filenameNoExt = getFilenameNoExt(state.file.opts.filename);
    var expr = getGlobalExpression(state, filenameNoExt, declaration.id.name);
    assignToGlobal(expr, nodes, declaration.id);
  }
1351350
def Write(self, *state_args, **state_dict):
        """"""
        if len(state_dict) + len(state_args) < 1:
            raise Exception("Please include at-least 1 state variable, got {0} and {1}".format(state_args, state_dict))

        if len(state_dict) > 1:
            raise Exception("Please include at-most 1 keyword argument expression, got {0}".format(state_dict))

        if len(state_dict) > 0:
            state_key = next(iter(state_dict.keys()))
            write_expr = state_dict[state_key]

            state_args += (state_key,)

            expr = self >> write_expr

        else:
            expr = self



        def g(x, state):
            update = { key: x for key in state_args }
            state = utils.merge(state, update)

            #side effect for convenience
            _StateContextManager.REFS.update(state)

            return x, state


        return expr.__then__(g)