Creates the Safari data.
164267
private BrowserUsageData getSafariUsageData() {
    BrowserUsageData data = new BrowserUsageData();
    data
        .setBrowserName("Safari");
    data
        .setMarketShare(7.15f);
    ColorReference safariColor = new HighchartsColor(3);
    data
        .setColor(safariColor);
    data
        .getVersionUsageData()
        .add(
            new VersionUsageData("Safari 5.0", 4.55f, safariColor
                .brighten(0.1f)));
    data
        .getVersionUsageData()
        .add(
            new VersionUsageData("Safari 4.0", 1.42f, safariColor
                .brighten(0.2f)));
    data
        .getVersionUsageData()
        .add(
            new VersionUsageData("Safari Win 5.0", 0.23f, safariColor
                .brighten(0.3f)));
    data
        .getVersionUsageData()
        .add(
            new VersionUsageData("Safari 4.1", 0.21f, safariColor
                .brighten(0.4f)));
    data
        .getVersionUsageData()
        .add(
            new VersionUsageData("Safari / Maxthon", 0.20f, safariColor
                .brighten(0.5f)));
    data
        .getVersionUsageData()
        .add(
            new VersionUsageData("Safari 3.1", 0.19f, safariColor
                .brighten(0.6f)));
    data
        .getVersionUsageData()
        .add(
            new VersionUsageData("Safari 4.1", 0.14f, safariColor
                .brighten(0.7f)));
    return data;
  }
367396
def create_html(api_key, attrs):
    ''''''
    gif = get_gif(api_key, attrs['gif_id'])

    if 'alt' not in attrs.keys():
        attrs['alt'] = 'source: {}'.format(gif['data']['source'])

    html_out = '<a href="{}">'.format(gif['data']['url'])
    html_out += '<img src="{}" alt="{}">'.format(
        gif['data']['images']['original']['url'],
        attrs['alt'])
    html_out += '</a>'

    return html_out
663091
function Stylesheet() {
  var styleElement = document.createElement('style'),
    head = document.getElementsByTagName('head')[0];

  head.appendChild(styleElement);

  // Safari does not see the new stylesheet unless you append something.
  // However!  IE will blow chunks, so ... filter it thusly:
  if (!window.createPopup) {
    styleElement.appendChild(document.createTextNode(''));
  }

  this.sheet = document.styleSheets[document.styleSheets.length - 1];
}
126766
def build_html():
    """"""
    source = AjaxDataSource(data_url='./data',
                            polling_interval=INTERVAL,
                            method='GET')

    # OHLC plot
    p = figure(plot_height=400,
               title='OHLC',
               sizing_mode='scale_width',
               tools="xpan,xwheel_zoom,xbox_zoom,reset",
               x_axis_type=None,
               y_axis_location="right",
               y_axis_label="Price ($)")
    p.x_range.follow = "end"
    p.x_range.follow_interval = 100
    p.x_range.range_padding = 0
    p.line(x='time', y='average', alpha=0.25, line_width=3, color='black',
           source=source)
    p.line(x='time', y='ma', alpha=0.8, line_width=2, color='steelblue',
           source=source)
    p.segment(x0='time', y0='low', x1='time', y1='high', line_width=2,
              color='black', source=source)
    p.segment(x0='time', y0='open', x1='time', y1='close', line_width=8,
              color='color', source=source, alpha=0.8)

    # MACD plot
    p2 = figure(plot_height=200,
                title='MACD',
                sizing_mode='scale_width',
                x_range=p.x_range,
                x_axis_label='Time (s)',
                tools="xpan,xwheel_zoom,xbox_zoom,reset",
                y_axis_location="right")
    p2.line(x='time', y='macd', color='darkred', line_width=2, source=source)
    p2.line(x='time', y='macd9', color='navy', line_width=2, source=source)
    p2.segment(x0='time', y0=0, x1='time', y1='macdh', line_width=6, color='steelblue',
               alpha=0.5, source=source)

    # Combine plots together
    plot = gridplot([[p], [p2]], toolbar_location="left", plot_width=1000)

    # Compose html from plots and template
    script, div = components(plot, theme=theme)
    html = template.render(resources=CDN.render(), script=script, div=div)

    return html
