Parses raw Sass variable definitions
into the thematic mapping of vars names to values.
507838
function(varsData) {
    if (isJSON(varsData)) {
      // JSON variables
      varsData = JSON.parse(varsData);

      for (var key in varsData) {
        if (varsData.hasOwnProperty(key)) {
          this.vars[normalizeVarName(key)] = varsData[key];
        }
      }
    }
    else {
      // Sass variables
      var pattern = /\$([^\s:]+)\s*:\s*([^!;]+)/g;
      var match = pattern.exec(varsData);

      while (match) {
        this.vars[ match[1] ] = match[2].trim();
        match = pattern.exec(varsData);
      }
    }
  }
47771
function parseProperties(source, baseDirectory) {
  // Get the raw SCSS concrete syntax tree.
  const rawTree = parseCSS(source);
  removeWhitespace(rawTree);

  // Convert the concrete syntax tree into a more convenient AST.
  let schema
  const rootRules = []
  for (const rule of rawTree.value) {
    if (rule.type === 'atrule') {
      removeWhitespace(rule);
      const [keyword, argument] = rule.value;
      if (keyword.value === 'schema') {
        schema = visitSchema(argument, baseDirectory)
      } else if (keyword.value === 'import') {
        rootRules.push(...visitImport(argument, baseDirectory))
      }
    } else {
      rootRules.push(visitRule(rule, false))
    }
  }

  // Flatten out any nested selectors.
  const rules = []
  for (const rootRule of rootRules) {
    flattenRule(rootRule, rules, [[]]);
  }

  const validator = new Validator();

  for (const rule of rules) {
    // Validate each rule's properties against the schema.
    for (const property in rule.properties) {
      if (schema) {
        const propertySchema = schema[property]
        const value = rule.properties[property]
        if (!propertySchema) {
          throw new Error(`Property '${property}' is not present in the schema`);
        }
        const {errors} = validator.validate(value, propertySchema);
        if (errors.length > 0) {
          throw new Error(`Invalid value '${value}' for property '${property}'`)
        }
      }
    }

    rule.selectors = rule.selectors.map(applyPseudoClasses)
  }

  return rules;
}
640990
def parse_variable_definition(lexer: Lexer) -> VariableDefinitionNode:
    """"""
    start = lexer.token
    return VariableDefinitionNode(
        variable=parse_variable(lexer),
        type=expect_token(lexer, TokenKind.COLON) and parse_type_reference(lexer),
        default_value=parse_value_literal(lexer, True)
        if expect_optional_token(lexer, TokenKind.EQUALS)
        else None,
        directives=parse_directives(lexer, True),
        loc=loc(lexer, start),
    )
342977
def parse_values_from_lines(self,lines,iskeyword=False):
        

        if iskeyword:
            extra = {}
            for line in lines:
                raw = line.strip().split()
                if len(raw) == 0 or raw[0] == "#":
                    continue
                name = raw[0].strip().lower()

                value = raw[1].strip()
                v,t,f = self._parse_value(value)
                if name not in self._df.index:
                    extra[name] = v
                else:
                    # if the parsed values type isn't right
                    if t != self._df.loc[name, "type"]:

                        # if a float was expected and int return, not a problem
                        if t == np.int32 and self._df.loc[name, "type"] == np.float64:
                            self._df.loc[name, "value"] = np.float64(v)


                        # if this is a required input, throw
                        elif self._df.loc[name, "required"]:
                            raise Exception("wrong type found for variable " + name + ":" + str(t))
                        else:

                            # else, since this problem is usually a string, check for acceptable values
                            found = False
                            for nname, avalues in self.accept_values.items():
                                if v in avalues:
                                    if t == self._df.loc[nname, "type"]:
                                        self._df.loc[nname, "value"] = v
                                        found = True
                                        break
                            if not found:
                                warnings.warn("non-conforming value found for " + \
                                              name + ":" + str(v) + "...ignoring", PyemuWarning)


                    else:
                        self._df.loc[name, "value"] = v
            return extra




        assert len(lines) == len(CONTROL_VARIABLE_LINES),\
        "ControlData error: len of lines not equal to " +\
        str(len(CONTROL_VARIABLE_LINES))

        for iline,line in enumerate(lines):
            vals = line.strip().split()
            names = CONTROL_VARIABLE_LINES[iline].strip().split()
            for name,val in zip(names,vals):
                v,t,f = self._parse_value(val)
                name = name.replace('[','').replace(']','')
                
                #if the parsed values type isn't right
                if t != self._df.loc[name,"type"]:

                    # if a float was expected and int return, not a problem
                    if t == np.int32 and self._df.loc[name,"type"] == np.float64:
                        self._df.loc[name,"value"] = np.float64(v)


                    # if this is a required input, throw
                    elif self._df.loc[name,"required"]:
                        raise Exception("wrong type found for variable " + name + ":" + str(t))
                    else:
                        
                        #else, since this problem is usually a string, check for acceptable values
                        found = False
                        for nname,avalues in self.accept_values.items():
                            if v in avalues:
                                if t == self._df.loc[nname,"type"]:
                                    self._df.loc[nname,"value"] = v
                                    found = True
                                    break
                        if not found:
                            warnings.warn("non-conforming value found for " +\
                                  name + ":" + str(v) + "...ignoring",PyemuWarning)


                else:
                    self._df.loc[name,"value"] = v
