query_id
string
corpus_id
string
query
string
code
string
label
int64
ef14b1aa2a287d125fee9ed1c958aa3a
7d80fd0ff513b5bc49df8127a8aae62d
Check whether we edit existing rule or adding new one
ruleVerification(rule, 'edit', (e: boolean) => { if (e) { const tgt = state.userSettings.imageLinkType.presetList.find((x) => x.id === rule.id) if (tgt) { tgt.rule = rule.rule dispatch('USER_SETTINGS_PERSIST') } } }) }
0
bdc1be3636dd9300b960496dded28379
7a5f99a5374c5f2bbcc6ec38c21e7c0d
======================================================================================================================= ! CBaseLineDetection::AddBoxCheckOverlap This tries to add a current box to an existing set of boxes, and try to merge in such a way that all boxes remain true to height and slope requirements \param ...
{ while(rtree.Query(RTree::AcceptOverlapping(bBox), Visitor()).count > 0) { bBox.edges[2].first++; bBox.edges[2].second++; } rtree.Insert(rtree.GetSize(), bBox); currBoxCoords[CIRCUITWIDTH] = bBox.edges[0].first; currBoxCoords[CIRCUITDEPTH] = bBox.edges[1].first; currBoxCoords[CIRCUITHEIGHT] = bBox.edges[2]....
1
ce6fb469524138b3f602f6f8143b71dd
d2b6fd27715850f7671fba73559d884a
Create resource group for a subscription
endpoint = ''.join([get_rm_endpoint(), '/subscriptions/', subscription_id, '/resourceGroups/', rgname, '?api-version=', RESOURCE_API]) return do_get(endpoint, access_token)
0
ae5ce9dbd819522d5c03d62d7d6d9348
48047b861509db97db43af4ed4c081c5
Helper function to get the title for the show action.
self.show_title = show_title self.get_tvdb(show_only=True) if self.tvdb is not None: return self.tvdb['Series']['SeriesName']
1
21d43cb100e82192eb425aa2b33d4ba5
45b0b741d6500673476a2856923e3e11
takes a list of lists of integer and adds up the element from all of the nested lists
total = 0 for i in range(len(nums_list)): for j in range(len(nums_list[i])): total += int(nums_list[i][j]) return total
1
bcdeaf515a21a3e3765571334145b860
a53811be3137692313796b3b44fbe698
在每个theta点两边极近相等距离取2个点,这两个点直线斜率约等于其导数。 用途:该方法是通用的,适用于所有函数求梯度,不限于线性回归。但性能不好,可用于测试验证看自己求导的结果于此是否一致
y = sample_temp x = plate_temp all_slope = [] all_index = [] index = 0 while index < len(y): if index >= len(y) - jump: break if x[index]-x[index+jump] == 0: jump = jump + 1 index = 0 else: pass slope = (y[index]-y[i...
1
f16d1c07f2f9eb147f17dd8828666929
31a442117dd9b1bb1650d8332c5d8dcc
! Temperature difference to obtain a certain heat flux [K]
class HeatTransfer(): def dTdx(self, t): return 0
0
b17b3289362908c2134f1ab82a9472cc
51293add239b663a64be760f5a3a6041
https://atcoder.jp/contests/arc074/tasks/arc074_b
func main() { var s string fmt.Scanf("%s", &s) fmt.Println(abc132A(s)) }
0
7ea3ab1154e893711e345b0e56e00bf0
95e92023f964ea02195a4f4846b85c31
Generate points on the map for various stores using OSM Nominatim API
let map = renderMap(); let myMarks = [{ "lat": 48.186580, "lng": 16.313160, "name": "Schloss Schönbrunn", "information": `At the end of the seventeenth century Emperor Leopold I commissioned the Baroque architect Johann Bernhard Fischer von Erlach, who had receive...
0
82ebd9a8d55a99c9ba5a12069d60dfdf
7933b98366ac20fff18ebc13f0e00608
Método que visualiza as novidades
class NewsController extends Controller public function index() { $news = News::orderBy('updated_at', 'desc')->paginate(10); return view('Interno.news.news', compact('news')); }
1
a4abf4278f75a49ac9bce0818f6ea3eb
ba5fe4ac1241689475a5a80125de1443
调用原始函数
class Defer public function call() { return call_user_func($this->callable); }
1
47a52fe3f2017ef1bfd5d7a0242bb6c3
48d02217056fe19b1e32440f0a1c93f9
分组编号一致性
class StoreMemberGroupTimeTest extends BaseTest public function testGroupId() { $model = D('StoreMember'); $field = [ 'a.store_id', 'a.member_id', 'a.group_id', 'b.group_id' ]; $where = []; $where['a.group_id'] = ['gt', 0]; $where['b.group_id']...
1
9e4e51521ff509079402f88b55a2f237
c1591e90124a7273ed83e1d632025901
执行Transact-SQL语句,并返回执行结果
namespace AeroEduClass.Lib.PostgreSQLDB DataSet ExecuteQuery(System.Data.Common.DbTransaction trans, System.Data.CommandType cmdType, string cmdText, params System.Data.Common.DbParameter[] cmdParms);
0
9e6c8ab7c208ff36d942e1a8f3a1f80b
5cf5753d113dfd2e6371cc8636091b61
! \brief configure USART DMA transmission only one parameter can be selected which is shown as below: \arg USART_DENT_ENABLE: DMA enable for transmission \arg USART_DENT_DISABLE: DMA disable for transmission \retval none
{ assert_param(IsAdcDmaModule(ADCx)); assert_param(IS_FUNCTIONAL_STATE(Cmd)); if (Cmd != DISABLE) { ADCx->CTRL2 |= CTRL2_DMA_SET; } else { ADCx->CTRL2 &= CTRL2_DMA_RESET; } }
0
cf651a9c80bb3868722bc84f77b22567
1dbed908221feb033d274687ce4c9fe1
A helper function for setting a context variable from the policy enforcement context.
function set_context_info(key, value) { p_c_context_info[key] = value; }
1
d67f880140ce8e7ccab3c338c18634f5
0fcc550fc62c9462e618f10037cd0efa
当没有数据时不再上拉加载
onReachBottom () { let { nodata } = this.data; if (nodata === true) { return false; } this.getHList(); }
1
89d1f9c0c2f4452f92d8b350c3d57135
a34ceab6cda41001c50a160a9e570430
Renvoi le mysqli_result
class Statement public function getResult(): \mysqli_result { return $this->mysqli_result; }
1
127d65d9ff6060f09bb9283bde40bab0
63285e46848f59048cb06f368634223e
设置kPad display值
{ *pdwPad1 = dwKeyPad1; *pdwPad2 = dwKeyPad2; *pdwSystem = dwKeySystem; }
0
0c8bdabf898c9b7b5d5884e19034282f
1da79e02ce559ec5353791c4eb0bf7e7
设备状态类
datas = { "1": "运行中", "2": "关闭", "running": "运行中", "active": "运行中", "stopping": "关机中", "stopped": "关闭", "shutoff": "关闭", "shutdown": "关闭", "creating": "创建中", "createfailed": "创建失败", "restarting": "重启中", "closing": "关机中",...
1
67eecc7185605ea5ca7b92f85920fade
c81c86f96b00964e8759a7c403669d6b
! Process the RPC response header, primarily to get the payload length
{ if (blob.length < DCERPC_FRAG_LEN_OFFSET+2) { return STATUS_MORE_ENTRIES; } *size = dcerpc_get_frag_length(&blob); if (*size > blob.length) { return STATUS_MORE_ENTRIES; } return NT_STATUS_OK; }
1
848fd8d448bae1681fe578214cfd84ef
36f06b90f0a062a62d224a9f96ac8e32
Finds the owner of an offer.
DBController.getOffersById(req.params.id, function(err, result) { if (err) { throw err; res.redirect('/users/admin'); } req.offerValues = result; next(); }); }
0
0849053313cff41d6fe3064b1174fdea
91c736d52852022ad93aae7ed79719b7
Help-method to resize the comment rows.
if (!($('.edtComment').height())) { return; }; var widCom = $('.edtComment').width(); $('.closeEdtComment').css({ top: -32, left: widCom/0.998 }); }
0
bc9c7fb02608d70abf059585ef947d71
3cd17c26327f3dc60b8ff7cf6e84c1f7
计算清关费用
@Before(AdminInterceptor.class) public class AdminController extends BaseController public void openExitCost() { String navTabId = getPara("navTabId"); String id = getPara("id"); RegorderModel m = RegorderModel.getById(id); double final_vaild_cost = 0; if (m != null) { double vaild_cost = m.getactualCost()...
0
ec43750e66b0d072620d5495e11c345d
e27435677e7b6f7badbf17c889c5ca9c
Returns the Right Ascension of the phase centre in radians.
if ( !m_initComplete ) throw new NoInitException( NoInit ); return m_rightAscension; }
1
eb334ebad4a58cebe3d930154966f732
b1e62ff1d864664fa43e555143d2a5fe
谱库/乐谱编辑
$(".new_create i").click(function () { $(".create_list").show(); drag($(".create_list")); $(".baffle").show(); }); $(".create_list .btn2").click(function () { $(".create_list").hide(); $(".create_list .list_txt").val(""); $(...
0
eb172639fb614bb50eab545ff1ec9fd0
9bd87317196ba5d8e7a0aa06e27bada0
按照有效数量排序
class CategoryTreeService static function sortComp($model1, $model2){ if(isset($model1->sortFieldValueList["validRecruitCategoryCount"])){ $validRecruitCategoryCount1 =$model1->sortFieldValueList["validRecruitCategoryCount"]; $validRecruitCategoryCount2 = $model2->sortFieldValueList["va...
1
c7ce742588a8fd9c523b437752445c46
df2d2f7b39814a6e9969f4f8f85723ee
Returns the global DFS object used.
class LD public function getFSInstance() { return $this->fs; }
0
8561457e09aea6a84edddd5ad2f6f404
4b7c7367902da7e777e8942204220bf3
医技业务管理-住院页签-点击每一行:查询住院医技申请对应费用及执行记录
{ DataTable myTb = (DataTable)this.DgvZkqr.DataSource; if (myTb == null || myTb.Rows.Count == 0) return false; int nrow = this.DgvZkqr.CurrentCell.RowIndex; string sBinID = myTb.Rows[nrow]["inpatient_id"].ToString().Trim(); string sBabyID = myTb.Rows[n...
1
43f170889102a6316c5165bf8441afda
0aa6445e554595a69d4c60266fc65a16
Checks whether Shulker use the JavaScript plugins support mode or not.
let pattern = undefined; try { pattern = new RegExp("(?<!SUPPORT)", "i"); } catch (error) { } if (pattern != undefined) { return true; } return false; }
0
b14a87fd136640ee26a9ad6f280a2d1c
4b6a99953ce0e9e0ebf64e33cb757873
Returns the customer details of the specific customer number through service call.
public JsonResult GetCustomerDetails(string name) { var data = _customerdetailservice.GetDetailsByName(name); return Json(new { data.Address, data.EmailId, data.Contact }, JsonRequestBehavior.AllowGet); }
0
b0debc4b48c4a220661b7e1aa0a993d6
857d218eab5137960e61027bb9eaa0a6
Verdant Embrace |3|G|G Enchantment - Aura Enchant creature Enchanted creature gets +3/+3 and has "At the beginning of each upkeep, put a 1/1 |Sgreen Saproling creature token onto the battlefield."
local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(72101208,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1,72101209+EFFECT_COUNT_CODE_OATH) e2:SetOperation(c72101208.jsop) c:RegisterEffect(e2) local e3=Effect.Crea...
0
214e039c1296a42e03c0fa133b38f101
dc39600afca4a9dd60c5210597ac7491
<br> <p> 返回哈希表 key 中,一个或多个给定域的值。 <br> 如果给定的域不存在于哈希表,那么返回一个 nil 值。 <br>
namespace XiaoFeng.Redis public partial class RedisClient : Disposable, IRedisClient public async Task<List<string>> GetHashValuesAsync(string key, params object[] fields) => await this.GetHashValuesAsync(key, null, fields);
1
717b729c0c82aedf110041dc7cd9f94d
9390bdbfae4d81fa103922dd421991b2
Delete a nonBusinessDay (asynchronously) Deletes the nonBusinessDay identified by the specified id.
{ if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling NonBusinessDayApi->UpdateNonBusinessDay"); var localVarPath = "/beta/nonBusinessDay"; var localVarPathParams = new Dictionary<String, String>(); var loc...
0
6d4c0f8c2c7fb354c45ebcd3b2b50dde
9eefbe5817db9f6bdfae2af643f2ec76
Returns the start indexes.
class UADetracLoader(AbstractLoader): def get_video_start_indices(self): return self.video_start_indices
1
061555a8b8a6feaa479a7f482fc68fff
4a9b5128f91baf726d9ced2be0ea957f
Wysyła wiadomość informującą o przyznanym poziomie dostępu dla konta.
namespace Moneybox.App.Domain.Services void NotifyApproachingPayInLimit(string emailAddress);
0
453abd8babffe097f6049b1c14d92554
4c851d41d9bcf98a1a4554c85081cd23
Evaluates the post content for how many links are in it.
{ async Task<int?> Do() { CheckModuleReady(); if (postLink == null) throw new ArgumentNullException(nameof(postLink)); await WaitForTablesInitialize(); return await OpenSession(session => { ...
0
50ed76c9c4881c18f8134954ef83639a
adf2d4eec25646fa620c62c9fef9d711
Test CLI for the use case of video playlist identifiers.
class TestSonosPlaylist: def test_remove_playlist_bad_id(self, soco): with pytest.raises(SoCoUPnPException): soco.remove_sonos_playlist("SQ:-7") playlists = soco.get_sonos_playlists() if len(playlists) == 0: hpl_i = 0 else: hpl_i = max([int(x.item_id.s...
0
e9fc0bea9c58aad72ebe2b520aa3556f
f7b344094d9271ad3150fe8bc0cd1934
获得某种摘要,例如hashAlgorithm可取为SHA-512
public class OMessageDigest public static String calculate(String algorithm, byte[] data) { String hashValue = null; try{ MessageDigest digester = MessageDigest.getInstance(algorithm); digester.update(data); byte[] digest = digester.digest(); hashValue = n...
1
3ade6c92fba87ef4bf9e83338f546f4b
7f2a3b486f8b4b3f6e7793d7e656e945
Route for self-care GST information update.
await contractorService.UpdateInsuranceInfo(req.session, req.body); return { status: constants._2xx._200.status, content: constants._2xx._200.reason }; }
0
7d0c8324d2249b42a6b8e94310e5949b
75258c7083090a911ea09e0c0af5a531
counting number of selected products in category and subcategories
{ if ($id != 'all') { $this->db->where('category', $id); $this->db->where('online', 1); } else { $this->db->where('online', 1); } return $this->db->count_all_results('product_main'); }
0
eb86921bcb243c15ceb8ab7c983d018d
8b9143d6671c5c1654d6950f87bff340
Test case for get_supported_locales_for_datasets Get Supported Locales for Datasets # noqa: E501
class TestDatasetsApi(unittest.TestCase): def test_get_dataset_target(self): pass
0
0ab4ef388e31af7979609c8bae8e46ef
52de700acb5ec8b44a1b8e57904da291
Read register value from P4 switch using the DEFAULT_CLI.
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): def do_GET(self): try: driver = get_driver(name='aws_f1')( fpga_slot_id=int(environ['FPGA_SLOTS'].split(',', 1)[0])) code = 200 msg = dumps(dict( response=driver.read_register(0), ...
0
5d5572caeb01f796d3e9d14092497918
1ecddc7e007fd04ae8cf32f2ba2540a7
Gets the aggregate ratings
namespace HostLPass.WebApi.Controllers [Authorize] public class RatingsController : BaseApiController public IQueryable<Rating> GetRatings() { return _ratingRepository.GetAll(); }
0
867ecda6682c21908906b7bc89002918
b5d72c837900cf76d09f47257d5c912b
リソースファイルよりメッセージを取得します。 もし、指定されたキーでメッセージが解決できない場合はキーを返します。
public class MessageBean extends HashMap public String getResource(String key) { final Locale locale = FxContext.get().getLocale(); return getResource(key, locale); }
0
32ab3ac3bb57d0d9d2edec753c8002d8
5fcb6ab0560a0fe303c278896cd7a2fa
Seta um patrimônio como disponível.
class TreasureController extends Controller public function use() { $this->checkParameters([ 'id' => 'required|integer', 'address' => 'required|string' ]); return $this->success($this->treasureService->use(request('id'), request('address'))); }
0
76729c3fe550b0ebef88f120e99d623f
b6a793ce63019a365bbe52e9a7df1194
Проверят дерево на бинарность.
public class Tree<E extends Comparable<E>> implements SimpleTree<E> public boolean isBinary() { boolean result = true; LinkedList<Node<E>> stack = new LinkedList<>(); stack.push(root); while (!stack.isEmpty()) { Node<E> node = stack.poll(); if(node.leaves().size()...
1
272f2e9fb31f1d2fe168f4446da68d64
7f1280f060792426616287e775cf6d5d
two instances are equal iff they represent the same syntax
namespace mylib.CLI public override bool Equals(object obj) { return obj is OptionSyntax syntax && Equals(syntax); }
1
c45275a86cfa3b32b30c6305be64d2d0
4c98412d467873454ae3adc566c5ecd6
Create Email Inputs compoentns and append to container
var counter; var ssdiv = document.getElementById('secret-santa-emails'); counter = ++ssdiv.children.length; var div = document.createElement("div"); var formGroup = document.createAttribute("id"); formGroup.value = "ss-form-group-container-" + counter; div.setAttributeNode(formGroup); ssdiv.appendChild(div); v...
1
1466c42bc47956367369ba1156742cf0
69e2e5aee810192584f99a5fffded963
Maps legacy element types to their new form
$fields = []; $mapping = $this->getSetting('pattern_mapping'); foreach ($mapping as $field) { $fields[$field['destination']][] = $element[$field['source']]; } $element['#type'] = 'pattern'; $element['#id'] = $this->getSetting('pattern'); $element['#fields'] = $fields; $element['#mu...
1
93a4c555288b30e6683981e309347fe7
7f422feaf1fceefa15fc81cc7677c80d
Event that fires when OTP entry is focused.
class loginClass(): def focus_in(self, entry, event): subprocess.Popen(["onboard","20*10"])
1
2b6b3973dfe774238d6fa8cd75f32c7a
514dcc59ac405a62c960348b29411533
Get all establishments with filtering support for certain fields, with support for pagination
{ $stores = $this->filterStores($request); $stores = $stores->get(); $withBusinessInfo = $request->input('business_info', false) ?: false; if ($withBusinessInfo) { foreach ($stores as $store) { $store->append(['business_name', 'business_logo_url']); ...
0
97985315c9541c6f17271917ac6a9c4e
149f87c1d9d16bfc4df1755911bfeaee
Set angle of ship
public class Asteroids extends PApplet class Ship void setTurnAngle(float a) { turnAngle = a; }
1
fbf020844fd22baf17e74c417de69f99
56a715390c88d544d46c039a3aeb7f33
这个实例是延迟选项卡切换效果
function SlidingTab(img) { this.outtimer; this.intimer; this.left = 0; this.interval = 6; this.animatingout = false; this.animatingin = false; this.increment = 5; this.extenddist = 50; this.imgobj = img; this.taboutloop = function(){ this.animatingout = true; this.left = parseInt(this.imgobj.style.left); ...
1
9ad3645d770bf561556fa576318149bc
b73c6c80d55dac9f2b91a5ac04c67514
Return the :class:`NamedSignal` *name*, creating it if required. Repeated calls to this function will return the same signal object.
if instance is None: return self signal = getattr(instance, self.name, None) if signal is None: signal = self.factory() setattr(instance, self.name, signal) return signal
1
4c3c7fa35a0c16d1247d9b02ed331c81
55025531b0d91acd65bd751417600f05
This method evaluates village event code in the mocked context to predict the outcome
void evaluateRound();
0
035712a15dcea0f529de55a2068b4c38
0e032d7feda30317ded30c6cf956eb92
CSVRowToStringArray: Funzione che prende una riga da un csv e torna un array di stringhe con l'elenco dei contenuti di ogni elemento Parametri: stringa con riga da esaminare, carattere che separa i campi, carattere che separa le righe
function fromcsv(s, separator) if not s then error("s is null") end s = s .. separator local t = {} local fieldstart = 1 repeat if string.find(s, '^"', fieldstart) then local a, c local i = fieldstart repeat a, i, c = string.find(s, '"("?)', i+1) until c ~= '"' ...
1
4f7c97a1d56c038ae98dc14b0ddb1ab0
5673caa5d76351990c1598a55deac56a
Get all backward dependencies by namespace for the provided extension.
{ $abstract = $this->getAlias($abstract); if (isset($this->extenders[$abstract])) { return $this->extenders[$abstract]; } return []; }
0
3e5cace7c1df91d1aa1b5a1556560e1d
9e45459b5491a3487392c904a394420b
摄像机目前看向的位置UV
function viewPointCameraLocation() { var cameraLocation = Websocket_PackageIDs.camera; return cameraLocation; }
0
f6523bda0518fe290cf659b97e169682
955c415b5ad811cef7ad3538c92f4c4b
根据loanBasisId删除
try { lnLoanSubTypeService.delLnLoanSubType(lnLoanSubType .getLoanSubTypeId()); } catch (Exception e) { e.printStackTrace(); } return null; }
0
49786b5818164119b413e5c78bdd143a
07218ed7c9e02139a137baff5cb0e674
inputs: - learner: the learning algorithm to be trained and predicted on - sample_size: the size of samples (number) to be drawn from training set - X_train: features training set - y_train: income training set - X_val: features validation set - y_val: income validation set
print("Start eval of model "+title+":") if title == "XGBoost" or title == "LGBM": model.fit(X_train, y_train, eval_set=[(X_train, y_train), (X_val, y_val)], early_stopping_rounds=50, verbose=False) else: model.fit(X_train, y_train) pred = model.predict(X_val) pred_train = model.predi...
0
96610d678ed193a835a81d48d0c610d3
7da2f0f5ccbcdda70f1e8d9482090706
课程章节练习查看
$this->check_auth(); $url=U('doctest',array('cid'=>$this->cid,'sid'=>$this->sid)); $zrel = cacheRead($this->cachepath.'topics_'.$this->cid.'_'.$this->sid.'.php'); $rel =cacheRead($this->userpath.'coll_exercise_topics_'.$this->cid.'_'.$this->sid.'.php'); $t=I('get.t'); $tt...
1
e7a3359e56274b00d034cf2177293001
1766c5dd872f65c79281240fda172e4e
Retrieves all branch departments by branch assembly. In case of exception.
public BranchDepartment findBranchDepartmentByBranchAssemblyAndStartDate(final BranchAssembly branchAssembly, final Date referenceDate) { try { TypedQuery<BranchDepartment> query = this .getEntityManager() .createQuery( "select db from BranchDepartment db where db.branchAssembly = :branchAssem...
0
564bc63b366dab53ca564655ecc5c146
442fb8da97f0d8fcc8b3a874087b6bfc
logs each send of mail, so I can bill for SMTP sends
{ $aFields = array( 'date' => date("Y-m-d") ); $this->store_data(TABLE_LOG, $aFields, 'issue', 'mail'); }
1
7a49b9ef5a9b90cd4e1c96632c1e3eb5
c4a320f9e2bd60dfbb7b6615e8839c21
Returns new tags resulting from merging two tag dicts
for tag in additions: if tag not in tags: tags.append(tag) return tags
0
cd096ad8449118de3884015b4ddef6d2
7af6f5aca10a14b4bb5b492a8c36df68
Returns a smoothed series of points using the Catmull-Rom spline algorithm.
namespace TwistedLogik.Ultraviolet public static void CatmullRom(ref Vector2 vector1, ref Vector2 vector2, ref Vector2 vector3, ref Vector2 vector4, Single amount, out Vector2 result) { var t2 = amount * amount; var t3 = t2 * amount; result = new Vector2( (flo...
1
1e4c27c42f89319816997e7dbffb165f
7b5bdc960d57951d46c96c409847a27c
数据清理执行
if self.config.get("mysql").get("clear_need") and self.config.get("clear_sql"): for sqlstring in self.config.get("clear_sql"): self.exec_sql(self.config.get("clear_sql").get(sqlstring)) logger.info("数据清理开关已打开,数据清理完成") else: logger.info("数据清理开关未打开,skip数...
1
dd0ba9b2c6bf1192c383a1397370a16f
0a2e36377cc33d40605d690a17b7a5f5
Genertes a Dockerfile file using the configured information
class ImageBuilder extends Image private function createDockerFile() { $dockerFile = ''; $dockerFile .= "FROM " . $this->parentImage . "\n"; $dockerFile .= "LABEL " . self::COMMON_LABEL . "\n"; $dockerFile .= "WORKDIR /home\n"; if ($this->getVersion()) { $dockerFi...
1
e0626a7e69bc54c3a219bdd73477341b
a8675488a6faf79f13e8738123257494
读取距离的文件,并且用字典存储
def read_dist(filename): f = open(filename, "r") dist_list = [] for line in f: split_line = line.split() dist_list.append(split_line) f.close() return dist_list
0
f69b488d853fbe5ea646ec44a1d7d423
1d0aab7c4e3540ae049035d31d08c2c4
刪除使用者的緊急聯絡人
@RestController @RequestMapping("/passenger") public class UserController @Encrypt @Decrypt @UserLoginToken @PostMapping("/emergency/delete") public Result emergencyDelete(@RequestBody EmergencyContact emergencyContact){ return emergencyContactService.delete(emergencyContact); }
1
205c500e76b8d36ada816fe7fdeb0293
25a5a124637ddf75fdf875a289376b0a
更新野牛和狼的距离
void GameBoard::updateWolves(){ std::uniform_real_distribution<double> p(0,1); std::uniform_int_distribution<int> x_or_y(0,1); std::uniform_int_distribution<int> increment(0,1); for(size_t i=0;i<number_wolf;i++) { int px = wolf_positions[i].rx(); int py = wolf_positions[i].ry(); ...
0
aa91aaa3d6659aee2d514ce81f727701
e196ac931d693f51a00a4b10edfa950f
축, 절대좌표를 입력받아 해당 좌표로 이동하는 기능
time = int(input('이동 시간을 입력하세요 ')) speed = int(input('이동 속도 입력하세요 ')) distance = time * speed print(f'이동거리는 {distance:.1f} km 입니다.')
0
bafdab4c16293cb31da39c4b35b8506e
d8703e9349d00eae9bd76a137ec377ca
根据政策ID获取政策集合,同时获取每个政策的返利信息。
@Service public class AcademyRebatePolicyBizImpl implements AcademyRebatePolicyBiz public AcademyRebatePolicy getAcademyRebatePolicyById(int id) throws Exception { return academyRebatePolicyDao.findById(id); }
0
158ced975163fa5c6dba366ba82eb7fc
0c0b8107b39f80eac3836557c687c2e3
Sets the value of the '{@link SensorDataWebGui.AbstractPE#isPersistentView <em>Persistent View</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
boolean isSetPersistent();
0
ee82e1d2b00b17329c83f660367cff88
eaab2797491d55f9bc60df6b04c7abbd
@brief vraci grafiku k figurky.
QGraphicsPixmapItem *Figure::getItem() { return item; }
1
a3bdf23d3498d86c7ccf92ab9acb829e
ce452e6c7de41daf0c3cd73d668b7f60
将stat中的数据绘制到条形图中,stat是一个dict类型,key是X轴,key的value是一个list类型,元素序号num对应的值是Y轴
def visualize_stat(stat: dict, file_name: str)-> None: data_frame = pd.Series(stat) data_frame.plot(kind='bar') plt.savefig(file_name+'.png') plt.show() return None
0
df9501e07e02f2d1d03b8be0f616f9a9
2213fc7781772ed2704209372a805688
Get social_text
class Branch public function getSocialText() { return $this->social_text; }
1
a4d47beffa358ea19fb43e780d2654ad
d1db9fb640f7b565236b5cb02ac7bb54
This function creates a new mock client and accessory mocks.
async def mock_client(engine, event_loop): client_id = str(uuid.uuid4()) session_id = str(uuid.uuid4()) client = TestClient(URL, client_id, session_id, TOKEN, event_loop) await client.connect() await client.register_client() yield client await client.sio.disconnect()
1
01eb8fde8c43aa9f246423666b01b4c2
6efe46874ea48958242f31c53f8b2279
Gets OAuth user by the specified user Id or Phone number asynchronous.
{ string apiPath = "/api/v1/users/:id/"; string pathParameter = userUuid; byte[] bodyParameter = null; byte[] result = await ProcessAsync(true, ApiClient.ENDPOINT_ID, apiPath, pathParameter, bodyParameter, null, ApiClient.Method.GET, false, cancellationToken).ConfigureAwait(false); return GetUser(resul...
0
852d1a80b2df29f1731bbf5ae2b2a7bb
6477636e5589bcc1e34bd7703ecb7652
Ensure that the size of xnew matches the expected length
class GaussianProcessModel: def _validate_xnew(self,xnew): rows,cols = xnew.shape nparams = len(self.k_lambda) if nparams != cols: raise ValueError("Expected %i elements in xNew, not %i"%(nparams,cols))
1
58613a13eac9a4645027f48896ec3aef
773355d1d010aa9ad4c4d555ae22fedf
read メソッドが呼び出された後に、 FileInputStreamMonitor#postProcess を呼び出すように、 コードに修正を加える。
if (finalReader != null) return; rawInputStream = getInputStream(); eofInputFilter = new EofInputFilter(rawInputStream, (byte) (inputEofChar & 0xff)); inputBuffer = new InputBuffer(eofInputFilter, bufferSize, buffering, blocking, this); markableInputStream = new MarkableInputStream(inputBuffer); unicodeD...
0
e736c6eb3ba9508c66e21438f13b5eb5
a8570be7df95912b77c820c74fca8bdf
Returns if the point is within range of length and width.
{ var startMeasure = startPoint.GetStartPointMeasure(); var endMeasure = endPoint.GetEndPointMeasure(); return IsWithinRange(currentMeasure, startMeasure, endMeasure); }
0
a68c73c02cb331f98c2ce3050d5e752d
adc5ed5995f8e25da905fd9d35f6461d
Метод формирует массив моделей с задачами
generateTags(); Random random = new Random(); for (int i = 1; i <= demoProjects.length; i++) { Project p = new Project(demoProjects[i - 1]); for (int k = 1; k < 4; k++) { Task task = new Task("Подпроект " + i + "-" + k); task.setDescription...
1
6bff98385ad825f27f4c98584fd8ddf7
61a4229ac20e1f7ca9c7e88b763f5613
VMDファイル読み込み
{ IMotionProvider motion; var extension = System.IO.Path.GetExtension(filePath); if (String.Compare(extension, ".vmd", true) == 0) motion = new MMDMotion(filePath, ignoreParent); else if (String.Compare(extension, ".vme", true) == 0) motion = new MMDMotionForVME(f...
1
5ef1448f2c36697c7d5035cb20fbf81f
451026f1fb775691d0a9845ac71eeda9
this method handles OnClick for mastery report button
public class LeaderboardUIManager : MonoBehaviour public void MasteryReportButton() { SceneManager.LoadScene("MasteryReport"); }
1
b12a76566e66a8c3777e13db1b4885e3
42a213a611a4d320cb075cc460b6849b
根据商户认证状态显示用户信息
public class CertificationFragment extends BaseFragment @Override protected void init() { if (AppContext.getUserBean().data.cardstatus.equals(ApiHttpClient.YES)) { commit.setVisibility(View.GONE); et_name.setEnabled(false); et_name.setText(AppContext.getUserBean().data.na...
1
26150ebe039168953659d03d5b489723
4809ecae80aee6e819c6273423303605
혈압 등록
class DbUtil: def save(self, health): conn = sqlite3.connect(self.db_file) ins = ('INSERT INTO health(regist_datetime, height, weight, bmi) VALUES(?, ?, ?, ?)') conn.execute(ins, (health.regist_datetime, health.height, health.weight, health.bmi)) conn.commit() conn.close()
0
41bf9fa84aa870fe4b6cbf4c888cbead
40e0d42dfdacb73867d8533a45572592
Get listing rule id
public function getRuleId();
1
91c8f906c61d691317d17286f04d423b
ac88f1d7cd2f15b87a0a97cc08c586c0
RPN expression evaluation test
int main(int argc, const char * argv[]) { char exp1[] = "3-2+4"; char exp2[] = "(1+2)*3"; char exp3[] = "((1-2)+3)*(5-2)"; printf("%s = %d\n", exp1, EvalInfixExp(exp1)); printf("%s = %d\n", exp2, EvalInfixExp(exp2)); printf("%s = %d\n", exp3, EvalInfixExp(exp3)); return 0; }
0
75ecd51db1db76f4f08fca9bfdd11860
d4ad4175128ef0c4f615edd97fa41681
Sum two accumulators.
class CountsAggregator(base_aggregator.BaseAggregator): def reduce(a, b): return a + b
1
82e15aaf6c173e1325b2e00bf02e6495
ca607bab2d7edc5e8f694023a3cb5b68
This call is required before any other calls to the Facebook API. We pass in the callback to be invoked once initialization is finished
public static class FacebookAPI public static void Init(InitDelegate _onInitComplete = null, HideUnityDelegate _onHideUnity = null){ if (!FB.IsInitialized) { Debug.Log("INIT"); FB.Init(_onInitComplete, _onHideUnity); } else { FB.ActivateApp(); } }
1
30fcf27c3ce3e38df5e73213af78dadd
ba1e6a1925c779139298fa711bdf0b13
Toggle support button text
Button toggleRelease = (Button) findViewById(R.id.toggleRecording_button); int id = mRecordingEnabled ? R.string.toggleRecordingOff : R.string.toggleRecordingOn; toggleRelease.setText(id); }
1
79702000949730fa20c2677ec2c862b8
196dc38700a16609094787aeae5380be
Class which wraps the X11 event polling and turns it into a notification system
threading.Thread.__init__(self) self.event = threading.Event() self.on_error = on_error self.parent = parent self.polling_interval = polling_interval
0
45654f1c3bd01a7b3cd705e97284da9f
48cdcaf4c47ba8ec910d3d3f96eecf69
Get the list of best models for a given GBD round except for shock aggregator models
result = [] for model in models: if any([x < 0 or math.isnan(x) for x in model.scores()]): continue result.append(model) return result
0
e372af5de7af574303948f90d5f3e259
9bd8e10fcc39479cb9204b7c1d3ef038
changes xml file names e.g. 0file1.xml
xmls = os.listdir(path + "/Annotations") print xmls cnt = 1 prename = "000000" for xml in xmls: tree = ElementTree() tree.parse(os.path.join(path + "/Annotations",xml)) print os.path.join(path + "/Annotations",xml) all_objects = tree.getroot().getchildren() ...
1
c0bdfbf7e21f20cadb5d48c0bdee852d
fee0e9c3e7be4a3d0986ec6abf37cbd8
获取pointsAccountJournal列表
$condition_arr = $list_log = array (); $condition_arr ['pl_memberid'] = $this->member_info ['member_id']; $page = new Page (); $points_model = Model ( 'points' ); $list = $points_model->getPointsLogList ( $condition_arr, $page, '*', '' ); foreach ( $list as $key => $value ) { $list_log [$key] ['sl_id'] =...
1
214fc1d6420b58a13a56041475fa1988
326ba2eb8277934e7d606aedaa20aeb4
利用itertools包创建多值离散特征二分序列组合
def do_discrete_special(special_fields, bin, feature_column): deal_column = [] for feature in feature_column: if feature not in special_fields: special_feature = [0 for i in range(len(special_fields))] discrete_feature = discrete_one_feature(bin, feature) else: ...
0
75c7c1ccd6d711922a640f05c5cde17d
c752fba99e1a471de26aaf644ff9d981
Updates the neighborFacility's build time. This is for internal use only (reCalcQueuedBuildings()).
namespace Draco.Core.Runtime public class BuildRunner : IBuildRunner, IDisposable private void SetNextBuildTime(DateTime value) { lock (this) { this.nextBuildTime = value; } }
0
60cb6a623f8b50a7c4f470fd71fde2cd
37437f62392520cb1db847ed5f0ec1c2
Returns the value of the '<em><b>One Way</b></em>' containment reference. <!-- begin-user-doc --> <p> If the meaning of the '<em>One Way</em>' containment reference isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
boolean isOne();
0
65e48a2d356f614df28dbec3daf1927d
af463532266d61aef339670c68a71ffc
@brief draws the increment screen markings
handle_internal(ctx, &minutes, 32, MN_center_32, BG_color_M, inc); handle_internal(ctx, &minutes, 16, MN_center_16, BG_color_M, inc); handle_internal(ctx, &minutes, 8, MN_center_8, BG_color_M, inc); handle_internal(ctx, &minutes, 4, MN_center_4, BG_color_M, inc); handle_internal(ctx, &minutes, 2, MN_center_2,...
1
bd348ab375df59fa1e59808942ae2313
147ab38b67966c2b759fe8d719bace38
get numpy list of QRS Locations Returns: qrs_locs (numpy list): list of QRS locations in the signal
def postprocess(beat_locs2, margin, wl=100): thres = (margin+1)*0.5 accum = convolve(beat_locs2, [1]*(margin*2+1), mode='same') beat_locs = [] for idx in range(wl): if accum[idx] > thres and accum[idx] == max(accum[ : idx+wl+1]): beat_locs.append(idx) for idx in range(wl, len(...
0