query_id
string
corpus_id
string
query
string
code
string
label
int64
0f0db94242180d73f677b3df0a4b8078
582b0faa0319e3dcf2e2e5651752a301
Возвращает длину списка ходов.
class Protocol: def __len__(self) -> int: return len(self.steps)
1
61a502473e9b3d9cb52c8bb7cfc6b292
7fea5716d59d62c7d9ef9318eb5d308b
whether the current topic is kafka compact topic or not.
boolean isSetCompact();
1
a8d305ca85161b13c0e84309b7009826
1b3f04a0162db2c87f863e3e2d37a9ed
Cause a Breakpoint exception.
class Assembler public BREAK({code}: { code: Assembler.Numeric } = {code: 0}): this { return this.pushExceptionInstruction({code, funct: 0b001101}); }
1
163a6a9a4374aeb12b9378ae832dbfc2
8a07e9541755fa12f37e8d568173bc00
Задает метки с датой на графике
for (int i = 0; i < dateAcc.length; i++) { accAxisXValues.add(new AxisValue(i).setLabel(dateAcc[i])); } }
1
9363f0340d43af4d442359d4fa199fe0
fcf49d05c4acbfe2e579b8b00c506e6d
Fungsi untuk cetak informasi gadget
System.out.println(macName + "\t\t " + macSize + "\t\t\t\t" + macPrice + "\t\t" + macCount); System.out.println(thinkPadName + " " + thinkPadSize + "\t\t\t\t" + thinkPadPrice + "\t\t" + thinkPadCount); System.out.println(asusName + "\t " + asusSize + "\t\t\t\t" + asusPrice + "\t\t\t" + asu...
1
f94ccd1200d655ab24489200c2fa0283
23f0c88b1b00c808a1500067b7b44618
Free an allocated bvarith64_buffer
VP6_DeletePBInstance ( PB_INSTANCE **pbi ) { if ( *pbi ) { VP6_DeleteTmpBuffers(*pbi); VP6_DeleteQuantizer(&(*pbi)->quantizer); VP6_DeleteHuffman (*pbi); } duck_free ( *pbi ); *pbi = 0; }
0
3011d59ceddb087cc5fe95292c78c7a9
3dce8deae2b5e174062e824415fc4832
Save the NextSegmentRule.
public void testRemoveNextSegmentRule() throws Exception { eventFlowManager.removeSegmentRule(rule1); eventFlowManager.removeSegmentRule(rule3); assertEquals(eventFlow.getNextSegmentRules().size(), 1); assertTrue(eventFlow.getNextSegmentRules().contains(rule2)); }
0
b7b4b5d84df0c8690772688da7cb9c5b
44bfa1b1c357284bd066dbc78ba5049e
Register and enqueue admin specific styles and scripts
class WPMemberToolPlugin private function register_scripts_and_styles() { if ( is_admin() ) { } else { } }
0
152f3b38393b920cafac9e53d2cc1811
03480289b3e5015493f5651c7cf19c23
@brief Dialog procedure of Transfer Status pane.
void TransferProgressDialog::fileOpProgress(const unsigned int& aID, const QString& aOp, const QString& aCurrFilePath, const quint64& aCurrProgress, ...
1
3e0496224344f21aefdb20cd431e3845
6f6a94e5da603fc8eeea071bb9c19c34
calculate the age of the user by asking for their birthdate
new_date = birthdate.split('-') new_date = list(map(int, new_date)) born = date(new_date[0], new_date[1], new_date[2]) today = date.today() days_in_year = 365.2425 age = int((today - born).days / days_in_year) return age
1
d5fbb8c7408713548512454f8a2b8372
f8b9a51bb2106571cb56c467530efa3a
获取操作系统,浏览器及浏览器版本信�?
Map<String,String> map = new HashMap<>(); String browserDetails = request.getHeader("User-Agent"); String userAgent = browserDetails; if (browserDetails == null || browserDetails.trim().length() == 0) { map.put("os","智能柜C#"); map.put("browser","智能柜C#"); } else { if (userAgent.toLowerCase() == nul...
1
ad9194cf1feb88c6f3c8ad5cdc73d986
d9b6bc3d20f41369541361f01dbef5e6
Cancel a batch of scheduled events on the transport.
class Sender(BaseHandler, mixins.SenderMixin): def cancel_scheduled_messages(self, *sequence_numbers): if not self.running: self.open() numbers = [types.AMQPLong(s) for s in sequence_numbers] request_body = {'sequence-numbers': types.AMQPArray(numbers)} return self._mgmt_requ...
1
8a21428172207bb268f0cdedd31acd5b
2ad853681a64069a39a9b44fb4e8b880
Retrieve the horizontal radius.
class Component(object): def _get_h(self): return self._h
0
6f5b7cc6e1b8a23f1d880b080f5157ad
7d080cc310a02d423b819f145ead15a6
Get inputted group names and corresponding label
def _exrtact_group_labels_landmarks(landmark_manager): groups_keys = landmark_manager.keys() if len(groups_keys) == 0: groups_keys = [' '] labels_keys = [[' ']] else: labels_keys = [landmark_manager[g].keys() for g in groups_keys] return groups_keys, labels_keys
1
3ab8425e4e860a1f8f998ed59c47b2e7
a5f9672e9a63747c49c9008914649b82
Asserts that two tokens are equivalent in all their members.
public class CosmosUpdateTimeFindTokenTest private void ensureEqual(CosmosUpdateTimeFindToken token1, CosmosUpdateTimeFindToken token2) { assertEquals("Tokens should match", token1, token2); assertEquals("Hashcode of tokens should match", token1.hashCode(), token2.hashCode()); }
1
b977043a8883aafbf69519e5702a8ec0
ba6fc69a3bc04a805a66aa3f0604f3d7
Implementation of randomblob(N). Return a random blob that is N bytes long.
def RAND_pseudo_bytes(*args, **kwargs): pass
0
201ed52ff670abf34a3b578aaf12d5ce
edc54e55bd8b1278048e1bdebbaa1b3e
#根据基础概率 获得所有的条件概率
class NaiBayes(object): def cal_condi_prob(self): condi_prob = {} dim_x = zip(*self.train_x) for i, xi in enumerate(dim_x): xi = np.array(xi) for xij in np.unique(xi): bool_xij = xi ==xij for y in self.labels: bool_y = s...
1
d3cb07a421a01687dabedb28b38136a0
85a048734aa95793d6de318ffa1ec1f0
给角色授权,若是子节点会附带上根节点的权限
namespace Project.Logic.Domain public partial class S_T_DBSDefine public void SetAuth(string roleCode, string roleName, string authType, string roleType) { var security = this.S_T_DBSSecurity.FirstOrDefault(d => d.RoleCode == roleCode); if (security == null) { ...
1
e8a321d77d342582c3a59f16521c4ac9
57891db64aed6379d19fa01e2c64ed23
Получает текущую мощность двигателя
public abstract class Car implements Movable{ public double getEnginePower(){ return enginePower; }
1
58588c59bd5046f102983e26eb600dfc
d3c5f3250fbaa1eb17543b538973b166
配资配置
{ $mid=MID; $minfo = MemberModel::getMemberInfoByID($mid); $amoney = $minfo['account']/100; $this->assign('amoney',$amoney); $res=request(); $id=intval($res->param('id')); if(empty($id)){ ajaxmsg('系统错误',0);} $borrow_res=BorrowModel::getBorrowById($id,1...
1
e598f97f4485b719cb0360e52c230a45
73ba9c50ea192d18fa036a3928df6ddb
metodo para agregar un colaborador a la lista de los YA seleccionados
this._servicio.agregarAuxiliar(this.carnetEstudiante).subscribe( res =>{ this.mensajeAlertaFuncion("Se añadio a la lista de auxiliares", "Atencion"); this.carnetEstudiante= ""; this.nombreEstudiante= ""; this.apellidoEstudiante= ""; this.emailEstudiante= ""; this.listarAuxiliar...
1
f75ce0fd85535237388378baf20f7c16
6e5e4281e96eaf7983c0a64964cbbc2e
add key to the namespace. it is fine to add a key multiple times.
public abstract class CacheDaoSupport<PK extends Number, E> private void addCacheKeyToNamespace(String key) { boolean ismember = getJedis().sismember(LIST_NAME_SPACE, key); if (!ismember) { getJedis().sadd(LIST_NAME_SPACE, key); } }
1
d6f9771f10bc8a97555568e04f78221a
f5cb943d454fd58e618962f212c30e16
Get the value of labelFont
public class OverlayLabel extends OverlayComponent public Font getFont() { return font; }
0
4828e4ed9a5e0357b283e981ab5dda1b
5da3246f09f02433e743c11fa33f2449
Helper function to convert from nanoseconds to hardware ticks. This uses fixed-point arithmetic to retain precision. Note that only 32-bit frequency values are supported.
{ switch (pTimer->enmClock) { case TMCLOCK_VIRTUAL: case TMCLOCK_VIRTUAL_SYNC: AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000); return u64Ticks / 1000000; case TMCLOCK_REAL: AssertCompile(TMCLOCK_FREQ_REAL == 1000); return u64Ticks; ...
0
41ed82d73472b6fc9e7b6425385dc29d
2ad7530f38e27552af9b59833cf7880c
Returns a JSON-serializable object for compatibility with django.core.serializers.python.Serializer. Obviously this is not strictly a string, but it's closer than the collection of attrs instances returned by the default implementation.
class Field(Serializable): def __repr__(self): attrs = list(self.attributes + self.children) attrs.append('valid_since') attrs_values = [(attr, getattr(self, attr)) for attr in attrs] attrs_values = [(attr, value) if attr != 'type' else ('type_', value) for attr, ...
0
51f8b99f39570d6854d75d0abe938b95
de2e19b852fc1eaff4325bb754dc47cf
Makes user member of group
global $db; $groupID = $db->escape( $groupID ); $userID = $db->escape( $userID ); $db->query( "UPDATE ".DB_TABLE_PREFIX."groups_members SET isConfirmed='1' WHERE groupID='{$groupID}' AND userID='{$userID}'" ); if( $db->rows_affected != 1 ) { $_SESSION['response']['errors'][] = _("Something went wrong and w...
0
0283f694420a6f60cd7818a340513386
8a0f9b3d4333a3bacfd41d606e2e475a
@targets: the list of strings representing the names of the target columns @table: the string representing the name of the table from which target is to be selected @conditions: the dictionary for which every column indicated by key should be equal to its corresponding value
assert from_table is not None assert to_table is not None assert conditions is not None if name is None: self.name = "REL_%s_to_%s" % (from_table, to_table) else: self.name = name self.from_table = from_table self.to_table = to_table ...
0
3021528665ac182f5aa6b66518ba82ac
42cf150a9b0e0504c1b24d04fff8c7b4
如果缓存里有了,则直接请求验证它的正确性
async function validate (request, session) { const cached = await fw.cache.get(session.jsid) const out = { valid: !!cached } if (out.valid) { out.credentials = cached } return out }
0
471187cc81402caad67cdbe8ccb9a3ea
0f029f65bca4fbf7ef00dbd229bc3163
Fonction qui enlève toutes les balises html dans du texte
public class SendMail public static final String HtmlenTexte(String stringhtmltexte) { HTMLEditorKit kit = new HTMLEditorKit(); Document doc = kit.createDefaultDocument(); try { kit.read(new StringReader(stringhtmltexte), doc, 0); return doc.getText(0, doc.getLength()).tr...
1
447c94a3849cf8e36aea53ece92cb159
e6581a2e9d320fb3c6e4bac9e31103ca
Ignore trailing zeroes
OrderedListTreeNode::OrderedListTreeNode(const VfmdByteArray& startingNumber) : m_startingNumber(startingNumber) { while (m_startingNumber.size() > 0 && m_startingNumber.byteAt(0) == '0') { m_startingNumber.chopLeft(1); } }
0
21d4f94630fd4a87de47bb4012d0c2f3
880360b4b09d7a4df418c6ef6bbe1e06
如果是云信的demo password会进行md5编码,如果是开发者自己的应用可以引入其它方式 甚至可以转到开发者自己的应用服务器,拿到真正的accid 与password,可以异步操作,但此时 user相关数据(user目录、image目录以及日志等)并未创建
include_once UC_ROOT . "/uc_client/header.php"; $user = curr_user(); $info = array('id' => $user['id'], 'password' => $pwd, "email" => ""); $data = $api->update_user($info); $result = array(); $result['flag'] = $api->is_ok($data) ; $result['msg'] = $api->get_msg($data) ; $result['msg'] .= $api->gen_s...
0
1f527c99016411c38f40ecdec6d416b7
7efa878916f8012925afd445a1cfa24a
Get dateNaissEleve.
namespace Notes public class cls_Eleve : cls_ObjetBase public DateTime getDateNaissance() { return c_DateNaissance; }
1
bdb1043211331394ba86dc4ef85f61b0
24d4bd1eefb944b043fb95bbacaf9635
Custom close method. Shows save dialog first
{ if (SaveMgr.bChanged) { if (SaveMgr.NotifyChanges(TRUE) == FALSE) return; } if (SaveMgr.lpLoadedFile) free(SaveMgr.lpLoadedFile); CDialog::OnClose(); }
0
bd7f26b49bfee0aab1dfc13b177c3ce5
7a070f3b7a0f0a17bdca4e4364cc6d1c
Returns a list of addresses of memory cells that constitute the public memory. segment_offsets should be the dictionary returned by relocate_segments().
class Segment: def getNamedAddresses(self): return HopperLowLevel.getNamedAddresses(self.__internal_segment_addr__)
0
968e5d6162f8d04a749fcc92db6e31a8
9d1770a450d08d7e396fd7cd23ecb3c2
Test creating new ssl cluster but not providing a keystore will fail validation.
func TestCreateClusterComplexPrivate(t *testing.T) { runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/complex-private", "v1alpha2") }
0
a8a83112269fbb7fc16bbcb36d184a9e
40fd4dae8c8b7df1855aaacaa91f53aa
This function is used to Click on Place of Issuance DropDown Field and to select Element from the Drop Down
public class AccountHolderPage extends LPLCoreDriver{ public boolean selectPlaceOfIssuanceLst(String strPlaceOfIssuanceEle ){ boolean blnResult = false; try{ String strPlaceOfIssuanceDrop_XPATH=strToclickCommAcc_XPATH.replace("xxx",testData.get("strGovtIdsection")).replace("yyy", testData.get("strPlaceOfIssua...
1
8d03443712111621c600e211e74fc3a5
51f73231b0443116b10863c10c48eeb1
Setter of the component responsible of the keyphrase selection.
public class KEAFilter extends Filter implements OptionHandler public void setKeyphrasesAtt(int newKeyphrasesAtt) { m_KeyphrasesAtt = newKeyphrasesAtt; }
1
ba9908d7773ce2f4eb376f6679c0435a
924307b0559d99740cc21fe9c0a9977f
修改详情图片
const ctx = this.ctx const id = ctx.params.id const detailpic = await ctx.service.detailpic.show(id) if(!detailpic) { ctx.body = { ...fo, message: '查无此商品' } }else { const result = await ctx.service.detailpic.update(id, ctx.request.body) if(result){ ctx...
1
d0a383d1179de5cf2e7179f7a8db690c
3acc096852e04bef63740432a7016df2
Checks whether euclid algorithm throws the correct exception when is invoked with wrong arguments.
public class TestCalculator @Test public void divisionWhithoutArgumentsTest() { calculator.div(arguments); assertEquals(0, calculator.getResult(), 1); }
0
fa9c752b2475c3a89ea5c28290f9baf5
61b46578bb7ce7badb5ae1286e8a53f4
Test that user cannot initialize a Card with invalid suit the code is expected to throw ValueError
class UnitTests(unittest.TestCase): def test_invalid_card_rank_range_high(self): from playingcard import PlayingCard with self.assertRaises(SystemExit): PlayingCard(14, 0)
0
a3a1cd8bd1f3ef7e9b6553d76f4f0813
ae0a669b0abc6d1fe8eedff3c4938d07
获取最矮的ul
function getMinLi(){ var index = 0; var minH = $(oLi[0]).height(); for(var i=0; i<oLi.length; i++){ if($(oLi[i]).height() < minH){ index = i; minH = $(oLi[i]).height(); } } return { index: index, minH: minH } }
0
24a9eaa61f90ebd74878d0862c85ca29
f04770473b2907a17915b70c0e617a0b
Returns the first non-empty Filter from the argument list.
for (let arg of args) if (arg) return arg; }
1
ffd622080999deaa238e0e1a81f25bdf
54fc0775218fc28020645deaf0d5272b
! Returns the sampling mode to be used for this texture.
RwTextureGetFilterMode(const RwTexture *texture) { RWAPIFUNCTION(RWSTRING("RwTextureGetFilterMode")); RWASSERT(textureModule.numInstances); RWASSERT(texture); RWASSERT(0 < (texture->refCount)); RWRETURN(RwTextureGetFilterModeMacro(texture)); }
1
d46f46a8f01394afc053469582380f52
910fd6497afadc138b4a0367346c4d98
Add product to group
class PropertiesTestCase(TestCase): def test_add_product_to_property_group(self): pids = [p.id for p in self.pg.products.all()] self.assertEqual(pids, [self.p1.id, self.p2.id]) self.pg.products.add(self.p1.id) pids = [p.id for p in self.pg.products.all()] self.assertEqual(pids, [...
1
e5e0466c1a1615bde93583bda8addb52
f0589a6e42b9ee6067efcd764cb44cd2
创建style数据层接口。
{ string ClassNamespace = AssemblyPath + ".Style"; object objType = CreateObject(AssemblyPath, ClassNamespace); return (Foosun.IDAL.IStyle)objType; }
1
4fb70ee1ce9369124d8e0e714a837309
92a714cdef68bdfc116133ea8efeea53
Returns whether or not this Request can log provenance information to clients.
public boolean canProxy();
0
ad0ee5aa267f42609c0b1403ceb6be9a
156804a61ba7c6ee58a8508e10cd0c1c
A method that checks if the UpdateProduct method can be executed.
{ if (editModel?.Product == null || !await Database.Products.Select(p => p.Id).ContainsAsync(editModel.Product.Id)) { return OperationResult(ResultType.Error, "Product not found."); } List<string> messages = new List<string>(); ...
1
6d2a64591467ed0144587ff8a9720ef5
69cd97c7df97c99c270904a34fe9c08e
簡素な漢数字をアラビア数字に変換します。
namespace Grayscale.Kifuwarane.Entities.ApplicatedGame public static class GameTranslator public static string IntToArabic(int num) { string numStr; if (1 <= num && num <= 9) { numStr = GameTranslator.ArabiaNumeric[num - 1]; } else ...
0
6ad814e127db5202314c1757a40fed36
7850d4c6cb00868a99bceb2ce6feef08
Return true if point Q lies on our curve
{ mp_int buf1, buf2, buf3; mp_init_multi(&buf2, &buf3, NULL); int IsOnCurve; mp_init_set(&buf1, 2); mp_exptmod(&P->X, &buf1, &JQ->p, &buf2); mp_exptmod(&P->Z, &buf1, &JQ->p, &buf3); mp_mulmod(&buf2, &buf3, &JQ->p, &buf3); mp_mulmod(&buf1, &JQ->d, &JQ->p...
1
c9fd3ac9cbe67ac0a7da2f1e49410a7e
aab27b576151738e76d0971edeb016b7
Order by task assignee (needs to be followed by {@link #asc()} or {@link #desc()}).
HistoricTaskInstanceQuery orderByTaskAssignee();
1
c01d5a1c091c8a145a31399d39d26d1c
8e570971bb0924ab4162d71daac11b27
Remove snapshot from database
public function deleteSnapshot();
1
05aed8d12109f5c0a1cd4a5fbe2cdfb2
46906e4f015b6812e003a6a5227558ce
更新排行榜 只显示前三 不足前三时 有几个显示几个
public class HnLiveBaseBiz public ArrayList<OnlineBean> getShowOnlineList(ArrayList<OnlineBean> onlineList) { ArrayList<OnlineBean> list=new ArrayList<>(); if (onlineList.size() >= 30) { for (int i = 0; i <30 ; i++) { list.add(onlineList.get(i)); } }else{...
0
bd618624097fabec0d06ac07f6b578c4
ed8773cfc606f65c607dcf3d917b6dc9
Detects there is any active seo plugin
class SEOOutput public static function exists() { return self::$seoProvider != null; }
1
21dcc11f15ec92128786a2b8161eb7d3
51ac3c4639e7f4e01c264caa966bacd6
Returns a python type according to a java type
if python_type is int: return 'Integer' if python_type in [float, decimal.Decimal]: return 'Float' if python_type is bool: return 'Boolean' if python_type is datetime.datetime: return 'DateTime' if python_type is datetime.date: ...
0
6ca4d6c9fc998f07af7b7ebe6e08932b
aa15e30ed1200a69612a25b349e0fd09
FIFO queue holding all JSON configurations that need parsing and processing
class EventQueue: def __init__(self, config: Dict[str, str]): self._config = config
0
e055a52349122d97f3f9b5412e2487ab
c3ee6f515e553aed66de9166da4912ac
Reads all published projects or all archived projects
namespace API_VSIA.Controllers [EnableCors(origins: "*", headers: "*", methods: "*")] [CustomAuthorize] [RoutePrefix("projects")] public class ProjectAPIController : ApiController [Route("")] [HttpGet] [SwaggerOperation("GetAll")] [SwaggerResponse(HttpStatusCode.OK, type: typeof(...
0
2c53ca6aca211463bafcd00b074d1f6c
48d5611f003e33720bc2c6fb962273d7
Can Import Listings
$db = new DbHandler(); $request_type = @$post_data['request_type']; $status = 0; $response_data = array(); $error_code = ""; $errors_msg = ""; if (!empty($post_data)) { $application_code = @$post_data['application_code']; $retArr = $this->g...
0
73467ec1ad7610955a989a3e680e8051
f652a5e700110d45fdbb73399337b124
2. 得到某个类的静态属性
public class ReflectUtils public static Object getStaticProperty(String className, String fieldName) throws SecurityException, IllegalArgumentException, NoSuchFieldException, ClassNotFoundException, IllegalAccessException { Class<?> cls = Class.forName(className); Field field = cls.getField(fieldName); O...
1
793769b68e96886d080089756a64e926
3a1b26b5a42dd3243d6f6fa31b5be0ed
Returns a copy of the integer array in descending order.
public class Statistics public static double[] sortInDescendingOrder(final double[] data) { Arrays.sort(data); for (int index = 0; index < data.length / 2; ++index) { swap(data, index, data.length - index - 1); } return data; }
0
577340052cbeccf177e5a1a683f2bb44
8728b5c6f4d40115c636c20426cb7d1b
Add match table with current round in match report.
report_match_query = """insert into matches (id1, id2, winner) values (%s, %s, %s) """ with get_cursor() as report_match_cursor: report_match_cursor.execute(report_match_query, (winner, loser, winner,))
0
9533c117f93cb2e0296cede227313f43
0c0070ce8aa52e396f060a42015eb2b8
Returns the meta object for the containment reference list '{@link org.jabylon.properties.PropertyFileDescriptor#getReviews <em>Reviews</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
ImmutableList<SchemaOrgType> getReviewsList();
0
20bc5fba974350ee86b427e8de580ccf
0760af11c95d6d2158e4daf4d1c46ae2
根据部门和人员ID,为部门添加关联人员
Integer addEmp(String positionId, String[] empIds);
0
e0aa6131302d0005ecb61ad62f89ad88
140bfd85b022a6e4a4807eb791798716
通过私钥创建 keystore
def create_jks(): print('create jks start') command = 'keytool -genkey -alias {alias} -keypass {alias} -storepass {alias} -dname "CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown" -keyalg RSA -validity 20000 -keystore {alias}.keystore' command = command.format(alias=jks_name) print(co...
1
8ce37bda2b49ffd4d3cf0762867d61d8
e1f06af9fe1bcc379d0640286198ac8a
Plotting Feature Importance Table of CatBoost
def plot_features(booster, figsize): fig, ax = plt.subplots(1,1,figsize=figsize) return plot_importance(booster=booster, ax=ax)
1
2d8ece7a9bf641dfd018e55c69ccde72
e0febc62b06eb118850e255f19695b20
获取将要修改的线路信息
var cv = plus.webview.currentWebview(); $("#lineName").val(cv.lineName); poleLineId = cv.poleLineId; if(typeof(poleLineId)!="undefined"){ var UID = plus.storage.getItem("uid"); var logingUser = plus.storage.getItem("logingUser"); var areaName = plus.storage.getItem("areaName"); var url = plus.storage.getIt...
1
d0e3b9dfcd345c5ac3b760db2753acd9
3ade8b232c62b9af3e15b7b2ebe2d8ca
Return k nearest points to central.
def orderCenter(points, k): return np.array(points[:k])
0
b8ca68013ae14c1d33a9dde935f308c3
195e11f0fe07af873e8583fb8c33c466
This test passing means the module doesn't crash when an invalid event handler is called or when the event handler execution fails.
{ $oConfig = oxRegistry::getConfig(); $sState = $oConfig->getConfigParam('sTestDeactivateEvent'); $this->assertSame(null, $sState, 'No events should have been executed till now'); $oEnvironment = new Environment(); $oEnvironment->prepare(array('with_events')); $oModul...
0
b9387378f2b622df5c8fd8092182acb1
ba4a6c738c1eab3d5f7853e2c6769e65
Returns a new HrWithholdingsQuery object.
namespace Microsoft.StoreServices Task<ClawbackQueryResponse> ClawbackQueryAsync(ClawbackQueryRequest request);
0
50b3656e44b7c1d68d6e14cf0b2fb51d
f7c48e10b6b47b142de22058383d0627
测试获取所有Office的方法
public List<SysOffice> selectAllOffice(Model model){ List<SysOffice> sysOffice = sysOfficeService.getAllOffice(); return sysOffice; }
1
3224b76a7878ffaf32abf40dd1108418
02fb9c8dad9a412671a170a1d26a950f
Set whether a representation should be stored.
public class DataObject extends JSONMetaDataObject public void setRetain(boolean retain) { this.retain = retain; }
1
3959116a8192c2e150de58664d5812b3
dcffb3440f2dc992557c1095c7d855c0
清除redis中保持的最新房源列表
@Service public class ContentImageServiceImpl implements ContentImageService public void deleteHomeRedis(){ try { jedisClient.hdel(PRODUCT_HOME,PRODUCT_HOME); }catch (Exception e){ e.printStackTrace(); } }
1
9d1cd8e0069be07cd8d12f971f79ab28
1e757843e7c315977f3409924724caed
Read the block that is previous to current position
fseek(file, BLOCK_SIZE * block_id, SEEK_SET); fread(buffer, BLOCK_SIZE, 1, file); }
0
fcbe2bec65dc64bd55269ac2d857980c
daf08aa8350b824d7fc67a828f3b3dfd
setter fokus i felt for fornavn
namespace UtnEmall.ServerManager public partial class UserEditor public void FocusFirst() { Keyboard.Focus(TxtFirstName); }
1
cc0fe3af15c1793fb9e4d3908dc3ac81
b91fa201cff4deb22c4f48ade41e2b33
Method to convert the Droplet Object to JSON
return { "instance_uuid": self.instance_uuid, "uuid": self.node_id, "links": self.links_json(), "maintenance": self.maintenance, "provision_state": self.provision_state, "power_state": self.power_state, "name": self.name ...
1
b991e1f9e00279eec8ac6d65dc59b16c
f61a128b1f82ba83e878eed0fd3f0a20
Fonction qui reçoit la requête SQL et un tableau des paramètres pour bind et exécuter une requête GET (SELECT, etc...)
if (C_PERF == "show") $startTime = microtime(true); $req = mysqli_query($this->db,$sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysqli_error($this->db)); $this->request = $sql; if (C_PERF == "show"){ $endTime = microtime(true); $elapsed = $endTime - $startTime; $this->perf[$this->iPerf]["sql...
0
c75665b5912f3282635b114f3c0d40a2
a84bf14fd1c836ee502586de2d4c9c67
Проверка метода запроса на подтверждение учетной записи
namespace FaceLook.UI.Infrastructure.Concrete public class AuthenticationProvider : IAuthProvider public bool ConfirmAccount(string login, Guid key) { return _authProvider.ConfirmAccount(login, key); }
1
d8a99d3cba1309bf29af9ed7c2ebc903
dae171349d389e35b7c29ead51029938
Get the last object that disturbed the inventory of the caller. * Returns OBJECT_INVALID if the caller is not a valid creature or placeable.
namespace NWN public static partial class NWScript public static NWObject GetLastUsedBy() => new NWObject(Core.NWScript.GetLastUsedBy());
1
fe9dd4b9b4a0d224736715fd3a8cc1bf
c9bc798b5ae5cc95791a49efb80b426b
展示所有用户的位置信息列表
List<UserInf> uList = DataSupport.findAll(UserInf.class); for(int i = 0; i<uList.size();i++) { List<UserInf> List = DataSupport.findAll(UserInf.class, true); InfoBean infList = List.get(i).getInfo(); if (!(infList == null)) { double Latitude = infList....
1
5d339ac6be03bfbb5d040ad2b999ff82
ae3ebfce8ec55c3c25a23cfb69d6aace
Set of fields for all node types to be loaded
class JCMSCollectionNode extends SqlBase public function fields() { $fields = [ 'nid' => $this->t('Legacy ID'), 'uid' => $this->t('Author ID'), 'uuid' => $this->t('UUID'), 'title' => $this->t('Name'), 'sub_title' => $this->t('Sub title'), 'created' => $this->t('Created timestamp'...
0
9b79f2b3b9ac5beecec08d7557abd3bc
22e10f42ddd8dfa5eb42e0ead425c039
二项分布,模拟抛硬币试验
def pmf_coin(): rvs,ps = [0,1],[0.5,0.5] return pmf_list(rvs,ps)
0
b4fe79408ac0622c02b2b783674dd98b
192f29048fabee28b8ea2cc6ade48f95
Gets the real OCSP response according to the OCSP request we've got from the prover
class Ocsp public function decodeOcspResponse($rawResponseBody) { $ocspResponse = $this->derDecoder->decodeElement($rawResponseBody); if (!$ocspResponse instanceof Sequence) { throw Asn1DecodingException::create('Invalid response type'); } $this->checkResponseStatus($ocsp...
1
14ba5c6e4303deb767398314f478b12f
9790ba5d70cadb06cf12333e6504512f
When a client requests ownership, transfer ownership to them.
def transferOwnership(_account): _onlyOwner() Require(_transferOwnership(_account)) return True
1
40612a8e6ca31ddbb5f57db5c234947f
0b472b4b8ce8b0c9a51547e298e67259
from the coordinates calculate each distance from each point and save it
void point_dist() { int i, j; double x; for(i=0; i<MAXN; i++) { for(j=i+1; j<MAXN; j++) { x = (D_Point[i].x-D_Point[j].x)*(D_Point[i].x-D_Point[j].x); x += (D_Point[i].y-D_Point[j].y)*(D_Point[i].y-D_Point[j].y); D_Length[i][j] = sqrt(x); D_Length[j][i] = D_Length[i][j]; } } }
1
8c521a5b8d59c73cc52f3966d5c95c94
005f47c018adcea4f2a33ce599cb24b9
Get the server uri of the system, i.e. a uri that when entered in the browser accesses the server that runs the KiWi (and SOLR) applications. Can be used to compute the paths of other applications relative to the current application. Computed like the base uri.
public class SIOC public static String getURI() { return NS; }
0
c9b4f8007cf3542e562395ff5b9deadf
6a28152b3d83aca34b3d4e513514364e
To update sync email option to remove Commented user & it's group - ig_es_sync_wp_users ES version 3.2 onwards
class Lifecycle extends Framework\Plugin\Lifecycle private function update_to_2_5_0() { add_option( 'wc_social_login_append_buttons_memberships_restriction_messages', 'yes' ); }
0
dee72bd44366d1f024a1ae12808ddf27
258f3d23ee6a3af4e08436acb580959e
Gets the file names which were processed since last execution of reset_file_names_processed
class Generator_CSVS(keras.utils.Sequence): def reset_file_names_processed(self): self.file_names_processed = list()
0
a1716586d345a814a0025061495fc5e5
82cd084d605ecaf28c71de35adf34957
以类型分组形式返回字典数据
@ResponseBody public ResultJson typeDataTable(@RequestParam(value = "typeGroupId", required = false) Long typeGroupId) throws JsonException { ResultJson json = ResultJson.newBuilder().bulid(); try { json.setData(typeService.getListByGroupId(typeGroupId)); } catch (Exception e...
1
e82274b2fee9df83247322c293574ed2
cfeaf6c062ee864310cadb39f0626b0e
Builds a payment request with Api Key and Api Login values
{ $rb = new RequestBuilder($sandbox); try { $paymentRequest = $rb->callPaymentRequest($head, $content); } catch (\Exception $e) { echo $e->getMessage(); } return $paymentRequest; }
0
babc7498188fa3fe82f9be01543f9018
051d0171c0bad722dbc0e83d698c2745
uploads the bytes (content) to the blob with the name as file name
if (!this.isInitialised) { this._initialise() } const containerClient = blobServiceClient.getContainerClient(containerName) const blockBlobClient = containerClient.getBlockBlobClient(blobName) return blockBlobClient.upload(value, value.length) }
1
0245e7aefb1cff3aa56c6ea6cadb457b
e4d1a8adc68a6f61ecae47e7566b293a
Initializes a private key from an integer.
class KeyPair: def __init__(self, private_key): self.__sk = private_key.bytes[::-1] self.__pk = ed25519.publickey_hash_unsafe(self.__sk, sha3.keccak_512)
0
610b9a8419c7521111b6a7d15d180bad
0055ad1081dd111a607f62ee23293b75
Update data in chunk1
$chunks = intval(getParam('chunks')); $chunk_id = intval(getParam('Chunkindex')); $tmppath = $savedir . '/tmp/' . getParam("id"); if (!file_exists($tmppath)) {@mkdir($tmppath, 0777, true);} $tmpname = getParam("id") . "_{$chunk_id}"; @move_uploaded_file($_FILES["file"]["tmp_name"], "{$tmppath}/{...
0
96cd821260c217ccdf754b1476bbb029
79ca5190748dea7982d5fe570a35bc86
Validate the flow mirror point.
mirror_row = validation_args.resource_row if not hasattr(mirror_row, 'active') or \ mirror_row.active == [False]: return self.validate_output_port_is_not_empty(mirror_row) self.validate_selects_are_not_empty(mirror_row) self.validate_output_port_is_not...
1
0fc32de490d26fd9918e6ff520005ef5
7f6e80c497f856c40eea39af7ea46978
PIE mappings for ADC interrupts
{ 0x0000, 0x1fff, MRA_RAM}, { 0x2100, 0x2103, pia_r(S11_PIA0) }, { 0x2400, 0x2403, pia_r(S11_PIA1) }, { 0x2800, 0x2803, pia_r(S11_PIA2) }, { 0x2c00, 0x2c03, pia_r(S11_PIA3) }, { 0x3000, 0x3003, pia_r(S11_PIA4) }, { 0x3400, 0x3403, pia_r(S11_PIA5) }, { 0x4000, 0xffff, MRA_ROM }, MEMORY_END static MEMORY_...
0
91d7a282cdcd6b575e4a8126981afcf1
bae7e1b59cef630ce3786d199b0f822f
Set all the solver parameters based on the values read from an input file
class SolverParamReader: def __init__(self, dict_args): self.maxval = float(dict_args['maxval']) self.minval = float(dict_args['minval']) self.smooth_rect_sizes = map(int, dict_args['smooth_rect_sizes'].split(',')) self.smooth_rect_reductions = map(int, dict_args['smooth_rect_reductions'].split(',')) ...
1
4ac53efa693e8157414d017d18eb2444
05910f57f87dcc3d13e19d4f6b28671b
Lấy danh sách nhà cung cấp đổ vào CBB
namespace QLNS.DAO class DAO_SanPham public dynamic LayDSNhaCC() { var ds = db.NhaCungCaps.Select(s => new { s.ID, s.Ten, }).ToList(); return ds; }
1
bdd789dfc4be0257ed23ea5a265397dc
5574673b68fd188f5a2d440a7b43cbf4
Disable the add/delete piece/peg buttons.
if (btnInsert != null) { btnInsert.setEnabled(false); } if (btnRemove != null) { btnRemove.setEnabled(false); } if (btnMoveUp != null) { btnMoveUp.setEnabled(false); } if (btnMoveDown != null) { btnMoveDown.setEnabled(false); } }
1
c744b02727b45f4bd608223f76aa6c06
1a83b27a302beb276fe3da88329aa6fb
Uncamelcase
class Cp camelize(str) { return (!str.includes('-') && !str.includes('_')) ? str : str.replace( /[-_][^-_]/g, match => match.charAt(1).toUpperCase() ) }
0
b4ae916aa43bf3d04f8080346087106a
e63b122e8cb04a5dece34f7a247d6381
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % ...
void mapscan( COLOR *scan, int xres ) { double mult, Lw, b; int x; for (x = 0; x < xres; x++) { Lw = plum(scan[x]); if (Lw < LMIN) { setcolor(scan[x], 0., 0., 0.); continue; } b = BLw(Lw); mult = (Lb(b) - ldmin)/(ldmax - ldmin)/(Lw*inpexp); if (lumf == rgblum) mult *= WHTEFFICACY; scalecolo...
0
c13d04828132a03470e1d62712e409e9
d273580edab25bc27dc3a8aef82bf2dc
当鸟飞出屏幕或被击中时,当前剩余飞鸟数减一
if bird.rect.top <= 0: stats.game_active = False stats.died_times += 1 ai_settings.pillar_speed = 0 ai_settings.ground_speed = 0
0
6d7b81334f1fec5ab80bb9e1d718f41e
4f1940482ec1a997e0aeb9c39f138b43
Retourne une partie de la description de l'événement Si la description de l'événement est plus courte que la partie demandée, la description de l'événement est retournée en entier.
class Article extends BaseArticle public function getDescriptionTruncate($l = null) { if (!$l) $l = 100; if (strlen($this->getDescription()) > $l-3) { $str = substr($this->getDescription(), 0, $l-3).'...'; return $str; } return $this->getDescription(); }
1