query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2ed6d392e1e403ec66b1049a71ce0ecb | 08df1ff136ca61156e2d699d54a515a1 | whether the message was sent or received | if(id == 1 || id == 11) this->isSend = true;
if(id == 2 || id == 10) this->isSend = false;
if(id == 10 || id == 11) this->isClient = true;
if(id == 2 || id == 1) this->isClient = false;
if(id == 2 || id == 10) this->timeStamp = (size_t)std::chrono::duration_cast<std::chrono::seconds>(std::chrono::sy... | 1 |
b7565bd7d1a9683e4d17363725aae650 | 211fd13d39b0708fe69047547f98ddaf | A thread that periodically samples from a MetricProvider and caches the
samples. | class QueryTimer:
def __init__(self, metric_base, sample_rate=1):
self._metric_base = metric_base
self._sample_rate = sample_rate | 0 |
2201b6ceaca92425732052a5e6848f9f | 83415c18fdaae99cb559f5ea04bc9769 | e.g. cpu MHz : 1594.851 | func parseIperfCPUUsage(output string) (string, string) {
match := iperfCPUOutputRegexp.FindStringSubmatch(output)
if match != nil && len(match) > 1 {
return match[1], match[4]
}
return "0", "0"
} | 0 |
27cd3a51a51dda09fe79738e3ab39236 | f4f905a307d70b5f882c4afd89809642 | Determinam palindroamele obținute prin concatenarea elementelor de pe aceleași poziții în cele două liste. | def toateelempalindrom(l):
for x in l:
if is_palindrome(x) == False:
return False
return True | 0 |
0f872b47766b1814c4140ab0a1840da3 | 1c075899ab1e415194b91849d1e4d23d | Get a list of routes that are documented. Returns an array of Strings. | protected function getRoutes()
{
return Cache::tags(config('api-helper.cache_tag_prefix') . '_routes')->remember('api_doc', config('api-helper.cache_ttl'), function () {
$path = base_path();
exec("php $path/artisan route:list|grep -E '@'|awk '{print $3\":\"$5\":\"$8\":\"$9}'", $route... | 1 |
d1280de89a8c1320d9491d9678ff3d80 | d8ef3cc7ce903d950a99b130907657f9 | Sets whether or not the bridge should carry action parameters forward into subsequent renders.
indicates they are not. | public class SoGLRenderAction extends SoAction implements Destroyable
public boolean isPassUpdate() { return pimpl.passupdate; } | 0 |
9112492a7ae0eeb14d6e88837df3b96b | 213ade1fd8aca1caf0451f00ff81a6d8 | Trigger Change Of Stored Credentials To Valid User Account. | public class AccountEngine
void onServerValidResetVCSucc(); | 0 |
ce1c74d713e49f6ee251c164871c85d0 | 6990779bdf7c2bbf1953b497658b9173 | Helper method to get the latest audit config | namespace Pulumi.AwsNative.IoT
public static class GetAccountAuditConfiguration
public static Task<GetAccountAuditConfigurationResult> InvokeAsync(GetAccountAuditConfigurationArgs args, InvokeOptions? options = null)
=> global::Pulumi.Deployment.Instance.InvokeAsync<GetAccountAuditConfigurationResult>("... | 1 |
da00ca52aa9093a8acf0862c1e0fdb5d | 1683d9d8bf6e8eb4fc95ef4ef53015d8 | Exception for Ipernity API Errors | class APIError(Error):
def __init__(self, what, message=None, **additional):
super(APIError, self).__init__(what, Message=message, **additional) | 1 |
3aafc376023d390fc16ef7e55c674338 | 0ff341ec69e9a38863d20bf21843ebdb | 回答済みの場合には処理をしない | {
if ($comment->work->status === 'complete') {
return;
}
if (auth()->id() === 1) {
dispatch(new \App\Jobs\CommentEmail($comment));
} else {
dispatch(new \App\Jobs\UserComment($comment, 'comment'))->onQueue('comment');
}
} | 1 |
32297b110f238b906c7f6398e04e7494 | c95772aedbc99881ad0f3798a1abdcfa | 等级2代理(招商):系统最高等级 & 上级是等级1用户 | $level = [];
if(!$agent['superior_username']){
$level['level1'] = $agent;
$level['level2'] = false;
$level['level3'] = false;
return $level;
}else{
$username = $agent['superior_username'];
$sql = "select * from web_agentmember where username='$username'";
$level2 = $db -> getRow($sql);
if(!$level2['s... | 0 |
c9527e9b28468dfc2f4b042ce8d8b96c | b31bb5f1d6038aa0d824264eb93172fd | Fonction Callback permettant d'ouvrir la pince du robot à la réception du message de Commande | LISTENER.add(listener);
DobotMessage msg = new DobotMessage();
msg.id=10;
msg.rw=0;
msg.isQueued=0;
msg.params = new byte[0];
msg.paramsLen=0;
CommandQueue0.add(msg.getCommand());
} | 0 |
1d7b38d9c60d7b61d34c4446f5ccd90a | 7a44626fc98c6c43b1d89fc3b20f137b | get learning rate from an external file, so that we can adjust learning rate while training | parameters = None
with open(filename, 'r') as fp:
parameters = json.load(fp)
return float(parameters['learning_rate']), int(parameters['num_epochs']), int(parameters['batch_size']), int(parameters['Tx']) | 1 |
affcca3e21d6a43d3e963a1aea381314 | 6572b86f0055c9d91b5c5403673a0b5e | compute all of the terms on the mass balance equation set left-hand-side; diagonal terms will be subject to change as time step changes | a = a.ravel()
df = np.zeros((nr,nr+1))
for k in range(nr):
for i in range(nr):
df[k,i] = b_l[i,k] + nue*b_lc[i,k] + + np.sum(b_nl[i,:,k]*a) + np.sum(b_nl[:,i,k]*a)
df[k,nr] = b_cc[k] + np.sum(b_lc[:,k]*a)
return df | 1 |
eab2ccdafc96864ad03c4f4e0bbcef23 | 09dc9c6463ceab2b5ad1996b79984782 | Queries Edge for all accounts, workspaces, and milestones
to cache them for processing. | def generate_cache(update=False):
for service in quest.api.get_services():
quest.api.get_features(service, update_cache=update) | 0 |
1ad5e6e070311097d0b0024edf82778f | b3169f50c56d57d6ed445c0585ea0aae | 3.Kullanıcıdan bir tamsayı girmesini isteyin, ekrana o tamsayının mutlak degerini yazdırın. | public class Odev03TernaryOperator
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Lutfen bir tamsayi giriniz");
int num = scan.nextInt();
int result = num>0 ? num : num*-1 ;
System.out.println(result);
scan.close();
} | 1 |
3a616f3299ac67198749daabd8d72d60 | d125d23f8fe319d745983002609222b9 | Compute Initial Node redefined so as to begin the journey only from
highways | Iterator it = map.entrySet().iterator();
String key , hkey;
Element val;
Way temp;
List<Node> nodes;
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
key = (String) entry.getKey();
val = (Element)entry.getValue();
... | 1 |
644625250bf4c1de8a5ac4069b43a192 | 3a583ce1e640b056eed759670759909c | Called when the <see cref="CommandParameter"/> property changes. | namespace ViewModelLib.Commands
public class BehaviorBinding : Freezable
private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((BehaviorBinding)d).OnCommandChanged(e);
} | 0 |
a1ce9d8621921de7cbf0562aeab0de1d | 9d1c2762bc51a899e26a360c8f41a88f | Cette fonction permet de récupérer les types d'articles | ArrayList<Mention> listMention = new ArrayList<Mention>();
ConnexionDB con = new ConnexionDB();
ResultSet res = con.envoiRequete("SELECT Type FROM mention");
try {
while(res.next())
{
Mention mentionTemp = new Mention();
mentionTemp.setType(res.getString(1));
listMention.add(mentionTemp);
}... | 0 |
83ce84a22b9582632cea1e1c04e99ca9 | 83a2ea7de4de57daeef63c5526c2948f | Установить стиль ребра | function style(edges) {
var marker = vars.edges.arrows.value ? "url(#d3plus_edge_marker_default)" : "none"
edges
.style("stroke-width",vars.style.edges.width)
.style("stroke",vars.style.edges.color)
.attr("opacity",vars.style.edges.opacity)
.attr("marker-start",function(e){
var d... | 1 |
edcb84b176a7b0b9eb72e7d1b73e95c2 | fcf0d11adfce2fda5da86ffc87e7d07f | ###### Is tree empty? ################################################# | class BSTree
bool isEmpty() {
return (root == nullptr);
} | 1 |
bd79e4ad5d312b583f085fc0d634d49d | 464b44943f8ef69bf99e865d9e6f4eb4 | List all running tasks in celery cluster | class OpenCenterCLI(cliapp.Application):
def cmd_task_list(self, args):
self._list_obj('task') | 0 |
a2d638e5cae2bb60143bb3ec26b86888 | 599e8ef903690cb6ba6ec92beab90a8d | When a NetworkView instantiates it has viewID=0 and is unusable.
We need to assign the right viewID -on all players(!)- for it to work.
We use a function (as opposed to go.networkview.viewID = id1) so that we could scale up to multiple
networkViews eventually. | public class PlayerID : NetworkBehaviour
[Client]
void GetNetIdentity()
{
playerNetworkID = GetComponent<NetworkIdentity>().netId;
CmdTellServerMyIdentity(MakeUniqueIdentity());
} | 0 |
8a9b86895b1f3e67574b042fe1513728 | d7ca72c6e594b155ee2feb1e95aa6015 | 返回几年几月几日0点的时间戳 | class date
public static function _zero($timestamp = 0) {
return strtotime(date('Y-m-d', self::strtotime($timestamp)));
} | 1 |
bca2bc37cabfa61a895ba8419d92f6d0 | 2e102625a38ab680dcd0a3c9a3f2e076 | 18、二叉树的镜像
递归版本; | public class _33_镜像输出二叉树
public TreeNode Mirror(TreeNode pRoot) {
dfs(pRoot);
return pRoot;
} | 1 |
9ae17661a7539a01ae6a9190ef312715 | c7ea92cc00f3a02bb4eadd4ca7665fed | Shows the page to the user.
[[Special:BadgeManager/subpage]]. | {
global $wgSpecialPages;
if( !is_array( $wgSpecialPages[0] ) || !is_array( $wgSpecialPages[1] ) )
{
throw new JWException( "\$wgSpecialPages has an incorrect structure." );
}
$output = null;
if( count( $wgSpecialPages[0] ) >= 1 )
{
$output .= "<h2>Private Special Pages<hr/></h2><P>\n<ul>";
fore... | 0 |
3b67ed3d605a34482d468ed3cf00467e | e54ea52043149a5236d668aae6d22687 | Get crash report | {
$code = $this->resolveArg('code');
$query = '
query ($code: String) {
reportData {
report(code: $code) {
code
title
startTime
endTime
fights(killType: Kills) {
id
encounterID
st... | 0 |
63061bb0c699c40f2dfe82447ed2b25d | 09c1f7208edd7b1eb762007df41348f3 | 查询特定vin的会员卡是否存在 | public boolean isExist(String vipNum); | 1 |
063310611e65d40f1f7a2932d0623ef1 | 55ad0f6eacaab36d25c69878aaf9fe4e | Función que calcula el coste total de las referencias de la tabla del componente | function calculaCoste(tableId){
try {
table = document.getElementById('mitablaRefsLibres');
var rowCount = table.rows.length;
var coste_ref = 0;
var costeTotal = 0;
for(var i=1; i<rowCount; i++) {
var row = table.rows[i];
coste_ref = parseFloat(row.cells[10].childNodes[0].nodeValue);
coste_ref = cos... | 1 |
f963d74a4974d577754ea94ff79d5b69 | 534700a984d77e267f6600d76814e252 | Correct conductivity signal for effects of cell thermal mass. | def imaginary_conductivity(T, f):
pass | 0 |
0c4e72052c0380d98244191aac09faae | a95931205197d61cda3d66a57a937bfb | 批量删除路口信息 | public class TrafficLineAction extends BaseAction
public String batchRealDelete() throws ServiceException {
boolean isSuc = trafficLineService.batchRealDelete(idsValue, versionFlag);
if(isSuc) {
String logContent = "批量删除交通路线";
String logName = SystemOparetionLogUtil.getLogName();
String logTime = SystemOpa... | 0 |
25779525f819e200c47453a35e917b95 | a61bb6313bff0ed4aa842c671e25f1f7 | Unsupported at the moment, deis is CoreOS only. Porting would be another project :P | pub fn is_wsl() -> bool {
false
} | 0 |
a8e9ab3f49741cb6b7bae8395fe6d32a | e61e85784141e8dac3d01caa2efa1c44 | Обрабатываем сущности содержащие компоненты "SpawnPoint", "Position"
Аспект - список сущностей, содержащих выбранные компоненты. | public class ServerThread extends Thread
public void componentSpawnEvent(ComponentSpawnEvent componentSpawnEvent) {
for(ComponentListener componentListener : componentListeners) {
componentListener.componentSpawn(componentSpawnEvent);
}
} | 0 |
6c10131d7a175478c1081e0389b6bb81 | 2959f74e85a1f66bd3be4280e8084dbf | Brings the array to its initial state with all zeroes.
Used when we want to empty the structure without reallocating all the objects/memory
NOT THREAD SAFE !!! | void reinitialize_pos_array(int posArr[COL]){
for(int j = 0; j < COL; j++){
posArr[j] = 0;
}
} | 1 |
94ce589327fd4476837f24ff9fa14ceb | 89916d7128603f3a82703288c764ebff | Returns cells selection shade width. | public class WebList extends JList implements EventMethods, FontMethods<WebList>, SizeMethods<WebList>
public void setSelectionShadeWidth ( final int selectionShadeWidth )
{
getWebUI ().setSelectionShadeWidth ( selectionShadeWidth );
} | 0 |
8ebfabb1ce9a515d0006ee32f380f21f | f25d2992bed8863240a02bb41965806d | 交易委托解冻结接口 | public partial class Web_JHJX_New2013_JHJX_UserDongJie_YDJZHGL_info : System.Web.UI.Page
protected void btnJieDong_Click(object sender, EventArgs e)
{
try
{
ArrayList al = new ArrayList();
string strzlyhb = " update dbo.AAA_DLZHXXB set B_SFDJ = '否' ,DJGNX = '' WHERE B_DLYX='"... | 1 |
cd5005b33049bdbaecfcf3575bffba02 | e75976e1237ecbb83abd47d9913989eb | Returns SubsetLink if it exists | {
struct setinfo *s;
s = findset(subname);
if( s == 0 || s->subsetof == 0)return 0;
return strdup(s->subsetof);
} | 1 |
c6ba21204acdd7fae9ac50580ea1a902 | 759b2416daa11dbeeb80db99ecb85da4 | db_init --
Initialize an environment. | {
DB_ENV *dbenv;
int ret;
if ((ret = db_env_create(&dbenv, 0)) != 0) {
dbenv->err(dbenv, ret, "db_env_create");
return (NULL);
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, prefix);
if ((ret = dbenv->set_cachesize(dbenv, 0, cachesize, 0)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->set_cachesiz... | 1 |
2010181c1e765f244904108ed70e54f9 | de80f42c078f0c673be1047f8ee15aa3 | A viewport-color-checking function for tests. Tests for the presence of a list of expected colors in the entire viewport or specified ViewRect. | async function testViewports(viewId: Id64String, imodel: IModelConnection, width: number, height: number, test: (vp: TestViewport) => Promise<void>): Promise<void> {
if (!IModelApp.initialized)
return Promise.resolve();
await testOnScreenViewport(viewId, imodel, width, height, test);
const offscreen = await c... | 0 |
771ae56b1445c676452d4b75af899ad6 | fcd360998b5aabcb73b36e413e71b901 | Connect to the database for this application. Will 'die' on failure. | bool silgy_app_init(int argc, char *argv[])
{
Cdb::DBOpen(G_dbName, G_dbUser, G_dbPassword);
return true;
} | 0 |
3cfa8e7a1c477dc92995ac89163ae2c3 | f101110073ae3390551681cbbe7c1838 | Tests writing to a stream chainer that contains an unseekable stream | writer = BlobWriter(self.db, self.directory, 4)
writer.write('12345')
writer.seek(-1, 2)
self.assertEqual(writer.tell(), 4)
writer.write('abcd')
writer.close()
self.assertEquals('1234abcd', self._read_all()) | 0 |
8d0050b3a07f0a4de783bb11e9a6961d | 923a398edf8e0e3339a404d3669143b7 | Counts num sold by going through each seat and incrementing based on type found | function phpTicketsRec($seatsArr){
foreach ($seatsArr as $key => $value) {
if ($value > 0){
switch ($key){
case "STA":
echo "$value x Standard Adult <br>";
break;
case "STP":
echo "$value x Standard Concession <br>";
... | 0 |
7ca760e05e131ebbbd0c974e367e59b8 | aeba4806412031ad4506b601e4f11d42 | 指定されたデータを登録してTrueを返却します。
すでに存在するデータの場合はFalseを返却します。 | try {
DatabaseEntry putKeyEntry = new DatabaseEntry(key);
DatabaseEntry putValueEntry = new DatabaseEntry(value);
OperationStatus status = cursor.putNoOverwrite(putKeyEntry,
putValueEntry);
if (status == SUCCESS) {
isCurrent = true;
keyEntry = putKeyEntry;
valueEntry = putValueEntry;
... | 1 |
3962cc94137ab302ba8a41849b744778 | 43b81d269a1d7626620d76f29482a25e | Updates the external accounting system | {
$model = new Update([
'external' => $this->ext_collection(),
]);
return $this->runModel($model);
} | 1 |
0828ba354d8e7e83f711465e5e66fa65 | b8c9c5bafeeef67db7426314df732a2f | Read the motion table from the server. | public class ClientApp
@Override
public void actionPerformed(ActionEvent e)
{
controller.writeToServer("getmoves:" + controller.getUserName());
} | 0 |
07566172887b42b8a984d67f95596fdc | 9f9dc3a188c3ce91aa05cea118767748 | In the case of a multiVM environment, we need to connect the VMs using
a private network | class OSReleaseTest(OpsVsiTest):
def setupNet(self):
switch_opts = self.getSwitchOpts()
intfd_topo = SingleSwitchTopo(k=0, sopts=switch_opts)
self.net = Mininet(intfd_topo, switch=VsiOpenSwitch,
host=Host, link=OpsVsiLink,
controller=None, bu... | 0 |
dcb5b51a4eec01710ae698470a14e35a | fe2456538b724f72daf68b80d329830c | 返回第i行和第j列的像素值及其周围八个像素的未加权平均值。 | {
int ii, jj;
pixel_sum sum;
pixel current_pixel;
initialize_pixel_sum(&sum);
for(jj = fastmax(j-1, 0); jj <= fastmin(j+1, dim-1); jj++)
for(ii = fastmax(i-1, 0); ii <= fastmin(i+1, dim-1); ii++)
accumulate_sum(&sum, src[RIDX(ii,jj,dim)]);
assign_sum_to_pixel(¤t_pixel, sum);
re... | 0 |
008315df3c2873bdea9cabc05a9c7f25 | 3f52c3f20edba228f48f2860e303c515 | Returns an empty persistent set of specified type. | internal fun <K, V> persistentHashMapOf(): PersistentMap<K, V> = PersistentHashMap.emptyOf() | 0 |
ba5ce06d16bdc56beea52875f1bde3c5 | 292ff258b02cb692727d7fc7fcb36246 | Shows the close. | namespace Monoflector.Plugins
class PluginInstaller : IPluginInstallation
public void ShowClose()
{
_dialog.ShowClose();
} | 1 |
61eeee8cf9f78330da124fc24e801b7e | 3750d88670a5fb8d9590e360d4bf2f3d | Check if a user is assigned to a specified series. | public boolean isUserAssigned(
String uid,
String roleName, boolean recursively) throws BSFLocalizedException, BSFNotFoundException; | 0 |
284ec619a3dd78672b2e355679e7bb58 | 7ab951ec5f2c54414b51394a7743f3fa | Detects whether or not the current index of a string shows an ending of a comment block such as "* /" | {
Match m2 = Regex.Match(text, @"^\/\*.*\*\/$");
bool ret = false;
ret |= m2.Success;
return ret;
} | 0 |
6452bd31d8559081946462ff41a6eb44 | 275f085c6a29dfb33d3c8c82a7e73e79 | 将今天的数据添加到redis | user_total = random.randint(70, 100)
start_date, end_date = self.get_date()
random_datetime = []
for i in range(0, user_total):
random_datetime.append(random.randint(start_date, end_date))
set_cache(self.get_key(self.key_today_random), user_total, 24 * 3600)
s... | 1 |
1b4ea4eb59c7437e77f8a19f4dc58baf | 0d5980f0effa9cd5f1fb537a65162e8f | terminate program - this must be called by the program before ending | def DoTerminate():
print ("... quitting")
exit(0) | 1 |
53cc528b362ddb0a0ee40bc8426945e6 | af07a6589b3552e33993d48578caed17 | display all details of all borrowers | {
var borrower = db.Borrower.Include(b => b.AspNetUsers);
string userId = User.Identity.GetUserId();
borrower = from b in db.Borrower select b;
borrower = borrower.Where(o => o.Uid == userId);
return View(borrower.ToList());
} | 0 |
3ab264d5f403ca8e622202a2f63fb9e9 | 10bca34b249a312e6a19438026bf05f7 | Debug command, prints message tags and some misc info to the log | REGISTER_DEBUGCMD_FUNC(info)
{
GLint gi;
pEngfuncs->Con_Printf(">>>> >>>> >>>> >>>>\n");
pEngfuncs->Con_Printf("MDT_DLL_VERSION: %s\n", __DATE__);
pEngfuncs->Con_Printf("GL_VENDOR: %s\n",glGetString(GL_VENDOR));
pEngfuncs->Con_Printf("GL_RENDERER: %s\n",glGetString(GL_RENDERER));
pEngfuncs->Con_Printf("GL_VERSION... | 1 |
8a3be92d9efa3a00005f674d88bf290a | 7f61448ad6da3ef0f9cb03f40c5be655 | fixHeader | cases like (1) | 0 |
2f6e82c6edb0569447a47f9913ecaeb6 | 32923a0feb15a9cce1f9f6ae419e79ad | Checks whether title of tudu is empty or not | public void onTextChanged(CharSequence s, int start, int before, int count) {
if (s.toString().trim().length() == 0) {
clearTitleButton.setEnabled(false);
clearTitleButton.setVisibility(View.INVISIBLE);
} else {
clea... | 1 |
b2ff3da437ce0ac0feccefe5dd31bd08 | cb4b80f10a3d00da1d977a7256df255b | Generates all the possible combinations with the chars in the given key.
Yields each combination. | {
for (int len = 1; len <= text.Length; len++)
{
int maxIndex = text.Length - len;
for (int index = 0; index <= maxIndex; index++)
{
string key = text.Substring(index, len);
if (m_keys.Contains(key))
... | 0 |
d7dc4dbb67f48afab2e6d0ea7d4a86e1 | 9ab301f5b43e179940c99ac9324e1b36 | Tells device to check signature against application. If it passes,
the application will boot.
Exception raises if signature fails. | def validate_app(paths, config, part):
app_path = os.path.join(paths.work, part.path)
commands.run_command([
'codesign', '--display', '--requirements', '-', '--verbose=5', app_path
])
if config.run_spctl_assess:
commands.run_command(['spctl', '--assess', '-vv', app_path]) | 0 |
4bbb6335e52279f103109d183e6f2ec4 | 3bd56f87e50db3cddfc459d1aff1edc6 | 把商品显示进去页面 | class GoodsController extends CommonController{
public function DisplayProduct(){
layout(FALSE);
$title = I('get.goodsName');
$this->assign('title',$title);
$goods = D('Goods');
$goodsinfo = $goods->FindGoodsPage($title);
$this->assign('goodstitle',$goodsinfo['goods_name']);
$this->assign('goodsima... | 1 |
8902b37fcb7af653cac6b6a5c0db2c76 | 9e6823db1f3a9899108e42304f5e68d4 | アフィリエイトサービスへのリクエストURLを取得する | {
StringBuilder sb = new StringBuilder();
sb.Append(baseUrl);
sb.Append(Constants.SHOP_PATH);
sb.Append("?vendorNumber=");
sb.Append(vendorNumber);
sb.Append("&licenseeNumber=");
sb.Append(licenseeNumber);
return sb.... | 1 |
de40eb47ffd70fd6284da3c93320a09a | ed9638629d316cb9bd7bd54685519ddd | Function to check the A records | def query_a_record(domain):
return [str(x) for x in resolver.query(domain, 'A')] | 1 |
566b91377945330275bb781062dd7d56 | 5c17a3bf6ed96008879384ca41c88912 | Returns the match fixture with the primary key or returns <code>null</code> if it could not be found. | public abstract class MatchFixtureLocalServiceBaseImpl
extends BaseLocalServiceImpl implements MatchFixtureLocalService,
IdentifiableBean
@Indexable(type = IndexableType.REINDEX)
public MatchFixture updateMatchFixture(MatchFixture matchFixture)
throws SystemException {
return updateMatchFixture(matchFixture, tr... | 0 |
65102d328ba07f8eaf38e12cd5ef60ab | c177be9e09fbc7346e3547d9f85d4e9e | This function returns the next choice distribution | n = len(self_hist)
if n % 2 == 0:
return choices[0]
else:
return choices[1] | 0 |
16c86a1fc7d36b7fcd1c1be374dd1bd3 | 52f3cdbd468325f1971401acc8423d27 | Ags:
list_of_attr_dicts (list of dict)
name (str): Class of the object.
Returns:
(list of OOMDPObject) | attrs = [ (attrname, attrs.pop(attrname)) for (attrname, obj) in attrs.items() if isinstance (attrs[attrname], ofinstance) ]
try:
attrs.sort ( lambda x,y : cmp(x[1]._creation_counter, y[1]._creation_counter) )
except AttributeError:
pass
for base in bases[::-1]:
if hasattr(base, ... | 0 |
bf717c6e9d007e1f671d614e2f96b283 | 725eb4f46429c08e03dfa02476b7098d | Saves generated document in README.md file. | src = read_file_contents(self.template_folder, 'readme.txt')
rewrites = {'title': title, 'body': body}
write_file(new_path, 'readme.md', src.format(**rewrites)) | 1 |
38b58543462dd73e567047d44d915d08 | 76fbd346fc7958e94532e0c0aaf84666 | Appends messages to the list | foreach (string elem in messages) {
Builder.Append(elem);
}
return this;
} | 0 |
2e8ef1f55d51f6727faf278da44818ad | af665f6c0690bf89e68452732018186e | Validates the SAML Message against the specified schema. | SAMLObject validateSignature(SignableSAMLObject tokenSaml, String messageFormat)
throws SAMLEngineException; | 0 |
614eade4abadc7e97f1848e600cd02fc | 62bd0e4fd277151aafb26d5795b0fef7 | Megkeresi az adott nevű diákot | for (int i = 0; i < studentlist.size(); i++) {
if (studentlist.get(i).getName().contains(name)) {
return studentlist.get(i);
}
}
return null;
} | 1 |
5db78a42fcb4bec2b42419fac1095856 | 94aadc8eca8151c9ae163c748ec62ee0 | Checa tabela vazia. | {
int size=tab->size;
CEL *linha=tab->pfirst;
CEL*current=linha;
for(int i=0;i<size;i++)
{
current=linha;
for(int j=0;j<size;j++)
{
if(current->info==0)
{
return 1;
}
current=current->pe;
}
linha=... | 0 |
9ea659f674544e6e6759c7d7bad75d55 | 8c55a9245cb8afcf229ee4d79930ef8f | Prepara los campos del formulario para permitir
dar de alta una entidad. Este método se sobreescribe a
nivel de formulario. | {
parent::postGenerateForm($form, $formbuilder);
$sel =& $form->getElement('id_tipo');
$p = objeto_tabla('proceso');
$db = $p->getDatabaseConnection();
$sel = $form->createElement('hierselect', 'tipoetapa', 'Tipo/Etapa', null, '/');
$mainOptions = htmlentities_array(
... | 1 |
d475436dc8259db33c5258c470894284 | 3b186bd1174620cdfd18b2b66e257926 | 获取redisclient,以host+port为key缓存在JedisClientsMap中。 | Jedis getRedis(); | 0 |
dbfb647e39efedcd6b912d3702fbc67d | d31be8e51860128a8a35633baca24ffe | Used to find wrong keywords.
Raises:
WrongKeywordViolation | log_err_str = '%s keyword %s not found; expected in %s' % (
self.need, self.name, self.expected_loc)
if severity == 'error':
log.error(log_err_str)
elif severity == 'warning':
log.warning(log_err_str)
elif severity == 'info':
log.info(log_e... | 0 |
840776a0bbc07d2ba0ad86be61eff90b | 18a7005506eac15e902aaee9591cb3dd | 헤더 이후의 데이터 셋팅 오프셋을 리턴한다. | pdv_set_header_offset(PdvDev * sd, int header_offset)
{
edt_msg(DBG2, "pdv_set_header_offset(%d,%d)\n", header_offset);
sd->dd_p->header_offset = header_offset;
} | 0 |
6109805841383ec80ac1a545466d8939 | d5e7b7ba290fd9546be91dc0a00e036a | Tests that invalid Javadoc tags do not get leaked into the API
description https://bugs.eclipse.org/bugs/show_bug.cgi?id=255222 | class InputSingleLineJavadoc
void foo5() {} | 0 |
4576bc403374baeea60263887dc685da | b6533a85d3cfe5d9c1ccec922fa864e8 | Function to get user or admin user profile info by email. | @RestController
//@CrossOrigin("http://localhost:8081")
public class UsersController
@GetMapping("/users/profile/{userEmail}")
public Map<String, Object> getOneUserByEmail(@PathVariable("userEmail") String userEmail) {
Map<String, Object> resultMap = new HashMap<>();
Users userByEmail = repository.findByUserEmail(... | 1 |
cf14fad7f00fc23b42d91f6f256aa488 | 15ef56d8fcc20affa63ec7057882f588 | Compile an LLDP-DU (data unit) for transmission inside of an ethernet packet.
Necessary TLVs are:
- Chassis ID TLV
- Port ID TLV
- Time to Live TLV | def duid_uuid(mac: netaddr.EUI, time: datetime.datetime) -> bytes:
start = datetime.datetime(
1582, 10, 15, 0, 0, 0, 0,
tzinfo=datetime.timezone.utc,
)
clock_seq = 0
timestamp = round((time - start).total_seconds() * 10e6)
time_low = timestamp & 0xFF_FF_FF_FF
time_mid = (timestam... | 0 |
4b4f7ef98842f28398724a664d990c88 | 07be772e4935fa9c1de0011d3b176b27 | #Sackin (number leaves below each node equiv to number interior vertices above each node) | statSackin = function (root){
root=as.treeshape(root)
Ns=sackin(root, norm = NULL)
return (Ns)
} | 1 |
9f073f2d5cde91ae8d93946c8ba23f01 | 456b5c64c0ded2f492547b49dffb8d8b | 赤いエリアを抜き出す関数 | lower = np.array([120, 120, 120], np.uint8)
upper = np.array([191, 191, 191], np.uint8)
greylines = cv2.inRange(img, lower, upper)
notgreylines = cv2.bitwise_not(greylines)
lower = np.array( [240, 240, 240], np.uint8)
upper = np.array([255, 255, 255], np.uint8)
mask = cv2.inRange(img, lower,... | 0 |
6f10cf892c01bebf9f303660afe93eb6 | dd155ccb0b612381a9c68091b5d15d26 | Runs a blocking function in a non-blocking way | class BlockingTrioPortal:
def run_sync(self, fn, *args):
return self._do_it(self._run_sync_cb, fn, *args) | 1 |
52c555a48708dded0898f8ce7a29ae64 | 9563904572ab887af0c28303e63dd1af | Retorna período inicial da consulta. | public class RetornoEstornoPulaPula
public Date getDataInicio()
{
return this.dataInicio;
} | 1 |
4a4962105b23c6890edccf7d93870f97 | ac84e8b02995dbccc0468081de53ea51 | GET /cad_neighborhoods
GET /cad_neighborhoods.json | @districts = District.all
respond_to do |format|
format.html
format.xml { render :xml => @districts }
end
end | 0 |
006908a22b1557dd9ec6926fa3119ff5 | 22d784ac20a6126c522ac6d81333e1ae | Update (in-place) the marginalized acquisition probability column
'p_acq'. This is typically called after a change in catalog or
change in the fid set. The acq['probs'].p_acq_marg() method will
pick up the new fid set. | class PumaAllocator(object):
def _update_probabilities(self):
w = self.weights_frame
w['p_pos'] = - w.p.where(w.p < 0, 0)
w['p_neg'] = w.p.where(w.p > 0, 0)
self.prob = np.array(w[['p_neg', 'p_pos']].values.flat)
return self.prob | 0 |
c27f263d9ba53517b6b16a108a153ef4 | a2eabfe9032cf14962f1e75ac760f301 | Determines the shortest spaces a target token is from the current token | Preconditions.checkArgument(token1 != null && token2 != null);
int token1EndColumn = token1.column() + (token1.text().length() - 1);
int tok2StartColumn = token2.column();
return tok2StartColumn - token1EndColumn - 1;
} | 1 |
68f6e167aec3da1c6d49eee8c097cc14 | 874d2c14a5f1de1ff61ea22d51df58c9 | Find all input MIDI devices | {
const StringArray list (MidiInput::getDevices());
String midiDeviceName;
for (int i = (list.size()-1); i >= 0; i--){
if ( list[i] != "Midi Through: Midi Through Port-0" ){
midiDeviceName = list[i];
}
cout << "Available midi device " << i << ": " << list[i] << endl;
}
if(midiDe... | 1 |
50c785ad9e9ff0d346c9c4b64199190c | d31944b26c4798bb50d97d394460c313 | 获取博客阅读排行榜,评论排行榜及推荐排行榜信息 | class ArticleCtl
async hot(ctx) {
const hot = await Article.find({})
.sort({updateTime: 1});
const list = await store.get('') || hot;
ctx.body = global.suc(0, list.slice(0, 10), '获取博客排行成功');
} | 0 |
633bed949bf22eda130d0e46212ea7d0 | a8e911ff5411ae16070b39e9cc2e868a | Gets the broadcast address of the server | class NetBIOS:
# Creates a NetBIOS instance without specifying any default NetBIOS domain nameserver.
# All queries will be sent through the servport.
def get_broadcastaddr(self):
return self.__broadcastaddr | 1 |
4e42f1c7faec5ef86e8d41a9acba28aa | 03b6f660467a2ce984238ef9737dc4e4 | GET: LicenceType | {
$licences = new LicenceType();
if ($request->name != '') {
$licences = $licences->Where('lic_name','like','%'.$request->name.'%');
}
$count = $licences->get()->count();
$licences = $licences->orderBy('created_at','desc')->paginate(10);
return view('admi... | 1 |
f11d6a1e074df851787308a200deff35 | bed5762ff079f5c63734378ce8fbf6fc | 弦数変更時、各弦のチューニングの FormArray を更新する | const selectedTuningPresetTuning = this.detectTuningPresetTuning(tuningPresetKey);
if(!selectedTuningPresetTuning) {
return;
}
this.creatingScaleFormTuning.controls.forEach((control, controlIndex) => {
const index = (controlIndex < 6) ? controlIndex : controlIndex % 6 + 1;
control.setV... | 1 |
844122ca696425675ce9b36797ef07b6 | ed07f5dabb2b7de9e4e0d57a2fbb41b8 | Sets the hour of the day.
<p>
Accepts numbers from 0 to 23. If the range is exceeded, it will bubble up to the days. | class HourHand extends ClockHand
public void setHour(int h)
{
hour = ((h > 12) || (h < 1)) ? 12 : h;
update();
} | 0 |
5ffffdee3dd61a6fd5e8f151002b116b | a18fd8bef392d9ad694a46efe56518ab | Configure the female PA result | this.isAppropriate = function (a) {
return a.gender === 'female';
};
return this;
} | 0 |
d644bf18da109ac22768a01d5e73d8a6 | f65031e6c81d07b684b57b396fc8b7a7 | [GL2.1] glFogCoordPointer: define an array of fog coordinates | namespace CSharpGL
public static partial class OpenGL
[DllImport(Win32.opengl32, EntryPoint = "glFogiv", SetLastError = true)]
public static extern void Fogiv(uint pname, int[] parameters); | 0 |
8d3503ea5d1655612a1a7c1f4b52ade9 | b843656dea6c74372bbdd03757102f40 | This function inserts new job in the queue at the tail | {
int tempJID;
int tempJID2;
int tempCount=0;
int point=0;
long insertCount=0;
for(tempCount=0;tempCount<count;tempCount++){
if(jobs[queue[tempCount]].laxity > jobs[jobIndex].laxity)
{
tempJID = queue[tempCount];
insertCount = tempCount;
break;
}
}
if((tempCount == count) || (count == 0))
{
qu... | 0 |
a017337de374690f1838fad24066c363 | 4e3e8043996b31b22f48e0d175982cae | Format multiplication text
The order of the factors are randomized. | {
$code = (int)$code;
$rand = mt_rand(min(1, $code - 1), max(1, $code - 1));
$operation = mt_rand(0, count($this->operations) - 1);
switch($this->operations[$operation]) {
case '+': return ($code - $rand).' + '.$rand;
case '-': return ($code + $rand).' - '.$ra... | 0 |
d0e16f9c2cee3d4f66ddcaf581983101 | 6e3f0be36fe341a61f39a1cfd5e56a74 | Approximate count of unique values.
.. deprecated:: 0.18.12
This method has been renamed to :func:`DataFrame.approx_n_unique`. | class DataFrame(object):
def nunique(self, axis: str = 'rows', count_na: bool = False) -> 'DataFrame':
return self._stat_funcs('nunique', axis, count_na=count_na) | 0 |
7ae27201af68e0a021bb06203b88c613 | 6824c1c23ffe121d03dc472cc4b83362 | Getter que obtiene el total de capsulas | int result = 0;
result = getCablesAmount();
return result;
} | 0 |
2ecddc208f9a9c6aada331cdf490422e | 4b0001ab9354ec19dd7d4bebc74d1609 | Stops the stopwatch, logs the result, pops nested scope stack. | class ScaryStopwatch extends LitElement
stop() {
if (!this._running) {
return;
}
this._running = false;
const dif = Date.now() - this._lastTime
if (dif != 0) {
this._time += Date.now() - this._lastTime;
this._notify(this._time);
}
if (this._animationFrame) {
window.ca... | 0 |
ece5fb4c6574d57b9e183e13074737ec | 53b029d64260a6718c45577e3c693fd9 | NOTE: this should not be the logic governing a world-wide
quake. other objects may also need updating e.g. on the
server. rather, when your main game logic has determined
the amplitude and length of an earthquake, feed it to this
method to update this particular client. | class Game(object):
def notify(self, amount): | 1 |
d34de5a73da59459783245ab50cfc91c | 83b653910156c36f19c973bbb4087328 | 新增分期利息规则 | public String addRepayExtendPlan(Model model, String infoId,BigDecimal[] interest,Date[] endDate,BigDecimal[] principal){
List<RepayExtendPlanModel> plans = Lists.newArrayList();
for (int i = 1; i < endDate.length; i++) {
plans.add(new RepayExtendPlanModel(interest[i], endDate[i], principal[i], infoId, i));
}... | 1 |
44089b019e1eb70118d57c21b2856bc7 | 1f74bec54a460d1624030e6a43d66d15 | Learns a cross-validated classifier on the dataset
Ignore: | def cross_validation():
dataset = load_data()
row, col = dataset.shape
X = dataset[:, :col - 1]
Y = dataset[:, -1]
clf = SVC(kernel='rbf', C=1000)
clf.fit(X, Y)
scores = cs.cross_val_score(clf, X, Y, cv=5)
joblib.dump(clf, "train_model.m")
print("Accuracy: %0.2f (+- %0.2f)" % (scores... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.