query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
63a1f5ba5120431b75a2e4f3f2557d95 | 7e0cd7c50279c1ca694b8245e3a4ee04 | 判断指定句柄处的进程是否处于活动状态 | {
if (Environment.Is64BitProcess)
{
return BassX64.BASS_ChannelIsActive(handle);
}
else
{
return BassX86.BASS_ChannelIsActive(handle);
}
} | 1 |
ce28bfc6a94704cd9b4d4dfb2466fe6d | 19f4df026d06ae344e34e8fd34c5ee2c | Проверка на повтор статуса | class MainPageMNEMO(BasePage):
def check_multi_state(self):
value = self.browser.find_element(By.CSS_SELECTOR, '[class="st3e8e3203e-19ba-4a3f-844c-0692f53e7be2"]')
self.is_element_no_text_wating(value, '-')
value = self.browser.find_element(By.CSS_SELECTOR, '[class="st3e8e3203e-19ba-4a3f-844c-0... | 0 |
bb4795fe9ae6117579b210efc45cd20b | fa22e6a90460e2e275d172d8c5063695 | Creates a SQL Statement for 'Average' operation. | namespace RepoDb.Interfaces
string CreateSum(QueryBuilder queryBuilder,
string tableName,
Field field,
QueryGroup where = null,
string hints = null); | 0 |
8d92c5ee75d8bcdd6cc3ae0eceb298c7 | e135a9051f12d96150d5c8be9eafd871 | Связывает события контекстного меню в таблице с книгами с их обработчиками | {
if (booksInfoViewDataGridView.SelectedRows.Count != 0)
{
booksContextMenuStrip.Items[1].Enabled = true;
booksContextMenuStrip.Items[2].Enabled = true;
}
else
{
booksContextMenuStrip.Items[1].Enabled = f... | 0 |
8282b8fc44fb97146e281e11f64545e8 | 3e886579aaa566e92d3f7dcee8545462 | Application logs to blob storage configuration. | this IServiceCollection services,
IConfiguration configuration)
{
if (services == null)
{
throw new ArgumentNullException(nameof(services));
}
if (configuration == null)
{
throw new ArgumentNullEx... | 1 |
81d5ee45ae92965b84441f7a2c967fea | 6065ccdcd710122fc317ccb6646621a2 | Use this method to make a request to the Device Controller for the current txstatus information. | namespace OBD2.Cables
public abstract class Cable : IDisposable
public abstract List<Tuple<DiagnosticTroubleCode, string>> RequestAllDtcStatuses(); | 0 |
5cd271e2e3b87ab3fba14950b589c343 | cda667878202a3d49749b24054d23e75 | Inverts a boolean function. | class Invert(Operation):
def __init__(self, probability):
Operation.__init__(self, probability) | 0 |
58a52cb5199d242300f01b4ccb6f299f | 6923cabb66ed5c8ea449557664731f72 | Returns a new object of class '<em>Guidance Response</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | org.openxmlformats.schemas.presentationml.x2006.main.CTGuide addNewGuide(); | 0 |
124e4bdf239d87efd5e9870c04a0c317 | d1806cc9971dea7a54d5412f9daff476 | Returns the modifier key, 0 if it is not set. | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public class KeyComboManager implements TalkBackService.KeyEventListener,
TalkBackService.ServiceStateListener
public static int getModifier(long keyComboCode) {
return (int) (keyComboCode >> 32);
} | 1 |
783f6d98a90c4e682ae2d1401bcb5be9 | ecfaf9409b99b2ed66485b2b6e4ef2d6 | 如果可以找到一個單引號或雙引號,前一個字元並不是反斜線,則表示沒經過 addslashes() 處理 | {
return $code === 34 && charCodeAt($body, $pos + 1) === 34 && charCodeAt($body, $pos + 2) === 34;
} | 0 |
6c4e7b5a6e5df7083c3666814c9b48ab | d9d0e640f039a2271ccce6dc447b4e54 | Retrieves a collection containing all sensors associated with the specified category. | namespace Microsoft.WindowsAPICodePack.Sensors
public static class SensorManager
public static SensorList<Sensor> GetAllSensors( )
{
return GetSensorsByCategoryId( SensorCategories.All );
} | 1 |
d1d9eceb6aa21940b44afc21d3a35566 | 46506db56ad247f58f5c42aab74baafe | Return the appropriate Card View for the given Card | switch (cardTypeId) {
case 1:
return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAcCAYAAAAX4C3rAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wkPEwQ0IXda5QAAAvNJREFUWMPtll2IjFEcxn/zzqeZ3R0zO4u1g12zVrIktIhNIm4UiVyQfCREbBLJhYgkN4oLKSStFOVC2ZbCZvPRUutrGGbFsqbBsrPzPfu+57h412ykLO... | 1 |
d93a39484453da42a12b20cde580471b | 48f216baf51567178d962f6116b5b6e3 | Restore a permission state previously backed up via {@link #backupRuntimePermissions}.
<p>If not all state can be restored, the un-restoreable state will be delayed and can be
re-tried via {@link #restoreDelayedRuntimePermissions}. | public void restore() throws IllegalStateException; | 1 |
0f212678306762f8ea15ff05eab5730c | e1fb4c59c0f20e6b9190cf21605db828 | <p>
Deletes a <a>Resource</a> resource.
</p>
Request to delete a <a>Resource</a>.
Asynchronous callback handler for events in the lifecycle of the
request. Users can provide an implementation of the callback
methods in this interface to receive notification of successful or
unsuccessful completion of the operation.
ope... | ServiceCall<Void> deleteAsync(String resourceGroupName, String accountName, final ServiceCallback<Void> serviceCallback); | 1 |
9cb1f20bcbcd1062bc1b214500aa4b3c | 3cd1fdf48267f863802f64ef94ac5a03 | Returns a flat list containing all
registers and subregisters | public class IndexedRegisters
protected int[] getRegisters() {
return _registers;
} | 0 |
36e6ebc3c76076b7483e36a15a15dd40 | 748caf8105f77cffea9c944a2243dee5 | 该方法将外部变量的值赋给内部属性 | class Class1
public void set(int i, String str) {
this.i = i;
this.str = str;
} | 1 |
87ef77c674ad7a20ab249f03621584c1 | 7594b58472f704f48b9115d1ea676398 | Because queue names include ancestors, separated by periods, we can find
the lowest common ancestors by going from the start of the names until
there's a character that doesn't match. | if(names == null)
throw new ArgumentNullException("names", "'names' cannot be null");
if(names.Count == 0)
throw new ArgumentException("'names' must be have one or more names", "names");
List<string[]> elemsList = names.Select(name => SplitName(DirName... | 1 |
8050f7659b2956f0169dc34756ada055 | 13e72ab8c142b74333acf533148de4af | Called from the activity whenever a convenient place to interrupt the user happens and seems
reasonable to check for consent
Returns true if the consent form is shown so the caller can react accordingly (eg. cancel what it's about to do) | class AccountSelectionMediator
private boolean shouldInputBeProcessed() {
assert mComponentShowTime != 0;
long currentTime = SystemClock.elapsedRealtime();
return currentTime - mComponentShowTime > POTENTIALLY_UNINTENDED_INPUT_THRESHOLD;
} | 0 |
1228e38742ba3c6d1bb7c9df257099bf | d53c31f1799d19e1d7db9834803de08f | Mount the memory card and create a file | def mountUSB():
system("mount -t vfat -o utf8,uid=pi,gid=pi,noatime /dev/sda1 /media/usbstick 2> /dev/null") | 0 |
2d0b0b05feb25574dc053d60ef0303a0 | 7551f6c58940facfe6ecac64955b7190 | Get human readable number string in format XX'XXX | leader, number = number_string[:2], number_string[2:]
return '{:2s}{:s}{:s}'.format(leader,
'0' * (pad_length - len(number)),
number) | 1 |
b96e37bb43a34c6c5578d6e1c5028bb7 | 650e9737c1247532a5e5299364427c95 | Partial sums for empirical CDF (formula (2.1) from Section 2.1 "Model" in [Haynes2017])
<code>
partialSums'[i, tau] = (count(data[j] < t) * 2 + count(data[j] == t) * 1) for j=0..tau-1
where t is the i-th quantile value (see Section 3.1 "Discrete approximation" in [Haynes2017] for details)
</code>
In order to get bet... | ontime_inds = np.logical_and(data[:, 1] < self.tmax, data[:, 1] >= self.tmin)
early_inds = data[:, 1] >= self.tmax
late_inds = np.logical_and(data[:, 1] < self.tmin, data[:, 1] >= 0)
inds = [early_inds, ontime_inds, late_inds]
temp_output = []
for ind in inds:
... | 0 |
1d7fe53f475fc601762f4480c7f1e3e7 | 57453c7a1ab50a87977147978048343e | Returns application toolbar height | public class MeasureUtil
public static int getToolbarHeight(Context context) {
final TypedArray styledAttributes = context.getTheme()
.obtainStyledAttributes(new int[]{R.attr.actionBarSize});
int toolbarHeight = (int) styledAttributes.getDimension(0, 0);
styledAttributes.recycle(... | 1 |
0dac7c22af38dc7461aada3cf6d32438 | 21c548a3a298b098a01811be620f1bb1 | 비학위의 개설 과목 생성(상시제,기수제) | class CourseController extends Controller
public function createSemisters($record,Request $request, $reset = false)
{
if ($reset) {
$this->resetSemisters($record);
}
for ($year = 1; $year <= $record->course_dueration; $year++) {
$coursesem = new App\CourseSemister();
... | 0 |
00be3e70e236107ded29a9c986e95ad4 | d3a4db3391dc5a5e436f31bfee773a5b | Displays a 2D representation of the cell (matplotlib) | class Phantom2d(object):
def show(self, show=False):
plt.imshow(self.phantom_array, origin='upper',
interpolation='nearest', cmap='gray')
plt.colorbar()
if show:
plt.show() | 1 |
d901d2178c49f4afc309e76deea48ae1 | 17315f0dc65f5210302ce0e060a73a99 | Checks if a given process ID belongs to the currently active stream.
The process ID to check | FILE *p;
char *psLine = NULL;
size_t bufferSize = BUFFER_SIZE;
int tokenBufferSize = TOKEN_BUFFER_SIZE;
char **psToks = malloc(tokenBufferSize * sizeof(char*));
if ((p = popen("ps", "r")) == NULL) {
printf("pipe could not be opened\n");
} else {
int lineCount = 0;
... | 1 |
d487f90a9eebcc1eb911c8c1137434c6 | d805ec1b35b3522887691fe574b3e2f7 | Returns the duration of a single time step in hours | c = 'Num_timesteps'
T = 0.008/10
return self.m_data_df[c].sum() * T / 3600 | 0 |
c6bd8d4daeeddd6e485ea439b23d8e42 | de0ca6f1191e51780664de0ed75017ab | Waits for a file field to exist before uploading. | function FileSelectHandler(e, addfieldfunc, successHandler) {
FileDragLeave(e);
UploadDraggedShortcutFiles(
e,
addfieldfunc,
successHandler
);
} | 0 |
a33300d96a393fe441e24b657e80cc5c | af196dbf679fc4b13b39e94c341033d6 | 求得本次用水量 | ts_end = int(time.time()) - (60 * 10)
ts_start = ts_end - (60 * 10)
data = query_building(10, ts_start, ts_end)
return data[0]['building']['waterConsumption'] | 1 |
152bdffd4724f5e5be3ed23c84760b17 | 3531249a06be223c3de6c99498d88076 | Adiciona Condição do veículo (1 - acabado; 2 - inacabado; 3 - semi-acabado) | {
if (fleet[fleetnum].cond[i] >= 50)
CondLabel[i].BackColor = Color.Yellow;
else if (fleet[fleetnum].cond[i] < 50 && fleet[fleetnum].cond[i] >= 30)
CondLabel[i].BackColor = Color.Transparent;
else if (fleet[fleetnum].cond[i] < 30 && fleet[fleet... | 0 |
f7f20a25f9dedced9063bd76481358ef | 96e8f55fa83c494afe8a4d9a46804e37 | 返回随机英文名字 | public class WebTools
public static String getRndCnName() {
Random random = new Random();
String[] Surname = {"赵", "钱", "孙", "李", "周", "吴", "郑", "王", "冯", "陈", "褚", "卫", "蒋", "沈", "韩", "杨", "朱", "秦", "尤", "许",
"何", "吕", "施", "张", "孔", "曹", "严", "华", "金", "魏", "陶", "姜", "戚", "谢", "邹", "喻"... | 0 |
b48584340a206c28d4b525277b132329 | d4fdd214952db844d82559a6014e80a2 | ====================
NET_ErrorString
==================== | {
static const StringID network_error_strings[] = {
STR_NETWORK_ERROR_CLIENT_GENERAL,
STR_NETWORK_ERROR_CLIENT_DESYNC,
STR_NETWORK_ERROR_CLIENT_SAVEGAME,
STR_NETWORK_ERROR_CLIENT_CONNECTION_LOST,
STR_NETWORK_ERROR_CLIENT_PROTOCOL_ERROR,
STR_NETWORK_ERROR_CLIENT_NEWGRF_MISMATCH,
STR_NETWORK_ERROR_CLIENT_N... | 1 |
5a7fa9bb0c4bea1007eb6dfb6c526b07 | 20b01f5ca496cc7319c9473ab80b74f0 | Add a denyAll rule | err = _execute("auditctl -W "+rule._composeCommand())
if err != "":
raise Exception(err) | 0 |
64112464eb4721e7adf3beaf64a71abe | 7d9181538f421f1381afb78ad91e2b97 | Radiogenic heat production coefficient for 40K. | def heat_ratio():
gam = 1.4
return gam | 0 |
75ca17403832d329a4bcd8e3055d6fe4 | 733be109b834212517d14e4264191b71 | Select the roster as the current tab | public class MainPageController
public static void deselectRoster() {
thisController.tabPane.getSelectionModel().select(
thisController.classTab);
((Stage)thisController.tabPane.getScene().getWindow())
.setTitle("Grader Tool");
thisController.disable();
} | 0 |
90d7d1353b26c9bd6d116b181b4e8264 | c3ba6446bcbcda57cb9ca4b0d5f7775f | Set the set of towns on the graph | @enumerable_canyon = Town.new 'Enumerable Canyon', 1, 1, seed
@duck_type_beach = Town.new 'Duck Type Beach', 2, 2, seed
@monkey_patch_city = Town.new 'Monkey Patch City', 1, 1, seed
@nil_town = Town.new 'Nil Town', 0, 3, seed
@matzburg = Town.new 'Matzburg', 3, 0, seed
@hash_crossing = Town.new 'Hash Crossi... | 1 |
3a8108fa181f3801402ae849143f902a | 7076de1ef4d08c066db2ddd5a7943bc1 | KernelSegment destructor. | PredicateSetSegment::~PredicateSetSegment()
{
delete data;
} | 0 |
9bf80578a779aa1195a6af63ad1818d9 | 73328ec5c49f833c2f600e764aadf3f1 | Asserts that this object has the same reference as another object. | namespace ChainingAssertion
public static partial class AssertExtensions
public static async Task IsSameReferenceAs<T>(this Task<T> actual, T expected, string message = "")
=> (await actual.ConfigureAwait(false)).IsSameReferenceAs(expected, message); | 1 |
57b18e120115e65f1c69c50e817e9abb | 93cc013a26081cd6140f7f2df54f848f | 判定是否安装微信 | var wx = api.require('wx');
wx.isInstalled(function(ret, err) {
callback(ret.installed,extra);
});
} | 1 |
ea6f99b3c3f3ba38c9f831e73f7ea196 | 49df1feacec13ccb618662f4220880a2 | Get assigned_customer_manager list. | public function getCustomers(); | 0 |
0ef333bb62d549db16890b1e55af75c4 | 01dd76f5447d3709e8d0ca4d14d41d8a | Queries ALC errors.
<p>ALC uses the same conventions and mechanisms as AL for error handling. In particular, ALC does not use conventions derived from X11 (GLX) or Windows
(WGL).</p>
<p>Error conditions are specific to the device, and (like AL) a call to alcGetError resets the error state.</p> | void ALApp::error()
{
ALenum error;
while ((error = alGetError()) != AL_NO_ERROR)
fprintf( stderr, "ALApp::error(): 0x%04X\n", error );
} | 1 |
7213a609aa40a0ac4aca5c2333263713 | 991fc153d12b292125aaa0d4624782a6 | 训练knn解释模型。 | def ModelTrain(filename,testPrecent, crossTimes, savePath):
dataGroup,label,minK = BestK(filename,testPrecent,crossTimes)
train_X,test_X,train_y,test_y = model_selection.train_test_split(dataGroup,label,test_size=testPrecent,random_state=crossTimes)
k = minK
clf = KNeighborsClassifier(n_neighbors=k)
... | 1 |
ba521b70ca849a23c06d3bb8ad2e6b4c | 0d6e6bec64d8e36c58f479c57430b032 | 日付ID相互変換チェック | class BaseController extends Controller{
public function check_date($date_arr) {
$invalid_date_arr = array();
foreach ($date_arr as $row) {
$timestamp = strtotime($row);
$standard = date('Y-m-d', $timestamp);
if ($standard != $row) $invalid_date_arr[] = $row;
... | 1 |
a12bbd6a9263861e08f8a1e704b874a8 | 6b5891f699c1e8dce380a873d14688d9 | Whether the permission allows managing threads. | class Permissions(object):
def can_manage_channels(self):
return self._bit(4) | 0 |
ecefff37da66008561d02cc3892b83f3 | f21f22e838912fc1596a034873851b75 | 新增一个分支,并让这个分支指向head所指向的commit | url_suffix = f'/repositories/{self.workspace}/{repo}/refs/branches'
body = {
"target": {
"hash": target_branch
},
"name": name
}
return self._http_request(method='POST', url_suffix=url_suffix, json_data=body) | 1 |
cfc9ebb51d6242242ff753200cc401b2 | 74b36168edbb2ab731698c89aae6f683 | Set location of presentation controls. This is done programmatically because anchor
does not work well with high DPI settings. | namespace Viewer.UI.Presentation
internal partial class PresentationControl : UserControl
private void SetControlsLocation()
{
NextButton.Location = new Point(
ClientSize.Width - NextButton.Width - 10,
ClientSize.Height / 2 - NextButton.Height / 2
);
... | 1 |
d1fef018ac136405d7c2144d7f58827e | 22e5e4f00d9433fc55692dffe7a82db3 | ItemProcess constructor. | class Process implements ProcessInterface
public function __construct(int $start, int $end, bool $isReprocess)
{
$this->start = $start;
$this->end = $end;
$this->isReprocess = $isReprocess;
} | 0 |
415abafe3aa63fb2ccdfcac1dcbd6745 | 63b69032a699968ba4acecb7fb43a8de | 根目錄路徑 | function root_path()
{
return paths('root_path');
} | 1 |
4751d6b72100db78822a4b8fa64d5a40 | 34b6385fb9392777d6d4a51e9d23a642 | Invoked when an interstitial ad is shown on the screen | if event == "interstitialDidShow" then
m_ad_has_shown = true
elseif event == "interstitialDidDismiss" then
end
end | 1 |
0c6f1c37c25e0a8f5c09c2dddfd9f856 | 3140662d3f569da1da950276ca5a1cff | Should return array of rewards for each agent | class TrivialModel(Model):
def expected_rewards(self):
return self.er | 0 |
f6555020f472f8cc29a8115e9bd2f7be | 76ef61e4d52a28042e16fb9e9a809cda | Print nodes at the extremes of tree | if (active.hasNext() && active.hasPrevious()) {
System.out.println(active.getValue());
this.printNodesWithBothChildren(active.getPrevious());
this.printNodesWithBothChildren(active.getNext());
}
} | 0 |
940823fb40df8b4a95db304a65d34167 | fcbe0fa1f29e6077e8581d0f240219f6 | test for test of no correlation | def test_corr_two_grids(gridded_da_float):
x = gridded_da_float()
y = gridded_da_float()
corrcoeff = corr(x, y, dim="time")
assert not corrcoeff.isnull().any() | 0 |
12380600a95668a3057cb01d0c172c7a | a411b77cec921c97170bd8212d891116 | Множення матриці на вектор | {
Vector res;
double x;
for (int i = 0; i < dim; i++)
{
x = 0;
for (int j = 0; j < dim; j++)
x = x + v.vec[i] * m.mat[j][i];
res.vec[i] = x;
}
return res;
} | 1 |
270f8da6f58dbd89e4f40b858d7636a8 | 0de3be10d3f21b36d92f4017aad1e7a1 | edit date in sales wizard page | {
$referer = $_SERVER['HTTP_REFERER'];
$id =Yii::app()->request->getParam("id");
$set_date =Yii::app()->request->getParam("set_date");
$model = SerSellContract::model()->find("id='$id' and deleted = 0");
$model->set_date = strtotime($set_date);
$model->save();
... | 1 |
35a14dddfbb854abdd184814aea451fd | c2be625f46c25064567491fe8a58d8e3 | <p>
An optional group of data elements which together specify a date associated with the resource file specified in
<ResourceFileLink>, <i>eg</i> date when the resource was last updated. Repeatable to specify different
dates with their various roles.
</p> | public class CICitationImpl extends AbstractObjectImpl implements CICitation
@Override
public OgcPropertyList<CIDate> getDateList()
{
return dateList;
} | 1 |
4178d726189fbf27e2bf4c0a79f1f4cd | 0337db4aefb61f397ad14cc2feec255c | Mapping between classnames and index
Returns | self.classes.sort()
self.class_index = np.zeros(np.max(self.classes) + 1, dtype=int)
for i, j in enumerate(self.classes):
self.class_index[j] = i | 1 |
f9011cccf0347573d5b9b0093c0182be | a290677a991a562d1a54575b99ab7628 | make the upper triangular matrix "distance_matrix" symmetric;
note that there is nothing returned | {
for (int i=std::get<0>(upperTriangle).getHeight()-1;i>=0;i--)
{
for (int j=0;j<i;j++)
{
columnTransform(std::get<0>(upperTriangle), std::get<1>(upperTriangle), i, j, i);
}
}
assert(std::get<0>(upperTriangle) == eye<mat>(std::get<0>(upperTriangle).getHeight(), std::get<0>(upperTriangle).getWidth()));
ret... | 0 |
c7455b48ac281197428245e9f746d009 | 885671180195f229040ea3f7bd67326e | Send a fax using supplied supported file-types. | public class _Document extends Dispatch
public void sendFax(String address, Variant subject) {
Dispatch.call(this, "SendFax", address, subject);
} | 0 |
8dec784d801d9ddf00530dfb565bd9a7 | 74ec5648ae933e7c4136f298d1459dd7 | ******************************************************************************** REGISTER SELLER | class SalesController extends Controller
public function create()
{
$roles = Session::get('roles');
$sellers = DB::table('sellers')
->join('users', 'sellers.idUser', '=', 'users.idUser')
->join('workers', 'workers.idWorker', '=', 'users.owner')
... | 1 |
1148cb4819ab3587f38efe7fb1237c95 | 17444ed28b753a5f4a7ba44f339cc1de | ● 標籤跳轉 | StatementResult
StatementGoto_execute(
Interpreter interpreter,
CriaId object,
List parameters,
CriaBlock block,
StatementGoto statement
)
{
Logger_trc("[ START ]%s", __func__);
StatementResult result;
result.type = STATEMENT_RESULT_NORMAL;
if (statement == NULL)
{
Logger_dbg("sta... | 1 |
bb45f143da3cc17435dfde1ab4a43bce | 2cba8e4ea2e061eeed2261998aa29ace | Search for an actor, actress or production member. | class PlayersApi
def player_search(search_term, opts = {})
data, _status_code, _headers = player_search_with_http_info(search_term, opts)
data
end | 1 |
6ed0a70ebe383b41c6b76335b7328788 | 7a4cc67f5af97def5c3f4cc88f9f453a | 将沉降点数据信息写入到excel | @Controller
@RequestMapping("/project-info/interval")
public class ProjectInfoIntervalController extends BaseController
public String writeExcel(List<MetroLineIntervalSp> datas, String desc) {
WritableWorkbook book = null;
try {
Date date = new Date();
SimpleDateFormat simpleFormat = new SimpleDateFormat("yyM... | 1 |
96241bc6379bbbf0aae5b419f598dbf0 | fa0fb5df000b3e10c97ed32aa99c294a | Renames specified keys for all or a subset of documents in a
MongoDB collection. The updates are driven by an input python
dict passed as the rename_map argument. The keys of rename_map define
doc keys that should be changed. The values of the key-value
pairs in rename_map are the new keys assigned to each match. | class Database(pymongo.database.Database):
def _rename_attributes(self, collection, rename_map, query=None, verbose=False):
dbcol = self[collection]
cursor = dbcol.find(query)
counts = dict()
for k in rename_map:
counts[k] = 0
for doc in cursor:
id = doc.p... | 1 |
09ceeb09d41a3ce4e4f04b2348aab764 | 4a5795764cb0eb7c6338608c9601b98b | Returns the bank angle in radians. | namespace larcfm
void Daidalus::setBankAngle(double val) {
core_.parameters.setBankAngle(val);
reset();
} | 0 |
3f57895bf45cf1e23c13e2b35529f311 | fb75546ad613705e3c5f274a6b633aea | <p>
Disassociates the specified principals or resources from the specified resource share.
</p>
Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
implementation of the callback methods in this interface to receive notification of successful or
unsuccessful completion of the ... | java.util.concurrent.Future<AssociateResourceResult> associateResourceAsync(AssociateResourceRequest associateResourceRequest); | 0 |
bea9caf83cb54ad735cf6554dc4a0082 | 30aa68aae32b016d6013cf20bf8e6f97 | Asserts that a commented value is not returned. | public class NodeUtilityTest
@Test public void testParseNodeForCommentedCode(){
final String targetSource = new StringBuilder().append("")
.append("public class A {\n\n")
.append(" private void ma() {\n")
.append(" la = \"b\"; // comment\n")
.append(" ... | 1 |
25c476bd5b87c86d62c8c8a35797e274 | 49b54d67501699ec1ab895df9f938321 | Parses unsigned 32 bit integers | def parse_uint32(_bytes, order=None):
return _parse_from_format(_UINT32_FORMAT, _bytes, order) | 1 |
80cad26a2d51d98dd40735a7c67912a5 | d2d75d527cfce29f124d0fcf4c809dc0 | Destructor of a QSensorItem | QTouchDevice::~QTouchDevice()
{
delete d;
} | 0 |
b62f3a8608627da7e4743d0bd48cd09b | cc237f4a8cc255f17f90aab5da39e460 | 从缓存中获得指定的连接提供对象,如果不存在则返回null | {
if (Connections.IsNullOrLength0())
{
return null;
}
if (string.IsNullOrWhiteSpace(key))
{
return Connections[0];
}
return Connections.Where(p => p.Key == key).FirstOrDefault();
} | 1 |
655920910fc45c483417966d9eac23cf | 86474cd5e4b6f5f7fbcc7399b120b5bb | Controlla se l'altro utente ha inviato un keep alive entro il massimo tempo consentito | namespace OpenStory.Services.Contracts
[OperationContract]
bool TryKeepAlive(int accountId, out TimeSpan lag); | 1 |
52a1459c66636e7ebaec9e678b839059 | f8f0c577b51aaa5a713239a07f8d0a49 | create the db frame with a callback to remove it from the dict when it's garbage-collected
(could be a set, but that's not available on all versions we want to target). | def temp_db():
fname = tempfile.mktemp(suffix='.db')
db = connect_db(wfm_db, fname)
yield db
os.remove(fname) | 0 |
16aababc95cd2e20947d891aa82afdd6 | ecdb04ef46f3dc52418bd7e17d25806d | 用主机名称连接使用Tcp协议的服务端 | namespace DeviceMangerModule
class TcpClientConnectorHelp
public static TcpClient Connect(string hostname, int port, int millisecondsTimeout)
{
ConnectorState cs = new ConnectorState();
cs.Hostname = hostname;
cs... | 1 |
f7ae0c97ec3c4f58b5dad0d1ec0a4003 | d086a6f4cfa118d61814d9205ab72337 | lookup the default nameserver and display it | class Ui_mainForm(QtGui.QWidget):
def lakukanNslookup(self):
tujuan = str(self.tujuanNslookupLineEdit.text())
self.myNslookup.initialize(tujuan)
self.myNslookup.start() | 0 |
7d80bd2ed7fe56a2359f5995fa3841ff | 8ee4472dbb01881fb39dc1a73f50d9da | 智慧城管事件数量(月) | @Controller
@RequestMapping("analysis/eventAnalysis")
public class EventAnalysisController
@RequestMapping("/listMonth")
@ResponseBody
public EchartData2 listMonth(){
List<String> legend = new ArrayList<>();
List<Integer> category = new ArrayList<>();
List<Series> series = new ArrayList<Series>();
List<Inte... | 1 |
017efd29d0e3f0ae44136c9bef7943e2 | 1f04fbded6fb37d1200911b2c325ef53 | Test multiple output type for diff command. | class LocalRemote(unittest.TestCase):
def test_diff_multiple_output(self):
export_dir = os.path.join(self._local_reports, "export_dir3")
env = self._env.copy()
env["CC_REPO_DIR"] = ''
env["CC_CHANGED_FILES"] = ''
out, _, _ = get_diff_results(
[self._run_names[0]], [se... | 1 |
a5f6203516626dbdae656fbb393e23f5 | 61cceec9102fdfd4733919d9372790c4 | Check if any counter is non zero. | {
for (map<string, const DetectorSummary*>::const_iterator it = sumMap.begin();
it != sumMap.end(); it++) {
if (it->second->GetMult() > 0) {
return true;
}
}
return false;
} | 1 |
f093e9732ff765a6ca3643be83c63e4a | 1c86fc3a010fb024cc42bf87f58a525b | 根据员工ID和时间区间获取一段时间内的员工考勤记录 | {
var q = from a in dal.GetObjects().Include("T_HR_SHIFTDEFINE")
where a.OWNERCOMPANYID == strCompanyID
&& a.EMPLOYEEID == strEmployeeID
&& a.ATTENDANCEDATE >= dtStart && a.ATTENDANCEDATE <= dtEnd
select a;
... | 1 |
ca81e17999c555604214082ffcbec8d3 | 7c164688aeb57a965a902254291ab104 | The algorithm now proceeds as follows:
When the algorithm has finished, shortestKnownDistance contains the
shortest distance from the starting point to all reachable targets. | class Dijkstra
static NodeDist nearestGoal(Graph G, Node s, HashSet<Node> targets) {
if (targets.isEmpty()) throw new RuntimeException("no target");
int n = G.numNodes;
dists = new double[n];
for (int i = 0; i < n; i++) {
dists[i] = Double.MAX_VALUE;
}
dists[s.id] = 0.0;
... | 0 |
ef761d532fa9a12c4fd8d3bf329e8e9d | ac4d85520e234b02630098c12a3a2432 | Загрузка последнего автосохранения | namespace MyFirstWindow
[KSPAddon(KSPAddon.Startup.Flight, false)]
public class MyFirstWindow : MonoBehaviour
void load_cfg()
{
try
{
if (File.Exists<MyFirstWindow>("save.sav"))
{
using (var file = File.Open<MyFirstWindow>("save... | 1 |
5394092938b6539c6b28006a644acd40 | 9f245c9ef8986e6b95c9c40700810e44 | Carrega o objeto <$scope.estudo> com os dados do <$scope.config> | Dados.tempoRevisaoMedio().then(function (arr) {
var faixas = [];
arr.data.forEach(function(faixa){
faixas.push(faixa);
});
$scope.faixas = faixas;
calculaTempoCorrecao();
setTimeout(function(){
$scope.addGraf... | 0 |
96423201c38dcea25e8ec3c5fc726a05 | af34e2008be02bb9b77668f039944704 | Computes the cost of a parameter | def get_cost(nameCF, p):
if nameCF == "x^2":
return getCost_x2(p)
elif nameCF == "x^4":
return getCost_x4(p)
elif nameCF == "ellipse":
return getCost_ellipse(p)
elif nameCF == "1Dsigwell":
return getCost_1Dsigwell(p)
elif nameCF == "2Dshell":
return getCost_2D... | 1 |
5cc29aa15e374922fce86dc4ae464442 | 10304e2e102825a4138c3af11f55c170 | 设置 下线原因 字段:pet_trends_entity.down_reason | @Table(name = "t_frozen_information")
public class TFrozenInformation
public void setFrozenReason(String frozenReason) {
this.frozenReason = frozenReason == null ? null : frozenReason.trim();
} | 0 |
566f2566bb37bae15804eeb4598cccbf | 6cf1d8462ee85fc2265c171c3ca74e8e | Displays a view that lists a page of forums | class ForumController extends Controller
public function index()
{
$forums = Forum::paginate(5);
return view('forum.index', compact('forums'));
} | 1 |
f95d65bdc43f4a108df9592e1c99665f | 425d9d708585788f0c9767e677008195 | B1046.划拳 | class MajiangService extends ExtGameRpcService{
public function anGang($request){
if(!$this->checkParams($request, array('mjVal'))) return;
$mjVal = (int)$request['mjVal'];
$uid = $this->senderUid;
$room = $this->room;
$game = MajiangDao::getMajiangGame($this->room->id);
... | 0 |
3ca01e6aeb4c97fa198280e96c354596 | 795fcd1244a8bb84a0debff362879054 | 이머니 충전(무통장 입금신청, 카드결제 성공후시 호출) | public String withdrawalOk(HttpServletRequest request, HttpSession session, @ModelAttribute MemberDto mbdto){
try{
int member_num = (Integer)session.getAttribute("member_num");
MemberDto member = mservice.getMemberData(member_num);
request.setAttribute("member", member);
MemberDto check = ... | 0 |
ff5b813f675a37cd8b5af83458e6867c | a6d6a81b8100ddf8cc2c65f8659a45bf | Takes in an Int and returns the appropriate suit for our deck of cards | public class deck
public static int GimmeCardSuit(int GivenNum) {
int SuitVal = 0;
SuitVal = GivenNum / 13;
return SuitVal;
} | 1 |
fb98b32ba5f85ff0fc6d19e790b47705 | e7817a7121ebb009904eb7231fe23197 | 留给Client调用的,血量变化回调,让Client可以触发血量变化事件从而同步状态。 | [RequireComponent(typeof(Rigidbody))]
public class TankController : MonoBehaviour
[PunRPC]
void SyncLife(int playerId, int currentLife)
{
m_life = currentLife;
Debug.Log("player " + playerId.ToString() + "'s life: " + m_life.ToString());
if (m_lifeText)
{
m_lifeText.t... | 1 |
4fe323f4d0fb54faa842213ccb1bd0cd | dce00945815878de1283e5d537b47d5a | Sends a prompt to the user and optionally waits for a response. | public static string Prompt(this ICakeContext context, string message, TimeSpan timeout)
{
return Prompt(context, message, null, timeout);
} | 1 |
bec10ba300c85005cd3e969c5a36c4f9 | 83fa4acf5cbefe3fe7ac3e1178269ec8 | Return the tasklist shown in this view | class AuthItemForm extends CFormModel
public function getTaskList()
{
$authItems = Yii::app()->getAuthManager()->getAuthItems(CAuthItem::TYPE_TASK);
return CHtml::listData($authItems, 'name', 'description');
} | 1 |
6337aa6913f47b101adf93c7dabd05b9 | a4074824bfa6aa9f83e68e4018d1a1e4 | Get a package window from either old sendme logic, or congestion control.
A package window is how many cells you can still send. | find_packet_count (void)
{
int num = GET_MIN(srv_state->advw_size, srv_state->cwnd_free);
return num;
} | 1 |
22d8f40ed0c2591c0f3f27c237319563 | 5aecdd734428a922ec6479867e8dd985 | 根据鼠标按下的位置,更新"裁剪后"的绘制对象(非原件)的选中状态; | namespace Tida.Canvas.Infrastructure.EditTools public partial class MoveEditTool : EditTool,IHaveMousePositionTracker
private bool UpdateDrawObjectSelectedState(Vector2D mouseDownPosition,ICanvasContextEx canvasContext) {
if(mouseDownPosition == null) {
return false;
}
... | 1 |
c7d6c2e0e1de12c725eb149b1ceba3d2 | b302b67d6eb09db7c3053cb2aa57f244 | ================================================================
函数:InitStageData()
功能:初始化该Stage的数据
需要初始化的数据,如计数器、标志位等;
================================================================= | self._towerData = {
layer = 0,
now_layer = 0,
now_stage = 0,
now_star = 0,
now_left_star = 0,
select_buffs = nil,
buffs = nil,
shop_buy = nil,
open_count = 0,
max_layer = 0,
max_stage = 0,
pass_reward = nil,
free = false,
can_fast = false,
award_preview = nil,
status = 0
}
... | 1 |
38eac2d57e79f5d36b0f8496dd69db5b | 54b60f64509454b658dc35af9f0d8685 | 测试通过员工登录名查询数据 | class TestStore(unittest.TestCase):
# #登录商超门店
def test_bb_search_staff1(self):
base1.search_staff(base1.name)
text = base1.driver.find_element_by_xpath('//*[@id="tables"]/tbody/tr/td[2]').text
assert text == base1.name
time.sleep(2) | 1 |
65b789193401c80f144fc2e7be6a24a8 | 7ee867c6537df09ccaa6796f617cad76 | Force a route to be served on HTTPS | abstract class Record
public function httpsOnly($isSecure) {
if ($this->isSetHttpsOnly) {
throw new \BadFunctionCallException('You are trying to set HTTPS rule twice for the same route item.');
}
$this->isSetHttpsOnly = true;
$this->httpsOnly = filter_var($isSecure, FILTER_VALIDATE_BOOLEAN);
return $this;
... | 1 |
f6561f5c09ed91dc3adc51fc8c8bf0f9 | d02f4a2c4470aefb6c1cb161d85849e4 | 根据小鹅通订单主键获取订单记录列表 | namespace GD.Mall
public class OrderBiz
public async Task<List<OrderModel>> GetGetModelsByKey(string orderKey)
{
using (var conn = MySqlHelper.GetConnection())
{
return (await conn.GetListAsync<OrderModel>("where order_key=@orderKey", new { orderKey })).ToList();
... | 1 |
586f5e63903d8b95817d57662d59e878 | 12ab9cbb3cfde0cb8509fb49ef8a8099 | POST /namings | @petname = Petname.new(petname_params)
respond_to do |format|
if @petname.save
format.html { redirect_to @petname, notice: 'Petname was successfully created.' }
format.json { render :show, status: :created, location: @petname }
else
format.html { render :new }
format.... | 1 |
dd11dcad06c92a94775ad1055ca62315 | fd8d7cef4c7033bf4c911089069cda91 | ***************************** send RobberCards ********************************************* | void *SPADE(void *abs) {
int thread_id = (int)(size_t)pthread_self();
usleep(750000);
for(int b = 0; b < 14; b++) {
sem_wait(&FLAG);
myfile.open("STACK.txt", ios_base::out | ios_base::app);
myfile << "Spade " << cards[b] << "\n";
cout << "Thread:" << thread_id << " is running\n";
myfile.close();
sem_... | 0 |
1a32fc8ba72cd4d428bb93547098d720 | f15117bdb36d820e4c73fc5fc1a7ec7b | 将拼音字符串转成id list | self._split(str)
for word in self.wordsList:
self.pinyinList.append(self.pinyin_dict[word])
if len(self.wordsList) != len(self.pinyinList):
print('=====================')
print("ERROR")
self._join()
return self.str | 0 |
38fd4456c830bc676644419599afbb2a | 3f99e775345e54ad0d279631f6e4754f | 七天未跟单数量 | String sql = "SELECT COUNT(0) FROM lkcrm_crm_customer AS ccc WHERE owner_user_id != 0 AND deal_status = '未成交' AND is_lock = 0 " +
" AND( ( to_days(now()) - to_days( IFNULL( ( SELECT car.create_time FROM lkcrm_admin_record AS car WHERE car.types = 'crm_customer' " +
" AND car.type... | 1 |
cf6274cab2158e70b4465f322d9b05e2 | 36e9930ac1031f00286894bf056dbcfc | \brief Realiza a operacao MUL | int i, j, aux=0, *vet;
for (i = 0; i < tam_n2; i++) {
vet = allocate_number(tam_n1 + tam_n2);
for (j = 0; j < tam_n1; j++) {
vet[i+j] = n2[i] * n1[j] + aux;
if (vet[i+j] > 9) {
aux = vet[i+j]/10;
vet[i+j] = vet[i+j] % 10;
} else... | 1 |
a2cd1e194de7a77f35002db22a9c6ec0 | dc8d14e25cccefc5810308858da73614 | very internal, basically the message contains stack-trace | cclog("----------------------------------------")
cclog("LUA traceStack: " .. tostring(msg) .. "\n")
cclog(debug.traceback())
cclog("----------------------------------------")
end | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.