instance_bodylist_noname : instance_bodylist_noname COMMA instance_body_noname
353441
def p_instance_bodylist_noname(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
667862
function fixNestedLists (body, indent) {
  var regex = new RegExp('' +
    '(\\S(?: |  )?)' + // Last char of current point, plus one or two spaces
                       // to allow trailing spaces
    '((?:' + indent + ')+)' + // Indentation of sub point
    '(' + POINT_REGEX + '(?:.*)+)$', 'gm'); // Body of subpoint
  return body.replace(regex, '$1\n' + indent + '$2$3');
}
621517
def convert_name(s):
    
    m = re.compile(r"^(.*)\.(.*)\((.*)\)(.*)  ::  (.*)$")
    res = m.search(s)
    if res:
        clname, methodname, all_args, ret, perm = res.groups()
        args = " ".join(map(name_to_androguard, all_args.split(",")))

        clname = name_to_androguard(clname)
        ret = name_to_androguard(ret)

        # perm is actually a comma separated list of permissions
        return "{}-{}-({}){}".format(clname, methodname, args, ret), perm.split(", ")
    else:
        raise ValueError("what?")
268568
function (elbName, cb) {
      query(elbName, function (err, data) {
        if (err) return cb(err);
        var result = [];
        data.Instances.map(function (item) { result.push(item.InstanceId); });
        cb(undefined, result);
      });
    }
102531
private void writeLegacyFormatting(List<Object> list, Object paramExtractor) {
        if (paramExtractor != null) {
            list.add("{\"params\":");
            list.add(paramExtractor);
            list.add(",");
        }
        else {
            list.add("{");
        }

        if (HAS_SCRIPT) {
            /*
             * {
             *   "params": ...,
             *   "lang": "...",
             *   "script": "...",
             *   "upsert": {...}
             * }
             */
            if (HAS_LANG) {
                list.add(SCRIPT_LANG_1X);
            }
            list.add(SCRIPT_1X);
            if (UPSERT) {
                list.add(",\"upsert\":");
            }
        }
        else {
            /*
             * {
             *   "doc_as_upsert": true,
             *   "doc": {...}
             * }
             */
            if (UPSERT) {
                list.add("\"doc_as_upsert\":true,");
            }
            list.add("\"doc\":");
        }
    }
1169499
def _join(self, identifier, instance=None, tags=None):
        
        tag_list = []
        if tags is not None:
            tag_list.extend(tags.items())
        tag_list.extend(self._base_tags)
        return ".".join(identifier) + "," + ",".join(
            "{}={}".format(k, v)
            for k, v in tag_list
        )
1108333
def _child_inst_names(self) -> Set[InstanceName]:
        """"""
        return frozenset([c.iname() for c in self.data_children()])
1345557
def __non_body_parameter_descriptor(self, param):
    
    descriptor = {}

    descriptor['name'] = param.name

    param_type, param_format = self.__field_to_parameter_type_and_format(param)

    # Required
    if param.required:
      descriptor['required'] = True

    # Type
    descriptor['type'] = param_type

    # Format (optional)
    if param_format:
      descriptor['format'] = param_format

    # Default
    default = self.__parameter_default(param)
    if default is not None:
      descriptor['default'] = default

    # Repeated
    if param.repeated:
      descriptor['repeated'] = True

    # Enum
    enum_descriptor = self.__parameter_enum(param)
    if enum_descriptor is not None:
      descriptor['enum'] = enum_descriptor

    return descriptor
1357706
def show_instances(server, cim_class):
    
    if cim_class == 'CIM_RegisteredProfile':
        for inst in server.profiles:
            print(inst.tomof())
        return

    for ns in server.namespaces:
        try:
            insts = server.conn.EnumerateInstances(cim_class, namespace=ns)
            if len(insts):
                print('INSTANCES OF %s ns=%s' % (cim_class, ns))
                for inst in insts:
                    print(inst.tomof())
        except pywbem.Error as er:
            if er.status_code != pywbem.CIM_ERR_INVALID_CLASS:
                print('%s namespace %s Enumerate failed for conn=%s\n'
                      'exception=%s'
                      % (cim_class, ns, server, er))
776939
def not_as_alias_handler(names_list):
    """"""
    list_ = list()
    for alias in names_list:
        list_.append(alias.name)
    return list_
467113
def as_list(self):
        
        self._sanitise()
        l = []
        for name in self.names:
            l.append(getattr(self, name))
        return l
985435
public final void ruleXListLiteral() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:771:2: ( ( ( rule__XListLiteral__Group__0 ) ) )
            // InternalXbase.g:772:2: ( ( rule__XListLiteral__Group__0 ) )
            {
            // InternalXbase.g:772:2: ( ( rule__XListLiteral__Group__0 ) )
            // InternalXbase.g:773:3: ( rule__XListLiteral__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXListLiteralAccess().getGroup()); 
            }
            // InternalXbase.g:774:3: ( rule__XListLiteral__Group__0 )
            // InternalXbase.g:774:4: rule__XListLiteral__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__XListLiteral__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getXListLiteralAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
22238
def p_define_params_paramlist(p):
    
    for i in p[2]:
        if not isinstance(i, ID):
            error(p.lineno(3),
                  '"%s" might not appear in a macro parameter list' % str(i))
            p[0] = None
            return

    names = [x.name for x in p[2]]
    for i in range(len(names)):
        if names[i] in names[i + 1:]:
            error(p.lineno(3),
                  'Duplicated name parameter "%s"' % (names[i]))
            p[0] = None
            return

    p[0] = p[2]
906901
def _list(self, path, dim_key=None, **kwargs):
        """"""
        url_str = self.base_url + path
        if dim_key and dim_key in kwargs:
            dim_str = self.get_dimensions_url_string(kwargs[dim_key])
            kwargs[dim_key] = dim_str

        if kwargs:
            url_str += '?%s' % parse.urlencode(kwargs, True)

        body = self.client.list(
            path=url_str
        )

        return self._parse_body(body)
237849
def __substituteFromClientStatement(self,match,prevResponse,extraSymbol="",sessionID = "general"):
        
        prev = 0
        startPadding = 1+len(extraSymbol)
        finalResponse = ""
        for m in re.finditer(r'%'+extraSymbol+'[0-9]+', prevResponse):
            start = m.start(0)
            end = m.end(0)     
            num = int(prevResponse[start+startPadding:end])
            finalResponse += prevResponse[prev:start]
            try:finalResponse += self._quote(self._substitute(match.group(num)),sessionID)
            except IndexError as e:pass
            prev = end
        namedGroup = match.groupdict()
        if namedGroup:
            prevResponse = finalResponse + prevResponse[prev:]
            finalResponse = ""
            prev = 0
            for m in re.finditer(r'%'+extraSymbol+'([a-zA-Z_][a-zA-Z_0-9]*)([^a-zA-Z_0-9]|$)', prevResponse):
                start = m.start(1)
                end = m.end(1)
                finalResponse += prevResponse[prev:start]
                try:
                    value = namedGroup[prevResponse[start+startPadding:end]]
                    if value:finalResponse += self._quote(self._substitute(value),sessionID)
                except KeyError as e:pass
                prev = end
        return finalResponse + prevResponse[prev:]
1228414
def namelist_handle(tokens):
    """"""
    if len(tokens) == 1:
        return tokens[0]
    elif len(tokens) == 2:
        return tokens[0] + "\n" + tokens[0] + " = " + tokens[1]
    else:
        raise CoconutInternalException("invalid in-line nonlocal / global tokens", tokens)
679488
def p_simple_list(p):
    ''''''
    tok = p.lexer
    heredoc.gatherheredocuments(tok)

    if len(p) == 3 or len(p[1]) > 1:
        parts = p[1]
        if len(p) == 3:
            parts.append(ast.node(kind='operator', op=p[2], pos=p.lexspan(2)))
        p[0] = ast.node(kind='list', parts=parts, pos=_partsspan(parts))
    else:
        assert len(p[1]) == 1
        p[0] = p[1][0]

    if (len(p) == 2 and p.lexer._parserstate & flags.parser.CMDSUBST and
            p.lexer._current_token.nopos() == p.lexer._shell_eof_token):
        # accept the input
        p.accept()