Create new instance from a hash of properties with values.
 @param [Object] frame The CGRect or a Hash of properties.
490993
def initWithFrame(properties={})
      if properties.is_a? Hash
        # Set the initial property values from the given hash
        super(CGRect.new)
        initialize_bindings
        set_properties(properties)
      else
        super(properties)
      end
      view_setup
      
      self
    end
28795
public function build(): GetFrameOwnerRequest
	{
		$instance = new GetFrameOwnerRequest();
		if ($this->frameId === null) {
			throw new BuilderException('Property [frameId] is required.');
		}
		$instance->frameId = $this->frameId;
		return $instance;
	}
149143
def add_to_initial_stack(self, frame):
    """"""
    if not self._setable_initial_frames:
      raise ValueError(
          "This instance does not allow to manually set initial frame stack.")
    assert_msg = "{}, {}".format(frame.shape, self._initial_frames.shape[:1])
    assert frame.shape == self._initial_frames.shape[2:], assert_msg
    initial_frames = np.roll(self._initial_frames, shift=-1, axis=1)
    initial_frames[0, -1, ...] = frame
    self._initial_frames = initial_frames
305166
public function addFrame(Frame $frame)
    {
        $tmpFrame = clone $frame;
        $tmpFrame->resize($this->width, $this->height);
        ob_start();
        imagegif($tmpFrame->toGDImage());
        $this->frames[] = ob_get_clean();
        $tmpFrame = null;
    }
34903
function() {
        var factory = this.viewFactory;

        this._addChildren([
            factory.createFrame(frameConst.L),
            factory.createFrame(frameConst.R)
        ]);
    }
789726
def update_frame(self, key, ranges=None, element=None):
        
        self.generate_plot(key, ranges, element)
