return a new manager with the blocks
559665
def combine(self, blocks, copy=True):
        
        if len(blocks) == 0:
            return self.make_empty()

        # FIXME: optimization potential
        indexer = np.sort(np.concatenate([b.mgr_locs.as_array
                                          for b in blocks]))
        inv_indexer = lib.get_reverse_indexer(indexer, self.shape[0])

        new_blocks = []
        for b in blocks:
            b = b.copy(deep=copy)
            b.mgr_locs = algos.take_1d(inv_indexer, b.mgr_locs.as_array,
                                       axis=0, allow_fill=False)
            new_blocks.append(b)

        axes = list(self.axes)
        axes[0] = self.items.take(indexer)

        return self.__class__(new_blocks, axes, do_integrity_check=False)
160506
def update(self, old_line, new_line, once=False):
        
        nb = 0
        for block in self.blocks:
            nb += block.update(old_line, new_line, once=once)
            if nb and once:
                return nb
        return nb
809516
def enter_block(self, name):
        """"""
        section = self._get_section(name)
        block = self.current_block = section.new_block()
        self.blocks.append(block)
        return block
1017486
def _create(cls, model_class, *args, **kwargs):
        """"""
        if cls._meta.django_get_or_create:
            return cls._get_or_create(model_class, *args, **kwargs)

        manager = cls._get_manager(model_class)
        return manager.create(*args, **kwargs)
169865
function Manager (remote) {

	/** Allow usage without `new`. */
	if (!(this instanceof Manager)) {
		return new Manager(remote);
	}

	/**
	 * @property {Boolean} isRemote
	 * Whether the manager is remote.
	 */
	this.isRemote = false;

	/**
	 * @property {Socket} socket
	 * A socket.io instance, or `null` if using locally.
	 */
	this.socket = null;

	/** If only using locally, stop here. */
	if (!remote) {
		return this;
	}

	/** If it's a URL, connect to it. */
	if (typeof remote === 'string') {
		this.isRemote = true;

		/** Automatically postfix the manager scope. */
		var url = remote + '/panic-manager';

		/** Connect to the remote manager. */
		this.socket = socket.client(url);

		return this;
	}

	/** Listen for /panic-manager connections. */
	var server = socket.server(remote).of('/panic-manager');

	/** Listen for connections. */
	server.on('connection', function (socket) {

		/** Listen for start commands. */
		socket.on('start', function (config) {
			spawn(config);
		});

	});

	this.socket = server;

}
1077990
def block_by_command(cls, command):
        
        for block in cls.blocks:
            if block.has_command(command):
                return block
729428
def add_block(self, name):
        

        if not self.RE_NAME.match(name):
            raise ValueError(u"Invalid block name '{0}'"
                             .format(common.from_utf8(name)))

        if name in self._block_map:
            raise ValueError(u"Block '{0}' already exists"
                             .format(common.from_utf8(name)))

        # add new block and index mapping
        self._block_map[name] = len(self._ast[2])  # must come first
        option_list = []
        block = [name, option_list]
        self._ast[2].append(block)
974261
def manager(self, obj):
        """"""
        manager = getattr(obj, _MANAGER_ATTR, None)
        if manager is None:
            manager = AttachmentsManager()
            setattr(obj.__class__, _MANAGER_ATTR, manager)

        return manager
19012
def put(self):
        
        return self.manager.put(
            id=self.id,
            name=self.name,
            description=self.description,
            whitelisted_container_task_types=(
                self.whitelisted_container_task_types
            ),
            whitelisted_executable_task_types=(
                self.whitelisted_executable_task_types
            ),
        )
937436
def _consolidate(blocks):
    

    # sort by _can_consolidate, dtype
    gkey = lambda x: x._consolidate_key
    grouper = itertools.groupby(sorted(blocks, key=gkey), gkey)

    new_blocks = []
    for (_can_consolidate, dtype), group_blocks in grouper:
        merged_blocks = _merge_blocks(list(group_blocks), dtype=dtype,
                                      _can_consolidate=_can_consolidate)
        new_blocks = _extend_blocks(merged_blocks, new_blocks)
    return new_blocks
