query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
cecce1614fa29e7d275d38cc4ba7d644 | 27bf41a24da4df6f01248fc6d887d531 | 是否移动环境 | export class ConfigService
isMobile(): boolean {
if (
this.mobileEnvironment.toUpperCase() == "NONE" ||
this.mobileEnvironment == ""
) {
return false;
}
return true;
} | 1 |
e326c095789caf2d60896fc3140691b6 | 310ad9cb711bcca909ee59871af63ba0 | 根据用户名查找用户粉丝列表 | class FollowerModel extends MY_Model
public function getFollowersByName($uid, $keyword, $page, $limit, $visituid) {
$follower_userlist = service('PeopleSearch')->getFollowersReturnJSON($uid, $keyword, $page, $limit);
$follower_userlist = json_decode($follower_userlist, TRUE);
if ($follower_userlist['total'] > 0) ... | 1 |
30eae0b729b2dbb2c879f6799bedc2bb | 3447460e6306f6c77a8c16e89a80ef96 | Acknowledge (and cull) an item in the sequence. | void Connection::rtx_ack(const Seq ack) {
auto acked = ack - prev_highest_ack_;
writeq.acknowledge(acked);
if(cb.SND.UNA == cb.SND.NXT) {
rtx_stop();
rto_attempt = 0;
}
else if(acked > 0) {
rtx_reset();
rto_attempt = 0;
}
} | 1 |
39f560fdc8e34fb680577301260359ab | 2be14c8271ba0d890ead2d6d5214c06b | FUNCTION
DESCRIPTION
Before enter CB language screen, get language list
PARAMETERS
none
RETURNS
none
GLOBALS AFFECTED
none | {
HWND hWndComboBox = GetDlgItem(hDlg, IDC_COMBO_USERLANGSETTING);
if(!hWndComboBox) {return;}
TCHAR szTemp[MAX_LOADSTRING];
TCHAR szLanguageString[MAX_LOADSTRING];
for(unsigned int i = 0; i < g_GlobalConfig.appLangs.size(); i++)
{
if(g_GlobalConfig.appLangs[i].length())
{
... | 1 |
a318d213c7d011de63c916e6d3eb2bf9 | 6c61c4fa5bf8fa0589b03918819a2cdc | Add embedding layer.
Returns:
inputs: List of length num_steps, each of whose elements should be
a tensor of shape (batch_size, embed_size). | batch_size, seq_len = inputs.size()
token_embedding = self.token_embedding(inputs)
position_embedding = self.position_embedding(inputs, seq_len)
embedding = token_embedding + position_embedding
embedding = self.layer_norm(embedding)
embedding = self.dropout(embedding)
return embedding | 0 |
dbc35f928014e395eb30b946e326a515 | 1c108509815d57b3f047d838e1f1d366 | Installs the exception handlers for uncaught errors and unhandled promise rejections. | process.on('uncaughtException', function(err) {
console.error('Caught exception:', err.stack);
});
process.on('unhandledRejection', function(reason, p) {
console.error('Unhandled Rejection at: Promise ', p, ' reason: ', reason.stack);
});
} | 1 |
2fe602d22d59cb3d20ed89c699ee4cc0 | 633ff7917f487da22cdbe3a9f3d2b601 | Sets if the camera is able to free-look | export class RegularCameraControls
set locked(val) {
this._locked = val;
} | 1 |
36fca2e2a6996eb573b5e80e292672e2 | 1a94c438d02932862e436619d9a34cb6 | 新增缺课白名单 | $act_id = input('id/d');
if($_FILES){
$file = $_FILES['file'];
if(substr($file['name'],-3) !== 'csv'){
return ajaxReturn(0,'请上传csv文件');
}
if($file['error']>0){
return ajaxReturn(1,'上传失败');
}
$act_id =... | 1 |
d573925a777bcb8f042f22c4673c3580 | 64a86f18e8e78dd33092842e518ac980 | Исключение при пустом пути | class KeyTestCase(unittest.TestCase):
def test_null_path(self):
with self.assertRaises(ValueError) as _:
Key(self.def_index, None, 1) | 1 |
721e17f62c5b0bc8d546b0c360893bb4 | 603daf02242d715ccda413f165a50b8b | Swap axes of the list of images to be used for CNN | image, label = super(CardiacDataSet, self).get_image_and_label(index)
def prepare(x):
x = np.swapaxes(x, 1, 3)
x = x.reshape((-1, x.shape[2], x.shape[3]))
return x
image = prepare(image)
label = prepare(label)
assert image.shape == label.shape
... | 1 |
6cf240278eebd426b9766f2107545157 | 0d7062c28a5436a0bddb149932642a4d | Is the curret page search page ? | class Enqueue
private static function isSearchPage() {
if (is_multisite() && (defined('SUBDOMAIN_INSTALL') && SUBDOMAIN_INSTALL === false)) {
if (trim(strtok($_SERVER["REQUEST_URI"], '?'), "/") == trim(get_blog_details()->path, "/") && is_search()) {
return true;
}
... | 1 |
87ffa51acb6755497cd10820e1ea268b | 180431219d309e66a3441b10c2a6ec58 | 根据收到的餐桌信息,生成餐桌信息表 | {
int i = 0;
if (!isdish)
{
foreach (DataRow dr2 in shopptable.Rows)
{
string dishid = dr2["dishid"].ToString();
string dishunit = dr2["dishunit"].ToString();
strin... | 1 |
37298201e6352fedeb77f98267aa5615 | b6edef054cb1746cceda0208a43c6398 | Removes the specified <paramref name="connectionId"/> from all Chatrooms. | namespace PandoLogic.Models
public static class ChatUserExtensions
public static void RemoveAllWithConnectionId(this DbSet<ChatUser> users, string connectionId)
{
users.RemoveRange(users.Where(u => u.ConnectionId == connectionId));
} | 0 |
ea7b4f8d454098dd9afa311f7abc75c6 | 7e5ace5693f950eff5368aff09d77ce2 | used to determine if pts data is available. | class PointDataSet:
def hasData(self):
return not self.data.empty | 1 |
2c270e48261fdd58cd82f64b17f17ae1 | 98288f310604a0f2416a60f2a7d96c56 | 龙蛋采集被打断 | public void onPlayerItemConsume(PlayerItemConsumeEvent event) {
if (event.getItem().getType().equals(Material.ENDER_PEARL)) {
event.setCancelled(true);
}
} | 0 |
cb839bbef358e7b639b00f5d0d030193 | 2bfe49d0f2457b93d9a333aff567db13 | Displays content on the connection scene. | Label headerLabel = new Label("Connection");
headerLabel.setFont(Font.font("Arial", FontWeight.BOLD, 24));
gridPane.add(headerLabel, 0,0,2,1);
GridPane.setHalignment(headerLabel, HPos.CENTER);
GridPane.setMargin(headerLabel, new Insets(20, 0,20,0));
Label nameLabel = new ... | 1 |
7fb759a721460bb2904eae127f92d5fb | fa9124273d5fc476e77cba369a8b59b6 | 查找给定对象的所有type为103的对象属性 | <T> List<Property> getAllProperties(T t); | 0 |
c68bb60d10793d7131cf886622902be6 | 92b1ca5b5e4f3bf10ba135cb40e4580d | このTweetViewModelの色設定を更新します。 | viewModel.color = color
tv_color.textColor = color
ic_color.textColor = color
} | 1 |
bd9a50e55e7a272f729bdafec77cae7e | 72cb6d1527549b08eed3f01f35e34724 | Mark the referred column as indexed or non-indexed. | public class SQLColumn implements SchemaElement
public boolean isIndexed() {
return this.isIndexed;
} | 0 |
d11fe18ffb3ec821fc90c8f7e7867a65 | dbc0793b5581e31119cd1c30b80e7a70 | Search for a substring using the KMP algorithm. | if not substring:
return list(range(len(text)+1))
substr_hash = kr_initial_hash(substring)
return [
i for (i, text_hash, possible_match) in kr_rolling_hash(text, len(substring))
if text_hash == substr_hash and possible_match == substring
] | 0 |
ef6807d5284873aa226b2883b6fd9ab9 | 5a57836021565883be988f79ae063539 | Evaluates a setting value by combining current value with environment,
site and global settings. | val = self.value(setting_name)
if not val:
return default_value
return val | 0 |
ee5f1dd98c6690b0413ff86fe24fbff7 | 7bf338942b9964f813a9bef0e3741aa9 | 初始化Word组件 | {
DataGridViewUtils.InitGridForArr(WordsDictionaryDGV, 80, true, true, true, false, false, true);
} | 0 |
3f0d9b0dbc72d661ab5570db33ca9734 | bb60a40f51e1a49025225819a654f9d3 | Retourne un lien pour afficher le nom du module, avec un lien
conduisant à sa présentation. | final class Module extends Singleton
public static function createModuleLink($moduleName = NULL, array $options = [], $anchor = NULL, $encodeEntities = true) {
if(is_null($moduleName)) $moduleName = i::Module()->moduleName;
$url = 'index.php?'.self::GET_NAME.'='.$moduleName;
$url .= self::getMoreParamsForLink('&'... | 1 |
9f47aa1d130359863bd87fa62c2c3594 | 2c1694581972ac08e417825f4418313a | calculate the force in the y direction given dy, distance, and the overall force | if vy > 0:
Fdy = - (1/2) * self.ro * self.Sy * vy**2
else:
Fdy = (1/2) * self.ro * self.Sy * vy**2
return Fdy | 0 |
7f449cb65eeeb374c1464c8647b632f1 | b5be97ad9065bed18621bff5c79d7c80 | 安全检测方法 | class Safe
public function urlChecker(){
if($_SERVER['REQUEST_URI']){
$url = $_SERVER['REQUEST_URI'];
$keyword=array("'",";","union"," "," ","and","‘","“");
foreach ($keyword as $value) {
if(strstr($url, $value)) die('<script type="text/javascript" charset="utf-8" async defer>alert("亲,别这样啊!手下留情~~"... | 1 |
5da6103c6813a7152f6ddd7d875da368 | 15c5755221fc29891ab2ec6d46df1bb2 | The SetStretchBltMode function sets the bitmap stretching mode in the specified device context | int CTexture::Stretch(CDC *pDC,
CRect *pRect)
{
if(!IsValid())
return 0;
SetStretchBltMode(pDC->m_hDC,COLORONCOLOR);
return StretchDIBits(pDC->m_hDC,
pRect->left,
pRect->top,
pRect->Width(),
pRect->Height(),
0,
0,
m_Width,
m_Height,
GetData(),
(CONST BITMAPINFO *)&m_Header,
DIB_RGB... | 1 |
bab2b2141845863793620444b5c60528 | bbb6fd415e12178db7f1cb5857915cb7 | Add a section for viewing images to the UI | pictureList = new JTextArea(RESOURCES.getString("picturesAreaName")+"\n");
pictureList.setEditable(false);
JScrollPane scrollPane = new JScrollPane(pictureList);
scrollPane.setLocation(
Integer.parseInt(RESOURCES.getString("picturesAreaLocationX")),
Integer.parseInt(RESOURCES.getString("picturesAreaLoc... | 1 |
8b82662ed41abb7bdc726afc310d80b1 | d8c5ccbb2b6929d6af70626f1d9b457e | method called to set a faction entity's faction colors: | factionList = []
for element in XMLRoot:
if element.get("Name") is not None:
colorElement = element.find("Color")
color = [float(x.strip())/255 for x in colorElement.text.split(',')]
factionList.append([element.get("Name"), color])
retu... | 0 |
bfe296db554f0f8f97ea89cb1995c48e | 54df9d11f6d8deb389400cd4e68d4e6f | Test constructor with document root with missing trailing directory separator. | class FileParserTest extends \PHPUnit_Framework_TestCase
public function testConstruct()
{
$this->assertEquals(
$this->testDir,
$this->parser->dir,
'Newly created parser\'s ::$dir must include trailing dir separator.'
);
} | 0 |
c17e524675d41ce3b635237d4b3b9214 | 4cf949a1c701ad6200d93fdfbbca0e2c | Loop over all items after the given index. | {
while(startIdx >= 0)
{
var idx = Search(data, startIdx, endIdx);
if (idx < 0) yield break;
yield return idx;
startIdx = idx + 1;
}
} | 0 |
e072c9e15dd7aaf67a8dc3bfb19ddf97 | df3f340e48cb5f0d691801231e751cf5 | creates one card from the two arrays above. | def get_random_card(list1,list2):
suite_index = random.randint(0,len(list1)-1)
values_index = random.randint(0,len(list2)-1)
return list1[suite_index] + " " + str(list2[values_index]) | 1 |
18cc64fc1da563933285d219e79e3ddb | 1e3c1214c9b8aeda67726288f3e40ea2 | 将毫秒数的时间转换成分+秒的形式 | int minute;
int second;
minute = (int) ((millisecond / 1000) / 60);
second = (int) ((millisecond / 1000) % 60);
if (minute < 1) {
if (second < 10) {
return "0" + second;
} else {
return "" + second;
}
}el... | 1 |
9ed3fbfe2c6b1a8e200231899e94931c | a59a382a42c4c383d9633bcc391805c4 | Route for all topics | class TopicController extends \BaseController
public function index() {
$this->layout->content = View::make('topic.index')->with('graph', $this->traverseGraph(Topic::findOrFail(1)));
} | 0 |
e2f5705fcf7bf5879c35a74e42a09245 | d86a4e528dd8fda667baee9f6a16b4d1 | Will check to see if you are on a bucket and change the color of the player's label | {
if (col.gameObject.tag.Equals ("Player")) {
this.active = true;
exclamation.text = "!";
exclamation.color = Color.red;
}
} | 0 |
b879a845ff2d8d082b74a8705c8b537f | 9ff1d909f1e4400634570a9e82f5f8f8 | 获取评论有效回复数量,未审核的不包括在内. | $num = self::where('reply_id', $reply_id)
->where('status', self::STATUS_NORMAL)
->count();
return $num;
} | 1 |
68571d510c017c8cb8278b8c1c5170e0 | 7b1d1f8bf5570abfc09cb92e8da19678 | Функция для девятого задания: выводит студентов под определённым номером | grade = Grades.objects.get(pk=num)
studentsList = grade.students_set.all()
return render(request, "myApp/students.html", {"students": studentsList}) | 1 |
52519637dfbae400144d6fc7137fca87 | 103f933c2a19c884fd86024ba89657ac | Modify version: | def modify_changelog():
with open('src_copy/src/CHANGES.md', 'r') as file:
data = file.readlines()
data[0] = "# Changelog"
with open('src_copy/src/CHANGES.md', 'w') as file:
file.writelines(data) | 0 |
ea258568256bd35f212a65ad8600ca49 | f875454f2e108fca4ce542b245a60bd7 | Обрамляет кавычками алиасы полей | class BlitzQueryTemplate extends \Topface\Db\QueryTemplate\BlitzQueryTemplate
public function field($str) {
if (!empty($str)) {
return "\"$str\"";
}
} | 1 |
9deb58e0ef14f1fe99f9d240a7c86aa4 | d2019b370a20884bf9113b3fc173e36b | Registers binary type information in cluster. Do not update binary
registry. This is a literal implementation of Ignite thin client
protocol's `OP_PUT_BINARY_TYPE` operation. You would probably want
to use :py:meth:`~pyignite.client.Client.register_binary_type` instead. | class AioClient(BaseClient):
async def put_binary_type(self, type_name: str, affinity_key_field: str = None, is_enum=False, schema: dict = None):
conn = await self.random_node()
return await put_binary_type_async(conn, type_name, affinity_key_field, is_enum, schema) | 1 |
6836446dff00aace8c6784ddc2422379 | e3cc244927842ce1c8dd0c8cd4b7a2ca | 删除轮播(直接删除) | @RestController
@RequestMapping("adminer")
public class AdminController
@PostMapping("deleLunbo")
public BusinessMessage<String> deleLunbo(String id){
return adminService.deleLunbo(id).build();
} | 1 |
566c76d1eccc2c2e40e95fe35fe6fbc9 | 4e086e37b9c32868bb87515991437b17 | 添加自定义机器人服务 | public BaseRes start(@RequestBody Map<String, Object> params, HttpServletRequest request) {
robotService.start(params, request);
return ResUtils.ok("启动成功");
} | 0 |
12fa91b4e5540fba70a045cc8d55d809 | b6dffdf32cad08d9ddf0391c08056771 | A common config does not exist, but the testing config does, loading the config should not fail | async def test_loading_with_no_config(hass: HomeAssistant, mock_config_entry) -> None:
mock_config_entry.add_to_hass(hass)
await setup.async_setup_component(hass, DOMAIN, {})
assert mock_config_entry.state is config_entries.ConfigEntryState.SETUP_ERROR | 0 |
239395f40c028ee371887f6dae317474 | 34ab87396760e83d9618b32f75533180 | 判断项目名称是否存在,,如存在返回真 | namespace KDWechat.BLL.Module
public class md_sale_project
public static bool CheckPName(string p_name,int wx_id)
{
bool isChecked = false;
using (kd_moduleEntities db = new kd_moduleEntities())
{
isChecked = (from x in db.t_md_sale_project where x.p_name ... | 0 |
e722c68335e358edc65aeb2112df040c | 3d2f3ee9f8f6b5c6a1000287acded3b8 | Test whether student information inserts correctly | BST<Student> name = manager.getTreeName();
Student student = new Student("2324234", "Ajay", "Dalmia");
name.insert(student);
assertTrue(manager.getTreeName().toArray().get(0)
.getFirstName().equals("Ajay"));
} | 1 |
c4f0e328a1366d279b85a0e28917c3e1 | 2c712598e423270a891063e6b0dedd39 | Method to disable the 'Clear Search' button on the GUI. | {
try
{
this.EnableSearchButton();
}
catch (Exception ex)
{
ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
}
} | 0 |
f0e88f4ebdca3b5161f9083b9dce9302 | d40753ab8718fdd33c5c7c39fc61c59c | Prints a string multiplied by a number | def testfunction(string, factor):
print(string * factor) | 1 |
105be983ffb369036daf597f3e42c451 | abd3c657d0bf806f1509e653d23a6e09 | Draws the Menu Button for adding a component to the component list. | {
var menu = new MenuSelectionComponent();
menu.DataContext = currentOrder;
fullComponentBorder.Child = menu;
} | 0 |
e0022b12f89417f35494203bff3de805 | 16b0a0c60e8413c5a93f5008f64705ac | Returns a list of the pixels the snake is occupying. Pixels
are represented by a list with 2 elements | class Snake:
def body(self) -> List[List]:
return self._body | 1 |
f3a005f69c674e9c45e304a4b7ffdbd7 | 650bc7af5b61b6a6e9891484cd04e906 | Given -
trampee - the name of the symbol to hook
tramp - the stage 2 trampoline entry
orig_func - out parameter storing the address of the function that was
originally called.
This function will update the ruby binary image so that all calls to trampee
will be routed to tramp.
Returns 0 on success | orig_strcpy = (T_strcpy) dlsym(RTLD_NEXT, "strcpy");
orig_strncpy = (T_strncpy) dlsym(RTLD_NEXT, "strncpy");
orig_strlen = (T_strlen) dlsym(RTLD_NEXT, "strlen");
orig_strcmp = (T_strcmp) dlsym(RTLD_NEXT, "strcmp");
orig_strncmp = (T_strncmp) dlsym(RTLD_NEXT, "strncmp");
orig_memcpy = (T_memcpy) ... | 0 |
6b01dbbc710004cc2e08db0aecf1edb8 | ce5df764f893f9af2534e2f8bc9d3232 | No-op if nothing to add | impl FakeAggregateSignature
pub fn add(&mut self, _signature: &FakeSignature) {
} | 0 |
26bfc3c84a2edafbf799cbe974b0b365 | e8e35205fadddc63fa3bdf36ebd0a5b9 | Metodo para definir la operacion sql para listar todos los documentos registrados en la base de datos | return "select ide_acafi,serie_acafi,nombre_inarti,nombre_acafi,descripcion1_acafi,color_acafi,nombre_aceaf ,nom_geper,nombre_acuba as UBICACION,fecha_compra_acafi \n"
+ ",ano_actual_acafi ,anos_uso_acafi,vida_util_acafi,valor_compra_acafi,valor_comercial_acafi,valor_remate_acafi,observacion_aca... | 1 |
f98070470006286512552a3cd47bd215 | 772e8a9962c363470996b25b1ab98c2f | Opens the file and reloads the CompactLabelToOrdinal. The file it expects
is generated from the <see cref="Flush(Stream)"/> command. | {
using (FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read))
{
Load(stream);
}
} | 1 |
a7fb1a2c8e2a384ca0d582d14fde749a | 0bd34457cd4102ec87e086d6bc72594f | Returns the meta object for class '{@link org.talend.dataquality.analysis.Analysis <em>Analysis</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getAnalysisSheet_Analysis(); | 0 |
4d6c58c561d724647a1dbdff9f8fe76a | be7f79b09b638815db06af9d078bf865 | вывод информации о шрифте | if (!hfont)
return {};
wchar_t buffer[1024];
swprintf(buffer, std::size(buffer), L"%ld %ld %ld %ld %ld %hhu %hhu %hhu %hhu %hhu %hhu %hhu %hhu %s",
logfont.lfHeight, logfont.lfWidth, logfont.lfEscapement, logfont.lfOrientation, logfont.lfWeight,
logfont.lfItalic, logfont.lfUnderline, logfont.lfStrikeOut, logfo... | 1 |
53f384e45c0048af00d2ab04b9fec4a1 | 07d2e2f1c121f3d21583fc6407d1d2f2 | Ziska zvuky ze zadane slozky a nastavi delku pole | void son_load_all(t_son *son)
{
son->mort = son_load_check("images/mort.wav");
son->bonus = son_load_check("images/bonus.wav");
son->teleport = son_load_check("images/teleport.wav");
son->vortex = son_load_check("images/vortex.wav");
} | 0 |
993dbce87fbca27a40195d01a99edc70 | 524e0140956ab334e6cd93cd58393bce | Speichert ein Gipfel | @Entity
public class Field
public static void setFeld (int x, int y, String gelaende, int idBurg, int idSpieler){
Field field = new Field ();
field.x = x;
field.y = y;
String koords = ""+x+""+y;
field.koordinaten = koords;
field.idBurg = idBurg;
field.gelaende=gelaende;
field.idSpieler=idSpieler;
fie... | 0 |
0e1c3718a4a7920790aef2eea6134e48 | 5c79b8201adecfcdecfa6c1214efc439 | Returns a map with all ReportTable identifier and name entries. | public class ReportServiceImpl implements ReportService
@Override
public List<VoReportDescriptor> getReportDescriptors(final String language) {
final Map<String, VoReportDescriptor> out = new TreeMap<>();
for (final ReportDescriptor descriptor : reportDescriptors.values()) {
if (descript... | 0 |
0d1bdd5563fe95723761bc017d77361c | d33df4f768deb9cdf5c3efd8b4464a43 | this function is called when the towers are changed
the "fresh" variable determines if a move has been made yet
if it has not then it means we're getting this function called because
of a reset. here we remake the disks from scratch | if(fresh){
init_fresh_disk(DISK_NAME, BLOCK_SIZE, NUM_BLOCKS);
init_inode_table();
init_fdt();
init_root_dir();
init_bmap();
init_superblock();
set_bmap();
inode_table[superblock.root_inode].notInUse = false;
set_inode_sb();
write... | 1 |
be2630be67c527e1892f3792a133a340 | 3ae5aa0fd0803963c11f851661e42bc2 | Тест, проверяющий удаление по id элемента в массиве. | {
$posts = PostModel::getAllList();
$this->assertCount(7, $posts);
$this->assertEquals(1, $posts[0]->getId());
$this->assertEquals(2, $posts[1]->getId());
$this->assertEquals(3, $posts[2]->getId());
$input = array();
$input['ids'] = [1,2];
$header = $t... | 1 |
7312ef6ed8dbbf88726ac9c99f1649b8 | 03325fa5f722e78f2de9b4cae33846b1 | Creates a handler that will stop a feature as part of a transaction. | return new IAsyncHandler<PolicyFailure>() {
@Override
public void handle(PolicyFailure result) {
EngineResultImpl engineResult = new EngineResultImpl(result);
resultHandler.handle(AsyncResultImpl.<IEngineResult> create(engineResult));
}
... | 0 |
1bc72f48993cdd60388ea481bae10a9d | 4df277adf8992e21cd9999bf29a08a61 | Deletes the choice corresponding to the identifier from the list of choices. | {
SqlParameter[] choiceParam = {
new SqlParameter("@ChoiceGUID", SqlDbType.UniqueIdentifier) { Value = choice.ChoiceGUID }
};
ExecuteCommand(CHOICES_DELETE, choiceParam);
} | 1 |
3bf75603041648a3355a1eb065474c55 | c4d174322e0cafd44893104d7e7c722c | @brief テンプレート設定を初期化する。 | $this->_templater = new $templateClass($templates);
if (empty($this->settings['templates'])) {
return;
}
if (is_string($this->settings['templates'])) {
$this->_templater->load($this->settings['templates']);
}
if (is_array($this->settings['templates'])) {
$this->_templater->add($this->settings['temp... | 1 |
3d302c4508de8e6f078862ddae1405fa | e9f5722bc1429feaae2184929ca674d9 | Recursively scan directory at given depth, create array with filenames and their checksums | int fs_list_files(char *dir_name, char *array[], int length, int index)
{
DIR *dir;
struct stat st;
struct dirent *ep;
char *full_path;
char *next_dir;
dir = opendir(dir_name);
if (dir == NULL)
{
return -1;
}
while (ep = readdir(dir))
{
if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name... | 0 |
f8f6d1ec708d5e1b869fa4dc74f19e8c | f064710c48974d99696c327ea3eb5c5c | Obtiene los descendientes de un concepto | child_inds = []
target_index = concept_map[CONCEPTS_STR].index(target)
target_row = concept_map[ADJ_MAT_STR][target_index]
for ind in range(len(target_row)):
val = target_row[ind]
if(val>0 and ind != target_index):
child_inds.append(ind)
... | 1 |
7f9a7473b89494616a0642d34bbd6a4c | 527f07faa5f63021e0caf5b5f0720712 | Gets whether the armor stand has marker enabled. If true, the armor stand's bounding box is set to zero and
cannot be interacted with. | public function getProcessmarker(): bool; | 1 |
c0602b7d775cbb9cfa7bbe7f91d5a69b | 6cb2bcb74bcd5512cf49d777dbc713b3 | Description: Function that creates a list with the provinces of Costa Rica
Returns the list with the elements | class CovidCases:
def get_pygal_american_geoid_string_list():
geoIdList = 'AR, BB, BM, BO, BR, BS, CA, CL, CO, ' + \
'CR, CU, DO, EC, SV, GT, GY, HN, HT, ' + \
'JM, MX, NI, PA, PE, PR, PY, SR, US, UY, VE'
return geoIdList | 0 |
2fd6079c8ef6fdb8184444a09c87509a | b843e7cd42cfb8b28dda407019f5917d | 根据传入的html代码获取所有a标签的href属性,结果返回list | js = """
var htmlArray = new Array;
var links = document.getElementsByTagName('a');
for(var i = 0; i < links.length ; i ++ )
{
htmlArray.push(links[i].outerHTML)
};
return htmlArray;
"""
htmlArray = self.driv... | 0 |
b073c046c32c3ca44324b6871d51dd58 | d58e2cb376333555fd248e104da9801f | The agent supports special, built-in "vines" commands beginning with
'v' that the agent executes itself, without invoking a shell. For example,
+v user root+ will change the user account that future shell commands
execute as. | super(VSphereAgent, self).__init__(user, pwd, host)
self.msg_attr_types = {
'hostname': (types.StringType, types.UnicodeType),
'name': (types.StringType, types.UnicodeType, types.NoneType),
'key': (types.StringType, types.UnicodeType, types.NoneType),
'use... | 0 |
1b73304cf13fa9e1c4937e818a3f34db | 0d50edf6fe0da283e78ad46274ed5c81 | very similar to redirect_in | function httpredirect($url) {
if (substr($url, 0, 1) == '?') {
$baseurl = parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH);
$url = $baseurl . $url;
}
if (!headers_sent()) {
header("Location: {$url}",true);
} else {
echo "<a href=\"{$url}\">click here to continue</a>";
}
die();
} | 1 |
d47a81ea27cd09d7260fffc8f824d17b | 016dc56cf8522be49206049b96bdb0f2 | Групповая отправка чеков или отправка чеков кнопкой управления | def SendTo(bot, update, user_data):
keyboard = [[InlineKeyboardButton("Отправить во все группы", callback_data='1'),
InlineKeyboardButton("Отправить выборочно", callback_data='2')]]
reply_markup = InlineKeyboardMarkup(keyboard)
bot.sendMessage(update.message.chat.id,'Выберите действие:'... | 1 |
c5ccf8942d084d10b30ea55720baa5fe | b4aba27efea5e96254f4117526e688a8 | 个人砍价列表 | class TuanController extends Controller
public function kjlist($uid)
{
$posts = Packagetest::listBargain($uid);
return view('kanjialist', compact( 'posts'));
} | 1 |
7486f80525d6ba83800a57f439614bbb | 8fe56e1909ce9a9e3bb9a9d53d7f000e | Builds the Streamlink command required to launch a stream. | class VlcPlayer(Player):
def _buildStartOpts(self, streamUrl, playList=False):
opts = [self.PLAYER_CMD, "-Irc", "-vv", streamUrl.replace('https://', 'http://')]
return opts | 0 |
3b1c3242cad40fb6ff4f69e36f20e2e2 | ba0cbd6a9998e993cd83f95f539e1886 | Similar to cleanSignal_curvature, but preserves the length of the array
i.e. end points are not trimmed. Threshold default is also better tuned to EQE. | garbage_where = np.argwhere(data_full['distance'] > signal_threshold)
print(garbage_where)
if not garbage_where.size:
end_garbage = 0
else:
end_garbage = garbage_where[0][0]
data_clean = clip_data_dict(data_full, head=end_garbage)
end_descent = np.argwhere(data_clean['signal'] < ... | 0 |
79cb7226f7d0a334556f3684aea7f7ce | 405ae9ca00d00d024197234623e9bcf2 | Get the score of the given team | int getPointsForTeam(Team tm); | 1 |
c24f04d22640377180129511dd5639c0 | 06c74e4867230e720312c5eb315b1dab | Clear Global Interrupt Enable. | {
#ifdef __S12_CORE
__asm SEI;
XGMCTL_XGIE = 0;
#endif
#ifdef __S08_CORE
#endif
} | 1 |
9d4ab72dbbc69521f8839e79c07e79fe | 49ea4667f7c8cc13d5f58eda190f4480 | Упаковывает типы полей.
В конфигурационном файле необходимо указать массив идентификаторов типов полей. | {
if ($this->searchHeadersTypes === null || $this->searchHeadersTypes == []) {
$this->searchHeadersTypes = $this->getConfig('searchHeadersTypes');
}
if ($this->searchHeadersTypes === null || $this->searchHeadersTypes == []) {
$this->searchHeadersTypes = $this->fillTyp... | 1 |
bb09db0d2e11e31df3c2da5d795e63f3 | a35ceef6948696b43b8ed96b1ac1f979 | Abandon ongoing attempt to split this subproblem. | class Connection(ExportImport.ExportImport):
def abort_sub(self, t):
tmp=self._tmp
if tmp is None: return
src=self._storage
self._tmp=None
self._storage=tmp
self._cache.invalidate(src._index.keys())
self._invalidate_creating(src._creating) | 1 |
9a3c2a15e297acfbfad7693818b08a35 | 4bd5a099fe6d6559325cfb90be53de14 | Add columns with the percent difference between base values and the
Exponential Moving Average of those values. | try:
import numpy as np
import pandas as pd
except:
print('Necessary packages not installed. Please install:')
print('numpy & pandas')
last_col_calc = data['last_' + num_col] / data['last_' + denom_col]
last_col = replace_ratio_values(last_... | 0 |
afab83ef10aec2b481b568bbe75e102f | 0e8760f527d22b2cfdcc1188da492951 | Returns a record reader for the rows within the file. Records are sorted if sort order is configured. | SortedReader<V> withAscending(boolean ascending); | 1 |
d8c4a4f494c6d5d21bc316ebdfa3d09e | 9d8e122eae3dd86a08d1d6bcee128bd4 | Performs the state evolution prediction
Uses the nonlinear dynamics of the system and Euler approximation
X~(k+1) = f(X(k), U(k)) | class state_space_controller():
def predict_observer(self, U):
self.X_hat = (self.A * self.X_hat + self.B * U) | 0 |
38ad305b219a1f90bbfac76f198b993c | 1388317e4d43915c4a7e157a88504337 | Filters out shadow and replaces it with the background pixels | def remove_shadow(img):
rgb_planes = cv2.split(img)
result_planes = []
result_norm_planes = []
for plane in rgb_planes:
dilated_img = cv2.dilate(plane, np.ones((5,5), np.uint8))
bg_img = cv2.medianBlur(dilated_img, 21)
diff_img = 255 - cv2.absdiff(plane, bg_img)
norm_img ... | 1 |
7aae196603c3af97c47a9496b62256ff | fb9298964029a0c5cd17fa00bee2d392 | Assert that reset key must be valid. | clear()
email = 'test1@gmail.com'
result = auth.auth_register(email, 'abcdefg', 'John', 'Smith')
auth.auth_passwordreset_request(email)
reset_code = ''
data = pickle.load(open("data.p", "rb"))
for user in data.get_reset_users():
if user['u_id'] == result['u_id']:
reset_co... | 1 |
1029a4c1ef74108e6af9ea6abb12770e | 9f220e0eb69f4aef6735f09661699a91 | This function generates boxplot of income per capita for different regions for a given year. | class regionalGDP(object):
def plot_hist(self):
self.df['Income'].hist(by=self.df['Region'], xlabelsize=6, xrot = True, ylabelsize=8, bins=20)
plt.suptitle('GDP Distribution in ' + str(self.year), fontsize=16)
plt.savefig("Income_by_Region_" + str(self.year) + "_Histogram.pdf") | 0 |
992a9d76df472c3cc185f6425a9d231d | b09f4bf66c22597d328c11c8cd3d2de3 | 已经存在的不再记录 | export class ApiItemParser
private addApiItem (apiItem: ApiItem) {
const existsApiItem = this.items.find(item => item.method === apiItem.method && item.url === apiItem.url)
if (existsApiItem != null) {
logger.warn(`duplicated api-items: method(${ apiItem.method }) url(${ apiItem.url }). skipped`)
re... | 1 |
ca0db9b0e54869699ccf45bc942c81e6 | 6b2bba1926817b6388bd65d79ea90f19 | Gets number of sectors in the circular chart area. | namespace TwilightShards.AetherumExplorer
public partial class AetherumSettings : PropertyHandler
public int getSectorMaxNum()
{
return this.Get<int>(PropertyName.MaxSizeOfSectorCatalog);
} | 0 |
f01557fe79489e1984656c6b910a61f0 | bb544eea85965831ad9e7359fe911f5e | Get the wallet's primary address. | try:
_check_token(uid, token)
wallet_data = get_server_wallet()
return wallet_data['public_address']
except (errors.ItemNotFoundError, IndexError, errors.InvalidTokenError):
raise | 1 |
4e4de7b8587e03209e3a9ff8c044260c | aa22bdfa77b091b268bc6ae60a5d8fa3 | @brief IIS发送通道使能配置 | static void IISx_TX_enable(IIS_TypeDef* IISx,IIS_TX_CHANNAL tx_cha)
{
BaseType_t xResult;
IISChax iisdmacha = IISCha0;
IISDMA_TypeDef* IISDMA = IISDMA0;
audio_play_card_iis_num_t iis_num = AUDIO_PLAY_IIS2;
int32_t block_size = 0;
audio_writedate_t buf_msg;
audio_play_card_codec_num_t codec_n... | 1 |
5c29bb155347c005a5deeae4905b4d09 | b0cb3c3310ee04d876bc2ed88dd5c204 | Return whether a given user has permission to perform bulk edit actions on these elements | class Authorisation
public static function canDeleteElement($elementId, $elementType, $userId) {
if ($elementType == Person::COLLECTION && $elementId == $userId){
$res = true;
}else{
$res = self::isOpenEdition($elementId, $elementType);
if($res != true) {
... | 0 |
fa9f8e976e10af879c90683d3cf947f3 | 4973b0b5cc47099ba33fb2e1081e9fda | Inserts the new node after the specified node in the <see cref="SingleLinkedList{T}"/>. | namespace ARMeilleure.IntermediateRepresentation
class IntrusiveList<T> where T : IEquatable<T>, IIntrusiveListNode<T>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public T AddAfter(T node, T newNode)
{
Debug.Assert(EqualsNull(newNode.ListPrevious));
Debug.Assert(Equals... | 1 |
aa22abe3c8613673a08f2de1ec51b43b | a5a6f3bc432155b98a8477f6808b6966 | of SH registers to be loaded using LOAD_SH_REG_INDEX. | void SH1_Load(uint16_t data)
{
__R30 &= ~0xFFFF;
__R30 |= SH1_LOAD_CONTROL_ENABLE << SH1_LOAD_CONTROL_SHIFT;
__R30 = __R30 | data;
__R30 &= ~(SH1_LOAD_CONTROL_ENABLE << SH1_LOAD_CONTROL_SHIFT);
} | 0 |
ee482626148b98c1e35e471f79db999a | 660fe7ba0914d4af0c73ed66d1c16cb4 | It should throw an exception with invalid options. | public void invalidOption() {
String[] simpleArgs = {"filename.dot", "3", "-hello"};
try {
CommandParser.parse(simpleArgs);
fail();
} catch (CommandParserException e) {
System.out.println(e.getMessage());
}
} | 1 |
e49ee0204fb4b7cb4928cacfb0aab2b2 | 01bcabb7fa72df3702926a624b44932b | localsテーブルにデータ挿入 | class Consultas
public function InsertLocal(array $datos)
{
$sql = "INSERT INTO local
VALUES (:id, :nombre, :direccion, :telefono, :email)";
$valores = [
':id' => $datos['id'],
':nombre' => $datos['nombre'],
':direccion' => $datos['direccion'... | 1 |
78a6be8889b3ad9973afd195bcf3ce6d | 20e7b325a5326d4869db6fd4f421e9f0 | Retrieves the last line/communication received from the server, for use
in debugging purposes. | namespace HawkIO
public class InputThread : IOThread
public string getLastReceived()
{
return this.lastReceived;
} | 1 |
72e403a54fceaf4d79520b3573ce9121 | a47cae316db61702290865048100167f | Reads the symbol from the specified position. | {
if (TryGetSymbolRecordByOffset(position, out SymbolRecord symbolRecord))
return symbolRecord;
throw new KeyNotFoundException();
} | 1 |
d585545b863af665b43fae079a216542 | 845f761c80b76ac6b27f30a89d9e2576 | Retourne l'horaire de fin de l'activite. | class Task(AbstractSchedulableObject):
def getFin(self):
return (self.__debut + self.__duree) if self.__debut is not None else None | 1 |
5070657cfb41e243e8c4738732548047 | 6c7524685b75685bfeff02611a505b5c | Map our API-side Nameserver list to WHMCS format | {
$whmcsdomainlist = array();
$whmcsdomainlist["extension"] = array();
$whmcsdomainlist["autoreg"] = array();
$premiumEnabled = false;
$premium_settings = Helper::SQLCall("SELECT value FROM tblconfiguration WHERE setting = 'PremiumDomains' LIMIT 1", array());
if ($pre... | 0 |
7be8a832954765958451dff9cb9281e6 | 6871e368ff41eb7780035a8a3b2b7a95 | Read all data set types (hits, markers, parametric data, status data)
from pridb to Pandas DataFrame. | from statsmodels import datasets
ns = self._namespace()
for name, dataset in datasets.__dict__.iteritems():
if hasattr(dataset, "load_pandas"):
ns[name] = dataset.load_pandas().data | 0 |
fa2642e0f05c16fbc6a17552a73d08c5 | 11c1500637257bfff75dde7fd7f04f16 | Make a local copy of the file and return the path to it. | abstract class Assets_base_file
abstract public function get_local_copy(); | 1 |
85917cb69b21a9bf7bc35613e00c017a | 4f416e6a6d900c73f30948dd23e4d14c | 把输入的音频(或含有音频视频)转为单声道,并可以设置采样率,然后wav格式输出. | def downsample_wav(source_path, out_path, bit_depth):
tfm = sox.Transformer()
tfm.rate(16000)
tfm.convert(bitdepth=bit_depth)
tfm.build(source_path, out_path) | 0 |
e3b47fa14e157cb22292eb8ad6e1b7a1 | 19c1da55c28850b5028c5ce120dae75f | 获取网卡信息和当前TCP连接数。 | def get_network_info():
print
print "network_info:"
if os == "Windows":
tmplist = []
for interface in localWMI.Win32_NetworkAdapterConfiguration (IPEnabled=1):
tmpdict = {}
tmpdict["Description"] = interface.Description
tmpdict["IPAd... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.