query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4a3f976aead6c33b2c935f5fabb04632 | 4763a81efcab05e3c70102b9a123733c | Publishes a list of RealEstate objects to the specified channels. | namespace IS24RestApi
Task<PublishObjects> GetAsync(RealEstate realEstate, int? channelId = null); | 0 |
36596be2ddb146fa583b29da305aefb7 | 0aef23c1cc3716d5a263c94c82ca9cdd | 根据AppID获取账号下所有用户信息 | Class MemberService extends BaseService
public function getInfoByAppUserId($appUserId)
{
$memberId = $this->getMemberId($appUserId);
if (!$memberId) return [];
return $this->getInfo($memberId);
} | 0 |
cc67a6ba43f415eefb9b1f7d5fa06f0e | 14a87db8b2be4d60df54dbeddc6030e7 | Sets silent mode to on or off. When silent mode is on there will be no communication back to Gerrit, i.e. no
build started/failed/successful approve messages etc. Default is false. | void setIsQuiet(boolean quiet); | 1 |
4c92f16c06c6887560450031873578f0 | afaf99e309873acf20929cdd2bcf5f73 | Method GET: Code | namespace Workshop2.Controllers
public class BookController : Controller
public JsonResult Code()
{
return Json(bookService.GetCodeList());
} | 1 |
490fd3798f8d1f7be24d1a5305926cc1 | b4a3788be4dd0911d8904b7cd1bc0e96 | Serial read append to the given vector, non-blocking | {
const unsigned int bufSize = 255;
unsigned char clear[bufSize];
unsigned long read = bufSize;
int ret;
while (read == bufSize)
{
ret = core.ReadFromSerial(&device, port, clear, bufSize, read);
if (ret != DEVICE_OK)
return ret;
}
return DEVICE_OK;
} | 0 |
6a12ece090084964eb423f1671a9249f | 39c0999d67a2fe8d0fd671b3f9dfd266 | Generates random permutations | function randPerm(length) {
let array = orderedPerm(length);
shuffle(array)
return array
} | 1 |
5f2bde29d05f7bde0a08a97d109ef4e1 | 04e39bd8a44f155d4cdc100af7418ead | 功能描述:给出一个排好序的链表,删除链表中的所有重复出现的元素,只保留原链表中只出现一次的元素。
例如:给出的链表为1->2->3->3->4->4->5, 返回1->2->5. | public class Solution
public static ListNode deleteDuplication(ListNode headNode)
{
ListNode newHeadNode = new ListNode(Integer.MIN_VALUE);
newHeadNode.next = headNode;
ListNode prev = newHeadNode;
ListNode node = newHeadNode.next;
while (node != null)
{
b... | 1 |
dc669c77e96bfb0f04cfd0d1ca6f3e78 | daa1e1a9a083af791cb32e7c69a89808 | Test that bundle serialization works correctly | batch_job = self.TestBatchJob("test_job", username="bob", \
apikey="123", url="http://localhost:9000")
bundle = save_function(batch_job.__class__, globals())
bundle_str = json.dumps(bundle)
print("checking tar contents...")
batch_job._BatchJob__create_bundle_tar(bundl... | 1 |
188a4688612d13c1c3c6e00ebbb1c6db | 1b8e8b422cd279fa06981a2647cce7d6 | Sistemdeki cihaz verileri arasında arama yapmak için kullanılan fonksiyon. | $search = isset($_GET['search']) ? $_GET['search'] : 'nothing';
$escapedString = db::escape($search);
$q = "SELECT `systems`.*, `regions`.`name` `regionName` FROM `systems` JOIN `regions` ON (`regions`.`id` = `systems`.`regionID`) WHERE `systems`.`name` LIKE '%$escapedString%' ORDER BY `systems`.`name`";
$r = d... | 1 |
5fddea635653298c858c6fc860db7a85 | b654f3a4bf7fc668c4afaf9ea0a4fef1 | The Xml object provides easy means to convert XML to HopObject and HopObjects to XML. | def transformXmlParserId():
return TransformId(_obj=xmlsecmod.transformXmlParserId()) | 0 |
e4b34d977400d87212f3de7b0e3755bb | 2388c06cfee72cf33c6f24bad6f857f6 | Return the results of the select that corresponds to the given URI. | cursor = None
table_class, itemId = self._getTableClass(uri)
if table_class:
if itemId:
_ID = uri.getLastPathSegment()
selection = table_class._ID + " = ? "
selectionArgs = [_ID]
kwargs = dict(
table=table_cl... | 1 |
fe576fce7e976210efa6c45c4e76f140 | 684e34fa2802262c424c9a91d394859b | returns a new grocery list that combines the local list and the other grocery list | for(Customer* cust:other.customersList){
customersList.push_back(cust->clone());
}
orderList.clear();
for(OrderPair order:other.orderList){
orderList.push_back(order);
}
currOrderList.clear();
for(OrderPair order:other.currOrderList){
currOrderList.push_back(order);
... | 0 |
f6b9aaf8f849caa74949fc44a76d0fda | 1642e014fe6073bfcdf911641a230e58 | A helper function for dijkstra to update costs of nodes and also to assign the the least cost path to each node that in the search list | void updateDijkstra(Vertex*& visiting, PriorityQueue<Vertex*>& F) {
for (Edge* edge : visiting->edges) {
Vertex* neighbor = edge->finish;
if (neighbor->visited == true) {
continue;
}
double costToCompare = visiting->cost + edge->cost;
if ((neighbor->cost) > costTo... | 1 |
1257fc11288c95bcb7d3a1a04cb9cda8 | 1a1e58fcc552d2232b518074b21c60ca | Retornem l'etiqueta amb més usos | return $this->db->select("tags", "*", [
'ORDER' => 'count DESC',
'LIMIT' => $limit
]);
} | 1 |
e324e12121efd58c06f9f38f1505bb2a | cf299b224169afe785e59b1a7c6fd64d | Test postscript parsing for total number of parsed sentences | pinav_sentence_t test_sentence = {
72,
"$PSLSP,193772.0585851,780,3963889.204,1001383.917,4879428.991,5,4.5*72\r\n"
};
pinav_output_t test_output;
pinav_parse_sentence(&test_sentence, &test_output);
} | 0 |
3afe2ad404332a8785a458abeda4fa56 | 45dc85703729e653e7a5d08f7950efac | Indique si la rubrique passée en paramètre est sous-rubrique de la rubrique courante | boolean isCategRelSubCateg(long id_cat, long id_subcat) throws DataAccessException; | 1 |
3865f889c2489ab8c4e323370e28ff8c | efd905039b14b4e6c28e5e22e5e8ad3e | Thread function which performs map operation. | void * run_mapper(void *mapper_function) {
int _me = findMyself(0);
while(1) {
pthread_mutex_lock(&filelist_lock);
char *file = pop_next_file();
pthread_mutex_unlock(&filelist_lock);
if(file == NULL) {
break;
}
((Mapper)mapper_function)(file);
... | 1 |
4917bf19a46e2f91aa1112824371082b | ca48b469fb823638d8ef255e3f95356c | Zero-pad to square, then resize | def pad_image_to_square(slice):
rows, cols = slice.shape
if rows > cols:
diff = rows - cols
pixel_data = np.zeros((rows, cols + diff), dtype='>i2')
pixel_data[:, diff/2 : diff/2 + cols] = slice
elif cols > rows:
diff = cols - rows
pixel_data = np.zeros((rows + diff, c... | 0 |
1afd74191ca9aebe67f546ff0caf4192 | 638e761c2c4070cdad61236425eb2524 | Rooted tree enumeration with internal nodes starting at some value and such
that the maximum leaf label is `max_leaf_label`. | class DiscoTree:
def tokens(self,global_root=None,max_index=-1):
if global_root is None:
global_root = self
if self.is_leaf():
return [ self ]
result = []
for node in self.covered_nodes(global_root):
if node.right_corner() > max_index:
... | 0 |
d76216f37a63f639cb803fe10e0eb27e | f67192820933fae8bcc66ec7216ebc51 | конструктор с параметром - строка в стиле С | MyString::MyString(const char * s)
{
cout << "The char* constructor was called: " << s << endl;
str = new char[strlen(s) + 1];
strcpy_s(str, strlen(s) + 1, s);
} | 1 |
702f58c04433cf09e01dc351e6b2d6e9 | 86f8494e37a2003b739d102f86d393de | By default, pages should be creatable | abstract class Crud extends AbstractController
public function isCreatable(): bool
{
return true;
} | 1 |
b8cf096b934ea77b5e0a7dd80e1e424b | 3132cbbfddcea4c0d97b28933aefd615 | Get angle in radians that robot is currently oriented. | getCurrentAngleInRad() {
return this.movement.currentAngle;
} | 1 |
6a75e4951a0627247120a5d399584d42 | e99629bbdacca58ba0163dc0127a9ef0 | Graph conflicts into tree structure. | {
if(threads == 1)
{
for(Integer i : checkList)
{
Vector<Path> classConflicts = buildClassConflicts(i);
for(Path p : classConflicts)
addConflict(p,conflictSets);
}
}
else
{
ArrayList<ClassConflicts> tasks = new ArrayList<ClassConflicts>();
for(Integer i : checkList)
tasks.add(... | 0 |
a96c9cbf99faba8cca4875b22f94f845 | 4d2569ab01054a2a240acad74d891c96 | Настраиваем конвертер данных | abstract class DataConverter
public function __construct()
{
} | 0 |
086cb4081f5ec48dbb572900a9379fae | 3ea5b95f2152c945f89191fce175a9c3 | 将风向传感器的角度值转换为风向16方位 | def ConvertWindDirect(winddirc):
if winddirc == "N":
winddirc = 0
if winddirc == "NNE":
winddirc = 22.5
if winddirc == "NE":
winddirc = 45
if winddirc == "ENE":
winddirc = 67.5
if winddirc == "E":
winddirc = 90
if winddirc == "ESE":
winddirc = 112.... | 0 |
78a70264d1a8f7f1b8554270ce72cb51 | 7b3195f4c22a806624d85758a517c558 | 按规则读Xml文件 | {
XmlDocument xDom = new XmlDocument();
XmlReader reader = null;
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreComments = true;
try
{
reader = XmlReader.Create(path, settings);
xDom.Loa... | 1 |
63194a9b285467a31021f0628806a829 | 87d51cb68f9a89ccb0d33c42ed14fb9d | The interval in hours between notification. This must be in the range [`1`-`72`]. Default:`2`. | class _SimpleMonitorState:
def notify_interval(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "notify_interval") | 1 |
912603363d98a48d7b4a8a3de0a33534 | 8adb639066e24160fa8e99b9b994ac6d | Remove the specified Tipo_Articulo from storage. | {
$tipoArticulo = $this->tipoArticuloRepository->findWithoutFail($id);
if (empty($tipoArticulo)) {
Flash::error('Tipo Articulo not found');
return redirect(route('tipoArticulos.index'));
}
$this->tipoArticuloRepository->delete($id);
Flash::success('Tip... | 1 |
90b03ef22c567688d100e13f907df107 | 1b7f2d518fdab4370f53aba4da69ae61 | 特征值法计算权重向量 | class AHP:
# 传入判断矩阵
def get_eig(self):
eig_val ,eig_vector = np.linalg.eig(self.array)
max_val = np.max(eig_val)
max_val = round(max_val.real, 4)
index = np.argmax(eig_val)
max_vector = eig_vector[:,index]
max_vector = max_vector.real.round(4)
self.max_val = ... | 1 |
aa20fdf8a49011207db5e99bce232999 | 01182348b1050a9c51f281e9c49c0478 | 更新现有服务绑定的流程版本 | if (record == null) {
return 0;
}
record.setDevVersion(record.getRelVersion());
int rows = this.versionDao.updateByPrimaryKeySelective(record);
bindImage2appVersion(record);
return rows;
} | 1 |
56ac22f963bd809c7f2c8e41b81d94c8 | 8a8a0ff5cbed3e8b2a479707ef9a1b92 | ** Scene::createFromFile | std::shared_ptr<Scene> scene, const glm::mat4& transform)
{
ModelLoader ml;
ml.Reset();
std::vector< std::string > texNames;
bool retval = ml.addModelFromFileToScene((std::string(filepath) + std::string("/") + std::string(filename)).c_str(), scene, texNames, transform);
if (!retval)
return false;
for... | 1 |
39f5d388e9a3bebee09c205a2cd305e5 | b527a54a3db8dc2ed158e9d2f093aaa6 | Sets the finalidad disabled editables. | App.cmbMov.setDisabled(true);
App.nfSemana.setDisabled(true);
App.txtfSucursalCR.setDisabled(true);
App.dfFechaEmision.setDisabled(true);
App.dfFechaRevision.setDisabled(true);
App.txtfObservaciones.setDisabled(true);
App.txtfComentarios.setDisabled(true);
App.imgbtnGuardar.setDisabled(t... | 1 |
09eec6b402a6b5f2a3ca2ef8755ce18d | 6200ac4ee7a7d825d946f52b01f150dc | Read from an Obograph JSON using ObographSource. | def test_read_obograph1():
t = Transformer()
s = ObographSource(t)
g = s.parse(
os.path.join(RESOURCE_DIR, "goslim_generic.json"),
knowledge_source="GO slim generic",
)
nodes = {}
edges = {}
for rec in g:
if rec:
if len(rec) == 4:
edges[(re... | 1 |
f470d3fda51fe06541d8849442215abb | 7038a4a0e812034e867f5c89902a9a84 | Create a new graph on top of this one. All scopes bound to
this graph will be lost in the new graph, but will not be
modified in this one. | class OnnxGraph:
def create_new_graph_with_same_config(self):
return OnnxGraph([], output_shapes={}, dtypes={}, target=self._target, opset=self._opset,
extra_opset=self.extra_opset, output_names=[]) | 1 |
f9d7efc56bbdf6d5c83cc55ba1a0fbe6 | b0953b7006f682a917c7249e00c5913a | 递归建立八叉树 | for(int i = 0; i < Num[num].size(); i++) {
Node* p = insert(Tree[num], Num[num][i]);
Tree[Num[num][i]] = p;
createTree(Num, Tree, p, Num[num][i]);
}
} | 0 |
5372963d520e8230bc8d334d691b865f | ddc5be8ce5bd4b3bc6d141c4ed54959f | The retention duration of retention policy. | class ClusterAutomatedBackupPolicyTimeBasedRetentionArgs:
def retention_period(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "retention_period") | 1 |
5ea5fb635a94b72abb465c9fa99e86b1 | b3fbd90f81f71b9fd2aab828d675fe21 | ショートメール通知判定 (入力値が0か1以外ならエラー) | {
if (!preg_match("/^[0-4]{1}$/", $_POST['round'])) : throw new Exception("入力フォームの不正な書き換えを検知しました。お心当たりのない場合,申し訳ございませんがメインページのお問い合わせからお知らせください。");
endif;
} | 0 |
d84d0580b156a5d3a42c9178192de2f2 | cf21a010c7c97c122e05fd1f4688067b | 将二维数组转化为用于同步到有道笔记的日报文本 | function shx_to_textarea($json){
$arr = json_decode($json, true);
$str_arr = array();
$str = "";
if(is_array($arr)){
foreach($arr as $v){
$str[] = $v['column'] . ':' . $v['value'];
}
$str = implode("\r\n", $str);
}else{
$str = $arr;
}
return $str;
} | 1 |
b8c1f7ccc1e83af3ee41ec55dccdb067 | 7f2f6f96b65b1a3bf6a2f51eceea125a | Print upcoming schedule and realtime data for an STM bus. | global stst, servo, bus, status, wait_status, P_RPM, S_RPM, ADC_raw, data_index, complete
if complete == 0:
stst.status_label.config(text = str(status))
stst.P_RPM_value.config(text = str(P_RPM))
stst.S_RPM_value.config(text = str(S_RPM))
stst.strain_value... | 0 |
475917bf0236f0b062e1e138755aeef3 | 2e866fa0b1ae366eb75a93272360db93 | This method lists all the entities inserted in datastore. It uses HTTP GET method and paging support. | @Path("/testpath")
public class JaxRsResourceWork
@GET
@Path("/getAllEntitiesTest")
@Produces("application/json")
public List<EntityTest> getEntitiesTest() {
return userdao.findAll();
} | 0 |
4e93a70a45571aff7c24581878d2054c | fd0aa1291fd19078463633afafbf07a0 | 保存聚合模型数据 | if (models == null) {
return false;
}
if (models.isEmpty()) {
return true;
}
if (models.size() > Constant.NUM_ONE_HUNDRED) {
for (List<WaterMetadataAggregateModel> list : ListUtil.getSubList(models, Constant.NUM_ONE_HUNDRED)) {
... | 1 |
af0047dc331ccecb1feba80b62973cf7 | 57109e13bea738eb22965d8a48f18858 | Listar os matches realizados com base nos filtros informados | {
$columnList = [
'id' => '#',
'title' => trans('linguagem.title'),
'stadium' => trans('linguagem.stadium'),
'team_a' => trans('linguagem.team_a'),
'team_b' => trans('linguagem.team_b'),
'result' => trans('linguagem.result'),
... | 1 |
46ce27ba08bc939d4d616ade672ee59b | 693ec4697c3144b9676c8374e9821123 | Computes A and B, or Eqn(A2) of Tara's second paper | def A22eq_A22(prms, k):
return - vnkn(prms, k) + (2 * prms[14]) - 1 - ALPHA * (2 * prms[2] - 2) | 0 |
1e3b3f17ca23a0da8510dfb249758e17 | 642a34f66ef1ab4220a6099b3d09c474 | Returns the number of elements contained in the #GHashTable. | gint g_hash_table_size (GHashTable *hash_table)
{
g_return_val_if_fail (hash_table, 0);
return hash_table->nnodes;
} | 1 |
711b79343aec2934905fc4e68e26ebe7 | b9437780280f8d0ef8ea95e2e7004bfa | Obtener los tipos de consultorio actuales para crear los controles | {
$arrConsultorios = Consultorios::all();
$listConsultorios = [];
foreach ($arrConsultorios as $key => $consultorio) {
$listConsultorios[$key] = $consultorio;
$arrConsultas = Consultorios::find($consultorio->id)->consultas;
$listConsultas = [];
... | 0 |
c6de42a5f948461663acc29eb593cbbc | b72c13b614fe1fb221c2173d33c6ae93 | APRS latitude format: DDMM.mm | deg = int(m_latitude);
mm = int((m_latitude - deg)*60);
ss = (m_latitude - deg - (double(mm)/60))*3600;
} | 0 |
ef8e7dd24e340fc343a20cb149a6b8e2 | 5866198c4f9e9d17d3c283ab607fc285 | Performs deconvolution with Tikhonov regularization on raw fluorescence stack. | class VMI:
def deconv(self, psf, iter=5):
self.data = restoration.richardson_lucy(
image=self.data, psf=psf, iterations=iter, clip=False) | 0 |
c64560750d9a74433a27d7f02f86ab02 | a4503a50851b92abc2d24142a505cb79 | MX record lookup | func LookupMX(name string) (mxs []*MX, err error) | 1 |
0c20db3f3ddfb1e18ec5c03cb569d7ec | 93f92cad8da10c9f395603cd3cbb8f13 | This initializes neurons in preparation for recurrence.
Note that the Critter should already have expressed its
genotype before this is called. | self.parents = parents
self.children = children
self.neurotype = neurotype
self.bias = bias
self.output = 0
self.linput = 0
self.error = 0
self.biasdelta = 0
if neurotype == 'input':
self.parents = []
elif neurotype == 'output':... | 0 |
e345d35cbd61bfa080e93b6882b36ce6 | 5968b3ca7e0dfaaa587540d733f29da8 | Returns the total amount of sunlight received | public class SleepFile{
public int getTotalLight(){
int total = 0;
for(SleepEvent list : events){
if(list.getState().toString().equals("LIGHT")){
total += list.getSeconds();
}
}
return total;
} | 0 |
b0662155534f744cad8515ab6580e02e | a97bb0af46ffbee2db44ef9722992e0f | If 1 is given for x and 1 is given for y, then the method should output true | if(y % x == 0){
return true;
}
return false;
} | 1 |
b9a2497dc9b77990a6dc1c49ef594307 | cbebf068065ae359d6a2df9e02c5fcb7 | Gets times and beam modes for a particular LHC fill. | kick_times: pd.Index, opt: DotDict
) -> Tuple[TfsDataFrame, TfsDataFrame, TfsDataFrame]:
db = _get_db(opt)
if opt.fill is not None:
timespan_ts = _get_fill_times(db, opt.fill)
timespan_dt = _convert_time_index(timespan_ts)
else:
td = pd.Timedelta(minutes=opt.time_around_kicks)
... | 0 |
e8e273466f7e73aefac40b7800d6daf3 | ac0ea9f63664236e113669b8db195fc7 | @brief retrieve the current valve state. | class EZRain(Device):
def getValveStatus(self):
self.querier.setMsgHandler(EZRainStatusMsgHandler())
self.querier.querysd(CONTROL, GET_STATUS) | 1 |
648da20d7afe53b7c4b637186113a8a9 | 8c318dbf965cc4df12c5cb6c2b73d33d | 请求查询回购放大倍数 | start_time = time.time()
MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 2329')
requesturl = baseUrl + "/api/78dk/platform/mm/money/merchantMoneyEnlarge"
LOGGER.info("修改预授信放大系数请求地址:【{}】".format(requesturl))
params = dict()
params["uid"] = uid
params["zoomCoefficient"]... | 0 |
e15907c82c33813ffde36a26e71187c8 | 17497f2cffc640c3d7322e00c2a38920 | 已发货订单量(根据发货时间范围) | {
$bh_id = $this->visitor->get('has_behalf');
$start_time = $_POST['query_time'] ? gmstr2time($_POST['query_time']):0;
$end_time = $start_time + 86400;
if($start_time)
{
$order_list = $this->_order_mod->find(array(
'conditions'=>"order_alias.bh_id={$bh_id} AND order_alias.ship_... | 1 |
a287c85474258c365bc2fb664781b9ae | add1edcd90e9a8a7830a42637b349de1 | Perform long addition of strings representing integers. | string
CBigINT_add (string s1, string s2)
{
int l1 = s1.length (), l2 = s2.length ();
int i = l1 - 1, j = l2 - 1;
string res = "";
int carry = 0;
while (i >= 0 && j >= 0)
{
int val = A (s1[i]) + A (s2[j]) + carry;
i--, j--;
if (val >= 10)
{
val -= 10;
carry = 1;
}
else
{
... | 1 |
a6ef69bfa7ceea2ad24540d81793c5df | 76fb4eaed7f1c8d9eee52c2a584017ca | 前のタスクを取得する。 | val iViewList = viewTask.toMutableList()
val num = iViewList.size
if (num > 0) {
return iViewList[num - 1]
}
return null
} | 0 |
4f47a28f0b23e1b231cb609b682af0d1 | 80854657983fdb121bcfe7d746961f9a | Re-throws exceptions during {@link #test()}. | public class TestResult
public TestResult throwed(final Throwable t) {
if (!failed) {
ob.add("error", t.getMessage());
}
failed = true;
if (ex == null) {
JsonArrayBuilder trace = Json.createArrayBuilder();
ex = Json.createObjectBuilder();
e... | 0 |
a0c3928bdc41a5a031f32d11cc42ff98 | 50dc9930e7886edb502634d984160545 | 获取订单中所有的产品IDS | class ServiceOrder
private function getProductsByOrder($service)
{
$oPIDs = [];
foreach ($service as $item) {
array_push($oPIDs, $item['product_id']);
}
$products = Product::all($oPIDs)
->visible(['id', 'price', 'stock', 'name', 'main_img_url'])
->... | 1 |
c90ccd2a6de0a6c2f4f1704d8011c19c | c762bdea5f569194a46bfcb7edc41af6 | Check to see if CapacityToRelease property is set | namespace Amazon.SecurityHub.Model
public partial class AwsWafv2RuleGroupDetails
internal bool IsSetCapacity()
{
return this._capacity.HasValue;
} | 0 |
57a308c1071294c19d64b7692b1837b3 | 94d9b3a404cce6675ec7487f8146d28f | Генерирует цену аренды транспорта (в рублях). | public final class Truck extends MotoVehicle
public int calRent(int days) {
return tonnage * 50 * days;
} | 1 |
592ff3a9ab000b8be7ea0d2298e84678 | 1de0d6d77d4184249135f41fc28ecf7b | try to determine if the child process is still active. If not, mark
the child as dead and close all IO descriptors etc ("func:`finalize`).
If `recover` is `True` and the child is indeed dead, we attempt to
re-initialize it (:func:`initialize`). We only do that for so many
times (`self.recover_max`) before giving up -... | if markAlive is not None:
self.set_active_status(markAlive)
self.on_listening()
while self._do_one_listen():
pass
self._sticky, self._pool = (None, None) | 0 |
f33cda3b08a0aefdd6c346ffc7dc010d | 5d09139a2a7b383db75f0a3f88c15d6a | Starts server session object. | class TechDivision_HttpUtils_HttpSessionHandler
extends TechDivision_Lang_Object
implements TechDivision_HttpUtils_Interfaces_Session
public function __construct()
{
session_start();
} | 1 |
ccf7d85b2bde50aad4efd5ead6628b22 | 691ebdae962975a4bbf9041f6a381f14 | Called when the landscape has been picked. | posY += dist / 4;
if (posY > 0) {
posY %= 10;
posY -= 10;
}
landscape.setPosition(landscape.getX(), (int) posY);
} | 0 |
f7808341a00dad2a7e3a60e3fb6763d5 | 04013ab0cc1a82f7dda51f503a0a2a56 | Checks if requests made via AJAX are cleared for access (user is logged in), responds with error if not | public function onlyAjax()
{
if (!(KIRA_DEBUG || Request::isAjax())) {
$this->renderError(400);
}
} | 0 |
3f66b39a8fc9cfdfac555c95de105ced | 2ebd01257e369ce45cab8772a5f48bf0 | Splits the query string into individual keywords, getting rid of
unnecessary spaces and grouping quoted words together. | {
$query = str_replace('-', ' ', $query);
$parts = explode(' ', $query);
$parts = array_map('str_normalize', $parts);
$parts = array_unique($parts);
return $parts;
} | 0 |
6a1d21042b7cb12c0552d725dffe117a | 18681de404fd6c9dca878624cf092531 | Lists Subjects from Courses.txt | void register_subject_TA()
{
string line,subject_1;
flag = true;
cout<<"---------------------------------- Courses Offered -----------------"<<endl;
file.open(index_subject);
while ( getline (file,line) )
{
flag = true;
for(iter = obj_TA.subjects.begin(); iter != obj_TA.subjects.end(); ++iter)
... | 1 |
24fca6185a4f22f9eac07b605d984e43 | 1bbf7998dd357f890e3d70d4d11f6b48 | 从请求的请求头里面获取userId | public abstract class UserValidationAspect extends ControllerAspect{
protected Long getUserId(ProceedingJoinPoint point){
Number userId=SpringMVCContext.getLongHeader("userId");
if(userId==null){
userId = (Number)getPropertyValue(point,"userId");
}
if(userId==null){
... | 1 |
dd43c8b2a23a11959a07f1a8977f1bb8 | db60195f96958c66884e2e5c5d3d8daf | Generate a configuration template if button is clicked. | class PropertyEditor(QWidget):
# Signals
def generate(self):
if not Main.isConfig(Main.get_json()):
QMessageBox.warning(self, "Warning",
'配置文件错误或者为空,无法生成训练数据',
QMessageBox.Ok)
return
a = TrainDialog(self)
... | 0 |
a1b64bd23fbe1f17436fe836888eee5a | fbd3e6c0ce708c986db4b1389eb7c60b | Displays error with proper execution command and terminates program. | def error(message, *args, **kwargs):
progam = os.path.basename(sys.argv[0])
sys.exit('{0}: error: {1}'.format(progam, message.format(*args, **kwargs))) | 1 |
98ec120dea676c8aecc5ca5ea521233c | bb3afaf6e717b1fd548144b34f97d796 | Проверка ситуации, когда в тексте не встречено запрещенных слов. | class VKTextAnalysis:
def check_text(self, text=''):
warning = []
current_position = 0
for word_unreq in text.split(' '):
if word_unreq == '':
current_position += 1
continue
word = self.morphology.parse(self.russian_word_preprocess(word_unr... | 0 |
df850a12fa771ec9cccf4765bf673156 | f4ebafbc254f478cda445f83c201654c | counts admin notifications that have not been dismissed | $dismissed = get_user_meta( get_current_user_id(), 'dnh_dismissed_notices', true );
if ( '' === $dismissed ) {
$dismissed = array();
}
return $dismissed;
} | 0 |
5060f957a7698fdf790410a23d99ec52 | c6010dc94674c78f0472ebaca4fd2d4f | Hide and Show the correct buttons of the user | if (profileOwner) {
followButton.style.display = "none";
followingButton.style.display = "block";
settingsButton.style.display = "block";
notificationButton.style.display = "block";
newBookButton.style.display = "block";
} else {
followButton.style.display = "inli... | 1 |
63c78c5ea77cf4ed50d075d24abb80bb | 6a82da8a32f677317d0acf5201401505 | 获取格林尼治时间戳 | public class MyTime
public static long getGMTUnixTimeByCalendar() {
Calendar calendar = Calendar.getInstance();
long unixTime = calendar.getTimeInMillis();
return (unixTime) / 1000;
} | 1 |
5a0afaa7d0429c41cc0c93f112826aac | 4c3f73b042706f36624230cb483ce57b | Gets the consumer specified by the provided consumer ID. | OAuth1Consumer getConsumer(String consumerKey); | 1 |
8097dc48ceaeb10acf8b2e18409cb583 | 18c41f67e9c004aacf6f1e69476fcf74 | 查看上一条评论 | {
$comment = Comment::findOrFail($id);
if ($comment->floor_num > 0)
{
$floorNum = $comment->floor_num;
}
else
{
$rootComment = $comment->rootComment()->firstOrFail();
$floorNum = $rootComment->floor_num;
}
$page = ce... | 0 |
df13637e40877348c574538f96b78577 | 1fee7a092b65f100fb79166d573a92ee | Crea un registro de una producción de extruido. | ventana_bienvenida.destroy()
global ventana_produccion
ventana_produccion = tk.Tk()
ventana_produccion.title("Registro de Producción Diaria")
ventana_produccion.geometry("600x500")
codigo = tk.IntVar()
codigo_label = ttk.Label(ventana_produccion, text = "Código:")
codigo_label.place(x=100, y=50)
codigo_entry =... | 1 |
0ca346828e9a51a06a787c4adc4b5abb | 16f072c2050e3fddc37583ab981929af | 请在此处作答 构造残差网络模型基本块 | class ResNet(keras.Model):
def build_resblock(self, filter_num, blocks, strides=1):
res_block = Sequential()
res_block.add(BasicBlock(filter_num, strides=strides))
for _ in range(1, blocks):
res_block.add(BasicBlock(filter_num, strides=1))
return res_block | 1 |
66acc3882c78c39ee186526d0b023b18 | 729f51f231be177f39221c30d105353b | renvoie un entier au hasard entre 0 et n-1 | int randn(int n) {
return rand() % n;
} | 1 |
5b0e96d5639f1e278727a51c2b399d8c | 0e64f1ed30adbac851162b91330fd641 | Reposition the entry meta. | function gb_entry_meta() {
echo '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('Posted on %s', 'reverie'), get_the_time('l, F jS, Y'), get_the_time()) .'</time>';
} | 0 |
600d0adec7d5d6257c6b3871fe2a9c08 | a0c239876e0cfc1e7d8960bafd87e779 | Write tracking record about successful login while IP address is blocked. | @Service
public class LoginAttemptService
public void loginSucceeded(String ip) {
assertIp(ip, MethodNames.LOGIN_SUCCEEDED);
int attempts = getCacheValue(ip);
logger.debug("Resetting failed attempts counter for IP [{}] from [{}] to 0.", ip, attempts);
attemptsCache.invalidate(ip);
} | 0 |
dd3b7c9a54725d4b86b0587664d4f5df | f096207b3ebf0b0a942e123ec63af307 | 设置路由,传入controller处理函数 | class RouterPattern
public function bindCtr($ctr, $method)
{
$this->handlerAdapter = new ControllerHandlerAdapter($ctr, $method);
} | 1 |
0f8d8d2819358f8254ecc8c504a0d637 | 0ee740330ffcdb1761dd4de3a87cb53e | Run the Smirnov-Grubbs test to remove outliers in the given data set. | def smirnov_grubbs(data, t, alpha):
x, o = list(data), []
while True:
n = len(x)
t1 = stats.t.isf(q=(alpha / n) / 2, df=n - 2)
tau = (n - 1) * t1 / np.sqrt(n * (n - 2) + n * t1 * t1)
i_min, i_max = np.argmin(x), np.argmax(x)
myu, std = np.mean(x), np.std(x, ddof=1)
... | 1 |
37387d96f4c228bf33f55d5db6c4e36c | b07af6e7117387dcb6173668262ebad5 | Setter to Diameter Header Command Code field. | class DiameterHeader(object):
def command_code(self) -> bytes:
return self._command_code | 0 |
d7f434cea81322af4e99f83418deb583 | 005e61cbd35f8455bd768c479947249f | auxiliar_1 - tabela com atributos freguesia, ponto de centro, numero de servicos iniciados e finalizados nela
try_except verifica se a tabela ja existe - se nao existe e criada | Conectar c = new Conectar();
String sql = "create table "+cpf+nome+"(id int not null AUTO_INCREMENT, nome varchar(45) not null,faltas int null,compensar int null,ativo bit null,previstas int not null,dadas int null,compensadas int not null, primary key (id))";
try{
PreparedStatement ... | 0 |
118eccb502e09c1f5cfaad65431c5ac7 | 89c64838fc205ac5fd57a2bf17e5d8ad | ReadFile - read file using file util and return byte array | static jbyteArray readFileJava(JNIEnv * env, jobject file) {
jclass utilClass = (*env) -> FindClass( env, JNIUTILS_CLASS );
jmethodID readFileMethodID = (*env)->GetStaticMethodID( env, utilClass,
"readFile", "(Ljava/io/File;)[B" );
return (jbyteArray)(*env)->CallStaticObjectMethod( env, utilClass,
readFileMeth... | 1 |
b846ff6ae3f2b91952ffa0b903c355c0 | ca88b66824dbda2a21cded1b3a3c0f58 | Attempts to get a loaded game sound from the asset manager. | public class Assets
public static Sound loadSound(String path){
return Gdx.audio.newSound(Gdx.files.internal(path));
} | 0 |
6f6037e78c0052ceb74b955fe4f79a8e | 34b04c48f48595e56f016d72c8ae5a26 | This function adds a flow to a switch so the switch will know the path and will not ask the controller again | stored_flows_box = deepcopy(self.stored_flows)
if not switch:
log.info('The Flow cannot be stored, the destination switch '
f'have not been specified: {switch}')
return
installed_flow = {}
flow_list = []
installed_flow['command'] = com... | 1 |
cc32ea05651aa34a8dddede125ff65fa | d92615933715c4977b4892b35fd9e5d2 | Sets the given element at the <see cref="CurrentIndex"/> as long as it does not already exist in the collection. | namespace Animancer
public class Key : Key.IListItem
public class KeyedList<T> : IList<T>, ICollection where T : class, IListItem
public void Add(T item)
{
var key = item.Key;
if (key._Index != NotInList)
throw new ArgumentException(SingleUse);... | 0 |
129eaf051d100c1554d0a6e696b37fe9 | c20e52c7a97eb50d9ad7264951daf03d | exclude "none" option from enum return (as technically every flag enum contains 0) | result = []
@reserved_cards_flags.each_with_index do |val,index|
if val
result.push(index)
end
end
result
end | 0 |
2ca7188ce2316b4aa73981d3cf4548f6 | b31b0d75166abaf1ae1380785ecc4432 | 获取用户相关配置项(年薪等级、家庭人口) | interface ApiService
@GET("user/getApplyConfig")
fun getApplyConfig(@Query("userId") userId:String?):Observable<ApiResult<ApplyConfigModel?>> | 1 |
6159b3fbaa4f87614e6ae09fd2b62d27 | c255f37ab74d199b1fdfb8d32c81b9ca | Retrieves the double buffering value. | public class Canvas3D extends Canvas
public boolean getDoubleBufferEnable() {
return doubleBufferEnable;
} | 1 |
5de8273a14ff1698dab5d9d5e76cfb13 | 562fb3d0b586c023ccb6d4102257d75c | @brief Initializes core hardware (GDT, IDT, PIC, IRQ subsystem) | bmk_cpu_init(void)
{
struct region_descriptor region;
int i;
fillsegment(&gdt[SEGMENT_CODE], SDT_MEMERA, SEG_PAGEGRAN);
fillsegment(&gdt[SEGMENT_DATA], SDT_MEMRWA, SEG_PAGEGRAN);
fillsegment(&gdt[SEGMENT_GS], SDT_MEMRWA, SEG_BYTEGRAN);
region.rd_limit = sizeof(gdt)-1;
region.rd_base = (unsigned int)(uintptr_t)(v... | 1 |
98b494e3e22624fc011056c1f951b1b9 | c17e4a234e6e42a5d4e4b037bf237349 | Erstellt ein leeres Diagramm. | Diagram createDiagram(); | 1 |
2a879567694a946746a28ed3cc18a029 | 6667840b8c1752e6ace687bd5d4795bc | Возвращает список координат, в которых может находится палуба | class Map:
def _get_coordinates(self):
result = []
amount = self._object_amount
for i in range(len(self._blocks)):
for j in range(self._blocks[i]):
to_build = BlockObject.HOME_AMT if amount > BlockObject.HOME_AMT else amount
amount -= BlockObject.HOME_... | 1 |
aace99e9367bdcfe58816d4875f5e3b0 | f89051f9ad92400aec4994f8a37e2553 | Returns the result of interpreting the object as an instance of '<em>Measurement</em>'.
<!-- begin-user-doc -->
This implementation returns null;
returning a non-null result will terminate the switch.
<!-- end-user-doc --> | EClass getMeasurementResult(); | 0 |
b5fb5abb8ec1307032ac4647dcdc5fd7 | 3ea8100dae3ba1f96b55ae68b7d30907 | Sets the value of the divLineDashLen property.
allowed object is
{@link BigDecimal } | public class DrawController extends JPanel
public void setDashLength(double dashLength) {
this.dashLength = dashLength;
} | 0 |
78b0db3fece391eeeca9d55e2fa9ce30 | ba507768d5f597de7e8f7ef6fbeb89bc | 返回 ANSI 格式代码。
您可以传递任何 `FG_*`,`BG_*` 和 `TEXT_*`
常量,也可以通过 [[xtermFgColor]]] 和 [[xtermBgColor]] 来指定格式。 | {
$codes = [];
if($this->foreground){
$codes[] = $this->foreground->getForegroundCode();
}
if($this->background){
$codes[] = $this->background->getBackgroundCode();
}
foreach ($this->options as $option) {
$codes[] = $option->getBe... | 1 |
f3043fbb465ec3b3d5de0701389b025e | f84fbf6e8645f1e786a8112d5264ad0d | Construct the sequence-based PEA regularization cost. Use the output
of the first spawn net of each clone of the base PeaNet instance. | class PeaNetSeq(object):
def _construct_class_cost(self):
class_costs = []
for i in range(self.seq_len):
Yd_i = self.Yd_seq[i]
Yp_i = self.PN_seq[i].output_spawn[0]
cat_cost = cat_cost_xent(Yp_i, Yd_i, lam_smooth=5e-4)
class_costs.append(cat_cost)
... | 1 |
27c1029ab4a539a6ec76d36eac9e7cef | 9b836c73c55ec112abcab517afad873d | Handles team API requests. | class ApiClient implements ApiClientInterface
public function handle(RequestInterface $request): ResponseInterface
{
$options = [];
if ($request->isV1()) {
$options['headers']['content-type'] = 'application/x-www-form-urlencoded';
} else {
$options['headers']['content... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.