create and setup my atom from the block b
500590
def set_atom(self, block, block_items, existing_col, min_itemsize,
                 nan_rep, info, encoding=None, errors='strict'):
        

        self.values = list(block_items)

        # short-cut certain block types
        if block.is_categorical:
            return self.set_atom_categorical(block, items=block_items,
                                             info=info)
        elif block.is_datetimetz:
            return self.set_atom_datetime64tz(block, info=info)
        elif block.is_datetime:
            return self.set_atom_datetime64(block)
        elif block.is_timedelta:
            return self.set_atom_timedelta64(block)
        elif block.is_complex:
            return self.set_atom_complex(block)

        dtype = block.dtype.name
        inferred_type = lib.infer_dtype(block.values, skipna=False)

        if inferred_type == 'date':
            raise TypeError(
                "[date] is not implemented as a table column")
        elif inferred_type == 'datetime':
            # after 8260
            # this only would be hit for a mutli-timezone dtype
            # which is an error

            raise TypeError(
                "too many timezones in this block, create separate "
                "data columns"
            )
        elif inferred_type == 'unicode':
            raise TypeError(
                "[unicode] is not implemented as a table column")

        # this is basically a catchall; if say a datetime64 has nans then will
        # end up here ###
        elif inferred_type == 'string' or dtype == 'object':
            self.set_atom_string(
                block, block_items,
                existing_col,
                min_itemsize,
                nan_rep,
                encoding,
                errors)

        # set as a data block
        else:
            self.set_atom_data(block)
