Remove Nuke margins when docked UI
    .. _More info:
        https://gist.github.com/maty974/4739917
483339
def _nuke_set_zero_margins(widget_object):
    
    parentApp = QtWidgets.QApplication.allWidgets()
    parentWidgetList = []
    for parent in parentApp:
        for child in parent.children():
            if widget_object.__class__.__name__ == child.__class__.__name__:
                parentWidgetList.append(
                    parent.parentWidget())
                parentWidgetList.append(
                    parent.parentWidget().parentWidget())
                parentWidgetList.append(
                    parent.parentWidget().parentWidget().parentWidget())

                for sub in parentWidgetList:
                        for tinychild in sub.children():
                            try:
                                tinychild.setContentsMargins(0, 0, 0, 0)
                            except Exception:
                                pass
244687
function repel( pt, i ) {
  if ( pt.distance(mouse) < threshold ) { // smaller than threshold distance, push it out
    var dir = pt.$subtract(mouse).normalize();
    pt.set( dir.multiply(threshold).add( mouse ).min( space.size ).max(0, 0) );
  } else { // bigger than threshold distance, pull it in
    var orig = origs[i];
    pt.set ( orig.$add( pt.$subtract(orig).multiply(0.98) ) );
  }
}
1226656
function blockCmdArrowNavigation() {
        if (Env.mac) {
          editor.on('keydown', function (e) {
            if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode == 37 || e.keyCode == 39)) {
              e.preventDefault();
              editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' : 'forward', 'lineboundary');
            }
          });
        }
      }
132650
private void setImmersiveSticky() {
        mActivity.getWindow().getDecorView().setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
    }
744664
def __clean_doc_block(self):
        
        # Return immediately if the DockBlock is empty.
        if not self._comment:
            return

        for i in range(1, len(self._comment) - 1):
            self._comment[i] = re.sub(r'^\s*\*', '', self._comment[i])

        self._comment[0] = re.sub(r'^\s*/\*\*', '', self._comment[0])

        self._comment[-1] = re.sub(r'\*/\s*$', '', self._comment[-1])

        for i, line in enumerate(self._comment):
            self._comment[i] = line.strip()

        self._comment = self.__remove_leading_empty_lines(self._comment)
        self._comment = self.__remove_trailing_empty_lines(self._comment)
34493
function(inst) {
		var self = this;
		self.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
		var borders = $.datepicker._getBorders(inst.dpDiv);
		instActive = inst; // for delegate hover events
		inst.dpDiv.empty().append(this._generateHTML(inst));
		var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
		if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6
			cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
		}
		inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();
		var numMonths = this._getNumberOfMonths(inst);
		var cols = numMonths[1];
		var width = 17;
		inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
		if (cols > 1)
			inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
		inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
			'Class']('ui-datepicker-multi');
		inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
			'Class']('ui-datepicker-rtl');
		if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
				// #6694 - don't focus the input if it's already focused
				// this breaks the change event in IE
				inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
			inst.input.focus();
		// deffered render of the years select (to avoid flashes on Firefox) 
		if( inst.yearshtml ){
			var origyearshtml = inst.yearshtml;
			setTimeout(function(){
				//assure that inst.yearshtml didn't change.
				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
					inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);
				}
				origyearshtml = inst.yearshtml = null;
			}, 0);
		}
	}
596454
def set_margins(self, left,top,right=-1):
        ""
        self.l_margin=left
        self.t_margin=top
        if(right==-1):
            right=left
        self.r_margin=right
902449
function () {
            var chart = this,
              reflow = function (e) {
                  chart.reflow(e);
              };


            addEvent(win, 'resize', reflow);
            addEvent(chart, 'destroy', function () {
                removeEvent(win, 'resize', reflow);
            });
        }
1196950
def suppressConsoleOut(meth):
    """"""
    @wraps(meth)
    def decorate(*args, **kwargs):
        """Decorate"""
        # Disable ansible console output
        _stdout = sys.stdout
        fptr = open(os.devnull, 'w')
        sys.stdout = fptr
        try:
            return meth(*args, **kwargs)
        except Exception as e:
            raise e
        finally:
            # Enable console output
            sys.stdout = _stdout
    return decorate
1085312
def X_less(self):
        """"""
        self.parent.value('window_length',
                          self.parent.value('window_length') / 2)
        self.parent.overview.update_position()
