query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
deec4976f9da53546320d6e66bd395fb | 20ae4aa02d0a460b030fd53f9947166b | 从小助手压缩包文件名中提取版本信息
DNF蚊子腿小助手_v4.6.6_by风之凌殇.7z => v4.6.6 | public final class Version
private static String getFromFile(String file) {
file = file.substring(0, file.length() - 4);
int i = file.lastIndexOf('/');
if (i >= 0) {
file = file.substring(i + 1);
}
i = file.indexOf("-");
if (i >= 0) {
file = file.s... | 1 |
86a1978bbb5d63b0a64ff9567d0ddf08 | 19c03a9846a5e021295abf231c5be03e | Visit a parse tree produced by the {@code pre_bracket}
labeled alternative in {@link TBRParser#datatypes}. | public class DogeScriptBaseListener implements DogeScriptListener
@Override public void exitDatatype(@NotNull DogeScriptParser.DatatypeContext ctx) { } | 0 |
f2e2892f9ee756bb7cb7c06883f22cd7 | 74566c682e3391bc2567c0e76139622f | Used to perform a batch write operation to DynamoDB with full parameter
specification. | expires_at = self._get_expires_at()
with self.table(self.default_table_name).batch_writer() as batch:
for i, data in enumerate(items):
batch.put_item(
Item=self._process_item_data(
table_name, partition_key, data, i, expires_at
... | 1 |
b9dea08ad5ef50be6280727542f988f4 | b4054f85be3c7795a6215469f489e991 | Returns the entity class associated with this DTO | public class EntityTable implements com.mrhan.db.allrounddaos.ITable
@Override
public Class<?> getEntityClass() {
return entityClass;
} | 1 |
c16cad6975e96c0c3fb7cee8e4c96b82 | e49c0a660c1d420d2938ed57d6b6049a | Allows ids to be automatically generated for notes through entity framework | {
foreach (var domain in modelBuilder.Model.GetEntityTypes().Where(e =>
!e.IsKeyless && !e.IsOwned() && e.ClrType.IsDerivedFrom(typeof(IEntity<Guid>)))
.Select(e => e.ClrType))
{
modelBuilder.Entity(domain, b =>
{
... | 0 |
7b729459041db30b5fbc01533cb1ed8c | 0c6d87cf0668e12febb0c43b90edf88b | Returns tuple of the last four years | def all_years():
return ["2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020"] | 0 |
3b99c8545ee3e761622590fefb6c660e | 22ba112886f79afc75372e5fa7211671 | 括弧内を抽出 | class Parser:
def _extract_parentheses(self, text: AnyStr):
if '(' not in text:
return text
for i in re.findall(self.PARENTHESES_RE, text):
exp = i[1:-1]
key = 'KEY.{}'.format(md5(exp.encode()).hexdigest())
self._parentheses_exp[key] = self._proc_exp(exp... | 1 |
0ab50ee85e517ee964adb642b31b2689 | 5136f69d22a97ace900c7f15dfc08b63 | Marks the <see cref="Exception"/> has "handled", thus preventing it from triggering exception escalation
policy which, by default, terminates the process. | namespace Exceptionless.NLog public static class LogBuilderExtensions
public static void MarkAsUnhandledError(this IDictionary<string, object> contextData) {
contextData[IsUnhandledError] = true;
} | 0 |
b36a46df72dd624877008a43b2d662b2 | 6684355c89a5ed8b0ccd2e229ebbbc5c | 方法以整数的形式返回所有系统内存的字节数. | namespace War.Script
[LuaCallCSharp]
public class Utility
public static int GetSystemMemory()
{
return SystemInfo.systemMemorySize;
} | 1 |
1c388e4b57f354686a783639191971ac | 43574e318e82d0ca1dfe954e995a8b5b | Reads the tile position of each flag. | public class DataReader
public String[] getFlagPole() {
return flagPole;
} | 0 |
daa359da61ff9c023ede46fbb64178d0 | f21321d45c4bc5f6012b0206fa49b88d | GET: Dieticians | namespace MenuPlan.WebApp.Controllers
[Authorize(Roles = "Admin")]
public class MenuController : Controller
public ActionResult Index(int dietID)
{
try
{
List<MenuVM> model = menuBLL.GetMenuList(dietID);
ViewBag.DietID = dietID;
Vie... | 0 |
6032569d3d745f4d9c8f78b15a7c135f | dc49c76e4debfaeec50027e23eaf7ec2 | Second step in ELAN import process, for transcription/translation tier selection from ELAN *.eaf file. | infos = []
frm_pos = 0
for elem in lyr_list:
if "&" in elem and not elem.startswith(('%raw', '#')):
line = {}
line['syllables'] = []
syllb_list = elem.split("&")
for syllable in syllb_list:
if syllable:
frm = frm_lis... | 0 |
e7f97ede9e1ae20be10c12f2c9723f62 | 34a1db04819a5d8b3dfc48c0d710d064 | Returns the value of a specified parameter in the parameter collection. | namespace DSC.DataExecutor.DBExecutor
public class OutputParametersResponse : ErrorResponse
public object GetParameterValue(string key)
{
object paramValue;
ParameterValues.TryGetValue(key, out paramValue);
return paramValue;
} | 1 |
6944f10ff8c69b826af1ce300bb7c1f3 | 3e123b8df48ec86a10307e6a81cb77e9 | Remove video from an album | public bool RemoveFromAlbum(long ownerId, long videoId, IEnumerable<string> albumIds, long? targetId = null, long? albumId = null)
{
var parameters = new VkParameters {
{ "target_id", targetId },
{ "album_id", albumId },
{ "album_ids", albumIds },
{ "owner_id", ownerId },
{ "video_id", videoI... | 1 |
49d90dba325b8c8418c1ccf3e0272f9b | 56d17aeb0ff2ac744d3498f1f56b35cf | Set filenames include pattern from option. | {
if (unshield && filename)
{
char pattern[256];
char* prefix = strdup(filename);
char* p = strrchr(prefix, '/');
if (!p)
p = prefix;
for (; *p != '\0'; p++)
{
if ('.' == *p || isdigit(*p))
{
*p = '\0';
break;
}
}
snprintf(pattern, sizeof(patte... | 1 |
d380613e1f02d6fc3942cdca8eac0131 | 326ee115796b6d0cdb24fa2ad74bdfdb | 如果有match到 | def match_function():
match = pattern.match('hello world!')
if match:
print(match.group(), type(match.group()))
print(match.start(), match.end())
result = pattern.match('!hello world!')
print(result)
print("=" * 20, "search", "=" * 20) | 1 |
1f6ef9a6a0f50253d97c723e15efd3d6 | c819bcb83696559b66027d1b96dd6c9c | Add message to the receive list | void Receiver_addToReceiveList(char* message)
{
pthread_mutex_lock(&receiveListMutex);
{
if (List_prepend(pReceiveList, message) == -1) {
General_print("Receive Thread Error: Failed to add a received message to the receive list\n");
free(message);
} else if (List_count(pR... | 1 |
5fe0e1f457ad17678041fba1c48c7e02 | 8068a58612c04f618885aec241aa7066 | Create a new Esewa Instance. | session: aiohttp.ClientSession = None):
self._universe_manager = universe_manager
self._type_manager = type_manager
self._logger = logger
if session:
self._session = session
else:
self._session = aiohttp.ClientSession()
self.market... | 0 |
8ce586c1755ba39225bd271bd547a2c9 | b9021b5639ada76a368ce9b9df3ce076 | Defines whether a popup-style numeric filter should be used for the
property with the given ID.
<p>
The types Integer, Long, Float and Double are considered to be 'numeric'
within this context. | default boolean isPropertyValue() {
return false;
} | 0 |
dccd1edf0642899d73bf6d01bb63bff5 | 863f3ea6e741bbce4af9bfbd5657149c | 获取列名以及类型 用于判断修改列类型
1. 获取数据库列名以及列类型
2. 根据Attr表查出来的数据和表列对应 筛选出有所改变的 | class ColMapper(object):
def get_attr_mappings(self):
mapping = defaultdict(list)
with self.db.begin() as conn:
cursor = self.db.execute("select * from %s limit 1" % self.table)
cols = cursor.keys()
for col in cols:
postfix = re_col.findall(col)
... | 0 |
80b65a6e796087f050f3a8a644a3fdc0 | ee5d284c84296977a5335b8eda8b8834 | 批量删除合同收费计划 | {
var result = new ResultJson();
try
{
var msg = _plansBatchService.DleteByIds(ids);
if (msg.Status == MessageStatus.Success)
{
result.IsSuccess = true;
}
}
catch (Exce... | 1 |
e8c16dfaed28c023f72f60266870d9a9 | f85f8c3b149595deb2a2b48bc5fc18ab | 生成并归一化user_prefer | class ToMySQL:
def user_song_prefer_to_mysql(self):
i = 0
user_song_prefer = []
for line in open('../rec/data/user_song_prefer.txt', 'r', encoding='utf-8'):
i += 1
try:
user_id = line[0:line.find(',')]
song_id = line[line.find(',') + 1:line... | 0 |
1bf59856333c450fe9cbd6f1dc1d55b2 | 5887e2c8ce983f1b3889b8a559d5a9a4 | Sets file subtype (usually non-zero for drivers and fonts) | namespace pe_bliss
void file_version_info::set_file_subtype(uint32_t file_subtype)
{
file_subtype_ = file_subtype;
} | 1 |
8c2f4c35d36c3c7d68f1ed6744de801e | 3510de39ddb5c4ba8e4740b9d50b0d06 | Initialize the current data as a empty string. | char* data = static_cast<char*>(SharedBuffer::alloc(sizeof(char))->data());
data[0] = 0;
mString = data;
} | 1 |
9b5792fc5e6f14ba15a286ff4d4cd7a9 | fbfa26a09501ec3ca7be95fd5550feff | \brief Disables UART transmit DMA | {
MAP_UARTIntDisable(pUARTuDMA->ulUARTBaseAddr, UART_INT_DMATX | UART_INT_DMARX);
MAP_uDMAChannelDisable(pUARTuDMA->ulDMATxChannelNumber);
MAP_uDMAChannelDisable(pUARTuDMA->ulDMARxChannelNumber);
pUARTuDMA->ucDMATxCompleteFlag = 0;
pUARTuDMA->ucDMARxCompleteFlag = 0;
MAP_UARTDMADisable(pUARTuDMA->ulUARTBaseAddr, ... | 1 |
25c830457a3bba2d4281ac500123c117 | cd0f0f2ea4a73b4dc2bcc953e65686b2 | Compares two types by their names. | namespace GraphQL.AspNet.Schemas.TypeSystem
public sealed class GraphTypeEqualityComparer : IEqualityComparer<IGraphType>
public bool Equals(IGraphType x, IGraphType y)
{
return x?.Name == y?.Name;
} | 1 |
1714175204f865035a5a735555fa03e6 | c7c19e08114b5039a52e4a297f952a3c | Az aktuális dátum-nap kezdete. | {
DateTime result = this.CurrentYearStartDateBase;
return this.IsSystemTime ? result : result.ToServerTime();
} | 1 |
91ad5171188c9bc69cd42f9ecc410e7e | bd98b9df68ba16a2e1fa05f2df791503 | 获取借阅天数 | public class Back extends Frame
public String getReaderBorrowDays(Date date1, Date date2) {
String sum = "";
int year1 = 0, month1 = 0, day1 = 0;
int year2 = 0, month2 = 0, day2 = 0;
int[] monthdays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
Calendar cal1 = new GregorianCalendar();
Calendar cal2 ... | 1 |
ba7b064a7ed12c002a17f4de205ace94 | b76cdcb099ee063146f3144df8855e31 | Gets the operator associated with the given token.
correct syntax. | class WhereExpression
private getOperator(operatorToken: any): string
{
return WhereExpression.operatorMap[operatorToken.kind];
} | 1 |
68aa32f757ced6d39d94608a5a900aa6 | 62aef8d85841580713451cc4a92c13c0 | 设置响应结果:1成功,-1失败 | public void setResult(int result) {
this.result = result;
} | 1 |
e8c7c5bf35db86706819a82fc2641d6c | 8e6099500e815fa458f1de171c4b7e9f | Cập nhật chi tiết ServiceJob | public BookingJobDetails update(Map<String, Object> newValues, String itemID) {
return bookingJobDetailsManager.updateEntity(newValues, itemID, BookingJobDetails.class);
} | 0 |
35ef1c1d69a73d3e77c75bc15927b6c9 | cf7238aa060885618bc4e374ea16f5b7 | Returns true if the position is under attack by any opponent pieces | var attackedPosition = getAttackedPosition();
var opponentPieces = currentBoard.getOpponentPieces();
return attackedPosition.map(opponentPieces::containsKey).orElse(false);
} | 1 |
0ab948a27998777f4e9723a18a77e25b | afae06728f2335d10f0f7dabf6616698 | 设置推送静默的起始结束时间。 | public class BPushApi
public static void setNoDisturbMode(Context ctx, int startHour, int startMinute, int endHour, int endMinute) {
PushManager.setNoDisturbMode(ctx.getApplicationContext(),
startHour, startMinute, endHour, endMinute);
} | 1 |
5acf9b1bb541d2397a69d204fd31775a | 21f1e5e64f9a5221335101077d0314a1 | 前渡金利息計算対象フラグ(非表示)を設定する | public class CreateRequestWithdrawParamDto extends BaseDto
public String getDelayedInterestFlg() {
return delayedInterestFlg;
} | 0 |
dc1b805f3567ae21cb62117d03827f94 | e8669aaece7717fc4e437dd5198661e3 | 对trans在Z轴上进行缩放 | {
GzMatrix tmp_trans =
{
1.0f , 0.0f , 0.0f , translate[X] ,
0.0f , 1.0f , 0.0f , translate[Y] ,
0.0f , 0.0f , 1.0f , translate[Z] ,
0.0f , 0.0f , 0.0f , 1.0f
};
memcpy(mat, tmp_trans, sizeof(float)*16);
return GZ_SU... | 0 |
c6c38d51346018c7ffaec2445588afa6 | ba5080bbc6bbfaba20cc654114c6deaa | returns articles that have not yet, but will, be published | return qs.filter(
Q(
Q(unpub_date__isnull=True) |
Q(unpub_date__gt=date.today())
) |
Q(published=False)
) | 1 |
dc334b7e0771cb4510fdaad7ede4e02a | 3d5ff4b723f34103278f29905fe0607c | Return if given form element is a div | abstract class icms_form_Element
public function isContainer() {
return false;
} | 0 |
e6a5cc6af37951225873f94244664621 | ccc7cff876267cf0437994c801a65b17 | Función para borrar el usuario conectado | if(firebase.auth().currentUser){
confirm("Are you sure to delete your user?");
if(confirm){
firebase.auth().currentUser.delete();
let id = firebase.auth().currentUser.email.split(/@/);
let element = firebase.database().ref(`Users/${id[0]}`);
element.remove();
document.getElemen... | 1 |
c8ca40035c7c01d2676f364704f7fcf5 | c11be2c4cb7946765b2764e2e7cb55d7 | 根据用户id 和 朋友id 查询是否喜欢过 查询结果大于0 代表喜欢过这个朋友 | boolean isLike(int article_id,int user_id); | 0 |
dc8664e5b0ad9929b917857e080efb50 | c15b8e7e900efa7de219bef2f87925bb | Descriptor representing a nested structure | self.code = code
self.descr = descr
self.parent = None
self.children = []
self.depth = None
self.rows = []
self.hmodel = None
self.fmodel = None | 1 |
01afa9ba3a9d114a3e209cc1d9d656a3 | 3ef964ab991ab7ebd3026ea60241223b | 分片上传合并(从redis中合并) | @Controller
@RequestMapping("/file/upload")
@Slf4j
public class FileUploadController
@PostMapping("/mergeChunk")
@ResponseBody
public Result mergeChunk(String fileMd5, String fileName) {
Result result = Results.failure(1);
FileChannel destFileChannel = null;
FileChannel sourceFileChannel... | 0 |
f06a9208e45f30fce1ae0cf80cffa317 | a8bde40d6f358354e1043b0197773940 | Sets user tenants. | {
return $this->hasMany(Tenant::className(), ['id' => 'tenant_id'])
->viaTable('{{%tenant_user}}', ['user_id' => 'id']);
} | 0 |
e9a470ce985049b1216ab0b9e777c7ef | 731412851b2aeeba10e44d4d45c7ee22 | 根据科室名找到科室code | List<BeanDepartmentInfo> list = DataSupport.where("key = ?", hosp + "_" + code).find(BeanDepartmentInfo.class);
if (!list.isEmpty()) {
return list.get(0).getHospital() + "_" + list.get(0).getDepartmentName();
} else {
return null;
}
} | 0 |
0ddcd208c6cd9001faf110d409379548 | 2ac064978ef748ac03394e83230b561c | Get the top keywords for the given period. | class GoogleTrends:
def top30in30(self, **kwargs):
return self._google_trend_api.top30in30() | 1 |
40a79d5f868c283102cc019cd428bf34 | 367a548994459533789c025643d18fb5 | 작업허가서 항목 생성 | function fn_pkg_4(){
var turn_down = fn_check_turn_down();
if(turn_down) {
var col20 = $("input[id=pkgStatusModel_col20]");
if (col20.val() == "") {
alert("반려 사유는 필수항목입니다.");
return;
}
} else {
var check_seqs = $("input[name=check_seqs]");
var work_dates = $("input[name='work_dates']");
var non_che... | 1 |
c07ae389c6add0122e37b65bda889e90 | 59d0762e52174c6e420f31dbf20815c4 | 【异步方法】查询设备的关联关系 | if (deviceId == null) {
return null;
}
return SmartCache.hget(DEVICE_REL_MAP, deviceId, () -> {
R<DeviceRel> result = getDeviceRelClient().getDeviceRelByDeviceId(deviceId);
return result.getData();
});
} | 0 |
fd7da8e69a3edc2937c809729fa59d4a | 4fc1b76c02e62679bb68811f1e3635fb | Retrieve the patch strategy step for a subcloud ID.
Will raise if subcloud does not exist. | class SubcloudsController(object):
def patch(self, subcloud_ref=None, verb=None):
policy.authorize(subclouds_policy.POLICY_ROOT % "modify", {},
restcomm.extract_credentials_for_policy())
context = restcomm.extract_context_from_environ()
subcloud = None
if subclou... | 1 |
d44ff50b29c0055f11372a66f1395c5d | 163776f4274a975a9aca3cc06eacd618 | Toggles the state of the Add Topic functionality. | if (mAddTopicFragment == null) {
mAddTopicFragment = new AddTopicFragment();
mAddTopicFragment.setOnTopicListener(this);
}
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
if (show) {
if (mAddTopicFragment.isAdded()) {
... | 1 |
12ca0f2935117a18749026edaf3f8194 | 0f52c27c0543bc0326d4181599924493 | Set an option that will be passed to the ovftool | class PDFFactory
public function addwkhtmltopdfOption($option) {
$this->wkhtmltopdfOptions[] = $this->cleanwkhtmltopdfOption($option);
} | 0 |
e552bb6a8d7fa4002f68d31f459294a2 | e8435181e56def7993133a0e895a26be | Determines interval between peaks using auto-correlation | def freq_from_autocorr(sig, fs):
corr = fftconvolve(sig, sig[::-1], mode='full')
corr = corr[len(corr)/2:]
d = diff(corr)
start = find(d > 0)[0]
peak = argmax(corr)
px, py = parabolic(corr, peak)
return fs * px | 0 |
c7adaf3103b205231772e24662327407 | 4d7032854463c43b8fa79b85d41bf63e | Layer that filters out inf and nans from any tensor.
This is usefull when there are instability issues,
which cause a small number of values to go bad. | def my_filter_callable(datum, tensor):
return len(tensor.shape) == 0 and tensor == 0.0 | 0 |
c19595ae03303c55f72ad58d914f8b6d | 767df85abc0dcb420b79f77f5f07ba99 | 停用小组标签 | $documenttagid = Control::GetRequest("doctagid", 0);
$documentchannelid = Control::GetRequest("cid", 0);
$pagesize = Control::GetRequest("ps", 20);
$pageindex = Control::GetRequest("p", 1);
$adminuserid = Control::GetAdminUserID();
if ($documenttagid > 0) {
$d... | 1 |
8111864462594ac8092b19d3537fdeaa | 958d519ba27489f97784c964e5d7cd50 | Read a raw token. Ignore the pushback stack, and do not interpret source
requests. (This is not ordinarily a useful entry point, and is documented here
only for the sake of completeness.) | const char *tokf )
{
char f;
int ntok = -1;
while ( (f = *tokf++) != 0)
{
if (ntok++ >= MAXTOKS)
rcderr("Too many tokens FUBAR !!!");
char token[400];
if (f=='q' || f=='p')
{
int c = 0;
while (1)
{
c = fgetc(Fpm);
if (c == EOF) ... | 0 |
e4bc34ee4b003ebd609e271a16cb15fb | 88981cc81b7b65443bc5d3ae46c6f375 | 获取系统铃声的集合 | {
try
{
return CCommonMethods.myMethods.GetSoundList();
}
catch (Exception ex)
{
CLOGException.Trace("WCFQueryLib.CQueryService.GetSoundList 异常", CBaseMethods.MyBase.GetExceptionInfo(ex));
return new List... | 1 |
8033ae06d61d777abbf871831eefbf60 | f9a5445a88e98b88fa28e8bb79aeb21d | 返回处于被选中状态的对象(只适用于单选情况) | class BaseFrame(object):
def findelement_and_return_selectedstatus(self, findstyle, styleparame):
ele = self.findelement(findstyle, styleparame)
eleinfo_selected = self.geteleinfo_selected(ele)
return eleinfo_selected | 0 |
c6df37479c82858f229fba7cae129c74 | 8a8e065f18f7bc13e96ba827130189c9 | Calculate the angle of a joystick, given a specific x and y input value. | {
float coeff_1 = PI/4;
float coeff_2 = 3*coeff_1;
float abs_y = abs(y)+1e-10;
float r, angle;
if (x >= 0) {
r = (x - abs_y) / (x + abs_y);
angle = coeff_1 - coeff_1 * r;
}
else {
r = (x + abs_y) / (abs_y - x);
angle = coeff_2 - coeff_1 * r;
}
if (y < 0)
return(-angle);
... | 1 |
b0f6ad8138a79820b7bcc0ee82b0c623 | 6ddfe975201fb24e54bf3bacac8e2e97 | 获得一个沿Z轴方向旋转的矩阵 | float radian = yAngle * 3.1415926f / 180;
Matrix4x4 matrix = new Matrix4x4();
matrix.Identity();
matrix.value[0, 0] = (float)Math.Cos(radian);
matrix.value[0, 2] = (float)Math.Sin(radian);
matrix.value[2, 0] = -(float)Math.Sin(radian);
... | 0 |
55446b612a955e71bf5e996962b38e67 | a20c81ddd301826a6627804c06f59572 | 现结客户消费积分产生比例 | $user_id = cookie("userinfo")['user_id'];
$user = M("user")->where(array("user_id"=>$user_id))->find();
if($user['history_points'] <= 300){
$jidou_num = $jidou_num;
}elseif($user['history_points'] > 300 && $user['history_points'] <= 1000){
$jidou_num = $jidou_num * 1.05;
}elseif($user['history_points'] ... | 1 |
9193b908c5f231e2d3bd0609668c9fff | fb6473bad84c99b657c987c54ead9744 | Parses a line for the supported format denoting a circuit.
Returns a Circuit object based on the found attributes.
The circuit number will be parsed as an int primitive instead of a String object.
Thus, "C0" will become "0". Correlation can be maintained more easily using raw primitives.
Format Example:
C C0 H:7 E:7 P:... | lines = data.strip().splitlines()
try:
qcount = int(lines.pop(0))
except ValueError:
raise ValueError('First line should be qubit count')
gates: List[Gate] = []
for l in lines:
l = l.strip()
if l == '': continue
gdesc = l.split(' ')
q = int(gdesc[2])
... | 1 |
76c0c58546db360493e184a106b76a56 | 990202cd3c1d3b20a3ce70c3b5d4b654 | This method was generated by MyBatis Generator.
This method returns the value of the database column t_shadow_table_datasource.CREATE_TIME | @Table("TOKEN_APIS")
public class TOKEN_APISObj implements java.io.Serializable,com.google.gwt.user.client.rpc.IsSerializable,
com.ksyzt.gwt.client.data.IFieldValue{
public java.sql.Timestamp getCREATE_TIME() {
return CREATE_TIME;
} | 0 |
3429a09e7e3d50afcf3eb04f6e347a12 | 44599c87be33a14ff134c9cbf33e640a | Test simple training of an embedding_rnn seq2seq model | set_seed(1000)
monkeypatch.setattr(wandb, 'log', _noop)
df = read_test_data()
train_dataset = mltd.MeldLinearTextDataset(df, mode='emotion')
dev_dataset = mltd.MeldLinearTextDataset(df, mode='emotion',
vocab=train_dataset.vocab)
glove_file = StringIO(... | 0 |
7cdb401b51ca9110f687862a32f5b983 | a4ffb1a8452ea174ac806f017e639d4e | Get the max refresh period. | public class TaskParameters
public IntegerProperty refreshTimeMaxProperty() {
return refreshTimeMax;
} | 1 |
38d978471b544dbe40024c813e83241a | 805d14507a37fdff622ebb5e12e2d8dd | returns table with chats still being broadcast | class NewPhoneRegistered
public function broadcastOn()
{
return [];
} | 0 |
dca43e8981a0a960e40b67df7a29f440 | 9aa77a97225bf4380ff6aa35a40d71cc | Index of file/field data end in raw multipart temp file. | {
if (!_directSubPart)
throw new StreamCorruptedException("Not direct sub-part data mode to process for ID=" + getCurrentPartId());
if (_mmDelimiter.isBoundarySet())
return processMIMEBoundaryData(buf, offset, len);
_streamOffset += len;
return len;
} | 0 |
bb5d9a485d1d7a57afddb5b5be3164d9 | dbde7cd3cc55e691465d622b8c4c91b4 | Example of firing off generic notification to something on the UI.
The Observer won't receive anything, this would be similar to a
button press being called directly | export default class RCTGIFViewDemo extends Component
sendNotification() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this.refs.RCTImageView),
UIManager.RCTImageView.Commands.handleTask,
[name]
);
} | 1 |
acd139b94b06edc16d65b0cc06ab7979 | 393a3c5741d0204a7403efef977a1022 | Test if the task holder loader can find the configurations under the directory. | {
$loader = new RateLimitingConfigLoader();
$this->assertSame([
ServiceLocatorInterface::class => [
FactoryResolver::class => [
RateLimiterInterface::class => RateLimiterFactory::class,
],
ReflectionResolver::class => [
... | 0 |
c94c38dd0380099857883c9359acd0cd | cfef8e20dd848a308d85200f85b075f3 | This function allows the file manager view to zoom "around" the image
currently under the mouse cursor, instead of around the top left image | {
myMap.Center = myMap.ImageToWorld(new System.Drawing.Point(e.X, e.Y));
if (rblMapTools.SelectedValue == "0")
myMap.Zoom = myMap.Zoom * 0.5;
else if (rblMapTools.SelectedValue == "1")
myMap.Zoom = myMap.Zoom * 2;
GenerateMap();
} | 1 |
f35824433219fe77e6eb4fac9bd01cc4 | d5ab0d9eab3b85438e85f7e765c54469 | Méthode qui utilise les modulos pour s'assurer que l'écran est toujours rempli avec bgTile | class Background:
def background_update(self):
if self.update_counter % self.frame_last == 0:
for x in range(WIDTH / TILE_SIZE):
for y in range(HEIGHT / TILE_SIZE + 1):
self.background.blit(self.background_tile, (x * TILE_SIZE, y * TILE_SIZE))
self.update... | 1 |
6e733d2be665491d52b89b1d525938f9 | 7232efe0eea33ec52e2479a83558cb11 | Returns the active resource (Page, xml, null). | BooleanResource isCurrentlyActive(); | 0 |
c489a4997fac83a52f2bf7f7e1332ad9 | 2587c80cfce19129bd05fb194cf804ab | Initializes the motion detector object. | class MotionDetector(shotDetector):
def __init__(self, threshold = 0.50, num_frames_post_shot = 30,
kernel_size = -1):
raise NotImplementedError()
self.threshold = float(threshold)
self.num_frames_post_shot = int(num_frames_post_shot)
self.kernel_size = int(kernel_size)
... | 1 |
5acbb84155db9794d0a7fa7041c7ed35 | 662fd45dd83677c71cfe769430e3d48a | MCIS에 VM 추가 등록 | func CreateSystemMcisDynamic(option string) (*TbMcisInfo, error) {
nsId := common.SystemCommonNs
req := &TbMcisDynamicReq{}
req.Name = option
req.Label = option
req.SystemLabel = option
req.Description = option
req.InstallMonAgent = "no"
switch option {
case "probe":
connections, err := common.GetConnConfigL... | 1 |
b355d40ec961c14e3e789b2ea80fb792 | f613446c48426c5aa97c8a0bf8b6e99f | 获取特定shop所有foodtype | class ShopController extends Controller
public function getFoodcate(Request $request)
{
$type = $request->input('type');
$shopname = $request->input('shopname');
$data = DB::table('food')
->where('type', $type)
->get();
return view('home.products', ['data' => ... | 0 |
3484cbe17a54e7f98644e914ee296535 | 623f27de367f1b58e383391b9bf70337 | Load in image files to a list of numpy arrays. Sequentially stack arrays
into a single array. | def load_batch_of_images(file_list, img_shape):
n_channels = 3
n_samples = len(file_list)
width, height = img_shape
images = np.zeros([n_samples, height, width, n_channels], dtype=np.uint8)
for i, img_file in enumerate(file_list):
img = scipy.misc.imread(img_file)
img = scipy.m... | 1 |
789aec5b98ce59e8794c6426c81ad87d | 07f992d4aad05ff644973abe71cba40c | Serial port data received method. Send start command when it is first opening | {
if ( com0_running == 0 )
{
com0_running = 1;
com0_send_byte();
}
} | 1 |
d1ff933def98a9e1a4724ad25f50ac84 | 78d1e0d3a21373513d685e28a4314811 | The value for a specific metadata key should be returned | def get_value(target_key, metadata):
values = [x["value"] for x in metadata if x["label"] == target_key]
return values[0] | 1 |
ff2bd26f9dc4c83f07ab1450cf1622aa | 2f59cc26fb626b466ca90da065a5b3df | => 是否可打补丁 | fun initTinker(): UpgradeManager {
Beta.enableHotfix = true
Beta.canAutoDownloadPatch = true
Beta.canNotifyUserRestart = true
Beta.canAutoPatch = true
Beta.betaPatchListener = object : BetaPatchListener {
override fun onPatchReceived(patchFileUrl: String) {
... | 1 |
9455aad5b1e82cd8729c95dd6afb8902 | 1bd7913f33f0011b1ff5dc83d164ad77 | 车辆日常点检 | @FormUrlEncoded
@POST(ApiAddress.updatacarcheck)
Observable<UpData> getUpCarCheckData(@Field("data") String data, @Field("scoreData") String scoreData
, @Field("diancherichangJc.kaoheDate") String kaoheDate
, @Field("diancherichangJc.lineCode") String lineCode
, @Field("dianc... | 1 |
5c276d070637ec65c5a6da6fa114e13e | 922ba5bed99bb6284cfb2f5bd29527a3 | Command to list Catequizando entities ordered by their creation dates | class QuizzController extends Controller
public function index()
{
$quizzes=Quizz::all()->sortByDesc('id');
return view('admin.quizz.index', ['quizzes' => $quizzes]);
} | 0 |
f4d6f47d37ad119a1d99c6e9b3f39b7a | 575c8cd086accaf2c1e266b525fef901 | get index of the element with the lowest gval | int SimplexSearch::vg_index(int vg) {
for (int jj=0; jj <= nn; jj++) {
if (ff[jj] > ff[vg]) {
vg = jj;
}
}
return vg;
} | 0 |
9c571806422b1aa41dfcb157fe3305f9 | 330e684c8f2bf8e280bcbe4ecf65ee0a | Get the duration type. | class SubscriptionTypeVariant
public function getPeriodtype()
{
return $this->periodtype;
} | 1 |
2938b6f5faf0978905b8db8d49b5cf30 | 8248678b5bae986c7bff31bada4c5612 | 将每次点击查询都置到第一页 | this.pageNum = 1;
this.$nextTick(function () {
this.$refs['pages'].currentPage = 1;
});
} | 1 |
a73a50b594b6e4858fdb5d4fd3d16d06 | 7931ae33cebb2afe868e515b11c9c209 | Write a command, one bit at a time | class HD44780:
def cmd(self, bits, char_mode=False):
sleep(0.001)
bits=bin(bits)[2:].zfill(8)
GPIO.output(self.pin_rs, char_mode)
for pin in self.pins_db:
GPIO.output(pin, False)
for i in range(4):
if bits[i] == "1":
GPIO.output(self.pins_d... | 0 |
78300bd22cb0906ac664d89b72e4a7bd | a7051bb7ac9b141c62c89d8fc6ebcc56 | We need to figure out the locale of the file based on the file name. The file can be
something like foo.html, foo_fr.html foo_fr-FR.html, or foo_fr_FR.html. We parse that
name and create a locale object based on the language and country codes in the name | const _name = path.basename(normalizeRelativePath(filePath))
return _name !== LOCALE_PH ? _name : null
} | 0 |
b66882514d160bf6b2445d7bc65267b3 | 7ca23321f5aaa2c616be4fd84d201616 | 点击返回键按钮时清空关键词和回复内容的额编辑框 | class ArticleDetailActivity : BaseActivity(), ArticleDetailContract.View, EasyPermissions.PermissionCallbacks, EasyPermissions.RationaleCallbacks
private fun resetInputState() {
if (emotionMainFragment!!.isUserInputEmpty()) {
pid = "0"
replyId = "0"
emotionMainFragment!!.setE... | 0 |
bdf12b77275b52bd54bd10308a1ecdb5 | 9b9eddc17936024834c6b8461ca04858 | School - holds most functions for managing students - adding/removing from dom and database | function Student(){
this.datastore=[];
} | 0 |
9794cd135d8e4efe3d63aca88d966bb8 | 7e7b1980bd462aff72ab95445b38782c | Get non-admin users | {
$result = $this->db->query("SELECT * FROM users WHERE user_status = 1 and user_type != 1 ");
return $result;
} | 1 |
b5ffdd37e74a720b53705b8307a72c61 | 7a5d9258bd444f5da68fe7acd0020853 | Retrieves an environment by name. | namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
public static class AzureContextExtensions
public static IAzureEnvironment GetEnvironment(this IAzureContextContainer container, string name)
{
return container.Environments.FirstOrDefault((e) => string.Equals(e.Name, name, St... | 1 |
155250a007891f36b34800cafa65aeaf | a873005880b173bf157d29c1af81b858 | Fx15 - LD DT, Vx
Set delay timer = Vx.
DT is set equal to the value of Vx. | class TestCPU(unittest.TestCase):
def test_LD_Vx_DT(self):
self.cpu.instruction = 0xF107
self.cpu.delay_timer = 0x42
self.cpu._LD_Vx_DT()
self.assertEqual(0x42, self.cpu.V[0x1]) | 0 |
e01095f331859037f98904e41e061635 | c619e002aed83975b8ff469ae89af338 | ritorna una lista di tuple che rappresenta i vicini della tupla passata, se rientrano nel range della griglia | class App:
def getNeighbors(self, x, y):
return [(i, j) for i in range(max(0, x - 1), min(self.row - 1, x + 1) + 1)
for j in range(max(0, y - 1), min(self.col - 1, y + 1) + 1) if i != x or j != y] | 1 |
488ccf6bffcfe2a24a0ab14a597d28ea | 903ad8c976a7e0344f72b72210ffd856 | handleFileServe serves at the given path the files under the given directory. | func sourceHandler(response http.ResponseWriter, request *http.Request) {
http.ServeFile(response, request, request.URL.Path[1:])
} | 0 |
180aa1c1d0ee8e8dbc629951b23f7c84 | 7dcd85be91770ae7bd94475804f8afe3 | 根据用户编号删除教师用户信息 | public int teacher_Delete(@Param("tno") String tno); | 1 |
abd0451d5f7e6e4e01e0a9b84896373b | 8b50cdbc0b321f2cf51e5c293d14f575 | Returns the identifier of the story. | class MangaReviewScores
public function getStory(): int
{
return $this->story;
} | 0 |
669166c30f666a59c5b420d31e46eae8 | 678af48df3c92962e6be008162cdd587 | Header only. | class TValidationSummary extends TWebControl
protected function renderHeaderOnly($writer)
{
$writer->write($this->getHeaderText());
} | 1 |
d234400da1a29fe810d41440dfeebbcb | fbf4706409cc7e22651dc43232cd9f19 | 异步后置处理。 | namespace Lenic.Framework.Common
public class MethodPipeline
public MethodPipeline After(Action<object[], MethodPipelineResult> func)
{
this._afterHandles.Add(func);
return this;
} | 0 |
29e7eae40b7cbf3b76e0b58fe2a05d52 | a64538ab8d573abbfc8f6deba1fbe817 | Cria o currículo com os dados salvos | public String form(@RequestParam(value = "imagem") MultipartFile imagem, CursoControllerModel curso, @RequestParam(value = "video") MultipartFile video)
throws IOException {
cursoRepository.save(CursoMapper.converter(curso, imagem, video));
return "redirect:menuTutor";
} | 1 |
bce44896adfc8611d6663e1aa0e8d498 | e2081f920d7249106fe21e10b9c1b3c2 | Callback for when a connection to the IRC server has been
established. This method is called *after* a connecting was
successful. | class IRCBot(asynchat.async_chat):
def handle_connect(self):
if self.verbose:
print '\x1b[31m--\x1b[0m Connected to IRC-server!'
if self.password:
self._write(('PASS', self.password))
self._write(('NICK', self.nick))
self._write(('USER', self.user, '+iw', self.ni... | 1 |
57b13a49e182789ca7d445913aae2bf8 | 66829f766a6db55e5fbd8cce47f82e4d | pandas-profileレポート出力 | headers = [args.path, 'MPJPE', 'MPJPE-PA', 'Match']
report_ref = all_report
table = []
for act in report_ref.keys():
tabs = [act]
for key in headers[1:]:
if key in report_ref[act].keys():
tabs.append(report_ref[act][key])
else:
tabs... | 0 |
9153636d445270589ca7c623e678ac66 | 0dd1034871ec5bcfddfa5953f221b321 | 获取支付银行数量 | class Banks extends BaseModel
public function getBanksCount($condition) {
return Db::name('banks')->where($condition)->count();
} | 1 |
75183f1156f005ba4fa072abf8e7b0d5 | 6206a865bd756a20744ef1fdaa66f803 | Sets this binding to create a singleton binding | class DIBindTo implements IDIBindTo
public function asSingleton(): IDIBindTo
{
$binding = $this->container->getBinding($this->symbol);
if ($binding === null) {
throw new DINotFoundException($this->symbol);
}
$this->container->setBinding($this->symbol, new DISingletonBindi... | 1 |
0b9bd38fd201d12f4c8ca7cb29212164 | 746bcba7d9ae9e19d12d2f551b0e387d | This is used to grab references to images that have been previously loaded. | function addImage(img, name)
images[name] = img
end | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.