\
    Returns if the origin is Canada.

    `origin`
        The origin to check.
554858
def origin_canada(origin):
    
    return origin in (
    u'CALGARY', u'HALIFAX', u'MONTREAL', u'QUEBEC', u'OTTAWA', u'TORONTO',
    u'VANCOUVER')
690967
def origin(self):
        
        # TODO: add a keyword-only option for keeping user/pass maybe?
        if not self.is_absolute():
            raise ValueError("URL should be absolute")
        if not self._val.scheme:
            raise ValueError("URL should have scheme")
        v = self._val
        netloc = self._make_netloc(None, None, v.hostname, v.port, encode=False)
        val = v._replace(netloc=netloc, path="", query="", fragment="")
        return URL(val, encoded=True)
99335
def compute_origin
      return nil if move.castle

      possibilities = case move.piece
      when /[brq]/i then direction_origins
      when /[kn]/i  then move_origins
      when /p/i     then pawn_origins
      end

      if possibilities.length > 1
        possibilities = disambiguate(possibilities)
      end

      self.board.position_for(possibilities.first)
    end
916097
def _set_country(self, c):
        

        self.location.countrycode = c.split()[0].split('=')[1].strip().upper()
1133065
private String checkOriginHeader(HttpServletRequest request, JCorsConfig config) {

		String originHeader = request.getHeader(CorsHeaders.ORIGIN_HEADER);
		Constraint.ensureNotEmpty(originHeader, "Cross-Origin requests must specify an Origin Header");

		String[] origins = originHeader.split(" ");

		for (String origin : origins) {
			Constraint.ensureTrue(config.isOriginAllowed(origin), String.format("The specified origin is not allowed: '%s'", origin));
		}

		return originHeader;
	}
637900
def set_origin(self, origin=None):
        """"""
        if origin:
            self._origin = origin.encode()
        else:
            self._origin = None
1119084
def origin_iraq(origin):
    
    return origin == u'BAGHDAD' \
           or u'BASRAH' in origin \
           or u'HILLAH' in origin \
           or u'KIRKUK' in origin \
           or u'MOSUL' in origin
1088660
public static function getOrigin() {
		$headers = getallheaders ();
		if (isset ( $headers ['Origin'] )) {
			return $headers ['Origin'];
		}
		if (isset ( $_SERVER ['HTTP_ORIGIN'] )) {
			return $_SERVER ['HTTP_ORIGIN'];
		} else if (isset ( $_SERVER ['HTTP_REFERER'] )) {
			return $_SERVER ['HTTP_REFERER'];
		} else {
			return $_SERVER ['REMOTE_ADDR'];
		}
	}
1300216
def origin=(new_origin)
      if new_origin
        if !new_origin.respond_to?(:to_str)
          raise TypeError, "Can't convert #{new_origin.class} into String."
        end
        new_origin = new_origin.to_str
        new_scheme = new_origin[/^([^:\/?#]+):\/\//, 1]
        unless new_scheme
          raise InvalidURIError, 'An origin cannot omit the scheme.'
        end
        new_host = new_origin[/:\/\/([^\/?#:]+)/, 1]
        unless new_host
          raise InvalidURIError, 'An origin cannot omit the host.'
        end
        new_port = new_origin[/:([^:@\[\]\/]*?)$/, 1]
      end

      self.scheme = defined?(new_scheme) ? new_scheme : nil
      self.host = defined?(new_host) ? new_host : nil
      self.port = defined?(new_port) ? new_port : nil
      self.userinfo = nil

      # Reset dependent values
      remove_instance_variable(:@userinfo) if defined?(@userinfo)
      remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo)
      remove_instance_variable(:@authority) if defined?(@authority)
      remove_instance_variable(:@normalized_authority) if defined?(@normalized_authority)
      remove_composite_values

      # Ensure we haven't created an invalid URI
      validate()
    end
1017916
public static boolean checkOrigin(ServerEndpointConfig config, WebSocketHttpExchange exchange) {
        ServerEndpointConfig.Configurator c = config.getConfigurator();
        return c.checkOrigin(exchange.getRequestHeader(Headers.ORIGIN_STRING));
    }
1067457
def origin(self):
        
        entry = self._proto.commandQueueEntry
        if entry.cmdId.HasField('origin'):
            return entry.cmdId.origin
        return None
134159
public Point getOrigin() {
        if (this.origin == null) {
            double x = MercatorProjection.tileToPixel(this.tileX, this.tileSize);
            double y = MercatorProjection.tileToPixel(this.tileY, this.tileSize);
            this.origin = new Point(x, y);
        }
        return this.origin;
    }
516288
def origin(self):
        
        with self.selenium.context(self.selenium.CONTEXT_CHROME):
            return self.root.get_attribute("origin")
766295
function( origin, original ) {
		var y, x;
		switch ( origin[ 0 ] ) {
			case "top": y = 0; break;
			case "middle": y = 0.5; break;
			case "bottom": y = 1; break;
			default: y = origin[ 0 ] / original.height;
		}
		switch ( origin[ 1 ] ) {
			case "left": x = 0; break;
			case "center": x = 0.5; break;
			case "right": x = 1; break;
			default: x = origin[ 1 ] / original.width;
		}
		return {
			x: x,
			y: y
		};
	}
1125421
private function origins()
    {
        if(array_has($_SERVER, 'HTTP_ORIGIN')){
            foreach (config('cors.origins') as $origin) {
                if ($_SERVER['HTTP_ORIGIN'] == $origin) {
                    header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
                    break;
                }
            }

            if(config('cors.origins') == ['*']){
                header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
            }
        }


        if(!array_has($_SERVER, 'HTTP_ORIGIN') &&
            env('APP_ENV') != 'local' &&
            config('cors.local') != 'true' &&
            config('cors.internal') == false){

            abort(403);
        }
    }
1174490
protected function validateOrigin($origin, $allowedOrigins)
    {
        if (empty($allowedOrigins) || empty($origin)) {
            return false;
        }
        foreach ($allowedOrigins as $allowedOrigin) {
            if ($allowedOrigin === '*') {
                return true;
            }
            if (strcasecmp($allowedOrigin, $origin) === 0) {
                return true;
            }
        }
        return false;
    }
1236314
def _check(sample, data):
    """"""
    if dd.get_chip_method(sample).lower() == "atac":
        return [sample]
    if dd.get_phenotype(sample) == "input":
        return None
    for origin in data:
        if dd.get_batch(sample) in (dd.get_batches(origin[0]) or []) and dd.get_phenotype(origin[0]) == "input":
            sample["work_bam_input"] = origin[0].get("work_bam")
            return [sample]
    return [sample]