query_id
string
corpus_id
string
query
string
code
string
label
int64
e2946e181d3b7c6284b4275922b1418a
394c686872b616fc5b5290e2c00fa140
Converts Premiums to Work Details and sets the override flag.
namespace FiveOhFirstDataCore.Core.Services public Task OverridePromotionRequirementsAsync(Dictionary<int, PromotionDetails> details);
0
f3f044c4b091e6b8268dec13939342c8
03dea5587d86efcbf04091bc0e2ad093
adds an ad to the end of the ads list
const cloneAdds = [...this.state.allAds]; const findAddIndex = cloneAdds.findIndex((a) => a.adId === updatedAdd.adId); cloneAdds[findAddIndex] = updatedAdd; this.setState({ allAds: cloneAdds }); }
0
5c7acf654db13c842f11730913853216
148a314d88b55a322c450baf9264695d
Gets the certificate by subject name
List<CertificateDataWrapper> getCertificateDatasBySubject(String subjectDN);
1
6bed518524846edfd5553566427e6261
14b96cb070a0e8b49f0af4fde589f0dd
以恒定速度追踪玩家
namespace KID public class CameraControl : MonoBehaviour private void Track() { Vector3 posPlayer = player.position; Vector3 posCamera = transform.position; posPlayer.x = 0; posPlayer.y = 16; posPlayer.z += 15; ...
1
3706a3b386ea9238a8807f1544dd565b
36dd6be379c0a89e40913cc5231fa645
Decodes and yields each message event from the contents byte string.
msgs_list = [] for obj in self.__decode_json_stream(output): msgs_list.append(obj) return msgs_list
0
98c76ac289080887ca73cd7437e8ffce
88f052965ff3548f34e39f7ca922e72a
# discard variants in Encode DAC black list regions
auxProcessVariants <- function(vars, cnvGR, heterozygous.range, homozygous.range, min.total.depth, exclude.indels, regions.to.exclude){ if (!is.null(regions.to.exclude)) { vars <- IRanges::subsetByOverlaps(vars, regions.to.exclude, type = "any", invert = TRUE) } vars <- IRanges::subsetByOverlaps(vars, cnvGR,...
0
3c1207a9f2f33585ed07d9551b6212e4
3baaf49756f05fc182a2be0f242297f6
Store a new student, with their face, in the DB
def register_new_face(path, name, phone, email, auth): conn = sqlite3.connect('facevec.db', isolation_level=None, check_same_thread=False) max_id = conn.execute("SELECT MAX(ID) FROM FACEVEC").fetchone()[0] if max_id == None: id = 1024 else: id = max_id + 1; vec = get_vec(path) conn.execute("INSERT ...
1
e4b4c5e4967d235cb25329e6ebfa1fac
289dd885a27eb1d19e5da699eb2b5849
Setter for origURL
protected function setOriginUrl(?string $originUrl): self { $this->originUrl = $originUrl; return $this; }
1
86a6b1ea7d3b4f1e22b5380b786d4dea
c126eec5e6491e49fa3d61736eb1f0b9
Read tags: <tags><tag> ... </tag> ... </tags>. The tags are translated as keywords.
std::vector<std::string> &word_list) { int left = 0; std::string word; bool skip_tag = false; for (const char *ptr = file_content.c_str(); *ptr != '\0'; ++ptr) { if ((*ptr >= 'a' && *ptr <= 'z') || (*ptr >= 'A' && *ptr <= 'Z') || (*ptr >= '0' && *ptr <= '9')) { if (*ptr >= 'A...
0
c60e8422151b40ff94fe4a644626f866
851c1136093d611dc9af86da3a8e60de
解析单条匹配返回的XML字符串
{ List<string> rtnStr = new List<string>(); XmlDocument xd = new XmlDocument(); xd.LoadXml(xml); string status = string.Empty, description = string.Empty; XmlNodeList statusList = xd.GetElementsByTagName("status"); ...
1
f366a9d648b1157d3f48081fb784c7c8
c318cf40230fbdc90ca53ebcb5ec4e6e
<p> The accuracy test of the method <code>deleteDescendants</code>. </p> <p> The tree is as follow: name / \ a b \ / c / \ d e \ f </p> <p> Delete a-c, b-c at the same time. </p> to JUnit
DefaultConfigurationObject a = new DefaultConfigurationObject("a"); DefaultConfigurationObject b = new DefaultConfigurationObject("b"); DefaultConfigurationObject c = new DefaultConfigurationObject("c"); DefaultConfigurationObject d = new DefaultConfigurationObject("d"); DefaultC...
1
bd2aef2678595be45fb9b6dbb38076cd
f29f117e2734ccebe2ff79babfa9eba0
检查stellar账户是否有效
{ $url = str_replace(self::ACCOUNT_ID_KEY, $account_id, $validate_url); $response = $this->curl_get($url); if ($response['code'] == 200 && (count(json_decode($response['string'])) > 0)) { return true; } else { return false; } }
1
761f7c38b58ce98510ee48dccc267b80
10db2962f4f09920418b6433ce48f3b3
Kysyy käyttäjältä nostettavan summan, ja palauttaa sen kokonaislukuna.
const inputField = document.getElementById(inputId); const amountValue = inputField.value; const inputedAmount = parseFloat(amountValue); inputField.value = ''; return inputedAmount; }
0
53909713783c17112620a7e0a8e17d1e
181d00efba7ca049bad5664b162448c9
Gets the total number of items purchased.
{ if (!isset($this->_properties['purchases'])) { return null; } $quantity = array_sum(Hash::extract($this->_properties['purchases'], '{n}.quantity')); return $quantity; }
1
7f276fd1209b14c5da5e444857738cef
ca217d765db3ef19362020f7851e2872
自定义验证器:广告类型是否有效
class Advertising extends \yii\db\ActiveRecord public function rules() { return [ [['ad_title', 'ad_excerpt', 'ad_poster', 'ad_target_value', 'ad_publish_community', 'ad_type', 'ad_location', 'ad_end_time'], 'required'], [['ad_excerpt'], 'string'], [['ad_location', 'ad_s...
0
ccae1a05f8678b7ee62e7e31db5af55d
90ecda0d2127be0f532733b58d7d605b
生成订单号的随机数字
class WholeOrderModel extends Model public function createOrderNumbere(){ return date('YmdHis').rand(0,99); }
1
b4712a036cb852da9d8f17a18570d4bd
d4474eb459a73305f7e3dbee9961616a
creates the training operation for a neural network in tensorflow using the Adam optimization algorithm
with tf.variable_scope("Projection/Optmizer"): optimizer = tf.train.AdamOptimizer(self.config.learning_rate) train_op = optimizer.minimize(loss) return train_op
1
6c6efbd5d2e19df092cd6d27e1d1967a
7f61448ad6da3ef0f9cb03f40c5be655
Non-windows is case-sensitive.
cases like (1)
0
689cabfd5c8c9db70e836b6a71ecfbf8
7534501d14090f7dc695ed759b0de732
Set if the property is excluded from access.
class Asset implements FilterableInterface public function setIncluded($included) { $this->excluded = ! $included; return $this; }
1
16d344e49fcbe20846074239ebda7d1f
7217039f88a680e9c938242c1544d44e
2D Heat kernel
def heat_kernel(x,t): return 1/(np.sqrt(4*np.pi*_alpha*t)) * np.exp(-x**2/(4*_alpha*t ))
0
b250d676acc1e86715ced67701fa7e70
a1c0e3212d626f1a3848b2f5933c1df8
Zwraca UNIX timestamp z wiersza DB
class Model_Sidewinder_Product_Definition implements Countable, Iterator public function getTimestamp(){ return $this->_timestamp; }
0
3bf9d9511c8b4fe1b22d3b7530620f09
8930bcaab9665c06f3a1184235dd74f5
Move component order down.
if self.CanMoveCurrentDown(): index = self.GetSelection() order = self.order.pop(index) self.order.insert(index + 1, order) self.Delete(index) if order >= 0: self.Insert(self.items[self.order[index + 1]], index + 1) else: ...
1
e542ba906f0b6ea1c9d5d66d3d3887ed
8e6f2d1304b05d800cadeb50aba8e5dc
设置节点处理中
$this->orderNo = $orderNo; $nodeModel = new NodeModel(); $node = $nodeModel->where('task_id', $taskId)->where('node_index', $nodeIndex == ProcessModel::PROCESS_STATUS_END ? $this->MAX_NUM : $nodeIndex)->first(['node_code']); if (empty($node)) { DB::rollback(); thr...
0
5b95591a5176f5432b928976d1365afc
3a41e72224e8db9e86d56f46c5dea45f
返回一个集合的全部成员,该集合是所有给定集合的交集(即:公共成员)。 不存在的 key 被视为空集。 当给定集合当中有一个空集时,结果也为空集(根据集合运算定律)。 可用版本: >= 1.0.0 时间复杂度: O(N * M), N 为给定集合当中基数最小的集合, M 为给定集合的个数。 返回值: 交集成员的列表。
public <K, V> Set<V> sInter(String dbName, Collection<K> keys);
1
a514ab9f65833166d642b50ecccb9a28
4dbab3ab12550528d2957c8c6d7d1794
Performs 1D range search
def inRange(a, r1, r2, count=False): idxs = (r1 <= a) & (a < r2) return np.count_nonzero(idxs) if count else a[idxs]
1
814c7cdd27c2d93684b4c5b4016773f2
e6f5d59510d125a2e6dca3b0b903a9b6
送信するパケットをキューに入れる
public class NetworkManager public void AddPacket(NetPacket packet) { Packets.Enqueue(packet); }
1
25eab1cd95a5435cca422749b709594f
9f8fb0706927b339cc09bcfbf74b8ca8
Function for checking the capacity of the matrix and increasing it's size if necessary.
public class LoadRCGraph extends RCGraph{ private void ensureCapacity() { if (vCount >= vertics.length){ RCGNode[] buffer = new RCGNode[vCount * 2]; for (int index = 0; index < vCount; ++index){ buffer[index] = vertics[index]; vertics[index] = null; } vertics = buffer; buffer = null; } }
1
14f3ee692f0e2ae334084f141c3b1569
a3d0cc94dcacb77fa2b52b8504909344
True if the expression is of the type that can return a value (property,field,cosntnat, method call)
ExpressionTypes type = exp.expType(); return (type == ExpressionTypes.avg || ExpressionTypes.count == type || ExpressionTypes.sum == type || ExpressionTypes.max == type || ExpressionTypes.min == type); }
0
6588c30ef2f2d668ce352271aa797e46
be9bdac5050d565fd647284c8a44f762
Saves the TIFF represented by the internal data structure into the specified file
public class TIFFhandler extends LoggingClass public void saveAs(String fname) { logPush("Calling FlexData.dumpToFile with string argument ", fname); fData.dumpToFile(fname); logPop("Done"); }
1
277f63037a64af17c464dd68f9b881fb
fe7cbc5d0002a60292e46ca9bea7b68b
Fonction qui retourne la liste des cartes encore non-révélées du jeu
var lesMoveValides = []; var main = etat.joueurs[etat.tour].main; for (var i = 0; i < main.length; i++) { var carte = main[i]; if (carte.valide) lesMoveValides.push(carte); } return lesMoveValides; }
0
ff898653b063716fc78fc7e25c191134
24cd1d559a5880a8fbc7c0702a756f18
[ resizing_lattice_resize_function
void InitLattice(long Nmols, long Nsites, double L, long PBC) { long i, j, k, nmols; long NC; double bondlength, cell, cell2; double x0, y0, z0; if (PBC!=1) Exit("position", "InitLattice", "PBC!=1."); bondlength = 1.0; cell = bondlength * sqrt(2.0); cell2 = 0.5 * cell; nmols...
0
5070d8b2102aff26f1ce206a1caf24ee
6fc94de9d51fb11d039858a3eda62d6d
露出優先設定を取得
namespace LiteOT public partial class MainWindow private String GetPriority( Int32 id ) { return m_PriorityList[ id ]; }
1
ebc851e11ff199b1f6a9abc4d9af364b
274b10418a49d83d19aee5aa5f49dade
For border cells, returns an wall (line) that is on the outside of the maze
namespace MeiroGenerator public class CellMap public void GenerateOutsideWall() { Filter(i => i.Location.X == 0 || i.Location.Y == 0 || i.Location.X == Width - 1 || i.Location.Y == Height - 1) .ForEach(i => i.IsWall = true); }
1
264305f0ccaa332af1a92b9bd3e4c41b
1fc8c53790bd6868ba464d9e7a50b85c
Build the String representation of this bar graph and return it.
int barlength = (int) Math.round(0.3 * value*100); return label + "|" + repeat('#', barlength) + repeat(' ', 30-barlength) + "|"; }
1
5309ca791a23394ab0225e2f7d862ecf
3fb189c2247dc7c1ea902e4142d7366b
返回两个数组对象中,有相同属性的对象集合
function identicalPropertyObjArr(data1: Array<any>, data2: Array<any>, property: string): Array<any> { var result = []; for (var i = 0; i < data1.length; i++) { var obj1 = data1[i]; var obj1Name = obj1[property]; var isExist = f...
1
10a74cefcf4bca86b688c16fd05e121c
679e6c5930f0a28437f80975e955ffe0
判断一个角色是否所有技能都已经完成
local flag = true for i = 1, 3 do if not self.complete_list[i] then flag = false break end end return flag end
1
cd4c515ec40706ec75d2c686eb216b97
3e1fbb3a5780c7e5b045ead52e2eac81
Parse single Peptide Record entry to `PSM`.
class PeptideRecordReader(ReaderBase): def __iter__(self) -> Iterable[PSM]: with open(self.filename, "rt") as open_file: reader = csv.DictReader(open_file, delimiter=self._peprec.separator) for row in reader: entry = self.PeprecEntry(**row) psm = self._ent...
1
0697eeeeb293358f7a346f5a8ef4d456
acca80d128457ea644e74420e464b550
Update campaign status succeeded.
public class BINCPMEACT03_Service extends BaseService public int updCampaignImportSuccess(Map<String, Object> map) { Map<String, Object> param = new HashMap<String, Object>(); param.putAll(map); param.put(CherryBatchConstants.IBATIS_SQL_ID, "BINCPMEACT03.updCampaignImportSuccess"); return baseServiceImpl.update...
1
50ce2b65373f10e39e8b1252d5ba4792
bd197db422f1696a45478758f33df67d
controleer de mappings/relaties van iedere entity of die valide zijn.
{ $this->db->createCommand()->checkIntegrity(false)->execute(); foreach ($this->foreignKeys as $fKeyName => $fKeyInfo) { $this->db->createCommand()->addForeignKey($fKeyName, $fKeyInfo['table'], $fKeyInfo['column'],$fKeyInfo['ref_table'], $fKeyInfo['ref_column'] )->execute(); ...
1
0310ec54bfb176815e2105023f3cbb17
cb3bb53f987e8962da8d5f80f900af54
Randomize by swapping two cities in the path.
if np.random.random() < self.mutation_prob: p1, p2 = np.random.choice(range(self.num_cities), 2, replace=False) Path[p1], Path[p2] = Path[p2], Path[p1]
1
bac1b383f05197846abc786f4f3c97b6
76d7fc312e34f79a5a6266a15297b977
Gets the debark date.
public class TripFlight extends Data public LocalDate getTakeoffDate() { return takeoffDate; }
0
04cb457b154b67c068f9827a7813e3f5
c343f8c37d0172ece91e85fe710baf27
Serializes the file item into a javascript array. This method should be overriden only when developing a custom FileBrowser control.
namespace LMI.BusinessLogic.CodeFirst [DataType("Umbraco.ListView", "List View - Members")] [PreValue("pageSize", @"10")] [PreValue("orderBy", @"Name")] [PreValue("orderDirection", @"asc")] [PreValue("includeProperties", @"[{""alias"":""email"",""isSystem"":1},{""alias"":""username"",""isSystem"":1}...
0
356b8090c16f8063616bd37f9c3e9695
7fb1022bfc0edb19bbae6a0723cab8da
Makes the tool window visible if it was closed or hidden.
namespace QtCreatorPack internal sealed class LocatorWindowCommand private void ShowToolWindow(object sender, EventArgs e) { IVsWindowFrame windowFrame = (IVsWindowFrame)_locatorWindow.Frame; ErrorHandler.ThrowOnFailure(windowFrame.Show()); }
1
1f2b4b69e15983a0b74427989b7ee3ce
8919cee2c2776d2ebf9abbd8ddf4282f
Wrapper for loading compressed models.
def load(path): with tf.device(get_device()): if '.tar' in path: return serialization.load_pthtar(path) else: return serialization.load(path)
1
08d117223e65a74843e14cf722a2d840
423c40a4c157597651c214befe3789af
Simple function returning number of arcs.
public class CubicTileParameters implements TileParameters{ public int getArcsInRing(int ring) { return phiCount; }
1
687fc5bb4a9edbaa08d1b4f421a2c75c
6cdce33fd2c6d54b3fcd41faf71622dd
Método para verificar se o comentário foi feito
return $this->db->createCommand() ->select(ItemCommentTable::ITEM_CMMENT_ID_FIELD) ->from(ItemCommentTable::NAME) ->where(ItemCommentTable::ITEM_CMMENT_ID_FIELD . ' = :comentId',array(':comentId' => $commentId)) ->queryScalar() !== false; }
1
22f087d4bf74c0b3472a2f48010791bc
ec6a0378d449238c52056d8cae53c0f6
Negate the last number on the screen
function delLastInput() { input = input.toString(); input = input.substring(0,input.length-1); if (input == "") { input = 0; } numBeautify(input); document.getElementById('display').innerHTML=screenshow; }
0
7daa7fcb13d5b0cce6ec680ff71e173c
7a101396d4acc131aa17c1e7fd29b35e
Cleans and compiles all given files/directories.
class Builder def compile cleanup compass_build sprockets_build mustache_build end
1
eed1a4a95153f46dc974ff82971e4dca
3d83ca31cd14d42ed7153bde77da77d2
Find all ETDs what will expire in the given number of days
public function findExpired() : iterable;
0
4d0c13ae1cb8471924864657636bef6a
2a6fa35a4f1815983a6e15b34da79711
Parameterizes strings and replaces underscores with hyphens
function hyphen(target) { return target.replace(rhyphen, '$1-$2').toLowerCase(); }
0
03e3779bd08485c42847cc6fcfeb4eb8
e4bd253f1a18fd7f285f7584e272f759
Can a schema name be used in an index definition statement? <p> Schemas are not currently supported by this driver.
public class AfmDatabaseMetaData implements java.sql.DatabaseMetaData @Override public boolean supportsSchemasInDataManipulation() { return false; }
1
9ff44c3af91cbbaf3cc12f72a75ac685
356a84225e878e5c4e496354e49c8a2c
Магічний метод для встановлення значення поля об'єкту
class Object protected function setValue($value) { $this->value = $value; }
0
cad3c259fd7cc59d3726a9e6b2cd44ce
73afce8db56df97028e4affb2ad2d601
funkcja zamieniajaca odczyt z ADC na posczegolne 4 cyfry, przy okazji mapowanie 8bitow na warosc 0-5000
{ uint8_t rozbity_odczyt; uint32_t analog_read=(uint32_t)bit_8_read*5000UL/255UL; switch(nr_cyfry) { case 0:return rozbity_odczyt=analog_read/1000UL; break; case 1:return rozbity_odczyt=analog_read%1000UL/100UL; break; case 2:return rozbity_odczyt=analog_read%100UL/10UL; break; case 3:return rozbity_odcz...
1
49cfca32db2f7f79788db41f74e6c255
903d7885d27489f9182c2da3de579b3a
Function findIndexOfRegister:
{ u32 i; for (i = 0; i < array_size; i++) { if (val == *(parameter + i)) return i; } battery_log(BAT_LOG_CRTI, "NO register value match. val=%d\r\n", val); return 0; }
1
6e71bd9d02a1841ee0ce8a4b5aaba3ce
bae29c062f154244ba19cb1f726c5aa2
Function to compress a directory
def compress(): print("#"*50) print("Compressing the ./data directory.") t1 = time.time() datestr = "-".join([str(x) for x in time.localtime()[:3]]) subprocess.run(["tar", "-czf", "data-"+datestr+".tar.gz", "./data"]) t2 = time.time() print("\nCompressed files generated in {} seconds.".forma...
1
aa0f74b595df86e7e9e7804128705eee
8bfe67d579e19d618e46e00a9420e34c
Retourne l'énergie courante Returns (int): L'énergie courante
class CharacterAttributeComponent(Component): def getEnergy(self): energyadd = self.calculateEnergy() self._energy = self._energy+energyadd return self._energy
1
722a6922951b376e4afdde66018688c5
900b22076dafdce35159f5763f316fb9
Cette méthode montre comment obtenir la liste des salariés répondant à un critère.
{ int pageIndex = 2; int itemsPerPage = 3; CollaborateurService service = new CollaborateurService(_webServiceUrl); List<Collaborateur> collaborateurList = service.GetList(pageNumber: pageIndex, rowsPerPage: itemsPerPage); }
0
a0da34577b4a2c1e47c95829d1257c96
312bc872586a2bc3801bf74463704a81
获取 指定class的 元素 正则
var ele = document.getElementsByTagName("*"); var reg = new RegExp("(?:^| )"+strClass+"(?: |$)"); var ary=[]; for(var i=0;i<ele.length;i++){ var cur = ele[i]; if(reg.test(cur.className)){ ary.push(cur); } } return ary; ...
1
0d33cb80a9e258f8a78b2cdb95d7b940
154852204ac2c68ef58728f724232e66
获取远程文件中的字符
InputStream ins = null; ins = ftpClient.retrieveFileStream(fileName); BufferedReader reader = new BufferedReader(new InputStreamReader(ins, strencoding)); String line = reader.readLine(); reader.close(); if (ins != null) { ins.close(); } ftpClient.getReply(); return line; }
1
fd81d4b998fbd9392066fa93b0b5b0ab
ee954f4486a78c645b191773fb4a8177
Subscribe cascaded SC with in active cascaded client.
public class CscReceivePublicationCallback implements ISCMPMessageCallback @Override public void receive(SCMPMessage reply) throws Exception { if (this.cascClient.isDestroyed() == true) { return; } CascadedSC cascSC = this.cascClient.getCascadedSC(); if (cascSC.tryAcquirePermitOnCascClientSemaphore(cascClie...
0
51bc6d83889c454afac1150243c7ca54
9c6d547b60db7b44edac467d234c6090
## 四杠 40番
sort($totalhand); $mystring = implode("", $totalhand); $findme = '414141424242434343444444'; $pos = strpos($mystring, $findme); if ($pos === false) { return 0; } else { return 40; } }
1
54c8cf1448160ac4b66fa7812e9b8976
f44911ae3102de8683f02c08475e35b9
Method to build string from Media list.
class Source def media_list source_media.sort{|x,y| x.medium <=> y.medium }.map{ |x| x.medium }.join(', ') end
1
2babe71b295cf0108c05bd552f681a5a
080501528f0a8338215408ee04a428fd
FUNCTION DESCRIPTION PARAMETERS simInterface [IN] RETURNS void
{ if (sim_id == MMI_SPA_SIM_ID_SIM1) { g_spa_context.sim_flag = g_spa_context.sim_flag & (~MMI_SPA_FLAG_SIM1_READ_FAIL); } else if (sim_id == MMI_SPA_SIM_ID_SIM2) { g_spa_context.sim_flag = g_spa_context.sim_flag & (~MMI_SPA_FLAG_SIM2_READ_FAIL); } else { MMI_TRAC...
0
85400eb14eb2d1fbecd90470f884046d
1871460dccd8a5a8c0ef43027a735fa9
withブロックを抜ける際に実行される後処理を実装 例外が送出された場合は、引数でその情報を受け取れる
@Suppress("unused", "MemberVisibilityCanBePrivate", "NAME_SHADOWING") open class AndroidScope( lifecycleOwner: LifecycleOwner? = null, lifeEvent: Lifecycle.Event = Lifecycle.Event.ON_DESTROY, val dispatcher: CoroutineDispatcher = Dispatchers.Main ) : CoroutineScope, Closeable open fun finally(block: Android...
1
24ad10eb99a936e2317d0c265e0a7e15
7c132552fdb75cc83d79c7d0222fce29
Update the hold mode of the thermostat.
if hvac_mode == HVAC_MODE_AUTO: data.ENTITIES[self._entity_control_mode].STATE = HMIP_CONTROL_MODE_AUTO elif hvac_mode == HVAC_MODE_HEAT: data.ENTITIES[self._entity_control_mode].STATE = HMIP_CONTROL_MODE_MANU elif hvac_mode == HVAC_MODE_OFF: self.set_temperat...
0
6d214d4d6c0e8f24a1fb7d026768a634
26cf8d850d0defb2a7615cd67168938f
удаление пробелов из введенной строки
string returnString; for(unsigned int i = 0,k = 0; i<input.length() ;i++){ if(input.at(i)!=' '){ returnString.append(" "); returnString.at(k)=input.at(i); k++; } } return returnString; }
0
a0d7ae533393ec7a7529f08c68cf6723
c30e59d4977eb3b083524c5aa3408561
読み取り専用の切り替えを行う
if (enableReadonlyMode) { this.store.dispatch(new readonlyModeActions.EnableReadonlyModeAction()); return; } this.store.dispatch(new readonlyModeActions.DisableReadonlyModeAction()); }
1
e4ef2c4acc026c7c67175246b6a1b3ad
4728f735b7b7f090e4565e30ebe246e5
concatenation of two last expressions in stack
{ for(int i=0;i < a->count ;i++){ LASSERT(a,a->type=LVAL_QEXPR,"wrong type"); } lval* x = lval_pop(a,0); while(a->count){ x = lval_join(x,lval_pop(a,0)); } lval_del(a); return x; }
0
4271827ae12b93e54b75fb34fa62953c
d6ce47af37bbf7e737afe06ffc4ae5ee
Hides the start screen overlay, calls getRandomPhrase(), then adds phrase to gameboard
class Game startGame(){ document.querySelector('#overlay').style.display = 'none'; this.activePhrase = this.getRandomPhrase(); this.activePhrase.addPhraseToDisplay(); }
1
3153eaf8b118adbe94b34dae7b70e21d
afcb543f7755f1e413ffa87b62e982ba
Löscht den gesammten Inhalt von addresses und setzt current auf -1
Iterator currentAddresses = addressHome.findAll().iterator(); while(currentAddresses.hasNext()) { Address a = (Address)currentAddresses.next(); a.remove(); } }
0
0bad83a590fa638d59deff96d5bda9a4
15f8e1c5cda79b6ad570a3f4dd0d6584
For convienance, this method returns the protocol, host and port as a URL.
protocol = 'http' if self.isSecure: protocol = 'https' return self.__getUrl("%s://%s:%s" % (protocol, self.host, self.port), "/")
1
b831c78dd33a0a3182dd56ae42a89ce7
5b4d8e2b09ede86d630712c76bc18b0d
(Boolean) When using volume rendering, assume volume has the same density everywhere (not using any textures), for faster rendering
export class CyclesWorldSettings public set volume_sampling(value: 'DISTANCE' | 'EQUIANGULAR' | 'MULTIPLE_IMPORTANCE') { PythonInterop.setEnum(this.interop, `${this.accessor}.volume_sampling`, value) }
0
79a1e022c86e536b3b82ba5adc491f24
45c289cec1d86f831e595806cae4fa54
Runs RNN prediction.
with torch.no_grad(): inpt = torch.tensor(X, dtype=torch.float32) mv_lstm.init_hidden(inpt.size(0)) preds = mv_lstm(inpt).view(-1).detach().numpy() return preds
1
fab2c176bf6fb1eb6d41812559f46e73
d767988efaf6608c06d5ca1c8209aa93
记录每次读取到的字节
public void bytesRead(LongTaskTimer.Sample sample, SocketAddress remoteAddress, long numberOfBytes) { received.record(numberOfBytes); }
1
c558f3eec1f948b6ad067239ea0838d4
dc8cf201c17a2ab551131c247833ddb7
Test method for {@link applicationLayer.BlockController#checkIfBlockIsInBody(String)}.
public class SeleniumWrapper public void assertBodyText(Instruction instruction) throws SeleniumRunnerException { assertEquals(instruction.getTarget(), selenium.getBodyText()); }
0
6076952c8325baaf325300ed9bb771a1
243b437775ae057541cb931360e00cad
This tests the case where a requisite_in matches by name instead of ID See https://github.com/saltstack/salt/issues/30820 for more info
recipestr = r""" class TestRequires(PackageRecipe): name = 'foo' version = '1' clearBuildReqs() def setup(r): r.Create('%(bindir)s/perl', contents='\n'.join(( '#!/bin/bash', 'print $*', '', 'case $1 in', ' *INC*) ;;', ...
1
265174d0ce5a073ac22893761d54f582
1161cef6e15f461cde02f246a18172b3
计算命名实体序列向量间的相似度
template2id = np.zeros((max(unique_templates) + 1, 1), dtype=int) for count_template, uqt in enumerate(unique_templates): template2id[uqt] = count_template score = np.zeros((len(p1),)) total_pairs = np.array(range(len(p1))) batchsize = 100000 sublists = [total_pairs[i:i + batchsize] ...
1
e0a19f92001fb771551ead759960bbce
3539df4f3b8ec2d817bd75442bbfab97
传入的一个文件路径,将该文件读入DataSet中,field由ConllLoader初始化时指定的headers决定。
class CoNLLULoader(BaseLoader): def __init__(self, file_path: str): self.file_path = file_path
0
22cb5efb303fbaf7452a030748364ea6
a9330ea59dc73a05fadf9c27594e76c2
计算GAP统计量
{ if (source != null && SA != null && ST != null && EH != null && GSA != null && PCG != null) { GSA.analysis(); return 1; } return 0; }
0
ecf38dc1a364fcc821bd73b7b421858a
2c2a595865573d51d5c8262e6f795bb4
The "less than or equal to" operator.
class dec(object): def __le__(self, other): return self.value <= other.value
1
62c5b9af4b4b4025666d53c643f0beff
f0af5a6ffff4f735a3160f9c7b98e8ba
Este método modifica el temporizador que rige cada cuánto tiempo se realiza un movimiento en el camino.
public class Barco extends Actor public void correrTiempo() { if(intervalo_tiempo==50) { time--; intervalo_tiempo=0; } else { intervalo_tiempo++; } }
1
7f6017d368419a730fadf64d3e657582
a04aef8a7eea695589f977fdd2dc51c8
Asynchronously transforms a <see cref="Result{T, TError}"/> into a <see cref="Result{U, TError}"/> by applying an async function and collapsing the result if the mapped <see cref="Result{T, TError}"/> contains a value otherwise by constructing a new <see cref="Result{U,TError}"/> from the <typeparamref name="TError"/...
this Task<Result<TSuccess, TFailure>> x, Func<TSuccess, Task<Result<TSuccessNew, TFailure>>> f) { var result = await x; return result.IsSuccess ? await f.Invoke(result.Success).ConfigureAwait(continueOnCapturedContext: false) : Result...
1
7772fcb913203d7a4e3d3c62f1a8943c
a408f173e7c54f3f4febd5a8475fc8a0
行规范化稀疏矩阵
def row_normalize(mx): rowsum = np.array(mx.sum(1)) r_inv = 1/rowsum r_inv[np.isinf(r_inv)] = 0. r_mat_inv = sp.diags(r_inv) mx = r_mat_inv.dot(mx) return mx
1
05e6637fd4bf51f70f0ca3548bf0f056
2216bcbce9dd1a64655dd183d3a822be
initialize the root node for a tree
class Tree(object): def __init__(self): self.root=Node('root')
1
6c93d8772d89fb5cb7abda779126d7ad
ee58597457bde6db162a826c5b3de5f5
Returns the results of the batch job. The job must be done. Supports standard list paging. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [BatchJobError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
class JobResult(Client): async def get_query_result( self, startIndex=0, maxResults=None, pageToken=None, timeoutMs=1000, ): if self.state is None: await self.update() endpoint = ( EndPoint().query.format(projectId=self.project_id) + "/" + self.job_id ) ...
1
c793057d5bf4b6bd71a1ccec346c3061
6df3514144e0047c48f916055135bf59
Получить всех пользователей (кроме помеченных на удаление)
namespace Getticket.Web.DAL.IRepositories IList<User> FindAllNotDeleted();
1
2eb69bc5750b85ead40b32eba75150b4
88ad296f352f980501cc48bfcd66a9fd
根据USERID获取对应的secretKey,从redis中获取
{ string key = $"{USERNAME}{ userId.ToString().GetHash() }"; return this.NewExecutor().HashGet(key, userId).GetRedisValue<string>(); }
1
15fcaf54892ad44d72729abd54fcbd09
a5da379debacb1615c4adc5356ca4d2c
复制一个inode结构的引用,返回复制后的引用
struct xpr_inode_info *xpr_ino_i=XPR_INO_I(inode); struct super_block *sb=inode->i_sb; ino_t ino=inode->i_ino; uid_t uid=inode->i_uid; gid_t gid=inode->i_gid; struct buffer_head *bh; struct xpr_inode *raw_inode =xpr_raw_inode(sb,ino,&bh); if(!raw_inode) return NULL; raw_inode->i_mode=inode->i_mode; raw_inod...
0
b00df842c5c0572df12c68aa54d446a7
2ee5abdddc34a29f3342c8b69e7f7be7
Obtener recorrido del arbol en Postorden
if (arbol == NULL) { return; } else { postOrden(arbol->izquierda); postOrden(arbol->derecha); cout << arbol->info << " - "; } }
1
386ef9b7e079bd37fd2bfb9a561fac5a
b004632d8e8d4423de68fdf323f9b640
Translate conditons into a MongoDb criterion. The conditions come from the options on the interface: whether to constrain to items that have assessments and or reviews. The result can be fed into an other Mongo query. It can also be used to filter a list of record that has already been fetched. !!! hint `{'assessment':...
logger.debug(u'query to parse2: {}'.format(query)) if query == {} or query is None: return (Query()._id != u'-1') q = None for c in self.parse_condition(query): if q is None: q = c else: q = q & c logger.debug(u'...
1
19f976519f0d9c6dabb1ee6c359ecafc
f8a2f3a94148b554cf1e19d888234d49
Убрать первый символ из строки
class Parse protected function removeHead(string $item) { return mb_substr($item, 1); }
1
b4e00e7683b54860fa6bc149d35d1cf8
28b6bd7ab6380f18dafbb5c7efacbf4c
返回未安装的APP名
namespace XLY.SF.Project.Domains List<AppEntity> FindUnInstalledApp(Device device);
1
c07c739eed6ba9222292265871fa8dc7
cf6a452920946a739d27aac3802c3e3f
Obtener cantidad de verde de un pixel
int get_green(int it){ return pow((((double) it)/((double) n)),0.2)*255; }
1
fd7aa1c79156de7b35fa90b75a14474f
1fee5b1b50919a35d900d832f6ed14f2
function feedbackInit Function that initializes the parameters needed for the feedback
return { callback : undefined, audiofeedback : "none", vibrationfeedback : "none", visualfeedback : "none", touch : "none", element : null, touchcallback : undefined, th_android : 500, th_windowsphone : 500, th_ios : 180, th : 500 }; }
1
dfaf8e54d524c07fe17e9ed3be2be2e8
8ad0f6408c5d9ac6b92b8b6b0acad1ca
insertFBUser method will insert the FB user data into the users table fb_id, fb_first_name, fb_middle_name, fb_last_name, fb_gender, fb_link, fb_locale, fb_name, fb_timezone, fb_updated_time, fb_username
Class UserModel extends Database{ public function insertFBData($data){ $sqlst = "INSERT INTO users(fb_id, fb_first_name, fb_middle_name, fb_last_name, fb_gender, fb_link, fb_locale, fb_name, fb_timezone, fb_updated_time, fb_username)VALUES(:fb_id, :fb_first_name, :fb_middle_name, :fb_last_name, :fb_gender, :fb_link, ...
1
d57bbb7161da9afaf4e7687a70161fcf
a20e3b0c8c21934585a33fb727fbd6de
Converts pandas DataFrame to waypoints dictionary
from ..tracks.track_utils import GeometryUtils as gu waypoint = df_row['closest_waypoint'] before = waypoint - 1 if waypoints[waypoint].tolist() == waypoints[before].tolist(): before -= 1 after = (waypoint + 1) % len(waypoints) if waypoints[waypoint].tolist() ...
0
a57d2abadc6c874248506f03126aafa8
245d3239294cacc034bfcb57acd8d7e4
adds a bit of randomness when the best actions evaluate to the same value
{ int best_action = 0; double best_value = Q[0]; int num_ties = 1; double value; for (int a=1; a<actionCount; a++) { value = Q[a]; if (value >= best_value) if (value > best_value) { best_value = value; best_action = a; } else { num_ties++; ...
1
62d50ef7e20f483d7f94e824de15e3d6
739005a54c0302fb3cf1b1d7cdeb0eae
Number of join keys.
@Value.Enclosing public class RelBuilder int groupKeyCount();
0
17d105e1d5687b2bff3761382f551708
09f9cd7a18ba306f2a22de85cf0552a7
Callback for the Up Button Swaps this Region with the one above it in the List and IVDict.
def swap_prev(): obj.swap_prev()
1
81973b18f0e6b86a56734522653a7575
f855a11a0d3f789289679f0f609a0505
更新数据至源
public class MongoDao public void updateSourceDocument(SourceData data) { connect(); MongoCollection<Document> collection = mongoDatabase.getCollection("sourceData"); Document newDocument = new Document("name", data.getName()).append("type", data.getType()) .append("tupleNum", data.getTupleNum()).append("freq...
1