query_id
string
corpus_id
string
query
string
code
string
label
int64
18973ac98361c710b1c6c7e4f6035134
613fd9c4b1b72a61dd55c0059d0af6a3
Reports whole-system, average cpu usage.
class OverallSystemUsage(ProfilerRuleBase): def __init__(self, scan_interval_us=60 * 1000 * 1000): validate_positive_integer(self.__class__.__name__, "scan_interval_us", scan_interval_us) super().__init__(scan_interval_us=scan_interval_us)
0
6c822043b87edfbb8a6fe4dce93c1e01
878716825aebf2404bcd5aed10a99a2e
GET: TicketModels
{ Mapper.CreateMap<Ticket, TicketViewModel>(); var ticketViewModel = Mapper.Map<IEnumerable<Ticket>, IEnumerable<TicketViewModel>>(_ticketApplicationService.GetAll()); return View(ticketViewModel); }
1
e6f17fc21f7935f6712b250c8f6c4955
6dcee39a1e6b8a685919a8cbf04c22b5
Physical device name (e.g., 'r1mx960wf') on which subscriber is defined
class CustomerGatewayArgs: def device_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "device_name")
1
253b32e56c7e6ef6ce31563665af12d1
04c18b6644fe874a41c10347d517b7a5
处理login返回来的authorization,登录以后缓存用户的校验码
String mdk = MD5.mkMd5(usr.getIdx()+"!232%948394jfke"); RedisUtil.getInstance().setEntity(mdk, usr, 24*60*60, 0); session(GlobalSetting.Session_User_Id, mdk ); SecurityUtil su = new SecurityUtil(); su.doAuthorization(SysUserService.getInstance().findSysFunctionsByUser(usr.getIdx())); String authorizationUs...
1
59dc74ed7f22969509c970f52266d982
442e3caee3ab74f69a60b51fe2bab4a6
Build Json for requesting CloudVisionAPI
var requestLayers = []; for (let layer of layers) { switch (layer.type) { case 'tiled': requestLayers.push({ type: 'http', options: { urlTemplate: layer.options.urlTemplate } }) break; case 'CartoDB': ...
0
94149577a89d53d2d5aa8ed56ed08054
8a3e9fd3a00798c3d0ce95ef49a53f10
convert predecessor indices to shortest paths
void my_graph::ancestor(int i){ for(int k=2; k<20; k++){ P[i][k]=P[P[i][k-1]][k-1]; } }
0
8dca9fed505495072bc0c3b5aa54a359
04b889eb845ee186e61d6e9c1dbfbded
Returns the consolidated health of the input player
int howHealthyIs(DracView currentView, PlayerID player) { return currentView->healthPoint[player]; }
1
cbdbfe32cf2b78bfc453677b57bfc572
c84d5472ff2f2799f333ada145a471de
An initial parameter guess for models fit on ``lr_data``, ``svm_data``. The guess is drawn from a multivariate normal distribution with zero mean and identity covariance. The vector returned by :func:`data_x0` is the weight vector with the intercept concatenated to the end of the vector. This fixture may also used as t...
b_init = np.ones(len(datasets_sizes)) a_init = np.ones(len(datasets_sizes)) c_init = np.ones(len(datasets_sizes)) x0 = np.zeros((sum(datasets_sizes)+3*len(datasets_sizes)),dtype=float) x0[sum(datasets_sizes):] = np.concatenate((a_init,b_init,c_init)) return x0
0
6dba17f06b49f9177c567aee882f43e4
1d89aa037ddebca346431547a0baadea
Creates an array of webpack `module.rules` according to the current settings such as the environment.
{ let out = {}; _.each(this.entries, (arr,name) => { let middleware = []; if (name !== 'vendor') { if (this.devMode) middleware.push(`webpack-dev-server/client?${this.sourcePath}`); if (this.hmr) middleware.push("webpack/hot/dev-server"); ...
0
0cd41f489ba44d70f9a14f1706fd88ac
2b5fe7d362efee7e65b4449dbefca380
当身份证号码为360428190808036111的时候,被测试方法返回true
func TestValidate(t *testing.T) { if !Validate("110101199003078216") { t.Error("test fail") } }
0
108a5bebb04dd9591a637e4dfb323626
e65a6522cc09407385cf4dc409d96f59
Display the number of bunnies on screen.
namespace _05_bunnies class Program static void Main(string[] args) { Console.WriteLine(NumberOfEars(33, 2)); Console.Read(); }
0
373ef61f655abda84ed740ec34c2c734
e1eac9db94327b97117206296eab7cd9
Renew an existing SSL.
return this.client.sendLRORequest( { fabricName, renewCertificateParameter, options }, beginRenewCertificateOperationSpec, options); }
1
a9746d698f0eca5b3334c91d413d26b5
d1ed33414956a768bbcc272869ae6098
Remove any key whose value indicates null.
return { key: value for key, value in dictionary.items() if value is not None }
1
5885f26b7e8e9cf3455eca3b0bade947
9e9510fa56f70a8a47aefc7a692806d2
Update order_total on lineitem delete
def update_on_delete(sender, instance, **kwargs): instance.order_id.update_total()
1
852507c4296182af1e1c9bce13fc258f
5dadd5b504573a25d65210f00ca54108
<para>Добавляет в базу коллекцию Repairs</para>
namespace FAMIS.Controllers public class RepairController : Controller [HttpPost] public int Handler_InsertRepairList(String data) { if (!commonController.isRightToOperate(SystemConfig.Menu_ZCWX, SystemConfig.operation_add)) { return -6; } ...
1
b6f6fd81a388900e568394c7293d1cbb
f08cb89efa62272bc9f24959af056b53
Copies a random number generator (a list of rngs). Should be deep.
def copy_list_with_rand1(head): map = ChainHashMap() cur = head while cur is not None: map.__setitem__(cur, Node(cur.value)) cur = cur.next cur = head while cur is not None: map.get(cur).next = map.get(cur.next) map.get(cur).rand = map.get(cur.rand) cur = cur.next return map.get(head)
1
a5c4972d8220da3e1f001959ea4ccd23
56cc4aee7aab184b2f696b27484febe1
Shows or hides the profiler display.
{ if (!lblDisplay) return; if (!isRecording) lblDisplay->setVisible(true); else lblDisplay->setVisible(!lblDisplay->isVisible()); }
1
be08e0740f5d0651c61351e29acfce03
0f1cc6517876dcf16e7b2929103c8c1c
deletes the communication pointer which is set in each node
MPI_Comm * pcomm = (MPI_Comm*) comm; if (ref != 0) { ref->DecreaseRef (); if (ref->GetCount () == 0) { MPI_Comm_free (pcomm); delete ref; }; }; delete pcomm; comm = new MPI_Comm; *((MPI_Comm*)comm) = *((MPI_Comm*)_comm); ref = 0; procGroup = -1; procNumber = -1; procIndex = -1; }
1
30ff429e014c3e5e952e5f2d6ae2c2e3
c2f01ca262e86bc98d3b572adad59e89
Enables or disables "details" display mode. This function has effect to fdisk_partition_to_string() function.
const char *command, const char *message) { if (sd->status.option & OPTION_HIDE) { sd->status.option &= ~OPTION_HIDE; clif_displaymessage (fd, msg_table[10]); } else { sd->status.option |= OPTION_HIDE; clif_displaymessage (fd, msg_table[11]); ...
0
c2f7d843b6e4fecf718adbcf986c1436
f8f5afbb3799f2f25569429bdd217c27
Testing valid validator_registry transaction.
kwargs = dict(id_user=1) mock_make_transaction.return_value = [] result = registration.Registration.save_data(**kwargs) nt.assert_true(result)
0
b22aa5ce1967fae5dc271308af133127
a48c1b72975764b99d653a650ed049be
Is Buffered Mysqli Result? Unbuffered If client memory is a short resource and freeing server resources as early as possible to keep server load low is not needed, unbuffered results can be used. Scrolling through unbuffered results is not possible before all rows have been read.
{ zval *zres; struct php_sqlite_result *res; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zres)) { return; } ZEND_FETCH_RESOURCE(res, struct php_sqlite_result *, &zres, -1, "sqlite result", le_sqlite_result); RETURN_BOOL(res->nrows && res->curr_row < res->nrows); }
0
fa891cb057ad169182f367cd86f08404
e08fd0080ae5bdb23d75b9a4c72d8777
Checks to see if the statement contains ORG.
boolean isOrContains(Subject s);
0
a9ddf8dfddfd3c21b272f762cf2354bf
f5fda2f1f08754f580ca8627040833f5
Chain two functions (`g ∘ self`) # Examples: ``` use fntools::unstable::FnExt; let add_two = |a: i32| a + 2; let add_three = |a: i32| a + 3; #[rustfmt::skip] let add_eight = add_two .chain(add_three) .chain(add_three); assert_eq!(add_eight(4), 12); ``` For more info see [`chain`] [`chain`]: crate::unstable::chain
let Chain { f, g } = self; (f, g) }
0
f1647140ce862656cfa45b106da49a2f
999771f50ae446640e22ffec60977ae0
自动生成基站数量和坐标
building_size = [10, 10] x_buildings = [] y_buildings = [] while len(x_buildings) <= self.initial_building_num: x_building = np.random.uniform()*200 -100 y_building = np.random.uniform()*200 -100 if len(x_buildings) == 0: x_buildings.ap...
1
e3c2b21b1e7ecd51f36526ef6e80f62b
07bdefa78394980638f3d3cdafd44bb6
D. Descending Sort
def foo(a): for i in range(len(a), 0, -1): for j in range(1, i): if a[j-1] > a[j]: a[j-1], a[j] = a[j], a[j-1] return a
0
cb6d30b86734febf8521727db9982210
d04b6dc783adf641077f2340a4027062
Retrieve PK of all matched record.
class Charge_model extends CI_Model public function get_all_pk() { return ee()->db->select( $this->_pk )->get($this->_table)->result_array(); }
1
2eb7891ccf6c5385af396f856a98edb5
72866a7073c06b74f229c11ca42b511e
Calculate a pointcut for the given async annotation types, if any.
Operation getPointcut();
0
05f82085f39b75f2f41e1b00b5036ebb
e65642774eaa6da0aed282a5876b163d
写入短信上行信息,返回1成功,其它失败
public int sentSM(String[] mobiles, String content, long smID);
0
eef766fb2bf62878cd450723915a4ec9
adcc23827ea486e100620de43f391801
Restores the window from minimized or maximized state.
{ bool raiseEvent = panelState != PanelState.Restored; panelState = PanelState.Restored; IsMaximized = false; if (raiseEvent && Restored != null) { Restored(this, EventArgs.Empty); } }
1
cdbee56e24cd563c2e06b662485c2b83
94cd28a0a4bf545407581f8c14c08be4
Removes the agency with the given id.
class AgencyController extends Controller public function destroy($id) { $this->agencyRepository->deleteById($id); return redirect()->route('agencies.index') ->with(config('core.session_success'), __('agency::labels.agency') . ' ' . __('core::labels.delete_success')); }
1
4b7fa17882a9b080b3383ea8cc2b14a0
f1ac5ea32fc98a1413d21fd90553af13
生成TradeRequest对象 - for 普通赎回
RedeemRequest request = new RedeemRequest(); request.setVersion(Constant.HftSysConfig.Version); request.setMerchantId(Constant.HftSysConfig.MerchantId); request.setDistributorCode(Constant.HftSysConfig.DistributorCode); if("1".equals(vo.getLevel())){ request.setBusinType(Constant.HftBusiType.RedeemOrg); ...
0
ca4fa2fdbbd0b1db3bb769592e5239ea
f88c22653246b1c66d843d176b578db8
要求パラメータ:メールアドレス3をセットします。
public class LoginOauthDTO public void setMailAddress(String mailAddress) { this.mailAddress = mailAddress; }
1
8768095db251cda0504731cbe7b4f950
a389864d6e6032f041a1e3969ac1f200
Get 最大可配置云盘大小,单位GB。
public class CynosdbClusterDetail extends AbstractModel{ public Long getStorageLimit() { return this.StorageLimit; }
1
136be81d9c2a7f9cc7953399d5532ddc
c1e75df1a56c587f9bf93ceb7a9baae9
Returns the report names.
public function getReportNames();
1
12b8676af7b43d7c6088f434ec00faaa
5a7a3174567f1c2715313e61a5ff39b9
Заменяет символы табуляции на 4 пробела
void replace_tabs_by_spaces(char *s) { char *i = s; while (*i != 0) { if (*i == '\t') *i = ' '; i++; } }
0
ec171613d6c64ade11354b7d009fb229
098f8f00b6f51dcc941628abb443273f
Disposing will call Stop() on the Startwatch which is being controlled
namespace DW.WPFToolkit.Helpers public class KeyboardWatcher : IDisposable public void Dispose() { if (_hookId == IntPtr.Zero) return; StopWatch(); }
0
8e6e490ac5bf6e318443797d2cdce2ca
fb842c1d3332fbdb0e934edb3841b303
文字列からItemSubClassesを取得
function stringToItems(items_str) { if (!items_str || !$.trim(items_str)) return []; var i, items_obj_array = [], items_str_array = items_str.split(','), limit = items_str_array.length; for (i = 0; i < limit; i++) { items_obj_array[i] = { "pid": items_str_array[i] }; if (i === (limit - 1)) ...
0
a0e815e358bd120adf28ef4a1cb10433
ac81da5abab35cc3e4c5f2619552bd68
判断两点之间是否有障碍,返回布尔值
function GameMap:pathHasBlock(beginPos, endPos) local vector = G_Utils.getDirVector(beginPos, endPos) local beginTile = self:space2Tile(beginPos) local endTile = self:space2Tile(endPos) local tileWidth = self:getTileSize().width local temp = beginPos local tempTile = beginTile while not cc.p...
1
3b1677f7beae3fe84b1dc72dde299a32
d20ecf591d80d6dd91adda3006d9cb35
Method to update OVS rules for an existing VM port.
port_operation = context.get('operation') trunk_obj = self._trunk_neutron_to_vnc(sub_ports, UPDATE, id, port_operation) self._resource_update('virtual_port_group', trunk_obj) ret_trunk_q = self._trunk_vnc_to_neutron( self._vnc_li...
0
6adea6c9ca4493487ee14a502b944269
721dfdb7943e7b8cafd6f026c16281b7
The number of articles remaining for the user based on the total minus the bought ones
{ $qb = $this->createQueryBuilder('a'); $qb->leftJoin('a.advert', 'b') ->select('count(a)') ->where('b.user = :user') ->setParameter('user', $user); $result = $qb->getQuery()->getSingleScalarResult(); return $result; }
0
164e34b9140b549ff0fb869a06c8ab1d
a6f4913a2a76f51c78c5f0d23c0ea187
Create customized observation model using a table name.
if not self.persistence_layer.check_if_table_exists(tablename): raise utils.BayesDBInvalidBtableError(tablename) if not self.persistence_layer.has_models(tablename): raise utils.BayesDBNoModelsError(tablename) if numsamples is None: numsamples=50 return self.select(tablename, col...
0
e8afcf3b5fee674e49bd0d951709ee20
c45e54959fb352b2657598f0ab50724c
检查参数是否为空,如果不为空,则抛出异常
@Component abstract class BaseController @Deprecated("使用ResponseWrapper") protected fun checkParams(vararg params: String?){ params.forEach { if (it.isNullOrEmpty()){ throw ParamsErrorException() } } }
1
2683245e253eea01eb95c3493f3b2dcc
7476cea57edba09f554d37b98e206ea2
未回答の検査コメントのリストを取得する。 Returns:
class Issue(Folder): def getListIssueComment(self): return self.__issuecomment.values()
0
84a90f6baf8c840de96da3ada8bf8926
76eb07a1eda107aca9c147e581b079a8
Returns {@code true} if the receiver's row header is visible, and {@code false} otherwise. <p> <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> </ul>
public class JavaFXTable extends JavaFXComponent<FXDataBookView> implements ITable @Override public boolean isTableHeaderVisible() { return true; }
0
e008c97daad1c1067e95eb6f6cd90cf4
c0cedb3d360ad1e0a2f514440cb03cda
https://projecteuler.net/problem=29
prime, total = 8, 13 while prime / total >= 0.10: x = (total + 3) // 4 base = 4*x**2 + 1 if isprime(base): prime += 1 if isprime(base - 2*x): prime += 1 if isprime(base + 2*x): prime += 1 total += 4 print((total + 1) // 2)
0
e4f6dfae46b280bb20484691a83cf5ea
35af92813ad4fd1c255c6df5c825bb4a
Returns a new {@code CUDA_RESOURCE_VIEW_DESC} instance allocated with {@link BufferUtils}.
public class CUDA_RESOURCE_DESC extends Struct<CUDA_RESOURCE_DESC> implements NativeResource @Nullable public static CUDA_RESOURCE_DESC.Buffer createSafe(long address, int capacity) { return address == NULL ? null : new Buffer(address, capacity); }
0
37b221062ceeadcd317416cddcebab8f
1d7ad626f8c25f4dd436289b7a358ce4
Sets current and active angles for use in math based on radio button selection.
currentlyFiring = firing; if (angle >= 20 && angle < 85) { row = 1; } else if (angle < 105 && angle >= 85) { row = 2; } else if (angle >= 105 && angle < 165) { row = 3; } else if (angle >= 165 && angle < 190) { ...
0
0dd96cfb2c3fd9d353bb3058da140275
b2eb05c0796357f84ae55666fb15e1e4
Returns the smallest screen size an application will see in normal operation, corresponding to smallest screen width resource qualifier. This is the smallest value of both screen width dp and screen height dp in both portrait and landscape.
public class ShortcutHelper public static int getMinimumSplashImageSizeInPx(Context context) { return getSizeFromResourceInPx(context, R.dimen.webapp_splash_image_size_minimum); }
0
7c66664e3aaabab4f22421096d181ddf
0705c27d1ceb77c0673eda383cf85c71
Test decoding when shift causes a letter to wrap back
class TestRSdecoding(unittest.TestCase): def test_oneerr(self): for i, c in enumerate(self.code): newch = r58conv( (b58conv(c)+1) % 59) r = self.code[:i] + newch + self.code[i+1:] decode = self.coder.decode(r) self.assertEqual(self.string, decode)
1
3e032c483ae31afea83a64b497428ad9
2121a354711e59fbaac83bcb8718c957
根据商品id获取已购买商品的会员
public Member getNEByGoodsId(int goodsId);
1
b781823e18af6f5e6b29c667a9d80b90
438ef3a0f5b9260e170cfd0b54a4f71d
Gets the output generator of the test
ResultOutputer<T> getOutput();
1
d86087b88e54bfca35dadf4d35810a20
88d036900d41ee222ed273fe9401b31d
将Root2挂到了Root1上
void Union(SetType S,SetName Root1,SetName Root2){ S[Root2]=Root1; return; }
1
757491b9f870d658713764af2ace9cf4
e60e7f81d1e1247cf3128e1a7b7f44d6
Get Chat Data By User ID
namespace ShipWithMeCore.UseCases Task<IEnumerable<ChatEntity>> GetAll(long userId);
1
64eab17d5c1f3c04b76320fc0bd07cbf
1ea494c889ed44208086ad54f2e52cc0
Method description: Receives and interprets data sent from the host device. Input params: n/a Output params: n/a
void USART2_IRQHandler(void) { uint8 value; if(USART_GetITStatus(HOSTCOMM_USART, USART_IT_RXNE) != RESET) { value=USART_ReceiveData(HOSTCOMM_USART); if ((value == '$') && (contReceive == 0)) { contReceive = 1; recCount = 0; recBuffer[recCount++] = value; } else { recBuffer[recCount++] = value...
1
88874a2911459b26313bd367d9d54202
6b7ed142b9ce8fb8e6d6201b4d382c71
Optimizes the specified input machine.
{ var allowedGlyphIdsSet = allowedGlyphIds != null ? new HashSet<ushort>(allowedGlyphIds) : new HashSet<ushort>(Enumerable.Range(ushort.MinValue, ushort.MaxValue - ushort.MinValue + 1).Select(p => (ushort)p)); var queue = new Que...
1
7325a42c533b80700d5aefdfa7082025
f7b38555909cbbbbae4e24bd7135228d
Writes a prompt to console and returns user input as boolean. The inputs "true", "TRUE", "TrUe", "yes", "YES", "oui", "OUI" "ja", "JA", "y", "Y", "j", "J", "o", "O" return true, all other false.
{ bool isValid = false; bool answer; do { write("Please enter 'true' or 'false'"); if (bool.TryParse(Console.ReadLine(), out answer)) { isValid = true; } } while (!isVa...
0
7af9fc7dc60c1a3827edcf56058dccd2
dc15a573edafba6382113d705d425d17
返回按照最近安装顺序排序的更新包安装标志文件
{ XmlDocument document = new XmlDocument(); document.Load(Util.GetDictiory() + "\\ServerUpdateFiles.xml"); return document.DocumentElement.ChildNodes[0].Attributes["no"].Value; }
0
cf5bb57f6ec90b344838a6b797e87eb9
db4bc7a58450fdca764ab6fb9c14b4c8
Returns time in milliseconds for last frame drawn
{ #ifndef USE_TIMING return 0; #else return Timing_frame.microseconds_total; #endif }
0
0a190e5d445c75d3c070f4bbfb4d2e8b
771d383f11ae0deae411c266e1d118f9
Enleve un produit du catalogue
class CatalogueProductController extends Controller public function destroy($id) { try { $productCatalogue = CatalogueProduct::findOrFail($id); $productCatalogue->delete(); return response()->json(['state' => true, 'data' => $productCatalogue], 200); } catch (\Exc...
1
7da9fa7f0a339f071f062a0dd6054b31
b3e6ddb68d4d937c9b7a960a3ced553d
Verify User get an Error message if he tries to create an Account with already registered Mobile Number
with self.client: self.register_user("sue", "sue@gmail.com", "Bootcamp11") response = self.register_user("sue", "sue@gmail.com", "Bootcamp11") data = json.loads(response.data.decode()) self.assertEqual(data.get('message'), "Email already in use")
0
524ed1723dcaff362b097549392b3304
4870e93d7c28412cad4fab3d0276573c
Returns true, if a given value meets the validation requirements.
namespace ConnectedDevelopment.InformSystem.WebApi.Models.DataAnnotations [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public sealed class AllowedValuesAttribute : ValidationAttribute public override bool IsValid(object value) { if (value is nul...
1
b58f891a68a29d08f35b206c5f443a42
47eba23ec9e7bc6becb0cbe97ea20b30
Create the icon node class name for an IContentsModel.
if (iconDescriptor == null) iconDescriptor = new NodeIconDescriptor("reportpartcontainer"); return iconDescriptor; }
0
901a2c4013e604e36c22b91191b09c51
a17c82a13e671e46f67dde089cca069d
Main function to validate a BST
def validate_BST(root): prev = float('-inf') return traverse_and_check(root, [prev])
1
179f0d67df86a99d8ea406c3904edc05
324da68d3d3854b1fdb57f4eed1aaa31
カラーコード(e.g."f8c630")をintのカラーに変換する関数.
function convertColor(colorStr: string): number { const c: Color = color(colorStr); const d: string = c.hex(); const n: number = parseInt(d.replace('#', '0x')); return n; }
1
728f6a244fd48e148d52b9521c94a538
4d01736739822abfc3ed8fffe8cd30ff
입주자 대표 회의 - 30분 주기로 입주자 대표 회의 상태 변경
$finish_recess_date = date('Y-m-d'); if(is_array($this->_contract)){ foreach($this->_contract as $val){ if(strtotime($val['contract_date']) < strtotime(INQUIRY_4515_RECESS_START_DATE)){ continue; } if(strtotime($finish_recess_date) <= strtotime($val['c...
0
6d9cb5e72945ba20805bab8f75bb3831
d836eef0eeb6fa8bd8c79726893c727d
Calculates the correlation among the numerical features and removes the highly correlated features
def main(debug = False): num_rows = 10000 if debug else None col_length = [] for i in range(4132): col_length.append(i) if debug: df = pd.read_csv('feature_engineering.csv',nrows = num_rows) df = reduce_mem_usage_parallel(df, 10) else: df1 = pd.read_csv('feature_engin...
0
81e67f40e6f407242fa19be56e7bdd67
cc5aa2d634cf6bea5785f74f622dd8da
Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys.
class Proxy(proxy2.BaseProxy): def update_ssl_termination(self, load_balancer, **attrs): load_balancer_id = resource2.Resource._get_id(load_balancer) return self._update(ssl_termination.SSLTermination, load_balancer_id=load_balancer_id, **attrs)
1
2c320bbaa1de88e59abaf4e4c3e6c81f
42184f0d76e1800640296ab8949eb403
Turns a path like d:\frog.txt into d:\frog_md5.txt or http://server/path/file.txt into http://server/path/file_md5.txt by splitting on the period and appending to the second-to-last segement
public class DropOffUtil public String makeDotFile(final String fullName) { final int fpos = fullName.lastIndexOf("/"); final int rpos = fullName.lastIndexOf("\\"); if (fpos == -1 && rpos == -1) { return "." + fullName; } final int pos = Math.max(fpos, rpos); ...
0
6ab36f1b23f78166f199574763b3c419
d622473129d730dc23ac5555259494f1
No-op for the time being
class FakeVpnFeaturesRegistry : VpnFeaturesRegistry override suspend fun refreshFeature(feature: VpnFeature) { }
1
487353e292e8f422ef8e1218b69924d9
f88f4f39d70da148fcc4fbdb888259fb
Create a PublicKeyHash2ArculaPublicKeyHash transaction.
asset = { "type": MAGISTRATE[type], "subType": subtype, "action": 0, "data": { "name": name.decode("utf-8") if isinstance(name, bytes) else name, } } if ipfsData is not None: asset["data"]["ipfsData"] = \ ...
0
0ac41c0260d4f95013dd69bc9ca60ab1
428c2955f6f5a0c8110075406be2816c
나의 주소록에 인물들을 삭제하는 메서드
void removePersonInfo(PersonalInfo *addressBook) { Boolean isEmpty; char name[7]; int indexes[10] = {-1,}; int index = 0; int k = 0; int selection; char flagOfDoing; char flagOfReturn = 'Y'; while (flagOfReturn == 'Y') { isEmpty = isEmptyAddressBook(addressBook); if (isEmpty == TRUE ) { printf ("주소록이 비어...
1
6ced335304e88f01e4fd58df4003e55c
d842d0ab10c014ddab7ba47ad7f122e6
RHS for star
def star(x): return lambda Ns: opt(plus(x))(Ns)
1
530073b4550da5065ef135ccaa3cc505
e24df9bdfa15bd1ae2e3e7a2dbcf1cda
以二进制形式读文件
def readBinaryFile(filename): with open(filename, 'rb') as f: return f.read();
1
53a00f59d6aec1cf3dd26953d75daacf
6a5e0b6ea2a1b947021e62f328b020bf
Return an array of applicable extension valuies that should match this writer. eg 'json', 'jsn' Exclude the extension dot return array
public abstract class ExportBaseToPage extends WizardPage protected abstract String[] getExtensions();
1
600c94e805b2d2342633272fb6b560e1
d3baa30e91f82a9e77f125b420a88f84
使用try…catch语句
public class D01_EXC_Throw public static void main(String[] args) throws Exception { try { Integer.parseInt("abc"); } catch (Exception e) { System.out.println("catched"); throw new RuntimeException(e); } finally { System.out.println("finally"); ...
1
3b2e54691a0fa87174965c6db2d0b36b
046afec63371c2c619825d07a0d05508
根据BlockMaxNumber获得Prj_Project,返回一个对象的IList
{ SqlParameter[] parameters = { new SqlParameter("@pageIndex", SqlDbType.Int), new SqlParameter("@pageSize", SqlDbType.Int), new SqlParameter("@TotalCount", SqlDbType.Int) }; parameters[0].Value = PageIndex; ...
0
d4748af4fb176db27ade4ee17e04b2e5
db9409e4a7216135adb02eeafe675319
Get the Smart Element Grid configuration builder
$build['config'] = $this->getTable($this->t('Configurations used'), $this->configNames(), array( $this->t('id'), $this->t('get') )); return $build; }
0
137642ac7b794fe9b4a0f3730d6d0caf
2b2ad4f6aa0d2be3538f060ff6196d30
The status code from SIP registration.
class SMSVerificationResponse: def status(self): return self.response["responseCode"]
0
4a02290a7404e2f6f500aa9c9a7c3e91
e90cea5413d13ae57a37a93c84a83dea
SREM
class Builder def srem(lhs, rhs, name = "") Instruction.from_ptr(C.LLVMBuildSRem(self, lhs, rhs, name)) end
1
eae17af44f31031dfadc54ad1b0adad4
2e603bc65f3b7aa10093a3a60f0aa805
Add software.
class SoftwareController async create ({ request, response, view }) { }
1
3b0589e73596f57e8fe7f8523fd0abb6
14dc3e55bfd881c95bfafee1cf42be03
Indicates whether comment should be saved
{ return this._comment != null && this._comment.Count > 0; }
0
0dbaea69404fb5e3ec7b7f1139636ab8
6b6d27385b5c5746a70ff00b19f01673
生成所有训练样本的句向量
data_train_vec = [] for sentence in data_train: sentence_words = sentence2words(sentence) sentence_ids = [] for word in sentence_words: sentence_ids.append(vocab_dict[word]) data_train_vec.append(sentence_ids) for sentence_ids in data_train_vec: while len(...
1
502790f166d5397b20cb5db4d4e10fc9
2443dd661e541b2fabb11aa1ad0e6d8e
Returns the days of the week that are considered to be weekend days, for example Saturday and Sunday, or Friday and Saturday.
class Holiday public static function getWeekend() { return array(self::SATURDAY, self::SUNDAY); }
1
8967f202d0ff143d771f5710a2f89f4e
6892be39c3145ef40f8d75ca04abf0c5
Multiple linear regression with xarray.
def multivariate_regression(X, y, alpha=0.01, epochs=100, k=64, l=0): cost_func = cost.reduce_mean_sse_reg grad_func = cost.reduce_mean_sse_reg_grad W, b = np.zeros((X.shape[1], 1)), np.zeros((1, 1)) W, b, *_ = minimize.adam(W, b, X, y, cost_func, grad_func, alpha, epochs, ...
0
9735f6193170c2caef944d690f27a515
bbb3b118ea0734494115eacfd251b457
Bulk API content type, one of XML, CSV, ZIP_XML, ZIP_CSV. The option is a: &lt;code&gt;org.apache.camel.component.salesforce.api.dto.bulk.ContentType&lt;/code&gt; type.
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-25T23:45:59.064-04:00") public class UploadBytesBinaryRequestParameter public UploadBytesBinaryRequestParameter contentType(String contentType) { this.contentType = contentType; return this; }
0
310b2e2c6786aec47a0268afb23ee38b
de2a88e70bd0ee588a3c20eb99f1ee90
Imports the result file.
namespace pwiz.Skyline public class CommandLineUI private void ImportResults(MsDataFileUri msDataFileUri) { RunDlg<ImportResultsDlg>(Program.MainWindow.ImportResults, importResultsDlg => { importResultsDlg.NamedPathSets = importResultsDlg.GetDataSo...
1
adb6a9e69b1562efab83c5f2223d0807
61e70584c19f1c78f423c56d5c58e8d5
Enables both PCA9552 LED drivers.
void MAX7301::enable(void) { write(0x04, read(0x04) | 0x01); }
0
b24329037f6be1157ed4ac0ad59af672
5930c5b017e9ae97c9f7e1ae9fd2778f
Returns all Twitter data for a party, inc. tweets
convert.JSON = TRUE, return.response = FALSE, verbose = FALSE) { if (length(party) > 1) { stop("Party must be single value") } if ((!is.numeric(party)) || (party <= 0)) { stop("Party must be an integer > 0") } require("jsonlite"...
0
2429c492fce74145116a7eb062da6a07
9e3cc8575191d7fc797d80696bfe1408
初始化历史录像,获取最近一个月录像
function initHistoryTree() { hisTree = new dhtmlXTreeObject("cameraHisTreeDiv", "100%", "100%", 0); hisTree.setImagePath("./js/codebase/imgs/csh_bluefolders/"); hisTree.enableCheckBoxes(1); hisTree.setOnCheckHandler(function () { videoTree.deleteChildItems(1); var selectIds = hisTree.getAllChecked() + ""; i...
0
7474f7d7059f8671c372704f66a89bec
8c9199037146b90b692b23c4f6ef4ce6
Method checks if LicenceCode is stored localy
def in_storage(unique_code): return get_username_from_storage(unique_code) is not None
1
335eed2f085f7059a9325abfe876154a
410cb7a06ee259fa2276882e825083e8
Open watchdog
int delay = 0; SYSCTL_RCGCWD_R = 0x1; delay = SYSCTL_RCGCWD_R; WATCHDOG0_LOAD_R = 0xfffffff; WATCHDOG0_CTL_R |= 0x2; WATCHDOG0_CTL_R |= 0x1; }
1
63331858ae9d29d738f13c61ac552c24
984c6fd121ff23cb03e286ce14f0d98d
Create a list of changes for each version. Return: The change log as a list of strings, one per line Changes in v4: - Jog the dial back closer to the widget Changes in v3: None Changes in v2: - Fix the widget - Jog the dial etc.
old = info.get('old', [None])[0] new = info.get('new', [None])[0] if old is None or new is None: return [] return [{ 'title': 'Rebase', 'rendered_html': mark_safe(self.render_change_entry_html(info)), }]
0
4898dbec9348b223f5f50ed6324b5287
ff90baf0c36953a8e8c8c973b4292e38
Sets the basic tile colors.
numCols = 4; baseColors= new int[numCols][3]; baseColors[3][redComp] = D2KColors.D2K_RED.getRed(); baseColors[3][greenComp] = D2KColors.D2K_RED.getGreen(); baseColors[3][blueComp] = D2KColors.D2K_RED.getBlue(); baseColors[2][redComp] = D2KColors.D2K_YELLOW.getRed(); baseColors[2][greenComp] = D2KColors.D2...
1
30d928ee5ae4d8c77624c634b0212fe8
00e1030692e3c9cd2a38e3b2ea4d885f
Converts e.g. tf.float32_ref to tf.float32.
class SFACell(nn.Module): def refcast(self, array, dtype): dtype = np.dtype(dtype) if array.dtype == dtype: return array return array.astype(dtype)
0
3f3a596fe7dec1709e5f9bca922ab2d7
5ef98d27a419662c408753492310a80b
reads the temperature and publishes it
myPrint("Capacity: "); snprintf (msg, 75, "%d", readI2CRegister16bit(0x20, 0)); client.publish(mqtt_1CAP, msg); myPrint(msg); myPrint(",Temp: "); snprintf (msg, 75, "%d", readI2CRegister16bit(0x20, 5)); int temp = int(msg); client.publish(mqtt_2TMP, msg); myPrint(msg); if (temp...
1
5e3fe0961882b4c5f63a6e002aa8a6fc
8e13c45320f54ac73f799f9aa66261cd
Enter a parse tree produced by {@link PigParser3Parser#illustrate_clause}.
public class sparkJavaBaseListener implements sparkJavaListener @Override public void enterExplain(sparkJavaParser.ExplainContext ctx) { }
0
25c6f29c7431ea61f4c1fdfb24780149
fdcbc70dc6af34bd78263c3b16e12e16
Creates a new class designed to run given plan from given seed.
class UpdateRunner(object): def __init__(self, plan): self.update_plan = plan self.get_current_step()
0
e15425243656308ce14ed89cb898187f
6cba84efe1ea9aa1516590fa05363f84
@brief メディア固有処理実行を要求 以下のメディア状態では受け付ける。
void CDetectDVDMedia::WaitMediaReady() { CSingleLock waitLock(m_muReadingMedia); }
0
6da172d638a86a811e732e385b163f4a
378df57d057e9f75e4e1b4aeeefe9c40
Método para colorir borda de campos inválidos
function panelInvalid(panel) { panel.css("border-color", "red"); panel.children('.panel-heading').css("background-color", "#ff8080"); panel.children('.panel-heading').children().css("color", "#c90000"); }
1
75e83ad9c4bdf76f95615f7207ed7829
8cce9b2d0c22217776e4fc474e6426b2
获取通讯录的access_token并放入session中
class WechatController extends ActiveController public function actionAccesstoken() { $code = $_GET["code"]; $appid = Yii::$app->params['wechat']['appid']; $appsecret = Yii::$app->params['wechat']['appsecret']; $request_url = 'https://api.weixin.qq.com/sns/jscode2session?appid='.$app...
0