1223156
function add_frame(Frame $frame) {
    
    $style = $frame->get_style();
    $display = $style->display;

    $collapse = $this->_table->get_style()->border_collapse == "collapse";

    // Recursively add the frames within tables, table-row-groups and table-rows
    if ( $display === "table-row" ||
         $display === "table" ||
         $display === "inline-table" ||
         in_array($display, Table_Frame_Decorator::$ROW_GROUPS) ) {

      $start_row = $this->__row;
      foreach ( $frame->get_children() as $child )
        $this->add_frame( $child );

      if ( $display === "table-row" )
        $this->add_row();

      $num_rows = $this->__row - $start_row - 1;
      $key = $frame->get_id();

      // Row groups always span across the entire table
      $this->_frames[$key]["columns"] = range(0,max(0,$this->_num_cols-1));
      $this->_frames[$key]["rows"] = range($start_row, max(0, $this->__row - 1));
      $this->_frames[$key]["frame"] = $frame;

      if ( $display !== "table-row" && $collapse ) {

        $bp = $style->get_border_properties();

        // Resolve the borders
        for ( $i = 0; $i < $num_rows+1; $i++) {
          $this->_resolve_border($start_row + $i, 0, "vertical", $bp["left"]);
          $this->_resolve_border($start_row + $i, $this->_num_cols, "vertical", $bp["right"]);
        }

        for ( $j = 0; $j < $this->_num_cols; $j++) {
          $this->_resolve_border($start_row, $j, "horizontal", $bp["top"]);
          $this->_resolve_border($this->__row, $j, "horizontal", $bp["bottom"]);
        }
      }


      return;
    }
    
    $node = $frame->get_node();
    
    // Determine where this cell is going
    $colspan = $node->getAttribute("colspan");
    $rowspan = $node->getAttribute("rowspan");

    if ( !$colspan ) {
      $colspan = 1;
      $node->setAttribute("colspan",1);
    }

    if ( !$rowspan ) {
      $rowspan = 1;
      $node->setAttribute("rowspan",1);
    }
    $key = $frame->get_id();

    $bp = $style->get_border_properties();


    // Add the frame to the cellmap
    $max_left = $max_right = 0;

    // Find the next available column (fix by Ciro Mondueri)
    $ac = $this->__col;
    while ( isset($this->_cells[$this->__row][$ac]) )
       $ac++;
    $this->__col = $ac;

    // Rows:
    for ( $i = 0; $i < $rowspan; $i++ ) {
      $row = $this->__row + $i;

      $this->_frames[$key]["rows"][] = $row;

      for ( $j = 0; $j < $colspan; $j++)
        $this->_cells[$row][$this->__col + $j] = $frame;

      if ( $collapse ) {
        // Resolve vertical borders
        $max_left = max($max_left, $this->_resolve_border($row, $this->__col, "vertical", $bp["left"]));
        $max_right = max($max_right, $this->_resolve_border($row, $this->__col + $colspan, "vertical", $bp["right"]));
      }
    }

    $max_top = $max_bottom = 0;

    // Columns:
    for ( $j = 0; $j < $colspan; $j++ ) {
      $col = $this->__col + $j;
      $this->_frames[$key]["columns"][] = $col;

      if ( $collapse ) {
        // Resolve horizontal borders
        $max_top = max($max_top, $this->_resolve_border($this->__row, $col, "horizontal", $bp["top"]));
        $max_bottom = max($max_bottom, $this->_resolve_border($this->__row + $rowspan, $col, "horizontal", $bp["bottom"]));
      }
    }

    $this->_frames[$key]["frame"] = $frame;

    // Handle seperated border model
    if ( !$collapse ) {
      list($h, $v) = $this->_table->get_style()->border_spacing;

      // Border spacing is effectively a margin between cells
      $v = $style->length_in_pt($v) / 2;
      $h = $style->length_in_pt($h) / 2;
      $style->margin = "$v $h";

      // The additional 1/2 width gets added to the table proper

    } else {

      // Drop the frame's actual border
      $style->border_left_width = $max_left / 2;
      $style->border_right_width = $max_right / 2;
      $style->border_top_width = $max_top / 2;
      $style->border_bottom_width = $max_bottom / 2;
      $style->margin = "none";
    }

    // Resolve the frame's width
    list($frame_min, $frame_max) = $frame->get_min_max_width();

    $width = $style->width;

    if ( is_percent($width) ) {
      $var = "percent";
      $val = (float)rtrim($width, "% ") / $colspan;

    } else if ( $width !== "auto" ) {
      $var = "absolute";
      $val = $style->length_in_pt($frame_min) / $colspan;
    }

    if (!$this->_columns_locked) {
      $min = 0;
      $max = 0;
      for ( $cs = 0; $cs < $colspan; $cs++ ) {
  
        // Resolve the frame's width(s) with other cells
        $col =& $this->get_column( $this->__col + $cs );
  
        // Note: $var is either 'percent' or 'absolute'.  We compare the
        // requested percentage or absolute values with the existing widths
        // and adjust accordingly.
        if ( isset($var) && $val > $col[$var] ) {
          $col[$var] = $val;
          $col["auto"] = false;
        }
  
        $min += $col["min-width"];
        $max += $col["max-width"];
      }
  
  
      if ( $frame_min > $min ) {
        // The frame needs more space.  Expand each sub-column
        $inc = ($frame_min - $min) / $colspan;
        for ($c = 0; $c < $colspan; $c++) {
          $col =& $this->get_column($this->__col + $c);
          $col["min-width"] += $inc;
        }
      }
  
      if ( $frame_max > $max ) {
        $inc = ($frame_max - $max) / $colspan;
        for ($c = 0; $c < $colspan; $c++) {
          $col =& $this->get_column($this->__col + $c);
          $col["max-width"] += $inc;
        }
      }
    }

    $this->__col += $colspan;
    if ( $this->__col > $this->_num_cols )
      $this->_num_cols = $this->__col;

  }
303772
def add(self, name, *vals):
        '''
        
        '''
        item = self.frames[-1].get(name)
        if item is None:
            self.frames[-1][name] = item = []
        item.extend(vals)
