获取板块集合下的子板块列表，输出 市场，板块分类,板块代码，名称，ID
198505
def _example_plate_subplate(quote_ctx):
    
    ret_status, ret_data = quote_ctx.get_plate_list(ft.Market.SZ, ft.Plate.ALL)
    if ret_status != ft.RET_OK:
        print(ret_data)
        exit()
    print("plate_subplate")
    print(ret_data)
516399
function (el) {
        if (el == null) {
            // 不指定el清空
            for (var i = 0; i < this._roots.length; i++) {
                var root = this._roots[i];
                if (root instanceof Group) {
                    root.delChildrenFromStorage(this);
                }
            }

            this._roots = [];
            this._displayList = [];
            this._displayListLen = 0;

            return;
        }

        if (el instanceof Array) {
            for (var i = 0, l = el.length; i < l; i++) {
                this.delRoot(el[i]);
            }
            return;
        }


        var idx = util.indexOf(this._roots, el);
        if (idx >= 0) {
            this.delFromStorage(el);
            this._roots.splice(idx, 1);
            if (el instanceof Group) {
                el.delChildrenFromStorage(this);
            }
        }
    }
862695
function isIDNumber(cardid) {
	//身份证正则表达式(18位) 
	var isIdCard2 = /^[1-9]\d{5}(19\d{2}|[2-9]\d{3})((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])(\d{4}|\d{3}X)$/i;
	var stard = "10X98765432"; //最后一位身份证的号码
	var first = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; //1-17系数
	var sum = 0;
	if (!isIdCard2.test(cardid)) return false;

	var year = cardid.substr(6, 4),
		month = cardid.substr(10, 2),
		day = cardid.substr(12, 2);
	var birthday = cardid.substr(6, 8);
	if (birthday !== Calendar.formatTime(new Date(year, month, day), 'YYYYMMDD')) //校验日期是否合法
		return false;

	for (let i = 0; i < 17; i++) {
		sum += cardid[i] * first[i];
	}
	var result = sum % 11;
	var last = stard[result]; //计算出来的最后一位身份证号码

	return String.last(cardid).toUpperCase() === last.toUpperCase();
}
475079
def _get_id2parents(id2parents, item_id, item_obj):
    """"""
    if item_id in id2parents:
        return id2parents[item_id]
    parent_ids = set()
    for parent_obj in item_obj.parents:
        parent_id = parent_obj.item_id
        parent_ids.add(parent_id)
        parent_ids |= _get_id2parents(id2parents, parent_id, parent_obj)
    id2parents[item_id] = parent_ids
    return parent_ids
