按股票排列的查看blockname的视图

        Returns:
            [type] -- [description]
547298
def view_code(self):
        

        return self.data.groupby(level=1).apply(
            lambda x:
            [item for item in x.index.remove_unused_levels().levels[0]]
        )
498633
def p_rddl_block(self, p):
        ''''''
        if p[1] is None:
            p[0] = dict()
        else:
            name, block = p[2]
            p[1][name] = block
            p[0] = p[1]
889673
def block_size(self):
        
        bs = self.attributes['block_size']
        if isinstance(bs, six.string_types):
            bs = shlex.split(bs)
        bs = [str(e) for e in bs]
        return bs
1118383
def QA_fetch_stock_block_adv(code=None, blockname=None, collections=DATABASE.stock_block):
    '''
    
    '''
    if code is not None and blockname is None:
        # 返回这个股票代码所属的板块
        data = pd.DataFrame([item for item in collections.find(
            {'code': {'$in': code}})])
        data = data.drop(['_id'], axis=1)

        return QA_DataStruct_Stock_block(data.set_index(['blockname', 'code'], drop=True).drop_duplicates())
    elif blockname is not None and code is None:
        #
        # 🛠 todo fnished 返回 这个板块所有的股票
        # 返回该板块所属的股票
        # print("QA Error blockname is Not none code none, return all code from its block name have not implemented yet !")

        items_from_collections = [item for item in collections.find(
            {'blockname': re.compile(blockname)})]
        data = pd.DataFrame(items_from_collections).drop(['_id'], axis=1)
        data_set_index = data.set_index(['blockname', 'code'], drop=True)
        return QA_DataStruct_Stock_block(data_set_index)

    else:
        # 🛠 todo 返回 判断 这个股票是否和属于该板块
        data = pd.DataFrame(
            [item for item in collections.find()]).drop(['_id'], axis=1)
        data_set_index = data.set_index(['blockname', 'code'], drop=True)
        return QA_DataStruct_Stock_block(data_set_index)
729473
function parseBlock(tokens) {
  if (tokens.type === 'blockquote') {
    return [getBlockquoteToken(tokens)];
  } else if (tokens.type === 'bullet_list' && tokens.content.type === 'list_item' ||
    tokens.type === 'ordered-list' && tokens.content.type === 'list_item') {
    return [getListToken(tokens)];
  }
  return tokens;
}
1301975
def listBlockChildren(self, block_name=""):
        
        if (not block_name) or re.search("['%','*']", block_name):
            dbsExceptionHandler("dbsException-invalid-input", "DBSBlock/listBlockChildren. Block_name must be provided." )
        conn = self.dbi.connection()
        try:
            results = self.blockchildlist.execute(conn, block_name)
            return results
        finally:
            if conn:
                conn.close()
772752
def block_structure(self):
        
        n, m = self.shape
        if n != m:
            raise AttributeError("block_structure only defined for square "
                                 "matrices")
        for k in range(1, n):
            if ((self.matrix[:k, k:] == 0).all() and
                    (self.matrix[k:, :k] == 0).all()):
                return (k,) + self[k:, k:].block_structure
        return n,
157808
def _to_string(self):
        
        # Allow access to _to_string protected method
        return u"{course_key}+{BLOCK_TYPE_PREFIX}@{block_type}+{BLOCK_PREFIX}@{block_id}".format(
            course_key=self.course_key._to_string(),  # pylint: disable=protected-access
            BLOCK_TYPE_PREFIX=self.BLOCK_TYPE_PREFIX,
            block_type=self.block_type,
            BLOCK_PREFIX=self.BLOCK_PREFIX,
            block_id=self.block_id
        )
99249
def get_canonical_block_by_number(self, block_number: BlockNumber) -> BaseBlock:
        
        validate_uint256(block_number, title="Block Number")
        return self.get_block_by_hash(self.chaindb.get_canonical_block_hash(block_number))
666786
def rpc_get_name_at( self, name, block_height, **con_info ):
        
        if not check_name(name):
            return {'error': 'invalid name', 'http_status': 400}

        if not check_block(block_height):
            return self.success_response({'record': None})

        db = get_db_state(self.working_dir)
        names_at = db.get_name_at( name, block_height, include_expired=False )
        db.close()
        
        ret = []
        for name_rec in names_at:
            if 'opcode' not in name_rec:
                name_rec['opcode'] = op_get_opcode_name(name_rec['op'])
            
            ret.append(self.sanitize_rec(name_rec))

        return self.success_response( {'records': ret} )
538002
def getblock(self, hash: str) -> dict:
        ''''''

        return cast(dict, self.api_fetch('getblock?hash=' + hash))
1144864
def name(self):
        

        if self._name is not None:
            return self._name

        if not self.blocks:
            return None

        if not self.blocks[0].instructions:
            return None

        if not self.blocks[0].instructions[0].labels:
            return None

        lbl = self.blocks[0].instructions[0].labels[0]

        if isinstance(lbl, FunctionLabel):
            return lbl.function_name

        return None
1145490
def _get_block(self):
    """"""
    b = self._fh.read(4) # get block size bytes
    #print self._fh.tell()
    if not b: raise StopIteration
    block_size = struct.unpack('<i',b)[0]
    return self._fh.read(block_size)
1350826
def blocks_name_declaration(mixin_node)
      block_name_declaration(DEFAULT_BLOCK_NAME)

      mixin_node.params.select { |n| n.type == :mixin_block_param }.each do |param|
        block_name_declaration(param.value)
      end
    end
252304
function getOptTypesFrom(block, name) {
  var types = getTypesFrom_(block, name);
  if (types.length == 0) {
    return undefined;
  } else if (types.indexOf('null') != -1) {
    return 'null';
  } else if (types.length == 1) {
    return types[0];
  } else {
    return '[' + types.join(', ') + ']';
  }
}
1011035
def get_hyperparameters(self):
        
        hyperparameters = {}
        for block_name, block in self.blocks.items():
            hyperparameters[block_name] = block.get_hyperparameters()

        return hyperparameters
609474
def _get_block_hash(self, number):
        
        num = _format_block_number(number)
        hash_key = header_prefix + num + num_suffix
        return self.db.get(hash_key)