query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
b831c78dd33a0a3182dd56ae42a89ce7 | efcad8ce21cf48369f5809bc2bee1450 | (Boolean) When using volume rendering, assume volume has the same
density everywhere (not using any textures), for faster rendering | float depth
) const
{
return ((depth == 0.0f) || (depth == 1.0f));
} | 0 |
79a1e022c86e536b3b82ba5adc491f24 | 227f9c6b841146e46a38507d149efa31 | Runs RNN prediction. | gt_embedding = tf.reshape(gt, [n_samples * seq_len, charmap_len])
gt_RNN_input = gt_embedding@embedding
gt_RNN_input = tf.reshape(gt_RNN_input, [n_samples, seq_len, num_neurons])[:, :-1]
gt_sentence_input = tf.concat([char_input, gt_RNN_input], axis=1)
RNN_output, _ = rnn_step_prediction(cells, char... | 1 |
fab2c176bf6fb1eb6d41812559f46e73 | 44b4406ebde6752c0fcae1cb4ae7e669 | 记录每次读取到的字节 | public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ByteBuf result = (ByteBuf) msg;
byte[] result1 = new byte[result.readableBytes()];
result.readBytes(result1);
message.append(new String(result1));
result.release();
} | 1 |
c558f3eec1f948b6ad067239ea0838d4 | 2355c5c7953bedbbf4987c1aedaf7f13 | Test method for {@link applicationLayer.BlockController#checkIfBlockIsInBody(String)}. | {
if (string== null) {
throw new IllegalArgumentException(
"The string value cannot be null.");
}
if(_getTextFromElement(By.tagName("body")).contains(string))
return true;
else
return false;
} | 1 |
6076952c8325baaf325300ed9bb771a1 | 0eeab49160532ef47fb96e048d79b328 | 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 | state_run = self.run_function(
'state.sls',
mods='requisites.requisite_in_match_by_name'
)
bar_state = 'cmd_|-bar state_|-echo bar_|-wait'
self.assertIn(bar_state, state_run)
self.assertEqual(state_run[bar_state]['comment'],
'Comma... | 1 |
265174d0ce5a073ac22893761d54f582 | 43550f1491d93806a3ddee1893bded0f | 计算命名实体序列向量间的相似度 | def Vector_sim (a,b):
url=api_url+'/api/v0.1/sim'
ret = ''
try:
dt = {'words': ('%s|%s' % (a,b))}
res = requests.post(url, data=dt, timeout=2)
res.encoding = 'utf-8'
res = json.loads(res.text)
if res['result'] == 'OK':
ret = json.loads(res["simcos"])
... | 1 |
e0a19f92001fb771551ead759960bbce | 3830a5a22a398503f2023ccb8743ea6f | 传入的一个文件路径,将该文件读入DataSet中,field由ConllLoader初始化时指定的headers决定。 | fin = codecs.open(file_path, encoding='utf-8')
strIn = fin.read()
fin.close()
conllsentences = []
sent_no = 0
sentences = strIn.split("\n\n")
for sent in sentences:
if(len(sent)>0):
lines = sent.split("\n")
csent = conll... | 0 |
22cb5efb303fbaf7452a030748364ea6 | 70642cd99b3d34bb821574d45f531d76 | 计算GAP统计量 | df['gap'] = pd.to_datetime(df.date_r)-pd.to_datetime(df.date_a)
df['gap_month'] = df.gap.map(lambda x:x/np.timedelta64(3600*24*30,'s'))
minV = df.gap_month.min()
maxV = df.gap_month.max()
dic={}
lst=[]
if (minValue==None) | (maxValue==None):
for i in range(0,20):
tmp_df =... | 1 |
ecf38dc1a364fcc821bd73b7b421858a | a71fb1594141acf5f466e803013c8d94 | The "less than or equal to" operator. | class Comparable(metaclass=abc.ABCMeta):
def __le__(self, value: t.Any) -> Condition:
value = self._sql_value(value)
return Condition(f"{self} <= {value}") | 1 |
62c5b9af4b4b4025666d53c643f0beff | 24a67f8eb55bd9fff098771a49b053cc | Este método modifica el temporizador que rige cada cuánto tiempo se realiza un movimiento en el camino. | void Enemy::setTimeToMoveFor(int timeInput)
{
timeToMoveFor = timeInput;
} | 1 |
6a7420ce90423bc232480ebf26610ec2 | c43a9028faa107c1f1cbcd00fea2410b | 格子是否占用 | function IsLockedGrid(index, type)
index = index % C_STORAGE_GIRD_NUM
local grid = g_mainplayer:getItemGird(index, type)
if 1 == grid.mLock then
return true
else
return false
end
end | 0 |
7772fcb913203d7a4e3d3c62f1a8943c | a25966f7afbd3c1c06008226ca316b49 | 行规范化稀疏矩阵 | def normalize(matrix):
rowsum = np.array(matrix.sum(1))
r_inv = np.power(rowsum, -1.0).flatten()
r_inv[np.isinf(r_inv)] = 0.
r_mat_inv = sp.diags(r_inv)
mx = r_mat_inv.dot(matrix)
return mx | 1 |
05e6637fd4bf51f70f0ca3548bf0f056 | 2b774b308ab1c25dd89024a10dda392d | initialize the root node for a tree | {
treenode_t x;
x.n = 0;
x.leaf = 1;
int i;
for (i = 0; i < 2 * t; i++)
{
x.links[i] = -1;
}
return x;
} | 1 |
6c93d8772d89fb5cb7abda779126d7ad | a38253f6c1858ff305b878eedd09f827 | 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]() | namespace Google.Ads.GoogleAds.V14.Services
public sealed partial class BatchJobServiceClientImpl : BatchJobServiceClient
public override gax::PagedAsyncEnumerable<ListBatchJobResultsResponse, BatchJobResult> ListBatchJobResultsAsync(ListBatchJobResultsRequest request, gaxgrpc::CallSettings callSettings = null)
... | 1 |
c793057d5bf4b6bd71a1ccec346c3061 | 6051accd2b3d1b639bf958c53ac01e10 | Получить всех пользователей (кроме помеченных на удаление) | class Users extends AbstractModel
public function getAll()
{
return $this->getORM()->find('User', "user_delete = 0");
} | 1 |
e5824f4fc91d404e7eba56da799d38f2 | f5888693c88df56545f871973f5bad06 | Decide whether this delimiter can be a close delimiter | string peek = Peek(1).val;
return la.val == "," && peek != "]" && peek != "}";
} | 0 |
15fcaf54892ad44d72729abd54fcbd09 | 45232cb14a61a95b3c28529295532d7c | 复制一个inode结构的引用,返回复制后的引用 | {
struct inode *p;
struct inode *ip;
loop:
ip = NULL;
for(p = &inode[0]; p < &inode[NINODE]; p++) {
if(dev==p->i_dev && ino==p->i_number) {
if((p->i_flag&ILOCK) != 0) {
p->i_flag |= IWANT;
ksleep(p, PINOD);
goto loop;
}
if((p->i_flag&IMOUNT) != 0) {
for_each_array(mp, mount)
if(mp->m... | 0 |
b00df842c5c0572df12c68aa54d446a7 | 9db872d635b030a742277f30c8138247 | Obtener recorrido del arbol en Postorden | public class ArbolBinario
public List<String> recorridoPos(NodoDoble x) {
if (x != null) {
recorridoPos(x.retornaLI());
recorridoPos(x.retornaLD());
pos.add(x.retornaDato().toString());
}
return pos;
} | 1 |
8138d7f34286cacb30e4eb61bbac5d6e | 0cb8c9897cae7c3892c512024a8898da | 计算真实的机动消耗 | {
float res = (atk - target.getArmor())*2 + (src.getRealAttack() - target.getReduceRealAttack());
return (int)res;
} | 0 |
10d7f389657725768a7fc3847a708660 | 7dfa517abe714b8a2bfab8097be4ef1d | récupération de tout les produits par type de lait | {
$res = PdoBouquet::$monPdo->query("select * from produit where idCategorie='$idCategorie'");
$lesLignes = array();
$lesLignes = $res->fetchAll();
return $lesLignes;
} | 0 |
b4e00e7683b54860fa6bc149d35d1cf8 | ff264157459269d0576e0e93e35689e9 | 返回未安装的APP名 | $uninstalled = array ();
$installed = $this->field ( 'app_id' )->order ( 'app_id DESC' )->findAll ();
foreach ( $installed as $k => $v ) {
$installed [$k] = $this->getAppById ( $v ['app_id'] );
}
$installed = getSubByKey ( $installed, 'app_name' );
$installed = empty ( $installed ) ? C ( 'DEFAULT_APPS' )... | 1 |
c07c739eed6ba9222292265871fa8dc7 | a88b11f17aa59e93e679ea1d95c6a597 | Obtener cantidad de verde de un pixel | let indice = (x + y * imagedata.width) * 4;
return imagedata.data[indice + 2];
} | 1 |
fd7aa1c79156de7b35fa90b75a14474f | 66c9ae65a1058cb667d0ff8e6fc01500 | 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 : 75,
th_windowsphone : 75,
th_ios : 180,
th_firefox : 180,
th : 75,
th_se_factor : 40
};
} | 1 |
c8eb59c6ffb5c251ebb315f93b4ab09c | 28be474ea164cae5259389c595918386 | Simple quasi-Newton algorithm.
Highly inspired by:
M. Zibulevsky, "Blind source separation with relative newton method | r_prev = b - A.dot(x_0)
p_prev = r_prev
k = 1
if cap_residuals:
residuals = []
while k < maxit:
k += 1
alpha_k = (r_prev.T.dot(r_prev))*(1/p_prev.T.dot(A.dot(p_prev)))
x_k = x_0 + alpha_k*p_prev
r_k = r_prev - alpha_k*A.dot(p_prev)
beta_k = r_k.T.dot(r... | 0 |
d57bbb7161da9afaf4e7687a70161fcf | d3c86520d820cbd938d5880d679e6d9f | Converts pandas DataFrame to waypoints dictionary | def create_dataFrame(tree, root):
tags = { "tags": [] }
for child in root.iter('{http://www.topografix.com/GPX/1/0}trkpt'):
tag = {}
tag['lat'] = child.attrib['lat']
tag['lon'] = child.attrib['lon']
tags["tags"].append(tag)
df = pd.DataFrame(tags["tags"])
df = df.apply(pd... | 0 |
a57d2abadc6c874248506f03126aafa8 | 5724dcefc0c2de09ef4c76f9dc166896 | adds a bit of randomness when the best actions evaluate to the same value | max_val = -math.inf
ties = []
for i in range(len(Q_values)):
Q_val = Q_values[i]
if Q_val > max_val:
max_val = Q_val
ties = [i]
elif Q_val == max_val:
ties.append(i)
return np.random.choice(ties) | 1 |
62d50ef7e20f483d7f94e824de15e3d6 | 92da56886a323e2e9c1aaa2d2871392e | Number of join keys. | if (primaryKey == null) {
return 0;
} else {
return primaryKey.length;
}
} | 0 |
17d105e1d5687b2bff3761382f551708 | 8bc74f867cf4822c3c403e389bf37301 | Callback for the Up Button
Swaps this Region with the one above it in the List and IVDict. | class ImagePanoramaUI(FormUI):
def button_up_clicked(self):
row_index = self.right_list.currentRow()
current_item = self.right_list.takeItem(row_index)
self.right_list.insertItem(row_index - 1, current_item)
self.right_list.setCurrentRow(row_index - 1) | 1 |
81973b18f0e6b86a56734522653a7575 | 4aefd59fb8506af39ac2a37a3997cba6 | 更新数据至源 | Connection conn = ConnectSrcDb.getSrcConnection();
String sql = "UPDATE "+App.danMaTbName+" SET status = ?,drown_number=? where issue_number = ?";
PreparedStatement pstmt = (PreparedStatement) conn.prepareStatement(sql);
pstmt.setString(1, status);
pstmt.setString(2, Integer.toString(srcDataBean.getNo1())+In... | 1 |
b694f39ae0e8f15ebb33ab104a71a531 | dd8ae718d58cbd5b7a6f9f57cf588827 | Store the public key for a given Threema ID in the cache, and the underlying store. | public override void CacheIdentityId(string identityId)
{
base.CacheIdentityId(identityId);
using (var kvStore = new SQLiteLocalStorage())
{
kvStore.CacheIdentity(GetNamespacedKey(IDENTITY_ID_CACHE_KEY), identityId);
}
} | 0 |
81435446659ebab8a26639c04e3c2585 | 28bf0ea9fb22c26fcf1823d030d4ece0 | Function to draw square obstacle. | glColor3f(1.0, 1.0, 1.0);
for (vector<int>::size_type i = 0; i < border.size(); i = i + 4){
glRectf(border.at(i) * squareSize, border.at(i + 1)*squareSize, border.at(i + 2)*squareSize, border.at(i + 3)*squareSize);
}
for (vector<int>::size_type j = 0; j < obstaclesBottom.size(); j = j + 4){
glRectf(obstaclesBo... | 1 |
d0f4ce6378446ae99480930fa765e1b1 | 0ef8187cc86eb7f6b0045aa18b3f38a4 | 添加自定义头部的http post请求 | public void post_test() throws Exception {
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Content-Type", "11111");
httpPost.setHeader("User-Agent", "222222");
httpPost.setHeader("Request-Id", "6666666666");
CloseableHttpClient client = HttpClients.createDefault();... | 1 |
cea153cf2190c390a51598bb9f60e859 | 8f8f885fb9cacf59e6dbb3778ecaf463 | Resta a los montos del pedido los montos de una línea de detalle. | function resetDetalle() {
$('#sum-subtotal').text('');
$("#tb-detalle > tbody > tr:not(:last)").remove();
} | 0 |
3057bce1fbc77d64f4994bdb017381fd | 2f58f272106ce63e9a47b7ecd4d55d4c | Given an undirected tree, return its diameter: the number of edges in a longest path in that tree.
The tree is given as an array of edges where edges[i] = [u, v] is a bidirectional edge between nodes u and v. Each node has labels in the set {0, 1, ..., edges.length}. | public class Diameter
public int[] diameterOfTree(List<Integer>[] tree) {
int u = longestPath(tree, 0);
int v = longestPath(tree, u);
return new int[] { u, v };
} | 0 |
5d201b0c5dc6fdd44e584b141143770d | b99abdb1b8e9ad21363ecf129e7ea7f4 | Transform a Joi schema to a array type OpenAPI V3 Schema Object | return Object.keys(schema).reduce((acc, value) => {
return { ...acc, [value]: schema[value].default };
}, {});
} | 0 |
f1a54a01dede00e6f172769cf4fc522b | cd49656758e05a2ea7aea5eef2581fc4 | Removes all conditions that will be used for ordering. | final class SearchConditionBuilder
public function clearOrder(): self
{
$this->order = null;
return $this;
} | 1 |
32c9eeee7febb8a1e06962b24811116a | d75a59ccc297857783814068a189880f | Configures the egress engine to use a parked frame
when continuously sending frames | impl<I> FdCan<I, ConfigMode>
where
I: Instance,
pub fn set_frame_transmit(&mut self, fts: FrameTransmissionConfig) {
let (fdoe, brse) = match fts {
FrameTransmissionConfig::ClassicCanOnly => (false, false),
FrameTransmissionConfig::AllowFdCan => (true, false),
FrameTransm... | 0 |
1b6b6d02ab0bff94aeb1c693cb07f095 | 86b738f60246ad4afef76d08cdb374c9 | 如果这个 {@code key} 在缓存中有对应的 {@code value} 并且不为 {@code null},则返回 true | default <T> boolean contains(Key<T> key) {
return get(key) != null;
} | 1 |
49e1e8d61f6e49ee0517ea84a565869c | 6d2a91b99aaac94b910568bb1d352124 | Formats the specified page node. | $result = [
'nodes:page' => []
];
foreach ($pageList as $page) {
$result['nodes:page'][] = $page;
}
return $result;
} | 0 |
8d521711975ff0a80da764ed7c5288ea | 4d8dacde20d6126a8f7cb77820acda3a | Adiciona um crime ao resumo | function addCrimeToSummary($crime, &$summary)
{
if (!isset($summary[$crime])) {
$summary[$crime] = 0;
}
$summary[$crime]++;
return;
} | 1 |
1236971e45e37c18edafd60830d76a66 | f39eeadfac3f7ccf4731d039581ca5d8 | 取得所有9png文件名,不包括路径 | files = [map(lambda y: os.path.join(x[0], y), x[2]) for x in os.walk(src_base)]
paths = []
map(paths.extend, files)
return filter(lambda x: x.endswith('.png'), paths) | 0 |
91360d42c4473b699cc9aed2352d8949 | f40e6a5b18cad33ca4a82d119c9485d7 | \brief Lookup a volume from uuid. | struct key *key,
const char *volname,
size_t volnamesz)
{
struct afs_vldb_entry *vldb = ERR_PTR(-EDESTADDRREQ);
struct afs_vl_cursor vc;
int ret;
if (!afs_begin_vlserver_operation(&vc, cell, key))
return ERR_PTR(-ERESTARTSYS);
while (afs_select_vlserver(&vc)) {
vldb = afs_vl_get_entry_by_n... | 0 |
5eb6bf785d0763afd34cd48a57ce8304 | da083b66918fd20ced4f141ebebb5f95 | 跳转到新增SoftPerfPrePer页面 | public class SoftwareAction extends BizAction
public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
return mapping.findForward("softwareView");
} | 0 |
5ab99080bbed4c634645577987dbbf8a | de4c9a53ad2dfec295bf410f9d232a71 | GET: TraineePage | namespace FptHrLearningSystem.Controllers
[Authorize(Roles = "Staff")]
public class TrainerListController : Controller
public ActionResult Index(int page = 1, int pageSize = 3)
{
var trainerIds = ListAllPaging(page, pageSize);
return View(trainerIds);
} | 0 |
ffbe24fe9e3e7439d8244b95d9c1d11b | 75c99605b1657483d5f2b906eea1fcdb | Gets the available static snapshots for enabling client-side processing that is isolated from changing data. | options?: GetSnapshotsOptionalParams
): Promise<GetSnapshotsResponse> {
return this.sendOperationRequest({ options }, getSnapshotsOperationSpec);
} | 1 |
98dd2594864c39e523d05dbc78e4607e | b0bff1db35f3449c852df458d8ad3200 | 格式化一组版本信息列表 | {
foreach ($list AS $k => $v) {
}
return $list;
} | 0 |
1cf594cdcdaba85b744e1556b4be1586 | 8daecb2e5b0e52cefad740582d243cd6 | 根据技能名称获取时长 | @Service
@Transactional
public class OpeTimeService
public long getTimeByName(String name){
OpeTime en = this.opeTimeDao.findByName(name);
if (en == null){
en = new OpeTime();
en.setName(name);
en.setTime(0L);
en = this.saveEntity(en);
}
if (en.getTime() == null){
en.setTime(0L);
this.updateEn... | 1 |
12d5bd6a1f2c3efb0c9a8f1165638171 | 60fcdbe3f6cbb34f8d8f7b7de86ca2ee | Set max height for each node in tree-like net
i.e. max deepness of each node in tree
Each node id must be str like "['s', 1, 2, 1, 1]"
Inputs:
- ``net`` -- a net from map_tree_to_net func.
Output:
net, each node of which has "max_height" key
in node["coords"] attribute. If attribute "coords"
does not exist, it will be... | def totals_tree(m): | 0 |
2f763022147e076d45fe797960a9680f | 2da365affa49f324d618b66adbe1c509 | Converts an action's name to a privilege name | function toActionName(action) {
return C_ACTION_NAME[action];
} | 0 |
a7f0e2a3356da5a83d843aab5cb32051 | e549c0aafbbcec13d17dd13207dad921 | Test the creation of each leaf node. This test
tests number and parenthesis creation using the composite
base class to check each item for the right type. | void Test_expression_tree_from_postfix::comprehensive_test()
{
fill_maps(variables, cost);
right_branch = new Node ("-?", nullptr, nullptr, nullptr);
left_branch = new Node ("+", nullptr, nullptr, nullptr);
exp = new Node ("*", right_branch, left_branch, nullptr);
real =real->expression_tree_from_po... | 0 |
05797708b7eed5266df4f46b86715607 | ac3e8116c185ca9a88da331fa23497b1 | Display the selected planet and hide the others | public class Main : MonoBehaviour
private void ShowDetails()
{
planetDetails.SetActive(true);
planetPanel.longDesc.enabled = true;
planetPanel.explorePlanet.enabled = false;
} | 0 |
a564dc93d6d97332c15b8fb590566f17 | b5bad68eb2f895351ecf9bc230ca7648 | Get all available versions in the time range. | List<Version<T>> findVersionsBetween(Timestamp start, Timestamp end); | 1 |
c02ce326c2a0019c3261d2511e51f167 | 43ece49535ce16f52795946d68068165 | If set to false the user won't be able to edit the percentComplete of the tasks. | public class LinkablePie extends PieCharts implements ILinkableChart{
public void setPercentageConfigured(boolean isPercentageConfigured) {
this.isPercentageConfigured = isPercentageConfigured;
} | 1 |
6807224a7665b53822a8721fa8b9e70e | fcce91a6e772772f424d9d46afd87a9e | Sets the game bullets view. Game will not work without initializing this member | {
this.isPlayerBullet = isPlayerBullet;
if (!isPlayerBullet)
{
moveSpeed = 20;
}
} | 0 |
19b3cb2a40e80d81c001c4e2d78e2284 | a65604c0b86ea5fba1608981312f953d | Disables corner cutting in diagonal movement. | export class EasyStar{
disableCornerCutting() {
this.allowCornerCutting = false;
} | 1 |
757220cb242acc90067f70372933c766 | 38fa00b0c08003a7bef37dbacdd05886 | 初始化kmean类 | class K_Means_Clustering:
def __init__(self,k_value,optimal_difference=0.001,maximum_iterations=1000):
self.k_value = k_value
self.optimal_difference = optimal_difference
self.maximum_iterations = maximum_iterations | 1 |
70c95421fd604a4fa77e5d4a858ed7bd | ce993ec21187a546d30d45908fb183c1 | Divides up a single boundary into a grid based on a grid size in meters | def bbox_split(bbox, number_grids):
lat_min = bbox[0]
lon_min = bbox[1]
lat_max = bbox[2]
lon_max = bbox[3]
const_lat = abs(abs(lat_max) - abs(lat_min)) / number_grids
const_lon = abs(abs(lon_max) - abs(lon_min)) / number_grids
print('const_lat: %s\nconst_lon: %s' % (const_lat, const_lon))
... | 0 |
b912b6fe29f21c49c5f984e5eb57b12f | cb951f74d716878f664c15318a530b7d | 保存任务数据到SP | class TaskService private constructor(nodeService: MyAccessibilityService) : BaseEventService(nodeService)
private fun saveTaskProgress(progress: String) {
SPUtils.getInstance(nodeService, Constant.SP_TASK_FILE_NAME)
.put(Constant.KEY_TASK_PROGRESS, progress)
} | 1 |
0363231b0d7140a45bd55da36b78e325 | d1772c1cbdd78a40d31b86e3a1f86cdd | Called when the player stops moving | namespace CoT
public class Player : Creature
private void StopMoving()
{
if (Vector2.Distance(GroundPosition, targetPos) < Map.TileSize.Y / 16)
{
currentPlayerState = PlayerState.Idle;
}
} | 1 |
438ec86934f75c2dc68ac881e649af3b | 7f61448ad6da3ef0f9cb03f40c5be655 | initial error | cases like (1) | 0 |
53c7af84f1a56451975a52576114af06 | 3425b631a01dc6328917d806c3acf28a | overloaded constructor, used when loading game from json file | : m_width{ width + 1 }
, m_height{ height }
, m_size{ (unsigned long long)m_width * m_height + 1 }
{
m_data = new char[m_size];
m_map = new char[m_size];
std::ifstream file(mapFile);
file.seekg(0, std::ios::beg);
if (!file.read(m_map, m_size - 1)) {
printf("Error reading map file.\nMake sure there's a map c... | 0 |
8cf8d431976c3f78fa9e5f4657a67206 | 16c226dba437ee36d946d2a13c6af3e5 | Verify that the lead-in value is correct for the TED1000 | class LDBoardTester(object):
def test_led(self, board: str) -> bool:
_LOGGER.info('LDBoardTest::test_led:: Executing LED test.')
tolerance = 10 / 100
expected = .225
tolerance = tolerance * expected
if board == LDBoardTester.LD5200:
self.__serial.send_command(b're... | 0 |
a92c170f475f3092ea8f5d8201da4852 | 24776df8ccd0b38c95eb79e17a3d73ef | Returns a random store id in UUID4 format.
Returns:
`str`: Random store id. | class _Store:
def randomname(self):
raise NotImplementedError() | 0 |
c5e0177f25afb3c03717e11f365b3cff | 3a061aba639d700b27da5e7fa6c508b2 | Perform a request to Keycloak | class UAAClient(object):
def _request(self, resource, method, body=None, params=None, auth=None, headers={}):
endpoint = urljoin(
self.base_url,
resource.lstrip('/')
)
requests_method = getattr(requests, method.lower())
int_headers = {}
if self.token and a... | 0 |
8f03d28813c1c419e875dcf9ba36eb69 | bdc8eed22751ff2e9db74639583b517c | Gets today data object for a given domain. | class OpeningHours
static function get_today( $vertical ) {
assert( ! empty( $vertical ) );
$cache = new Cache( 'opening_hours' );
$result = $cache->get( "{$vertical}_today" );
if ( empty( $result ) ) {
$result = self::do_lookup( $vertical, 'today' );
$result = array_merge( array(
'status' => 'fai... | 1 |
8171624014361619cd8fd9740fe8257a | 9626b4e741d74fda3181efbc1ad6f767 | Gets a list of exam IDs the student is registered for. | {
using SqlConnection conn = new SqlConnection(ConnStr);
SqlCommand sqlCommand = new SqlCommand("SELECT [UserId] FROM [dbo].[Exam_StudentPapers] WHERE ExamId = @examId ", conn);
sqlCommand.Parameters.Add("@examId", SqlDbType.UniqueIdentifier).Value = examId;
conn.... | 0 |
874818ab5484b1f9b8b3c0e6cea25f2e | 7e911aaf6f5817c16590ac8619ed4fb1 | điều chỉnh trọng số | public class Score : MonoBehaviour
protected void ChangeWeigth(float change) {
currentWeight += change;
weight.text = currentWeight.ToString();
weightSlider.value = currentWeight;
if (currentWeight < 8) {
PC.jumpSpeed = 350f;
} else {
PC.jumpSpeed = 0f;
... | 1 |
f054835f110a596e9b5d02bcda5ada2a | 51907393d0d47f653f9a9d0133ee7a7e | Should directory contents be displayed in mtime order. | class DirIndexFugue
public function is_sort_by_filemtime()
{
return $this->is_sort_by('M');
} | 1 |
a33b2052eed53f8400755b35fda1ffe6 | a9623fe40c805793dd3ce13f0861146f | Calculate JS divergence of two vectors | def js_divergence(p_hist:dict, q_hist:dict, normalize:bool=False):
p_cnt, q_cnt = _balance_distributions(p_hist, q_hist)
m_cnt = {}
for k,v in p_cnt.items():
m_cnt[k] = 0.5 * (v + q_cnt[k])
js = 0.5 * (kl_divergence(p_cnt, m_cnt) + kl_divergence(q_cnt, m_cnt))
if normalize:
js = 1 / ... | 1 |
3724e1e1a0d56854ddf1cc48811778c1 | f1d3eab1a61dfa0958c07c289470670e | 返回String类型的双精度数字 | public class H
static double readDouble() throws Exception {
return Double.parseDouble(readString());
} | 0 |
4e1e7f0c9672f30f1e4827c93145415c | 7cc114f054df268b4b0ee46efd030d20 | 获取淘礼金相关配置 | namespace Sanzhang.Config
public class APIConfigs
public static HufeiHongzhi GetHufeiHongzhiConfigInfo()
{
return GetConfig().hufeiHongzhi;
} | 0 |
427becf6bb13517817ff9e087d72b2e2 | 1374195f332fb062e9e5390d846d1a65 | si el mmr es < 3000 y tiene temporada current, devuelve la misma sin actualizarla | public void whenPlayerMmrIsLessThan3000ThenCurrentSeasonsIsNotUpdated() {
givenACurrentPlayerSeason(3200, seasonStartDate);
givenAPlayerSeasons();
givenPlayerSeasonsRepositoryThatReturnPlayerLeague();
givenAPlayerWinRateRepositoryThatReturnPlayerWinRateWith(2800);
givenSeasonService();
whenAddOrUpdatePlaye... | 1 |
abd4e96dbf389674b06e1065992a1970 | 2d567fd82432600b058177bdb5874e73 | Get friend links of given website | class FacebookPermission:
def getFriendsWebsite(self):
return self.base.get("friends_website", []) | 0 |
7626bcbd57779e237ba527a4ef6cf0b4 | 0e2e5f5f5426c5efbbd2cf78b06bdd40 | returns the jquery code generated for the "edit stations bctypes and languages" page | call_data = skicall.call_data
page_data = skicall.page_data
utils.clear_call_data(call_data, keep=['textblock','text','language','status'] )
project = call_data['editedprojname']
language = skicall.lang[0].lower()
default_language = skicall.lang[1]
page_data[("adminhead","page_head","large_t... | 0 |
a09cbaadb32e4e2e9301641040e93b12 | 2378f6efbe9ea1e9ed296f65e7499fba | Updates the todo in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. | val date = Date()
val offsetMillis = TimeZone.getDefault().getOffset(date.time).toLong()
val offsetSeconds = TimeUnit.MILLISECONDS.toSeconds(offsetMillis).toInt()
val temporalDateTime = Temporal.DateTime(date, offsetSeconds)
val updatedTodo = updateModel(todo, todo.name, todo.pri... | 0 |
82bf37369d775aa99fd0ebe633a636cb | 2df654903a9e64fb177ba140ad0fbaf6 | 日付を加算する.
既存のオブジェクトは変更しない. | public class JisekiESienList_SearchHelper
private Calendar addCalendar(Calendar cal, int field, int amount) {
Calendar addCal = Calendar.getInstance();
addCal.setTime(cal.getTime());
addCal.add(field, amount);
return addCal;
} | 1 |
76801fc396f13051b0afd9f8db4eadcc | f669bcddc29d5c5587dd5fb4fb6cf53b | Predict | def predict():
image_path = opt.image_path
model = opt.model_path
json_path = opt.json_path
topk = opt.topk
with open(json_path, 'r') as f:
cat_to_name = json.load(f)
if opt.gpu == True:
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
else:
dev... | 1 |
8595b1246aacbe409d9d147c3946a73c | 20e80e0abbbd3985c00a86c6d0d98082 | Initialise les propriétés nécessaires au fonctionnement de ObjetDeDémo | {
$this->_age = 19;
$this->_aSonBonnet = TRUE;
$this->_couleurPreferee = 'rouge';
$this->_gouts = [ 'musique', 'cinéma', 'curling' ];
} | 1 |
d70b1593788ac4b91396d0db6a080aee | 40e420554d98b645b2d05781ee3e67d1 | Uses cURL to fetch additional data at the given path.
The domain used is the one provided on object instantiation. | class RestClient
public function read($path = null, array $params = array())
{
return $this->get($path, $params);
} | 0 |
3f5a80b2fffb928c0a53dd5f9847e543 | f8719791879227c4c2b8653e442d7903 | Definition of view type (Section or Item) | public int getItemViewType(); | 1 |
6a75758db881b6752523304b1ff8bbd2 | ed6ba720238b94dadd72091a91ec3e86 | 随机选出一个单词,且与指定单词不同 | class WordCreate():
def random_choice(self):
whole_sentences = random.choice(self.sc_list)
sentences_name = whole_sentences[0]
random_sentence_index = randrange(2,len(whole_sentences))
random_sentence = whole_sentences[random_sentence_index]
seg_list = jieba.cut(random_sentence,c... | 0 |
9af9897d74e5017ec0895c06f44f69b1 | c563f805b321f04830f6f44f2d2a3d27 | 抓取列表提取链接,添加到队列,并过滤重复的链接 | def extract_list_links():
headers = {'Host': 'search.51job.com',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36'}
job_link_xpath = '//div[@id="resultList"]/div[@class="el"]/p/span/a/@href'
next_xpath = '... | 1 |
1a203301cb845a86b06fad23a0edb820 | 6172f0234d06caa87830c84710a0a650 | Sets the agent kyc approved. | public function setIsApproved($approved); | 1 |
bd7ea1e6c6b70e69b91cd9876812b564 | 42e8f4d5f0893e1874c47fcfacc8fe83 | Returns the value of the '<em><b>Dynamic Viscosity</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Dynamic Viscosity</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | public double getDynamicViscosity(); | 1 |
28275c046a3d526f33426a1c408d1ba1 | f3d621bd574879c48dd9422b77674125 | Activa los botones para que el usuario juegue | public class AplicacionAhorcado extends javax.swing.JFrame
private void habilitarBotones(){
botonA.setEnabled(true);
botonB.setEnabled(true);
botonC.setEnabled(true);
botonD.setEnabled(true);
botonE.setEnabled(true);
botonF.setEnabled(true);
botonG.setEnabled(true);
botonH.setEnabled(tru... | 1 |
f0a4f4e2c96f57c5d3a0dbe9d47c2878 | 3a3b5aac2a7fcff30b5f51c02eb7fd26 | Send avatar image to screen | async def avatar(*args):
pass | 0 |
27080f796edd46d36b0d1c40cbd9922e | 5b059e02ce0e66d0e960b70bf05da516 | add a comment line in the csv. Comment line start with '#' as first character. | {
if (!ValidateEdit(selectedIndex))
return selectedIndex;
this.Lines[selectedIndex] = comment
? this.Lines[selectedIndex].Insert(0, "#")
: this.Lines[selectedIndex].TrimStart('#');
... | 1 |
21b3e774b87a3f905be7b3637d7fcc80 | 25efcba750e07617956a4fdf9fc78163 | Add an event argument, only if it is not existing. | int event_id,
sol::optional<int> param1,
sol::optional<int> param2)
{
if (!param1)
{
param1 = 0;
}
if (!param2)
{
param2 = 0;
}
event_add(event_id, *param1, *param2);
} | 0 |
d063cd5d5058a04489ce1d9f9025c232 | 13daa6f82cb20e062fb6b523c7aade1f | test the hasNext method for IListIterator | public class ListTester
private boolean testIterHasNext(Iterator<Integer> iterator, Result expectedResult) {
Result result;
try {
if (iterator.hasNext()) {
result = Result.True;
} else {
result = Result.False;
}
} catch (ConcurrentModificationException e) {
result = Result.ConcurrentModificati... | 1 |
8923200daf4c639a946b86deff89ec43 | d725565988a2ebf5d73f85a0e8d0fd0a | M�thode ajoutant des attributs HTML pris dans un tableau | class HTMLViewLogic implements IViewLogic
public function multiAddProperty (array $array) {
foreach ($array as $key => $value) {
$this->addProperty($key, $value);
}
} | 1 |
4707029ac34a1a72dd3d45ebc0137fb0 | 298b6e99344a853c7f3396491c7a7bb4 | Check to see if a given cluster has already been added to the active set of cluster data | public class HeartbeatManager
public boolean isValidCluster(UUID uuid) {
return heartbeatStorage.containsKey(uuid.toString());
} | 1 |
e5b89c4802f222e23ebf31ead9b4f485 | 92029e0269354e06822a63bc68e8a31c | 记录系统日志到日志数据表 | class SystemLog extends Model
public function write($data)
{
$data['operator_ip'] = app('request')->ip();
$this->fill($data);
return $this->save($data);
} | 1 |
341694db4fe7f1d355982d77dfa9a477 | a0dc13c5ccafa4e6111cedfc764cb495 | Returns to lobby | public class SMSceneManager : Photon.PunBehaviour
public void returnToLobby()
{
PhotonNetwork.LeaveRoom ();
} | 1 |
92badcbc19e391ea035717a938a4ae52 | 40fb789524871ec91da6321e82090272 | Resumes the selffeedback. | {
$params = compact(get_param_names(__METHOD__));
return $this->request([
'method' => 'resume',
'params' => $params
]);
} | 1 |
fc4198fc94bd77cc2ffbfc006d745bef | f1f4aeae133e6107a5028ca96e59e155 | Notification of thread state change. | public class ThreadManForUser implements HLEModule, HLEStartModule
public void hleChangeThreadState(SceKernelThreadInfo thread, int newStatus) {
if (thread == null) {
return;
}
if (thread.status == newStatus) {
return;
}
if (!dispatchThreadEnabled &... | 1 |
819323ea94b4bf01d621cc043e4ce318 | f10612aeb48eaf65abfd4add4ae3a13f | Constructor method for SyncLog | class SyncToken extends Command
public function __construct()
{
parent::__construct();
} | 0 |
61b46ad8f1feb3ba7adbc449fca8b238 | 1b70b715d573d38296dc91f50dea7b4b | If any extensions want to show the new header, they can register their screen ids.
Separate so extensions can register support for the feature plugin separately. | function evf_get_screen_ids() {
$evf_screen_id = sanitize_title( __( 'Everest Forms', 'everest-forms' ) );
$screen_ids = array(
'toplevel_page_' . $evf_screen_id,
$evf_screen_id . '_page_evf-builder',
$evf_screen_id . '_page_evf-entries',
$evf_screen_id . '_page_evf-settings',
$evf_screen_id . '_page_evf... | 1 |
c81e9c434e709c6ba310a2544431ba07 | 61aa28b55134df065e546e6e29e63852 | A string array of data, that captures an array of strings connected to an object. | class RestData
{
string a;
string b;
string c;
} | 0 |
fa093e853f139044088731ce1dadb522 | b219ea3699c977c68a005e4291d6c9ac | 提交菜肴的修改信息 | class DishAction extends BaseAction
public function updateDish()
{
if(Validate::post('id') == null)
{
Tool::getBack();
}
$this->model->id = trim($_POST['id']);
$this->model->tag = trim($_POST['tag']);
$this->model->empid = trim($_POST['empid']);
$this->model->unitid = tri... | 1 |
2f807a1eb5f499c1a769a8d52e8f67a0 | db7200500d7f11620bbde765a20b816c | 获取与当前进程同名的所有进程 | pids = psutil.process_iter()
print("[" + name + "]'s pid is:", flush=True)
back=[]
for pid in pids:
if name in pid.name():
print(pid.pid, flush=True)
back.append(pid.pid)
return back | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.