query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
c660e7d681bc80cc1521f5938ceec4c8 | 4e7242371026c16b5e00a32d139b757f | Elimina un Nodo del grafo por su ID | public void borrar(EntityManager em, Nodos nodos); | 0 |
21b0626dbc338afd44975cc7fad910a2 | a1871dec3e1b0cac72f8e94962327e67 | Método para remover veiculo na posição dada | try {
interfaceVeiculo.removerVeiculo(veiculoSelecionado);
label01.setText("Veículo deletado.");
} catch (Exception e) {
label01.setText("Veículo não existe.");
} finally {
this.initialize(null, null);
}
} | 0 |
170827887ab6e06830708aa144416fd4 | 84f7051cc2f96c3738010b65302db11c | Scheme function calls into this function when it is done.
We store results and longjmp back to where we started, at the
bottom of the trampoline (we only jump once). | static uae_u32 REGPARAM2 m68k_call_handler (TrapContext *dummy_ctx)
{
TrapContext *context = current_context;
uae_u32 sp;
sp = m68k_areg (®s, 7);
sp -= sizeof (void *);
put_pointer (sp, context);
sp -= 4;
put_long (sp, m68k_return_trapaddr);
m68k_areg (®s, 7) = sp;
m68k_setpc (context->call68k_f... | 0 |
d6d825db43421fae3db6f0def6a93ddb | e1f22c4c8556f3f4ceb3c725c71c33e7 | Deliver the last video buffer and get a new one to start writing to. | struct v4l2_buffer buf;
memset(&buf, 0, sizeof buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
if (xioctl(camera->fd, VIDIOC_DQBUF, &buf) == -1)
return FALSE;
memcpy(camera->head.start, camera->buffers[buf.index].start, buf.bytesused);
camera->head.length = buf.bytesused;... | 1 |
0483d4cfb18fb7c09846929c0aad6c8d | c2d06e6874046a716948d52a5b6abc6d | Synchronously writes a redirect header instructing the remote user's browser to load the URL you specify. Call this one time and do not write any other data to the response stream. | namespace OwinFramework.Pages.Restful.Interfaces
Task Redirect(IOwinContext context, Uri url, HttpStatusCode statusCode = HttpStatusCode.Found); | 0 |
31f8f075991a6ecce572b1a155581770 | 7de91605a35cd7f7af2211cd83029cd6 | обновити лічильник завантаженних даних | function update_count(count,ticket){
$.getJSON("updatecount.php",{count:count,file:ticket},function(data){
$("body").find("#count_"+ data.id).empty().text(data.count).fadeIn('slow');
$("input[name=start]").val(Number(data.count) + Number(1));
});
} | 1 |
61f640caf57dfc60a54e2a0f8c4a6fe5 | 60c93e83012050c7b87cbcf293d5351b | Tests playing quiz fails | class TriviaTestCase(unittest.TestCase):
def test_unprocessable_play_quiz(self):
new_quiz = {
'previous_questions': []
}
res = self.client().post('/quizzes', json=new_quiz)
data = json.loads(res.data)
self.assertEqual(res.status_code, 422)
self.assertEqual(dat... | 1 |
572bd5941b87c99bed408434acf51268 | 4943769ef8895bbee9623ae7a4d021cb | Reload all read node by reload button. | class FeedsManager(QDialog, Ui_FeedsManager):
def on_reloadButton_clicked(self):
itm = self.feedsTree.selectedItems()[0]
self.__reloadFeed(itm) | 0 |
bdb6c1f441b8fec85c9d7a3fa1369020 | dd57d3a82e64a088084e5012131a9ad1 | 生成行政工资介绍信编号,返回,并记录到数据库中。 | public Integer initCpaSalaryInfo(CpaSalaryInfo cpaSalaryInfo); | 0 |
7338758dfde7dca029a657e451cdba78 | da803e13df54eb8a43a104083d027a51 | Create a regex for matching all illegal characters within the
XML 1.1 spec so that we can filter them out. | class PDF2text_helper:
def invalid_xml_remove(self, c):
illegal_unichrs = [(0x00, 0x08), (0x0B, 0x1F), (0x7F, 0x84), (0x86, 0x9F),
(0xD800, 0xDFFF), (0xFDD0, 0xFDDF), (0xFFFE, 0xFFFF),
(0x1FFFE, 0x1FFFF), (0x2FFFE, 0x2FFFF), (0x3FFFE, 0x3FFFF),
... | 1 |
3e5b361dc388b835d4c271be890bf3f8 | 20ea1884cfb7fc2c4d77111c86644cfd | Gets the value at index 3. | public class Matrix33
public double get33() { return a[8]; } | 0 |
ef42dda03dcbe1e9d5cc64cd845072f8 | 17a76a320c9fb4550abfa473d283c4d8 | Testing that undefining all beans with a singleton previously created
still works | final ContextLifecycle lifecycle = getServices(ContextLifecycle.class);
lifecycle.endRequest("UnitTest", new HashMapBeanStore());
lifecycle.endSession("UnitTest", new ConcurrentHashMapBeanStore());
final AbstractApplicationContext singletonContext =
lifecycle.getSingletonCont... | 1 |
7ef11d4627966ea33c9825c0c935de75 | 778c8c631860e5dac26de790ca23c82e | 字符串转化为BigDecimal类型,为空则返回默认值
BigDecimal | if (isNullOrEmpty(str, true)) {
return nullDefaultValue;
}
return new BigDecimal(str);
} | 1 |
517c5e32ebf97418f8efc47be01c9e74 | 0f5268631ce8a26cad1c100191699876 | Resets the list of nations. | {
GameObject[] WorldMapCountries = GameObject.FindGameObjectsWithTag("CountryColliderBody");
SelectedCountriesNumber.text = "0";
foreach (GameObject WorldMapCountry in WorldMapCountries)
{
WorldMapCountry.transform.GetChild(0).localScale = new Vector3(0, 1, 1);
... | 1 |
e6361f9d9f4197deb76380de23c44409 | e92ea676330dcf026fbc62b78101d1a4 | Genere le code html pour le bouton de Deconnexion sur la navbar | $_target_url = interprete_argument_balise(1,$p);
if (!$_target_url AND $_target_url!="''"){
$_target_url = "";
}
else
$_target_url = "\''.addslashes($_target_url).'\'";
$p->code = "'<!--magiclogin--><' . '"."?php echo magiclogin_logout_link($_target_url); ?'.'>'";
$p->interdire_scripts = false;
return $p;
} | 1 |
fe698b7836700b850af358616dfe277f | f5e6f4d7e8a53133d205e355c6ebc668 | 左向打印 | class ThreeCube():
def l(self):
self.left_turn()
self.print_cube() | 0 |
229644983e7546f08a3c9e8305014298 | 13320a783c7f3c75efa375d94aeea85b | we do not create courses here intentionally because it requires full sync and is slow | class ModuleStoreWrite(ModuleStoreRead, ModuleStoreAssetWriteInterface, metaclass=ABCMeta):
def create_course(self, org, course, run, user_id, fields=None, **kwargs):
pass | 1 |
c4d416f8bf8670bf3c8ba959e23b18bf | 502afbd65a083527b966aeac44f27144 | update each icon's text with the new value | export class GoodsIcon extends ui.Components.GoodsIconUI
public updateTxtContent(value: string) {
this._txtContent.changeText(value);
} | 1 |
3ca8728a639bb510b6a1f19404040fc6 | d6f485db69f706f51e59c82c81aa2853 | Bulk Delete SLO Timeframes. | slo_path = SSM.build_slo_id(window, slo_config, full=True)
LOGGER.info(f'Deleting SLO "{slo_path}"')
try:
return self.client.delete_service_level_objective(slo_path)
except google.api_core.exceptions.NotFound:
LOGGER.warning(
f'SLO "{slo_path}" doe... | 0 |
7eb6b201e656b108b5a2840ea37437fe | 87a017285b58f487ff3e780ccb448a26 | Method that removes all currently added foreign keys. | {
foreach (var relationship in modelBuilder.Model.GetEntityTypes().SelectMany(x=>x.GetForeignKeys()))
{
relationship.DeleteBehavior = DeleteBehavior.Restrict;
}
return modelBuilder;
} | 0 |
a71674a63b6d19f6dd7ecb5157f9db5b | 12b38811ac32daf51b1415365d97e39c | 根据分类、产品状态、(产品名称、产品简称、产品编号)查询产品列表信息 | public Map<String, Object> listProductByState(Integer id, String state) {
Map<String, Object> map = new HashMap<String, Object>();
if (id == null) {
map.put("rows", saleListService.listProductByState(state));
} else {
map.put("rows", saleListService.listProductByState... | 0 |
7ca4d2c0dc8cb50dbfcdbdf825163889 | b92fcc3bdfded110fb3bdefd63eedb0e | States cards a player has used to try to claim a route | public final class Info
public String claimedRoute(Route route, SortedBag<Card> cards) {
return String.format(CLAIMED_ROUTE,
playerName,
nameOf(route),
descriptionOf(cards));
} | 1 |
33007408f515695900d95b8900ba611d | b14e003e36731c36857ff742e32def47 | Simple Fourier reconstruction | def simple_reconstruction(dataset, **kwargs):
if dataset.encoded_dim == 1:
axes = (0,)
elif dataset.encoded_dim == 2:
axes = (0,1)
elif dataset.encoded_dim == 3:
axes = (0,1,2)
data = np.fft.fftshift(np.fft.ifft2(dataset.data, axes=axes),
... | 1 |
36c90eef53aeaf93affebbb0a20a10db | a78b7fe0ea4b8ce90c4b62378434cbe7 | @brief 获取外部sd卡的路径,如果存在就返回,如果不存在就返回空的。 | public class FileTool
public static String getExternalStoragePath() {
boolean exist = isSdCardExist();
String sdpath = "";
if (exist) {
sdpath = Environment.getExternalStorageDirectory()
.getAbsolutePath();
} else {
sdpath = "error";
}
... | 0 |
3b32b089fe667c5f80295b964c4e4194 | e5d5a4599d17b0b8e687de8ffc284154 | Get the current observation.
The a scalar value representing the distance to the redlight. | class Buggy(WBits):
def get_distance(self):
command = 'buggy{}.get_distance()'.format(self.index)
value = self._get_command(command)
return self.val_process(value) | 1 |
ef1f25441b017c1aa3346abcdf7b3097 | cc0ce1f4e49fbe872f6e047ad1bb62bb | 그리드 폭 조절 | {
if (winGridView1.gridView1.Columns.Count > 0 && winGridView1.gridView1.RowCount > 0)
{
winGridView1.gridView1.SetGridColumWidth("Text", 150);
winGridView1.gridView1.SetGridColumWidth("Value", 280);
}
} | 1 |
2f2b37f4ec67eea52c68a9bd8d8770e5 | 116c851faef18cffa08183adc4d4f560 | Convert a mac address to a format that can be used in Kumbang
models.
Replaces the colons in a mac address with underscores. | {
std::string macAddress = macAddrString;
std::replace(macAddress.begin(), macAddress.end(), '-', ':');
return macAddress;
} | 0 |
503a1c21166107b4a539646b03e77650 | 7c768b958103c3e78e15895f2509c06b | 指定の親以下にプロジェクト情報があるか確認する | const obj = this.get(rootId);
const isParent = obj.parentId === parentId
if (!isParent && obj.parent.is('project') === false) return this.hasParent(obj.parentId, parentId);
return isParent;
} | 1 |
4e08d8e70c15bb7d0f63fac57bd47cb6 | 3c9f33efc98e431ea2f2a11227d6d3a0 | 查找该优惠券未使用的code码,随机返回一个 | @Service
public class MultimallCouponService
public String generateCode() {
String code = getRandomNum(8);
while (findByCode(code) != null) {
code = getRandomNum(8);
}
return code;
} | 0 |
7691c7012865eacdcf9c86ed3a09e331 | 93fa22cbf15bd0192fcb3a1bc5626ee6 | Handles GitHub webhook income request. | event: APIGatewayProxyEventV2,
context: Context,
): Promise<APIGatewayProxyResultV2> {
const ip = event.requestContext.http.sourceIp;
if (!isGitHubHooksIP(ip)) {
return respondJSON({
statusCode: 400,
body: JSON.stringify({
success: false,
error: "request does not come from GitHub... | 1 |
f4b90c0af60e5fd39b799743f855cec7 | 5e5c50156fe02b098100ba4962a0f066 | Called when the player has pressed back after pressing the attack button | public class PlayerControls : ByTheTale.StateMachine.MachineBehaviour
public void OnAttackAnimationFinished()
{
if (IsCurrentState<PlayerControlsAttackRecovery>())
{
ChangeState<PlayerControlsFree>();
}
} | 0 |
1a8a5fa008787d8995a0067726dd1055 | 712d0f60d9918a5d1ac007daff5131a4 | 获得所有顶级分类的主键id | List<Integer> listMainProjectTypeId(); | 1 |
0055d1fd8d992712284c4a00c4643e79 | 7a1953f4b806662383b03bcf5689ea8c | Download a file with Options. | function downloadFile($url, $option, $savedir, $auto_hash = true, $hash_id = 0, $filename = NULL); | 1 |
bf60d4c6dc10875c2b8096f1b340bd1f | 332b9a05ce9591b4a5d1adbcf79e5588 | Check whether customer ID is local created customer ID. | @Deprecated
boolean isCustomerIdExist(Long domainId); | 0 |
4aa0a0452577183e1203b37047d33be0 | a88d3745b93d01e181e6d62abbdb84ca | Provides a CPython extension build via CMake. | def build():
with open(os.path.join(directory, 'build', 'extensions.json'), 'w') as f:
f.write(do_build()) | 0 |
b2511e9499a7b5149f8042ee26b8383a | 9d3b2375e25eecaf09728bfb88107db6 | 初始化浮动处理对话框 | {
Vector2 pos = new Vector2(float.Parse(opt[1]), float.Parse(opt[2]));
FloatDialog.instance.SpawnFloatDialog(opt[0], pos);
yield return null;
} | 1 |
2ccdbef7dbb2751111454f37a6f2e375 | 0ddf93ee9484e1048342decacc077f2d | 给多项式按 升幂排序 并且合并同类项 | PNode *p1 = Pa->next;
PNode *p2 = Pb->next;
PNode *p3 = Pa;
while (p1 && p2) {
if (p1->expn == p2->expn) {
int sum = p1->coef + p2->coef;
if (sum != 0) {
p1->coef = sum;
p3->next = p1;
p3 = p1;
p1 = p1->n... | 1 |
abf24bbaa6d50bb39ff20c9ffe40f211 | 1e7f31cb8896a5b491ab22a634f71df9 | 获取某一篇文章的所有作者,返所有的作者,等待补全信息 | def get_author(main):
author = []
for i in range(0, len(main)):
author1 = re.findall(r'<div class="pub">\n \n \n (.*?) /.*?</div>', main[i], re.S)
author.append(author1[0])
return author | 1 |
dc329032f724a9c812bf422d0dc893a1 | dc82b455554e33bf038b2c99fe396eec | LCD12864初始化 | {
LCD_PWR_EN_1();
bsp_DelayUS(10 * 1000);
LCD_RESET_0();
bsp_DelayUS(20);
LCD_RESET_1();
bsp_DelayUS(10 * 1000);
Lcd_WriteIndex(0x36);
Lcd_WriteData(0x00);
Lcd_WriteIndex(0x3A);
Lcd_WriteData(0x05);
... | 1 |
e13b9aa52d70ae47d721d13e5e57b748 | 682431fe20b8648b08e50b5e7364f458 | Returns a slice of the MAC address | {
String macAddr;
for (int i = 12; i < 17; i++)
{
if (fullMacAddr[i] == ':')
;
else
macAddr += fullMacAddr[i];
}
return macAddr;
} | 1 |
acf8ea84c4a9ad92479ef7c5f5379ad3 | 00d55483a7915c252a2435023db39929 | !
\ingroup mptSolver
\brief IVP data output
History and graphic output for ODE data. | void VeloSimTell1Algorithm::outputData(LHCb::VeloTELL1Data* inData)
{
if(m_isDebug) debug()<< " ==> inputData() " <<endmsg;
m_outputData->insert(inData);
} | 0 |
c7374cb46b1e9a33485bb983f72e32a5 | c96082ba184cd501ca6d339f37a3ac68 | Country Selection Function | def countrySelector(countries):
val = 'go'
selection = []
print('Please select the countries you wish to graph. type "all" to select all. type "next" when done.')
print('The list of countries is as follows: ', countries)
while val != 'next':
val = input("Enter a country (or next): ")
... | 1 |
11d754bdcffb4694bc47fdc2bdc8646d | 436a9d7c9f0e68d7553cfaf26248f772 | Returns the rgb spectrum from HSV | h_i = int(h*6)
f = h*6 - h_i
p = v * (1 - s)
q = v * (1 - f*s)
t = v * (1 - (1 - f) * s)
if h_i == 0:
r, g, b = v, t, p
elif h_i == 1:
r, g, b = q, v, p
elif h_i == 2:
r, g, b = p, v, t
elif h_i == 3:
r, g, b = p, q, v
elif h_i == 4:
r, g, ... | 1 |
f649b88c11ce6dafad9ba27bf8603cc3 | 41853df015052b768acb0f74b856405d | Gets the number of buffers filled with data. For test purposes only. | namespace LineGraph.DataReceiver
public class RingBufferManager
public int GetDataCount()
{
return DataCount;
} | 1 |
eb3e7551b462863f280800051c9da859 | 48e555957d12fc3829b7889a61524637 | Custom loop for masonry grid. | function vcm_mental_blog_loop( $offset = 0, $atts ) {
$atts = shortcode_atts( array(
'category' => '',
'type' => get_mental_option( 'blog_type' ),
'items_per_page' => get_mental_option( 'blog_items_per_page' ),
'show_read' => 'yes',
'show_excerpt' => 'yes',
'show_author' =... | 1 |
632cb66158d8fb05003a2e8232b32523 | 2d3becf8468e7a870f10f66fac8ba118 | Returns the execution listeners for the flow execution of this request context. | public class ProxyConfig
public CompositeProxyExecutionListener getListeners() {
return this.listeners;
} | 1 |
fb8f1580b799f4cd68ec1e118fea7c23 | b7211d712b037fbcd708656c28344067 | 获取时间当天的结束时间 | public class DateUtil
public static Date getDayEndTime(Date date){
return getDateAnyTime(date, "23:59:59");
} | 1 |
777af317aa64a3c2e2a019941aa22091 | 584df6b0859712c8110b096217fcd56d | 统计边的数量 | def count_edge_nodes(edges, numNodes):
dictionary = defaultdict(int)
for num1, num2 in edges:
dictionary[num1] += 1
dictionary[num2] += 1
return dictionary | 0 |
804f3a90410e15ff38eb6fd0db3cde7a | 40d958ed9758fe7ce6977277f8d9adb7 | Load the highscores either from the application data
or call for a download of the scores | {
_highScores.Clear();
if (File.Exists(HIGHSCOREFILE))
{
try
{
FileStream fs = new FileStream(HIGHSCOREFILE, FileMode.Open, FileAccess.Read);
BinaryFormatter bf = new BinaryFormatter();
... | 0 |
a8b99da0f755e55a0af2e8ca5ebc7e00 | df488b780b7d781b1a5802e63f9751f8 | Sub classes must return a bit mask that indicates which events are being
sunk. | unsigned IOHIDConsumer::eventFlags()
{
unsigned flags = 0;
flags = (_keyboardNub) ? _keyboardNub->eventFlags() : _otherEventFlags;
return( flags );
} | 1 |
1ba9fe2698e63226165480a92f0c3b58 | 17f971e97ae9681d3f47ad72806ca3e0 | Copy the data before changing the colours | void VCL_DoCube_X_Color::cp_Copy_Data(VCL_DoCube_X_Color &in_docube)
{
CKvSet2d_of_XvectorShort depth_data_w_bp;
CKvSet2d_of_XvectorInt point_to_rl;
depth_data_w_bp = in_docube.e_Export_Xvectors_Boundary_Point();
this->zz_depth_data_w_bp.cp_Copy(&depth_data_w_bp);
point_to_rl = in_docube.grlv_Get_RL_to_Voxel_Index... | 1 |
ed0677e48394595b3f70c09a7d11a4f0 | 2af66a21c48374542c94d76a8265adfd | Place unevenly spaced 2D data on a grid by 2D binning (nearest
neighbor interpolation). | def do_2D_binning(data_x, data_y, data_to_bin, bins_y, bins_x):
bins = np.array((bins_x, bins_y))
print(bins)
for array in [data_x, data_y, data_to_bin, bins]:
print(array.shape)
print(type(array))
mean_binned, xedges, yedges, binnumber = scipy.stats.binned_statistic_2d(data_x, data_y, d... | 0 |
dd247ba2df7d385a3c8bd73c5b236993 | e80502ae7c3dae7ac6b9db5b37843659 | Modify the Special:AncientPages query to ignore soft redirect pages | class AutoRedirect
static function PrefixSearchBackend ($namespaces, $search, $limit, &$results) {
global $wgAutoRedirectNamespaces;
if ($namespaces[0] == NS_MAIN) {
$namespaces = $wgAutoRedirectNamespaces[''];
array_unshift($namespaces, NS_MAIN);
}
$srchres = arr... | 0 |
5ecf2b87f260421cc1193bad90ba8671 | 0db074f3ec98bf5432f025b071317445 | Get a list of all evidence (including undetermined). | $sql = "SELECT evid.*,
res.*,
evid.id AS id,
evid.timemodified,
evid.timecreated,
res.id AS resource_id,
resty.name AS resource_type
FROM {block_assmgr_eviden... | 0 |
b29ba82c0c28ef55626fc1c4893659c9 | fca8ec6a1704712b44431b60dfae64db | rather than .push.. | def add_to_array(arr, str)
new_array = arr << str
p new_array
end | 1 |
1c4d5eea26bce409e86afb24293e9acb | 59b5d8228756adcd9396519867124478 | omap_fan5355_vsel_to_vdc - convert FAN535503 VSEL value to microvolts DC
Returns the microvolts DC that the FAN535503 Regulator should generate when
programmed with @vsel. | uint16_t mv;
if(setting > 0x7F)
return INVALID_VBUCK_VOL;
if(setting <= 0x50)
mv = (setting * 125)/10 + 600;
else
mv = (setting - 0x50)*50 + 1600;
return mv;
} | 1 |
facb29b11e2c64a29f9c04b20b6b3f9b | e773df7cce0c81a0914519a3c112ddd2 | Make a string by stopping at the first NUL | function nullstr()
local t={}
local d=coroutine.yield()
while d~="\0" do
table.insert(t,d)
d=coroutine.yield()
end
return table.concat(t)
end | 1 |
6e2a197e0a9fd6464cb713a1c41671ae | 8820baf74447a966008184da122f22cd | HOTFIX : Make sure the multi-method methods have the same output type as generic one | public static class HandleTests
[Fact]
public static void GenericMethodRuntimeMethodHandleTest()
{
MethodInfo mi1 = typeof(Base).GetMethod(nameof(Base.GenericMethod));
MethodInfo mi2 = (MethodInfo)MethodBase.GetMethodFromHandle(mi1.MethodHandle);
Assert.Equal(mi1, mi2);
} | 0 |
6559c7ae0a8777e9941e464c8b9072b4 | 4a1f056d95b92cd1f7b6340a9df2e96d | 为教练则不跳转 | if (this.teacherLast <= 0 || this.loadingData || this.$route.name !== 'adjustTime') {
return false;
}
this.getTeachers();
} | 0 |
80ea6dbcffcdb055553fbda2450845ee | 44f24628df6bcbaffd0325bd9c242942 | <p>The time period in days, that tells how often this inventory entry is restocked.</p> | public class StockItem implements Serializable
public Long getRestockThreshold() {
return restockThreshold;
} | 0 |
f7cc4c1cbf7e1e7bbe007a30b28c7833 | ad68a511833b8fa9390639ce53535f55 | Callback method to handle any exceptions raised by the test connection. | class TestClient(testtools.TestCase):
def test_connection_refused(self):
def cb(request, context):
raise requests.exceptions.ConnectionError() | 1 |
8f9e3bff98df0cb0f66c340e770f497d | 05ac9e0c9d56a7f8abff1800b3350582 | Раз юзер слово уже знает - нечего ему по 1000 раз учить!
удалем из всех тренировок текущего лессона | class BotOwner(commands.Cog):
async def clearnword(self, ctx, user: discord.Member):
if not (await self.ex.get_user(user.id)).n_word:
return await ctx.send(await self.ex.get_msg(ctx, 'general', 'no_n_word'))
await self.ex.conn.execute("DELETE FROM general.nword where userid = $1", user.id)
... | 0 |
5d19e55e668e63be7fab09abd9e58673 | df44cbc7a18afcc08feaa5df5d43ed4f | Reports whether tile noises should be played | public class View2048 extends GridLayout
public boolean isPlaySound() {
return isPlaySound;
} | 1 |
df4bc284106033a4643a55af0573e8f8 | d3184d5a197059078844bef2521b40cf | Test that years that are multiples of 400 are
marked as leap years | class TimeLibUnitTest(unittest.TestCase):
def testTimestampIsLeapYear(self):
self.assertEquals(timelib.Timestamp.IsLeapYear(2012), True)
self.assertEquals(timelib.Timestamp.IsLeapYear(2013), False)
self.assertEquals(timelib.Timestamp.IsLeapYear(2000), True)
self.assertEquals(timelib.Timestamp.IsLeapYear... | 1 |
4f15bbacfe93cfe9b8cd8293db1e7f27 | 2d9f1111f9f0cdbb0361452016b0096e | Ensures that retrieving a tag by name works as expected. | BlogEntry blogEntry = new BlogEntry(blog);
blogEntry.setTags("junit");
blogEntry.setPublished(true);
index.index(blogEntry);
assertEquals(1, index.getTag("junit").getNumberOfBlogEntries());
assertTrue(index.getTags().contains(new Tag("junit", blog)));
assertEquals(1, index.getTags().size());... | 1 |
1a0f962b6c22d14d2a22af835c49957a | 3bb205c4bc39b4b98ad345a56a4dfc7c | Verify that POST method is not allowed on config/server-configs apis. | self.client.login(username='john', password='john123john')
url = self.url.format(self.example_api.name)
data = {
'name': 'key-auth',
}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self... | 0 |
03722c57914b87f5be80b824b32a1788 | 757bbbd52f1b8d636829c97627b97030 | method to get the velocity from the accels | def get_acceleration(vel):
u = vel.u
v = vel.u
time = vel.time
a_x = []
a_y = []
for t in range(len(time)):
if t == 0:
dt = (time[t+1]-time[t]).total_seconds()
a_x_temp = (u[t+1]-u[t])/dt
a_y_temp = (v[t+1]-v[t])/dt
a_x.append(a_x_temp)
... | 0 |
cb10c5c9571016908d54f9cfe854fd97 | 44b4734e87b28b8109fe51ca23b99630 | Closes a tunnel identified by the unique tunnel id. When a <code>CloseTunnel</code>
request is received, we close the WebSocket connections between the client and proxy
server so no data can be transmitted.
<para>
Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/refe... | namespace Amazon.IoTSecureTunneling
public partial class AmazonIoTSecureTunnelingClient : AmazonServiceClient, IAmazonIoTSecureTunneling
public virtual DescribeTunnelResponse EndDescribeTunnel(IAsyncResult asyncResult)
{
return EndInvoke<DescribeTunnelResponse>(asyncResult);
} | 0 |
699067d6bd39cabec2c1a09f92efb339 | f29ea6401d83e05619a6f301fd830607 | Exposing the Ids for the users and roles | protected Record2<String, String> getId(io.github.jklingsporn.vertx.auth.jooq.generated.tables.pojos.UserRoles object) {
return compositeKeyRecord(object.getUsername(), object.getRole());
} | 1 |
e3b570e1484ab584fc4c384ac48a7070 | d98bc52c78d8ee9da207a761a075a8db | Adds a propagate task for this entity.
To be implemented by subclasses. | class AbstractPropagation(object):
def _propagator_factory(self): | 0 |
c4324f8522650b169ff2552c9fbd3527 | 3f762406c26e20f0f071af138c4f0500 | Parse the sign-extension attribute, for those machines that
support it. | namespace beaker
static Implicit_conversion*
make_sign_extension(Type* t, Expression* e)
{
return new Implicit_conversion(Conversion::sign_ext, t, e);
} | 0 |
d1a4252f2381b02123a4efa6f5b697cd | 84bb49302aab3e0fcba65f2a69bfb9da | Obtiene la informacion relacionada a un badge por medio de DataConduIT | {
try
{
var BecasInternas = await _ctx.BecaInterna.Where(e => e.BecaInternaId == becaInternaId).AsNoTracking().FirstOrDefaultAsync();
return BecasInternas;
}
catch (Exception e)
{
throw new Exception(e.Me... | 0 |
eb8bd9bf9509eeebd78caa1bb53366a4 | 9bb379e1af2791b0c77693f430e2157d | 出现异常重新开始 | public class CrashHandler implements Thread.UncaughtExceptionHandler
private boolean handleException(Throwable ex) {
if (ex == null) {
return false;
}
restartApplication();
return true;
} | 1 |
8ae9d73e263c4d5ba66fe2d4b4952e0f | 3bbf9ee5b3e69a2288f5ec71f489faaa | liefert die Beschreibung zu dem entsprechenden Arzt | class Appointment
public String toString()
{
return description;
} | 0 |
f486337630030595222eef6239c3bc51 | 40b819b664b731163ee36b90f9bce3a0 | 函数说明:使用Sklearn构建Logistic回归分类器,遍历参数,找到最优的参数 | param_grid = [
{'activation': ['identity', 'logistic', 'tanh', 'relu'], 'learning_rate_init': [0.001, 0.01, 0.0001],
'momentum': [
0.9, 0.8, 0.99, 0.5], 'solver': ['sgd']}
]
clf = GridSearchCV(MLPClassifier(hidden_layer_sizes=(3,),max_iter=20000, alpha=0.015), param_grid,
... | 0 |
12662d34e21a118d1064c66951248270 | 9fda6ecb39e714210d991bee5dfe67c4 | Filter the query on the host column
Example usage:
<code>
$query->filterByHost('fooValue'); // WHERE host = 'fooValue'
$query->filterByHost('%fooValue%'); // WHERE host LIKE '%fooValue%'
</code>
Accepts wildcards (* and % trigger a LIKE) | {
$clone = clone $this;
$clone->host = $this->filterStringToLower($host);
return $clone;
} | 0 |
1b5df285a15ca31b7430a7a5994b47b6 | d293bb2147c0d6ba1649dd94041f24d4 | Return a specific qos config. | public class AmqpTopicSubscription
public MqttQoS qos() {
return qos;
} | 1 |
334d71fe36bd9cdf8aae0af468eb961b | e9923eff9c3eecfc2b15a43cc753bb18 | 判断是否为纵向图 | public class XChart implements IRender
public boolean isVerticalScreen() {
return( (Float.compare(mWidth , mHeight) == -1)?true:false);
} | 1 |
08947848c15ce78241d3f4e3143b00bc | 6f198ea270f5a8499216c73a83af09c7 | Get the field attribute for a property. Any required attribute properties not explicitly
set will be added to the returned object. | namespace Catel.Data
List<IFieldValidationResult> GetFieldValidations(string propertyName); | 0 |
639d1998be44c69c9650237ba91f8f9d | e8302b73d9402a143615e7cbffe131fc | Initializes object of MessageHandler class. | class MessageParserHandler:
def __init__(self):
pass | 0 |
8b830c80b258335cc1d88b1f65461988 | 20ce82cda87c92f978ce9866b8cb22ac | 根据产品版本号和产品类型自动生成产品版本字符串 | public class CodeGeneratedUtils
public static String createPackageProductCode(String productCode,String index) {
return productCode + new SimpleDateFormat("yyMMddHHmm").format(new Date()) + index;
} | 0 |
8f1f9c3b0d53553746dce1250440b615 | baf402833303a75282ed9d9967af678e | This recursive function loops through the results by page
After it's finished the last page it updates the items
and renders a new page. | function resultsLoop(){
$("#main").empty();
$.each(response.items, function(i,item) {
var thumb = item.snippet.thumbnails.default.url;
var title = item.snippet.title;
var description = item.snippet.description.substring(0,100);
... | 0 |
4382d3719e9aa18fdb16695f7ca1c6c3 | 19f81dc9f8acf485d09eda40c4ccb850 | The type of watermarking to be used: * `OTT` - A/B watermarking (for video streams only) * `DUPLICATED` - Stream duplication to match A/B video streams in CDN delivery (for audio streams only) | class _EcdPolicyGroupState:
def watermark_transparency(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "watermark_transparency") | 0 |
8f5b1cde28a112b042019a7b5aa21ab8 | 84730758e92547824776f9c525533d83 | Gets the required host OS ("windows", "linux", "macosx"), if any. | std::string EngineSystem::GetOS(){
return "OTHER";
} | 0 |
ef480bd9212f4636f4d2875691a83a73 | 736fd71ba388edb2358816f60e253d7b | 上传在线诊断的图片到已诊断库 | class Exam extends Controller
public function uploadTongueImage(){
$image = input('file');
$patient_info_id = input('id');
$batch = Db::name("batch")->where(array('patient_info_id'=>$patient_info_id))->find();
$time = strtotime(date('Y-m-d',time()));
Db::startTrans();
if(... | 1 |
e89e6d3a825a2470d01dc2deb84b22a8 | 22831f474fc722a4660d121f89a4dfb7 | 初始状态是 batch size x enc_units的大小 | class SpatioTemporalLSTMCell(nn.Module): # stlstm
def init_state(self):
return torch.zeros((self.batch, self.num_hidden, self.height, self.width),
dtype=torch.float32) | 0 |
637bc7a2943f157dbd4274c593e24439 | b70a537a6c95af2bd2e7067f404c0ad2 | Asks for new game and either goes back to RunGameLoop() or simply creates a new Game instance | namespace Nim
public class Game
private void AskForNewGame()
{
switch(InputHandler.GetMenuChoice(2))
{
case 1:
new Game(players, firstTurn);
break;
case 2:
Program.RunGameLoop();
... | 1 |
121c36367049f86f0fe5b80763911dc9 | 28ea29d27f91e02f0138ac5e9813f834 | Wikiコンテンツをプレーンなテキストに変換 | def translate_text_wiki(body):
return translate_none(body) | 0 |
3728ba5ef6c45c336d4155461f249366 | ad7627e4f58d58e97c6b2620c8830d79 | 재귀호출을 통해 하위 Menu를 생성하고 Menu 정보를 Tag에 저장합니다. | public partial class Auth_Search : SecurityIn
private bool CreateSubMenu(string Up_ID, StringBuilder SBHtml, out string ErrMsg)
{
try
{
using (SqlCommand cmd = new SqlCommand())
{
StringBuilder SBSql = new StringBuilder();
SBSql.AppendLine(" SE... | 1 |
cbdd3dd94ac42b476d69d861986e4e05 | 4e35717939df585afc2766210d1ae661 | Returns mapped ScriptSharp TypeSymbol object. | {
string className = ScriptHelper.GetClassName(content, classIndex, namespaceIndex);
return GetTypeByScript(content, className);
} | 1 |
40615bde024c14dc8ce60099a888c58c | 06eea1fa18fe164bd3a364cacd41a07e | - 클릭과 동시에 발동하는 특수타입대사 | public class CharacterController_2D : MonoBehaviour
private void SpecialAction() {
} | 0 |
b94fae8e487f3456f8ff8de9a7753bf6 | dfcad759c7a835c6138e4a908d2301f7 | 自动调用相应类文件,并反回实例化对象 | $autoLoag = new AutoLoagClass();
$file = self::MapFile($className);
if (!isset(self::$_ObjArr[$className])){
if(!file_exists($file)){
throw new Exception('file '.$file.' not find');
}
$res = require_once $file;
self::$_map[$class... | 1 |
09cb7c5498f7314b9df93222547308ed | 4c44fa05c58310f5dab0be74e6814eb0 | Creates the loop characteristics for multiple instances loops. | self.loop_instr = []
for i in range(self.num_of_nested_loop):
self.loop_instr.append(self.loop_init_instr[2 * i])
self.loop_instr.append(self.loop_init_instr[2 * i + 1])
self.loop_instr.append(self.loop_branch_target_instr[i])
self.loop_instr.append(self.l... | 1 |
922b0760bc1c111ce6d09852cfdd9241 | 7f61448ad6da3ef0f9cb03f40c5be655 | 인수 없고, return 값도 없는 경우 | cases like (1) | 0 |
2bb3b3b4a92f5ce99ea39ef5c100d419 | be9d9a2e9f2a9021d7a7c7ff30f0b350 | Deactivate a body slot for a specific player | async with pool.acquire() as conn:
await conn.execute('UPDATE Acolytes SET is_equipped = 0 WHERE instance_id = $1', instance_id)
if slot == 1:
await conn.execute('UPDATE players SET acolyte1 = NULL where user_id = $1', user_id)
if slot == 2:
await conn.execute('UPDATE... | 1 |
feb963bacd92a255632fceee4f109435 | 8824b4a5fb9cb4b66ae869b51afbfdae | 获取Get形式加入验签的URL | namespace TinyFx.Extensions.DotNetty
public static class DotNettyUtil
public static string GetSignWsUrl(string url, string rsaPrivateKey)
{
var builder = new UriBuilderEx(url);
var sign = SecurityUtil.RSASignData(url, rsaPrivateKey);
builder.AppendQueryString("sign", sign... | 1 |
e49ac145fb505b428f5218d258f7a78c | 92dfb853be806ee39cad0ae10f38c89c | Returns parallel writer instance. | public class PVWriterEvent<T>
public PVWriter<T> getPvWriter() {
return pvWriter;
} | 0 |
a1668593e72c5d8d7653cb80026ec154 | 1b8e770211c92935d4c613eb813f7f39 | 逐字节做异或运算 | bytes.mapIndexed { index, byte ->
bytes[index] = byte.xor(key.toByte())
}
return bytes
} | 1 |
5cc70f6fc94c73e8bdabeed4677004d1 | 614e5e4088120ed049282ed39e56b5c1 | The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. | public class MessenteOptions
public String getHttpMethod() {
return httpMethod != null ? httpMethod.toString() : HttpMethod.POST.toString();
} | 1 |
9b9b3460635be32576cfe18766b1a86d | 9e63e046c2c2224a4f9344a20d3bbe43 | Administrate connected mobile clients | {
$server = Server::findOrFail($id);
$clients = Client::where('server_id', $id)
->where('client_status', 1)
->get();
return view("management::servers.client", compact('clients', 'id', 'server'));
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.