query_id
string
corpus_id
string
query
string
code
string
label
int64
a331763afc838722eecaf6ec5c877f57
76358e87967ed4d76de21b5cb7e1a452
是否能安全创建工程
private static bool CanCreate() { return !EditorApplication.isPlaying && !Application.isPlaying && !EditorApplication.isCompiling; }
1
5c3d063bec538fa2df8fc7ffefc639b1
59e6fe5c3b6e8fa1c56d57106cbd9108
Submit one task to workers.
if not isinstance(task_id, int): raise RayvisonTaskIdError(10006, "task_id must int !!!!") self.task.submit_task(task_id, producer) return True
1
21e307eb56c4c205afde07203337b4d4
65af56d3a8fc0981077165edcb70ce46
Dynamically set a column's content
abstract class Builder protected final function set_col_value( $col, $val ) { $this->data[ $col ] = $val; }
1
38c474ed89009093dc84294836c87e31
5e3093070ae5c00ac6dcf7b4b0ca6700
Caches a given flattened order of instructions for a basic block.
if decode_loop_step is not None: key_seq_dim = cache["key"].shape.as_list()[1] indices = tf.reshape( tf.one_hot(decode_loop_step, key_seq_dim, dtype=key.dtype), [1, key_seq_dim, 1, 1]) key = cache["key"] + key * indices value_seq_dim = cache["value"].shape.as_list()[1] ...
0
53d7c3bc73edc98a6e39f4dc537421ad
f972d95ad660479b4453a1284b67515b
获取订单航班
let self = this let data = { deptcode: self.data.deptcode } API.invest.getFlowno(data).then(result => { let res = result.data if (res.flag === 1) { self.setData({ barimg: res.data.barimg, flowno: res.data.orderInfo.ordernum, }) self.getOrderD...
1
41feee3c46aac35d6b74289ff06970cf
0ce475204ef3c4e9c9821227650a489f
Records a TWA has been opened.
$properties = array( 'setup_storefront' => isset( $_POST['setup_storefront_theme'] ) && 'yes' === $_POST['setup_storefront_theme'], 'setup_automated_tax' => isset( $_POST['setup_automated_taxes'] ) && 'yes' === $_POST['setup_automated_taxes'], 'setup_mailchimp' => isset( $_POST['setup_mailchimp'] ) &&...
0
30647815b68e328d7926148441ecc7a5
214b47eaa2bbea297e592581cbf6c0c1
Object to hold and display the results of a Wald test
self.out = None self.fit = None self.res = None self.bkg = None self.bkg_comp = None self.peaks = None self.init = None self.covar = None self.coeffs = None self.stderr = None
0
d79cf4ffd0c84a3553e1c6bd266c6849
0359f0295c390fe4ed18a4ca9c0ccf2c
Обработка пачки юзеров в системе rocket jump. Отправляем им запрос для получения статусов юзеров.
{ $model = new AccountsStatusModel(); $requestInfo = $model->getAccountRequestId(); foreach($requestInfo as $request) { $requestId = $request["request_id"]; $entityId = $request['entity_id']; if(!$requestId) continue; $adAccountInfo = $model->getAccountInfo($requestId); if($adAccountInfo) { ...
0
a298c2324d4c36a6d22f399144d2b980
43c7d5d4dc80d4648d70c469fc937756
A definition of the abstract method from the Hand class to check whether the hand is a valid Straight Flush or not. A Straight Flush in Big Two is defined as a hand consisting of 5 cards of the same suit and with consecutive ranks. 'false' if the hand is an invalid Straight Flush
{ if (this.IsValidHand(hand) == true) { if (this.IsStraightFlush(hand) == false && this.IsFourOfAKind(hand) == false && this.IsFullHouse(hand) == false && this.IsFlush(hand) == false && this.IsStraight(hand) == false && this.IsThree...
0
5655d13c34145170a814d4534b6483cc
85e07f1b7d239faa4a02d7e76d211168
Returns a new object of class '<em>Type Cr Reconnaissance</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
TypeCompositionDotationTheoriqueEnType createTypeCompositionDotationTheoriqueEnType();
0
49db0aecb75887cf82e22a304a56c266
d04ebc76b170814aa6dd3f15f2642854
Alle Bewertungsobjekte aus Datenbank laden
{ Debug.WriteLine("KonsumKreditVerwaltung - BildungsAngabenLaden"); Debug.Indent(); List<tblAbschluss> alleAbschlüsse = null; try { using (var context = new dbLapProjektEntities()) { alleAbschlüsse = ...
0
558db14186a1e01d50d24e40a78dcdc7
d314b3d1d10cdb416f11916a1aa56316
Return how much food the cat has left
{ float amntPoop; float lostWeight = (0.005 * m_weight); amntPoop = lostWeight + .98 * amntFood; m_weight -= lostWeight; m_weight = static_cast<float>(static_cast<int>(m_weight * 10.)) / 10.; return amntPoop; }
0
4c5cccb816107c281d5897cb0b2fa252
8c79dc247261f36a7b89ade34e574072
funkcja ustawia wysokosc okna
void set_ventana_height(uint32_t value) { setParam(PARAM_VENTANA_DIM_Y,value); }
1
9c39e1f0b78bcc01d7ffa3f53699c332
4aff5794a56f29dc4feccc906c1f84fa
sv0にsv1を合成する
{ ByteVector bv; Byte b = 0x00; for (int i = 0; i < s.size(); ++i) { bv += b; bv += s[i]; } for (int i = 0; i < 2 * s.size(); ++i) return bv; }
0
9724729da3f7223816cfbf73ad21be95
d091c9a47bc7eef48ac8aa6ff688b5f7
Constructor of the layered graph. Note that it *only* creates vertices and DOES NOT connect them
this.vertexes = vertexes; this.layout = null; this.root = null; this.layers = new go.Map(); this.bounds = new go.Rect(NaN, NaN, NaN, NaN); }
1
257cd306971fe357073c2c97a6ae6ddf
172185aad5533a98607bc9a21ad7a711
Value an active cash flow structure of a bond.
Newtonsoft.Json.Linq.JToken rate = null, Newtonsoft.Json.Linq.JToken per = null, Newtonsoft.Json.Linq.JToken nper = null, Newtonsoft.Json.Linq.JToken pv = null, Newtonsoft.Json.Linq.JToken fv = null, Newtonsoft.Json.Linq.JToken type = null);
0
9ed3fbc17a0114d559225e7cfccaabfb
3ffb74fba17d91ae66cdc4edae6dc18b
课程预约管理
public ModelAndView gotoBooking(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView model = new ModelAndView("/business/sk_class/bookClassInfo"); SimpleDateFormat dateFromat=new SimpleDateFormat("yyyy-MM-dd"); User loginUser = SessionUtil.getLoginUser(request); String view...
1
5d15aa217db89059cb77ac022e45f335
13a4f563720483e9f0c143e1b273e073
Gibt Karten ohne bestimmten Typ zurück.
if (race !== undefined) { var output = cardsf.filter((item) => { return this.fAttrRace(item, race, 0); }); return output; } return cardsf; }
0
b34ca9ca266e3a76fa888a5ddac25dfc
e5112ffb9191d1652cc6831182ffe29e
Load the current plane. As part of a batch of stitched planes.
pre_planes, labels = classified_plane reset_pre_planes = list(map(input_helpers["reset"], pre_planes)) return reset_pre_planes, labels
0
9ebb0609edaf1dfb8c5570e2f45408a2
23f951adba7735e2967309c2292b5844
Deletes the local copies of the audio files.
class FadeAudioTest(globalTests): def tearDown(self): del self.TestAudio pathops.delete_if_exists("./.TestAudio.wav") pathops.delete_if_exists("./.TestAudio.rename.wav")
1
298f12ae014486c2c4a31bd12cee2c45
0806a36a75cda94ac5215995919ab9f5
Handle HTTP errors. Call is controlled by the specific API methods.
class AvsGoDynamicHtml extends AvsDataSourceMixin(AvsHttpMixin(PolymerElement)) _handleHttpError(event) { }
1
c2f735d10cb73dcbc3fedd493f822f54
885181fba2deb9e24d1f2ae7606ce8ec
Vanilla RNN Cell.
class RWACell(tf.contrib.rnn.RNNCell): def __init__(self, num_units, decay_rate=0.0): self.num_units = num_units if type(decay_rate) is not tf.Variable: decay_rate = tf.convert_to_tensor(decay_rate) self.decay_rate = decay_rate self.activation = tf.nn.tanh
0
eff2c46db66480d86529e24f51d5034e
00a173bee6deeef025afa85d03f243b9
查询会员结余款流水帐方法
public class UserBillService{ public String accountQuery(String str) throws ParseException{ JSONParser parser = new JSONParser(); JSONObject parseObject = (JSONObject)parser.parse(str); RsAccountBO rsAccountBO = RsAccountBO.getFromApplicationContext(); Page page = new Page(); try { Map<String, Object> p...
1
b87fed8e88776c145f1381dab87a0aaa
38e63da5fe8374df0c4f0d7440a41953
从任务大厅中随机领取一个任务
{ uniform_int_distribution<int> dist(0, distance(task_queues.begin(), task_queues.end()) - 1); auto it = task_queues.begin(); advance(it, dist(rng)); auto& q = tasks[*it]; auto ret = q.front(); q.pop(); if (q.empty()) { task_queues.remove_i...
1
7f2df6cf5c5999d73acea760b2d8d849
54582b4a7b2c767273a8677311cb2a03
如果是第一次播放视频,那就创建一个新的surfaceView
public class CaptureActivity extends Activity implements Callback ,OnClickListener , QianseitActivityInterface{ @Override public void surfaceCreated(SurfaceHolder holder) { if (!hasSurface) { hasSurface = true; initCamera(holder); } }
0
be74468c852d456aa8dad2d706dcf685
4015390aba0ae0aa89766c4cbd3395c5
Toggles flag on clicked tile
class Sweeper flagSquare (eventTarget) { const htmlId = eventTarget.id.split('-'); const thisSpace = this.board[htmlId[1]][htmlId[2]]; if (!thisSpace[0]) { thisSpace[3] = !thisSpace[3]; eventTarget.classList.toggle('flagged'); } }
1
9501ca02648749ecb88a822cc15fb3f8
d9d50a429701121d5a0dedcd04fc657b
method that begins the race and prints who won
carsOnRace = carsReady.getCarsReady(); int carsSize = carsOnRace.size(); for (int i = 0; i < carsSize; i++) { carsOnRace.get(i).setName(carsList.get(i).getName()); carsOnRace.get(i).start(); } }
0
e2f52b0b1eaa624b52d48c0bb3d94144
0f561a789503b8e2633ab52e090cca95
the constructor creates condition parser generator initialized with given code parser
this->codeReader = new CodeReader(lexer); this->threadManager = new ThreadManager; this->loadCommandMap(); }
0
c3106b65c301ebe0918180d5a3b5b98a
0f56a656f88b1d6e8be5a20934cbc2bb
\brief Parse predicate arguments. If \c f==0, they are arguments of a predicate declaration. If parsing a declaration, argument names are pushed to the \c arg_names vector.
OPTBL *oppTy ) { #define MAXNARG 100 // max # args for fcn (temp storage size) PSOP ps[PSSZ]; USI codeSize; UFST stb; UFARG arg[MAXNARG]; SI aN; USI off; UFST *p; RC rc; SI nFaSave; UFARG *fArgSave; stb.ty = oppTy->v1; stb.sz = oppTy->v2; if (tokeNot(CUTID)) return is...
0
2be2fd7cc01d491a997d6f8619d2213a
1d8b7234d9e2d2972b95c11975e4c2f5
Check if two geometries are equal and have the same point ordering. Returns true if the two geometries are equal and the coordinates are in the same order.
namespace GeoJSON.Net.Geometry public class GeometryCollection : GeoJSONObject, IGeometryObject protected bool Equals(GeometryCollection other) { return base.Equals(other) && Geometries.SequenceEqual(other.Geometries); }
1
dbd532704a31a76dd7d3e4495ca63206
d97204d8413d2c609f3152a68b6e53e5
Outputs a post's Categories in a list. Use in The Loop.
$post_categories = wp_get_post_categories( get_the_ID() ); $cats = array(); if( $as_list ) { echo '<ul class="category-list">'; foreach($post_categories as $c){ $cat = get_category( $c ); echo '<li data-cat-slug="'. $cat->cat_ID .'">' . $cat->name . '</li>'; } echo '</ul>'; } else { $first_cat ...
1
401c658bf5d3b7f33ecd1e38b17648db
838287cfafc3391123e57b397b351927
Schedules the MiniZinc evaluation and keeps track of the scheduled job ID
namespace DSC.Business.AsyncOperations public class TermPlanSearchWorker : AsyncSearchOperation<TermPlanSearchArgs, UndoBindingListView<TermPlanSearchResult>> protected override void SetJobId() { if(IsBusy) { JobId = DalFactory.CreateInterface<IDbJobManager>().GetNewJ...
0
405dde7f08ab15c7635b1a8b0e5e107e
0e6b14c21f2a92086db24c432d03d3ec
Handles the OnClick event of the lbtnSendReport control.
{ Hashtable reportOptionalParameter = new Hashtable(); try { this.Cursor = Cursors.WaitCursor; reportOptionalParameter.Clear(); reportOptionalParameter.Add("KeyName", "TemplateID"); reportOptionalParameter.Add("K...
1
e902193c4dfd6201d54febab45cf139a
37bfa5943aa3930ed160774becc859a4
Partially allocate stock
SalesOrderAllocation.objects.create( line=self.line, shipment=self.shipment, item=StockItem.objects.get(pk=self.Sa.pk), quantity=25) SalesOrderAllocation.objects.create( line=self.line, shipment=self.shipment, item=Stock...
1
e30eb3dd2c53a6a81874b76e4557b6d6
9caf9262fed8865be01a6f967811b607
This method runs all the error detections strategies with all the possible configurations on the dataset.
def solve(train_sets, test_sets): size_to_model = find_best_config(train_sets) X_test, Y_test = splice(test_sets[100000]) size_to_error = {} for size, model in size_to_model.items(): prediction = model.predict_proba(X_test) incorrectly_classified_no = 0 error = 0 for k in...
1
4907e4bb950a112ea5dbc52395a46ae8
0c35cd24ddd222acab981f87e579478d
Partition the array/list lst around a certain pivot choosing uniformly at random lst = input list/array start = start index end = end index
if end is None: end = len(ls) - 1 if end - start < 1: return pivot_index = random.randint(start, end) i = partition(ls, start, end, pivot_index) quicksort(ls, start, i-1) quicksort(ls, i+1, end)
1
81ce8fecde13009ee365075a61fa1a87
d426c54f1be623d2d80928fa51f1293d
<p> 判定是否开启连接池、及url是http还是https <br> 如果已开启连接池,则自动调用build方法,从连接池中获取client对象<br> 否则,直接创建client对象<br> </p>
public class SimpleHttpClient implements Closeable protected CloseableHttpAsyncClient getHttpAsyncClient() { if (httpAsyncClient == null) { synchronized (this) { if (httpAsyncClient == null) { try { HttpAsyncClientBuilder builder = HttpAsyncClients.custom(); builder.setMaxConnPerRoute(maxConnP...
0
0d5a6a7a15dea4a8f3841286ebbdb666
79b4c41b72ff7ba6c737d07e0cbacc4b
Loading Landing Page and Modal
function IntroModal(props) { return ( <React.Fragment> <div className="w-full h-full z-10 block absolute bottom-0 bg-black opacity-25"></div> <div className="z-30 mx-5 absolute bottom-0 w-auto"> <div className="bg-white rounded-md mb-3 p-6 text-center shadow-xl"> <div className="flex justify-cente...
1
3361670b0d5d4f0106b5c8e2fdf0dce7
386b932d4dc0e68de95172deaccf73a3
这是一个批量删除设备故障信息的方法
namespace EquipmentSystem.DeviceManager Task BatchDeleteEquipmentAsync(EntityDto input);
0
c34c754b8eb47a2e4230acc917a9c9b5
f5c924d5c93fdf162e27429ddcefdca7
If a commit exists as specified, return the change_num, else None. If no branch_id specified, return highest change number of matching commits.
def get_commit(repositoryName=None, commitId=None): pass
0
547c277a30bd4658e2f5c350352fb14e
f3651bab53537423eb639d3b4c7d83e8
把中文内容转换成数字信息
class sortItem: def cn2dig(self, cn, encoding="utf-8"): try: result = int(cn) except Exception, e: if isinstance(cn, str): cn = cn.decode(encoding) count = 0 result = 0 tmp = 0 while count < len(cn): tmpChr = cn[count] tmpNum = const.Level2_Chinese_Chars.get(tmpChr, None) or const.Lev...
1
72ceffbc4e9b19272dc3c52878274259
637d353379e7c264f41901a9e0cef20a
Returns the business services assocaited with this business entity.
@SBIAssociation(label = HAS_UNIT, direction = Direction.IN) public Iterable<BusinessMeasure> getBusinessMeasures();
0
1907ff37ecfd4f26841561dcaced122d
f860d26ca75a864a0cad108e47516e7c
Chèn thêm 1 phiếu thu
{ ObjectParameter err = new ObjectParameter("err", typeof(string)); using (QLThuhocphiEntities ql = new QLThuhocphiEntities()) { ql.InsertPHIEUTHU(pt.SOPHIEU, pt.MaNV, pt.MaSV, pt.HocPhi, pt.MienGiam, pt.ThucThu, pt.NgayThu, pt.MaLyDoThu,err); } ...
1
c4a40744ad9acec03b86ae48ff603022
25aad39d5742106cb4012c9503a80c9b
Index within a loop of this mapping (note loop might be for a parent object)
export class UVLoopLayers public get active_index(): number { return PythonInterop.getInteger(this.interop, `${this.accessor}.active_index`) }
1
1038fe2dcff3f14a25525efe28809c68
60fcfb82fafb31a7bda2622596050d78
Returns the value of the '<em><b>Low Voltage Override</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Low Voltage Override</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc --> annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documen...
boolean isSetAlarmLowOff();
0
f5215b265d29801056bced826cbcf32e
dcae2eb1b64cd9ccbf0c82f9fe3aaa7a
Execute Spatial Pooling algorithm over input space.
class SpatialNL(nn.Module): def __init__(self, inplanes, planes, use_scale=False): self.use_scale = use_scale super(SpatialNL, self).__init__() self.t = nn.Conv1d(inplanes, planes, kernel_size=1, stride=1, bias=False) self.p = nn.Conv1d(inplanes, planes, kernel_size=1, stride=1, bias=Fal...
0
6cf49a44cb0cb2181f7f47c8059a4ca7
3c5e07cab8294069905a7d0359c73314
Standard window-focus override. Notice focus lost so we can pause on focus lost. e.g. user switches to take a call.
xbool Application::OnFocus() { Global.m_bWindowFocused = true; return false; }
0
c0b21095190eb310980ce79024f66ae2
0144d573b93be277073577f6ee45e4a6
Возвраащет признак показа поста в мессенджере.
class OfferItem extends AbstractAdItem public function getShowInNotify() { return $this->get(self::FIELD_SHOW_IN_NOTIFICATION); }
1
68f921081cdc7d1cf3582f8ac0d01137
0d13b39c9a7ddaaacbefcd19143dc65e
Get the review associated with the purchase.
class Order extends Model public function reviewOrder() { return $this->hasOne(ReviewOrder::class); }
1
c829a366b45e4e84e6a1c80b4dcf3c5a
ace39204e8281ba6f2366f0db79c01d2
thread timing (in nano seconds)
#ifdef __linux__ timespec tp; double time; clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp); time = tp.tv_sec * 1000.0 + ((double) tp.tv_nsec) / 1000000.0; return time; #else return -1.0; #endif }
0
eaa99aaf9e7b1639f6a368e7b8664935
b5ef283fc681ae2f65e25a14e71aa047
This API is used to get trigger logs.
{ JsonResponseModel<ListTriggersResponse> rsp = null; try { var strResp = this.InternalRequestSync(req, "ListTriggers"); rsp = JsonConvert.DeserializeObject<JsonResponseModel<ListTriggersResponse>>(strResp); } cat...
0
beb60bb9fa3c73edd78036c475b845db
a8499363550d114d17a4b238d4ee37da
Template for creating modify grid layout button
class Modify_window(Create): def button_create(self): text = "update" font = design.button_font read = tk.Button(self.root, text = text,font = font) read.grid(row = 5, column = 0) read.config(command = lambda: self.run_modify())
1
3dc4c17814f4308e1d92b59084a33bff
4ea0f78c93c2555c5906ff2caca7d01a
获取未报价的报价列表数量
class quoteModel extends Model public function noQuoteListCount($company_id,$soso) { $where =[ 'inquiry_supplier.supplier_id' => $company_id, 'inquiry_supplier.status' => 0, ]; $invitedNoQuotedNum = $this ->table('inquiry,inquiry_supplier')->join('left') ...
1
c9f8a6cac3dd469c8d3efe1301b81447
a3e0828ae36e7c04fe3fb48493ca86be
Inicializa botón enviar correos
function startApp() { enviar.disabled = true; }
0
bd13cd4d9b3dcb7307cd0da2a1e2efa5
f34c77fd9475c5132704e554ed960f22
Reset the thread identifier to initial values previous to any spawns
static void reset_helper_control (void) { __helper_once = PTHREAD_ONCE_INIT; __helper_tid = 0; }
1
9dc75f504c5ff99d01f38e1308d97572
46a4ffdaad8f04a6ec08415d648852d5
Imposta o_ denominazione titolo frontend.
public class SamopPnl extends javax.swing.JPanel{ public final void setTitle(String title){ frName.setText(title); }
1
9533ece0230ef3e4bb42054b738cc7a4
dec0e60f67853ffc638dd54dcdc9310b
This function loads and merge message and categories data
messages = pd.read_csv(messages_csv) categories = pd.read_csv(categories_csv) df = messages.merge(categories, on='id') return df
1
370fcb863e1f6650eb61701fbf44dd77
14dc7523329f5e5239155106027d5227
Non-staff users cannot create new Answers.
_, question_id = self.add_question() headers = self.get_request_header() data = json.dumps(self.answer) url = f'/questions/{question_id}/answers' response = self.test_client.post(url, headers=headers, data=data) self.assertEqual(response.status_code, 401)
1
f857021af87fc2057bee5ad26f558252
b78940f316b2c89fb60834a7ce29cd57
Renvoie l'unité. Par convention : 0 -> m 1 -> cm 2 -> mm 3 -> inches 4 -> feet 5 -> yard
public function getUnit();
1
07c5599721d14cbb7489ad1c21e527ca
ef3f915c05b68b0ceb6633d5ae01ce71
선택된 강의 시간표들을 출력하는 메소드입니다.
public ArrayList<ScheduleVO> getSelectedSchedule(Map<String, List<String>> map) throws RemoteException;
1
a5434bd2f7f7278e6aa964df59b627e3
77cdedc5f6e3ab0fc99d2aa325ec694e
保存核算对象定义
namespace QCMS.Controller public class QCMSController : IHttpHandler, IRequiresSessionState private string QC00002A_Save(HttpContext context) { string res = Const_All.SIGN_SUCCESS; SDP.ORM.Base.TableDal dal; SDP.ORM.DBHelper.DBI_Command cmd; if (Helper_Log.log...
1
a186e2ea31b256daa988e3f9489c87be
def9441eb06d242375a2a96583e278ff
格式化空间大小 形如:[2.63M]
class App def format_size(sz) if (emptyval?(sz)) EMPTYVAL else case when sz < KB then "#{sz}B" when sz >= KB && sz < MB then "#{sz/KB}KB" when sz >= MB && sz < GB then "#{sz/MB}MB" when sz >= GB && sz < TB then "#{sz/GB}GB" when sz >= TB && sz < PB th...
1
a1533a13f40a79eb9d3624d4a30199f8
e3364ced13ca6458ec58e13625c4dc07
Consume object from given coordinates
row, col = coords for entity in self.board[row][col].organisms: if isinstance(entity, classObject): return entity return None
1
70f47f7e03872a9602b01b91918fd15a
10122299ddd32c9208caa08541ae19b7
获取K层叶子节点的个数
if(root == null || k < 1) { return 0; } if(k == 1) { return 1; } return kLeaves(root.left,k-1) + kLeaves(root.right,k-1); }
0
044c0baf3ea973bc0ce6b8dc60596ece
3485d840c29f1344827ccb812ac829b9
从request中获得AppKey
if (context.getHttpServletRequest().getAttribute(AUTH_CONTEXT) instanceof AuthenticationContext) { AuthenticationContext authContext = (AuthenticationContext) context.getHttpServletRequest() .getAttribute(AUTH_CONTEXT); if (authContext.getParameter(CONSUMER_KEY) != nu...
1
4bcc7df7b335f4469757889a55163fcd
1a89ffa860cfb65415cbb38c34c593c2
Returns the *crystallographic* reciprocal lattice, i.e., no factor of 2 * pi.
self, ) -> Tuple[Tuple[float, float, float], Tuple[float, float, float]]: return self._lattice_abc
0
408e9a0bce05acf1d1baeabe8725479c
fa0d1f675975790b90550414cb8b3938
POST /homes POST /homes.xml
@home_type = HomeType.new(home_type_params) if @home_type.save render json: @home_type, status: :created, location: @home_type else render json: @home_type.errors, status: :unprocessable_entity end end
1
2bc921e70f9f9826019a42ff2af511d6
60408ba6c13f70bbcc6dedefae6aa511
Finds orders of the specified symbol and type with specified tag and current bot instance id. If symbol is null or empty then it is skipped.
string currencyPair = null, bool? isToken = null, CancellationToken token = default, IProgress<RetryReport> progress = null) { var parameters = new Dictionary<string, string>(); if (currencyPair != null) parameters.Add(nameof(currencyPair).ToSnakeCase(), currency...
0
a430d76fe4d3c9bfafd63a561c483a67
56d4de95c709904eca051b6bcb68f873
Clear all filesystem, string, and binary attachments.
cleanAttach() { bridge.callHandler('CLEAN_ALL_ATTACHMENTS', ...arguments) }
1
6f6fce6156354d50a320b24c6b195a71
390c99272d1e78acac81e3ce958de5eb
用于检测手机号是否注册过
phonenumber = request.args.get('phonenumber','') print('phonenumber:',phonenumber) user= Users.query.filter_by(phonenumber=phonenumber).first() if user: dic = { 'status':1, 'info':'该手机号已经注册,请重新输入', } else: dic = { 'status':0, 'i...
1
5ef1eafb1059b1879fd3af5121029f5d
7883bc11ef86ed1e19439b5a9261b201
格式化为年月日时分秒字符串
public class NET_DVR_SYSTEM_TIME extends Structure public String toStringTimeDateFormat() { return String.format("%02d-%02d-%02d %02d:%02d:%02d", wYear, wMonth, wDay, wHour, wMinute, wSecond); }
1
05d9f2273bf6a9ed112f7a31aefe07a2
470e635a6a80273c30eeb2714661268a
获取优惠券更新时间
changeTime() { let startTime = new Date(this.data.mainData.grabUser[0].couponStartDate * 1000).toLocaleDateString() let endTime = new Date(this.data.mainData.grabUser[0].couponEndDate * 1000).toLocaleDateString() this.setData({ timeString: startTime + '至' + endTime }) }
0
e6851a7f31b55b9e212871f1be03a02c
d5251ad42cef05630dc5b4aea90f0c07
提取所有高危IP
def possible_ip_crawler(): url_list=['https://www.us-proxy.org/','https://free-proxy-list.net/'] possible_ip_list=[] for url in tqdm(url_list): response=requests.get(url) df=pd.read_html(response.text)[0] df.drop((len(df)-1),axis=0,inplace=True) df['Port']=df['Port'].apply(la...
0
633385feca5589d5cc81095a70db488c
13de9c634a58f1de4d08ab3d64ad1b79
Pas d'édition possible sur des pourcentages.
class Hidden implements Displaytype public function isEditable() : bool { return false; }
1
74a6752677920731385315078cde576a
c4ceaf4466ad8790e968b0b2a5d13b2e
before game start, release billing service resource
public class PaymentScreen extends Activity @Override public void onDestroy() { stopService(new Intent(this, PayPalService.class)); super.onDestroy(); }
0
420ed15509b5e7f22c71d585472de9bc
10d395db3f8e461c1c4f78af87e309ff
OpCode: 0xF8 (Implied) -- Set Decimal Mode.
void SED(byte opcode, byte args[2]) { if(opcode != 0xf8) { displ_print_opcode("Unrecognized opcode for SED %02x\n", opcode); return; } set_status_flag(DECIMAL_MODE, 1); }
1
65a9ee37bf79140f0689a2f0a1b5cf18
b776c2b2ed63e2acdb5f1ce75d224788
Returns the meta object for the containment reference '{@link com.laegler.stubbr.lang.stubbrLang.SendData#getDataType <em>Data Type</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getDataType();
1
775f24efd4cd9ce71d1ef784bc041006
cd310d2893f564d42084c1a59365bfae
Tests the DecodeProductData function using data from testdata/product_sets
SetupSetting(false); DecodeBarcode(); EXPECT_TRUE(UnitTestBarcodeUtility::HasEAN8(barcode_results_)); EXPECT_TRUE(UnitTestBarcodeUtility::HasEAN13(barcode_results_)); EXPECT_TRUE(UnitTestBarcodeUtility::HasUPCA(barcode_results_)); EXPECT_TRUE(UnitTestBarcodeUtility::HasUPCE(barcode_results_)); EXPECT_TRUE...
0
8b00c57336e86a369fb9af514ffbbad6
1ef66d8226fae28558f77776ce385723
插入排序(优化)
func MInsert(input []int) { for i := 1 ; i < len(input) ; i ++ { v := input[i] for j := i-1 ; j >= 0 ; j -- { if v >= input[j] { copy(input[j+2:],input[j+1:i]) input[j+1] = v break } if j == 0 { copy(input[1:],input[:i]) input[0] = v } } } return }
1
bf1201152832304c87cc82e8e4215d03
4b9701833a20684fe21219fd72d13f03
Called (indirectly) from the Tcl notifier loop with a new clipboard event. Follows behaviour specified by TwapiCallbackFn typedef.
gboolean ui_paste_callback(GtkWidget *widget, gpointer user_data) { gtk_clipboard_request_text(gtk_clipboard_get(GDK_NONE), paste_callback, NULL); return TRUE; }
0
4e8b9c5740abef73da71b0c33acaf4d0
125f931f4bb7f9f1acba99f5c4776bab
https://stackoverflow.com/a/8055977
function copyTextToClipboard(text) { var textArea = document.createElement('textarea'); textArea.style.position = 'fixed'; textArea.style.top = 0; textArea.style.left = 0; textArea.style.width = '2em'; textArea.style.height = '2em'; textArea.style.padding = 0; textArea.style.border = 'no...
1
5321461bcafc16cd538ac64e25880f24
49c87305f73265424392e075fa2b7681
限制Text中的指定子字串的字体斜体
textColor: Int = this.superColor, matchStr: String = this.matchStr!!, matchAll: Boolean = false, indexArray: Array<Int>? = null ): SuperTextView { setMatchStrStyle( matchStr, matchAll, indexArray, SuperTextConfig.Style.COLOR, textColor, 0, 0, 0f, 0 ...
0
6f9994e8014eaa84e79f961a155b41ec
7e3ea620ddecaf0980b46c49b1b79848
Calculates the hashvalue of the given file with the given hash_function.
def hash_file(file_name, algo): file_hash = None block_size = 2 ** 16 if algo == 'md5': file_hash = hashlib.md5() elif algo == 'sha1': file_hash = hashlib.sha1() elif algo == 'sha224': file_hash = hashlib.sha224() elif algo == 'sha256': file_hash = hashlib.sha256(...
1
2c8a07c84b274c4fa50d44d10efefc5f
8914771c0494292a48faa848c615230a
校验两条规则是否冲突
class Paper extends Base private function isChangedRule($firstRule, $secondRule) { if (count($firstRule['courseIds']) != count($secondRule['courseIds'])) { return true; } foreach ($firstRule['courseIds'] as $firstValue) { $has = false; foreach ($secondRul...
1
50ceab52d5aa9031e6b26d3099762cc4
1576b24c77882b198d142606febd52ad
Send a JSON payload to a given endpoing
class Resty public function postJson($url, $structure = null, $headers = null, $options = null) { return $this->sendJsonRequest($url, 'POST', $structure, $headers, $options); }
1
45dbb046f6510d60b869692fa359feeb
9ef2ab11f40f872ed8ac693aa1f056d5
r""" Multi-class focal loss implementation: https://arxiv.org/abs/1708.02002
class FocalLoss(nn.Module): def focal_loss(self, x, y): alpha = 0.25 gamma = 2 t = one_hot_embedding(y.data.cpu(), self.num_classes + 1) t = t[:, 1:] t=t.to(device) p = x.sigmoid() pt = p * t + (1 - p) * (1 - t) w = alpha * t + (1 - alpha) * (1 - t) ...
1
f85825fc7a7e572aae48c146cff21163
e254da1c4847fc60fb4312fe6519dbfe
сумма карт крупье
{ $long = count ($table); $total = 0; for ($i=0; $i<$long; $i++) $total += cardValue($table[$i]); return $total; }
1
7f5934a57b2ca5d99ac7538960ca941f
e76d594ec26a4d43235a5ee35cc9c672
It collects a list of tupples with user_id, username and comment.
param = {"shortcode": self.shortcode} return self._scrape_pages(lambda node: {"username": node["owner"]["username"], "user_id": node["owner"]["id"], "text": node["text"], "time": node["created_at"]}, QUERY_COMMENTS_URL, param, "edge_media_to_comment", count, new=True)
1
291ac4741e80bc52c13af037f5993e89
91faf9a4aa2bdcdd05fecdff5c0a4fe7
Returns a simple, native type.
class Repository private static function _getNativeType($type){ if (in_array($type, self::$_nativeTypes)){ return $type; } else { if (array_key_exists($type, self::$_extendedTypes)){ if (in_array(self::$_extendedTypes[$type]['type'], self::$_nativeTypes)){ ...
1
e64d8b2c7cb06c68efd76eb075bba929
14db941cad47ddba89018965644578a6
获得编辑图层
let layer = this.findLayerById(id) as __esri.FeatureLayer; if (!layer) { throw new Error('FeatureLayer 不存在'); } return FeatureLayerEditor(this.view, layer, fieldConfig); }
1
0c8fe1a8ffd9d53475af549ed7c27721
2df76a6b034b169c4f7781feabd7cc12
Test case for cancel_booking_request
class BookingTest extends \Tests\BaseCRUDTest public function testCancelBooking() { $booking = $this->repository->model()->factory()->create(); $this->assertTrue($booking->cancelBooking()); }
1
04850063e473281d05c0c0f53cad315e
6d8440824cad935f9b49590a4b0863b8
外交協定設定が編集済みかどうかを取得する
public class ReservationBean // extends+ // extends- public boolean isCommissionplanModified() { return commissionplan_is_modified; }
0
6e97a77c801f9f54a820f8028ad00250
38227c1a8f8d7000aea613969a44a804
When another screen is pushed, this is called. Ideally you'll want to disable input and gameplay from update.
{ base.Begin(); if (!GameHandleInput) { ParentScreen.ShouldHandleInput = false; } if (!GameUpdate) { ParentScreen.ShouldUpdate = false; } }
1
27f7fa40f58ae0e4c75e8c6b6acdcd10
b09d5bbf62b694466e76536807f8e2ee
Создать случайный объект из списка префабов
{ int index; index = Random.Range(0, prefabs.Length); Instantiate(prefabs[index], position, Quaternion.identity, transform); }
1
58e4c3bc8f14ff0a180293e0801507b1
fbb10ef0e13351b602e71ce1678152f5
任务开始前先自动执行的
class SizeTask(object): def _before_start(self): pass
1
a9de516e01d2c9f2c05e0580b207ec89
78ea211144edbc1f872bcd3bee509cf8
Continue the user permission request (to be called in OnMapReadyCallback#OnMapReady()).
void continuePermissionRequest();
1
3781184fefc226673b8d67a6fca1adad
f9ddb39ce77034546022b3eeedfd5095
暂停按钮委托方法
public partial class MainForm : Form private void PauseButtonClick(object sender, EventArgs e) { this.flagPause = true; this.pauseButton.Enabled = false; }
1
f32903e2d27dc50a116f4036ffd43385
5166920334c7134151537a77fd208728
Apply cleansing rules.
abstract class Pride_Typograph_RuleHandler_Abstract public abstract function clean($text);
1
c83357d6cc2c43e0cfac823b7bb04477
aa8f32d4a94977b5d59115252f8c55bb
Var_Set -- Set the variable name to the value val in the given context. None. Side Effects: If the variable doesn't yet exist, a new record is created for it. Else the old value is freed and the new one stuck in its place The variable is searched for only in its context before being created in that context. I.e. if the...
VXIjsiResult JsiContext::SetVar(const VXIchar *name, const VXIValue *value) { ClearException(); if ((name == NULL) || (name[0] == 0) || (value == NULL)) return VXIjsi_RESULT_INVALID_ARGUMENT; if (!AccessBegin()) return VXIjsi_RESULT_SYSTEM_ERROR; JsiProtectedJsval val(context); VXIjsiResu...
1
bf7df3f8061af2581bffd976ca1922ed
3f1858bc8d1fcd9619b653492c0a1bab
Borra toda la data de autologueo para un determinado usuario
class User_Autologin extends CI_Model function clear($user_id) { $del = R::load($this->table_name, $user_id); R::trash($del); }
1