query_id
string
corpus_id
string
query
string
code
string
label
int64
0324a399e3a47c1025ccb25a4db005c1
ada28e418959a6166c9427b0f990b4be
Removes the slang.
def slang_look_up(text): return text.apply(lambda row: " ".join([slangs_dict[word] if word in slangs_dict else word for word in row.split()]))
0
a916e407e181044ac8d1e08089ab058f
88baf91379cce3e99607f680ab1ad86d
得到文化墙中的风采剪影、班组荣誉
Map<String, String> paramMap = new HashMap<String, String>(); paramMap.put("teamid", getUsersInfoUtil().getLoginUser().TeamID + ""); paramMap.put("displaybanner", isOpenWall + ""); paramMap.put("banners", picStrs); NetRequest.startRequest(NetUrl.UPLOAD_CULTURE_WALL_PIC, paramMap, false, new ResponseCallBack()...
0
6fccf13982f47d2711f2cd7f55b48082
34891ec1602eaf39bc285e2d2774058e
Finds the borders of the coins by checking the surrounding points of every point in the array
void boundaryPoints(String file, set<PointUniq>& Points) { Mat grey = imread(file, IMREAD_GRAYSCALE); PointUniq p; int tmp1; int count = 0; for (int r = 0; r < grey.rows; r++) { for (int c = 0; c < grey.cols; c++) { int tmp = grey.at<uint8_t>(r, c); if (tmp == HoleVal) { tmp1 = grey.at<uint8_t>(r + 1, ...
1
67b4b59895a2ffaaa3151eb95cf63e5c
76d99f58fcddf64551469469061c393d
给图片添加图像水印
namespace ChilonSoft.Helpers public class ImageHelper public static void AddWater(string Path, string Path_sy, string addText, int fontSize, string font) { System.Drawing.Image image = System.Drawing.Image.FromFile(Path); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(...
0
597ea22add77a5c17febcbb46cc7aa46
10d109ab936b9a8b51b669523a5a1ca3
Suppression d'une substitution avec gestion du positionnement de la page courrante (si suppression du dernier element d'une page)
void MenuSouhaits::suprexigee() { objet->Suppr_exigence(choix2->currentText()); update(); }
0
46a9f6ab1ebd2f6a58e22aece7f61421
c3524d87f98b99d9cc5b2ee4f4aa0c03
Create goSNMP client
var goOcto GoOcto goOcto.client = gooctoprint.NewClient(URL, APIKey) return &goOcto }
0
8ccdf3c3d77445ff12ccbcd95c2a1b59
bc3af8b2c6ab7d485e2adb479cd58c3e
\fn void SetPINMODE(uint8_t puerto, uint8_t pin, uint8_t modo) \brief Setup resistor mode for each pin
{ uint32_t port_idx = (gpio_pin>>4); uint32_t pin_idx = (gpio_pin & 0xful); dw_gpio_private_t *gpio_priv = &gpio_intance[port_idx]; gpio_reg_ptr addr = (gpio_reg_ptr)(gpio_priv->base); uint32_t pudr_priv = addr->PUDR; pudr_priv &= ~(3ul<<pin_idx); pudr_priv |= (pin_mode<<pin_idx*2); addr->PUDR = pud...
1
30ccc96fdfc02a7219b08033f0037386
2daec0e404eb63e8b92da2858e0a3ab1
Writes the section opening markup.
{ if ($this->isSilent()) { return; } fwrite($this->file, ' ' . $this->formatter->formatPropertyName($sectionName) . ': '); }
1
e6c6694daaf127ee01298aa1a0b70875
f3b05a9e5b4d98f637009bffc22aea17
Called when local client node has been reconnected to the cluster.
@Nullable public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted) throws IgniteCheckedException;
1
fb5d98b36bb0e1f32a82ea8db2eebef4
ef4a87a52dddbc2cc09cb5932b0fe828
Sets the read state for items in conversation. Calling this method would result in call to EWS.
namespace Aspose.Email.Cloud.Sdk.Api public class ClientThreadApi public async Task SetIsReadAsync( ClientThreadSetIsReadRequest request) => await Task.Run(() => SetIsRead(request ));
1
2fab89a9551e69decfaf54127146f226
e394e1b698adea21e1d312600560fb6b
初始化,将数组中的元素全部设置成-1
void Initial(int s[]) { for(int i=0;i<MAXSIZE;i++) s[i] = -1; }
1
934be3739346d570f5bc0dd43720c1c3
5c5dd3360b4def95b085a52477475754
将新建的根节点数据保存到数据库中
{ RootObject roo = new RootObject(); roo = rootObject; if (roo != null) { _db.RootObjects.Add(roo); try { _db.SaveChanges(); } catch (DbEntityValidationException ex...
1
468790232a46a574cd3eb2673c67652c
c9e9a0dc110430e325ecb96488b82c25
배열 객체를 반으로 자르고, 왼쪽 절반을 새로운 객체로 리턴합니다.
n = n % arr.length return [...arr.slice(-n), ...arr.slice(0, -n)] }
0
51177939f6eaca58e669fae7e8939efa
8552c23964c17ebcffe3ac30f73f0fe2
一个函数,以fun1类型的指针作为参数,以fun1类型的指针作为返回值
int main(){ int fun(int x); printf("%d\n",fun(1)); printf("%d\n",fun(1)); printf("%d\n",fun(1)); return 0; }
0
1118b67c8fb39eedc8d2a8e74d88dfce
2d5a440d83a21825db8cad43a2454f8e
Called before canceling the current wizard step. Here is the point to do all adjustments before the previous dialogs loaded, in the case of a chained wizard.
public class MonthEndWP2Win extends WizardPanelWin public void beforeCancel() { }
1
c8bc30bc93a58d66f2b22b3b3fae74b4
dad95365df67f1a29c0806c741a18c4f
Builds a route entry object that can be directly pushed onto the stack via call to route.push(). This holds all the app view state to support nav bar navigation.
return { layout: this.activeLayout, tabId: this.activeId, tabIndex: this.activeIndex, available: this.getAvailablePanels(), hash: this.hash, }; }
1
4bba6fa58e847933517f65526e67eb6d
cd9d9c8e18b6cd005ad4d9bb1aee2dd4
注册事件,用于在页面回退的时候触发
export class CheckoutPage ionViewWillLeave() { this.unregisterBackButtonAction && this.unregisterBackButtonAction(); }
0
49b5e81fb3b4008d4e9da8c8423b8c25
2ee717faf84f7fb229ca06af06658fbf
Gets random digits to append to a string to create an "unlikely-to-copy" name
appendix := make([]rune, 4) var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") for i := range appendix { appendix[i] = letters[rand.Intn(len(letters))] } return string(appendix) }
0
dc211a9ee3613fff1be33d9a66896fbb
71c44f9be0122c85f16c2948d88acbc6
Compares two IWSElement pointers
namespace Hyperstore.Modeling public class ModelElementComparer : IEqualityComparer<IModelElement>, IEqualityComparer public bool Equals(object x, object y) { return Equals(x as IModelElement, y as IModelElement); }
0
b8afa5c4258d43d28521cdd8d2faaf67
197c5b8bd765b15ca9fc3414115ffcc5
Default transfer function - moves data instantly from tx_buf to rx_buf
set_tx_ptr(self.tx_ptr); write_tx_data_inc(0); write_tx_data_inc(0); self.tx_size = 0; self.tx_tail_size = 0; self.tx_tail = 0; }
0
fe7ae4102e0ead6fe92c8b6962591293
9d04603a28855e71cda9afd54fae6bec
Encode the RGB values of each pixel in an image into arrays of ASCII characters and make the image black. To restore the image, run the decode_image method. NOTE: Large images will result in long processing times and significant memory usage (>100-200 MB for a 1920*1080 image)
def encoder(inputFile, textFile): image = Image.open(inputFile) modeChecker(image) currentPixel = getCurrentPixel(image) for i in range(33): next(currentPixel) byteLength = 0 for byte in iter(lambda: textFile.read(1), b''): byteLength += 1 try: for iterator in...
0
bf9d2fd14a556ad450213f9d68915542
753c5d82fee7017b6037153975a74af3
Returns the order by type of this journal feed.
@ProviderType public class JournalFeedWrapper implements JournalFeed, ModelWrapper<JournalFeed> @Override public java.lang.String getOrderByCol() { return _journalFeed.getOrderByCol(); }
1
ea3bbc96da10b77925896a3db8be507f
2457278408c47c29c99ab8b4389024f8
出力に使用する行合計値の名前を取得する
public class TimeMessageUtility protected static String getNameTotal(MospParams mospParams) { return mospParams.getName("Total"); }
1
0f8b2d169ab4063cd696b907c448a8b7
38fea358edfe7d425febf8a37308a1a8
添加下载内容
public class DownloadFragment extends Fragment @OnClick(R.id.download_fab_add) public void onClick() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_download_add, null); builder.setView(view); ...
1
fc065cf370c2b4008f180776c24c9ab0
bcfee3a8617a52a6a9de9d8674af7713
Init the cache, put data in, and check that the results are returned
for test_case in correct_cache_init_data: try: ob = SimpleCache(test_case) except Exception: pytest.fail()
0
08eaaac6f553d70e8ce4ff306bca9d69
74050e2efaf170ced423c500e44c6393
创建 "编辑" 一级菜单的子菜单
{ $temparr = Array(); if($this->canedit) { $temparr[] = Array('type'=>'td_22', 'value'=>'<A href="admin.php?act='.$this->moduleact.'&subact=editdeepmenu&id='.$line['id'].'&categid='.$this->categid.'">'.$this->adm->DrawIcon('edit').'</A>'); } return $temparr; }
0
0797bce195c76a70b9689a6277534e39
b3c4a2a9d49cb45abdd910a8e8a8f464
Lifecycle method that executes when binding is complete
abstract class BaseKotlinActivity<T : ViewDataBinding, R : BaseKotlinViewModel> : AppCompatActivity(){ abstract fun initAfterBinding()
1
bc248147b2cf7f41f7e32949472ffc91
be80be8dee8567fb4e7ac3dacb008b5a
adds a {@link IDataNode} that is written by this {@link IFlowNode}.
public class Workflow public void addFile(RDataInstanceNode rdin) { fileNodes.put(rdin.getId(), rdin); }
0
909657750cdb576a41f474ac6e76e175
0713c2ca524397034d399133e7eeb6f1
$Procedure VSCLG ( Vector scaling, general dimension )
Vscale::Vs(int argc, char **argv, int, char **) { argc--; argv++; switch (argc){ case 1: { double vs; if (MacroExec::getDoubleArgs(argc, argv, &vs, 1) != 1){ ABORT; } rescale_image(vs); break; } case 2: { double pix[2]; if (MacroExec::getDoubleArgs(argc, ar...
0
d0fce3b2298808903f6f8b59649bc15b
0eccb47e9b18c9489963e606b4d75f74
Loads all exchange rates. Keys are the ISO 4217 codes of source currencies, values are arrays of which the keys are ISO 4217 codes of destination currencies and values are \Commercie\CurrencyExchange\ExchangeRateInterface objects, or NULL for combinations of currencies for which no exchange rate could be found.
public function setExchangeRates(array $exchangeRates = null);
1
dd146f8138e0acf184e4577405c6a7b1
a498983016bec2376ae82431f06b72e2
Checks the validity of the key that is pressed. Checks space and length.
const validKeys = "1234567890"; return newInputValue.length < currInputValue.length || (currInputValue.length < newInputValue.length && !currInputValue.includes(keyPressed) && validKeys.includes(keyPressed)); }
0
37ebdf192e8b69aa699f4e9e378fbaa9
1d073b8cb2f7761fa674c902ff478837
Cuenta el numero de fichas de cada jugador y lo devuelve como una tupla
class Board: def get_score(self): return (len(self.player_1_cells_captured), len(self.player_2_cells_captured))
1
049e8c571feb3d4aa2f07e267fa07833
bfc6558a54fa9077951133a2668a4de5
Returns the n highest values of the array
class ArrayManager(object): def high(self): return self.high_array
0
ae80fd8b3c35a775aeb7064a001ca7e6
beea440a12c61869a8511973dc946326
Function to create staging table in database
query: str = _make_create_table_query( table_name=TableName.STAGE_ELEM_ID, column_ddl=" elem_id TEXT NOT NULL" ) cursor.execute(query)
1
6c440b46424976475810252b6afe2504
38263c139ed0a02b115a51180ea41811
Make sure the RIDs of all interface implementation rows are determined.
void Font::_ensure_rid(int p_index) const { if (!rids[p_index].is_valid() && data[p_index].is_valid()) { rids.write[p_index] = data[p_index]->find_cache(variation_coordinates); } }
1
37a0f17f06d33e310c388d49d7376903
95a61bf21a85d0623a599448fa07a65e
Get vote of feature for given integral image.
im_copy = im.copy() im_copy = efficientnet_preprocess_input(im_copy) result = FeatureExtractor.__feature_extractor_model.predict(im_copy) return result[0]
0
7106da70d1289d97961dc60686f9c207
943c9a942d98d87fbb358f27ff1f7640
Создать (или привязать существующий) адрес (email, sms, push) к подписке
{ $this->Viewer_SetResponseAjax('json'); $sMail=getRequestStr('mail'); if ($this->oUserCurrent) { $sMail=$this->oUserCurrent->getMail(); } if (!func_check($sMail, 'mail')) { $this->Message_AddError($this->Lang_Get('registration_mail_error'), $this->Lan...
1
953b8fe07701d9f3b7ffed0992223f47
eb3a53e7c5b49f14baabd45f6088c1d4
Kreira naredbe na temelju unesenih parametara i vraća istu (ovisno o unesenom parametru).
public class InstructionFactory public Instruction build() { if (resource != null) { return new InstructionImpl(resource); } else if (rmaText != null) { return new InstructionImpl(rmaText, rankOrder); } else if (text != null) { return new InstructionImpl(title...
1
632539b66beb9afa42ecee41b602e3f8
c8fc47c2b057c3e1dab617369e406f60
r"""Tensorboard logging function. This function logs the following: - ``Running Discriminator Loss`` - ``Running Generator Loss`` - ``Running Losses`` - Loss Values of the individual Losses.
class BaseTrainer(ABC): def _write_to_tensorboard(self, loss): for key, value in loss.items(): self.writer.add_scalar(key, value, self.steps)
1
fd1754c24e6a939ede9dea06bfd00209
1e5d1f97a041538899ed6aa1810ba7e2
对标注信息进行过滤,记录不符合要求的图片
def label_filter(input_data): f = open(input_data) lines = f.readlines() f.close() label_list = [] label_text = [] label_pic = [] label_num = [] for line in lines: data = line.split('\t') label_num.append(data[0]) label_pic.append(data[2]) text = ' '.join(...
0
30d8dbca9525ad789d86c02b04902823
e3251fa3e1e9ba18bd95b3521b9d2404
@brief 提取堆栈溢出信息功能模块槽函数
{ if (false == gMsgMutex.tryLock()) { return; } while(!g_ShowMsg.isEmpty()) { QString strMsg = g_ShowMsg.takeFirst(); QStringList listMsg = strMsg.split(","); if (listMsg.length() == 8) { QTableWidgetItem* item = new QTableWidgetItem (listMsg.at(0)...
0
ebc350cadedcfaa513da7f054e174fbc
ed3ad1b1920cbb8d5eef9807ffe23a1f
Отмечаем ячейки как найденные и увеличиваем счетчик найденных пар
function clickOnCell(event) { if (watch.isOn) { if (event.target.className.indexOf("hide") === -1) { return; } event.target.className = event.target.className.replace(/ hide/g, ""); pairCounter++; if (pairCounter === 1) { firstCell = event.target; ...
1
154c2d6d3cab476e7856482b748f9f1d
ef8d1895ee10056d9e0be8ee3ab4d9de
Converts all OS-specific directory separator characters to '/'. Useful for outputting to a config file or similar.
function backslashToSlash($value) { return str_replace(DIRECTORY_SEPARATOR, "/", $value); }
1
ce3279c32007621428cd73b103a333fa
7bd2031b8d8809068005c6ddf3ee4207
Add a heading, the heading count is automatically determined.
abstract class base_moodleform extends moodleform function add_heading($name , $text) { $this->_form->addElement('header', $name, $text); }
0
d0dba1b7c0c142bb452847c89d54eb89
59d6ac0e757fd32f15673fe830ca9c8b
Sets the parent container to the specified phase.
this.isNewPhase = isNewPhase; if (isNewPhase) { currentPhase = (currentPhase + 1 == Integer.MIN_VALUE ? 0 : currentPhase + 1); } }
0
1966fa147319691fe7528266185f213d
9fbcdfa747a34823856249f973e6754e
Recursively evaluate all relevant conditions of the tree, based on the state we use to build the tree
class Tree: def conditional(self, state: State, node: ast.If, index: int): test = node.test p_true = state.generateConditionalProperties(test.left, test.ops, test.comparators) p_false = copy.copy(p_true) p_false.is_true = False logging.debug("Forking %s with conditional %s" % (st...
1
5dda74c904816d40d1e7e9f754df6493
e49fb259ab2b15cc485222db0dc300dd
행렬의 행과 열의 개수를 tuple형태로 리턴하는 함수
class Matrix(object): def shap(self): return self.row_num(), self.col_num()
1
70a80f3744a6b8c0661fc8e8f3ea8071
d491f3a0d0a212cb03e4c19b3e8f114a
Set the 商品分类名称(多个ID用逗号隔开). 商品分类名称(多个ID用逗号隔开)
public class CommMagePagePo extends PagePo<CommMageListVo> public void setCommCatgName(String commCatgName) { this.commCatgName = commCatgName == null ? null : commCatgName.trim(); }
0
49da9450e6c33ad2f199b340eaea5a3b
bf0af195809c73126fc30fc4426e8b19
Esta función obtiene la "fecha desde" que se presenta en el formulario.
class FirmaElectronica{ public function getFrom(){ return date('Y-m-d H:i:s', $this->data['validFrom_time_t']); }
1
827a55a0ff13cf1cdab64f03205e423c
88aa1b19e9893f7a49e5cb743d44e103
Desc:检查运单是否发标,中标,预中标,发标,废标等状态
public String checkStatus(String tsUUID);
1
f75373b38e9b7f80192178c3d5ae2155
3d64250a6271642b3d0682f846223f25
Сумма скидок на товары
{ $I = $this; $productPage = new ProductPage($I); return $productPage->getItemsDiscount(); }
1
16ce0e132579e3f429dbaa0a1831f959
e6009bbfd81d1c50c8dd717667c0d623
네트워크 연결에 따른 콘솔 로그 출력
public class NetworkManager : Photon.MonoBehaviour{ void OnGUI(){ GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString()); }
0
7784c270d74b0a4ec28ffb530f4a4f99
c311e7e41b1f60cf9abc0c36667c20b7
修改收单商户进件时判断是否有修改银行卡号
$data = $_REQUEST; $bank_len = strlen($data['bank_no']); if($bank_len < 16 || $bank_len >19){ echo json_encode(['msg'=>'银行卡位数错误','code'=>0,'success'=>false]); exit; } $arr['username'] = $data['username']; $arr['Yhkh'] = $data['bank_no']; ...
1
1e6033721a7957cd7818b371a491f026
fbe728660303dc1ecf5e9dfd195fae4b
Returns a new object of class '<em>Cdr List</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
SCDRoot createSCDRoot();
0
20b3e9c4010651e1183749a0b9739e6a
03a605f507e5f5d6d7af85b7bbb4438c
Кроппирование юзерпика
async def kicker(): rows = core.allSQL() now = date.today() for row in rows: if row[1]: limit = date(row[3], row[4], row[5]) if now > limit and row[6] == '': text, reply_markup = await check_user(row[1], row[2]) try: await b...
0
84093604d86258e7a097633a107f0173
da7745c50f3c8ccdd43e59a7938944a5
Set the value related to the column: LISTDATERECEIVED
class dbs_pve_data_superslotmachinejackpot extends dbs_basedatacell public function set_recvlist($value) { $this->setdata ( self::DBKey_recvlist, $value ); }
0
e34e9993effe41f76b546b00b71dc587
291d497f23e2af84c34648354b8b91eb
Calculates if supplied integer array is jolly or not.
var result = []; var temp = 0; for (var i = 0; i < arr.length-1; i++){ temp = Math.abs(arr[i+1] - arr[i]); result.push(temp); temp = 0; }; var temp2 = 0; for (var j = 0; j < result.length; j++){ temp2 += result[j]; }; if (temp2/result.length === result[0])...
1
da4b959b3a74d66852aa4111ad2764c9
0b54292b1467ad8cbdd2aaff7f160976
Creates a binary plist Buffer from an object
function parseBinaryPlist(data) { return bplistParse.parseBuffer(data); }
0
79fc33009511854169242a6a807f9cca
aad4546e2954e1adefc748678e79aa27
Debugging function when an N-DELETE-RQ is received.
class DIMSEServiceProvider(object): def debug_receive_n_create_rq(msg): pass
0
59731ad47e0d034efa58fb32daa078d2
b08dcfe02c924d16bfc0c07a8aabab39
Classic tableau 10 palette.
function initPalettes() { var i, j, result = new Uint8Array( 0x100 ); for ( i = 0; i < 4; i++ ) { for ( j = 0; j < 8; j += 2 ) { result[ i << j ] = i << 2; } } return result; }
0
885ff4c5462a997b4202af150ca497a1
c389c33086d4b5a648bcc396f2caa07e
Stranica za CRUD korisnika.
namespace WebApplication15.Controllers public class KorisnikController : Controller public ActionResult AddOrEdit(int id=0) { Korisnik korisnik = new Korisnik(); return View(korisnik); }
1
ba17d34e5efe5a05a3f6ef5ff06ca0f8
3c26d4d7cffb5e0ce4d15627f75bbe45
How large the raw message is with the short 5 byte header
class kalcmd_bluecore_msg_header(kalcmd_msg_header): def length(self): return 2
0
924d9382caaf2c9499f6b8122c5d1476
ba3df8ad4a91b3555edafb0b771186ea
------------------------------------------------------------ alignを作成する。
{ switch (alignment) { case laCenter: format.SetAlignment(StringAlignmentCenter); format.SetLineAlignment(StringAlignmentCenter); break; case laCenterLeft: format.SetAlignment(StringAlignmentNear); format.SetLineAlignment(StringAlignmentCenter); break; case laCenterRight: format.SetAlignment(StringAlignme...
1
f4351eb473954418665e3e914419107c
1e84392c55aaac0a9b58fa22a40609c8
赠品策略类型.
public class OfferRstrRulDO extends BaseDO{ public java.lang.String getRstrType() { return this.rstrType; }
1
f4c07a1ca0fff64751047e66c3251daf
ba883f4560683ed3b02cc3eee4b90154
Get topn accuracy over training epochs
def get_top_k_acc(output,target,k=5): count = 0 top_k = torch.topk(output,dim=-1,k=5) for element in range(len(target)): if target[element] in top_k[1][element]: count+=1 return float(count)/float(target.size(0))
1
537bd39877a0242823ced6b3c89a7d74
eca4e8b495834a66257fda9c1f45149f
Deactivates the furniture info window.
if infoWnd then infoWnd:removeFromParent() infoWnd = nil GUISystem:enableUserInput() end end
1
c407dfc9ea70091cb9d789183a1825dd
92038583f82592315146a34d035e9c97
Gets the action to be taken when an error is encountered during condition resolution.
public class CompileEnvironment public WarningAction getWarningAction() { return warningAction; }
0
a1570eaf5830d14417533416e492f095
b2513e846a4afea1380c60915723c842
分页列出数据库中所有的番剧
internal interface DanDanApiService @GET("api/v2/bangumi/shin") suspend fun getBangumiList(): BangumiListResponse
0
23dbf072cc0702f8305c3d91c0a444ba
d3b7cc0ccb8f8b547aa30190303bb8ec
Run the validations defined on the current HasStateMachine::State. Errors found there should be added to this object.
class ActivityStateMachine(ModelStateMachine): def is_valid(self): return not list(self.instance.errors)
0
5ea9b8dfbf184e332f363e7f83d3e4ca
e8fc1b7163be0f5a12d03cd42211c30e
Return the value associated with the column: FILLER1
public class RLCMIMessage extends RLCMessage public void setFiller_2(String _Filler_2) { write(36, _Filler_2); }
0
4502608f9b62a26722ffbfc828696bd2
a8f44b189a9427af22b7b6127e6e07de
Action for view list of Customers
class CustomerController extends Controller public function index() { return view('customers.index'); }
1
8e2671f56a3ead80623a67aebb30d374
ce4fbdbe5c67a383e37f1420d6824bca
Stores the orderid and the amount in the session.
class BaseOrderHandler: def add_order_to_session(self, order_id): self.orders_ids.append(order_id)
0
cb1989d96f23e68bf52c21da670eedba
eaf94ef87007efb79edfec9f6b134e0a
lists all attendees
class AttendeesController extends ApiController public function index() { $attendees = Attendee::all(); return $this->respond([ 'data' => $this->attendeeTransformer->transformCollection($attendees->all()) ]); }
1
12503bbe1dc173578bb030328cdc5d76
232d3d8abe530f822d778d94a015c9c1
用指定排序算法处理
List<ExecutionResult> resultList = new ArrayList<>(); for (ISorter sorter : sorters) { int[] tempParams = Arrays.copyOf(sourceData, sourceData.length); try { ExecutionResult exeRs = getMethodExecuteTime(sorter, "sort", new Class<?>[] { int[].class }, false, false, new Object[] { tempParams }); i...
1
ff23b90e44a4c01737132b6ac30809db
c6286149ef6346b24dcfe52e18973322
Returns the matrix representation of the given number value.
def value_to_vector(value, size): assert value >= 0 and value < (1 << size), "The value cannot fit in %d bits" % size binary_list = [int(i) for i in ('{0:0%db}' % size).format(value)] return np.matrix(binary_list)
1
0c2080ba0fdf06182d37d5287a003a41
b02774a28e855f36091a6b5a9f862f1b
wait all child process exit
{ int ret_val; while(waitpid(-1, &ret_val, WNOHANG) > 0) { printf("Return from child: %d.\n", WEXITSTATUS(ret_val)); if(WEXITSTATUS(ret_val) == 1) { close_parent = true; } } return ; }
0
cc5dd9302f69c3d1d09695a1396a23e1
aa25727ef01dabd5ec3449ab06914769
通过Post方式提交参数给服务器,也可以用来传送json或xml文件
public class UploadByServlet public static String post(String url, NameValuePair... nameValuePairs){ HttpClient httpClient = new DefaultHttpClient(); String msg = ""; HttpPost post = new HttpPost(Url+url); List<NameValuePair> params = new ArrayList<NameValuePair>(); for(int i =0;...
0
0416bc65871fe5a7f77c29f2ac781847
263c90bbec1a6356b2c76bf7a4becc7e
Returns a list of suites for a project
def get_suites(project_id): req = requests.get(settings.URL + 'get_suites/' + str(project_id), auth=(settings.USR, settings.PWD), headers=headers) return req.json()
1
7b6fb9b5d12fe879887babb04b268d2f
7359bd9c92fe610b6370f73e2a5e3c5d
Gets the riskLastUpdatedDateTime The date and time that the risk state was last updated. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2021 is 2021-01-01T00:00:00Z. Supports $filter (eq).
namespace Amazon.Personalize.Model public partial class SolutionVersion internal bool IsSetLastUpdatedDateTime() { return this._lastUpdatedDateTime.HasValue; }
0
6a3ef9c8ebda428696b99ee755609c64
5a41b3f119034eb82f14bd0d7e0c9a39
Log out of Splunk. For now this simply nil's out the _token_ attribute
class Client(): def logout(self): self._token = None self._user = None
1
0f6e7012474418f9c14efa05d4e3374e
875dc23650043432c8fac0dde0fbeda6
Removes the job on the remote server. The job output that has been transferred to this client object will be preserved.
class HTCondorObjectBase(object): def remove(self, options=[], sub_job_num=None): args = ['condor_rm'] args.extend(options) job_id = '%s.%s' % (self.cluster_id, sub_job_num) if sub_job_num else str(self.cluster_id) args.append(job_id) out, err = self._execute(args) return...
1
cf25ca3b63e9d48234ea04045a94bc4b
13edd5729dc252289f812808f076b65f
Função para fazer a soma de Y //
def Sexta(x): y = 0 for i in x: y = y + ord(i) return y
0
ca82513cbc98b77ba1e0cbf88aa521c1
e82e4a86b6aadca11572cd735cc0b417
Gets a list of all the invites received by the user..
List<IInvite> getInvites() throws DiscordException, HTTP429Exception;
1
baf12c0d1f4796851886cc88ec7aa22d
de6b577101b36aba5a5e3e527c2e7c4a
Is AUTH LOGIN retry enabled.
public boolean getAuthRespEnabled();
0
da8bd259e558356d1b4bd99a461ee606
b8709c019658afa7f83ec4a516791f32
Return parts which are potentially unsafe
public class AnonymizeResult public HashSet<Part> getUnsafeParts() { return unsafeParts; }
1
e516ed8368f2526aff576c0cbbb09ebb
330019f0334b4c6fa9c9f24881d16a7e
Возвращает первый элемент, который удовлетворяет условию $condition, возвращает false, если такого элемента не существует
class Container implements ArrayAccess , ArrayableInterface , JsonableInterface, JsonSerializable, FileableInterface, RevertableInterface, Countable , IteratorAggregate public function findWhere($condition) { $this->where($condition)->first(); return $this; ...
0
7effadd2edf2a865e1fd6c0eb693e713
82cb1c6e64399043898e6153687f21c8
订阅children变化
if (this._childrenData != v) { this._childrenData = v; this.isSub = false; } }
0
34de114e09a8c9b8910d0b8ae1d545aa
e49c4fb8fbca4ad876d3071173b9f3c3
Method to mark a cell as a Mine
def mark_cell_as_mine(row_index, col_index, board, undiscovered_mines): cell = board[row_index][col_index] cell.value = 20 mine_found_update(row_index, col_index, board) undiscovered_mines -= 1 return undiscovered_mines
1
1cfe21574c27447451e11c1591e1d575
d304d32d32c04e0b6a9454caa2bf26c4
Called when the all widgets have been removed from this provider
namespace vgc::ui void Widget::onWidgetRemoved(Widget*) { }
0
0c6ada5ed98e5e3f5ddbf307407b0101
22cf3d3e5d90024156c83ebaab8d6b56
Get a client from the pool or creates a new one if the pool is empty. Also the clients are tested before being returned.
class RedisPool: def get_client(self): return self.__client_cls(connection_pool=self.__pool)
0
011722bfc1dec06cc4a3ce893f49407e
32164f5685db46bf855b00d05696d500
https://gist.github.com/jakevdp/a7b3c47d605ab1d47af5
def annotate_heatmap(im, data=None, valfmt="{x:.2f}", textcolors=["black", "white"], threshold=None, **textkw): import matplotlib import numpy as np if not isinstance(data, (list, np.ndarray)): data = im.get_array() if threshold is not None: thre...
1
6f4468f801691de0554457ca58fce2c8
1784b52552ae05e84b318b41a30a36a9
取一段时间内的病人数据包括风险值
db = MySqlDB() sql = "select region, max(date) from RegionRisk group by region" with db.connect(): result = db.read(sql) response = dict((t[0], Timestamp(t[1])) for t in result) return response["PAT"] if "PAT" in response else None
0
27a40e52b52f727a32c26e0dbe498e6a
6edebb09db856ef448b763b8d1ddba38
Get the code collab dst.
class PostIt public function getCodeCollDest(): ?string { return $this->codeCollDest; }
1
545d17f595d1afc7fc33d3e988576324
c0db9d4ccc3e8a2364e68066697d50bf
32.整数中1出现的次数(从1到n整数中1出现的次数)
class Solution: def NumberOf1Between1AndN_Solution(self, n): if not n: return 0 count = 0 for i in range(1,n+1): tmp = str(i).count('1') count += tmp return count
1
42102c75ac31f50dc8de58c88c130c87
b4063d448275113f3c145212c71e97fc
Finishes the asynchronous execution of the GetViolationDetails operation.
namespace Amazon.IoTFleetWise GetVehicleStatusResponse EndGetVehicleStatus(IAsyncResult asyncResult);
0
0f916e1f58f7fb747520811eb39c93b8
d760b73295569fcb02b7efc7cf36bd68
Calcule la date de fin de l'événement en fonction de sa durée
VouivreDate NetDeviceFRACTALFacet::calculateDateEndWriting(const NetMessagePtr& lMsg, VouivreDate dateOfStartWritingEvent) { return dateOfStartWritingEvent + this->calculateSendingOrReceivingDuration(lMsg) ; }
1
79c584ea9c6ccb69d986a359185c7923
05e07ae47734347b2d077bf0973f6026
Creates a new database connection and inserts a sample user record into the database.
cursor = connection.cursor() cursor.execute("DROP DATABASE cet") cursor.execute("CREATE DATABASE cet") cursor.execute("USE cet") call_command('syncdb', interactive=True) u1 = User.objects.create_user('rnanda1243@gmail.com', 'Ego371!') u1.first_name = 'Rachit' u1.last_name = 'Nanda' u1.about = 'Hi. I\'m Rachit....
1
bca3278d18bf958b503a88c853ae36ed
8c7b5f7595fb6ee548de9e99461fab3c
Function to clean GALEX tiles and create exposure maps
from astropy.coordinates import SkyCoord assert bgs_footprint < 14000. is_bgs = (tiles['PROGRAM'] == 'BRIGHT') tile_coord = SkyCoord(ra=tiles['RA'] * u.deg, dec=tiles['DEC'] * u.deg, frame='icrs') ecl_lat = tile_coord.barycentrictrueecliptic.lat.to(u.deg).value is_ngc = (...
0
2206fde81ec0ee983738477ccf04c605
3729579304ec05e2558eea21b1f87d1b
初始化所有班级学生对应缓存key 网校学生redis hash key格式为 class_ulist_classid
$class_code = key($this->user['client_class']); $class_code = $this->checkclasscode($class_code); $teacherlist = $studentlist = $familylist = array(); $mClientClass = ClsFactory::Create('Model.mClientClass'); $clientclassarr = $mClientClass->getClientClassByClassCode($class_code); $clientclas...
0
27658266f74991de380ac94d23f47fa9
50ac2408a6d7d7b8096ab77a1ec6e88f
使用代理,无用户名密码授权
proxy={'https':ip+':'+port} print proxy proxy_support=urllib2.ProxyHandler(proxy) opener=urllib2.build_opener(proxy_support) urllib2.install_opener(opener) test_url="https://www.qq.com" req=urllib2.Request(test_url,headers=self.header) try: re...
1