@private

Returns location.origin or builds it if device doesn't support it.

@method _getOrigin
171152
function () {
        var location = this._location;
        var origin = location.origin;

        // Older browsers, especially IE, don't have origin
        if (!origin) {
          origin = location.protocol + '//' + location.hostname;

          if (location.port) {
            origin += ':' + location.port;
          }
        }

        return origin;
      }
871630
function getEndpoint(origin, locale, path) {
  const validOrigin = Object.prototype.hasOwnProperty.call(endpoints, origin) ? origin : 'us';
  const endpoint = endpoints[validOrigin];

  return Object.assign(
    {},
    { origin: validOrigin },
    { hostname: origin === 'cn' ? endpoint.hostname : getPathHostName(validOrigin, path) },
    { locale: endpoint.locales.find(item => item === locale) || endpoint.defaultLocale },
  );
}
1251702
function isSameOrigin(a, b) {
  var urlA = parseURL(a);
  var urlB = parseURL(b);
  if (!urlA || !urlB) {
    return false;
  }
  if (urlA.origin === urlB.origin) {
    return true;
  }
  if (
    urlA.protocol === urlB.protocol &&
    urlA.hostname === urlB.hostname &&
    urlA.port === urlB.port
  ) {
    return true;
  }
  return false;
}
24939
def on_origin(self, *args):
        """"""
        if self.origin is None:
            Clock.schedule_once(self.on_origin, 0)
            return
        self.origin.bind(
            pos=self._trigger_repoint,
            size=self._trigger_repoint
        )
983356
function makeLocation(req, origin) {
  var protocol = !!req.connection.verifyPeer ? 'https://' : 'http://',
      reqOrigin = origin || (protocol + req.headers.host);
  return url.parse(reqOrigin + req.originalUrl);
}
589012
public function getOrigin($name = null)
    {
        if (is_null($name)) {
            return $this->origin;
        } else {
            return array_key_exists($name, $this->origin) ? $this->origin[$name] : null;
        }
    }
545705
function getLocation(func) {
  const location = { ...func.location };

  // if the function has an identifier, start the block after it so the
  // identifier is included in the "scope" of its parent
  const identifierEnd = get(func, "identifier.loc.end");
  if (identifierEnd) {
    location.start = identifierEnd;
  }

  return location;
}
1059907
function isCrossOriginURL(url) {
  var parts = url.match(REGEXP_ORIGINS);

  return parts && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
}
37901
def origin(self):
        
        libfn = utils.get_lib_fn('getOrigin%s'%self._libsuffix)
        return libfn(self.pointer)
1119059
function isSameOrigin(url) {
    let location = window.location;
    let a = document.createElement('a');

    a.href = url;

    return a.hostname == location.hostname &&
        a.port == location.port &&
        a.protocol == location.protocol;
}
762856
function origin(fn) {
  'use strict';

  exec('git config --local --get remote.origin.url', function (errors, stdout, stderr) {
    var url = "";

    if (errors)  return fn(errors.stack, url);
    if (stderr)  return fn(stderr, url);

    url = trim.call(stdout);
    if (!url) return fn('Unable to find remote origin URL!', url);

    fn(null, url);
  });
}
1171071
function (req) {
                var location = getLocation(req),
                    href = location.origin + location.search;
                return href;
            }
248410
function locate(arg) {
  var newLocale = undefined,
      prop = undefined;
  if (typeof arg === 'string') {
    newLocale = arg === 'zh-cn' ? LOCALE_ZH_CN : LOCALE_EN;
  } else {
    newLocale = arg;
  }
  if (!_curentLocale) {
    _curentLocale = {};
  }
  for (prop in newLocale) {
    if (newLocale.hasOwnProperty(prop) && typeof newLocale[prop] === 'string') {
      _curentLocale[prop] = newLocale[prop];
    }
  }
}
216690
func (i *InteractionRestriction) GetOrigin() string {
	if i == nil || i.Origin == nil {
		return ""
	}
	return *i.Origin
}
385136
private Coordinate getOrigin(HumanInputEvent<?> event) {
		// Get the original location for the lastly selected index:
		if (lastSelection != null) {
			try {
				return service.getIndexService().getVertex(service.getGeometry(), lastSelection);
			} catch (GeometryIndexNotFoundException e) {
			}
		}

		// Backup plan: mouse location.
		return getLocation(event, RenderSpace.SCREEN);
	}
1209966
function setupOriginJS(config){
  const web3Provider = new Web3.providers.HttpProvider(config.web3Url)
  // global
  web3 = new Web3(web3Provider)
  console.log(`Web3 URL: ${config.web3Url}`)

  const ipfsUrl = urllib.parse(config.ipfsUrl)
  // global
  o = new Origin({
    ipfsDomain: ipfsUrl.hostname,
    ipfsGatewayProtocol: ipfsUrl.protocol.replace(':',''),
    ipfsGatewayPort: ipfsUrl.port,
    web3
  })
  console.log(`IPFS URL: ${config.ipfsUrl}`)
}
819021
def get_location(opts=None, provider=None):
    '''
    
    '''
    if opts is None:
        opts = {}
    ret = opts.get('location')
    if ret is None and provider is not None:
        ret = provider.get('location')
    if ret is None:
        ret = get_region_from_metadata()
    if ret is None:
        ret = DEFAULT_LOCATION
    return ret