108913
private void parseSentence() {
        if (sentence == null) {
            return;
        }
        definition = sentence;
        values = new ArrayList<DSLVariableValue>();
        sentence = null;

        int variableStart = definition.indexOf("{");
        while (variableStart >= 0) {
            int variableEnd = getIndexForEndOfVariable(definition,
                                                       variableStart);
            String variable = definition.substring(variableStart + 1,
                                                   variableEnd);
            values.add(parseValue(variable));
            variableStart = definition.indexOf("{",
                                               variableEnd);
        }
    }
311689
def compile(
            self, scss_string=None, scss_file=None, source_files=None,
            super_selector=None, filename=None, is_sass=None,
            line_numbers=True, import_static_css=False):
        
        # Derive our root namespace
        self.scss_vars = _default_scss_vars.copy()
        if self._scss_vars is not None:
            self.scss_vars.update(self._scss_vars)

        root_namespace = Namespace(
            variables=self.scss_vars,
            functions=self._library,
        )

        # Figure out search paths.  Fall back from provided explicitly to
        # defined globally to just searching the current directory
        search_paths = ['.']
        if self._search_paths is not None:
            assert not isinstance(self._search_paths, six.string_types), \
                "`search_paths` should be an iterable, not a string"
            search_paths.extend(self._search_paths)
        else:
            if config.LOAD_PATHS:
                if isinstance(config.LOAD_PATHS, six.string_types):
                    # Back-compat: allow comma-delimited
                    search_paths.extend(config.LOAD_PATHS.split(','))
                else:
                    search_paths.extend(config.LOAD_PATHS)

            search_paths.extend(self._scss_opts.get('load_paths', []))

        # Normalize a few old styles of options
        output_style = self._scss_opts.get('style', config.STYLE)
        if output_style is True:
            output_style = 'compressed'
        elif output_style is False:
            output_style = 'legacy'

        fixed_search_path = []
        for path in search_paths:
            if isinstance(path, six.string_types):
                fixed_search_path.append(Path(path))
            else:
                fixed_search_path.append(path)

        # Build the compiler
        compiler = Compiler(
            namespace=root_namespace,
            extensions=[
                CoreExtension,
                ExtraExtension,
                FontsExtension,
                CompassExtension,
                BootstrapExtension,
            ],
            search_path=fixed_search_path,
            import_static_css=import_static_css,
            live_errors=self.live_errors,
            generate_source_map=self._scss_opts.get('debug_info', False),
            output_style=output_style,
            warn_unused_imports=self._scss_opts.get('warn_unused', False),
            ignore_parse_errors=config.DEBUG,
            loops_have_own_scopes=config.CONTROL_SCOPING,
            undefined_variables_fatal=config.FATAL_UNDEFINED,
            super_selector=super_selector or self.super_selector,
        )
        # Gonna add the source files manually
        compilation = compiler.make_compilation()

        # Inject the files we know about
        # TODO how does this work with the expectation of absoluteness
        if source_files is not None:
            for source in source_files:
                compilation.add_source(source)
        elif scss_string is not None:
            source = SourceFile.from_string(
                scss_string,
                relpath=filename,
                is_sass=is_sass,
            )
            compilation.add_source(source)
        elif scss_file is not None:
            # This is now the only way to allow forcibly overriding the
            # filename a source "thinks" it is
            with open(scss_file, 'rb') as f:
                source = SourceFile.from_file(
                    f,
                    relpath=filename or scss_file,
                    is_sass=is_sass,
                )
            compilation.add_source(source)

        # Plus the ones from the constructor
        if self._scss_files:
            for name, contents in list(self._scss_files.items()):
                source = SourceFile.from_string(contents, relpath=name)
                compilation.add_source(source)

        compiled = compiler.call_and_catch_errors(compilation.run)
        self.source_files = list(SourceFileTuple(*os.path.split(s.path)) for s in compilation.source_index.values())
        return compiled
932650
function getSassReference(rawData) {
    // group sassdoc items (variables, mixins, functions, etc.) by @group
    var content = _.groupBy(rawData, (item) => item.group[0]);

    Object.keys(content).forEach((group) => {
        content[group] = content[group].map((item) => {
            // boolean flag for deprecated
            item.deprecated = typeof item.deprecated !== 'undefined'
            return item;
        });

        // group every sassdoc item by type
        content[group] = _.groupBy(content[group], (item) => item.context.type + 's');
    });

    return content;
}
409464
function processVars (markdownContent, config) {
  if (config.variables && Array.isArray(config.variables)) {
    config.variables.forEach((v) => {
      markdownContent = markdownContent.replace(new RegExp('%' + v.name + '%', 'g'), v.content);
    });
  }
  if (config.base_url) {
    markdownContent = markdownContent.replace(/%base_url%/g, config.base_url);
  }
  if (config.image_url) {
    markdownContent = markdownContent.replace(/%image_url%/g, config.image_url);
  }
  return markdownContent;
}
338565
def _parse_env_var_file(data):
    

    output = {}
    for line in data.splitlines():
        line = line.strip()
        if not line or '=' not in line:
            continue
        parts = line.split('=')
        if len(parts) != 2:
            continue
        name = parts[0]
        value = parts[1]
        if len(value) > 1:
            if value[0] == '"' and value[-1] == '"':
                value = value[1:-1]
        output[name] = value
    return output
