query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
773065f1c09340faf3d82f4337a94362 | 959d5c59cf89f361aec162dd6a2ac3e7 | 获取本地服务器时间 | url = 'https://a.jd.com//ajax/queryServerData.html'
session = requests.session()
result = session.get(url).text
print(result)
servertime = json.load(result)
jdServertime = servertime["serverTime"]
print(jdServertime)
localtime = jdServertime - 30
r... | 0 |
e575636c4192e587e51a136a231221e7 | 64131dbf909ff99843f1a5611abebf5c | 计算字符串长度[全角算2长度] | public class StringUtil
public static int countLength(String str) {
int length = 0;
char[] chars = str.toCharArray();
for (int w = 0; w < str.length(); w++) {
char c = chars[w];
if (c >= '\u0391' && c <= '\uFFE5') {
length++;
length++;
... | 1 |
a5b509cae9d86a785ef7c7ca7ad3923c | f61b1d45a57ece5b560348e902e207da | デフォルトではfigureのBoundsをそのまま返す. | class RegionDoc : Region
override fun getBounds(r: Rect): Boolean {
return super.getBounds(r)
} | 1 |
d0ca0b6bd7b22f52cc818ac27a71da11 | 9b8bc3b65706839cb6db7662cf3ba63b | Orders the given collection descending by the given predicate | namespace ReactiveUI
public static class OrderedComparer<T>
public static IComparer<T> OrderByDescending<TValue>(Func<T, TValue> selector, IComparer<TValue> comparer)
{
return ComparerChainingExtensions.ThenByDescending<T, TValue>(null, selector, comparer);
} | 1 |
ca777690558e55954eec8c1df43db847 | 48ca0c540eba9f8b4185a0567e5f6450 | A structure that contains and allow to manipulate easily a set of parameters | class Params(Core.dictattr):
def __init__(self, *args, **kwargs):
super(Params, self).__init__(*args, **kwargs) | 1 |
b7a90a321d615a12b984b9bdf34c260a | 2a877d2485f5e0134887af0af7084822 | 将字符串转换为Int32(写这个方法是因为 2.00这种格式,用int.TryParse是转换不了的,所以我先转换成decimal类型) | namespace YDH.Finace.Common
public static class StringExtensions
public static int ToInt32(this string text, int defaultValue = 0)
{
var result = defaultValue;
if (int.TryParse(text, out var value))
{
result = value;
}
return result... | 0 |
08d954d342e97f701557b9641f13fdb6 | f302c7b5e868e12b0f00cd0afbf155f3 | List all users for a tenant who meets command arguments. | def list_users():
init_dao(env('client_id'), env('client_secret'), env('tenant_id'))
return Response(get_all_users(r.args.get('since'), r.args), content_type=CT) | 1 |
5d7f2e558d68a7d138575bc7e53678c2 | e08b8653f725d4ada1483543c8d2513a | Performs disk cache check synchronously. | @ThreadSafe
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ImagePipeline
public boolean isInDiskCacheSync(final ImageRequest imageRequest) {
final CacheKey cacheKey = mCacheKeyFactory.getEncodedCacheKey(imageRequest, null);
final ImageRequest.CacheChoice cacheChoice = imageRequest.getCacheChoice();
switch (cac... | 1 |
dfd04cae8f18c5807c70172de9389e15 | 25e085f241663d03160e1822e0639981 | Retrieve a list of triangle index objects that intersect or come quite close
to intersecting the specified 3d bounding box. | public static extern int SphereTrianglesIntersection(
Vector3 center, float radius,
Vector3[] verts, int[] tris, int trisCount,
int[] intersections, int maxIntersections
); | 0 |
af6496997be3de8b85680d09ed82e1a6 | 13ad0afe1423426681eb31cc4fe228e1 | @brief set Free-fall duration LSB | int32_t lis2dux12_ff_duration_get(stmdev_ctx_t *ctx, uint8_t *val)
{
lis2dux12_wake_up_dur_t wake_up_dur;
lis2dux12_free_fall_t free_fall;
int32_t ret;
ret = lis2dux12_read_reg(ctx, LIS2DUX12_WAKE_UP_DUR, (uint8_t *)&wake_up_dur, 1);
if (ret == 0)
{
ret = lis2dux12_read_reg(ctx, LIS2DUX12_FREE_FALL, (ui... | 0 |
21733cb48c7f7bb44f78f5de0848c453 | 1f352a76c61e852fa3715561122af3fc | Create an array from an array expression. | JsonElement json,
SerializationState state)
{
var materializedType = GetMemberFromKey<Type>(json.GetProperty(nameof(NewArray.ArrayTypeKey)).GetString());
var list = json.GetProperty(nameof(NewArray.Expressions));
var expressionList = list.EnumerateArra... | 1 |
8298d16bf4dcdb5f75097d4663b4dc81 | 63e5b5e6243cbf1b490cb6586090c019 | 判断是否为空的元素标记 | function _isEmpty(item) {
if (item.content ||
item.filename ||
item.questions ||
item.title ||
item.linkurl ||
item.url ||
item.remarks ||
item.onoff ||
item.pic) {
return false
}
return true
} | 1 |
96207a9b5e669074a40c32e8680f9f4c | 374ffe48c8a0b753cb9c255da1857a17 | set 地图名称描述(小地图TIPS,支持xml) | namespace EarthView
namespace World
namespace Spatial3D
namespace Atlas
public class Scene : EarthView.World.Spatial.Atlas.Iscene
public override void SetDescription(string desc)
{
EarthView_World_Spatial3D_Atlas_CScene_setDescription_void_EVString(this.NativeObject, desc);
} | 1 |
996513a41b34a0865260ded1ee4b28a1 | 485c865d1fc4a4337bb31c841233de7f | 商品照片类型编码ID的取得 | public class EcmsDetailModel
public String getIdType() {
return this.idType;
} | 0 |
105a9a9acbd3ecb33031d1b1dc8688fd | 45fa2d89485c82a1372b2bd182e19c7d | magic method for 'in' operator to check whether some key exists in a nested dict. | class NestAPI():
def __contains__(self, name):
return hasattr(self, name) | 0 |
b15ef69505451de1ae38b43d30e75c02 | b2ab8862574eb937649189fe8629b6e5 | Method for adding multiple class paths to the load path {@see Autoloader::add_class}. | class Psr4
public function addClassFiles(array $classPaths): void
{
$this->classPaths = array_merge($this->classPaths, $classPaths);
} | 1 |
181210fe3aca574603930f491e14a4bd | 626c2ab5fd287f330f51df0cc422d882 | Writes a object that can be converted to a string to the serial port. | {
var writeString = value.ToString();
try
{
byte[] writeBytes = StringEncoder.GetBytes(writeString);
_serialPort.Write(writeBytes, 0, writeBytes.Length);
}
catch
{
}
} | 1 |
1c669a9608bf9f627249624366fc8d7f | fb354e3767be38b1c15a2e0d9c4ac25d | Prepares a true or false value, whether string or boolean, for sql, which requires an integer. | try:
return type(string)
except:
if string:
return 1
elif not string or string.lower() == "false":
return 0 | 1 |
96a4c70a548a40182547f749d99ad8a0 | f514aa8f4536953bc450341204043431 | Display the resource using keyword searching. | $this->searchResults = UniversalSearch::where('title', 'like', '%'.$key.'%')->where('company_id', null)->where('type', 'backend')->paginate(5);
$this->searchKey = $key;
session()->put('searchKey', $this->searchKey);
if(request()->ajax()){
$view = view('superadmin.search.ajax-... | 1 |
55285c84e341ea6c07877fb98e8fe135 | 0ba9d208d5de15254ef426a9fa96053a | 平台列表界面视图 | class PlatformsController extends Controller
public function showListPage(Request $request)
{
$platforms = Platforms::getList();
return view('admin.platforms', ['platforms' => $platforms]);
} | 1 |
18bde42898b7a44de994cc18c5cb5fb9 | 191e77b25512a189afa257ba19244fd3 | Grab the data elements from the index that we need to disable and enable menu items | MenuIds_t & rxDisable, MenuIds_t & rxRemove, MenuIds_t & rxMarkInherited, MenuStrings_t & rxRename ) const
{
UNREFERENCED_PARAMETER( rxCheck );
UNREFERENCED_PARAMETER( rnSubmenuIndex );
UNREFERENCED_PARAMETER( rxDisable );
UNREFERENCED_PARAMETER( rxRemove );
UNREFERENCED_PARAMETER( rxMarkInh... | 0 |
1435f943394cd64a030933f979f9c572 | 97cb5f964f7739e31b15d726e1393762 | find the line number of the last line the target is suspected for | upper_bd=None, lower_bd=None):
cur_row = math.floor(cur_row)
if abs(cur_row - upper_bd) < 1 and abs(cur_row - lower_bd) < 1:
print(f"Termination condition! Current row: {cur_row}")
return cur_row + 1
if field_cnt_dict[cur_row] == field_cnt_dict[cur_row + 1]... | 1 |
d43163510a2f83df0483224d41065884 | 11f9d9df57a0d388e598a5855393c65a | Initiates the asynchronous execution of the UpdateDataset operation. | DatasetBackendUpdatePayloadData payload,
CustomSearchesDbContext dbContext,
WorkerJobDbContext workerJobDbContext)
{
Dataset dataset = await dbContext.Dataset
.Where(d => d.DatasetId == payload.DatasetId)
.Include(d => d.ParentFolde... | 1 |
d13cdc32dba82202b1aebe2b14ee215d | 4f6f526280189c1dc79d5d2183cd7d9b | Finds and displays a pointVente entity. | class PointVenteController extends Controller
public function show($id)
{
} | 1 |
36fb616f0a41973e29d5828bab579664 | abe343e2ad2f7f261628d1059d6d0b5e | Class encapsulating the necessary functionality for creating arbitrarily-sized, undirected, connected
networks. | class DiGraph:
def __init__(self, nodes=None, edges=None):
self._nodes = []
self.nodes = nodes
self._edges = []
self.edges = edges
self._create_connections()
self._sorted_nodes = None
self._node_wip = [] | 0 |
4248752284567aab9863b8525ed5785f | 63837d994ce74b6f7ebfb4d89a9544e3 | =====================================================================
HAL_dogEnable
This function enables the hardware dog
none
none
===================================================================== | {
dog_kick();
g_mss_int_enable_1 = *(volatile unsigned long*)(HWIO_MSS_INT_ENABLE_1_ADDR);
g_mss_int_status_1 = HWIO_IN(MSS_IRQ_STATUS_1);
g_time_Match_val = HWIO_IN(SLEEP_XTAL_TIMETICK_MATCH_VAL);
#ifndef NO_DOG
ERR_FATAL( "Dog bark timeout.", 0, 0, 0 );
#endif
} | 0 |
a3065625567f0e90d300df8b7385e747 | b7c60f76bc4e6ccf734629162274c61e | A wrapper for Fsmvc.start().
according to defaultAlert() which is used if not provided. | public String startAlertsBroker() throws BaseException; | 0 |
0d96ff44133475c4d8c07f1e97927b1a | 14b5beb94c25cfecc324f243d509377b | Test that shift won't break if it there is nothing in the list. | new_dll.push(3)
new_dll.push(4)
new_dll.shift()
assert new_dll.head.val == 4
assert new_dll.tail is new_dll.head | 0 |
869d8cb18ef8bc6b0ec073dbc28ef109 | e8534d641ae637787fc55ba40950e590 | 根据最优解值的记录,用深度优先搜索构建出所有的LCS | x = new int[num + 1];
a = m;
n = num;
cn = 0;
bestN = 0;
bestX = v;
traceBack(1);
x = null;
a = null;
return bestN;
} | 0 |
d533453d7bbe4abde11db59f983cb6a2 | 23b2b84165e9295b6d5a05d53f65d077 | Convert a Glulx value into a signed char value. Not a Javascript
string, but the bastardized C notion used by the Glk library:
a number from -128 to 127. | def c_schar(i):
return ((i + 128) % 256) - 128 | 1 |
9913df1dc8272e7815bacd7e1900f20e | a86ff200b09cf462509f2fb420a9580c | Gets the netHours attribute of the ServiceContract object | namespace BudgetExecution
IAmount GetHours(); | 0 |
30e6595eb23f4baade94a063d2480807 | fefd58e9bed10b12d00e6f34089fe97f | Cycles all of the provided regex patterns and exits when any of them matches
text from standard output stream. | public void expectErrAllByRegex(
String[] regexPatterns,
int timeoutSeconds ) throws ProcessTalkException {
this.processTalker.expectErrAllByRegex(regexPatterns, timeoutSeconds);
} | 0 |
bd5fbb4023d08c3102f972bf45d02761 | da25bd400a373677cfd2e7395c0d9b72 | 지문인증을 위한 암호키 생성 | @Slf4j
@Service
public class JwtService
public String creatingSafeKeys() {
SecretKey key = Keys.secretKeyFor(SignatureAlgorithm.HS256);
return Encoders.BASE64URL.encode(key.getEncoded());
} | 1 |
6d40851727976de6a9d029d831762003 | 7dc596971f4ae02c6acdbaeaf1f3e4cb | 進行方向を角度をもとに設定する | public class chrController : MonoBehaviour
public void cmdSetDirection(float angle)
{
this.transform.rotation = Quaternion.AngleAxis(angle, Vector3.up);
} | 1 |
963627bd85e943c38604bbd9f5b64a58 | 53cafaa9e6e6110bd620d54f96b12c9b | Invoked to activate and render a page. In certain cases, based on values returned when
activating the page, a {@link org.apache.tapestry5.services.ComponentEventResultProcessor}
may be used to send an alternate response
(typically, a redirect).
defines the page name and activation context | void activate(ActivateRequest req); | 1 |
7c9ef22ea6b3218a800f9b0efd4e4cea | 41ac27a2e3383eafeb247144f01c3d01 | Set budget_id. | class BudgetDetails(object):
def budget(self, budget):
self._budget = budget | 0 |
1de779c1187c4d7c985670d967571d18 | 16415a2177d61ce419940a29980d366d | 判断指定元素是否位于位数组中 | if (key == null || element == null) {
throw new RuntimeException("键值均不能为空");
}
String actualKey = buildBfActualKey(key);
boolean result = false;
List<Boolean> tfs = redisTemplate.executePipelined((RedisCallback<Object>) connection -> {
for (long index : ge... | 1 |
bc721ac7fd19217672954985b1fde66b | da5cee5dbbeb10317a9ca8c0e40f871d | 点是否在线段上 | bool pointonseg(Point p)
{
return cmp((p-s)^(e-s))==0 && cmp((p-s)*(p-e)) <= 0;
} | 1 |
4efd9b34cff55d53eb1411b5cd56464c | 9a9ad5e3b370f3fff916f87363158848 | 根据消息主题、消息状态(已读或未读)发件人或收件人 查找信息
<code>messageTopic<code>[消息主题] <br/>
<code>receiveState<code>阅读状态:0:未读;1:已读;] <br/>
<code>senderId<code>[发件人ID] <br/>
<code>receiverId<code>[收件人ID] <br/> | TransMsgStateRecord findMsgStateByMsgKeys(String msgKeys); | 0 |
f4a0cf28350a989972511c7a8741c0a0 | 54de32e3c3304c58fa25925fc5a64994 | Makes the colors of the palette version of an image more closely match the true color version. | {
ProcessImage(bmp,
[](DWORD& color) {
BYTE r0, g0, b0;
GetRGB(color, r0, g0, b0);
WORD r1 = static_cast<WORD>((r0 * .393) + (g0 *.769) + (b0 * .189));
WORD g1 = static_cast<WORD>((r0 * .349) + (g0 *.686) + (b0 * .168));
WORD b1 = static_cast<WORD>((r0 * .272) + (g0 *.534) + (b0 * .131));
color = ... | 0 |
4ede9e8d6450254649011f2e75dc94c8 | 8f8e12c2f4aaa110fdecdd400199a92b | Starts the actual playback queued up by the arm process. | namespace Sharpex2D.Audio.WaveOut
[Developer("ThuCommix", "developer@sharpex2d.de")]
[TestState(TestState.Tested)]
internal class WaveOut
private void StartPlayback()
{
Stream.Position = 0;
foreach (WaveOutBuffer buffer in _buffers)
{
if (!buffer.I... | 1 |
2bc2068c2bfcbee85b327bbec0c95c0d | b019887ba0163341585db4b499efed90 | Checks what class the IPv4 address belongs to. | {
if ($this->proper_address < 2147483648) {
$class = 'A';
}elseif ($this->proper_address < 3221225472) {
$class = 'B';
}elseif ($this->proper_address < 3758096384) {
$class = 'C';
}elseif ($this->proper_address < 4026531840) {
$class = ... | 1 |
c1861bc88681204102275402299806d3 | 1e6a015e616e7434ffee253a959c8f1e | Find unique coordinates given a list of steps in a path. | def check_coords(coords):
coords_sum = coords[:, 0] + coords[:, 1]
valid_coords = np.isfinite(coords_sum)
return coords[valid_coords] | 0 |
2d11eab7954973584d28d3435f392c65 | a43903827b0585bc002d9646f91d2da9 | Get minimumwordlength option. | class PasswordComplexityValidator extends ConstraintValidator
protected function getMinLength(PasswordComplexity $constraint): int
{
return null === $constraint->requireMinLength
? (int) $this->configProvider->getMinLength()
: (int) $constraint->requireMinLength;
} | 1 |
2f1722c8389092d2963e58746ad44bc6 | 90b83cb8470e97d6ad6ad2d4444df8fc | ##### Define server logic ################################################### | server <- function(input, output, session) {
dat <- eventReactive({input$newplot}, {
long <- runif(10,-121, -77 )
lat <- runif(10,33, 48)
val1 <- runif(10, 1, 30)
val2 <- sample(letters, 10)
data.frame(latitude = lat, longitude = long, val1, val2)
})
output$mymap <- renderLeaflet({
leaflet(data = dat) %>... | 1 |
b3f692fd16e3ecbd4f198aa24d2efd6b | 80f3f9bace05de84a3339c764c7dde84 | Test the elimination of some XSS vulnerabilities | {
$xssAttempt = "<script>alert('xss')</script>";
$expected = "<script>alert('xss')</script>";
$actual = $this->_htmlEncoder->encode($xssAttempt);
$this->assertEquals($expected, $actual);
} | 1 |
905c9b9e928da009f3f5ebbcf3fd5299 | 88aa0b980956afc63e801982d62a2c0a | 持续地对计数器进行清理,直到退出为止 | {
while (count_--)
{
cout << "this is a test ... " << count_<< endl;
sleep(1);
}
} | 0 |
b5817ef0735b77fc2eff976093ebd253 | 6a8e7959085a853b8e5b72fd8e2e72d9 | SPI IRQ priority configuration | void NVIC_Configuration(void)
{
NVIC_InitPara NVIC_InitStructure;
NVIC_PRIGroup_Enable(NVIC_PRIGROUP_1);
NVIC_InitStructure.NVIC_IRQ = SPI1_IRQn;
NVIC_InitStructure.NVIC_IRQPreemptPriority = 1;
NVIC_InitStructure.NVIC_IRQSubPriority = 2;
NVIC_InitStructure.NVIC_IRQEnable = ENABLE;
NVIC_Init(... | 1 |
4436b89a976401a49418bebc5b6d25f5 | bc1eadc78c8d3ef065f603a46641736b | Check if user can't log out if not logged in | client = Client()
client.login(
username="active_user_1",
password=PASSWORD
)
client.get(reverse('logout'))
response = client.get(reverse('login'))
self.assertFalse(
response.context['user'].is_authenticated()
) | 0 |
4773573927044286186fcbc5bdedd235 | 23da743b862b4fe73be07c91ea87af80 | Prints flash text in the center of the lcd row. | void LCD::write(const __FlashStringHelper *text, int_least16_t x, int_least16_t y)
{
this->write(text, x, y, foreground_color, background_color, 1);
} | 0 |
4c1d572f0c022f73a2ad4d64048c0b95 | bbdfa435fadd6a633f2cbb644a111a3b | 新增儿童健康体检问询记录 | @Log(title = "产前诊断体格检查记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TbChCqzdtgjcjl tbChCqzdtgjcjl)
{
return toAjax(tbChCqzdtgjcjlService.insertTbChCqzdtgjcjl(tbChCqzdtgjcjl));
} | 0 |
7ce4efef0cad9c89bb8896eed5b19a1e | f8cdc13f83bc6759ce663e96d2f57e1c | 增加指定货币类型的货币数量,仅缓存在客户端,顶部UI的数值也是客户端模拟改变,游历完成后一次性发送数据到服务器 | namespace Genesis.GameClient
public class RewardCollectionHelper
public void SetCurrency(CurrencyType typeId, int count)
{
m_ReceiveGoodsData.AddCurrency(typeId, count);
} | 1 |
625774738550372d0e434edd85266be4 | 95dc364d357fae7fb52b60c8f8313a14 | convert from H:M:S to samples | int EffectAudioProcessor::calcDelaySampsFromMsec(float Msec)
{
int samps = round(Msec * (fs/1000));
return samps;
} | 0 |
3dd073426a7a72dd39e43a6010b9cb06 | 5c2101363697d86c77313a7b4d053dd7 | Removes any data validation, if present | {
if(empty($this->validation_data) || empty($this->_field_data))
return false;
foreach($this->_field_data as $field => $value)
{
if(!array_key_exists($field, $this->validation_data))
unset($this->_field_data[$field]);
}
} | 0 |
d5d3f5d7bc8ebd12f6154d212457ce75 | 648acaa4f890c4382663266219de5e97 | Compute the public keys of the specified subaddress. | match &self.private_set {
Some(priv_set) => Ok(priv_set.compute_key_images(&self.hashed_pubkey_basepoint)),
None => Err(Error::NotASigner),
}
} | 0 |
84e908547cff356c10b8e6516e36ed94 | eb172ff22af667d4e496e7509a0cef4f | Set Model e View da solução One | namespace PesquisaOperacional.Gurobi.Core.Solver
public class GurobiSolver
public SaidaViewModel Run(EntradaViewModel entrada)
{
CriaVariaveis(entrada);
CriaFuncaoObjetivo(entrada);
CriaRestricaoHR(entrada);
CriaRestricaoHE(entrada);
CriaRestricaoD... | 0 |
5414e8aa1f7f8f98c2ca78e0b70200b3 | de21de09ac1579894832e6eb9b4da082 | Creates the temporary monitor with the combined reports to be displayed on common graph | function createTrendReport(category)
{
document.getElementById('buttonViewer').style = 'display:block';
document.getElementById('visualisation').innerHTML = "";
var data0 = [];
var data1 = [];
var data2 = [];
var data3 = [];
var data4 = [];
var data5 = [];
var data6 = [];
var ans... | 1 |
cb997fc43e7f1c0d81c15e142dd70754 | d2240ec709146654ba4fcf295bcf920b | 结束时间是否已经到期 | {
String endTime = map.get(key);
if (StringUtil.isNotEmpty(endTime))
{
return true;
}
return false;
} | 0 |
42686be73c115181a68a8dd100a9b492 | 17eba17befba0905f6cb053f8ca3a3f4 | オブジェクトの配列から特定のプロパティの最小値を取得します. | function minBy(arr, fn) {
return Math.min(...arr.map(typeof fn === 'function' ? fn : val => val[fn]))
} | 1 |
af01ba986fb5fe4851af28a588661df3 | ea1c1a50c5761ad28a3d88555e85b51f | Throttled ndb delete. | self.conn['test']['test'].insert_one({'name': 'paulie'})
assert_soon(lambda: self._count() == 1)
self.conn['test']['test'].delete_one({'name': 'paulie'})
assert_soon(lambda: self._count() == 0) | 0 |
d1c589da109618a5ec562d53958a5140 | e5316d142117e987accd8d9c58aa3acc | Creates launch_request from input params | def get_request(start_lat, start_lng, duration, trip_type, need_return, tags, constraints):
return ImmutableMultiDict([
('start_lat', str(start_lat)),
('start_lng', str(start_lng)),
('duration', str(duration)),
('trip_type', trip_type),
('need_return', str(need_return)),
... | 1 |
86e5cedd3ace94bdc49b2c46dd234039 | 372c69c5b21ef48a2fc63289b23f5177 | Gets the sum of all itemValues for the measure test. | double result = 0;
for (Double dev : findings.values()) {
result += dev;
}
return result;
} | 1 |
00447cde33944c977d513798969ef4f2 | 82319c8cbd7ad0b97a3390d2b6157dcd | Registers magics commands. | hive_storage = preg.PregStorage()
shell_helper = PregHelper(self._preg_tool, hive_storage)
parser_mediator = shell_helper.BuildParserMediator()
self._preg_cache.parser_mediator = parser_mediator
self._preg_cache.shell_helper = shell_helper
self._preg_cache.hive_storage = hive_storage
registr... | 1 |
9a5825de88e0fdb66b014a653744c4e7 | e6f1598504a90efd4460d731479c05e4 | Returns the disk sector that contains byte offset POS
within INODE. Returns SECTOR_NOT_PRESENT if INODE does
not contain data for a byte at offset POS. | static disk_sector_t
byte_to_sector (const struct inode *inode, off_t pos)
{
ASSERT (inode != NULL);
if (pos < inode->data.length)
return inode->data.start + pos / DISK_SECTOR_SIZE;
else
return -1;
} | 1 |
6d782c28852e2fe8700544cdf0dfe9ed | 4e58b35deb6dc52e672fb3ab405c8808 | check that function doesn't delete the input file | class GetConfigTests(unittest.TestCase):
def test_get_config_does_not_delete(self):
lc.initialize_config(self.filename)
self.assertTrue(os.path.exists(self.filename)) | 1 |
696a8f2e5daaa25a6d68ae71a5ad8ed3 | f5221d9e8dcc41cc068d41e5e53180d6 | 增加1:1课程 | @ResponseBody
public Map<String,Object> saveOneToOne(HttpServletRequest request,@ModelAttribute("course") Course course){
try {
Teacher teacher=teacherService.getTeacherByUserId(getLoginUserId(request));
course.setTeacherId(teacher.getId());
course.setSellType("1");
int num=courseSe... | 1 |
303240d2c38fdfe7c2e0897ed094d2fb | da1d8da2c9bb748a8c414563e8878d47 | Carry out ban actions on this guild | initiating_user, ban_reason = None, None
banned_user = user
async for ban_entry in guild.audit_logs(action=AuditLogAction.ban):
banned_user = ban_entry.target
if banned_user != user:
continue
initiating_user = ban_entry.user
if ... | 0 |
07f1bf9e4e098179d563a9d9341ffe76 | 2373405a6ff9155f15665c6e46b2133c | returns true if there's still a condtion to be evaluated | public boolean test(Context context)
{
LoggerFactory.getLogger(Or.class).debug("Testing condition: " + this);
for(Condition condition : conditions)
{
if(condition.test(context))
return true;
}
return false;
} | 0 |
4506743bf10d89ab5d692deb85bd5b49 | 875c3abd924e2cfd8f3e9d97a4e07630 | 判断是否需要更新服务器域名 | foreach (var version in ServerResVersion)
{
string fileName = version.Key;
string serverMD5 = version.Value;
if (!LocalResVersion.ContainsKey(fileName))
{
NeedDownfiles.Add(fileName);
}
else
{
... | 0 |
9e457d585f5a57a11cc819d5bbaf87ff | ecc96e8e2dddf476e7168e2169fb2fbc | Sparse tensor index | @jit
def foo():
x = [Tensor([1]), Tensor([2]), Tensor([3]), Tensor([4])]
return x.index(Tensor([3]))
assert foo() == 2 | 0 |
9011c4d84796ebc3cacbca58a9f0cb90 | 5ac362f7c47812c7437d4445913ed223 | A ``ServiceTicket`` ought to be created with an appropriate
prefix. | service_to_encode = (
re.sub(r"[\n\t\s]*", "", service)
.replace(SERVICE_TYPE, ServicePrefix[SERVICE_TYPE])
.replace(SERVICE_ENDPOINT, ServicePrefix[SERVICE_ENDPOINT])
.replace(SERVICE_DIDCOMM_MESSAGING, ServicePrefix[SERVICE_DIDCOMM_MESSAGING])
.replace(SERVICE_ROUTING_KEYS,... | 1 |
af14b5c8c56443e057fb88f4f8478b16 | 7834500da3766a177c12525ff2cdc3c2 | Search with the given regex
and return the first one found if there is a hit.
Pass True for deepsearch if attributes also need to be searched. | if pattern is None :
return self
elif len(pattern) == 0 :
return self
else :
pattern=list(pattern)
apattern=pattern.pop()
matching_items=list()
if isinstance(apattern, str):
for item in self.data :
if reg... | 0 |
753458c7819895e4a647e72332e46cb8 | 468cb0409b2fd754303fcb207143ddcb | Method to dump dictionary to memcache. | tokey = self.pickler.dumps
dumps = self.value_pickler.dumps
if isinstance(mapping,dict):
mapping = iteritems(mapping)
self.cache.update(dict(((tokey(k),dumps(v)) for k,v in mapping))) | 1 |
934ec2712ddf388e2b183b53c68123fa | 8a8748892ba35e9853be05fdc7958dc2 | Prepend the base path to all paths. | character.mugshot_path = prepend_prefix(character.mugshot_path)
for action in character.actions:
action.spritesheet_path = prepend_prefix(action.spritesheet_path) | 1 |
9c385a88245d1b9d02b2f99e74a6b6ff | aac8fdafcad5306bb80bf767c9f82454 | Retrieve a contract. | class CMS(Base):
def GetContract(self, master_account_id: str, account_id: str='') -> Response:
url = f'{self.base_url}/contracts/{master_account_id}'.format(account_id=account_id or self.oauth.account_id)
return self.session.get(url, headers=self.oauth.headers) | 1 |
5da35ab531fad903fb55c1bc7d3dbe01 | f4231e10478c32f667dbbf301559b3ec | 从计算表中获取期数 | namespace SJ.BackEnd.Biz.AC
[ClassData("cname", "勾对体", "vision", 1)]
public class AcRecoD : BizTableVoucherD
private int GetPeriod()
{
return PeriodHelper.GetCurrent(this.ApiTask);
} | 1 |
45e59003e11d198e61dd7b77e0cbb5a2 | ea76242dd1972fdd6fbc99828124b6a8 | Gets the image factory | class ObjectManager extends \Magento\Framework\App\ObjectManager
public function getFactory()
{
return $this->_factory;
} | 0 |
327de30e650fb647dfb8903700b1b18b | b123fcea680121c37a0f323f3e94ceee | This method is used to set collection meta data. | class Collection(Definition):
def metadata(self, value):
pass | 1 |
f7c1cae8eb8605501121c3d2e4d57661 | c2b6e0c016328147ef22735bfbf36e8c | Create an effect for when the escape key is pressed. | class XInputEffect final : public IDirectInputEffect
virtual HRESULT WINAPI Escape(LPDIEFFESCAPE) override
{
return E_NOTIMPL;
} | 0 |
2a2ae439a9602b17099bf4117bb0b1d8 | 15a87fb0fa8966bdbb2ef74cf9f1c3c6 | Set the result-oriented properties back to their "unset" values. | class DromaeoServer(zip_http_server.HTTPZipFileServer):
def Reset(self):
self._results_have_been_set.clear() | 1 |
abd4f5e76f5eec23533eaccd4aace267 | ef0e14397ff7299fcb9818c5c46e3e25 | ! The function preserves the red shades only by removing
all the blue and green shades. | void redOnly()
{
removegreen();
removeblue();
removegreen();
} | 1 |
f9f22a34b86687ee71a3ecad5058ecaf | b3bdffa37b5862376ff613c85b61d2b5 | Returns the default crop configuration for this image. | namespace Our.Umbraco.GridValueConverters.Default.Controls
[GridControl(EditorView = "media")]
public class MediaGridControl : Grid.Control<MediaGridValue, MediaGridConfig>
public ImageCropDataSet GetCropDataSet()
{
Size? size = this.Editor?.Config?.Size;
return this.Value?.GetCropDataSet(size);
} | 1 |
4e8fb4dd228ed44e31e892912e1f1bea | cb41c699409da7b0287fc26770cde8d3 | We render a quad, so we always use index count = 6. | {
aVertexCount = aQuadCount * 6;
aIndexCount = aQuadCount * 6;
return DXShapeUtils::CreateResources(xArgs);
} | 1 |
b7b9107662ff37c3e4d8c09e31d7ef93 | 46693eb98e375ffef2c608acb9fbb063 | Draw white canvas. | public class MapCanvas extends Canvas
public void drawClearRect() {
gc.save();
gc.setFill(Color.WHITE);
gc.clearRect(0, 0, WIDTH, HEIGHT);
gc.restore();
} | 1 |
de99476bb7bdf7e66cd1080ab1a73211 | 72a759fbad46a9121d6c2ea969046b78 | Tells us whether or not this app is using the social media aspects | class StudentResourceService
public static function showSocialTools() {
$config = Zend_Registry::get('config');
$socialconf = $config->studentresources->showsocialtools;
if($socialconf == "all")
return(true);
if($socialconf == "")
return(false);
$allowedgroups = $config->studentresources->allowedgroups-... | 1 |
3aa1aace3c2415d3b88c1c149fac79cc | f81808b06104874c6984106d490b0ac8 | this function takes the SH-1 exception number and attempts to
translate this number into a unix compatible signal value | {
const struct excep_to_sig_map *map;
for (map = excep_to_sig_map; map->signo; map++)
if (map->excep == excep)
return map->signo;
return SIGHUP;
} | 1 |
2736d25c33938b49db4acc7896078136 | 0629e983e3c60ccab525654c35e99fdc | Codigo a ejecutarse al crearse. | {
$objModelo = $modelo->getMySelf();
ObservadorGeneral::registrarLog('CREACION_', $objModelo, DB::raw('NULL'), $objModelo->toJson(), Auth::user()->id);
} | 1 |
7686d8a3eb01b1f6ad31a863cb80c2ed | 049889bfc53718bb107dd2c4e5c6b440 | Handles the Click event of the SubmitAudioVerse control. | {
if (chkWaveForm.Checked)
{
if (waveViewer.WaveStream == null)
{
if (File.Exists(_PoemAudio.FilePath))
{
this.Cursor = Cursors.WaitCursor;
Application.DoEvents();
... | 0 |
354e5c8df8dfd323952885172834e006 | cc712cef7c130ec11bcbf570f5d751b9 | makes a fake MX reply | {
char *buf = munit_malloc(512 * sizeof *buf);
buf[16] = 2;
buf[17] = 0;
buf[101] = 1;
buf[256] = 2;
buf[511] = 3;
return buf;
} | 0 |
6c3d28cf3c881166e68ba421e7684dc7 | 4bdc3400a07ba90171fba5966965bd5a | Performs a lossy down conversion to UnityEngine.Quaternion | {
Vector2 az_el = AzimuthElevationConverter.Convert(quat) * Mathf.Deg2Rad;
float[] res = QuatUtils.FromYawPitchRoll(
-clamp(az_el.y, axis2),
clamp(az_el.x, axis1),
0f);
return new Quaternion(res[1], res[2], res[3], res[0]);
... | 1 |
2363867ee8940bd954d479984b3312a5 | d770cdb1223f03c79b6547dae169eefe | Returns the x position of the engine window. | public abstract class CCAbstractApp implements
KeyListener,
MouseListener,
MouseMotionListener{
public abstract int windowX(); | 1 |
3e2c2c214b25bc2da8206b6ac89b0aac | f310068fd654a63287a36f7b8cad7a7a | 给结果按照关键字加em标签 | for key in keywords:
ComStr = self.soup.findAll(assign_tag, text=key)
for each in ComStr:
each.string = keywords[key]
print(u'{0} ==> {1}'.format(key, keywords[key])) | 0 |
10e5d8e8fc07ef38f967485ee93e357f | 28905b434889f56c960d6a9ce0c4838b | Pokaz menu administratora | namespace Prolab2_3Spo
public partial class Form1 : Form
private void buttonAdminLog_Click(object sender, EventArgs e)
{
adminProscPanel.Show();
adminPanel.Hide();
} | 1 |
5b5fa4c7219f5ad9fe4756e1b0e4c0b7 | 1bb26f0327b75e0372085d17afd4e4f2 | UpdateTask changes an existing task and returns false if not found | _, err := project.Update(g.Map{"name": name}, g.Map{"id": id})
if err != nil {
return false
}
return true
} | 0 |
fc11298e76c9ab82d8a4562043970462 | c13f86b1021971f4072f23152e5177bb | Removes an operating system from the app | {
$os = OperatingSystem::find($id);
if (count($os) > 0) {
$os->delete();
}
return redirect('/operatingsystem');
} | 1 |
8b26978e03b07ff8fe91df9d77a6d691 | e97aa610ba63e85104b4884e3647e09f | 验证给出字符串是否为utf8编码 | function is_utf8($text) {
return StringTool::isUTF8($text);
} | 1 |
4bb4ab74e64d00210bc600afe3376d38 | 6d21efe83f605f01c955429070022888 | 检测产品项编码是否可用 (没有被其他产品项使用即为可用) | {
try
{
int n = itemService.IsExistItemCode(item_code,item_id);
return n > 0 ? false : true;
}
catch (Exception ex)
{
throw (ex);
}
} | 1 |
ec30dcaf2cb1d69138d61f210c7d8e60 | 7a5f1b4a5618eb21421bd1b15b5dceef | <p>
Activates the Batch with the given id immediately.
</p>
<p>
<strong>Note:</strong> All JobDefinitions and Jobs
related to the provided batch will be activated.
</p>
If no such batch can be found.
If the user has no Permissions#UPDATE permission on Resources#BATCH. | namespace org.camunda.bpm.engine
void activateJobByJobDefinitionId(string jobDefinitionId); | 0 |
ff866e0d10779f80fd752dae36b905c2 | 01e6ddb69b83a3a1451d0d6a26ea0c4f | 生成解绑二维码 | if( confirm('您将要解绑此二维码,所有绑定信息将会被清除,请确认此操作!?') ){
$.getJSON("admin/doctor/unbundling",{'doctor_id':doctor_id,qc_code:qc_code},function(msg){
if( msg.result_code == 200 ){
alert(msg.info)
history.go(0);
}
if( msg.result_code == 400 ){
alert(msg.error_msg)
histor... | 0 |
fa892bfa625312979d6366a158e0047b | 56e3a6488dd55c77376fe8a9ee643954 | Get a string representation of the enabled scopes. Used when authenticating. | public class OpenIDConnectAuthenticator extends AbstractApplicationAuthenticator
implements FederatedApplicationAuthenticator
protected String getScope(Map<String, String> authenticatorProperties) {
return authenticatorProperties.get(IdentityApplicationConstants.Authenticator.OIDC.SCOPES);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.