query_id
string
corpus_id
string
query
string
code
string
label
int64
bb6428898325a5ef9682c9adaa6444d5
e712013b8eab0110a07d6e7446f3bb80
A method that can be called to receive what buttons are being pressed by the NN.
{ int counter = 1; for (int Yindex = 0; Yindex < 5; Yindex++) { for (int Xindex = 0; Xindex < 3; Xindex++) { Rneurons[counter].SetState(InputButtonsArray[Xindex, Yindex].state); counter++; ...
1
a7c047bdd8ab512e8ee8657f81835fe2
6008283f6b331f241fc121c605fae136
Setter for <code>NBC_DVH_HIS.DATA_VERSION</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.8.0" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class NbcDvhHisRecord extends TableRecordImpl<NbcDvhHisRecord> implements Record11<Long, Long, Long, Long, Double, ...
1
ac41164aab4682a0a809f751be9d7407
6ef3b6085b231b0bc1675cfb44bfe73d
===== Gets Maximum CourseID from data access laer and send back to the presentation layer =========
class SynchronizeDataCohortSelect : AppCompatActivity() fun fetch_courseid() { val cursor1: Cursor = db!!.getCourseId(g_course_selected!!) val stringBuilder1 = StringBuilder() while (cursor1.moveToNext()) { stringBuilder1.append(" " + cursor1.getString(0)) g_c...
0
ef0af6927ae21b68554e04f5a639abb0
935d0f30fa20004d14078f7bdbcddd2b
Returns the index of a country in the countries collection by its name.
{ for (int i = 0; i < _countries.Count; i++) { if (_name == _countries[i].CountryName) return i; } return -1; }
1
a4ecdac2b3d780225fe9fba59465efcd
7ef9b56ecf0684eab49374b5f92c6499
grab a reference to the main player's data manager so we can update its values later on (scoring, lives etc.)
{ resetPosition = playerRigidBody.transform.position; stats = GetComponent<PlayerStats>(); health = GetComponent<Health>(); health.healthDepleted.AddListener(ResetPlayer); gm = FindObjectOfType<GameManager>(); teamTag = GetComponent<TeamTag>(); }
0
82dec0c2528936c384212d2fa41436e6
6a57a050e2bef5831fbd75248a64a728
Renvoie un identifiant unique pour chaque instance
int identifiant; identifiant = prochainIdent; prochainIdent ++; return identifiant; }
1
b143228784bcbef4722b060b981b7b34
0dfbfff7415c5e76cfa1795c8f90afba
将一个字节转为2个字符(16进制大写)
public class StringHelper private static String toHex(byte b) { char[] buf = new char[2]; byte bt = b; for (int i = 0; i < 2; i++) { buf[1 - i] = Hex.DIGITS_LOWER[bt & 0xF]; bt = (byte) (bt >>> 4); } return new String(buf); }
0
4754d68dcae39ea11e1f51604a231ed6
53a734b81b28961c7507557ea955d8f2
根据标签进行群发-图文
{ $ret = array(); $ret['filter']['tag_id'] = $tag_id; $ret['filter']['is_to_all'] = $is_to_all; $params = $this->buildParamsByMsgType('text', $content, "", "", array(), $title, $description, $send_ignore_reprint, $clientmsgid); $ret = array_merge($ret, $params); retur...
0
c61105e79d6e6beefe56ce5923f64c7c
212cc6c85ff752c38020e15ccc8832c4
Sets the evento configuracao local service.
public class CorrigirEventosImportadosController public void setLocal(String strLocal) { m_empresa.getM_registoEventos().getEvento(strTitulo_old).setLocal(strLocal); }
1
6c222c2aaf8d759e42caa23a468b5a1f
54bdd321ca4c44b4d825a85bb218f02a
Shows a Snack bar with the duration specified displayed on the button <p>The button will be displayed only if the "actionListener is not null"</p>
if (null == parent) { return; } Snackbar.make(parent, text, Snackbar.LENGTH_SHORT).setAction(action, listener).show(); }
1
d1b9bef4feb9edbd87cdf6ebd20e55ae
74c372d941f8253da0c75a748b1354c3
再帰的にig_nodeをめぐってblockとmap_infoを関連づける
_blockMap = {} _temp = [] _blockSortMap = {} _temp_singular = [] _map = {} for x in range(len(self.__blockList)): _temp.append(self._block_map[self.__blockList[x]]['Loop_info']) _blockMap[self.__blockList[x]] = _temp _temp = [] ...
0
d4b6e146c4c59095d82ecbaaff08f8c4
b7cef2473ab8be298714d18e54a36ed6
隐藏mobile中的4位
public class TextUtil public static String formatMobileHide4(String mobile){ if(TextUtils.isEmpty(mobile)) return ""; return mobile.substring(0,3)+"****"+mobile.substring(7,11); }
1
41308b7b1f2f2ab52dcd2d36e34803e7
59ea2e72a1b9699f11758647f5b4be8b
通过用户账号分页查询该用户所有购物车列表
List<ShoppingCartBO> getShoppingCartList(Integer userId, Integer page, Integer pageSize);
1
04591697071b1a63b278d562ddc73c80
8fe20154b978830ca4ce90b986d1e5a5
Checks whether resetting the password over an invalid email fails.
class PasswordResetTestCase(APITestCase): def test_password_reset_invalid_email(self): url = reverse('auth-password-reset') data = { 'email': 'nonexistent@example.org', } res = self.client.post(url, data=data, format='json') self.assertEqual(res.status_code, status.HT...
0
ef30bb00522805920827c91cbe0ffb46
ee5f9fd0408dd5c864c8370cff579329
Method to be called when the button for a regular F move is pressed
namespace CubeSimulatorGUI public class Cube public void RegularR() { edges = RegularMoves.REdges(edges); corners = RegularMoves.RCorners(corners); }
0
55eed2b25d4384f3c69bcff963fcb3a2
be0ea11127aecdce9c5810798a3cd01b
Adds entity relations to $result
$view_builder = \Drupal::entityTypeManager()->getViewBuilder($this->entityType->id()); foreach ($result as $row) { $entity = $row->_entity; $entity->view = $this->view; $this->build[$entity->id()] = $view_builder->view($entity, $this->view->rowPlugin->options['view_mode'], $this->getLangcode($...
0
296907b7213d0a56904de2435bf8c9f1
b3f185588c6143aff1828429c02d1173
Get List of replica AZs of the shard
public class LoadBalancerDetail extends AbstractModel{ public String [] getSlaveZone() { return this.SlaveZone; }
1
f6cc77f63a04f6cf54ff4921f03109d5
38830054c0383a9deef55ad03c7f4cbc
Returns @c true if the Client is being interactively resized; otherwise @c false.
namespace Gecko [return: MarshalAs(UnmanagedType.U1)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)] bool GetImageIsResizedAttribute();
0
6c85f1a8ffcf79ca9d94507edac41aef
0a6e1a1b4fdd3245b5f5662b15d92489
Handler for changes in the RDB pair status variable. Note that this can be triggered from a user pairing request via either screen or web UI and it can also be triggered by an externally generated pair request from a remote device.
{ DEBUG_LOGF("appSmHandlePairingPairConfirm, status %d", cfm->status); switch (appGetState()) { case APP_STATE_HANDSET_PAIRING: appSmSetCoreState(); break; case APP_STATE_FACTORY_RESET: break; default: break; } }
0
a4825442b3cd800d44bc5faf3137a6e0
302cd5715d15970284a0c40a43aa7e3f
Reimplemented to save all child displays
class Tree(npyscreen.MLTreeMultiSelect): def display(self, *args, **kwargs): with self.lock: return super().display(*args, **kwargs)
0
45117c615103b5cb929e7f1b1150fd62
c5d91161cb6d1cd0674a930041f6595c
Returns dict of allowed TLVs' formats for RCP message specified by ID.
{ int i; serprintf("get_ff_format %d\n", id); for( i = 0; i < sizeof( id_fmt ) / sizeof( struct id_fmt_str); i++ ) { if( id_fmt[i].id == id ) { if( fourcc ) { *fourcc = id_fmt[i].fourcc; } return id_fmt[i].format; } } return 0; }
0
a5930eb933dd4ceba1f559d99dcfbce5
45826a93c335f0b0cd3148445541e8cc
Instantiates an instance of a specific field type based on the assembly and class name of the field type
namespace Microsoft.Protocols.TestTools public static class TestToolHelpers internal static object CreateInstanceFromTypeName(string nameOfType) { return CreateInstanceFromTypeName(nameOfType, null); }
0
a177df9692412762abd1d008806d0239
c69562c25f06772bc0017cb5cf926750
Process an HTTP upgrade. Processors that support HTTP upgrade should override this method and process the provided token.
public class HttpServerUpgradeHandler extends HttpObjectAggregator void upgradeTo(ChannelHandlerContext ctx, FullHttpRequest upgradeRequest);
1
67f523b79f7cd0abb6137bd439933d77
fb8cb83825ee174c1a6e1f14a1d8e9fd
定时获取系统监控信息
task = new TimerTask() { @Override public void run() { System.gc(); getMonitorInfo(); } }; Timer time = new Timer(); long delay = 0; long interpe = 30 * 1000; time.schedule(task, delay, interpe); }
1
7dcddc2c72d72986f14d0d23b9cbfbc0
118aa6da23c4f21018d1e7524e4f8781
Returns the parent clade of the given clade
public TaxonConceptDTO getParentConceptFor(String taxonConceptKey) throws ServiceException;
1
48df1099da0e2819cf129efb20fc7b3b
db861d2a0526d0993c257478301ab3a1
Creates each [EpisodeRow].
return EpisodeFO( uuid = TestConstants.UUID, number = TestConstants.NUMBER.toString(), name = TestConstants.NAME, length = TimeUtils.getTimeFO(), note = TestConstants.NOTE ) }
0
9a3145d29a1f76d2c39643825e45e83b
234b8f645a02fd13a277e6fe8e413d03
Returns circle bounce data for the given particle
{ return particle.Direction * ((particle.StartLifetime - particle.Lifetime) * particle.Speed); }
0
314ca982bbb1a677c384b3556d44189e
617e45f70ac43e8b92498af288265cca
Unblock all waiters on this condition
{ condition_variable_impl * d = _d.cast<condition_variable_impl>(); auto_lock<>(& d->_mtx); cv_event_queue_t::iterator it = d->_queue.begin(); cv_event_queue_t::iterator itEnd = d->_queue.end(); for (; it != itEnd; ++it) { tread_cv_event * current = *it; SetEvent(current->_event); ...
1
64a727213c2c10ede8959f309a4aebdd
46503a608992b9d2028cb076392dba4a
Закрывает КОМПАС-3D.
{ try { _manager.OpenKompas(); } catch (Exception) { _manager.KsObjectSetNull(); _manager.OpenKompas(); } }
0
7fc6ed7104dd4437a3b7299e2f96327c
30b0ba06befb4b36189e3282c4e1b0a2
- Retrieves the latitude/longitude of the event (as it isn't given in the basic get_events call) - Returns them in a list like this: [latitude, longitude]
class Event: def get_location(self): return
0
d43379feab9ba89721a1af732e4a307a
07bdd0f1abef8b5d2facb427620e3938
Draws the "Enter Name" UserInterface of this CharacterSelectionState.
GUIDrawConnectionInfo(new Rect(0, Screen.height-20, 100, 20), connectionStateFontSize); if(PhotonNetwork.connectionState == ConnectionState.Disconnected) { GUIDrawEnterName(); } }
1
ae28f3b7fcd73de8a0f1379706df9a23
abad53c8ef8b840f93bd35ddc9c1bd79
Returns the default stroke config for the geometry.
StrokeConfig getDefaultStrokeConfig();
1
9c14155c9b8025dbdf830d7147514c9d
aac1e2c20b45fb7c3c89fff2f414c341
получаем все возможные шаги коня
public class test public static int[][] knightMoves(int x, int y) { return new int[][]{{y + 2, x + 1}, {y + 2, x - 1}, {y - 2, x + 1}, {y - 2, x - 1}, {y - 1, x + 2}, {y + 1, x + 2}, {y - 1, x - 2}, {y + 1, x - 2}}; }
1
ff89231d2986ecabdf378eee4a2fd6db
946697c5f2a5b0dd76b0f5739071a907
Attempt to add a new side into the shape.
class Solid(Common): def add_sides(self, *args: Side): self.side.extend(args)
1
7acd86569a974d5ee624569fb829953b
9728108a3715c3c61a2f07cda974f738
乘法,返回精度为2的字符串
BigDecimal b1 = new BigDecimal(v1); BigDecimal b2 = new BigDecimal(v2); return b1.multiply(b2).toPlainString(); }
0
64073dd2f237290871a20833b8628400
2feb5241edcca0e029c006c09bb4aa6a
Caso não existir diretório de Log, cria-o
if not os.path.exists(self.PATH_DIR_LOG): os.mkdir(self.PATH_DIR_LOG) with open(path_to_log, 'w'): pass else: if not os.path.exists(path_to_log): with open(path_to_log, 'w'): pass
1
812419972cab7024f468c087e5426adc
8ed14f2a478edb3fdfe0e14075a67afc
得到分开的服务器文件夹列表和文件列表
def listFD(url): page = requests.get(url).text soup = BeautifulSoup(page, 'html.parser') if url.endswith('/'): fileList = [url + node.get('href') for node in soup.find_all('a') if node.get('href').endswith('t')] folderList = [url + node.get('href') for node in soup.find_all('a') if node.get(...
1
fa0cc934bb75de6a6a284a74458b89c6
2cd4107d4ca5bc20ef886a69c773ac68
Add JS module to the output
function add_module_to_script( $tag, $handle, $src ) { if ( "js-file" === $handle ) { echo $src; $tag = '<script type="module" src="' . esc_url( $src ) . '"></script>'; } return $tag; }
1
afe5ad5c426b2fb1edb1202d2dac8238
6fc6b16aa09dd6ea1c2fb132b69fa00f
Visit a parse tree produced by CypherParser#oC_YieldItem.
class CypherListener(ParseTreeListener): # Enter a parse tree produced by CypherParser#oC_Cypher. def exitOC_Query(self, ctx:CypherParser.OC_QueryContext): pass
0
a87a3f9b0523182d780de53c3a0bdbbb
010af26606eb6efabfcec48cea549a6c
Redirects to the login path to allow the flash messages to display for sign_out.
class ApplicationController def after_sign_out_path_for(resource_or_scope) flash[:logout] = true root_path end
0
88d8396c75005f33d26d6cd275fbe40a
8b86a8681ad9fbdccfa9b0248bea26cc
can only update own account
class ProfileRetrieveUpdateTests(APITestCase): def test_update_profile_owner_only(self): self.client.force_authenticate(user=self.user1) res = self.client.patch( reverse("profile_retrieveupdate_view", kwargs={"username": "test2"})) self.assertEqual(res.status_code, status.HTTP_403_FO...
1
ae398a9b092e4c5d63c8a9cca56df6d7
296ac2807b124b87bfa68e6d9537693e
Redémarre le jeu avec une planche de jeu chargée d'un fichier
class Interface: def chargerPartie2(self, fichier): self.makeMain() general.start.chargePlanete(os.path.join(".", "sauvegardes", fichier)) general.start.start()
1
ec05bf1b0ea1ef26393b6670a59cce10
7eba8ecbfdd67a9121445306fe5b3dbc
includesTx checks if a block contains a transaction hash
bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock) { { LOCK(cs_main); { if (mempool.lookup(hash, tx)) return true; } CTxDB txdb("r"); CTxIndex txindex; if (tx.ReadFromDisk(txdb, COutPoint(hash, 0), txindex)) ...
0
8f3ef1cae7c98ff3a4a546fb2a7ee7a5
d9ae3e2db95d0d9e89ff01ce4f2c65bc
Test create team command API with non-lead lead.
class TestTeamCommandApis(TestCase): def test_add_non_unique_team(self) -> None: try: self.testapi.team_add("lead", "regular", "gh3") except RuntimeError: pass else: self.assertTrue(False)
0
9e54ec9c3aa99cf75392b39c9e2fc565
ae94c09eb20cf7d7ed81d41520c834ba
定时更新计时字典
class WSClass private void UpdateDicToALL(string[] val) { List<string[]> list = null; dic_toall.TryGetValue(DateTime.Now.Day, out list); if (list != null) { list.Add(val); dic_toall.TryUpdate(DateTime.Now.Day, list, list); } }
0
77062d2fe4b63ac30b247a849ff7bfbb
507f684198e8203338890a723bbb76eb
ratio使用w/h与statistics_tools中相反 使用聚类的方法自动确定最佳的anchor box配置 与v1的差别为不同的size使用不同的ratio
offsets=(0.5, 0.5), clip=False, **kwargs): super(SFDAnchorGenerator, self).__init__(**kwargs) assert len(im_size) == 2 self._im_size = im_size self._clip = clip if isinstance(sizes, (list, tuple)): self._sizes = (sizes[0], np.sqrt(sizes[0] * sizes[1])...
0
e31984f3a20f6c02d5e7f1dc13f606af
b6ad19d661dd3191272ea567ea6ae522
Uses a confusion matrix to compute precision, recall and fbeta.
tp = cm[1,1] fn = cm[1,0] fp = cm[0,1] tn = cm[0,0] print('precision:{:.3f}'.format(tp/(tp+fp))) print('recall:{:.3f}'.format(tp/(tp+fn))) print('f1-score:{:.3f}'.format(2*(tp/(tp+fp))*(tp/(tp+fn))/((tp/(tp+fp))+(tp/(tp+fn)))))
1
ed92239361bfe42376416771fa95ee20
b06ce019e2d64c7f9833e5f9555aeee5
Takes dictionary of parameters, converting values to required type and providing defaults for missing values.
if analysis_dict['Type'] not in ["Dichotomous", "Polytomous"]: raise AssertionError(f"{analysis_dict['Type']} not supported") if ((analysis_dict['Type'] == "Polytomous") and (analysis_dict['SubType'] is None)): raise AssertionError("Polytomous Types must have SubType " ...
1
1d1efdbd70d0fbf4964e8bd0cc0b062a
7c7ee3ddf85b32a1eacad8d58a778a19
2009.03.24加,删除节点,顺带删除所有子节点
class Nodes extends CI_Model function del_node($node_id) { $node_info=$this->get_node($node_id,'node_id'); $this->db->where('node_id', $node_id)->delete('vx_node'); $this->db->set('node_id', 0)->where('node_id', $node_id)->update('vx_post'); if($node_info['node_type']===1){ ...
0
da805ac7083864eb245815337a3261c7
ee0d8e9df151c7507f71eb017e403d46
method for button to clear the diagnose editor
class CheckinOut(QtWidgets.QMainWindow): def diag_win(self): self.d = DiagnosisWin() self.d.show() self.d.ui.textEdit.setText(self.ui.textEdit.toPlainText()) self.d.ui.pushButton_2.clicked.connect(self.d.emit_diag) self.d.diagnosis.connect(self.slot_ckdiag_write)
0
bcddd0d6fd2549e8b9e21369b451490f
7fd9bb0fff6d5dd4e07f9049bbba6855
Inloggen met google
export class LoginComponent implements OnInit async loginWithGoogle() { const provider = new firebase.auth.GoogleAuthProvider(); const credential = await this.angularFireAuth.auth.signInWithPopup(provider); console.log("In google login function"); this.router.navigateByUrl('/home'); }
1
acff9b12d14b4e3f7b3d8d20dbef77db
bd6f7346d70078dcec3c58fcd3e87978
Check that two different input shapes of the same length, but some have ones, broadcast to the correct shape.
check_input_and_output_numbers(operator, input_count_range=1, output_count_range=1) check_input_and_output_types(operator, good_input_types=[FloatTensorType]) input_shape = operator.inputs[0].type.shape if len(input_shape) not in [2, 4]: raise RuntimeError("Input must be a 2-D or a 4-D tensor") ...
0
5ff5074de6fa99291582d56d32a5b081
1604f885f655807fb17e9b2b0b94c126
Assert that the size of an empty queue is 0
namespace JoachimDalen.AzureFunctions.TestUtils.Asserts public static class QueueAsserts public static void QueueIsEmpty(this Assert assert, string queue) => QueueHasMessageCount(assert, AzureFunctionConstants.DevelopmentConnectionString, queue, 0);
1
7dc320326bb069f8dc03689eca031209
122738c31d2714711a594b89db03bd38
Bug #10188: Do not allow newlines in headers (CR or LF)
class Mail protected function _sanitizeHeaders(&$headers) { foreach ($headers as $key => $value) { $headers[$key] = preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i', null, $value); } }
1
d312605579604269b7b0d6b88f76f195
4710648687710264e7042e831ac439f7
FUNCTION DESCRIPTION change the group letter format to the vendor requries PARAMETERS void RETURNS void
namespace CA.WorkFlow.Common.PostPOToSap public class Common public static string ConvertMatlGroup(string sMartGroup) { string sResult = string.Empty; switch (sMartGroup) { case "ZNT_STSTY": sResult = "ZNT_STS_H"; break; ...
0
04e10ae4b0f4b2b197ec67073c58981b
dc28c56aa39d0321f67bc29a75706abc
Récupérer la moyenne d'un attribut d'une liste de dataframe listData: la liste de dataframe attribute: l'attribut auquel on va calculer la moyenne
def moyenneliste(liste): res=[] liste=np.array(liste) for i in range(len(liste[:][0])): res.append(np.mean(liste[:,i])) return res
0
822fb3dad137f638e6f70d0e5bffc08a
2b77bb4dc2fc3c04ad9abda10b21a82c
Get an empty list.
def get_empty_list(): global test_name, naked, proc_x, proc_y, func_x, func_y, func_a, n, ok, log, count, varToChange, rand, item, text, number_of_calls, list2, proc_z, func_z, x, proc_w, func_c, if2, i, loglist, changing_list, list_copy, unittestResults return []
1
078b2a6e65c5af81a4cfb181d44c4237
911e9cef7028c7bd70aa816411323d26
Gets invalid message for an entity or column
class BaseModel extends \yii\base\Model public static function getEmptyMsg($attribute) { return Yii::$app->getI18n()->format(Yii::t('yii', '{attribute} cannot be blank.'), ['attribute' => $attribute], Yii::$app->language); }
1
3f94845e247a868e9e9d8a57ebdb984a
c0a93eacd5d2dfb5a5748e177f238a2f
Writes a 32 bit floating point number to the buffer in little endian.
public static partial class BufferHelpers public static unsafe void WriteSingle(this ref BufferWriterSlim<byte> builder, float value, bool isLittleEndian) => Write<float>(ref builder, isLittleEndian ? &WriteSingleLittleEndian : &WriteSingleBigEndian, value);
1
209d3e801cbad4542273f977a865bed8
f87b7654fca549db4f125d792dc30df0
Visits adjacent topology vertex edges in depth-first order based on distance, starting with the specified root edge, using the supplied visit delegate.
this IGraph<TVertexId, TVertexProperty, TEdgeProperty> graph, IDfsStrategy<TVertexId> strategy, IEnumerable<Vertex<TVertexId>> roots) { var reached = new Dictionary<Vertex<TVertexId>, int>(); var vertexStack = new Stack<Vertex<TVertexId>>(); ...
1
61d17d73d6b63dd65a628483edb227b1
d560c22244a927f5397b33be786b968d
Returns result of expression.
namespace Calculations.Expressions public abstract class Expression public object Evaluate( ) { ExpressionVisitor visitor = new ExpressionVisitor( ); Accept(visitor); return visitor.Result; }
1
3813664835c513c3f6c6dcc451f424a1
cae4358f3ba298c79f1bd99159023411
フロアプランを読み込む
{ building_info data = {0}; FILE *FP; while(strlen(data.houseRent) == 0 && strlen(data.others) == 0 && strlen(data.roomType) == 0) { printf("\n希望家賃はいくらですか?:"); do{ fgets(data.houseRent, sizeof(data.houseRent), stdin); if(strlen(data.houseRent) >= 50) {...
0
b53b845e8d187f0b4a73caf09408c759
78b5c779d7b438dfcb8902dc720204a1
Submit login details to the server for registration
var regForm = { username: document.getElementById('tb-username').value, password: document.getElementById('tb-password').value, passwordRetype: document.getElementById('tb-password-retype').value, errorList: [], isValid: false, validate...
1
b229483980449e502ea13e30f0f0636e
851a430505437544cfa4d0d39ca32545
个人主中页面 根据用户类型跳转
class AuthController extends Controller public function actionPersonalType() { if (!Yii::$app->user->isGuest) { return $this->goHome(); } return $this->render('personal-type'); }
0
3753800d794bec4eeffd8e00c0a8210f
983351f1554b2dae8a02aa306185a5a4
记录装备流水
public class DataLogPrintModule public static void equipmentUpLevelLog(UserInfo userInfo, Equipment equipment, EquipmentMould equipmentMould, int beforeLevel, int afterLevel, int consumeSilver, int type) { Date logDate = new Date(); String ossFolder = "ossLog" + File.separator + TimeUtil.format(logDate, "yyyy") + F...
1
613f32c15936ff7ff65549c02cf20a63
40844d216b3d5e1786ab640a859d7c4c
Create a Manhattan distance field that contains the minimum distance to each entity (zombies or humans) in entity_list. Each entity is represented as a grid position of the form (row, col)
class Apocalypse(poc_grid.Grid): def move_zombies(self, human_distance_field): self.move(human_distance_field, self._zombie_list, self.four_neighbors, "gt")
0
2cf864e703bae036279a4016e8126774
545ada0c3fd46218bd896bf612045424
Locate the description file
with open( 'README.md', 'r' ) as f: desc = f.read() return desc
1
e9f2aa99ed008ff40e572e1ad484696c
7154626d84cf282663079460e3f2a6f7
Normaliza los PS respecto a la longitud de la barra de vida
public class PlayerBehaviour : MonoBehaviour public float AttValueScale(float health) { float currentHeath = health; float scale; scale = currentHeath * PercentualOfLifeBar; return scale; }
1
fd8099a777d20cd9461411c7b8f34da6
8e0351b4609a6d65e613798f817fe84d
Use to map a friends location on the grid.
public class LeetArray private int mapToGrid(int row, int col) { if (row >= 0 && row <= 2) { if (col >= 0 && col <= 2) return 0; if (col >= 3 && col <= 5) return 1; if (col >= 6 && col <= 8) return 2; } if (row >...
1
c7a183b1cc91dec9e3054148b5c3e712
01153036d330206e163d6fc98a7e14e1
Manage vCenter Servers in vCloud Director. \b
def process(vm_object): try: name = vm_object.summary.config.name except vim.ManagedObjectNotFound: return None machine = VirtualMachine(name=name) machine._vm_object = vm_object return machine return [ machine for vm_object in get_...
0
ef390ab3964f64ab6995be27f6f951f2
0fa3b50bbdf1e5bf63ea181d8193282d
method that returns id of the movie for particular movie name that has been provided
public class DatabaseAllMovies public Cursor getMovieId(String name) { return database.query( "all_movies", new String[] {"_id"}, "name=" + name, null, null, null, null); }
1
d3dc0f7a58ada58b8f22e140b4943eb6
da2b3e4303c28a16013c0e305d8a71f4
获取当前HTTP 请求的HTTP 请求参数键值对形式。 &name1=value1&name2=value2 ........。 主要用于程序中记录请求Log
public class RequestSender public static class RequestData public String getParams() { StringBuffer result = new StringBuffer(); if (null != mParam && mParam.size() > 0) { Object[] keys = mParam.keySet().toArray(); for (int i = 0; i < keys.length; i++) { ...
1
86655aaca2cd486dcc2e93dc7ba146d0
2087ae424e0c63758d957a5fd252bacf
=========================================================================== DESCRIPTION This function invokes the CM API to get either the list of available networks from the access stratum or the preferred network list from the SIM/USIM. Handling of the results is done asynchronously in the Phone command event handle...
dsat_result_enum_type dsatcmif_get_cm_ss_info ( void ) { dsat_result_enum_type result = DSAT_OK; DS_AT_MSG1_ERROR("Subs id %d ",dsat_qcsimapp_info[dsat_get_qcsimapp_val()].subs_id); if (TRUE != cm_ss_cmd_get_ss_info_msim ( cmif_ss_cmd_cb_func, ...
0
f497810b9ac490e4d6b1904275465791
32128bec2958c8ea1bc1b4786ecaafd7
Checks whether catalogue is a user catalogue (not meta).
class IsDeclarativeCatalogTests(unittest.TestCase): def test_with_declarative_catalog(self): self.assertTrue(utils.is_declarative_catalog( catalogs.DeclarativeCatalog))
0
22b1a77ffb91227801f5ee10713a5390
e77920bb01e5b0c69c00011630780c0c
Iterate over all credit card numbers in the line. i and j are start and end indices of the first and last digit of the valid credit card in the line.
while (self.index < len(self.data)): if len(self.data[self.index]) >= 3: yield self.data[self.index] self.index += 1
0
b43adc4b2c2679ad52aa3109746b6d3a
345dd425f2991ba4ab0f183b1b50c0c4
Reset the value of roation related Sliders.
{ thetaSlider.value = ThetaInitValue; phiSlider.value = PhiInitValue; thetaInput.contentType = InputField.ContentType.IntegerNumber; thetaInput.text = ThetaInitValue.ToString(); phiInput.contentType = InputField.ContentType.IntegerNumber; phiInput.text = PhiInitValue....
1
7eb6123ae822fd0566a23b11edf7021a
abb543a5cf7401dcec2ac8b0177adc9e
展示sigmoid函数
class Node(object): def sigmoid(self,x): x = float(x) minus_x = decimal.Decimal(-x) one = decimal.Decimal(1.0) result = decimal.Decimal(one/(one+minus_x.exp())) return float(result)
1
617924d1f119fd1dae71167136cb73a7
1ba4c8aa3f5e91438bf2feeb3937105f
Returns the top N features for each code, as a dictionary
def topwords(idfswordlist,n=10): topfeaturedict=dict() for i in range(n): feature=max(idfswordlist) if feature>0: index=idfswordlist.index(feature) topfeaturedict.update({feature:index}) idfswordlist[index]=-100 else: break topfeaturedict=sorted(topfeaturedict.iteritems(),reverse=True) return topf...
1
e760a1c496be851422fdee0db64f3dee
a56026fb010870742fd5c4e53aca6e78
将开头为张,并且长度为3的姓名打印
public class FirstThreeCharacters public static void main(String[] args) { String[] name = {"Rinat","Almira","madina","nunux","nayima","lala","aynigar","erpan","umut","parat"}; for ( String eachName : name){ System.out.println(eachName.substring(0,3)); } }
0
cf93027cbb51f9ec0407fe9295b29ac4
6fba1b15525ced81940a34adf0f4ceeb
Tests the shape key hierarchies returned by castRay
public class BBFixture void rayCast(BBRayCastOutput output, final BBRayCastInput input) { m_shape.rayCast(output, input, m_body.getTransform()); }
0
a08d48291c72052ce03584ff560c0469
fb8ec435649ee126dde7b1cb20f9a3f8
Test a 1D Laplace equation in spherical coordinates. This is a Laplace solve as there is no source term, only boundary-conditions. NB: The potential is represented with quadratic elements are used instead of the usual linear ones.
int main(int argc, char* argv[]) { assert(argc == DIM+1); int hi[DIM]; int lo[DIM]; for (int i = 0; i < DIM; i++) { sscanf(argv[i+1],"%d",&hi[i]); lo[i] = 0; } float h = 1./(hi[0]); Box domainWithGhost(lo,hi); Box domain = domainWithGhost.grow(-1); MDArray phi(domainWithGhost); MDA...
0
646301fb5f581b061cc94aec20937ed6
4fb7df79f1c9fb7bc3a891c250d6087c
Flag that ensures that OOBE configuration is applied only once.
$is_firstload = get_option( 'pip_addon_gdpr_has_replaced' ); if ( $is_firstload ) { return; } add_option( 'pip_addon_gdpr_has_replaced', true, '', true ); }
1
075dbc4fa682ac228cd4a844725c0926
27f800d58b8e75f58508b0013bb2066c
Return absolute url for Order.
class Zend_Payment_Data_Order_Item public function getUrl() { return $this->_url; }
0
71244ff183cba4143b56e3456e1adade
e35d9193b88b2eb7932f949044f93d9e
Returns a copy of this color with the specified blue component.
@IntRange(from = 0x0, to = 0xFF) int blue) { return (color & 0xffffff00) | blue; }
1
2b6cebf1226d06f1d2cfcdcae2b3fe7a
c3170331bc66e6ece73921dab0c87ee0
This function saves the state of the application by saving data such as room collection, staff list and fellow list currently available in the application
class Amity(object): def load_state(self, db_path): if os.path.exists(db_path): db = AmityDb(db_path) if db.read_data(): app_data = pickle.loads(db.read_data()) self.list_of_rooms = app_data[0] self.allocated_members = app_data[1] ...
0
a8934eb323da9d442eb8389badb0e4bf
627287562e5ec2891bf60d4b4ba30710
Проверка на попытку записать в базу значение NULL
{ if (IsEmpty || Checker.IsNull(value)) { return false; } throw null; }
1
e8f604cc40dd0449c583ed4e36d551d8
1976f3f3326ea5e31159787212af4ffa
Get the id of the "Popular" page.
class TestIndexLanding(BrowseBase): def test_popular(self): a, b = self.setup_popular() self._test_popular(self.url, [self.webapp.id, a.id, b.id])
0
2fa965858a73121c9a74a9a2c811208b
11b01db848740028dae4e6b7fdfad480
Get future events for a group
for group in groups: group["number_in_period"] = number_in_period(self.get_past_events(group, oauth_headers), self.filters['period_filter'][1]) group["period"] = self.filters['period_filter'][1] time.sleep(self.api_rate_li...
0
0525d7d9478fdf2de3a500ae0ec3541d
debbc7455bbd8f1c968301e837de6ff2
Returns negative points of the player in the current game
void *p_user_data, int p_num_args, godot_variant **p_args) { godot_variant ret; if (p_num_args != 1) { api->godot_variant_new_int(&ret, -1); } else { user_data_struct *user_data = (user_data_struct *)p_user_data; int player = api->godot_variant_as_int(p_args[0]); int out = (player >= 0 && player < 4) ? get...
0
91380be3c17029eb1948d7c93019baea
cd660a4de8af8817352d178d44215dba
The descendingIterator method, acquires an instance of DescendingIterator object of this ArrayDeque. This method returns an iterator with objects in reverse order as the ArrayDeque.
public class ArrayDeque<E> extends AbstractCollection<E> implements Deque<E>, Cloneable, Serializable public Iterator<E> descendingIterator() { return new ReverseArrayDequeIterator<E>(); }
1
173ce2f8736561b4e120314b714b35f7
75a7f4e5a1bbd3add4fa363f0bed8a0d
Check if the device is connected to PubKit messaging
class Device(object): def is_connected(self): return self._mqtt_client and self._mqtt_client.sock
1
7c7e3cefbda8accf9b773709e921fd9b
6c7c34834f2af69fe58761f9b5bcfea5
Gets if the character is actually a character that can be used for building a custom element name. See https://html.spec.whatwg.org/#valid-custom-element-name
return ( isPrintable(c) && c !== 0xfeff && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BR...
1
2c4c32be8f0cbbcfef4cf4128bdb16d7
9b03c307a325e88e396f0dae7235179a
向以node为根节点的bst中的插入元素elem 返回插入元素后新的根节点
class BinTree(object): def add(self, elem): node = BinTreeNode(elem) if self.root is None: self.root = node else: queue = [self.root] while queue: cur = queue.pop(0) if cur.left is None: cur.left = node ...
0
77fcb02cd81dfa5e0f12c9655b237b99
3a74ad0db4679354fea299b1b5904a61
Исключение при ошибочном имени шаблона компонента
class LinkerTest extends TestCase public function testRegistereException1() { $Component = md5(mt_rand()); Linker::$Component(); }
0
32e50055cbea9a8bcad0a6309612ea64
c5a262f8d4db82a01cd107bdf8135600
Universal time counter.
RMuint32 gbus_time_us(GBUS_PTR pgbus) { RMDBGLOG((LOCALDBG, "%s()\n", __PRETTY_FUNCTION__)); #ifdef WITH_QUICKTURN return gbus_read_uint32(pgbus,REG_BASE_system_block+SYS_clk_cnt)*4; #else return pgbus->gbus_read_uint32(REG_BASE_system_block+SYS_xtal_in_cnt)/XTAL_MHZ; #endif }
1
9f293714f2e6d0b0f4e1b434c5b2868b
c5575ce041f0a78cb112ed429dd89564
Meetingのリスト表示
{ $departments = Department::primitive()->get(); $meetings = Meeting::orderBy('id'); if ($request->filled('status')) { switch ($request->status) { case 'ongoging': $meetings = $meetings->whereNull('closed_at'); b...
1
ed6e35332a513e10a8bfca6ee5b35700
fe9c9cb9cd0da89c579e689a977821e4
Returns the list of files that are read to produce the output.
class DistInOutGenerator(InOutGenerator): def get_filenames(self) -> List[str]: return self.__i_generator.filenames if self.__i_generator is not None else []
1
16a25933be1cc6bcf0c9d71090d0da96
f5eae2f7e4d3d3739bfc002427b624ae
Forces JavaScript garbage collection on the page.
const client = await page.target().createCDPSession(); await client.send('HeapProfiler.enable'); return client.send('HeapProfiler.collectGarbage'); }
1
2dff95301450a7bd280ae874452de9bc
04a6cf55219c18057abab8c465a82a67
# Calculate egg conversion factor
{ Rstd <- 0.0112372 eatm <<- -0.0049*tc-1.31 aatm <<- (eatm/1000+1) aco2 <<- aatm ekin <<- 0 akin <<- (ekin/1000+1) apc <<- (-13/1000+1)*Rstd ap <<- apc/Rstd ehco3 <<- -0.141*tc+10.78-eatm ahco3 <<- (ehco3/1000+1) eco3 <<- -0.052*tc+7.22-eatm aco3 <<- (eco3/1000+1) edic <<- 10.53-0.105*tc ...
0
fcc9df2e363512be22c1b950c1d7f486
641b95a091ece9f951946dbd0321a573
@brief Get the Hadamard gate
class Circuit(object): def _x_gate(self): return torch.tensor([[0, 1], [1, 0]]) + 0j
0