902833
def frame
      return @frame if @frame

      chars = []
      # 4 corners
      chars << Char.new(0x23, @x_offset - 1, @y_offset - 1)               # TopLeft
      chars << Char.new(0x23, @x_offset + @width, @y_offset - 1)          # TopRight
      chars << Char.new(0x23, @x_offset - 1, @y_offset + @height)         # BottomLeft
      chars << Char.new(0x23, @x_offset + @width, @y_offset  + @height)   # BottomRight

      # horiz
      @width.times { |x| chars << Char.new(0x2d, x + @x_offset, @y_offset - 1) }
      @width.times { |x| chars << Char.new(0x2d, x + @x_offset, @y_offset + @height) }

      # vertical
      @height.times { |y| chars << Char.new(0x7c, @x_offset - 1, y + @y_offset) }
      @height.times { |y| chars << Char.new(0x7c, @x_offset + @width, y + @y_offset) }
      @frame = ""
      @frame << chars.join
    end
143161
def create(element, element_id=nil, &block)
      element = initialize_element(element, element_id)
      style_and_context(element, element_id, &block)

      element
    end
305881
def add_frame(frame)
      raise ArgumentError, "Invalid argument 'frame'. Expected Frame, got #{frame.class}." unless frame.is_a?(Frame)
      # Do not add it again if the frame already belongs to this instance:
      @frames << frame unless @associated_frames[frame.uid]
      @associated_frames[frame.uid] = frame
    end
541232
def _add_crc(self, frame):
        
        crc = struct.pack('<H', crc16(frame))
        return frame + crc
1347217
public function build(): GetApplicationCacheForFrameRequest
	{
		$instance = new GetApplicationCacheForFrameRequest();
		if ($this->frameId === null) {
			throw new BuilderException('Property [frameId] is required.');
		}
		$instance->frameId = $this->frameId;
		return $instance;
	}
