query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
323ffdcfda061330f6562939bd31725f | 8a57e94796a4d98342f1ca0d6d0cd338 | Return a tuple of strings that match the regular expression pattern. | mt = re.search(regx,line)
if not mt: return None
return mt.groups() | 1 |
d9056ecaab33af0ab1ff1da2d48a1259 | 5778ac6ee6ec742ca3cbe94bfdc8609d | Specifies the resolution, in DPI.
The default is 72 DPI. | int hpgs_image_set_resolution(hpgs_image *_this, double x_dpi, double y_dpi)
{
if (!_this->vtable->set_resolution)
return 0;
return _this->vtable->set_resolution(_this,x_dpi,y_dpi);
} | 1 |
be2ed2ee7682388160da80d99172e921 | ae150d26ce980373dc2929a9d7f4123d | Checksum extended TCP header and data. | {
bool fOdd;
uint32_t u32Sum = rtNetIPv4PseudoChecksum(pIpHdr);
u32Sum = rtNetIPv4AddUDPChecksum(pUdpHdr, u32Sum);
fOdd = false;
u32Sum = rtNetIPv4AddDataChecksum(pvData, RT_BE2H_U16(pUdpHdr->uh_ulen) - sizeof(*pUdpHdr), u32Sum, &fOdd);
return rtNetIPv4FinalizeChecksum(u32Sum);
} | 0 |
6b60e743ab777bcb149a6a19580c4811 | 11f281e30610cc14bc033140f1616332 | Sortiert die Dateien mit den aktuellen Sortiereinstellungen. | void FileSort::Sort(void)
{
this->Load();
this->items.sort();
this->Save();
} | 1 |
cb7bb5db11d4b4ff74fc8ef7a200d467 | 2d8b0f25ea39e0b950f188022e4f82c5 | encrypts the string by multiplying it by the key. | self.last_function = "MUL"
if key != None: self.key = key
output = ""
for i in xrange(len(org_str)):
character_num = ord(org_str[i]) * self.key
while character_num > 255: character_num -= 255
while character_num < 0: character_num += 255
ou... | 1 |
10f0e6794d5b20a25bf65e316c17fb7b | 9dd879bc9fc3f67ae48af95c3f8034d1 | Callback for response to seek() device method. | class AisPlayerDevice(MediaPlayerEntity):
async def async_media_seek(self, position):
if position == 0:
val = -5000
elif position == 1:
val = 5000
else:
val = position * 1000
self._media_status_received_time = dt_util.utcnow()
self._med... | 0 |
73429c051fbc6af0b815104546654c6a | 63680f8cab3320c7afae616098f6b175 | Return DataStructureElement object with the given id | DataElement getDataElement(String dataElementId); | 0 |
42c37941bacc04e33e767d3af9eec162 | 40bb119bd2be6232cad2413997bd8f12 | 通过稿件编号更新稿件信息 | public ArticleBean update(ArticleBean articleBean)throws ServiceException; | 1 |
bdda2bd9007280410e5e66091c599fd4 | adc2ef1449f0fb8b4733f02fde38e2c4 | Transforms [center x, center y, width, height] to [xmin, ymin, xmax, ymax]. | boxes = tf.cast(boxes, dtype=tf.float32)
boxes_transformed = tf.concat(
[(boxes[..., :2] + boxes[..., 2:]) / 2.0, boxes[..., 2:] - boxes[..., :2]],
axis=-1
)
return boxes_transformed | 1 |
d15932fb442dc123cecf5aa256198f8b | 9815b846992beec3bb4934832b67df6b | Sets a TLS/SSL session ID to be used during TLS/SSL connect.
This function sets a session ID to be used when the TLS/SSL connection is
to be established. | e_sslResult_t sslSoc_setCtxSess(s_sslCtx_t* ps_sslCtx, l_sslSess_t s_desc)
{
int ret;
assert(ps_sslCtx != NULL);
if ((s_desc != SSL_INVALID_SESSION )
&& (sslSesCache_getById(ps_sslCtx->ps_sslSett->ps_sessCache, s_desc)
== E_SSL_SESSCACHE_HIT))
{
ret = E_SSL_OK;
}
else
{
ret = E_SSL_ERROR;
}
if (s... | 1 |
710ba42f167ff56175c783c556935514 | 0aa6b171812a3a5bd8e0efd3f11be663 | Tests the conversion of the old style VA publisher to the replacement placeholder object, strict unit test | potsource = 'msgid ""\nmsgstr ""\n'
posource = '#: obsoleteme:10\nmsgid "One"\nmsgstr ""\n'
newpo = self.convertpot(potsource, posource)
print str(newpo)
assert len(newpo.units) == 1 | 1 |
ad9f646c9b306536c8bd8bea5f2017ff | 674181d8d4169d1eba05f7a15a206b07 | Sets which type of modmail to use on this guild. | {
m_JoinType = type;
if (type == _enGuildJoinMethod.eGuildJoinMethod_Free)
{
m_GuildJoinMethodLabel.text = StringTableManager.GetData(6233);
}
else if (type == _enGuildJoinMethod.eGuildJoinMethod_Approval)
{
m_GuildJoinMethodLabel.text = String... | 0 |
5a646dd50643345ba32767184bba3aa8 | 57ba5c25cb1b206a9989e09ed52de493 | 设置报损单 | @RequiresPermissions(value="商品报损")
public Map<String, Object> save(LossStatement lossStatement,String lossGoodsToJson) {
Map<String, Object> resultMap=new HashMap<>();
User currentUser=userService.getUserByUserName((String)SecurityUtils.getSubject().getPrincipal());
if (lossStatement!=null) {
lossStatement.s... | 1 |
503ca3fa20920e39771637fe48705b50 | 00e1ea576a6e58bf3239b4936b62cc51 | ===========================================================================
DESCRIPTION
Process REQ message from Framework
=========================================================================== | ProcessSerPortReq (_NEAR_ MsgPkt_T* pReq,int BMCInst)
{
INT8U ResLen;
INT8U HandShake;
MsgPkt_T Res;
INT8U EnRes [MAX_SERIAL_PKT_SIZE];
_FAR_ BMCInfo_t *pBMCInfo = &g_BMCInfo[BMCInst];
if (0 != ValidateSerialCheckSum (pBMCInfo->SerialConfig.SerialPkt, pBMCInfo->SerialConfig.... | 1 |
d93e13c3a4fecce31f5fde729bed68d4 | 286d81a6a6988e89f242ee682b1d8c29 | Returns the incompatibility of the truth values of this GroundRule's GroundAtoms given
the replacment of a single atom's value with another value.
This method should only be used by callers that really know what they are doing.
Incompatibility is always non-negative. | switch (LHS) {
case Primitive:
switch (RHS) {
case Primitive: return Primitive;
case Modifier: return Primitive;
case Invalid: return Invalid;
}
case Modifier:
switch (RHS) {
... | 0 |
8125f8710bfc398aba83a892629946be | 2eb883b6a21dc3ff164ad22ee4ea2ce7 | 删除真正的士兵对象(从地图上视觉上移除这个兵) | namespace Avocat
public class BattleMap
public void RemoveObj(BattleMapObj obj)
{
Debug.Assert(obj == null || obj.Map == this, "the warrior is not in the map");
FindXY(obj, out int x, out int y);
objs[x, y] = null;
} | 1 |
fa91cec266942d1ac877aa91c2332af0 | 762483c624e88ae8a5f04ba34bdcc5dd | Prints a message in the console and return the value set by the user.
If the line returned is empty, a default value is returned
If the line is "**", null is returned. | {
PrintLn(prompt);
PrintLn($"Default value is : {defaultValue}");
string inputString = Console.ReadLine();
if (inputString == string.Empty)
{
return defaultValue;
}
return inputString;
} | 0 |
efe4435e465eac7547a42aeba1a94254 | 7ae5f1b5f212f6be2e9faff940844cec | Computes the minimum vertex cover of the graph. | public Collection vertexCover(); | 1 |
88bf3fff92609206c6ce53dece259e50 | d953340250f0cfff728d1f085cb3a71d | 根据区域id,开始和结束日期查询该区域当前时间段内,上期(30天前)、去年同期、前年同期的最高温和最低温数据 | def getAllTrendingResBetweenByregion_id():
handler = StatiscHandler()
return handler.getAllDailyRes_BetweenBySenate() | 0 |
f96f4c2b8688c76a8955b4ab4301ec73 | 52291905c87beb38085bd58c6912130d | Sends the relevant data and control information to the next stage by calling two methods of the next stage | void sendCurrentStage( Order order ); | 0 |
36ea9ee8654709f17a5342db60fb4115 | 91dc52be3a632d7318790a56e49fceea | This method assumes the video id is valid and that a video with that id exists!<para>This method returns fresh api data from the YouTube api.</para> | def video(video_id):
r = requests.get("https://www.googleapis.com/youtube/v3/videos?key=" + getGoogleKey() + "&id="+video_id + "&part=snippet,id,topicDetails,contentDetails,recordingDetails,statistics,status").json()
print("https://www.googleapis.com/youtube/v3/videos?key=" + getGoogleKey() + "&id="+video_id + "&... | 1 |
ced06f5a21346604d95e875515a6b278 | 8e8bd9f243c315d6f8090b00546f09a1 | Emit a notification that the endpoint was reconfigured. | self, entity: Union[str, dict], attribute: str, old: str, new: str, kwargs: dict
) -> None:
if self.enabled:
self._start_notification_cycle()
else:
self._cancel_notification_cycle() | 0 |
da6b17dbb73e046bd2dd69d353bbacb7 | fbba1d92d1ff2bcb61d101386a7da61f | Returns the text body template name. | class InvitationEmail(EmailTemplate):
def body_template_name(self):
return 'kdo/emails/invite_%s.txt' % get_language() | 1 |
699e9e7f6aeaef7e1b5cbc7c55842c0d | 7b6c4f0ecc4f9bed58db8955e2a3cd65 | 获取所有JobDetail | public List<JobInfo> getAllJobDetails(){
List<JobInfo> allJobInfoList = new ArrayList<JobInfo>();
List<? extends Trigger> triggerList = null;
try {
List<String> allJobGroupNamesList = this.scheduler.getJobGroupNames();
Iterator<String> jobGroupIterator = allJobGroupNamesList.iterator();
while(jobGroup... | 1 |
a59b6a08dd241b900d2f2a43c1eabacf | 1125f3ae103af60bb3cac11a5e1acb55 | This method sets the table shortcuts. | class redmine11ConvertModel extends redmineConvertModel
public function setTable()
{
$dbPrefix = '';
define('REDMINE_TABLE_ATTACHMENTS', $dbPrefix . 'attachments');
define('REDMINE_TABLE_AUTH_SOURCES', $dbPrefix . 'auth_sources');
define('REDMINE_TABLE_BOAR... | 1 |
4f9ae5a48c2e713aeebf13fdea1c2020 | 4beaaec54ab6b5f5f764fbe0417737ef | Remove comments with /* */, // or #, if they occur before any other char on a line | {
int curStart = 0;
int curBreak = 0;
while ((curBreak = txt.IndexOf('\n', curStart)) >= 0)
{
if (txt[curStart] != '#' && txt[curStart] != '@')
{
txt = txt.Substring(0, curStart) + txt.Substring(curBreak + 1);
... | 0 |
7e1f287c4c8033f37440898c68ad792d | d6561cd361fcf13d430788e3a105f499 | Create GRPC connection to the node agent. | def _connect(server):
if server is None:
server = core._global_server()
stub = field_pb2_grpc.FieldServiceStub(server.channel)
return stub | 1 |
f7ce346bb3f008f9ca2bfea7b99806ff | f01529a69c2cfe6a646a2f7beb56d192 | modify oembed output to force ssl on youtube videos | if ( isset( $providers['#https?://(www\.)?scribd\.com/doc/.*#i'] ) ) {
$providers['#https?://(www\.)?scribd\.com/doc/.*#i'][0] = 'https://www.scribd.com/services/oembed';
}
return $providers;
} | 0 |
ec771ae978d5414a2eb55aefff550a43 | 6b29a688f23937faa63f645c7566dbcc | WAVEファイルの保存確認処理を行う。 | {
while (true)
{
Thread.Sleep(10);
var wcm = new WindowControllerManager("音声ファイルの保存");
var dlg = wcm.GetTop();
if (dlg == null) continue;
if (wcm.GetChiledByClassName("Edit") =... | 1 |
3364d961b15a40a65572ae0b5eff9bf0 | f64b2c5c928b4c84fb57e7329a69a1c6 | Returns:
bool: Whether to do a case sensitive comparison over the stop words (default: false) | class Radio(object):
def anchor_case_sensitive(self, anchor_case_sensitive):
self._anchor_case_sensitive = anchor_case_sensitive | 0 |
372e36ec4dad0fc0d55562698a6a859c | cdc734e95be51e76392ddb3703694839 | returns true, if symbol is not a latin letter | expect fun Char.isISOControl(): Boolean | 0 |
0ce2b28e815e838dff0ba6a77dea0de2 | d941feb5f22901b33f9ef29316581a82 | Generator to be passed to fit_generator, predict_generator, etc. using Keras interface. | class DeepECGV4(object):
def create_generator(self, path, mode, batch_size):
return DataGenerator(path=path, mode=mode, shape=[self.length, self.channels],
batch_size=batch_size, prefetch_buffer=1500, seed=0, num_parallel_calls=32) | 1 |
2d66aff3b233e79e78d7b85ba911a001 | 05d8f70ea3edf521b654bc24f9726e49 | 模拟字符串+1:从后到前逐个计算置换,注意溢出处理 | int num=0,i=0;
for(;s1[i]!='\0';++i){
int k=s1[i]-'0'+s2[i]-'0'+num;
s1[i]=k%10+'0';
num=k/10;
}
if(num!=0)
s1[i++]=num+'0';
s1[i]='\0';
} | 0 |
335375a33d7b6e7a7697b52777b9554b | 53d1e3b31e343fda0761ef710172f161 | GPS无效点过滤 | {
if (point.getLongitude() < 73.33 || point.getLongitude() > 135.05 || point.getLatitude() < 3.51
|| point.getLatitude() > 53.33)
{
return point;
}
WGS84ToGCJ02 convert = new WGS84ToGCJ02();
return convert.getEncryPoint(point.getLongitude(), point.... | 1 |
b54e9fbb9d817e757478559583114421 | f815242c4ef55bb6762877dedfac52c8 | Get the digest (an MD5 digest of the non-keyword expanded flavor of the revision) for the default revision. | def default_digest_algorithm():
return app_settings.DEFAULT_DIGEST_ALGORITHM | 0 |
651b2b0fcf53570e1181206cee6382c6 | 7c5fccd5548d67e7ae9c7679d53ec866 | 改变聚焦的元素在父类容器中的绘制顺序,达到聚焦后的View,放大之后能够层叠在其他子View之上 | public class LibTvRecyclerView2 extends RecyclerView implements IDynamicFocusViewGroup{ private void init(){
@Override
public int onGetChildDrawingOrder(int childCount, int i){
final int tempFocusIndex = indexOfChild(getFocusedChild());
if (tempFocusIndex == -1) {
... | 1 |
0e69534f3afebaa9f9afb223f766a2ac | 0154277b55c9fad6da21f2688de56249 | From http://stackoverflow.com/a/17004263/2931197 | def zip(*iterables):
sentinel = object()
iterators = [iter(it) for it in iterables]
while iterators:
result = []
for it in iterators:
elem = next(it, sentinel)
if elem is sentinel:
return
result.append(elem)
yield tuple(result) | 1 |
a34945742cc161e1b1ddcb4fdba92bd5 | 9493476508b46594483e0d15f101222e | 计算模型在测试集上的准确率以及损失 | net.eval()
labels, predicts = [],[]
loss_meter = AvgMeter()
for batch_idx, (feature, label) in enumerate(loader):
feature = feature.float().cuda()
label = label.float().cuda()
predict = net(feature)
loss = cost(predict,label.long())
loss_meter.update(loss.item(... | 1 |
a9a5cfeb5944b07ad06e0bff4570c084 | 4f0307976f912464d1171e4b255f03de | 根据身份ID来查询所有保单号列表。 | public List<Insurance> queryInsuranceList(String bizNo) throws ServiceException; | 0 |
62fa4a151ccfbfaf3d80bdd74dc0b900 | 588fe20b66f4c6a69414f39356ec320b | <p>
All those actions that contain at least one front-end action
state that is deferring to this operation.
</p> | public abstract class GuiForwardLogic
extends MetafacadeBase
implements GuiForward
public boolean isEnteringActionState()
{
return this.getSuperFrontEndForward().isEnteringActionState();
} | 0 |
ead5deebf460057e1c8789d0ebb49384 | 2ba58b7d5808c195d09b6c51ccbab636 | Receive shot and determine if it has hit or missed. Check win conditions. Opponent takes shot. | self._computer.pick()
shot = False
hit = -1
player_turn = choice((True, False))
pcx, pcy = 0, 0
pos = {
0: 'A',
1: 'B',
2: 'C',
3: 'D',
4: 'E',
5: 'F',
6: 'G',
7: 'H',
... | 1 |
6033dcb189d088ec3996f86a1ea305f6 | ce3a273eee38b41da16570415fe0669f | 開始可能な配信グループを取得する(ラッパー) | class Api
public static function getGroupList(bool $unique = true): iterable
{
$group_list = [];
$buffer = GetGroupList::encode();
foreach (self::$address_list as $key => $address) {
$res = self::sendToAddressAndRecv($address, $buffer);
while ($res) {
... | 1 |
67fe580cfd407b0494e6f20315535050 | afb4c8a07140c1070fc88033ff210883 | =======================================================
获取某个实验的某个主版本的所有子版本(孩子) | Long pageNo, Long pageSize) {
PaginationResult<ItemsChildAssayModel> result = new PaginationResult<ItemsChildAssayModel>();
Long count = assayChildCount(assayId);
Long pageCount = count % pageSize > 0 ? count / pageSize + 1 : count
/ pageSize;
Long pageS = (pageNo - 1L) * pageSize;
List<ItemsChildAssay... | 1 |
ce876a41fe6caac40c62b8831de8145c | e8bfec5b520a30e0989acd811d655e8d | Compares two tables (pandas DataFrames) with storm-to-event linkages. | feature_colname2='column', dtype_colname1='type', dtype_colname2='type', output_root='', keep_images=False, n_jobs=1):
wb = openpyxl.Workbook()
img_dir = 'img_temp'
if os.path.isdir(img_dir):
shutil.rmtree(img_dir)
os.mkdir(img_dir)
table1 = _table1.copy()
table2 = _table2.copy()
if sample_size <= 1.0:
both... | 1 |
720488a1b19120298885f8c0a28b0639 | 288b61436be3aecd23c44f5d72f34f78 | Should never be used by itself, removes the cargo ship from all applicable statuses, but keeps it in the main cargo ship list. | {
if ( this.CargoShipsIdle.Contains( cargoShipID ) )
this.CargoShipsIdle.Remove( cargoShipID );
if ( this.CargoShipsLoading.Contains( cargoShipID ) )
this.CargoShipsLoading.Remove( cargoShipID );
if ( this.CargoShipsUnloading.Contains( cargoShi... | 1 |
3c007d1bb4a7473546e06e88374d340b | fff0e9ae5bfc851af81f9b18f0c51415 | Example : Explicit typing | let y : A = x;
return y;
type A = number;
} | 1 |
03d917c3f8212288a8f786f6a692a239 | bea062488ec02fdd8becc25f7a7ac306 | Draw tiled source image in all patterns and save each in dictionary. | try:
tiles = pygame.image.load(filename)
except pygame.error:
raise pygame.error, 'Could not load image "%s" %s' % (filename, pygame.get_error())
tileWidth = 32
tileHeight = 32
curs = {}
tiles.lock()
for ycur in range(tiles.get_height() / tileHeight):
for xcur in rang... | 1 |
4f82331f8641f6118e00f03a680ff082 | 251ef879a8df4175a68d3f69c118b117 | Fetch a channel from the pool. Will return a new one if necessary. If
a channel in the free pool is closed, will remove it. Will return None
if we hit the cap. Will clean up any channels that were published to
but closed due to error. | class Channel(ABC):
def connect(self) -> Optional[Queue]: | 0 |
6e8a8012f2c999e29b6ca517c0c14b9c | 715ba1bb3ae9516a075222a486f4f131 | Gramos de almidón por porción en base a los gramos totales/número de porciones | function getPortionWeight() {
let totalWeight = document.querySelector('#food_weightNum')
let foodPortions = document.querySelector('#food_portions')
let portionWeight = document.querySelector('#portion_weight')
let foodPortionQtd = document.querySelector('#portion_qtd')
foodPortionQtd.value = foodP... | 1 |
49d72c0379c71f33225a110a28901f3c | 96bacb57a43ba99769c741cba5292c83 | 打开撤销确认对话框 | function alertDeleteRollbackWindow(){
$(this).parent().addClass("checked");
$("#can").load("alert/alert_delete_rollback.html");
$(".opacity_bg").show();
} | 1 |
e3595347e4bda87ef8b9bec4519e0ada | 751bf0f3c624f4f278e82e60c48a2cc3 | Gets all keys of a dictionary where the key-value-pair satisfy a specified condition. | FillDictIfNull();
_lock.EnterReadLock();
try {
Dictionary<KEY_TYPE,VALUE_TYPE> dict=GetShallowHelper(isShort);
return dict.Values.Where(match).Select(x => CopyDictValue(x)).ToList();
}
finally {
_lock.ExitReadLock();
}
} | 0 |
fcf583d4a7911cf2ae3e070c8430f5f6 | 519798eb8a961202c1bd4a79f7bd5259 | 두 날짜를 비교해서 시작날짜와 종료날짜를 체크해서 리턴한다.
날짜 형식은 yyyy.mm.dd 형식으로 넘어와야 된다. | public class LogicDateRulesUtil
public static String checkDatePeriod(String periodDate) {
if ((LogicStringRulesUtil.stringNullUtil(periodDate))) {
String regex = "^(1[89]|20)\\d{2}(0[1-9]|1[0-2])-(1[89]|20)\\d{2}(0[1-9]|1[0-2])$";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(periodDate);
if (... | 0 |
78396f25dfe71056c25bde3642fa99c3 | 73890e5e9b25d7b060a5998df2e2714b | 通过医生获得医院 | {
List<ViewModels.Patient.HospitalModel> hospitalSet = GetList(doctorID, 0).Select(s => new ViewModels.Patient.HospitalModel() { HospitalID = s.HospitalID, HospitalName = s.HospitalName }).ToList();
return hospitalSet;
} | 1 |
09633142f32a533abee8db0a62f5288b | 6de6f741f3c16737facb18712fba5717 | The literal's variable. | public class BooleanLiteral extends Literal
public BooleanVariable getBooleanVariable() {
return v;
} | 1 |
ea7e28192abc47e062d799048693cab4 | 9041635c6d955b54d22d9748b6a2810b | Read installation requirements from pip install files. | def read_requirements():
reqs_path = os.path.join('.', 'requirements.txt')
install_reqs = parse_requirements(reqs_path, session=PipSession())
reqs = [str(ir.req) for ir in install_reqs]
return reqs | 1 |
65f8b3f6bbcbf46c175cd089f0de26ce | 548040daa24d3d662855e76968feb801 | Gets the column identifiers and names from a worksheet in an Excel file | namespace QueryToExcel
IEnumerable<string> GetColumnNames(string worksheetName, string namedRangeName); | 1 |
187d1f427495a6647bbcda1e79847e07 | 02dac4cf6bb6ec2049d5320f3f392ce1 | NAME
AppIsDeviceBonded
DESCRIPTION
This function returns the status whether the connected device is
bonded or not.
RETURNS/MODIFIES
Nothing. | {
connected = TRUE;
connection_handle = handle;
#ifdef TERMINAL_ON
printf("Connected to device:");
for(int i = 5; i > 0; i--){
printf("%02X-", addr[i]);
}
printf("%02X\n\r", addr[0]);
#endif
#ifdef PAIRING_ON
ret = aci_gap_slave_security_request(conn_handle, BONDING,
... | 0 |
645fcfb74756fb02fddf7b4abaf96f57 | f7a17e4311a5b0b3e045b748e99e8d82 | Adds a keyword for the publication entry. | {
$allKeywords = $item->addChild('allKeywords');
if ($article->getKeywords() !== '') {
$articleKeywords = explode(',', $article->getKeywords());
$keywords = $allKeywords->addChild('keywords');
foreach ($articleKeywords as $key) {
$this->appendCData... | 1 |
d8aa6f90fb6e8aaef2a3863f14823f61 | 8f3d56850b0e8b595b5a937abc5fa1d3 | 清洗作者
传入一行包含多个作者及其脚标的字符串
返回一个字典(key:作者名 value:脚标(list))
主要针对英语,其他语言可能出问题 | def getAuthors(header, label, xpos, pdf):
authors = []
authorsIndex = []
authorsLine = []
for i in range(len(header)):
if label[i] == '<author>':
tmpStr=[]
originLen = len(authors)
if pdf.hasIndex(i):
authorListTmp, authorIndexTmp = pdf.handleIndex(i)
authors += authorListTmp
authorsIndex += ... | 0 |
35fedb0fca117ce6b8d9da12708d48ea | 1c9c274fc4a7d049884f5d9700e0dacd | Laat alle gespeelde kaarten zien op de GUI. | public class Board
public void fillBoardView(JPanel view)
{
for (FlippableCard c : cards) {
c.hideFront();
view.add(c);
}
} | 0 |
46d4a3076b7eed58cac4f4de6786134c | 4d6098c167153ac0f4bfb52e048a70ce | Getter que retorna todos os telefones para o formulario. | class Blacklist:
def getAllTelefones(self):
r = requests.get(url=self.url)
return r.json() | 1 |
b971894c05287e67c64065ee12412972 | 3e1ed88d57e838f8232e557d1ddae789 | HPなどの条件変化に対応するための、PassiveEffectの初期化と再代入 | function PassiveRealEffect(caster_ptr, target_ptr, passiveInfo, params)
local spellID = passiveInfo[ 1 ]
local level = passiveInfo[ 2 ]
local index = tb_skill_base[spellID].uplevel_id[ 1 ] + level - 1
local config = tb_skill_uplevel[index]
local ac = false
for _, passiveEffect in ipairs(config.passive_type) do ... | 0 |
bf8d1d30bf594e6c0d1c9cf38b3f8a57 | 026f18c6d25fa693df06cb209e284bc4 | 将度的元组修改成字典 | temp=dict()
if len(result):
for i in result:
try:
data=float(i[1])
temp[str(i[0].encode("utf-8"))] = i[1]
except:
temp[str(i[0].encode("utf-8"))] = str(i[1].encode("utf-8"))
return temp | 1 |
8a617735a19c8a9706b71983e3a6859a | 11ab8b59befdb644f386152101115509 | GetFundingDepthMessagePrimaryKey gets a concatenated string that forms from the message fields which identify the depth message uniquely | {
if(String.IsNullOrEmpty(FUND_IDENTIFIER))
{
return String.Empty;
}
else
{
return "MF";
}
} | 0 |
f2d0428687bf96f090944f99bf4f7f08 | da412bdef3792711f50d11736c917145 | Import properties from a resource (within our JAR?) | String value = getProperty(key);
String path = key.replaceAll("\\.", "/");
if (path.endsWith("listing"))
path = path.substring(0, path.lastIndexOf("/"));
if (null == value || value.trim().isEmpty())
return;
for (String element: value.split(","))
... | 1 |
199026561328c7be22ca91a2fe1b9a28 | 07851812f78227a79fdcf97f57a371af | function which returns integer Division | def int_division(dividend, divisor):
return int(dividend // divisor) | 1 |
2bea97573fbe7d6cca610533eb0ea7a0 | f9bc70a5c1fc0f00b6f347f11efea4d0 | Removes columns from the list widget | for col in self.Columns.keys():
try:
self.Columns[col]['List'].selection_clear(0, END)
except:
continue
for col in self.Columns.keys():
try:
self.Columns[col]['List'].delete(0, END)
except:
co... | 0 |
de4f03fa0fb58780db2191619a912d56 | a9e2f494b84d395d88b899c84d71c607 | 点赞的答案列表 | class UsersCtrl
async listLikingAnswers (ctx) {
const user = await User.findById(ctx.params.id).select('+likingAnswers').populate('likingAnswers')
if (!user) {ctx.throw(404, '用户不存在')}
ctx.body = user.likingAnswers
} | 1 |
42ade0d2663fb0803eb646ecbcd5709c | 35fd62c4166cbed8be367b7580d8e1b1 | Estimated covariance matrix for triangulation measures | sigma_inv = 1.0/sigma
Gg = np.linalg.pinv(sigma_inv[:,None]*G,rcond)
Cm = Gg.dot(Gg.transpose())
return Cm | 1 |
92f5e958b9b84d55418adf7daaca39ac | 4c6ea352329b41ae7e30344c330f7781 | Returns the number of bits in the minimal two's-complement representation
of this BigInteger, excluding a sign bit.
this BigInteger, excluding a sign bit. | {
int bitcount = bn[0] * BIGNUM_INT_BITS - 1;
while (bitcount >= 0
&& (bn[bitcount / BIGNUM_INT_BITS + 1] >> (bitcount % BIGNUM_INT_BITS)) == 0) bitcount--;
return bitcount + 1;
} | 1 |
1b0098ac119b82b4eaf9d7991a3915c6 | 0d6bcbc5961de040b2e1858187ef7284 | Sets the value of the '{@link fr.istic.idm.project.UIMM.RadioButtonItem#getValue <em>Value</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public void setValue( org.pentaho.pms.cwm.pentaho.meta.core.CwmExpression newValue ); | 0 |
7170167f920174a2a8dad2621e0f9baf | 288e0cff03f2baa075aef4926e82ed75 | Convert AORSEARCH result to pandas frame | with open(filename,'r') as f:
soup = BeautifulSoup(f.read(),HTMLPARSER)
ths = soup.find_all('th')
try:
htable = list(filter(lambda x: 'NAIF_ID' in x.text,ths))[0]
except IndexError:
return None
htable = htable.parent.parent
table = read_html(str(htable))[0]
table = ta... | 1 |
e8885eef77558547cd6c919f5a147ace | 7728c2b877ad99389943471901e4c1cc | Verifies connectivity to the broker instance and creates the queue for the test. | public void CreateConnectionFactory()
{
this.brokerIsRunning = BrokerRunning.IsRunningWithEmptyQueues(queue);
this.brokerIsRunning.Apply();
var connectionFactory = new CachingConnectionFactory();
connectionFactory.ChannelCacheSize = this.concurrentConsumer... | 0 |
ab630cacef54512e436799d10b37840c | 63750b8818759540d20120173eb9b42f | This functions checks if the collider belongs to a Fish object, and if it does, it returns the FishController for that object | public class fishFood : MonoBehaviour
public void OnTriggerEnter(Collider collider){
if(collider.gameObject.name == "Fish1")
{
Destroy(gameObject);
}
} | 0 |
a6888f1dcb9caabceff53dd15eb10ab5 | 5bcece0808492faf55b689cb8bca1f09 | Add Google captcha field to Comment form | {
$comment_field = $fields['comment'];
unset($fields['comment']);
$fields['comment'] = $comment_field;
return $fields;
} | 0 |
48371fdb2dd0ab8a95266cb70dd4281c | 99cd0cfe2da2912ab73ecc0381427935 | Creates a StaticMergeTag, returning its id. | export class StaticMergeTagsApi extends runtime.BaseAPI
async createStaticMergeTag(requestParameters: CreateStaticMergeTagRequest): Promise<number> {
const response = await this.createStaticMergeTagRaw(requestParameters);
return await response.value();
} | 1 |
32e4d7012e5b78933eaa9e050f683207 | 9a901d23d2d3c87317444aeedc1d4c05 | Returns the current user being used by Sentry, if any. | public final class SentryThread implements IUnknownPropertiesConsumer
public @Nullable Boolean isCurrent() {
return current;
} | 0 |
5a82741dc4fd4b4ac5b843c0f487dd29 | 77c6bd03f608d029faaba3956b9afe93 | Gets the player's luck. | class Character
public function getLuck() {
return $this->_luck;
} | 1 |
885b7ff14cd87a635d67d31531b91fa5 | 687b7d486cb38f3ec0eaeabab39efb6a | 按运单号集合合计总条数总金额,冻结总条数总金额查询 | @Controller
@RequestMapping(value = "/transInfoAction")
public class TransInfoAction
@DataSource(Constants.DATA_SOURCE_SLAVE)
@RequestMapping("/getTotalNumAndTotalMoney")
@ResponseBody
public Object getTotalNumAndTotalMoney(@RequestParam("info") String param) {
Map<String, Object> map = new HashMap<String, Object>... | 1 |
4c9d32d58a9fa559545b138efc10ecac | 7db298e6a987beb3e607a821d02d362a | 定义当前数据如何保存到数据库中:即将枚举状态中的的状态码code写进数据库中 | void saveSysCode(); | 0 |
d66bde5a9bb9bebffd679f2833bf5505 | 17e29494323622e752388f070df68521 | 인덱스 계산을 편하게 하기 위해 인덱스 1부터 시작하도록 0에는 None을 위치시킴 | class LinkedListLIFO(object): # 후입선출(stack)
def _find(self, index):
prev = None
Node = self.head
i = 0
while Node and i < index:
prev = Node
Node = Node.pointer
i += 1
return Node, prev, i | 0 |
603d5bede938cf6d3f7161d13a0e8a85 | b2d5615be8abaf6f1e23fee5d1451458 | Called after creating a new report, formats a report to display mri events | class MriServerDispatch(BaseDispatch):
def _format_report(self):
if not self.setup:
raise ValueError('Dispatch not setup yet, please call setup_report')
full_url = requests.compat.urljoin(ServerConsts.API_URL.REPORT_ID, self.report_id)
attr_no_time = self._attributes
attr_no_... | 1 |
fb171000b51ea9ccc3d25d48c2336b44 | 41bed2d1f389d0719a14b9d242c81ea1 | Check whether the Embedly dark skin is enabled | $settings = $editor->getSettings();
foreach ($settings['toolbar']['rows'] as $row) {
foreach ($row as $group) {
foreach ($group['items'] as $button) {
if ($button === 'video_embed') {
return TRUE;
}
}
}
}
return FALSE;
} | 0 |
5e03dc3760ec0c83b59c55c72045cae0 | 4d7612613e63761055ac1f32e3e89e15 | Returns the meta object for the containment reference '{@link net.opengis.wcs10.DocumentRoot#getCoverageDescription <em>Coverage Description</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EEnum getCoverage(); | 0 |
c3c41efebf2f8e4fabab311084afc5bf | 5169b555e864b01b92d82b1caf674c9d | Gets all of the EPGs from the APIC. | buf = bytearray()
self.__writeInt(buf, self.__CMD_EPG_SRV_ENUM_SERVICE)
self.__writeInt(buf, 0)
ret, buf = await self.__sendAndReceive(buf)
if ret == self.__CMD_SUCCESS:
return self.__readVector(self.__readServiceInfo, memoryview(buf), [0], len(buf))
return ... | 1 |
db7a67a27d41ce6542a36352e70e118a | a15c8d7f91e5520c0227247e117e156e | Implementation of minimax algorithm with alpha-beta pruning. Agents is a
list of all police agents, in addition to the one criminal agent currently
being pursued by this specific police agent. | i %= len(agents)
if depth <= 0 or simulationState.isFinal():
return self.pursuitEvaluationFunction(simulationState, agents[self.index])
elif isinstance(agents[i], PoliceAgent):
for legalAction in simulationState.getLegalActionsForAgent(agents[i]):
successo... | 1 |
14173471a918daef039897779b2b7612 | db404b46dfcff6623b8cc305f586e6a5 | GET: RefereeDistrikts | {
if (Session["role"] == null || (Convert.ToInt32(Session["role"])!=7 && Convert.ToInt32(Session["role"])!=1))
{
return Redirect("/");
}
int user_id = Convert.ToInt32(Session["user"]);
int role = Convert.ToInt32(Session["role"]);
... | 1 |
efeb14ae96e7f5448711a22bbbdc8f86 | 32de388dce41369eadeb63c1b0103f46 | @brief Req different frequencies from same client, expect clock to be set at last Req frequency before Rel | void AxiPD_ReqClk
(
npa_client_handle clk,
DAL_axipd_ReqStateType eState,
uint32 uClkFreq
)
{
if((0 == uClkFreq && AXIPD_REQ_PRE == eState) ||
(0 != uClkFreq && AXIPD_REQ_POST == eState))
{
return;
}
npa_issue_required_request(clk,uClkFreq);
} | 1 |
caf564ee55ec8224a836618030b91a82 | 0ea180c208da513350577e04364548c6 | users who are invited but have not accepted | def friend_requests
inverse_friendships.map { |friendship| friendship.user unless friendship.confirmed }.compact
end | 1 |
7fdc1cc6d6532b6309365136fbd8aaa1 | 09a6f8f8556675a7ec5fede0013de121 | Calculates the logarithm of the sum of e to the power of input 'x'. The method tries to avoid \
overflows by using the relationship: log(sum(exp(x))) = alpha + log(sum(exp(x-alpha))). | x_max = np.max(x)
x = np.log(np.sum(np.exp(x - x_max)))
x += x_max
return x | 1 |
c5a246a4c4edf5f0540119aa59c18009 | 8cb4c78f8c123e845ef716304d6773d9 | 可以将字典转成namedtuple | def convert_to_namedtuple(dict):
return namedtuple('X', dict.keys())(*dict.values()) | 1 |
8f28698191d6e8e8b9919f2528b19dfe | 5d05ba9814acfc4dca14a320fda7df82 | 获取错误出票列表 | class Rbremit extends \app\models\open\OpenBase
public function getErrorData($limit) {
$where = ['AND', ['remit_status' => static::STATUS_DOING],
['rsp_status'=>'6004']];
$data = static::find()->where($where)->orderBy('create_time ASC')->offset(0)->limit($limit)->all();
return $data;... | 1 |
5b2f368ab59a184387a9f40883d5ac8d | 728fe0102bc299d8687509bf078e0017 | Volta para a tela de Doenças de uma Determinada Árvore | {
if (cv.quantInjuriasArvore(codArvore) == 0)
{
if (cv.quantInjuriasArvore(codArvore) == 0)
cv.atualizaStatusArvore(1, codArvore);
else
cv.atualizaStatusArvore(2, codArvore);
}
} | 0 |
3d8da73776073568dab46f06293bad68 | 6705aff091568600d3159ded6a757142 | # Convert "vec" into a comma separated series for printing.
#
# Argument: vec a character vector
# Returns: A single string with the entries of vec listed in series. | .str <- function(x){
str(x, list.len=length(x))
} | 0 |
b25d6fe0e97e74642ed6948c34c6119e | a2da705c39ba47a943596ce017c4c525 | Load location of cells from a file (csv and HDF) and render as spheres aligned to the root mesh. | mesh = triangleMesh()
with open(''.join((rootfilename,'.n'))) as f:
csvreader = csv.reader(f, delimiter=' ',skipinitialspace=True)
numberOfLines = int(csvreader.next()[0])
mesh.nodes.numbers = np.zeros((numberOfLines), dtype=np.int)
mesh.nodes.coordinates = np.zeros((numberOfLine... | 0 |
2590a4662d5c46c9bfcee07a507b0b06 | c0cb58ee2cbb0fb50e513d578666ba6b | Test if check returns True on valid sp | class TestTriplegs:
def test_check_suceeding(self, testdata_tpls):
assert Triplegs._check(testdata_tpls) | 1 |
f37b79219e6a6863e577d14f12b3cbc8 | 07e2d85a776ece61dd6653cae08b7f58 | List of complaints that has been solved | public IEnumerable<Complaints> Get()
{
using (BODBcontext context = new BODBcontext())
{
return context.Complaints.Where(w=>w.Publish == true).OrderByDescending(o => o.CreatedDate).ToList();
}
} | 0 |
5e75d8a6f8d690f3debfa99d0e035256 | 47a60be3c4f380872193d0ccb43d9a95 | Load fonts & save to resources | @Service
class CaptchaServiceImpl : CaptchaService
@EventListener(ApplicationReadyEvent::class)
override fun loadFonts() {
fonts.clear()
val cl = this.javaClass.classLoader
val resolver = PathMatchingResourcePatternResolver(cl)
try {
for (resource in resolver.getResources... | 1 |
9b8027988e6aa5483143b21ca5e8df66 | bf3a0aa882394e39ab855e50faf6c454 | Get movementDate. | if (MovementDate == null)
throw new IllegalArgumentException("MovementDate is mandatory.");
set_Value("MovementDate", MovementDate);
} | 0 |
3a6bf3a40757545f6f26cd0f89bcc5b8 | c6752fbdc08e76fe5636fa67347bda9b | Sets the speed for mouse look. | namespace HT.Framework
[DisallowMultipleComponent]
[InternalModule(HTFrameworkModule.Controller)]
public sealed class ControllerManager : InternalModuleBase
public void SetLookAngle(Vector2 angle, float distance, bool damping = true)
{
_mouseRotation.SetAngle(angle, distance, damping);
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.