41743
function bind(from, node, comPrefix, valPrefix, clsPrefix, ignores) {
  ignores = Object.assign({
    true: true,
    false: true,
    null: true,
    undefined: true
  }, ignores);

  let hasPath = false;

  //处理节点属性
  let attributes = node.attributes;
  for (let i in attributes) {
    if (!/^\d+$/.test(i)) continue;
    let attr = attributes[i];

    //处理属性值
    if (attr.value.indexOf('{') > -1) {
      attr.value = replaceString(from, attr.value, valPrefix, ignores);
    }

    //绑定事件
    if (/^(bind|catch)\w+/.test(attr.name)) {
      node.setAttribute('data-' + attr.name, attr.value);
      attr.value = '_dispatch';
      if (!hasPath && comPrefix) {
        node.setAttribute('data-path', comPrefix);
      }
    }

    //如果是循环标签,则在子标签中忽略循环索引和值变量
    if (attr.name === 'wx:for') {
      let index = node.getAttribute('wx:for-index') || 'index';
      let item = node.getAttribute('wx:for-item') || 'item';
      ignores[index] = true;
      ignores[item] = true;
    }

    if (clsPrefix && attr.name === 'class') {
      const matchArr = [];
      // "xxx {{a ? 'b' : 'c'}}"
      // => "xxx $"
      attr.value = attr.value.replace(/\{\{([^}]+)\}\}/ig, function (match) {
        matchArr.push(match);
        matchArr.push(match);
        return '$';
      });

      // => "xxx prefix-xxx $ prefix-$"
      attr.value = attr.value.split(' ').map(cls => `${cls} ${clsPrefix}-${cls}`).join(' ');

      // => "xxx prefix-xxx {{a ? 'b' : 'c'}} prefix-{{a ? 'b' : 'c'}}"
      attr.value = attr.value.replace(/\$/g, function () {
        const matchItem = matchArr.shift();
        return matchItem;
      });
    }
  }

  //如果节点为文本
  if (node.nodeName === '#text') {
    let data = node.data;
    if (data) {
      node.replaceData(0, data.length, replaceString(from, data, valPrefix, ignores));
    }
  }

  //递归处理子节点
  for (let i in node.childNodes) {
    if (!/^\d+$/.test(i)) continue;
    let n = node.childNodes[i];
    // 不转换template 定义
    if (n.nodeName === 'template' && n.getAttribute('name')) {
      bindTemplateEvents(n);
      continue;
    }
    bind(from, n, comPrefix, valPrefix, clsPrefix, ignores);
  }
}
17800
function dir2TreeStr(){
    argD = Type.isBoolean(argD) ? "./" : trimAndDelQuotes(argD);
    let dirJson,djOpt;
    try{
        djOpt = {
            // preChars:{
            //     directory: ":open_file_folder: ",
            //     file:":page_facing_up: "
            // },
            exclude:{
                outExcludeDir: true //将过滤掉的文件夹输出
            },
            extChars:{
                directory: " /"
            },
            maxDepth: argM
        };
        dirJson = dir2Json(argD, djOpt);
    }catch(e3){
        errorOut("Gen Json via dir failed: " + e3.toString());
        dirJson = false;
    }
    if(!dirJson){
        if(dirJson===null){
            warningOut("The directory '" + argD + "' is empty! (exclude-filter: .git|.svn|.idea|node_modules|bower_components )");
        }
    }else if(Type.isString(dirJson)){
        warningOut("The directory '" + argD + "' is '" + dirJson + "'");
    }else{
        // 间距配置和上面不一样
        s = Type.isNaN(s) ? 2 : s;
        v = Type.isNaN(v) ? 0 : v;
        jsonName = (djOpt.preChars && djOpt.preChars.directory || "") + argD.replace(/\\/g,"/");
        outputVal = false;
        _doMain(dirJson,true);
    }
}
1049989
function(param) {
      var step, start, res;
      //如果无参数 当成是获取第一个元素
      if (!param || !(param = param.replace(/\s+/g, ""))) {
        return {
          start: 1,
          step: 0
        };
      }
      if (res = nthCache.get(param)) return res;
      // 对even odd等转化为标准的a，b组合(即step与start)
      if (param == "even") {
        start = 2;
        step = 2;
      } else if (param == "odd") {
        step = 2;
        start = 1;
      } else {
        res = param.match(nthValueReg);
        // 对错误的nth参数抛出错误
        if (!res) step = null; // 无论其他参数，如果step为null，则永远为false
        else {
          if (res[1]) {
            step = 0;
            start = parseInt(res[1]);
          } else {
            if (res[2] == "-") res[2] = "-1";
            step = res[2] ? parseInt(res[2]) : 1;
            start = res[3] ? parseInt(res[3]) : 0;
          }
        }
      }
      if (start < 1) {
        if (step < 1) {
          step = null; //标志false
        } else {
          start = -(-start) % step + step;
        }
      }
      return nthCache.set(param, {
        start: start,
        step: step
      });
    }