1291365
def create_frame(command):
    """"""
    # pylint: disable=too-many-branches,too-many-return-statements
    if command == Command.GW_ERROR_NTF:
        return FrameErrorNotification()
    if command == Command.GW_COMMAND_SEND_REQ:
        return FrameCommandSendRequest()
    if command == Command.GW_COMMAND_SEND_CFM:
        return FrameCommandSendConfirmation()
    if command == Command.GW_COMMAND_RUN_STATUS_NTF:
        return FrameCommandRunStatusNotification()
    if command == Command.GW_COMMAND_REMAINING_TIME_NTF:
        return FrameCommandRemainingTimeNotification()
    if command == Command.GW_SESSION_FINISHED_NTF:
        return FrameSessionFinishedNotification()

    if command == Command.GW_PASSWORD_ENTER_REQ:
        return FramePasswordEnterRequest()
    if command == Command.GW_PASSWORD_ENTER_CFM:
        return FramePasswordEnterConfirmation()

    if command == Command.GW_CS_DISCOVER_NODES_REQ:
        return FrameDiscoverNodesRequest()
    if command == Command.GW_CS_DISCOVER_NODES_CFM:
        return FrameDiscoverNodesConfirmation()
    if command == Command.GW_CS_DISCOVER_NODES_NTF:
        return FrameDiscoverNodesNotification()

    if command == Command.GW_GET_SCENE_LIST_REQ:
        return FrameGetSceneListRequest()
    if command == Command.GW_GET_SCENE_LIST_CFM:
        return FrameGetSceneListConfirmation()
    if command == Command.GW_GET_SCENE_LIST_NTF:
        return FrameGetSceneListNotification()

    if command == Command.GW_GET_NODE_INFORMATION_REQ:
        return FrameGetNodeInformationRequest()
    if command == Command.GW_GET_NODE_INFORMATION_CFM:
        return FrameGetNodeInformationConfirmation()
    if command == Command.GW_GET_NODE_INFORMATION_NTF:
        return FrameGetNodeInformationNotification()

    if command == Command.GW_GET_ALL_NODES_INFORMATION_REQ:
        return FrameGetAllNodesInformationRequest()
    if command == Command.GW_GET_ALL_NODES_INFORMATION_CFM:
        return FrameGetAllNodesInformationConfirmation()
    if command == Command.GW_GET_ALL_NODES_INFORMATION_NTF:
        return FrameGetAllNodesInformationNotification()
    if command == Command.GW_GET_ALL_NODES_INFORMATION_FINISHED_NTF:
        return FrameGetAllNodesInformationFinishedNotification()

    if command == Command.GW_ACTIVATE_SCENE_REQ:
        return FrameActivateSceneRequest()
    if command == Command.GW_ACTIVATE_SCENE_CFM:
        return FrameActivateSceneConfirmation()

    if command == Command.GW_GET_VERSION_REQ:
        return FrameGetVersionRequest()
    if command == Command.GW_GET_VERSION_CFM:
        return FrameGetVersionConfirmation()
    if command == Command.GW_GET_PROTOCOL_VERSION_REQ:
        return FrameGetProtocolVersionRequest()
    if command == Command.GW_GET_PROTOCOL_VERSION_CFM:
        return FrameGetProtocolVersionConfirmation()

    if command == Command.GW_SET_NODE_NAME_REQ:
        return FrameSetNodeNameRequest()
    if command == Command.GW_SET_NODE_NAME_CFM:
        return FrameSetNodeNameConfirmation()

    if command == Command.GW_NODE_INFORMATION_CHANGED_NTF:
        return FrameNodeInformationChangedNotification()

    if command == Command.GW_GET_STATE_REQ:
        return FrameGetStateRequest()
    if command == Command.GW_GET_STATE_CFM:
        return FrameGetStateConfirmation()

    if command == Command.GW_SET_UTC_REQ:
        return FrameSetUTCRequest()
    if command == Command.GW_SET_UTC_CFM:
        return FrameSetUTCConfirmation()

    if command == Command.GW_ACTIVATION_LOG_UPDATED_NTF:
        return FrameActivationLogUpdatedNotification()

    if command == Command.GW_HOUSE_STATUS_MONITOR_ENABLE_REQ:
        return FrameHouseStatusMonitorEnableRequest()
    if command == Command.GW_HOUSE_STATUS_MONITOR_ENABLE_CFM:
        return FrameHouseStatusMonitorEnableConfirmation()
    if command == Command.GW_HOUSE_STATUS_MONITOR_DISABLE_REQ:
        return FrameHouseStatusMonitorDisableRequest()
    if command == Command.GW_HOUSE_STATUS_MONITOR_DISABLE_CFM:
        return FrameHouseStatusMonitorDisableConfirmation()

    if command == Command.GW_NODE_STATE_POSITION_CHANGED_NTF:
        return FrameNodeStatePositionChangedNotification()

    return None
1211024
def update_widgets(self, new_frame=None):
        
        for column in self._columns:
            for widget in column:
                # First handle the normal case - pull the default data from the current frame.
                if widget.name in self._frame.data:
                    widget.value = self._frame.data[widget.name]
                elif widget.is_tab_stop:
                    # Make sure every active widget is properly initialised, by calling the setter.
                    # This will fix up any dodgy NoneType values, but preserve any values overridden
                    # by other code.
                    widget.value = widget.value

                # If an old frame was present, give the widget a chance to clone internal state
                # from the previous view.  If there is no clone function, ignore the error.
                if new_frame:
                    try:
                        widget.clone(new_frame.find_widget(widget.name))
                    except AttributeError:
                        pass
7098
def structures_in_frame(uid)
      raise ArgumentError, "Expected String, got #{uid.class}." unless uid.is_a?(String)
      frame_structures = Array.new
      @structures.each do |s|
        frame_structures << s if s.frame.uid == uid
      end
      return frame_structures
    end
676548
def create_new(cls, oldvalue, *args):
    ""
    if oldvalue is not None:
        raise AlreadyExistsException('%r already exists' % (oldvalue,))
    return cls.create_instance(*args)