query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
abbd47e194ccc240bf4479635fce1913 | 21a411dd23e9720cb6216e288eea992d | Creates a tournament and returns its ID. (REST) | db_connection, db_cursor = connect()
db_cursor.execute("INSERT INTO tournaments(name) VALUES(%s) RETURNING tournament_id", (name,))
db_connection.commit()
tournament_id = db_cursor.fetchone()[0]
db_cursor.close()
db_connection.close()
return tournament_id | 1 |
c0a2ba72b6c09cc3d9644043c26c0a97 | d521750d34951be3f3f3978de951892c | Change visibility of detected targets. | class DistanceMeasurement extends Component
get targetVisible() {
return this._targetVisible;
} | 0 |
3985779f99c02dba7c4e01dbde15d86c | 5c1297c61ed7a1d2c57560bf18b76494 | Get the nth ancestor of the given directory | class ElFinderVolumeClasticFileSystem extends ElFinderVolumeDriver
public function parents($hash, $lineal = false)
{
$this->dispatcher
->dispatch('elfinder.'.__METHOD__, new ElFinderEvent(func_get_args()));
return $this->driver->parents($hash, $lineal);
} | 0 |
935339eff3ee7825be0d5b9003a740d3 | 158521db342bb38ecabf5b593395a80c | Return the value in the dictionary.
If the key (k) is not found, this returns None unless a
default (d) is specified. | class vdict(dict):
def get(self, key_path=None):
try:
return self.__get(key_path)
except KeyError as e:
return None | 0 |
a691282cea00dd43aad367921756df1e | 67c2948a8ea51fa6ec18f71ae04e09b1 | 注册Tab条目的itemProvider | TabItemBuilder tabItemBuild = new TabItemBuilder(this).create()
.setDefaultIcon(android.R.drawable.ic_menu_send)
.setText(getString(R.string.news_fragment))
.setSelectedColor(getResources().getColor(R.color.colorBlue))
.setTag("A")
... | 0 |
59e0d8168c8b5bd9931060259cb77157 | 2c7f7624714a5a7afbcb7cc4eb822ed9 | 创建一个私有变量来保存socket通信对象 | class MySocket():
def __init__(self, sock_type=socket.AF_INET, sock_family=socket.SOCK_STREAM):
self.data = b'' | 0 |
f16c975dfe101c873b4f063f8b2293ff | 5f66045983762217315124d9da0038a7 | 全てのプレイヤーターンのUIを非表示にする | public class BattleController : MonoBehaviour
public void TurnEnd()
{
UIControl UICon = uiCon.GetComponent<UIControl>();
enemyGone = false;
playerGone = false;
UICon.TurnEndUI();
} | 0 |
d9899552c0b55ce17a2ccbe3e72a4615 | 1d73d566c9d8c56d2fed4907eee32c55 | Close both modals (even though both can't be opened at the same time) and just show the calendar. | class SingleClientForm extends React.Component
handleModalSelectDayPopupCloseRequest() {
this.setState({showSelectDayPopup: false});
} | 0 |
bfbc8f619754b63d0d807b0d84f84586 | c407d15f540787c6e3592ebf825e65a2 | Constructor used for initializing front and rear pointers to -1 - | priorityQueue::priorityQueue()
{
front=rear=NULL;
} | 0 |
4e11181df3a926c2319e73e142871127 | 8947728e99687f2c16196e5e1ff2bdea | Toggles the log view. | class Log:
def view_log(self):
self._pane.withdraw() if self._active else self._pane.deiconify()
self._active = not self._active | 1 |
00c5c95377d6f7242017c5937a3e8dad | 2a211ae5f5f7296c397fcebf017e5277 | 保存教师评学数据 | boolean save(TeacherSuggestion teacherSuggestion); | 1 |
105eb796c2e7d5e2ecd55caaf619050e | ad1c6ddb01c17e518de79d4603d82708 | 结束时间校验 | $result = $this->_checkDate('end_time', '结束时间格式错误');
if (strtotime($this->getFieldValue('start_time')) > strtotime($this->getFieldValue('end_time'))) {
$this->setFieldMessage('end_time', '结束时间必须大于开始时间');
return false;
}
return $result;
} | 1 |
00e65430a75e099aadb31f00528fdeb4 | 7c46d003a0d5bdf5adfa9efefbbe110a | Отменить внесенные изменения в запись о сотруднике | export class EmployeeHandler
async cancelChanges(): Promise<void> {
return (await this.driver.findElement(this.cancelButton)).click();
} | 1 |
bbcc3242cc159a1729b04c8c2249bce2 | 2a9339c8f9c83eb45ae23449c2bb4660 | 매수호가 | class TextKiwoom(QAxWidget):
def get_highest_trade_amount_jusik(self, minute="15", market="101", request_by_amount="1"):
self.dynamicCall(self.FUNC_SET_INPUT_VALUE, "시장구분", market)
self.dynamicCall(self.FUNC_SET_INPUT_VALUE, "정렬구분", request_by_amount)
self.dynamicCall(self.FUNC_SET_INPUT_VALUE, ... | 0 |
77a7f002371c9855441093c01d48b473 | cd29705670ee2a25aa7241ee317d7030 | Tri la liste des candidats en fonction de ce qu'a choisi l'utilisateur | class CarriereController extends Controller
public function index()
{
$candidats_spontanne = Carriere::orderby('created_at', 'DESC')->get();
return CarriereResource::collection($candidats_spontanne);
} | 0 |
5ad0eec69fe15c0811922f5695f95747 | 75d9768af889b373a9312596897fa22b | Gets the rule collection in the response. | public function getRuleSet(): RuleSet; | 1 |
b4f7fc8eb8cc4db9406b3dd94a000063 | 4b2dafecbfa7ef32d4d70956a6da3df0 | Rereads configuration from ini file. | namespace FTXFixer partial class FTXFixerWnd : Window, INotifyPropertyChanged
private void ReloadSettingsINI() => LoadSettings(); | 1 |
e1f4df98fdfaa98575a4f7d9eb288d9d | 61639861de1f33510b1b90e87d90ade4 | remplir l écran avec le blanc | void Vider_Vue()
{
MLV_draw_filled_rectangle(0 ,0 ,959 ,539 ,MLV_COLOR_WHITE);
} | 1 |
43a56dba4a962776b3fcb25ff1190841 | 3bf33997ec654b225e3d0d4828a51adf | Creates an absolute path starting from the `@solid/community-server` module root. | if (doesExist(import.meta) && doesExist(import.meta.url)) {
return join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
} else {
return join(dirname(process.argv[1]), '..', '..');
}
} | 1 |
fae8951341ec263de008afba0822dc00 | 0c0f84768d4323a71d1c4af3a623c2c3 | 1. 通过遍历实现 | public class PreorderTraversal
public List<Integer> preorderTraversal1(TreeNode root) {
List<Integer> list = new ArrayList<>();
preorder(root,list);
return list;
} | 1 |
41d4eb92bb0e650f773d9ae392ba1149 | 5b36abd8cc2628196abd6e04ab5230f5 | tests the all method of dictionary __objects | class TestStorage(unittest.TestCase):
def test_all(self):
object = models.storage.all()
self.assertIsInstance(object, dict) | 1 |
a091790e5989e5ad94888b38552ac5a7 | 1c9e9b2608ccceb80b77afadc1260fce | Output a line of notification text to the display. | def notify(text):
sys.stdout.write('\t'+ROPGENERATOR_COLOR_ANSI + '% ' + END_COLOR_ANSI + text+'\n') | 1 |
e3dc6e4d07e578ded71b6213b814fc5d | c67439c2e3622db8c01fe1d04c623096 | Return array of the number which represent the layout of the footer. | global $axiom_options;
$col_nums = 3;
$layout = axiom_get_footer_layout();
$col_nums = substr($layout, 7, 1);
return $col_nums;
} | 0 |
cce3b46cfad54bc39672622b61bc81d9 | 0a4156b9665e349192b1f4e4a48e7b32 | 根据租户ID加载物资规格 | if (StringUtils.isBlank(p.getId())) {
logger.debug("loadSpec id = " + p.getId());
return;
}
Spec specInfo = new Spec();
specInfo.setProductID(p.getId());
p.setSpecList(specService.selectList(specInfo));
if (p.getSpecList() != null) {
logger.debug("loadSpec = p.getSpecList() = " + p.getSpecList().si... | 0 |
c916f649be423b2a321d2276d5942556 | 26da7119e1d00de3593b77b807c7dc66 | Gets the callback function defined using @ref tsk_app_set_fatal_cb(). | tsk_debug_f tsk_debug_get_warn_cb()
{
return tsk_debug_warn_cb;
} | 0 |
bad6d191d1ab82f4bd8bd17a6a2b611c | 6f1126022459e31ae9c972a90a123484 | Select the initial states for the AO channels, by using the correct
offset of the scanning galvo and the voltages of the switching galvos | {
{
t_boolean is_switching;
t_int result;
t_uint32 num_final_analog_outputs = 0;
hil_task_stop_all(Project_Model_Correct_DWork.HILInitialize_Card);
hil_monitor_stop_all(Project_Model_Correct_DWork.HILInitialize_Card);
is_switching = false;
if ((Project_Model_Correct_P.HILInitialize_AOTermi... | 0 |
d52dad6f3dabdd36a0347e1fac2c6654 | 7f61448ad6da3ef0f9cb03f40c5be655 | String function for easy representation and comparison | cases like (1) | 0 |
12d5c5c61efb12f94a3cb1c7d48210db | 2aede3f27758da579eb6f5abbba70185 | Loads register C into register D | {
d_registers[C] = A == d_registers[B] ? 1 : 0;
} | 0 |
5b54f77e506282031f77196486b134fb | bfe33a4481b63291e5a5c9e647cdb197 | 获取 订单积分 的属性值 | @Entity(name = "SO_ORDI")
public class Ordi extends DbInstanceId implements java.io.Serializable
@Column(name = "POINT_MONEY")
public BigDecimal getPointMoney() {
return pointMoney;
} | 1 |
07d5d00976796feb4fa9568f1151d102 | 9e38bca0d285442356a1fc87c48e8358 | does a step on the line (weight update), calculates loss and gradients at the new position. Sets the new step
direction vars. | this.weight += (this.deltaWeight + momentum * this.oldDeltaWeight);
this.oldDeltaWeight = this.deltaWeight;
this.deltaWeight = 0.0;
} | 0 |
fba9b3805c8dfb66c3f5af3a0374e03b | 3e2abf5101d96ecf12313d84bb990d42 | Runs the setmargin algorithm. | col = SolutionFactory()
s1.Reset()
s2.Reset()
s1_margin = 0
s2_margin = s1.CurSpan()
s2.MoveToMargin(s2_margin)
while True:
g1 = s1.CurGradient()
g2 = s2.CurGradient()
overhang0 = s2_margin - options.m0
overhang1 = s2_margin - options.m1
g_cur = (g1 + g2 -
options.c0 *... | 1 |
cf15b3dd6d27c9fe7a0967c8f202fdda | 9b5f2c2193fb1cfefb4a3ffe087462b1 | Compute the coefficients for the generating function S and its derivatives. | self._compute_constants(samplerate, cutoff, resonance, dbgain)
self._a_coeffs[0] = ((self._a + 1) -
(self._a - 1) * self._cos_w0 + self._sqrtAlpha)
self._a_coeffs[1] = ((2.0 *
((self._a - 1) - (self._a + 1) * self._cos_w0)) /
... | 0 |
e690879dbf9e55be9c4dc3260b317a15 | 217477d9a72763c13fd3cbde2c484538 | Create a box from two values. Values are reversed if needed | shape := newShape()
box := &BoxShape{
Polygon: &PolygonShape{Shape: shape},
Width: w,
Height: h,
Position: pos,
Shape: shape,
}
hw := w / 2.0
hh := h / 2.0
if hw < 0 {
hw = -hw
}
if hh < 0 {
hh = -hh
}
box.verts = [4]vect.Vect{
{-hw, -hh},
{-hw, hh},
{hw, hh},
{hw, -hh},
}
pol... | 0 |
f30a04ad1edf86dc924f5e9f04178d4c | eedd8921f223e78d1714401e100d54e6 | an extern func is one that has no basic blocks | is_special_block(struct kedr_ir_node *node, struct kedr_ifunc *func)
{
return (is_transfer_outside(node, func) ||
(node->dest_inner != NULL &&
node->dest_inner->orig_addr <= node->orig_addr));
} | 0 |
b7fb14688700581f1aca0affb06368fa | 8797c832a50a53aea6d6c2775410a7aa | Performs forward or inverse 1D or 2D Discrete Cosine Transformation | def dct(x, type=2, n=None, axis=-1, norm='ortho'):
if n is not None:
x = _truncate_or_zero_pad(x, n, axis)
n = None
dtype = np.result_type(np.float32, np.asarray(x))
x0 = np.asarray(x, dtype=dtype)
if dtype == complex:
return (_dct(x0.real, type, n, axis, norm) + 1j *
... | 1 |
c829cbc560460987004cae24024d9366 | 3064e201d48445cbc91a5f5c2e338095 | 關閉當前頁面 | class BasePage:
def close_page(self):
self.driver.close()
log.info("当前页面 --> 关闭") | 1 |
eed1e3e974b081bf21b1d5406e3cfbc1 | f527816b39d86838510a286dbf706379 | SUMMARY: deletes and recreates binary folder causing all YAML tool files to be deserialized again
INPUT: none
OUTPUT: none | import shutil
for d in [bin_folder, tmp_folder]:
if os.path.exists(d):
shutil.rmtree(d) | 1 |
3b71999b8e82c3a88531f031417f051e | bcb4ae9ed7fc7ae1aaa2244f0cf162d1 | handles what happens when a number on the pad is clicked | function numberPressed(numberId) {
if (numberId === 'one') {
numbers = numbers + '1';
if (shouldPop) { expressionArray.pop() }
expressionArray.push(numbers)
}
else if (numberId === 'two') {
numbers = numbers + '2';
if (shouldPop) { expressionArray.pop() }
expr... | 1 |
f43fb6f67c1426fa948b7b90eb2cb688 | 577016c1f44bc9563d1ff1f86ca5351a | Gets matching collation name for a language ID. | {
$languageID = $this->languageID;
$languageID &= 0xff;
switch ($languageID) {
case 0x09:
return 'en';
case 0x0c:
return 'fr';
case 0x07:
return 'de';
case 0x10:
return 'it';
... | 1 |
a15b846f4b4c437cf56d370bf40ed094 | b0f36cac0fad384caecc0238e4939ba4 | 用户是否已经输入过邀请码 | $invite_code = I('invite_code','','trim');
if(!$invite_code){
echo 0;
return;
}
$count = D('Admin/Admin')->isHasCode($invite_code);
if(!$count){
echo 0;
return;
}
echo 'true';
} | 1 |
23e5ceee40a3aeb8091974ac2afc7202 | c98181954efc55375ae3d9ac99b16ade | 如果三层iframe都存在 | var length = $('iframe',window.top.document).length;
var arr = $('iframe',window.top.document);
for(var i=0;i<length;i++){
if(window === arr[i].contentWindow){
return arr[i];
}
}
} | 0 |
2d9e8a2dd198ec36b830ef2143f3a63a | c8f9cae4625e494cc95d7cd472affc12 | Returns the current torrents in a dictionary. | torrents_hash = []
torrent_list = self._call('core.get_torrents_status', {}, [
'active_time',
'all_time_download',
'download_payload_rate',
'finished_time',
'hash',
'label',
'name',
'num_peers',
... | 0 |
3adea53327676a3841e8bd9f8a019495 | a348953acd2ae842e309df9a4409ca88 | CHECKS IF ALL GOALS ARE COMPLETE //// | namespace PlanValidation1
class PlanValidator
private bool IsGoalTask(Task t)
{
bool[] actionVector = t.GetActionVector();
for (int i = 0; i < actionVector.Length; i++)
{
if (!actionVector[i]) return false;
}
return true;
} | 0 |
618efa397d43b9e1195adf35a4b64c2c | 585462ae4defc2d163e5ff1d3e34a7c8 | 保存HtlQuotaJudge实体 | public void saveTSysYhJs(TSysYhJs tSysYhJs); | 0 |
ca3f6c553ea3b1af69604925948fbec7 | 1c8afb295fb5a4121a618199f5f3b38d | Returns a dictionary mapping partial module names to a list of the
methods within that module | class Codegen(object):
def modules(self):
return self._modules | 0 |
ed82851f828f92669166597226481745 | d02a7390571d537d0e6c60847de8b7ca | Retourne les produits concernés par le tableau des idProduits passés en argument | abstract class DShopAdapter{
public function getProductsByID( $productIDs )
{
return array();
} | 1 |
ffaba932879e0e547feabe2f8f52bf3e | d366d454525042df12eb1876c521bcb3 | Display the list of users followed by a screen name, sorted in
reverse order by the number of followers of those users. | class Session
public void printFolUserList(IDs ids) {
try {
do {
for (long id : ids.getIDs()) {
String followerName = twitter.showUser(id).getName();
String followerScreenName = twitter.showUser(id).getScreenName();
System.o... | 0 |
37bff713acdc780e6bc3ac4f7e15d40b | eec7233a51632ab6e49c832675d30f89 | Gets the payment history of the given user | namespace Vapps.Payments
Task<PagedResultDto<SubscriptionPaymentListDto>> GetPaymentHistory(GetPaymentHistoryInput input); | 1 |
97207f4b74fb9478a3319ce39330b583 | c11ec8e418c2c673dc97418904136be4 | 清空R20、R21数据 | class RunTaskService(object):
def clear_all_data(self):
args = None
self.run_task("RisDeviceTask", "clearalldata", args) | 1 |
63d13587b17c6a8fc73a733f0423c594 | 3c6409316f0475d8699607a1c982e4e3 | Set contactGroupAddress | {
$db = $this->negotiateDB($database);
if ( $reference === null ) {
$reference = 'WPTripolis' . (isset($_SERVER['REMOTE_ADDR']) ? '::' . $_SERVER['REMOTE_ADDR'] : '::CLI');
}
$body = array(
'contactId' => $contactId,
'contactGroupIds' => array(
'contactGroupId' => $groupId
),
'reference' => ... | 0 |
8f56868cfb823b66d1abac393de309a3 | b267752a2f7e01ccc00d9935c3a5ebc2 | Get enable dirty check setting | public abstract class AbstractObservableEntity<T extends SMDIdentity> extends AbstractObservable implements ObservableEntity<T>
protected void setDirtyEnabled(boolean isDirtyEnabled) {
this.isDirtyEnabled = isDirtyEnabled;
} | 0 |
e0a481ed4106b250f3729352fd2012de | cd5a62ef80219d22bf1b47d927345e21 | Emits IL instructions that load the "$this" variable onto the evaluation stack. | namespace QuercusDotNet.Expr{public class ExprFactory
public ThisExpr createThis(InterpretedClassDef cl)
{
return new ThisExpr(cl);
} | 0 |
143493072ea93c4b62f6acb04cf7b9f0 | fb142c11a0799804987ee47449793ba0 | Получить размер линии | class Tr extends Widget
public function line()
{
return $this->offset + 1;
} | 0 |
e3e5a034b3e28dffdd759a86f4edb3e0 | e67c9b7fbf0cb0457bf6af6c8d554875 | 账号只允许字母、数字、下划线 | public class AppUtils
public static boolean checkUserAccountSymbol(String checkString) {
Pattern pattern = Pattern.compile("^[A-Za-z0-9][A-Za-z0-9_]{0,}+$");
Matcher matcher = pattern.matcher(checkString);
if (matcher.matches()) {
return true;
} else
return false;... | 1 |
e5b4d18530c3ab47bf58cbeb4a615c61 | f222f1cab1b0f582ac87a05240a26eac | Getter of Special Commitments
Any special commitments associated with this job posting. Valid
entries include VeteranCommit, MilitarySpouseCommit, etc. | class Embedder:
def get_special_instructions(self, rec):
return rec.get('special_instructions') | 0 |
9d4bbe74d4169ebcd62a6fc33b784847 | 66fcc83246521d24499c5ba2d0b1d9f7 | 跟据登录ID取得登录名 | public abstract class OrganDao extends GeneralDao
@OQL("select loginName from User where userId=:1")
public abstract String getLoginName(Integer userId) throws Exception; | 0 |
5bc48b84245c0444eb76f046723d3ad5 | 5c3ff983d31486368cb84f251d3b01ba | the game state is initially set to inactive | class GameStats:
def __init__(self,ai_game):
self.game_active = False | 1 |
f240d3a5612642a984ef4a98422cdb48 | 2301530f4f51d0f896abbb8fe40f084d | 对生成的对象进行相关操作,比如:旋转,缩放等
目的是让图片不太好识别 | def get_image_generator():
image_datagen = ImageDataGenerator(rotation_range=15.,
zoom_range=0.2,
width_shift_range=0.1,
height_shift_range=0.1)
return image_datagen | 1 |
1d2813b9fae8e0f24c083abcb6f0d07e | 0ab9b73ff2f54fbf65a07b66b2ed46f8 | 获取商品告急数量总数 | @GET("/FireServices.asmx/getUndealAlarm")
Observable<String> getUnDealAlarmCount(@Query("dqid") String dqid); | 0 |
fbc3cab6b8b1d12ec419d8fb9c084ddf | bfd39b5e686947105b922d189b31cb60 | Add the uniform confidence noise to the confidence scores. | class SemiSupervisedLearner():
def confidence_scores(self, hp_dists):
ranking = np.argsort(-hp_dists, axis=1)
return hp_dists[np.arange(ranking.shape[0]), ranking[:,0]] -\
hp_dists[np.arange(ranking.shape[0]), ranking[:,1]] | 0 |
d4510a7c41fbca8ca9e385293a41b737 | 35f6f1bd8baaad6446a9490ba47fc335 | Set the maximum buffer size. | public class CSVReader
public void setBufferSize(final int size) {
if (size > 0) this.max_length = size;
} | 1 |
16c5bfb86e2e596fbb3ea12268aa14f3 | 2358de10893688d12f3d8e94a604bc5f | Gets a feed by it's token | {
var _feedDataSource = App.Current.Resources["feedDataSource"] as FeedDataSource;
var _feeds = _feedDataSource.Feeds;
try
{
var matches = _feedDataSource.Feeds.SelectMany(group => group.Items).Where((item) => item.Title.Equals(uniqueId));
... | 0 |
4c84c200e27291f0788cf3ec3c4215ea | a45630a95fb23d6714b2724db1160ffe | \brief Virtual function that defines the characters allowed in operator definitions.
\sa #ValidNameChars, #ValidPrefixOprtChars | namespace qmu
void QmuParserBase::DefineOprt( const QString &a_sName, fun_type2 a_pFun, unsigned a_iPrec,
EOprtAssociativity a_eAssociativity, bool a_bAllowOpt )
{
for (int i=0; m_bBuiltInOp && i<cmENDIF; ++i)
{
if (a_sName == c_DefaultOprt.at(i))
{
Er... | 0 |
b4405c3f1335a655d859fe5a75aaddbe | 190941b3ef3f58401d30e92d83ec99d9 | Tests a simple example. | class TestMain(unittest.TestCase):
def test_simple_example(self):
usb_size = 1
memes = [
('rollsafe.jpg', 205, 6),
('sad_pepe_compilation.gif', 410, 10),
('yodeling_kid.avi', 605, 12)
]
expected = (
22,
{'yodeling_kid.avi', 'sad... | 1 |
05966c2e2a7982670affb406a8f26933 | c497e00062bb28036623d8b5f3ff34de | Construct an empty string with enough capacity pre-allocated to store
at least `n` bytes.
Will create a heap allocation only if `n` is larger than the inline capacity. | def _malloc_char_array(n):
t = ctypes.c_char * n
return t() | 0 |
38806502f6ebd0d8c537eda059399fe0 | d5751a15f2733b4ebd57b319b8351b72 | Sets up a VT-x or AMD-V session.
This is mostly about setting up the hardware VM state. | {
uint64_t tmp64, vmxon_region_pa;
uint32_t tmp32;
void *vmxon_region_va = (void *)get_cpu_var(vmxon_region);
tmp32 = (uint32_t)msr_read(MSR_IA32_VMX_BASIC);
(void)memcpy_s(vmxon_region_va, 4U, (void *)&tmp32, 4U);
CPU_CR_READ(cr0, &tmp64);
CPU_CR_WRITE(cr0, tmp64 | CR0_NE);
CPU_CR_READ(cr4, &tmp64);
CPU_CR_WR... | 1 |
00a8df6237ea894c4ed6d8f31bcbc8ef | 2525deb00a957e2a7fc2849ae74e2f24 | Test case for submit_udf | self.CANEngine.load_config('tests/configurations/conf_replay_uds.py')
self.CANEngine.edit_module(
2,
{
'pipe': 2,
'services': [
{"service": 1, "sub": None}],
'mode': 'UDS',
'range': [1, 2]
... | 0 |
65fba485bc1b6810c246b31d624954c8 | a59a70c59d703aabf362f30ad35de736 | Build a text encoder from config. | base_architecture(args)
encoder = TextRecognitionEncoder(
args=args,
)
decoder = LSTMDecoder(
dictionary=task.target_dictionary,
embed_dim=encoder.embed_dim,
hidden_size=args.decoder_hidden_size,
out_embed_dim=args.decoder_out_e... | 1 |
7bd2de4e4844b3a0fa5ee70908fd1649 | 1f9bbff2a1db9787b834c5fac351d98c | Return new $resource instance | {
$resource = property_exists($this, 'categoryResource')? $this->categoryResource : 'App\Models\Category';
return (new ReflectionClass($resource))->newInstanceArgs();
} | 1 |
2c4e8f206511ec1d44b26b0eee2d369d | da6e94d237ee4253045e17d81b8e89af | 获取上星期开始日期 | var weekStartDate = new Date(new Date() - 24 * 60 * 60 * 1000 * 6)
return formatDate(weekStartDate)
} | 1 |
fe18466b88b5f4d2e8b9fa57149505bc | fb6b6403fbf60edf458145eda0f10c75 | Create indefinite length application class TLV object.
This function can also create indefinite length context specific class TLV object. | {
$this->tlvData .= pack("C", TLV::OBJECT_VAL);
$className = get_class($object);
if ($className == "stdClass")
{
foreach ($object as $key => $value)
{
if (is_callable(array($object, $key)) || is_callable($value))
{
continue;
}
$this->tlvData .= $key;
$this->tlvData .= "\x00";
... | 1 |
6eadee44f02b0477740451f8fcc03f52 | adeb7060fdd895118ddfe06d2eb2a1b4 | 设置已拉取信息 | var resInfo = data;
if (resInfo == null) {
return;
}
info = resInfo;
} | 1 |
f80ad945d865cc9eab16897edc1bd68a | 60a19aa7d60ff85ee1c83fc6cf8a540a | ユーザプロフィール画像の更新 | $statement = "UPDATE user_info SET profile_image_path = ? WHERE id = ?";
$this->make_query($statement, [$path, $id]);
} | 1 |
e827e94008c59b5b5bb6e2a42051730a | 353d6484d4979b3358a5a74b7ab34512 | ip4 -> ip6 (decap) 6rd VRF test | testIpv4()
{
BOOST_TEST(make_ipv6_address(
"::ffff:1.2.3.4").is_v4_mapped());
BOOST_TEST(! make_ipv6_address(
"1::ffff:1.2.3.4").is_v4_mapped());
BOOST_TEST(make_ipv6_address("::ffff:c0a8:0001"
).to_string() == "::ffff:192.168.0.1");
BOOST_TEST... | 0 |
f297f77a31186b71c20a11b6a8613c57 | 281c0a4b3f645d387e00df240325dfdc | 根据买家用户获取指定状态、订单编号的订单 | class Order extends Model
public function getOrder($user_id,$status,$page,$limit){
return $this->where(['order_status'=>$status,'user_id'=>$user_id])->orderBy('created_at','desc')->limit($limit)->get();
} | 0 |
03ebee485327bf6d252c38780718df83 | 9c9cb6131bfc09faf8fdf5da786c120e | Tests the convert_value method | prop = element_factory.create(UML.Property)
prop.typeValue = "integer"
assert type_converter(prop) == "int" | 0 |
59bdfe31e7ad34cd7add1a0089351b67 | f2c8e5bae4408eaca953f7ede18e6dc1 | Coin Change problem WITH REPITITION to find all possible COMBINATION by Subsequence approach | public class MinRepeatitiveCoinsForGivenSum
public static void main(String[] args)
{
int[] denominations = {1,2,5};
int SUM = 24;
int res = getMinmNumberCoins(SUM,denominations);
System.out.println("res== "+res);
} | 0 |
97c8da1df4d47e893e1e5d2c3e401e0f | 0077392338069d15c635481727af5cf3 | GET: api/Réunion | [Route("api/v1/congregacao")]
[Authorize(Policy = "Member")]
public async Task<IActionResult> Get()
{
try
{
var result = _service.ObterTodos();
return (result == null || !result.Any()) ? NoContent() : await Response(result);
... | 0 |
6ca1f21d2cbe8ea7da0fbc959bea2bbf | 611dc9cfa8991e64d1e0f10be0b3e282 | Registers a newly created transmission with internal data models
as required. | class TransmissionClient:
def register_services(self) -> None:
def add_torrent(service: ServiceCall) -> None:
if not (tm_client := _get_client(self.hass, service.data)):
raise ValueError("Transmission instance is not found")
torrent = service.data[ATTR_TORRENT]
if... | 0 |
f9ca77106980dce6408be3cc3f62c42f | 9770bcdc756f9ae610a8d537eca9ae73 | Copy wheel members into their archive locations.
category: 'purelib', 'platlib', 'headers', 'data' etc.
source: files belonging to category
root: relative to root directory i.e. '.', 'src | class Wheel(object):
def fixup(self, install_paths):
root = os.path.dirname(self.distinfo_location(install_paths))
records = list(self.records())
py_files = [
os.path.normpath(os.path.join(root, record))
for record, _, _ in records
if record.endswith(".py")
... | 0 |
addb2cea1258bde599484e695ddd0c94 | a46cf3ede9c20f801cbaebb150989009 | Returns the direction the menu will be pointing at when popped up. | interface NavigationBar
fun getNavigationDirection(): Int | 1 |
f8db712f788c1cee8782ab87cb9b6bb9 | 927e55517b178b8ea89342b989d6ef35 | Function to handle an object property relation, given the type of
the parent objct, and the candidate object JSON. This function
intelligently introspects the candidate object, and will recursively
add a nested JSON object to the ontology, or resolve an ID reference
to an existing individual in the ontology.
This funct... | class Loader():
def __handleObjectProperty(self, object_property: str, i_type: str,
i_id: str, candidate_obj: object) -> Union[list, ThingClass]:
isList: bool = type(candidate_obj) is list
if not isList: candidate_obj = [candidate_obj]
ret_obj = []
for obj in candidate_obj:
... | 1 |
26f04fd5ad866bc69b2d46d83ce61598 | e653e44a02c59f47796ca0bd93e27ba7 | From 'foo_bar' to 'Foo Bar' | abstract class AbstractField implements FieldInterface
private function humanizeString(string $string): string
{
return ucfirst(mb_strtolower(trim(preg_replace(['/([A-Z])/', '/[_\s]+/'], ['_$1', ' '], $string))));
} | 1 |
3cfaa02f430374484999c2c01bea1385 | c93accddca52850febfe8fbb671e9e61 | Prompts for a card to be swiped and removes that card from the database | class Removinator:
def remove_card(self):
self.send_command('REM') | 0 |
378ce772ff3107a5963616cf98e4c208 | 17ec3cb2da6f21b68943a7e44d9b6013 | Возможность сделать запрос на сервер. | {
$response = $this->sendCommand(static::RCMD_REQ, $query);
return $response->getCode() !== Response::RCMD_GENERIC_ERROR;
} | 1 |
777bba20c7d2d863f19f793a28359314 | 7357bd819bf41f74f8ddeb1bc05e1be0 | 类型:大类 / 一类-二类 | public class CategoryAdapter extends MyBaseAdapter<Object>
@Override
public int getViewTypeCount() {
return 2;
} | 1 |
54366ce014ea9d4e0cf11e33597f4b76 | a03cf69cb320b6bfedd80801ed613e01 | 上一个引导 | uid = req.get_argument('uid')
skip = req.get_argument('skip', '')
goto = req.get_argument('goto', '')
step = int(req.get_argument('step', 1))
user = user_app.get_user(uid)
if user.is_new():
return search(req, msg='user not exists')
msg = ''
if skip:
user_app.skip_guide(us... | 0 |
e5fb553f5b4f7f71001f2bc1321d4f9d | 5539ac7552f83656417a011defd3271c | function to generate normal random data | void generateRandomNormal(float* data, size_t size, float sigma){
for(size_t i = 0; i < size; i++){
float u = float(rand())/RAND_MAX + EPSILON;
float v = float(rand())/RAND_MAX;
u = u <= 1 ? u : 1.0f;
data[i] = (float) (sqrtf( -2 * logf(u) ) * cos(2 * M_PI * v) * sigma);
}
} | 1 |
4746cb9debd6bc711c9063004b458928 | 5837afe6a8f80e27c8073dba73339487 | 获取雇主相关联系信息 | $member = self::$logic->getRs(['recruit_id' => $recruit_id], 'company_id,contact_company,contact_name,contact_tel,contact_mobile,contact_email');
$company_info = D('member/company/company')->getCompanyBaseInfo($member['company_id']);
$result = [
'company_name' => $member['contact_com... | 1 |
73c2a7ae4b4dbdcbd7d224233e69412d | caffc3b5afa40311c6a770fc27d462c2 | Returns the value of the '<em><b>Library</b></em>' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc -->
<!-- begin-model-doc -->
Name of the logical library this element belongs to.
<!-- end-model-doc -->
extendedMetaData="kind='element' name='library' namespace='##targetNamespace'" | public String getLibrary(); | 1 |
ce5f76054ecb79de9bc23780752e59ae | 9aab1d9c8d70165ffbc097b8b9e19503 | Initialise all chunks with empty data. | void
SerialIO::emptyFileChunk()
{
for (uint8_t i = 0; i < MAX_CHUNK_CHARS; ++i) {
file_chunk[i] = 0;
}
} | 1 |
88d0e6ede2991788713277c4ae2d0904 | d324ed0d20085a4b01c2499e9518bca6 | 判断open表是否为空 | for cur in self.__open_indexes:
if not cur:
return False
return True | 0 |
04a247a0948171a82411dcf6d864481f | fda2fcd784168f87f8797cb248f09d11 | Ask a DNS question to the specified server | {
DNSHeader h;
int id;
int length;
if ((length = this->MakePayload(name, DNS_QUERY_A, 1, (unsigned char*)&h.payload)) == -1)
return -1;
DNSRequest* req = this->AddQuery(&h, id);
if ((!req) || (req->SendRequests(&h, length, DNS_QUERY_A) == -1))
return -1;
return id;
} | 1 |
cfa22d444cc70a7256dbce7e5dec3840 | 1de4c150308e6a2ec62d2b77c7b1d822 | Add a new skip logic rule | public function addRule(ContextInterface $ctx, AddRuleRequest $request): AddRuleResponse; | 1 |
edbcc69f5f542eaeaede44265e7f35e0 | 8b4d179407498a9cb79d629fd30ee880 | vide les champs input | var lastname = document.getElementById('lastname').value='';
var firstname = document.getElementById('firstname').value='';
var city = document.getElementById('city').value='';
} | 1 |
ff4085561c0f98172465ed5578b9258c | a30245f6a55d507d671233797b773e68 | Get Current Elo Ratings | class EloScore:
def __init__(self, ratingA=ELO_RATING_DEFAULT, ratingB=ELO_RATING_DEFAULT):
self.ratingA = ratingA
self.ratingB = ratingB | 0 |
9bb05e58a1ab28a3b900f201b2f3c1f1 | eae135219be16b491bc7b9f73147375e | Make an integrated address from the wallet address and a payment ID
} | function makeIntegratedAddress(remote, port, payment_id, onSuccess, onFailure) {
var method = "make_integrated_address";
if (payment_id != undefined) {
var params = { payment_id: payment_id }
} else {
var params = { payment_id: "" }
}
walletJSONrpc(remote, port, method, params,
function(resp) {
... | 1 |
a48d13b83a1a76509494dcb5d7dc852f | 862c24ec6dfe71cf0abfd48b4ffb7217 | The destructor closes the Prolog engine, freeing all resources | LuaParser::~LuaParser()
{
close();
} | 0 |
996de2d1fac97e8112ccf01e711a1932 | caa94e3f98fee31f44d471e6df321c60 | return all deadlines which are currently in database | class DeadlineController extends Controller
public function index()
{
$deadlines = $this->deadline_repository->where('is_active', 1)->get();
return view('backend.deadlines.index', compact('deadlines'));
} | 0 |
44e1d9b661a80312de6c9253d3496aa8 | 4eeee0e1a3ffdc23fb8006e37af8db52 | 资源文件名重复check | let repeat = false;
const useResourceServer = this.isUseResourceServer();
if (useResourceServer) {
repeat = await externalResourceService.isNameDuplicate(addTag.name).catch(e => {
console.log(e);
});
} else {
const res = await dSourceDataService.queryDDataSource(this.currentSou... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.