query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
7dba5e61e48d2677ad79ed7c45d3618a | 6ab3c9aa7f5cfcb69e609b7aedefd092 | Initializes all settings to default values. | {
Source = "";
CreateThumbnails = false;
ColumnCount = 3;
HeaderText = "";
BlankTarget = true;
KeepRatio = false;
ThumbnailWidth = 0;
ThumbnailHeight = 0;
CreateArchive = false;
ArchiveName = ... | 1 |
81680f3b8450d5558e73ff6788309553 | 8beb322f21faea8c7495e5f222e139f2 | Send a custom lossless packet to a friend. | namespace SharpTox.Core
public class Tox : IDisposable
public bool SendLosslessPacket(int friendnumber, byte[] data)
{
if (disposed)
throw new ObjectDisposedException(GetType().FullName);
if (data.Length > ToxConstants.MaxCustomPacketSize)
throw new Ar... | 1 |
ed50cf5f3b3f5ad7ad15008c6a3e9f37 | 7df2e152fe84e552f11856f1cb758eba | Возвращает название текущего языка на английском языке | String ru = "Да";
String en = "Yes";
String lang = Locale.getDefault().getLanguage();
if (lang == null || lang.length() < 1) {
return en;
}
if (lang.indexOf("en") == 0) {
return en;
}
if (lang.indexOf("ru") == 0) {
retur... | 0 |
830fb02db7f81b16a0a43a5bdc9d5955 | d994acf6e8054bc571068c3ca8cf7e32 | The Frechet mean of (weighted) points computed with the
Euclidean metric is the weighted average of the points
in the Euclidean space. | length = np.linalg.norm
sape = lambda p,t : length(p-t)/ ((length(p) + length(t))/2)
list_sape = [sape(np.array(p),np.array(t)) for p,t in data]
return np.mean(list_sape) | 0 |
087b114239c7ca94dd3c2dbe336b029b | f09115b4a366e5e9d576724cd0a39668 | Returns the size in blocks of the image. Useful to set up the
size of the start of the next image. | class HDTBitmap extends HDTPart
protected int size() {
return bits;
} | 0 |
420d4fb0eeba833eae828f83b8d92929 | acad7caad6d849bb584b5c4d963c3af9 | Processes request data model asynchronously. | namespace Amica.Data
public class SqlDataAccessBase : DataAccessBase
public override void ExecuteAsync<T>(IRequest request, Action<Response<T>, IRequest> callback)
{
} | 1 |
ce572fef6e5bda579efd50d14a2b9560 | 84d12be059ce3d74e190042404bca937 | Returns the number of words counted. This number can vary between
implementations. For example the {@link StandardWordAnalyser} removes
formatted numbers from the count. | public int getRawWordCount (); | 1 |
66c03e8075d31f2f573e5d8c0ba752f0 | 3b13f0c24e40a490e5e1be94aa31d82d | Tests arithmetic_mean for integers | class MeanCalculatorTest
@Test
void testSimpleFieldAsIntegerMeanCalculator() {
this.setCalculator();
this.setUnknownFields();
this.setSimpleFieldsToIntegers();
assertThrows(NullPointerException.class, () -> {
sField0n.calculate(calculator, sField);
});
assertThrows(ClassCastException.class, () -> {
s... | 1 |
6e42a4ca0d93168469e9a5d7ac2d2fb4 | 091617dc84206f4167d057b46bc655e5 | POST: api/Spots | class Api::V1::SpotsController
def index
@spots = SpotService.getSpots(current_api_v1_user.id)
render json: @spots
end | 0 |
aaebe58d031e6f1e6db14bb37c44c052 | 5bb900909050e316fbd71b615d684475 | Calculates the velocity as 1st derivative (gradient) of position.
Calculation needs one frame as buffer. | namespace SBP
[Serializable]
public class Node
public Vector2 GetSecondVelocity(float dt)
{
return (position - prevPosition) / dt;
} | 1 |
54e2f644a4b1cc6f7f92fdd34e4f23f1 | 8a8b466999ea463073dd873abd42d092 | 请求添加总结 | @Controller
public class SummaryController
@RequestMapping(value = "/web/summary/summarySend", method = RequestMethod.POST)
@ResponseBody
public DataResponse<Map<String, Object>> collectSummaryRequest(@RequestBody Map<String, String> params){
SummaryService service = new SummaryService();
return... | 1 |
2371decc4fde03546dd150cc50174b23 | 3d7f177ab309afc2708e495818a2071b | GET: tarifaEnvios/Create | {
var tipos = db.ParametrosDetalles.Where(x => x.Parametro.ParametroCodigo == "01").ToList();
var formaPago = db.ParametrosDetalles.Where(x => x.Parametro.ParametroCodigo == "02").ToList();
var proveedores = db.Proveedores;
ViewBag.OrdenContactoInterno = new Selec... | 1 |
9da23078c254852cd62c8c7fb74a9e9e | e232bb1044f30fbb42c5151f82b7e2a6 | 分页获取管理岗位人员考勤数据[异步] | namespace Learn.Business.ManagePositionAtt
public class ManagePostHistoryAttBusiness : IManagePostHistoryAtt
public async Task<BaseResultModel<ManagePostHistoryAtt>> GetPageManagePostAtt(int pageIndex, int pageSize, Dictionary<string, string> sortDic, Dictionary<string, string> searchDic)
{
Expr... | 1 |
4ff3ef358a1848750ca3079e65efda4a | fd1ffd96049a7e1fe346c585570afe67 | Generate numbers close to zero but not zero | var number float64
probability := rand.Float64()
if probability < 0.001 {
number = -0.5 - rand.Float64()
} else {
number = rand.Float64() - 0.5
}
return number
} | 1 |
582a9c4ddefaaab127b0b8ee0a2fb069 | afccdaacddca64429e4e76493e36f3ca | If we've previously set up to use a CD/DVD method, the media has
already been mounted by payload.setup. We can't try to mount it
again. So just use what we already know to create the selector.
Otherwise, check to see if there's anything available. | xl_mediacheck(struct xl_softc *sc)
{
if (sc->xl_media & (XL_MEDIAOPT_MASK & ~XL_MEDIAOPT_VCO)) {
if (sc->xl_xcvr <= XL_XCVR_AUTO)
return;
else {
printf("%s: bogus xcvr value "
"in EEPROM (%x)\n", sc->sc_dev.dv_xname, sc->xl_xcvr);
printf("%s: choosing new default based "
"on card type\n", sc->sc_de... | 0 |
b6b6dab61009756a5f5c08efa487db4d | 530c4774a4549b652ac8cb3237e6a949 | Gets the bin for the given key value | {
unsigned int bin = 0;
for (; (bin < binsLimits.size()) and (val > binsLimits[bin]) ; ++bin);
return bin;
} | 1 |
d72d5bd9568bcff2b5bd1cd4e09f097b | b26e6bd2d926a630c7ff3cabd941e188 | 调用Azkaban接口,获取工作流运行日志 | public class AzkabanWorkflowClient implements WorkflowClient
public String getAzkabanJobLog(String jobId, String offset, String length) {
List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
urlParameters.add(new BasicNameValuePair("session.id", _sessionId));
urlParameters.add(new BasicNameVa... | 1 |
113f520af3020189ec20b5dbc63136e1 | de9740391daada05e3b7f895b660ab25 | Should the working directory be regenerated on run or not? | class Stage:
def preserve_old_working_dir(self):
return False | 1 |
5cfaf3ec64a2ff20c304ccffcbe878ce | b918935719ee5c39d79e80e44ea8c17c | Prepare links for the combined files and insert them in the processed HTML | def linkLocalFiles(listFname):
for fname in open(listFname).read().splitlines():
fname = fname.strip()
if not isfile(fname):
fname = join(HTMLDIR, fname)
if not isfile(fname):
print "missing: %s<br>" % fname
continue
mTime = str(os.path... | 1 |
d4a79218e04da193ec1b2b984dbc3894 | 36c2f4916b8eb4d135a71f61203ca951 | Computes inverse docutment frequency and multiplies it by the term frequency | tf = term_frequency(term, document)
idf = _inverse_document_frequency(term, corpus)
return tf * idf | 1 |
50a10f6859941e4eb3e20b6a34cfef3e | b8ae9b20e0bbda84ff52ba6370c8224b | Defines a security inline streaming policy to a Server Group
Returns the Inline Policy Id | def ServerGroup_addInlinePolicy(apiURL, sgId, pName, pType, ilId, dIps, dir, proto):
req = {
'cmd':'$ServerGroup.addInlinePolicy',
'args':{
'serverGroupId': sgId,
'policyName': pName,
'policyType': pType,
'inlineDeviceId': ilId,
'destinationIps': dIps,
'direction': dir,
'protocol': proto
... | 1 |
4cacafc55808d97d1fa20281e019a57b | 9651957bf11b56c104aad55443e33caa | (optional) The id of the FORM tag (defaults to an auto-generated id). | class WorkflowTransitionElement extends FormElement
protected static function getFormId() {
return 'workflow_transition_form';
} | 1 |
4f83ab3b2cf89a2407d1ada90cad7a1d | 8df10813c213e498f5d72d00d1573972 | получить список непустых ячеек | namespace Assets.Scripts
public class SingleBoardStorage : IBoardStorage
public IEnumerable<Cell> GetListOfCells()
{
return cells.Cast<Cell>().Where(cell => cell != null).ToList();
} | 1 |
6306fb8b9f738b8a52c658a4ad3e74d5 | 807e6e41e36e9abf8ddc4b1369039de0 | Returns a list of AbstractOutputInstance objects | class TTOutputVersion(TTDirBase):
def _read_outputs(self, class_=None):
return self.find(depth=1, class_=class_ or TTOutput) | 0 |
5eec2e99249de508b20f351538d6b13c | 21afc325f4b8d2890e4e6aea65e416ad | Return a mapping of types to the lists of policies they support,
for use in config screen. | class PolicyType(ExtensiblePresentation):
def targets(self): | 0 |
57d374a7ec97f4b0a85d3cee9f71bcc6 | a0d98d25f3b3b7e324766ae9d30f95cb | Gets a value of a specific label. Returns "-1" if label has not found. | while (nullptr != (szToken = NextToken())) {
if (Equals(szToken, label)) {
return 1;
}
number = std::atoi(szToken);
}
return 0;
} | 0 |
a620eedb3f391083f9a2ca3acab3cdb2 | ed344b27341030f8bce012f62ed5808f | Pre-Order Traversal using recursion
Time Complexity: O(n)
Space Complexity: O(height), worst case: O(n), balanced BST: O(logn) | public class BSTTraversal
public void preOrderRecursion(TreeNode node){
if(node==null)
return;
visit(node);
preOrderRecursion(node.left);
preOrderRecursion(node.right);
} | 1 |
44585542c607442c35c746d8147a1225 | 4b6a65dbc045418173630d2fe35617a1 | Called by the game manager after calling the <code>Referee</code>'s init method.
The module must be registered to the game manager. | public class PickMajorFreeSpins : FreeSpinGame
protected override IEnumerator playGameStartModules()
{
_didInit = true;
yield break;
} | 0 |
a6fba06f7084e28816a7f9a0046656cc | 23346516ab7baa47fc3dddd42710fbb4 | Short circuit and | {
(void) opcode;
z80->regs.iff1 = false;
z80->regs.iff2 = false;
z80->regs.pc++;
return 4;
} | 0 |
6e0bddc344d8bedcaa7e8eb61fe8111a | 48df199f5f5a849e9ae5a5605167f2a1 | Search for hosts in your environment by platform, hostname, IP, and other criteria. | async apiHostGetHostList(displayName?: string, fqdn?: string, hostnameOrId?: string, insightsId?: string, branchId?: string, perPage?: number, page?: number, orderBy?: 'display_name' | 'updated', orderHow?: 'ASC' | 'DESC', staleness?: Array<'fresh' | 'stale' | 'stale_warning' | 'unknown'>, tags?: Array<string>, registe... | 1 |
9db7f05592adc8cd9dedc4fd3e1906fb | 6491703e1a288ee8c142487e760a280f | 初始化各点距离及路径 | $start_node_id=$start_id;
$info=NavigationPoint::where('map_id',$map_id)->pluck('axis', 'id')->toArray();
$i=0;
foreach($info as $k=>$g){
$node_arr[$i]['node_id']=$k;
$node_arr[$i]['next_node']=array();
$node_arr[$i]['distance']=array();
$r... | 1 |
18a1d4d0818dbb37ace05e3aa7792a0b | 0573f93721c53ddb9aa4564ab8a8d835 | Ensure a mmap syscall was successful | static int __mod_mmap_open(struct inode *inode, struct file *filp)
{
return 0;
} | 0 |
fb7e277337f435820316bf81f6efc972 | 3e2c85c5b473978341a269b680b392b4 | 登录RG | class UserController extends Controller
static function yglogin($username,$password)
{
$usermodel = D('User');
try
{
$url = "http://180.101.72.213:2525/apiyungoing/userauth?username=".urlencode($username)."&password=".urlencode($password);
$ch = curl_init();
... | 0 |
be58701f03e21ae10137e2ecfef6ff36 | eceabb149c4f2d04f6b87327d2ede538 | Отсылает заголовки и страницу ошибки сервера в браузер. | function error($view, $msg = "Something went wrong..")
{
$url = "http://localhost/errorpage";
if (headers_sent()){
die('<script type="text/javascript">window.location.href="' . $url . '";</script>');
}else{
header('Location: ' . $url);
die();
}
} | 1 |
d0d9d0cd992e3e3ef76177518a59a062 | cecdb62bd2e7d35299b131d4af40381e | Initializes the entry set for reading the parameters from the
database for the PDF generation | namespace Sequoia.Ballot.Data
public class BallotEntrySet : BaseEntrySet
private void InitStpParamSql()
{
this.hstSql = new Hashtable();
this.sqlLoad = "upPdfParamList";
this.esuInfo = new EntrySetUpdate("upPdfParamUpdate");
Dictionary<string, SqlDbType> parms... | 1 |
4b779c3845a5094a404932bcf8e165d8 | b85c02a6877543d484f676232d2c1f79 | Generate a secret key used for encryption between two parties. | def generate_secret_key():
return helper.generate_secret_key() | 1 |
9110e12a06bb54d03bc6c68c53ca1b61 | d28ed792c3dab1832d7bdb4c46be2c58 | Setter for <code>oa_salary.t_insurance_change_record.describ</code>. | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.2" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TInsuranceChangeRecordRecord extends org.jooq.impl.UpdatableRecordImpl<jooq.model.tables.recor... | 1 |
d519fdbc9b24f6b25ed1eef08cf41943 | e9342c88730bf3a4fc0c500ac393c17b | 返回具有帐户名称作为键,帐户余额作为值的数组 | function newAccount(initialBalance)
local self = {balance = initialBalance}
local withdraw = function (v)
self.balance = self.balance - v
end
local deposit = function (v)
self.balance = self.balance + v
end
local getBalance = function... | 0 |
d981c1dd3d269cf55f4d7090313a0edd | 66a6b6e62d805fecf066da4c340bbd76 | Test correct values in LUSERS with one client connected
(connecting by sending USER first instead of NICK) | self.client_connect(0)
self.client_connect(1)
self.client_connect(2)
self.client_connect(3)
self.client_connect(4)
self.client_send('get wait0\r\n', 0)
self.mock_recv('get wait0\r\n', 0)
self.client_send('get a\r\n', 1)
self.client_send('get a\r\n'... | 0 |
75819e49a25dc235f8b1f02567aa8b42 | 8b0db0ec769b4306c05c81f7832d3a0f | Calculate bounds within texture size. | inline void KLTexture_SetBoundsFit( KLSprite* pSprite, u16 index ){
KLSprite_SetUVFit( pSprite,
pSprite->pUvTable[index].x,
pSprite->pUvTable[index].y,
pSprite->pUvTable[index].w,
pSprite->pUvTable[index].h );
} | 0 |
70e9661152cdf369ea64ba27f56c0d6c | 463b5c64bfba1d92406b38bd4ed6d568 | 风格 | function StylePanel() {
var root = $('#panel-style-btn-list');
var colorBtn = $('#panel-style-btn-color-dialog');
var sizeBtnMap = {
'small': $('#panel-style-btn-size-small'),
'normal': $('#panel-style-btn-size-normal'),
'large': $('#panel-style-btn-size-large')
};
var defaul... | 1 |
5e510f44e273fac097acc45e1c840375 | 7b58091229131fec8b2febc16e81103d | 返回 财务状况分析描述 | public class Sur0001s01Dto extends PagingBaseCondDto
public String getFinancesAnalysis() {
return financesAnalysis;
} | 1 |
c8e0bb677033fb5cd0d7126e951a2f3d | 2ff5f242b8ccb521879523274a92fe57 | Head Office can specify whether/not system will accept back-dated
transactions. This is an MFI-wide setting and will be applicable to all
transactions in all offices for all loans, savings and client accounts.
By default, backdated transactions should be allowed. If the setting is
changed it only applies to future tran... | func IsAllowedBackdate() bool {
systemParams, _ := FindByKey(keyBackdate)
if strings.ToUpper(systemParams.Value) == "FALSE" {
fmt.Println("Allow backdate: false")
return false
}
fmt.Println("Allow backdate: true")
return true
} | 1 |
9b71790ffcf87cb6b0cd3646e3b6332d | a0c41c9c0162d2b003478e1ee149c9d2 | Get appointment data from database with given stored parameter starting date and end date | DBConnection.makeConnection();
Connection connection = DBConnection.connection;
PreparedStatement statement = connection.prepareStatement("select * from appointments");
ResultSet resultSet = statement.executeQuery();
while(resultSet.next()){
String start = dateAndTime... | 0 |
748d233922c10da05df89564fa471312 | 5308cc7da8b5fb59088b659caa9dad02 | Converts a certain {@link OutcomeDTO} into a {@link Outcome}. | if (diagnosisOutcomeModel == null) {
diagnosisOutcomeModel = new DiagnosisOutcomeModel();
}
this.diagnosisOutcomeModel.setOutcome(outcome);
} | 0 |
4be35775836f5b18f8eb8e08afd7ad69 | fa2e023971afe02ef0adae171ec85ec4 | @brief adau1978_pll_automute: [set] Write PLL automute configuration pin | {
if((CCM_ANALOG_TUPLE_OFFSET(pllControl) == 0x10) || (CCM_ANALOG_TUPLE_OFFSET(pllControl) == 0x20))
CCM_ANALOG_TUPLE_REG_SET(base, pllControl) = 1 << CCM_ANALOG_TUPLE_SHIFT(pllControl);
else
CCM_ANALOG_TUPLE_REG_CLR(base, pllControl) = 1 << CCM_ANALOG_TUPLE_SHIFT(pllControl);
} | 1 |
846cad4fca280810b8d963aa48372495 | f2b0912c2e8e7784c861d9cd20631d46 | Build the entry that you use to check if an ack packet matches an existing entry. | {
dynamic dict = Locale.GetDictionary(GetType().FullName + ".EventAck");
List<QueryParam> queryParams = new()
{
new QueryParam("@eventID", dict.EventID),
new QueryParam("@ackTimestamp", dict.AckTimestamp),
new QueryParam("@ackUs... | 1 |
c508edb71671ec2cae8f13e8a43f6a1a | be68d150d739be96ce099cce9f8adadf | Destructor that destroys GLB application thread | namespace robinglut
robin_glut::~robin_glut()
{
} | 0 |
e6f9a0310ccaf085e3dc46bb658fd7f3 | ec960fe03a67cd0fa74ec510f84996df | Prepare data for processing cylindrical equal area input format. | d = ct.defaultdict(list)
dict_ = dict_default.copy()
for k, v in sorted(dict_.items(), key=ut.natural_sort):
num = cls._extract_number(k)
if Geo_obj:
G = la.input_.Geometry
v = [G(geo_string) for geo_string in v... | 0 |
1f3ad70e3a5d4f5ad150a16d9d699ce7 | 28701711c4a01ac199d4da5ffab60106 | Call to server to read content of uploaded file | return this.readFileHandler.send({
urlParams: {
bucketName,
fileName,
},
}, DEFAULT_ERROR_MESSAGE_READ_FILE).then((httpResponse) => {
return typeof httpResponse.body === 'object' ?
httpResponse.body : JSON.parse(httpResponse.body);
});
} | 1 |
7336211498959b506f972e87b90a122a | b83be2b0102a571cb4f6989797c88c40 | Entfernt den Eintrag mit dem angegebenen Namen.
Argumente:
name -- Name des Teilnehmers | class InfoForm(BoxLayout):
def remove_member(self, name):
self.player_pane.remove_widget(self.members[name])
self.members.pop(name)
self.add_empty() | 1 |
96860bc7acbd89b855fe5e7a77a116db | da682fdefd1227e798d1a1b8b7cc2cc0 | Gets the sbi distribution list users. | public class UserHandlerImpl extends PilDataObjectHandlerImpl<User> implements UserHandler
@Override
public User[] findSDUsers() {
Collection<User> resultCol = this.getReadAllQueryResult(QueryRepository.SD_USERS);
User[] result = new User[resultCol.size()];
resultCol.toArray(result);
return result;
... | 0 |
9fd926e1283cbb6df195c367e4122ad4 | 1fc28459e2c5d8819640863308b2b3f5 | Get the actual file name from file descriptor
The actual code is copied from http://stackoverflow.com/a/13624412 | for i in glob('/proc/[0-9]*/fd/[0-9]*'):
try:
if re.search(inode, os.readlink(i)):
return i.split('/')[2]
except OSError:
pass | 1 |
7d0f9b49eb578e75bcdf33266b439060 | d03fdefcc0c7446f830c52c9c08b360f | 取得去年月日(去年的今天) | public class NewDateUtil
public static String geyLasterYearMonth() {
return LocalDate.now().minusMonths(12).format(MONTH_FORMATTER);
} | 0 |
918ad0d9f2cb32eb1e614ebb62a7f809 | a26c8fccb6a251161017727a8e0c74c6 | EDITOR: Draw the text field for the node's message | self.message_box = Text(self.canvas,
" "*16,
20, 40,
fill="white",
justify=tk.LEFT,
anchor=tk.W,
font=font.Font(family="Monospace",size=18)
) | 1 |
c36383185999f50788606f7955462157 | a40323d16551984424b78e44ac87c7ad | @brief Set the last valid byte address for the text box | {
uint32_t index = TextBoxId - guiConfigTEXT_BOX_ID_OFFSET;
if (index < guiConfigNUMBER_OF_TEXT_BOXES)
{
prvTextBox_list[index].xWritePos = XPos + prvTextBox_list[index].padding.left;
return GUIErrorStatus_Success;
}
else
{
prvErrorHandler();
return GUIErrorStatus_InvalidId;
}
} | 0 |
25556b6f10f2b2bdfcf92615e251c964 | 5eb741cfb0cab11b191e39a7bc95da3e | Disengage the brake | public class PivotArm extends Subsystem
public void disableBrake() {
pivotBrake.set(Value.kReverse);
} | 1 |
98ce75f869cf34dae66566ec69214b1a | 6fcf0b13eabc4df1b3637f32554f83bf | Determines whether the specified column header is located in the collection. | namespace SEIDR.Doc
public class DocRecordColumnCollection : IEnumerable<DocRecordColumnInfo>
public bool HasColumn(DocRecordColumnInfo columnInfo)
{
return Columns.Contains(columnInfo);
} | 1 |
9226efe6c09d3da1bf37e306125204ca | 47845b70893bb42de6cd1bb21d9f4339 | Set the default HTTPS encryption cipher suites.
You can specify more than one by using ',' as a delimiter | public void setFileTransferDefaultHttpsCipherSuites(
String cipherSuites ) {
setTempProperty( FILE_TRANSFER_HTTPS_DEFAULT_CIPHER_SUITES, cipherSuites );
} | 1 |
93fb013c42fd71cc74c866af3dc48589 | 015cfe80952ad823c0e2b47ff8ecad8d | 四角形要素の形状関数。
2次以上のセレンディピティ要素の定義はツィエンキーヴィッツの定本に拠った。
ラグランジェ要素は線要素の形状関数を掛け合わせるとできる。 | x = m['mu20'] + m['mu02']
y = 4 * m['mu11'] ** 2 + (m['mu20'] - m['mu02']) ** 2
try:
el = (x + y ** 0.5) / (x - y ** 0.5)
except:
el = 0.5
return el | 0 |
6c2177db276d8a9278b150bc15589e00 | dafce56bed861d8b58df39a7f6c4d016 | 验证多条白名单列表时白名单功能1 | class URL_Management(unittest.TestCase):
def test_url_C004_white(self):
self.Page.go_white_list()
self.Page.click_add_black_btn()
self.Page.click_popup_negative_btn()
self.assertEqual(self.base.get_assert('id', 'com.gwchina.lssw.parent:id/tv_empty_tip').text, "空空哒~") | 0 |
93927fd33c2cb72dcbc777529358e8ca | bafe9eb9eb8036326e54607da47f4901 | 新規予約作成画面用のキャンセルボタン・登録ボタンを表示、もしくは非表示にする | def calendar_btn
if current_store_manager.order_plan.present?
link_to "予約カレンダーを#{calendar_btn_message}する", store_manager_update_calendar_status_path, method: :patch,
data: { confirm: "予約カレンダーを#{calendar_btn_message}します。" } , class: "btn btn-outline-secondary"
end
end | 0 |
ea7912dbae92497a1360e012e785fb21 | b94c6f01a70c60b185ed12e94275a1b6 | A palindrome is a word that reads the same backward or forward. Write a function that checks if a given word is a
palindrome. Character case should be ignored. For example, isPalindrome("Deleveled") should return true as
character case should be ignored, resulting in "deleveled", which is a palindrome since it reads th... | def palindrome(word):
return True if word.lower().replace(" ", "") == word[::-1].lower().replace(" ", "") else False | 1 |
9f73deb208e1a3ec9bc2be7f869946ff | d7ed1162d11cd5a2298a10206299a67b | local contains only one item, remote contains two items => add one item to local | for k, _ in pairs(remoteList) do
if remoteList[k] ~= nil then
list[k] = remoteList[k]
end
end
end | 0 |
5d205caf7d080edba9505bd7fa503170 | ab95785e4e121f938a54e789b306dfc4 | Helper method to get a configured middleware instance | $strMethod = strtolower($strMethod);
$this->arrMiddleware = array_change_key_case($this->arrMiddleware);
return isset($this->arrMiddleware[$strMethod]) ? $this->arrMiddleware[$strMethod] : [];
} | 1 |
5a8687a6d3eb3cac63eff66f4278f5d9 | 9666e27ea45a25822e1915798955757c | Erzeugt die Ausgabe des "Eintrag verfassen"-Links.<br />
Version 0.1, 13.04.2007<br />
Version 0.2, 07.01.2008 (Mehrsprachigkeit eingef�hrt)<br /> | {
$line = '';
$line .= '<div class="tl_content_left" style="width:170px;">';
$line .= $arrRow['nachname'].','.$arrRow['vorname'];
$line .= ($arrRow['titel']) ? ','.$arrRow['titel'] : '';
$line .= '</div>';
$line .= '<div class="tl_content_left" style="width:70px;">';
... | 0 |
55c70b1d8305b3d26d5f14f99366ea98 | bbd3b8ce8c5fe1c256a3fbea3c750dee | Set the direction of the ball (when it hits the paddle) | public class BallBehaviour : MonoBehaviour
public void SetBallSpeedDirection(Vector2 dir){
speed = dir.normalized;
} | 1 |
08bd16e68c91a2e1a5b672abeb48a3fe | 6e742eeb7b4f57da14281a9b2058c53b | Check if a given value matches the district pattern. | {
if (!StringService::checkDistrict($this->$attribute)
|| self::find()->where(['template_id' => $this->template_id, $attribute => $this->$attribute])->exists()
) {
$this->addError($attribute);
return false;
}
return true;
} | 1 |
b0f03c15feed23a9a64ba6dd41920fdf | e3c7151a6126ad532d2833aabda381ed | Sets the relational operator for the beginning transaction date | String getToXactDateRelOp(); | 0 |
399abffa8c64a86c224a193ade984442 | 5efc48d0fae642294ac6560502a1b783 | 设置相机旋转区域 | namespace CameraTools
public partial class Main_Form : Form
private void AnShiBaoSetRoi(string cameraip)
{
if (!AnShiBaoIsSetRoi)
{
if (SelectedCamera.Width == 384 && SelectedCamera.Height == 216)
pb_DoubleClick(SelectedCamera, null);
... | 1 |
3ed3d294575ba54da94d4d3d7558a8de | e3d1d56fea19ccf9dfab3ac3bdb041e4 | Extends world by one tile
is_refresh_trigger: Whether or not new tile should be a trigger
for a refresh of the world | public class AutoTiling_Water : Tile
public override void RefreshTile(Vector3Int position, ITilemap tilemap)
{
for (int y = -1; y <= 1; y++)
{
for (int x = -1; x <= 1; x++)
{
Vector3Int nPosition = new Vector3Int(position.x + x, position.y + y, position.z);
... | 0 |
c537bef3b065a5b29df81908e3a720fc | c7a6e829301e245077544ea329918727 | Retorna la imagen del Half-Laser | public class DoubleLaser extends Laser implements Serializable{
@Override
public String getImagePath(){
return "Resources/Images/Card/Upgrade/DoubleLaser.png";
} | 0 |
9f582ed3d28b24ae54974adcec825a44 | ff0409e5e0249875967ee06f56abe47e | Compares times with ms precision. | return a == b || a != null && b != null
&& Math.abs(a.getTime() - b.getTime()) <= millisTolerance;
} | 1 |
62107cded4429e375fc4b868d5d85eae | 889941c7adf411f6963596cba9faea6a | 修改商品页面 只能修改状态为0 和1 的商品 | class Shop extends Controller
public function edit_goods_status()
{
$this->applyCsrfToken();
$this->_form('xy_goods_list', 'form');
} | 0 |
c9e82d5f5fac754a9f4fd72e1d7c169d | 3f10e1dce3b2d85d944a2bd38986d65e | 头删。 | int cur = this.element[this.head].cur;
while (this.element[cur].cur != this.tail) {
cur = this.element[cur].cur;
}
this.element[cur].cur = this.head;
freeNode(this.tail);
this.tail = cur;
this.length--;
} | 0 |
922ddb30b02cf0e5e055187acbd45b53 | 6ccab8a62daebf051eaaf9f4249da600 | Generate all possible k-1 subsets for this itemset (preserves order) | def subsets(itemset):
return chain(*[combinations(itemset, i + 1) for i, a in enumerate(itemset)]) | 0 |
d7ca35734483d55e756d7a121427d8f2 | 7d0af739de8642913969ec17626a422a | Gets a new #GUnixMountMonitor. The default rate limit for which the
monitor will report consecutive changes for the mount and mount
point entry files is the default for a #GFileMonitor. Use
g_unix_mount_monitor_set_rate_limit() to change this. | public class WatchKit
public static WatchMonitor createModify(final String path, final Watcher watcher) {
return createModify(path, 0, watcher);
} | 0 |
dc66a58e69b0f11ddfab95f4d05f9493 | b6eaf5840fbf939a7e53e2a51e8c6146 | POST: TrainingSheetExercises/Create | namespace ITSRunning.WebApp.Controllers
public class TrainingController : Controller
[Authorize]
[HttpPost]
public async Task<IActionResult> Create(TrainingCreation training)
{
try
{
if (ModelState.IsValid)
{
var new... | 0 |
2f871bfbf7b3f40c5a2f8310878ca7da | 294e34eccbaba346e60dc1b09ea6a740 | 给资源打包分组 | if(empty($resource_list)) {
return false;
}
$title_mark = defined('TITLE_MARK') ? TITLE_MARK : '<notitle>';
$group_resource_list = $group_attr_list = array();
foreach($resource_list as $key => $resource) {
if(stripos($resource['title'], $title_mark) !== f... | 1 |
dfeb6a227ecf565262dde6c210ece035 | 00ac97d12c1238acf3dc2becf5e21b01 | 学生爱好统计 | $config = array(
'error' => false,
'debug' => false,
'log' => false,
);
$this->load->library('EXT_Server', $config, 'oServer');
if(! $aResult = $this->oServer->getData()){
$aResult = $this->input->get() ? $this->input->get() : $this->input-... | 0 |
ce32ea3afbf8631e2db7ba40393537f3 | 1b3bed469bdde36e5cc51b5bbb717da7 | determine the last tid, which is just the number of trades. | try:
i = ((t.iloc[:,0:3] == ['']*3).all(axis = 1)).tolist().index(True)
except:
i = len(t)-1
return i | 0 |
880d52a0c3fc76085b1ba7c01dfe3c77 | 32b05a503d9c6640986dfebde997bce9 | Test a minimal active space manually. | config = {'acqfunction_config': {'name': 'default', 'acq_str': 'ucb'}}
tu = Tuun(config)
search_space_list = ('real', [0.0, 2.0])
tu.set_config_from_list(search_space_list)
data = {
'x': [[0.25], [0.5], [0.75], [1.0], [1.25], [1.5], [1.75]],
'y': [8.0, 7.0, 6.0, 1.0, 4.0, 5.0, 6.0],
... | 1 |
1250e8f07637cf3622654d41cf1f658d | 85136e81b5089d48af40c17e18bbc214 | 根据user里面的uid以及里面的属性值来进行更新操作 | updateUid (obj) {
let keys = Object.keys(obj);
for (let i=0; i<keys.length;i++) {
let key = keys[i];
userInfo[key] = obj[key]
}
} | 0 |
4e3d2e2aa547d39ac76235f4c3843090 | 5b343597617b13f8bffae47b1c50751e | Returns number of examples needed per batch for each class. | class BertSumCSVDataProcessor(torch.utils.data.IterableDataset):
def __len__(self):
return self.num_examples_per_task | 0 |
cb26a41317e96e70c50dea0f56b7719a | ad7004c738024cceea36e6b0f6416407 | Re-index the poses of the array. Useful after pose insertion/deletion. | namespace SPNATI_Character_Editor.DataStructures
[Serializable]
public class PoseStage : BindableObject, IPoseCode
public void Reorder(List<string> expectedOrder)
{
Poses.Sort((p1, p2) => expectedOrder.IndexOf(p1.Key).CompareTo(expectedOrder.IndexOf(p2.Key)));
} | 1 |
01bf426e81ac884228be49f77d115995 | edf7b76d9839c8712d2c5b2c5ca559ce | Calculates the length of this bezier curve. | namespace Engine
public static partial class Measurements
[DebuggerStepThrough]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double Length(this BezierSegmentX2D bezier) => bezier?.Degree switch
{
PolynomialDegree.Constant => 0,
PolynomialDegree.Lin... | 1 |
2e0dbfcefd72806fb24a881e17148bad | 1c94f856d7f922ee52bdb15ac232b4df | Runs PHP Mess Detector in a specified directory. | class FeatureContext extends BehatContext
public function iRunPhpDocumentorAgainstTheDirectory($folder_path)
{
$this->iRun(
"php bin/phpdoc.php -d $folder_path -t build --config=none --force"
);
} | 0 |
4fe77b8c50fdc1f9615b499c3e990c0d | 0c60231633fd805ab936725389ec3887 | Draw the feet | export default class R2D2 extends THREE.Object3D
createFeet() {
this.rightFoot = new THREE.Mesh(
new THREE.CylinderGeometry(this.topFootRadius, this.bottomFootRadius, this.footHeight, 32, 32, 1),
new THREE.MeshPhongMaterial({ map: new THREE.TextureLoader().load(bootsImg) }));
thi... | 1 |
1e02b8337acf084ab0b5ac437a26fc82 | efc9ca8ad098adda94c6678d547a6c84 | 分层次遍历
思路:
利用队列,一层一层地出队列 — 在我们每次访问完毕一层时,这时队列中存储的刚好是下一层的所有元素。
在下一次循环开始时,首先记录该层的元素个数,一次性访问完这一层的所有元素 | public class MyBinaryTree implements BinaryTree
@Override
public void layerTraverseByQueue(Node root) {
if (root == null) {
return;
}
Queue<Node> queue = new LinkedList<>();
queue.offer(root);
while (!queue.isEmpty()) {
int size = queue.size();
... | 1 |
3e25c8edbb9fb05796e57cc4e2fecea2 | 6d1d8a32e3427b2709976297a26f1287 | returns time taken in seconds for latest operation | class TicTac:
def tac(self):
if len(self.timers_ids_stack) != 0:
current_id = self.timers_ids_stack.pop()
self.timers[current_id].append(time.perf_counter())
return (self.timers[current_id][1] - self.timers[current_id][0]) | 1 |
5ba686310884c9c8a8e7c98888467db6 | 34af6ce4765e297007e9235111363bf3 | The first day of the interval represented by the schedule block. | class Schedule(Entity):
def datetime_start(self):
return self._data.get('dtstart') | 0 |
819ed3b5a205164796fb2511c6af09e7 | 1ba70c44e6dd099ec17497d1166126b9 | Gets the covered elements of the node.
A number if the node has covered elements, NULL otherwise. | public function getElements(): ?int; | 1 |
003f0af07815059802711290c3deff95 | 0a821987dfe2dc92579bfbf9b1a0c684 | 定义一个监听的方法,监听主机的端口发过来的命令 | DatagramSocket socket = new DatagramSocket();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = null;
while ((line = reader.readLine()) != null) {
if ("886".equals(line)) {
break;
}
byte[] bytes = line.getBytes();
DatagramPacket packet = new DatagramPack... | 0 |
c0a4c04739ac8dc9e38cfc84d49dbf69 | 1e9a628bf2bd7d96acd85db4c2ad33fb | Delete records from DB table <tt>f_council_apply_risk_handle</tt>.
<p>
The sql statement for this operation is <br>
<tt>delete from f_council_apply_risk_handle where (form_id = ?)</tt> | public FCouncilApplyRiskHandleDO findByFormId(long formId) throws DataAccessException; | 0 |
09f49a0716905d89cdcf02695a9dc6e5 | cff42961138a8afa16e76e49dd2ce6d4 | 更新下一代;
基于轮盘赌选择方法,进行基因型的选择; | self.judge()
self.shortest_dis_per_generarion[self.generation] = self.best.distance
newLives = []
P = np.zeros((self.lifeCount,))
for i in range(self.lifeCount):
P[i] = self.lives[i].fitness/self.totalFitness
for k in range(1, self.lifeCount):
P[k]... | 1 |
87bcfa735315948538f46955b904d7f2 | 84ff60efa3f81499611fc0c805705f8b | 3、提供一個全局的接口,提供創建實例。 | class InstanceManager
public static I3 getInstance() {
return new B3();
} | 1 |
ea68b09a700d142f621cfd590ffc5a9b | 4c87059b8eacca13449fafbf9c90593a | Test that bound method handlers and weakrref work correctly. | import IronPythonTest
def keep_alive(o): pass
def test_runner():
import _weakref
global called
called = 0
a = IronPythonTest.Events()
def foo():
global called
called += 1
foo.abc = a
... | 1 |
2afb707ac2ea2264e98a2f132449444b | 55acb00518434be49d1c595d71929ab0 | Returns true if the structure has parsed the Javascript comment id correctly. | function isScriptParsed(message) {
return isMethod(message, "Debugger.scriptParsed");
} | 0 |
d44bc39fed9d1585e6825bc53069f258 | ca9597199f63344d9ddfc4c463c242a5 | Gets the device from arrays.
The device on which the given array reside is returned.
.. note::
Unlike :func:`get_array_module`, this method does not recognize
:class:`~chainer.Variable` objects.
If you need to get device from the :class:`~chainer.Variable` instance
``v``, you need to use ``get_device_from_array(v.array... | if is_numpy_array(arr):
return numpy
elif is_cupy_array(arr):
return cupy
else:
raise ValueError(
"Only numpy and cupy arrays are supported"
f", but found {type(arr)} instead. If "
"get_array_module module wasn't called "
"directly, thi... | 0 |
ec33bd51f9973c0e775879e294c9d79c | 641f1f420208a45eceb2fd08f6a2931b | Will check the authorization status. | export default class RootController
isAuthorized(callback) {
const that = this;
that.restAngular.one(urls.loginCheck).get().then(function success(data) {
that.handleAuthorizeData(data);
callback(true);
}, function error(data) {
callback(false);
});
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.