489317
function (e) {
/*Line 8 - 'AtomFrameView.js' */            var self = this;
/*Line 9 - 'AtomFrameView.js' */            $(e).addClass("atom-frame-view");
/*Line 10 - 'AtomFrameView.js' */            this._items = [];
/*Line 11 - 'AtomFrameView.js' */            this._layout = WebAtoms.AtomViewBoxLayout.defaultInstance;
/*Line 12 - 'AtomFrameView.js' */            this.backCommand = function () {
/*Line 13 - 'AtomFrameView.js' */                self.onBackCommand.apply(self, arguments);
/*Line 14 - 'AtomFrameView.js' */            };
/*Line 15 - 'AtomFrameView.js' */        }
756970
function () {

/*Line 48 - 'AtomViewStack.js' */                var element = this._element;
/*Line 49 - 'AtomViewStack.js' */                var childEn = new ChildEnumerator(element);

/*Line 51 - 'AtomViewStack.js' */                var selectedIndex = this.get_selectedIndex();
/*Line 52 - 'AtomViewStack.js' */                var previousIndex = this._previousIndex;

/*Line 54 - 'AtomViewStack.js' */                var queue = WebAtoms.dispatcher;
/*Line 55 - 'AtomViewStack.js' */                queue.pause();

/*Line 57 - 'AtomViewStack.js' */                var i = -1;

/*Line 59 - 'AtomViewStack.js' */                var self = this;

/*Line 61 - 'AtomViewStack.js' */                var selectedElement, previousElement;

/*Line 63 - 'AtomViewStack.js' */                while (childEn.next()) {
/*Line 64 - 'AtomViewStack.js' */                    i = i + 1;
/*Line 65 - 'AtomViewStack.js' */                    var item = childEn.current();
/*Line 66 - 'AtomViewStack.js' */                    var $item = $(item);
/*Line 67 - 'AtomViewStack.js' */                    $item.addClass("view-stack-child");
/*Line 68 - 'AtomViewStack.js' */                    if (previousIndex == -1) {
/*Line 69 - 'AtomViewStack.js' */                        $item.addClass("hidden");
/*Line 70 - 'AtomViewStack.js' */                    }
/*Line 71 - 'AtomViewStack.js' */                    if (i == selectedIndex) {
/*Line 72 - 'AtomViewStack.js' */                        selectedElement = item;
/*Line 73 - 'AtomViewStack.js' */                    } else if (i == previousIndex) {
/*Line 74 - 'AtomViewStack.js' */                        previousElement = item;
/*Line 75 - 'AtomViewStack.js' */                    } else {
/*Line 76 - 'AtomViewStack.js' */                        $item.addClass("hidden");
/*Line 77 - 'AtomViewStack.js' */                    }
/*Line 78 - 'AtomViewStack.js' */                }

/*Line 80 - 'AtomViewStack.js' */                if (selectedElement) {
/*Line 81 - 'AtomViewStack.js' */                    var width = $(element).innerWidth();
/*Line 82 - 'AtomViewStack.js' */                    var height = $(element).innerHeight();

/*Line 84 - 'AtomViewStack.js' */                    this._selectedChild = selectedElement;
/*Line 85 - 'AtomViewStack.js' */                    var $selectedElement = $(selectedElement);
/*Line 86 - 'AtomViewStack.js' */                    AtomUI.setItemRect($selectedElement,selectedElement, { width: width, height: height });
/*Line 87 - 'AtomViewStack.js' */                    var sac = selectedElement.atomControl;
/*Line 88 - 'AtomViewStack.js' */                    if (sac) {
/*Line 89 - 'AtomViewStack.js' */                        sac.updateUI();
/*Line 90 - 'AtomViewStack.js' */                    }

/*Line 92 - 'AtomViewStack.js' */                    if (previousElement && previousElement != selectedElement) {
/*Line 93 - 'AtomViewStack.js' */                        var self = this;

/*Line 95 - 'AtomViewStack.js' */                        var $previousElement = $(previousElement);

/*Line 97 - 'AtomViewStack.js' */                        var sd = this._swipeDirection;
/*Line 98 - 'AtomViewStack.js' */                        if (sd != null && /none/i.test(sd)) {
/*Line 99 - 'AtomViewStack.js' */                            $previousElement.addClass("hidden");
/*Line 100 - 'AtomViewStack.js' */                            $selectedElement.removeClass("hidden");
/*Line 101 - 'AtomViewStack.js' */                        } else {
/*Line 102 - 'AtomViewStack.js' */                            // animate...
/*Line 103 - 'AtomViewStack.js' */                            var ael = [selectedElement, previousElement];
/*Line 104 - 'AtomViewStack.js' */                            $(ael).removeClass("hidden");
/*Line 105 - 'AtomViewStack.js' */                            this._isAnimating = true;
/*Line 106 - 'AtomViewStack.js' */                            if (selectedIndex < previousIndex) {
/*Line 107 - 'AtomViewStack.js' */                                $selectedElement.css("left", -width);
/*Line 108 - 'AtomViewStack.js' */                                //log("left: -" + width);
/*Line 109 - 'AtomViewStack.js' */                            } else {
/*Line 110 - 'AtomViewStack.js' */                                $selectedElement.css("left", width);
/*Line 111 - 'AtomViewStack.js' */                                //log("left: " + width);
/*Line 112 - 'AtomViewStack.js' */                            }
/*Line 113 - 'AtomViewStack.js' */                            $(ael).addClass("animate-left-property");
/*Line 114 - 'AtomViewStack.js' */                            setTimeout(function () {
/*Line 115 - 'AtomViewStack.js' */                                $selectedElement.css("left", 0);
/*Line 116 - 'AtomViewStack.js' */                                //log("left: 0");
/*Line 117 - 'AtomViewStack.js' */                                if (selectedIndex < previousIndex) {
/*Line 118 - 'AtomViewStack.js' */                                    $previousElement.css("left", width);
/*Line 119 - 'AtomViewStack.js' */                                } else {
/*Line 120 - 'AtomViewStack.js' */                                    $previousElement.css("left", -width);
/*Line 121 - 'AtomViewStack.js' */                                }
/*Line 122 - 'AtomViewStack.js' */                                setTimeout(function () {
/*Line 123 - 'AtomViewStack.js' */                                    self._isAnimating = false;
/*Line 124 - 'AtomViewStack.js' */                                    $(ael).removeClass("animate-left-property");
/*Line 125 - 'AtomViewStack.js' */                                    $previousElement.addClass("hidden");
/*Line 126 - 'AtomViewStack.js' */                                }, 800);
/*Line 127 - 'AtomViewStack.js' */                            }, 50);
/*Line 128 - 'AtomViewStack.js' */                        }
/*Line 129 - 'AtomViewStack.js' */                    } else {
/*Line 130 - 'AtomViewStack.js' */                        $selectedElement.removeClass("hidden");
/*Line 131 - 'AtomViewStack.js' */                    }
/*Line 132 - 'AtomViewStack.js' */                }

/*Line 134 - 'AtomViewStack.js' */                queue.start();

/*Line 136 - 'AtomViewStack.js' */            }
873883
private static double combineRmsd(int b1, int b2, AFPChain afpChain,Atom[] ca1,Atom[] ca2)
	{
		int     i;
		int     afpn = 0;

		int[] afpChainList =afpChain.getAfpChainList();

		int[] block2Afp = afpChain.getBlock2Afp();
		int[] blockSize = afpChain.getBlockSize();


		int[]   list = new int[blockSize[b1]+blockSize[b2]];
		for(i = block2Afp[b1]; i < block2Afp[b1] + blockSize[b1]; i ++) {
			list[afpn ++] = afpChainList[i];
		}
		for(i = block2Afp[b2]; i < block2Afp[b2] + blockSize[b2]; i ++) {
			list[afpn ++] = afpChainList[i];
		}
		double  rmsd = AFPChainer.calAfpRmsd(afpn, list,0, afpChain,ca1,ca2);

		afpChain.setBlock2Afp(block2Afp);
		afpChain.setBlockSize(blockSize);
		afpChain.setAfpChainList(afpChainList);

		return rmsd;
	}