269571
private void buildData(String path, WebPage page, List<TreePageData> data, WebSiteRequest req) throws IOException, SQLException {
		if(isVisible(page)) {
			if(path.length()>0) path=path+'/'+page.getShortTitle();
			else path=page.getShortTitle();
			WebPage[] pages=page.getCachedPages(req);
			int len=pages.length;
			data.add(
				new TreePageData(
					len>0 ? (path+'/') : path,
					req.getContextPath()+req.getURL(page),
					page.getDescription()
				)
			);
			for(int c=0; c<len; c++) buildData(path, pages[c], data, req);
		}
	}
168684
def _create_options(self):
        
        def enable(attribute, value=True):
            setattr(self, attribute, value)

            # Return `True`, to be able to chain this in the lambdas below.
            return True

        def disable(attribute):
            setattr(self, attribute, False)
            return True

        def simple_option(title, description, field_name, values=None):
            " Create Simple on/of option. "
            values = values or ['off', 'on']

            def get_current_value():
                return values[bool(getattr(self, field_name))]

            def get_values():
                return {
                    values[1]: lambda: enable(field_name),
                    values[0]: lambda: disable(field_name),
                }

            return Option(title=title, description=description,
                          get_values=get_values,
                          get_current_value=get_current_value)

        brightness_values = [1.0 / 20 * value for value in range(0, 21)]

        return [
            OptionCategory('Input', [
                simple_option(title='Editing mode',
                              description='Vi or emacs key bindings.',
                              field_name='vi_mode',
                              values=[EditingMode.EMACS, EditingMode.VI]),
                simple_option(title='Paste mode',
                              description="When enabled, don't indent automatically.",
                              field_name='paste_mode'),
                Option(title='Complete while typing',
                       description="Generate autocompletions automatically while typing. "
                                   'Don\'t require pressing TAB. (Not compatible with "History search".)',
                       get_current_value=lambda: ['off', 'on'][self.complete_while_typing],
                       get_values=lambda: {
                           'on': lambda: enable('complete_while_typing') and disable('enable_history_search'),
                           'off': lambda: disable('complete_while_typing'),
                       }),
                Option(title='History search',
                       description='When pressing the up-arrow, filter the history on input starting '
                                   'with the current text. (Not compatible with "Complete while typing".)',
                       get_current_value=lambda: ['off', 'on'][self.enable_history_search],
                       get_values=lambda: {
                           'on': lambda: enable('enable_history_search') and disable('complete_while_typing'),
                           'off': lambda: disable('enable_history_search'),
                       }),
                simple_option(title='Mouse support',
                              description='Respond to mouse clicks and scrolling for positioning the cursor, '
                                          'selecting text and scrolling through windows.',
                              field_name='enable_mouse_support'),
                simple_option(title='Confirm on exit',
                              description='Require confirmation when exiting.',
                              field_name='confirm_exit'),
                simple_option(title='Input validation',
                              description='In case of syntax errors, move the cursor to the error '
                                          'instead of showing a traceback of a SyntaxError.',
                              field_name='enable_input_validation'),
                simple_option(title='Auto suggestion',
                              description='Auto suggest inputs by looking at the history. '
                                          'Pressing right arrow or Ctrl-E will complete the entry.',
                              field_name='enable_auto_suggest'),
                Option(title='Accept input on enter',
                       description='Amount of ENTER presses required to execute input when the cursor '
                                   'is at the end of the input. (Note that META+ENTER will always execute.)',
                       get_current_value=lambda: str(self.accept_input_on_enter or 'meta-enter'),
                       get_values=lambda: {
                           '2': lambda: enable('accept_input_on_enter', 2),
                           '3': lambda: enable('accept_input_on_enter', 3),
                           '4': lambda: enable('accept_input_on_enter', 4),
                           'meta-enter': lambda: enable('accept_input_on_enter', None),
                       }),
            ]),
            OptionCategory('Display', [
                Option(title='Completions',
                       description='Visualisation to use for displaying the completions. (Multiple columns, one column, a toolbar or nothing.)',
                       get_current_value=lambda: self.completion_visualisation,
                       get_values=lambda: {
                           CompletionVisualisation.NONE: lambda: enable('completion_visualisation', CompletionVisualisation.NONE),
                           CompletionVisualisation.POP_UP: lambda: enable('completion_visualisation', CompletionVisualisation.POP_UP),
                           CompletionVisualisation.MULTI_COLUMN: lambda: enable('completion_visualisation', CompletionVisualisation.MULTI_COLUMN),
                           CompletionVisualisation.TOOLBAR: lambda: enable('completion_visualisation', CompletionVisualisation.TOOLBAR),
                       }),
                Option(title='Prompt',
                       description="Visualisation of the prompt. ('>>>' or 'In [1]:')",
                       get_current_value=lambda: self.prompt_style,
                       get_values=lambda: dict((s, partial(enable, 'prompt_style', s)) for s in self.all_prompt_styles)),
                simple_option(title='Blank line after output',
                              description='Insert a blank line after the output.',
                              field_name='insert_blank_line_after_output'),
                simple_option(title='Show signature',
                              description='Display function signatures.',
                              field_name='show_signature'),
                simple_option(title='Show docstring',
                              description='Display function docstrings.',
                              field_name='show_docstring'),
                simple_option(title='Show line numbers',
                              description='Show line numbers when the input consists of multiple lines.',
                              field_name='show_line_numbers'),
                simple_option(title='Show Meta+Enter message',
                              description='Show the [Meta+Enter] message when this key combination is required to execute commands. ' +
                                  '(This is the case when a simple [Enter] key press will insert a newline.',
                              field_name='show_meta_enter_message'),
                simple_option(title='Wrap lines',
                              description='Wrap lines instead of scrolling horizontally.',
                              field_name='wrap_lines'),
                simple_option(title='Show status bar',
                              description='Show the status bar at the bottom of the terminal.',
                              field_name='show_status_bar'),
                simple_option(title='Show sidebar help',
                              description='When the sidebar is visible, also show this help text.',
                              field_name='show_sidebar_help'),
                simple_option(title='Highlight parenthesis',
                              description='Highlight matching parenthesis, when the cursor is on or right after one.',
                              field_name='highlight_matching_parenthesis'),
            ]),
            OptionCategory('Colors', [
                simple_option(title='Syntax highlighting',
                              description='Use colors for syntax highligthing',
                              field_name='enable_syntax_highlighting'),
                simple_option(title='Swap light/dark colors',
                              description='Swap light and dark colors.',
                              field_name='swap_light_and_dark'),
                Option(title='Code',
                       description='Color scheme to use for the Python code.',
                       get_current_value=lambda: self._current_code_style_name,
                       get_values=lambda: dict(
                            (name, partial(self.use_code_colorscheme, name)) for name in self.code_styles)
                       ),
                Option(title='User interface',
                       description='Color scheme to use for the user interface.',
                       get_current_value=lambda: self._current_ui_style_name,
                       get_values=lambda: dict(
                            (name, partial(self.use_ui_colorscheme, name)) for name in self.ui_styles)
                       ),
                Option(title='Color depth',
                       description='Monochrome (1 bit), 16 ANSI colors (4 bit),\n256 colors (8 bit), or 24 bit.',
                       get_current_value=lambda: COLOR_DEPTHS[self.color_depth],
                       get_values=lambda: dict(
                           (name, partial(self._use_color_depth, depth)) for depth, name in COLOR_DEPTHS.items())
                       ),
                Option(title='Min brightness',
                       description='Minimum brightness for the color scheme (default=0.0).',
                       get_current_value=lambda: '%.2f' % self.min_brightness,
                       get_values=lambda: dict(
                           ('%.2f' % value, partial(self._set_min_brightness, value))
                            for value in brightness_values)
                       ),
                Option(title='Max brightness',
                       description='Maximum brightness for the color scheme (default=1.0).',
                       get_current_value=lambda: '%.2f' % self.max_brightness,
                       get_values=lambda: dict(
                           ('%.2f' % value, partial(self._set_max_brightness, value))
                            for value in brightness_values)
                       ),
            ]),
        ]
