query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
fd49cedea4fa17d632ea294b6a15d1c0 | 316ebc4ad8aac3f443deca082d415265 | 查询所有有效行业 | class Industry extends Model
public static function GetAll()
{
$result = Industry::where('display=1')->paginate(15,false,['query'=>request()->param()]);
return $result;
} | 1 |
d2daf6fa5dd439ed4412a52e430a330c | 812472fbd72a1cb7de714e5082bcbb5e | Metoda pozwala na zmianę karty. | namespace Patterns.Structural.Facade
sealed class ReceptionSystem
public Guid TakeMemberCard(Guid card)
{
Console.WriteLine("Change abonement card to key");
return Guid.NewGuid();
} | 1 |
db0f3839b1c561d0feeaafa78d59c214 | 2231f37ed96ceb3682975fe19538a3db | 获取帖子(A)中用户(B)的所有购买记录. | class PwThreadAttachBuy
public function getByAid($aid, $limit = 20, $offset = 0)
{
if (empty($aid)) {
return [];
}
return $this->_getDao()->getByAid($aid, $limit, $offset);
} | 0 |
98e22ac79090f6b8c5a3f36097829f3f | 249f78c2903f5c3eaed6f18e5c240111 | Creates Alert object containing text. Object disappears after a while or when clicked. | class Alert:
def __init__(self):
pass | 0 |
13d23374602520c736533138e8cbeade | 0e9cd2add6898322a21c0b1a90b8b615 | Playerのこライダーに侵入いした時に攻撃アニメーション | [RequireComponent(typeof(Animator),typeof(Rigidbody),typeof(ConstantForce))]
/*
* 敵の基底クラス
* Attacked:被攻撃
* EnemyAttack:攻撃
* Behave:行動
* Death:消滅
*/
public abstract class EnemyAbstractController : MonoBehaviour
protected virtual void OnTriggerEnter(Collider collider)
{
if(collider.tag == "Player")
... | 0 |
28c30dfd61de6f9e94bd60f8a80c9b31 | 63cc91b11dbb2b699ab319561c0db82c | Returns the ambiguous entities mapped to their possible candidates
from which humans need to manually choose the correct candidate. | def exists_geq(k, it):
true_it = (x for x in it if x)
c = 0
for _ in true_it:
c += 1
if c >= k:
return True
return False
ambiguations = defaultdict(lambda: defaultdict(int))
ambiguous_ents = set()
for file_ in files:
with op... | 1 |
ad0def9eb6465ba9d5389411bcc99479 | 2d1af8b0a598a78fc2db83205170af14 | Заполнение полей объекта Новость. | class Article
function fillFromArray($data = array()) {
if (isset($data['id'])) {
$this->id = $data['id'];
}
if (isset($data['title'])) {
$this->title = $data['title'];
}
if (isset($data['url'])) {
$this->url = $data['url'];
}
i... | 1 |
d96c374950279c51e46dc79a54564193 | fd3b7377f59324c5e814a97b6a4b03a5 | 获取格式化游玩时长 | class FinancialBase extends ActiveRecord
public function getTimesFormat($time)
{
if (empty($time)) {
return '0s';
} else {
$base = $time;
$i = 0;
while ($time / 60 > 1) {
if ($i >= 2) {
break;
}
... | 1 |
be3115e3bbcea4731faa105c299a4543 | 58ee50b809e319dc0b5d58b2e323748b | 增加友情链接分类 | {
if (isset($_POST['name'])) {
$data['type'] = "add";
$data['name'] = $_POST['name'];
$data['code'] = $_POST['code'];
$data['showorder'] = $_POST['showorder'];
$result = $this->model->Action($data);
if ($result !== true) {
... | 1 |
04768b81a32ab417f60b627bbc112976 | ec62147778daf5f889cb230794cbe0f4 | Specifies a list of table names to export. | class OtsBackupPlanOtsDetailArgs:
def table_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
return pulumi.get(self, "table_names") | 1 |
40577da7d70eecfb63d70fdb45644290 | 5ddd137bb2eb7eaed860b66f35dcb976 | 根据输入主帐号姓名查询主帐号是否在可以设置副手机号的登录名白名单中 | @Service("checkMainAcctPropertyService")
public class CheckMainAcctPropertyService
public boolean verifyNameNotInBlackList(String name){
boolean isIn = mainAcctDao.isInUapLoginNameBlacklist(name);
if(isIn){
return false;
}else{
return true;
}
} | 0 |
273bddaed3c24b5ea6a1670919a7a8ed | 39956ca02415eeb5ba473da785d11ac2 | 双击相机节点后的回调函数 | class CameraSequencerUI(QtWidgets.QMainWindow):
def handleItemDoubleClicked(self, index):
item = self.cameralist.model().itemFromIndex(index)
self.cameraSelectedSignal.emit(item) | 1 |
678ca75290cad0881d3d6df1b6c40029 | e33763bf28ccce2d9008800a65684cc1 | create
Creates a new upload with the provided properties.
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Upload created successfully </td><td> - </td></tr>
<tr><td> 0 </td><td> Lob uses RESTful HTTP response codes t... | export class DBClient
createUpload (data) {
return this._client.createUpload(data)
} | 1 |
f3a5ae6fd1d0209613be318cb5f1a7f1 | 2075f4ac8acfd1ccf221e100e098fbc5 | @brief Inicializace automatickeho modu - nastavovaciho casovace
vymaze priznaky, ze je validni nastaveni casovace | uint8_t regB;
rtc_read_reg(RTC_REG_B, ®B);
initialConfig = regB;
rtc_disable_update_int();
rtc_disable_periodic_int();
rtc_disable_alarm_int();
uint8_t regC;
rtc_read_reg(RTC_REG_C, ®C);
rtc_set_BIN();
rtc_init_fields();
return 0;
} | 1 |
d9cd6ca45ab436926e32bc13417ca5b6 | 6a0ca181cc1eb07f96d19dd608293b1b | 第四页弹幕 | $this->login_false();
$info=M('Danmu')->order('id desc')->select();
$count=count($info);
$Page= new \Think\Page($count,25);
if($_GET['p']<1){
$_GET['p']=1;
}else{
$_GET['p']=(int)$_GET['p'];
}
$list=array_slice($info, 25*($_GET['p']-1),25);
$sh... | 1 |
fd004d31115c3b69e9029b509734f911 | e045128d2e576d33b02bd7754222c7bd | 设置从上往下单列布局 | class HxbRecyclerview @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : LinearLayout(context, attrs, defStyleAttr)
fun setGridLayout(size: Int) {
val layoutManager = GridLayoutManager(context, size)
this.rvHxb.layoutManager = layoutManager
} | 0 |
2ae9107ebd1473157b2d95624cd581af | cddf455a48ee0f85a2dfab5bec1b2634 | 获取购物车中所有非购物车状态下的商品 | $map['userId']= session('oto_userId');
$isCarExists=M('car_session')->where($map)->field('car_session,userId')->find();
$WST_CART=unserialize($isCarExists['car_session']);
$shopcart = $WST_CART?$WST_CART:array();
foreach($shopcart as $key=>$cgoods){
$temp = explode('_',$key);
$goodsId = (int)$... | 0 |
86a260ee946126d5f148ad92348b2c06 | d9bedb71fa5d7e4e54a48d3ffaf5be69 | Returns array with the first and last values swapped | def first_and_last_swap(seq):
return seq[-1:] + seq[1:-1] + seq[:1] | 1 |
c545ede143f1e1b8a0fd504ed18ff3dd | 85e2256a61e93dc3c52ad2e012e764fa | deuxieme version de la fonction qui calcule la qualité d'un individu à partir de sa valeur,
obtenue par la fonction "decodage" | double fitness(node& c) {
double x;
decode(c, x);
return f(x);
} | 1 |
8541e5565819cea796a628589117f789 | 7841591137f4a38d89b3d5108b3f43ac | 计算每个batch中分类前n准确的个数 | def batch_acc(pred, label):
return torch.sum(pred == label) | 0 |
6d5c189367cc89e166294498579fb832 | 18f8dfdacb912432e024fd445abd6cbd | 将SQL拼接到 context | public SqlBatch batchWith(final String sql) {
return new SqlBatchImpl(this, contextWith(sql));
} | 1 |
690a6254bdb3cb9d4ca6225134b14cd3 | fe3f1ea84119f3b93d2a599445323eff | In bioinformatics, the template modeling score or TM-score is a measure of similarity
between two protein structures with different tertiary structures.
The TM-score indicates the difference between two structures by a score between (0,1],
where 1 indicates a perfect match between two structures.
< Zhang Y and Skolnick... | cmd = TMALIGN_PATH +" {0}/{1} {0}/{2}".format(PDBS_PATH, pdb1, pdb2)
results = subprocess.run(
cmd, shell=True, universal_newlines=True,
stdout=subprocess.PIPE
)
res = results.stdout
if score == 'rmsd':
return float(re.findall(r'RMSD=[\s]*([\d.]*\d+)', res)[0])
elif ... | 1 |
4c2dc07e725267494356163289fe542f | c9fc854c02e6f928619368c712eddff3 | 结束DB事务(根据$result结果 commit或rollback) | {
if ($all) {
while ($this->setTrans(false)) {
$this->driver::commit();
}
} elseif ($this->setTrans(false)) {
$this->driver::commit();
}
} | 0 |
46ae92fc024abb92325c0f915a534713 | 3cfd90c16ab6b2917435062bcfd7884a | 设置视频背景图片 | public class SimpleVideoView extends RelativeLayout implements OnClickListener{
public void setInitPicture(Drawable d){
mVideoView.setBackground(d);
} | 1 |
ff94d25a3fb59a5c70da18ca23bda52e | 9733e976036dd5ceee5a6099090e0412 | Find a shared library by name in a list of directories. | if name:
try:
lib = CDLL(name)
if lib._name:
return lib
except (AttributeError, OSError, TypeError):
pass
v = 'load'
else:
v = 'find'
raise OSError("couldn't %s lib %s" % (v, repr(name))) | 0 |
9face6af42ca0049cb638323a39c49a7 | 226683d09630a3f82f5117ff37561ec4 | 根据服务商id号审核服务商 | public void serviceAudit(@RequestParam(value = "form") String data){
Map<String,Object> result = new HashMap<String,Object>();
try {
companyProductService.serviceAudit(data);
result.put(Constant.RESPONSE_CODE, Constant.SUCCEED_CODE_VALUE);
result.put(Constant.RESP... | 0 |
447067393d321ea6e28e59e988a79f06 | b7a8b037c1a225b7a1a4357ada8d2f07 | Test if it finds a YAML config file. | class TestConfig(unittest.TestCase):
def test_find_config_file_yaml(self):
create_file(YAML_PATH)
self.assertEqual(YAML_PATH, config_util.find_config_file(CONFIG_DIR)) | 1 |
8d3039ccf3c36cafbdc8ca13ddbce70e | d9b39d66bc5ed6df25f46bf27a9af36f | 设置业务类型排序 | if(IS_POST) {
$member_type_db = M('member_type');
foreach(I('post.order') as $typeid=>$listorder) {
$member_type_db->where(array('typeid'=>$typeid))->save(array('listorder'=>$listorder));
}
$this->success('操作成功');
} else {
$this->error('操作失败');
}
} | 1 |
1ba5133f57fea9376052e8d7dc14f214 | 7a6167cf9db0830bb215746e1d950167 | Assert get_location_list when there are no locations returns empty
list. | loc = (1,2)
h = Herbivore(self.spes_island, loc)
loc_list = h.get_potential_coordinates()
assert h.probabilities(loc_list) is None | 0 |
e39a7e707473954e89aa7e4e6cf050b2 | 2ecb44d6e33676c40b0b20aa334eba4e | save holder in the storage layer | void XBridgeApp::storageStore(XBridgeSessionPtr session, const unsigned char * data)
{
if (!data)
{
return;
}
std::vector<unsigned char> id(data, data+20);
boost::mutex::scoped_lock l(m_sessionsLock);
m_sessions[id] = session;
dht_storage_store(data, (sockaddr *)&m_sin, m_dhtPort);
... | 1 |
dbfc4eddc0528636c039cbd2df2378e0 | 88bd9901652af624c782d5fea1761d1d | 预加载Mabinogi的资源文件夹 | function onPreLoad(game: Sein.Game<GameState>) {
game.resource.load({type: 'GlTF', name: 'miku.gltf', url: require('assets/gltfs/miku.gltf')});
} | 0 |
db102a668066deb4b412b310dbb94608 | aa314fadd0b3588910566260d6e674ca | Reorder the row positions | class OrderPhaseController(RestController):
def reorder(self, uids, delim=u'|'):
msg_fmt = u"reorder: uids='{uids}', delim='{delim}'"
LOG.info(msg_fmt.format(uids=uids, delim=delim))
accessor = OrderPhaseAccessor()
accessor.reorder_position(uids, delim)
return dict(status='succes... | 1 |
254ce6619c7034b7574529d831b6213b | 4c912b3b0557804a4beb44400ee3371e | Compute the growth rate. | class Crop:
def get_growth_rate(self):
return(self._growth_rate) | 0 |
dd4cf6e19d0717a10b4f753baad577b8 | 058b5ca88b14b0c3c33bb7ea76c56554 | 修复bssid | IllegalArgumentException, IllegalAccessException {
Field localField1;
if (!Build.MODEL.contains("HTC") && !Build.MANUFACTURER.contains("HTC")) {
return;
}
localField1 = WifiConfiguration.class.getDeclaredField("mWifiApProfile");
localField1.setAccessible(true);
Object localObject2 = localField1.get(co... | 1 |
8aa441dc2ed6216ff68d24c97ac3966a | d07511a265d3b7c663d01f3c526c77c9 | 获取代理服务地址:简单的轮询 | random_sql = """
SELECT ip, port FROM proxy_ip
ORDER BY RAND()
LIMIT 1
"""
result = cursor.execute(random_sql)
for ip_info in cursor.fetchall():
ip = ip_info[0]
port = ip_info[1]
judge_re = self.judge_ip(ip, port)
... | 0 |
0f98a1015a35d25e4ee8f4eacac6dada | 22f89e24fabc9d8489f3ff6f18d3f7d7 | Finds and displays a basicSetting entity. | class SettingsController extends Controller
public function show(Request $request)
{
$setting = Settings::find($request->get('id'));
return response()->json($setting);
} | 1 |
b65be01bd5b8dbdee917f05a07685744 | bb338586cbbb820e8c4d47d2869e35c8 | Finds the last race entry and the results. | RaceDto findLastRaceAndResultsWithPosition(int position); | 1 |
dd091ac9aa36b20dca0ac96ceb682064 | 22afb6704715324ef7b05140e58ee101 | 在bitmap中画矩形 | canvas.save();
int bmpWidth = bmpInfo.getBmpWidth();
int bmpHeight = bmpInfo.getBmpHeight();
canvas.clipRect(startX, startY, startX + bmpInfo.getRectX(), startY + bmpInfo.getRectY());
canvas.drawBitmap(bmpInfo.getBmp(), startX - currentFrame * bmpWidth / 8, startY - direction * b... | 0 |
46f4b7cdccd878d42215efd71cbe270c | ef002f76b29d5eaaa0245112e5cae43b | Exports the specified FileRecord to disk | public function exportTo($localPath); | 1 |
e59bac45f13194d884ae0a77a6b04fe3 | 98689f6097af8956184a00969fd424c1 | 获取阅卷状态 | $condition = array(
'sid' => $sid,
'exam_id' => $exam_id
);
$r = $this->exam_result->field('status')->where($condition)->find();
if($r){
return $r['status'];
}else{
return false;
}
} | 1 |
f73619205768bbb26caa1b0b6f9b0afc | 80424a21c55170cdad8dae39e5dcb14b | Translated from https://stackoverflow.com/a/14646734/8239386 | function copyTextToClipboard(text) {
var textArea = document.createElement("textarea");
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;
textArea.style.width = '2em';
textArea.style.height = '2em';
textArea.style.padding = 0;
... | 1 |
8b7393df33f82c3b45beb68fe1eae086 | 21fccaaff0727429db343140bac26d84 | Checks whether the current BoundingBox intersects a Ray.
The Ray to check for intersection with.
Distance at which the ray intersects the BoundingBox, or null if there is no intersection. | namespace WCell.Util.Graphics
public class OBB
public void Intersects(ref Ray ray, out float? results)
{
Bounds.Intersects(ref ray, out results);
} | 1 |
27df0dc8be0d336b664af7b7d2bf1aea | 8403d8617780fda083b78ed9af9ad9b4 | This prints the state of the network (the results of test cases, and weights). | class neural_network(object):
def show(self):
pass | 0 |
969fa19bd9860c8d0b0e560a003217d7 | a720a58949a8b15834e10ee003668014 | Compares the usernames of the given users and returns the longer of the two | tierDict = {"IRON" : 0,
"BRONZE" : 1,
"SILVER" : 2,
"GOLD" : 3,
"PLATINUM" : 4,
"DIAMOND" : 5,
"MASTER" : 6,
"GRANDMASTER" : 7,
"CHALLENGER" : 8
}
rankDict = {"I" : 1,
... | 0 |
ef029dae3576165922f3acfeb82449fa | 21b5a8f5cbd199900163faab5c0cd214 | Move the camera on the z-axis by a given number of steps in either direction. | VectorXYZ d = getViewDirection();
VectorXZ md = new VectorXZ(d.x, d.z).normalize();
move(md.x * step, 0, md.z * step);
} | 0 |
020d2a5fbbaf4a61231512083f30d046 | cd67d564b91273328b00b763c56446e8 | Only replaces first instance in case of repetition | namespace Monopy.PreceRateWage.Common
public static class StringHelper
public static string ReplaceFirst(string input, string oldValue, string newValue)
{
Regex regEx = new Regex(oldValue, RegexOptions.Multiline);
return regEx.Replace(input, newValue, 1);
} | 1 |
6ca0f937a1effe4306625bc7daf30201 | 3d1a1bbb1d5c783acfdc0d42dff3c4d7 | 根据查询条件获取对象SsFeedback列表 | {
var model = new FeedbackListModel
{
QueryInfo = queryInfo,
FeedbackList = new List<FeedbackModel>()
};
var query = from fb in Context.NHHCG_Feedback
join dc in Context.Dictionary.Where(a => a.FieldType == "... | 1 |
a31b0372b7e280cd993c6b4ff4d9cf5e | f0f210b97f1790bffd1763e56321eedd | reset calculated labels and entry boxes | int counter = 0;
for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board[0].length; j++) {
boxValues[i][j] = 0;
if (boxLabels[i][j] != emptyLabel) {
frame.getContentPane().remove(boxLabels[i][j]);
boxLabels[i][j] = emptyLabel;
System.out.println(boxLabels[i][j] + " ");
coun... | 1 |
613c7f12e451c62e685d09e23b1a2eca | 470e06f7d834a9deded24952abf72d1e | Méthode qui permet de définir le temps maximal | public class NumericQuestion extends Question
public void setMaxTime(long time) {
this.maxTime = time;
} | 1 |
10895c9910383ce9cdfeb5c1c3033031 | 2295941fb0669a4044b0e9af5c91b669 | Display the list of the overtime requests by the connected employee | try:
filters = {'employee':employee}
if status:
filters['status'] = status
if owner:
filters['owner'] = owner
return frappe.get_list("Overtime Request", filters=filters, fields=["name", "date", "workflow_state"])
except Exception as e:
return frapp... | 1 |
3604245a87ad16824a0db9f2f2def298 | 7b45d968ffb85b0379c8658f882ab4f0 | Get flag "validate while setting"
If unset the values will not be validated while setting them | abstract class AbstractPropelDataModelTask extends Task
public function setValidate($v)
{
$this->validate = $v;
} | 0 |
d6045b6705b752d3eea4f7e9b47a468b | 4562610ba595d0f969e55704377becf7 | Save parameters of the emitter. | void Emitter::Initialise(const glm::vec4& a_emitterPosition, float a_fVelocity, const glm::vec4 a_colour, const glm::vec4& a_emitterDirection, const glm::vec4 a_spread, float a_fLifeSpan)
{
m_emitterPosition = a_emitterPosition;
m_fVelocity = a_fVelocity;
m_colour = a_colour;
m_emitterDirection = a_emitterDirection... | 1 |
0d3b90ff08362fb9b7eb1bdd5ec3d3d9 | 43e903154b4c4d16a5d635e08fcb5541 | 展示商品类别及其下面的商品列表 | class TypesController extends Controller
public function index($id){
$alltypes = DB::table('types')->get();
$bread = $this->bread($alltypes,$id);
if(empty($bread)){
return redirect('http://localhost/lenovo/public/home');
}
$endbread = array_pop($bread);
$typelist = $this->checktypes($alltypes);
$all... | 1 |
0cc4e3bc1e76970ac36fa8bdc41690be | eafcf405f5a249d01b50cae68f8e7ce3 | Ask PBX Agent information | {
$pbx_bridge = PbxBridge::where('name', $this->data['BridgeUniqueid'])->first();
if (empty($pbx_bridge)) {
$pbx_bridge = new PbxBridge();
$pbx_bridge->name = $this->data['BridgeUniqueid'];
$pbx_bridge->save();
}
$pbx_channel = PbxChannel::where('n... | 0 |
f8d28f9321cd3024117fc0efc955ae52 | 6c0c175a012881d08baa52d1e11924e5 | 生成分销关系链 | class relationModel extends Model
public static function generate($fans)
{
if(!$fans || !$fans['fanid'])
return false;
$user = new MappingFans();
$user->fans = $fans;
$model = array(
'id'=>$fans['fanid'],
'openid'=>$fans['openid'],
'uni... | 1 |
77493f5afb87f9e3a8f3679b6d4ae8f7 | 07a4048493697c8825af5ccd79d81cb5 | Método para devolver a estilização da tag <tr> | class MultiAnexos
public function setCssTableTr($css)
{
$this->_table_tr = $css;
return $this;
} | 0 |
ecbd61495e93eab4369355afa0d1efb4 | 473bc590e892457a76029d9def6c440b | 获取酒龄(小时) | public class Petctjiancha extends BaseEntity
public String getShenzhuanyir() {
return shenzhuanyir;
} | 0 |
ada182fe4a4f1f7b6a4b687c850b85e9 | dd7f440007ff5095f0e574d4400cc1ce | Runs test for create from key throws exception with white space configuration key. | tested.setName("");
try {
tested.getKey("arbitrary string");
fail();
}
catch (IllegalArgumentException e) {
}
} | 0 |
77e75e30cb0fb0df96c1b69065bd7624 | 460ee1100fb1b3fc197f4b0a14870a96 | Tests exception with empty path. | {
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage("Missing path");
$logger = new Logger();
$logger->log("");
} | 1 |
dad81e79664cbcdfc99921a829a0f89c | eb707890afc188eb19202dbb8e8076c9 | Returns the payload identifier for this encoding (as specified by RFC 3551 or a dynamic one). | public class BerBitString extends BerObject
public BerIdentifier getIdentifier()
{
return gIDENTIFIER;
} | 1 |
b01c9d689214c5baff534d090772cc2f | 95ba95444afba04719887b1f34697b80 | Seeks to a specified percentage into the song | namespace MagicLeap
public class MusicServiceExample : MonoBehaviour
private void Seek(float sliderValue)
{
uint targetMS = (uint)(_trackLengthMS * sliderValue);
float currentValue = _trackHeadPositionMS / (float)_trackLengthMS;
if (Math.Abs(currentValue - sliderValue) < ... | 1 |
58110ea4816b056df45ca7a6c9662f3e | a88a5e30783154285ea532e6f7c2dffd | convert to string and html-escape given value (of any type) | function EZdisplayObject(obj,name,opts/* legacy: indent=opts */)
function EZformatObjectProcess(obj, name, opts, local)
function getValueString(value,format)
{
if (isHTML)
{
return value
+ (value.right(3) == '...' ? ''
: EZdisplayObject.EOL_MARKER);
}
if (opts.showtype)
return value;... | 0 |
de583c6d0ae2b844d13770ef406e5201 | eda036a6352210f2514b6737e224143b | Test if the connection between the server and this client is lost. | class XMPPHandlerTest(unittest.TestCase):
def test_connectionLost(self):
handler = subprotocols.XMPPHandler()
xs = xmlstream.XmlStream(xmlstream.Authenticator())
handler.makeConnection(xs)
handler.connectionLost(Exception())
self.assertIdentical(None, handler.xmlstream) | 1 |
793012d7f053c94bbc93565a92a6c2ce | ef3ff47537e89c04099803a645aaf8f2 | Return the value of the last data.
Throw Exception if the queue is empty. | int getValue() throws IllegalStateException, BufferUnderflowException; | 1 |
dd7c60e8ce5271ceea915b0b96a4b58a | 61449a09bdff92c9b479c1b936b44ec8 | gckOS_GetPageSize
Get the system's page size.
gckOS Os
Pointer to an gckOS object.
gctSIZE_T * PageSize
Pointer to a variable that will receive the system's page size. | SIZE_T GetLargePageSize()
{
HANDLE hToken = 0;
LUID luid;
TOKEN_PRIVILEGES tp;
OpenProcessToken (GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken);
LookupPrivilegeValue (NULL, TEXT("SeLockMemoryPrivilege"), &luid);
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
tp.Privileges[0].Attributes = S... | 0 |
694f16dce205c714bf13a8d887e15486 | 6feaedeabeabfffe594435941e5fdb2c | 获取空闲连接测试语句 | class ConnectPool(object):
# 这是yml配置文件读出来后,转为字典
def get_pool_free(self):
self.__lock.acquire()
count = 0
for connect in self.__connects:
if connect.get_free():
count += 1
self.__lock.release()
return count | 1 |
0421e7900d146f013788ef7d42002a0a | 0eac425092c0bc10ff05cf33cc002dda | 判断对象是否有某个原型属性 | function hasPrototypeProperty(object, name) {
return !object.hasOwnProperty(name) && (name in object)
} | 1 |
8904c0b17d88740373d03708d5f1d44e | 4fe27b1383689a0cc2427b49d1874845 | Возвращает HTML код с продуктами данного каталога | {
$catId = getCatId($catName, $errors);
if ($catId != null)
{
$productsFromSameCategory = getProductsFromSameCategory($catId, $tags, $errors);
$imagesArray = getProductImages($catId, $errors);
}
if (empty($errors))
{
$itemsInRow = 0;
$position = [ 0 => 'left',
... | 1 |
e48bbc93d31556bf7c74c31571ba4004 | 841bfe8d808dfaa26cb1bb28ec4dec92 | 查询咨询分类列表GET | function consultList () {
return axios.get('/api/user/consult.json')
} | 1 |
614b90eb90ea6f89b82dbb92914bc1d4 | fe46cfc3daa1569f75e6874b4cf73117 | 查询 CC 攻击日志 | namespace TencentCloud.Yunjing.V20180228
public class YunjingClient : AbstractClient{
public DeleteAttackLogsResponse DeleteAttackLogsSync(DeleteAttackLogsRequest req)
{
JsonResponseModel<DeleteAttackLogsResponse> rsp = null;
try
{
var strResp = this.In... | 0 |
75a1756729f650831b67bda31b763e04 | 72af9db978740d8939f88d5486a7a387 | Paint a round background for all selected cells. | Graphics2D g2 = (Graphics2D)g;
g2.setStroke(new BasicStroke(1));
Coord c = SpreadsheetEditView.selectedCoord;
System.out.println(c);
for (int i = CELL_WIDTH; i < width; i += CELL_WIDTH) {
for (int j = CELL_HEIGHT; j < height; j += CELL_HEIGHT) {
g2.setStroke(new BasicStroke(3));
... | 0 |
cc1e249dfe5ecf65515a4ee361b3cc1f | 3d1ced418a40f0f469adc3789771c5fd | Append a switch table with specified row count. | namespace AutoBogus
TBuilder WithDataTableRowCount(Func<AutoGenerateContext, int> count); | 0 |
f5caaea0af2df8dd6e64bd039fff3405 | 5375a6fb6124c301cce833ffefe9af41 | Поэлементное сложение двух матриц | {
if (matrix1.GetLength(0) == 2 && matrix2.GetLength(0) == 2 &&
matrix1.GetLength(1) == 2 && matrix2.GetLength(1) == 2)
{
double[,] ans= {
{0, 0},
{0, 0}
};
ans[0, 0] = matrix1[0, 0] + ma... | 1 |
6f42df9fab82e275f4fbf45c2aad63d2 | d1e02f9afdba2b51cf808314e3a999fd | Setup the dummy api from _common. | iiqtools_gather_info.iiq_api = MagicMock()
self.fake_response = MagicMock()
self.fake_response.read.return_value = '{"foo":"bar"}'
iiqtools_gather_info.iiq_api.make_request.return_value = self.fake_response | 1 |
50e5b072670f6b006b6906baa6dca66e | 52fd78e323480fd068ce1287148de3d2 | Main function of the program.
Reads the data, and substracts each image from its baseline | def biassub(input_image, input_masterbias) :
import os, sys
from pyraf import iraf
iraf.imarith(operand1='@'+input_image, op='-', operand2=input_masterbias, result='z@'+input_image)
print('Masterbias is subtracted from the images.') | 1 |
f7380a158e709974ae9f23abc53130a6 | f0b07bd502010e9ed180de1648febb4e | Confirm IPN data using string raw post data.
Using the raw data overcomes issues with unicode and urlencode. | {
$paypalAPI = new PaypalPaymentsStandardAPI();
$paypal_info = $paypalAPI->decodeArray($posted_data);
$decoded_args = array_merge(array('cmd' => '_notify-validate'), $paypal_info);
$response = $paypalAPI->request($this->gateway_api, $decoded_args);
return new IPNIdentityValid... | 1 |
b3fd89b5376d0fb22f4f26974cb3d248 | 48d897443225180e506ff0a9d315656e | 离职原因发生更改 | function duty_vaca_reason() {
$(this).attr({
"data-toggle":"modal",
"data-target":"#duty_viewVacation"
})
duty_vacaModel($(this))
} | 0 |
e3e537b1df6e71eb0648f465bf98d926 | be3ad7205b1376632a64f05f8df879af | Resets the exponential backoff, indicating a successful polling. | namespace Premotion.Mansion.Http
public abstract class BackoffStrategy : DisposableBase
public abstract void Reset(); | 1 |
529fb9afc9702e585146822480dea719 | a9dda9f0bc8f8392027e944934bb9967 | Retourner le chemin absolu du fichier téléchargé | class Annonce extends \Business\AnnuaireBundle\Entity\Annonce implements \Doctrine\ORM\Proxy\Proxy
public function getAbsolutePath()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getAbsolutePath', array());
return parent::getAbsolutePath();
} | 1 |
04ee986ec64f4a4d2cf782b6007df134 | 2cc73b204740a59daafb3f6fd8a77d21 | this is executed when the title bar is clicked to move the window | void TitleBar::mouseMoveEvent(QMouseEvent *me)
{
if (mMaxNormal)
return;
mainwin->move(me->globalPos() - mClickPos);
} | 1 |
14456792c58316feeed8c8f95f0a2aaa | d2935e6eed9eded55ba0667f4e2ca3b0 | 유저의 캠페인 리스트 가져오기 | @Controller
public class HomeController
@ResponseBody
@RequestMapping(value = "/getUserFestivalList.do")
public ResultUtil getUserFestivalList(HttpServletRequest request, HttpServletResponse response, ManagerVO vo) throws Exception {
ResultUtil resultUtils = managerService.getUserFestivalList(vo);
return resultUtil... | 0 |
1e9aaa08ce503ed79d0c3847039131bd | 30af1df8c17ba4a5ece518e200046792 | 獲取客服所接待的用戶 | {
$sql="select * from `odm_chat_user` where `kefu`='{$kefu}' and is_online = 1";
return self::$db->query($sql);
} | 1 |
097de0466c29d9796ef8fbafc65d3d62 | 56dd339ce69432422cb7b5ae4e8b6ee0 | address of the interface on which the request was received. | Ip4Address interfaceIpAddress(); | 1 |
a4028ccd14aef15b65cd51b7d46bdef4 | ef8cd84951cdd2482638ec9dba86e1cc | Calculate the external physics of the drive cycle | drift_kin, drift_vel, drift_time = self.calc_drift(goal, epsilon)
if drift_time > max_time and max_time > 0:
distance = abs(goal - self.value) - epsilon
F_fric = - (self.mass * self.gravity) * math.cos(self.angle) * self.friction_kinetic
F_move = - (self.mass * se... | 1 |
24f7132e55ce8aed50265a2cca9bfccf | dac069e2b71da05a4ac1ebbc686b9fef | See if the sidebar has been slotted so that we can display or not | class Admin extends Base
public function hasSidebar()
{
return (bool)$this->_showSidebar;
} | 1 |
c5c2d6954dd9142b439eec1b3cfb9712 | 93ab57238611160cf237c2694f5e8b9f | Method to get Mutual Fund Value | class EquFactorVs(Equ):
def MktValue(self):
MktValue1 = self.df_sb['total_mv'].fillna(0)
return MktValue1 | 0 |
243bc8a8ba6bba733f8ae3fea1cb8d84 | c03d0b1afd5de8b33fc9d0e32ac04872 | 根据子id获取父列表 | class Unlimit
public function getParentByChild($data, $child_id, $p_key = 'p_id')
{
$arr = array();
foreach ($data as $item) {
if ($item['id'] == $child_id) {
$arr[] = $item['id'];
if ($item[$p_key] != 0) {
$arr = array_merge($arr, $t... | 1 |
c019314f57bdcc3cc0f96a14b2c685b3 | 41be23e2cecdd3c5ff073e18b8bb37cb | Calc the euclidean distance between the expression profiles of 2 nodes. | node1 = root.get_child(node1_name)
node2 = root.get_child(node2_name)
dist = np.linalg.norm(node1.exp - node2.exp)
return dist | 1 |
1932b925ac157c4d0f944e1d344d9813 | 80f9f3882ac5386bb80bf46229cd6d9f | check to see if there are any pending eligibility forms to be completed | const incompletePages = this.pageCheckList.filter( x => x.isComplete !== true );
return (incompletePages.length !== 0 ? false : true );
} | 1 |
8510cc4c66138380c3858741df8cdceb | 3d1cf95eadf00116481ce8d019e1b816 | 计算区块头部 hash | record := string(block.Index) + block.Timestamp + string(block.BPM) + block.PrevHash
sha3 := sha256.New()
sha3.Write([]byte(record))
hash := sha3.Sum(nil)
return hex.EncodeToString(hash)
} | 1 |
50bb018585679f8fdfcdbf80d5c6cf35 | 9111dff3548bafd3f747e6424ab56482 | Expect 404 not found response code and end the chain | class NotFoundHandler(requesthandlers.APIHandler):
def get(self):
return 0 | 0 |
697cd9b2763ac0bb18d1bdd4339c5dad | 4ff913ebbbf69fa263e8225b55b7adf8 | Set the availability of the device. | {
if (!isset($available) || !is_bool($available)) {
throw new InvalidArgumentException(sprintf(
'The availability must be a boolean value.'
));
}
$this->available = $available;
return $this;
} | 1 |
b3ba1640f8422077e15cd7cb03ce5aa0 | 4fe50b6a81bc5640e298a1c5c41737cd | Complete a transfer of AVAX from the X-Chain
to the C-Chain.Before this method is called, you
must call the X-Chain’s `exportAVAX` method to initiate
the transfer. [More Info](https://docs.avax.network/v1.0/en/api/platform/#avmimportava) | let _lock = COINS_LOCK.lock().unwrap();
let timeout = now_ms() / 1000 + timeout;
let client = match coin.as_ref().rpc_client {
UtxoRpcClientEnum::Native(ref client) => client,
UtxoRpcClientEnum::Electrum(_) => panic!("Expected NativeClient"),
};
let from_addr = get_address_by_label(c... | 0 |
b02b8974b0210013ee1e344b90a94149 | 8eff2cfdfba6bfb61851ffa66ccee5a7 | 返回入/出站记录dataframe | sub_path = os.path.join(self.save_path, self.port_name)
self.port_return = pd.read_csv(os.path.join(sub_path, self.port_name + '_PortReturn.csv'),
index_col=[0], encoding='gbk')
self.port_return.columns = self.port_return.columns.map(str)
self.port_... | 0 |
7612910391b1f850a31031021c393f94 | 2a67a6ab35a28bbc03fb2765a0ccce3d | 调用策略枚举中的方法,计算工资 | class Bonus
getBonus() {
return this.strategy.calculate( this.salary );
} | 1 |
47ffa9966b15ff061f6e99fbfe5c1456 | a05a8ef74d7c7611785365b052860d8f | Method is triggered when a setting value in the property grid
has changed. | namespace Marble.Views
public partial class SettingsView : UcBase
void OnSettingAdded(SettingAddedEventArgs args)
{
Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
{
RefreshPropertyGrid(args.SettingModuleName);
}));
} | 0 |
07c22cb52e880eb304cbe47c73891c79 | 753f65a9c99df94ff51378293cb5ce45 | 采集页面的班级ID | function getClassId(){
return $("#class_id").val();
} | 1 |
7d0d730ec6a0eb3cbea29ae423b293ff | 0dcd114bbb64390f0a27dcae5e6ec167 | Checks if the qualifier ID is valid. | static boolean qbi_svc_id_is_valid
(
qbi_svc_id_e svc_id
)
{
return (svc_id > QBI_SVC_ID_UNKNOWN && svc_id < QBI_SVC_ID_MAX);
} | 1 |
1ade38cad90821ba04d61cf83bd7afd4 | fd79d4d019abf6b9079ea6ea1c35f455 | Notify reception of a message on control channel. | if self.dataReady('control'):
message = self.recv('control')
if isinstance(message, Axon.Ipc.producerFinished):
self.send(message, 'signal')
return True
self.last_control_message = message
return False | 1 |
293ac9bbd5b4f7eee5762b41063b51a0 | 27b7f9ef4a2e61a25290498591a97668 | Subprogram to build the path from the <see cref="AdvancedEnemy"/>'s current <see cref="Tile"/> to the specified end <see cref="Tile"/> | {
pathLane.laneTiles.Add(startTile);
Tile newTile = startTile;
bool endBuild = false;
while (!endBuild)
{
newTile.adjacentTiles.TryGetValue(direction, out newTile);
if (newTile.laneID.Length > 0)
{
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.