const CONTAINER_LOCATION = 1;
const CONTAINER_PERSISTENT = 2;
const CONTAINER_WEIGHT = 3;
const CONTAINER_TIMEOUT = 4;
const CONTAINER_ONLINE = 5;
const CONTAINER_CALLBACK = 6;
320573
public function AddContainer($Options) {
      
      $Required = array(
         Gdn_Cache::CONTAINER_LOCATION
      );
      
      $KeyedRequirements = array_fill_keys($Required, 1);
      if (sizeof(array_intersect_key($Options, $KeyedRequirements)) != sizeof($Required)) {
         $Missing = implode(", ",array_keys(array_diff_key($KeyedRequirements,$Options)));
         return $this->Failure("Required parameters not supplied. Missing: {$Missing}");
      }
      
      $CacheLocation = GetValue(Gdn_Cache::CONTAINER_LOCATION,$Options);
      
      // Merge the options array with our local defaults
      $Defaults = array(
         Gdn_Cache::CONTAINER_WEIGHT      => 1
      );
      
      $FinalContainer = array_merge($Defaults, $Options);
      $this->Containers[$CacheLocation] = $FinalContainer;
      $PathInfo = explode(':',$CacheLocation);
      
      $ServerHostname = GetValue(0, $PathInfo);
      $ServerPort = GetValue(1, $PathInfo, 11211);
      
      $AddServerResult = $this->Memcache->addServer(
         $ServerHostname,
         $ServerPort,
         GetValue(Gdn_Cache::CONTAINER_WEIGHT, $FinalContainer, 1)
      );
      
      if (!$AddServerResult) {
         $Callback = GetValue(Gdn_Cache::CONTAINER_CALLBACK, $FinalContainer, NULL);
         if (!is_null($Callback))
            call_user_func($Callback, $ServerHostname, $ServerPort);
         
         return Gdn_Cache::CACHEOP_FAILURE;
      }
      
      return Gdn_Cache::CACHEOP_SUCCESS;
   }
1204795
function checkCondition(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if ((l = checkIdent(i)) && tokens[i].value === 'when') i += l;
  else return 0;

  while (i < tokensLength) {
    if (l = checkBlock(i)) {
      tokens[i].condition_child = 0;
      break;
    } else if (l = checkFunction(i)) tokens[i].condition_child = 1;
    else if (l = checkBrackets(i)) tokens[i].condition_child = 2;
    else if (l = checkParentheses(i)) tokens[i].condition_child = 3;
    else if (l = checkVariable(i)) tokens[i].condition_child = 4;
    else if (l = checkIdent(i)) tokens[i].condition_child = 5;
    else if (l = checkNumber(i)) tokens[i].condition_child = 6;
    else if (l = checkDelim(i)) tokens[i].condition_child = 7;
    else if (l = checkOperator(i)) tokens[i].condition_child = 8;
    else if (l = checkCombinator(i)) tokens[i].condition_child = 9;
    else if (l = checkSC(i)) tokens[i].condition_child = 10;
    else if (l = checkString(i)) tokens[i].condition_child = 11;
    else return 0;

    i += l;
  }

  return i - start;
}
31025
def code_constants(self):
        
        # TODO: remove link register values
        return [const.value for block in self.blocks for const in block.vex.constants]
1009081
function(resource_object) {

		for (var name in resource_object) {
			if (resource_object[name].type == 'container_stack') {

				resource_object[name] = {
					type: 'container',
					value: this._mergeRootContainerStack(resource_object[name].value)
				}

			}
		}

	}
378153
function(cb) {
          docker.listContainers({
            all : 1,
          // filters: '{"status":["running"]}'
          }, function(err, containers) {
            if (err) {
              return cb(err);
            }

            var container = null;

            for (var c = 0; c < containers.length; c++) {
              if (containers[c].Image.indexOf(utils.qualifiedImageName(tag,
                  options.registry, null)) === 0) {
                // If the current container is running or terminated
                if (utils.getContainerStatus(containers[c]) === "RUNNING"
                    || utils.getContainerStatus(containers[c]) === "STOPPED") {
                  container = containers[c];
                  break;
                }
              }
            }

            cb(null, container);
          });
        }
1299189
function(container) {
		var top = container.el.offsetTop;
		var bottom = top+container.el.offsetHeight;
	
		var left = container.el.offsetLeft;
		var right = left+container.el.offsetWidth;
	
		return [
	    	{x : left, y: top},
	    	{x : left, y: bottom},
	    	{x : right, y: top},
	    	{x : right, y: bottom}
		];
   }
1320421
def array_const(self):
        
        self.eat(TokenTypes.LBRACKET)
        node = Array(self.arg_list(TokenTypes.RBRACKET))
        self.eat(TokenTypes.RBRACKET)
        return node
