Initialize transform url if it doesnt exist
487820
protected function initTransformUrl()
    {
        if (!$this->transform_url) {
            // security in a different format for transformations
            $security_str = $this->security ?
                sprintf('/security=policy:%s,signature:%s',
                    $this->security->policy,
                    $this->security->signature
                ) : '';

            $this->transform_url = sprintf(FilestackConfig::CDN_URL . '%s/%s',
                $security_str,
                $this->handle);
        }
    }
945891
def _before_initialize(self, location, **kwargs):
        
        url = kwargs.get('url', '')
        if url.lower() == 'localhost':
            self.url = 'http://localhost/nominatim/search'
        elif url:
            self.url = url
369086
function initRepeaterActions () {
		var loadDelays = ['300', '600', '900', '1200'];

		var sort = function (data, sortProperty, sortDirection) {
			var sortedData = _.sortBy(data, function (item) {
				return item[sortProperty];
			});

			// sort direction
			if (sortDirection === 'desc') {
				sortedData = sortedData.reverse();
			}

			return sortedData;
		};

		function getSampleDataSet (options, callback) {
			var resp = {
				count: data.repeater.listData.length,
				items: [],
				page: options.pageIndex
			};

			// get start and end limits for JSON
			var i, l;
			resp.pages = Math.ceil(resp.count / (options.pageSize || 50));

			i = options.pageIndex * (options.pageSize || 50);
			l = i + (options.pageSize || 50);
			l = (l <= resp.count) ? l : resp.count;
			resp.start = i + 1;
			resp.end = l;

			// setup columns for list view
			resp.columns = [
				{
					label: 'Common Name',
					property: 'commonName',
					sortable: true
				},
				{
					label: 'Latin Name',
					property: 'latinName',
					sortable: true
				},
				{
					label: 'Appearance',
					property: 'appearance',
					sortable: true
				},
				{
					label: 'Sound',
					property: 'sound',
					sortable: true
				}
			];

			// add sample items to datasource
			for (i; i < l; i++) {
				// from data.js
				resp.items.push(data.repeater.listData[i]);
			}

			resp.items = sort(resp.items, options.sortProperty, options.sortDirection);

			// call and simulate latency
			setTimeout(function () {
				callback(resp);
			}, loadDelays[Math.floor(Math.random() * 4)]);

		}

		// initialize the repeater
		var repeaterActions = $('#myRepeaterActions');
		repeaterActions.repeater({
			list_noItemsHTML: '<span>foo</span>',
			list_highlightSortedColumn: true,
			list_selectable: 'multi',
			list_actions: {
				width: 37,
				items: [
					{
						name: 'edit',
						html: '<span class="glyphicon glyphicon-pencil"></span> Edit'
					},
					{
						name: 'copy',
						html: '<span class="glyphicon glyphicon-copy"></span> Copy'
					},
					{
						name: 'delete',
						html: '<span class="glyphicon glyphicon-trash"></span> Delete',
						clickAction: function (helpers, callback, e) {
							console.log('hey it worked');
							console.log(helpers);
							e.preventDefault();
							callback();
						}
					}
				]
			},
			// setup your custom datasource to handle data retrieval;
			// responsible for any paging, sorting, filtering, searching logic
			dataSource: getSampleDataSet
		});
	}
816393
static BindTransform getNetTransform(TypeName typeName) {
		if (URL.class.getName().equals(typeName.toString())) {
			return new UrlBindTransform();
		}

		return null;
	}
1337952
function (callback, initialHash) {

            var self = this,
                fragment;

            this.$checkUrlFn = function () {
                self.checkUrl.apply(self, arguments);
            };

            if (this.runsInBrowser()) {
                // we're in a browser

                if (this.$.useState) {

                    fragment = window.location.pathname;
                    fragment = fragment.replace(new RegExp("^" + (this.$.baseUrl || "")), "");

                    if (window.addEventListener) {
                        window.addEventListener('popstate', this.$checkUrlFn, false);
                    } else {
                        window.attachEvent('onpopstate', this.$checkUrlFn);
                    }

                } else {

                    if ("onhashchange" in window) {
                        if (window.addEventListener) {
                            window.addEventListener('hashchange', this.$checkUrlFn, false);
                        } else {
                            window.attachEvent('onhashchange', this.$checkUrlFn);
                        }
                    } else {
                        // polling
                        this.$checkUrlInterval = setInterval(this.$checkUrlFn, this.$.interval);
                    }
                }


            } else {
                // rendering on node
                this.$history.push(initialHash || "");
            }

            fragment = fragment || this._getFragment();

            this.navigate(fragment, false, true, true, callback);
            this.$processUrl = true;
        }
