query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4f477354f2a32f042fb6c105ec71e962 | c25d491b52f4b66ff413e846969ea9f0 | Assign a delegate to the pool.
PoolDelegate<T> | [Experimental(diagnosticId: Experiments.ObjectPool, UrlFormat = Experiments.UrlFormat)]
public static class ObjectPoolServiceCollectionExtensions
public static IServiceCollection AddPooled<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(
this IServiceCollection services... | 0 |
d323f90731094e13670f59d3536ba065 | 83ddbdb63f3e4a799a7d04c69a078ca5 | Keep asking for user input until we get a valid action | class Room(object):
def take_action(self):
self.next_action = input("OBSERVE, SAVE, CHANGE ROOM, HELP, EXIT ") | 0 |
041d650817959b205c2277f1acae66de | 152b7cef54b4c5551ae5cec1cf69f2bd | Loop through all handles. Upon detection of a handle signalled by poll,
its corresponding event handler is fetched and invoked. | static void dispatchSignalledHandles(const struct pollfd* fds,
size_t noOfHandles)
{
size_t i = 0;
for(i = 0; i < noOfHandles; ++i) {
if((POLLRDNORM | POLLERR) & fds[i].revents) {
EventHandler* signalledHandler = findHandler(fds[i].fd);
if(NULL != signalledHandler){... | 1 |
f91ad9fa86ec88400dbf136a36bfcd3f | b14893d514aef499513af471ca29d4c2 | 售后延期确认 | {
$data = $this->request->param();
if (isset($data['sh_delayed'])) {
Db::name('order')->where('id',$data['id'])->update(['sh_delayed'=>$data['sh_delayed']]);
$this->success('操作成功');
}
$order = Db::name('order')->where('id',$data['id'])->find();
$delaye... | 1 |
830a2fa6ca758e384c005590d7929114 | 55e62a23d63adf48057b17b140585cb3 | Builds hashmap containing movie id as key and movie name as value | movie_names = {}
with codecs.open("../data/ml-100k/u.item", "r", encoding="ISO-8859-1", errors='ignore') as f:
for line in f:
ary = line.split('|')
movie_names[int(ary[0])] = ary[1]
return movie_names | 1 |
d7273cfd6ea079386b5c15cb36d9de23 | 74250b85d6328b8f7b818a7378d7c3e6 | 同工会的所有玩家列表 | function FindAllPlayers()
local players = world:FindPlayers()
local npc = world.Npc and world.Npc:GetChildren() or {}
local res = {}
for i = 1, #players do
res[i] = players[i]
end
for i = #players + 1, #players + #npc do
res[i] = npc[i - #players]
end
return res
end | 0 |
b5591b22f1953e1c7b507965e2675447 | 05d856c543deb70aa91b4914592e03cb | 获取文件命名构建器 | {
builder.Context.FileName = fileName;
builder.Context.FileNameBuilder = null;
return builder;
} | 0 |
d7a6fa7bf459c935ebe338b55775b3db | fcde4806a606f7483ca62f5921778192 | 获取当前日期。 <br>
获取的日期格式为yyMMdd | public class DateUtils extends org.apache.commons.lang.time.DateUtils
public static String getDate() {
return getDate("yyyy-MM-dd");
} | 0 |
e00c44224960828bca0640a856d052dc | 2a02bbd78131e06cb3dfdd7b03795bc7 | https://stackoverflow.com/a/12514470/1013828 | def chunks(l, n):
n = max(1, n)
return (l[i:i+n] for i in range(0, len(l), n)) | 1 |
9af18322532b4c3999f6bfe58e83ef13 | 2497dff51bc5efde62e2bc12cd19c9e5 | Updates a list of insurance for a lease. | namespace Dym.Popular.HttpApi.Controllers.Mis
[ApiExplorerSettings(GroupName = ApiGrouping.GroupName_Mis)]
public class InsuranceController : PopularController
[HttpPut]
public async Task<PopularResult<string>> UpdateAsync([FromBody] InsuranceDto dto)
{
return await _insuranceService... | 0 |
a2ab6ec9732521cf58ec21da96924e3f | 2e900033cb7a10678fe500b7bd907f8c | Ratings for Review, switches star image according to a new start rating passed in. | function updateStars(starCounter){
if (starCounter==1){
starlets[0].className='fa fa-star-o';
starlets[1].className='fa fa-star-o';
starlets[2].className='fa fa-star';
}
else if (starCounter==2) {
starlets[0].className='fa fa-star-o';
starlets[1].className='fa fa-star';
s... | 1 |
94d9bb8945b626dbbc4dd73d72dd96b4 | 14a4e2f85127a50de6cdf501a0788bcd | 地震回数に関する情報を構造化する | Element element = new Element();
element.setId(MetSequenceUtils.trimElementId(rain.getName(), "rain"));
element.setName(new Name());
element.getName().setLang("ja");
element.getName().setContent("雨量");
Subelement rainTotal = new Subelement();
rainTotal.setId("Tota... | 0 |
3985bb89ccb86f9db270552929504ba8 | da221d3ff7723d86927ff02de3a9bad1 | 网络图片文字识别 根据图像路径
用户向服务请求识别一些网络上背景复杂,特殊字体的文字。 | {
if (string.IsNullOrWhiteSpace(url))
throw new AipException("url cannot be null or empty.");
var paraList = new List<KeyValuePair<string, object>>
{
new KeyValuePair<string, object>("url", url)
};
if (options != null)
... | 1 |
0d49b4a02952e87b7de95ec874d8a701 | e36721a3cb1a89fa4fbbaf7d1968ad08 | # Função para fazer a máscara de pixels | img_normalizada <- img
qtddLinhas <- dim(dataset)[1]
qtddColunas<- dim(dataset)[2]
minValor <- min(img)
maxValor <- max(img)
for(linha in 1:qtddLinhas){
for(coluna in 1:qtddColunas){
img_normalizada[linha,coluna] <- ((img[linha,coluna] - minValor) / (maxValor - minValor))
}
}
return(img_no... | 0 |
e6f3b25396b4d4be859ccef19ee8d8dc | d157a5f3aa3755cf5f0e8f7d03b25100 | return the coordinate of a cell which has lots of number can be placed | def pick_next_cell(sudoku_state):
min_value_positions = get_min_value_positions(sudoku_state)
if len(min_value_positions) == 1:
return min_value_positions[0][0], min_value_positions[0][1]
max_row, max_col, max_degree = -1, -1, 0
for position in min_value_positions:
curr_degree ... | 1 |
f6ff39ec20f9a162f23db5bf211cce45 | bba4ffdec4d6a7926ceb51ec386184b0 | 执行SolidWorks作图程序 | static void Main()
{
#if false
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
System.Windows.Forms.Application.Run(new Form1());
return;
#endif
string filename = System.IO.Path.GetDirector... | 0 |
8ee24c51f8517fa52f649de9cc4a50ac | e07d9755af3e550ba3a813bda6ac2100 | Removes the commits given after the one from the argument. | class HistoryGraph:
def _remove_change_sets(self, change_sets):
self._remove_nodes([cs.commit_hash for cs in change_sets]) | 0 |
b14fb133593eea00db6193e767472ce2 | ba705fa589b0f78db47b02366dd8f9be | ============================================================
<T>获得客户命令类型的数据内容。</T>
============================================================ | public abstract class XBaseMessageItem
extends FXmlObject
implements
XObjectFace,
XValidationFace,
XObjectSource
public String getIsClient(){
return _isClient;
} | 0 |
7ed09caab182e57b548ae02d8a8e2a46 | f05dce0901a560cfbab0a0ac7f43b480 | 自定义Map结构 | func main(){
var m map[int]string = make(map[int]string)
fmt.Println(m)
var m1 map[int]string = map[int]string{
90: "优秀",
80: "良好",
70: "及格",
}
fmt.Println(m1)
var m2 = map[int]string{
90: "优秀",
80: "良好",
70: "及格",
}
fmt.Println(m2)
var m3 = make(map[int]string, 16)
fmt.Println(m3)
var m4 = m... | 0 |
ca15885bc8570373fc5c3acc515bc794 | 8819bafc419dbe1a1f8d2308490c4249 | Skips any running effects (like typewriter) to their finished state | fn pause_for_effect() {
let mut line = String::new();
std::io::stdin().read_line(&mut line).unwrap();
} | 0 |
14e78b2f000f857949798e8381db52f4 | 882e754e36a1efbc83630fa8d717d8cc | Generates a randomDate in a specific range | class EventFactory extends Factory
public function generateDateRange()
{
$date = $this->faker->date();
return [
'fromDate' => $date,
'toDate' => Carbon::parse($date)->addDays(rand(1, 30))->toDateString()
];
} | 0 |
355ded783d6c380ae4d506be685ad675 | fa7ff239cdecd063ef3d173209c4d3d8 | Определяет является ли функция библеотечной, пользовательской, либо вообще не является функцией | type_of_function determineTypeOfFunction(const char function_name[MAX_LENGTH_OF_FUNCTION_NAME], const int number_of_lines, const char source_code[MAX_NUMBER_OF_LINES][MAX_LENGTH_OF_STRING]) {
bool keyword_flag = false;
keyword_flag = checkForKeyword(function_name);
if (keyword_flag)
{
return no_function;
}
in... | 1 |
e5bcc93a04eb425b4dede0af5aa897f1 | 922d523235c9e9b52487b0c661e4b0c9 | Get a grid source by identifier. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | class EditDocumentApi(object):
def edit_document_xlsx_get_cell_by_identifier(self, input, **kwargs):
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.edit_document_xlsx_get_cell_by_identifier_with_http_info(input, **kwargs)
else:
(data) ... | 1 |
3152f3a4a075aba7e9d90b7c187e2aaa | 935a381cb23e22da6441747d126d5b46 | opens the image of the .avi file, does imageprocessing to find the circle,
determines the midpoint of the circle and its movement along the main axis of movement
input is an .avi file
no output but generates an .avi file - a copy of the input file with an overlay of the detected circle and the midpoint
and a .csv file ... | length, width, _ = img.shape
img = cv2.medianBlur(img, 11)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT,
5,
math.floor(width / 2),
param1=80,
param2=250,
minRadius=math.floor(width / 10),
maxRadius=math.c... | 0 |
9cd34cc0637e75167f5e5fc0b8f7ea63 | 082fd75e6bb5ef3b1b5a459d9b84b74a | Determines whether the file system has been initialised. | global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
ob_start();
if ( file_exists( ABSPATH . '/wp-admin/includes/screen.php' ) ) {
include_once ABSPATH . '/wp-admin/includes/screen.php';
}
if ( file_exists( ABSPATH . '/wp-admin/includes/template.php' ) ) {
include_once ABSPATH . '/wp-admin/in... | 1 |
86e7e85c8f70f8231799921606b52d66 | 0e9fc188db8ae588a1c654808ccaeafa | Initialize a SoftLayer virtual machine. | cloud_client = cloud_client_instance(record.user_id)
vm_id = cloud_client.instantiate_vms('scalarm', record.image_secrets.image_identifier, 1,
record.params.merge('instance_type' => record.instance_type)).first
record.vm_identifier = vm_id
record.save
record
... | 1 |
0dfcbe2199ff69de2e5a27f59dc31d49 | 4e13df25fb26f9a4833865b7b58b258d | End date for the calendar; return null to automatically set from the model. | class Calendar extends ParameterHolder
public function getEndDate () {
return $this->end;
} | 0 |
38f127980f311febbb2a204c1ea995ff | f0b1c429040c8e662cc9c04759c1b66e | Méthode pour récupérer les infos d'un top player | class Topo extends Model
public function getVieuxCampeurInformation() {
$data_vc = null;
$vc_base_url = config('app.vieux_campeur_base_url');
if ($this->vc_ref != null && $vc_base_url != null) {
try {
$client = new Client();
$reponse = $client->request... | 0 |
4c13879bd2348eea28c15b7f70667444 | ef21c876352fcf582201c8bce0202dc5 | 将InlineShape转换为Image | {
RenderTargetBitmap bitmapImage =
new RenderTargetBitmap((int)element.ActualWidth,
(int)element.ActualHeight,
96, 96,
PixelFormats.Pbgra32);
bitmapImage.Render(element);
retur... | 1 |
036e481c2afefc4943c73e7594cb705a | bd6285b8c3df06c62675ced010a02b1a | 数据准备,还支持并行 | namespace LaborAndSocialSecurity.Uploaders
public abstract class Uploader<T> where T : IUploadable
public virtual void BeginUpload()
{
var list = this.GetData(parm4GetData);
list.AsParallel()
.WithDegreeOfParallelism(32)
.ForAll(item =>
... | 1 |
a6d8ce5ec6ad7bfa09dd1ebf0eb46a7c | 6cbef543a8fc218f38b89acc988b788a | fonction qui demande nb cases qui vont etre remplies | int choix[4]={4,4,4,4};
switch (nbjoueur){
case 2:
for(int i=0; i<4; i++){
if(*(couleur+i)!=4 && choix[0]==4){
choix[0]=i;
}
else{
if(*(couleur+i)!=4){
choix[1]=i;
}
}
}
printTab4(plateau, p ,couleur, choix, nbjoueur, pion_jouer,tmp);
break;
case 3:
for(int i=0; i<4; i++){
... | 0 |
669e382c908d9f127e3439b0612b78fc | 1f0ee5e3c407ce980fcbdc729ea790a9 | Starts up the game as a client. | class ClientService:
def start(self) -> None:
self.__connect(self.address)
self.game_finished = False
self.my_label['text'] = 'You:'
self.opponent_label['text'] = 'Opponent:'
self.status_bar['text'] = 'Waiting for start'
receive_thread = Thread(target=self.__receive)
... | 1 |
8643a657ce53525fece1e8684d92ebd4 | 16397e75070ea28d2a1f95c0da5ca179 | Rückt Position um ein Element weiter, sofern dieses existiert.
weiter gerückt werden kann. | public class KellerListe implements Liste
public void advance() {
if(this.endpos()) {
throw new RuntimeException("Endposition erreicht");
}
vorne.push(hinten.top());
hinten.pop();
} | 1 |
ef1596e4e04d74c33b4677b00b372084 | 4b451659f9314f49424cf5c605f1d368 | 获取对应的redis model name | protected function getModelName() {
return Resource::class;
} | 0 |
f3b801d1f674b4e046d5b713a64e5a57 | 7a6de19d34c4b32fe265feaba138e21f | Function that returns the first object whose <idKey> === <idValue> | export default class JsonData
private getObject(idName: string, idValue: string): object {
let o: object = null;
let t: object;
for (t of this.json)
if (t[idName] === idValue) {
o = t;
break;
}
return o;
} | 1 |
d3e1e8a0c52a54f01c24cd424320ef4f | c40b8551b85dbfbd6ee8d7a9489799b5 | Valida si el producto tiene registrados atributos en la Tabla ProductosxAtributos o NO | Object[] valores = atributosSeleccionados.values().toArray();
int size = valores.length;
for (int i = 0; i < size; i++) {
Integer v = (Integer) valores[i];
if (v == 0) {
return false;
}
}
return true;
} | 0 |
5d0edd02046a93fbee7fc7e1857f7a9c | 0ace52166ac69889263a7267abdd09c6 | helper method to render a-to-z navigation for faceting | $results = $facet->getResults();
$build['map'] = [
'#type' => 'html_tag',
'#tag' => 'div',
'#attributes' => [
'class' => ['facets-map'],
'id' => $facet->id(),
],
];
$build['#attached']['library'][] = 'facets_map_widget/facets_map';
$build['#attached']['drupalS... | 0 |
2007e9c4df9f118375d0a1910ff084b1 | cfad48041cc3084624fd62e2ab6a9ac6 | when the object is enabled, we want to let the Custom Events component know that we want to access an event and use it. | public class BuildingObject : MonoBehaviour
void OnEnable() {
DrupalUnityIO.OnPlacardSelected += OnPlacardSelected;
DrupalUnityIO.OnGotTour += OnGotTour;
} | 1 |
5ce41f2438e006d7770c23356638c2e7 | 94b605ce49417554333857c1bb8dedcb | Gets the city by area code. | public class RegionUtils
public static City getCityByCode(String code) {
if (CollectionUtil.isEmpty(cities)) {
return null;
}
return cities.stream().filter(item -> item.getCode().equals(code)).findAny()
.orElse(null);
} | 1 |
35d1043eb20be793e68a96f7a4deb99a | 9318d56fd1a1117a995f0fe93412f2a3 | Method to get compiled source code for the test. | String getGeneratedSourceCode(); | 0 |
e8fb7ffd02a54c224595445cb2c80477 | 0adf3710f1d01c5bb2c71c57a392f035 | 按照序号排序,序号为1的是大奖。 | const awardOrder = { Bronze: 0, Silver: 1, Gold: 2, Platinum: 3 };
listObjs.sort((a, b) =>
a.neededForAward - b.neededForAward ||
awardOrder[b.awardType] - awardOrder[a.awardType] ||
a.listTitle.localeCompare(b.listTitle));
} | 0 |
131ecf6ceab77293cee00d7f4a5c6180 | ba38be2ca98f1036e7a57bee58c7fd4c | make sure all columns have equal length | class TransactionList(wx.ListCtrl):
def FitColumns(self):
for idx, _ in enumerate(self.__properties):
self.SetColumnWidth(idx, wx.LIST_AUTOSIZE)
self.Layout() | 0 |
aa1b36665ef5466ac5b30c0b5d8e0229 | a0e74c56ff62e35a84d5608715894904 | Returns the meta object for the attribute '{@link org.abchip.mimo.biz.model.product.inventory.Lot#getCreationDate <em>Creation Date</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public class MjGwlRecipeMasterEOImpl extends EntityImpl
public Date getCreationDate() {
return (Date)getAttributeInternal(CREATIONDATE);
} | 0 |
f7722c47c0b802eaad687ab0a8888df7 | 2640f0373b4135cd544559809a51b779 | 탈출 장비 기능 구현, 실제로는 탈출 장비 관련 각종 로직이 구현됨, 여기서는 Strategy pattern 연동 결과에 문제가 없는지(=결과값이 같은지) 확인 | public class Exam07 class Dropship extends Unit
void unload() { } | 0 |
c99d316deca5ebe93061ff6bbd123b7e | f0163419cf816f47efaac812757d151b | Dividing the binary numbers into groups depending upon the number of 1s in them | def bin_division(divident,divisor):
k=len(divisor)
curr=divident[:k]
while k < len(divident):
if curr[0] == '1':
curr=perform_xor(divisor,curr)+divident[k]
else:
curr=perform_xor('0'*len(divisor),curr)+divident[k]
k+=1
if curr[0] == '1':
curr =... | 0 |
656679eec4140ee9a540e1db7de26bfd | 6e9df670a016e1eaaefda61384f4558a | GET: Rubrics | namespace DbProject
public partial class Form1 : Form
private void button4_Click(object sender, EventArgs e)
{
Rubrics r = new Rubrics();
this.Hide();
r.Show();
} | 0 |
ae81b79f31c8db556595d74b664180ba | 5bfe390e09a256e3b65ccb2d4dafbfd0 | function for sending thank you message - gets/ adds single donation and prints thank you | def thank_you(donors):
sub_menu_selection(sub_prompt, sub_dispatch) | 0 |
84e4836532e0504b5b9a174741493d70 | b98ba682dd134f446a5844607378830b | Retrieves an internationalized string and insert text into | {
$string = $key;
if(!empty($this->strings[$key]) && $this->current_lang != $this->original_lang) $string = $this->strings[$key];
$this->new_strings[$key] = $string;
return $string;
} | 1 |
21ffcf1cff5a75c0b1d6f6551210743a | 2fbde2e0dd77efc398e44a059d98b2d1 | Checks if given data block describes FAT structure | {
if (superBlock[0].crc != computeCRC(-1, CRC_SB)) return -1;
return 0;
} | 0 |
53ee5eb9503db350617f6745e585e307 | 9225bdb6a80a3c23f2b0d19061559b4a | This method simply loads screen to be quizzed on animals | public class SelectScreen extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_screen);
loaddata();
} | 0 |
96ba5374f6d2def4d6de4cfac178c284 | b4e8de589c92a80cb44a5ce5dc723055 | Check that templates contain the right variables. | class FewShotPromptWithTemplates(StringPromptTemplate):
def template_is_valid(cls, values: Dict) -> Dict:
if values["validate_template"]:
input_variables = values["input_variables"]
expected_input_variables = set(values["suffix"].input_variables)
expected_input_variables |= s... | 1 |
da21a215525b651f55f6e992088d3cd7 | e7c14bcc42b99747bd08368dbdb57270 | 设置文字绘制工具目录
<p>
1. 引擎使用该目录的 TextPainter 和 font_list.json 进行文字绘制
</p> | public class PdfBoxGraphics2D extends Graphics2D
@SuppressWarnings("WeakerAccess")
public void setFontTextDrawer(IPdfBoxGraphics2DFontTextDrawer fontTextDrawer) {
this.fontTextDrawer = fontTextDrawer;
} | 0 |
19a9a67e57642e1c7228ea67e00b98aa | 182b6b9c341a46f3bc88277a6a397920 | Run when keybindings are changed | void keyBindingChanged(KeyBindingChangeEvent evt); | 1 |
a81bf2a754c77ee257bdc08f4c7a7150 | 9bc49de8e43fd46467f66c43b0ef15ce | Map BEL motor drive PDOs in CSP mode. | void InvertedPendulumControl::drvMotor(byte ch, int8_t sp) {
Wire.beginTransmission(0x38);
Wire.write(ch);
Wire.write(sp);
Wire.endTransmission();
} | 0 |
9df27df827a3d72b4a4b12e60fff45b2 | 3940be6311c7e58dd4382323330aed0b | Saves configuration overwriting all previous settings | namespace ExternalUtilsCSharp.JSONConfigUtils
public class JsonConfigHelper<T> : ConfigUtils where T : new()
public override byte[] SaveSettings()
{
JSONConfigManager.WriteFile(Settings, lastConfigName);
return null;
} | 1 |
6047b11fc78030a16c216b7a47a29e39 | 4738f16112c5abda5d64b8a0d6635ec0 | 15要素タプルの7番目の要素に対して、関数を適用します。 | namespace LangExt
public static class TupleModule
public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, U, T10, T11, T12, T13, T14, Tuple<T15>>> Map9<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, U>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>> se... | 0 |
63a0c7801a9f17ab0ed4f9e968cf1240 | 396ad7766d9d1a48686a732a17780d97 | Attempts to retrieve the static resource mapped to from the given weather code. Some
resources will differ depending on whether it is night or day. | var resID: Int
if (weatherCode / 100 == 2) {
resID = com.mycityweather.R.raw.storm_weather
return resID
} else if (weatherCode / 100 == 3) {
resID = com.mycityweather.R.raw.rainy_weather
return resID
} else i... | 0 |
791e3e354e12389975badd3e56f48017 | 89bc727f2737850105004fba44203813 | Delete a topic permission | $topic->delete();
return [
'error' => 0,
'message' => ''
];
} | 0 |
6f456a721f2a6b24f6b50b2974723351 | c57618061bb7d736700f2be4825d3ea4 | Find a recommended date slot for the event | function getNextFreeBookingSlot(
list: CalendarEvent[],
date: number = dayjs().valueOf(),
min_size: number = 30
): IBookingSlot {
const slots = getFreeBookingSlots(list, min_size);
const time = dayjs(date).startOf('m').second(1);
for (const block of slots) {
const start = dayjs(block.sta... | 1 |
fd4172167862be1a2df216940d3897fb | b739564f7ebd69d87c4079df86d5704b | Unsubscribes Keyboard interrupt | int mouse_unsubscribe_int() {
if (sys_irqdisable(&mouse_hook_id) != OK) {
printf("\nERROR: sys_irqdisable of kbd_unsubscribe_int failed!\n");
return 1;
}
if (sys_irqrmpolicy(&mouse_hook_id) != OK) {
printf("\nERROR: sys_irqrmpolicy of kbd_unsubscribe_int failed!\n");
return 1;
}
return 0;
} | 0 |
6e65bf3e0a10387880f7917e332968cb | 09b27b9f0a31f313d4f4cdc985f62969 | Loads a notification event from XML. | if (node == null) {
throw new ArgumentNullException("node");
}
X301Event evt = new X301Event();
String itemText = String.Empty;
Int32 value = 0;
DateTime time = DateTime.MinValue;
Double duration = 0.0;
X301A... | 1 |
f25a993667b7a88761be439086b08b94 | 97efb343ddf7d34002361baddcaaf7c1 | Check whether the path provided appears to be a test case | if not isinstance(path,(str,list)):
return False
if isinstance(path, list):
for p in path:
if not is_testcase_path(p):
return False
if isinstance(path, str):
if not os.path.exists(path):
return False
return True | 1 |
13369a0b3a406f1fea53e334fb14dd8e | 274aae8a07ab9797bbc4fbcbfd23ef9b | Tests new consumer creates with autocomplete key and secret | func TestCreateConsumerWithSaslAuth(t *testing.T) {
performCreateConsumerTest(t, "TestBrokers", "TestGroupId", "TestOffset", "TestUsername", "TestPassword")
} | 0 |
165e7a5245888ce8d00d3752839fec5f | 068c40415015fb641b147bfb05e99e1d | @brief Compares the first n bytes of str1 and str 2.
Time Complexity: O(n). | {
const uint8* s1 = (const uint8*)str1;
const uint8* s2 = (const uint8*)str2;
while (len-- > 0)
{
if (*s1++ != *s2++)
{
return s1[-1] < s2[-1] ? -1 : 1;
}
}
return 0;
} | 1 |
df67cea8c140aa5ad4d6718eff4a4188 | 1aa96941d922642e1c04a30dd07e00a0 | 根据shopId查找店铺导航栏 | ConditionQuery query = new ConditionQuery()
.eq("shop_id", shopId)
.eq("is_delete", "0");
SingleValueCondition singleValueCondition = new SingleValueCondition("item_type", "!=", 3);
query.add(singleValueCondition);
query.setOrder("t.catalog_id, t.seq", "as... | 1 |
9fae8b2b8f0f4f991c13ffb1720c1c06 | 4085c46fb5dc3b35e6801d1701f29a87 | Sets the raw token | {
$this->unfilteredTokenValue = $value;
$this->tokenValue = $value;
$this->setIsResolved(isset($value));
$this->setIsFiltered(False);
$this->setUnresolvedFilters($this->filters);
return $this;
} | 1 |
6217ac14dc8e5d17bb619c2097e84922 | 87aaf56b65a2ae276640cd89f1a11e92 | Add a character at the given position in string. | if (at > row->size) {
int padlen = at-row->size;
row->chars = realloc(row->chars,row->size+padlen+2);
memset(row->chars+row->size,' ',padlen);
row->chars[row->size+padlen+1] = '\0';
row->size += padlen+1;
} else {
row->chars = realloc(row->chars,row->size+2);
... | 1 |
fc2b19674960400b45faa80c0e93dfe1 | 50dcdcd3a5b2d6a54ed7f8e92a00eb62 | only turn if currently moving | public class Player : MonoBehaviour
public virtual void TurnUpdate()
{
if (actionPoints <= 0)
{
moving = false;
attacking = false;
}
} | 0 |
95b04601d9e45065fa7430d79cbccb67 | 0120e0d50ce47b658d8e8394743a0256 | Set (active) VBL using NI-DCPower driver (inactive disabled) | static void mipi_dsih_hal_dpi_lp_during_vbp(struct comipfb_info *fbi, int enable)
{
mipi_dsih_write_part(fbi, MIPI_VID_MODE_CFG, enable, MIPI_LP_VBP_EN, 1);
} | 0 |
722d69da6c86142a97d62a31d17cf43d | 7b4ab69536c4aa95cc3a2df0327584c6 | Function to onboard the user on to the application. | class ShoppingListFlowHandler(ConfigFlow, domain=DOMAIN):
async def async_step_onboarding(
self, _: dict[str, Any] | None = None
) -> FlowResult:
return await self.async_step_user(user_input={}) | 1 |
db1151b152f122c5e2cab62a43d3b0e6 | ca1d26841b39eeda23052e641e04ec5a | Returns the value of the '<em><b>Agreement Item Seq Id</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Agreement Item Seq Id</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc -->
annotation="mimo-ent-slot key='true'"
annotation="mimo-ent... | EReference getAgreementItem_Agreement(); | 0 |
cd6b6bc95c6a9d81dc6fb58e4aa15b12 | daafc87bf71605cdc202103355dd15cd | Get the portlet driver registry of the consumer. | PortletRegistryAdminService getPortletRegistryAdminService(); | 0 |
2a0ffeef77c9cbab792b6d1ca7fc5b37 | 44314f4b77f1927fbe4d5c3a59be7154 | zeigt, ob es sich um den linken Aufzug handelt | if self.table[self.locked_key] and self.table[self.side_key] is 'left':
return True
return False | 1 |
f85e42078499b488c4326135ac316988 | 2fbaff67b740003aca83759d042dda3d | Returns how many points the player will receive if he/she successfully
completes the next goal. This is reset to 1 if the player fails to do so.
Returns -1 if the game is not currently being played. | class Words(Actor):
def get_points(self):
return self._points | 0 |
8dbf2c4da4a9502ad9dfb4b6d19cf0ef | d798eae782793570a7daf01b7fef74f2 | llena el diccionario que relaciona el número del mes con su equivalente a texto en español | dictio.put("BUS", "Servicio público");
dictio.put("HOUSE", "Casa");
dictio.put("HORSE", "Caballo");
return dictio;
} | 0 |
d7a5db824bd74113814655ea4a973278 | 722fdc7bd186946b9d06fcd6f236e465 | 判断表达式是否为表达式树中参数的成员 | namespace Meta.Driver.SqlBuilder.AnalysisExpression
internal class SqlExpressionVisitor : ExpressionVisitor
private bool IsDbMember(MemberExpression node, out MemberExpression dbMember)
{
dbMember = MemberVisitor(node);
return dbMember.Expression != null && dbMember.Expression.NodeType == ExpressionType.Parame... | 1 |
1b9b2c9b5a77838b36aff0c96d3729d4 | 65744253a2ebd0dc943ff21f54eb937c | Method that checks whether an ASN.1 signature has CAdES-XL1 format. | if (listSignersSignature != null && listSignersSignature.size() > 0) {
for (SignerInformation signerInformation: listSignersSignature) {
if (isCAdESEPES(signerInformation)) {
return true;
}
SignerInformationStore counterSignatures = signerInformation.getCounterSignatures();
if (counterSignatures != ... | 0 |
4732884c3eef1a05d5be6882d4e944a4 | 5f2a09bb82dc2e0f668cef5491d84918 | Java wrapper for Windows registry API RegCloseKey() | {
int r;
if (hp)
{
if (hp == HKEY_REG || hp && hp == P_CP->regdir)
return 0;
for (r = 0; r < elementsof(hkeys); r++)
if (hp == hkeys[r].handle)
return 0;
}
if (r = RegCloseKey(hp))
{
errno = unix_err(r);
return -1;
}
return 0;
} | 0 |
681cabdf02f7fa2386e4c26c92e22613 | c4cd8f5e582d9c5392a112413987ded5 | Calculate and consolidate reciprocal values, returning resultant dataframe. | def get_rpr(original_data_dict):
filename_source = original_data_dict['rcv'][2]
df_rcv_slice = get_raw_data(filename_source)
filename_source = original_data_dict['acct_payable'][2]
df_acct_payable_slice = get_raw_data(filename_source)
df_syn_factor_slice = df_rcv_slice / df_acct_payable_slice * 100
... | 1 |
575c0bffeeaf198ec63d16920f20d337 | 51a1c3186a33998c59bb153386cec466 | 判断产生式右部是否全属于nullable | {
if (isNullable == null)
switch (m_symtype)
{
case CSymbol.SymType.simpleaction: isNullable = true; break;
case CSymbol.SymType.oldaction: isNullable = true; break;
case CSymbol.SymType.terminal: isNullable = false; break;
case CSymbol.SymType.eofsymbol: isNullable = false; break;
... | 1 |
4f4cf7e9292029bf91d6a01696fc0bfc | e23edd18dfa9ab45eb98ab7d0aa673c9 | 获取所有视图字段集合 | public abstract class AbstractSTViewer
abstract public ISTDataViewersField[] getAllFields(); | 1 |
a1b514cce9e2bd0379b95f337b097ab3 | dd04a305c4464876707c7836787dc00c | Returns the audio player. | class ChannelSom:
def getPlayerAudio(self):
return self.playerAudio | 1 |
ba6588f2ca1bfad8f58fc6159a3bcae3 | 24d06414e8b5a0cd017d3e2ce2b8a31f | 查询所有线路并分页显示 | namespace Guoli.Admin.Controllers
public class LineController : Controller
[HttpPost]
public JsonResult GetLines()
{
var json = JqueryDataTableAjaxHelper.GetPageListJson(
Request,
(pageIndex, pageSize) =>
{
var stationBl... | 1 |
edb55ab2b776c0afc51122e66513705b | 80714407ea32ad731f3f7a84289322b6 | Returns whether the vertices v and w are adjacent.
Input: Vertex, Vertex; Output: boolean | for e in self._edges:
if v in e._endpoints and w in e._endpoints:
return True
return False | 1 |
b6b41ef28e816499e5df4e7bb458c6ab | 3e5558deaec930d67d7bd5446a636485 | Builds and returns list of ProductListData from Products | $basicProductsData = [];
foreach($rawProducts as $rawProduct){
$basicProductsData[] = [
'id' => $rawProduct['id'],
'title' => $rawProduct['title'],
'handle' => $rawProduct['handle'],
'vendor' => $rawProduct['vendor'],
'product_type' => $rawProduct['product_type'],
'tags' => $rawProduct['t... | 1 |
038172eb4b9eb9acfcd23e3b886173df | b5ff743a9d8471df99cf1674df483673 | Restituisce l'azione di visualizzazione del manuale utente. | class ManualController extends AbstractController
public function indexAction(Manual $manual) {
$view = new BaseView();
$this->setView($view, $manual);
} | 1 |
e88e088eeff36828db92e0512116a632 | d6d79565d9e051eb50b63f0a437e4fe5 | 영화장르를 파일에서 불러옴 | genre_list = []
f = open("u.genre", "r")
line = f.readline().rstrip()
while line:
genre = line.split("|")[0]
genre_list.append(genre)
line = f.readline().rstrip()
return genre_list | 1 |
1980206a6d911738f11841613a7b968f | 50ed7ed2ff03871a99a3476f56911928 | Returns true if current Flight Gate is settled or not | public function isReadyForSettle(): bool; | 0 |
bfaef7ba6c0abe103684a8b4145086a0 | fc5623ddae1a70fd2ba50663260b0611 | POST: Pokemon/Create | class PokemonsController
def create
trainer = Trainer.find_by_id(params[:id])
pokemon = Pokemon.new_from_faker
if trainer
trainer.pokemons.create(pokemon)
else
pokemon.save
end
render json: pokemon
end | 1 |
2ef5cd535188cef7ecdb15e1a6208dd7 | 709d487586f00ee15f6abf500c7ea640 | 将多维矩阵转换为一维列表 | flat = []
for i in x:
for ii in i:
flat.append(ii)
return flat | 1 |
4f3a6292060799c007ad0b57cba1c056 | 3c7c3d292f2bbe02b409ae6bcf861c5b | Default endoint for Custom Authorization Server | public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints
.pathMapping("/oauth/token", "/login")
.authenticationManager(authenticationManager)
.userDetailsService(userDetailsService)
.tokenServices(to... | 1 |
d7b496618738d06354b0d1332ff925b9 | d0be7776906a87eba1270262082984cf | Animates the board inverting | public class Game
private void flipBoard()
{
Chess placeholderPiece;
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 7; j++)
{
placeholderPiece = coordinate[i][j].getChessPiece();
coordinate[i][j].setChessPiece(coordinate[6-i][6-j].getChessPiece());
coordinate[6-i][6-j].setChessPiece(placehol... | 0 |
6cf87a900d92a5e26e509a967514eea8 | 28f24da4b31b33cadf96933ad9047f1f | Get the maximum sample delay supported | class DoppleringDelayNode(GenericNode):
def delay_max(self):
return self._property_instances[_libaudioverse.Lav_DELAY_DELAY_MAX] | 1 |
f8e8f51baf8e38d59de861bb04e02e55 | 8811d1bb0e0649f6fb933427ab47dca5 | Gets a list of type practice groups based on the specified context. | public function getContexts(string $specializationName); | 0 |
cdddabc6dc8e6084e2380dfa152e3f3a | 7ab9379a9ca50b1088399545598885a5 | Attempt to find SUBL by TID field | namespace EduHub.Data.Entities
[GeneratedCode("EduHub Data", "0.9")]
public sealed partial class SUBLDataSet : EduHubDataSet<SUBL>
public bool TryFindByTID(int TID, out SUBL Value)
{
return Index_TID.Value.TryGetValue(TID, out Value);
} | 1 |
7943371f3d6aaa7ac6d651090a1ca193 | 5ac476fb539a05d783f1b7ade300d767 | Добавляет новый товар в таблицу с закупленными товарами | namespace Alvasoft.ODTIntegration.Buffer
void AddFinishedProduct(FinishedProduct aPocket); | 0 |
10a239c7884a0b56d2663939815369f7 | 2ce5db5a4c2a37af0ad158928233b941 | -------------------------------------------------------------------------
Generates code whenever a value is selected in the query tab's
property value list.
------------------------------------------------------------------------- | {
var temp = GeneratedCodes.FirstOrDefault(gcvm => gcvm.Table == SelectedTable && gcvm.Template == SelectedTemplate);
SelectedCode = temp?.Code;
} | 0 |
2ce44d54cfc0bbbf0618cfa6e78d90df | 594a643d94cbb2b0836fd7e1af81b3db | Este metodo sirve para llenar una lista de datos obtenidos de la base de
datos | public class ConsultaProfesor implements IConsulta
public void getResultSetData (ResultSet result)
{
int dni, universidad, facultad, departamento; String nombre, apellidos;
this.tracer.debug("ConsultaProfesor", "getResultSetData()", "Iniciando la lectura de la consulta...");
try
{
... | 1 |
7a3c17fc126f7d36695a45647c664029 | a24c81d3b6165ac228546fcc2b3f11dc | Fonction qui retourne le nom de l'étape d'indice i | string schema::getName(int pIndex) {
list<string>::iterator it_nombre = nombre.begin();
string dataNombre = *it_nombre;
int pos = 0;
while(pos<pIndex) {
it_nombre++;
dataNombre = *it_nombre;
pos++;
}
return dataNombre;
} | 1 |
05ef9a1d58306ff39a81635622a6539c | 0a8960a1d3b52f4734a2c79efe0b074d | 关于组合价值的情景分析 | def visual_analyze(df):
_ = sns.pairplot(df[:50], vars=[8, 11, 12, 14, 19], height=1.5)
plt.show()
corr = df.corr()
mask = np.zeros_like(corr, dtype=np.bool)
mask[np.triu_indices_from(mask)] = True
fig, ax = plt.subplots(figsize=(11, 9))
cmap = sns.diverging_palette(220, 10, as_cmap=True)
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.