query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
c747bcff12c6c2c224e004fda324f7eb | 03d9938390839dcb7832a960717bb5ff | Shape of grids. | impl<A: Ord> Grid<A>
pub fn shape(&self) -> Vec<usize> {
self.projections.iter().map(Bins::len).collect()
} | 1 |
1f1c68c71ba09c389baeb5c6df19d902 | c24ceafbfdbe9de8cfdb424fa9cb84de | 测试删除区服 | class mokeDnsCasesObj(StartEnd):
def test_E9_delZone(self):
logging.info("------------------mokeForDNS用例编号:E9------------------")
state = self.dbo.delZoneCommon(self.view01Name, self.zoneSameName, url=self.urlPath, header=self.header)
self.assertEqual(state, 'true') | 1 |
778ab9483d972130ec20e88198be5b84 | be7eacbbd87958f5d2afa82e6da90ef7 | Returns if the user can fire on the spot that they click on. | private bool CanFireAtTarget()
{
return (targeter.getTarget().transform.position - transform.position).sqrMagnitude
<= fireRange * fireRange;
} | 1 |
79b5d2424f06f3165f8ddad9b6669de8 | 8225e6c63b6c5eaed023aad485a79d4c | Getter for event service | public class DungeonService
public EventService getEventService() {
return eventService;
} | 1 |
9432ca53aaa96f56070c9dd1976ef732 | 0010ddcb841d169dc584e5fed6026b1f | Loads a .yaml calibration file, as generated by RGBDemo | def load_calib_file(filename):
with open(CALIB_FOLDER + filename, 'r') as cal_file:
data = json.load(cal_file)
return data | 0 |
f58d4e1800dbc63f58bd478accdb65f4 | b23a728702ec8180878a5f2a6f739834 | Called when the "Add..." button is pressed to let the user choose a
plugin to be added to the testing chain. | class MainApp(object):
def _editSelectedPlugin( self, widget ):
self.pcbody.editSelectedPlugin() | 0 |
b885c7e7291d0e8c7b81b163f1fc8c2c | 629c005656441a21d3611245b7de1a5c | Called when user click to item on the sub-category list. | public class Presenter
public void onTypeClick(Context context, RecyclerItem recyclerItem) {
Intent intent = new Intent(recyclerItem.getAction());
context.startActivity(intent);
} | 1 |
59c7773acee342b01a03c89e45b4e126 | 9756f5f251dce0d8b5e9da95d32101b6 | Function to call to poll the server to generate a unique list of senders and send it back. | GetSenderListFromServerThread t = new GetSenderListFromServerThread();
t.start();
try {
t.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
return senders;
} | 1 |
28b8e4879b6b57e06891c66bdef748ab | 6d9e2ddcefb0f7f8fcb90b0d15c3b07f | Añadir extensión a un nombre base para generar un nombre de archivo completo para
una solicitud de firmado | String retorno = null;
retorno = (String) objects_mapa.get(k_mapa_ruta_base);
retorno = aumentar_ruta(retorno, nombre_accion_sin_extension, error);
if (retorno != null) {
retorno = retorno + k_datos_extension;
}
return retorno;
} | 1 |
904d14250d3e2893340d3846f12a0df2 | 2c413b4ebad3727024e2e7b4e5786cc9 | 判断节点列表中是否存在一个节点,用户对其有权限 | namespace sDev.CoreFunction.Auth
public class SystemManager
public static bool CheckNodeUser(string nodeId, DataRow taskItem)
{
bool b = false;
if (nodeId == null)
{
b = true;
}
else
{
if (taskItem != nul... | 0 |
d4c1a0df90a224578b58706890e3589b | 91703490aaca3313d164c5194bce6e10 | @brief Resultat::afficherRes Affiche les résultats d'un morceau.
Affiche une partition avec le resultat. | TypeHaplo** tabHaploNR, FILE* resultats_haplo, int i, int k)
{
int j, c = 0;
int* idsPaireHaplo = NULL;
fprintf(resultats_haplo, "/ind %d haplo1 ", k);
idsPaireHaplo = recherche_meilleure_paire_haplo(tabGenoNR[i], tabFreqHaplo, nbHaploNonRedondant);
for (c=0; c < nbHa... | 0 |
b85563f8eb44cff572cebf1db028a5bc | a019d35aab1e30542e5624f57f795768 | <p>
根据查询条件导出客户开发表中的数据<br/>
</p> | @ResponseBody
public void exportData(HttpServletRequest request, HttpServletResponse response) {
DzdResponse dzdResponse = new DzdResponse();
String cname = request.getParameter("cname");
String telephone = request.getParameter("telephone");
String bname = request.getParameter("b... | 1 |
d8ecde0c9ac285117ef0864741a5ba17 | e2a42a9a887063d9831346a6f58ad278 | Delete generated question field from form. | class QuestionController extends FrontendController
public function destroy($id)
{
} | 0 |
e5671dc35564d1bb67e79e61efad5002 | c23c6f5d8d18fa2e10797c77047be795 | Return a new string based on s in which all letters have been converted
to uppercase and whitespace and punctuation characters have been stripped
from both ends. Inner punctuation and whitespace is left untouched. | StringBuffer buf = new StringBuffer();
boolean lastCharIsWhiteSpace = false;
for (int i=0; i<s.length(); i++) {
char c = s.charAt(i);
if (Character.isLetterOrDigit(c)) {
if (lastCharIsWhiteSpace) c = Character.toUpperCase(c);
else c = Character.toLowerCase(c);
bu... | 0 |
f035f5c9c41b1f31bb0962874aef25a0 | 425f8d69e738efc46913cb149f2c0514 | Creates the SQLite database file on the disk and creates the desired tables within the database | {
await ApplicationData.Current.LocalFolder.CreateFileAsync(DatabaseFilename, CreationCollisionOption.OpenIfExists);
using (SqliteConnection database = new SqliteConnection($"Filename={DatabasePath}"))
{
database.Open();
string createTable = Cr... | 1 |
24bf40faf895e28c54ba6f3113633db1 | 81b91045bf46c4370e50b7d0f12e6299 | @brief Set BCLK sampling edge for RX module | inline SSC_RES_CODE ssc_set_FSYNC_TX_edge(e_ssc_edge_t e_edge)
{
volatile avr32_ssc_t *p_ssc;
p_ssc = SSC_DEVICE;
switch(e_edge)
{
case SSC_EDGE_FALLING:
p_ssc->TFMR.fsos = AVR32_SSC_TFMR_FSOS_NEG_PULSE;
break;
case SSC_EDGE_RISING:
p_ssc->TFMR.fsos = AVR32_SSC_TFMR_FSOS_POS_PULSE;
break;
... | 0 |
a7d00905ac70d3cbb0ce3764568517ae | c7e63695954472a2c2214712fff8e4f0 | If the locale is not already set, set it based on the MCC of the SIM. | public final class MccTable
public static void updateMccMncConfiguration(PhoneBase phone, String mccmnc) {
if (!TextUtils.isEmpty(mccmnc)) {
int mcc, mnc;
try {
mcc = Integer.parseInt(mccmnc.substring(0,3));
mnc = Integer.parseInt(mccmnc.substring(3));
... | 1 |
b074aa53117fafbc096ef50171a280d3 | 608fc1e493ab2e510fbbbbdcd7400bb9 | Complex fft wrapper (COMPLEX16Time ->COMPLEX16Freq. No error checking or padding! | ComplexVector FFT(NumericVector& x){
Environment base("package:stats");
Function fft = base["fft"];
ComplexVector res = fft(_["z"] = x);
return res;
} | 1 |
712232bde19098b54e532bd6f4a01d86 | 732305f05d294941959cafd46068f4c0 | Called by test client to verify connection is ready. If this call throws
an exception, most likely the service has not finished starting yet. Returns
false if the main form has not finished loading yet. | boolean isReady() throws ConfigurationException; | 1 |
4c54a57b4fb99950c64863d330c1897b | dbde382e0857bf8616c8e4b5ca320d7a | #医院及门诊列表接口 type 1为医院 2为门诊 3为药店 | class Inpatient extends Base
public function inpatientType()
{
$hid = $this->hospitalId;
$admId = $this->data['admId'];
$arpbl = $this->data['arpbl'];
$params = [
'arpbl' => $admId,
'admId' => $arpbl,
];
$data = Server::ability('hospital... | 0 |
b9dd1978056e4e00e12597d40473f726 | e4cc94594889c3d6472253fffead6100 | combines two lists without repeats takes two lists and returns a new combined list | result = []
for item in list_a:
if item not in result:
result.append(item)
for item in list_b:
if item not in result:
result.append(item)
return result | 1 |
e9f8ca702ff0bd77e37041496ef77468 | 70b360563f114c5811a7c77d36ed4128 | GET: Project
Returns the Create project site for logged in users. | {
if (Session["UserID"] != null)
{
int sessionUserId = int.Parse(Session["UserID"].ToString());
ViewBag.projectId = new SelectList(unitOfWork.ProjectRepository.Get(c => c.userId == sessionUserId), "projectId", "name");
return View();
... | 1 |
6b882a1d8cc12bc4f7d556d42d013be0 | fce28d66d1c1d0c7e987410038d4d503 | Getter for <code>Permission._ID</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.8.2"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PermissionRecord extends UpdatableRecordImpl<PermissionRecord> implements Record3<Integer, String, Integer>
@... | 0 |
fd8fc9b7a9d52164a8c9fe6e8a4b4103 | ac0c3030fa0c95820ccc637a97061429 | check duplication timeoff with othertimeoff | export class WritevaformComponent implements OnInit, AfterViewInit, OnDestroy
CheckRepeatTime(StartDateTime, EndDateTime, W_StartDateTime, W_EndDateTime) {
if (W_StartDateTime < EndDateTime && W_EndDateTime > StartDateTime) {
return true;
} else {
return false;
}
} | 1 |
6f010a62be5f9a96447e85d2b093012a | 247b14c356acf4dd7cfedc48023ed598 | 功能描述:设置扫地机线速度角速度
全局影响:无
输入:线速度值与角速度值
输出:无
2017-x-x 新建 | if l_direction==0:
self.ZuoLunShiJiSuDu=(l_speed*((const.WheelDiameter*const.pi)/const.EncoderResolution)*10)*-1
else:
self.ZuoLunShiJiSuDu=l_speed*((const.WheelDiameter*const.pi)/const.EncoderResolution)*10
if r_direction==0:
self.YuoLunShiJiSuDu=(r_speed*((c... | 0 |
109c10c87c4afde3493f71e90865c2e7 | cd9a83979559229753ee8fdd45cc402d | 显示一个用邻接矩阵存储的图 | void DispGraph(AdjMatrix g) {
int i, j;
cout << "图的顶点: ";
for (i = 0; i < g->n; i++)
cout << " " << g->data[i];
cout << "\n\n图的邻接矩阵:" << endl;
for (i = 0; i < g->n; i++) {
cout << " " << g->data[i];
for (j = 0; j < g->n; j++)
cout << " " << g->arcs[i][j];
... | 1 |
51403100527d5c210df7515321535fc1 | 572b8873b837dbe398f8ef4138f565b5 | Método que se encarga de eliminar los temporales de lista negra | void eliminarTemporalesDeListaNegra(); | 1 |
f7e8db5bc25e8f750ab662f6010033eb | 75b3e7129a70d3263a5e03239527085e | Test case for com_adobe_granite_bundles_hc_impl_sling_get_servlet_health_check | class ConfigmgrApiTest extends \PHPUnit_Framework_TestCase
public function testComAdobeGraniteBundlesHcImplWebDavBundleHealthCheck()
{
} | 0 |
1e2909bd1fefebe21f5d517b4091ff33 | 3da2fcf9c5f5710da8e4c1c8a41c26d3 | 根据题目获取对应的解题、解析、答案 | List<TeaSolution> result = new ArrayList<>();
switch (quesType) {
case SINGLE_CHOICE:
case MULTI_CHOICE:
case CHOICE:
result.addAll(teaChoiceSolutionMapper.getTeaChoiceSolutionById(quesId));
break;
case ESSAY:
ca... | 1 |
a6ad3abf37b5be7dfb81d76148bbbdc2 | 64c4cdddda3015b94b67ebdc4e179495 | All enumeration types return [] if not provided with any variants. | fn collect_enum_variants<'a>(s: &'a synstructure::Structure<'_>) -> EnumVariants<'a> {
let mut nullary_variants = vec![];
let mut block_variants = vec![];
for variant in s.variants().iter() {
if variant.bindings().is_empty() {
nullary_variants.push((variant, nullary_variants.len() as isi... | 0 |
24a5c4558296d252414b102ba31f1fd8 | d7e079d667a91ecd92ffe2db0ce43a92 | There must always be a valid material blueprint resource listener instance | {
Material* material = MaterialManager::FindOrNull(event->mResourceIdName);
if (material != nullptr)
ResourceListEntryAdded(this, material);
} | 0 |
81cbf619ee2b1cdd1c3c7af85d210134 | 0b4630819223fa9abf7b1586f153b82b | Вернуться в корневой каталог. | public class Cd extends Command
private boolean goBackToRoot() {
this.operateSys.setCurrentWorkingDir(this.operateSys.getRoot());
return true;
} | 1 |
f711e0cb5b5701d9916b90698db0487b | 96d7477368bb5fa73e07936338ddf314 | Save the episode list in preferences | Editor e = prefs.edit();
Set<String> set = new HashSet<String>();
for (UUID i: list) {
set.add(i.toString());
}
e.putStringSet(name, set);
e.commit();
} | 1 |
77bd95bf044ee87862ce06ff2e2b4a20 | 6e9d4918fb1274bf7a69d984a9a48b2f | Launch incoming task observer | void registerObserver(TaskObserver o); | 0 |
c28453a841b9ea2085021d3dc0460f30 | 719285ff88661c1ec61d401710f25e43 | 获取InputStream中的内容 | public class FileUtils
private static String readInputStream(InputStream is) throws IOException {
int length = is.available();
byte[] buffer = new byte[length];
is.read(buffer);
return new String(buffer, "UTF-8");
} | 1 |
0941242b66c871a34d9f72368d5a28d2 | eb5d3126c11f840bdc01f695fafbe255 | Whether the Driver supports specifying a connection encoding | public function supportsQuoting()
{
$this->connect();
return $this->_connection->getAttribute(PDO::ATTR_DRIVER_NAME) !== 'odbc';
} | 0 |
06996b840f417876a889f2b6c6127b17 | 6855c11200c6289ffd50f668470631d8 | 更新专业信息 | namespace InterfaceLayer.Base
public class ProfessionInterface
public bool Update(BaseDepartment model)
{
return _dal.Update(model);
} | 1 |
cdbf04ed2c374e04fddf190b297d8b1d | e1f0e428092e2915fbbf1660d3ece80a | Updates the map based on whether take away or sit in is requested. | public class Statistician extends Thread
public static void checkTakeAway(String input) {
if (input.contains("takeAway='")) {
getTakeAway(input);
} else {
}
} | 0 |
a6c16043eb467248e35a8c82c7a67fc4 | d864065badd08fd9eeec1c52bb439e18 | Prints out tweets with username, text, and tweet information | s=""
for i,tweet in enumerate(tweets):
s += ((click.style('[%d] ' %(i+1), bold=True, fg="blue") +
click.style('@%s - ' %tweet.author.screen_name, bold=True, fg="cyan") +
click.style('%s' %tweet.text)).encode('utf_8')+'\n\n')
if pager:
click.echo_via_pager(s)
else:
click.ech... | 1 |
072dbdd47977f6baaa361a39b383168e | 535746dc04099e34f9919e7d4d6f4e8f | 设置华为刘海屏手机不使用刘海区 | fun Context.hasNotchAtHuawei(): Boolean {
var ret = false
try {
val classLoader = classLoader
val hwNotchSizeUtil = classLoader.loadClass("com.huawei.android.util.HwNotchSizeUtil")
val method = hwNotchSizeUtil.getMethod("hasNotchInScreen")
ret = method.invoke(hwNotchSizeUtil) as ... | 0 |
2cb62ce30588aa0691d89f306fca0b97 | bf7735fc0db1ae8902865b4a32c68891 | Summary:
图片/直播/故事集广场九宫格元素 | class Photo:
def get_photo_gridview(self):
return d(resourceId=self.__pkg_name + ':id/id_coverflow') | 1 |
6c7ec1527e5841e893feef8bb5dfc95e | 109fdc32f4f11893b39e1c7ad9a796c7 | 使用{@link com.yuki.xndroid.di.module.ConfigModule.Builder}给框架配置一些配置参数 | public void applyOptions(Context context, RepositoryConfigModule.Builder builder) {
if (!BuildConfig.LOG_DEBUG) {
builder.printHttpLogLevel(RequestInterceptor.Level.NONE);
}
builder.baseUrl(Api.APP_DOMAIN)
.globalHttpHandler(new GlobalHttpHandlerImpl())
... | 1 |
b86c72732f266a43aa973b69ecb3f598 | 2e0d2cbb455532a0a3a5a6ad07f2d411 | Number of background threads that will simultaneously write to TSDB. | impl<C, E: Error> Config<C, E>
pub fn helper_threads(&self) -> u32 {
self.helper_threads
} | 1 |
e12739798141fcd5e15d0c0f605ffeca | 2074702474d2e10d5c423f510d55e991 | Return the value of a defined variable, or throws
if the variable is not defined | public class Stack
public Data getVariable(String name) {
Data v = CurrentAR.get(name);
if (v == null) {
throw new RuntimeException ("Variable " + name + " not defined");
}
return v;
} | 1 |
29409eccfac5231a650af4bf4355153f | 7131f8c47c0c415320cf81800c40f378 | Selects one of the possible board locations to place tile | let validChoice = false;
let tryOne = 0;
while (!validChoice) {
tryOne = this.getRandomIntInclusive(0, 8);
if (this.currentBoard[tryOne] === ' ') {
validChoice = true;
}
return (tryOne);
}
} | 1 |
eb97d3b333cd5fb484b50aa3eb28a22e | 945eea29f60bdb309a044454520c0b73 | We want it as big as possible in the window, but still
maintaining the correct aspect ratio, and always
having an integer pixel size. | var ratio float64 = math.Min(float64(maxWidth) / float64(w), float64(maxHeight) / float64(h))
return int(float64(w) * ratio), int(float64(h) * ratio)
} | 1 |
ab773b7c27bf307e006e79518b81ebdd | ffc12ba627361f299af04b49708a3edc | Method that validates a signed PDF document. | public VerificationResult verify(final String aFileName, byte[] aPassword) {
final VerificationResult tmpResult = new VerificationResult();
try {
final PdfReader tmpReader = getPdfReader(aFileName, aPassword);
final AcroFields tmpAcroFields = tmpReader.getAcroFields();
final ArrayList<String> tmpNam... | 1 |
643407554412f0ebd13b5413b16463d4 | b9e30354c356d72e177d94fa1f454ca9 | 根据ip池id获取ip段列表 | IPSet = self.GetItemByUHostId(hostid, "IPSet")
Pool = {hostid: {}}
for ip in IPSet:
if "IPId" in ip:
Pool[hostid]["EIP"] = ip["IP"]
Pool[hostid]["EIPID"] = ip["IPId"]
else:
Pool[hostid]["IP"] = ip["IP"]
return Pool | 0 |
d8ad65cbaec0d47d084361e27191e689 | 4b006083f91062742fb9594f90848e62 | @brief Initializes the USCI CC110x interface
The NWK layer will define its callback structure and pass the pointer to
this function. An application can also declare its own structure and call
this function in order to use the same interface. | {
uint32_t err_code;
ble_nus_init_t nus_init;
memset(&nus_init, 0, sizeof(nus_init));
nus_init.data_handler = nus_data_handler;
err_code = ble_nus_init(&m_nus, &nus_init);
APP_ERROR_CHECK(err_code);
} | 0 |
1ff872b1a268373447874cfeaa6b48df | 781258e176e9edf7cd692beb2cd4c2d1 | 新增勋章 | class OperatorsController extends PipiAdminController
public function actionAddMedal(){
$userMedal = new UserMedalService();
$cinfo = array();
$mid = Yii::app()->request->getParam('mid');
if($mid){
$cinfo = $userMedal->getMedalList(array('mid'=>$mid));
if(!($cinfo = array_shift($cinfo))){
exit('没有获取到数... | 1 |
b28d5767f2349e4bf1ce67dcde759f6e | 12a5df46332c7bac15678e9df3fdb9ba | [ok]c2 | class LexerSuite(unittest.TestCase):
def test_all_lexer_5(self):
self.assertTrue(TestLexer.checkLexeme(""" /* this is a comment */ void foo() {if (a==0) {b = a+c}} """
,"""void,foo,(,),{,if,(,a,==,0,),{,b,=,a,+,c,},},<EOF>""",187)) | 0 |
f983d287c360aa7980ff3514e8a5bae8 | cfaadde1b04430921199fbda7e3436b4 | This method returns the Sql Server User | public class EnvironmentManager
public static String getMySqlUser() {
return properties.getProperty("MYSQLUSER");
} | 0 |
e796d5a65c2fa4df91ca226585eac208 | 791279a53165c9036404780eb02778e2 | Return the product of 2 vectors | t_float vec_prod(t_ls v1, t_ls v2)
{
return (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
} | 1 |
a555532d7741ac3678f07e8dd085fbbe | 686295ef60f47dd3c3bb091d837afe6d | This method is called when the "Product Barcode" field in the add item
batch view is changed by the user. | {
fnChangetoDefaultCursor();
if(strBarcodePalletType == 3)
{
document.all.divShpmt.style.visibility = "visible";
}
else
{
document.all.divShpmt.style.visibility = "hidden";
}
var numNoOfRecords = arrBarcodeItemDetails.length;
fnChildTable();
if( strErrorMsg+"" != "null" &&
strErrorMsg.length != 0 )
... | 1 |
74e1fbc3ca1c286487c8e953ae5dfc66 | 3f3c1fe737f509fc280d40d6c220b4b4 | MakeErrorComment adds a comment to the PR indicating failure. | if err != nil {
return ReportError{err.Error()}
}
return nil
} | 0 |
52041129d6c325b905aea75dfeb01359 | d5768e1c38e52f8d901f5fc2b9dc8504 | 删除检测项的判断结果 | class ReportController extends CommonController
public function delDetection(){
$id = I('post.id');
$obj = new ReportModel();
$result = $obj->delDetection($id);
$this->response($result,'json');
} | 1 |
72ef9d02c3819167b667ab6372c2d4b8 | 4b542401c25b884d4e72ddb796f66034 | Le pide al usuario que ingrese su lugar a estacionar | class Welcome extends CI_Controller
public function lugar()
{
$this->header();
$this->load->view('container/container_lugar');
$this->load->view('footer/footer_s');
} | 0 |
ef72144015a6113adaf1daae2b4e3a64 | e5e14f053475e113b29d0d1ebf72b6c4 | 将测试数据集合设置从头开始读取 | void CDataSet::reset(){
fetch.clear();
fetch.seekg(0,ios::beg);
} | 1 |
f58a8cf8673ecbd0d4e93f6a46f8b2a6 | ed086c7871cb817140f8b80dd693f7f2 | 先释放之前的AudioBufferSourceNode对象
然后再重新连接
因为不允许在一个Node上start两次 | function reuseBuffer(c) {
c.queued.buffer = c.playing.buffer;
c.queued.source = context.createBufferSource();
c.queued.source.buffer = c.playing.buffer;
c.queued.source.onended = () => { on_end(c); };
start_playing(c);
} | 0 |
d381ca587cfde3d0480745195b62b4d0 | 02f4857e46c4cbb2c48da04c35d12f6e | select auditor with less number of task pending to publish | positions = ["President", "GSU Officer", "Faculty Officer"]
for position in positions:
candidates_list = self.get_candidates(position)
for candidate in candidates_list:
if candidate["number_of_votes_1st"] == 0 and candidate["number_of_votes_2nd"] == 0 and candidat... | 0 |
6bdd4f6b5208c20d029dc71880968c6c | 91b66089607ad8fd0f61ac90778952c9 | Compound assignments, such as
i += 2; | public class Decompiler class InstructionSetVisitor extends org.objectweb.asm.MethodVisitor
@Override
public void visitIincInsn(int idx, int increment) {
LocalVariableDeclaration local = findLocalVariable(idx);
String var = local.local;
Immediate lhs = newLocalImmediate(var);
Immediate rhs = newIntValueI... | 1 |
6488a61d25d17ef3f8fb55a2bcecf3f2 | 09bd160a7a8340d8c4959e0c258c44ba | Modulate percent hue, saturation, and brightness of an image | img_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV).astype(np.float)
img_hsv[:, :, 0] = (img_hsv[:, :, 0] + hue_delta) % 180
img_hsv[:, :, 1] *= sat_mult
img_hsv[:, :, 2] *= val_mult
img_hsv[img_hsv > 255] = 255
return cv2.cvtColor(np.round(img_hsv).astype(np.uint8), cv2.COLOR... | 1 |
3c8ca8fa4b9d439c8156dd98dcd365fe | f34078c9b914a99edcdd36ec4aee366c | 实例化并返回一个头部View的Holder | return when (viewType) {
TYPE_SPACE -> MyHolder(View(parent.context))
else -> MyHolder(getItemView(parent), holderListener)
}
} | 0 |
70e9f5e0b1335197ec3cf813f833a756 | 82b814ea916b5d72b2b7629c21d5d87b | show saved location data from database | SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.query(VIEW_AGGREGATE_LOCATIONS,
new String[] {
KEY_LOCATION_ID + " AS " + BaseColumns._ID,
KEY_LOCATION_TITLE,
KEY_WIRELESS_SSID,
KEY_STREET_ADDRESS,
KEY_LATITUDE,
KEY_LONGITU... | 1 |
5527de7f88fbffe9d116467505c9f179 | 174f7394cfec41aa47e8fa8acd9d3984 | map position value in pixels to position value on data axis | double PF_GraphicView::toGraphDX(int d) const
{
double factor = double(xAxis->range().size()) / double(xAxis->axisRect()->width());
return d*factor;
} | 1 |
9608031a549a875245ac754db90b39ed | 1fb9008a18cafa1b42c00e8ad970ae73 | 根据mchId查询详情 | MchInfo selectByPayOrderKey(String payOrderId); | 0 |
bed6d62961a096fddfa9080772b57511 | 10263b45f4b6924bcd5467432af2cc9b | déplace la pièce sur la gauche | class PieceJ(Piece):
def deplacer_a_gauche(self, matrice):
m__ = matrice.get_matrice()
for i in range(4):
if i == 2:
continue
colonne = self.__piece[i].get_colonne_matrice() - 1
ligne = self.__piece[i].get_ligne_matrice()
if colonne < 0 or ... | 1 |
ca1578ab7a639e081ed8a49bf82027cf | c49dd69a76855a720316f04e8253664f | Generator that iterates through a list repeatedly | def list_gen(a_list):
for element in a_list:
yield element | 0 |
8d149ed7c3545d3cadb000d9740ebf0c | 98b973d71da18762f15ee77ab6de4c9c | Select a literal based on two-clause heuristic | for (int i = 1; i <= numVars; ++i){
if (model[sortedLits[i]] == UNDEF){
int retVal = sortedLits[i];
if(negLitClauses[retVal].size() > posLitClauses[retVal].size()){
retVal = -retVal;
}
return retVal;
}
}
retu... | 1 |
78733ae980af0e4e83b7b18bc5ef178a | 9116cf4bc580908deb6dc5d1179016ad | 그리드와 교차하는 벽체를 절단한다. | body, err := dcBody(k)
if err != nil {
return nil, err
}
if k.CrossBarWeb && k.CrossBarWidth != 0 {
web, err := dcCrossWeb(k)
if err != nil {
return nil, err
}
body = sdf.Union3D(body, web)
body.(*sdf.UnionSDF3).SetMin(sdf.PolyMin(k.WallThickness))
}
var grate sdf.SDF3
if k.CrossBarWidth == 0 {
... | 1 |
f24a45159ae4e9bf24033836f2f7bfc8 | ced48fec3e79088032d8c6e07908e724 | 进入房间,完成发牌,然后创建子线程来进行房间内各玩家的通信 | public class CreateDDZMenu : MonoBehaviour
void CreateRoom()
{
MessageInfo req = new MessageInfo();
CreateRoomReq creatRoom = new CreateRoomReq();
req.messageId = MESSAGE_ID.msg_CreateRoomReq;
creatRoom.games = this.games;
creatRoom.type = this.payType;
creatRoom.play... | 0 |
0f8c5d0e60be6eeabcd9d988e7bd4421 | 5a706872aa711ed6895cba71e7416e93 | Gets all the routes that connect the given airports. | {
$statement = $this->prepare(
'select Flight.ID, Airline.Name, Flight.DepartureTime, Flight.ArrivalTime, Flight.Price'
. ' from Flight inner join Airline on Flight.Airline=Airline.Code'
. ' where DepartureAirport=? and ArrivalAirport=? order by DepartureTime');
$statement->bindValue(1, $airport_departure... | 1 |
2feb3c8c0323f515fc31badca07a374c | a69a179bd15b8203d481a7af0b2e3d23 | Obtem todos os medicamentos armazenados | {
try{
$medicamento = Medicamento::all();
$response=[
'msg' => 'Lista de Medicamento',
'Medicamentos' => $medicamento,
];
return response()->json($response, 200);
} catch(\Trowable $th) {
return \response($th... | 1 |
cd7d63257ed4ce257d5fd17ceda3abde | 110c76fec638cf5df9707b6311b12b18 | Divide $costs by $loans and protect against division by zero | class Blah
protected function divideCosts($costs, $loans)
{
return ($loans > 0) ? ($costs / $loans) : 0;
} | 1 |
00d48cd69e97fbfb350fa36584ef2923 | 80d49c2b3f85eef7c1adbd88ce322571 | Постепенно появляется черная заставка и сообщаем сцене, что игра закончена | public class StageController : MonoBehaviour
private void SilenceStart()
{
if ( stage == Stage.SILENCE && state == State.INITIALIZE )
{
state = State.NOWPLAYING;
subScreenMessage.SendMessage("SetMessage"," ");
subScreenMessage.SendMessage( "SetMessage", "CAUTION!" );
subScreenMessage.SendMessage(
"... | 0 |
e2c3d540b14b6db037fca399c87cb0a2 | ac2a8fb7ddaadd21cbb6f6a9b83e5145 | Inform VBox that we will stop supplying it with dirty rectangle
information. This function is intended to be called when an X
virtual terminal is disabled, or the X server is terminated. | int x, int y, int width, int height)
{
struct drm_gem_object *obj;
struct vbox_bo *bo;
int ret = -EBUSY;
bool store_for_later = false;
int x2, y2;
unsigned long flags;
struct drm_clip_rect rect;
obj = fbdev->afb.obj;
bo = gem_to_vbox_bo(obj);
if (drm_can_sleep())
ret = vbox_bo_reserve(bo, true);
i... | 0 |
1073a5e79970399f3d573f1a7e19f069 | 02d5f2822a0eeefd80fc8a029be49dfd | A wrapper for running commands inside the virturalenv | run("source %(ve_dir)s/bin/activate; %(cmd)s" % {
've_dir': virtualenv_dir,
'cmd': command,
}) | 1 |
86eca5679ce56edc3bf3b8d3fd5f8d24 | 964696356f210ac67716d89c825e45b4 | 是否进入页面就加载数据 | public class HomeFragment extends Fragment implements HomeContract.View, OnBannerListener, View.OnClickListener
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
Log.d("TAG", "isVisibleToUser 1: " + isVisibleToUser);
if (isVisibleT... | 1 |
db6ad434ded8784dc8a2cead2f159e77 | 1f57ee1ddbdc772ce467742875d2777a | Filters documents that have fields that match any of the provided terms (not analyzed). | namespace Spacebuilder.Search
public class LuceneSearchBuilder
public LuceneSearchBuilder WithFields(Dictionary<string, BoostLevel> fieldNameAndBoosts, IEnumerable<string> values, bool exactMatch, BooleanClause.Occur occur, bool asFilter = false)
{
foreach (var fieldNameAndBoost in fieldNameAndB... | 1 |
ea564b5d3f9a0e2a01895fb1c6a3a67c | 49ca826aeb9f8c8c00882cfb65fb9407 | タイルに経路番号をセットする | this.pathTile = pathTile;
setTileProperties(pathTile, FlxObject.NONE);
pathCoor = this.getTileCoords(pathTile);
pathCoor.sort(new Comparator<FlxPoint>() {
public int compare(FlxPoint lhs, FlxPoint rhs) {
return (int) (lhs.x - rhs.x);
}
});
... | 0 |
720b69bb2ed1e397f2a4b9a92548ce32 | 0b7a369d067ed266222cf2eb730ef49d | Determine le noeud voisin ayant la plus basse valeur (la date de visite la plus vielle) | {
nd a=n;
while(n!=NULL)
{
if(a->valeur->val>n->valeur->val)
{
a=n;
}
n=n->suivant;
}
return a;
} | 0 |
78298bc992def32410d5ca1f96b4aa4b | bff623d066f67411779eb2aea904865f | IntZD不等于0,说明从父窗体传来了主键ID,
加载实体信息做修改操作。 | namespace D35100
[SmartPart]
public partial class F35100 : BaseSmartPart
private void EditRecord(object sender, EventArgs e)
{
if (!this.formLoad)
{
this.SetEditRecord();
}
} | 0 |
77df8f413109b61e10fbe8d995255c4e | 50cb4d10458404351d1a7776beab7ce6 | Select which discovered characteristic you want to read the latest value from. Updated values are accessible from
the function getLatestCharacteristics() | public void selectCharacteristicToRead(String uuid){
presentUUIDtoRead = uuid;
if (successfulConnection){
if (bleSemaphore == 0){
bleSemaphore += 1;
bluetoothLEService.discoverCharacteristics(connectedDevice, presentUUIDtoRead);
}}
} | 1 |
db67db80b6bc642a603ba35959ef8eae | 792e9737c62b9a8c24007acc6f2fe92a | To get test data iteration value from config.properties file | public class ConfigurationPropertiesPage extends EventClassesPage{
public String getPropertyValue(){
Table table = new Table(SeleniumTestCase.driver, By.xpath(EVENTS_CLASSES_PROPERTIES_TABLE));
return table.getCell(1, VALUE_INDEX).getText();
} | 0 |
f120ae7dedcad08f626015ea1c48669d | 4f094f139826713702c5b2c7869aeea1 | Returns the first server on list. | {
if(count($this->serverInfos) === 0)
throw new \Exception("No server in list");
return $this->serverInfos[0];
} | 1 |
caa6279b4354872992be4084bb6e93b9 | 5cb191588a664aff2f8f683b1fba585d | Format a line in the directory list based on the file's type and other attributes. | let ret = ''
ret += this.permissions
ret += ' '
ret += this.user + ' '.repeat(userPadding - this.user.length + 1)
ret += ' '
ret += this.group + ' '.repeat(groupPadding - this.group.length + 1)
ret += ' '
ret += `${' '.repeat(sizePadding - this.fileSize.toString().length)}${this.fileS... | 1 |
f7487e7a4f8490f25f304e9f9ed6de7c | 128bdcd376f8afc0f0f5f615942c825c | Reset(self: SecurityCache)
Reset cache storage and free memory | {
if (_cache != null)
{
FlushAll();
((System.Runtime.Caching.MemoryCache)_cache).Dispose();
}
} | 1 |
848198c585cbb5dbd808f10b5a69e7e9 | 6ed88a47f3a459309e7c4cd5cc1b7159 | Create new instance of element resolver. | class StringResolver(object):
def __init__(self, element_resolver, stats):
self._element_resolver = element_resolver
self._stats = stats | 0 |
6c07aa2541a3523d0fe2ed3d7fea6ccc | 1c6e5683d48f6a082377cdcda6b64d77 | returns the current DOCTYPE, can be <code>NULL</code>. | abstract class WebPage
public function getDoctype()
{
return $this->doctype_p;
} | 1 |
5333a667ed092ff9cace39107ee76020 | 8b1cb36cbaae1e146e30334aa500a868 | Get entity type element status
Returns true if entity is an element, false otherwise. An element may
contain either data or other elements and is used for tag representation. | public function isElement(); | 1 |
24205a9a3c050dea55927f2824155954 | fafd81ffca0a1037fccf80a68de0e178 | Gets an absolute path, given a package ID and the relative path inside the package. | {
string assetPath = ResolveAssetPath(packageName, relativeFolderPath, assetFileName);
return AssetPathToAbsolutePath(assetPath);
} | 1 |
176e049b825d41ceb05318cbf6fe0dfc | 38d4e4e933a24039afe13cfbb4f8e4e8 | Sets the first merchant defined field. | class EntryExecTranWebmoneyOutput
function setClientField1( $clientField1 ){
$this->execTranWebmoneyOutput->setClientField1($clientField1);
} | 1 |
3d97cc0ca413563c47a6590ab00cc86a | ddba66793c53ed1cc22abcd5d9bcab27 | Sets a timer which executes a function or specified piece of code once after the timer expires. | namespace CsGL.SDL
public unsafe class SDL_timer : SDL
[DllImport("SDL.dll")]
public static extern IntPtr SDL_AddTimer(uint interval, SDL_NewTimerCallback callback, object param); | 1 |
0761136fea263551927cc909efd6396b | d8b7405cd0ed7a6b4b1d27d8ab8f996e | convert a dictionary of raw frequencies to probabilities | for key in probabilities:
probabilities[key] = probabilities[key] / total_sum
return probabilities | 1 |
68740fb225d75d0c55496e8d9e3654aa | aaff932a6cf5d95beaa80717b3d9de1f | 通过学号获得一卡通卡号 | @RequestMapping(value = "/family/queryFamilyCardNumberBySchoolCode", method = RequestMethod.POST)
@ResponseBody
Wrapper queryFamilyCardNumberBySchoolCode(@RequestParam("schoolCode") String schoolCode); | 0 |
cb9acaf21b13fb2a6161061499833a5d | 03f51b0ea26e8366a9e725a37f928ef6 | Unsets surcharge id field. | class Order extends \XLite\Model\Order implements \Doctrine\ORM\Proxy\Proxy
public function removeSurcharge($surcharge)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'removeSurcharge', array($surcharge));
return parent::removeSurcharge($surcharge);
} | 0 |
b9ccbe8de5f2825058e349ebea50e968 | ab705095fe52990f70ccc908f1ede05c | Фиксирует транзакцию | {
$key = $this->getKey();
if (isset(self::$transactions[$key]) && self::$transactions[$key]['count'] > 0) {
self::$transactions[$key]['count']++;
return true;
} else {
$res = $this->dbh()->beginTransaction();
if (true === $res) {
... | 0 |
2e080c5cb1b26674d0705468b51ff365 | e88d78f4b8f4e32f2cdd5d05022b6e5e | 종료된 방의 정보만 가져오는 메소드 | List<LocpVO> all = dao.getAll();
Set<LocpVO> set = new HashSet<LocpVO>();
for(LocpVO locpVO:all) {
if(locpVO.getLocp_end_time().getTime() > new java.util.Date().getTime() && locpVO.getLocp_status().equals(1)) {
set.add(locpVO);
}
}
return set;
} | 0 |
a1e4efe95b7eeb3158e28905893ef087 | 96f3a189a31b07cc424cfc092cfd0c90 | 获得信号的周期 | namespace CottonTestCore
public class InterfaceCore
public uint GetSetPeriod(bool set = false, int freq = 100)
{
if (!connected)
throw new Exception("服务器未连接");
uint address = 0xff79;
Client.ReceiveEventArgs re;
if (set)
re = Wri... | 1 |
fead4c1d8673e2ac4150cab81e657fc7 | f9beeab4ce15690a5b60834c2d91d2a1 | 解析spiderservice返回的ip列表 | url = 'http://httpbin.org/ip'
ipList = []
for ipAndPort in ipAndPortList:
try:
proxy = {'http': ipAndPort, 'https': ipAndPort}
proxies = urllib.request.ProxyHandler(proxy)
opener = urllib.request.build_opener(proxies, urllib.request.HTTPHandler)
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.