query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e4f2abdcfbff5534cb968fe153f3783c | 752492608499c4443a48ceda62c0304b | 读取excel文件并插入到es中 | def write_es(filename):
book = xlrd.open_workbook("data/" + filename)
sheet = book.sheet_by_name("Sheet1")
actions = []
start_num = 1
for r in range(1, sheet.nrows):
type = str(sheet.cell(r, 0).value)
if type.strip() == '':
type = 'NULL'
content = sheet.cell(r,... | 1 |
b14070ed0513e31c9db387321b824889 | 425b1c42939581258a65fc83daf86a3f | JSON出力関数
HTTPヘッダも含めて、レンダリングする。 | function generateOutput() {
global $response;
$response['log'].='encoding json|';
$print=json_encode($response);
echo $print;
} | 0 |
87e2747d091ccc12a943eec3b4c41859 | e69cf4c5da298fb93619fb34ced3671f | Returns notices with upcoming or ongoing schedules. | class Tribe__Events__Template__Month extends Tribe__Events__Template_Factory
public function set_notices() {
$slice_length = $this->current_month_ends - $this->current_month_begins + 1;
$current_month_counts = array_slice( self::$calendar_days, $this->current_month_begins, $slice_length );
foreach ( $c... | 0 |
1d9e84908ebeb8beeef6f3ab6ba0c7b0 | c2b66e622f5db0afcd783e2c37478951 | Removes a (IE-specific) capture added via _addModalCaptureIE() | if (!capturing) {
if (lteIE8) {
SeadragonUtils.removeEvent(elmt, "mouseup", onMouseUp, false);
SeadragonUtils.addEvent(elmt, "mouseup", onMouseUpIE, true);
SeadragonUtils.addEvent(elmt, "mousemove", onMouseMoveIE, true);
... | 0 |
b9ff3143ac4719b1a3123767ecf5a5a7 | 270ac4fa1417db0d5883b03352694ed8 | 初始化服务器本地IP | public class MainActivity extends AppCompatActivity
private void initLocalhostIp(int port) {
String ipAddress = IPUtil.getLocalIPAddress(true);
mTvIp.setText("本机IP: " + ipAddress + " 端口: " + port);
} | 1 |
866b8b3cb46642fe4ea4adff889aadbf | e4e959e558f724e07c1eca44812ce155 | Test aggregate with a function that doesn't support reduceat | class TestAggregate(unittest.TestCase):
def test_aggregate(self):
yield self.coll.insert([{"oh": "hai", "lulz": 123},
{"oh": "kthxbye", "lulz": 456},
{"oh": "hai", "lulz": 789}, ], safe=True)
res = yield self.coll.aggregate([
{"... | 0 |
53d77dd5606655eacaf2f11ed44c0f47 | efbf46cfcaaab18068f1d9489065936c | returns a list of instances of NativeModule class, which defines functions that can be called from JavaScript | String[][] getNativeModules(); | 0 |
2ec48c516059a6cd059fe13ae725e94e | 17247a6c6ef511fe2d177f94c41de0d7 | Releases the current reader and returns it to the cache. | func ReturnGZipReader(gz *gzip.Reader) {
gz.Close()
gzipReaderCache.Put(gz)
} | 1 |
e93b30ed02b001787e788249e8d25ded | a5c937a16319929e82a603e7d027873f | Converts Square Kilometers (km²) to Square Yards (yd²) | namespace Conversions.UnitsOfArea
public class Area
public static double SquareYardToSquareKilometer(double sqy)
{
return sqy / ConstValues.SqKmSqyard;
} | 0 |
5ca07c2269eef8abe777b2877b1086f5 | d2f3266fe141e1a4e98f5350b33040ab | Get the path associated with a child image. | def image_path_at(self, i):
return self.image_path_from_index(self._image_index[i]) | 1 |
95394ad581ed076ca7fafe53488844c2 | e09b24565a864534eee61de8f6f69b79 | Get the value of the searchText parameter in the messaging extension query. | function getQueryParameters(name: string, params?: MessagingExtensionParameter[]) {
return params && params.find(p => p.name === name)?.value;
} | 1 |
5674cdac7d69a38965498b08c8ea97ea | c0fcf0d4e283edc39502eea3f269de55 | Count number of existing mailboxes | server = self.get_pop_connection()
resp, mails, octets = server.list()
return len(mails) | 1 |
212846bb375d979732b2e512bdd14f8c | 324ecf0ccd7fdaeecf41791fbeaa43d7 | Add a new <code>Property</code> in the <code>ContentManager</code>
properties container. | void addProperty(String name, Object value); | 1 |
dbfc96d983ce1b8070fcad25d3fecbe5 | 877b0e0c8f12417f6c0ec4f5681a5925 | Loads all classes to paginated list, allows to search and sort classes | class ClassesController extends Controller
public function index(Request $request)
{
$filter = $request->input('filter');
$per_page = $request->input('per_page');
$current_page = $request->input('current_page');
$sort_by = $request->input('sort_by');
$descending = $request->i... | 1 |
39ebf5d6061f22c237c7805029996c94 | c1f5479eeeb03f162e818afe613d640c | If any alphabetic factors are identical, convert to exponent | export default class Parser
parseFactorHelper() {
while (this.checkGet(' ')) {
}
if (this.checkGet('^')) {
return EW.exp(this.parsePower(), this.parseFactorHelper());
}
return null;
} | 0 |
bdf6003d2dc9b258d72d7a7c7e79ca2f | 515c6ddaa86e13a382522e25959fc8e8 | Convert between ecliptic and equatorial coordinates. | public final class EclipticToEquatorialConversion implements Function<EclipticCoordinates, EquatorialCoordinates>
@Override
public EquatorialCoordinates apply(EclipticCoordinates ecl) {
double rightAscension = Math.atan2((Math.sin(ecl.lon()) * cosEpsilon - (Math.tan(ecl.lat()) * sinEpsilon)), Math.cos(ecl.l... | 1 |
aa3e47e02804495cb41ef47aef15eb7e | dbb53851f545bc85392c19b57603430d | 保存采购药品信息 | String saveInfo(DrugApply info) throws Exception; | 1 |
26ec783bef0cdb586bb820481b548da2 | 64fecab9e82f1a5e492432053aa4c262 | 验证日期字符串是否是YYYY-MM-DD格式 | function isValidDate(val) {
const reg = /^\d{4}-\d{2}-\d{2}$/;
return reg.test(val);
} | 1 |
ffa018d4920860f563c331174a264a95 | bb76138f658feae0035fdd21a880928f | 模拟OOM第四种情况——直接内存溢出
NIO会使用到直接内存,使用参数-XX:MaxDirectMemorySize=100m测试 | public class DirectMemoryTest3
public static void main(String[] args) throws IllegalAccessException {
Field unsafeField = Unsafe.class.getDeclaredFields()[0];
unsafeField.setAccessible(true);
Unsafe unsafe = (Unsafe) unsafeField.get(null);
int i = 0;
while (true) {
un... | 1 |
0b19581ca2d1e19efd487232f559942a | 18cce3cb41bcdb467447055c0e673c03 | is the distance from the opcode to the target. | {
if(opcode == OP_0)
return 0;
assert(opcode >= OP_1 && opcode <= OP_16);
return (int)opcode - (int)(OP_1 - 1);
} | 0 |
0a93086253973070e8d9bddd58d72f42 | 85fb9a89aeac4b92d40474ad362a8a1a | render the menu for when mark mode is enables | class Avalanche1P:Avalanche1PDummyMode()
override fun renderSetting(engine:GameEngine, playerID:Int) {
if(menuCursor<=8) {
drawMenu(engine, playerID, receiver, 0, EventReceiver.COLOR.BLUE, 0, "GAME TYPE", GAMETYPE_NAME[gametype])
if(gametype==2)
drawMenu(engine, playerID, receiver, 2, EventReceiver.COLOR.BL... | 0 |
0477c41a4ca043237396a99686ae51fd | a5c9405c5e4efc8b5b89a66689db5de8 | calculates the accuracy of the classification with threshold on distances | xb = som._recorder['xb']
w = som.weights.view(-1, xb.shape[(-1)])
distances = expanded_op(xb, w.to(device=(xb.device)), pdist)
row_sz = som.size[0]
preds = idxs_2d_to_1d(pred_b, row_sz)
n_classes = som.size[0] * som.size[1]
batch_size = xb.shape[0]
count = 0
_, inverse = preds.unique... | 1 |
0307d9461640ce9dcac9c25184f85ede | 11689c4bd86ef6438410d4b041ac9c4e | 设置职称名称 | @Table(name = "sy_company")
public class SyCompany
public void setQymc(String qymc) {
this.qymc = qymc;
} | 0 |
b72e7ab670929b43564b42f6fac3f8f1 | 10f9755fca9f34ab8a0b46dce93595c3 | Gets the value of the singleRecipient property.
possible object is
{@link SingleRecipient } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SendTemplateRequest", propOrder = {
"mailUser",
"fromEmail",
"fromName",
"templateName",
"subject",
"templateBody",
"replyTo",
"isAddOptOutTag",
"isBodyHtml",
"customDomain",
"trackOpen",
"singleRecipient"
})
public c... | 1 |
3c53505f295e980bcdedfd87a6b1ded2 | 7f61448ad6da3ef0f9cb03f40c5be655 | Constitution: | cases like (1) | 0 |
9c393e1d588f08aa812d7965d72aa07c | 9789ce6d6e6469a1e94c9d96e0a5901f | Drops tables and closes connection | def close(session, cluster):
session.execute(drop_table1)
session.execute(drop_table2)
session.execute(drop_table3)
session.shutdown()
cluster.shutdown() | 1 |
7618a98c01e1416631ed2ffdadb96601 | b11d45e6aa7a37c2fe07cf3a7ad71336 | Get music rhythm for note blocks | rhythm_generator = self.state['rhythm']['order_eng']
rhythm_pi = rhythm_generator.next()
self.state['rhythm']['row_idx'] = rhythm_pi
row_idx = self.state['rhythm']['row_idx']
self.rhythm_lock.acquire()
rhythm_pattern = copy(self.state['rhythm']['pattern'][row_idx])
... | 1 |
88cfd890721f0d8fe40e905cf4df14d8 | f23e756726e49247280cdefb5bab40ae | Queues the scripted action for later run after any preceding scripted
elements are performed. | {
if (action == null)
{
throw new ArgumentNullException("action");
}
lock (actionQueuesLateUpdateFunc)
{
actionQueuesLateUpdateFunc.Add(action);
noActionQueueToExecuteLateUpdateFunc = false;
}
} | 1 |
e316274ca8e466f39383c970fe1be16b | 182f87cdf18622b58c481b296c69a3f1 | 根据借车单号查询对象 | public class TCarBaoxiudangManageImpl implements TCarBaoxiudangManage{
public TCarBaoxiudang selectTCarBaoxiudangByFlowId(Integer flowId){
DetachedCriteria criteria = DetachedCriteria.forClass(TCarBaoxiudang.class);
criteria.add(Restrictions.eq("flowId", flowId));
List<TCarBaoxiudang> carBaoxiudangList = qbcDao.... | 1 |
2fbdf7977b2cb06286c21eda5409e6e0 | 149f367c26b7bcc80a1dbe7e87848a33 | Test that the resulting cube contains the expected data following
vertical integration where some of the values in the data are negative.
This shows that both zero values and negative values have no impact
on the integration as the Integration plugin is currently
restricted so that only positive values contribute towar... | class Test__pad_and_calculate_neighbourhood(IrisTest):
def test_basic(self):
expected_data = np.array(
[[0.85714286, 0.75, 0.83333333, 0.85714286, 0.75, 1., 0.85714286],
[0.85714286, 0.8, 0.75, 0.75, 0.5, np.nan, 0.75],
[0.75, 0.83333333, 0.75, 0.8, 0.66666667, 1., 0.8],
... | 0 |
87e66f143d5eee2da51350ace868709f | 24cb0ad76a9c936c9730310669092aee | ReportSalesBO转ReportDataDTO | salesOrderDTO.setUserId(WebUtil.getUserId(request));
String username = WebUtil.getUserName(request);
salesOrderDTO.setUserName(username);
salesOrderDTO.setShopVersionId(WebUtil.getShopVersionId(request));
salesOrderDTO.setShopId(WebUtil.getShopId(request));
salesOrderDTO.setStatus(OrderStatus.SA... | 0 |
41857e9e7fc7c93677bba98c29cad5ee | 27c610b97cf39f30cacd4c289672eccc | Checks how many cells are empty and returns that number. | public class Score implements Serializable
public int getEmptyCells(){
return this.emptyCells;
} | 1 |
550ec27e2e016e3fbc3133a458217359 | 89f288d016fe2b573d7152f4f220ba21 | 商铺头部 | let headhtmlStr = '';
let footloadHtml = '';
headhtmlStr = `
<div class="header-content">
<div class="logo"></div>
<div class="loginShop clearfix">
<div class="head-title fl"></div>
<div class="loginbox fr">
<spa... | 1 |
d2f7fbbe6c205c9830a0771c5836f339 | 8a6121056d053f96f7b3a2c9f73762a1 | Sets the infant view. | this.view = getChildAt(0);
if(view != null) {
init();
}
} | 0 |
56a31ec6c7291ac2967234a86ad2d321 | c366758a01c315ef774f89b30f488b22 | 向容器注册mqclient服务。
通过委托构建mq相关的配置选项 | namespace MQTransaction.Common.Extensions
public static class ServiceExtension
public static IServiceCollection AddMQTransaction(this IServiceCollection services, Action<MQTransOptions> optionsaction)
{
var options = new MQTransOptions();
optionsaction(options);
options.C... | 1 |
4ed9d66024e32aae9d645ea0e57e51e7 | b5938035ad23dc704cc3cd4a926596ee | @brief Clears GPIO0_7 interrupt status. | void IMONITOR_ClrGPIO0Pin0IntStatus(void)
{
IMONITOR->INTSTATUS &= ~IMONITOR_INTSTATUS_GPIO0_0;
} | 0 |
e35e989fdbe90ed805846b3afe5686e0 | 857b7ec74f9b1a8085af211421ba5371 | Merge dissolved features into one shapefile | def run_merge_fc(geojson_inputs, folder_path, recursive, geojson_output):
from .merge_fc import merge_features
merge_features(geojson_inputs, folder_path, recursive, geojson_output) | 1 |
e6d41c04747aa491ba6cf2967675ad1e | f3d68d73cfe663151b3cdcf9b53390d1 | 直接获取SAP客户端连接 | def open_sap():
sap_object = win32com.client.Dispatch(SAP_OBJECT)
sap_object.ApplicationStart()
return sap_object | 1 |
a66d13e384f8b280d25601c465a18669 | f908c0b576e7cdfa99fabfb1e214379e | Enter a parse tree produced by the {@code compute}
labeled alternative in {@link B314Parser#instruction}. | class asm8080Listener(ParseTreeListener):
# Enter a parse tree produced by asm8080Parser#prog.
def enterInstruction(self, ctx:asm8080Parser.InstructionContext):
pass | 0 |
81ae040b513d2617a28d1b050ca5515d | f59673fe466259d1922630e02bd2a19c | Add a client to the head of the linked list | {
CM_FUNC_START( "cmclient_list_add()",0,0,0 );
CM_ASSERT( client_ptr != NULL );
CM_ASSERT( client_ptr->link.next_ptr == NULL );
#ifndef FEATURE_Q_SINGLE_LINK
CM_ASSERT( client_ptr->link.prev_ptr == NULL );
#endif
#ifndef FEATURE_Q_NO_SELF_QPTR
CM_ASSERT( client_ptr->link.q_ptr == NULL );
#endif
q_put( CLIE... | 0 |
9177322d2afb1660ddda3e48c02f98af | 78c1b8f93b68fff210b44341496974e4 | 获取连接两个结点的路径,使用结点 | let paList = getNodePathList(nodeA)
let pbList = getNodePathList(nodeB)
let len = Math.min(paList.length, pbList.length)
for (let i = len - 1; i >= 0 ; i -= 1) {
if (paList[i] === pbList[i]) {
return paList[i]
}
}
} | 0 |
375807f44f0a682bc068572144a98c0a | 5194c0bd5d4fc0df53e78b6a0e7b3c83 | Make a floating point control filled with initial value.
If min and/or max are non-NULL will enforce range
Requires utils.js jQuery.js and inputBox class | var box = $('#number-input').children();
this.minusBtn = box.eq(0);
this.input = box.eq(1);
this.plusBtn = box.eq(2);
this.value = parseInt(this.input.val(),10);
this.maxValue = maxValue;
this.minValue = minValue;
this.step = step;
if(this.value>=this.minValue){
this.disableMinus();
}
if(this.value>=this.m... | 0 |
7feededa0d0dafa39138efeffa1bc4b2 | 2fef0445c9e05a516587504671f7ab1f | Renders the `core/loginout` block on server. | class addon_example_util extends addon_example_info
public function core_display_login_bottom($vars)
{
$encode = $vars['encode'];
return '';
} | 0 |
0665dd5585feea966ff97e81c3ae2ae6 | 81fb3f0f80b22d6f6c1c050e36a26711 | 等待定位信息按钮 | void MainWindow::on_pushButton_locate_clicked()
{
timer->stop();
locate();
} | 0 |
1267c5927ab38d68f0e07899420c7786 | 8d535bbd8f35b1fe6b231698d449b0b6 | 일반 마켓상품 컬럼. om_product, om_product_entity 테이블의 컬럼 | {
$aMarketPrdInfo = $this->getMarketProduct($aParam);
$aReq = array(
'market_code' => $aMarketPrdInfo['market_code'],
'entity_type' => 'market_product',
'attribute_code' => 'official_type',
'value_table' => 'om_product_value_varchar',
... | 0 |
3a3a05d604cdb0071d63d5cec9df64fa | 1d83599fdb75dc06439878801711f061 | Gets the teamsApp property value. The application that is linked to the tab. This cannot be changed after tab creation. | namespace HigLabo.Net.Microsoft
public partial class MicrosoftClient
public async Task<AppcatalogsListTeamsappsResponse> AppcatalogsListTeamsappsAsync(AppcatalogsListTeamsappsParameter parameter)
{
return await this.SendAsync<AppcatalogsListTeamsappsParameter, AppcatalogsListTeamsappsResponse>(p... | 0 |
bcc0b0c3bd91a27a2237e455e969c0f0 | 5335518b91b810e652caad9f05a69af1 | Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. | public class OperationalInsightsManagementClientImpl extends AzureServiceClient
public OperationalInsightsManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
return this;
} | 1 |
f91477c887950582b44a13b1908954e9 | 0aed4b0f4530864537dcbabadd20bb97 | Add/Remove network adapters for VM(s) (defined in cluster conf file) | class VMrun(): # pylint: disable=too-many-public-methods
def add_network_adapter(self, adapter_type, host_network=None, quiet=False):
return self.vmrun(
'addNetworkAdapter',
self.vmx_file,
adapter_type,
host_network,
quiet=quiet) | 1 |
4fd9b947bf527c79846fcdaa80b0f5a3 | 6c21310b81407b5ace7edcf5da892acb | Get Acceleration domain name service type | sys_srv_domain_e_type rr_sel_get_service_domain(const gas_id_t gas_id)
{
return rr_get_PLMN_request_details_ptr(gas_id)->service_domain;
} | 0 |
95ece98c6556d386be4ae0a24f8a3ed1 | adceaae0061df7953d381fad70a3c1c4 | Test getting automation ID | await setup_platform(hass, LOCK_DOMAIN)
entity_registry = er.async_get(hass)
entry = entity_registry.async_get(DEVICE_ID)
assert entry.unique_id == "51cab3b545d2o34ed7fz02731bda5324" | 0 |
5b9ed1cab7b14a1f37b4fbf083681c4b | 33e206aa37be8b2803d460857e0d9db6 | チューナーを確保し、ブロックを呼び出す。
・ブロックの呼出し後にチューナーを(必ず)解放する。 | int main()
{
kotone();
return 0;
} | 0 |
759a409ebec65d7ae794175fffc0151f | 11f90725d10f3ad051b08a9514b0a9be | Ensure that we can retrieve configuration properties and sensitive ones are properly masked. | {
$model = new MUtil_Model_NestedArrayModel('text', array());
$settings = new Zend_Config_Ini(GEMS_ROOT_DIR . '/configs/project.example.ini', APPLICATION_ENV);
$this->project = new Gems_Project_ProjectSettings($settings);
$this->maskedType = new Gems_Model_Type_Encrypt... | 1 |
0e3d9802561e6e778988a26452d5db79 | 1a753f964cc69fe45ffd0b9897eaf4e2 | nilであることを判定する. | public class RedBlackTree
public boolean IsNil(RedBlackTreeNode node){
if( node == nil){
return true;
}else{
return false;
}
} | 1 |
79c7b0fc1f5166d4ee79d8478ac36e45 | 5c9de69b395071d56e89ef255ef76a00 | Получить среднее значение показателя для всех предприятий. | namespace EfCore.Sharding.Suggestion.Sharding.Abstractions
Task<decimal> AverageAsync(Expression<Func<T, decimal>> selector); | 1 |
570d5b6644bd8bcf643933308b700be3 | 9195dc0cbc9479d2cc542ed57840d90b | Configures the DataLoaders to use a temporary directory for storing the datasets,
and removes the path at the end of all tests in this module. | tmp_dir = tf.test.get_temp_dir()
shutil.rmtree(tmp_dir)
os.mkdir(tmp_dir)
cls.data_dir = tmp_dir
cls().generate_data(TinyAlgo.data_dir, None) | 1 |
ee080c61309f6f197c956c7de45ac9e2 | ad30483647828e5383af1f4749f61ecd | check if some string is ipv4 address or not | ipv4_pattern = "^(?:[0-9]{,2}\.|1[0-9]{,2}\.|2[0-5]{,2}[\.]*){,4}$"
ipv4 = bool( re.search( ipv4_pattern, string ))
assert type(ipv4) is bool
return ipv4 | 1 |
ab5acdd136ec29a0ed48ca49caf5c5a2 | 587485a549758e64fa879dd547d6553e | 返回本数据视图的所有数据 | local resultArr = {}
for k,v in pairs(self._viewArr) do
table.insert(resultArr, v[2])
end
if self._isCellView then
resultArr = self._allCellViewArr
end
return resultArr
end | 1 |
b5038a655c13958b1d224a4de2dd7717 | 6ab448097227bf7223bae210a974562b | Marks a frame as having ended. | {
frame_data_t *frame = args ;
VERIFY_OBJECT(frame, FRAME_DATA_NAME) ;
gucr_setRenderIndex(frame->hf, frame->nFrameNumber);
if ( frame->surface_started ) {
const surface_set_t *surfaces = context->page->surfaces ;
frame->surface_started = FALSE ;
if ( surfaces->frame_end != NULL &&
!(*surf... | 1 |
618e3bc59c475198372378f5134d8849 | 3bf503e0b8b36a783fe735ea348b3820 | Add constant impedance load admittance to diagonal elements of
Y-matrix | for bus_data_dict in self.bus_data_dict_list:
node_num =bus_data_dict['Bus number']
self.Y[node_num-1, node_num-1] +=complex(bus_data_dict['Shunt conductance G'],bus_data_dict['Shunt susceptance B'])
for branch_data_dict in self.branch_data_dict_list:
if bran... | 1 |
078369389079064d2432ece3ae5db730 | a0b8fe9b5f841612054915b324b497a3 | 交换优先级队列中的两个元素 | const temp = this.pq[a]
this.pq[a] = this.pq[b]
this.pq[b] = temp
} | 1 |
f04788ddadcb785c7aceb5b3fe25bf42 | c8f38d5abc0630088913b3833dfcbca4 | Defined in subclasses, move to destination
This is the main modelling function
Returns true if at destination, else false | if(target is None):
return False
target_px = util.mm_2_pixel(target)
print("Going to (" + str(target.x) + ", " + str(target.y) + ") mm, or (" + str(target_px.x) + ", " + str(target_px.y) + ") px")
time_center = time.time()
at_goal = False
accumulated_error = 0... | 1 |
828b1bbc3da09a1180e217537a04cfde | dd29db63306b46a3913c527e07790e44 | Функция навешивания лисенеров для спойлеров | spollersArray.forEach((spollersBlock) => {
spollersBlock = matchMedia ? spollersBlock.item : spollersBlock;
if (matchMedia.matches || !matchMedia) {
spollersBlock.classList.add("_init");
initSpollerBody(spollersBlock);
spollersBlock.addEventListener("click", setSpollerAction);
... | 1 |
1f8a6da47922b053752962043f7e4cdc | c5cc60beae950520f832bd0385b965a7 | 遍历评分控件,设置相应的分数 | {
int score = 0;
foreach (var item in listCtrl)
{
if (item.SimpleValue!=null && item.SimpleValue.ToString() != "")
{
string str = Regex.Replace(item.SimpleValue.ToString(), @"[^\d.\d]", "");
score += int.... | 1 |
b39027466b1ff98ae0461998cc36d174 | 572ebd39099a43c5a0f2bbd5eb0a2024 | Returns all Kiezatlas criteria existing in the DB. ### Experimental
A Kiezatlas criteria is a topic type whose URI starts with <code>ka2.criteria.</code>
but does not end with <code>.facet</code>. | score_criteria_list = IdeaScoresCriteria.objects.all()
serializer = IdeaScoresCriteriaSerializer(score_criteria_list, many=True)
return Response(serializer.data, status=status.HTTP_200_OK) | 0 |
b0bca4eb564182d6c06c964af3b4a663 | 1b639bce7a5d40bcc2c28133aa42465b | Initialize the properties of Slyum. | global rules, user_settings, stylesheet_content, suppress_days
global applies_to_ext_mapping, applies_to_ext_mapping_initialized
if not user_settings:
user_settings = sublime.load_settings('DevSkim.sublime-settings')
if not user_settings:
logger.warning("U... | 0 |
c8f485e7c7de235fb4a45df96d4b1a01 | eccba9455308ffc88d5b8f8ff8665085 | Вернуть регистрационный номер ФН | class Db2Manuhome(db.Model):
def __get_note_doc_reg_num(self, doc_id: str) -> str:
reg_num: str = ''
if doc_id and self.reg_documents:
for doc in self.reg_documents:
if doc.id == doc_id:
return doc.document_reg_id
return reg_num | 1 |
7d6e197839cae018bd4dec23eee44d6d | 3b9581a76cc9e41437a1e92d0ebf8be6 | Init global variable storing information about motion. | void initMotion(void) {
motion_init();
} | 0 |
eac84ad53d1f9e23cb530b6a24a0c680 | 4e471c27ea55b2cbc2f966014cdb9832 | Computes the hazard function from MTLR predictions.
The hazard function is the instantenous rate of failure, i.e. roughly
the risk of event at each time interval. It's computed using
`h(t) = f(t) / S(t)`,
where `f(t)` and `S(t)` are the density and survival functions at t,
respectively. | class CoxSurvivalModel(SurvivalModel):
def hazard_rate(self, t):
return self._rate_param | 0 |
6038bd249e4e108d14c5ad190b32ff84 | ed886e43acc2439d6bd39052c430c677 | 从intent中获取数据,activity是否在前台 | fun isActivityFore(activity: Activity?) =
activity?.intent?.getBooleanExtra(KEY_ACTIVITY_FORE, false) ?: false | 1 |
866b427caafe160e6ca23fc0ec330c21 | 5532402c8e0f5f960ca8915e2f3ce35e | 返回请求 ID 生成器. | export class SocketIOApiClient implements ISocketApiClient<SocketLedgerEvent>
private genarateReqID(): string {
const maxCounterRequestID =
this.options.maxCounterRequestID || defaultMaxCounterRequestID;
if (this.counterReqID > maxCounterRequestID) {
this.counterReqID = 1;
}
return `${this.o... | 1 |
74ed8028e371b0593c6773538b2df441 | a8922a40fc1c33b1fcadbabaaaf90b30 | Gets number of floors within array List | public class Building
public static int getNumberOfFloors() {
return (numberOfFloors);
} | 0 |
372b429e0ef49f827015ec80f4e39014 | 62a1c37360a2b5cd9b395ee23e9a18e1 | 冒泡事件的兼容性封装函数 | class TrendChartIndex extends Component
bubbling(arr){
let length = arr.length
for(let i = length-1; i >= 0 ; i--) {
for(let j = 0; j < i; j++) {
let num = arr[j]
if(arr[j] > arr[j+1]) {
arr[j] = arr[j+1]
arr[j+1] = num
... | 0 |
3bb6009858867c3a3dd0668f01a0bde7 | 0fb4a33d4b0b26305fecef6a26043732 | Delete Today Page Category By Id | {
$cat = Category::find($id);
Page::where('name', '=', strtolower($cat->title))->delete();
Category::find($id)->delete();
Session::flash('success', 'Deleted successfully');
} | 1 |
dc01c623e0e3407f9b372cdcbd7bdd57 | 30b0ba06befb4b36189e3282c4e1b0a2 | Get event location | class Event:
def get_location(self):
return | 1 |
42c9d67247ec4cc9560e2c552675f97f | 3c14bca72117d900961265aae5a7612e | 通过两点距离计算比例 | double lon2){
double distance = MapDistanceUtils.getDistance(lat1, lat2, lon1, lon2);
distance = distance / ratio;
return distance;
} | 0 |
421b23ac9fb154ab2f23c88aaf6f856d | 938ea9d90c5dbea72d98542e65deeea9 | Adds a new buffer to the list and makes it the current buffer. | {
for (DefaultBufferViewModel bufferViewModel : currentBufferViewModels)
{
bufferViewModel.setBufferModel(bufferModel);
}
bufferStructure.addBufferModel(bufferModel, idPrefix,
currentBufferViewModels);
currentBufferViewModels.clear();
} | 0 |
0464b757fab0dfa143e40fed0c4d84b6 | 2c9b810202b72793c107f7539ec9e98f | 查看邮件日志 | {
$params = Yii::$app->request->get();
if (isset($params['id'])) {
$query = new Query();
$model = new GameEmailLog();
$count = $query
->select('id')
->from($model::tableName())
->where('email_id = '.$params['id'])
... | 1 |
92b18421419bc32b7a77cc837602f0b4 | ff7de073b09236c5512927d069bdcb37 | Metodo para capturar a data de nascimento de uma pessoa | def nasc_(nasc_img):
nasc_img_gray = cv2.cvtColor(nasc_img, cv2.COLOR_RGB2GRAY)
nasc_img_gray = np.concatenate((nasc_img_gray, nasc_img_gray), axis=0)
nasc_img_gray = np.concatenate((nasc_img_gray, nasc_img_gray), axis=1)
nasc_img_gray2 = cv2.adaptiveThreshold(nasc_img_gray,255,cv2.ADAPTIVE_THRESH_MEAN_... | 1 |
b13b2ee150c1b1e42db534a064e2ae55 | 6690734af4351be0952e1fc6cb036b0d | Check if array is sorted. | def __sortedCheck(arr: []) -> bool:
for i in range(1, len(arr)):
if arr[i] < arr[i - 1]:
return False
return True | 1 |
919b60b6d04cc326e31f388ba64f6bc0 | d908351ea397150bc9f893dd985fad6e | Gets the sport name. | public class Competition
public String getName() {
return name;
} | 0 |
7af4eb0d3d40b06a0df8aa6f35ffd241 | b5d47ae3530837f342ca822f434fa7c8 | create ParameterList with iterable Parameters | m = make(parameterMap)
for _, paramList := range params {
for _, param := range paramList {
m.add(param)
}
}
return
} | 0 |
d37a6e080abf7fa68ccbc134fed21927 | 44e5908b76dee307ce25a4ddc584280c | Load the next level as long as a next level exists. If not, load the main menu. Remember, if you change
the name of the scene you must also change the string in this method. Consider using the build index
later in development. | {
int sceneCount = SceneManager.sceneCountInBuildSettings;
int currentScene = SceneManager.GetActiveScene().buildIndex;
if (currentScene < sceneCount - 1)
{
SceneManager.LoadScene(currentScene + 1);
}
else
{
... | 1 |
657f04154a59e66cada0d3105ddaeda3 | f4a4126f1c14de73156211813ff58dec | コースのドラッグスクロールを開始する。 | interface ITouchAffairItem : ISingleDayItem
fun onMoveStart(course: ICourseViewGroup, row: Int, column: Int) | 1 |
e1ca889d5c5a59d1aa369f0b99d1c9a4 | 854c87cc64a43fb3e4efcb85065c2545 | Check which streams fit in HW outputs | output_width = 0
output_height = 0
if args.hd:
output_width = 1280
output_height = 720
elif args.fhd:
output_width = 1920
output_height = 1080
elif args.qhd:
output_width = 2560
output_height = 1440
elif args.uhd:
output_width = 3840
... | 0 |
30d6c2eafbbee73c0b271135e02cb4fd | 0a424942afc6fb786a2944100e3fb964 | Retrieve prepid info for given prepid | if p_index >= len(self.preexistence):
return 'There is no such preexistence'
return self.preexistence[p_index] | 0 |
be164b16db61f56212c9b949bd7eedd6 | 011b75038b4fadeae796f2c40f667f8f | Sets the NOTE_ON and NOTE_OFF messages for the specified parameters | [ExecuteInEditMode]
public class PureData : MonoBehaviour
public static bool SendNoteOn(int channel, int pitch, int velocity) {
return instance.communicator.SendNoteOn(channel, pitch, velocity);
} | 0 |
99e193f1a5a3d077ecf2980682d9220a | 736c990d8c712257ecd526c4c2bbebed | Show Location Permission Missing Dialog
This method creates a location permission missing dialog box. | class BackgroundLocationPermissionUtil(var context: Context)
private fun showLocationPermissionMissingDialog() {
permissionMissingDialog = CustomDialogBuilder(
context,
"Missing background location access",
"Please provide background location access all the time. " +
... | 1 |
396203fdb694328d25c1cbeca1e6f5bc | 692eb390817a05df4668de2814ca665a | Check to see if Realm property is set | {
if ( array_key_exists( $propertyName, $this->properties ) )
{
return true;
}
return parent::__isset( ( $propertyName ) );
} | 1 |
36a3996b175cdb4aa8aec3b0215dd7ca | de04c668a5d7a95285c68938f4ffb713 | 生成以主键字段索引的SELECT语句 | {
$expressions = $this->expressions($tableName, $tableAlias, $excludeKeys, $columnAliases);
return (count($expressions) >= 1) ? "SELECT\n" . join(",\n", $expressions) : '';
} | 0 |
57479d880b65ec5a6e3ec6cf0409cf04 | 37860ece00b81b02d4dde31ae3b5c3ba | Thread safe method used to get the next request id. | {
lock (_api)
{
_requestID += 1;
return _requestID;
}
} | 1 |
febf4f228c37c7076138cbb65fd9ecc3 | ebccc7e2086983ebec6f462dd081afa6 | 设置底部TAB 图片资源 | public abstract class BaseFragmentActivity extends BaseActivity
public void setTabBackground(View imageButton, int resId) {
imageButton.setBackgroundResource(resId);
} | 1 |
04805a480521f901618b9c43eedbeff9 | c73dd9840141437e917a8aaf8b34ce67 | Function that is called when a message is recieved from a child component | namespace MikuMikuWorld
public abstract class GameComponent : IGameComponent
internal protected virtual void OnReceivedMessage(string message, params object[] args) { } | 1 |
ff3a59500d79f87c5a85d27dfdcda2c9 | a86d8733f2074c4d8ef96eede27243ca | Gets a list of build definition folders. | {
return api.CallAndParseAsync<SearchFoldersResult>(
HttpMethod.POST,
SearchFoldersUrl.BuildUrl(),
PrepareSearchParams(),
null,
Utils.PrepareJsonHeaders(),
cancellationToken);
} | 1 |
c07036bf64ee119ddf1c1758069b190a | 592f892ca655c8beb09cfdb085f7ae37 | Method to set the value of field status_ordem | class OrdemServico extends \Phalcon\Mvc\Model
public function setStatusOrdem($status_ordem)
{
$this->status_ordem = $status_ordem;
return $this;
} | 1 |
efffc63cec375c50cd42aacbc2c21224 | 4258a2c13d98b1cf68f6d07c762a60ee | Convert kelvin to fahrehneit | kelvin_ = (5 * (fhValue - 32) / 9) + 273.15;
return;
} | 0 |
e4d464a5affe3d3598ff422686184c88 | b2b3753e0a04ce4e4bd707612f6c200e | 获取通用设置数量 | {
string strSql = "select count(GeneralID) from ZL_CommonModel where " + filter;
return SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, strSql, null));
} | 1 |
eacbbc88bbb2dd53e49f5675c40cbb2b | 8df1a92277cdcf31b76b674244118582 | Set token regex. | {
parent::__construct();
$this->addToken(self::T_IF_OPEN, '#if');
$this->addToken(self::T_IF_ELSE, '#else');
$this->addToken(self::T_FOREACH_OPEN, '#foreach');
$this->addToken(self::T_FOR_OPEN, '#for');
$this->addToken(self::T_BLOCK_CLOSE, '#end');
$this->addT... | 1 |
76b33bcb171ec0a1ea522bede90ea932 | 93ec6fe46b489d0c3a54c842d1b3b3dc | 带参数的sql执行, 返回一个结果集的查询, 防止SQL注入 | Map<String, Object> mapSql_(@Param("sql") String sql); | 0 |
2c0180e63eac81488af25b210630a98f | aa095d72fdc2453265e7645670a8c0ba | セット要素の表示非表示関数 | {
var setMenu = document.getElementById('set_menu');
var setMenuBridge = document.getElementById('set_menu_bridge');
if(setMenu)
{
if(isShow)
{
setMenuBridge.style.display = '';
setMenu.style.display = '';
}
else
{
setMenu.style.display = 'none';
setMenuBridge.style.display = 'none';
}
}
} | 1 |
01b8a634fb89e297811c96a0e480f71c | 9d2001927f680c92e374a65ce55a91a9 | 丢弃所有的计时,并将计时开始时间设为现在 | if @handle.ptr == nil
raise "this is disposed"
end
Native.RunEditor_clear_times(@handle.ptr)
end | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.