query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
35977653ad5f4ce12041ab04ee1868b3 | 8701fd27b4ab0f28e96893352429e6f5 | Register built-in effects | void RegisterCustomEffects() {
LEDS.SetGlobalBrightness(0.1);
RegisterNextEffect(50,3,Rainbow);
} | 0 |
60d7bb19486c0be7a91dec0c2b4b1aec | fc68d669655c3cee708f2f1f77485edf | ERROR: type should be string, got "https://codility.com/demo/results/trainingBPDPM9-XQG\nTask score: 100%" | def solution(A):
B = sorted(A)
count = 0
before = -1000001
for num in B:
if num != before:
count += 1
before = num
return count | 1 |
e905145e07813c1ea3e285d7274cb67b | c9cadd8941ee8047314e6277695e311e | @brief Block used to add image processing support to fragment shader. | class Filter
static get defaultFragmentSrc()
{
return [
'varying vec2 vTextureCoord;',
'varying vec2 vFilterCoord;',
'uniform sampler2D uSampler;',
'uniform sampler2D filterSampler;',
'void main(void){',
' vec4 masky = texture2D(filte... | 1 |
acfa0a08698e5ad6553983656e878d9c | 8c21eb9cfee345d1247f7be4edba1a4f | Convert the parsed index information into options to the Generators index method. | public function setGeneratorOptions(array $options); | 0 |
87814c34ca20078d304935275dcd7195 | 3382ede10faa31f628c1039434f5c6ed | 通过Tag id获取文章 | @RestController
public class ArticleController
@RequestMapping(value = "/t/{tagId}" , method = RequestMethod.GET)
public Result getArticleByMeta(@PathVariable Integer tagId) {
List<Map<String, Article>> tagArticle = articleService.getArticleByMeta(tagId);
return ResultUtil.success(tagArticle);
} | 1 |
7ce4905cff478b2db3d4c78ba7b34dd8 | b01fd154b430c6bd16c33e5150d2e471 | Returns a list of the variables directly owned by this element | class ProcessingContext
List<VariableElement> allFields(Element element) {
List<VariableElement> list = new ArrayList<>();
gatherProperties(list, element);
return list;
} | 1 |
c9ddd6fc4704486eee8fd4e1d509c854 | c7d7543e7bc8ce40a094ed1a609a911a | 批量建立试卷与问题的联系 | if(null==vo.getId()){
vo = examDao.save(vo);
for(String id:ids){
if(StringUtils.isNotEmpty(id)){
TeQuestionExamVO qevo = new TeQuestionExamVO();
qevo.setExampaperId(vo.getId());
qevo.setQuestionId(Long.parseLong(id));
questionExamDao.save(qevo);
}
}
}else{
updateMakeExam(vo,... | 1 |
0173d9dd89cee758017f2fd92f99b133 | 979494033845aea24b4449ceb6cffa5c | !
@brief - Configures the pinouts of SPI1 interface | {
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hspi->Instance==SPI1)
{
__HAL_RCC_SPI1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;... | 1 |
fa34f2e4f97aeafd655908ac31d4bd95 | f2ca385dc3f97a81742200e8d10f6caf | Decorator to check whether user can unpublish a given
collection. | class Quiz(BaseModel):
def unpublishable(self, value):
self.logger.warn("Setting values on unpublishable will NOT update the remote Canvas instance.")
self._unpublishable = value | 0 |
caa2c0e82f1ab54a6bf9697fb25f4fb1 | e664781a1894a3c012d57646cde4ebe4 | Get the currently selected biome | local rawWeights = globalWorldPlayer:NKGetBiomeWeights()
local currentBiomeID = nil
local oldWeight = 0
for biomeIDs, biomeWeights in pairs(rawWeights) do
if biomeWeights > oldWeight then
oldWeight = biomeWeights
currentBiomeID = biomeIDs
end
end
return currentBiomeID
end | 1 |
dc9b61abbd4100588b16b4fe250b5f93 | 206921c4f399206e05c348e35d4651d8 | Check for feasibility and initialize the dictionary. | class ClueSolutionSpace:
def populate_from_dictionary(self, partial):
if self.__fully_filled: return
self.populate(partial.matching_solutions())
self.__fully_filled = True | 0 |
fff8a4bd75b68f30a6e06b2f322c766d | 2b6fc3b610397f310a7c619dd2d2a06b | this method reads out the games with details from the gameday data | def initialize():
GAMEIDEXTS = ['00','01','02','03','04','05','06','07','08','09','10','11']
GAMEDATE = '20151018'
for gameidext in GAMEIDEXTS:
gameid = GAMEDATE + gameidext
try:
openJSON(gameid)
all_games.append(gameid)
except ValueError:
None... | 1 |
e887427510d3c109db3d80f98bfff609 | 357ad4dcec4447fe22d0cf734a1744fc | Creates a relative path. | {
Contract.Requires(IsValid);
Contract.Requires(atom1.IsValid);
Contract.Requires(atom2.IsValid);
var components = new StringId[Components.Length + 2];
int count = 0;
foreach (StringId component in Components)
{
... | 1 |
db5ce77641da5c1982abbde8f438a951 | 55e202999c0df95e2db6750e1b60da3b | Move to previous example | function dislike() {
endExample(false);
if (my_current_example > 1) {
sendExample('Dislike');
}
} | 0 |
881690dfa272c1bd9774e06e03ecd9ab | d51b9f6a82f9c664e9d1343376b8db11 | Add JWT provider middleware. | return new JWTStrategy(this.jwtOptions, async (jwt_payload, next) => {
try {
const user = await this.prisma.user.findUnique({ where: { email: jwt_payload.email } });
if (!user) {
return next(null, false);
}
return n... | 1 |
afacc611ef5e27f08b0ae9b1bab3f3bf | d6e1c585658fae55406a052f7d9af7b5 | ********************************** // INTERSECT HEAD // ****************************************// | function candiateHeadEx() {
let canHead = document.querySelector('.candidates-header');
let canHeadPos = canHead.getBoundingClientRect().top;
let scrollPos = window.scrollY;
if (scrollPos > canHeadPos) {
canHead.classList += ' candidates-header-ex';
}
} | 0 |
2847f31ec051a07d422cc73fade5cb6c | 062d9a35614223a77fe9b1c35fd1cfe4 | Returns an array of items which positively fuzzy matched against a given query. | class Prose extends Prose_Component
public function getMatched()
{
$result = array();
foreach ($this->items as $item) {
$result[] = $item->getMatched();
}
return $result;
} | 0 |
9123433ca0d79f92d2b086a9bc2e5459 | 0f8fdaa402c0297e22b77d2dd8af8dd8 | 得到是否为夜间模式的item,设置此item的title | public class LatestNewsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
public void setIsNight(boolean flag) {
isNight = flag;
notifyDataSetChanged();
} | 0 |
c0bd9198d09923fcba42da5b2c4d62e2 | 17f07216a347d173676c2efbdcdf5730 | Remove wireless settings from search in demo mode | public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.WirelessSettings");
context.startActivity(intent);
} | 0 |
0f64af4e60d7e46c99666e14ab760010 | 7f8c2172a3cd19520611521c202d1805 | Checks that integer is greater than or equal to zero | namespace Infrastructure.Core.CodeContracts
public static class ParameterCheck
public static void IntParameterGreaterThanZero(int parameter, string parameterName)
{
ParameterNameRequired(parameterName);
Require(parameter > 0, string.Format(Messages.ParameterCheck_IntParameterGreaterT... | 0 |
c1ab5232a2ef40df1be13c0f8143877d | 03c4791a41a7f5020c63be1cd175ada9 | 微博稿件显示微博正文,普通稿件显示稿件标题 | function do_makeContent(res){
var meat_title = '<h2>'+res.text+'</h2>';
var meat_sub_title = '<h5>创建:'+res.create_id+' / '+res.create_dt+' 更新:'+setDefault(res.update_id,'-')+' / '+setDefault(res.update_dt,'-')+'</h5>';
var page_url = window.location.protocol +'//'+ window.location.host +window.location.pa... | 0 |
8f43a366947bad371ce8e394d6d9ec22 | 4d35fed1595a69a84b3540bfe8ca4e7d | unicornHatHDの画面更新関数 | {
static const double kPI = 3.1415926535897932384626433832795;
static const double kFovY = 40;
double nearDist, farDist, aspect;
glViewport(0, 0, width, height);
nearDist = 1.0 / tan((kFovY / 2.0) * kPI / 180.0);
farDist = nearDist + 2.0;
aspect = (double) width / height;
glMatrixMode(GL... | 0 |
e641bee740e0ed36f791e9bd21c2acfa | c82a4d03a8bba4fe4f8e07afb3531425 | Prints the entire Queue fom front to rear | if(self.front == self.rear):
print("\nQueue is Empty")
for i in self.queue:
print(i, "<--", end = '') | 0 |
0fa4780474a4d08ecccca7ed61169669 | dca3fd5b8b62998cf54d91c974fd6d59 | Generation of JSON to render Properties.
current request
current response | {
yield 'property:*title' => $this->getFullTitle();
if ($this->_baseHref) {
yield 'property:*baseHref' => $this->_baseHref;
}
if ($this->_headers) {
yield 'property:*headers' => $this->_headers;
}
if ($this->_cookies) {
yield 'prope... | 1 |
5251de7ccdd12e04947b09017eb31edb | bc99e5f87bb982b26886bd16eea90944 | Display the Juicer post content of the current Juicer post.
Must be used inside the Juicer Loop. | function juicer_the_content() {
echo juicer_get_the_content();
} | 1 |
e906db96801b3a7e025196efafb1053f | bb36733fc9a7b30fee456fafbb753ef9 | Set the value of a thread attribute. | NTSTATUS
LwRtlSetAffinityThreadAttribute(
pthread_attr_t* pAttr,
ULONG CpuNumber
)
{
NTSTATUS status = STATUS_SUCCESS;
CPU_SET_TYPE cpuSet;
CPU_ZERO(&cpuSet);
(void) CPU_SET(CpuNumber, &cpuSet);
status = LwErrnoToNtStatus(
pthread_attr_setaffinity_np(pAttr, sizeof(cpuSet), &cpuSe... | 1 |
1fe39941ae19cd7feb0eb3cfdd7e4579 | d0c6a0e80bd3100a87f8f05666526e27 | get the boundaries for acceptance of measurements - [-3sigma, 3sigma]
with
regards to the mean | nGroups = len(meanList)
XU = -999.0
XL = 999.0
YU = -999.0
YL = 999.0
nSigma = 5.0
for index in range(0,nGroups):
mu = meanList[index]
covar = covarList[index]
if mu!='NAN':
sigma1 = np.sqrt(covar[0,0])
sigma2 = np.sqrt(covar[1,1])
xmin = mu[0]-nSigma*sigma1
xmax = mu[0]+nSigma*sigma1
ymin ... | 1 |
a1437c2bfd70d8a5586a95e9fd46d495 | 5fb887724f366fc3cc57604a2ccc5c87 | backticks | public class BallerinaBaseListener implements BallerinaListener
@Override public void enterBacktickString(BallerinaParser.BacktickStringContext ctx) { } | 1 |
d908e15ebc1ed213ac328fd755725a69 | 1ff30bebcf4d269023e473daa4911911 | 根据登录账号查询学生的借书情况 | List<Student> getLogin(@Param("saccount") String saccount); | 0 |
5b574c0542c1b691a120aea6aea3b4c7 | 7beaac71a13e81f32b2e3df4a7f067ab | Allocate memory and release wait task,
as long as there are enough free memory. | {
uint32_t new_size;
uint32_t *aligned_addr;
void *pool_ptr;
new_size = size + (sizeof(uint32_t) << 1) + MALLOC_ALIGN - 1;
if (_do_task_mem_pool_alloc(_heap_mem_pool_id, new_size, TICKS_NONE,
&pool_ptr) != RC_OK) {
return NULL;
}
aligned_addr = (uint32_t *) ROUND_UP(pool_ptr, MALLOC_ALIGN);
*aligned_add... | 0 |
8024a3d74e9f498b309cd46358a955f0 | 86993977b227f025880299145d048c71 | We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.)
Based on your use case you may want one or the other. | namespace BlueprintZ.Tools.lib.system.DTE.VS
public sealed class VS_Command
public void VS_FullScreen(DTE2 dte)
{
Execute(dte, "View.FullScreen");
} | 1 |
e636823b56791a72878bf3bf36d94dfd | f47763820d7684e5595278d97e39d1b5 | 获取是否在录屏状态 | function ScreenRecordMgr:isRecording()
if gf:isAndroid() then
return self:supportRecordScreen() and self:isAndroidRecording()
elseif gf:isIos() then
return self:isiOSRecording()
else
return self.recording
end
end | 1 |
d77270ecf145585cc8998af98411c080 | 4748959277a6c1995ac1499cb2f71f02 | 设置标题颜色
<p> | void setTextTitleColor(int titleColor); | 1 |
365e81d35a2d8566b8517a0cdeb3e572 | c547abf5fadca23c63477414f77f484c | what should I write here?? | void mexFunction( int nlhs, mxArray* plhs[],
int nrhs, const mxArray* prhs[])
{
} | 1 |
77a05345c72d77584eb2b4ae2427bc7a | e93ec589ed57be3ca2080d8689eae7d1 | Executa o algortimo de menor tempo de movimento para
o elevador levar ao destino todos os passageiros, e mostra
como resposta a estado final dos andares do edifício. | LinkedList lista = make();
LinkedList visitados = make();
addfirst(estado, total_retangulos,total_vertices, &lista);
while((lista.total_size != 0)){
estado = removefirst(&lista, total_vertices);
addfirst(estado, total_retangulos, total_vertices, &visitados);
neighbours(estado, total_re... | 0 |
ae6a8528a1fcac4833457874a32555f3 | 8430abbffd29e35e54e6578a2f986bb9 | @brief Function for deleting RECORDS request. | SOAP_FMAC6 __trc__DeleteRecording(struct soap* soap, struct _trc__DeleteRecording *trc__DeleteRecording, struct _trc__DeleteRecordingResponse *trc__DeleteRecordingResponse)
{
return 0;
} | 1 |
c242b52eda2573384e2a273a1cecdfda | 03d619ae7fdee18f4fbeb3f75032817e | Runs when the BuzzardMoveEvent fires. It updates the position
of the Control to that of the model. | {
if(bevActor != null) {
bevActor.doMove(_target);
_curDelay = _delay;
}
} | 0 |
855f3c1fb442c527c706435360434eb4 | 0bf7042fb0d8cffc5cbdd821ed90d27c | Restores the read position previously saved with <see>Push</see>. | {
_readPosition = ((_readPosition + 7) >> 3) * 8;
return this;
} | 0 |
0a5cba1c7562eb3254ceb607fa7b52ec | a7a833592fbf2d93d0f19cbf6fa0a0ea | We only display date and title in the model | class Calendar(models.Model):
def __str__(self):
return str(self.date) | 0 |
7f3c779b242b42fec63eac7e840974fd | a55ffc72f9cfb5420b2d9496ad0cb8a3 | Retrieve L3 Cache Allocation | class CapsL2ca(Resource):
def get():
l2ca_info = caps.l2ca_info()
res = {
'cache_size': l2ca_info['cache_size'],
'cw_size': l2ca_info['cache_way_size'],
'cw_num': l2ca_info['cache_ways_num'],
'clos_num': l2ca_info['clos_num'],
'cdp_supported': ... | 0 |
35b78c3b62191a9dd5d45d90798f43ac | cab19f630ed183e1f2e1169d8bd275af | whenever the toolwindow loses focus the list is saved to the computer for loading next time the list is initialized | namespace RedCell.Research.Experiment.UI.WPF.Designer
public partial class MainWindow : Window
private void Editor_LostFocus(object sender, RoutedEventArgs e)
{
Save();
} | 1 |
763b9c970ae5f67374750ac8f5c960a1 | 6e41454ba1167d1995599cccad243c17 | Will make sure to take servers offline from load balancer before executing
operations on it. This requires load balancer configuration in your env.json config. | namespace hardforward.Controller.Strategy
void ReloadServers(); | 0 |
1927b539960d7e0c30200ba60146c7b1 | c0d91a953d79bf2702a1cb4574f524e0 | Convert true anomaly to eccentric anomaly | def true_anomaly_from_eccentric(e, E):
return 2 * atan2(sqrt(1.0 + e) * sin(E / 2.0), sqrt(1.0 - e) * cos(E / 2.0)) | 0 |
066be3208bdf1b5a80f7fa25a029dd81 | 243f3a8164fe4b8241b7cc423732a3e9 | How many testcases which are 'ok' are there? | class HtmlReporter
def passes
count - failures - errors - skips
end | 1 |
b3cc469f339ba0d36e5c6bfb0fbd40ca | dcc92a6ea3f15bd1c4083580e239bef9 | Tests that listeners receive the right events | public class InstanceConfigurationTest
@Test
public void testListeners() {
InstanceListenerInterface listener = mock(
InstanceListenerInterface.class);
this.objectToTest.addListener(listener);
InstanceMark someMark = new InstanceMark(Color.RED);
this.objectToTest.mark... | 1 |
ea3698f0ef416b3132b9626b549886d6 | b52f6c653d7f710aa4396e88f20c55d3 | Installs a package on a remote server. | class CFDPackageManager(object):
def install(self, package, version=None):
raise Exception("Please define an install method on your package manager %s" % self.__class__.__name__) | 0 |
0be97b95fdc2d13484d9c9bd10247b37 | f9043a373f15028dde49f63a72fa1513 | Sets the number of questions to the user's input | if (inNumAnswers <= MAX_NUMBER_OF_ANSWERS) {
numAnswers = inNumAnswers;
}
} | 0 |
5176729e3e04e3f670d0bd00acd0a378 | 229e794fe6e86ea73b84e6fbb6d18872 | Gets the access levels a person has from all permissions | namespace EPlast.BLL.Services.ActiveMembership
public class AccessLevelService : IAccessLevelService
public async Task<IEnumerable<string>> GetUserAccessLevelsAsync(string userId)
{
var leadershipLevelRoles = new List<string>
{
Roles.KurinHead,
Roles.K... | 1 |
ddd4de3c1372f4779c663cc4eb5944e4 | 38f85b228e37ada732ae6743ff7ebc25 | According to atomic_base.h: __cmpexch_failure_order | {
const DPAIR *a = (const DPAIR *)va ;
const DPAIR *b = (const DPAIR *)vb ;
Bool result ;
if ( ! o1_eq_o2( & a->key , & b->key , & result )) {
error_clear() ;
result = TRUE ;
}
if ( result ) {
return 0 ;
}
else {
return ( o1_gt_o2( & a->key , & b->key ) ? 1 : -1 ) ;
}
} | 0 |
760bcdc71f8ecaa536bbec9e7bc84c1c | 89967b4d26eae602898dcda78b58f890 | Override metode som avslutter programmet når du trekker "x"'en | namespace Marathon
public partial class mapForm : Form
private void mapForm_FormClosing(object sender, FormClosingEventArgs e)
{
Application.Exit();
} | 1 |
e91c7577fb1501ffca80ed2c2fb51723 | 9637d2c0316fc7d037c43d4ae4b3664a | Sets the closeDate attribute of the DocumentStore object | class PurchaseOrderItemsModel implements ModelInterface, ArrayAccess
public function setApCloseDate($ap_close_date)
{
$this->container['ap_close_date'] = $ap_close_date;
return $this;
} | 0 |
50e92ffc7ae49e7b57fe54fa629ecac6 | 8f6afd28696a1e61195fb5d30cb5035f | Create a new map with the given information
return the new game hash id | validation = auth.validate(request)
if validation['status'] != 'ok':
abort(validation['code'])
player_id = request.json['player_id']
map_code = request.json['map_code']
side = request.json['side']
if not match_validator.are_slots_available(player_id):
abort(403)
if not match_... | 1 |
bee4f80cdc6f259cb4140373140442f7 | eddaddd06fbddf465a41a386646a05bb | maps specified UniFileType to particular standard Spectrum FileType | switch (specificType) {
case SensorSpecificTypes.fiveInOne31:
case SensorSpecificTypes.fiveInOne38:
return SensorGeneralTypes.fiveInOne;
case SensorSpecificTypes.tower:
return SensorGeneralTypes.tower;
case SensorSpecificTypes.proIn:
return SensorGeneralTypes.proIn;
case SensorSp... | 0 |
c660e3193adcc9593b47ec168dec9d4e | b3f7421608011316fd4a27761799c366 | Collect bug report on failure | function mail_bug_report($errno, $errstr, $errfile, $errline) {
switch ($errno) {
case E_USER_ERROR:
$text = "FATAL [$errno] $errstr<br>\n".
" Fatal error in line ".$errline." of file ".$errfile.
", PHP ".PHP_VERSION." (".PHP_OS.")\n".
"Aborting...\n";
... | 1 |
c6f67df9f350edb6b62801167c2d6dc3 | 19b6b7242b1a005a17e3513b438129b3 | 设置角色各部分位置和大小 | this.stageW = this.stage.stageWidth;
this.stageH = this.stage.stageHeight;
this.gameRole = new GameRole();
this.gameRole.x = 0;
this.gameRole.y = 1178;
this.gameRole.scaleX = 1.2;
this.gameRole.scaleY = 1.2;
console.log(th... | 1 |
e931f77ec5482d90d86e4ce62fb7f223 | a2c1bf834831879c6c74a647832d2934 | 删除镜像不可变规则 | {
JsonResponseModel<DeleteImmutableTagRulesResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteImmutableTagRules");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<DeleteImmutableTagRulesResponse>>(strResp)... | 1 |
9f55feba4ecfa5a8230fbd42d2c0206d | b002bfcb3ab5ee6de169add95b026aa6 | 每年1月1号1点30执行,将下载类型限制是每年的用户,下载限制内数量重置为0 | $cache = Cache_Factory::getCache();
$dailyLimit = intval($cache->hGet('dailyTask2', 'dailyLimit'));
if($dailyLimit == 0){
return false;
}
$cacheHash = $uuid.'_user_info' ;
$cacheFinishNumKey = 'finishDailyTaskNum2';
$cacheFinishTimeKey = 'finishDailyTaskTime2';
$finishDailyTaskNum = $cache-... | 0 |
4f0a2fe8b2104bed8536b8a17f6ce575 | bb6022c527b443ff2cee114958e51713 | maps over the keyboard displaying every single character as a button | class KeyboardWindow:
def initializeKeyboard(self):
varRow = 1
varColumn = 0
for button in self.buttons:
command = lambda x=button: self.select(x)
if button != " Space ":
tk.Button(self.frame, text= button, width = 5, bg="#000000",fg="#ffffff",
... | 1 |
c6d6f12266def2885ae8df83bd92a0e3 | 8476004de7a06a11b06a8ca98ab26a11 | 链队列取队头结点值,输入链队列起始地址,要接收值的指针,输出成功或失败标志 | Status GetHead(Queue q, ElemType *e) {
if(q.front==NULL) return FALSE;
*e = q.front->data;
return OK;
} | 1 |
2a7ba81197cead03ee33f6cde5b6816c | 499191da119b7b58beb3c44e42d83c8c | Retrieves the value of one of the constants from the current fundamental catalogue (FK) model. | public function getConstant($constantName); | 1 |
610b3ba3b2204087932b9c2d460ff8af | 192988de67f912fcaa3ae66e84eac03e | Sets the "domainname" element | static VALUE radenroll_set_domain_ou (VALUE self, VALUE value) {
RUBY_ADENROLL *ptr_enroll;
adcli_enroll *enroll;
Check_Type(value, T_STRING);
Data_Get_Struct (self, RUBY_ADENROLL, ptr_enroll);
const char *c_value = StringValuePtr(value);
enroll = ptr_enroll->enroll;
adcli_enroll_set_domain_... | 0 |
06b8e3f380e9fcea11a0a2e2e2f78f5b | 10e4eefd89787fd424fac94492e4c6fd | 将单词和对应的词频输出到文件中 | word_count = {}
for key in list_word:
if key not in word_count:
word_count[key] = 1
else:
word_count[key] += 1
word_dict_sort = sorted(word_count.items(), key=lambda x: x[1], reverse=True)
for key in word_dict_sort:
writetxt_a(key[0] + '\t' + str(key[1]) +... | 1 |
7d1a14c02d335dca3a9cd728d9f7b220 | 083dcb1dd952fb61eaa01f81c02f2298 | Test sorted union error handling where middle table is not sorted (Negative test) | def test_join_merge():
sample_table_1.sort(key=lambda x: x[1])
sample_table_2.sort(key=lambda x: x[0])
results = join_merge(sample_table_1, 1, sample_table_2, 0)
results.sort(key=lambda x: (x[1], x[0], x[3]))
assert results == reference_result | 0 |
fe05eb6d697ce79f438e3e151d2074d5 | 093f259434af52c80d3f17518df775af | Function to validate each field. Takes the field and messageDiv.
It highlights the field if it has an error. | function validateField(input){
var re;
var message;
var parent_element = input;
var correctField = false;
while (parent_element.tagName != 'DIV') {
parent_element = parent_element.parentNode;
if (parent_element.tagName == 'DIV') {
error_element = parent_element.getElementsByTagName("SPAN")[0];
};
};
if(... | 1 |
109331f374e5dcedadb191225d78d668 | 861070e519b94bc3c4052b4e2c3027e2 | 스로틀을 당기고 있는지 여부를 체크하는 함수 | if (_bIsSkilling) {
if (_bSkillCounter > 0.0f)
_bSkillCounter-= Time.deltaTime;
else {
characterController.SetControllable(true);
_bIsSkilling = false;
}
}
else {
if (Input.GetAxis("Horizontal")!=0 || Input.GetAxis("Vertical")!=0 ||characterController.jumping) {
_bSkillPose = false;
... | 0 |
2bac2a38ab8002a3a0e5f97667143b89 | eddb6bed23c98bb3b71e37bc94893d60 | Test the SupplierPartDelete view | class ManufacturerTest(InvenTreeAPITestCase):
def test_supplier_part_create(self):
url = reverse('api-supplier-part-list')
response = self.post(
reverse('api-manufacturer-part-list'),
{
'part': 1,
'manufacturer': 7,
'MPN': 'PART_NUM... | 0 |
90cfddf852fff36f1a9f45677d72609c | 37fcae8591abfacaf1a8585b00909e0d | Reset metric states at the begin of each pass/user specified batch. | newtime = time()
if self.last_state is not None:
timediff = newtime - self.last_time
pl_module.logger.log_metrics({f"{self.last_state}_to_train_batch_end": timediff}, step=pl_module.global_step)
self.last_time = newtime
self.last_state = "train_batch_end"
... | 0 |
9ba3281402b0c4c058e1d99ae32f4750 | d4f0431ae347af58e98cc6e89240dac4 | 加载FormConfig配置文件 | public partial class Main : Form
private void LoadConfig()
{
try
{
var location = Assembly.GetExecutingAssembly().Location;
this.config = Import.LoadConfigFromXmlFile(Path.Combine(Directory.GetParent(location)?.FullName ?? string.Empty, "Config.xml")) ?? new();
}
... | 1 |
ebea52649212a6d48c014ca304201869 | 5a8f1aad20b6bd571e1ad5c8bad8a946 | 取得したOAuthIDとOAuthアカウントをDBと照合するメソッド | class User_model extends MY_Model
function check_oauth_login($uid, $source)
{
$query = $this->db_slave
->where(TBL_USER_OAUTH.'.oid', $uid)->where(TBL_USER_OAUTH.'.source', $source)
->join(TBL_USER,TBL_USER.'.userid = '.TBL_USER_OAUTH.'.userid',left)
->get(TBL_USER_OAUTH)... | 1 |
0e1b5fb248ca0ef600ec88589e5ac825 | 26fabfd447cbc468abe1443ffce4e5d8 | 移除全局 Progress Callback | try {
return await SYB.removeProgressListener();
} catch (e) {
console.error(e);
}
} | 1 |
80bda6f8a2825ae7c07c7aaaca0cc2d0 | 72a864d00953e71024af3d6c75cfe212 | 显示视频会议地点 | @RequestMapping(value = "meetingMap")
public String meetingMap(@RequestParam(required =true) String meetingId, @RequestParam(required =true)
String callback){
AppResult appResult = tbMeetingService.showMeetingMap(meetingId);
JSONObject json = JSONObject.fromObject(appResult);
String result = callback + "(" +... | 1 |
b622b9b50ce33c30ac6820ec4ad941c8 | c5ff2615a2118434b9f07f3fe56a06dc | 打印一个字符串全部的子序列 包括空字符串 | List<Character> list = new ArrayList<>();
for (int i = 0; i < str.length; i++) {
list.clear();
for (int j = i; j < str.length; j++) {
list.add(str[j]);
listToString(list);
}
}
} | 0 |
d160cae00dc58b284325de7e301c117c | a3df1452dba78d2e0d0a20c6f44ce01e | Build standard validation / testing transformation for Histology networks. It includes, resizing, and normalization. | def get_test_transforms(w=512,h=512):
transform = A.Compose([
A.Resize(width=w, height=h),
A.Normalize(),
ToTensorV2()])
return transform | 1 |
ba90df5454e10abed0b1144481124992 | f037bb4aaa5d4e37a9ebe8a9ea335471 | desfaz a conclusão da cotação e marca como em andamento | class StocksModel extends Model
public function cot_aprovado($id_aprovado)
{
$params = array(
$id_aprovado
);
$this->query(
"UPDATE cotacao_servicos
SET cot_aprovado = 1
WHERE id_cot = ? ",
$params
);
} | 0 |
80ed063625cd6addac1ba95c31ae4505 | b7882eb68cae2a33e4bde5b243f21848 | Test that a user can NOT approve a content view request for content that
they do NOT own | pk = self.app.pk
self.client.force_login(self.requestor)
response = self.client.get("/developers/request/{}/".format(pk))
self.assertEqual(response.status_code, 403)
self.client.logout() | 1 |
657d392959a2a18453b5f698126fcc8b | 2f397aeaca05919952f849e7a2b424b6 | Stores and computes collision frequencies | double kx=2*M_PI/periodicity[0];
double ky=2*M_PI/periodicity[1];
int numN=nMax*2+1;
VecF< VecF<double> > real(numN),imag(numN),skk(numN);
for(int nx=-nMax,i=0; nx<=nMax; ++nx,++i){
real[i]=VecF<double>(numN);
imag[i]=VecF<double>(numN);
skk[i]=VecF<double>(numN);
}
f... | 0 |
6d425b0db13a198eb5106a518fd8c403 | e53875084733f482839a186a1ddfed3c | 模糊查询商品 | @Select({"SELECT product.* FROM product product WHERE del_flag = 0 AND shelf_status=1 AND (product.`name` LIKE '%${name}%' OR product.`code` LIKE '%${name}%') UNION ",
"SELECT product.* FROM product product INNER JOIN series series ON product.series_id = series.id WHERE product.del_flag = 0 AND series.del_f... | 1 |
799e415dfdc9c5403e421f44f5db9679 | c57ddcf76bcf03b8be36561d2ddea392 | Импортирует рекомендуемые товары | $db = Db::getConnection();
$result = $db->query("SELECT * FROM products WHERE recomended=1 ORDER BY datetime DESC");
$recProducts = [];
$i = 0;
while($row = $result->fetch()) {
$recProducts[$i]['id'] = $row['id'];
$recProducts[$i]['title'] = $row['title'];
$recProducts[$i]['p... | 1 |
8783af1bbc7624f093041e8934cabf67 | 191d5226a826b2bfe8e5a86dbd243d17 | Este metodo me permite guardar las ordenes por prestador | class ordenController extends Controller
public function guardar(Validacionorden $req)
{
$dat = Ordenmodel::where('orden',$req['orden'])->get();
if($dat->isNotEmpty()){
return response()->json(['respuesta'=>'OC ya existe, favor ingrese otro numero de OC'],400);
} elseif ($dat->is... | 1 |
7dc85f719d7893ca4a022fab43c044b2 | dbae8577128f02ca97491e561c43171a | 直接执行单个系统命令并重定向到文件 | class BuilEditService
public function systemCommand($cmd, $directory = null, $input = '')
{
$directory = $directory ?: base_path();
$proc = proc_open(
$cmd,
[
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', 'w']
... | 0 |
8913191c11a831c61f5ebf8f2ba05de8 | f74e4d54f537d336fd3cad7ae1d72e6a | \brief Switch UDP (USB) clock source selection to UPLL clock. | {
LPC_SYSCON->USBPLLCLKSEL = src;
LPC_SYSCON->USBPLLCLKUEN = 0;
LPC_SYSCON->USBPLLCLKUEN = 1;
} | 1 |
e69e8d4bd728d5e65083dfa7c0a6f47a | 97a6da2bef91740a77b384ba3207f095 | Gets called at the beginning of ``evaluate()``
Default implementation loads the best-performing checkpoint for
evaluation, based on stored metrics. | class ModelBase:
def post_evaluation(self, checkpoint=None):
pass | 0 |
d1752069e8a6b894754def84bfc79436 | b033e161ab361fd4885346d0569ea884 | Update the users notified dates
Setting this date enables us to throttle notifications sent to a user based on when
we last sent her one. We don't do anything with this information currently.
This could become a hot spot in patch storms, and can be disabled without ill effect.
It is tested, so if you need to disable it... | await db.query(`
UPDATE tblChallenge SET DateMatchTimeNotified = GETUTCDATE() WHERE ChallengeId = @challengeId
`, {challengeId: {type: Db.INT, value: challenge.id}});
} | 1 |
67d21055fcaa225d05fade7e5e2f55c5 | 8e58b69c5744303b77106ac4c172cf12 | Disable the model used to view the node in editor mode. | class NodeEditor(UI_Object.UI):
def nodeViewMode(self,value):
self.edit(nodeViewMode=value) | 0 |
60ca584b46efdd0a67003744e96181eb | 93708b3cf026cadcca139f0a6ef3b718 | 通过车主姓名查询缴费信息 | public class MyDBHelper
public static List<ReimbursementInofo> selectReimbursementInofoByName(Context context, String name) {
List<ReimbursementInofo> list = new ArrayList<>();
SQLiteDatabase db = OutlayDBHelper.openDatabaseOnSDCrad(context, Name.DB.ZXN_APP);
Cursor cursor = db.rawQuery("select ... | 1 |
0dd046e8fad6990cb2b2eadd1811f91f | 066c447247134dafb097deb372c58a11 | Sets user TrainingDone. | public class Student
public void setSwtDone(boolean swtDone) {
_swtDone = swtDone;
} | 0 |
0c4db213426a52dbbb24643526e8c88c | d0024160a8f73f452b4b26753d677ec7 | GetIgnoreDirs returns dirs which should be ignored. | func ReadDockerignore(contextDir string) ([]string, error) {
var excludes []string
f, err := os.Open(filepath.Join(contextDir, ".dockerignore"))
switch {
case os.IsNotExist(err):
return excludes, nil
case err != nil:
return nil, err
}
defer f.Close()
patterns, err := ignorefile.ReadAll(f)
if err != nil {
... | 0 |
e270bfddcba6865b3f9ee9b485da3ea0 | 2b341c19f8f795680c649d89d27665a9 | State that the command should run in the foreground | {
$this->after = $fn;
if ($runInBackground === false) {
$this->inForeground();
}
return $this;
} | 1 |
c01ed945dbc227127a10ea4bba650f24 | 4d67245f86d120c796020ac14912aa11 | This method will be called to constantly lower the timer on the button buffer. | {
foreach (var state in buffList)
{
Buff b = state as Buff;
b.decreaseTimer();
}
} | 1 |
5970e1fb133b310cf3eeea761d2213c6 | d73ef7ed503ed0133fb6d20565ef8245 | 班级对话框 | class Course extends BaseController
public function dialogSelectClass()
{
$category_id = request()->get("category_id", 0);
$goodsid = request()->get("goodsid", 0);
$flag = request()->get("flag", 'category');
$box_id = request()->get("box_id", '');
$category_extend_id = reques... | 1 |
cb1c3a9ee12ea4012d4624b929a7e862 | a060e8ed5552bcf06730c50ebf1d7f49 | Decrypts a <c>long</c> value encrypted with <see cref="Encrypt(long)"/>. | namespace TSLuaFramework
public static double Decrypt(long value)
{
return Decrypt(value, cryptoKey);
} | 1 |
ffdcbc8e20d48239a94ef58ad0a3f3aa | 50e55f42bc88bbff40552ca056c32680 | Fetch an Employee instance for a service user | class EmployeeHelper
public getEmployee(id: string): Promise<EmployeeEntity> {
var employee = new EmployeeEntity();
employee.setContext(this.context);
employee.id = id;
return employee.load()
.then(isLoaded => employee);
} | 1 |
127bce324e12b2e65123046c5d279f72 | ca2aa71957418db31849f87cfd560c4c | Unity.Entities.Entity Unity.Tiny.Interpolation.LinearCurveFloat::GetKeysEntity() | struct SEQUENOEEXTENSIONS_API FTextCurve
: public FIndexedCurve
void FMovieSceneNameChannel::GetKeys(const TRange<FFrameNumber>& WithinRange, TArray<FFrameNumber>* OutKeyTimes, TArray<FKeyHandle>* OutKeyHandles)
{
GetData().GetKeys(WithinRange, OutKeyTimes, OutKeyHandles);
} | 0 |
1c15e9877bdd6b604e83476fe6fd32e6 | 5bffb95a6cb40f4aa31dc36bb3fc3d43 | 产生系统流水号,默认为四位 | class Number
static public function create($id=0)
{
$number = date('YmdH').str_pad(substr($id, -6), 6, '0', STR_PAD_LEFT);
$number .= self::_getCheckCode($number);
return $number;
} | 0 |
c7f25642f91645257e2d679a5948a0a2 | bd2cbcc55e45b02f4f5741d83e619800 | Generate Growths | std::vector<std::pair<Vec2, int>> grow_points;
tree_->GetGrowPoints(grow_points);
while (grow_buttons_->getChildrenCount() > grow_points.size()) {
grow_buttons_->removeChild(grow_buttons_->getChildren().at(0));
}
while (grow_buttons_->getChildrenCount() < grow_points.size()) {
auto btn = B... | 1 |
1ab7a3eb2702f0bc576533706cf49c47 | f43507425cdca766a5b631344da158e8 | returns the properties of a teacher in a readable single-line format | class Teacher(ITeacher):
def __str__(self):
return 'Teacher name: ' + str(self.teacher_name) + '\n' + \
'Courses: ' + str([i._course_name for i in self._courses]) | 0 |
9e53173d85ba0d826f2930703ea7f4d5 | c19f5cff6b01ccc3df59efc038169849 | The hasDigit method determines whether a string
has at least one numeric digit. | public class EditController implements Initializable{
private static boolean containsDigit(String s) {
boolean result = false;
for (char c : s.toCharArray()) {
if (Character.isDigit(c)) {
result = true;
break;
}
}
return result;
} | 1 |
716a753636374d1e0168fabce22bc581 | 39972167348ffa3ecca7c315f91e80ac | 根据学生或教师账号获取选题记录信息 | public Object getStudentTeacherRelationByStudentNo(HttpServletRequest request) {
try {
User user = (User) request.getSession().getAttribute("user");
logger.info("获取学生no" + user.getUserAccount());
List<StudentTeacherRelation> studentTeacherRelations = relationService.getSt... | 1 |
6e4e27725a71e8aac0f952e4afa3dbff | 3edf3cc6f393043e5cadb7613c9cd720 | Get the Int32Col Table interface for the schema. | ICFDbTestFloatColTableObj getFloatColTableObj(); | 0 |
d10f81a092bc06cc78456a9c57eea2a8 | 47987b64739475677442fb0683a3c0c4 | navigating through the mothers with the LEFT- and RIGHT-ARROW keys | var key = event.keyCode;
if (key == 37){
prev();
}
else if (key == 39){
next();
}
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.