910895
def create(self, data={}, **kwargs):
        "
        url = self.base_url
        return self.post_url(url, data, **kwargs)
287604
def generate_html(attrs, api_key):
    '''  '''
    # getting flickr api data
    flickr_data = get_info(attrs['photo_id'], api_key)

    # if size is not defined it will use large as image size
    if 'size' not in attrs.keys():
        attrs['size'] = 'large'

    # if no alt is defined it will use the flickr image title
    if 'alt' not in attrs.keys():
        attrs['alt'] = flickr_data['photo']['title']['_content']

    # return final html code
    return '<a href="{}"><img src="{}" alt="{}"></a>'.format(
        flickr_data['photo']['urls']['url'][0]['_content'],
        source_url(flickr_data['photo']['farm'],
                   flickr_data['photo']['server'],
                   attrs['photo_id'],
                   flickr_data['photo']['secret'],
                   attrs['size']),
        attrs['alt'])
1170710
def create(self, data, *args, **kwargs):
        
        super(MambuUser, self).create(data)
        self['user'][self.customFieldName] = self['customInformation']
        self.init(attrs=self['user'])
11847
def create_widget(self):
        
        d = self.declaration
        self.widget = WebView(self.get_context(), None, d.style)
594020
private void createDataFile() throws IOException {
        // temporary data file for storage of stream data
        Path path = Paths.get(filePath + ".ser");
        if (Files.deleteIfExists(path)) {
            log.debug("Previous flv data file existed and was removed");
        }
        this.dataChannel = Files.newByteChannel(path, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE, StandardOpenOption.READ);
    }
