query_id
string
corpus_id
string
query
string
code
string
label
int64
1dffbfa9ae7d8dd1ccda3b57bbdd5443
7b21ef6e3a8aa904e3f91f41cd09b944
Mutates dataset with 2 metre relative humidity based on present information on 2 metre dewpoint temperature and 2 metre temperature. - 't2m' in dataset.variables - 'd2m' in dataset.variables
def update_soil_temperatures(ds): dpeh = ds.PSEH - pr.physics.pressure(ds.PSEH, ds.hyai[-2], ds.hybi[-2]) dphm = ds.PS - pr.physics.pressure(ds.PS, ds.hyai[-2], ds.hybi[-2]) ds["TSLEH"] = ds.TSL ds["TSL"] = ds.T.isel(lev=-1) - ds.DTPB * dphm / dpeh zdts = ds.TSL - ds.TSLEH ds["TSN"] = ds.TSN + z...
0
a20ee4cb830b6f0540289c3a13aaa549
d110bc949b89dcf2549d8ca669db3b10
Testing that constructor's first argument can only be non empty strings
class TestSpace(unittest.TestCase): def test_string_constructor_exception(self): self.assertRaises(TypeError, lambda a: coords.Cartesian(a), 'some_string') self.assertRaises(TypeError, lambda a: coords.Cartesian(1, a), 'some_string') self.assertRaises(TypeError, lambda a: coords.Cartesian(1, -1,...
0
2649a00e900f16cafdb753495046c106
65f0805f130c6b5e0e4bef2bcacdbd62
Wait for a pid file to either be created or deleted.
def wait_pid(pid, timeout=None): def check_timeout(delay): if timeout is not None: if timer() >= stop_at: raise TimeoutExpired() time.sleep(delay) return min(delay * 2, 0.04) timer = getattr(time, 'monotonic', time.time) if timeout is not None: wai...
0
bf728281a08f8f2c013bb4bc56379e02
6e249eefdedb5e1a1be97f45e6be5cff
위도와 경도를 읽어와라. 위치 가져오는데 성공하면 succes로, 실패하면 error를 실행해라.
export function getLocation() success (res) { transformPoint(res.latitude, res.longitude) }
0
7dfbca9258fcc2f2ebf47dea98c13530
bc81f2d513b2d07a123d30cd301c9897
Hide unnecessary fields if dynamic search selected.
full_query = kwargs.pop('full', None) saved_search = kwargs.pop('saved_search', None) super(MachineSerializer, self).__init__(*args, **kwargs) if saved_search and not full_query: allowed = {'id', 'serial', 'console_user', 'hostname', 'last_checkin'} existing = set...
1
10c18650abc23bcfc36ddd22781441c0
dc9245161999924c5bb14e74de2ea815
Is param exists in GET or POST
$url = $this->getPath(); return strpos($url, '{' . $paramName . '}') !== false || strpos($url, '{' . $paramName . ':path}') !== false; }
0
87ebb82c937d6d09620f00c7dd1b32a2
882cfee4755212bdbf20fd9f5414c3b6
Getting customer threads identifiers.
class PwThreadsDigestIndexDao extends PwBaseDao public function getThreadsByCid($cid, $limit, $offset, $order) { list($field, $idx) = $this->_getOrderFieldAndIndex($order); $sql = $this->_bindSql('SELECT * FROM %s FORCE INDEX(%s) WHERE cid=? AND disabled=0 ORDER BY %s DESC %s', $this->getTable(), $i...
1
7dbd32b82343df64178afefa05648916
e602a1756b73093252bcf466f52742fa
A memory address will never be a literal
func checkAddr(addr uintptr) error { if addr&0x3 != 0 { return syserror.EINVAL } return nil }
0
2ad78f4f1453370c990d7dc69dae650d
471fb291ab859c730af24e85b0872615
generate suitable host file to do scaling test
for i in xrange(1, NUMBER+1): if i >= 100: PREFIX = "h" elif i >= 10: PREFIX = "h0" else: PREFIX = "h00" self.HostList.append(self.addHost(PREFIX + str(i), cpu=1.0/float(NUMBER)))
1
6e4b76873baf64f3b22c57929c25a563
e509fc245bf1a8c65623864cc6feeb2a
Muestra en tiempo real la vida del Player
class Player displayLife() { document.getElementById("life-player" + this.numero).textContent = "Life = " + this.life; }
1
c51fd683b3b4edf2d91274bc3b85430d
f79b67ee7b5fbcaac2c674d57c19306b
获取热门车辆列表
public IActionResult Huoquche() { var response = ResponseModelFactory.CreateInstance; using (_dbContext) { var query = _dbContext.Car.Where(x => x.IsDelete == 0).ToList(); response.SetData(query); return Ok(response); ...
0
923a479b8b79b090a5701f13794f53b7
837306403a3166bfcd0ad907be20f418
replaces the meta key in the contents with the corresponding meta key's HTML rendering.
if ( ! preg_match('~^(.*)\[contents([^\]]*)\](.*)$~s', $content, $m ) ) { return $content; } if ( $tags = trim( $m[2] ) ) { $tags = array_map('trim', explode(' ', $tags ) ); } $contents = $this->make_contents( $m[3], $tags ); return $m[1] . $contents . $m[3]; }
0
d85f0106416e2d35d2fa1d40eeba576a
74ef62a7a96d9179f8ac77a01253b7d5
Returns the latest release for a repo.
try: results = self.repo.releases() return results, None except (GitHubError, GitHubException) as err: return None, str(err)
0
cfba5894a1015b439edcba162c80fba2
3ca6b5a791dc352f324befeb8d82ec7a
Setter for <code>NBC_EPILEPSY.FIT_PERIOD</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.8.0" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class NbcEpilepsyHisRecord extends TableRecordImpl<NbcEpilepsyHisRecord> implements Record9<Long, Long, Long, Long,...
0
dec8d3c916373ab20ed065b0e5f2e521
f51f4afb02bc012fa326bdcb32b8e7ad
MethodName_StateUnderTest_ExpectedBehavior
namespace Microsoft.AzureIntegrationMigration.Runner.Tests public class StageRunnerStateFeature [Scenario] [Trait(TestConstants.TraitCategory, TestConstants.CategoryUnitTest)] public void GetStageRunnerWithSuccess(StageRunnerState state, IStageRunner parser, Exception e) { "Given...
1
c1c5c05c58c28f7ae1c7571b1d528a92
0075bd5b2602b674c1ad12093fad88a1
Tests if the mouse is inside a rectangle that's been rotated
{ Vector3 pos = RotateAngle(posoff, -rectAngle); return pos.x > -w && pos.z > 0 && pos.x < w && pos.z < h; }
1
46dccf76a7d215cdf7cb446c92731ad6
0d3e48bc2e26a16bb75c552bbd855a3a
STEP 1 // initialize values
void Initialize(void){ double cost1,sint1,cost2,sint2,cost2mt1,sint2mt1; m1 = 1; m2 = 1; l1 = 1; l2 = 1; m3 = 1; u=0; theta1 = 45; theta2 = 0; dtheta1[0] = 0; dtheta2[0] = 0; theta1 = theta1 * M_PI / 180; theta2 = theta2 * M_PI / 180; dtheta1[0] = dtheta1[0] * M_P...
1
8dfa0008228d788702aacdfe1fe06816
023acae22b1d3285bdb0bdb6ba9fa664
Controller for starting a workflow process.
class WorkflowInstanceEndpointsController(BaseController): def __init__(self, http_client = None): BaseController.__init__(self, http_client)
0
10e26c8b0613b3cc8bec97a006d9bccb
09bb55359a7122e64b2431f858c16ff7
Rewrite HTTP POST action. If the form is rendered embedded on the others pages we make sure the form is posted always through the same view, instead of making a HTTP POST request to the page where the form was rendered.
class InsertCreateView(PermissionRequiredMixin, generic.CreateView): def post(self, request, *args, **kwargs): if request.POST: if request.POST.get('submit_and_continue', False): self._redirect_to_self = True return super(InsertCreateView, self).post(request, *args, **kwargs)
1
a4362afc0caf69c93d3e77128281b75d
5c7debf847bbb320b5d9fa061722f68f
Writes current video values to xml
{ xml->setAttribute (T("gain"), outputGain); xml->setAttribute (T("mute"), mutedOutput); xml->setAttribute (T("bypass"), bypassOutput); xml->setAttribute (T("outMidiChan"), outputMidiChannel); MemoryBlock mb; getStateInformation (mb); XmlElement* chunk = new XmlElement (T("data")); chunk...
0
643d6d3bfa38abc557cfd0a01af24f0f
471e171b61d97cfb839c3fb7ff5cf1a9
获取重量监听者
public class MFWeigh public OnWeightChangeListener getOnWeightChangeListener() { return mOnWeightChangeListener; }
1
866dd7d7aaa7b0bf4c60093140911ac6
6f2db8a04162a6a2dc255b324c000349
Add a chart of accounts. Check permissions.
class ChartOfAccountController extends Controller public function create() { if (!Sentinel::hasAccess('capital.create')) { Flash::warning("Permission Denied"); return redirect('/'); } return view('chart_of_account.create', compact('')); }
1
110fe05a314b0b1d26590984379f6ee5
5f5a2fedd05db3ae23bde1332a9e6e7a
Initialize a saved working directory object
class StateIOClient(): def __init__(self): self._confirm_working_dirs()
0
964a5b0487b0b55b94e6f77e672f752f
9511a82a9a47d943fcce79c8c876fa1c
Return a dictionary opf output files to include in the summary.
def quip_out_dict(images=[]): d = {'OUTPUT_IMAGES': {'IMAGE_PATH': images}} d.update(_get_timestamp()) d.update(_get_quip_info()) return {'QUIP_OUT': d}
1
b4521a7c7b9e19d2af1bd6802ebe94ec
a28a492727bd71a50cfa66407f8841e1
Getter method for parent SHA-1 Hash IDs.
public class SolvedResult public int[] getParents() { return parents; }
0
3835af4df99a50de064e343e144837f8
3d29021ae882768274f573ec168db08e
currently retro power is hardcoded to 1
int get_revive_rete() { return 80; }
0
5b459597cf715d6d7ce43ff4f1299eb2
856a8561cffad63aced52c23f72ace23
Get page footer data (if any) for the specified page number of the report. This method is called once for each page of the report. Used for multiple page reports, the returned data (if any) will be given to smarty under the variable 'page_footer_data'.
public function getData(WidgetPageWidget $widgetPageWidget);
0
ddb704058344014f0960a4925ed3c68c
532c730a129a8ea72bbe59df5c86f82a
findCleanUpsAndPlugin()のCleanup対象プラグインを複数取得テスト
{ $result = getEnablePlugins(); $pluginNames = [ $result[0]['Plugin']['name'], $result[1]['Plugin']['name'] ]; $expect = ['BcBlog', 'BcFeed', 'BcMail']; $this->assertEquals($expect, $pluginNames, '利用可能なプラグインのリストを正しく取得できません'); }
0
b6615fc5090ea6001569b3d58543ecff
4116c1b539248446df111ddd84c45dce
Calculates the range of the pagination links.
class PaginationWidget extends AbstractBaseWidget private function getRange(): array { try { $aroundPages = floor(($this->pageRange - 1) / 2); $this->prevMin = $this->pagePointer - $aroundPages; $this->checkMinPage(); $this->nextMax = $this->pagePointer + $aro...
1
55946c47ffcf0ea089758fc54720b963
7ab626cf13755410e17cd360547830a9
Computes an unique key between to {@link EObject}s to store their similarity in cache. <p> <code>similarityKind</code> must be one of <ul> <li>{@link #NAME_SIMILARITY}</li> <li>{@link #TYPE_SIMILARITY}</li> <li>{@link #VALUE_SIMILARITY}</li> <li>{@link #RELATION_SIMILARITY}</li> </ul> </p> First of the two {@link EObje...
public Object getTypeKey(T object);
0
b8b23569af4acb1312eb31e482240f2f
61faed05f6b0adb0d4b0ad2e215c3e96
Outputs theme_mods or other php variables into javascript
function the_javascripts($echo = true) { if ($echo === false) { return get_instance()->theme->output_scripts(); } echo get_instance()->theme->output_scripts(); }
0
bc03956f8c832cf9116a9b35555b6f76
dc0b8e42a9f0ed8b83102f1fd105c298
Gets the user's work items
ProgressIndicator.show(display.asPanel()); String url = Constants.JOGET_WORKlIST_URL.replaceAll(Constants.V_LOGIN_AS, clientFactory.getUserId()); JsonpRequestBuilder rb = new JsonpRequestBuilder(); rb.requestObject(url, new AsyncCallback<JavaScriptObject>() { @Override public void onSuccess(JavaScriptObje...
1
4bfd59e3cbc070610e7add81982147c9
587e5158378e515ecfc47b35b07f4d24
获取上牌省列表
const url = `data/stateprovinces/show`; return this.apiService.get(url).map(response => { const result = response.result; return result.map(province => ({ key: province.key, code: province.code, text: province.text })); }); }
1
05bf79e03d09df23beba5aa96dcada1c
64d904c86196b30782a9a8f39718c889
Initializes velocities as i.i.d gaussians
func InitVelocity(N int, T0 float64, M float64) []r3.Vector { V := make([]r3.Vector, N) netP := r3.Vector{0, 0, 0} netE := 0.0 for n := 0; n < N; n++ { newP := (r3.Vector{rand.Float64() , rand.Float64(), rand.Float64()}).Sub(r3.Vector{0.5,0.5,0.5}) netP = netP.Add(newP) netE += newP.Norm2() V[n] = newP } ...
0
46e5f73993d299eaab070f1ec2c2052e
f6369dff3de94996ee23156128840c35
Sets the mailingAddress attribute value.
public class Address public void setMailAddress(String mailAddress) { this.mailAddress = mailAddress; }
0
71d71a7cc2346b6561ac842b27fb3212
3f5dc28ee1a838d1e4174ace7c30e109
When client starts, check if an anchor needs to be imported
{ if (rbAnchorText.Checked && (txtAnchorText.Text.Trim() == "")) { lblError.Text = GetString("dialogs.anchor.emptyanchor"); lblError.Visible = true; plnAnchorUpdate.Update(); return false; } return true; }
0
65cc9491cd6683cf53cc38dc7905bb79
d2c3ae572e286176d3bec8cfe6f002c3
Asserts that the DataBatcher returns the correct output 2 data after an epoch roll over.
hparams = copy.deepcopy(self._hparams) hparams.update({ "bucket_boundaries": [7], "bucket_batch_sizes": [6, 4]}) text_data = MonoTextData(hparams) iterator = DataIterator(text_data) hparams.update({ "bucket_boundaries": [7], "bucket...
1
651b5a798a9e9488404d50eba5a055ff
5bcee89a56aa8f7467e5cdbd70e94384
Get basic information on observed field. obs date, total integration time, fields (name, ra, dec), # of antennas, total bandwidth
class Isajet: def getobs(self,skiperrors=True): self.SLHAout.readdata() return self.SLHAout.getobs(SLHAdict)
0
134eb02c69cbcbf1691c64a1f77a4fcf
9a2a0c7cb4955cd7d81026a03881df04
加载左侧QListView的线路数据
{ if (_dtLineCodeAndName != null && _dtLineCodeAndName.Rows.Count > 0) { _dtLineCodeAndName.Rows.Clear(); } try { string cmdText= "select 自定义线路编号, 线路名 from 自定义线路代码表"; _dtLineCodeAndName = InnerFileOperato...
1
386b3da30e94fb4ad459e638f850fce5
b46a776e7b36c05943b423a78b80fd02
Get the number of running tasks
public class TaskQueue implements Runnable, Task.OnSystemFinishListen public static int getRunningTaskCount() { synchronized (TaskQueue.tasks_running) { return TaskQueue.tasks_running.size(); } }
1
10a6b98a249a4c9ed7fd254186067d05
cd2815e66a6060ddc96349c0413824dc
Destructure a qualified name.
let s = s.splitn(2, "::").last().unwrap(); for c in s.chars() { if c.is_ascii_uppercase() { out.push('_'); out.push(c.to_ascii_lowercase()); } else { out.push(c); } } }
1
c1bd1c3e508aa34ce0362fbf49671568
e459f7bdfe73ce910054c27e318c6f6c
通过 session id 获取 session 存在 redis 的 key 值
public class JedisShiroSessionRepositoryImpl extends JedisManager implements ShiroSessionRepository private String getRedisSessionKey(Serializable sessionId) { return this.REDIS_SHIRO_SESSION + sessionId; }
1
ba4ce6ee73e0ccb70d8e513021b1551c
5993cacfaffc72406353eb7b5385b733
Gets the liferay user id.
public class UserInfoRequest implements IRequest{ public void setLiferayUserId(String liferayUserId) { this.liferayUserId = liferayUserId; }
0
02305d02bec3b0168663ab6974967052
718a3daaad09b1780fb92d699c7a34c3
Generate an RSA keypair with an exponent of 65537 in PEM format
rng = Random.new().read key = RSA.generate(bits, rng) return (long_to_base64(key.e), long_to_base64(key.n), long_to_base64(key.d))
0
18f9b5729c87cbb2269c19313f096e3b
12aded4092f9571f549dae9f37ab73cf
X -> S
void cpu6280_op_119(struct cpu6280_context *context) { context->reg_s = context->reg_x; context->cycles_left -= 2; }
1
31779b9a25e9c4a35ea851800ee02d4d
c8f2ee6d94e3c3048c31bf3a9c4b1100
Set the value of fkdistributivocursoasignaturaid
class Asistenciaestudiantes public function setFkdistributivocursoasignaturaid($fkdistributivocursoasignaturaid) { $this->fkdistributivocursoasignaturaid = $fkdistributivocursoasignaturaid; return $this; }
1
d8f36a12c1d0f9bc566b6f5442dfb171
2153160f16a7b925b4a9867c6b4aa8c1
Проверка количества элементов массива кошек после выполнения метода инициализации
class UserDogModelTests(BaseTestCase): def test_user_dog_creation(self): self.create_user_dogs() self.assertEqual(UserDog.objects.count(), 4) self.assertEqual(UserDog.objects.get(id=1).user, self.user_1) self.assertEqual(UserDog.objects.get(id=1).status, 'u')
0
de0ee9db9fb785b8521fda89f93dc3fd
49347120a98d7329f3f09403e6c31532
回复动态消息
$userinfo = db('dynamic_table')->where('dynamic_id', $dynamic_id)->find(); $send_userid = $userinfo['user_id']; $map['message_type'] = 1; $map['message_dynamic_id'] = $dynamic_id; $map['message_sen_dynamic_userid'] = $send_userid; $map['message_dynamic_userid'] = $user_id; $map['addtime'] = time(); db('...
1
887894a24a96114225a42ba7221da468
9be16cc0dc9777e5927c81e810396d9d
Restores a specific package version for a user.
public Task RestoreForUser(string username, PackageType packageType, string packageName) { Ensure.ArgumentNotNullOrEmptyString(username, nameof(username)); Ensure.ArgumentNotNullOrEmptyString(packageName, nameof(packageName)); var route = ApiUrls.PackageRestoreUser(us...
1
f677d15e2e9a6f1437936cb4010069c9
48b0f04dd3f1b3595d3d879a0912d51b
make short term predictions until interrupted.
test() { const actions = []; for (const name in this.predictions) { actions.push({ name: name, loops: 100 }); } this.update(actions, null, true); }
0
9b1f03699ea23a4bda16dd6b66fe7f47
598c48d91b915c117a99db77393321d3
# Function to compute eCDF
CDF_Function <- function(x,mew,sigma) { CDF_value <- numeric(0) p <- (x-mew)/(sigma*sqrt(2)) CDF_value <-(1/2)*(1+Error_Function(p)) return(CDF_value) }
0
5e286d0abee9e00806e8cd49e75bab13
56adf96d727023e18af56f696de4f04c
Adjusts prediction of reward of the picked option.
i = _Replay.get() r, dr = self._repr, None with GetExecState(self) as state: options, ests, predictions = state for j,o in enumerate(reversed(options)): k = len(options) - j - 1 if i == k: inp = np.concatenate((r, ests[k...
1
247074b78dbc14e88c8c44e755d55d5a
cfb9db55d6854ba55d5613704f555ea5
Increment the reported spammers count.
class MySQL public function reportSpam($table_name, $item_id, $user_id, $user_type = 'fb_id') { $spam_reporter_table = $table_name.'_spam_reporter'; $id_list = $this->selectFromTable($spam_reporter_table, [[$table_name.'_id', $item_id], [$user_type, $user_id]]); if (count($id_list) > 0) { $items = $this->selec...
1
65c462b59bda3df51643776d01d37159
36dd4cd2d9340dbc87e92fa15c964a6f
アセットを取得する(同期版) ※呼び出し非推奨
if (isAsync) { StartCoroutine(LoadResAssetAsync(abName + "/" + assetName, callBack)); } else { callBack(LoadResAsset<T>(abName + "/" + assetName)); } }
1
64a14cddf0a4e201f384a8349ec17ffa
5f04ea2d247bacbdd9e051fdc3543b91
判断字符串是否为整数。整数的范围包括正负整数,无数值上限或下限。 待判断字符串
public class ApiVersionCondition implements RequestCondition<ApiVersionCondition> private boolean isInteger(String str) { Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); return pattern.matcher(str).matches(); }
1
048af5491b0635ed08df6ed525100f7f
06c41586782eccc78670c6eeaf79e799
Returns the length of time before commit logs should be deleted from the database.
function CombatLogGetRetentionTime() end
1
7bdc61dea6c3075009c12b48a747a792
4638b24ef30d266a27e3b72d9db4c23c
This function populates the the Table in corrective action reassign page
{ for (var i = 0; i <= vm.tableRecords.length; i++) { if (vm.tableRecords[i] != null) { if (vm.tableRecords[i].productlistId != null && vm.tableRecords[i].productlistId == vm.productListId) { vm.tableRecords[i].stockCount = vm.stockCoun...
0
643ea8f1678c49cedd69b160dd7fb3f7
b20613f71e72d99c36e330eafeeb078c
Formats date-time accordig to format string and the culture of the format provider. If format is null or empty the short date pattern is assumed
{ DateTimeFormatInfo dateFormat; if (provider == null) dateFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat; else { dateFormat = provider as DateTimeFormatInfo; if (dateFormat == null) ...
1
8915decc3af81534d626a081eed74451
6fffaab009452a0f29a94b1733e9f00d
Converts this period in weeks to a duration in milliweeks assuming a 7 day week, 24 hour day, 60 minute hour and 60 second minute. <p> This method allows you to convert from a period to a duration. However to achieve this it makes the assumption that all weeks are 7 days long, all days are 24 hours long, all hours are ...
class ReadableIntervalConverter extends AbstractConverter implements IntervalConverter, DurationConverter, PeriodConverter public long getDurationMillis(Object object) { return (((ReadableInterval) object)).toDurationMillis(); }
0
6a29da4ed45e1c1d19f810891731530f
f0fdcaa2e5cfef10cc485386e6e67d77
checks whether Player B played a valid card when the talon is closed
class BetaoriClosedHandParser(LogParser): def export_condition(self, player): open_melds = [x.tiles for x in player.melds if x.opened] if open_melds: return False return True
0
fb36e32008cb7edfef69c7ea531d11a3
154cab6a388fd427e638976a8d8edfac
将target的图片复制给original对象
function copyTheSameProperty(targetObject,originObject){ Object.keys(targetObject).forEach(key=>{targetObject[key]=originObject[key]}) }
0
de04bd8876341c4f2c6aaa0cea0d7607
cf409921492cbfee3c54f7e58662c96e
Select the top-k models to be part of the ensemble. A model can appear only once in the ensemble for this strategy. :meta private:
ensembleScores = [] for k in range(2, len(individualScores)+1): selectedModelIdx = np.argsort(individualScores[:,2])[-k:] estimators = individualScores[selectedModelIdx,:2] print("Best {}: {}".format(k, individualScores[:,0][selectedModelIdx])) model = VotingClassifier(estimators...
1
587216f1b37df89bca30688ce7c8be3c
45289b75e1edc78eca758e799565c2e6
<para>Writes commands and queries to the instrument to modify parameters and query</para> <para>device settings.</para> <para>Identifier = RSPWRMETER_FUNC_WRITE_TO_INSTRUMENT</para>
class YI2cPortProxy extends YFunctionProxy writeStr(codes) { this.liveFunc.writeStr(codes); return YAPI_SUCCESS; }
1
3bba19f123045c6153372df93a8ce3c2
aeafecd155e8767accbf7cc0af940460
Test a False is returned if the code doesn't have a matching Redis entry
class RedisBridgeTest extends \PHPUnit_Framework_TestCase public function testCheckingIfKeyExists() { $this->redis->expects($this->at(0))->method("get")->will($this->returnValue(false)); $this->redis->expects($this->at(1))->method("get")->will($this->returnValue("bar")); $this->assertFalse($...
1
af21149f8d4a30c9421ab07e4c3d4cdc
af4c809cb656279002ad2eb2c4a73e69
Validate that the value is float
{ if( !filter_var( $value, FILTER_VALIDATE_FLOAT ) ) throw new Exception( $this->formattedError( $field, "should be a float value" ) ); }
1
56d7d128d1432a4c39673a41b807c4ae
06e45859699486988437ae63043c166c
画像がアプリにドラッグドロップされたとき、画像を保存する
function drop_handler(ev) { ev.preventDefault(); var dt = ev.dataTransfer; var file; if (dt.items) { if (dt.items[0].kind == "file") { file = dt.items[0].getAsFile(); } } else { file = dt.files[i].getAsFile(); } drawImage(file); }
0
b8a6a734f0705039de40ad50b8e9cbe1
c671b073f8c68e914d8e2a484a5ba2be
Resultant ReturnType for the input conditional id
public function getReturnType(): string;
0
c9f40461955d5504925ac3de079a22e4
e94d17c3add4f27d231aa2862b559b7f
Turns filters for a given rypte into a set of query IDs. This can result in multiple queries due to the nature of the query processing on the server side. Since multiple values are treated as an OR condition, a query for {'id': ('1', '2')} is equivalent to a query for {'id': ('1',)} and {'id': ('2')}. This method split...
if self.ids: return {"ids": {"values": self.ids}} all_filters = filters.metadata(self.metadata) query_filters = [ query_filter for query_filter in [ filters.predicted_as(self.predicted_as), filters.predicted_by(self.predicted_by...
0
0bfa7675a53edc78584bdd849de70acb
ecb8ca2e8ee9aae1d08c282419d34fab
@Brief : 送信メールにPOSTデータをセットする関数
class HeFetchUrl function set_post_data($post_data) { foreach ($post_data as $name => $value) $this->postfields[$name] = $value; }
1
470ae5a557046c02ffa4e0329c4c58c5
1faa6bb09365edc77a169be11121a4f3
width and height can not be less than 1
Image::SharedImage::SharedImage (const PixelFormat format_, const int width_, const int height_) : format (format_), width (width_), height (height_) { jassert (format_ == RGB || format_ == ARGB || format_ == SingleChannel); jassert (width > 0 && height > 0); }
1
7d6b6a9f2fb969aef386159fba3eb3dc
83532b9b811e38dd7294b3099de524b1
Locator for options at top menu.
self.__o_icon_size_min = Option("icon_size_min", 24) self.__o_icon_size_max = Option("icon_size_max", 32) self.__o_effects = Option("effects", True) self.__o_separator_left = Option("separator_left", False) self.__o_separator_right = Option("separator_right", False) self....
0
d3281aea64e0d252f73ad96a8735e169
869ec0928dbdfd100623fdb421b3d4bf
# 版本提交方法
if($_POST) { if($_POST['version']) { $_POST['md5version'] = md5($_POST['version']); } D("Basic")->save($_POST); return show(1, '配置成功'); }else { return show(0, '没有提交的数据'); } }
1
7ca01b618db4084b67043f86ffaaa067
f5e5be3891b0977285ce049812fb3cb4
Returns the triangles of the Delaunay's triangulation
{ if(outputTriangles.Capacity < m_triangleSet.TriangleCount) { outputTriangles.Capacity = m_triangleSet.TriangleCount; } for (int i = 0; i < m_triangleSet.TriangleCount; ++i) { DelaunayTriangle triangle = m_triangleSet.G...
1
2a4c45f18755f62ae67fd77903dd5857
574e8191a6b06950f51d74799985373f
the Order to the view. The function requires a customer to be logged in. The Order must have been placed by the currently logged in customer.
{ bool isValid = db.Orders.Any(m => m.OrderId == id && m.UserName == User.Identity.Name); if (isValid) { return View(id); } else { return View("Error"); } }
1
13f66f9fbd9f1e8eed576e5849340970
ba6811fb71833efae2f3e9a993805e89
This function plots the validation curves of several networks, based on the results of validate_training(). It takes as input a list of validation folders (one for each network), each containing subfolders with dice scores for the corresponding validated epoch.
algo = self.algo_list path = self.config.path_result result = self.config.path_figures data = [self.config.dataset_name] files = os.listdir(str(path)) files_lwcase = [f.lower() for f in files] for d in data: df = pd.DataFrame() for a in alg...
0
7f2a521e4b4175bae8eab20d2f08b02e
9859aa044c4764136fdccf214c039d09
================================================================================================== checkArticle(Connection, long) : (자유게시판) 게시물 삭제전 딸린 글이 있는지 확인 ==================================================================================================
@Repository //DB와 접근하는 클래스이다! public class NotificationDao public String beforeInsertCheck(SqlSessionTemplate sqlSession, Notification nf) { return sqlSession.selectOne("notificationMapper.beforeInsertCheck",nf); }
0
eafc679cd7c6f829d8a562e8385d43ce
ce25ed94cb968234d81fb87c3d13d73e
# propensity score by lasso logistic regression
Ag_lasso_penal=function(X,Y,k_fold,group,lamda=NULL){ m=cv.grpreg(X=X,y=Y,nfolds=k_fold,group=group,penalty="grLasso",lambda=lamda) beta_Aglass=coef(m)[-1] w=c() for(k in 1:max(group)){ w[k]=1/norm(beta_Aglass[which(group==k)],'2') } if(length(which(w!=Inf))==0){ beta_Aglass=c(coef(m)[1] ,rep(0,dim(...
0
2aa3baed8fd3a6a2952dbfe67825264d
f75079f47902f81d6ba6403ffb05fb6d
附件上传提交页面.
@Controller @RequestMapping("admin/attach") public class AttachController extends BaseController @GetMapping(value = "") public String index(HttpServletRequest request, @RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "12") int limit) ...
0
56833d8f6a9e61c888c154da2fd6e502
f77348dab06c1bcaf9360bd03c151b79
decreases by 1 the actual representation degree
public final class LgInt implements Cmp<LgInt>, Displayable public void decrement() { addNb(minusOne()); }
1
10387d3c3cf30508f0c0c6b0685bcc39
25892acc0efbec841f64ad961bb3505d
Funcio que canvia l'estat dels camps a editables o no editables
{ this.txtCodigo.Enabled = a; this.txtDescripcion.Enabled = a; this.cboPar.Enabled = a; }
1
14e66c27ca7cede17e57d33b1a861255
f0377b49eb6d0556698090b96330106d
窗口滑动滤波
static void LPF(const unsigned char *in, unsigned char *out, const int w, const int h, const int wSize) { unsigned *iimg = new unsigned [(w+1)*(h+1)]; memset(iimg, 0, sizeof(unsigned)*(w+1)); for (int i = 0; i < h; ++i) { static const unsigned char *imgTmp = in; unsigned *cur = iimg + 1 + (w+1)*(i+1); unsigned...
1
ccb5ed529de016c6a25d386c91fdbc1d
c08d50339290ed2f87187525e47af997
Allows trader array indexing
function marketTraders (params, callback) function prepareData (data) { data.shift(); data.forEach(function(d){ if (accounts[d[4]]) { accounts[d[4]].sell.baseVolume += d[2]; accounts[d[4]].sell.counterVolume += d[3]; accounts[d[4]].sell.count++ accounts[d[4]].baseVolume...
0
edb7d755b15c8fa51a434dc4a5d93a5d
b58b46e317c882583c2217433b507443
Add a <see cref="CustomPieceTable"/> to the game.<br /> Checks if the custom piece table is valid and unique and adds it to the list of custom piece tables.
namespace Apptio.EditableTables.Interfaces void Add(string tableName, TableType tableType);
0
6495e7f637ced4209a54a1d1a601f10e
364698a09c910ff74cf92ec347f78d53
Return ``True`` if the passed type is a timedelta type.
class PythonTypeObjectFunctionPrototype(object): def DataTypeIsDatetime(self): return self.data_type in ( definitions.DATA_TYPE_FAT_DATE_TIME, definitions.DATA_TYPE_FILETIME, definitions.DATA_TYPE_FLOATINGTIME, definitions.DATA_TYPE_POSIX_TIME)
0
67cff563381e5999b4c694b8309d6e87
52db12696052926d9a1e8b8b515ff2f2
FUNCTION DESCRIPTION According to the control which pen long tap on, do the related action PARAMETERS pos [IN] The position of the pen long tap event RETURNS void
{ kal_trace(TRACE_GROUP_9, FUNC_JVM_PEN_UP_HDLR, jui_widget_mvm_is_in_menu()); if (lsk_pressed) { kal_trace(TRACE_GROUP_9, FUNC_JVM_PEN_UP_HDLR_LSK); if(jvm_keypad_event_notifier_cb_ptr) { lsk_pressed = KAL_FALSE; jvm_keypad_event_notifier_cb_ptr(KEY_LSK, KEY_EVENT_U...
0
a9ca731915cb953e3c163e585c1ab4ed
871be17de1c08a68e45d992cff70dd42
根据文件名,返回i节点序号
get_inode_idx(struct ext2_inode *parent_dir, const char *file) { load_blocks(parent_dir, curptr); struct ext2_dir_entry_2 *dir = (struct ext2_dir_entry_2*) curptr; unsigned int addr2 = (unsigned int) dir; while (dir->file_type != EXT2_FT_UNKNOWN) { #ifdef EXT2_DEBUG printf("i_node %x (%s)\n", dir->inode, dir->nam...
1
193024eb5a44cd29080a800f0298327b
794151c7329f30911db75a03a96cfe64
THIS FUNCTION INTERPRETS THE XML FILE AND CREATES THE REQUIRED OBJECTS ACCORDINGLY
t0 = time.clock() neuron = NEURON() morphology = MORPHOLOGY() print( '\nReading ' + filename + '...' ) xml_root = ET.parse( filename ).getroot() namespace = '{%s}' % xml_root.tag[1:].split("}")[0] print( str(namespace) ) Contours_Handle( xml_root, namespace, neuron, morphology ) ...
1
71da69eafa0d70022498fcc92992248d
a1e21090ac515b5ff7001dedd631f259
Updates that the player has bought a given upgrade.
void Game::payAnUpgrade() { updateMoney(-upgradePrice); }
0
5a7dd6b4f8a7ed5da9cbdf7e21778986
a52db46a54cc3227af3bc1819efafc34
Increase the minutes and kcal for Booty Barre.
minutesTot = minutesTot + 45; kcalTot = kcalTot + 300; displayMinutes(minutesTot); displayKcal(kcalTot); }
1
d554646f139776a1fc446cbd4e4ef701
caba303462e23ccb620a57bb31de6eed
Check if the request header is a bypass header.
public class DataApiRequestTypeIdentifier public static boolean isBypass(final MultivaluedMap<String, String> headers) { return BYPASS_HEADER_VALUE.equals(headers.getFirst(BYPASS_HEADER_NAME)); }
1
42e10c5bd62ed1a33e3bdf39b3486bf7
4f0026bf4d50d97ca73e1be4b42cd622
Inputs : Pointer to the SMIF global context Pointer to the msg of API received by SMIF Outputs : None Returns : None Description : This is the handler function for RACH OPT SMIF_INIT_IND msg
son_mif_oam_init_cnf_handler ( son_mif_gb_context_t *p_smif_gb_context, void *p_msg ) { SON_UT_TRACE_ENTER(); if (SON_PNULL != p_smif_gb_context->oam_init_ind_timer) { son_stop_timer(p_smif_gb_context->oam_init_ind_timer); p_smif_gb_context->oam_init_ind_timer = ...
1
b5feb8b610453b3c5e4bcabffc06782d
f362e3c6750992bf388e06e91f0fbe54
手动显示地图到某一个大像素坐标
require([ "esri/map", "esri/geometry/Point" ], function (Map, Point) { map.centerAndZoom(new Point(parseFloat(lon), parseFloat(lat)), parseFloat(level)); }) }
0
591e5521eaa9911d7c2e2137a22db44b
3b96ce2e08f404ec1db96a841190db9b
On définit les paramètres du menu du Dashboard d'Easy Admin
{ $builder ->add('name', TextType::class, array('label' => false, 'attr' => array('class'=>'form-control', 'placeholder'=> 'Nom du menu'))) ->add('color', TextType::class, array('label' => false, 'attr' => array('class'=>'form-control', 'placeholder'=> 'Code couleur'))) -...
1
67344e73ee54ca120ea9919d054d6682
4be3f4d2cc0bc482392cba9dc20d2035
マウス左ボタンのドラッグ中に呼ばれる
public class mouseAction : MonoBehaviour void OnMouseDrag(){ print ("drag"); }
1
e83c2f4f1ab0e43d06a87b28e731e812
5f491b1e8afc839ee7d80ad9ed0237a1
Utility to get a matching artifact for a given set of properties.
class ExtantArtifact(AbstractArtifact): def __init__(self, getter, logger=None, name=None): super(ExtantArtifact, self).__init__(logger=logger, name=name) self.getter = getter
0
2b3fb087f50bfecec73a055ccd6e494e
e23c5e0a927fd823cd7251703ef27caa
saber si es un numero lo que me manda
function Flotante(numero) { if(Number.isInteger(numero/1)) { var t; t=1; return (t); } else { t=0; return (t); } }
0
86d20ac0e0fa556b9ab05224859a0ddb
d0279f0bb200f9cf1c4263f5516925bd
用户扣除积分并添加课程
class UserRepository extends BaseRepository protected function pointsSubtraction($user_id, $cost) { try { $status = DB::update("UPDATE users SET point_pay_current=point_pay_current-{$cost} WHERE user_id={$user_id} AND point_pay_current >= {$cost}"); if ($status) { ret...
0
b90b2e9b8e353cd6df60cb1329c682cb
f6d082278930503a0543ec1a15691d90
Returns html code for url preview edit form
{ $html = $this->form([ 'action' => '/preview']); $html .= $this->input('is_preview'); $html .= $this->inputGroup('name', 'Name'); $html .= $this->inputGroup('number', 'Number'); $html .= $this->input('submit'); $html .= $this->helper->tag('/form'); return $ht...
1
db449ad9043f9b5f1f9b2a05f59c71d0
83410f4f5f0c599bfe3e585d0bc2dc48
Create a server pool Creates a pool for a particular service and version.
class Base_pool(Basejob): def create_pool(self,server_type): Cloud_client_browser = self.driver self.admin_cloud_login(username='admin') time.sleep(TestSpeedControl.TEST_STEP_INTERVAL) self.menu_pool() self.pool_UIMap = Pool_UIMap(Cloud_client_browser) ...
1
9f983e92008df58df75779cf1b509fe7
0128f4c7ffafb7c3927dddeb15065cb2
agrees with compute_Zbar
def get_Zbar(ions: list[tuple[int, int]], ionpopdict: dict[tuple[int, int], float]) -> float: Zbar = 0.0 nntot = get_nntot(ions, ionpopdict) for Z, ionstage in ions: nnion = ionpopdict[(Z, ionstage)] Zbar += Z * nnion / nntot return Zbar
1