663203
function (element, type, data, newScope) {
/*Line 363 - 'AtomUI.js' */        if (element.atomControl)
/*Line 364 - 'AtomUI.js' */            return;
/*Line 365 - 'AtomUI.js' */        if (!type) {
/*Line 366 - 'AtomUI.js' */            type = AtomUI.getAtomType(element);
/*Line 367 - 'AtomUI.js' */            type = WebAtoms[type];
/*Line 368 - 'AtomUI.js' */        } else {
/*Line 369 - 'AtomUI.js' */            if (type.constructor == String) {
/*Line 370 - 'AtomUI.js' */                type = WebAtoms[type];
/*Line 371 - 'AtomUI.js' */            }
/*Line 372 - 'AtomUI.js' */        }
/*Line 373 - 'AtomUI.js' */        if (type) {
/*Line 374 - 'AtomUI.js' */            var ctrl = new type(element);
/*Line 375 - 'AtomUI.js' */            if (data) {
/*Line 376 - 'AtomUI.js' */                ctrl._data = data;
/*Line 377 - 'AtomUI.js' */            }
/*Line 378 - 'AtomUI.js' */            if (newScope) {
/*Line 379 - 'AtomUI.js' */                ctrl._scope = newScope;
/*Line 380 - 'AtomUI.js' */            }

/*Line 382 - 'AtomUI.js' */            //inits templates..
/*Line 383 - 'AtomUI.js' */            //ctrl.prepareControl();

/*Line 385 - 'AtomUI.js' */            //init templates and creates controls...
/*Line 386 - 'AtomUI.js' */            ctrl.createChildren();

/*Line 388 - 'AtomUI.js' */            if (data) {
/*Line 389 - 'AtomUI.js' */                ctrl.init();
/*Line 390 - 'AtomUI.js' */            }
/*Line 391 - 'AtomUI.js' */            //$(element).removeAttr("atom-type");
/*Line 392 - 'AtomUI.js' */            return ctrl;
/*Line 393 - 'AtomUI.js' */        }
/*Line 394 - 'AtomUI.js' */        return null;
/*Line 395 - 'AtomUI.js' */    }
64814
void setBlock(final int index, final Block b) {
    blockList[index2BlockId(index)] = b.getBlockId();
    blockList[index2BlockLen(index)] = b.getNumBytes();
    blockList[index2BlockGenStamp(index)] = b.getGenerationStamp();
  }
1185415
def add_atom(self, key, atom):
        """"""
        self.graph.add_node(key, atom=atom)
1334276
def get_atom(value):
    
    atom = Atom()
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        atom.append(token)
    if value and value[0] in ATOM_ENDS:
        raise errors.HeaderParseError(
            "expected atom but found '{}'".format(value))
    token, value = get_atext(value)
    atom.append(token)
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        atom.append(token)
    return atom, value
761951
private void init() throws IOException {
        bsPutUByte('B');
        bsPutUByte('Z');

        this.data = new Data(this.blockSize100k);
        this.blockSorter = new BlockSort(this.data);

        // huffmanised magic bytes
        bsPutUByte('h');
        bsPutUByte('0' + this.blockSize100k);

        this.combinedCRC = 0;
        initBlock();
    }
