text:
package org.zaproxy.addon.automation;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.swing.ImageIcon;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.parosproxy.paros.CommandLine;
import org.parosproxy.paros.Constant;
import org.parosproxy.paros.control.Control;
import org.parosproxy.paros.extension.CommandLineArgument;
import org.parosproxy.paros.extension.CommandLineListener;
import org.parosproxy.paros.extension.ExtensionAdaptor;
import org.parosproxy.paros.extension.ExtensionHook;
import org.parosproxy.paros.model.Model;
import org.yaml.snakeyaml.Yaml;
import org.zaproxy.addon.automation.gui.AutomationPanel;
import org.zaproxy.addon.automation.jobs.ActiveScanJob;
import org.zaproxy.addon.automation.jobs.AddOnJob;
import org.zaproxy.addon.automation.jobs.ParamsJob;
import org.zaproxy.addon.automation.jobs.PassiveScanConfigJob;
import org.zaproxy.addon.automation.jobs.PassiveScanWaitJob;
import org.zaproxy.addon.automation.jobs.RequestorJob;
import org.zaproxy.addon.automation.jobs.SpiderJob;
import org.zaproxy.zap.ZAP;
import org.zaproxy.zap.eventBus.Event;
import org.zaproxy.zap.extension.stats.ExtensionStats;

public class ExtensionAutomation extends ExtensionAdaptor implements CommandLineListener {

    // The name is public so that other extensions can access it
    public static final String NAME = "ExtensionAutomation";

    // The i18n prefix
    public static final String PREFIX = "automation";

    public static final String RESOURCES_DIR = "/org/zaproxy/addon/automation/resources/";

    public static final ImageIcon ICON =
            new ImageIcon(ExtensionAutomation.class.getResource(RESOURCES_DIR + "robot.png"));

    private static final Logger LOG = LogManager.getLogger(ExtensionAutomation.class);

    private Map<String, AutomationJob> jobs = new HashMap<>();
    private SortedSet<AutomationJob> sortedJobs = new TreeSet<>();

    private AutomationParam param;
    private LinkedHashMap<Integer, AutomationPlan> plans = new LinkedHashMap<>();

    private CommandLineArgument[] arguments = new CommandLineArgument[4];
    private static final int ARG_AUTO_RUN_IDX = 0;
    private static final int ARG_AUTO_GEN_MIN_IDX = 1;
    private static final int ARG_AUTO_GEN_MAX_IDX = 2;
    private static final int ARG_AUTO_GEN_CONF_IDX = 3;

    private AutomationPanel automationPanel;

    public ExtensionAutomation() {
        super(NAME);
        setI18nPrefix(PREFIX);

        this.registerAutomationJob(new AddOnJob());
        this.registerAutomationJob(new PassiveScanConfigJob());
        this.registerAutomationJob(new RequestorJob());
        this.registerAutomationJob(new PassiveScanWaitJob());
        this.registerAutomationJob(new SpiderJob());
        this.registerAutomationJob(new ActiveScanJob());
        this.registerAutomationJob(new ParamsJob());
        // Instantiate early so its visible to potential consumers
        AutomationEventPublisher.getPublisher();
    }

    @Override
    public void hook(ExtensionHook extensionHook) {
        super.hook(extensionHook);

        extensionHook.addCommandLine(getCommandLineArguments());
        extensionHook.addOptionsParamSet(getParam());

        if (getView() != null) {
            extensionHook.getHookView().addStatusPanel(getAutomationPanel());
        }
    }

    @Override
    public void optionsLoaded() {}

    @Override
    public boolean canUnload() {
        // The extension can be dynamically unloaded, all resources used/added can be freed/removed
        // from core.
        return true;
    }

    @Override
    public void unload() {
        super.unload();
        ZAP.getEventBus().unregisterPublisher(AutomationEventPublisher.getPublisher());
    }

    @Override
    public List<String> getUnsavedResources() {
        if (this.hasView()) {
            return getAutomationPanel().getUnsavedPlans();
        }
        return null;
    }

    private AutomationPanel getAutomationPanel() {
        if (automationPanel == null) {
            automationPanel = new AutomationPanel(this);
        }
        return automationPanel;
    }

    public void registerAutomationJob(AutomationJob job) {
        this.jobs.put(job.getType(), job);
        this.sortedJobs.add(job);
    }

    public void unregisterAutomationJob(AutomationJob job) {
        this.jobs.remove(job.getType());
        this.sortedJobs.remove(job);
    }

    public void generateConfigFile(String filename) {
        File f = new File(filename);
        try (FileWriter fw = new FileWriter(f)) {
            fw.write(AutomationEnvironment.getConfigFileData());

            this.sortedJobs.forEach(
                    j -> {
                        try {
                            if (!j.isDataJob()) {
                                fw.write(j.getConfigFileData());
                                fw.write("\n");
                            }
                        } catch (IOException e) {
                            CommandLine.error(
                                    Constant.messages.getString(
                                            "automation.error.write", f.getAbsolutePath()),
                                    e);
                        }
                    });

        } catch (IOException e) {
            CommandLine.error(
                    Constant.messages.getString("automation.error.write", f.getAbsolutePath()), e);
        }
    }

    public void generateTemplateFile(String filename, boolean incAll) {
        File f = new File(filename);
        CommandLine.info(
                Constant.messages.getString(
                        "automation.cmdline.out.template", f.getAbsolutePath()));
        try (FileWriter fw = new FileWriter(f)) {
            fw.write(AutomationEnvironment.getTemplateFileData());

            jobs.values().stream()
                    .sorted()
                    .forEach(
                            j -> {
                                try {
                                    if (incAll) {
                                        fw.write(j.getTemplateDataMax());
                                    } else {
                                        fw.write(j.getTemplateDataMin());
                                    }
                                } catch (Exception e) {
                                    CommandLine.error(
                                            Constant.messages.getString(
                                                    "automation.error.job.template", j.getType()),
                                            e);
                                }
                            });

        } catch (IOException e) {
            CommandLine.error(
                    Constant.messages.getString("automation.error.write", f.getAbsolutePath()), e);
        }
    }

    private void clearStats() {
        // Clear stats for any stats tests
        ExtensionStats extStats =
                Control.getSingleton().getExtensionLoader().getExtension(ExtensionStats.class);
        if (extStats != null && extStats.getInMemoryStats() != null) {
            extStats.getInMemoryStats().allCleared();
        }
    }

    public AutomationProgress runPlan(AutomationPlan plan, boolean resetProgress)
            throws AutomationJobException {
        if (resetProgress) {
            plan.resetProgress();
        }
        clearStats();

        AutomationProgress progress = plan.getProgress();
        AutomationEnvironment env = plan.getEnv();

        AutomationEventPublisher.publishEvent(AutomationEventPublisher.PLAN_STARTED, plan, null);
        env.create(Model.getSingleton().getSession(), progress);

        AutomationEventPublisher.publishEvent(
                AutomationEventPublisher.PLAN_ENV_CREATED, plan, null);

        if (progress.hasErrors() || env.isTimeToQuit()) {
            // If the environment reports an error then no point in continuing
            AutomationEventPublisher.publishEvent(
                    AutomationEventPublisher.PLAN_FINISHED, plan, plan.getProgress().toMap());
            return progress;
        }

        List<AutomationJob> jobsToRun = plan.getJobs();

        for (AutomationJob job : jobsToRun) {
            job.applyParameters(progress);
            progress.info(Constant.messages.getString("automation.info.jobstart", job.getType()));
            job.setStatus(AutomationJob.Status.RUNNING);
            AutomationEventPublisher.publishEvent(AutomationEventPublisher.JOB_STARTED, job, null);
            job.runJob(env, progress);
            job.logTestsToProgress(progress);
            job.setStatus(AutomationJob.Status.COMPLETED);
            AutomationEventPublisher.publishEvent(
                    AutomationEventPublisher.JOB_FINISHED,
                    job,
                    job.getPlan().getProgress().getJobResults(job).toMap());
            progress.info(Constant.messages.getString("automation.info.jobend", job.getType()));
            progress.addRunJob(job);
            if (env.isTimeToQuit()) {
                break;
            }
        }

        AutomationEventPublisher.publishEvent(
                AutomationEventPublisher.PLAN_FINISHED, plan, plan.getProgress().toMap());
        return progress;
    }

    public void runPlanAsync(AutomationPlan plan) {
        new Thread(
                        () -> {
                            try {
                                this.runPlan(plan, true);
                            } catch (AutomationJobException e1) {
                                if (hasView()) {
                                    getView().showWarningDialog(e1.getMessage());
                                } else {
                                    LOG.warn(e1.getMessage());
                                }
                            }
                        },
                        "ZAP-Automation")
                .start();
    }

    public AutomationPlan loadPlan(File f)
            throws AutomationJobException, FileNotFoundException, IOException {
        return new AutomationPlan(this, f);
    }

    public AutomationPlan loadPlan(InputStream in) throws AutomationJobException {
        Yaml yaml = new Yaml();
        LinkedHashMap<?, ?> data = yaml.load(in);
        LinkedHashMap<?, ?> envData = (LinkedHashMap<?, ?>) data.get("env");
        ArrayList<?> jobsData = (ArrayList<?>) data.get("jobs");

        AutomationProgress progress = new AutomationProgress();
        AutomationEnvironment env = new AutomationEnvironment(envData, progress);

        List<AutomationJob> jobsToRun = new ArrayList<>();

        for (Object jobObj : jobsData) {
            if (!(jobObj instanceof LinkedHashMap<?, ?>)) {
                progress.error(Constant.messages.getString("automation.error.job.data", jobObj));
                continue;
            }
            LinkedHashMap<?, ?> jobData = (LinkedHashMap<?, ?>) jobObj;

            Object jobType = jobData.get("type");
            if (jobType == null) {
                progress.error(Constant.messages.getString("automation.error.job.notype", jobType));
                continue;
            }
            AutomationJob job = jobs.get(jobType);
            if (job != null) {
                job = job.newJob();
                Object jobName = jobData.get("name");
                if (jobName != null) {
                    if (jobName instanceof String) {
                        job.setName((String) jobName);
                    } else {
                        progress.warn(
                                Constant.messages.getString("automation.error.job.name", jobName));
                    }
                }

                Object paramsObj = jobData.get("parameters");
                if (paramsObj != null && !(paramsObj instanceof LinkedHashMap<?, ?>)) {
                    progress.error(
                            Constant.messages.getString("automation.error.job.data", paramsObj));
                    continue;
                }
                job.setEnv(env);
                job.setJobData(jobData);
                job.verifyParameters(progress);
                jobsToRun.add(job);

                job.addTests(jobData.get("tests"), progress);
            } else {
                progress.error(
                        Constant.messages.getString("automation.error.job.unknown", jobType));
            }
        }

        return new AutomationPlan(env, jobsToRun, progress);
    }

    public void loadPlan(AutomationPlan plan, boolean setFocus, boolean run) {
        if (hasView()) {
            getAutomationPanel().loadPlan(plan);
            if (setFocus) {
                getAutomationPanel().setTabFocus();
            }
            if (run) {
                this.runPlanAsync(plan);
            }
        }
    }

    public AutomationJob getJobByEvent(Event e) {
        if (hasView()) {
            return getAutomationPanel().getJob(e);
        }
        return null;
    }

    public void registerPlan(AutomationPlan plan) {
        this.plans.put(plan.getId(), plan);
    }

    public void displayPlan(AutomationPlan plan) {
        if (this.hasView()) {
            this.getAutomationPanel().setCurrentPlan(plan);
        }
        this.plans.put(plan.getId(), plan);
    }

    public AutomationPlan getPlan(int planId) {
        return this.plans.get(planId);
    }