701406
public function create() {
        if ($this->overrideAction('create')) {
            return;
        }

        $this->AdminToolbar->setBelongsToData($this->Model);
        $this->AdminToolbar->setHabtmData($this->Model);

        if ($this->request->is('post')) {
            $data = $this->AdminToolbar->getRequestData();
            $this->Model->create();

            if ($this->Model->saveAll($data, array('validate' => 'first', 'atomic' => true, 'deep' => true))) {
                $this->Model->set($data);
                $this->AdminToolbar->logAction(ActionLog::CREATE, $this->Model, $this->Model->id);

                $this->AdminToolbar->setFlashMessage(__d('admin', 'Successfully created a new %s', mb_strtolower($this->Model->singularName)));
                $this->AdminToolbar->redirectAfter($this->Model);

            } else {
                $this->AdminToolbar->setFlashMessage(__d('admin', 'Failed to create a new %s', mb_strtolower($this->Model->singularName)), 'is-error');
            }
        }

        $this->overrideView('create');
    }
912875
function()
	{
		this.anchor = this.view.env.document.createTextNode('');
		var el = this.view.element;

		if(el.parentNode)
		{
			el.parentNode.insertBefore(this.anchor, el.nextSibling);
			el.parentNode.removeChild(el);
		}

		this.boundViews = [];

		// Boundview options:
		this.boundViewName = this.view.element.getAttribute(settings.DATA_VIEW_ATTR);
		var opt = this.view.element.getAttribute(settings.DATA_OPTIONS_ATTR);

		this.boundViewOptions = opt ? JSON.parse(opt) : {};
		this.boundViewOptions.parentView = this.view;
		this.boundViewOptions.env = this.view.env;
		this.boundViewOptions.isBoundView = true;

		this.refreshBoundViews();
	}
146615
public static HTML createApplet (String ident, String archive, String clazz, int width,
                                     int height, boolean mayScript, String[] params)
    {
        return createApplet(ident, archive, clazz, ""+width, ""+height, mayScript, params);
    }
461140
public static HTML createApplet (String ident, String archive, String clazz, String width,
                                     String height, boolean mayScript, String[] params)
    {
        String ptags = "";
        for (int ii = 0; ii < params.length; ii += 2) {
            ptags = ptags + "<param name=\"" + params[ii] + "\" " + "value=\"" + params[ii+1] +
                "\"/>";
        }
        return _impl.createApplet(ident, archive, clazz, width, height, mayScript, ptags);
    }
858745
public void createWebElementAndAddInList(String webData, WebView webView){

		WebElement webElement = createWebElementAndSetLocation(webData, webView);

		if((webElement!=null)) 
			webElements.add(webElement);
	}
933115
def generate(self, url, browsers=None, orientation=None, mac_res=None, win_res=None,
                             quality=None, local=None, wait_time=None, callback_url=None):
        
        if isinstance(browsers, dict):
            browsers = [browsers]
        if browsers is None:
            browsers = [self.default_browser]
        data = dict((key, value) for key, value in locals().items() if value is not None and key != 'self')
        return self.execute('POST', '/screenshots', json=data)