314765
function initContainer(opts) {
    var apps, appDir;

    container = opts.container;

    // if batch, preload that dir
    container === 'batch' ?
        opts.preload.push('batch') :
        opts.preload.push('middleware');

    if (container === 'webserver') {
        appDir = path.join(opts.rootDir, '/app');
        apps = fs.readdirSync(appDir);
        _.each(apps, function (app) {
            opts.preload = opts.preload.concat([
                'app/' + app + '/filters',
                'app/' + app + '/utils'
            ]);
        });
    }

    init(opts);
}
181826
function getCallerLocation() {
    const error = new Error();
    if (error.stack) {
        const lines = error.stack.split("\n");
        for (let i = 2; i < lines.length; i++) {
            if (i > 0 && lines[i] === "    at <anonymous>") {
                const paren = lines[i - 1].indexOf("(");
                if (paren >= 0) {
                    return lines[i - 1].slice(paren + 1, lines[i - 1].length - 1);
                }
                else {
                    return "";
                }
            }
            else if (!lines[i].startsWith("    at CanaryTest.") &&
                !lines[i].startsWith("    at new CanaryTest")) {
                const paren = lines[i].indexOf("(");
                if (paren >= 0) {
                    return lines[i].slice(paren + 1, lines[i].length - 1);
                }
                else {
                    return lines[i].slice(7, lines[i].length);
                }
            }
        }
    }
    return "";
}
447895
function(raw_tag) {

		var container_config = {
				type: 'Element',
				tag_name: raw_tag.name
			};

		if ('attributes' in raw_tag) this._parseContainerStaticAttributes(container_config, raw_tag.attributes);
		if ('x' in raw_tag) this._parseContainerControlAttributes(container_config, raw_tag.x);

		return /** @type {_cElementContainer} */ container_config;

	}
266809
function() {
        canvasWidth = $(window).width();
        canvasHeight = $(window).height();
        if (supportsCanvas) {
          $canvas[0].width = canvasWidth;
          $canvas[0].height = canvasHeight;
        }
        $container.width(canvasWidth);
        $container.height(canvasHeight);
      }
1204203
function offsetContainerProperty(offsetProperty, coordinates, diff) {
  return {
    ...coordinates,
    containerPosition: {
      ...coordinates.containerPosition,
      [offsetProperty]: coordinates.containerPosition[offsetProperty] + diff
    }
  };
}
979655
function (geometry, container) {
            geometry.width = geometry.width || 0;
            geometry.height = geometry.height || 0;
            if (container == this.VIEWPORT) {
                container = this.getViewportSize();
                container.x = container.y = 0;
            }
            container.width = container.width || 0;
            container.height = container.height || 0;
            var left = (geometry.x < container.x) ? container.x : geometry.x;
            var top = (geometry.y < container.y) ? container.y : geometry.y;
            if (geometry.x + geometry.width > container.x + container.width) {
                left = container.x + container.width - geometry.width;
            }
            if (geometry.y + geometry.height > container.y + container.height) {
                top = container.y + container.height - geometry.height;
            }
            return {
                'top' : top,
                'left' : left
            };

        }
233977
function() {
    
   var i;
   var obj = {modules: [], wires: [], properties: null};

   for( i = 0 ; i < this.layer.containers.length ; i++) {
      obj.modules.push( {name: this.layer.containers[i].title, value: this.layer.containers[i].getValue(), config: this.layer.containers[i].getConfig()});
   }

   for( i = 0 ; i < this.layer.wires.length ; i++) {
      var wire = this.layer.wires[i];
		var wireObj = wire.getConfig();
		wireObj.src = {moduleId: WireIt.indexOf(wire.terminal1.container, this.layer.containers), terminal: wire.terminal1.name };
		wireObj.tgt = {moduleId: WireIt.indexOf(wire.terminal2.container, this.layer.containers), terminal: wire.terminal2.name };
      obj.wires.push(wireObj);
   }
   
   obj.properties = this.propertiesForm.getValue();
    
   return {
      name: obj.properties.name,
      working: obj
   };
 }
905616
function() {

		if (_config) {
			if (_config.xhr) {
				if (!(typeof _config.xhr === 'function' || typeof _config.xhr === 'object')) {
					throw ('ContainerConfig.xhr should be a function or an object');
				}
				if (_config.xhr.dataType && typeof _config.xhr.dataType !== 'function') {
					throw ('ContainerConfig.xhr.dataType should be a function');
				}
				if (_config.xhr.type && typeof _config.xhr.type !== 'function') {
					throw ('ContainerConfig.xhr.type should be a function');
				}
				if (_config.xhr.url && typeof _config.xhr.url !== 'function') {
					throw ('ContainerConfig.xhr.url should be a function');
				}
			}
		}

		return true;
	}
827645
function const_lookup_nesting(nesting, name) {
    var i, ii, result, constant;

    if (nesting.length === 0) return;

    // If the nesting is not empty the constant is looked up in its elements
    // and in order. The ancestors of those elements are ignored.
    for (i = 0, ii = nesting.length; i < ii; i++) {
      constant = nesting[i].$$const[name];
      if (constant != null) return constant;
    }
  }
339251
function createContainer(module) {
  var mapStateToProps = function mapStateToProps(state) {
    return state[module.name];
  };
  var mapDispatchToProps = function mapDispatchToProps(dispatch) {
    return Object.keys(module.actions).map(function (key) {
      var action = module.actions[key];
      return dispatch(action());
    });
  };

  var Container = function Container(props) {
    return props.children(props);
  };
  return (0, _reactRedux.connect)(mapStateToProps, module.actions || {})(Container);
}