source ////////////////////////////////////////////////////////
352554
public Object getSource(VariableScope variableScope) {

    if (sourceValueProvider instanceof ConstantValueProvider) {
      String variableName = (String) sourceValueProvider.getValue(variableScope);

      return variableScope.getVariableTyped(variableName);
    }
    else {
      return sourceValueProvider.getValue(variableScope);
    }

  }
785044
function _keySourceHintFrom( method, source, environment ){
		var hints = [];
		if( method ) hints.push( method );
		if( source ) hints.push( source );
		if( environment ) hints.push( "WHEN " + environment );

		return hints.join(' ');
	}
785198
function create(content, url) {
  url = url || '<source>';
  const map = new SourceMapGenerator({ file: url });
  const lines = content.split('\n');

  for (let l = 1, n = lines.length; l <= n; l++) {
    // Skip empty
    if (lines[l - 1]) {
      map.addMapping({
        source: url,
        original: { line: l, column: 0 },
        generated: { line: l, column: 0 }
      });
    }
  }

  map.setSourceContent(url, content);
  return map;
}
1216425
@Override
  public boolean source(FlowProcess<? extends Configuration> flowProcess, SourceCall<Corc, RecordReader> sourceCall)
      throws IOException {
    Corc corc = sourceCall.getContext();
    @SuppressWarnings("unchecked")
    boolean next = sourceCall.getInput().next(NullWritable.get(), corc);
    if (!next) {
      return false;
    }
    TupleEntry tupleEntry = sourceCall.getIncomingEntry();
    for (Comparable<?> fieldName : tupleEntry.getFields()) {
      if (ROW_ID_NAME.equals(fieldName)) {
        tupleEntry.setObject(ROW_ID_NAME, corc.getRecordIdentifier());
      } else {
        tupleEntry.setObject(fieldName, corc.get(fieldName.toString()));
      }
    }
    return true;
  }
1052544
@Override
    protected void initInputSource(WstxInputSource newInput, boolean isExt, String entityId)
        throws XMLStreamException
    {
        if (mFlattenWriter != null) {
            // Anything to flush from previous buffer contents?
            mFlattenWriter.flush(mInputBuffer, mInputPtr);
            mFlattenWriter.disableOutput();
            try {
                /* Then let's let base class do the 'real' input source setup;
                 * this includes skipping of optional XML declaration that we
                 * do NOT want to output
                 */
                super.initInputSource(newInput, isExt, entityId);
            } finally {
                // This will effectively skip declaration
                mFlattenWriter.enableOutput(mInputPtr);
            }
        } else {
            super.initInputSource(newInput, isExt, entityId);
        }
    }
650929
static Source updateSource(SourceName sourceName) {
    try (SecurityCenterClient client = SecurityCenterClient.create()) {
      // Start setting up a request to update a source.
      // SourceName sourceName = SourceName.of(/*organization=*/"123234324",/*source=*/
      // "423432321");
      Source source =
          Source.newBuilder()
              .setDisplayName("Updated Display Name")
              .setName(sourceName.toString())
              .build();
      FieldMask updateMask = FieldMask.newBuilder().addPaths("display_name").build();

      UpdateSourceRequest.Builder request =
          UpdateSourceRequest.newBuilder().setSource(source).setUpdateMask(updateMask);

      // Call the API.
      Source response = client.updateSource(request.build());

      System.out.println("Updated Source: " + response);
      return response;
    } catch (IOException e) {
      throw new RuntimeException("Couldn't create client.", e);
    }
  }
790800
function ( source ) {

		var comment = false;
		var chapters = [];
		var chapter = null;
		var sections = [];
		var section = null;
		var marker = new Showdown.converter ();

		function nextchapter ( title ) {
			if ( chapter ) {
				chapter.sections = sections.map ( function ( section, i ) {
					section.desc = marker.makeHtml ( section.desc );
					return section;
				});
				chapters.push ( chapter );
			}
			chapter = new dox.Chapter ({
				title : title || null
			});
			sections = [];
		}

		function nextsection ( line ) {
			if ( section && section.code ) {
				sections.push ( section );
			}
			section = new dox.Block ({
				line : line || 0,
				tags : [],
				desc : "",
				code : ""
			});
		}

		nextsection ();
		nextchapter ();
		source.split ( "\n" ).forEach ( function ( line, index ) {
			var md, trim = line.trim ();
			if ( comment ) {
				if ( trim.startsWith ( "*/" )) {
					comment = false;
				} else {
					if ( trim === "*" ) {
						section.desc += "\n\n";
					} else {
						md = line.replace ( this._GUTTER, "" );
						switch ( md [ 0 ]) {
							case "@" :
								section.tags.push ( new dox.Tag ({
									text : this._encode ( md )
								}));
								break;
							case "#" :
								//chapter.title = md.replace ( this._HEADER, "" );
								section.desc += "\n" + md + "\n\n";
								break;
							default :
								if ( !md.match ( this._LETTER )) {
									section.desc += "\n";
								}
								section.desc += this._encode ( md );
								break;
						}
					}
				}
			} else {
				if ( line.match ( this._CHAPTER )) {
					var title = this._TITLE.exec ( line );
					nextsection ( index );
					nextchapter ( title ? title [ 0 ] : null );
					section.code += this._HELLO.exec ( line );
				} else {
					if ( trim.startsWith ( "/**" )) {
						comment = true;
						nextsection ( index );
					} else {
						section.code += line + "\n";
					}
				}
			}
		}, this );
		nextsection ();
		nextchapter ();
		return chapters;
	}