1072168
def create_block(mc, block_id, subtype=None):
    
    # Get player tile position and real position.
    ptx, pty, ptz = mc.player.getTilePos()
    px, py, pz = mc.player.getPos()
    # Create block at current player tile location.
    if subtype is None:
        mc.setBlock(ptx, pty, ptz, block_id)
    else:
        mc.setBlock(ptx, pty, ptz, block_id, subtype)
    # Move the player's real positon up one block.
    mc.player.setPos(px, py+1, pz)
1042621
def parse_atoms(self, pdb):
    """"""
    
    atomre = re.compile("ATOM")
    
    atomlines = [line for line in pdb.lines if atomre.match(line)]
    
    chainresnums = {}
    
    for line in atomlines:
      chain = line[21]
      resname = line[17:20]
      resnum = line[22:27]
      #print resnum
      chainresnums.setdefault(chain, [])
      
      if resnum in chainresnums[chain]:
        assert self[chain][chainresnums[chain].index(resnum)] == resname
      else:
        if resnum[-1] == ' ':
          self.setdefault(chain, [])
          self[chain] += [resname]
          chainresnums[chain] += [resnum]
    
    return chainresnums
61508
def setup(self):
        
        self.log.info('starting the ``setup`` method')

        # RECURSIVELY CREATE MISSING DIRECTORIES
        if not os.path.exists(self.pathToWorkspace):
            os.makedirs(self.pathToWorkspace)
        if not os.path.exists(self.pathToWorkspace + "/qubits_output"):
            os.makedirs(self.pathToWorkspace + "/qubits_output")

        # FIND RESOURCES
        spectralDB = os.path.dirname(
            __file__) + "/resources/qubits_spectral_database"
        qubitsSettings = os.path.dirname(
            __file__) + "/resources/qubits_settings.yaml"
        dstSettings = self.pathToWorkspace + "/qubits_settings.yaml"

        # CHECK FOR PRE-EXISTANCE
        if os.path.exists(self.pathToWorkspace + "/qubits_spectral_database") or os.path.exists(dstSettings):
            self.log.warning(
                "A qubits workspace seems to already exist in this location")
            sys.exit(0)

        # COPY ASSETS TO REQUESTED LOCATION
        shutil.copytree(spectralDB, self.pathToWorkspace +
                        "/qubits_spectral_database")
        shutil.copyfile(qubitsSettings, dstSettings)

        # ADD USER'S HOME FOLDER INTO SETTINGS
        pathToReadFile = dstSettings
        try:
            self.log.debug("attempting to open the file %s" %
                           (pathToReadFile,))
            readFile = codecs.open(pathToReadFile, encoding='utf-8', mode='r')
            thisData = readFile.read()
            readFile.close()
        except IOError, e:
            message = 'could not open the file %s' % (pathToReadFile,)
            self.log.critical(message)
            raise IOError(message)

        readFile.close()
        thisData = thisData.replace("/Users/XXXX", self.home)
        try:
            self.log.debug("attempting to open the file %s" %
                           (pathToReadFile,))
            writeFile = codecs.open(pathToReadFile, encoding='utf-8', mode='w')
        except IOError, e:
            message = 'could not open the file %s' % (pathToReadFile,)
            self.log.critical(message)
            raise IOError(message)
        writeFile.write(thisData)
        writeFile.close()

        self.log.info('completed the ``setup`` method')
        return None
227809
def setup(app):
    '''  '''
    app.add_node(
        collapsible_code_block,
        html=(
            html_visit_collapsible_code_block,
            html_depart_collapsible_code_block
        )
    )
    app.add_directive('collapsible-code-block', CollapsibleCodeBlock)
169007
def _generate_atom_feed(self, feed):
        
        atom_feed = self.init_atom_feed(feed)
        atom_feed.title("Feed")
        return atom_feed
