query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
fad3439f07a9f6c9c7516afe564426cf | a3775509c93f2b6aecf25bbad79179b5 | Тест попытки получения списка заказов как покупателя анонимным пользователем | class OrderTest(APITestCase):
def test_list_orders_works_as_non_user(self):
response = self.client.get(self.url)
self.assertEqual(
response.status_code, status.HTTP_200_OK, response.data
)
self.assertEqual(len(response.data), 2) | 1 |
81d97a1a52da6877efa7c119b1375515 | ae1e7fad583ef0e429302073990be24e | 已知content,组装成规范的md文件格式 | class towxml
md2html(mdContent) {
const _ts = this;
return _ts.m.md.render(mdContent);
} | 0 |
b4bf4c1e302d0d60be527b881939e56b | c0eec21c9d84eb4140514068464fe144 | 虚拟删除角色 | @RestController
@RequestMapping("/open/role")
class OpenRoleController(private val roleService: RoleService)
@DeleteMapping("/{roleId}/deleteRole_v1")
@PreAuthorize("hasAuthority('upms:delRole')")
fun delete(@PathVariable("roleId") roleId: Int): SaasResult<Unit> {
return roleService.deleteV1(roleId, SecurityCon... | 0 |
2c3473dac13c4ca4882681f1301b6657 | 7ec5e28a4f0eae99961e926ff85ffb5e | 从Hash结构根据field获取缓存项,如果不存在则调用LoadValueWhenRedisNotExists()放入redis并返回 | {
var redisValue = Database.HashGet(RedisKey, field, commandFlags);
return TryDeserializeExpire(field, redisValue, out object ret) ? (T)ret : defaultValue;
} | 0 |
04303122f6b5d1abe357c3793523e5e8 | e9a3ee7a7a5144e6ea82f6dfb1a33285 | Returns an action object used in signalling that queried data has been
received. | function fetchActionSuccess( service, key, data ) {
return {
type: 'WC_FETCH_DATA_FETCHED',
payload: { service, key, data }
};
} | 1 |
2e636c6343cf39ebde1c20abe951ab50 | 27aeb31b3bfa34bd5cdfea784ad40bc3 | SQL Statement to list meeting participants for the specified meeting from DB | Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
List<Employee> employeeslist = new ArrayList<Employee>();
Employee employee = null;
try {
conn = dbhelper.getConnection();
String sql = "select * from employee,meetingparticipants where employee.employeeid=meetingparticipants... | 1 |
fea1bc0d5457ac60b4c23228821bca22 | 7497639b1fddb81e193d92878bdcfa4b | Add request settings for the stats component. | {
$builder
->add('max_length', TextType::class, array('label' => 'Max. length of result set'))
->add('limited', CheckboxType::class, array('label' => 'Limit result list for metric calculation?', 'required' => false))
->add('round_precision', TextType::class, array('label'... | 1 |
aee3be4ab9fa0c67175d7dae8a0a2ebd | 0747b5593a4334539badde643bb12a2d | 現在のシーン(ビュープロジェクション)をセット | export class View3D
public set scene(sc: Scene3D) {
this._scene = sc;
} | 1 |
d603bf6503ca4a86a38d06d64330531d | 8ca95cff8674372659959ddaba10ed9d | 添加需要高亮的view,默认高亮类型为矩形 | function CTaskNewView.addHightLightLineByTag( self, _obj)
if _obj == nil then
return
end
if self.m_clickTaskImg ~= nil then
self.m_clickTaskImg :removeFromParentAndCleanup( true)
self.m_clickTaskImg = nil
end
self.m_clickTaskImg = CSprite :createWithSpriteFrameName( "general_... | 1 |
91ac5ed70cef59db2772e888987b8eb9 | 9d466af890cf379f08cc83fd89785dd1 | This describes a memory region in a platform independant way. Permissions
are described with a string using 'rwx' for full read, write and execute
permissions and substituting '-' for missing permissions. For example
a page with only read and execute permissions would have permissions
of 'r-x'. | {
unsigned int memperms = 0;
switch (perms) {
case 7:
memperms = PROT_READ | PROT_WRITE | PROT_EXEC;
break;
case 6:
memperms = PROT_READ;
break;
case 5:
memperms = PROT_READ | PROT_EXEC;
break;
case 4:
memperms = PROT_READ | PROT_WRITE;
break;
default:
memperms = 0;
... | 0 |
405de3b05356236cd93451197be55553 | abf3daf8c3ec81a53e323eeb61a96399 | Get default Custom taxonomy configuration arguments | return array(
'query' => array(
'default' => '',
'required' => false,
),
'ids' => array(
'default' => '',
'required' => false,
),
'post_type' => array(
'default' => 'any',
'required' => false,
),
);
} | 0 |
7b8c5d6f55bc1cabdd824a00ebeafeca | 9c87784cb2fda39525a0a202d4db6f53 | 随机获取随机长度随机元素的一个数组 | Random r = new Random();
Integer[] result = new Integer[arr_legnth];
for(int i=0;i<arr_legnth;i++){
result[i] = r.nextInt(arr_legnth*3);
}
return result;
} | 0 |
8f41838bf3799e0942ed382de50f3ff3 | 4c6a5f5a4d0e3ff1db8933f5459b96ae | Reads audio samples at a specific offset. | namespace NAudio.Wave
public class WaveOffsetStream : WaveStream
public override int Read(byte[] destBuffer, int offset, int numBytes)
{
int bytesWritten = 0;
if (position < audioStartPosition)
{
bytesWritten = (int)Math.Min(numBytes, audioStartPosition - ... | 1 |
787b93e449e93ce372f71440b449ee05 | 43954ad7b14918b3fdd6b91b27340318 | Global namespace defaults to empty string. | class Section
def namespace_string
""
end | 1 |
7a0bf93791ba61164a6cecf3c0b3c526 | d8027086b8ed5114268ace29e4660ccc | 접속이 끊긴 세션들 주기적으로 정리 (1초 정도 마다 해주자) | def clean_sessions():
while not QUIT:
size = conn.zcard('recent:')
if size <= LIMIT:
time.sleep(1)
continue
end_index = min(size - LIMIT, 100)
tokens = conn.zrange('recent:', 0, end_index - 1)
session_keys = []
for token in tokens:
... | 1 |
c8572dbb8f6628f9548053ff832580aa | ab2bcb5c6cd64787b59105fc672078f8 | 上传考试试卷 | $data = $this->data;
$examClassroomQuiz = model('ExamClassroomQuiz');
$info = $examClassroomQuiz->where('id', $data['id'])->field('status,examtype')->find();
if ($info['status'] == 0) {
$res = $examClassroomQuiz->save(['status'=>1,'uploadbyid'=>$data['uid']],['id'=>$data['id'... | 1 |
ed11b97fe776d311f4c0177af8f395b1 | 713a83c639615991d7a565076625cd4a | 取分销产品的景点信息 | class test extends CI_Controller
public function get_user_sharingpoint_info(){
$postData = array(
'token' => '1460101942856',
'sign' => 'f379eab5603ca17c247f6ed79f316b663570d2cc',
'uid'=>'1380100706',
);
$this->__generalPost(base_url('/api/mobile/get_user_sharing... | 0 |
2164c5881f2f4b1f4e4184c6bdecf02a | 5a2cd5dfce19b84cf19a4a5f99ed3a1e | Método para inicializar el recycler del calendario | public class
CEnCalendarView extends LinearLayout
public void initRecycler(Context context) {
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
customRecycler_calendar.setLayoutManager(linearLayoutManager);
for (long i = 0; i < mS... | 1 |
eacf03be8c9a3f46d0de89b24c0cd325 | 31b2b402ed7733f1abe85083a8ef12a3 | Create graph encoding the frequency of turns between particular roads. | Graph = defaultdict(list)
for line in all_line_stations:
for i in range(len(line)):
station = line[i]
next_station = line[i + 1] if i + 1 < len(line) else ""
pre_station = line[i - 1] if i > 0 else ""
if pre_station and not pre_... | 0 |
6aedf59c08de71fd6069a0190449965f | 96928f75ae55d27ac2a9d156a96e565a | Check if given branch is current branch | c_branch = current_branch
cmd = "git --git-dir=\"#{git_dir}\" --work-tree=\"#{work_tree}\" merge-base --is-ancestor #{c_branch} #{branch}"
cmd2 = "git --git-dir=\"#{git_dir}\" --work-tree=\"#{work_tree}\" rev-parse --verify #{branch}"
cmd3 = "git --git-dir=\"#{git_dir}\" --work-tree=\"#... | 0 |
f8aa8407fe91028c70eb3ec9d35f5353 | fac184a8600c790754a14902234199af | 根据pointId删除points_log表数据 | @Service
@Import({
PromotionDataSourceConfig.class
})
public class PromotionTestBase extends AutoTestBase{
public void updatePointsLogByPointId(String pointId,PointsLogDO pointsLogDO) {
PointsLogDOExample exam = new PointsLogDOExample();
exam.createCriteria().andPointIdEqualTo(pointId);
pointsLogDAO.updat... | 0 |
b55a287aa0f4a8fc611ccb80364431ed | 01ed427061f32d6cced7195bd7b7efad | Resets the possession time of this Buff, practically resetting its lifetime | namespace ZitaAsteria.World.Effects
public abstract class AbstractCompoundEffect
public virtual void Reset()
{
_elapsedLifeMS = 0;
} | 1 |
12b531667cf439ce6f93ba1be573900b | 23405bc8f980561c72e45585fb1e4266 | Funcion que obtiene los datos y los modifica en unas variables pasadas por referencia | function datos_por_modificar(valor, valor1) {
$('#id_caracter').val(valor);
$('#caracter_modificar').val(valor1);
} | 0 |
ed4a655e29403ea72e1688b20eb8ef40 | b1482e5ecb29983ddf6f143d78ee2db3 | 管理员解锁用户账户 | {
while(1)
{
printf("请输入要解锁的管理员工号:\n");
int new_number = 0;
scanf ("%d",&new_number);
int index = find_number(new_number);
if(-1 == index)
{
show_msg("查无此人!",1);
return;
}
else
{
printf("确认解锁帐号请按1,取消请按2: \n");
switch(get_cmd('1','2'))
... | 1 |
99f9f8af49e79c2d23cddc41dcb422c6 | 5a0259cbfb0aa6cb8f67c4a75f7caa6b | Create a view with standard controller arguments. | page_name=None, params=None, **kwargs):
params = dicts.merge(params, self._params)
if ('scope_view' in params) and ('scope_path' not in kwargs):
view = params['scope_view'].view
redirect = params['scope_redirect']
return self.select(request, view, redirect,
... | 1 |
c75b2c16ae5de45b36aceffcc6dce1fd | cced090fbdb3c029d1663334b1fc6213 | Save token and redirect if login successful. | {
$accessToken = $request->user()->createToken(AccessTokenDataObject::fromRequest($request)->name);
session()->flash('token', explode('|', $accessToken->plainTextToken, 2)[1]);
return redirect()->action([self::class, 'index']);
} | 1 |
c8e84f8ba9e7c58fbab3e09f70856e04 | 30e629740b1249b93ac60ade83d151a9 | 根据项目名称和建设地点查找待审核的项目 | List<Map<String, Object>> queryProjectPreAudit(Map<String, Object> parame); | 1 |
97cbcbad54c4cc76739362ee71282b70 | cffe3210e77c01665ef06be74fc09acc | 将PPT文件转换为HTML文件 | String sourceFileName = "f:\\20171208茅台见证中纳友谊(2).doc";
String targetFileName = "C:\\html\\test1.html";
String imagePathStr = "C:\\html\\image\\";
HWPFDocument wordDocument = new HWPFDocument(new FileInputStream(sourceFileName));
Document document = DocumentBuilderFactory.newInsta... | 0 |
ce46bf6da293fe7a42843e6799c9dc7e | 902ea3e922f643cce37f5a798a5ac5c9 | Display a listing of the specifiction table. | class SpecController extends Controller
public function index()
{
return view('spec.index');
} | 0 |
db2de605b38c5b0e618d646aeeffb2e4 | fe7e1b3e0ccb82c7b3fabaa5e6912be3 | Main extension point to produce custom controller instances i.e. with non-empty constructors. | function createController($class)
{
return parent::createController($class);
} | 0 |
7c8ede8f7fe6119d250dab95ead07098 | b524c4711bcf8c977b945073683de93f | Printea la Letra W. | Class Informes extends CI_Controller{
function word(){
$this->load->view('informes/word/word');
} | 0 |
a5b4e97a1cc0e1c8eea91de6d7b376dc | 8e3e1aba5bfa5f58f57b198ccfbc5931 | Pobiera przedmioty prowadzącego z bazy | function get_items_for_guide($id){
$sql = "SELECT i.id, i.name, i.description, i.type, i.image, i.cost, i.attributes, i.manacost, i.cooldown, i.extra_about, i.components, ig.place, ig.stage_name, ig.stage_id FROM Item i, Items_for_guide ig WHERE ig.Guide_id = ? AND ig.Item_id = i.id";
if ($stmt = $_SESSION['link']-... | 1 |
0c5a2abb3d5c35e6d5d5235ad88f15e7 | 91c6bf5e0acbaec39714bd490735879b | Highlight the Right-clicked image. | class Ui_LandImageDialog(QtWidgets.QDialog):
def _imageComboBoxHighlighted(self, itemIndex):
card = self._currentLands[str(self.imageComboBox.itemText(itemIndex))]
self._mainFrameParent.cardImageWidget.setCardImage(card) | 0 |
54c4394c3ad8ce56d5f1b2a73fa610ef | b9be6a75c9dbad762ebf7c5510ba1ec8 | @brief Reads data from a previously open VB file. | FSReadBS(tFile *pFile, void *pvBuffer, unsigned long ulNumBytes)
{
#ifdef SUPPORT_RIGHTS_PD
unsigned long *pulPtr;
unsigned long ulCount, ulIdx, ulData;
#endif
if(!(pFile->ucFlags & FS_OPEN_READ))
{
return(0);
}
#ifdef SUPPORT_RIGHTS_PD
if(pFile->ulHeaderSize != 0)
{
ulCount ... | 1 |
d931db2d1b1696ba75591b6e72bff799 | 7202e068e60a7523ab35a9b37b39ee86 | Defines the mapping between persistent entity properties and database column names,
to create your column names in your DDL (e.g. "myThing" -> "MY_THING")
OR return null to have generic dao generate the mapping using reflection | public class MyNamingStrategy implements NamingStrategy{
@Override
public String columnName(String columnName) {
if (columnName == null) return null;
return setColumnStyleByConfig(columnName);
} | 1 |
8833d2b7d4a5f319fac7ed9dd9c31c3d | e381be4593740a6fadd6fc7c57026a65 | Tests to see if the PEAR Mail module is loaded. | class PetHelper
public static function hasMimeMail() {
return \Drupal::moduleHandler()->moduleExists('mimemail');
} | 0 |
d064a2475b409204b5d45e15c7fbfbee | ad2967025207f757b9e2472e1ba326fe | 全ての行が選択されている状態かを判定する。
このメソッドは、行の選択状態のみを判定するものであり、
列の状態については考慮しない。 | if (getSelectionCount() > 0) {
TreePath[] paths = getSelectionPaths();
return isTreePathAllSameLevels(paths);
}
else {
return false;
}
} | 0 |
c5061114f60d74d4234d46220062245d | 41bc311045981106a5aff2ec8ae7b32f | Sets router dead interval time.
This is the interval after which this interface will trigger a process to kill neighbor. | class clusterinstance(base_resource) :
def deadinterval(self, deadinterval) :
try :
self._deadinterval = deadinterval
except Exception as e:
raise e | 1 |
69c6a03749f272a2ccdf96c5f83f1d56 | 27f7e7a9475473813b5c952417dd9409 | Setter for <code>Account.fieldMonster.server</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.6.1"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
@Entity
@Table(name = "task_stage_history", schema = "mobsters")
public class TaskStageHistoryRecord extends UpdatableRecordImpl<TaskStageHisto... | 0 |
959b8d786e4490329a236b87b76bb2cf | fb8ddf75e86d089442c7969a19a04ae9 | <p>
将字符串长度修改为指定长度,并进行居中显示。
</p>
<pre>
</pre>
源字符串
指定的长度
长度不够时补充的字符串
如果被补充字符串为 null或者 empty | if ((str == null) || (size <= 0)) {
return str;
}
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
}
str = alignRight(str, strLen + (pads / 2), padChar);
str = alignLeft(str, size, padChar);
... | 1 |
38c3bba93761c485a81e4bbbf4a147af | a9a0f07f7fd7cd3a81b0397bebe7373b | 递归清理两端空白字符 | def trim(s):
if s[:1] != " " and s[-1:] != " ":
return s
elif s[:1] == " ":
return trim(s[1:])
else :
return trim(s[:-1]) | 1 |
c1ceca015ad31f613729938f3fe225a9 | 4c896ea37f3b3cd0e29900a00f619529 | 先从缓存中获取用户,没有则取数据表中数据,再将数据写入缓存 | ValueOperations<Integer, User> operations = redisTemplate.opsForValue();
boolean hasKey = redisTemplate.hasKey(userId);
if(hasKey){
User user = operations.get(userId);
log.info("从缓存区取出userId为{}的数据[{}]", userId, user.toString());
return user;
}
... | 1 |
3013123762af929f62c22bbde72c3e6f | 8d76347bc8a3d61e632b3a8022a68117 | 列举用户组的策略 | @ResponseBody
public Map<String,Object> groupStrategyList(@RequestParam(value="groupId")final Long groupId){
OperateTemplate template=new HttpTemplate() {
@Override
protected void doSomething() throws Exception {
map.put("data",groupStrategyService.groupStrategyList(groupId));
}
};
return template.... | 1 |
78de22370b0e54eff77d2d9e089a39bc | 73094be6a2a4fadfa1fc2fabac2ad6c0 | 生成Bundle列表类 | namespace ResetCore.NAsset
internal class AssetBundleExporter
private void GenBundleList()
{
CodeGener gener = new CodeGener("ResetCore.NAsset", "Bundles");
foreach (var kvp in assetBundleDict)
{
string name = kvp.Key;
if (name == "none")
... | 1 |
38988c0ad0da4b48ccfc608f67ecefcc | 4e2ac32bb987c7ac8de1de7a2ef39b94 | Get a list of handles of shared libs loaded by the current
process. Returns a NULL-terminated array allocated from POOL. | {
int n;
char *p;
array_init(return_value);
for (n = 0; ap_loaded_modules[n]; ++n) {
char *s = (char *) ap_loaded_modules[n]->name;
if ((p = strchr(s, '.'))) {
add_next_index_stringl(return_value, s, (p - s));
} else {
add_next_index_string(return_value, s);
}
}
} | 0 |
2e505c2b54e959fc4d2e355a44f6ff7e | 74525536f22d769ef49af2406cdc04ba | Returns a connection using the given DatabaseConfiguration <br>
and the ConnectionManager initialized in the constructor | public function getDBConnection($config); | 1 |
4bc7833dfd1c8ae36a398c8337cb13c5 | acd3323eacf85266f5f1c5916c297b99 | AccountDTO constructor. | {
$this->amount = $balance;
$this->number = $number;
$this->name = $name;
Assert::oneOf($type, [
self::ACCOUNT_TYPE_CURRENT,
self::ACCOUNT_TYPE_SAFE,
self::ACCOUNT_TYPE_GOAL,
self::ACCOUNT_TYPE_FAMILY,
self::ACCOUNT_TYPE_ALF... | 1 |
813dd04ed5cfa43f7097c76a25f3c3ec | ea78ba6720a1058d2ae82470d6e7a5e1 | Get dataset base.
Returns:
dict: the dataset base (2D and 3D information) | class BaseDataset(Dataset, metaclass=ABCMeta):
def get_required_dataset_info(self) -> Dict[str, BaseDatasetPropertiesType]:
info: Dict[str, BaseDatasetPropertiesType] = {'output_type': self.output_type,
'issparse': self.issparse}
return info | 0 |
c0277d3606c9b51b38ff2b6e62d00326 | eea1d8b04492a953c61dcf0b077c1bbd | Set the withdraw switch. | public class BankFields
public void setNoteWithdrawal(boolean noteWithdrawal) {
this.noteWithdrawal = noteWithdrawal;
getClient().getPA().sendFrame36(1011, noteWithdrawal ? 0 : 1);
} | 1 |
9362961125d274179888d48fbdb16456 | e13421eec5d818b7a128ffeccc31093c | Set TLS certificate (asynchronously)
Creates or updates the TLS certificate chain. | return updateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch).map(new Func1<ServiceResponseWithHeaders<CertificateInner, CertificateUpdateHeaders>, CertificateInner>() {
@Override
public CertificateInner call(ServiceResponseWithHeaders<Certif... | 1 |
167a9d0dd2257f36a0221bceca69e6bb | 11ff319b21cfca8aa23825e8d0f31333 | Fonction de traitement de nombre, pour séparer les milliers après
l'envoie d'une valeur dans le dblclick Forecast ex : 10000 -> 10 000 | {
try
{
if (((TextBox)e.OriginalSource).Text.Contains(","))
{
((TextBox)e.OriginalSource).Text = ((TextBox)e.OriginalSource).Text.Replace(",", ".");
((TextBox)e.OriginalSource).SelectionStart = ((TextBox)e.OriginalSo... | 0 |
217e150b183baaa3b26ad08b413ef11e | 13174087a932bc366002ba2fa1512d0f | nGram算法计算两个string相似度 | {
if (string.IsNullOrEmpty(value1)
|| string.IsNullOrEmpty(value2))
{
return "0";
}
int n = value1.Length;
int m = value2.Length;
int[,] d = new int[n + 1, m + 1];
int temp = 0;
char c... | 0 |
d89f908d369c4eb923601faa0f8eb084 | 64ddd687c53c785c944df7f83473f3f1 | ## When the data follows a mixture of Gaussian distribution. The parameters could be estimated
## using the EM algorithm.
##
## This function calculate the estimated parameters using EM algorithm.
## The default choice of the number of components is set as 2. | k <- 2
n.all <- length(x.all)
tau <- matrix(0,nrow=n.all,ncol=k)
ep.sig <- 1e-5
comp.sig <- start.vals$sig
comp.pi <- start.vals$pi
comp.mu <- start.vals$mu
iter <- 0
current.error <- 1
max.loglike <- -1e6
while (iter < max.iters && current.error > errtol){
iter <- iter + 1
last.ll <- m... | 1 |
5e0a0fd99d6c9094ce81c74f7d3cb07e | a0cce1801a671725edcc92a2ad135ac0 | 获取七日或者30天内访问数据的方法 | namespace GcSite.ModuleSys.Controllers
public class TrafficController : Controller
public WebInfo GetVistiorByHours(DateTime startTime, int site)
{
WebInfo web = new WebInfo();
try
{
List<VisitorInfo> vistio = work.CreateRepository<VisitorInfo>().GetList(
... | 0 |
ffb6417d47d422a660b7fa97bb9f9fcb | 0cd197d23696068eb2e076361cb1c662 | Only the owner can recover ERC-20 tokens. | def change_owner(new_owner: address):
if self.owner == msg.sender:
self.owner = new_owner | 0 |
6048d33468a64b32d32c530339f472b9 | bdbf4745481240f66091a8fced464616 | Print octal equivelents of decimal numbers. | let file = File::open("octal_nums.txt")?;
let reader = BufReader::new(file);
for line in reader.lines() {
for ch in line.unwrap().chars() {
let f = match ch {
'0' => '0',
'1' => '1',
'2' => '+',
'3' => '*',
'... | 0 |
af843642fc9074fe4a2418b5ed7098a1 | b0a3ff8432bc6450a291de4756476782 | 载入小组动态 | API.CourseGroupActivityApi_getLists(courseid,function(data){
var fix;
for(var i=0;i<data.data.length;i++){
if(data.data[i].isfixed == '1'){
fix = data.data[i];
}
}
var ht = templat... | 1 |
11d9586e351e5b907d0b9240647f3f15 | 2d20e30e9d969588576f82be6d1bc602 | Get All Gallery Sections | {
$db = &JFactory::getDBO();
$db->setQuery(" SELECT id_section as value, title as text FROM `#__section` ORDER BY title ");
return $db->loadObjectList();
} | 1 |
e38ca92bfc274c974a7e2a1b6c290458 | 5bbdd5f9914db47ffaa8a21622857108 | Sets the gzip_response of this OrgApacheSlingTracerInternalLogTracerProperties. | class OrgApacheSlingTracerInternalLogTracerProperties(Model):
def gzip_response(self, gzip_response: ConfigNodePropertyBoolean):
self._gzip_response = gzip_response | 1 |
434730e2100cd95f1427c08c61aba34c | 799de09ac4b0bfd1a58dae4b905eaf06 | Parses the given source into a model represented as an AST.
How to use the model is explained more thoroughly in the general
documentation of the :mod:`robot.parsing` module. | class Parser(object):
def __init__(self, handle=None):
self.handle = handle
self.model = None
self.node_info = None
self.children = {}
self.rooted = False | 0 |
a7fc8a199e01c0250fd301ec178972f4 | 35ccd89d28b5d83db86b266435991fc4 | Stop a webinar's live stream. | try:
params = request._serialize()
body = self.call("ForbidLiveStream", params)
response = json.loads(body)
if "Error" not in response["Response"]:
model = models.ForbidLiveStreamResponse()
model._deserialize(response["Response"])
... | 1 |
1b0849551d838b838bba4160ab8af874 | 889481169077f0d72319b376df9130ae | sends data to the parent process (non-blocking) | int Loop_Server::sendUp(_Pkt *p){
if(parent_conn != NULL && parent_conn->connected())
return parent_conn->writeData(p);
return 0;
} | 1 |
909c518d655ab8f3eaecedf410ccb3e6 | 1452df2edaff717e5e9f2d61135ea745 | Checks if default port is set | public function hasDefault(); | 0 |
4fa0d3c0f9ff841312b69821352c33fa | 3344272df4215065d03d922ec452c29e | Format message and send it through UART. Then free memory. | uint16_t i;
size_t len;
char str[MAX_MSG_LEN];
va_list argptr;
va_start(argptr, fmt);
len = vsnprintf(str, sizeof(str), fmt, argptr);
va_end(argptr);
len = strlen(str);
if (!str || len == 0) {
RA_WriteByte(0);
return;
}
if (len > MAX_MSG_LEN - remote.msglen) {
RA_WriteByte(0);
return;
}
for (i=0... | 0 |
5814f4d1f794e4e90c3c5040f3b783d9 | dabdfd305d00a94cbb46e92fac3f4452 | Create a swagger description for a list of endpoints | {
return new Description([
'baseUrl' => $options['base_url'],
'operations' => [
'getUserRepositories' => [
'httpMethod' => 'GET',
'uri' => '/users/{user}/repos',
'serializer_type' => 'array<J... | 1 |
4c20734fcdbb8672d6ec3e75945910a0 | 778df2d971fbbab4c1989a8acecde7a3 | \brief Sends Get Alarm command unicastly | {
if(med_WorkState == MED_STATE_URGENT)
{
app_Urgent_t app_Urgent;
app_Urgent.msgtype = URGENT;
app_Urgent.urgenttype = NOPWR;
app_Urgent.value = URGENT_NOPWR_RECVRETREAT;
MAC_UTIL_BuildandSendData((uint8 *)&app_Urgent,
sizeof(app_Urgent... | 0 |
f14490fe2b273924fc2b87b7d18acef6 | ab0a3bfffb71c2d2de4ee00d394e2caf | Get tracking API user agent | class WC_Google_Analytics_Pro_Measurement_Protocol_API extends SV_WC_API_Base
protected function get_request_user_agent() {
if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
$user_agent = $_SERVER['HTTP_USER_AGENT'];
} else {
$user_agent = parent::get_request_user_agent();
}
return $user_agent;
} | 1 |
34832607d20d25faaa295e74a4453775 | 30f40f9746787bd1378748ee4c8907c2 | Gets a configured Doctrine EntityGenerator instance. | class EntityGenerator implements EntityGeneratorInterface
private function getClassGenerator()
{
if (!$this->classGenerator) {
$generator = new DoctrineEntityGenerator();
$generator->setGenerateAnnotations(true);
$generator->setGenerateStubMethods(true);
$gene... | 1 |
8237292c686bb8b54fec8d6ea0fab555 | 8010c99973e6f156f5ce21049d1c3a99 | Inject hidden fields to aid deserialization/serialization for OpMsg parsing of commands. | ISOMsg msgToLog = (ISOMsg) isoTransaction.clone();
ByteArrayOutputStream bAos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(bAos);
int[] dEsToHide = new int[] { 2, 20, 23, 35, 45, 52, 55, 125 };
for (int i = 0; i < dEsToHide.length; i++) {
if (msgToLog.hasField(dEsToHide[i])) {
msgToL... | 0 |
be7c78ea0364616a178851c6acfe140a | 4e8588b13a1196a2a89226b20c71eebd | ショートカットkey1を切り替えた時の処理 | {
std::lock_guard<std::mutex> currentShortcutUI_lock(currentShortcutUI_mutex);
if (currentShortcutUI1 == nullptr)
{
return;
}
std::unique_lock<std::mutex> detectedShortcut_lock(detectedShortcut_mutex);
std::unique_lock<std::mutex> currentShortcut_lock(currentShortcut_mutex);
currentS... | 1 |
e4161e9ef98236bdcef0124da258e61f | bc0ee02d5b2917a24532010252bbbc9e | Initialize this with an initial reference count. | namespace quickbook
namespace detail
value_counted::value_counted() : value_base(&value_nil_impl::instance)
{
intrusive_ptr_add_ref(value_);
} | 0 |
ecf364a846b0d1f60fc92852428f3037 | fce8f43810b6a3af5484d55b25ce1560 | Apply geometric cooling. | def cooled_geo(T):
T = float(T*0.9)
return T | 1 |
bd215a3b5373f26e9796b6137930eab7 | 2a6e921f628d17eb20fa897624f9e234 | Takes away the permsissions that make them not able to send messages. | for item in Options['Lockdown']['Channels']:
MemberRole = ctx.guild.get_role(Options['Roles']['Member'])
Channel = ctx.guild.get_channel(item)
await Channel.set_permissions(
MemberRole, send_messages = False, read_messages = True
)
embed = ... | 1 |
0e6aad7752867f37486ed7f32aab3f6b | 40e0432bb44ef3679363e8b6ac57ea82 | Creates a new <see cref="ActorTask{TResult}"/> to execute the specified asynchronous work. | namespace Microsoft.CoyoteActors.TestingServices.Threading
internal sealed class ControlledActorTaskScheduler : ActorTaskScheduler
internal override ActorTask<TResult> RunAsync<TResult>(Func<Task<TResult>> function,
CancellationToken cancellationToken) =>
this.Runtime.CreateActorTask(functio... | 1 |
a3c252b1ee48b50c1cadc39b2279aa54 | d4b6dbdccd1f709ad05c8e77846853de | esse cenario checa se as colunas na grid foram alteradas tanto o total de colunas como nomenclatura
procedimento eh executando buscando registro cadastrado no cenario "cadastrarEmail" em seguida chegando os campos apresentados | class ManterBancoDadosEmailTest extends PHPUnit_Extensions_Selenium2TestCase
public function verificarAlteracoesNasColunasDaGrid()
{
$this->url("/admin/site/login");
$this->byId("loginform-username")->value("jenkins");
$this->byId("loginform-password")->value("mc102030");
$this->byNa... | 1 |
478fe8a6568b850fdb1e518c2bd023b8 | 52352266499461fb5dd6bad3a3f0cd71 | run shell with default timeout | if quiet:
output="stdout=PIPE, stderr=PIPE,"
else:
output=""
setup = "from subprocess import Popen, PIPE"
cmd = "p = Popen('{}', {} shell=True); p.communicate()".format(cmd, output)
timeit.timeit(setup=setup, stmt=cmd, number=1) | 0 |
bc52c21bd3cda90b6e89d6261e3c643d | 7827baab7a8267f8fdc57ea1550a53fa | MenusController constructor. | class MenuController extends BaseController
public function __construct(MenuRepository $repository)
{
$this->repository = $repository;
} | 1 |
cbe6201e6c60c0b9907c9414a580eec0 | d8e0c9e3c0e8ac40ba8118fa956e6fac | Gets a new request object with provided data | {
return new ConsulRequest<TRequestData>
{
RequestData = requestData
};
} | 1 |
62f0b52fe54c26a452e94d62c06b0739 | 70b434ed844d5ea7c8ce816f8314261f | Converts time of day to seconds since midnight | class DateTime
def total_seconds_from_midnight
return self.hour * 60 * 60 + self.min * 60 + self.sec
end | 1 |
7bffb03a5f1b5e8f97d94c3c4c2814ff | 5da6299d1b7249d1b564c94b7a9b4656 | Extracts facet normals from set string. | float *parse_stl_string(const char *data, int data_length, int *facets)
{
int faces = 0;
float *parsed = NULL;
char *loc = (char *)data;
if ((loc = strstr(loc, "endfacet"))) {
faces = 1;
while((loc = strstr(loc+sizeof("endfacet"), "endfacet"))) faces++;
} else {
return NULL;
... | 1 |
3453322176d2287cc4446eb311e94ece | fc11116c9154e16aee9501215bca7bf4 | Autopilot altitude-hold ARM | local function ahrs_on(self)
local response = write_command(self.fd, {
0x75, 0x65, 0x0C, 0x0A,
0x05, 0x11, 0x01, 0x01, 0x01,
0x05, 0x11, 0x01, 0x03, 0x00,
})
end | 0 |
398784f66bd454a34599d211013928f4 | 3724f1a020eb533c435d8c920fdd6caa | Applies fun with the given args (tuple) and returns an object
that can be used to get the results back
through get(timeout=0) | class ImmediateApply(object):
def __init__ (self, func, args, kwargs):
self.results = func(*args, **kwargs) | 0 |
365ed8ec86bae9e9da5c96cb02f41e7b | 6e2831d0526f315d6a504bdb673091e7 | Get the comment feed of the case based on its given UUID.
Return null if there is no comment. | IModel[] getCaseModels(UUID caseId) throws Exception; | 0 |
169019db335e9ac5c0b01e7a77395ab9 | dece93cd464f2dfeeaa765ff80f5e8bb | @brief Set the enabled/disabled status of the LSM303AGR accelerometer sensor axes | uint8_t *enable_xyz) {
if (LSM6DS3_ACC_GYRO_W_XEN_XL((void*) handle,
(enable_xyz[0] == 1) ?
LSM6DS3_ACC_GYRO_XEN_XL_ENABLED :
LSM6DS3_ACC_GYRO_XEN_XL_DISABLED) == MEMS_ERROR) {
return COMPONENT_ERROR;
}
if (LSM6DS3_ACC_GYRO_W_YEN_XL((void*) handle,
(enable_xyz[1] == 1) ?
LSM6DS3_ACC_GYRO_YEN... | 0 |
7ce1e582f81b7bffcd2c948cf4647d1a | d0ac2059d258a83ba0569fd113110ab6 | Returns a map of sound activation keys to sound paths | class Pymilio_db_connection:
def get_sound_paths(self, prepath='', where=''):
results = self.query(table='Sounds', fields=['SoundID', 'ColID', 'DirID', 'OriginalFilename'], where=where)
sound_paths = {}
for r in results:
sound_paths[str(r[0])] = "{3}/{0}/{1}/{2}".format(r[1], r[2], r[3], prepath)
return soun... | 1 |
ea984a9cf05f4ed5504f55bc49a68976 | 67e1c457925b9853bac3a196c441e327 | ##' @name connectionStatus | bom_db_is_connected <- function(con) {
DBI::dbIsValid(con) &&
tryCatch(DBI::dbGetQuery(con, "select TRUE;")[,1],
error = function(e) FALSE)
} | 1 |
51209117788223dc5f4e46206f88b419 | 6af93614d5bfe817623420c99d9448d2 | a multi-prerequisite with an OR relationship | function Or(factA, factB){
return {type:"composite",verify:game=>factA.verify(game)||factB.verify(game)}
} | 1 |
1e569a6a8d23f22e1b99c62a5346fd16 | 7b19e8fed6ed48b32a668d8873e65bbb | 查询某课程下共有多少堂课 | Integer findCountCataByCourseId(Long courseId); | 1 |
57d482b5d5745c6ac82b329aa0a49212 | 2ef4b747ffbe59083cb39dc163ade0f3 | If a type was specfied, filter the facts
by the given type | class PageQuerySet(SearchableQuerySetMixin, SpecificQuerySetMixin, TreeQuerySet):
def type(self, *types):
return self.filter(self.type_q(*types)) | 1 |
6b651101aa7eb43ae56eb8d5a90b0823 | e95025aec4d3413a0a5ade999f5f50ca | 非IE焦点切换回调函数 | var pageWidth = (window.top.innerWidth > 0) ? window.top.innerWidth : window.screen.width;
var pageHeight = (window.top.innerHeight > 0) ? window.top.innerHeight : window.screen.height;
var isPC = pageWidth>768||pageWidth==768;
var topOffset = isPC?60:82;
if(!isPC){
$("#mainLeft... | 0 |
4c285ec170c8cfee436b5d2f1e14de27 | 93876be865d0aa0700f48af208bbf413 | 关闭全部状态保持内的页面 | class Ap
closeAll(parent) {
let viewlist;
if (parent) {
viewlist = coreView.selectSubList(parent, '[data-view][role=group]:not([hidden])');
}
else {
viewlist = coreView.selectList('[data-view][role=group]:not([hidden])');
}
viewlist.map((t) => this... | 1 |
de6be50482bc7c4a3965dfc310645d19 | 7ad1660b211704ca428f830a00aeefdd | Creates a new test context. | class ContextTestCase(unittest.TestCase):
def setUp(self):
self.context = self.create_context()
self.context.create_subcontext("sub") | 1 |
30ed4cd61b38430f64a318a4f345b74f | 06282d1ce6bb3e51881c5484bc823b95 | Opens execute method menu. | {
if (ObjectManager.Player.IsDead)
{
return;
}
if (Variables.Menu.Item($"{Variables.MainMenuName}.defensives").GetValue<bool>())
{
Defensives.Execute(args);
}
if (Variables.Menu.Item($"{Variables... | 0 |
ecba1428e0d9ccc0fa2a7778dc0abbe2 | 06fb0c132020e478a9cf012d120f0a05 | Early exit if the event doesn't come from the primary action | if (evt.target instanceof MenuItem) {
if (((String)evt.arg).equals("Exit")) {
System.exit(1);
}
}
System.out.println("Event: " + evt + " Object: " + what);
return super.action(evt, what);
} | 0 |
d46250006e2eeea2f667c87f29277ca1 | 3720500110a3626b55c161af19c3ff19 | Set the maximum time in milliseconds that an association may remain idle.
Default 60 seconds (60000 milliseconds).
milliseconds. | public class RateLimiterConfig implements Serializable
public void setMaxIdle(final int maxIdle) {
this.maxIdle = maxIdle;
} | 0 |
c4df44b2b93dbb10c4024a4d3d742963 | 1439cf285073233d8404daad2ad7c5cf | this code gets the X and Y values of the hitbox of the weapon used. The hitbox determines the area wherein enemy player will get hit if mousePressed at the same time he's inside the hitbox.
this runs everytime an action is performed by the player | {
mouseBufferX = GlobalVariables.mouseLocation.getX();
mouseBufferY = GlobalVariables.mouseLocation.getY();
float lenghtX = Math.abs(mouseBufferX-location.getX());
float lenghtY = Math.abs(mouseBufferY-location.getY());
if (lenghtX >= lenghtY)
{
if (mouse... | 0 |
a770e2090dc449031762d5f07c6a3e8e | 7cc3137cd21b2a2f80a049a5a3b4d88d | different aspects of the game can be set here, such as max fps, window size,
etc. slick2d makes it very simple to create a window, so long as the logic of
the states is correct. | public class Breakout extends GraphicsProgram
public void init() {
this.setSize(WIDTH, HEIGHT);
} | 1 |
86e5ed2dfd7489e8cf89d6d6f6465613 | 970d25c795608bbda8e1ede93b4ce3c8 | Lock function that works by disabling task switching. A heap that uses
this lock function can only be used in task context. | {
UInt key;
Assert_isTrue(((BIOS_getThreadType() == BIOS_ThreadType_Task) ||
(BIOS_getThreadType() == BIOS_ThreadType_Main)),
GateSpinlock_A_badContext);
if (obj->owner == Task_self()) {
return (NESTED_ENTER);
}
key = Hwi_disable();
while (1) {
... | 1 |
76349d46613a77625d6b7b071bdda6da | 77f2db6059d3b0db8ae69c2358dc9f59 | Returns <CODE>true</CODE> if the cancel button is enabled and
<CODE>false</CODE> otherwise.
<CODE>false</CODE> otherwise. | public class BCWaitGameBModel extends Observable implements Observer
public boolean getCancelEnabled() {
return this.cancelEnabled;
} | 1 |
d1ef79a2e39304c28a563a01ee66843c | b4181a6f6ac985ad9bc502ac2095dcbf | метод для скачивания файла вместо просмотра | header('Content-type: text/html; charset=utf-8');
$fname = rawurldecode($n);
$upload = iconv('utf-8','windows-1251',$_SERVER['DOCUMENT_ROOT'].'/user_files/'.$fname);
if(file_exists($upload)){
$fsize = filesize($upload);
$fdown = $upload;
if (getenv('HTTP... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.