    /**
     * Run the automation plan define by the given file, intended only to be used from the command
     * line
     *
     * @param filename the name of the file
     * @return the automation progress
     */
    protected AutomationProgress runAutomationFile(String filename) {
        File f = new File(filename);
        if (!f.exists() || !f.canRead()) {
            CommandLine.error(
                    Constant.messages.getString("automation.error.nofile", f.getAbsolutePath()));
            return null;
        }
        try {
            AutomationPlan plan = new AutomationPlan(this, f);
            if (this.hasView()) {
                this.getAutomationPanel().setCurrentPlan(plan);
            }
            this.runPlan(plan, false);
            AutomationProgress progress = plan.getProgress();

            if (progress.hasErrors()) {
                CommandLine.info(Constant.messages.getString("automation.out.title.fail"));
                for (String str : progress.getErrors()) {
                    CommandLine.info(Constant.messages.getString("automation.out.info", str));
                }
            }
            if (progress.hasWarnings()) {
                CommandLine.info(Constant.messages.getString("automation.out.title.warn"));
                for (String str : progress.getWarnings()) {
                    CommandLine.info(Constant.messages.getString("automation.out.info", str));
                }
            }

            if (!progress.hasErrors() && !progress.hasWarnings()) {
                CommandLine.info(Constant.messages.getString("automation.out.title.good"));
            }
            return progress;

        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
            CommandLine.error(
                    Constant.messages.getString(
                            "automation.error.unexpected", f.getAbsolutePath(), e.getMessage()));
            return null;
        }
    }

    public static String getResourceAsString(String name) {
        try (InputStream in = ExtensionAutomation.class.getResourceAsStream(RESOURCES_DIR + name)) {
            return new BufferedReader(new InputStreamReader(in))
                            .lines()
                            .collect(Collectors.joining("\n"))
                    + "\n";
        } catch (Exception e) {
            CommandLine.error(
                    Constant.messages.getString("automation.error.nofile", RESOURCES_DIR + name));
        }
        return "";
    }

    public Map<String, AutomationJob> getAutomationJobs() {
        return Collections.unmodifiableMap(jobs);
    }

    public AutomationJob getAutomationJob(String type) {
        return jobs.get(type);
    }

    public List<JobResultData> getJobResultData() {
        List<JobResultData> list = new ArrayList<>();
        for (AutomationJob job : jobs.values()) {
            list.addAll(job.getJobResultData());
        }
        return list;
    }

    public AutomationParam getParam() {
        if (param == null) {
            param = new AutomationParam();
        }
        return param;
    }

    @Override
    public String getDescription() {
        return Constant.messages.getString(PREFIX + ".desc");
    }

    protected CommandLineArgument[] getCommandLineArguments() {
        arguments[ARG_AUTO_RUN_IDX] =
                new CommandLineArgument(
                        "-autorun",
                        1,
                        null,
                        "",
                        "-autorun <filename>      "
                                + Constant.messages.getString("automation.cmdline.autorun.help"));
        arguments[ARG_AUTO_GEN_MIN_IDX] =
                new CommandLineArgument(
                        "-autogenmin",
                        1,
                        null,
                        "",
                        "-autogenmin <filename>   "
                                + Constant.messages.getString(
                                        "automation.cmdline.autogenmin.help"));
        arguments[ARG_AUTO_GEN_MAX_IDX] =
                new CommandLineArgument(
                        "-autogenmax",
                        1,
                        null,
                        "",
                        "-autogenmax <filename>   "
                                + Constant.messages.getString(
                                        "automation.cmdline.autogenmax.help"));
        arguments[ARG_AUTO_GEN_CONF_IDX] =
                new CommandLineArgument(
                        "-autogenconf",
                        1,
                        null,
                        "",
                        "-autogenconf <filename>  "
                                + Constant.messages.getString(
                                        "automation.cmdline.autogenconf.help"));
        return arguments;
    }

    @Override
    public void execute(CommandLineArgument[] args) {
        if (arguments[ARG_AUTO_RUN_IDX].isEnabled()) {
            runAutomationFile(arguments[ARG_AUTO_RUN_IDX].getArguments().firstElement());
        }
        if (arguments[ARG_AUTO_GEN_MIN_IDX].isEnabled()) {
            generateTemplateFile(
                    arguments[ARG_AUTO_GEN_MIN_IDX].getArguments().firstElement(), false);
        }
        if (arguments[ARG_AUTO_GEN_MAX_IDX].isEnabled()) {
            generateTemplateFile(
                    arguments[ARG_AUTO_GEN_MAX_IDX].getArguments().firstElement(), true);
        }
        if (arguments[ARG_AUTO_GEN_CONF_IDX].isEnabled()) {
            generateConfigFile(arguments[ARG_AUTO_GEN_CONF_IDX].getArguments().firstElement());
        }
    }

    @Override
    public List<String> getHandledExtensions() {
        return null;
    }

    @Override
    public boolean handleFile(File file) {
        // Not supported
        return false;
    }

    @Override
    public String getAuthor() {
        return Constant.ZAP_TEAM;
    }
}


text:
module Kaya
  module View
    class Parser

      # Parses cucumber report html doc
      # Divides in each parts of document
      # @param [String] source = the html code
      # @param [Kaya::Result] the result object
      def self.adapt_to_kaya(source, result)
          source.gsub! 'Collapse All

',"
            Collapse All

#{kaya_info(result)}
"
        # end
        source.inspect
      end

      # This is the information added to html report
      # @param [Kaya::Results::Result] result object
      # @return [String] the html to be added
      def self.kaya_info(result)
        info  = "
Suite: #{result.suite_name}
"
        info += "
Execution name: #{result.execution_name.gsub('-_-',' ')}
" unless result.execution_name.empty?
        info += "
Command: #{result.command}
"
        info += "
Custom Params: #{result.custom_params_values.split('=').last}
"
        info += "
Started: #{result.started_at_formatted}
"
        info += "
Commit ID: #{result.git_log.split('\n').first}
"
        info += "
<input type='button' onclick='window.close();' value='Close this window' />"
      end

      def self.extract_summary source
        if no_scenario_but_green?(source) # 0 scenarios executed
          get_elapsed_time_for_zero(source)
        elsif has_scenarios_executed?(source) # scenarios executed > 0
          get_scenarios_summary(source)
        else
          "running"
        end
      end

      # Returns the status present on html cucumber report
      # @param [String] the entire report html code
      # @reurn [String] the text of status
      def self.get_status(source)
         source.scan(/\d\sscenarios?\s\(\d+\s(\w+)/i).flatten.first if finished_statement?(source)
      end

      # Checks if report says that execution is finised
      # @param [String] source = the entire report html code
      # @return [Boolean] true if report says finished
      def self.finished_statement? source
        !(source =~ /Finished in .*s seconds/).nil?
      end

      # Checks if result report is about no scenarios executed (scenarios not found)
      # @param [String] the entire report html source code
      # @return [Boolean] true if is finished (green) and no scenarios executed (It means that is empty. No scenarios executed)
      def self.no_scenario_but_green?(source)
        source.include? '0m0.000s seconds'
      end

      # Checks if has scenario results summary
      # @param [String] the entire report html source code
      # @return [Boolean] true if there is scenarios executed
      def self.has_scenarios_executed? source
        (source.include? "scenario") and (source.scan(/\d+\sscenario.*\)/).size > 0)
      end

      #
      def self.get_elapsed_time_for_zero(source)
        "0 Scenarios " + source.scan(/Finished in 0m0.000s seconds/).first.gsub("","")
      end

      def self.get_scenarios_summary(source)
        source.scan(/\d+\sscenario.*\)/).first.gsub(/\<.+\>/,' - ')
      end

    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.appdynamics.monitors.iPlanet.beans;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("cache-bucket")
public class CacheBucket {
    @XStreamAsAttribute()
    private String flagEnabled;
    @XStreamAsAttribute()
    private String secondsMaxAge;
    @XStreamAsAttribute()
    private String countEntries;
    @XStreamAsAttribute()
    private String maxEntries;
    @XStreamAsAttribute()
    private String countOpenEntries;
    @XStreamAsAttribute()
    private String maxOpenEntries;
    @XStreamAsAttribute()
    private String sizeHeapCache;
    @XStreamAsAttribute()
    private String maxHeapCacheSize;
    @XStreamAsAttribute()
    private String sizeMmapCache;
    @XStreamAsAttribute()
    private String maxMmapCacheSize;
    @XStreamAsAttribute()
    private String countHits;
    @XStreamAsAttribute()
    private String countMisses;
    @XStreamAsAttribute()
    private String countInfoHits;
    @XStreamAsAttribute()
    private String countInfoMisses;
    @XStreamAsAttribute()
    private String countContentHits;
    @XStreamAsAttribute()
    private String countContentMisses;
    @XStreamAsAttribute()
    private String countAcceleratorEntries;
    @XStreamAsAttribute()
    private String countAcceleratableRequests;
    @XStreamAsAttribute()
    private String countUnacceleratableRequests;
    @XStreamAsAttribute()
    private String countAcceleratableResponses;
    @XStreamAsAttribute()
    private String countUnacceleratableResponses;
    @XStreamAsAttribute()
    private String countAcceleratorHits;
    @XStreamAsAttribute()
    private String countAcceleratorMisses;

    public String getFlagEnabled() {
        return flagEnabled;
    }

    public void setFlagEnabled(String flagEnabled) {
        this.flagEnabled = flagEnabled;
    }

    public String getSecondsMaxAge() {
        return secondsMaxAge;
    }

    public void setSecondsMaxAge(String secondsMaxAge) {
        this.secondsMaxAge = secondsMaxAge;
    }

    public String getCountEntries() {
        return countEntries;
    }

    public void setCountEntries(String countEntries) {
        this.countEntries = countEntries;
    }

    public String getMaxEntries() {
        return maxEntries;
    }

    public void setMaxEntries(String maxEntries) {
        this.maxEntries = maxEntries;
    }

    public String getCountOpenEntries() {
        return countOpenEntries;
    }

    public void setCountOpenEntries(String countOpenEntries) {
        this.countOpenEntries = countOpenEntries;
    }

    public String getMaxOpenEntries() {
        return maxOpenEntries;
    }

    public void setMaxOpenEntries(String maxOpenEntries) {
        this.maxOpenEntries = maxOpenEntries;
    }

    public String getSizeHeapCache() {
        return sizeHeapCache;
    }

    public void setSizeHeapCache(String sizeHeapCache) {
        this.sizeHeapCache = sizeHeapCache;
    }

    public String getMaxHeapCacheSize() {
        return maxHeapCacheSize;
    }

    public void setMaxHeapCacheSize(String maxHeapCacheSize) {
        this.maxHeapCacheSize = maxHeapCacheSize;
    }

    public String getSizeMmapCache() {
        return sizeMmapCache;
    }

    public void setSizeMmapCache(String sizeMmapCache) {
        this.sizeMmapCache = sizeMmapCache;
    }

    public String getMaxMmapCacheSize() {
        return maxMmapCacheSize;
    }

    public void setMaxMmapCacheSize(String maxMmapCacheSize) {
        this.maxMmapCacheSize = maxMmapCacheSize;
    }

    public String getCountHits() {
        return countHits;
    }

    public void setCountHits(String countHits) {
        this.countHits = countHits;
    }

    public String getCountMisses() {
        return countMisses;
    }

    public void setCountMisses(String countMisses) {
        this.countMisses = countMisses;
    }

    public String getCountInfoHits() {
        return countInfoHits;
    }

    public void setCountInfoHits(String countInfoHits) {
        this.countInfoHits = countInfoHits;
    }

    public String getCountInfoMisses() {
        return countInfoMisses;
    }

    public void setCountInfoMisses(String countInfoMisses) {
        this.countInfoMisses = countInfoMisses;
    }

    public String getCountContentHits() {
        return countContentHits;
    }

    public void setCountContentHits(String countContentHits) {
        this.countContentHits = countContentHits;
    }

    public String getCountContentMisses() {
        return countContentMisses;
    }

    public void setCountContentMisses(String countContentMisses) {
        this.countContentMisses = countContentMisses;
    }

    public String getCountAcceleratorEntries() {
        return countAcceleratorEntries;
    }

    public void setCountAcceleratorEntries(String countAcceleratorEntries) {
        this.countAcceleratorEntries = countAcceleratorEntries;
    }

    public String getCountAcceleratableRequests() {
        return countAcceleratableRequests;
    }

    public void setCountAcceleratableRequests(String countAcceleratableRequests) {
        this.countAcceleratableRequests = countAcceleratableRequests;
    }

    public String getCountUnacceleratableRequests() {
        return countUnacceleratableRequests;
    }

    public void setCountUnacceleratableRequests(String countUnacceleratableRequests) {
        this.countUnacceleratableRequests = countUnacceleratableRequests;
    }

