query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9d1cd8e0069be07cd8d12f971f79ab28 | 6cd4987273b21934797837be578eb690 | Read the block that is previous to current position | PUBLIC void read_ahead()
{
register struct inode *rip;
struct buf *bp;
block_t b;
rip = rdahed_inode;
rdahed_inode = NIL_INODE;
if ( (b = read_map(rip, rdahedpos)) == NO_BLOCK) return;
bp = rahead(rip, b, rdahedpos, BLOCK_SIZE);
put_block(bp, PARTIAL_DATA_BLOCK);
} | 0 |
fcbe2bec65dc64bd55269ac2d857980c | cfa9460e71272e65ed3542eff41093dc | setter fokus i felt for fornavn | namespace UtnEmall.ServerManager
public partial class ServiceEditor
public void FocusFirst()
{
System.Windows.Input.Keyboard.Focus(TxtName);
} | 1 |
b4430d7116c97223ceaabbee89dd0397 | 971b7644745d43ad79ff0094f6dd0321 | Clear event bits for button status | uint16_t buttonStatus = PCA9671digitalWordRead();
_buttonStatus = ~(buttonStatus >> 8 & B11111);
} | 0 |
b991e1f9e00279eec8ac6d65dc59b16c | 0b9d45d8954b9c81c4e58d7f437b1eaf | Fonction qui reçoit la requête SQL et un tableau des paramètres pour bind et exécuter
une requête GET (SELECT, etc...) | {
global $pdo;
$def_type = explode(" ", $requete);
$type_req = $def_type[0];
if ($type_req == "SELECT")
{
$Myresult = $pdo->query($requete);
$Myresult->setFetchMode(PDO::FETCH_ASSOC);
$response = $Myresult->fetch();
return $response;
}
else {
$response... | 0 |
c75665b5912f3282635b114f3c0d40a2 | 7607cca3f71983fc319106b8a257fe42 | Проверка метода запроса на подтверждение учетной записи | {
$user = User::where('email', $this->unconfirmedUser->email)->first();
$crawler = $this->client->request('GET', '/users/confirm/test12323434234sdfsadfasdfas');
$this->assertRedirectedToAction('B302AuthUsersController@login');
$this->assertSessionHas('error');
$crawler = $thi... | 1 |
d8a99d3cba1309bf29af9ed7c2ebc903 | 3d1e0a0c43a9c9e0317669248a73f99e | Get the last object that disturbed the inventory of the caller. * Returns OBJECT_INVALID
if the caller is not a valid creature or placeable. | function GetModuleItemLostBy()
VM_ExecuteCommand(293, 0)
return StackPopObject()
end | 1 |
eedda5cd1f4f9b42bf77fb356cd60425 | ea954c45dbfb2d2b5429cdd7aad24244 | 获取excel表格中所有行的数据 | self.load_excel()
columns = self.sheet.max_column
rowdata = []
for i in range(1, columns + 1):
cellvalue = self.sheet.cell(row=row, column=i).value
rowdata.append(cellvalue)
return rowdata | 0 |
5d339ac6be03bfbb5d040ad2b999ff82 | 5211e86dddceb9208f6cf9db0037d010 | Set of fields for all node types to be loaded | $config->addField(new GlobalIdField('article'));
$config->addField(new EntityCanonicalUriField());
$config->addField(new EntityPreferredUriField());
$config->addField(new EntityIdField());
$config->addField(new EntityLabelField());
$config->addField(new NodeChangedDateField());
$config->addF... | 1 |
9b79f2b3b9ac5beecec08d7557abd3bc | 9ac51ed77ebb74f353bfb1071a2c1897 | 二项分布,模拟抛硬币试验 | int coin_toss(double p){
int count=0;
int flag=1;
double r;
while(flag){
r = (1.0*rand()) /(RAND_MAX);
if(r>p){
count++;
}
else{
flag=0;
}
}
return count;
} | 0 |
b4fe79408ac0622c02b2b783674dd98b | 08050d8188d502efd4b30d4f3356c4ae | Gets the real OCSP response according to the OCSP request we've got from the prover | {
DateTime minTime = validationTime - ClockSkewness;
DateTime maxTime = validationTime + ClockSkewness;
BCX.X509Certificate certificateBC = DotNetUtilities.FromX509Certificate(certificate);
BCX.X509Certificate issuerBC = DotNetUtilities.FromX509Certificate(issuer)... | 1 |
14ba5c6e4303deb767398314f478b12f | 014292fead2a1997b8c15c8ad43a7d2a | When a client requests ownership, transfer ownership to them. | public class TransferOwner : MonoBehaviourPun, IPunOwnershipCallbacks
public void OnOwnershipRequest(PhotonView targetView, Player requestingPlayer)
{
if (targetView != photonView) {
return;
}
photonView.TransferOwnership(requestingPlayer);
} | 1 |
40612a8e6ca31ddbb5f57db5c234947f | af47a2f430a8dbcd1f744e99dafd7af8 | from the coordinates calculate each distance from each point and save it | def calculate_dist(coord):
for i in range(NB_TOWNS):
x1 = coord[i][0]
y1 = coord[i][1]
for j in range(NB_TOWNS):
x2 = coord[j][0]
y2 = coord[j][1]
if i == j:
dist[i][j] = -1
else:
dist[i][j] = math.sqrt(pow((x2-x... | 1 |
8c521a5b8d59c73cc52f3966d5c95c94 | 6a21274250b08b3d7d257b15c6ad75ab | Get the server uri of the system, i.e. a uri that when entered in the browser accesses the
server that runs the KiWi (and SOLR) applications. Can be used to compute the paths of
other applications relative to the current application. Computed like the base uri. | String getUri() throws RemoteException; | 1 |
c9b4f8007cf3542e562395ff5b9deadf | 007f01d9abd2ebb6bcea8da59d943db2 | To update sync email option to remove Commented user & it's group - ig_es_sync_wp_users
ES version 3.2 onwards | global $DB;
$dbman = $DB->get_manager();
if ($oldversion < 2012083000) {
}
return true;
} | 0 |
dee72bd44366d1f024a1ae12808ddf27 | 99b2645e66b5e68f8c8a903a1f8606de | Gets the file names which were processed since last execution of reset_file_names_processed | class obj_header:
def get_file_names(self):
return self.filenames | 0 |
a1716586d345a814a0025061495fc5e5 | 0801b8b8807f0278e72d2251f9b9271d | 以类型分组形式返回字典数据 | if req.method == "GET":
dictType = valuesFun(models.DictType.objects.all().values())
dict = valuesFun(models.Dict.objects.all().values())
def dataProcess(data, data1):
list = []
for x in data:
obj = {}
obj['name'] = x['name']
... | 1 |
e82274b2fee9df83247322c293574ed2 | eeaa2f709d230350e24abe16fcb95139 | Builds a payment request with Api Key and Api Login values | class PlacetoPay
private function getPaymentRequest(
$keyID, $passPhrase, $recipientKeyID,
$customerSiteID, $reference, $amount,
$tax, $devolutionBase, $franchise)
{
$delim = chr(1);
$this->totalAmount = number_format($amount, 2, '.', '');
$this->taxAmount = number_format($tax, 2, '.', '');
$this->devolu... | 0 |
babc7498188fa3fe82f9be01543f9018 | 38aa61ce5abfbede291757787fc98b34 | uploads the bytes (content) to the blob with the name as file name | {
try
{
CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(name);
blob.UploadFromStream(stream);
SetPublicContainerPermissions(_blobContainer);
return blob.Uri.AbsoluteUri;
}
catch
... | 1 |
0245e7aefb1cff3aa56c6ea6cadb457b | f9b10b4d172a7136ff68e935fd68c784 | Initializes a private key from an integer. | class KMSChain(ProxyLib):
def private_key_from_bytes(self, data):
sk = PrivateKey(ProxyLib())
sk.set_pointer(self.get_pointer())
sk.from_bytes(data)
return sk | 0 |
610b9a8419c7521111b6a7d15d180bad | bdaed4b791812f33b879da85a4cdad88 | Update data in chunk1 | {
assert(iChunkCnt == Data2.getChunkCnt());
for (ChunkRange *pRange = Data2.pChunkRanges; pRange; pRange = pRange->Next)
AddChunkRange(pRange->Start, pRange->Length);
} | 0 |
96cd821260c217ccdf754b1476bbb029 | d0aee10abced0fd173708fd769939a1b | Validate the flow mirror point. | throws InvalidFlowException, UnavailableFlowEndpointException {
checkSwitchesExistsAndActive(mirrorPoint.getMirrorPointSwitchId(), mirrorPoint.getSinkEndpoint().getSwitchId());
EndpointDescriptor descriptor = EndpointDescriptor.makeDestination(FlowEndpoint.builder()
.switchId... | 1 |
0fc32de490d26fd9918e6ff520005ef5 | c54e8076c898932b24076500e1a84740 | PIE mappings for ADC interrupts | static ACPI_STATUS
mpacpi_nonpci_intr(ACPI_SUBTABLE_HEADER *hdrp, void *aux)
{
int *index = aux, pin, lindex;
struct mp_intr_map *mpi;
ACPI_MADT_NMI_SOURCE *ioapic_nmi;
ACPI_MADT_LOCAL_APIC_NMI *lapic_nmi;
ACPI_MADT_INTERRUPT_OVERRIDE *isa_ovr;
ACPI_MADT_LOCAL_X2APIC_NMI *x2apic_nmi;
struct pic *pic;
extern str... | 0 |
6b5df4ad93713b49e5f2b8634a3c0262 | fb429b86ee127539e02f95b05c59ae2e | 获得订单使用的房券 | if (in_array($order['type'], [Order::TYPE_BUY_CARD, Order::TYPE_BUY_GROUP_COURSE, Order::TYPE_BUY_PRIVATE_COURSE])) {
$where = [
'order_id' => $order['order_id'],
'status' => self::STATUS_USED,
];
if ($this->where($where)->count() > 0) {
... | 0 |
4ac53efa693e8157414d017d18eb2444 | 7fc5ce6f1a31e364977dcd2f8edef90a | Lấy danh sách nhà cung cấp đổ vào CBB | public JsonResult GetSupplierList(string id)
{
Repository rep = new Repository(User.Identity.GetEmployee());
var data = rep.GetSupplierList(id).Select(s => new { Value = s.SupplierCode, Text = s.SupplierName });
return Json(data, JsonRequestBehavior.AllowGet);
... | 1 |
2ad8ea8f127153a066245cbc2e157798 | 777d8d1bccaaaf9a8ab09093cb2aa6ae | Test method that computes unique column names. | class DataTestCase(unittest.TestCase):
def test_retrieved_data(self):
for i in colnames:
with self.subTest(i=i):
self.assertTrue(len(df[i].unique())>1) | 0 |
c744b02727b45f4bd608223f76aa6c06 | acbc5721f14fd1ef91c6702e5b1cea9b | Uncamelcase | class onboarding_base extends std{
function camelize($scored) {
return lcfirst(
implode('',
array_map('ucfirst',
array_map('strtolower',
explode('_', $scored)))));
} | 0 |
b4ae916aa43bf3d04f8080346087106a | 0961543883b1a6d307473eed73435798 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
... | i_palidx *result;
i_img *im;
dIMCTXim(src);
i_clear_error();
i_quant_makemap(quant, &src, 1);
result = i_quant_translate(quant, src);
if (result) {
im = i_img_pal_new(src->xsize, src->ysize, src->channels, quant->mc_size);
memcpy(im->idata, result, im->bytes);
PALEXT(im)->count = quant->mc_cou... | 1 |
c13d04828132a03470e1d62712e409e9 | ab7b61d9924377195063d0f835209ee0 | 当鸟飞出屏幕或被击中时,当前剩余飞鸟数减一 | public class Birds : MonoBehaviour
protected virtual void NextBird()
{
GameManager._gameManager.birds.Remove(this);
Destroy(gameObject);
Instantiate(ExpBoom, transform.position, Quaternion.identity);
GameManager._gameManager.NextBirds();
} | 0 |
6d7b81334f1fec5ab80bb9e1d718f41e | 402a28a5e46f31b007224fe5be0c82ea | Retourne une partie de la description de l'événement
Si la description de l'événement est plus courte que la partie demandée, la description de l'événement est retournée en entier. | if len(self.description) > length:
return self.description[:length] + ' …'
else:
return self.description | 1 |
323ffdcfda061330f6562939bd31725f | 39d8d69e4e91f88e7e94ac658cf89184 | Return a tuple of strings that match the regular expression pattern. | class FilenameRegex(object):
def get_data(self, filename):
match = self.regex.match(filename)
if match:
author = match.group(self.author_ind) if self.author_ind else None
title = match.group(self.title_ind) if self.title_ind else None
year = match.group(self.year_ind)... | 1 |
d9056ecaab33af0ab1ff1da2d48a1259 | 5e888f91641bfb7830f0d2c3974e6207 | Specifies the resolution, in DPI.
The default is 72 DPI. | @Api(1.1)
public Builder dpi(int dpi) {
mParams.add("dn_" + dpi);
return this;
} | 1 |
be2ed2ee7682388160da80d99172e921 | e90c89baab9cbe46836924191a5ac7a0 | Checksum extended TCP header and data. | static UInt16 LIB_ComputeTcpStyleChecksum(
UInt32 srcAddress,
UInt32 dstAddress,
UInt8 protocol,
UInt16 tcpLength,
UInt8* packet)
{
UInt8 virtualHeader[12];
UInt16* virtualHeaders = (UInt16*) virtualHeader;
int sum;
int i;
memcpy(&virtualHeader[0], &srcAddress, sizeof(UInt32));
... | 1 |
6b60e743ab777bcb149a6a19580c4811 | 30f0d162c90468b7d2f36cc58d48aa44 | Sortiert die Dateien mit den aktuellen Sortiereinstellungen. | {
if (AllFile.Count > 0)
{
switch (FileSelParm.FileSortBy)
{
case FileSortMode.FileName:
AllFile.Sort((x, y) => String.Compare(x.Name, y.Name, StringComparison.Ordinal));
break;
... | 1 |
e4106020f6a8448def9fec15d0aa226b | 22d6c510a64d6c6ea22f5e2c5ac1536c | 评价设置 | {
var e = eManager.GetEvaluation((int)id);
ViewBag.id = id;
ViewBag.Aname = e.Aname;
return View();
} | 0 |
10f0e6794d5b20a25bf65e316c17fb7b | 8d3a1ad5c3c9284f61c90f49e351f443 | Callback for response to seek() device method. | class AudioPlayerInterface(object):
def _do_seek(self, val):
self._seek = val | 0 |
73429c051fbc6af0b815104546654c6a | f922c6e9edb6cd958acb117913c037df | Return DataStructureElement object with the given id | @Entity("dataObjects")
public class DataObject extends ABaseResource implements ILifeCycleModelObject
public DataElement getDataElementById(String identifier) {
Optional<DataElement> opt = this.dataElements.stream().filter(s -> s.getIdentifier().equals(identifier)).findFirst();
return opt.orElse(null);
... | 0 |
42c37941bacc04e33e767d3af9eec162 | 31e8373c7d56f426a0b2b576322c1ac9 | 通过稿件编号更新稿件信息 | @Controller
public class ArticleController
@RequestMapping(value = "/updatearticelezl",method=RequestMethod.POST)
@ResponseBody
public String updatefolderInfo(GsjArticle article) {
return articleService.updateArtcilezlById(article);
} | 1 |
bdda2bd9007280410e5e66091c599fd4 | 66afcc33884d77cbb96353138d369ed9 | Transforms [center x, center y, width, height] to [xmin, ymin, xmax, ymax]. | def xywh_to_xyxy(boxes):
boxes_transformed = tf.concat(
[boxes[..., :2] - boxes[..., 2:] / 2.0, boxes[..., :2] + boxes[..., 2:] / 2.0],
axis=-1
)
return boxes_transformed | 1 |
d15932fb442dc123cecf5aa256198f8b | c81e67ea92e2127f5f19ccd339b3fe44 | 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. | namespace Org.BouncyCastle.Crypto.Tls
void NotifySessionID(byte[] sessionID); | 1 |
947790aea603af08b4d39b5b8f20a65e | 28e3b48ea524deb604d17cfbee3e4b31 | Check if a placement handler can handle a certain block. | abstract class AbstractDuel implements IUpdatedGame
abstract protected function handleBlockPlace(BlockPlaceEvent &$event): void; | 0 |
ad9f646c9b306536c8bd8bea5f2017ff | 788cf0701c36357330bc2dfd8ae04857 | Sets which type of modmail to use on this guild. | config = await db.get_config(ctx.guild)
if channel is None:
c = config.modlog_channel_id
return await ctx.send(f"My modlog is set to <#{c}> (id `{c}`).")
elif channel == 0:
channel_id = 0
else:
channel_id = channel.id
await db.upd... | 0 |
5a646dd50643345ba32767184bba3aa8 | 710daa91c1d55729e2b36a3bbd6c0276 | 设置报损单 | $type = $data['type'];
if(!$data || ($type == 1 && $data['inventory_id'] == 0)){
return array(
'success' => 0,
'message' => "模型参数非法!"
);
}
$attr_value = str_replace(array('Size:', '<br />'), '', $data['goods_attr']);
if($typ... | 1 |
503ca3fa20920e39771637fe48705b50 | f766dd7863230e7859e0a4e9ed74bb20 | ===========================================================================
DESCRIPTION
Process REQ message from Framework
=========================================================================== | void gp_processSecRecMsg(zstack_gpSecReq_t *pInMsg)
{
gp_SecReq_t Msg;
zcl_memcpy(&(Msg.gpdID), &(pInMsg->gpdID), sizeof(gpdID_t));
Msg.EndPoint = pInMsg->EndPoint;
zcl_memcpy(&(Msg.gp_SecData), &(pInMsg->gp_SecData), sizeof(gp_SecData_t));
Msg.dGPStubHandle = pInMsg->dGPStubHandle;
GP_Se... | 1 |
d93e13c3a4fecce31f5fde729bed68d4 | 9e4e835b09d77c3f7fc439bda2d4068a | 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. | public class Grounding
public static int groundAll(Model model, AtomManager atomManager, GroundRuleStore groundRuleStore) {
return groundAll(model.getRules(), atomManager, groundRuleStore);
} | 0 |
8125f8710bfc398aba83a892629946be | ad4fd36c2cf28a03e20a425265562e11 | 删除真正的士兵对象(从地图上视觉上移除这个兵) | CCSprite foe_over = (CCSprite) sender;
foe_over.removeSelf();
for (int i = 0; i < _Foes.size(); i++) {
FeiJi_Sprite foe = _Foes.get(i);
if (foe.getCCSprite() == foe_over) {
_Foes.remove(i);
break;
}
}
} | 1 |
fa91cec266942d1ac877aa91c2332af0 | 3e1b2e3e30b4b8eea30e3af10e9442db | 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. | final Integer defaultValue,
final boolean nullAccepted) {
Integer retVal = null;
do {
System.out.format("%s", message);
String str = scan.nextLine();
if (!str.equals("**")) {
if (str.length() > ... | 1 |
9bb0fb4855812c18468bd926c0596dc5 | 21389e1341edb411a2b45e0633b5c149 | Get page components to list a user's or all blogs. | final Page page = m_context.getEngine().getManager( PageManager.class ).getPage( blogid );
checkPermissions( page, username, password, "view" );
return new Hashtable<>();
} | 0 |
88bf3fff92609206c6ce53dece259e50 | c0a29f16c7c7be37287e28748f77e84d | 根据区域id,开始和结束日期查询该区域当前时间段内,上期(30天前)、去年同期、前年同期的最高温和最低温数据 | public ResultMessage queryAllTemp(@RequestParam(name = "regionId") Long regionId,
@RequestParam(name = "startDate") String startDate,
@RequestParam(name = "endDate") String endDate); | 0 |
f96f4c2b8688c76a8955b4ab4301ec73 | 26c8338e0217ac2df851a82bd3765b6f | Sends the relevant data and control information to the next stage by calling two methods of the next stage | public class ButtonManager : MonoBehaviour
public void onClickNextStage(){
managerObj.toNextStage ();
} | 0 |
36ea9ee8654709f17a5342db60fb4115 | 41fa0d66104ba0c02b425d8b851b36cb | 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> | {
_queryString.Clear();
_queryString["accessToken"] = await GetVideoAccessTokenAsync(videoId).ConfigureAwait(false);
Uri requestUri = new Uri($"{apiUrl}/{_location}/Accounts/{_accountId}/Videos/{videoId}/Index?{_queryString}");
HttpResponseMessage insightsRequestR... | 1 |
ced06f5a21346604d95e875515a6b278 | 4c63408e168e6f77920a67f61524db4c | Emit a notification that the endpoint was reconfigured. | vfu_virtio_notify_config(struct vfu_virtio_endpoint *virtio_endpoint)
{
struct spdk_vfu_endpoint *endpoint = virtio_endpoint->endpoint;
if (virtio_endpoint->dev == NULL) {
return;
}
virtio_endpoint->dev->cfg.isr = 1;
virtio_endpoint->dev->cfg.config_generation++;
vfu_irq_trigger(spdk_vfu_get_vfu_ctx(endpoint), ... | 1 |
a0015a2767d1941303b327cb869d878f | 59b2f774d4e4998dd77afb1eb8a82f4f | Test the reality property of the pseudo WV representation. | start = time.time()
rules_str = "NP -> NN,NP -> JJ NP,DP -> 'a' NP,VP -> VV_intrans 'to' DP,ROOT -> VP"
translate_fn = dataset._vocabulary.translate_meaning
lexicon_str = "T:{},NT:VV_intransitive -> {},T:to,T:a,T:{},NT:JJ -> {},T:{},NT:NN -> {}".format(
translate_fn("walk"), translate_fn("walk")... | 0 |
699e9e7f6aeaef7e1b5cbc7c55842c0d | bc5f5e56e9e62aa938cf9400c36d6b04 | 获取所有JobDetail | @Service
public class JobDetailsServiceImpl implements JobDetailsService
@Override
public List<JobDetails> getAll()
{
return jobDetailsRepository.findAll();
} | 1 |
a59b6a08dd241b900d2f2a43c1eabacf | bf5e764d0fac332f1fae5d2f851719e5 | This method sets the table shortcuts. | namespace Ximura.Data
public partial class DataContent
protected virtual void SetTableShortcuts()
{
} | 1 |
4f9ae5a48c2e713aeebf13fdea1c2020 | 4b9546e9c362393ce905a1e1f1439a27 | Remove comments with /* */, // or #, if they occur before any other char on a line | string textLine;
char ch;
ch = infile.peek();
while (ch == '#' || ch == '\n') {
getline(infile, textLine);
ch = infile.peek();
}
} | 0 |
7e1f287c4c8033f37440898c68ad792d | d7e86ccdaec6583ce91909f7b68ae7f8 | Create GRPC connection to the node agent. | class gRPC_API_Test_Interface(object):
def create(cls, secure=True):
return cls(secure).connect() | 1 |
f7ce346bb3f008f9ca2bfea7b99806ff | 51b87da96b4722d07dd40a4b938304cd | modify oembed output to force ssl on youtube videos | function zombie_embed_filter( $output, $data, $url ) {
$return = '<div class="video-container">' . $output . '</div>';
return $return;
} | 0 |
5094cb5b0275a20bf465dbd4d55ba3bd | f436e768b056aa7eaf5337a434642672 | FieldDescripterがMapのエントリーかを判定する | {
if (obj is BaseField<T>)
return true;
return false;
} | 0 |
3364d961b15a40a65572ae0b5eff9bf0 | 5dd29fee0af8ae1c18f29e75c036ab21 | Returns:
bool: Whether to do a case sensitive comparison over the stop words (default: false) | class StringChoice(Property):
def case_sensitive(self):
return getattr(self, '_case_sensitive', False) | 1 |
372e36ec4dad0fc0d55562698a6a859c | 01ddd8fd2fef6d7971e04282468a4194 | returns true, if symbol is not a latin letter | public final class StringUtil
public static final boolean isNotLetter(char c) {
return !isLetter(c);
} | 1 |
0ce2b28e815e838dff0ba6a77dea0de2 | 20ce41021455ce18b7fa0ea72548d1b0 | Generator to be passed to fit_generator, predict_generator, etc. using Keras interface. | def train_generator(files, labels):
while True:
for batch in batch_generator(raw_generator_with_label_from_tar(
"102flowers.tgz", files, labels), BATCH_SIZE):
batch_imgs = []
batch_targets = []
for raw, label in batch:
img = prepare_raw_b... | 1 |
2d66aff3b233e79e78d7b85ba911a001 | a0f367600db1bf718ee100511302d110 | 模拟字符串+1:从后到前逐个计算置换,注意溢出处理 | class Encrypt<string>
string operator()(const string &src) {
string s = src;
int len = s.length();
for (char &it : s) {
it = it + 1;
}
return s;
} | 0 |
335375a33d7b6e7a7697b52777b9554b | b723a4d95eb9fe24827cc3888229204a | GPS无效点过滤 | var re = [];
if (urt) {
for (var i = urt.length - 1; i >= 0; i--) {
var inf = new us.inf(urt[i]);
if (rt.mk[inf.i] && rt.mk[inf.i].inf.eqGps(inf)) {
continue;
}
re.push(inf);
}
}
return re;
} | 1 |
b54e9fbb9d817e757478559583114421 | 1ba67653d0e0cef8c94ffdae6ea34bea | Get the digest (an MD5 digest of the non-keyword expanded flavor of the revision) for the default revision. | class pcloud(object):
def digest(clazz):
response = pcloud_requests.get('getdigest', {})
if response.status_code != 200:
raise pcloud_error(error.HTTP_ERROR, str(response.status_code))
payload = response.payload
assert 'digest' in payload
return payload['digest'] | 1 |
651b2b0fcf53570e1181206cee6382c6 | ceee6d4730e537bb25f35aa7936af76f | 改变聚焦的元素在父类容器中的绘制顺序,达到聚焦后的View,放大之后能够层叠在其他子View之上 | public class GameCenterThirdPanel extends RelativeLayout
@Override
protected int getChildDrawingOrder(int childCount, int i) {
if(hasFocus()){
View child = getFocusedChild();
if (child != null){
int index = indexOfChild(child);
if (index != -1){
if (i < index){
return i;
}else {
... | 1 |
0e69534f3afebaa9f9afb223f766a2ac | 5328ad012c9b10cc8a3454e5301b7059 | From http://stackoverflow.com/a/17004263/2931197 | def chunks(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return itertools.zip_longest(*args, fillvalue=fillvalue) | 1 |
a34945742cc161e1b1ddcb4fdba92bd5 | a2d6349fb024ec142d61249829ff9280 | 计算模型在测试集上的准确率以及损失 | x = data["image"]
y = data["label"]
all_ones = np.ones(x.shape[0])
x = np.c_[x, all_ones]
f = np.dot(x, model.w)
loss = model.total_loss(f, y)
y_predict = model.predict(f)
acc = np.mean(y_predict == y) * 100
return loss, acc | 1 |
a9a5cfeb5944b07ad06e0bff4570c084 | 080c62d3e6c61fb23cc0aa16e9cc05a9 | 根据身份ID来查询所有保单号列表。 | List<PolicyProduct> getByInsurcompId(String id); | 0 |
62fa4a151ccfbfaf3d80bdd74dc0b900 | c96eec049272efa7ab06bbd9a6339ebf | <p>
All those actions that contain at least one front-end action
state that is deferring to this operation.
</p> | Set<String> getRequiredActions(); | 0 |
ead5deebf460057e1c8789d0ebb49384 | a8ad6766bf4861dedc6542aa428e6172 | Receive shot and determine if it has hit or missed. Check win conditions. Opponent takes shot. | let shipType = state.getSquareInfo(state.lastSquareClicked).ship;
let squaresAlive = state.playerBoards[state.currentOpponent].shipSquaresAlive;
if (squaresAlive.total === 0) {
state.sinkShip(state.currentOpponent, shipType);
this.logShot(state.lastSquareC... | 1 |
6033dcb189d088ec3996f86a1ea305f6 | 4ea4ee7005f3566fdd7fdcaaf2b1f0bb | 開始可能な配信グループを取得する(ラッパー) | {
$include = $this->extractInclude($request);
$filter = $this->extractFilter($request);
$isDefault = (bool) Arr::get($filter, 'isDefault', false);
$type = Arr::get($filter, 'type', '');
$groups = Group::query()
->where('id', '<>', Group::UNPAID)
->when... | 1 |
3f858191b757f4335f5d6123bf5aa715 | cbf825c10c14f906a1ef2c9fd6bcb0f6 | 是否关闭ga统计 | if (jumpData != null) {
return !jumpData.toLowerCase().contains("openjdjrapp://");
}
return false;
} | 0 |
1d26226feff72827944c3e54b7536c4e | bffa418a4cfac0b8a6c7c61e4907d0ca | Fetches a set of static IP addresses that need to be allowlisted by the customer when using the
static-IP connectivity method. | class AwsGovcloudIntegrationsEc2(dict):
def fetch_ip_addresses(self) -> Optional[bool]:
return pulumi.get(self, "fetch_ip_addresses") | 0 |
4593205c2cabd0721702bb91cfade299 | 57f9c48d95b9746bc18e4257c490e76c | 关闭视图后需要恢复光标,否则可能因为意外导致光标处于某个操作状态而无法恢复。 | void Widget::on_view1_cursorPositionChanged()
{
if(SWITCH)qDebug()<<"1 View1 cursorPositionChanged";
ui->view1->moveCursor(QTextCursor::End);
} | 0 |
3c007d1bb4a7473546e06e88374d340b | 26b53207b1d998abf40e4e4af38a1fe5 | Example : Explicit typing | class Example
public void Test() {
int value1 = Method1();
int value2 = Method1<int>();
int value3 = Method2(42);
} | 1 |
beb64e64ebb1d87cbbd06fb57013a07c | c2a5bcac8c95e4b27886342804ee352a | 设置摄像头展示区大小 即QLabel标签大小 | void webcamUI::updateArea(int value){
areasizeValue = value;
ui.label_AreaValue->setText(QString::number(areasizeValue));
} | 0 |
4f82331f8641f6118e00f03a680ff082 | f2f1528bbf5bf7eaaaa20c92eddf42a8 | 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:
def connect(self) -> Optional[Queue]: | 0 |
d816ef834cc698e4b32b9462b05c8727 | 1e34222cc55fbf0cbffde50315de90cd | make values like 8,200 be 8200 | function addCommaToIncomeInput(e){
let val = Number(e.target.value.replaceAll(',',''))
e.target.value = val.toLocaleString()
} | 0 |
49d72c0379c71f33225a110a28901f3c | 600bec1cb5c9ff89a8990b9e81a8ce7d | 打开撤销确认对话框 | openPop(){
this.setData({
confirm:true
})
} | 1 |
e3595347e4bda87ef8b9bec4519e0ada | b30f718c9ac07cb3558d840a855b79ea | Gets all keys of a dictionary where the key-value-pair satisfy a specified condition. | {
List<V> retu = new List<V>();
if (RequireLock)
{
lock (ab)
{
IEnumerable<KeyValuePair<K, V>> ret = ab.Where<KeyValuePair<K, V>>(d => ac(d.Value));
foreach (var cur in ret)
{
... | 0 |
fcf583d4a7911cf2ae3e070c8430f5f6 | 678fa7cf0e9c2da5e348be5bfec80676 | 두 날짜를 비교해서 시작날짜와 종료날짜를 체크해서 리턴한다.
날짜 형식은 yyyy.mm.dd 형식으로 넘어와야 된다. | ArrayList<Date> list = new ArrayList<Date>();
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(0);
Date selected = firstDatePick.getDate();
int year = 0;
year = Integer.valueOf(new SimpleDateFormat("yyyy").format(selected));
int month = 0;
month = Integer.valueOf(new SimpleDateFormat("MM").for... | 0 |
78396f25dfe71056c25bde3642fa99c3 | 5e56dda3aa33cfa844f9bbbe3024d180 | 通过医生获得医院 | function getDoctorOrg(){
var data={showCount:1,currentPage:1,doctorId:managerId,signType:1,name:""};
var dataJson=$.toJSON(data);
$.ajax({
url:'/jyOrgInfo/getJyDoctorSignOrg',
type:'POST',
data:dataJson,
dataType:"json",
contentType: "application/json",
success:func... | 1 |
b1f7eda59810859f374fc13d793d0586 | 80afdf4754697fa3717201b280c2338e | Perform Levenberk-Marquardt algorithm until chi-squared reaches some tolerance or the number of iterations is reached. | double maxError, double eps, double tol,
ICalculationCriteria network, double y)
{
double prevdist = 0.0d;
double step = 0.0d;
double xbest = _x2;
double x2ndBest = _x2;
double x3rdBest = _x... | 0 |
ea7e28192abc47e062d799048693cab4 | d29d9c1d72c3ee70d42159b2a6f48949 | Read installation requirements from pip install files. | if os.path.exists(os.path.join(self.doc_dir, 'requirements.txt')):
pip_out_log = BytesIO()
pip_err_log = BytesIO()
pip = sh.pip.bake(_cwd=self.doc_dir)
pip.install('-r', 'requirements.txt',
_out=pip_out_log,
_err=pip... | 1 |
65f8b3f6bbcbf46c175cd089f0de26ce | 9af35506d2691d841408dbf2188e870b | Gets the column identifiers and names from a worksheet in an Excel file | {
if (string.IsNullOrEmpty(tableName)) return null;
if (tableName.LastOrDefault() != '$') tableName += "$";
DataTable tableColumns;
string connectionString = this.GetExcelConnectionString(excelPath, true, eType);
using (var conn = new OleDbConnection(c... | 1 |
187d1f427495a6647bbcda1e79847e07 | 9dac90b06577eb297bdad67988d53821 | NAME
AppIsDeviceBonded
DESCRIPTION
This function returns the status whether the connected device is
bonded or not.
RETURNS/MODIFIES
Nothing. | {
if (appCallbacks)
{
return (SUCCESS);
}
else
{
return (bleAlreadyInRequestedMode);
}
} | 0 |
645fcfb74756fb02fddf7b4abaf96f57 | 9fb4103bd11eb7e74d153c110d603c9b | Adds a keyword for the publication entry. | function addKeyword($keywordItem) {
global $xml;
global $xml_keyword;
$xml_keywordItem = $xml ->createElement("KeyItem",$keywordItem);
$xml_keyword->appendChild($xml_keywordItem);
} | 1 |
d8aa6f90fb6e8aaef2a3863f14823f61 | e44ab220044bd7653d1dfb932203a557 | 清洗作者
传入一行包含多个作者及其脚标的字符串
返回一个字典(key:作者名 value:脚标(list))
主要针对英语,其他语言可能出问题 | num = len(jdict['author'])
bib_dict['author'] = []
for k in range(num):
bib_dict['author'].append(jdict['author'][k]['name']) | 0 |
35fedb0fca117ce6b8d9da12708d48ea | 46d27ea05f2b19551de973a3404ad831 | Laat alle gespeelde kaarten zien op de GUI. | public class GameWindow extends javax.swing.JDialog
public void showAllCards(LinkedList<Player> players) {
for(Player p: players){
getCardsPanel(p.getSeat()).showCards();
}
} | 1 |
46d4a3076b7eed58cac4f4de6786134c | 126910089a24b249132f30ea6fdea06f | Getter que retorna todos os telefones para o formulario. | public class MainActivity extends AppCompatActivity
private List<String> MetodoTelefonesLista(List<LinearLayout> listLinearLayout){
List<String> retorno = new ArrayList<>();
for(int i=0; i < listLinearLayout.size();i++){
EditText edt = (EditText)listLinearLayout.get(i).getChildAt(2);
... | 1 |
b971894c05287e67c64065ee12412972 | 7a6a0f24ac880088ef4b981bb5645abd | HPなどの条件変化に対応するための、PassiveEffectの初期化と再代入 | function My:SetBehitEffect(item,hpPer,bInit)
if bInit == true then
return;
end
if hpPer == 0 then
item.BehitG:SetActive(false);
return;
end
item:StartTimer();
if item.BehitG == nil then
return;
end
if item.BehitG.activeSelf == true then
return;
... | 0 |
62d0202dd3557cb07fc3b39ce62e00bc | 0d6faa5f4795ddf9faefa2a8ade15391 | 控制bgm平滑切换 | if(nil==m_isBgmOpen)then
initAudioInfo()
end
if(bgm~=m_currentBgm)then
isLoop = isLoop==nil and true or isLoop
m_currentBgm = bgm
SimpleAudioEngine:sharedEngine():playBackgroundMusic(m_currentBgm,isLoop)
end
end | 0 |
8a617735a19c8a9706b71983e3a6859a | d2053678c3b364f0c0c41d23bc0a68db | GetFundingDepthMessagePrimaryKey gets a concatenated string that forms from the message fields which identify the depth message uniquely | {
unchecked
{
return (Message.GetHashCode() * 397) ^ PropertyName.GetHashCode();
}
} | 0 |
f2d0428687bf96f090944f99bf4f7f08 | cd0cc68a5b35b9d2c20bafd2b71844e1 | Import properties from a resource (within our JAR?) | String props)
throws UOBSException {
PropertyResourceBundle config = null;
try {
config =
(PropertyResourceBundle) PropertyResourceBundle.getBundle(
props);
sErrFileExtension = config.getString("ERR_FILE_EXTENSION");
sErrFileDir = config.getString("ERR_FILE_DIRECTORY");
sCurrLastUpdat... | 1 |
199026561328c7be22ca91a2fe1b9a28 | 366aaf7e797537e4c667069c214662d3 | function which returns integer Division | int div(int a, int b)
{
return a / b;
} | 1 |
2bea97573fbe7d6cca610533eb0ea7a0 | ccc5f38d1ac77d94edb84d4afcc5a1a4 | Removes columns from the list widget | indexes = self.outputListView.selectedIndexes()
if len(indexes) > 0:
for index in sorted(indexes, reverse=True):
self.outputModel.removeRow(index.row(), index.parent()) | 0 |
de4f03fa0fb58780db2191619a912d56 | 07c61a9bb0bc4385bb539964e86065f1 | 点赞的答案列表 | const user = await User.findById(ctx.params.id)
.select("+likingAnswers")
.populate("likingAnswers");
if (!user) {
ctx.throw(404, "用户不存在");
}
ctx.body = user.likingAnswers;
} | 1 |
42ade0d2663fb0803eb646ecbcd5709c | ab898272a648622892474f3e0f926770 | Estimated covariance matrix for triangulation measures | Mat horizon::getCov(int n, vector<Vec3f> x)
{
Mat cov;
for (int i = 0; i * n < x.size(); i++)
{
int pos = i * n;
vector<Vec3f> tX;
if (pos + n < x.size())
tX.assign(x.begin()+pos, x.begin()+pos+n);
else
tX.assign(x.begin()+pos, x.end());
Vec3f mu = getMu(n, tX);
for (int j = pos; j < n && j < x.si... | 1 |
560b546ed892cef2e36923e49870cfba | 44708dab4445dff212f823b7f20f1022 | Предикат для определения что год публикации первого печатного издания меньше, чем второго | if not self.publication_date:
return False
if self.publication_date < saturn.date(1923, 1, 1):
return True
if saturn.date(1922, 12, 31) < self.publication_date < saturn.date(
1978, 1, 1):
return self.publication_date + saturn.timedelta(
... | 0 |
1b0098ac119b82b4eaf9d7991a3915c6 | 7703a689481c7200184e6677fc57811c | Sets the value of the '{@link fr.istic.idm.project.UIMM.RadioButtonItem#getValue <em>Value</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | void setValue(Object value); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.