388780
def mine_block(self, *args: Any, **kwargs: Any) -> BaseBlock:
        
        mined_block = self.get_vm(self.header).mine_block(*args, **kwargs)

        self.validate_block(mined_block)

        self.chaindb.persist_block(mined_block)
        self.header = self.create_header_from_parent(mined_block.header)
        return mined_block
419419
def _fetch_new(&client_block)
      if (@never_block || (_total_current_size < @max_size))
        if client_block.arity == 0
          nc = yield
        else
          nc = yield @sessions_key
        end
        HotTub.logger.info "[HotTub] Adding client: #{nc.class.name} to #{@name}." if HotTub.log_trace?
        nc
      end
    end
1338999
private long addBlock(Block block, List<BlockWithLocations> results) {
    ArrayList<String> machineSet =
      new ArrayList<String>(blocksMap.numNodes(block));
    for (Iterator<DatanodeDescriptor> it =
      blocksMap.nodeIterator(block); it.hasNext();) {
      String storageID = it.next().getStorageID();
      // filter invalidate replicas
      LightWeightHashSet<Block> blocks = recentInvalidateSets.get(storageID);
      if (blocks == null || !blocks.contains(block)) {
        machineSet.add(storageID);
      }
    }
    if (machineSet.size() == 0) {
      return 0;
    } else {
      results.add(new BlockWithLocations(block,
        machineSet.toArray(new String[machineSet.size()])));
      return block.getNumBytes();
    }
  }
471993
function reRunBlock(block, index, callback){
  growing:
  for(var i=index; i<block.length; i++){ //iterate over the block [body, header, etck] *
    var code=block[i].substr(0,2);//                                            |      |
    if (code=== ">>") {//The only tag  by deffault                         |    |      |
      printBrand(block[i]);//                                              |    |      |
    /*  if(block[i].substr(2)==="default"){                                |    |      |
        if(callback) callback();// // fixes the bug of last element        |    |      |
        else recallback();//                                               |    v      |
      }//                                                                  |           |
   */ //                                                                   v           |
    }//                                                                                |
    for(var ii=0; ii<taggies.length;ii++){//                                           |
        //match user taggies and control if there are some seeds  so executes... *     |
        if(taggies[ii].code === code){//                                         |     |
          if (code[0]==="x") {//user lib needs all control-->callback-mode       |     |
            interf=true;//                                                       |     |
            interfPath="../"+taggies[ii].path+"/index.js";//                     |     |
            indexb=i+1;//                                                        |     |
            scionBlock=block;//                                                  |     |
            scionName= block[i];//                                               |     |
            break growing;//  BREAK THE TWO LOOPS                                |     |
          }//if there are no seeds then, executes next                    |      |     |
           var audreySeed= require("../"+taggies[ii].path+"/index.js");// |      |     |
           var seed= audreySeed();//                                      |      |     |
           var callbackname=block[i];//                                   |      |     |
           seed.grow(callbackname, terminal);//                           V      |     |
        }//                                                                      |     |
    }//                                                                          |     |
   //if it's the last element, callback                                          |     |
     if(i===block.length-1){ //                                    |             |     |
              if(callback) callback();//                           |             |     |
              else recallback();//if it's other                    v             |     |
        }//                                                                      v     |
  }//                                                                                  v
  if(interf){//if the element was a seed then executes interface
    interf=undefined;
    recallback= callback;
    runInterf(block);
  }

}
1186135
def create(blocks, mode='basic', inplanes=16, divisor=4, num_classes=1000):
    
    block_dict = {
        'basic': BasicBlock,
        'bottleneck': Bottleneck
    }

    def instantiate(**_):
        return ResNetV2(block_dict[mode], blocks, inplanes=inplanes, divisor=divisor, num_classes=num_classes)

    return ModelFactory.generic(instantiate)
1178855
def manager(self):
        
        manager = SMCRequest._session_manager if not self._manager \
            else self._manager
        if not manager:
            raise SessionManagerNotFound('A session manager was not found. '
                'This is an initialization error binding the SessionManager. ')
        return manager
696619
def construct_xblock(self, block_type, scope_ids, field_data=None, *args, **kwargs):
        
        """
        return self.construct_xblock_from_class(
            cls=self.load_block_type(block_type),
            scope_ids=scope_ids,
            field_data=field_data,
            *args, **kwargs
        )