    public String getCountAcceleratableResponses() {
        return countAcceleratableResponses;
    }

    public void setCountAcceleratableResponses(String countAcceleratableResponses) {
        this.countAcceleratableResponses = countAcceleratableResponses;
    }

    public String getCountUnacceleratableResponses() {
        return countUnacceleratableResponses;
    }

    public void setCountUnacceleratableResponses(String countUnacceleratableResponses) {
        this.countUnacceleratableResponses = countUnacceleratableResponses;
    }

    public String getCountAcceleratorHits() {
        return countAcceleratorHits;
    }

    public void setCountAcceleratorHits(String countAcceleratorHits) {
        this.countAcceleratorHits = countAcceleratorHits;
    }

    public String getCountAcceleratorMisses() {
        return countAcceleratorMisses;
    }

    public void setCountAcceleratorMisses(String countAcceleratorMisses) {
        this.countAcceleratorMisses = countAcceleratorMisses;
    }
}


text:
***

## **Summary**
 * Study notes about `Core Python Programming`


text:
''' 9-plot_flux.py
=========================
AIM:	Plot maps of the stray light flux or equivalent magnitude given a particular date

INPUT:	files: 	- <orbit_id>_misc/orbits.dat
		- <orbit_id>_flux/flux_*.dat
		- resources/moon_*.dat, sun_*.dat, orbits_*.dat
	variables: see section PARAMETERS (below)

OUTPUT:	in <orbit_id>_figures/maps/ : map with the following name: flux_%07d.png

CMD:	python 9-plot_flux.py

ISSUES:	- Boundary zone when observing zone is centred on 360 deg

REQUIRES:- standard python libraries, specific libraries in resources/ (+ SciPy)
	 - Structure of the root folder:
	   * <orbit_id>_flux/ --> flux files
	   * <orbit_id>_figures/maps/ --> figures
	   * <orbit_id>_misc/ --> storages of data
	   * all_figures/ --> comparison figures

REMARKS: <none>
'''

#####################################################################################################################
# DEFINITIONS AND INCLUDES
import numpy as np
import pylab as plt

import os
import random
import time

import copy
from scipy.interpolate import griddata
from matplotlib.patches import Rectangle, Circle

from resources.routines import *
from resources.TimeStepping import *
import parameters as param
import resources.constants as const
import resources.figures as figures

from matplotlib.collections import PatchCollection
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.lines as mlines

#####################################################################################################################
# PARAMETERS
# Orbital elements
apogee=650
perigee=650
orbit_id = '6am_650_5_conf4e'

# First minute in data set !
minute_ini = 75#1440 * 172
minute_end = 81#1440 * 172 + 100

# File name for the output data file
orbits_file = 'orbits.dat'

# is true outputs .eps and .pdf for every step. Much slower and heavier
fancy = False

# compare the data to the flux of different stars
magnitudes = False

# Show stray light contour map ?
straylight = True

# Draw boundaries ?
boundaries = False

# Speeds up by not loading the different position files, does not save, but shows --> for new implementation or debugging
future = True
save = False
# TODO:
# - For minute (orbit_ID 800) 363500, contour of zone better

file_orbit      = 'orbit_%s.dat' % orbit_id
file_sun        = 'sun_%s.dat' % orbit_id
file_moon       = 'moon_%s.dat' % orbit_id

# Factor in the SL post treatment correction ?
SL_post_treat = True
# Factor in mirror efficiency for the equivalent star magnitude ?
mirror_correction = False
#####################################################################################################################
# CONSTANTS AND PHYSICAL PARAMETERS
period = altitude2period(apogee,perigee)

sl_min = 1e-9
sl_max = 0.1
#####################################################################################################################
# INITIALISATION
file_flux = 'flux_'
# Formatted folders definitions
folder_flux, folder_figures, folder_misc = init_folders(orbit_id)
folder_figures= '%s_figures/maps/' % (orbit_id)

#params = {'backend': 'ps','axes.labelsize': 14,'text.fontsize': 18,'legend.fontsize': 18,'xtick.labelsize': 14,'ytick.labelsize': 14,'text.usetex': True}
#plt.rcParams.update(params)

from matplotlib import rc
rc('font',**{'family':'serif','serif':['Palatino'],'size':14})
rc('text', usetex=True)

print '\nObservability Map Plotting'
print 'ORBIT ID:', orbit_id
print '-------------------------------------------'

if not os.path.isdir(folder_figures):
	print '\tError: figure folder %s does not exists.' % (folder_figures)
	exit()

ra = dec = S_sl=np.zeros(1)

# load the postions of the Moon, Sun and Earth
if not future :

	sys.stdout.write("Loading orbit file...\t\t\t")
	sys.stdout.flush()

	try:
		sat = np.loadtxt('resources/'+file_orbit, delimiter='\t')
	except ValueError:
		sat = np.loadtxt('resources/'+file_orbit, delimiter=' ')

	# apply time conditions
	sat = sat[sat[:,0] >= minute_ini]
	sat = sat[sat[:,0] <= minute_end]
	print "Done."

	sys.stdout.write("Loading Sun file...\t\t\t")
	sys.stdout.flush()

	try:
		sun = np.loadtxt('resources/'+file_sun, delimiter=' ')
	except ValueError:
		sun = np.loadtxt('resources/'+file_sun, delimiter='\t')

	sun = sun[sun[:,0] >= minute_ini]
	sun = sun[sun[:,0] <= minute_end]
	print "Done."

	sys.stdout.write("Loading Moon file...\t\t\t")
	sys.stdout.flush()

	try:
		moon = np.loadtxt('resources/'+file_moon, delimiter=',')
	except ValueError:
		moon = np.loadtxt('resources/'+file_moon, delimiter=' ')

	moon = moon[moon[:,0] >= minute_ini]
	moon = moon[moon[:,0] <= minute_end]
	print "Done."
################################################################################
# Prepare the grid
n_alpha = param.resx
n_delta = param.resy

ra_i = 0
ra_f = 2.*np.pi

dec_i = -np.pi/2.
dec_f = np.pi/2.

ra_step = (ra_f-ra_i)/n_alpha
dec_step = (dec_f-dec_i)/n_delta

iterable = (ra_i + i*ra_step for i in range(n_alpha))
ras = np.fromiter(iterable, np.float)-np.pi

iterable = (dec_i + i*dec_step for i in range(n_delta))
decs = np.fromiter(iterable, np.float)

ra_grid, dec_grid = np.meshgrid(ras, decs)

grid_points0 = np.zeros(np.shape(ra_grid))

iterable = (ra_i + ra_step/2 + i*ra_step for i in range(n_alpha))
ras2 = np.fromiter(iterable, np.float)-np.pi

iterable = (dec_i + dec_step/2 + i*dec_step for i in range(n_delta))
decs2 = np.fromiter(iterable, np.float)

#####################################################################################################################
# Prepares the list of minutes

sys.stdout.write("Loading computed orbits...\t\t")
sys.stdout.flush()

orbits = np.loadtxt(folder_misc+orbits_file,dtype='i4')

list_minutes = -1. * np.ones( ( np.shape(orbits)[0] + 2 ) * period )

id_min = 0
times = np.loadtxt('resources/minute_table_%s.dat' % orbit_id, delimiter=',',dtype='Int32')
for ii, orbit_current in enumerate(orbits[:,0]):
	t_ini, t_end, a_ini, a_end = fast_orbit2times(times,orbit_current,orbit_id)
	for minute in range(a_ini, a_end+1):
		list_minutes[id_min] = int(minute)
		id_min += 1

list_minutes = list_minutes[list_minutes > -1]

# apply time conditions
list_minutes = list_minutes[list_minutes >= minute_ini]
list_minutes = list_minutes[list_minutes <= minute_end]

print 'Done.'

#####
def draw_boundaries(ax,xx,yy,ra_step,dec_step, force=False):
	# sort the outer points rights to draw the limits correctly
	xx, yy, ox, oy = sort_boundary(xx,yy,ra_step,dec_step, force)

	# the last point is the first to close the path
	xx = np.append(xx,xx[0])
	yy = np.append(yy,yy[0])

	# Format the vertices of the path correctly ie [(x1,y1), (x2,y2), ..., (x1, y1)]
	verts = np.array(zip(xx,yy))
	# Create the path and say which points are the 1st, verticies or last point
	Path = mpath.Path
	codes = [Path.MOVETO]
	for ii in range(1, len(xx)-1): codes.append(Path.LINETO)
	codes.append(Path.CLOSEPOLY)

	path = mpath.Path(verts+[0,0], codes)
	patch = mpatches.PathPatch(path, facecolor='none', edgecolor='black',zorder=100)
	patch = ax.add_patch(patch)

	return ox, oy

####

if not magnitudes: from matplotlib import colors, ticker, cm

#####################################################################################################################
# Loops on every time step to get the data

for id_min, minute in enumerate(list_minutes):
	minute = int(minute)
	sys.stdout.write("Plotting stray light map "+str(minute)+'...\t')
	sys.stdout.flush()
	#####################################################################################################################
	# Loads the data
	# As it's produced by fortran, it may be a bit sketchy. We read line by line (which is slower than the native numpy method of reading text btw and filter out all space af$
	try:
		ra, dec, S_sl = load_flux_file(minute, file_flux, folder=folder_flux)

		# Apply the flux correction (SL post-treatment removal and the mirror efficiency)
		if mirror_correction: S_sl /= param.mirror_efficiency
		if SL_post_treat: S_sl *= (1.0 - param.SL_post_treat_reduction)
		S_sl *= param.SL_QE

		# Now we compare the flux with the magnitude of the star.
		if magnitudes: S_sl = flux2mag(S_sl,param.ppm_threshold)

		# Data is loaded and processed. --> We do a plot
		doplot = True
	except IOError: # There is no file. That means that there is nothing to plot
		raise
		S_sl=np.zeros(1)
		ra = dec = S_sl

		doplot = False
		sys.stdout.write("Warning: No point\t")
		sys.stdout.flush()
	#####################################################################################################################
	# Start ploting for minute min

	plt.figure()
	ax = plt.subplot(111, projection="mollweide")
	ax.grid(True)
	ax.set_xticklabels([r'$30^{\circ}$',r'$60^{\circ}$',r'$90^{\circ}$',r'$120^{\circ}$',r'$150^{\circ}$',r'$180^{\circ}$',r'$210^{\circ}$',r'$240^{\circ}$',r'$270^{\circ}$',r'$300^{\circ}$',r'$330^{\circ}$']) #,r'$360^{\circ}$'
	ax.set_xlabel(r'$\alpha$')
	ax.set_ylabel(r'$\delta$')
	#####################################################################################################################
	# Prepare plots...
	extent = (-np.pi,np.pi,-np.pi/2.,np.pi/2.)
	if doplot:

		if magnitudes:
			vf = np.linspace(param.magnitude_min,param.magnitude_max+0.2, (param.magnitude_max-param.magnitude_min+1)*2, endpoint=True)
			v = np.linspace(param.magnitude_min,param.magnitude_max, (param.magnitude_max-param.magnitude_min+1), endpoint=True)
			t = map(figures.format_mag, v)
		else:
			vf = np.logspace(np.log10(sl_min), np.log10(sl_max), np.log10(sl_max)-np.log10(sl_min)*2, endpoint=True)
			v = np.logspace(np.log10(sl_min), np.log10(sl_max), np.log10(sl_max)-np.log10(sl_min)+1, endpoint=True)
			t = map(figures.format_log10, v)

		# prepare the surface plot
		xi = np.linspace(-np.pi,np.pi,n_alpha*2)
		yi = np.linspace(-np.pi/2,np.pi/2,n_delta*2)

		# grid the data.

# Sometimes if the points are too well aligned, griddate hangs up as it uses 2d interpolation. Introducing therefore a small random noise on the position.
# or http://stackoverflow.com/questions/10886971/orbit_idernatives-to-scipy-interpolate-griddata-that-dont-hang-on-aligned-points
		ra = ra + np.random.random(ra.shape[0]) * 1e-6 - np.pi
		dec = dec + np.random.random(ra.shape[0]) * 1e-6
		zi = griddata((ra, dec), S_sl, (xi[None,:], yi[:,None]), method='cubic')