902716
@Override
    public List<String> sources() {
        List<String> sources = new ArrayList<>();
        for (int i = 0; i < this._sections.size(); i++) {
            for (int j = 0; j < this._sections.get(i).consumer.sources().size(); j++) {
                sources.add(this._sections.get(i).consumer.sources().get(j));
            }
        }
        return sources;
    }
119364
public function GenerateCustomSources()
    {
        // Variables used by some template files.
        $authors = \Peg\Lib\Settings::GetAuthors();
        $contributors = \Peg\Lib\Settings::GetContributors();
        $extension = \Peg\Lib\Settings::GetExtensionName();
        $version = \Peg\Lib\Settings::GetVersion();

        // Variable to temporarily store a template file content.
        $content = "";

        // Generate custom sources list
        $custom_sources = $this->GetCustomSources();

        if(count($custom_sources) > 0)
        {
            foreach($custom_sources as $custom_source)
            {
                if($custom_source != "." && $custom_source != "..")
                {
                    ob_start();
                        include($this->GetGenericTemplate(
                            $custom_source, "custom_sources"
                        ));
                        $content = ob_get_contents();
                    ob_end_clean();

                    if(
                        (strpos($custom_source, ".c") !== false)
                        ||
                        (strpos($custom_source, ".cpp") !== false)
                    )
                    {
                        $this->AddGenericFile(
                            $custom_source,
                            $content,
                            "src"
                        );
                    }
                    elseif(
                        (strpos($custom_source, ".h") !== false)
                        ||
                        (strpos($custom_source, ".hpp") !== false)
                    )
                    {
                        $this->AddGenericFile(
                            $custom_source,
                            $content,
                            "includes"
                        );
                    }
                }
            }
        }
    }
154994
public void addSource(String source)
    {
        if(this.sources == null)
            this.sources = new ArrayList<String>();
        this.sources.add(source);
    }
869644
@Override
  public void sourceConfInit(FlowProcess<? extends Configuration> flowProcess,
      Tap<Configuration, RecordReader, OutputCollector> tap, Configuration conf) {
    conf.setBoolean("mapred.mapper.new-api", false);
    conf.setClass("mapred.input.format.class", CorcInputFormat.class, InputFormat.class);
    // ORC cannot be combined.
    conf.setBoolean("cascading.hadoop.hfs.combine.files", false);
    CorcInputFormat.setSchemaTypeInfo(conf, schemaTypeInfo);
    CorcInputFormat.setTypeInfo(conf, typeInfo);
    CorcInputFormat.setSearchArgumentKryo(conf, searchArgumentKryo);
    CorcInputFormat.setConverterFactoryClass(conf, converterFactory.getClass().asSubclass(ConverterFactory.class));
  }
