query_id
string
corpus_id
string
query
string
code
string
label
int64
b2fc3521664f0acf08047f11adda0d73
511e97de9d2d8493c40650a3ddb56863
Restore the project using the specified path and settings.
namespace SolutionConverterLib public class ProjectConverter : IConverter public bool Load(string projectPath) { if (projectPath == null) { throw new Exception("projectPath can't be null"); } this.projectPath = projectPath; return ...
1
811a1d4df8eef478378a0989331deee4
2f1e8c31dbc1ae16f103f81ab53b9548
说明:本题中,我们将空字符串定义为有效的回文串。
std::cout << "Hello, World!\n"; string s = "babbbabbaba"; Solution so; auto res = so.shortestPalindrome(s); return 0; }
0
df16e8d1d2af04038a8fb8b9ecb6130e
c45182f698ecd3c33bb91065cba8d26e
返回小于key的数量
{ if (root == nullptr) return 0; if (root->key >= key) return countLessThan(root->left, key); int ls = (root->left ? root->left->size : 0); return ls + 1 + countLessThan(root->right, key); }
1
11b051ec82c2b0414d0dc3678fb338d4
3ffee0e7a7fb6d23cad41df2133aba11
Constructs the MazeFile class using deep copies of another MazeFile's data members
m_numSlugs(f.m_numSlugs), m_numMines(f.m_numMines), m_dim(f.m_dim), m_start(f.m_start) { for (int i=0; i< m_dim; i++) for(int j=0; j< m_dim; j++) m_sector[i][j] = f.m_sector[i][j]; }
1
a409221d1c39a6ba374b4cf21469cb47
a2a4d8bc227a04ef3069c1f7245c13c3
Returns whether or not this connection is to a ultrapeer supporting GUESS. Ultrapeer connection supports GUESS, <tt>false</tt> otherwise
public class RouterService public static boolean isGUESSCapable() { return UDPSERVICE.isGUESSCapable(); }
1
3b82361c999641b6d066f5a756084a2b
eb3c31e616d4029e5b2a1725f064dfde
Validates that the argument is a reference to a GCS bucket.
class DeployWithApiTests(DeployWithApiTestsBase): def testRequiresGsStyleBucketUrl(self): self.MakeApp() error_regex = 'argument --bucket: Must be a valid' with self.AssertRaisesArgumentErrorRegexp(error_regex): self.Run('app deploy --bucket=foobar {m}'.format( m=self.FullPath('app.yaml')))
1
692f29de62be21809c4357eac43aa712
b1c607d2a5c42c56d4b60bbf6dc37fc9
解析搜索结果页面,返回字幕信息列表
tarStr = parseHttpResultTJ(tarStr); ArrayList<Movie> list = new ArrayList<Movie>(); boolean ret = true; while (ret) { try { if (tarStr.indexOf(TAG4) != -1) { int start = tarStr.indexOf("href=\""); if (start != -1) { Movie movie = new Movie(); int end = tarStr.indexOf("\" "); S...
0
ac3387deea2eff05d652bea5519e933c
62d84c6d110f58053a12585c6014f73e
Hook at the bottom of the Subscribe section content HTML context: just before the closing of `section.subscribe-line div.container`
class shopEditorhooksPlugin extends shopPlugin public function backendProdLayout(&$params) { $bottom = <<<HTML <script>$(function () { var \$wrapper = $("#wa-app"); \$wrapper.on('wa_before_load', function (e, params) { // called when user clicks on a sidebar link that does not require full p...
0
818cce4a1f4df2f799df1c413200fcec
6f950f177b2e406574d6e55fb0958c1f
Returns the glyph IDs that map to the given ranges of Unicode codepoints. The returned glyph ranges are in the same order as the codepoints.
def save_unicode_categories(filename=None): def gen_ranges(): if not items: return range_code_point = items[0] range_len = 1 for code_point in items[1:]: if code_point == (range_code_point + range_len): range_len += 1 elif range_len == ...
0
9891a04111d64bc1d95e173d77832724
785bb24ec38b0566fa8eede4a1fcefeb
initialize preprocessor
{ type = izanagi::E_PLATFORM_DX9; isPreproc = FALSE; isPreprocShader = FALSE; }
0
cae1bb94404c1873a708d73b1c769c0c
8fc96f280f32d1a454006e70ce3fa486
根据ValueTypeID获取交易规则_取值类型
var objs = document.getElementsByName("chkAllVT"); var curckb = null; if (objs != null && objs.length != 0) { for ( var i = 0; i < objs.length; i++) { if (objs[i].value == valueId) { curckb = objs[i]; break; } } } if (curckb != null) { var cha = curckb.checked; JetsenWeb.Form.checkAllItems('c...
1
7fd5e5c6439044b2f6bb2d995a029ec0
1403faba0035e6280575793662521054
生成一个小于max的随机整数
public class MainActivity extends AppCompatActivity public int getRandomInt(int max) { int i = new Random().nextInt(max); Log.e("tag", "getgetRandomInt 执行了...i=" + i); return i; }
1
d301af0fa5ad0e7a70a72b21b265b4b9
a356f5e27e2c0a8d9127204238168de9
Check to see if DBProxyName property is set
namespace Amazon.RDS.Model public partial class ModifyDBProxyTargetGroupRequest : AmazonRDSRequest internal bool IsSetNewName() { return this._newName != null; }
0
4a100eea7ba217c53f11780560b2bf06
b3d5c4c5544a64edcb58f0ae11439393
Limits the joint states if it goes beyond the joint limits
th, az, ext = [i for i in joint_DOF] ext = min(max(ext, self.extLimits[0]), self.extLimits[1]) th = min(max(th, self.thLimits[0]), self.thLimits[1]) az = min(max(az, self.azLimits[0]), self.azLimits[1]) return [th, az, ext]
1
e5f576a93fbf1d5a1cf7b23491eb6a8e
566368212a7846ec62d08f94f21004b9
从xlsx载入姓氏
book = xlrd.open_workbook('电影.xlsx') sheet = book.sheet_by_index(0) values = sheet.col_values(colx=0, start_rowx=1) print(values) for i in range(len(values)): name = re.findall('[\u4e00-\u9fa5] (.*\(\d.*\))', values[i]) if name != []: dict_name = {values[i]:name[0]} ...
0
ce8f5099163324df265974a51fb74746
1ed2e5b7c933124cff54335c5cfa95fb
This method extracts the text content of a document from the TEXT, HEADLINE and GRAPHIC tags. All tags within these tags are also removed.
if (xml == null) { LOGGER.log(Level.SEVERE, "xml provided to getTextFromXml was null."); return ""; } StringBuffer textContent = new StringBuffer(); NodeList nodeList = xml.getElementsByTagName(TEXT_TAG_NAME); Element e; if (nodeList.getLength() != 0) { e = (Element) nodeList.item(0); textConten...
1
e8cea6736458cb6aee99f8b20b5bb6d1
228784cf7431786b98a2480ee73612de
根据实际获取当前时间的总金币充值额度
{ $rec = sql_fetch_one("SELECT sum(ug) as recharge FROM `pay_gamebar` WHERE `billts`>=UNIX_TIMESTAMP(CURDATE()) and uid=$uid"); if (! $rec) { return 0; } return intval($rec["recharge"]); }
1
8e3914a300c2882f3db11647f153c712
fd8e108139d1ec738a94489a4f6df495
转换成LCD显示坐标,即原点在左上角
displayXY = [] displayXY.append(point[0] + 200) displayXY.append(((-1) * (point[1])) + 200) return displayXY
1
dc3920c013e1fa4c0c0434918d78a347
53ef0b03f47754451e7533d16f116dc3
convert canvas coordinate to cartesian coordinate
const canvasRect = canvas.getBoundingClientRect(); v2_1.setX(((x - canvasRect.left) / canvasRect.width) * 2 - 1); v2_1.setY(((canvasRect.bottom - y) / canvasRect.height) * 2 - 1); return v2_1; }
1
284ecbf207488046c3591eafbc16e535
a63b778ea5faf02492c5b963c74cdacf
マテリアルをJSONエンコードする。
let ret = `{"geometricError":${this.geometricError}`; if (this.transform !== defaultTransform) { ret += `,"transform":[${this.transform}]`; } let sup = super.toJSON(); if (sup !== '') { ret += `,${sup}`; } if (!Check.undefine(this.boundingV...
0
e64cf746e6e9aa11ee443b552b6b1e43
f32b89af1a43d0cbffec4187651666fe
グリッドレイアウト中の各レイアウトの幅指定。12分割のうちcol分割分の幅を取る
$grid_col = array(); $grid_col[1]['lg'] = array(12); $grid_col[1]['md'] = array(12); $grid_col[1]['sm'] = array(12); $grid_col[1]['xs'] = array(12); $grid_col[2]['lg'] = array(6, 6); $grid_col[2]['md'] = array(6, 6); $grid_col[2]['sm'] = array(12); $grid_col[2]['xs'] = array(12); $grid_col[3]['lg'] ...
1
84951747684722f1c1f4c72bb1e937e6
23a2276e7ef42338f3efbb0c41d2b666
选取初始的k个聚类中心; 默认实现为选取前k个向量;
class K_Means_Clustering: def __initial_centers__(self, data, k): cnt = len(data) index = random.sample(range(0, cnt), k) return index
0
4e6ec26d95a9dd66ceed17e76a1315c1
88c41ed3ae62c2d8ea0b37b085dddd4b
修改二级学科
{ $id = $request->input('id'); $inputs = $request->except(['file','id']); $errs = $this->subCheck($inputs,'subject2',false); if(count($errs)!=0) return response()->json(['msg'=>['type'=>'err','content'=>$errs[0]]]); $sub2 = Subject2::find($id); foreach ($inputs as $ke...
1
74d5eabf869aad037b7955f95ffecc80
b4ee62d18868f7747cd70163d2cbeef4
Obtains value of kept simple key.
final class SimpleEntry<K, V> implements Map.Entry<K, V> @Override public K getKey() { return key; }
0
ac00c205382b207794feb5d24ef72bc4
ce53c326840a539d1481b8a7dbe07f69
Change current symlink to recently-fetched repo.
def symlink_current_release(): require('path') require('release') require('server_owner') with cd(''.join([env.path, '/releases'])): try: run_or_sudo('; if [ -e %(path)s/releases/previous ]; then mv -f `readlink %(path)s/releases/previous/` %(path)s/releases/archive/; fi;' % env) ...
1
1abd69b69873dcee698744ace13cb617
0321f74c2d70a42f8d71b2bb8c79fb19
删除字典字典类型,并且清除字典缓存
@Log(title = "字典类型", businessType = BusinessTypeEnum.CLEAN) @DeleteMapping("/clearCache") public ResultVo clearCache() { dictTypeService.clearCache(); return ResultVo.success(); }
1
573f98326e8250e814071eeea71a6057
d811f4d4522d0aff15785f176dec8559
Adds a singleton <see cref="gagvs::ExperimentServiceClient"/> to <paramref name="services"/>.
{ ThrowHelper.ThrowIfNull(services); services.AddLogging(); services.AddOptions(); #if NET8_0_OR_GREATER services.AddMetrics(); #endif services.TryAddTransient<HttpMessageHandlerBuilder, DefaultHttpMessageHandlerBuilder>(); services.TryAddS...
0
1ae0a0d41a22bace33cee749a377f1be
c70c19ae31acf942cca16ffe112430ae
This is a dynamic programming implementation of rod cutting problem.
def cut_rod(p, n): if n == 0: return 0 q = float('-inf') for i in range(1, n + 1): q = max(q, p[i] + cut_rod(p, n - i)) return q
0
e783048c653c08acfb50cb137fcb5b1a
550cb1e2a92455eb5929478e277ee962
Setter to Diameter Header Hop-by-Hop Identifier field.
public class MOVCTAFMMessage extends MessageRecord public void setHLEN(BigDecimal newvalue) { fieldHLEN.setBigDecimal(newvalue); }
0
14c23d437745a4ffeb9e0ea68c06b320
2fefc09b33d890b9df65b0a6b9a8fb96
Removes a database from Stardog, but first checks that the db exists
url = "/instances/%s/databases/%s" % (instance_id, dbname) resp, body = self.api.client.delete(url) check_for_exceptions(resp, body)
0
0d8e9f282230f3dfaac2760ff9e2e08f
60d6c54cf631b1cfe500b174dd27dbea
Get the last connexion of the user.
@SuppressWarnings("JpaDataSourceORMInspection") @Entity @Table( name = "user_profile", indexes = { @Index(columnList = "created"), @Index(columnList = "connected"), } ) public class User @NonNull public Date getConnected() { return connected; }
1
3b6abf0daa219d2597618a0cb31510f7
a5e4a5c127464f8364e8fa0207c0832f
Detect adapter presence on the selected port. the selected port, <code>false</code> if the adapter is not connected.
final boolean[] running = {false}; new Thread(){ @Override public void run() { String res = runShellCommand("getprop service.adb.tcp.port", 0); System.out.println(res); if (res.contains(ADB_PORT + "")) { running[...
1
384ab22cdc007682a534c7b4730437f3
0132d53f87132f3266a1515a5d29e46a
Clicks the templates tab within the general settings.
class WebNativeDatabaseSteps: def click_new_template_link(self): self._webnative_database.click_new_template_link()
0
86a4763bf0c240e327c20bb6e1fac0a3
e5127c30ad555168fb255df6ee6d931d
##### REFERENCE START - Code written based on example code "Inputing numbers directly, version 1:" from http://augustcouncil.com/~tgibson/tutorial/iotips.html#directly ###########################################
{ String url = "http://api.asksensors.com/write/"; url += apiKeyIn2; url += "?module2="; url += value; url += "&module3="; url += value; ask.begin(url); int httpCode = ask.GET(); if (httpCode > 0) { String payload = ask.getString(); Serial.println(httpCode); ...
1
9fd8c587bf65b5bf3ca54030a82f6dc2
a2907e24efca46ffe5da4789d914b5ef
Prompts user to enable Bluetooth or deactivate OBS. Gets called, if OBS is enabled in the settings but Bluetooth is disabled, so SimRa cannot connect to OBS.
public class SetupActivity extends AppCompatActivity private void askEnableBluetoothDialog() { boolean response = this.bluetoothConnection.requestBluetoothActivation(); if (response) Toast.makeText(SetupActivity.this.getApplicationContext(), "Done!", Toast.LENGTH_SHORT).show(); }
0
36cf703e8d36e6b34fa4c7f01f1ae32b
4a29d9552efa193b00befbb376e10ba7
判断两个数是否能除尽
def a(x, y): if x % y == 0: print("%s能被%s整除" % (x, y)) else: print('%s不能被%s整除' % (x, y))
1
a9556ec5e2687c57d32cf20bd67d03e0
8a8d8053739c840848c33130393d4b45
@brief Set the number of tuples in this table
{ if (this->num_gid_entries > 0) { this->num_gid_entries = num_gid_entries; } if (num_lid_entries > 0) { this->num_lid_entries = num_lid_entries; } }
0
7036cd3c70b8e9714166931885686a42
5600aabf19da22d52904b9ed9dbd1aa6
either a visible layer or must convey a visible link
return super.isVisible && (this.layerIn && this.layerIn.isVisible || this.conveys && this.conveys.isVisible); }
1
a3bb21b377649f2e58c99dd1f2ca02f1
dfbf2306a96271277b215bd2004af7a4
获取与该日志相关的所有评论
$logContentList = $this->where("log_id = '%d'", array($logId))->select(); foreach($logContentList as $key => $value) { $logContentList[$key]['key_comment'] = $fields[$value['tb_key']]; } return $logContentList; }
0
55ac9ab9dca12ba0d5f40b4b0da26f45
ce96990fdfc6dcaa8a98c682f00d4c3f
Validates a Filter for all Tenants.
namespace Microsoft.Azure.PowerShell.Cmdlets.Subscription public partial class Subscription internal async global::System.Threading.Tasks.Task SubscriptionPolicyGetPolicyForTenant_Validate(Microsoft.Azure.PowerShell.Cmdlets.Subscription.Runtime.IEventListener eventListener) { using( NoSynchroniz...
0
865cd6796e78b472b5b5718e16a43327
3f09f702db3be6dd1c6b5d4811852abe
初始化数据,因为是在attach里调用的,此时界面尚未切换到该容器。 因此如果要在viewpager场景实现懒加载,应该调用setUserVisibleHint
super.setUserVisibleHint(isVisibleToUser) if (isVisibleToUser && context != null && PrefUtils.getBoolean(Constant.IS_TAB_CONTENT,false)!!){ initData() PrefUtils.setBoolean(Constant.IS_TAB_CONTENT,false) } }
1
3a5e89c3443d1877f85318011dd23756
4a5a00de0ec5eb8defcd5335ce043a15
Returns the singleton object of the detailed router.
function getRouter() { return Utils.copy(lastRouter); }
0
7692a91fa8eae4722bd0797f915e6c49
3cdedadd19ff3428ef5a1fd7b3467e37
강의 번호를 이용해서 강의 정보를 가져오는 함수
class userDB_Adapter_Timetable(mContext: Context) fun getLecture(lecture_name:String) :String{ val selectSql : String = "select * from lecture where lecture_name = ?" val cursor: Cursor = db.rawQuery(selectSql, arrayOf(lecture_name.toString())) var disp : String = "" var rowdata : String...
0
8eac4be3e7a17acd4542b33abe18a67e
6aeac034ccf3907cdb0d897405f46fad
Normalizes the angle two be between [-180, 180].
def normalize(angle): return angle + (2 * np.pi) * np.floor((np.pi - angle) / (2 * np.pi))
0
fee2b5dc3b2f8a69779c04fada89bc87
76bd62dd1ad2e05ed3a6e1b974661984
设置每一个方块的运动方向,让每一个方块的运动方向和前一个方块的一致
void GameScene::moveBlock() { vector<kBlock>::iterator it1 = blockTypes.begin(); while (it1 != blockTypes.end()) { list<int>::iterator it2 = m_blockTags[*it1].begin(); while (it2 != m_blockTags[*it1].end()) { BlockSprite* blockSprite = (BlockSprite*)m_background->getChild...
0
4c79877178a1fb897bd0ab044be33210
27df4826d287ea7a8c1ab9a270481fe3
Send a transaction for calling a smart contract's method
public CompletableFuture<TransactionReceipt> sendTransactionAsync( String to, String abi, String functionName, List<Object> params, RemoteSignCallbackInterface remoteSignCallbackInterface) throws ABICodecException;
1
9decb667efe31bf7235f0a019b6724f5
d91ee33401521ebfcfe0da69c0d9fdcf
自定义错误处理,收集错误信息 发送错误报告
function customError($errno,$errstr){ echo "errorNumber:".$errno."message:".$errstr; echo "end Script!"; error_log("errorNumber:".$errno."message:".$errstr,1,"764670547@qq.com","764670547@qq.com"); }
1
deb68e11a81a0ceaaf8de50f095d0d02
61fbad1f3dfae822c8f5274a81ce1e90
执行stateOperation所指定的操作后,决定是否唤醒本Broker所暂挂的所有线程
void executed(QueueShardId shardId, QueueLocation location, boolean taskProcessed, long threadBusyTime);
0
167a182a9f41d2dfacb9c2c9ba20a252
2546566ef0e5dc3e0849bed5a3194093
sert à formater les attributs
class EsoterDefineForm extends CFormModel public function attributeLabels() { return array( 'rememberMe' => 'Remember me next time', 'porteurDNS' => 'Nom de domaine', 'porteurAlias' => 'Raccourci Porteur', 'porteurName' =>'Nom du porteur', 'isoterFileMappingPR' => 'File Prospet OTRS ', 'isoterF...
1
af15cff3dcf0529a5ddb1783bcda8878
36dcb35837d0b121607dcef51aa3429a
Edits borrowed book record
{ OleDbCommand cmd = new OleDbCommand( ); cmd.CommandType = CommandType.Text; cmd.CommandText = "update Book set ISBN = @ISBN, Title = @Title, Author = @Author, Genre = @Genre, Pages = @Pages, Lended = @Lended, FriendName = @FriendName, Comments = @Comments where ISBN = " + isbn; cmd...
1
2527ecff73937d3794d7f800496d9d2b
2dff357709893b9c281ddfc605df0805
绑定教育经历
$openid = $this->input->post('openid'); $school = $this->input->post('school'); $background = $this->input->post('background'); $department = $this->input->post('department'); $profession = $this->input->post('profession'); $start_year = $this->input->post('start_year'); $end_year = $thi...
1
a8cb153bae5f2c06f5a73ac67c5bb7ad
a927401fc16e6b2ddd05fc6e22603b7f
获取配置,并组成key-value数组
$objs = $this->all(); $cfgs = []; if($objs){ foreach($objs as $obj){ $temp = $obj->getData(); $cfgs[$temp['name']] = $temp['value']; } } return $cfgs; }
1
ccca26d1e29cf2add115120e2cf20528
783d7e7129355c1712a03f1609b2a688
通過courseID查詢成績
Course queryById(String courseId);
0
4bc417ce47ad15ba09d9a2d97db3c2ae
4983c8fed23b22d9c5e46868152843fc
Manage Hosts Role: All local users - Map User Purpose: Checks that you can map a user with the current role Tags: software Requirements: MCU Installed Component: manageHosts role
$this->get('http://www.ug.it.usyd.edu.au/~dbro8182/lnm/'); $this->setField('username', 'admin'); $this->setField('passwd', 'admin'); $this->click('Submit'); $this->click('Conflicts'); $this->click('Home'); $this->assertTitle('Administration :: Local Network Monitor'); $this->click('Conflicts'); $this-...
0
a8489643473239e5171388c8815b0798
6ccf6495136267f34ae06d83eef89ce0
This method only asks the computer to shutdown, this doesn't force it to stop. if the computer has crashed this method will not be able to stop it!
fun shutdown(context: Context) { val intent = Intent("android.intent.action.ACTION_REQUEST_SHUTDOWN") intent.putExtra("android.intent.extra.KEY_CONFIRM", false) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK context.startActivity(intent) (context as Activity).finish() }
1
032a744b1ba4f3791832af15c27dab33
bd3f2f50952c083fea915ec5f5090b01
根据id更新Letter
class Billomapy(object): def update_letter(self, letter_id, letter_dict): return self._create_put_request( resource=LETTERS, billomat_id=letter_id, send_data=letter_dict )
1
52ef26ea5a7871323aa7449a00e61281
bd6eab824777ac8654dbf5e29d1ee78f
Get adults
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-12-27T12:15:25.449Z[GMT]") public class HotelAvailabilityRequestOccupancies @Schema(example = "1", description = "") public Integer getAdults() { return adults; }
1
264c1cfdc741253e5ccfea411e990d73
a39222123357f77ee193b4622cd1cef4
现有鸡蛋,当前楼层:至少扔多少次才能确定导致碎的楼层
class EggDrop int findDeathFloorForEgg2() { int middle = MAXIMUM_FLOORS / 2; int right = MAXIMUM_FLOORS; int left = 1; if (isBrokenEgg(1)) return 1; if (!isBrokenEgg(MAXIMUM_FLOORS)) return -1; do { if (!isBrokenEgg(right - 1) && isBrokenEgg(right)) return right; if (!isBrokenEgg(right - 2) && isBrok...
0
22e9313f716857027c09992e6a60ad1a
7b5aa5c79b900328626b97f086767007
Establece los campos y botones de la ventana para crear un nuevo producto.
{ dgvProducts.ClearSelection(); txtName.ReadOnly = false; txtUPC.ReadOnly = false; cbxSelectDepartment.Enabled = true; cbxSupplier.Enabled = true; nudSell.ReadOnly = false; nudBuy.ReadOnly = false; btnSubmitNew.Enabl...
1
8ac9fa42d7e100cb0e4ef02d928f65cf
f5483b4080c775fd945cde396cf06da0
Get the Signature of apk file which is not installed.
val pm = mContext.packageManager val apps = pm .getInstalledPackages(PackageManager.GET_SIGNATURES); val iter = apps.iterator(); while (iter.hasNext()) { val info = iter.next(); val packageName = info.packageName; if (packageName.equals...
0
c31d4f1a3135ee7fd50c30573c3076d5
4fefb450dace3aad9bef924fa1fddcd8
Método para impedir cadastros de vendedores com cpfs repetidos
class Consumidor extends AppModel function validateCpfProibido() { $this->Funcionario = ClassRegistry::init('Funcionario'); $this->Funcionario->recursive = -1; $this->Promotor = ClassRegistry::init('Promotor'); $this->Promotor->recursive = -1; if ($this->Funcionario->findByCpf($t...
1
38ef89d3cb7f649260166c58edb8d6c6
9934bdcc34329cdb39369636cf1d7f42
Stability selection for binary or multi classification problem with randomized logistic regression.
lower=None, upper=None, loss_metric='mse', alpha=0.5, cv=None, class_weight=None): super().__init__(lower=lower, upper=upper, loss_metric=loss_metric, ...
1
afc9fb3c2fbabc9fccc8cd2de2c50e4e
1519ada3e2af02260c41bfad3ab111be
Reads a null flag.
{ FormatCode formatCode = AmqpEncoding.ReadFormatCode(buffer); if (formatCode == FormatCode.Null) { return null; } return BooleanEncoding.Decode(buffer, formatCode); }
1
27b8516165398838c943936971dc01a3
c53661f09476e45f780fc6f1f5fd394e
Kiszámolja egy pont 3D koordinátáit a torzított képeken kiválasztott pontokból.
{ return new Point3d( basePoint.X + (distance * Math.Cos(angle)), basePoint.Y + (distance * Math.Sin(angle)), basePoint.Z); }
0
c69db29b743a8edcf1ba8be09ed1613a
c39d63196b95f481c830cf0222f006b2
删除给定值的所有节点
{ for (PNode node = head; node; node = node->next) { PNode nextNode = node->next; if (nextNode->value == value) { removeAfter(head, node); break; } } }
0
ab6dfbd0d4c9e49466d96b50a8914e49
4a1b378ab5b78acb693b3bc2135bdff8
Converts string into Integer(int). Returns 0 if conversion fails.
try { return Integer.parseInt(intString); } catch (NumberFormatException e) { return 0; } }
1
66614ed4fd4e0f61aca2d6e12ee9c7bb
da23551d44a2128e56330e0eef99cf10
Invoke the view source dialog box
partial class MdiBrowser : Form void ViewSourceOnClick(object objSrc, EventArgs args) { BrowserChild bc = ActiveMdiChild as BrowserChild; if (bc != null) { Form frm = new Form(); frm.Text = bc.WebBrowser.DocumentTitle; TextBox txtbox = new TextBox(); ...
1
7c82d2d9cf6f577cfd1fee9993e0faa7
079f697f7db7d6ac20efb489f9caffd9
向服务器同步场景
@PostMapping("api-v1/sync") public String sync(HttpSession session) { Viewer viewer = (Viewer) session.getAttribute(Constant.roomInfo); return progress.sync(viewer.getRoomNum()); }
1
860f2308f2a303dfef44420d39da6a62
b546365d35e5172dbe7b0d22d642a40f
Returns the first module in the ordered set where userId = &#63; and groupId = &#63;.
@Component(service = EcmsGURelationPersistence.class) public class EcmsGURelationPersistenceImpl extends BasePersistenceImpl<EcmsGURelation> implements EcmsGURelationPersistence @Override public EcmsGURelation findBygroupUserId_First( long groupUserId, OrderByComparator<EcmsGURelation> orderByComparator) thr...
0
626f6a3ce5f1099ac5c6056de9bcdc76
5b1d892114ecd728d2b0579da3931444
Fits linear dynamical system to observations y with expectation-maximization
def estimate(niter: int, y: np.ndarray, x: np.ndarray, load: HyperLoad, emit: HyperEmit) -> Param: init = np.random.standard_normal((y.shape[0], x.shape[0])) init_eta = init, init, np.ones(2) return em(niter, (y, x), (load, emit), init_eta, eval_logobserved, estimate_eta, estimate_theta)
1
43e3fab09dffba8975d022fd8ee2643b
6deba4b68d7bff2afaf5d150abb32dd6
Get all driver as list of Driver objects or dictionaries. Optionally filter the drivers by specifying filters.
begin_date: datetime.datetime = None, end_date: datetime.datetime = None, index: int = 1, num: int = 20, can_json: bool = True, reverse: bool = True) -> dict: filter_dict = dict() if driver_name is not None: filter_dict['driver_name'] = driver_name if status...
1
901c4c8c4ec1b85219ef92178fb29566
05060892b546a2135c1cb0c4e6b8cdbb
Set up runtime-error variables
{ $this->runtimeException1 = new stub1RuntimeException('message'); $this->runtimeException2 = new stub2RuntimeException('message'); $this->runtimeException3 = new RuntimeException('message'); }
1
77e47f6d4cc4fb912291944ef319f4f1
072c7af3045fbed22266ff885a517ccf
@brief Flash alignment for the flash start address.
uint32_t flash_get_start_address(const flash_t *obj) { return FLASH_START_ADDR; }
0
62023e4743b53de125a0296678030de9
d7aad5aaa4ea21e2448d3b4eaad2c3a5
Gets the instance of the implementation of IConfiguration.
namespace Raven public static class ServiceCollectionExtensions public static IConfiguration GetConfiguration(this IServiceCollection services) { return services.GetSingletonInstance<IConfiguration>(); }
1
c4be422779097a2862cbd331da623735
248ab7a8fe6d77c0e0cbf25687efbe4a
Return numpy matrix from fits file fits_file_name
def read_fits_data(fname): hdulist = fits.open(fname) hdulist.verify('silentfix+warn') return hdulist[1].data
1
458aaeff9039985931dd33f4bf27aefa
96773182103cf7743afca07162279d54
Returns a handle to an instantiated tile, or null, if one was unable to be spawned. Takes a tile object to spawn, the rotation to orient it, and the grid location to place it.
namespace CivModel TileObject CreateTileObject(Player owner, Terrain.Point point);
0
de4b485b9d20f0bbb36fe573b93eb1ba
677ab862543b02dcfda824006893366e
Exit a parse tree produced by {@link DRL8Parser#classType_lf_classOrInterfaceType}.
public class Java8BaseListener implements Java8Listener @Override public void exitInterfaceType_lf_classOrInterfaceType(@NotNull Java8Parser.InterfaceType_lf_classOrInterfaceTypeContext ctx) { }
0
c0f68211328eaf64421ed9f44d06d5ca
bff5c813255ed20e7a9a824a14dfe3ff
Re-align the ink bar to the selected tab element
export class SpotlightHeaderComponent implements AfterContentChecked, AfterContentInit, OnDestroy public ngAfterContentInit() { this._alignInkBarToSelectedSpotlight(); }
1
c03e632e03158258e184e1618cf62d4c
27139061924fd620caf2ea9d1ef2a57c
:keyword sync_type: Field indicating sync type e.g. to sync only in case of failure or in all cases. Known values are: "Default" and "ForceResync".
if isinstance(sync_from, str): sync_from = uint256(sync_from) request_model = SyncRequest(sync_from=sync_from) self.get(request_model, **kwargs)
0
51a38149414734b98bfe01bd60c31d5a
a5118155fd51d4b72076698652261b62
מגלה מה התשובה הנכונה שנבחרה בשאלת ריבוי תשובות
function answerGiven(ev) { const el = ev.target givenAnswers[parseInt(el.getAttribute('questN'))] = parseInt(el.getAttribute('answN')) for (const answerDiv of el.parentElement.childNodes) { answerDiv.classList.remove('givenAnswer', 'correctAnswer', 'wrongAnswer') } el.classList.add('givenAnswer') }
0
bac4196c779e2dd6bcb98302811c1055
f51498995b1f6f2d976afc3c1c9982de
Find all child segment with the given name
Layer::childNodesWithName(const std::string& name) const { vector<ARC<Node>> result; for(auto obj : _children) { if(obj->name() != name) continue; result.push_back(obj); } return result; }
1
20f904fee01930a7b95211c51ed7b5cf
d0b35d8e79049f82b43f2637a27b4080
Mocks /profile/meta response
result = client.call_endpoint( url="/realm/profile_fields", method="GET", ) validate_against_openapi_schema(result, "/realm/profile_fields", "get", "200")
0
0787461e138a810d4c86951f0161f157
e649103b4b678d680160e8c6e4d17920
12201802: Event 12201802
def Event11210830(): IfFlagOn(-1, 11218990) IfFlagOn(-1, 11218991) IfFlagOn(-1, 11218992) IfFlagOn(-1, 11218993) IfFlagOn(-1, 11218994) IfFlagOn(-1, 11218995) IfFlagOn(-1, 11218996) IfFlagOn(-1, 11218997) IfFlagOn(-1, 11218998) IfFlagOn(-1, 11218999) IfConditionTrue(0, input_...
0
df7aaa2e39eb32c9db8f4d99c61e0cdc
5233dddd81e226ee776bb9183dc4116a
functions =======================================================
pub fn function_definition(input: &str) -> IResult<&str, Node> { let (input, _) = tag("fn")(input)?; let (input, _) = multispace0(input)?; let (input, name) = identifier(input)?; let (input, _) = multispace0(input)?; let (input, arg) = arguments(input)?; let (input, _) = multispace0(input)?; let (input, _...
1
593e151b3f399d12ac87ba4077303812
310d371c280f13cd044b971bf0215f9c
Simulates telemetry output from a point-of-sale machine in an ice cream shop. Sends temperature, humidity, and number of purchases data as a json string to the given IoT Hub client every second endlessly.
public class Main private static void sendTemperature(final GatewayCloud gatewayCloud) throws IOException { ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); executor.scheduleAtFixedRate(new Runnable() { @Override public void run() { try { gatewayCloud.send(ObjectFact...
0
181c6e140c8bfba0891aae8f034a6519
e39184e6ed29d7645032e408cfe6fb61
Compute the haversine distance on unit sphere. Inputs are in degrees, either scalars (with ops==math) or arrays (with ops==numpy).
def haversine_dist(lat1, long1, lat2, long2, earth_radius=6371000.0): lat_dist = lat2 - lat1 long_dist = long2 - long1 a = (np.sin(0.5 * lat_dist) ** 2 + np.cos(lat1) * np.cos(lat2) * np.sin(0.5 * long_dist) ** 2) angular_dist = 2 * np.arctan2(np.sqrt(a), np.sqrt(1 - a)) return earth_radius...
1
35efae1dd93e58b1855ed55b69e9e45a
d963a61d3af85457f9ae357f5326125a
Returns a list of all app domains for all apps of the current user.
public class ALPreferenceManager extends ALModule public List<String> getDomainList() throws CallError, InterruptedException { return (List<String>) service.call("getDomainList").get(); }
1
c28c0d6910f944f42d17a1f544b80aeb
0215aa3bf903c0f4640af484a25ee724
Frees a block of environment strings. the block must be obtained by calling the GetEnvironmentStrings function.
interface Userenv : StdCallLibrary fun DestroyEnvironmentBlock(lpEnvironment: Pointer): Boolean
1
5cf623a5de21390227f9ff06f17f90e5
467e2cf104994677c1b1658068ccce0f
Handles the Click event of the gIncludedAttributesEdit control.
{ try { this.EditEnabled(); this.DisableHeaderControls(false); } catch (Exception ex) { ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm); } }
0
6cb67424072591d264788c9a7c45efe2
9870b0f7da50a52b354c6e59f3fd0c80
Enable autolock.
auto_plist = '/Library/Preferences/com.apple.timezone.auto.plist' cmd = ['/usr/bin/defaults', 'write', auto_plist, 'Active', '-int', '1'] subprocess.check_output(cmd)
0
b60049d95b7a53744b7366b7c7f22200
cff0ab77121856277d7b8e04a244ee68
calculates the hour angle of sunrise
def get_hour_angle_sunrise(declination: FlexNum, lat_r: FlexNum): d = radians(declination) lat = lat_r hour_angle_sunrise = degrees(arccos((cos(radians(90.833)) / (cos(lat) * cos(d)) - tan(lat) * tan(d)))) return hour_angle_sunrise
1
6feb681c0e53c1d5c04d2fd533ed3aab
f8bbc7ccc8cbf6ce9432644ac8c4dda0
Get the default theme value for this preference.
public abstract class ThemePreference<T extends DynamicAppTheme> extends DynamicSpinnerPreference implements DynamicThemeResolver<T> public @Nullable String getTheme() { return mTheme; }
0
4a0c700a94f18eef4747a4d543ae0533
439add02a14560854e4bef6ee2f5cb7b
通过编码或名称模糊查询异动来源类型信息列表
List<AqxjXjflInfo> selectAqxjXjdflList(Page<AqxjXjflInfo> page, @Param("condition") Map<String, Object> condition);
1
f76898c9e0ca425f9a707a0c936a82ea
53f560f73c69fbb8e1f6dd6cb6bd15ae
현재 시간을 시분초(HHMMSS)로 변환
Calendar cal = Calendar.getInstance(); String ret = cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND); return ret; }
0
6de4cf7806723911f5694110de1fd16c
3b63df0770f5cf7b9572ab7b025754b5
Saves graph coordinates for (row, index) elliptic curve point. A point which has been saved one time can't have it's graph coordinates changed afterwards.
def cache_coords(node_key, x, y): NODE_COORDS_CACHE[node_key] = (x,y)
1
249f9ba0f4ffc98e91eb8aba09a2d312
83edd90d6e7d93cc6bd6ffda07afb4b6
Generate a unique IP address within the virsh DHCP scope.
if FLAGS.use_single_default_gateway: return '%s,%s.%s,%s,%s' % (data['vif_address'], data['instance_hostname'], FLAGS.dhcp_domain, data['address'], 'net:' + _host_dhcp_network(data)) ...
0
2197e167df498297613da54f282d4b81
edf97aaa74b7e02320a0da1b5c108d68
获取训练模型中所有节点的名字
def get_node_type(model): op_name = [] for i in range(len(model.graph.node)): if model.graph.node[i].op_type not in op_name: op_name.append(model.graph.node[i].op_type) return op_name
0
0a8f76308c69a6afdabb99ba39b2766b
cc42898ff5da3627a5422aeb65d5b44e
Sorts query terms by increasing document frequency.
std::sort(query_lexeme_ids_.begin(), query_lexeme_ids_.end(), [=](const unsigned int& id1, const unsigned int& id2) { return lexicon_->GetLexemeById(id1).doc_frequency < lexicon_->GetLexemeById(id2).doc_frequency; } ); }
1
a7455fc68e3cfeac27a82ebb85d3d441
87d5bf9b84135653ddcaf4af92dcfbce
Handles the user interface of selecting the size of the boats
public class mSizeDialog implements ActionListener @Override public void actionPerformed(ActionEvent arg0) { final JDialog sizeDialog = new JDialog(); final SpinnerNumberModel xSi = new SpinnerNumberModel(parent.getmIval(),3,20,1); final SpinnerNumberModel ySi = new SpinnerNumberModel(parent.getmJval(),3,20,1); ...
1
ba7433ad013a95fac819e66d4964f33a
d41b93a9437a62c01056dee506f9bda5
Calcular el area del terreno
def calcularArea(B,b,h): area = ((B+b)*h)/2 return area
1