#		print np.log10(sl_max)-np.log10(sl_min)

		# if not close enough, mask value
		# cosmetics
		for ii, rag in enumerate(xi) :
			a = np.where(abs(ra-rag)<0.1)[0]
			if np.shape(a) == 0: continue
			# if no a in array, continue
			for jj, decg in enumerate(yi) :
				b = np.where(abs(dec-decg)<0.1)[0]
				# if no dec in array, continue
				if np.shape(b)[0] == 0: continue

				# if not close enough, mask value
				if np.shape(np.intersect1d(a,b))[0] == 0: zi[jj,ii] = np.nan

		if straylight:
		# complete the holes in the interpolation
			cmap = plt.cm.jet
			w = ra_step
			h = dec_step

			for x, y, c_sl in zip(ra, dec, S_sl):
				if magnitudes: cc = (c_sl-param.magnitude_min)/(param.magnitude_max+0.2-param.magnitude_min)
				else: cc = (np.log10(c_sl)-np.log10(sl_min))/(np.log10(sl_max)-np.log10(sl_min))
				ax.add_artist(Rectangle(xy=(x-w/2,y-h/2), color=cmap(cc), width=w, height=h, zorder=0))#,

		# make a plot of the centers of the cells
		scat=plt.plot(ra,dec,'o',c='k', markersize=2)

		if straylight:
			if magnitudes:
				CS = plt.contour(xi,yi,zi,vf,linewidths=0.5,colors='k',extent=extent)
				CS = plt.contourf(xi,yi,zi,vf,cmap=plt.cm.jet,extent=extent)
			else:
				CS = plt.contour(xi,yi,zi,vf,linewidths=0.5,colors='k',extent=extent,locator=ticker.LogLocator())
				CS = plt.contourf(xi,yi,zi,vf,cmap=plt.cm.jet,extent=extent,locator=ticker.LogLocator())

			cbar = plt.colorbar(CS, ticks=v, orientation='horizontal',shrink=.8)
			cbar.set_ticklabels(t)
			l,b,w,h = plt.gca().get_position().bounds
			ll,bb,ww,hh = cbar.ax.get_position().bounds
			cbar.ax.set_position([ll, bb+0.1, ww, hh])

			if magnitudes: cbar.set_label(r'$m_V$')
			else: cbar.set_label(r'$\mathrm{Stray\ light\ flux}\ [\frac{\mathrm{ph}}{\mathrm{px}\cdot s}]$')

##########################################################################################
		# Get the outer limit of the data
		# make deep copy to avoid pointers issues from one image to the next.
		grid_points = copy.deepcopy(grid_points0)
		grid_points2 = copy.deepcopy(grid_points0)

		# For each point, find out what are the neighbouring points on the (half) grid
		for ii, ra_ in enumerate(ra):
			dec_ = dec[ii]

			id_ra = find_nearest(ras,ra_+ra_step/2)
			id_dec = find_nearest(decs,dec_+dec_step/2)
			grid_points[id_dec,id_ra] = 1

			id_ra = find_nearest(ras,ra_+ra_step/2)
			id_dec = find_nearest(decs,dec_-dec_step/2)
			grid_points[id_dec,id_ra] = 1

			id_ra = find_nearest(ras,ra_-ra_step/2)
			id_dec = find_nearest(decs,dec_+dec_step/2)
			grid_points[id_dec,id_ra] = 1

			id_ra = find_nearest(ras,ra_-ra_step/2)
			id_dec = find_nearest(decs,dec_-dec_step/2)
			grid_points[id_dec,id_ra] = 1

		if boundaries:
		# Size of "board"
			X = n_alpha-1
			Y = n_delta-1

		# Create the list of all points interesting
			neighbours = lambda x, y : [(x2, y2) for x2 in range(x-1, x+2) for y2 in range(y-1, y+2) if -1 < x <= X and -1 < y <= Y and (x != x2 or y != y2)]

		# restrict to only outer points
			for ii in range(0, n_alpha):
				for jj in range(0, n_delta):
					if grid_points[jj, ii]>0. :
						v = [grid_points[neighbours(ii,jj)[kk][1], neighbours(ii,jj)[kk][0]] for kk in range( 0, len( neighbours(ii,jj) ) )]
						# If there is point grid point which is not neighbour to a stray light calculation point, then it is a outer cell point.
						if 0 in v: grid_points2[jj,ii] = 1

		# restrict the list of the point in the cell grid to only outer points
			ra_grid2 = ra_grid[np.where(grid_points2>0.)]
			dec_grid2 = dec_grid[np.where(grid_points2>0.)]

		# change the name of the variable for clarity
			xx = ra_grid2
			yy = dec_grid2
			del ra_grid2, dec_grid2, grid_points, grid_points2

			ox, oy = draw_boundaries(ax,xx,yy,ra_step,dec_step)
			if np.shape(ox)[0] > 2 and future: ox, oy = draw_boundaries(ax,ox,oy,ra_step,dec_step,True)

			del xx, yy, ox, oy

		if not future:
			# find the position of the satellite in the orbit and to compute RA, DEC of the Earth and the Sun with respect to the sat's center.

			# EARTH
			id_sat = find_nearest(sat[:,0],minute)

			x = -1*sat[id_sat,1]
			y = -1*sat[id_sat,2]
			z = -1*sat[id_sat,3]

			ra_sat = rev( right_ascension(x,y) )
			dec_sat= declination(x,y,z)

			circle = Circle((ra_sat-np.pi,dec_sat), 0.07, facecolor='blue',
	                edgecolor='none', alpha=1, zorder=5)
			ax.add_patch(circle)

			# SUN
			id_sat = find_nearest(sun[:,0],minute)
			x = sun[id_sat,1]
			y = sun[id_sat,2]
			z = sun[id_sat,3]

			ra_sun = rev( right_ascension(x,y) )
			dec_sun= declination(x,y,z)

			plt.plot(ra_sun - np.pi,dec_sun,'o',color="yellow", markersize=8, zorder=5)

			# MOON
			id_sat = find_nearest(moon[:,0],minute)
			x = moon[id_sat,1]
			y = moon[id_sat,2]
			z = moon[id_sat,3]

			ra_moon = rev( right_ascension(x,y) )
			dec_moon= declination(x,y,z)
			circle = Circle((ra_moon - np.pi,dec_moon), 0.03, facecolor='white',
	                edgecolor='black', linewidth=0.5, alpha=1, zorder=5)
			ax.add_patch(circle)

			# reduces the size of the arrays speed up the plots
			sat = sat[sat[:,0] >= minute]
			sun = sun[sun[:,0] >= minute]
			moon = moon[moon[:,0] >= minute]
	else:
		v = np.linspace(param.magnitude_min,param.magnitude_max+0.2, (param.magnitude_max-param.magnitude_min+1)*2, endpoint=True)

		scat=plt.scatter(ra,dec,c=S_sl, s=2,vmin=param.magnitude_min, vmax=v[-1])

		t = np.linspace(param.magnitude_min,param.magnitude_max, (param.magnitude_max-param.magnitude_min+1), endpoint=True)
		plt.colorbar(ticks=t)
		scat.remove()

	plt.grid(True)

	# add the time, the orbit number and the stray light angle.

	# convert epoch to matplotlib float format
	labels = minute * 60. + const.timestamp_2018_01_01
	# to human readable date
	pre = time.gmtime(labels)
	labels = figures.format_second(pre)

	orbit_current = fast_minute2orbit(times,minute,orbit_id)

	plt.text(-0.1, 1.0,'%s' % labels, transform = ax.transAxes)
	plt.text(-0.1, 0.9,r'$\mathrm{orbit}\ %d$' % orbit_current, transform = ax.transAxes)
#	plt.text(-0.1, 0.8,r'$\mathrm{id}\ %d$' % orbit_id, transform = ax.transAxes)

	if future:
		plt.show()
		exit()
	if not save:
		plt.show()

	if magnitudes: fname = '%s/flux_%07d' % (folder_figures, minute)
	else: fname = '%s/straylight_%07d' % (folder_figures, minute)
	if (fancy and save):
		plt.savefig(fname+'.eps')
		os.system("epstopdf "+fname+".eps")
		os.system('pdfcrop '+fname+'.pdf')
		os.system('mv '+fname+'-crop.pdf '+fname+'.pdf')
		os.system('pdftocairo -png '+fname+'.pdf'+' '+fname)

	if save: plt.savefig(fname+'.png', dpi=param.dpi)

	plt.close()
	del ra, dec, S_sl
	print "Done."


text:
<form method="post" onsubmit="return false;">
New jFramework Module: <input type='text' id='ModulePath' />
<input type="checkbox" id="system" value="1" /> System Module
</form>

File:

<?php

class  extends BaseControllerClass

{

   function Start()

   {

      $App=$this->App;

      $View=$this->View;

      # Put your logic here

      $this->Present("Page Title Here");

   }

}

?>

<input type="button" onclick="fnSelect('code');" value="Select All"/>

<form method="post" id="saveform" style="display:none;">
<input type='hidden' id="save_module" name="module" />
<input type='hidden' id="save_file" name="file" />

Supply your system username and password if webserver does not have access writing files:

Username:<input type="text" name="save_username" value="<?php echo $_POST['save_username'];?>"/>
Password: <input type='password' name="save_password" value="<?php echo $_POST['save_password'];?>"/>

<input type='submit' value='Save File' />
</form>


text:
package google.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

@Configuration
public class ExecutorConfig {

	@Bean
	public ThreadPoolTaskExecutor taskExecutor() {
		ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
		executor.setCorePoolSize(4);
		executor.setMaxPoolSize(4);
		executor.setThreadNamePrefix("result_task_executor_thread");
		executor.initialize();
		return executor;
	}

}