1336955
private int fetch(State parent, List<Map.Entry<Integer, State>> siblings)
    {
        if (parent.isAcceptable())
        {
            State fakeNode = new State(-(parent.getDepth() + 1));  // 此节点是parent的子节点，同时具备parent的输出
            fakeNode.addEmit(parent.getLargestValueId());
            siblings.add(new AbstractMap.SimpleEntry<Integer, State>(0, fakeNode));
        }
        for (Map.Entry<Character, State> entry : parent.getSuccess().entrySet())
        {
            siblings.add(new AbstractMap.SimpleEntry<Integer, State>(entry.getKey() + 1, entry.getValue()));
        }
        return siblings.size();
    }
822202
public function get_tree($myid, $str, $sid = 0, $adds = '', $str_group = '') {
        $parent_id  = '';
        $nstr       = '';
        $number     = 1;

        //一级栏目
        $child = $this->get_child($myid);
        if (is_array($child)) {
            $total = count($child);
            foreach ($child as $id => $value) {
                $j = $k = '';
                if ($number == $total) {
                    $j .= $this->icon[2];
                } else {
                    $j .= $this->icon[1];
                    $k = $adds ? $this->icon[0] : '';
                }
                $spacer = $adds ? $adds . $j : '';
                $selected = $id == $sid ? 'selected' : '';
                @extract($value);
                $parent_id == 0 && $str_group ? eval("\$nstr = \"$str_group\";") : eval("\$nstr = \"$str\";");
                $this->ret .= $nstr;
                $nbsp = $this->nbsp;
                $this->get_tree($id, $str, $sid, $adds . $k . $nbsp, $str_group);
                $number++;
            }
        }
        return $this->ret;
    }
860151
public static String getAutoGeneratedId(Object po) throws SecurityException, NoSuchMethodException{
		String autoGeneratedId = "";
		//根据注解获取自增主键字段名
		Field[] allFields = po.getClass().getDeclaredFields();
		for(Field f:allFields){
			
			if("serialVersionUID".equals(f.getName())){
				continue;
			}
			
			//获取getter方法
			String getterName = "get" + StringUtils.capitalize(f.getName());
			Method getter = po.getClass().getDeclaredMethod(getterName);
			
			Id idAnno = getter.getAnnotation(Id.class);
			if(idAnno == null){
				continue;
			}
			GeneratedValue generatedValueAnno = getter.getAnnotation(GeneratedValue.class);
			if(generatedValueAnno == null){
				continue;
			}
			
			if(GenerationType.IDENTITY == generatedValueAnno.strategy() || GenerationType.TABLE == generatedValueAnno.strategy()){
				autoGeneratedId = f.getName();
				break;
			}
		}
		return autoGeneratedId;
	}
