query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
989f4d62d8d8f15e9316e5f3dc15f1c3 | 7bac9afdf498103a778b319ce0d830e5 | Dumps the database into the specified file | class DataBase:
def dump(self):
self._db.dump() | 0 |
9a5d85666b82e10aa797c162b985f43f | ac43aa529f3f87aef0d7e3b0923c08c8 | Verifies the behavior of the DefineMethodParameters() method when the
given method has many parameters. | namespace System.Reflection.Tests
public class MethodInfoParametersTests
[Theory]
[InlineData(typeof(MethodInfoParametersTests), "DummyMethod1", new string[] { "str", "iValue", "lValue" })]
[InlineData(typeof(MethodInfoParametersTests), "PrintStringArray", new string[] { "strArray" })]
[Inli... | 0 |
16e0b5198ead0e8b780be8ebb669cd87 | cf883cb98a12457d5c4c5f404f7dc9dd | Utility function to create missing nodes through a given xpath in case they don't exist | xnodes = query_xpath_x(xstr, xp_node, fixNode=fixNode)[0]
ret = xstr
for n in xnodes:
f = query_xpath_x('<?xml version="1.0" ?>\n' + n, xp_field, fixNode=fixNode)[0]
if len(f) == 0:
ret = ret.replace(n, '')
return ret | 0 |
3cef66c515b8a276becdcf38df0bc144 | 72001826e304a59f39a0cda1bc4b57b2 | default options to pass on to the finder for lazy loading
e.g.
:include => :votes | def render_options
return {} if params[:include].nil?
{ include: params[:include].split(",") }
end | 1 |
c6a4584887b4383003ee68222d5710c8 | b24639ad9f841295e15131bf0c7e645b | Receive information from file, processes and displays the result on the screen. | public class Runner
public static void main(String[] args)
{
final String filename = "file.txt";
try
{
DataExtractor numericDataExtractor = new NumericExtractor();
extractAndDisplayDataOnConsoleView("List of numeric data:", numericDataExtractor, filename);
... | 1 |
f2e10c724993b0f9eb18c01f229d6fb9 | 5ba0b062a1249d8cda3a35b914c2f041 | Read WorkWeek | {
ComplexWorkingWeek workingWeek = new ComplexWorkingWeek();
workingWeek.setWorkDay((int)IsoDayOfWeek.Monday, MIDNIGHT, HOURS_235959);
workingWeek.setWorkDay((int)IsoDayOfWeek.Tuesday, MIDNIGHT, HOURS_235959);
workingWeek.setWorkDay((int)IsoDayOfWeek.Wednesday, MI... | 0 |
1164c42e2b35ee464577c7839d11726d | 6de7f878c7324b74f6749f47b78d2888 | 设置接口class同时,也设置接口名称 | try {
Class<?> clazz = Class.forName(interfaceName.trim());
metadata.setIfClazz(clazz);
metadata.setInterfaceName(interfaceName.trim());
} catch (ClassNotFoundException cnfe) {
StringBuilder errorMsg = new StringBuilder();
errorMsg.append("Cons... | 1 |
e82592be89ac6ad7f319c94a0df1929c | 6cff1c8a49c3fd6924e70ffec2dec48e | constructor for saving data from gen | const int SIZE = 100;
myFuncGen->fName = (char*)malloc( sizeof(char)*(SIZE+1) );
strcpy(myFuncGen->fName,"UNKNOWN");
myFuncGen->fFrequency = 0;
myFuncGen->fFreqUnits = "ND";
myFuncGen->fBNCVoltage = 0;
myFuncGen->fBNCVoltageUnits = "ND";
m... | 0 |
55f4a52d18dca38d4d0aea85c26c3858 | 4817183c72fd61418a9d59ba654476f4 | 将图形验证码转化为字符串 | namespace QsTech.Authentication.Sso.Models
public class ValidateCodeGraph
public byte[] CreatePicture()
{
var text = this.CodeDescriptor.Text;
int randAngle = 35;
int mapwidth = (int)(text.Length * 19);
Bitmap image = new Bitmap(mapwidth, 25);
Gra... | 0 |
d7c801a0bdeb6c71fd0e494c7c3fdc49 | 7f4d8c5be7115eec255dc3a1477f7d06 | Metodo que destruye el proyectil. | class Projectile:
def destroy(self):
if (self.hit):
self.exist = False | 1 |
3310713f93449a13d7e5cba2b2934b26 | ec425946d3cd0107ba182d6b2730623f | Prevent adding duplicate material properties. | void cgMaterial::setMaterialProperties( cgUInt64 nProperties )
{
if ( mProperties == nProperties )
return;
mProperties = nProperties;
mDBDirtyFlags |= PropertiesDirty;
if ( !serializeMaterial() )
return;
} | 0 |
01962656a8ec54a1c845141db47c148a | e3291bc98ef44d2f5840695c32977bc6 | Method to skip Customer Search | namespace MultiFaceRec
public partial class UserInfoForm : Form
private void skipButton_Click(object sender, EventArgs e)
{
this.Hide();
CustScanForm custscan = new CustScanForm("CustomerTypeForm", "guest");
custscan.ShowDialog();
this.Close();
} | 1 |
701e965f5158f7615a9cdea202dec34a | e191d711f8318df303487763767c197a | 根据商品编号查询出此商品的所有标签信息 | ArrayList<String> getTagById(Integer id) throws SQLException; | 1 |
e933baa66b6a177037106df1e7c3ecea | 555c39ced42f1624605b2511780af863 | 将数组传递给一个函数,完成排序 | function array_sort(arr){
return arr.sort();
} | 1 |
f3d6bb454c9252ddddf2eabd400862ed | 8883e8235c770ccbcacf028c5d8241f9 | desenha (e apaga) os lados do triangulo abc | void triangulo(int x, int y){
glBegin(GL_TRIANGLES);
glVertex2d(x-2,y-2);
glVertex2d(x,y+2);
glVertex2d(x+2,y-2);
glEnd();
} | 0 |
9931e3c88f79d2c56d8afb02349ec892 | fbd2c28df3f568aa4ee35aeb39b6e7c0 | disable SPI to free PINs for FPGA communication | void bcm2835_spi_end(void) {
bcm2835_gpio_fsel(RPI_GPIO_P1_26, BCM2835_GPIO_FSEL_INPT);
bcm2835_gpio_fsel(RPI_GPIO_P1_24, BCM2835_GPIO_FSEL_INPT);
bcm2835_gpio_fsel(RPI_GPIO_P1_21, BCM2835_GPIO_FSEL_INPT);
bcm2835_gpio_fsel(RPI_GPIO_P1_19, BCM2835_GPIO_FSEL_INPT);
bcm2835_gpio_fsel(RPI_GPIO_P1_23, BCM... | 1 |
4e76c46b83618a5ab2ee6ea999637214 | 8dd5091701232902bfbc03dedeb0538f | Get the discrete values of this element, which may be empty. | IValue[] getValues(); | 1 |
cc47d3f800077abb9f0815fd1cf64e95 | 010f3140172473aa0e807c60eaf12606 | Tests to move share to new datastore | url = reverse('share_link')
request_data = {
'link_id': str('123456'),
'new_parent_datastore_id': self.test_datastore1_obj.id,
}
self.client.force_authenticate(user=self.test_user_obj)
response = self.client.post(url, request_data)
self.assertEqual... | 1 |
3853958faa44315bdbe4d8baca42ba81 | 0d9a26a69bbf74a9fd0cbb88bcf227b2 | получить название города | global $DB;
$name = $DB->val( 'SELECT country_name FROM city LEFT JOIN country ON country.id = city.country_id WHERE city.id = ?i', $cityId );
return ($name);
} | 0 |
ad1e4ae0a524ce87a903cc71dce58782 | fba83ea09c705d0f8315ad5500bfe71d | Returns full path to current dictionary from root. | class DictFile(object):
def File(self):
if self.stack:
return self.stack[-1].name
else:
return '' | 0 |
2859a83084bd12236a5951054c077533 | 6d2fec0236de710cd4a0af200ed25ce9 | Compare calculated hashes to supplied hashes. | namespace Foundation.Services.Security
public class SaltedHasher : Hasher
public override bool Compare(byte[] value, byte[] expectedHashValue)
{
var compareHash = HashBytes(value);
return Equals(compareHash, expectedHashValue);
} | 1 |
8172b05bc424a9e878c079720c5e9257 | d4c3ad8e836e9dc95d0da4abef22527c | 驗證 代付商户管理 - 修改代付商戶出款銀行 狀態 | {
$client = $this->createClient();
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
$qb = $em->createQueryBuilder();
$qb->update('BBDurianBundle:CashDepositEntry', 'cde');
$qb->set('cde.merchantId', ':merchantId');
$qb->where('cde.id = 2013052800000000... | 0 |
7919df5ae02892158b5ecbacb7cbd110 | cb5fecf5f2692a08e8435d48305f182f | Evaluate the transacton cost occurred from a revision | public long[] compute(Transaction txn); | 0 |
1d80664ff743f835398bd5f297235d02 | 6c4dcf5dd6dcd0bc853561f2ba2f9681 | Visszaadja az összes felhasználóval kapcsolatos információt. | public class UsersServiceImpl implements UsersService
@Override
public List<UserFull> getFullUsers() {
return dao.getFullUsers();
} | 1 |
9eed5e09583fae46c33d9f343e199cc7 | 99fc7e29bd3b5fe7e6bf875d42e2ec2b | Replace bad words with the first available good word | function replace_badwords($str){
$badwords = \ebcms\Config::get('user.comment.badwords');
return str_replace(array_keys($badwords), array_values($badwords), $str);
} | 0 |
ce66a522fe0487cecedf8f6d5cb86e5f | 7e287e8b158af10f92f4bcc0cac20d20 | This function will load data of the passed object. It will search through the loaded data and overwrite any member variables that it finds.
Data that does not belong to the object won't be loaded and member variables that the object has that are not in the saved data won't be affected. | namespace EnhancedEditor.Editor [InitializeOnLoad]
public static class PlayModeDataSave [Serializable]
private class PlayModeData
public bool LoadObject(Object _object) {
try {
Undo.RecordObject(_object, "Load Saved Data");
if (Contains(_ob... | 1 |
7a32e5b2b5c51b5c7ab8e6f8ed5c64ee | 2b91e7b09fb716aed319765af244e59f | Returns the ending position on the key pad given the starting position,
and the instruction string to follow. | public LE getResultsAfter(TACInstruction instr); | 0 |
a297362b9cadfe614e263719812668a9 | 797caedba9c98cb811d4d9db04b75eee | 获取 yyyyMMdd格式日期字符串 | public class DateUtil
public static String yyyyMMdd() {
return DateFormatUtils.format(new Date(),"yyyyMMdd");
} | 1 |
32b45fac00e0bf7db198813c2510a111 | 8516e8254a333de234849bf0c620925d | Runs a value through various sanitizing functions. | {
if (is_array($value) OR is_object($value))
{
foreach ($value as $key => $val)
{
$value[$key] = self::sanitize($val);
}
}
elseif (is_string($value))
{
if (self::$magic_quotes === TRUE)
{
$value = stripslashes($value);
}
if (strpos($value, "\r") !== FALSE)
{
$value = str_r... | 1 |
f429ea939e1bd04015edb2190f71395b | 35278f92c66296ee986f5177cd505514 | A method to wait until the UI list of ResourceUsage Objects has been
closed by the user | try {
getObjectById(ResourceID).
clickAndWaitForNewWindow();
} catch (UiObjectNotFoundException e) {
e.printStackTrace();
}
} | 0 |
20457e7fb6169894dabd1cb0d84ac5fd | a55a15a7df69c58b0e322e3d6581b2c2 | Test returned fluxes match fluxes from the input table | wue_data = {
"meas_ht": 7.11,
"canopy_ht": 4.42,
"ppath": "C3",
"ci_mod": "const_ppm",
"diff_ratio": 1 / 0.7,
}
fname = os.path.join(
TESTDIR, "data/TOA5_6843.ts_Above_2012_06_07_1300.dat"
)
matlab_fluxes = SimpleNamespace(
Fcp=-1.0280737876279... | 1 |
2c2bfc64eab1b4edd176a07d4d65de0c | 2a0e0c924ca6b2e1b33a16ef07aa53b9 | Derivative of Joukovski force w.r.t. changes of induced velocity at
each segment associated to grid coordinates variations. | if((derivId == id_ncold)||(derivId == id_Tcold)){
const real_t *ncold = unknowns->GetUnknownData(id_ncold);
const real_t *Tcold = unknowns->GetUnknownData(id_Tcold);
const real_t *Eterm = unknowns->GetUnknownData(id_Eterm);
for(len_t ir=0; ir<nr; ir++){
real_t j1 = j1Vec[... | 0 |
43f4a0bdd99d8aa91cfbaa4155bee113 | c7b3c3dcb20e2d0dd7845b7bf8cb1c7d | stop all reconn threads. | void stopConnectThread(trackCtrlDef *trackCtrl)
{
trackCtrl -> connectRunning = 0;
pthread_join (trackCtrl -> connectHandle, NULL);
if (trackCtrl -> throttlesRunning && trackCtrl -> throttlesHandle != 0)
{
trackCtrl -> throttlesRunning = 0;
pthread_join (trackCtrl -> throttlesHandle, NULL);
}
} | 1 |
cc6bd1f6f88407550db5c85c7f8a02d0 | a92dcc8f942e95cd6eab8d0918282ccc | Aufrufe zählen
Zählt wie oft ein Thema bereits aufgerufen wurde und gibt die Zahl wieder. | $dbTable = new DbTable($_SESSION['config']->DBCONNECT,
'forum',
array("title") ,
"Titel",
"",
"",
"parent='" .$CurrentThreadtitle ."' ");
return $dbTable->getRowCount();
} | 0 |
5df6221d8471444513ce2e9b844d02a5 | a8677317e06a1c080de32eb4a82979d6 | test to raise exception when type of day_of_month param does not match the expected type. | def test_bad_ts_manual_no_day():
with pytest.raises(TypeError):
time_utils.Timestamp(year=2018, month=1) | 0 |
152370f5125d135a3a7a62e77b731bb4 | 1f3fb9e578fff2296a5b1ed79335117f | Confirms that the new leader session ID has been successfully received by the new leader.
This method is usually called by the newly appointed {@link LeaderContender}.
The rational behind this method is to establish an order between setting the new leader
session ID in the {@link LeaderContender} and publishing the new... | Message message = MessageBuilder
.buildProposedEpoch(persistence.getProposedEpoch(),
persistence.getAckEpoch(),
persistence.getLastSeenConfig(),
getSyncTimeoutMs());
... | 0 |
4abec39457eb5e3056caf6d7c595ec37 | dadf600aa9ca70b55b4ae0c84a5cec3d | Sets the relevant userside port variables | VOID SetLocal(VOID)
{
NU_SUPERV_USER_VARIABLES
NU_SUPERVISOR_MODE();
thePort->portFlags &= ~pfVirtual;
theGrafPort.portFlags &= ~pfVirtual;
COORDS_rsGblCoord();
NU_USER_MODE();
} | 1 |
eb7955cb3d38a38b87bec3de1fe78433 | 51f9cc4d3343b06e5631ed109484861a | 读取mnist数据集数据 | def readdata():
dataset = []
with open('optdigits.tra', 'r') as file:
for line in file:
if line == '\n':
continue
dataset.append(list(map(int, line.split(',')[:-1])))
file.close()
return dataset | 0 |
116e7be452a2e3fd59afede53be660a4 | 8ccc0a815b6cb3261c73c39e8b8795a1 | Assert that the left nav (layered navigation) and the search results have been rendered. | class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Case_Controller
public function testExpectedLayoutBlocksAreRendered()
{
$this->mockAndDispatchSearchResults();
$this->assertLayoutBlockRendered('catalogsearch.leftnav');
$this->assertLayoutBlockRendered('search_re... | 1 |
2b1cb582cd5ccfa90b404dacd07c451b | 8d72df12f7d6dd327989aa2ff4b05a24 | sorts the hand by card value, lowest first | def Order(hand):
def get_card_val(card):
return card.value
hand.sort(key = get_card_val)
return hand | 1 |
afaee65a36abfc088b0c4f8b415f5347 | 40aa5d5eb1d88e353a61e56cdc22c1b0 | set sensorPin to INPUT mode | void SensorInit() {
GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P3, GPIO_PIN6);
GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P3, GPIO_PIN7);
} | 1 |
b4944593bcf295482f99da08c8f5277a | cffa91854c8a71a369b8512786f29e8c | 带偏移量右键单击本元素,相对于左上角坐标。不传入x或y值时点击元素中点 | Actions builder = new Actions(driver);
int xOffset = element.getLocation().getX() < 0 ? Math.abs(element.getLocation().getX()) + 2 : 0;
builder.moveToElement(element, xOffset, 2).click().build().perform();
} | 0 |
bc8208c7fc2c594395838ebf28dcd21c | f67e98fbebdfd031971ae4f80ad3b062 | argument type : int array[] (array), int Number_ele (number of array element)
return type : long int
functionality : multiply the input array and return the result of multiplication.
More info : recursive method | public class Lab
public static int multiArray (int[]intArray){
int result = 1;
for (int i = 0; i< intArray.length; i++){
result= result*intArray[i];
}
return result;
} | 0 |
b6352c88194824530a28248c46b54362 | c94a875e194f764716605ace7c00b918 | when x < y, means interval x is at left side of y and they are not contiguous | def interval_cmp(x, y):
if x[0] > y[0]:
return 1
elif x[0] < y[0]:
return -1
elif x[1] > y[1]:
return 1
elif x[1] < y[1]:
return -1
else:
return 0 | 0 |
fb8504901b6e942429be99f1042bcd21 | 7a473b4017bc24135bd1ca533f0bf33e | Convert an internal inventory item object into an LLSD object. | return {
'name': self.item_name,
'description': self.item_desc,
'create_date:': self.create_date,
'id': self.item_id,
} | 1 |
763d70a6dd4fbb402d11dc3d6d5d71ee | 12ee12f2e0c0bd9face15ee5d5d44099 | IOS检测版本更新 | try {
if (Platform.OS == 'ios') {
let buildNumber = await DeviceInfo.getBuildNumber()
let body = {
ios_build_number: parseInt(buildNumber)
}
let ret = await fetchCheckUpdate(body, '')()
if (ret) {
... | 1 |
afc9409c53b5c71db674357fd51e4eac | 882f5b2eb06919f7dda28c5c55ac3061 | Handles listing geocoding | {
$request->query('sort') ?: $request->query->set('sort', 'updated_at:desc');
$request->query('limit') ?: $request->query->set('limit', config('cms.database.eloquent.model.per_page'));
$data['model'] = new Geocodes;
$data['geocodes'] = Geocodes::with('parent')->search($request->query... | 1 |
fbaeb7179e954b79fe6d76dd556a3f79 | 2a673d1ba2dcda86acc27233303a2075 | 将秒转换为时间.如7201 -> [2,0,1] | static int[] getHourMinSecond(long second) {
int numHour = 60 * 60;
long timeMin = second % numHour;
return new int[]{
(int) (second / numHour)
, (int) (timeMin / 60)
, (int) (timeMin % 60)};
} | 1 |
cd1ffd9183ca6278895b669cb0c73533 | 6db9bcd9a9b42afe933d189ed993adf8 | 设置快递单当前签收状态,包括0在途中、1已揽收、2疑难、3已签收、4退签、5同城派送中、6退回、7转单 | @Table(name = "`waybill_tab`")
public class Waybill extends BaseEntity
public void setReceiptVerifyStatus(Integer receiptVerifyStatus) {
this.receiptVerifyStatus = receiptVerifyStatus;
} | 1 |
cd5f526ae0f11b7a7ea78be5bb59d9ca | 9117c18c149266930d6d2048facabdc1 | Given a sourcefile's filepath clone it somewhere else. | source_full_path = os.path.join(source_dir, source_file_name)
dest_full_path = os.path.join(dest_dir, source_file_name)
append = 0
while os.path.exists(dest_full_path):
append += 1
name_parts = source_file_name.split('.')
name_parts[0] += "-" + str(append)
new_name = '.'.... | 1 |
c5d2a49648ccf72509899b0f29cded24 | 1e57653b933283cf8919cb60bca67e41 | 点击完成拍照按钮 | try {
mCurrentPhotoFile = new File(PHOTO_DIR,
ImageUtil.getPhotoFileName());
final Intent intent = getTakePickIntent(mCurrentPhotoFile);
startActivityForResult(intent, CAMERA_WITH_DATA);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "拍照出错", Toast.LENGTH_LONG).show();
}
} | 0 |
92f44f099cb4c05e5e5b97f3643c765a | 32162bef022e360af712dfc499ef7c0d | Sprawdzenie stanu procesów bez blokowania. | {
CheckFileExist(QueueFileName);
List<string> lines = ReadAllLinesFromFile().ToList();
int startCount = lines.Count;
for (int i = 0; i < lines.Count; i++)
{
try
{
Process.GetProcessById(Convert.ToInt3... | 1 |
f497cf923400c2d1d6f4619c07c130fb | d9ac62ff0a0aebd192b610c770328f59 | 首页多图上传 | class IndexController extends CommonController
public function Image_Upload(){
if(IS_POST){
$this->Mygallery = D ( "Mygallery" );
$imgurl = I('post.imgurl') ?? '';
if(empty($imgurl)){
$this->ajaxReturn(['code' => 3000,'msg' => '参数错误!']);
}
... | 0 |
e08a1b95dbfcc79baadc0f4c98c24f45 | dfc3c2b74353a02f7a7c34960f9082b1 | This rest service serves questionStatistic for front end to paint number of question and answer in ribbon | {
$repository = $this->getDoctrine()->getRepository(Issue::class);
$allissue = count($repository->findAll());
$openissue = count($repository->findBy(array('status' => 1)));
return new JsonResponse(["total" => $allissue, "open" => $openissue], JsonResponse::HTTP_OK);
} | 0 |
6dcb779cfee34bfe0cc723c9cbec2dd9 | f34009c1c0934121acd588b316a040ed | 在释放鼠标按键之后恢复为箭头形状的图标 | class DesktopPet(QWidget):
def mouseReleaseEvent(self, event):
self.is_follow_mouse = False
self.setCursor(QCursor(Qt.ArrowCursor)) | 1 |
0037f898f6d3f5e4578e459d3082788b | 391dec1f415faaf2c82f348bf2b9be20 | Recibe como parametros una peticion, un ModelForm y una cadena con
la ruta del templata, dependiendo del tipo de peticion retorna la
vista correspondiente. | if request.method == "POST":
tipoDeAtencion = TipoDeAtencion()
form = TipoDeAtencionForm(request.POST, instance=tipoDeAtencion)
if form.is_valid():
tipoDeAtencion = form.save()
return HttpResponseRedirect( reverse("tiposDeAtencion:ver", args=(tipoDeAtencion.id,)) )
... | 1 |
fabf45a1856c8f23ae286b5b85422131 | 30b21686b888c0a76ebe83914f3e033e | Test to check a nested list with an empty list | class NeuralModuleConfigTest(TestCase):
def test_nested_list(self):
params = {"list_outer": [[1, 2, 3, 4]]}
self.assertEqual(self.module.validate_params(params), True) | 0 |
3474e62e2a2505e5c840294a82351576 | f0a21b897e73d2c29a40922d48f978c6 | Create the directory and move and rename the files into place. | def main():
os.chdir("FilesToSort")
for directory_name, subdirectories, filenames in os.walk('.'):
make_directories(filenames)
move_directories(filenames) | 1 |
ff0a9443915d7731372f9c976656bc84 | 0eaf35c72c06977cb5538c39bcc14bb9 | 设定是否使用Enum的toString函数来读写Enum,
为false时使用Enum的name()函数来读写Enum, 默认为false.
注意本函数一定要在Mapper创建后, 所有的读写动作之前调用. | public void setEnum(boolean value); | 1 |
e6d35c85c5b2f9df5acb3e25538b37cc | 1128911c273c239da2713bb362424a6c | Computes the cumulative frequency for the list of values provided. | cumulativeSumList = list()
cumulativeSumList.append(0)
for i in range(len(originList)):
cumulativeSumList.append(cumulativeSumList[-1] + originList[i])
return cumulativeSumList | 0 |
802b9d38b3665cc6085cef9d89deb5e6 | c2d75b389fe0830a2d0263608f84dea4 | ReceiptsController constructor. | class ReportController extends Controller
public function __construct()
{
} | 0 |
a2ad5d1f075de286856b9a8afefbd395 | ac702736b4da1aebfe768306d63f158e | Order the school information by the most recent school information dates | int changingIndexAndDistance = sortedSchoolsCloserToFarthestPoint[1][distanceIndex];
sortedSchoolsCloserToFarthestPoint[1][distanceIndex] = sortedSchoolsCloserToFarthestPoint[1][schoolIndex];
sortedSchoolsCloserToFarthestPoint[1][schoolIndex] = changingIndexAndDistance;
changingIndexAndDistance = sortedSchoolsC... | 0 |
1265178f72c7669d80d7ae9245e403f1 | e038d131e80fe48a1e1c17d8e837ab37 | NewLibp2pPubKey returns a new PubKey. | func New() hash.Hash32 | 0 |
4e7e4937af19b71de6d51622b8d74129 | 46dbab69564e645868a22ab7b7fcbbe4 | 取得当前单据运行过的流程实例次数(审批次数) | class MainpageController extends Controller
public function getFormRunNum(){
header("Access-Control-Allow-Origin: *");
$rs = Approval::dc_getRunNum();
$rs = ['yes' => $rs[0],'no'=>$rs[1]];
return $rs ?
json_success('成功',$rs,200):
json_fail('失败',null,100);
... | 1 |
40070759022309f09d467ef9ffa25c4d | 44039d5432739747351d9b5e7dd6a136 | Sets the retired of this AttackRedirectors. | {
if (!is_null($retired) && !is_bool($retired)) {
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($retired, true), gettype($retired)), __LINE__);
}
$this->Retired = $retired;
return $this;
} | 1 |
315a1ed64f35de81e5b6eb02edfaf6a5 | cffa91854c8a71a369b8512786f29e8c | Move element by its center | Actions builder = new Actions(driver);
int xOffset = element.getLocation().getX() < 0 ? Math.abs(element.getLocation().getX()) + 2 : 0;
builder.moveToElement(element, xOffset, 2).click().build().perform();
} | 0 |
7481f612a545346a2a3734dad84e56de | 0eefdfb5a676150a219cb4c1ca5de5c3 | Update the replay information in the UI with the replay file
pointed by the index | {
gActiveIdx = track_idx;
gPlayer.update_player();
for( i = 0; i <gQueue.length; i++ )
{
update_node_image( gQueue[i] );
}
} | 0 |
5dafc654c742c1e66c95ec06c5399295 | d5ef62bbf6c58697cce7469bfd9911f6 | 根据 self.validated_data 和 self.context 保存数据到数据库 | class RegisterView(FormView):
def form_valid(self, form):
form.save()
return super(RegisterView, self).form_valid(form) | 0 |
565b4e4b02e2978632e2aeefa524f21c | da07d3168a8ba75b62060cb80260cdd3 | Updates the order shipment email template to include
the tracking link in the tracking details | class WC_Shipment_Tracking
public function email_display( $order ) {
$this->display_tracking_info( $order->id, true );
} | 0 |
9f00095ca52da77c6867f15db818c6d6 | 329a2cc496ed6b4f6850e308e4cd709b | ===========================================
> 在指定缓冲区,取反一个像素颜色
============================================ | {
if (~(*lpbFrame & wColor) & bPos)
*lpbFrame |= bPos;
else
*lpbFrame &= ~bPos;
} | 0 |
aa81d0d2c628899d249fa9b10dd64259 | 12991253ab23d03d9d1eb5bc3c256272 | Initialize object with name and position | class Player:
def __init__(self, name, position):
self.name = name
self.position = position | 1 |
937fe0f7a820a3f14b20804697a26129 | 5711bf23e232beee5f2df3119d3bc860 | 屏幕关闭启动1像素Activity | public class KeepProgressAliveManager
public void startActivity(Context context){
Intent intent = new Intent(context, OnePixelActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
} | 1 |
0f4b8cf9616056f8ff631dc6acbd6f4d | f84d36f35439c4570024e6064310a359 | (1) the goal is to test the effectiveness of each similarity metric, e.g., bm25, tf-idf,
latent topic vector based similarity metric using LDA
(2) method: for each subtopic, ranked the top-n documents in decreasing order of the similarity
computed with a specific kernel, compute the nDCG of the obtained ranked list
the... | bow = self.dictionary.doc2bow(query_tokens)
latent_vector = self.model[bow]
ranking = []
p = sparse2full(latent_vector, self.n_topics)
print p
for i in range(len(self.latent_docs)):
q = sparse2full(self.latent_docs[i], self.n_topics)
score = kl_div... | 1 |
08aedb1dd319693abc1cc4254d9e7fed | 3efce241d27dd0ab0df6eb35e36077fd | Check whether the given file is a JWST x1d spectral data product. | try:
dfile = str(sorted(source.glob('hlsp_eleanor_tess_ffi_*_lc.fits'))[0] if source.is_dir() else source)
h = fits.getheader(dfile, 1)
cards_names = h.values()
return "TIME" in cards_names and "CORR_FLUX" in cards_names
except:
return False | 0 |
75e9eb59c6df4e16de67c071db6ba909 | 1e7d60f2ea3eb3250992b0b8cdb0278f | Checks many constraints mentioned in the tf.gather() documentation. | index_prefix = indices[:, :-1]
index_suffix = indices[:, -1]
index_prefix_changed = math_ops.reduce_any(
math_ops.not_equal(index_prefix[1:], index_prefix[:-1]), axis=1)
index_ok = array_ops.where(
index_prefix_changed, math_ops.equal(index_suffix[1:], 0),
math_ops.equal(index_suffix[1:], inde... | 0 |
ebc6a9cf735073e181251590ff82937a | c93f02b3bcfce5b8339943ee39498472 | returns true if avatar is facing right | local p = Minimap
local m = ({p:GetChildren()})[9]
return GetPlayerFacing()
end | 0 |
90c192af32fc9ab954a918beaf92adbb | 6143301c369024896fee4773ece519aa | Enable ansi mode | impl<'a> Prompt<'a>
fn init_ansi() -> bool {
ansi_term::enable_ansi_support().is_ok()
} | 1 |
d8abbdf74cc7a48ca06ee9accedf57d7 | b7664c383a2095f873b6e2918970553f | Save new url rewrites and remove old if exist | class Save_functions_admin extends Diafan
public function save_rewrite_redirect()
{
if (isset($this->diafan->oldrow["site_id"]) && $this->diafan->save_site_id != $this->diafan->oldrow["site_id"])
{
DB::query("UPDATE {redirect} SET site_id=%d WHERE module_name='%s' AND "
.($this->diafan->config("category") ?... | 1 |
0bafe94cd506c2dfbb883225d335b814 | c95018248dde45fa5e5a2e7921af0931 | all contiguous subarrays | function maxSumSubArrayPairs(nums, expectedSum) {
let i = 0,
minSize = Infinity,
maxSize = -Infinity,
j = 0,
currentSum = 0,
result = [];
currentSum += nums[0];
while (j < nums.length) {
if (currentSum < expectedSum) {
j++;
currentSum += nums[j];
} else if (currentSum > e... | 0 |
dd97018173ec4131302b22cbd17d4ed9 | f1746482718ebc4dee109371a1826d73 | Get total number of games the player has been in | class Player
public function getTotalGames()
{
return $this->totalGames;
} | 1 |
7aa1934265b6386042020d69768da1de | 92a627850507a3060930c03f57874806 | cancel interval when tab no longer shown (prevents cached pages from polling) | function onMouseLeaveTab(e){
tabTimer = window.setTimeout(hideTab, hideTimeoutInMs);
} | 0 |
aaa448b642251914185291fea50eb861 | 8ea46acbe50593b43f45a41872507f31 | Execution object for the CancelSubscription Choreo. | def cancel():
from app.api import cancel
return jsonify(cancel.execute(request)) | 0 |
ce86ec32cb29b773e396c244eca3459e | 482d99786420dcb9e213e7ae66e2a39a | Detect a URLSearchParams object | function isURLSearchParams(val: any): val is URLSearchParams {
return typeof val !== 'undefined' && val instanceof URLSearchParams
} | 1 |
08877cc096b908d3b0222c6181439c0c | 3cff58ef134833feddad0f70a3888955 | Refreshes portfolio data. | try:
self._port_data = load_pickle(self._data_path)
self._reb_calculator = load_rebcalculator(self._port_config.rebalance_type,
self._port_data.update_time, datetime.now())
except FileNotFoundError:
recent_rbd = se... | 1 |
667ed900d628b5fa3530d59d07f4e8a9 | ed7effad2b55fa9f17c5c8a80fe63454 | Generator to convert BAM files into Biopython SeqRecords. | for i in fh.readlines():
fields = i.rstrip('\n').split('\t')
yield SeqRecord.SeqRecord(
Seq.Seq(fields[9]),
id=fields[0],
letter_annotations={'phred_quality':
[phred_letter_to_number(i) for i in fields[10]]},
description=fields[11]
... | 0 |
89f4149144bf88d44775a58f357a3b28 | 94978dbf25f885e90b1c5a3ceb61cd31 | NewBinanceCliFlags returns new configuration flags for Binance. | func NewBlackduckCRSpecBuilderFromCobraFlags() *BlackduckCRSpecBuilderFromCobraFlags {
return &BlackduckCRSpecBuilderFromCobraFlags{
blackDuckSpec: &synopsysv1.BlackduckSpec{},
}
} | 0 |
cdc6655310510ee0b406677ea37665e8 | dad5a52a42393241df289f17c592dd2f | Writes out DMU format
Results contain the genotypes, markerlist and pedigree as were found in the input file
Any external markerlist/pedigree are stored in self.mark/self.ped | if self.out is None:
raise IOError('Writer object already closed')
self.out = None
if self.mapfile:
out = autofile(self.mapfile,'wb')
for locus in self.loci:
loc = self.genome.get_locus(locus)
out.write( ' '.join( map(str,[loc.chromosome or 0,locus,0,loc.location or 0] )) )... | 0 |
89bfc1509982157c38212a6c253bdc22 | fd02c70ac97f20cccda34ac52dc1e138 | Getting languages by rendering options. | public class PrestaShop
public PrestaShopCountry[] GetCountriesByRenderingOptions(PrestaShopRenderingOptions renderingOptions) throws Exception
{
return _bNesisApi.<PrestaShopCountry[]>Call(PrestaShopCountry[].class, "PrestaShop", bNesisToken, "GetCountriesByRenderingOptions", renderingOptions);
} | 0 |
60d5c49abdd25fdabf92260af97e657c | 2617ac6ae7fe0de26257108a982f9e2b | Remove length of packet. | impl<B> Packet<B>
where
B: AsMutSlice<Element = u8>,
unsafe fn set_length(&mut self, len: u16) {
NE::write_u16(&mut self.header_mut()[LENGTH], len);
} | 0 |
ad496fea33de995f3526984700f60d46 | 5647877992374c5e8fb19ac5dca9fc51 | Display the tic tac toe board and all the tokens that have been placed on top | int row;
for (row = 15; row >= 1; row -= 1) {
if (row < 9) {
normal_print(
"----------------------------------------------------------"
"-\n");
normal_print(
"%d | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s | %s "
... | 0 |
6d77661ea01eba2faeaa1cf981beb765 | 2ec4fd1aa30cd5bf6d064f3bf955a7f6 | Save a protobuf object to file | file_name = os.path.abspath(file_name)
with open(file_name, 'wb') as f:
pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL) | 0 |
834737880f8457701f0c006b7bcca74a | a60781d6db06f075a3ead904f18f7338 | Simple check that the user_id field in the vismooc
enrollments schema is mapped to correctly. | class TestEnroll(unittest.TestCase):
def test_course_id(self):
course_id = self.test1.to_dict()['course_class_id'].split('-')[0]
inserted_course_id = self.test1.to_dict()['course_id']
self.assertEqual(course_id, inserted_course_id) | 0 |
9c6009561024ea03e2a8cf107fdcca95 | 27dd9fa25de9d7e104e1d09a29cb68a1 | ad-hoc solution to test connectability to gmail. | def test_connection():
try:
socket.create_connection(("Google.com",80))
return 1
except :
return 0 | 0 |
8c5c2a5900f3f47ea47080871254f196 | 965efe1e109841223f0e7aedc5abe8cc | EXCELのセルオブジェクトにデータを設定する | public class BenriCell
public void set(double value) {
cell.setCellValue(value);
} | 1 |
5e8757e759f4b1350bb858aa58c024cc | e56be319992e91851666ad27f78cf65b | 中序和后序生成二叉树 | public class TreePbms class BuildBinaryTree
public void reconstructTree_In_Post(Node[] inOrder, Node[] postOrder) {
if (inOrder == null || postOrder == null || inOrder.length == 0 || postOrder.length == 0 || inOrder.length != postOrder.length)
return;
post_root = reconstructT... | 1 |
f029dd4c3c76d8d5b5470a59d8b8bf1d | 28f1ef0490c9bc133c4714cdb226c32b | Método para pedir al usuario una lista numérica de enteros
Devuelve una lista | namespace PesquisaOrdenacao.ConsoleAplication
List<int> ColetarNumerosUsuario (); | 1 |
6f765bb99ff5a75a05104f1faa4e1949 | bdc6bdfe2c5932f87c40403402dc69f0 | sets the ipadx of a variable according to desired width and current width | public class Button extends Drawable
public void addToWidth(int diff) {
this.width += diff;
} | 0 |
4b6ce817547bfca7c76b6500d98256da | fd51dfaa93f95bd54b7587d0446d984d | To make sure we get the right clrjit, we enumerate the process's modules and find the one
with the name we care about, then use its full path to gat a handle and load symbols. | LPCSTR symbol, LPVOID *address)
{
GetProcAddressContext *context = NULL;
DWORD result = ERROR_SUCCESS;
DWORD contextSize = 0;
DWORD symbolSize = 0;
BYTE getProcAddressStub[] =
"\x8b\x54\x24\x04"
"\x8b\x5a\x04"
"\x8d\x4a\x08"
"\x51"
"\x53"
"\xff\x12"
"\xc2\x04\x00";
do
{
symbolSize = (DWORD)st... | 0 |
7914c5f053f25bd44f4bbb97512b66b0 | 1820456eb0babce06e9b1fc5982a556f | @brief Implementation of the function that returns the number of current tasks cheduled to run | {
this->m_mutex->Lock();
int size = (int)this->m_taskVec.size();
this->m_mutex->Unlock();
return size;
} | 1 |
4692d4b90ecba1ce5a4f8d9001186140 | 03ccc3f3082ff5eb5f0b38b5e40aabab | 在指定目录下查找继承了指定基类的类型集合 | {
var result = new List<Type>();
Type attr = inheritType;
string domain = GetBaseDirectory();
string[] dllFiles = Directory.GetFiles(domain, searchpattern, SearchOption.TopDirectoryOnly);
foreach (string dllFileName in dllFiles)
{
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.