text:
'use strict';
module.exports = {
  up: function(queryInterface, Sequelize) {
    return queryInterface.createTable('questions', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      content: {
        type: Sequelize.TEXT
      },
      answered: {
        type: Sequelize.BOOLEAN
      },
      score: {
        type: Sequelize.INTEGER
      },
      userId: {
        type: Sequelize.INTEGER
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  down: function(queryInterface, Sequelize) {
    return queryInterface.dropTable('questions');
  }
};


text:
using Logy.Maps.ReliefMaps.Basemap;
using Logy.Maps.ReliefMaps.Map2D;
using NUnit.Framework;

namespace Logy.Maps.Metrics
{
    [TestFixture]
    public class SignedDistanceMap : RotationStopMap<SignedDistanceBasin>
    {
        [Test]
        public void Water_ShiftAxis(int i)
        {
            Data = new BasinDataAbstract<SignedDistanceBasin>(HealpixManager/*, -200d //, 2000d*/);

            ShiftAxis();
        }
    }
}


text:
using System;
using System.Collections.Generic;

using LBi.Cli.Arguments.Parsing.Ast;

namespace LBi.Cli.Arguments.Parsing
{
    public class Parser
    {
        public virtual NodeSequence Parse(string args)
        {
            Tokenizer tokenizer = new Tokenizer();
            IEnumerable<Token> tokens = tokenizer.Tokenize(args);
            return new NodeSequence(args, this.Parse(tokens));
        }

        protected virtual IEnumerable<AstNode> Parse(IEnumerable<Token> tokens)
        {
            using (var enu = tokens.GetEnumerator())
            {
                if (!enu.MoveNext())
                    throw new ArgumentException("Token stream must at the very least contain the terminator: EndOfStream", "tokens");

                while (enu.Current.Type != TokenType.EndOfString)
                {
                    yield return this.GetAstNode(enu);
                }
            }
        }

        protected virtual AstNode GetAstNode(IEnumerator<Token> enumerator)
        {
            AstNode ret;
            switch (enumerator.Current.Type)
            {
                case TokenType.ParameterName:
                    ret = new ParameterName(enumerator.Current,
                                            enumerator.Current.Value);
                    enumerator.MoveNext();
                    break;
                case TokenType.SwitchParameter:
                    Token token = enumerator.Current;
                    enumerator.MoveNext();
                    ret = new SwitchParameter(token,
                                              token.Value,
                                              this.GetAstNode(enumerator));
                    break;
                case TokenType.NumericValue:
                    ret = new LiteralValue(
                                            enumerator.Current,
                                            LiteralValueType.Numeric,
                                            enumerator.Current.Value);
                    enumerator.MoveNext();
                    break;
                case TokenType.StringValue:
                    ret = new LiteralValue(
                                            enumerator.Current,
                                            LiteralValueType.String,
                                            enumerator.Current.Value);
                    enumerator.MoveNext();
                    break;
                case TokenType.BoolValue:
                    ret = new LiteralValue(
                                            enumerator.Current,
                                            LiteralValueType.Boolean,
                                            enumerator.Current.Value);
                    enumerator.MoveNext();
                    break;
                case TokenType.NullValue:
                    ret = new LiteralValue(
                                            enumerator.Current,
                                            LiteralValueType.Null,
                                            enumerator.Current.Value);
                    enumerator.MoveNext();
                    break;
                case TokenType.ListStart:
                    ret = this.GetSequence(enumerator);
                    break;
                case TokenType.DictionaryStart:
                    ret = this.GetAssocArray(enumerator);
                    break;
                //case TokenType.DictionaryValueSeperator:
                //case TokenType.DictionaryKeySeperator:
                case TokenType.DictionaryEnd:
                //case TokenType.ListValueSeperator:
                case TokenType.ListEnd:
                    throw new Exception("Invalid token sequence.");

                default:
                    throw new ArgumentOutOfRangeException();
            }

            if (enumerator.Current.Type == TokenType.ListValueSeperator)
            {
                enumerator.MoveNext();

                AstNode obj = this.GetAstNode(enumerator);
                if (obj is Sequence)
                {
                    var list = new List<AstNode>(((Sequence) obj).Elements);
                    list.Add(ret);
                    ret = new Sequence(ret.SourceInfo, list);
                }
                else
                {
                    ret = new Sequence(ret.SourceInfo, new[] {ret, obj});
                }
            }

            return ret;
        }

        private AstNode GetAssocArray(IEnumerator<Token> enumerator)
        {
            ISourceInfo sourceInfo = enumerator.Current;
            List<KeyValuePair<AstNode, AstNode>> elements = new List<KeyValuePair<AstNode, AstNode>>();

            System.Diagnostics.Debug.Assert(enumerator.Current.Type == TokenType.DictionaryStart);

            enumerator.MoveNext();

            while (enumerator.Current.Type != TokenType.DictionaryEnd)
            {
                AstNode key = this.GetAstNode(enumerator);
                AstNode value = this.GetAstNode(enumerator);
                elements.Add(new KeyValuePair<AstNode, AstNode>(key, value));
            }

            // skip ListEnd token
            enumerator.MoveNext();

            return new AssociativeArray(sourceInfo, elements);
        }

        private AstNode GetSequence(IEnumerator<Token> enumerator)
        {
            ISourceInfo sourceInfo = enumerator.Current;

            List<AstNode> elements = new List<AstNode>();

            enumerator.MoveNext();

            while (enumerator.Current.Type != TokenType.ListEnd)
            {
                elements.Add(this.GetAstNode(enumerator));
            }

            // skip ListEnd token
            enumerator.MoveNext();

            return new Sequence(sourceInfo, elements);
        }
    }
}


text:
class Tag < ApplicationRecord
  has_many :taggings, dependent: :destroy
  has_many :articles, through: :taggings

  validates :name, presence: true, uniqueness: {case_sensitive: false}

  def published_articles
    @published_articles ||= articles.published.decorate
  end
end


text:
actions :tar, :cp_to_dir

attribute :source, :kind_of => [ String ], :required => true
attribute :dest, :kind_of => [ String ], :required => true
attribute :result_dir, :kind_of => [ String ]
attribute :result_file, :kind_of => [ String ]


text:
class MyFloat
  # IEEE 754 single precesion (32 bits)
  # 1 bit sign, 8 bit exponent, 23 bit fraction
  OFFSET_BIAS = 127

  SIGN_POSITION = 31
  SIGN_BITS = 0x1
  EXPONENT_POSITION = 23
  EXPONENT_BITS = 0xff
  FRACTION_POSITION = 0
  FRACTION_BITS = 0x7fffff

  # IEEE 754 has an explicit bit set above the fraction part (as in scientific notation)
  EXPLICIT_FRACTION_BIT = 0x800000

  @value = 0

  def initialize(value = 0)
    @value = value
    # Limit to 32 bit
    @value &= (2**32-1)
  end

  def value()
    # Special value for 0
    if (fraction_bits() == 0 and exponent() == 0)
      return sign() == 1 ? -0.0 : 0.0
    end
    (-1)**sign() * fraction() * 2**(exponent()-OFFSET_BIAS)
  end

  def sign()
    # 1 bit 31 bits offset
    (@value >> SIGN_POSITION) & SIGN_BITS
  end

  def exponent()
    # 8 bits 23 bits offset
    (@value >> EXPONENT_POSITION) & EXPONENT_BITS
  end

  def fraction()
    # 23 bits (@value & 0x7fffff)
    # 1.b22b21b20..b2b1b0
    # 1 + sum(i=1..23)(b[23-i]*2**(-i))
    # or 1 + sum(i=0..22)(b[i]*(2**(-i-1))
    fraction = 1
    for i in 0..22
      fraction += ((@value >> (22 - i)) & 0x1) * 2**(-i-1)
    end
    fraction.to_f
  end

  def fraction_bits()
    @value & FRACTION_BITS
  end

  def to_s()
    @value.to_s(2)
  end

  def raw_value()
    @value
  end

  def add(other)
    result = @value
    shift = exponent() - other.exponent()
    exponent = exponent()
    fraction_bits = fraction_bits() | EXPLICIT_FRACTION_BIT # add in implicit 23rd bit
    other_fraction_bits = other.fraction_bits | EXPLICIT_FRACTION_BIT
    if sign == 1
      fraction_bits = (~fraction_bits) + 1
    end
    if other.sign == 1
      other_fraction_bits = (~other_fraction_bits) + 1
    end
    if shift > 0
      other_fraction_bits >>= shift
    elsif shift < 0
      exponent = other.exponent()
      fraction_bits >>= -shift
    end
    fraction_bits += other_fraction_bits
    sign = 0
    if fraction_bits < 0
      fraction_bits = (~fraction_bits) + 1
      sign = 1
    end
    while fraction_bits >= (EXPLICIT_FRACTION_BIT << 1)
      exponent += 1
      fraction_bits >>= 1
    end
    while fraction_bits < (EXPLICIT_FRACTION_BIT)
      exponent -= 1
      fraction_bits <<= 1
      break if exponent == 0
    end
    if fraction_bits == EXPLICIT_FRACTION_BIT and exponent == 1
      # We are actually 0
      exponent = 0
    end
    MyFloat.new ((sign << SIGN_POSITION) | (exponent << EXPONENT_POSITION) | (fraction_bits & FRACTION_BITS))
  end

end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace DtoGenerator.Logic.Infrastructure.TreeProcessing
{
    public class BaseDtoClassLocator : CSharpSyntaxWalker
    {
        public string BaseDtoName { get; set; }

        public override void VisitClassDeclaration(ClassDeclarationSyntax node)
        {
            if(!node.Identifier.ToString().Contains("Mapper") && node?.BaseList?.Types != null)
            {
                this.BaseDtoName = node.BaseList.Types[0].Type.ToString();
            }

            base.VisitClassDeclaration(node);
        }
    }
}


text:
/*
 * JDAstroProfile.cc
 *
 *  Created on: 09/04/2018
 *
 *  Author:  Joaquim Palacio 		<<jpalacio@ifae.es>>
 *
 *
 */

#include "JDAstroProfile.h"

#include <TGraph.h>
#include <TMath.h>
#include <Rtypes.h>
#include <stddef.h>
#include <fstream>
#include <iostream>
#include <Rtypes.h>
#include <TAttFill.h>
#include <TAttLine.h>
#include <TAttText.h>
#include <TAxis.h>
#include <TCanvas.h>
#include <TF1.h>
#include <TF2.h>
#include <TGraph.h>
#include <TH1.h>
#include <TLegend.h>
#include <TPave.h>
#include <TString.h>
#include <TVirtualPad.h>
#include <TStyle.h>

using namespace std;

static const Double_t SolarMass2GeV = 1.1154e57;  			// [GeV/SolarM]
static const Double_t kpc2cm        = 3.08568e21; 			// [cm/kpc]

//-----------------------------------------------
//
//	This is the constructor used to show the possibilities that offers the JDAstroProfile class
//	It redirects us to CreateFunctionDM()
JDAstroProfile::JDAstroProfile():
		fdNdOmegaVsTheta(NULL), fdNdOmegaSigma1VsTheta(NULL),
		fNormdNdOmegaVsTheta(NULL), fNormdNdOmegaSigma1VsTheta(NULL), fIntegratedNdOmegaThetaVsTheta(NULL), fIntegratedNdOmegaSigma1ThetaVsTheta(NULL),
		fIntegratedNdOmegaOffThetaVsTheta(NULL), fIntegratedNdOmegaSigma1OffThetaVsTheta(NULL), fdNdOmegaThetaVsThetaPhi(NULL),
		fdNdOmegaSigma1ThetaVsThetaPhi(NULL), fdNdOmegaOffThetaVsThetaPhi(NULL), fdNdOmegaSigma1OffThetaVsThetaPhi(NULL),
		bIsdNdOmega(0),
		dDeg2Rad(TMath::Pi()/180.), dBinResolution(0.05)
{
	cout << endl;
	cout << endl;
	cout << "   Constructor JDAstroProfile..." << endl;
	cout << endl;
	cout << endl;
}

//-----------------------------------------------
//
//	This is the destructor.
//  It deletes the functions in order not to be reused
JDAstroProfile::~JDAstroProfile()
{

	if (gdNdOmega)											delete gdNdOmega;
	if (fdNdOmegaVsTheta)							delete fdNdOmegaVsTheta;
	if (fdNdOmegaSigma1VsTheta)						delete fdNdOmegaSigma1VsTheta;
	if (fNormdNdOmegaVsTheta)						delete fNormdNdOmegaVsTheta;
	if (fNormdNdOmegaSigma1VsTheta)					delete fNormdNdOmegaSigma1VsTheta;
	if (fIntegratedNdOmegaThetaVsTheta)							delete fIntegratedNdOmegaThetaVsTheta;
	if (fIntegratedNdOmegaSigma1ThetaVsTheta)						delete fIntegratedNdOmegaSigma1ThetaVsTheta;
	if (fIntegratedNdOmegaOffThetaVsTheta)						delete fIntegratedNdOmegaOffThetaVsTheta;
	if (fIntegratedNdOmegaSigma1OffThetaVsTheta)					delete fIntegratedNdOmegaSigma1OffThetaVsTheta;
	if (fdNdOmegaThetaVsThetaPhi)					delete fdNdOmegaThetaVsThetaPhi;
	if (fdNdOmegaSigma1ThetaVsThetaPhi)				delete fdNdOmegaSigma1ThetaVsThetaPhi;
	if (fdNdOmegaOffThetaVsThetaPhi)				delete fdNdOmegaOffThetaVsThetaPhi;
	if (fdNdOmegaSigma1OffThetaVsThetaPhi)				delete fdNdOmegaSigma1OffThetaVsThetaPhi;

		cout << endl;
		cout << endl;
		cout << "   Destructor JDAstroProfile..." << endl;
		cout << endl;
		cout << endl;
}

//-----------------------------------------------
//	This function creates the important functions of this class. The functions are:
//	TF1 fdNdOmegaVsTheta: 					evaluates the dNdOmega vs Theta; dNdOmega [~GeV, ~cm] 	theta [deg]
//	TF1 fdNdOmegaSigma1VsTheta: 				evaluates the dNdOmegaSigma1 vs Theta; dNdOmega [~GeV, ~cm] 	theta [deg]
//	TF1 fNormdNdOmegaVsTheta:				evaluates the dNdOmega normalized at a certain parameter vs Theta; dNdOmega [~GeV, ~cm] 	theta [deg]
//	TF1 fNormdNdOmegaSigma1VsTheta:				evaluates the dNdOmegaSigma1 normalized at a certain parameter vs Theta; dNdOmega [~GeV, ~cm] 	theta [deg]
//	TF1 fIntegratedNdOmegaThetaVsTheta:		integrates the dNdOmega to obtain the dNdOmega vs Theta; dNdOmega [~GeV,~cm]     theta [deg]
//	TF1 fIntegratedNdOmegaSigma1VsTheta:		integrates the dNdOmegaSigma1 to obtain the dNdOmegaSigma1 vs Theta; dNdOmega [~GeV,~cm]     theta [deg]
//	TF1 fIntegratedNdOmegaOffVsTheta:		integrates the dNdOmega on the OFF region to obtain the dNdOmega vs Theta; dNdOmega [~GeV,~cm]     theta [deg]
//	TF1 fIntegratedNdOmegaSigma1OffVsTheta:	integrates the dNdOmegaSigma1 on the OFF region to obtain the dNdOmegaSigma1 on the OFF region vs Theta; dNdOmega [~GeV,~cm]     theta [deg]
//  TF2 fdNdOmegaThetaVsThetaPhi:			evaluates the dNdOmega multiplied by Theta vs Theta and Phi; dNdOmega [~GeV, ~cm] 	theta [deg] 	phi[rad]
//  TF2 fdNdOmegaSigma1ThetaVsThetaPhi:			evaluates the dNdOmegaSigma1 multiplied by Theta vs Theta and Phi; dNdOmega [~GeV, ~cm] 	theta [deg] 	phi[rad]
//  TF2 fdNdOmegaOffThetaVsThetaPhi:			evaluates the dNdOmega on the OFF multiplied by Theta vs Theta and Phi; dNdOmega [~GeV, ~cm] 	theta [deg] 	phi[rad]
//  TF2 fdNdOmegaSigma1OffThetaVsThetaPhi:		evaluates the dNdOmegaSigma1 on the OFF multiplied by Theta vs Theta and Phi; dNdOmega [~GeV, ~cm] 	theta [deg] 	phi[rad]
void JDAstroProfile::CreateFunctionsAP()
{

	fdNdOmegaVsTheta = new TF1("fdNdOmegaVsTheta", this, &JDAstroProfile::dNdOmegaVsTheta,0.,GetThetaMax(),0, "JDAstroProfile", "dNdOmegaVsTheta");
	fdNdOmegaSigma1VsTheta = new TF1("fdNdOmegaSigma1VsTheta", this, &JDAstroProfile::dNdOmegaSigma1VsTheta,0.,GetThetaMax(),0, "JDAstroProfile", "dNdOmegaSigma1VsTheta");

	fdNdOmegaOffVsThetaPhi = new TF2("fdNdOmegaOffVsThetaPhi", this, &JDAstroProfile::dNdOmegaOffVsThetaPhi,0.,GetThetaMax(),0.,2*TMath::Pi(),1, "JDAstroProfile", "dNdOmegaOffVsThetaPhi");
	fdNdOmegaSigma1OffVsThetaPhi = new TF2("fdNdOmegaSigma1OffVsThetaPhi", this, &JDAstroProfile::dNdOmegaSigma1OffVsThetaPhi,0.,GetThetaMax(),0.,2*TMath::Pi(),1, "JDAstroProfile", "dNdOmegaSigma1OffVsThetaPhi");

	fdNdOmegaThetaVsThetaPhi = new TF2("fdNdOmegaThetaVsThetaPhi", this, &JDAstroProfile::dNdOmegaThetaVsThetaPhi,0.,GetThetaMax(),0.,2*TMath::Pi(),0, "JDAstroProfile", "dNdOmegaThetaVsThetaPhi");
	fdNdOmegaSigma1ThetaVsThetaPhi = new TF2("fdNdOmegaSigma1ThetaVsThetaPhi", this, &JDAstroProfile::dNdOmegaSigma1ThetaVsThetaPhi,0.,GetThetaMax(),0.,2*TMath::Pi(),0, "JDAstroProfile", "dNdOmegaSigma1ThetaVsThetaPhi");
	fdNdOmegaOffThetaVsThetaPhi = new TF2("fdNdOmegaOffThetaVsThetaPhi", this, &JDAstroProfile::dNdOmegaOffThetaVsThetaPhi,0.,GetThetaMax(),0.,2*TMath::Pi(),1, "JDAstroProfile", "dNdOmegaOffThetaVsThetaPhi");
	fdNdOmegaSigma1OffThetaVsThetaPhi = new TF2("fdNdOmegaSigma1OffThetaVsThetaPhi", this, &JDAstroProfile::dNdOmegaSigma1OffThetaVsThetaPhi,0.,GetThetaMax(),0.,2*TMath::Pi(),1, "JDAstroProfile", "dNdOmegaSigma1OffThetaVsThetaPhi");

	fIntegratedNdOmegaThetaVsTheta = new TF1("fIntegratedNdOmegaThetaVsTheta",this,&JDAstroProfile::IntegratedNdOmegaThetaVsTheta,0.,GetThetaMax(),0,"JDAstroProfile","IntegratedNdOmegaThetaVsTheta");
	fIntegratedNdOmegaSigma1ThetaVsTheta = new TF1("fIntegratedNdOmegaSigma1ThetaVsTheta",this,&JDAstroProfile::IntegratedNdOmegaSigma1ThetaVsTheta,0.,GetThetaMax(),0,"JDAstroProfile","IntegratedNdOmegaSigma1ThetaVsTheta");
	fIntegratedNdOmegaOffThetaVsTheta = new TF1("fIntegratedNdOmegaOffThetaVsTheta",this,&JDAstroProfile::IntegratedNdOmegaOffThetaVsTheta,0.,GetThetaMax(),1,"JDAstroProfile","IntegratedNdOmegaOffThetaVsTheta");
	fIntegratedNdOmegaSigma1OffThetaVsTheta = new TF1("fIntegratedNdOmegaSigma1OffThetaVsTheta",this,&JDAstroProfile::IntegratedNdOmegaSigma1OffThetaVsTheta,0.,GetThetaMax(),1,"JDAstroProfile","IntegratedNdOmegaSigma1OffThetaVsTheta");

	/////////////////////////// TO DELETE
	fNormdNdOmegaVsTheta = new TF1("fNormdNdOmegaVsTheta", this, &JDAstroProfile::NormdNdOmegaVsTheta, 0., GetThetaMax() , 1, "JDAstroProfile", "NormdNdOmegaVsTheta");
	fNormdNdOmegaSigma1VsTheta = new TF1("fNormdNdOmegaSigma1VsTheta", this, &JDAstroProfile::NormdNdOmegaSigma1VsTheta, 0., GetThetaMax() , 1, "JDAstroProfile", "NormdNdOmegaSigma1VsTheta");

}

//-----------------------------------------------
// It evaluates the TGraph dNdOmega [# · deg^{-2}] vs Theta [deg]
//
// x[0] 	= dTheta [deg]
Double_t JDAstroProfile::TGraphdNdOmegaVsTheta(Double_t* x, Double_t* par)
{
		return gdNdOmega->Eval(x[0]);
}

//-----------------------------------------------
// It evaluates the TGraph dNdOmegaSigma1 [# · deg^{-2}] vs Theta [deg]
//
// x[0] 	= dTheta [deg]
Double_t JDAstroProfile::TGraphdNdOmegaSigma1VsTheta(Double_t* x, Double_t* par)
{
		return gdNdOmegaSigma1->Eval(x[0]);
}

//-----------------------------------------------
// It integrates the dNdOmega [# · deg^{-2}] vs Theta [deg] and Phi [rad] multiplied by Theta [deg] in order to obtain the N(Delta Omega) [#]
//
// x[0] 	= dTheta [deg]
Double_t JDAstroProfile::IntegratedNdOmegaThetaVsTheta(Double_t* x, Double_t* par)
{
	return fdNdOmegaThetaVsThetaPhi->Integral(0.,x[0],0.,2*TMath::Pi(),1e-2);
}

//-----------------------------------------------
// It integrates the dNdOmegaSigma1 [# · deg^{-2}] vs Theta [deg] and Phi [rad] multiplied by Theta [deg] in order to obtain the NSigma1(Delta Omega) [#]
//
// x[0] 	= dTheta [deg]
Double_t JDAstroProfile::IntegratedNdOmegaSigma1ThetaVsTheta(Double_t* x, Double_t* par)
{
	return fdNdOmegaSigma1ThetaVsThetaPhi->Integral(0.,x[0],0.,2*TMath::Pi(),1e-2);
}

//-----------------------------------------------
// It integrates the dN_OFFdOmega [# · deg^{-2}] vs Theta [deg] and Phi [rad] on the OFF region multiplied by Theta [deg] in order to obtain the N_OFF (Delta Omega) [#]
//
// x[0] 	= dTheta [deg]
// par[0] 	= offset distance [deg]
Double_t JDAstroProfile::IntegratedNdOmegaOffThetaVsTheta(Double_t* x, Double_t* par)
{
	fdNdOmegaOffThetaVsThetaPhi->SetParameter(0,par[0]);
	return fdNdOmegaOffThetaVsThetaPhi->Integral(0.,x[0],0.,2*TMath::Pi(),1e-2);
}

//-----------------------------------------------
// It integrates the dN_OFFSigma1dOmega [# · deg^{-2}] vs Theta [deg] and Phi [rad] on the OFF region multiplied by Theta [deg] in order to obtain the N_OFFSigma1 (Delta Omega) [#]
//
// x[0] 	= dTheta [deg]
// par[0] 	= offset distance [deg]
Double_t JDAstroProfile::IntegratedNdOmegaSigma1OffThetaVsTheta(Double_t* x, Double_t* par)
{
	fdNdOmegaSigma1OffThetaVsThetaPhi->SetParameter(0,par[0]);
	return fdNdOmegaSigma1OffThetaVsThetaPhi->Integral(0.,x[0],0.,2*TMath::Pi(),1e-2);
}

//----------------------------------------------------
// 	It evaluates the dNdOmega [~GeV, ~cm] vs Theta [deg]
//
// 	x[0]		= theta	[deg]
Double_t JDAstroProfile::dNdOmegaVsTheta(Double_t* x, Double_t* par)
{
	return gdNdOmega->Eval(x[0]);
}

//----------------------------------------------------
// 	It evaluates the dNdOmegaSigma1 [~GeV, ~cm] vs Theta [deg]
//
// 	x[0]		= theta	[deg]
Double_t JDAstroProfile::dNdOmegaSigma1VsTheta(Double_t* x, Double_t* par)
{
	return gdNdOmegaSigma1->Eval(x[0]);
}

//----------------------------------------------------
// It evaluates the dNdOmega multiplied by Sin(Theta) vs Theta and Phi.
// The dNdOmega can be also multiplied by Theta if we are not considering Spherical Coordinates.
//
// x[0]		= theta	[deg]
// x[1]		= phi	[rad]
// x0rad    = theta [rad]
Double_t JDAstroProfile::dNdOmegaThetaVsThetaPhi(Double_t* x, Double_t* par)
{
	Double_t X0rad =x[0]*dDeg2Rad;

	if (GetIsSphericalCoordinates()==1)
	{
		return fdNdOmegaVsTheta->Eval(x[0])*TMath::Sin(X0rad);
	}
	else
	{
		return fdNdOmegaVsTheta->Eval(x[0])*x[0];
	}
}

//----------------------------------------------------
// It evaluates the dNdOmegaSigma1 multiplied by Sin(Theta) vs Theta and Phi.
// The dNdOmegaSigma1 can be also multiplied by Theta if we are not considering Spherical Coordinates.
//
// x[0]		= theta	[deg]
// x[1]		= phi	[rad]
// x0rad    = theta [rad]
Double_t JDAstroProfile::dNdOmegaSigma1ThetaVsThetaPhi(Double_t* x, Double_t* par)
{
	Double_t X0rad =x[0]*dDeg2Rad;

	if (GetIsSphericalCoordinates()==1)
	{
		return fdNdOmegaSigma1VsTheta->Eval(x[0])*TMath::Sin(X0rad);
	}
	else
	{
		return fdNdOmegaSigma1VsTheta->Eval(x[0])*x[0];
	}
}

//----------------------------------------------------
// It evaluates the dNdOmega on the OFF region vs Theta and Phi.
// The dNdOmega on the OFF region can be also multiplied by Theta if we are not considering Spherical Coordinates.
//
// x[0]		= theta	[deg]
// x[1]		= phi	[rad]
// par[0]	= offset	[deg]
// x0rad    = theta [rad]
// distFromHalo = distance from the center of the halo [deg] (Calculated from the law of cosines)
Double_t JDAstroProfile::dNdOmegaOffVsThetaPhi(Double_t* x, Double_t* par)
{
	Double_t distCenterSource = TMath::Sqrt(x[0]*x[0]+par[0]*par[0]-2*x[0]*par[0]*TMath::Cos(x[1]+(TMath::Pi()/2)));

	if (GetIsSphericalCoordinates()==1)
	{
		return fdNdOmegaVsTheta->Eval(distCenterSource);
	}
	else
	{
		return fdNdOmegaVsTheta->Eval(distCenterSource);
	}
}

//----------------------------------------------------
// It evaluates the dNdOmega_sig1 on the OFF region vs Theta and Phi.
// The dNdOmega on the OFF region can be also multiplied by Theta if we are not considering Spherical Coordinates.
//
// x[0]		= theta	[deg]
// x[1]		= phi	[rad]
// x0rad    = theta [rad]
// distFromHalo = distance from the center of the halo [deg] (Calculated from the law of cosines)
Double_t JDAstroProfile::dNdOmegaSigma1OffVsThetaPhi(Double_t* x, Double_t* par)
{
	Double_t distCenterSource = TMath::Sqrt(x[0]*x[0]+par[0]*par[0]-2*x[0]*par[0]*TMath::Cos(x[1]+(TMath::Pi()/2)));

	if (GetIsSphericalCoordinates()==1)
	{
		return fdNdOmegaSigma1VsTheta->Eval(distCenterSource);
	}
	else
	{
		return fdNdOmegaSigma1VsTheta->Eval(distCenterSource);
	}
}

//----------------------------------------------------
// It evaluates the dNdOmega on the OFF region multiplied by Sinus(Theta) vs Theta and Phi.
// The dNdOmega on the OFF region can be also multiplied by Theta if we are not considering Spherical Coordinates.
//
// x[0]		= theta	[deg]
// x[1]		= phi	[rad]
// par[0]	= offset	[deg]
// x0rad    = theta [rad]
// distFromHalo = distance from the center of the halo [deg] (Calculated from the law of cosines)
Double_t JDAstroProfile::dNdOmegaOffThetaVsThetaPhi(Double_t* x, Double_t* par)
{
	Double_t X0rad =x[0]*dDeg2Rad;

	Double_t distCenterSource = TMath::Sqrt(x[0]*x[0]+par[0]*par[0]-2*x[0]*par[0]*TMath::Cos(x[1]+(TMath::Pi()/2)));

	if (GetIsSphericalCoordinates()==1)
	{
		return fdNdOmegaVsTheta->Eval(distCenterSource)*TMath::Sin(X0rad);
	}
	else
	{
		return fdNdOmegaVsTheta->Eval(distCenterSource)*x[0];
	}
}

//----------------------------------------------------
// It evaluates the dNdOmegaSigma1 on the OFF region multiplied by Sinus(Theta) vs Theta and Phi.
// The dNdOmegaSigma1 on the OFF region can be also multiplied by Theta if we are not considering Spherical Coordinates.
//
// x[0]		= theta	[deg]
// x[1]		= phi	[rad]
// par[0]	= offset	[deg]
// x0rad    = theta [rad]
// distFromHalo = distance from the center of the halo [deg] (Calculated from the law of cosines)
Double_t JDAstroProfile::dNdOmegaSigma1OffThetaVsThetaPhi(Double_t* x, Double_t* par)
{
	Double_t X0rad =x[0]/180.*TMath::Pi();

	Double_t distCenterSource=TMath::Sqrt(x[0]*x[0]+par[0]*par[0]-2*x[0]*par[0]*TMath::Cos(x[1]+(TMath::Pi()/2)));

	if (GetIsSphericalCoordinates()==1)
	{
		return fdNdOmegaSigma1VsTheta->Eval(distCenterSource)*TMath::Sin(X0rad);
	}
	else
	{
		return fdNdOmegaSigma1VsTheta->Eval(distCenterSource)*X0rad;
	}
}

//It shows the available constructors
void JDAstroProfile::GetListOfConstructors()
{
	cout << " " << endl;
	cout << "    List of available constructors is:" << endl;
	cout << "    	- 	... " << endl;
	cout << " " << endl;
}

//It shows a warning message if anything is wrong
void JDAstroProfile::GetWarning()
{
	cout << "  *****************************" << endl;
	cout << "  ***" << endl;
	cout << "  ***  WARNING:" << endl;
	cout << "  ***" << endl;
	cout << "  ***  	- 	dN/dOmega not defined..." << endl;
	cout << " " << endl;
	cout << "  *****************************" << endl;
}


text:
from django.contrib import admin
from .models import *
admin.site.register(Genre)
#admin.site.register(Book)
#admin.site.register(Author)
#admin.site.register(BookInstance)
admin.site.register(Language)
# Register your models here.

# Define the admin class
class AuthorAdmin(admin.ModelAdmin):
    list_display = ('last_name', 'first_name', 'date_of_birth', 'date_of_death')
    fields = ['first_name', 'last_name', ('date_of_birth', 'date_of_death')]

# Register the admin class with the associated model
admin.site.register(Author, AuthorAdmin)

class BooksInstanceInline(admin.TabularInline):
    model = BookInstance

# Register the Admin classes for Book using the decorator

@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
    list_display = ('title', 'author', 'display_genre')
    inlines = [BooksInstanceInline]

# Register the Admin classes for BookInstance using the decorator

@admin.register(BookInstance)
class BookInstanceAdmin(admin.ModelAdmin):
    list_display = ('book', 'status', 'borrower', 'due_back', 'id')
    list_filter = ('status', 'due_back')

    fieldsets = (
        (None, {
            'fields': ('book', 'imprint', 'id')
        }),
        ('Availability', {
            'fields': ('status', 'due_back','borrower')
        }),
    )


text:
require([
            'jsiso/canvas/Control',
            'jsiso/canvas/Input',
            'jsiso/img/load',
            'jsiso/json/load',
            'jsiso/tile/Field',
            'jsiso/pathfind/pathfind',
            'jsiso/particles/EffectLoader',
            'jsiso/utils',
            'requirejs/domReady!'
        ],
        function(CanvasControl, CanvasInput, imgLoader, jsonLoader, TileField, pathfind, EffectLoader, utils) {
            // -- FPS --------------------------------
            window.requestAnimFrame = (function() {
                return window.requestAnimationFrame ||
                        window.webkitRequestAnimationFrame  ||
                        window.mozRequestAnimationFrame     ||
                        window.oRequestAnimationFrame       ||
                        window.msRequestAnimationFrame      ||
                        function(callback, element) {
                            window.setTimeout(callback, 1000 / 60);
                        };
            })();
            // ---------------------------------------

            // Editor Globals ------------------------

            var tileSelection = {};

            // ---------------------------------------

            var gameScheme = {
                tileHeight: 43,//30 градусов, отношение высоты к ширине
                tileWidth: 100,

                map: 'mapSmall.json',
                imageFiles: 'imageFiles.json',
            };

            //TODO: сделать дравинг в зависимости от размера экрана

            function launch() {
                jsonLoader([gameScheme.map, gameScheme.imageFiles]).then(function(jsonResponse) {
                    imgLoader([{graphics: jsonResponse[1].images}]).then(function(imgResponse) {
                        var game = new main(0, 0, 20, 20);  // X & Y drawing position, and tile span to draw - малая карта
                        // var game = new main(45, 45, 45, 45);// X & Y drawing position, and tile span to draw - большая карта
                        game.init([{
                            Title: "Graphics",
                            layout: jsonResponse[0].ground,
                            graphics: imgResponse[0].files,
                            graphicsDictionary: imgResponse[0].dictionary,
                            heightMap: {
                                map: jsonResponse[0].height,
                                offset: -80,
                                heightTile: imgResponse[0].files["ground.png"]
                            },
                            tileHeight: gameScheme.tileHeight,
                            tileWidth: gameScheme.tileWidth,
                            zeroIsBlank: true
                        }]);
                        addTilesToHUD("Graphics", imgResponse[0].dictionary, 1);
                    });
                });
            }

            function tileChoice(layer, tile) {
                tileSelection.title = layer;
                tileSelection.value = tile;
            }

            //Функция добавления на лаяут других объктов
            function addTilesToHUD(layer, dictionary, offset) {
                var clickTile;
                dictionary.forEach(function(tile, i) {
                    var clickTile = document.createElement("a");
                    clickTile.innerHTML += ("<img  height='50' width='50' src='../img/Grass/"  + tile +"' />");
                    document.getElementById("gameInfo").appendChild(clickTile);
                    clickTile.addEventListener("click", function(e){
                        tileChoice(layer, (i + offset))
                    });
                });
            }

            function main(x, y, xrange, yrange) {
                var mapLayers = [];
                var startY = y;
                var startX = x;
                var rangeX = xrange;
                var rangeY = yrange;
                var defaultRangeY = rangeY;

                var context = CanvasControl.create("canavas", 920, 600, {
                    background: "#000022",
                    display: "block",
                    marginLeft: "auto",
                    marginRight: "auto"
                });
                CanvasControl.fullScreen();

                var input = new CanvasInput(document, CanvasControl());

                input.mouse_action(function(coords) {
                    mapLayers.map(function(layer) {
//                                console.log(layer.getHeightMapTile());
                        tile_coordinates = layer.applyMouseFocus(coords.x, coords.y); // Get the current mouse location from X & Y Coords
                        console.log(coords);
                        //layer.setHeightmapTile(tile_coordinates.x, tile_coordinates.y, layer.getHeightMapTile(tile_coordinates.x, tile_coordinates.y) + 1); // Increase heightmap tile
                        layer.setTile(tile_coordinates.x, tile_coordinates.y, tileSelection.value); // Force the chaning of tile graphic
                    });
                });

                input.mouse_move(function(coords) {
                    mapLayers.map(function(layer) {
                        tile_coordinates = layer.applyMouseFocus(coords.x, coords.y); // Apply mouse rollover via mouse location X & Y
                    });
                });

                input.keyboard(function(keyCode, pressed, e) {
                    //Светить в консоли кейкод
                    console.log(keyCode);
                    switch(keyCode) {
                        case 65:
                            //a - отдалить
                            mapLayers.map(function(layer) {
                                if (startY + rangeY + 1 < mapLayers[0].getLayout().length) {
                                    layer.setZoom("out");
                                    layer.align("h-center", CanvasControl().width, xrange, -60);
                                    layer.align("v-center", CanvasControl().height,  yrange, 240);
                                    rangeX +=  1;
                                    rangeY +=  1
                                }
                            });
                            break;
                        case 83:
                            //s - приблизить
                            mapLayers.map(function(layer) {
                                if (rangeY - 1 > defaultRangeY - 1) {
                                    layer.setZoom("in");
                                    layer.align("h-center", CanvasControl().width, xrange, -60);
                                    layer.align("v-center", CanvasControl().height,  yrange, 240);
                                    rangeX -=  1;
                                    rangeY -=  1
                                }
                            });
                            break;
                        case 49:
                            // 1 - жми АДЫН
                            mapLayers.map(function(layer) {
                                layer.toggleGraphicsHide(true);
                                layer.toggleHeightShadow(true);
                            });
                            break;
                        case 50:
                            // 2 - жми два
                            mapLayers.map(function(layer) {
                                layer.toggleGraphicsHide(false);
                                layer.toggleHeightShadow(false);
                            });
                            break;
                        case 66:
                            if (pressed && document.getElementById('gameInfo').style.display !== 'none') {
                                document.getElementById('gameInfo').style.display = 'none';
                            } else if (pressed){
                                document.getElementById('gameInfo').style.display = 'block';
                            }
                            break;
                        case 89:
                            //Поворот Y, U
                            if (pressed) {
                                mapLayers.map(function(layer) {
                                    layer.rotate("left");
                                });
                            }
                            break;
                        case 85:
                            //Поворот Y, U
                            if (pressed) {
                                mapLayers.map(function(layer) {
                                    layer.rotate("right");
                                });
                            }
                            break;
                        case 75:
                            //save на кнопку, пока что-почему-то не работает, но метод лучше оставить. Вдруг пригодится)))
                            //в нём чувствуется какая-то будущее нужда на ровне с вебсокетом
                            var XML = new XMLPopulate();
                            XML.saveMap(44, mapLayers[0].getLayout(), mapLayers[0].getHeightLayout(), null);
                            break;
                        case 39:
                            //down  - X--
                            //left  - Y++
                            //up    - Y--
                            //right - X++
                            if (pressed) {
                                mapLayers.map(function(layer) {
                                    console.log(layer);
                                    layer.move('down', gameScheme.tileHeight);
                                    layer.move('left', gameScheme.tileHeight);
                                });
                                startX --;
                                startY ++;
                            }
                            break;
                        case 38:
                            if (pressed) {
                                mapLayers.map(function(layer) {
                                    layer.move('down', gameScheme.tileHeight);
                                    layer.move('up', gameScheme.tileHeight);
                                });
                                startX --;
                                startY --;
                            }
                            break;
                        case 40:
                            if (pressed) {
                                mapLayers.map(function(layer) {
                                    layer.move("right", gameScheme.tileHeight);
                                    layer.move("left", gameScheme.tileHeight);
                                });
                                startX ++;
                                startY ++;
                            }
                            break;
                        case 37:
                            if (pressed) {
                                mapLayers.map(function(layer) {
                                    layer.move("up",gameScheme.tileHeight);
                                    layer.move("right",gameScheme.tileHeight);
                                });
                                startX ++;
                                startY --;
                            }
                            break;
                    }
                });

                function draw() {
                    context.clearRect(0, 0, CanvasControl().width, CanvasControl().height);
                    for(i = startY; i < startY + rangeY; i++) {
                        for(j = startX; j < startX + rangeX; j++) {
                            mapLayers.map(function(layer) {
                                layer.draw(i,j);
                            });
                        }
                    }
                    requestAnimFrame(draw);
                }

                return {
                    init: function(layers) {
                        for (var i = 0; i < 0 + layers.length; i++) {
                            mapLayers[i] = new TileField(context, CanvasControl().height, CanvasControl().width);
                            mapLayers[i].setup(layers[i]);
                            mapLayers[i].align("h-center", CanvasControl().width, xrange + startX, 0);
                            mapLayers[i].align("v-center", CanvasControl().height, yrange + startY, (yrange + startY));
                            mapLayers[i].setZoom("in");
                        };
                        draw();
                    }
                }

            }

            launch();

        });


text:
from setuptools import find_packages
from distutils.core import setup

# requests 2.4.3 and 2.5.1 is known to work. Not sure about 2.5.1+
install_reqs =[
    'requests>=2.4.3',
    'requests-toolbelt==0.3.1',
    'wsgiref==0.1'
    ]

setup(
    author='Magnus Nilsson',
    author_email='magnus@karabas.nu',
    name='ScaleIO-py',
    description='Python interface to ScaleIO 1.31+ REST API',
    version="0.3.3-3",
    url='https://github.com/swevm/scaleio-py/',
    license='Apache License',
    packages=find_packages(),

    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
    install_requires=install_reqs,
)


text:
import numpy as np
import scipy.stats
from sklearn.preprocessing import scale, StandardScaler

from paa import paa
from operator import add

def sax(sequence, window, alphabet_size=5, adjust=True):
    '''

    Symbolic Aggregate Approximation.

    Transform time series into a string.

    Parameters
    ----------
    sequence: numpy.ndarray
        One-dimensional numpy array of arbitrary length
    window: int
        Length of sliding window
    alphabet_size: int
        Number of Gaussian breakpoints
    adjust: bool, default True
        Compute only for equal-size chunks

    Returns
    -------
    sax_representation: str
        A SAX representation

    Examples
    --------
    >>> import numpy as np
    >>> from sciquence.representation import sax
    >>> np.random.seed(42)
    >>> random_time_series = np.random.rand(50)
    >>> print sax(random_time_series, 10, alphabet_size=5)
    dcccc

    References
    ----------
    .. [1] Lin, J., Keogh, E., Lonardi, S., & Chiu, B. (2003).
           A Symbolic Representation of Time Series,
           with Implications for Streaming Algorithms.
           In proceedings of the 8th ACM SIGMOD Workshop
           on Research Issues in Data Mining and Knowledge Discovery.

           http://www.cs.ucr.edu/~eamonn/SAX.pdf

    .. [2] http://www.cs.ucr.edu/~eamonn/SAX.htm
    .. [3] https://jmotif.github.io/sax-vsm_site/morea/algorithm/SAX.html

    '''

    # TODO: check dimensionality, size, aphabet size etc.
    # Pre-step: checking if all arguments have proper values

    # First step: Standardization ( aka normalization, z-normalization or standard score)
    scaled = scale(sequence)

    # Second step: PAA
    paa_repr = paa(scaled, window=window, adjust=adjust)

    # Last step:
    breakpoints = gauss_breakpoints(alphabet_size)
    letters = _alphabet(alphabet_size)

    breakpoints= np.array(breakpoints)
    symbols = np.array(letters)
    return reduce(add, symbols[np.digitize(paa_repr, breakpoints)])

# =========== SAX object ============ #
# TODO: consider: some classes should be both transformers and processors

class SAX(object):

    def __init__(self, n_ranges=5, keep_scale=True):
        self.scaler = StandardScaler()
        self.breakpoints = gauss_breakpoints(n_ranges)

    def fit(self, X, y):
        return self

    def transform(self, X, y):
        pass

    def fit_transform(self, X, y):
        return self.fit(X, y).transform(X, y)

# ================ UTILS ================ #

def gauss_breakpoints(n_ranges):
    # TODO: move this function to utilities
    '''

    Get quantiles of Gaussian distribution.

    Parameters
    ----------
    n_ranges: int
        Number of equal ranges in Gaussian distribution

    Returns
    -------
    breakpoints: list of float
        List of Gaussian quantiles

    '''
    quantile_range = 1. / n_ranges
    quantiles = [quantile_range*i for i in range(1, n_ranges)]
    return [round(scipy.stats.norm.ppf(q), 2) for q in quantiles]

def _alphabet(n_letters):
    import string
    return np.array(list(string.ascii_lowercase)[:n_letters])

def get_bins(sequence, breakpoints, symbols):
    breakpoints= np.array(breakpoints)
    symbols = np.array(symbols)
    return np.digitize(sequence, breakpoints)[symbols]

if __name__ == '__main__':
    # rts = np.random.rand(20)*10
    # saxed = sax(rts, 3)
    # print saxed
    #print gauss_breakpoints(10)
    #import scipy.stats
    #print scipy.stats.norm.ppf(1. / 3)

    random_ts = np.random.rand(30, 100)
    print random_ts


text:
module Sub.Plugin2 where

import qualified API
action :: API.PluginAPI
action i = show i


text:
<!DOCTYPE html>
<html lang="<?php echo $lang; ?>">

<title><?php echo $title; ?></title>

<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.customisations.css">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

		Winebox

			<li class="<?php if ($pageid=='home') echo 'active'; ?>">Home

			<li class="<?php if ($pageid=='admin') echo 'active'; ?>">Administration

      <li class="<?php if ($pageid=='charts') echo 'active'; ?>">Charts

      <li class="<?php if ($pageid=='charts2') echo 'active'; ?>">Charts2


text:
'''
Created on Jan 11, 2014

@author: xapharius
'''
from datahandler.AbstractDataSet import AbstractDataSet
import numpy as np

class ImageDataSet(AbstractDataSet):
    '''
    Data set for image data.
    Contains the fields inputs and targets as list of numpy.ndarray
    '''

    def __init__(self, inputs, targets = None):
        '''
        Constructor
        @param inputs: list of numpy.ndarray (images)
        @param targets: list of some sort of label
        '''
        self.inputs = inputs
        self.targets = targets
        self.nrObservations = len(inputs)

    def get_observation(self, nr):
        '''
        Get Observation from inputs as tuple of input and target
        @param nr: index of observation to return
        @return: input and target of observation
        @rtype: tuple (numpy.ndarray, target)
        '''
        inputArr = self.inputs[nr]
        if self.targets != None:
            targetArr = self.targets[nr]
        else:
            targetArr = None
        return inputArr, targetArr

    def gen_observations(self):
        '''
        Iterate over all observations using a generator.
        @return: generator of tuple of inputs and targets
        @rtype: tuple (ndaray, target)
        '''
        for i in range(self.nrObservations):
            inputArr, targetArr = self.get_observation(i)
            yield inputArr, targetArr

    def rand_observation(self):
        i = np.random.randint(0, high=self.nrObservations)
        return self.get_observation(i)

    def get_inputs(self):
        return self.inputs

    def get_targets(self):
        return self.targets

    def get_nr_observations(self):
        return self.nrObservations


text:
package org.kindlyops.providers.rest;

import org.keycloak.connections.jpa.JpaConnectionProvider;
import org.jboss.resteasy.annotations.cache.NoCache;
import org.kindlyops.providers.OrganizationRepresentation;
import org.keycloak.models.KeycloakSession;
import org.kindlyops.providers.jpa.HavenOrganization;
import org.keycloak.models.utils.KeycloakModelUtils;

import javax.persistence.EntityManager;
import org.keycloak.models.RealmModel;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.LinkedList;

public class OrganizationResource {

    private final KeycloakSession session;

    public OrganizationResource(KeycloakSession session) {
        this.session = session;
        if (getRealm() == null) {
            throw new IllegalStateException("The service cannot accept a session without a realm in it's context.");
        }
    }

    private EntityManager getEntityManager() {
        return session.getProvider(JpaConnectionProvider.class).getEntityManager();
    }

    protected RealmModel getRealm() {
        return session.getContext().getRealm();
    }

    private List<OrganizationRepresentation> listOrganizations() {
        List<HavenOrganization> organizationEntities = getEntityManager()
                .createNamedQuery("findByRealm", HavenOrganization.class).setParameter("realmId", getRealm().getId())
                .getResultList();

        List<OrganizationRepresentation> result = new LinkedList<>();
        for (HavenOrganization entity : organizationEntities) {
            result.add(new OrganizationRepresentation(entity));
        }
        return result;
    }

    @GET
    @Path("")
    @NoCache
    @Produces(MediaType.APPLICATION_JSON)
    public List<OrganizationRepresentation> getOrganizations() {
        return this.listOrganizations();
    }

    @POST
    @Path("")
    @NoCache
    @Consumes(MediaType.APPLICATION_JSON)
    public Response createOrganization(OrganizationRepresentation rep) {
        this.addOrganization(rep);
        return Response.created(session.getContext().getUri().getAbsolutePathBuilder().path(rep.getId()).build())
                .build();
    }

    private OrganizationRepresentation addOrganization(OrganizationRepresentation organization) {
        HavenOrganization entity = new HavenOrganization();
        String id = organization.getId() == null ? KeycloakModelUtils.generateId() : organization.getId();
        entity.setId(id);
        entity.setName(organization.getName());
        entity.setRealmId(getRealm().getId());
        getEntityManager().persist(entity);

        organization.setId(id);
        return organization;
    }

    @GET
    @NoCache
    @Path("{id}")
    @Produces(MediaType.APPLICATION_JSON)
    public OrganizationRepresentation getOrganization(@PathParam("id") final String id) {
        return this.findOrganization(id);
    }

    private OrganizationRepresentation findOrganization(String id) {
        HavenOrganization entity = getEntityManager().find(HavenOrganization.class, id);
        return entity == null ? null : new OrganizationRepresentation(entity);
    }

}


text:
import cv2
from time import sleep

face_cascade = cv2.CascadeClassifier("../data/haarcascade_frontalface_alt2.xml")

video_capture = cv2.VideoCapture(0)

while True:
    if not video_capture.isOpened():
        print('Unable to load camera')
        sleep(1)
        pass

    ret, frame = video_capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(frame, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))

    for (x, y, w, h) in faces:
        cv2.rectangle(frame, (x, y), (x + w, y + h), (255, 0, 0), 2)

    cv2.imshow('Video', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
video_capture.release()
cv2.destroyAllWindows()

# image = cv2.imread("../data/bourne.png")
# gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))
# for (x, y, w, h) in faces:
#     cv2.rectangle(image, (x, y), (x + w, y + h), (255, 0, 0), 2)
#