1153569
private void initDatasource()  {
		if(this.isIncreamentImport()) {
			if(this.esjdbc.getStatusDbConfig() == null) {
				statusDbname = this.esjdbc.getDbConfig().getDbName() + "_config";
				String dbJNDIName = this.esjdbc.getDbConfig().getDbName() + "_config";
				try {
					createStatusTableSQL = new StringBuilder().append("create table " ).append( statusTableName)
							.append( " (ID number(10),lasttime number(10),lastvalue number(10),lastvaluetype number(1),PRIMARY KEY (ID))").toString();
					File dbpath = new File(statusStorePath);
					logger.info("initDatasource dbpath:" + dbpath.getCanonicalPath());
					SQLUtil.startPool(statusDbname,
							"org.sqlite.JDBC",
							"jdbc:sqlite://" + dbpath.getCanonicalPath(),
							"root", "root",
							null,//"false",
							null,// "READ_UNCOMMITTED",
							"select 1",
							dbJNDIName,
							10,
							10,
							20,
							true,
							false,
							null, false, false
					);
				} catch (Exception e) {
					throw new ESDataImportException(e);
				}
			}
			else{
				DBConfig statusDBConfig = esjdbc.getStatusDbConfig();

				statusDbname = esjdbc.getStatusDbConfig().getDbName();
				if(!statusDbname.equals(esjdbc.getDbConfig().getDbName())){
					String dbJNDIName = statusDbname + "_config";
					try {

						SQLUtil.startPool(statusDbname,
								statusDBConfig.getDbDriver(),
								statusDBConfig.getDbUrl(),
								statusDBConfig.getDbUser(), statusDBConfig.getDbPassword(),
								null,//"false",
								null,// "READ_UNCOMMITTED",
								statusDBConfig.getValidateSQL(),
								dbJNDIName,
								10,
								10,
								20,
								true,
								false,
								null, false, false
						);
					} catch (Exception e) {
						throw new ESDataImportException(e);
					}
				}
				createStatusTableSQL = statusDBConfig.getStatusTableDML();
				if(createStatusTableSQL == null){
					createStatusTableSQL = statusDBConfig.getCreateStatusTableSQL(SQLUtil.getPool(statusDbname).getDBType());
				}
				createStatusTableSQL = createStatusTableSQL.replace("$statusTableName",statusTableName);
			}

			if (esjdbc.getDateLastValueColumn() != null) {
				this.lastValueType = ImportIncreamentConfig.TIMESTAMP_TYPE;
			} else if (esjdbc.getNumberLastValueColumn() != null) {
				this.lastValueType = ImportIncreamentConfig.NUMBER_TYPE;

			} else if (esjdbc.getLastValueType() != null) {
				this.lastValueType = esjdbc.getLastValueType();
			} else {
				this.lastValueType = ImportIncreamentConfig.NUMBER_TYPE;
			}


			existSQL = new StringBuilder().append("select 1 from ").append(statusTableName).toString();
			selectSQL = new StringBuilder().append("select id,lasttime,lastvalue,lastvaluetype from ")
					.append(statusTableName).append(" where id=?").toString();
			updateSQL = new StringBuilder().append("update ").append(statusTableName)
					.append(" set lasttime = ?,lastvalue = ? ,lastvaluetype= ? where id=?").toString();
			insertSQL = new StringBuilder().append("insert into ").append(statusTableName)
					.append(" (id,lasttime,lastvalue,lastvaluetype) values(?,?,?,?)").toString();
		}
	}
442947
function getSourceTemplate(cb) {
    if (options.cache) {
      var info = self.cache[filename];
      if (info) {
        return cb(null, info.source, info.template);
      }
    }

    fs.readFile(filename, 'utf8', function(err, source) {
      if (err) return cb(err);

      var template = self.compile(source, filename);
      if (options.cache) {
        self.cache[filename] = {
          source: source,
          template: template
        };
      }
      return cb(null, source, template);
    });
  }
1218857
Source getSourceFromXmlAttribute() throws JspTagException, SAXException, ParserConfigurationException {
        Object xml = this.xml;
        if (xml == null) {
            throw new JspTagException(Resources.getMessage("TRANSFORM_XML_IS_NULL"));
        }

        // other JSTL XML tags may produce a list
        if (xml instanceof List) {
            List<?> list = (List<?>) xml;
            if (list.size() != 1) {
                throw new JspTagException(Resources.getMessage("TRANSFORM_XML_LIST_SIZE"));
            }
            xml = list.get(0);
        }

        if (xml instanceof Source) {
            return (Source) xml;
        }
        if (xml instanceof String) {
            String s = (String) xml;
            s = s.trim();
            if (s.length() == 0) {
                throw new JspTagException(Resources.getMessage("TRANSFORM_XML_IS_EMPTY"));
            }
            return XmlUtil.newSAXSource(new StringReader(s), xmlSystemId, entityResolver);
        }
        if (xml instanceof Reader) {
            return XmlUtil.newSAXSource((Reader) xml, xmlSystemId, entityResolver);
        }
        if (xml instanceof Node) {
            return new DOMSource((Node) xml, xmlSystemId);
        }
        throw new JspTagException(Resources.getMessage("TRANSFORM_XML_UNSUPPORTED_TYPE", xml.getClass()));
    }
931801
private function findSourceFiles(): void
  {
    $helper    = new SourceFinderHelper(dirname($this->configFilename));
    $filenames = $helper->findSources($this->sourcePattern);

    foreach ($filenames as $filename)
    {
      $routineName     = pathinfo($filename, PATHINFO_FILENAME);
      $this->sources[] = ['path_name'    => $filename,
                          'routine_name' => $routineName,
                          'method_name'  => $this->methodName($routineName)];
    }
  }
269850
public com.google.protobuf.ByteString
      getSourceUrlBytes() {
    java.lang.Object ref = sourceUrl_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      sourceUrl_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
403141
function () {
            return gpf.http.post("/fs/src/sources.json", this.toString())
                .then(function (answer) {
                    var HTTP_ERROR = 500;
                    if (answer.status === HTTP_ERROR) {
                        return dialogs.error(answer.responseText);
                    }
                });
        }