922784
function occupySlice(
  targetArr: Array<?string>,
  start: number,
  end: number,
  componentKey: string
): void {
  // eslint-disable-next-line no-plusplus
  for (let ii = start; ii < end; ii++) {
    // eslint-disable-next-line no-param-reassign
    targetArr[ii] = componentKey;
  }
}
786826
function expandMarginSetting(value) {
			if (typeof value === "number") {
				value = [value];
			}

			if (!Array.isArray(value)) {
				console.log("Margin only takes an integer or an array of integers");
				value = [0];
			}

			switch(value.length) {
			case 1:
				return [value[0], value[0], value[0], value[0]];
			case 2:
				return [value[0], value[1], value[0], value[1]];
			case 3:
				return [value[0], value[1], value[2], value[1]];
			case 4:
				return value;
			default:
				return value.slice(0, 4);
			}
		}
76508
function() {
		var availableWidth = this.element.outerWidth() - this.controlsContainer.outerWidth(),
			totalTabWidth = 0,
			tabElement,
			i,
			marginLeft,
			gap;

		for( i = 0; i < this.tabs.length; i++ ) {
			tabElement = this.tabs[ i ].element;

			/*
			 * In order to show every tab's close icon, decrement the z-index from left to right
			 */
			tabElement.css( 'z-index', this.tabs.length - i );
			totalTabWidth += tabElement.outerWidth() + parseInt( tabElement.css( 'margin-right' ), 10 );
		}

		gap = ( totalTabWidth - availableWidth ) / ( this.tabs.length - 1 )

		for( i = 0; i < this.tabs.length; i++ ) {

			/*
			 * The active tab keeps it's original width
			 */
			if( !this.tabs[ i ].isActive && gap > 0 ) {
				marginLeft = '-' + Math.floor( gap )+ 'px';
			} else {
				marginLeft = '';
			}

			this.tabs[ i ].element.css( 'margin-left', marginLeft );
		}

		if( this.element.outerWidth() < this.tabs[ 0 ].element.outerWidth() ) {
			this.element.css( 'overflow', 'hidden' );
		} else {
			this.element.css( 'overflow', 'visible' );
		}
	}
685636
function removeBinding(key, platform) {
        if (!key || ((platform !== null) && (platform !== undefined) && (platform !== brackets.platform))) {
            return;
        }

        var normalizedKey = normalizeKeyDescriptorString(key);

        if (!normalizedKey) {
            console.log("Failed to normalize " + key);
        } else if (_isKeyAssigned(normalizedKey)) {
            var binding = _keyMap[normalizedKey],
                command = CommandManager.get(binding.commandID),
                bindings = _commandMap[binding.commandID];

            // delete key binding record
            delete _keyMap[normalizedKey];

            if (bindings) {
                // delete mapping from command to key binding
                _commandMap[binding.commandID] = bindings.filter(function (b) {
                    return (b.key !== normalizedKey);
                });

                if (command) {
                    command.trigger("keyBindingRemoved", {key: normalizedKey, displayKey: binding.displayKey});
                }
            }
        }
    }
1252625
function () {
            var cfg = this._cfg, state = cfg.stateObject;
            var border = (state.borderSize > 0) ? state.borderSize : 0;

            if (!cfg.fullWidth && cfg.width > -1) {
                var w = cfg.width - state.paddingLeft - state.paddingRight - state.marginLeft - state.marginRight;
                if (this._hasBorder(state.skipLeftBorder, cfg.iconsLeft)) {
                    w -= state.borderLeft >= 0 ? state.borderLeft : border;
                }
                if (this._hasBorder(state.skipRightBorder, cfg.iconsRight)) {
                    w -= state.borderRight >= 0 ? state.borderRight : border;
                }
                this.innerWidth = w > 0 ? w : 0;
            } else {
                this.innerWidth = -1;
            }
            if (cfg.height > -1) {
                var h = (state.frameHeight || cfg.height) - state.paddingTop - state.paddingBottom - state.marginTop
                        - state.marginBottom;
                h -= state.borderTop >= 0 ? state.borderTop : border;
                h -= state.borderBottom >= 0 ? state.borderBottom : border;
                this.innerHeight = h > 0 ? h : 0;
            } else {
                this.innerHeight = -1;
            }
        }
266882
def update_floating_panels(self):
        """"""
        crect = self.editor.contentsRect()
        panels = self.panels_for_zone(Panel.Position.FLOATING)
        for panel in panels:
            if not panel.isVisible():
                continue
            panel.set_geometry(crect)
1034904
def additional_cleanup(self):
        """"""

        cmd.remove('not alt ""+A')  # Remove alternate conformations
        cmd.hide('labels', 'Interactions')  # Hide labels of lines
        cmd.disable('%sCartoon' % self.protname)
        cmd.hide('everything', 'hydrogens')