1298017
function getTransform(options) {
  if (typeof options === 'string' || options instanceof String) {
    return options
  }

  if (typeof options === 'object' && options.engine) {
    return options.engine
  }

  throw new Error('options.engine not found.')
}
215961
private CmsUUID maybeReplaceFormatter(CmsUUID formatterId) {

        if (m_customReplacements != null) {
            CmsUUID replacement = m_customReplacements.get(formatterId);
            if (replacement != null) {
                return replacement;
            }
        }
        return formatterId;
    }
385431
def check_url_does_not_exists(form, field):
    ''''''
    if field.data != field.object_data and Reuse.url_exists(field.data):
        raise validators.ValidationError(_('This URL is already registered'))
661738
def __init_url(self):
        """"""
        portals_self_url = "{}/portals/self".format(self._url)
        params = {
            "f" :"json"
        }
        if not self._securityHandler is None:
            params['token'] = self._securityHandler.token
        res = self._get(url=portals_self_url,
                           param_dict=params,
                           securityHandler=self._securityHandler,
                           proxy_url=self._proxy_url,
                           proxy_port=self._proxy_port)
        if "helperServices" in res:
            helper_services = res.get("helperServices")
            if "hydrology" in helper_services:
                analysis_service = helper_services.get("elevation")
                if "url" in analysis_service:
                    self._analysis_url = analysis_service.get("url")
        self._gpService = GPService(url=self._analysis_url,
                                    securityHandler=self._securityHandler,
                                    proxy_url=self._proxy_url,
                                    proxy_port=self._proxy_port,
                                    initialize=False)
758087
function getExpandedUrl(url, options) {
	var x = 0,
		i;
	if (options.urls) {
		i = options.urls.length;
		while (x < i) {
			if (options.urls[x].match === url) {
				if (options.urls[x].expanded) {
					return options.urls[x].expanded;
				}
				return null;
			}
			x++;
		}
	}
	return null;
}
816671
function(imageUrl, callback) {
        var url = imageUrl.clone(),
            extension = url.getExtension(),
            imageId = url.getImageIdentifier(),
            host = this.getHostForImageIdentifier(imageId);

        var data = {
            imageIdentifier: imageId,
            user: url.getUser(),
            publicKey: url.getPublicKey(),
            query: url.getQueryString()
        };

        if (extension) {
            data.extension = extension;
        }

        // Reset to remove transformations/query string
        url.reset().setPath('/shorturls');

        request({
            method: 'POST',
            uri: this.getSignedResourceUrl('POST', url.toString()),
            json: data,
            onComplete: function(err, res, body) {
                if (err) {
                    return callback(err);
                } else if (!body || !body.id) {
                    return callback('No ShortUrl was returned from server');
                }

                callback(err, new ShortUrl({ baseUrl: host, id: body.id }));
            }
        });

        return this;
    }
1065357
def assert_transform_exists(cli, transform_path):
    
    result = commands.query_transform_exists(cli, transform_path)
    assert result is True
    return result
983528
def _handle_actiongeturl(self, _):
        """"""
        obj = _make_object("ActionGetURL")
        obj.UrlString = self._get_struct_string()
        obj.TargetString = self._get_struct_string()
        yield obj
1045452
function(id, file, url, fm) {
				initImgTag.call(this, id, file, fm.convAbsUrl(url), fm);
			}
1057325
public void init( String baseUrl, XRPCBatchRequestSender callback )
	{
		this.url = baseUrl + "&locale=" + LocaleInfo.getCurrentLocale().getLocaleName();
		this.callback = callback;
	}
539383
def FinalizeTransferUrl(self, url):
        """"""
        url_builder = _UrlBuilder.FromUrl(url)
        if self.global_params.key:
            url_builder.query_params['key'] = self.global_params.key
        return url_builder.url
704939
static PrefsTransform getNetTransform(TypeName typeName) {
		if (URL.class.getName().equals(typeName.toString())) {
			return new UrlPrefsTransform();
		}

		return null;
	}