1371091
def _parse_resource_declarations(cls, declarations, resource_map):
        """"""

        resources = {}

        for decl in declarations:
            name = decl.pop('name')
            typename = decl.pop('type')
            desc = decl.pop('description', None)
            autocreate = decl.pop('autocreate', False)

            args = decl

            res_type = resource_map.get(typename)
            if res_type is None:
                raise UnknownRecipeResourceType("Could not find shared resource type", type=typename, name=name)

            # If the resource defines an argument schema, make sure we enforce it.
            if hasattr(res_type, "ARG_SCHEMA"):
                try:
                    args = res_type.ARG_SCHEMA.verify(args)
                except ValidationError as exc:
                    raise RecipeFileInvalid("Recipe file resource declarttion has invalid parameters", resource=name, error_message=exc.msg, **exc.params)

            if name in resources:
                raise RecipeFileInvalid("Attempted to add two shared resources with the same name", name=name)

            res = ResourceDeclaration(name, resource_map.get(typename), args, autocreate, desc, typename)
            resources[name] = res

        return resources
861638
function(value){
		value = Function.from(value)();
		value = (typeof value == 'string') ? value.split(' ') : Array.from(value);
		return value.map(function(val){
			val = String(val);
			var found = false;
			Object.each(Fx.CSS.Parsers, function(parser, key){
				if (found) return;
				var parsed = parser.parse(val);
				if (parsed || parsed === 0) found = {value: parsed, parser: parser};
			});
			found = found || {value: val, parser: Fx.CSS.Parsers.String};
			return found;
		});
	}
1300840
def _parse_meta(self, meta):
        
        for hostname, hostvars in meta.get('hostvars', {}).items():
            for var_key, var_val in hostvars.items():
                self._get_host(hostname)['hostvars'][var_key] = var_val
1006730
def parse_config_h(fp, vars=None):
    
    if vars is None:
        vars = {}
    define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
    undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")

    while True:
        line = fp.readline()
        if not line:
            break
        m = define_rx.match(line)
        if m:
            n, v = m.group(1, 2)
            try:
                v = int(v)
            except ValueError:
                pass
            vars[n] = v
        else:
            m = undef_rx.match(line)
            if m:
                vars[m.group(1)] = 0
    return vars
1138656
private String decodeAndUpdateWithVariables(String[] splitList,
      Map<String, Map<String, String>> variables) throws MtasParserException {
    StringBuilder builder = new StringBuilder();
    for (String split : splitList) {
      if (split.contains(":")) {
        String[] subSplit = split.split(":");
        if (subSplit.length == 2) {
          String decodedVariableName = new String(dec.decode(subSplit[0]),
              StandardCharsets.UTF_8);
          String decodedVariableValue = new String(dec.decode(subSplit[1]),
              StandardCharsets.UTF_8);
          if (variables.containsKey(decodedVariableName)) {
            if (variables.get(decodedVariableName)
                .containsKey(decodedVariableValue)) {
              String valueFromVariable = variables.get(decodedVariableName)
                  .get(decodedVariableValue);
              builder.append(valueFromVariable);
            } else {
              throw new MtasParserException("id " + decodedVariableValue
                  + " not found in " + decodedVariableName);
            }
          } else {
            throw new MtasParserException(
                "variable " + decodedVariableName + " unknown");
          }
        }
      } else {
        try {
          builder.append(new String(dec.decode(split), StandardCharsets.UTF_8));
        } catch (IllegalArgumentException e) {
          log.info(e);
        }
      }
    }
    return builder.toString();
  }
597914
def parse_enum_values_definition(lexer: Lexer) -> List[EnumValueDefinitionNode]:
    """"""
    return (
        cast(
            List[EnumValueDefinitionNode],
            many_nodes(
                lexer, TokenKind.BRACE_L, parse_enum_value_definition, TokenKind.BRACE_R
            ),
        )
        if peek(lexer, TokenKind.BRACE_L)
        else []
    )
1087057
def _parse_vars_tbl(self, var_tbl):
        """"""

        # Find the length of each variable to infer T
        T = self._check_forward_mode_input_dict(var_tbl)
        # The shape of X based on T and m
        shape = (T, 1)

        # Initialize X to zeros in the correct shape        
        X = np.zeros(shape)
        X[:,0] = var_tbl[self.var_name]
        return X
365997
function findVariableForAliases(varNames, aliases) {
  for (var j = 0; j < aliases.length; j++) {
    var re = new RegExp("^" + aliases[j] + "$", "i");
    for (var i = 0; i < varNames.length; i++) {
      if (re.test(varNames[i])) {
        return varNames[i];
      }
    }
  }
  return undefined;
}