878305
private void setBranchAtom(IAtomContainer molecule, IAtom unplacedAtom, IAtom atomA, IAtomContainer atomNeighbours,
            AtomPlacer3D ap3d, AtomTetrahedralLigandPlacer3D atlp3d) throws CDKException {
        //logger.debug("****** SET Branch Atom ****** >"+molecule.indexOf(unplacedAtom));
        IAtomContainer noCoords = molecule.getBuilder().newInstance(IAtomContainer.class);
        noCoords.addAtom(unplacedAtom);
        Point3d centerPlacedMolecule = ap3d.geometricCenterAllPlacedAtoms(molecule);
        IAtom atomB = atomNeighbours.getAtom(0);

        String atypeNameA = atomA.getAtomTypeName();
        String atypeNameB = atomB.getAtomTypeName();
        String atypeNameUnplaced = unplacedAtom.getAtomTypeName();

        double length = ap3d.getBondLengthValue(atypeNameA, atypeNameUnplaced);
        double angle = (ap3d.getAngleValue(atypeNameB, atypeNameA, atypeNameUnplaced)) * Math.PI / 180;
        /*
         * System.out.println("A:"+atomA.getSymbol()+" "+atomA.getAtomTypeName()+
         * " B:"+atomB.getSymbol()+" "+atomB.getAtomTypeName()
         * +" unplaced Atom:"
         * +unplacedAtom.getAtomTypeName()+" BL:"+length+" Angle:"+angle
         * +" FormalNeighbour:"
         * +atomA.getFormalNeighbourCount()+" HYB:"+atomA.getFlag
         * (CDKConstants.HYBRIDIZATION_SP2)
         * +" #Neigbhours:"+atomNeighbours.getAtomCount());
         */
        IAtom atomC = ap3d.getPlacedHeavyAtom(molecule, atomB, atomA);

        Point3d[] branchPoints = atlp3d.get3DCoordinatesForLigands(atomA, noCoords, atomNeighbours, atomC,
                (atomA.getFormalNeighbourCount() - atomNeighbours.getAtomCount()), length, angle);
        double distance = 0;
        int farthestPoint = 0;
        for (int i = 0; i < branchPoints.length; i++) {
            if (Math.abs(branchPoints[i].distance(centerPlacedMolecule)) > Math.abs(distance)) {
                distance = branchPoints[i].distance(centerPlacedMolecule);
                farthestPoint = i;
            }
        }

        int stereo = -1;
        IBond unplacedBond = molecule.getBond(atomA, unplacedAtom);
        if (atomA.getStereoParity() != CDKConstants.UNSET && atomA.getStereoParity() != 0
                || (unplacedBond.getStereo() == IBond.Stereo.UP || unplacedBond.getStereo() == IBond.Stereo.DOWN)
                && molecule.getMaximumBondOrder(atomA) == IBond.Order.SINGLE) {
            if (atomNeighbours.getAtomCount() > 1) {
                stereo = atlp3d.makeStereocenter(atomA.getPoint3d(), molecule.getBond(atomA, unplacedAtom),
                        (atomNeighbours.getAtom(0)).getPoint3d(), (atomNeighbours.getAtom(1)).getPoint3d(),
                        branchPoints);
            }
        }
        if (stereo != -1) {
            farthestPoint = stereo;
        }
        unplacedAtom.setPoint3d(branchPoints[farthestPoint]);
        unplacedAtom.setFlag(CDKConstants.ISPLACED, true);
    }
247150
@Override
    public void setup(IAtomContainer atomContainer, Rectangle screen) {
        this.setScale(atomContainer);
        Rectangle2D bounds = BoundsCalculator.calculateBounds(atomContainer);
        this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
        this.drawCenter = new Point2d(screen.getCenterX(), screen.getCenterY());
        this.setup();
    }
119385
function createNewBlock(name) {
          var node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();

          if (name || parentBlockName == "TABLE") {
            block = dom.create(name || newBlockName);
            setForcedBlockAttrs(block);
          } else {
            block = parentBlock.cloneNode(false);
          }

          caretNode = block;

          // Clone any parent styles
          if (settings.keep_styles !== false) {
            do {
              if (textInlineElements[node.nodeName]) {
                // Never clone a caret containers
                if (node.id == '_mce_caret') {
                  continue;
                }

                clonedNode = node.cloneNode(false);
                dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique

                if (block.hasChildNodes()) {
                  clonedNode.appendChild(block.firstChild);
                  block.appendChild(clonedNode);
                } else {
                  caretNode = clonedNode;
                  block.appendChild(clonedNode);
                }
              }
            } while ((node = node.parentNode) && node != editableRoot);
          }

          // BR is needed in empty blocks on non IE browsers
          if (!isIE) {
            caretNode.innerHTML = '<br data-mce-bogus="1">';
          }

          return block;
        }