query_id
string
corpus_id
string
query
string
code
string
label
int64
cd77acc1bc27f62ba5748d54ed79bd62
05a30cabc3a7c90b440968cdb02628ed
尝试获取锁,非阻塞方法,不成功返回null, 成功则返回获取到的key
String tryAcquireUnReentrant(String lockName);
1
af28bf60be7d2196c8bb1bd6d91dfe23
edd520da097af55758500e8585bd4096
Set exercise's abbreviation
public class WorkoutStepMesg extends Mesg public void setExerciseName(Integer exerciseName) { setFieldValue(11, 0, exerciseName, Fit.SUBFIELD_INDEX_MAIN_FIELD); }
0
e16735a6fa284160be928d7701f2fcb5
db5c9b5df6fb1893fbc169dbbd964595
ログイン時間を取得
public class TimeTick : MonoBehaviour public void GetLoginTime(out DateTime dateTime) { string lastTimeStr = PlayerPrefs.GetString(GlobalConst.login_time); if (lastTimeStr == "") { lastTimeStr = GetCurrentTime(); } dateTime = DateTime.Parse(lastTimeStr); }
1
a707a2d74a7679fd8622db27478d1e95
536fd21481468356beac3d355c742c8b
将字符串编码进行url解码,如果字符串为null返回null<br/>
public class StringUtils extends org.apache.commons.lang3.StringUtils{ public static String URLDecode(String str) { try { if (str == null) { return null; } else { return URLDecoder.decode(str, "UTF-8"); } } catch (Exception e) { ...
1
52e6d126f9b52bcb435e4e0a206dbb54
00579e306a0fe9bd541f02e4f5dff40b
Deletes all the tree items, but not from the database.
namespace Sitecore.ItemBucket.Kernel.Kernel.RemoteCrawlers public class RemoteDatabaseCrawler : BaseCrawler, IRemoteCrawler public void DeleteTree(Item rootItem) { Assert.ArgumentNotNull(rootItem, "rootItem"); if (rootItem.Axes.IsDescendantOf(this.root)) { using (IndexDeleteContext conte...
1
21e0038c85ee6f0ef26a91a432c0f74a
16e0ad052dc27107d360fe772f6d0569
utility function that converts beats per minute into seconds per beat
class NoteSequenceDataset(Dataset): def seconds_per_bar(self) -> float: bars_per_minute = self.qpm / self.meter[0] return 1 / (bars_per_minute / self.minute)
0
f23362fff19b87e64d4facca6b9e27df
c37fd9edf5145733b24f531d23e048e5
Determine if the context should be run using game time or if it should be run using real time.
namespace patterns bool fetus::is_real_time(void) const { #if defined(patterns_standalone) return irealtime; #else return true; #endif }
1
95694c5076f7ede7d2bba39b2606f041
a31108aaaa7b5482614e5fed77f1e2af
Executes when show discovered cards is pressed.
{ if (e.CurrentSelection != null) { Navigation.PushAsync(new DisplayCardPage { BindingContext = e.CurrentSelection[0] }); } }
0
98815c31331aed21bb68f7f2fd17da7c
c22bb5c45e592ceddcafebd1d2910313
查询所有的阶梯促销规则
List<ShopPMansongRule> findShopPMansongRuleAllList();
1
16574e843c0555372fc45c426ae19b8d
cc3fb4348333a4fba755ab77b22448e7
Computes compliant contact forces
int2 *ids, real *correction, bool * active, real3 *vel, real3 *omega, real3 *vel_fluid, real3 *JXYZA, real3 *JXYZB, real3 *JUVWB, real *rhs) { for (int index = 0; index < number_of_rigid_fluid; index++) { uint b1 = ids[index].x; uint b2 = ids[index].y; real temp = 0; temp += dot(JXYZA[index...
1
9ab06af0f6a0d3b2bfc50fc56123a62c
3037d499ec56c584710f04d0842946a0
Can all the procedures returned by getProcedures be called by the current user?
{ if (mCurProcedure == null) { return false; } return mCurProcedure.getType() == type; }
0
75986c29669b7a2ac9f0cf90dd6b8b07
ce17a25c703d07e239e928843e205d92
main wolf cms filter function which applies the current filter to the content
{ list($class, $method) = explode('::', $filter); if ( array_key_exists($class, $this->helpers) ) { $class = $this->helpers[$class]; return $class->{$method}($content); } return $class::$method($content); }
1
99d66b7e4ca3ccdcd690cd50da7d0d59
d8e8c5debbbd6a26b41733a51c48c8c7
Sub classes should call this at the end of {@link #setValues} once they finish changing isEmpty(). This is needed to fix b/18194655.
void clearValues();
1
6beac94e074acf8a3e71c14e011d8f9e
375a70292848425855f4c745eacb960e
Welcome messages go only to mailing list members, not to nonmembers.
class MailingListsController extends AppController public function isAuthorized($user, $request) { return true; }
0
3e50c0856c09c3133e22c486d5e38a8a
e959106f97a3cdd2a842951ad38cd5e6
如果匹配到最后一位
public class RegexMatch private boolean match(char[] str,int i,char[] pattern,int j){ if(j==pattern.length) return i==str.length; if(j<pattern.length-1 && pattern[j+1]=='*'){ if(i!=str.length && (str[i]==pattern[j] || pattern[j]=='.')){ return match(str,i,pattern,j+2) |...
1
073f8928d35f20cd9183e9b96cf04fb6
7161e1263e7eb3f64518483431e656f2
Sets opening direction (positive or negative on axis opposite of facing).
public class Gate public static void setDirOpen(TEBase TE, int dirOpen) { int temp = (TE.getData() & ~0x10) | (dirOpen << 4); TE.setData(temp); }
1
3a2c990c209e3099e683014624da96c2
0d9ac0bca102795b8dc4818ca6bbba53
Returns a newly created SAX 1 Parser, using the default parser factory.
SAXParserFactory saxf = null; try { saxf = SAXParserFactory.newInstance(); saxf.setValidating(false); saxf.setNamespaceAware(true); } catch (Exception e) { LOG.error("Cant create namespace aware SAX Parser Factory: " + e.getMessage(), e); } return saxf; }
0
12f1cdeb85c3b5f787a167784b7af946
d41704c5b3c067d754358b6d28e10fb4
Transform the object into a difference shape.
transform, forward = get_transform(bounds, size=size) arcs = [] geometries_by_layer = {} for layer, features in features_by_layer.iteritems(): geometries = [] for shape, props, fid in features: if shape.type == 'GeometryCollection': continue geomet...
1
3ef735d1256b26957bc1a88e15d11218
689f378fdf0f2eb4373d635dfb28a594
DoS for a Fermi Gas
MSq, MSq_vev, dof, c = bosons y = np.sum(dof * (MSq*MSq*(np.log(np.abs(MSq/MSq_vev) + 1e-100) - c) + 2*MSq*MSq_vev), axis = -1) MSq, MSq_vev, dof = fermions c = np.asarray([1.5]) y -= np.sum(dof * (MSq*MSq*(np.log(np.abs(MSq/MSq_vev) + 1e-100) - c) + 2*MSq*MSq_vev), axis = -1) ...
0
be9d6aa22ccf65f269a0de727532ea43
e744989615203fe8e791dfbf6d2a5bde
重置宽度配置
function reset() { if (!sliderWidth) { sliderWidth = element[0].offsetWidth; } if (!sliderWidth) { return; } var wid = getWidByVal(scope.value); var disWid = getWidByVal(scope.disabledValue); scope.curWidth = { width: wid + 'px' }; scope.barLeft = { l...
1
f0f195fb4c8abc0f1fd37048beee025b
4d4381d40ae85072e5dc21c1e8f8d26d
Note that, even though you're probably not storing the Transform as a pointer, you might still want to return a pointer (the address of the transform field). This is one way to ensure that when accessing the transform from outside the class, you're changing the entity's actual transform and not a copy of it.
const Transform& Ex10Camera::GameObject::GetTransform() const { return m_Transform; }
0
6aab0761052fe5310496607a6965a56f
2c0241c3c9f23fe2a567830c1c00a013
清空旧有函数信息
function clearFunc() { functionText = ""; $(".functionText").text(functionText); }
1
0423c86cff6e808adaef24204b5eab86
525327f94da44ab7ec1a117b60a7b56c
交易处理,根据请求报文解析交易码创建交易处理组件并执行
Response response = null; Message m = null; try { m = process(bizReqVo, preProcess(bizReqVo)); response = respHandler(m,bizReqVo); } catch (PlatformException e) { response = new Response(e.getRealCode(), e.getMessage()); response.setFlowId(bizReqVo.getChannelReqId()); return response; } catch (...
0
7199b753447642c7ab5caed7f1c630ea
9fc476f3f531e92cfb73f3177a0eff3b
This decorator function is used to mark methods or classes that they are not required for interface compliance.
def not_required_on(*args): def _dec(method_or_class): return method_or_class return _dec
1
ed207c544ca3cbc516a66bf4c1be14bb
7fbb3c1235255b28df5d515aa95ef7a6
Read requirements source files and merge it's content.
requirements = requirements or self.env.requirements def iter_lines(fn): with open(fn, 'r') as fin: for line in fin.readlines(): line = line.strip() if not line or line.startswith('#'): continue ...
1
071147dfcb70f4e47970a627b6e5b9d8
2ea10f464bf38b57e62c2f9a339739ec
Gets the id of this ChargingStation.
public class Station public Integer getStationId() { return stationId; }
1
dec649f8a725d88c753fda9adf271181
5629282b7a10aba5295ee542bf5f934b
根据参建单位主键查询参建单位名称
public String getUnitNameByUnitId(Integer unitId);
1
62cca488d45cd53f21dafc67996865c4
05e0021d142f6b35377d01bdb8022754
for CLUSTER
void cluster::printCluster() { m.pti("clusters: ", currentCluster); for (int i = 0; i < nVertices; ++i) std::cout << i << ": " << clusters[i] << "\n"; m.pti("distance: ", distance); m.pti("cluster: ", currentCluster); }
1
63c53f01f28a90fd6b731b30cd0eb8c2
89037a89484ac3f535987f088d7af3db
准确率计算函数(输入迭代过程中生成的每一个权值,用矩阵相乘的方式计算每个权值对应的准确率)
def Acc(output,true_label): acc = np.zeros(len(np.unique(output))) for i in range(len(np.unique(output))): acc[i] = float(np.sum(output[true_label==i]==i))/float((np.sum(true_label==i))) return acc
0
cc1d7b7bddda2955ec00992842be64a6
4d6ac578ce83bc68c7af17bb580205fb
Snapshot has been fired so update bypass state to the state stored in the recalled snapshot.
void AutoPanner::snapshotFired() { enablePanState = autoPannerValueTree.getPropertyAsValue("EnableAutoPan", nullptr).getValue(); enablePanButton.setToggleState(enablePanState, dontSendNotification); if (enablePanState == false) { setPanAmount(0.5); panningSlider.setValue(0.5); } }
0
a603d025898da389608abecc2fe21cf9
6df248e017dd15dc1b407b328cf50969
绑定评论元素整体的点击动作监听器
$(commentId).click( function () { var blogId=$(this).data("blog-id"); clickedFriendBlogCommentId=blogId; } ); }
1
cdd78a2c042e07a31577e391a0000c0e
6255e46656166077bcc6b7b0257bb618
统计我创建或加入的群组总数
namespace QQLib public class QQGroup private int GetGroupCount(string skey) { string uin = "o0" + qq; string bkn = QQJSEncrypt.getBkn(skey); HttpHelper http = new HttpHelper(); HttpItem getGroupInfoItem = new HttpItem() { URL = "htt...
1
6d88d8c33ba35f08a977d2bd522078e7
e917912aa6987ec4c35e9b93fa5ce775
Fill missing data columnwise by interpolating with the last available data.
class MyStrategy(strategy.BacktestingStrategy): def interpolate_nans(self, X): for j in range(X.shape[1]): mask_j = np.isnan(X[:, j]) X[mask_j, j] = np.interp(np.flatnonzero(mask_j), np.flatnonzero(~mask_j), X[~mask_j, j]) return X
1
39b7889e651b65941b59f768fcb85b9b
91583cb4d49e7f9c1f0dcfdb7ea1e581
Выполняет поиск начальников всех уровней
global $db; $control_company = $this->control_company($emp); $sql = "SELECT ORG_chief.id AS ORG_chief_id,ORG_boss.boss_type, ORG_boss.`level` as level, chief_employees.id AS chief_employees_id, chief_employees.surname AS chief_surname, chief_employees.name AS chie...
1
f4fc16ea66125b8badb44c830559d8b0
377f46467e2e322138b6ed3da55c3e53
Test Bit.ly asynchronous shortening.
url = "http://www.example.com/" l = Link(url=url) short_url = Link.shorten(l) self.assertLess(len(short_url), len(url))
0
08f7c8118ea50d223787faf30e541777
cff925589f77c043ad92375482c1d01e
Return current dns server ip
{ PFIXED_INFO pInfo = NULL; DWORD dwInfoSize = 0; in_addr DNSIp; if(ERROR_BUFFER_OVERFLOW == GetNetworkParams(pInfo, &dwInfoSize)) { pInfo = (PFIXED_INFO)::HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwInfoSize); if (ERROR_SUCCESS == GetNetworkParams(pInfo, &dwInfoSize)) { DNSIp.S_un.S_addr = inet_addr(...
1
56836c9b87c37bea9e446741ff1ed70a
06dbcab40c6f0b378fe4e284d3a14c28
Test displaying help (short version)
#[derive(Parser, PartialEq, Debug)] #[clap(name = "lorem-ipsum")] struct LoremIpsum {} let help = utils::get_long_help::<LoremIpsum>(); assert!(help.starts_with("lorem-ipsum \nFoo.\n\nBar\n\nUSAGE:")); }
0
2628f6f0d34760ae975233f1a7305db0
ae409f941d329566857556b13bbab393
Returns the options for selecting the policy.
class SkuPolicyMode implements ArrayInterface public function getOptions() { return [ 0 => [ 'label' => __('Use Config'), 'value' => Helper::SKU_POLICY_USE_CONFIG, ], 1 => [ 'label' => __('Standard'), 'value'...
1
fe56ab971d9a6894d4e27d7923cc31c4
5f58a74514c53d9d70a37d1804ea794f
Tests that the QPE circuit can correctly estimate the phase of a random two-qubit unitary.
dev = qml.device("default.qubit", wires=6, shots=(10000, (20000, 2), 30000)) @qml.qnode(dev) def circuit(): qml.Hadamard(1) qml.Hadamard(0) qml.PauliZ(0) qml.Hadamard(3) qml.Hadamard(5) qml.T(5) return ( ...
0
84c5c25659b6d8ab64a69c4122dfa16b
9b6de7836675f728dd25d5ce7ff1c066
Test PM density calculation based on data from the sensor.
class PMSensorTest def test_above_no_dust_voltage adc_value = 57 expected = 1.0549 sensor = Sensly::PMSensor.new(adc_value) assert_equal expected, sensor.pm_density.round(4) end
1
acba7895527372d152fa8400d6602476
38e362ee24a64c21ee08c3be227d3561
returns the current project from environment
def current_project(): from testbase.conf import settings return Project(settings.PROJECT_ROOT)
1
dd4fd3f0848b0f8dc323791f86341c6d
fd8c55d4ba35697b5bb3b0f26ab8669c
设置排序字段,inq_inquiry_order_goods
class SkuReadSearchSkuList public function setOrderFiled($orderFiled) { $this->orderFiled = $orderFiled; $this->apiParas["orderFiled"] = $orderFiled; }
1
86316c8d80f5cf7b7dd10a80fb7f06d9
fe2afb2ec1a5aa3c1c734dacf99ab40d
Entry point of DHCP Server.Do some system level initializations in this routine.
void DHCP_init (void) { prev_hook = usr_init; usr_init = DHCP_cfg_hook; RUNDOWN_ADD (DHCP_exit, 259); }
1
8e81bcce20c5a74415de46032120649e
c52af902556175991aa75219a3f94ea7
启动文字转语音页面
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "开始语音"); startActivityForResult(intent, VOICE_RECOGNITIO...
0
cb8934d09c6ae290cefe58a6fcccb90e
19c6669b577e1a940942b8fa375e80ae
traverse the list and convert to a singly-linked list
rst = None while head is not None: rst = TreeNode(head.data, rst, None) head = head.next return rst
0
283fdc5bda99dcea89813f66725f078e
df855b8d8d784bdb9f408e58343e4860
범위 내 요소의 개수를 카운트하는 함수
int countByRange(vector<string>& v, string leftValue, string rightValue) { vector<string>::iterator rightIndex = upper_bound(v.begin(), v.end(), rightValue); vector<string>::iterator leftIndex = lower_bound(v.begin(), v.end(), leftValue); return rightIndex - leftIndex; }
1
28b600edea3f54a2323f65e90f3ac445
e41cde7e6958138b12e8defc644d966a
Start process that would normally exit instantly and install busy loop at entry point.
pub fn test_kernel_entry(_boot_info: &'static BootInfo) -> ! { init(); test_main(); halt_loop(); }
1
5f63af628376c36deaccdbd9d06aec65
0d909c2ec32fa2642d82b79473ce95aa
Converts a pixel value to a UTM value
class Geomap: def point_pix2utm(self, x, y): return [ x * self.scale_x + self.utm_x , y * self.scale_y + self.utm_y ]
1
5111b2b38b641d7197a961937d2c57ce
e2cac15d8d0860feffbc264eb78bc025
查询对应班级学员 后分组
@Service public class CourseTeachingClassStudentGroupServiceImpl implements CourseTeachingClassStudentGroupService @Override public List<StudentViewData> getNotGroupedStudent(String t_course_teaching_class_id) { return studentService.getNotGroupedStudent(t_course_teaching_class_id); }
0
0451c2e82e88e36c4816bb73310e34b7
9c1dce0fa056724ceeeaf92366ec9a54
获取已分红日期
let deadline = init_ts; let min_ts = init_ts - time_out; if (action_ts > min_ts) { let n = 0; let b = init_ts + time_out; while (action_ts > b) { n = n + 1; b = init_ts + duration * n + time_out; } console.log('-------------------nnnnn-----', a...
0
d3f26cf79bbb58eafd4d07658b0873a8
e79656a4bf8d68c6e425d6d9e8152723
Zwraca czas wylaczenia silnika.
namespace AssignmentCAB201 class Plane public float GetRefuelTime() { return REFUEL_TIME; }
0
195d347764bc542a4f23eeaa93d16b85
7aa6e8bd3a01c070af84f11e417f2863
should only return the highest priority process that has "arrived"
impl<T> ProcessTracer<T> where T: ProcessCallback fn get_prior_ready_proc(&mut self) -> Option<usize> { let mut result: Option<usize> = None; let mut max_pri = 0; let mut max_ready = 0; for (i, proc) in self.procs.iter_mut().enumerate() { if proc.is_ready() { match result { Some(_proc) => { i...
1
1d1a0ad635893186eb044b9305a3c4e6
fb5130f7a72ad0c618e91f12f39d5197
删除无效节点(可能由于主动中断或者其他因素导致的线程失效),获取第一个有效节点或空节点, 或者称作获取锁持有节点
namespace java.util.concurrent.locks [Serializable] public abstract class AbstractQueuedLongSynchronizer : AbstractOwnableSynchronizer private Thread FullGetFirstQueuedThread() { Node h, s; Thread st; if (((h = Head_Renamed) != null && (s = h.Next) != null && s.Prev == Head_Renamed && (st = s.Thread) != nu...
0
c1e217fa283faa5241669f0325fbbca0
d98f1c7445a1d65f73c82398b2e89fa7
Get the coordinates of the center point of the mask
if maskImage.dtype != numpy.uint8: raise TypeError('maskImage must be an array of uint8.') coords = skimage.measure.find_contours( array=maskImage.astype(bool).astype(numpy.double), level=0.5, fully_connected='low', positive_orientation='low' ...
0
ef041c9a81489808b038d46fce3d9061
f4627580c78d29d5640baca1281c9330
获取BCD码的长度
function lengthb(s,b,i,c) { if(s == null || s == undefined || s == ""){ b = 0; }else{ for(b=i=0;c=s.charCodeAt(i++);b+=c>>11?3:c>>7?2:1); } return b; }
0
fb6b59dc09db4ec7fcd7a6beeb748aa6
a50412650a500a4c73b857aa3937fdab
Defines whether the writer should expand records with less columns than the number of headers. For example, if the writer is using "A,B,C" as the headers, and the user provides a row with "V1,V2", then {@code null} will be introduced in column C, generating the output "V1,V2,null". <p>Defaults to {@code false}</p>
public boolean isCsvAfterRow();
0
7f7fad202bbb342b095099c28840eea2
0fef1ecba7a4ee5286f246c294a53458
Don't send ctrl-c / SIGINT to the Java gateway:
def init_worker() -> None: signal.signal(signal.SIGINT, signal.SIG_IGN)
1
7d624e32ec38e1d690055aa8be527289
767996c8ab6288147683fcbd7aedf637
Transform words into standardized terms by lowercasing, de-pluralizing, and ignoring stopwords
public class SearchManager implements Searcher public List<Term> sanitize(String text) { String textlower = text.toLowerCase(); String[] textNew = textlower.split("[^a-z0-9]+"); ArrayList<Term> noStopWords = new ArrayList<Term>(); for (int i = 0; i < textNew.length; i++) { if (!_stopWords.contains(textNew[i]...
1
c486a4cced2a0c1c87390877254c78a3
e47e052366841af03ee6b1a4934e9cd5
create package for selected culture
class CtransifexHelperPackage public static function package($jLang, $project) { $folder = JPATH_ROOT . '/media/com_ctransifex/packages/' . $project->transifex_slug . '/' . $jLang; $zipFile = $folder . '/' . $jLang . '.' . $project->extension_name . '.zip'; if (JFile::exists($zipFile)) { JFile::delete($zipF...
1
376f5e58a1e16ca8839637c264e0b76a
a5faa8243b2525bd4dac4d5debf07830
Check for WM_CLIPBOARDUPDATE messages
void ExternalClipboard::WindowsClipboardHasChanged() { #if (_OLE_VER >= 0x200) if (m_fIgnoreChange) { return; } #endif if (!IsOurs() && m_fUpdateSystemClipboard) InternalClipboard::Clear(); }
0
41c11598997ae1279c169a90da9899e7
95b97ebd4a9e7e80c882e3445152ce11
Gets the max value a dtype can take
int maxVal(int matDepth) { switch (matDepth) { case CV_8U: return 255; case CV_32F: case CV_64F: return 1; case CV_32S: return std::numeric_limits<int>::max(); default: throw std::invalid_argument("Unrecognised Mat depth"); ...
1
3f23410feea96b4942f0e6301ff9ce4b
dd42c1a5f71d983817dad8eaa8292d0d
功能: 将slave信息转换为字符串 返回: slave信息字符串
try: if not slavelist: return True elif slavelist[0][10] == 'No' or slavelist[0][11] == 'No': return True return False except Exception as e: log_error("mysql_get_slave_status():"+str(e)) return True
0
9790fa82f8b92dd5efbaa581cfc95a05
3dfa0eb878fd13fdfd0456b9f89110c8
@brief Inquire call forward
int requestId; synchronized (mLock) { requestId = sRequestId; sRequestId++; } if (DBG) { Log.d(TAG, "queryCallForwardInTimeSlot(): requestId = " + requestId); } Message msg = mHandler.obtainMessage(IMS_UT_EVENT_GET_CF_TIME_SLOT, ...
1
b4032959dbb710caa7567e28046f0574
d1269fba812186da6c892f5c4bbb2087
Returns an adjusted collection of expressions nominated for evaluation.
class Puppet::Pops::Evaluator::EvaluatorImpl def eval_CollectExpression o, scope Puppet::Pops::Evaluator::CollectorTransformer.new().transform(o,scope) end
1
4eaf77696bc5953606f355a0c8612ac8
06e12f94e7f199b0c1679238e013ca48
Returns the meta object for the attribute '{@link datamodel.ElementaryBid#getPriceEnd <em>Price End</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
com.microsoft.schemas.crm._2006.webservices.CrmMoney getPrice();
0
a388468415a63cb383d4e7af95e557f5
b86c0d1c6e0a6135baaf4853c67616ae
Returns the software, if it exists
public final class NginxProperties public String getSoftware() { return this.software; }
1
6723c0f0cad980b80b3628a982c23eb3
df33287664410cc7997546ab5b055aa7
对于关键字参数,函数的调用者可以传入任意不受限制的关键字参数。至于到底传入了哪些,就需要在函数内部通过kw检查 仍以person()函数为例,我们希望检查是否有city和job参数:
def person(name,age,**kw): if 'city' in kw: pass if 'job' in kw: pass print('name:',name,'age:',age,'other:',kw)
1
2c4e576b41d39ed06f70c4d0acd9bf45
a837c3c7df048b316e0152a99e111664
Drop all armor and main inventory items.
override void HandleBody(PlayerBase player) { player.DropAllItems(); player.SetHealth(0.0); }
1
ab9d70368a255337770f139e78579bd5
6fcd4ed6f3eec9ef8ee19931d937c29a
Filter valid results for a given geometry from list of results.
function filterByGeometryType(geometryConfig, featureType) { return !(geometryConfig.indexOf(featureType) === -1) }
1
26a249072d94b3dcea145e42ace72ae1
1d0ff603e8d266f9ee27b546bcadd359
Increment maximum size by numNewRecords.
auto previous_value = mMaximumAccessRecordsNum.load(); while (previous_value < value_new && !mMaximumAccessRecordsNum.compare_exchange_weak(previous_value, value_new)); }
0
895681b5c596731f5fb7c86ea3cb75f2
2709557c95e1c7f0307234aebe831d4d
Gets the window for a tabmail tabInfo.
function getTab(tabId) { const tabSwitcher = MainView.getInstance().tabSwitcher(); const view = tabSwitcher.getTabView(tabId); const tabLink = tabSwitcher.tabIdToLink_[tabId]; assertNotEquals(view, undefined, tabId + ' does not exist.'); assertNotEquals(tabLink, undefined, tabId + ' does not exist.'); retur...
0
6f84c0606fce6644392107a0803b07bd
78c18c7d31fc6015c3a6e4c375105f36
根据日期获取属相
Calendar time = Calendar.getInstance(); time.setTime(birthDate); int month = time.get(Calendar.MONTH); int day = time.get(Calendar.DAY_OF_MONTH); if (day < constellationEdgeDay[month]) { month = month - 1; } if (month >= 0) { return constellationArr[month]; } return constellationArr[11]; }
0
8b752a39ef62c485b095959622699f85
f0982673b3880da5eeafc434f6ee63bb
Mapping from the request create order to the domain model.
class ApmOrderHandler extends AbstractOrderHandler public function createOrder(PayPalOrderParameter $orderParameter) { $order = new Order(); $order->setIntent(PaymentIntentV2::CAPTURE); $order->setPaymentSource($this->paymentSourceFactory->createPaymentSource($orderParameter)); $orde...
1
6c8687d90960a69b4ed7868c5a21b92f
c78dceebcc5a8f6c2c045563f6942d42
Set MIDI channel sharing.
{ Assert_Param(IS_MIDI(MIDIx)); Assert_Param(IS_MIDI_MCUCHx13_DH(CH2B)); Assert_Param(IS_MIDI_MCUCHx13_DL(CH2A)); MIDIx->MCU_CH2 = (CH2B<<16) | CH2A; }
1
94bac5321cdff7fa81a39d804abbfbc2
dd7aa697d2e80bb16bf642da41594afa
Resume patch transfer
Trace(); if (!GetOneFile(settings, "files.pb", 0)) { Log(LL::Error) << "Unable to get file listing." << std::endl; return false; } launcher::FileList newFileList; if (!appshared::parseProtoFromFile(GetOutputPath("files.pb"), newFileList)) { Log(LL::Error) << "Unable to parse file listing from serv...
0
9f0b572cf42e7f61a84e374b87f66ccd
32cbbd053ab3fc1585bd7ac2659b0816
识别二维码线程
{ myPtf("start DecodeThread \n"); while(decodethread_stop == 0) { if (decodethread_on != SCANTHREAD_STATE_WORKING) { usleep(100000); continue; } if (video_on==0) { myPtf("video_on == 0,run v4l2_on\n"); v4l2_on(&v); ...
1
7e92aa20e99bf9e4068b91a05c72e8ad
8d2777e4f8103f09821cd97126278bcf
获取某个号码某个时间段被呼叫的次数
class LinesData extends Base{ public function get_line_connect_count($line_id, $duration = 1) { if(empty($line_id) || empty($duration)){ return false; } if($duration != 1){ $duration = $duration * 24 * 3600; $time = time() - $duration; }else{ $time = strtotime(date("Y-m-d")); } $coun...
1
61b6b273a53888a485b44c010280b07a
6a89a27811773ad9d8dca43c1b6a67a5
Return the first link (url) in the soup which matches the 'match' parameter
link_list = get_all_links(soup) for link in link_list: if match in link: return link
1
41c54abb932a8cb36c27a3bd91d26af4
0a7651cb406355c00f7294d25fb33002
签到指定日期
class SignIn extends SigninModel public function sign($user,$sign_date) { $sign_date = str_replace(",", "-", $sign_date); $sign_set = self::get_setting(); if(!$this->check_sign($sign_date, $sign_set, $user)) return false; $sign_in = $this->get_points($sign_date, $sign_set, $user); $check = ...
1
7cbd12cbd157e9fc5e4961b778c9eef1
d3fabd2868cc20451dc224516cd8e441
Copies asset file bytes to destination path
{ using (FileStream fileStream = File.Create(destination)) { Assembly.GetExecutingAssembly().GetManifestResourceStream("MurkysRustBoot." + source).CopyTo(fileStream); } }
1
2ce2ad94630b9c42b822a98c8a3d99ea
dfd6494e6043d7897db7c69450a070aa
Identify all loads and stores.
for(auto funct = unit->Functions().First(); funct; funct = funct->Next) { if(funct->Value->IsDefinition() == false) { continue; } auto instrEnumerator = funct->Value->GetInstructionEnum(); while(instrEnumerator.IsValid()) { auto instr = instrEnumerator.Next();...
0
98f200719782ff91855d09b5560d5f45
84e07e95410ae5a66c6bc75ea48db371
Initializes the weapon with the given ID.
WeaponModel::WeaponModel( KeyValueFile* p_config ): Item(p_config->getInt("id")) { this->mWeaponType = NULL; this->loadFromConfig(p_config); }
1
55ec2139682278b8b45af4a2225903e7
8f4d5cdba06e70ca4ac67a2beb219d8f
渐进绘制边框
if (this.options.outline === false) { console.log('如果您想创建多边形边线,请在options中设置outline为true'); return; } options.width = this.options.polygon.outlineWidth || CesiumPolyline.defaultStyle.width; options.material = this.options.polygon.outlineColor || CesiumPolyline.defa...
0
b7efe88e9a71f55f200547b36d6193f8
a3ea2eae77c68610e10f8dd19c033a68
Custom activation layer, with the tf.nn.relu as default
class ActivationLayer(SimpleForwardLayer): def __init__(self, name, activation=tf.nn.relu): super().__init__(name, [], {}) if activation is None: raise Exception("Activation can't None") self.f = activation
1
f13d92343808d7cbe2dfb896adc492c8
2c55b90755a3ac29d320e6bf927c86fc
从书籍地址中解析书籍名字
namespace VShawnEpub.Discuz public class LKDiscuzBook:BaseBook public static string GetBookName(string webtitle) { if (webtitle.IndexOf("-轻之国度") > 0) { webtitle = webtitle.Substring(0, webtitle.IndexOf("-轻之国度")); } if (webtitle.IndexOf(" - 轻之国度...
1
ad21e150ea6b7ebf29fe40f1dad21d6c
6a0abb66a19336ec471e00fa0f65c9cd
Returns the first element of the queue, or null if empty.
namespace Org.Apache.Etch.Bindings.Csharp.Util public sealed class CircularQueue<T> public T Get() { return Get( 0 ); }
0
6e03935f27a54b2a0046fca034fcacdf
aa37b10f9ac097e4642907f3da90886d
FUNCTION M1BF_FillOXADestM1Bit DESCRIPTION Sets the destination pixel data based on the logical function "OR", "XOR" or "AND". INPUTS None. OUTPUTS None.
public static extern int PKG_Fill_OR16i(ref EventInfo info, short EventType, short Src1, short Src1_axis, short data, short dest, short dest_axis);
0
713c41fca1fea3242b2d2cbbef2bd260
855090524bc1d85857d777d3e87155ac
返回该节点的所有邻接边
{ QList<Edge *> returnList; if (mainEdge && mainEdge->sourceNode() != 0) { returnList << mainEdge; } foreach (Edge* edge, edgeList) { if (edge->destNode() == this && edge->sourceNode() != 0) { if (!returnList.contains(edge)) { returnList << edge; ...
1
eb48021dc603ad34c5947718d54e55bd
37cd8d6baa1f64d41c5def63d0a65d3f
Returns the number of entry bytes.
class ShuffleEntry(object): def size(self): return (16 + len(self.key) + len(self.secondary_key) + len(self.value) + (len(self.position) if self.position else 0))
1
1c240d3ea2a58c1a4a6f6ae4c7a8410e
8672d02fd06b2b2e341e868e9082bdcd
获取site的所有床位信息
public ServiceResponseData GetBedInfo() { int workId = requestData.GetData<int>(0); DataTable dtBedInfo = NewDao<IOPDDao>().GetBedInfo(workId); responseData.AddData(dtBedInfo); return responseData; }
0
f88c1187f5aa815af8b20798e31b755e
c88f26de770f9056facedbe14557c857
Check SeqFeatures of a sequence.
filename = sample[2] path = os.path.join(self.seq_filepath, sample[1], filename + '-' + str(self.seq_length) + \ '-features.npy') if os.path.isfile(path): return np.load(path) else: return self.extract_seq_features(sample)
1
a912318e5a9bb818dd41df65c0a7866c
a5ccda2039b48d3c1856f92983e3cc58
delete translations for a language id
class CategoryGroup extends Model public function deleteTranslation($category_group_id, $language = null) { $conditions = array('category_group_id' => $category_group_id); if (isset($language)) { $conditions['language'] = $language; } return (bool)$this->db->delete('categ...
1
57d4c57e3d78cbe31dabd75c38eb8cdd
febbcd3f6b69d81503ab08b0b1b8a3d7
Edytowanie typów maili wraz z nazwami językowymi
$id = $data['id_ed']; $mysql_update = "UPDATE `letter_templs` SET `menu_name-rus` = ".db_quote($data['ed_menu_name-rus']).", `menu_name-eng` = ".db_quote($data['ed_menu_name-eng']).", `menu_name-ukr` = ".db_quote($data['ed_menu_name-ukr']).", `text-rus` = ".db_quote($data['ed_full_text-r...
1
1a99cf4f5177091cf136fada5cb093fe
aee64626bc5bea46a2d4ee98240b2862
Returns the JS URL prefix (like domain) with trailing slash.
if (self.config.enable_jsdelivr['enabled']): return "https://cdn.jsdelivr.net/gh/%s/" % \ self.config.enable_jsdelivr["repo"] else: return self.config.site_prefix
1
300889b707e5755192fa8b4de911ca3f
c1f0221bc53f8664f911f4273841e12a
SERVER GET DATA PART ->
async function getData(url='localhost:3000') { const response = await fetch(url, { method: 'GET', mode: 'cors', cache: 'no-cache', credentials: 'same-origin', headers: { 'Content-Type': 'application/json' }, redirect: 'follow', referrerPolicy: 'no-referrer', }); ...
1
11e9da9e9a068cd0616d9fdb5633b845
2062f58f0df59f5da4cfbc9a8fc648a4
处理多行字符省略号
function string.stringEllipsis(szText, sizeE,sizeCN,maxWidth) local width = 0 local szResult = "..." local bOK = false local i = 1 while true do local cur = string.sub(szText,i,i) local byte = string.byte(cur) if byte == nil then break end if byte > 128 then if width <= maxWidth - 3*sizeE then ...
0
51d0ce60964f064d431acd010bdcdd7b
de4ea1703012d02d9130934f84525214
Function to redirect user for authentication in case of Token Request Failure exception
class TokenAuthenticator extends AbstractGuardAuthenticator public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { $data = array('message' => strtr('You are not valid. Try again later.', $exception->getMessageData())); return new JsonResponse($data, Response:...
0
7fb25ff03865721ee045f13296ff1a5d
74c053c7ac80f857f2a71758fdf33dc4
Controller for reading a phone number
number = raw_input("Please, enter number to call: ") if validate_number(number): print 'calling: {}'.format(number) return number
1
257d6345b9d2d92c3f50fcd461fac0b1
6a22f9708aaf068ad81dd07e02e45f06
使用POST方法发请求
fun PostRequest(Url:String,key:String,value:String):String{ try { val client = OkHttpClient() val requestBody= FormBody.Builder() .add(key,value) .build() val request = Request.Builder() .url(Url) ...
1
2075321ca3c5f2ba7638856ed3717bdb
cd7124b36c6026af7b0e5f7d1b7a55ee
Clear the sequenceTairObjectId data member; override in proxy if lazily loaded, otherwise this method does nothing.
public abstract class AbstractLocusBac extends AbstractDto implements ILocusBac public void clearBacTairObjectId() { }
1