query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d9a4655b33548e066bc598cb6cd658c4 | 4f3e3fcead13cd85f179083532fb9541 | Recalculate normalized tangents | {
if (!mesh)
return;
const u32 mesh_buffer_count = mesh->getMeshBufferCount();
for (u32 b = 0; b<mesh_buffer_count; ++b)
{
recalculateTangents(mesh->getMeshBuffer(b), recalculate_normals, smooth, angle_weighted);
}
} | 1 |
3d7858c6de2d34124f4f5f63f3a56b68 | 43bede099860092c82ce562ae55d08d8 | Возвращает данные по сценарию | [HttpGet]
[ProducesResponseType(typeof(List<RoutineDataDto>), (int) HttpStatusCode.OK)]
public async Task<ActionResult<List<RoutineDataDto>>> GetRoutineData(int routineId)
{
return await _mediator.Send(new GetRoutineDataRequest()
{
RoutineId = rout... | 1 |
3ef04f4053a412e56f19ee13500de792 | 150bdef7c71d166d9e060beb63c0ac8c | Get ad objective enum by objective name | {
if ( i == 0 ) { return objectiveScoresP1; }
else if ( i == 1 ) { return objectiveScoresP2; }
else if ( i == 2 ) { return objectiveScoresP3; }
else if ( i == 3 ) { return objectiveScoresP4; }
return null;
} | 0 |
65949c177a7305bb307dfc412975584f | f4a4d9e7c4b60cd86f5230765a856fa8 | Restart ppu processes | {
*(word *)((byte *)Player1StatusProc + 0x8) = 0x15eb;
*(word *)((byte *)Player2StatusProc + 0x8) = 0x15eb;
} | 0 |
1996876ab7f1830194e418b373b0c7b4 | a70bc1ae2b4adb9e740bd0b182114236 | pull the first available PCB off the free queue | pcb_t *_pcb_alloc( void ) {
return( (pcb_t *) _que_remove( &_free_pcbs ) );
} | 1 |
2c887e491fa35236f840d3f101b1f735 | bbf124a05a521b30c595061d66287e32 | 为有序集合 key 的成员 member 的 score 值加上增量 value | {
Command command("ZADD");
std::vector<const char *> args;
std::vector<size_t> lens;
std::vector<std::string> scores;
args.reserve(2 + 2 * member2score.size());
lens.reserve(2 + 2 * member2score.size());
scores.reserve(member2score.size());
args.push_back(command.c_str());
lens.push_back(co... | 0 |
4447b332c530e9005cbabe8b5207a77c | 000b5b1f1da000aafc565ff4984db698 | Allows the mesh to create mesh area lights from its emissive contribution | {
foreach (Material material in GetRenderer().materials)
{
material.DisableKeyword("_EMISSION");
}
} | 0 |
b9478956f711aab3be1047f7630e8966 | ee36e6455bcec41f9a53bdf2276368bb | MQTT客户端的回调函数(用于查看通信状态) | {
ol_trace("mgt-&&&callback_MqttState : [%s]\r\n", line);
if (strstr(line, "IMQTTSTATE:0") != NULL) {
fg_mqtt_state = 0;
}else {
fg_mqtt_state = 1;
}
} | 1 |
ceca045ea6666de1be3fd060e14996a0 | 9d0a6aace89da46032953790e611bbd4 | Checks a keyIndex is a valid key for a stream deck. A number between 0 and 14. | if (key >= 0 && key <= 11) {
return TRUE;
} else {
return FALSE;
}
} | 0 |
6dbf4c15de5138bab3c955e001d6f58c | 8a5fc543dbc6196a935279b626f19631 | Calculates the distribution of user account ages for users who are active in the data.
Question #10
Inputs: df - Events data
eventType - List of event types to include in the data
Output: A pandas Series containing account age of the user for each action taken in the community | self.cid_ages = self.meta[['cohortid', 'date', 'ageyrs']].\
drop_duplicates().\
groupby(['cohortid']).\
apply(lambda x : x.tail(1).ageyrs) | 0 |
b17fa7c7a917a3f64c02dca398bd2373 | 511cf779f1e601e2122a196995bf923b | 按钮的不同状态,变换图片显示 | public class MyButton extends Element
public void changeState(int newState) {
state = newState;
switch (newState) {
case 0:
currentImg = notActiveImg;
break;
case 1:
currentImg = image;
break;
case 2:
... | 1 |
4c863d242f0a2d10fb7f08c37e170c19 | 7aa7962142b55aa3e20cccee195f0ff7 | Useful for preventing duplicate reviews by the same user on one recipe | class ReviewSerializer(serializers.ModelSerializer):
def validate(self, data):
creator = self.context["request"].user
product = data["product"]
review_quantity = Review.objects.filter(creator=creator.id, product=product).count()
if self.context["request"].method == "POST" and review_quan... | 1 |
d10f49774059555070c68fe7578f0493 | 524fb4c26c556d962fd02cfcb44dd024 | 列表查询(非分页) | public abstract class GeneralController<S extends ServiceImpl<M, T>, M extends BaseMapper<T>, T>
@RequestMapping("list")
@ResponseBody
public List<T> list(T param) {
return service.list(buildWrapper(param));
} | 1 |
f98c0e14aaef87d02ea4f74e9bdf4fab | 0ac324684c6914aafb7079ef648e8ed2 | 根据参赛队伍编号删除 | @Delete("delete from seminar_score where team_id=#{teamId}")
int deleteByTeamId(@Param("teamId") Long teamId); | 1 |
269dae95129e87348666258f7a9d462a | e716225ba9300548faab384979bf25cd | 所属メンバーの中から、指定したタグの最大値を取得する
タグの形式は数値型のみ | {
$pdo = self::getInstance();
$sql = "select count(*) as count from " . $table_name;
$stmt = $pdo->prepare($sql);
$flag = $stmt->execute();
$result_arr = array();
if ($flag) {
$result_arr = $stmt->fetchAll();
} else {
throw new \Excepti... | 0 |
b7d407123ee7c1fd1b7294defcbf3bb5 | 2b65617a0c39f7c9b5e481efa7fded08 | Test changing Wlan password. | account_1 = accounts("McMaster123", "Scba123456", "Scba123456", "suofqpd1200@gmail.com", "John Doe", "416-956-8837")
old = "Scba123456"
new = "ABc1234567"
assert account_1.password_change(old, new) == new, "password should be changed to the new password" | 0 |
95b298122fdd48ec4c0e6cce70f7b102 | 8009f4ddc6b5a5537ebb8494b2698e21 | 中通 | class Express extends Model
public function getComs(){
$params = 'key='.Config::get('juhe.expressKey');
$content = mixCurl(Config::get('juhe.expressComUrl'),$params);
return $this->_returnArray($content);
} | 0 |
665a1f9df3c3afbb2b208498fe857323 | 5fcccccbc8d5990b910d39e0be470d22 | @brief 在指定的地址连续写入字节 | {
if (addressStart % SIZE_PAGE != 0) return false;
uint8_t cmd[5];
cmd[0] = WRITE_DATA;
cmd[1] = addressStart >> 16 & 0xFF;
cmd[2] = addressStart >> 8 & 0xFF;
cmd[3] = addressStart & 0xFF;
cmd[4] = data[0];
enableWrite();
_comDriverSpi.writeSpi(cmd, sizeof(cmd));
for (uint8_t retry = 0; retry < MAX_... | 0 |
a1773d474f5ddcd70fda3704b7030cd9 | a0433fb76a391038677a06d533d37295 | 是否保存主界面状态。 | public class BannerFragment extends Fragment
public void setSaveView(boolean save) {
mSaveView = save;
} | 0 |
56f52705633124df5998cc3a58a80053 | 3a32324c7f7b619e95162a40fe2bddc2 | @brief Unit test for @ref IO_config and @ref IO_setBit.
IO_setBit correctly sets a bit in the PORTB register, which drives `PB0`
high. | uint8_t bits[32];
memset ( bits, 0, sizeof ( bits ) );
set_bit ( 0, bits );
ok ( bits[0] == 0x01 );
set_bit ( 17, bits );
ok ( bits[2] == 0x02 );
set_bit ( 22, bits );
ok ( bits[2] == 0x42 );
set_bit ( 22, bits );
ok ( bits[2] == 0x42 );
clear_bit ( 0, bits );
ok ( bits[0] == 0x00 );
bits[5] = 0xff;
clear... | 0 |
190894b6978f69fa83a059c79dc4714c | 9d1d94553d74d0531d3a1e93672ac9fb | Test calling UniProtKB when protien data is returned. | class TestParse(DatabaseMixin):
def test_protein_count(self):
protein_number = self.manager.session.query(Protein).count()
self.assertEqual(29, protein_number) | 0 |
0962f6d51b82df9a06d4e07b44025631 | 501d6af164c9717490c538655709b28f | 检测QQ是否为空 | var atit = document.getElementById("u_qq").value;
var sptit = document.getElementById("err_u_qq");
if(atit.length >= 6){
sptit.innerHTML = "";
return true;
}else{
sptit.innerHTML = "qq不合法";
sptit.style.color = "red";
sptit.style.fontSize = "11px";
return false;
}
} | 0 |
a3ee72bf879cc8aaa0e38e8c9c1cae53 | 5bac80a2b8cf979dc1eeb8575e8a68dc | 设置pkid | public class UpdatesAction extends ManagementAction
protected void fixPkids(UpdateVO u) {
if (!StringUtil.isEmpty(u.getUpdateId())) {
for (UpdateXRVO uxr : u.getUpdateSections())
uxr.setUpdateId(u.getUpdateId());
}
} | 0 |
b708bcbd742ef19d16a97e294babeeec | edd7170330bb72f82c341b69558dd7fa | Set the value of siret. | @MappedSuperclass
@Embeddable
public class CreditCard implements Serializable
public void setSvn(String svn) {
this.svn = svn;
} | 0 |
2b6a82f650b54c81c21a339793275461 | 42772e3613aa741bdc122fc31f526808 | Updates the moving average of variables. | class _BaseOptimizer(tf.__internal__.tracking.AutoTrackable):
def _overwrite_model_variables_with_average_value_helper(self, var_list):
for var, average_var in zip(
var_list, self._model_variables_moving_average
):
var.assign(average_var) | 0 |
ba81fa166a85aa3e4f14052a30e14488 | bb15e3bd91952ab04655eeea93e0068c | 运行一回合游戏,返回True说明达到游戏结束条件 | await self._day_phase()
if self.check_winner():
return True
self._day += 1
await self._night_phase()
for player in self.players:
self.ctx.create_task(player.post_night_task(self))
return False | 1 |
70d8fa6f37137b7ded19fa6b1ebe0480 | 9fbcb16fdb9e062155638f58b76b217b | 获取日期时间字符串格式:yyMMdd | public class DateFormatUtil
public static String getYMDString(Date date) {
return getString(date,YMD_FORMAT);
} | 0 |
f05fdf7fd34ce58d1cf2636bbc0433ff | 4bcf5ef2ce126456c5d0592507e17164 | Test that does not perform successful sign in due to wrong password | class finding_views(unittest.TestCase):
def test_login__with_wrong_password(self):
data=dict(
signin_username="m496",
signin_password="wrongpassword"
)
response = app.test_client(self).post('/signin', content_type='multipart/form-data', data=data, follow_redirects=True)
s... | 1 |
7f039bd61dd39aece7f6c14ce1667837 | 32f4ff8ad63f8635c4f4c810731d5450 | Recibir los tipos de productos que se pueden guardar en la base de datos. | String[] array = new String[3];
array[0] = "rtipo";
array[1] = "rtico";
array[2] = "rprod";
return array;
} | 0 |
e7b6b613518ee0d28236e5ee9614cbe4 | 73a448f8156574c961b2b0caad4b0507 | 比较新老虚拟dom,返回一个补丁对象,记录了虚拟dom的变化 | class vdom
static diff(oldVnode, vnode, parentElm = undefined) {
let currentPatch = [];
if (oldVnode === undefined || oldVnode.sel !== vnode.sel){
console.log('不同类型', vnode.sel, oldVnode.sel);
vdom.commit(currentPatch, 1, vnode, oldVnode.elm || undefined, parentElm);
... | 1 |
1784f032b7a686c35b552a8f6bbefdbf | 183ae6c4a4407f63ce26a4c202d2a8e7 | 置き換えたTTSメソッドを元に戻す | {
int tIndex = t.SelectionStart;
int tselLength = t.SelectionLength;
int tLength = t.TextLength;
string text = t.SelectionLength > 0? t.SelectedText : t.Text;
text = text.Replace(" ", "").Replace(" ", "");
if(tselLength > 0) {
... | 0 |
d8cdc11208e34dd687144b15f0c92330 | 610864a4ed32678655ba22320ac6bb8c | success redirect to homepage | class FacebookAuthenticator extends AbstractGuardAuthenticator
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
return new RedirectResponse($this->router->generate('homepage'));
} | 1 |
eabba6c05634c47f38725517f6bb33eb | 4fc55a64f4a6456cc48271767b6678e8 | 去除尾部的标点符号 | string stripPunct(const string &s)
{
if (ispunct(s[s.length() - 1]))
{
return s.substr(0, s.length() - 1);
}
else
{
return s;
}
} | 1 |
f0a022527d05d615f699b5886594ce43 | 47494bf561264b455d7da94417d22a4d | The mime type of this file (based on the filename)
Returns
str
NOTE
Defaults to 'text/plain' in case the actual file type is unknown. | class Data( object ):
def get_mime(self):
return 'application/octet-stream' | 0 |
94d8bd1868565838ac7a2768b7045c9e | eb670adf702744bc39ac06db99d7a5d0 | @brief 响应好友间发送文件的回复 | namespace ClientCore
void CMediumServer::HSB_FileSendDataBeginRsp(const std::shared_ptr<CClientSess>& pClientSess, const FileSendDataBeginRsp rspMsg)
{
if (rspMsg.m_errCode == ERROR_CODE_TYPE::E_CODE_SUCCEED)
{
int nFileSize = 0;
std::string strImageName = GetUserImageDir(pClientSess->UserId()) + rspMsg.m_strFile... | 1 |
283e764bf5f8d4ba5a9fb61ea27b3dff | b462c8da5b5bbf10f0896fe157f38d6b | to determine if this is the Document view | {
const UPDFViewerSettings& Settings = *GetDefault<UPDFViewerSettings>();
return (InViewMode == Settings.VolumeViewMode);
} | 0 |
f989ab334ebe459dc7a21d61ae94d747 | b82e2c1985c28b418dcc2d3024c729db | Enable ScrollHandDrag Mode in QGraphicsView (displays a hand
pointer) | class UiMainWindow(QtWidgets.QMainWindow):
def onMoveClicked(self, checked) -> None:
try:
self.QView.setDragMode(self.QView.ScrollHandDrag)
except:
self.QStatus.showMessage("Status: Wait...")
else:
self.QStatus.showMessage("Status: Done") | 1 |
c85740488d7c13e3eaf71eb26f0444db | a43fda6e9814525e0ec1d4c49ffcc248 | 如果该类别文档数为0则返回0 | num_of_categories = sum(self.category_count.values())
num_of_docs_of_the_category = self.category_count[category]
return float(num_of_docs_of_the_category) / float(num_of_categories) | 0 |
25ac83d6cd4de78bb686a31caf3450bd | 1d1b0690f677c16654dfc72543de4bcc | Check if audio preference is editable. | public class Editor extends Artist
public boolean getPreferences() {
return electronicEditing;
} | 0 |
d20adc131f47772fcc04d9d63590f605 | 27681385b2d606011e0e070b017f7e52 | Handle basic ping requests to the server | namespace Subterfuge.Remake.Api.Network.Api
Task<SubterfugeResponse<PingResponse>> Ping(); | 1 |
d9757c93f048aaf39238e109806e60e2 | c9c8245ece9c3dfc31d32ff25f96e59f | 原型模式
构造函数是一个空的函数
把属性和方法添加到原型对象中 | function pro (obj) {
var Func = function () { };
Func.prototype = obj;
return new Func();
} | 1 |
98866a7669c7831a1a8e322690473179 | 5127f0bba6867a0ff5c317e071292e64 | converts world space s coordinate to local space based on provided mapping | public class VectorMath : MonoBehaviour
public static Vector3 LocalToWorld(Vector3 vector, Transform localSpace)
{
return vector.z * localSpace.forward + vector.y * localSpace.up + vector.x * localSpace.right;
} | 0 |
6cdf0dfd1decc6ec278931552e0ddeec | e736852dd474524923f8d23c7c3f86d1 | Gets the services provided by a given shop | {
var service = availableGoodsListBox.Items.Cast<Service>().ToList();
return service.Select(item => new ShopService
{
Shop = selectedShop,
Service = item
})
.ToList();
} | 1 |
ee899dbeb91629ff12b355c7f5b249f2 | d792867e27de09f2fa54780795e194c9 | This code is used to convert cartesian coordinates to geodetic coordinates | def cartesian_to_geodetic(x, y, z):
eps = 1.0 * 10**-3
eccentricity_sq = _WGS84_ECCENTRICITY**2
norm_vector = math.sqrt(x*x+y*y+z*z)
if (norm_vector < eps):
return (0.0, 0.0, -_WGS84_EARTH_RADIUS)
rho_sq = x*x + y*y
dz = eccentricity_sq*z
while True:
zdz = z + dz
nh = math.sqrt(rho_sq + zdz*... | 1 |
07838f8c29e7b303db13afcc6eba90a1 | 6584101dd581b4c1d25065bde987390d | Returns the current time, padded for use with mediawiki api. | namespace CH.Froorider.DokuwikiClient.Contracts
[XmlRpcMethod("dokuwiki.getTime")]
int GetTime(); | 0 |
cd2fd4c33be5c9702c6fd526063c0cbd | 51b4ed2b8d4002d3a255e0bacb6aa886 | Returns a parfile representation of the entire model as a string. | write_physical_grids=False):
description = ''
description += 'Simulation File = ' + self.file_address + '\n'
description += 'Species\n'
description += '-------\n'
description += '\t' + self.s.__str__().replace('\n', '\n\t')
description += '\n'
desc... | 1 |
1fa845fc03e671018d865cf8e100d4d1 | fc85e5d4a39eb2e0a896625ab3a15e9d | Функция выбирает пользователя из базы данных,
если он есть в сессии и имеет статус "онлайн" | auth_id = self.auth_session.get('id', None)
session_id = self.auth_session.get('session_id', None)
remember = self.auth_session.get('remember', '0')
if auth_id is None:
return None
user = self.auth_get_user_entity(auth_id=auth_id)
if user is None:
... | 1 |
19543d374476f433d75daf6971c8aa0e | a03c4397031ed57f2a47b833f824bf0c | printOptions()
Show the current THREEDHST option set. | show_hypisq_links_opts(void){
#ifdef HYPISQ_REUNIT_ALLOW_SVD
node0_printf("HYPISQ_REUNIT_ALLOW_SVD\n");
#endif
#ifdef HYPISQ_REUNIT_SVD_ONLY
node0_printf("HYPISQ_REUNIT_SVD_ONLY (used together with HYPISQ_REUNIT_ALLOW_SVD)\n");
#endif
#ifdef HYPISQ_REUNIT_SVD_REL_ERROR
node0_printf("HYPISQ_REUNIT_SVD_REL_ERROR = ... | 0 |
a78c2c5face4b4517eccb65d58263d19 | 2997060f766708fa47528be22cd8a428 | Available vehicle correctly identified as available | license_plate = 'MCM4111'
date = '2020-03-02'
time = '12:00'
response = test_client.get(get_endpoint(license_plate, date, time))
json_response = response.get_json()
assert response.status_code == 200
assert json_response['available'] == True
assert json_response['day'] == 'Lunes' | 1 |
decd9ddf6d8204fa76b18edca5d9eefa | 0234c55c9a2f37c1b88114095ab97c33 | 按点赞量排序 | public List<Praise> orderByViewCount(List<Praise> plist); | 0 |
585e5b93613e3ede5cc8e3c842d028e3 | 6fda65d576c9d88f3554456b5ff4473c | 加盐密码的sha256值 | public class EncryptUtils
public static String sha256Crypt(final String value, final String salt) {
return Sha2Crypt.sha256Crypt(value.getBytes(), salt);
} | 1 |
d71eaa46fac93a94ac2c2d6bc55d5622 | af4d3f1d1d82808ca427a02eb7b25ddd | Returns a Queryset of all questions added to the consent form. | class SettingsView(generic.DetailView):
def get_queryset(self):
return Question.objects.filter(pub_date__lte=timezone.now()) | 0 |
728277c3e22082479bb9dcbe37328631 | 22e5e52c0f1c51a8a1e5adee56f18f02 | Method that initiaties DFP Ads (to be used only for testing purposes) | public class MainActivity extends AppCompatActivity implements View.OnClickListener{
private void InitAds(boolean test)
{
AdView mAdView = (AdView) findViewById(R.id.adView);
if(test)
{
MobileAds.initialize(getApplicationContext(), "ca-app-pub-3940256099942544~3347511713");
... | 1 |
9a3df7574e1e7f3eeacd68e1f5e3bb6f | 83d422f9b04d2d163337211e0c8392c9 | function that saves contents of a dataframe to S3 | def save_data(df, database_filename):
engine = create_engine('sqlite:///'+ database_filename)
df.to_sql('DisasterResponse', engine, index=False, if_exists='replace') | 0 |
571ccb35972206be45da200e3d4d90be | ae5f318540a5b3e46fb412f6e41f4393 | Update the given Ftp account | class FtpAccountsController extends AuthController
public function destroy(FtpAccount $ftpAccount)
{
try {
$this->repository->destroy($ftpAccount);
} catch (ExecuteCommandException $exception) {
return redirect()->route('admin.ftp')
->with('error', __('ftp::ft... | 0 |
73d5e0efbb80fef24b160cfbd9010425 | e0480615476ede7587eafd9a2189c2e2 | 빈값을 전달했을 때 0을 리턴하는지에 대한 테스트 작성 | class Test02Positive(BaseTestClass):
def test_ss_len_is_null(self):
self.assertEqual(self.fn('abbccdde', 0), '') | 0 |
0a5eb2fed4a3d8daf3ca717fc7ee41f5 | bf06067310e6af2f01e5ceba367550fd | @brief Group keypoints to skeletons and assemble them to person | order = [13,12,8, 7, 6, 9, 10, 11, 2, 1, 0, 3, 4, 5, 14, 15, 16, 17]
oneperson = { "face_keypoints": [],
"pose_keypoints": joints_np[order].flatten().tolist(),
"hand_right_keypoints": [],
"hand_left_keypoints":[]}
people = {"poeple": [oneperson]}
... | 1 |
2d82a39ea6e80760c6e2589da31f1735 | ac26d4123c810d599c7b4316b8168cd5 | 자기 자신에게 쓰이는 데이터 교환 | public class ItemUI : MonoBehaviour
public void Exchange(ItemUI itemUI)
{
itemUI.SetItem(Items);
this.SetItem(itemUI.Items);
} | 1 |
55d7e98cb07cd32661fb703ff22a1da6 | 0d5bd9009d4fd08f686c776e850fbee4 | Load DeepLabCut data. | class VD_Data(data.Dataset):
def _load(self, n_videos):
data_blur, data_sharp, data_gt = [], [], []
for idx in range(n_videos):
sharps = np.array([imageio.imread(sharp_name) for sharp_name in self.images_sharp[idx]])
blurs = np.array([imageio.imread(blur_name) for blur_name in se... | 0 |
0a4aa8cca9b1189740b5a4453f2dd117 | ebb44a6e2d0fece98109588f32f33363 | Save ages into database | class SaveController(object):
def PUT(self):
rdb.write_ratings("data/ratings_new.txt")
output = {'result': 'success'}
return json.dumps(output) | 0 |
369c38e144e2fc7b782041ea08f7a1fb | f45ad19ec4a2d1a68801564156f1ae8a | replace all digits into `0`,
so we can treat any `0` as any number | def zero_digit(s):
return re.sub('\d', '0', s) | 1 |
0f314c73b47d59348b88be42004c6925 | ef52a95e42b1d42d9470fdcf2bf6b962 | @brief check initialize, connect, de-initalization operations of wifi manager | {
ble_result_e ret = BLE_MANAGER_FAIL;
ret = ble_manager_init(NULL);
TC_ASSERT_EQ("ble_manager_init", ret, BLE_MANAGER_SUCCESS);
ble_client_ctx *ctx;
ctx = ble_client_create_ctx(&client_config);
ble_conn_info conn_info = { 0, };
memcpy(conn_info.addr.mac, g_target.mac, BLE_BD_ADDR_MAX_LEN);
conn_info.addr.type ... | 0 |
41c43a896865e4eaa7a7cd3aaf83dc90 | 1a8b459f22a27e1411e3fa66b172e8ff | Sets the agent count in the time of world creation. | public class Goldfish<T extends Comparable<T>, A extends Agent<T>> implements
Callable<A>
public void setGames(int gameCount) {
this.gameCount = gameCount;
} | 0 |
03b6ce3a23134820088a84831511feb0 | b75e3f010e172973aea4c808b4f1ba11 | Returns a new Tensor with the smallest integer greater than or equal to each element | namespace TorchSharp
public static partial class torch
public static Tensor trunc(Tensor input) => input.trunc(); | 0 |
370e2faad9056b4bb91ffa3f00043e66 | f3d7ca798d598783b7f9c925d9c7fa5b | Method to determine if current time is evening | export class DateService
isEvening(dateStr: string): boolean {
let hour = moment(dateStr).hour();
return (hour >= EVENING_START && hour < 24) || (hour >= 0 && hour < EVENING_END);
} | 1 |
290384a8df463b40585dfa0d430f6053 | 9aa9b465fce68a485610682620ce63a5 | helper function to setup the synaptics_rmi4_fn
save the base address of RMI command register, RMI query register, RMI control register,
and RMI data register. The interrupt mask is initialized as well
struct synaptics_rmi4_fn_desc rmi_fd: a particular function descriptor fields in PDT entry
struct synaptics_rmi4_fn *rm... | static int tc_dwc_g210_setup_40bit_rmmi(struct ufs_hba *hba)
{
static const struct ufshcd_dme_attr_val setup_attrs[] = {
{ UIC_ARG_MIB(TX_GLOBALHIBERNATE), 0x00, DME_LOCAL },
{ UIC_ARG_MIB(REFCLKMODE), 0x01, DME_LOCAL },
{ UIC_ARG_MIB(CDIRECTCTRL6), 0x80, DME_LOCAL },
{ UIC_ARG_MIB(CBDIVFACTOR), 0x08, DME_LOCA... | 0 |
eba58ccf0dde8ad34216072913da6913 | 64e32645aa1e70923d4888a743d98b6d | find longest palindrome substring using dynamic programming | int main()
{
string str = "xyaabax";
int dp[M][M];
constructDP(dp, str);
int l = 3;
int r = 5;
cout << countOfPalindromeInRange(dp, l, r);
return 0;
} | 0 |
444a5a8969ef99e0b14e140aaed8d560 | cd7ae897dbbd2c3388361c8b2d39e951 | Updates the subscription plan asynchronous. | {
var options = new SubscriptionUpdateOptions();
action(options);
await _subscriptionService.UpdateAsync(subscriptionId, options);
} | 1 |
9eab1d8a9672341ae695b43187f01e50 | 792d417a9b1daa9f1228bf3698f5a37e | FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
allowed values are Ignore or Fail. Defaults to Ignore. | class GrpcRouteRuleAction(dict):
def fault_injection_policy(self) -> Optional['outputs.GrpcRouteRuleActionFaultInjectionPolicy']:
return pulumi.get(self, "fault_injection_policy") | 0 |
1ad6702de519dfb626c289bd8a2ee208 | 54133ff323ebff944844c7f2d76d1446 | Check that Spark backend works the same way as ROOT RDF. | store = surf.Store(reader = "rdflib", writer = "rdflib")
session = surf.Session(store, auto_load = True)
Person = session.get_class(surf.ns.FOAF.Person)
person = Person()
person.foaf_name = "John"
person.save()
same_person = Person(person.subject)
self.ass... | 0 |
1924000464e70b8ad1155a67fc5fa552 | 10d95c2c896e60c215c7d1a2a766e839 | Sort values of the given worksheet name. | class MyExcel:
def get_sheet_values(self, sheetname, includeEmptyCells=True):
my_sheet_index = self.sheetNames.index(sheetname)
sheet = self.wb.sheet_by_index(my_sheet_index)
data = {}
for row_index in range(sheet.nrows):
for col_index in range(sheet.ncols):
c... | 1 |
3243a9c79e8010024d7ebf8673f7e69b | f643ae4799b61c6582c2ee34d5e67367 | Add layer of Dbpedia spotlight annotation on input file. | external_annotations = self._config.src2src.SLP01.external_annotations
if (self._skip_SLP05
or not external_annotations
or not isfile(external_annotations)):
return
input_folder = self._folders['SLP02']['out'] + self._folders['SLP05']['suffix']
output_... | 0 |
ddba03b952706fb31953bafe3670ba49 | 1c6abc671fc5d2410c5470b23bc45b2e | 삭제할 데이터의 노드를 찾고 삭제한 트리를 리턴 | if(node == null) {
return node;
}else if(value.compareTo(node.getValue()) < 0){
node.setLeftChild(delete(value, node.getLeftChild()));
}else if(value.compareTo(node.getValue()) > 0){
node.setRightChild(delete(value, node.getRightChild()));
}else{
... | 1 |
b74baebcff2b4bfb1743b1fd32befdbf | a97d36036dd8670997b6417fc58b2fd6 | 根据获取微博账号昵称,获取oid | class Weibo_Api{
public static function getUidByNick($nickname = ''){
$url = 'http://open.weibo.com/widget/ajax_getuidnick.php';
$param = array('nickname' => $nickname);
$curl_opt_arr = array(
CURLOPT_REFERER => 'http://open.weibo.com/widget/followbutton.php',
CURLOPT_HTTPHEADER => array('Host' => 'open.wei... | 1 |
3971436db2748e34cdeac88c1cbd7220 | 7f179e3ce5dce5400ef0d4442f3dec7b | Get onlineStartDate | public class RoomOutOfOrderPage extends RoomBaseAbstractPage
public String getStartDateValue() {
return getDateValue("from");
} | 0 |
1c80ccc33e3c6c46ea404fd5e5d53bc7 | a5ae2493c5cf1d12abfb5b1be4e51066 | !
@brief DeviceOrientationプロファイルのメッセージを処理する. | {
if (g_fOrientation > (g_fTargetOrientation + 0.05) || g_fOrientation < (g_fTargetOrientation - 0.05))
{
motor_control::NavigationStatus statusMsg;
statusMsg.bNavigationCompleted = false;
g_NavigationPub.publish(statusMsg);
g_bOrientationRegulationActivated = true;
g_bDi... | 0 |
0a23b22cd8095ea1fab37f1b8b9e5230 | 11d2323cc66ca1d61a6a2aa1c7b6f44c | Allows a user to view the school details | class SchoolController extends Controller
public function show($id)
{
$schoolobj = School::find($id);
return view('students.studentshome', ['schoolobj' => $schoolobj ]);
} | 1 |
b6fb9a8f20bc01539b88a268d86e11b3 | acfd4fd75034c19bc0a5df3330e845c5 | 获取IAM用户Token(使用密码+虚拟MFA) 该接口可以用于通过用户名/密码+虚拟MFA的方式进行认证,在IAM用户开启了的登录保护功能,并选择通过虚拟MFA验证时获取IAM用户token。
token是系统颁发给用户的访问令牌,承载用户的身份、权限等信息。调用IAM以及其他云服务的接口时,可以使用本接口获取的token进行鉴权。
该接口可以使用全局区域的Endpoint和其他区域的Endpoint调用。如果使用全局区域的Endpoint调用,该token可以在所有区域使用;如果使用非全局区域的Endpoint调用,则该token仅在该区域生效,不能跨区域使用。IAM的Endpoint请参见:[地区和终端节点](https://... | public class IamClient
public KeystoneCreateUserTokenByPasswordAndMfaResponse keystoneCreateUserTokenByPasswordAndMfa(KeystoneCreateUserTokenByPasswordAndMfaRequest request) {
return hcClient.syncInvokeHttp(request, IamMeta.keystoneCreateUserTokenByPasswordAndMfa);
} | 1 |
066af97169f5ae592590a6ce688490b3 | fe9b538a0b4dddaab4fe9bdbb923f22a | Receives query parameters and gets all the doctors. | public async Task<GetDoctorsResult> GetDoctors([FromQuery] QueryResource query)
{
var doctors = await this.repository.GetDoctorsAsync(query);
var result = new GetDoctorsResult() { ItemsNumber = doctors.Count() };
if (query.Page <= 0)
query.Page = 1;
... | 1 |
075c01a7d26625519129900c7a309728 | 0607100a9ee922a7211729db833a25d4 | 查看博客ID对应的HTML | public class ArticleServlet extends BaseServlet
protected void getArticleHtml(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{
String blogId = req.getParameter("blogId");
String blogIdS = String.format("%05d", Integer.parseInt(blogId));
req.getRequestDispat... | 1 |
985fb2cea66a82c30706483b6a95afdf | 2f8c36e9857c19a7fc5fb8f54f39286b | 数据库连接参数设置 默认连接localhost | $this->host = "127.0.0.1";
$this->username = "wenfei158";
$this->password = "19880517";
$this->dbname = "sharing_information";
} | 1 |
0a7cb587d3ca9eb5ba7073c592a57313 | 1d5d0896c60a89c6f7e3684f8c4cac86 | Применить точки маршрута на карту | {
foreach (var latLng in positions)
{
AddMarker(latLng);
}
ResetAllRoutesAsync();
SetMapBound();
} | 1 |
dd1d3a8d54e6939b80c86d4a9f5196ad | b95b75b351fe4de90bde0fe5a14c345b | Test that the Williams correction is correctly computed. | exp = (-0.11858541225631833, 0.90756579317867436, [], nan)
I = array([7.2, 7.1, 9.1, 7.2, 7.3, 7.2, 7.5])
II = array([8.8, 7.5, 7.7, 7.6, 7.4, 6.7, 7.2])
obs = mc_t_two_sample(I, II, permutations=0)
assert_allclose(obs[0], exp[0])
assert_allclose(obs[1], exp[1])
s... | 0 |
1554e2ee79a65cc62037c14bdc0a87f3 | e7ec6158d6294279bf59b2dcbec2d645 | View for editing cluster. | def edit_team(request, template=None):
context = RequestContext(request)
if request.method == 'POST':
pass
return render_to_response(template, context_instance=context) | 0 |
78e82e86029c68c4580fe8eb047dc3bd | 38a8a71e4d5bdc18d012d7f35045ff83 | Permet de récupérer les objets, renvoi true s'il y en a | class objetManager
function getObjet($id_objet){
$clauses['id_objet'] = $id_objet;
$result = $this->connection->select($this->tablePrefix.'objet',$clauses);
return $this->connection->getAssocArray($result);
} | 0 |
9f9af6afd4596c575d597b4c21bb7d8a | b0bf143fde2317be6fe67a3ca739ecce | Performs Multiplication arithmetic operation between two tensors inplace. | namespace TorchSharp.Tensor
public sealed partial class TorchTensor
public TorchTensor multiply(TorchTensor target) => mul(target); | 0 |
7bd84c15624528ab6f311a42948a9260 | b88ea6096317eab1916221f3ee167989 | Returns the number of geometries in this GeometryCollection. | class GeometryCollection(GEOSGeometry):
def __len__(self):
return self.num_geom | 1 |
7353192c580c077e26fc397e7c42e380 | 9d6b877fb487fd50295e7f1616ef7a95 | Sort about the point cloud center or from a given point
Requires: | self.root = None
self.voxel = voxel
self.pcd = []
self.voxel2pcd()
self.pos = self.get_center() | 0 |
b1d4512d74fa07f71346b219d7e1703a | 2adbdd0faca11c01170261a5cb2a7066 | #我所擁有的任務道具 | class TaskController extends Controller
public function index()
{
$read_Task=Task::where('user_id',\Auth::user()->id)->get();
return view('task.matter_tasks')->with(compact('read_Task','read_Matter'));
} | 0 |
a9642d13434defcd86ca17df95b3e1fc | 41df3ec3861e2f7a1b4a62c688367f08 | Loads a squad dataset (json format) from the given path. | def load_data(path):
with open(path, 'r') as fh:
return json.load(fh) | 1 |
848a91379e1e2d3837cf397d0e3f3591 | 53c15a712a8a314c9fad79f19db5d8bc | Computes number of terms of given degree. | def terms(order, dim):
return int(scipy.special.comb(order+dim, dim, 1)) | 1 |
97842c7fe5f6b13217aeef005f4c6d54 | 60d75e7400bbd8bac3688e79f5ac942b | Clears the data associated with the Profile.
Same as {@link #clearBrowsingData(int[], long, long, Runnable)} with unbounded time range. | final OobNotificationManager notifyManager = mOobManager.getOobNotificationManager(clientId);
notifyManager.clearNotificationProfiles(new OobClearNotificationProfileCallback() {
@Override
public void onClearNotificationProfileResult(final OobResponse oobResponse) {
... | 0 |
35547cff9b0ac6a85d6254bbbe7c6a54 | 62d311cd9d9e728cee4a51e329727baa | Gets the plano_taxa_default of this TaxasRefinanciamentoResponse.
{{{taxas_refinanciamento_response_plano_taxa_default_value}}} | class Servico(DataObject):
def taxaMinima(self) -> float:
return get(self.dados, 'minimum.value', valueType=float) | 0 |
b6d0a642528cb98004d0e01a8fff65e1 | 18717a6a2a35fcb175ad788f2ca92ad3 | draw lives indicator using given icon | public class BoardActiveScreen extends InteractiveScreen
private void drawLives(SpriteBatch batch, Robot robot, int index) {
TextureRegion lifeTexture = TextureConverterUtil.getLifeTexture();
int heartSize = tileDimensions / 4;
for (int i = 0; i < robot.getAmountOfLives(); i++) {
bat... | 1 |
8ddef6fef00f9f13cabc9cb567abd20f | 0250fb9260b20be4d330d6ad3e58b117 | Get the back image from array. | export default class HomeNavigationBar extends Component
getBackImage() {
switch( this.props.theme ) {
case HOMENAVIGATIONBAR_THEME_GREY:
return Images.BtnBackBlue;
case HOMENAVIGATIONBAR_THEME_BLUE:
return Images.BtnBackWhite;
}
return Ima... | 0 |
5e7496d4cd36b512afa4166e61be6e02 | 9f2807feb1d6c9c5e33b824d85919bc2 | 简书转盘抽奖 | {
$now_time = date('Y-m-d H:i:s',time());
$cate_id = $request->input('cate_id');
$cate = LotteryCate::where(['status'=>1])
->where('start_date','<=',$now_time)
->where('end_date','>=',$now_time)
->find($cate_id);
if (!$cate) {
return $r... | 1 |
b511e08d2bb4a3c737a968becd07919d | 2595102ad69fdf3f3e6df5ce11d35776 | 1. 根据配置信息构造所有的组件 | for (String name : AppConfig.COMPONENTS) {
try {
Class<?> clazz = Class.forName(name);
Object object = clazz.newInstance();
if (object instanceof IAppInterface) {
((IAppInterface) object).initialize(this);
}
... | 1 |
badf8aee2c6f835c5776d27f86fcb0a5 | eeb2ed61badc57f7a2f405f87a4d3e4c | Gets the final score from the game level | public class GameActivity extends AppCompatActivity implements Observer{
public static double getScore() {
return Math.ceil((10000 - 10 * GameActivity.intNumMoves)/ 0.03 * GameActivity.intTimeScore);
} | 1 |
a9fbeb5508f6e10b27b58091258df396 | e2997dab4d1ad005b0e705da11e2e3d5 | Returns a deny-all Kubernetes NetworkPolicy. | return {
GroupId: groupId,
IpPermissions: [{
IpRanges: [{
CidrIp: '0.0.0.0/0',
}],
IpProtocol: '-1',
}],
};
} | 0 |
1bc2e57483d2e2ce7910e5917ddc1c1e | ebdc971ab27c5bd2fd28cfea92cd4dde | Set weight fraction of suspension | {
const double value_ = std::min ( std::max ( value , 0.0 ), 1.0 ) ;
if ( s_equal ( value_ , m_fraction ) ) { return false ; }
m_fraction = value_ ;
return true ;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.