227325
function mix(target, source) {
        var args = _arrSlice.call(arguments),
            i = 1,
            key, self = arguments.callee,
            //如果最后参数是布尔，判定是否覆写同名属性
            ride = $.isBoolean(args[args.length - 1]) ? args.pop() : true;
        if(args.length === 1) {
            target = !this.window ? this : _cleanObj;
            i = 0;
        }

        while((source = args[i++])) {
            //source = [{a:1},{b:3}];
            if($.isArray(source)) {
                for(var n = 0, len = source.length; n < len; n++) {
                    self(target, source[n], ride);
                }

                continue;
            }
            //杂糅只允许对象
            for(key in source) {
                if(ride || !(key in target)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    }
275910
function tree(list) {
  const mapped = {}; // { id: name } 形式方便取值

  list.forEach((it) => {
    mapped[it.id] = it;
  });

  const result = [];

  list.forEach((it) => {
    if (it.pid === '') {
      result.push(it);
    } else {
      const parent = mapped[it.pid];
      if (parent) {
        if (!parent.children) {
          parent.children = [];
        }
        parent.children.push(it);
      }
    }
  });

  return result;
}
746314
function newInstance({Class, id, pageId}) {
  const typeofName = (typeof Class).toLowerCase();

  const ctDataMode = getTemplateConfig.call(this, pageId, "ct-data-mode");

  let Constructor;

  /***
   * 如果Class可以实例化
   */
  if (typeofName === "function") {
    Constructor = Class;
  }
  /***
   * 如果Class不可以实例化则用缺省的Page进行实例化
   */
  else if (typeofName === "undefined") {
    Constructor = Page;
  }

  if (!Constructor) {
    throw "页面管理类无法初始化";
    return false;
  }

  /***
   * 如果是singleInstance 或 singleInstanceResult
   */
  if (ctDataMode.toLowerCase().indexOf("singleinstance") !== -1) {
    if (!this.getSingleInstance(pageId)) {
      this.singleInstances[pageId] = new Constructor(this, id);
    }
    return this.singleInstances[pageId];
  } else {
    return new Constructor(this, id);
  }
}
634093
public synchronized long nextId() {
		long timestamp = genTime();
		if (timestamp < lastTimestamp) {
			// 如果服务器时间有问题(时钟后退) 报错。
			throw new IllegalStateException(StrUtil.format("Clock moved backwards. Refusing to generate id for {}ms", lastTimestamp - timestamp));
		}
		if (lastTimestamp == timestamp) {
			sequence = (sequence + 1) & sequenceMask;
			if (sequence == 0) {
				timestamp = tilNextMillis(lastTimestamp);
			}
		} else {
			sequence = 0L;
		}

		lastTimestamp = timestamp;

		return ((timestamp - twepoch) << timestampLeftShift) | (datacenterId << datacenterIdShift) | (workerId << workerIdShift) | sequence;
	}
37364
private static void mergeContinueNumIntoOne(List<Vertex> linkedArray)
    {
        if (linkedArray.size() < 2)
            return;

        ListIterator<Vertex> listIterator = linkedArray.listIterator();
        Vertex next = listIterator.next();
        Vertex current = next;
        while (listIterator.hasNext())
        {
            next = listIterator.next();
//            System.out.println("current:" + current + " next:" + next);
            if ((TextUtility.isAllNum(current.realWord) || TextUtility.isAllChineseNum(current.realWord)) && (TextUtility.isAllNum(next.realWord) || TextUtility.isAllChineseNum(next.realWord)))
            {
                /////////// 这部分从逻辑上等同于current.realWord = current.realWord + next.realWord;
                // 但是current指针被几个路径共享，需要备份，不然修改了一处就修改了全局
                current = Vertex.newNumberInstance(current.realWord + next.realWord);
                listIterator.previous();
                listIterator.previous();
                listIterator.set(current);
                listIterator.next();
                listIterator.next();
                /////////// end 这部分
//                System.out.println("before:" + linkedArray);
                listIterator.remove();
//                System.out.println("after:" + linkedArray);
            }
            else
            {
                current = next;
            }
        }

//        logger.trace("数字识别后：" + Graph.parseResult(linkedArray));
    }
1027790
private void select(int dataIndex, String[] resultList, int resultIndex, List<String[]> result) {
		int resultLen = resultList.length;
		int resultCount = resultIndex + 1;
		if (resultCount > resultLen) { // 全部选择完时，输出组合结果
			result.add(Arrays.copyOf(resultList, resultList.length));
			return;
		}

		// 递归选择下一个
		for (int i = dataIndex; i < datas.length + resultCount - resultLen; i++) {
			resultList[resultIndex] = datas[i];
			select(i + 1, resultList, resultIndex + 1, result);
		}
	}
959588
function (runtime, name, fn, config) {
            name = indexMapStr(name);

            var mods = runtime.Env.mods,
                mod = mods[name];

            if (mod && mod.fn) {
                S.log(name + ' is defined more than once', 'warn');
                return;
            }

            // 没有 use，静态载入的 add 可能执行
            Utils.createModuleInfo(runtime, name);

            mod = mods[name];

            // 注意：通过 S.add(name[, fn[, config]]) 注册的代码，无论是页面中的代码，
            // 还是 js 文件里的代码，add 执行时，都意味着该模块已经 LOADED
            S.mix(mod, {
                name: name,
                status: LOADED,
                fn: fn
            });

            S.mix(mod, config);
        }