query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
a3a6726bcdf9d734a3d5a2e41f085fe6 | f62f99bd3178b7f92ccd3319de916199 | parse the input inserted in the initial scene
such as the ip, the port, the nickname and the method connection
and attempt a connection | case @message
when /\ACON\t(.+)\t(.+)/ then self._connection_request($1.to_f, $2.to_f); return true
when /\ALIN\t(.+)\t(.+)/ then self._connection_login($1, $2); return true
when /\AREG\t(.+)\t(.+)/ then self._connection_register($1, $2); return true
end
return false
end | 1 |
18dc1f26ef1555687e472dd1329fc152 | e5754ea4dba06659b96e97466268b5f6 | Writes the file string to the proper file given the dataset class
and training data percent | class IOD:
def write_to_file(self, output_file, write_like_original=False):
write_file(output_file, self.dataset, write_like_original=write_like_original) | 0 |
821bba4ac595d2e026c78e69a4204219 | abd7fc2bcbbbf40494e936d9d177b7ea | Metodo para abrir el grafico 1 de las 5 salas mas utilizadas | {
$datos=Nota::join('sitios','sitios.id_sitio','=','notas.id_sitio')
->join('municipios','municipios.id_municipio','=','sitios.id_municipio')
->join('estados','estados.id_estado','=','municipios.id_estado')
->groupBy("sitios.nombre");
$categorias=$datos->pluck... | 0 |
b17efcf9342c981867d89b3f237b881d | bfef1f28cb5901b64d31150f02657547 | Get array of strings representing terms.
Breaks up the expression string into terms.
e.g. "5+3" breaks into ["5","3"] | function breakPieces(exp: string): string[] {
const parts: string[] = [];
let part: string;
for (let i = 0; i < exp.length; i++) {
if (exp[i] === '(') {
part = getBracketExp(exp.substring(i, exp.length));
parts.push(part);
i += part.length + 1;
} else if (isNumeric(exp[i]) || exp[i] === ... | 1 |
3d689ce60e6f4ceb050b96bf0793aa43 | 22f1d5372df2e90ba5e7ac338dec77d7 | ###############################################################################################
A method used for calculating Distribution descriptors based on SecondaryStr of
AADs.
Usage:
result=CalculateDistributionSecondaryStr(protein)
Input:protein is a pure protein sequence.
Output:result is a dict form containing... | global ss_calculated
global ss_showing
global progressbar
progressbar.ax.set_visible(True)
glob_ax.figure.canvas.draw()
def _show_ss():
for r in glob_ss_rects:
r.set_visible(True)
def _hide_ss():
for r in glob_ss_rects:
... | 0 |
80b649a4cae20e0cc8fa80056842d457 | a4ebe6e90b72702e823baab157821f69 | Matches the functions from the kp organisations dataframe to the viaa "Makers" and "Bijdragers" functions based on the mapping
from the metadata_mapping.json | def make_mapper(df1, df2, address1_column_name, address2_column_name, name1, name2, fuzz_thresh=60):
stripped_df1= strip_address(df1, address1_column_name, 'stripped1')
stripped_df2= strip_address(df2, address2_column_name, 'stripped2')
nonnull_df1 = stripped_df1[stripped_df1['stripped1']!= '']
nonnull_... | 0 |
16f6ecdd798b0e1262423570cff58a9e | ef9fff74d07b7c815ff25a3eddace010 | Проверяет правомерность использования поля в запросе в
зависимоти от прав пользователя | class AccessUtility
public static function beUserHasRightToEditTableField($table = 'be_users', $field = '')
{
return static::getBackendUserAuthentication()->check('non_exclude_fields', $table . ':' . $field);
} | 1 |
371dab9b3fede4a06c5bd946c49ebe08 | ea07f9a62fd5ee4fcbb0a0018439aad5 | 游戏胜利时弹出窗口并时间对比 | if ((total == restFlag + restBlock) && (status == 1 || status == 2)) {
clearInterval(timer);
$("#alert").text("你赢啦,时间是" + $("#time").text() + "s");
for (var i = 1; i < mineArr.length; i++) {
for (var j = 1; j < mineArr[0].length; j++) {
if (mineArr[i][j] == -1) {
$("#... | 1 |
9f30fe567a6bb0489d02b44670ca37d0 | dd25e9597df66ab3751d3a2b2b5e950c | 设置摇奖号码 | @POST("/app/terminalapi/call")
@FormUrlEncoded
Observable<ResSaveLottery> setLottery(@Field("requestValue") ReqSaveLottery reqSaveLottery); | 1 |
9ce82db8df45c1e65898810dd2bcab31 | 5456f238b22bc47731da06bda4128b03 | Add a certification for an id to the given public key. | boolean changed = false;
final List<Integer> availableCAs = new ArrayList<>(certProfile.getAvailableCAs());
for (int i = 0; i < availableCAs.size(); i++) {
int value = availableCAs.get(i);
if (value == fromId) {
availableCAs.set(i, toId);
c... | 0 |
4d36ec08da59580fac69393dec628253 | 6587bfde75346f6ae5aef13f249adcb9 | Finds and returns the number of occurences of a specified rank in the PokerHand
Helps with determining handType | {
int count = 0;
for (int i = 0; i < hand.size(); i++)
if (hand.get(i) == c)
count++;
return count;
} | 1 |
c08f9005dec4bd494c7a4646dc2693a6 | 4b1a98bd6bc2fe2b3c648ccdb87e143f | \brief get luminosity value from TSL2561 sensor
\author Thomas Aziz
\date 24JAN2019 | int tsl2561GetLux(void)
{
uint16_t visible_and_ir = 0;
wiringPiI2CWriteReg8(TSL2561fd,TSL2561_COMMAND_BIT,TSL2561_CONTROL_POWERON);
wiringPiI2CWriteReg8(TSL2561fd,TSL2561_REGISTER_TIMING,TSL2561_GAIN_AUTO);
delay(LUXDELAY);
visible_and_ir = wiringPiI2CReadReg16(TSL2561fd,TSL2561_REGISTER_CHAN0_LOW);... | 1 |
30652c06b6859a595d59a187a48257e0 | 0e6418f0cf2b93cd404da1b9337b50af | 添加支付图标 | View view = LayoutInflater.from(mContext).inflate(R.layout.pay_radio_item, null);
ImageView icon = (ImageView) view.findViewById(R.id.iv_pay_icon);
TextView name = (TextView) view.findViewById(R.id.tv_pay_name);
RadioButton rb = (RadioButton) view.findViewById(R.id.radio_button);
... | 1 |
d7c24d9b4874432d58fb4ad63faefefe | d132a66d83ac6f8c53a4a618d4ebb3b0 | 设置第二个数据库连接 | class MySQL extends Service
public function setDB($name)
{
$this->name = $name;
isset($this->pdo[$name]) || $this->conn($name);
} | 1 |
4dc0dda513ac9f099e088cbd8213fe2d | 37cbf6a252feffe4590b869a7dd358a9 | 初始化默认kpi | @Service("initPartService")
public class InitPartService
public void initKpiMap(String url){
List<ColourCode> itc = this.colourCodeService.getColoursWithNoPoundSign();
ColourCode [] colors = new ColourCode[6];
for(int i =0;i<itc.size();i++){
colors[i] = new ColourCode();
colors[i] = itc... | 1 |
f6998627423d5729a939e7d94f6dcd01 | 194750704d800e1a51a414bb05739506 | Tests for nil "actdeparttime" element | {
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlInt target = null;
target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(ACTIVITYTYPEMASK$0, 0);
if (target == null) return false;
return target.isNil();
... | 0 |
3711c2a66de8ac1416b848a4854e13c4 | 9ccfd7496977636c8f93fa96701ed6cb | Generates a new id for a saga. | let id = STORE._unique;
id += 1;
return prefix + id;
} | 1 |
73a63377e94ac55247fd81c856665e10 | bbb83009dd6c5cb37cc92e106173a2f9 | Get the doc string of a given command by name. | commands = get_commands()
commands = list(filter(lambda x: x.name == name or name in x.aliases, commands))
if commands:
return commands[0].help
else:
return None | 1 |
a45f73104b51352588cedc37fca986b1 | 9ce39b92d36a2e98f6a2af3680a15ffd | This function enables/disables the reporting of link check state changes. | public class LtpManagement extends AbstractStartableComponent
public void setLogLinkOperStateChanges(boolean logLinkOperStateChanges) {
_logLinkOperStateChanges = logLinkOperStateChanges;
} | 1 |
76b7480de0e5e8049fe308c0376fd9b1 | 2f997cd7768a6625057fcb6c5fd34ba4 | Initialize the base Advantage Air climate entity. | super().__init__(_create_climate(xknx, config))
self._attr_entity_category = config.get(CONF_ENTITY_CATEGORY)
self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
if self.preset_modes:
self._attr_supported_features |= ClimateEntityFeature.PRESET_MODE
... | 1 |
9ccc2cd9851e973fea225bfef9832a51 | 55e7ecb7265792eb16ea820d51b2b9bf | 展现申领单 | class ShenShowController extends BeforeController
public function ShenInfo()
{
$id = I('get.');
$where['id'] = $id['id'];
$Indent = M('Indent');
$res = $Indent->where($where)->find();
if(!$res){
echo '<center>';
$this->error('系统问题,联系管理员');
... | 1 |
c530585171a0671f277c31fef3e289c3 | d037102113f70bf30f01c59aa83867f0 | Test adjoint of Kraus matrices is correct. | auxiliary_list_2 = [hops.basis.hierarchy.auxiliary_list[i] for i in [0, 1, 3, 5]]
auxiliary_list_2.sort(
key=lambda x: hops.basis.hierarchy._aux_index(x, absolute=True)
)
stable_aux = set(auxiliary_list_2) & set(hops.basis.hierarchy.auxiliary_list)
permute_aux_row = []
permute_aux_col = ... | 0 |
4e254cd98f3ca4f56bb01d744e226e1e | 096ae7b6eab2692928d151f4a04b26c4 | Un-registers a prefix declaration if present. | {
if ( array_key_exists($prefix, self::$libPaths) )
{
unset(self::$libPaths[$prefix]);
}
} | 1 |
a8e11e8a679592133ec6506c3b17e433 | e8e61e89338198be5595785a7aa56de3 | if a setup was already made, use the same session | public class SessionSetup : MonoBehaviour
public void ConfirmSetup()
{
SetupData newOrLoadedSession = SessionSetupTransfer.GetSetupDataAndDestroyInstance();
if (newOrLoadedSession != null)
setupData = newOrLoadedSession;
setupData.SetSeed();
if (!HexMetrics.noiseSource)
... | 1 |
1b7f0a4e503a6eb623525a0f16b561b7 | 3a97b191df166deac784fa8db102a2ca | Checks the supplied response for errors and casts response data to
supplied type. | {
if (response == null)
{
throw new ArgumentNullException(nameof(response));
}
if (!response.Succeeded)
{
throw response.Exception;
}
} | 0 |
de8c193d2891997a6e2660243f087b02 | e7b96b4d3739b0754a4c4b1019bd4b6c | Load document from files and make sentence segmentation | class Preprocessor(object):
def sent_seg(self, doc_path):
with open(doc_path) as f:
return sent_tokenize(f.read()) | 1 |
765beb32ea6d21d17f686c23b1d4d14a | 0d25ab29e79219af4c778970b99c9484 | Returns the first key (or subkey) this comparator uses.
This can be used for shortcut creation or tree representation. | final class LeafNode<K extends Comparable<K>, V> extends AbstractNode<K, V>
@Override
public K getFirstKey() {
return this.records.firstKey();
} | 1 |
9cbe04a179a9aaf3363377fab0f769c7 | 7c5d4238ee8cfa58880388d74dcb97a7 | Read overlap file into hash/list. | hash = defaultdict(list)
fo = open(file)
for line in fo:
g = Gene(line)
hash[g.loc].append(g)
fo.close()
return hash | 1 |
f0e6301a9c069eccecb21341f100fc14 | 4b503b2b38edd30597220386779a325b | Generate the feeds from the current context, and output files. | class EntityGenerator(generators.Generator):
class EntitySubGenerator(generators.CachingGenerator):
def generate_feeds(self, writer):
if self.settings.get('FEED_ATOM'):
writer.write_feed(self.entities, self.context,
self.settings['FEED_ATOM'])
... | 1 |
7dc2dc4fcdd617530748374e955e05d3 | 51d6460e6491410f61ca94cf4f143ac4 | Cancel a delayed call created by call_later(). | class Call(six.with_metaclass(abc.ABCMeta)):
def cancel(self):
raise NotImplementedError() | 1 |
0b254b3a1c9de1c3cde8caef70a84cb2 | 887a5787bd9944b30446b77e76485acd | Reads debug messages as a message dialog box. | string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage)
{
Debug.WriteLine(messageText);
return false;
} | 0 |
d58a38c6885ae2167bec93c1f34d53ab | 1f92eeac9508a1262fcada4eb6eda703 | 按分类的orderId升序查找 | Order findOrderByOrderId(@Param(value = "orderId") String orderId); | 0 |
cf640ad1a30948860835da5692b9825c | 8f96d1d652699d4ce175795d95d7daf4 | function that returns the iterator of the root (the stub) | class EmptyIterator:
def next(self):
raise StopIteration
if self.root:
return iter(self.root)
else:
return EmptyIterator() | 1 |
091aa927d644480a81de457aa14514e0 | 47876378cc13a62bd4e313c2b8b87211 | This is a rudimentary implementation of the random function from the random module in Python 3.x. | def rand():
global rseed
rseed = (rseed * 1103515245 + 12345) & RAND_MAX
return rseed | 1 |
8f25e515b3f90d55a712ea3e62249fdb | 7e0c9eb37a4088a22f9c8a7b6a364827 | Replace the html entities in text with corresponding unicode entities.
Uses UTF-8 encoding. | class Loader(object):
def unicodeToHTMLEntities(self, text):
text = cgi.escape(text).encode('ascii', 'xmlcharrefreplace')
return text | 0 |
5a004e032f2b084db6df13354c716c25 | 29faeab782466e88bcce3bf174d5e722 | 麻将机下移动画 | let $numberCell = $('#number-Cell' + i + '-' + j + '')
$numberCell.animate({
top: getMoveDown(i,count) + 'px'
},200)
} | 1 |
6c9b4a953b4c44ff37338efaaac5547d | b2f197b80a9960e313829013e2d9f4cf | Supprime tous les segments | draw.children()
.filter(elem => elem.hasClass('segment') || elem.hasClass('point'))
.forEach(elem => elem.remove());
crease.remove();
positive.plot([]);
negative.plot([]);
} | 1 |
42a14523896bccd7ef406b3c35468dc2 | 65d1005a2a7a181d9eff0d0ccba1463a | request progress report update from agent. | {
LoggingService.Debug(string.Format("EventTaskService.RequestTaskReportProgressed:TCPProtocol.Header:\n{0}\nTCPProtocol.Header:\n{1}", protocol.Header, protocol.Body));
ISystemUserBase systemUser = _clientContextMgr.CurrentContext.Client.User;
INormalUserRelationship normalU... | 1 |
072ddf950462cfaa958ae39daeaa86b6 | 7b1d20031109bc3b61fca69ca143de1c | Lists all Cleaners models. | class CleanerController extends Controller
public function index()
{
$cleaner = Cleaner::paginate(25);
return view('+admin.cleaner.index', compact('cleaner'));
} | 1 |
35d908fc0ab458f509a366c2c12cef8b | 136746ece806c89a4eef82713faa4b93 | 根据 钉钉唯一标识符 查询最近一个月的考勤记录 | namespace DAL
public class KaoQinService
public KaoQin GetKaoQinByUserId(string last_year_month, string userid)
{
string sql = "select id,考勤年月,部门,班组,人员编号,姓名,应出勤,实际出勤,出差,旷工,年假,事假,病假,正常调休,产假,陪产假,婚假,丧假,迟到早退次数,缺卡次数,工作日加班次数,休息日加班,节假日加班,休息日出差,夜间值班次数,夜间值班调休次数,打卡签到次数,工作时长,备注,更改者,更改日期,IsSubmit,排序 from im... | 0 |
123346b94f6ff60a618d5b85eefd842e | f9497074ff7e78566d54e0e35d2383dd | \brief To get the \ref Switches_States_t from the input \p text line
\details This function check the \p text to be equal to one of
switch states as in \ref Switches_text and then returns
the \ref Switches_States_t accoring to the equality check
and returns #SWITCH_ERROR if it doesn't match any text. | state[0] = s.readSwitch(&s,SW0);
state[1] = s.readSwitch(&s,SW1);
state[2] = s.readSwitch(&s,SW2);
state[3] = s.readSwitch(&s,SW3);
} | 0 |
4d1a65b11c13f6f79cdb8c38e6b0a9c6 | a19c9e801fe6238f34416031060205e9 | Returns the user ID from of this notification entry. | public class Announcement implements Parcelable
public String getUser_ID() {
return user_ID;
} | 1 |
6cbba6803ce331d6cc7d326a596e8812 | 34a052ec6de19b3dee57c5f2f6ad56bc | A sequential list search. | def sequentualSearch(alist,item):
pos=0
found=False
while pos<len(alist) and found==False:
if alist[pos]==item:
found=True
else:
pos+=1
return found | 1 |
911ff16c9cb816918eed235f37544023 | cdd3ed605e6a46a9c57cbc15e5440bd8 | Function to get fast fourier transform (absolute values). | vec2 = np.arange(0, fourier_signal.shape[0]) / fourier_signal.shape[0]
vec1 = np.arange(0, fourier_signal.shape[0]).\
reshape((fourier_signal.shape[0], 1))
exp = np.exp(vec1 * vec2 * UNITY_ROOT_CONSTANT)
return np.dot(exp, fourier_signal) / fourier_signal.shape[0] | 0 |
b585dbacb3e492a47e61ad7915c65a21 | 78beb4261b051dd0b04970d093802e13 | Move the stepper motor one step in HALF_STEP mode. | void ULN2003BOOST::ccwStepHalf(){
for(int i = 7; i >= 0; i--){
sendByte(halfStep[i]);
}
} | 1 |
ddb38bb8108f7185d62516a252428490 | 8f90086325cf56414e782ed82c05afe8 | asks user to input practice problem grades | void ClassQuiz::AcceptGrades()
{
for(size_t i{}; i < numStudents; ++i)
{
std::cout << "Enter grade for student "
<< i+1 << ": ";
std::cin >> *(grades+i);
}
} | 1 |
68952277f763443f19fb108a5ec8ca47 | 33340a8e3449f8e9c5c527c9e5d2450e | Determina si el usuario aún tiene pruebas pendientes. | {
if ($user === null) {
return false;
}
$key = __METHOD__ . $user->getId();
if ($this->cache->get($key) !== null) {
return $this->cache->get($key);
}
$limit = (new \DateTime())->modify('-' . $this->trialDays . ' day');
if ($user->getDat... | 1 |
750ea56d8795c8cf3136c1c5ed721b0a | f9c5b50fc3c21c9d1c14d7a7c28d3490 | Display the specified Users data. | class OnpeUsersController extends Controller
public function show($id)
{
$users=User::findOrFail($id);
return view ('Onpe.users.index', compact("users"));
} | 1 |
e12db400485f900b554303de84a89828 | e7cfd3cad5b6349cfbdb2e08ab9a84bd | Check if this `train` stops at the given station (by the station name).
Returns the index of this station within train["stations"], or
if the train does not stop returns -1. | for k, v in station_names.items():
if code in v:
return k
return '' | 0 |
d88825c38c1fe6866567d35f347c7755 | 69f1f3ee4fce75343869ec1c59adf1d8 | 获取指定产品快照规则 | class LiveClient(AbstractClient):
def DescribeLiveSnapshotRules(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeLiveSnapshotRules", params, headers=headers)
response = json.loads(body)
model = mode... | 1 |
bd48a810a68e6e48064b87b88fdf5812 | 4d6d053c459139c64491102ddfe1263a | ! GDB is sending values to be written to the registers. Registers are the
same and in the same order as described in gdb_read_registers() above. | static void gdb_cmd_getregs(struct kgdb_state *ks)
{
gdb_get_regs_helper(ks);
kgdb_mem2hex((char *)gdb_regs, remcom_out_buffer, NUMREGBYTES);
} | 0 |
701ca25067d07ad7ccfc0b0d41f1fc0e | 42f06e7ea979f88564d3c250886d727e | metodo que permite la eliminacio permanente de los usuario
pueden ser administradores, clientes o tecnicos
la eliminacion se lo hace mediante una peticion ajax | {
if ($request->ajax()){
try{
$user = User::find($id);
$user->delete();
$nombre_completo=$user->primer_paterno.' '.$user->segundo_materno.' '.$user->name;
flash('Se eliminó al usuario: '.$nombre_completo, 'danger')->important();
r... | 1 |
31a3b98d5921e5768cdd824e1dcc8b66 | 12bd38371e73168b361002ae430b5c43 | This is a decorator class which uses an underlying CacheInterface | class WidgetCacheDecorator extends CacheAbstractDecorator implements WidgetInterface
public function __construct(WidgetInterface $repository, CacheInterface $cache)
{
$this->repository = $repository;
$this->cache = $cache;
} | 1 |
dd4a0d6c5fa596654bb89c0ac001b085 | 43dbe1be0895b31313c1c53e7b3110a9 | Thread function for timestamping stdout | namespace terminal
s64 Terminal::stdout_printer_thread(Terminal* term) {
const u32 BUFF_SIZE = 512;
char buff[BUFF_SIZE];
while (true) {
ssize_t count = syscalls::read(term->fd_stdout, buff, BUFF_SIZE - 1);
buff[count] = '\0';
term->printer.get()->format(buff);
}
} | 0 |
475179d36fb25c67b6645ec06779fc55 | d1861255843b65c6aae0d6e8aa285725 | Retrieve a list of accepted fields per authentication strategy. | result = credentials.keys.map.reject do |field|
IGNORED_FIELDS.include?(field)
end
result << :access_token
return result
end | 1 |
e8a780d22cfe92f7a19b086808915315 | 0a67969933eae284e605db44196d96d5 | 显示售出的金币 | class SceneGame_JSYS extends basic.SceneBase
private onShowGold(e: egret.Event): void {
this.jsys_up.showGold(e.data.gold);
this.txt_gold.text = GameData.assGold(2,e.data.gold);
} | 1 |
2b59a83817608865508cb924f5f0f81f | 338404ea896c2851e7f258f093072e07 | Checks the ability of sign in operation. | {
if (ASPNETIdentityConfig.EnableSignupProcess
|| ASPNETIdentityConfig.EnableEditingOfUserAttribute
|| ASPNETIdentityConfig.EnableAdministrationOfUsersAndRoles)
{
return false;
}
else
{
re... | 0 |
1a6557a28aa72da0799fe40be7d63d6f | 3ca9ff1114822c5a6a0c04e5903674de | Set port range. | this.lowPort = lowest;
this.highPort = highest;
this.nextPort = lowPort;
} | 1 |
ef38f21ad32c98b7d14af7fe55343b1e | 0080ebdc81ba77386fcbdb6bd0948308 | Initialise the account switcher | async function initAccount() {
await prefs.init();
const accountSelectionBox = getElementById("account-selection-box");
const accounts = (await browser.accounts.list()).
filter(account =>
account.type === "imap" ||
account.type === "pop3" ||
account.type === "none"
);
const items = [];
for (const acco... | 1 |
07029cb18e416b9cb97dc69825dd8d84 | 4d0ab4b256630a6249f10f2032c368a3 | 向MongoDB插入一条数据col为集合(表)的名字,标识符为name参数为args的文档 | public class DDPClient extends Observable
public int collectionInsert(String collectionName,
Map<String, Object> insertParams, DDPListener resultListener) {
Object[] collArgs = new Object[1];
collArgs[0] = insertParams;
return call("/" + collectionName + "/insert"... | 1 |
a45bd751b16b1c5998f5b81bbeaf585b | 3844eb277fbb9bfc87797ffe54c42488 | 生成用户保洁订单数据 | class AutoCleaner
public function reckonCleanOrderBill($orderData){
$unverifyCleanPhoto = (new OrderCleanPhoto())->getOrderNoVefiryNum($orderData['id']);
if($unverifyCleanPhoto > 0){
return null;
}
$userScoreNum = model('OrderCleanScore')->getUserScoreNumOrderSn($orderData['o... | 1 |
e50b087566f46bd9c46c1561444b6a54 | 50efe71d378ca8910a1ff50cc9db504b | User API to Get the Move Count | userName := GetUserName(request)
if userName != "" {
tmpstring := "000|0x4|"
done := setCommand(common.Obfuscate(common.Base64Encode(tmpstring)))
if done {
r := strings.NewReplacer("{STATS}", createcountDiv(), "{MESSAGE}", "Command Issued!")
result := r.Replace(SuccessHTML)
fmt.Fprintf(response, result... | 0 |
841e186e94bb088b7aa2462a50a6874c | 396b2f8d2e4fd7ca5ca0e47096ae2b85 | Sends transaction for auth + capture (same day settlement) based on amount. | {
$cardsStorage = $this->getCardsStorage($payment);
if ($this->_formatAmount($cardsStorage->getProcessedAmount() - $cardsStorage->getCapturedAmount()) < $requestedAmount) {
Mage::throwException(Mage::helper('paygate')->__('Invalid amount for capture.'));
}
$messages = arr... | 1 |
23f65d7c82ad4f25c95fec14f0be44e1 | ac57a6b06d83404e441be1de410792cc | 进入Activity,执行切换动画 | public class EvaluteActivity extends AppCompatActivity implements View.OnClickListener
@Override
public void startActivity(Intent intent) {
super.startActivity(intent);
overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
} | 1 |
5287c324e5afb0d389627da3c9920444 | 348cf1adafd5c06f83a3f886ba72fc9c | Retrieves the number of elevators in the building. | class Building
def number_of_elevators
@elevators.count
end | 1 |
2436db040e20f432a08a4acd5ee7924a | d8d31cfaaf636db0df20045ebd69f28d | Test CRUD functions of the Bill model. | table_name = AWS_CUR_TABLE_MAP["bill"]
bill_id = self.processor._create_cost_entry_bill(self.row, self.accessor)
self.assertIsNotNone(bill_id)
query = self.accessor._get_db_obj_query(table_name)
id_in_db = query.order_by("-id").first().id
provider_uuid = query.order_by("-... | 1 |
f842697e22ebf46a50bbddf6908eb34b | de39e3cbffde4ba8741e247842a18ad6 | test that the detachment was successful | class TestPowerVMDriver(test.NoDBTestCase):
def test_detach_volume(self, mock_bld_slot_mgr, mock_inst_exists):
mock_inst_exists.side_effect = [True, False, False]
mock_bdm = self._fake_bdms()['block_device_mapping'][0]
self.drv.detach_volume('context', mock_bdm.get('connection_info'),
... | 1 |
40664ebf8950297622e4b857c374f8ff | 5d59ca40e0e37dbc032f4f706d0c67b1 | 覆盖该方法来设定从第几行开始读取 | class Pipas_Fun extends ImportPerLine
protected void setReadFromLine() {
this.readFromLine = 2;
} | 1 |
81e17ccdc1dbced4c30ab2e783763155 | 6b88b70c25d80af1872f2c13234038f8 | Получение встречи из списка по имени | $search = $_POST['search'];
$list = \MealOclock\Models\EventModel::findByName( $search, '\stdClass' );
echo json_encode( $list );
} | 1 |
bdf8b7fd349a3b09c3bcf30adc9f6418 | 7f95286ed361757352a03b2ee7f3341d | Run feature vector accumulation on multiple cores | threads = []
num_worker_threads = THREADS_TO_USE
qTasks = Queue(10 * num_worker_threads)
for i in range(num_worker_threads):
t = Thread(target=getSampleGraphFeatureVector, args=(i, qTasks,bShowGraphs, bSaveGraphs,))
t.setDaemon(True)
t.start()
iAllCount = np.shape(mAllSamples... | 1 |
8997715e27ede7c4479be5e2bbf79c11 | fb26da3d22dbba5b0c99c07723ebb15b | 获取所有测点的全局状态 | namespace Haewon.Module
public class PaixMotion
public bool GetAllStatus(out Motion_Paix_Function.TnmcX_ALL_STATUS tAllStatus)
{
bool bRet;
nRet = Motion_Paix_Function.nmcX_GetAllStatus(nDevNo, out tAllStatus);
switch (nRet)
{
case (short)Motio... | 1 |
1be027aa01b22198ba560d41e9c88213 | 8978758459a8c0422241e78d0bcfec82 | 根据当前侧边栏, 标签页,分页展示数据 | Class ArticleModel extends BaseModel{
public function getPageData($cid='all',$tid='all',$is_show='all',$is_delete=0,$limit=10){
if($cid=='all' && $tid=='all'){
if($is_show=='all'){
$where=array(
'is_delete'=>$is_delete
);
}else{
... | 1 |
48d0755f6c82ef702b0c968a2c9cacd0 | 50e64fc01680a4b69600069eba31ee98 | 构建多叉树 | public class TreeUtils
public Node buildTree(List<CommentInfo> commentInfo, long id){
Node tree = new Node();
List<Node> children = new ArrayList<>();
List<Node> nodeList = new ArrayList<>();
for (CommentInfo info : commentInfo) {
children.add(buildNode(info));
}
... | 1 |
bed7a9f8d061f15ce9c4a6a0c6d7ae9f | fa8a3628cf65e66e1276db2717e5eb9f | 현재 년월일시분 반환 | public class AbstractAction extends ActionSupport implements SessionAware,
ServletRequestAware, ServletResponseAware ,ServletContextAware
String getCurDate() {
String nowdate = null;
Calendar cal;
int year;
int month;
int day;
int hour24;
int min;
int sec;
int ms;
cal = new GregorianCalendar();
... | 1 |
aba944a3a0de4456ad4b1694ed4620a8 | 714601237d6425831ab773458dc7e5d2 | Close last opened group | {
if(lastOpened == null)
return;
lastOpened.closeMenu();
lastOpened.setVisible(false);
lastOpened = null;
} | 1 |
ed668eaf20e47f0a259a74ee4221df39 | 7f28429060e0d962b678642370790525 | Get message from the current dialog displayed on the browser | public class WebDialog extends WebObject
public String getPromptMessage()
{
Alert alert = driver.switchTo().alert();
return alert.getText();
} | 1 |
3247f269cb38c21c23bb24bf6f74ea74 | d870d17ba2f8406af8b65c8f8e10e5bc | Load a config file from another local Moodle instance and set the database
values in the $CFG global and initializing the new ADODB database connection.
global DB connection or load the alternate config options. | function vmoodle_feed_config($vmoodle) {
global $CFG;
$CFG->dbtype = $vmoodle->vdbtype;
$CFG->dbhost = $vmoodle->vdbhost;
$CFG->dbname = $vmoodle->vdbname;
if (empty($CFG->vchildsdblogin)) {
$CFG->dbuser = $vmoodle->vdblogin;
} else {
$CFG->dbuser = $CFG->vchildsdblogin;... | 1 |
0834bb2015c1614c7b47dfea329fbaa5 | f713e1476f7464e5a0c8e70fdd0942f2 | It should encode localized system properties. | FieldKey fieldKey = FieldKey.VALUE;
assertEquals("wrong localized name!", "Name", fieldKey.getLocalizedName(Locale.US));
} | 0 |
8cb848ef8c661edd97a19dc4a889cfcf | 547ba7772a1f8dd68ff33fd47be2f697 | Cette fonction récupère les données si le fichier existe.
On renvoie un dictionnaire : soit l'objet dépicklé si fichier existant, soit un dictionnaire vide. | def getStoredDataFromDisk(file):
try:
data_from_file=pickle.load(open(file, 'rb'))
except IOError:
data_from_file={}
return data_from_file | 1 |
0f64e5eb8493b05af8d9f6afe8a6eb0a | 255ca6a4a1352cd5fd1e1fb0f3bef510 | Метод для проверки наличия директории, в которой будут располагаться сохраненные файлы с сохраненными словарями | namespace TestTask
class Location
public static void CheckFiles(string location)
{
if (!Directory.Exists(location))
{
Directory.CreateDirectory(location);
}
if (!File.Exists(location + "\\ourHTML.txt"))
{
using (File... | 1 |
97ddb1a7db6ab2e9881d1797056b9bf6 | 6a615f043c4a54732630c40ef3ae7520 | Returns the summaries of spending by period | var err error
p := new(ParamToShowSummary)
p.SumOfMonth = make([]int, 12)
p.ExpenseOfMonth = make([]int, 12)
p.Results = make(map[int]*ResultOfMonth)
for k, v := range Payers {
if v.IsCalcSummary {
p.Results[k] = &ResultOfMonth{
Name: v.Name,
Summary: make([]int, 12),
}
}
}
p.Year = year
p... | 1 |
f39621140a8d71bf8b4146d4ba1d14fb | 8bfff9476e1da017f04d56213dcf84bf | FUNCTION
Function Name : SIM_HAL_DisableUsbClock
Description : Disable the clock for USBFS module
This function disables the clock for USBFS moudle
END | static inline void UDP_DisableUsbClock(void)
{
REG_PMC_SCDR = PMC_SCER_UDP;
} | 0 |
c76c47e37841a9b0c82b7041eef819b5 | 3295cb187434e413c3fc1df58a2e3cb7 | Class representing bishop chess figure. | class Horse(GamePiece):
def __init__(self, team):
super().__init__(team)
self._type = "Horse" | 0 |
5a52178ae3cc47e4f50b5654e42a6a25 | 26aec1fda3468a125dc0133eb903f2ac | Get the scheduler table column name | class Scheduler implements SchedulerInterface
private function getScheduleKey(): string {
return 'schedule';
} | 0 |
15c9036e953fc35761d2221707de4dc1 | 567f89a36d5f847acc91fe5f352b9705 | Tests the creation of nondeterministic transition functions | class AutomataTests(unittest.TestCase):
def test_nfa_to_dfa_05(self):
nfa = Automata.read_from_json('./test/data/test_nfa_to_dfa_05')
dfa = nfa.to_dfa()
self.assertEqual(6, len(dfa.states))
self.assertEqual(2, len(dfa.final_states))
self.assertEqual(12, len(dfa.transitions))
... | 0 |
3e9bfbea95bcfab2f83c7a66b91e0025 | 5de9aecce944a4787078c62b70526c6d | Test that get retrieves all members of the underlying table | $users = $this->dao->getAll(User::class);
$this->assertEquals(101, sizeof($users));
$user = current($users);
$this->assertInstanceOf(User::class, $user);
$orga = $user->getOrganization();
$this->assertInstanceOf(Organization::class, $orga);
} | 1 |
3f83c4c9b66d244de4ddc44631c719bc | f6d18c9e04de4a7c404d3718d5f7eb88 | Set speed of fan by changing level at /proc/acpi/ibm/fan
speed: 0-7, auto, disengaged, full-speed | Serial.print("Set fan ");
Serial.print(_name);
Serial.print(" to ");
Serial.println(speed);
int percent = 0;
if(speed.equalsIgnoreCase("on")) {
percent = 100;
} else if(speed.equalsIgnoreCase("off")) {
percent = 0;
} else if(speed == "+") {
int increasedPercent = ... | 0 |
525c36a96a9cae6aeea4259c569366fb | 62de7f430c3ab737a51b6ab687dfe117 | 查询下一时间段数据 | $type_id = intval($type_id);
$time = $this->time;
$ftime = $this->get_type_ftime($type_id);
$action_time = date('H:i:s', $time + $ftime);
$where = "WHERE `type`=$type_id AND `actionTime`<='$action_time'";
$data = $this->db->query("SELECT COUNT(1) AS `__total` FROM `{$this->db_prefix}data_time` $where", 2);
... | 1 |
910b3553af67010768e815b969240d57 | 234e41563136bb4fb57baa9307e2e9e5 | ログイン中のユーザの権限名を表示します。 | $tmp = $this->loadSession();
$result['userName'] = $tmp['username'];
if($tmp['role'] === "patron"){
$result['role'] = '保護者';
}
elseif ($tmp['role'] === "teacher"){
$result['role'] = '管理者';
}
else{
$result['role'] = '未ログイン';
... | 1 |
2a3d9c9571209f7e4aeeceb22a163219 | ff1494dd330590ca47a2b2c253c589f0 | 出力ストリームに[第1値,第2値]の形で文字列表現を挿入 | std::ostream& GUIUtil::operator<<(std::ostream& os, const InputOutput& io) {
return os << io.question << std::endl << io.answer << std::endl;
} | 0 |
ee9d3060e565a9bddb87247c0d4224a3 | 7ff943df129f2abc76573536af79c8a5 | Get temperatures of the printed circuit board and microcontroller. | class SocketClient(AsyncClient):
async def get_temperature_and_pressure(self):
return await self.send_command('get_temperature_and_pressure') | 0 |
30cda5162ddd6397f805ecdffb698bb1 | 704eaa48c5fbb7cbef25fcf42cd87a6d | Returns keystoneclient instance | class KServeDeploymentService(BaseDeploymentService):
def _get_client(self) -> KServeClient:
return self._get_model_deployer().kserve_client | 0 |
b3ab917f5ad1f6a9af16926518c5b049 | 6237769589646b6e46bd126bf5dd59d0 | @brief променя среща или име на дадена среща | void DlgRoutes::changeStation(class Station * p)
{
if (p!=st && p!=nullptr)
{
ui->tableRoutes->clear();
st = p;
FillData();
}
} | 0 |
66737b42c5dbad8f7e56248249f3e3ef | d86d5eee0890af3f35f78a6e47fbc589 | Get the new URL for managing coupons. | class WPCOM_Additional_CSS_Manager
private function get_nudge_url() {
return '/checkout/' . $this->domain . '/premium';
} | 0 |
d9701bcea35dc7679355069b7b832f63 | 8f6b6aac6bbb80519d118a6eff0551ff | funkcja pokazuje reprezentację binarną znaku | uint8_t z = 128;
while(z > 0) {
if(u & z) printf("1");
else printf("0");
z >>= 1;
}
printf("\n");
} | 1 |
03b857c32838bdbf4c12e599b1d320fb | da8c2883111be81309f683b17fbee0ae | Build a member expression from a linq expression which contains the property. ie x => x.thisFieldName or x => x.Ref_Table.thisFieldName | namespace NLite.Dynamic
internal class QueryableSearcher<T>
private LambdaExpression GetPropertyLambdaExpression(Filter item, ParameterExpression param)
{
var props = item.Field.Split('.');
Expression memberAccess = param;
var typeOfProp = typeof(T);
int i = 0... | 1 |
6a25a176fef7a04798e688a33c214822 | 8a3444b7fef9d8869ef524aa5e9aa83f | Get the options for the itemProvider | class EntityReference extends FieldTargetBase implements ConfigurableTargetInterface
public function getFeedsItemOptions() {
return [
'guid' => $this->t('Item GUID'),
];
} | 0 |
2be935e3548ed313d886ae603b5cf3df | 9e4454d46361e08f25f2d6b5943bda4b | Gets the block id map
Returns | class SectionsList
public function getMappedIblocks()
{
// get iblocks if they not set yet
if (empty($this->iblocksIds))
{
foreach ($this->mappedSections as $mappedSection)
{
$id = $mappedSection["PARAMS"]["IBLOCK"];
$this->iblocksIds[$id] = $id;
}
}
return $this->iblocksIds;
} | 1 |
f96b4d24e0f755cddb9757c17d5acfc1 | 28fc9044c41642331c27059131dd3020 | 在DGV中绘制Button按钮 | {
DataGridViewButtonColumn c = new DataGridViewButtonColumn();
c.Text = name;
c.DefaultCellStyle.BackColor = Color.LightGray;
c.DefaultCellStyle.SelectionBackColor = Color.DarkGray;
c.UseColumnTextForButtonValue = true;
c.Width = 60;
... | 1 |
4075e91fee2044acc947f359864a44e8 | d56bbe9e13e31b7508fce67a53683197 | 显示或关闭图例 | {
this.show_graph = false;
this.show_adjencency = false;
if (is_outline)
{
this.is_outline = false;
}
else
{
this.is_outline = true;
}
this.Refresh();
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.