query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
538103cae3c91d0b1fb694ce90ffa36f | 6ab8fa6d20c09dda04f84f2d63e59fcc | 根据相关推荐获取还未爬取的url | iscrawled_list = get_topic_priority(platform)
all_urls = []
for iscrawled in iscrawled_list:
topic_urls = sql.get_topic_bycrawed(platform, '0', iscrawled[0], settings.DOWN_NUM)
urls = db.handle_db(topic_urls)['data']
all_urls.extend(urls)
if len(all_urls) < settings.DOWN_NUM:... | 1 |
6592f8845bbdc0e9ddb0f06d7dbd1814 | 57ffafd5adb2384a238e3c39b1ca23d1 | Kollar om användaren valt ett värde i editeringsdropdownen, returnera värdet annars falskt. | function liesuresValue() {
var liesures = document.getElementById("liesures");
if (liesures.checked == true){
console.log('Liesures Checked');
return liesures.value = true;
} else {
console.log('Liesures Not');
return liesures.value = false;
}
... | 0 |
6448a0ec3244ced0c64ddcd299ebb680 | 0240070a9a8d9ce752f6e5eadeb36a21 | Get faq group collection | {
$searchModel = new FaqGroupsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | 1 |
7a29410eeca0c8839c7d7b90362e6945 | 1cfa7a661c0a237c861c60dd5cdef340 | tests a software update proposal can be marshaled and unmarshaled | add_var(self.tapp, "proposal", "{}")
app2 = api.create_app("UTApp2", "dummy", "{'spec':'http://justatest.com'}")
add_var(app2, "proposal", "{}")
proposals = _db_get_proposals(self.tapp)
assert len(proposals) == 1 | 0 |
8e3211abf904723dd8748645e252d9f7 | ac4722ac7f60b6a951098189f76083d9 | This adds a property descriptor for the Task Start Date feature.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public class TaskExecutionHistoryItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource
protected void addServerJobStartDatePropertyDescriptor(Object... | 1 |
5b2597597234f911df4f97df7efe51f3 | ccf03c905004def1413071411ede0d7d | Acessar diretorio anterior | class DataExplorer extends CI_Controller
public function BackDirection(){
$this->logedCheckerWithLinks();
$tempFilePath=dirname($this->session->userdata('curr_path'));
if($this->session->has_userdata('root_link')){
if(strlen($tempFilePath)>=strlen($this->session->userdata('root_link'))){
$this->session->se... | 1 |
53e3c5a6b860712831f1e8406cdcd498 | e2972b85259a3d62fb6ad1197c8f3793 | @brief API Handle the master BTF(data byte trasmission finish) interrupt. this intterrupt occure when data and shift
registers are empty. | {
unsigned int val, idx;
if (HW_USDHC_INT_STATUS(instance).B.BRR) {
for (idx = 0; idx < ESDHC_FIFO_LENGTH; idx++) {
val = HW_USDHC_DATA_BUFF_ACC_PORT_RD(instance);
}
}
val = val * 2;
HW_USDHC_INT_STATUS(instance).B.BRR = 1;
} | 1 |
732000d8e8f5357e988cd455dd49b7dc | 7a5fecf5e40226e68cf01f38b9ad3104 | 打开极速 | function openTianti(param) {
ExecuteMainFrameFunction("tianti")
return
} | 0 |
213d3bfc5b25b9093c17782f67859cdb | 832d86ab00e7c3588cab12bc7a27a9cd | Initialize the files to save calibration data | class CameraCalibrator:
def __init__(self):
if not os.path.isfile(CALIBRATION_FILE):
self.do_calibrate_camera()
self._load_calibration()
print('(init: CameraCalibrator)') | 0 |
6bb3a9287b28940c87fe984b2f3d1bfc | 1e9c2c7c6d3f9874f838eb00a46bd78b | Create an OCD BallotMeasureContest object derived from a ScrapedProposition.
Return a BallotMeasureContest object. | self.outcome = None
self.for_votes = 0
self.agn_votes = 0
self.party_votes = {}
if entries is not None:
self.__dict__.update(entries) | 0 |
30367ad5c6ef80673d9a9641012f6610 | 881a2bede6414bea77e390c082438d7d | Resets the plot parameters to matplotlib default values
Adapted from:
https://stackoverflow.com/questions/26413185/how-to-recover-matplotlib-defaults-after-setting-stylesheet | def plot_params(fontsize=16,linewidth=1.5):
global fs,lw
mpl.rcParams['axes.linewidth'] = 1.5
mpl.rcParams['xtick.major.size'] = 5
mpl.rcParams['xtick.major.width'] = 1.5
mpl.rcParams['ytick.major.size'] = 5
mpl.rcParams['ytick.major.width'] = 1.5
mpl.rcParams['xtick.labelsize'] = 14
mpl... | 0 |
6f45d4ecda7e34e611a71f070260317a | 7f9d90336d5264b1ee8c6d8fde5214e7 | Returns the value of the '<em><b>Group Ending With</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Group Ending With</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc -->
extendedMetaData="kind='attribute' name='group-ending-with'" | public class PSParamDef
public boolean isEndGroup()
{
return m_endGroup;
} | 1 |
1564aff02ebc72c535a984739bd8d557 | 44ad18109d007a5e25ff65b829200956 | 내판매정보 가져오기 | class MoblieSellBoardController extends Controller
public function show($id)
{
$post=sellboard::find($id);
if($post==null)
return "잘못된 경로입니다.";
return json_encode($post);
} | 1 |
ecc50196887af17768e0ac6ef2d310b8 | 5d8bb0a0c935bbd9c33422f8825b90fc | 获取所有的卖家及旗下的全部商品列表 | class usershopModel{
function getSellerList($startItem, $listNum) {
$sql = "SELECT S_ID,S_ShopName,S_ShopImgUrl,S_Coordinate FROM `r_seller` WHERE S_Status = 1 LIMIT $startItem,$listNum";
$result = DB::findAll($sql);
foreach ($result as $key => $item) {
$SID = $item[... | 0 |
e81d39d756f20ac8765bea66b070fdc6 | a89ebd3ea19ae53931f20ef458d9a257 | Tests reading and deserialization of content from a JSON string. | StateMap map = StateMap.create();
map.fromJson(TEST_JSON_STRING);
assertEquals("testValue", map.get("testKey"));
assertEquals("oddCase", map.get("hasOwnProperty"));
assertTrue(map.has("nullKey"));
assertEquals(null, map.get("nullKey"));
assertEquals("null", map.get("nullString"));
} | 1 |
30a8d935a3d113290c3dfbd7ebc62015 | ae70794514b22d2273271f4fac6b69b4 | Coordinates the drawing of a number of water tanks | void SimulationWidget::DrawTank() {
RGBAValue<float> tankColour(51, 102, 153, 255);
float thick = 15;
float tankHeight, tankWidth, startH, startW;
if (aspectRatio < 1.0) {
tankHeight = (5 * frameBuffer.height) / sceneSize;
tankWidth = (8 * frameBuffer.width) / sceneSize * aspectRatio;
... | 0 |
0df9d53ad127275672ac1053ccb4f35a | b31365dcf96aedb5ee68a54ace69d584 | Hides the part the user selected of the Ontology. This function is called as a slot. | function HideSelectedPartsTool(visualizationTool) {
GeneralTool.apply(this, arguments);
} | 0 |
e5b2b5faf7b9a850ca6f9e7cb14f4d7b | c34d66b991318a85e051a2f5f19bb4f9 | Read all settings from non-volatile memory. | public class SettingsIO
public ArrayList<SettingsAttribute> readAll() {
return OSUtil.memcpy(attributes);
} | 0 |
2d787788c1a3ec09dbebc6937e5959db | 2bf4139ccca939a92ac06879bf1840c3 | ワーニングメッセージの設定 | public function setWarnList (array $warn_list) {
$this->warn = $warn_list;
} | 1 |
fee80c94cb09fcfbb4b7a0d24b82439a | 526ca7abdf7c4c1d2d6be332be059924 | Helper method that balances LL imbalance. | class UnrolledLinkedList():
def balance(self, node):
thisNode = node
while thisNode.itemsLength() <= self.max_node_capacity / 2 and thisNode.hasNext():
self.__str__()
thisNode.items.append(thisNode.next.items[0])
thisNode.next.items = thisNode.next.items[1:]
... | 1 |
5a16df1b2970037b35f4647da5894da1 | e7d1bc9354ea14a067f7a55352ee67b4 | Add submenu to Tools menu | global $submenu;
$url = get_bloginfo('url') . "/wp-admin/post.php?post=18863&action=edit";
$submenu['edit.php'][] = array('Störer', 'manage_options', $url);
} | 0 |
c8d2ca6a3f2765eb95ed8918eb7a99c7 | ce43027d79a2975244f0adfe33122534 | Generate a random base64 string from urandom. | def generate_random_string(length):
return base64.urlsafe_b64encode(os.urandom(length)) | 1 |
ab3dd9ee4d88a7ac2c16f61e8fd369af | 81e7ae445da622b0e240e7e37327c33b | Hide main window | void hide_mainwin(void) {
window_stack_remove(s_window, true);
} | 1 |
693d7f6b3fbd40076d4d06f4b65b09b6 | 65d9827fc4a899c74cf757c040fb0c3e | 根据实训发布id和账号查询有效的权限 | Class TestdatabasePermissionModel extends Model{
public function getTestDBPer($college_id, $testdb_id){
$map['del_flag'] = array('eq', '1');
$map['college_id'] = array('eq', $college_id);
$map['testdb_id'] = array('eq', $testdb_id);
$data = M('TestdatabasePermission')
->field('testdb_id, college_id, permiss_l... | 0 |
8aa5e742d73871086ba42342b6a52668 | 6fe46be7f6b7285fcdb91d2b7a8c67ad | 根据发票ID 查询相关的订单 | public List<PurchaseInvoice> findByLinesId(String linesId); | 0 |
479f52b115d43a5fe110a0661d5ba55e | de7e1d4a4ebaa1a97e8d728fa33f68e6 | Look into the direction of mouse smoothly. | namespace ZS.Engine.Utilities public static class LookHelper
public static Quaternion SmoothLookAtMouse(Transform source, float speed, float offset = 0) {
_mousePos = Input.mousePosition;
_objectPos = Camera.main.WorldToScreenPoint(source.position);
var quaternion = CalcRotation(_objectPos, _mousePos);
... | 1 |
0d9ab6d752bba8e846a89da1ce69e5da | a055eb858b7a4b367ed546a1e66ad662 | Toggles bounding boxes on the currently focused image | class ImageCanvasFrame(Frame):
def new_bounding_box(self):
self.imageCanvas.status = ImageCanvasStatus.DRAWING
self.new_bounding_box_button.configure(state='disable')
self.delete_bounding_box_button.configure(state='normal')
self.select_bounding_box_button.configure(state='normal') | 0 |
5fbda78f15aa7416f0a6d353c9aafb91 | 1ceb4b7429fe9e1a1550ef317a31471e | \brief Fonction qui retourne le reste d'une division entiere | static char *RemainderOfDiv(int *NbArg, long *TabArg)
{
#ifndef HAVE_DIV
return safestrdup("Unsupported function: div");
#else
char *str;
int val1,val2;
div_t res;
(*NbArg)++;
str = CalcArg(TabArg,NbArg);
val1 = atoi(str);
free(str);
(*NbArg)++;
str = CalcArg(TabArg,NbArg);
val2 = atoi(str);
fre... | 1 |
5eb07099c028f6e7cea13a51dcc1ba47 | 496f26c549c4079fa6c64d3a28b7601d | Process the query string and exclude querystring named "p" | $q = explode("&", $_SERVER['QUERY_STRING']);
if($q && count($q)>1 && $q[0][0]==='r'){
unset($q[0]);
return "&".implode('&', $q);
}
return '';
} | 0 |
c8deb1e158f0ce1f793d44688bc76e90 | b85208f49c1ef53e9be4e6bf10b523dd | Asynchronously request save (update) of meta data
EVENT GENERATED: OperationSuccessfulEvent | {
this.AssertAsynchronous();
return TaskUtils.GetTaskForSynchronousOperationReturningTask(
() =>
{
this.WriteMetadataDocumentImplementation();
return this.FlushAsync();
});
} | 1 |
dfb12b9d752d621748d146a6ed03de8a | 32dc6242b913a107980fbb2cd433ff50 | 演示枚举类型的遍历 | namespace Types
class Program
static void EnumsDemo()
{
Enums.Demo.Test();
} | 0 |
1cd054589f8b886a875c97afe94ca4f6 | 0090f7a2cd220bd4c6c7671ba30ca78a | Sets the default event queue size that will be used for creating {@link EventStream}. | void setDefaultReceiveEventQueueParameters(ILLBEventQueueParameters params); | 1 |
a768f7744ae3e62c21b2f4991197bd63 | 744e360e6747453a6c742a392f66555a | Performs on the fly swap for custom head links in structure files | class customTemplate:
def _link(self):
maxDepth = self.maxDepth;
loopIndices = [];
for d in range(maxDepth) :
loopIndices.append(self._getLoopIndices(d));
for d in range(maxDepth):
instIndices = loopIndices[d];
for t in range(len(instIndices)):
... | 0 |
1447e7956980c1b510472f668b272846 | 1907b9beec6b6f87d8086662255ae2f8 | Performs necessary clean up and destroys root window. | static int shutdown( void ) {
destroy_windows();
return 0;
} | 1 |
903e6520b6c2b8f6b3448ee49ab8f118 | d915e8dedc6bfb60187a565a3ced9fc7 | Whether the stone at the position is imreversible | class GameStone
get moveable() : boolean {
return this._moveable;
} | 0 |
43f904d3fd845be3ce865d71d48028cd | e519626c9d40eee2363a3461089d2ed1 | 버튼을 누르면 비디오촬영 화면 Camera 앱 실행 | public class MainActivity extends AppCompatActivity @Override
protected void onCreate(Bundle savedInstanceState)
@Override
public void onClick(View v) {
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, RESULT_CAMERA_IMAGE);
... | 0 |
f704e74802c387060edf9552b655fb9f | adcb55319095540253819408372bacae | 新增抄表记录 | {
try
{
VariedEnum.OperatorStatus tempOperatorStatus;
ModelCMS_ConsumptionReg tempCMS_ConsumptionReg = GetConsumptionRegModel();
tempOperatorStatus = myBUConsumptionReg.Insert(tempCMS_ConsumptionReg);
if (tempOperatorStatus ... | 1 |
9008228e4b1f726887c9ec60da83ed97 | e4f9b0ca0a48bd35835efebedef8bea3 | 라디오 박스 설정 함수 | function setRadio(id)
{
var n = rand(1,5);
document.getElementById(id+"_" + n).checked = true;
} | 1 |
e8d0f904bd70f64fde62cb19844dd6b3 | 138dc39a18b7f8690894294836911d7e | 判断用户是否为学生 | def is_student(user_id, request):
classrooms = Classroom.objects.filter(teacher_id=request.user.id)
for classroom in classrooms:
if Enroll.objects.filter(classroom_id=classroom.id, student_id=user_id).exists():
return True
return False | 1 |
084f917274fc24dcaaab036613b9d049 | cb3f217d0ba99f8848d98c86ec60f4bf | Wrapper for line chart used to build all-calls chart on overview page and all charts on public page | function loadLoginsLineChart() {
} | 0 |
dc81076ebc68bf776528b17475c7b7b5 | 02527a089cc5122bf4941ac880a40e17 | 使能或失能USART的DMA接口 | {
u32 data;
data = readl(MS1_CTL);
data &= ~MS1_CTL_DMAEN_MASK;
data |= (isEnable << MS1_CTL_DMAEN_BIT);
writel(data, MS1_CTL);
} | 1 |
4168523a952c46bf4b36a48327fddf5f | c7328853d0cd39b15b393449361043dd | 检查作业单下箱的终止状态, 如果全部箱均为终止状态, 则不从仓码同步数据至本地 | public void towerSyncBatchSheetState(Map<String, String> map); | 0 |
050ed63e17211c1fced4f8340d8b1179 | 09aa3a3662bc265ae651d96472920ef0 | Method that check if each instance that is created has
a unique id | class TestBaseModelClass(unittest.TestCase):
def test_multipleinstancecreation(self):
b1 = BaseModel()
self.assertEqual(type(b1.id), str)
self.assertEqual(type(b1.created_at), datetime)
self.assertEqual(type(b1.updated_at), datetime)
b2 = BaseModel()
self.assertEqual(type... | 1 |
bc971d3b44184e28812bdc2a67a9d879 | 133156761d431982559af6a8149f104f | Ask the BTMetaInfo object, get the name from the bencoded data in the .torrent file | class BTParser():
def parse_torrent(self, torrent_name):
self.data = open(torrent_name, "r").read()
self.parsed_data = []
index = 0
while index < (len(self.data) -1):
index, new_data = self.decode(index)
self.parsed_data.append(new_data)
torrent_info = sel... | 0 |
cc015fcfec323d2b9b4501a4f159e330 | 215eb128cdd84234e5723862a5b60ea5 | ueberprueft, ob die uebergebene Artikelnummer schon in einer Orderline
existiert, damit ein Artikel nicht mehrfach einzeln bestellt wird. | public class Order
public boolean contains(Product product) {
return lines.containsKey(product);
} | 1 |
73fcc95621d67c5e4952b41681a7f7a6 | 8d81791b1a19975048dcee8dc041ee31 | calculate the threshold to show lane lines based on the histogram | maxIndex = 0
c =0
ci = cj = 0
i=0
j =255
begin = True
end = 255
start = 0
try:
while end - start >20:
while j > i:
ci += hist[i]
cj += hist[j]
j -=1
... | 1 |
87bff061126c59f45825b2c89ecc311e | 59ee0b58a91b71e8ad8bf0a37bd82223 | Randomly changes the screen, font, and position of text along
with all their colors. This is primarily for the screen
scramble. | randomText.insert(0, random.choice(wordCollection[Set]))
Text.insert(0, Font.render(randomText[0], False, (255,255,255)))
for i in range(len(randomText)):
TextColor = (255,255,255)
x = randomText.count(randomText[i])
if(x == 2):
TextColor = (130,234,255)
if(x >= ... | 1 |
37494fbd289f987aa8802301ea556856 | af1b37f0ef4359717940a3d98164e1f4 | Generates the magic packet data with 6x 0xFF and 16x the MAC address | func wolMsgCreate(macAddr net.HardwareAddr) (wolMsg []byte) {
wolMsg = make([]byte, 0, 102)
wolMsg = append(wolMsg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)
for i := 0; i < 16; i++ {
wolMsg = append(wolMsg, macAddr...)
}
return wolMsg
} | 1 |
efe64cdec4bfe46fdb491574fb5f9fd6 | a3e14b24b4931ed0f397183dc50504cf | Start following a friend | namespace Yupi.Messages.Parsers
internal class PacketLibrary
internal static void FollowBuddy(GameClientMessageHandler handler)
{
handler.FollowBuddy();
} | 1 |
a55afeb9e220bcec397f618718ab50d5 | 0b18f0ca7fe940d30def83c276c85f53 | Tests serialization for generic record. | val1 = I64Type(-10000000)
buff = val1.serialize()
val2 = I64Type()
val2.deserialize(buff, 0)
assert val1.val == val2.val
val1 = I64Type(10000000)
buff = val1.serialize()
val2 = I64Type()
val2.deserialize(buff, 0)
assert val1.val == val2.val | 0 |
0f84388e0c71b74ebe40e45eb6322f98 | 080e3b5212ae0f7f02b42b4570072a06 | Retourne un nouveau Polynome où les termes adjacents de degrés identiques sont combinés | void TPolynom::Combine() {
const size_t cnt = FMembers.Count();
for( size_t i=0; i < cnt; i++ ) {
if( FMembers.IsNull(i) ) continue;
for( size_t j=i+1; j < cnt; j++ ) {
if( FMembers.IsNull(j) ) continue;
if( FMembers[i] == FMembers[j] ) {
FMembers[i].IncMult(FMembers[j].GetMult());... | 0 |
cb8e488dbd3af54c5eea954a0361af5b | 0f12f9ded75387cb52a8ddc5486c6bad | 显示销售机会来源修改页面 | public String viewSalesChanceForDevelop()
{
try
{
int salesChanceId=Integer.parseInt(ServletActionContext.getRequest().getParameter("salesChanceId"));
SalesChance salesChance=salesChanceDao.getSalesChanceById(salesChanceId);
ServletActionContext.getRequest().setAttribute("salesChance", salesChance);
L... | 0 |
20ce3f7649cf8c7ff8bc3959ef0ea1c1 | bff45ed02ec1a94e900880c1bb0d2a98 | Prepares the image display for the click and hover event.
Removes the bloat of roi button and menu button that pyqtgraph
can display. Creates pen colors for click events. | self.line, = axes.plot([0], [0], '--w', linewidth=2,
path_effects=[pe.Stroke(linewidth=3, foreground='black'), pe.Normal()])
self.x_vals = list()
self.y_vals = list()
self.img_cols = ncols
self.img_rows = nrows
self.area_mask = None
... | 0 |
12f4b2fbea1f4c418235471d4531feb3 | 92e4feacf9d289883db2f3f745d30d1d | 向平台发关排行榜数据 | sumbitPostMessageToRank(obj) {
if (CC_WECHATGAME) {
console.log('提交用户数据至排行榜:',obj);
wx.postMessage({
messageType: 2,
keyValue: "score",
score: obj.score,
unit:obj.unit,
level: obj.level,
title... | 1 |
a15b99f02aa7843d144ad74d6e6b1706 | e29802be990ce62fb1b178b15e16b2ce | 在获得焦点时,保存旧的值到标签的自定义属性oldValue中 | var oldVal = obj.getAttribute("oldValue");
var val = obj.value;
if(val != oldVal){
fieldValChanged=true;
}
} | 0 |
3d2256a9c321081244922e765b8478be | c128a7fb6cc40aaf35a0fa929d038d31 | 获取玩家职业 | class EC
public function getVocation()
{
$response = $this->client('get', 'config/getVocation');
return $response;
} | 1 |
ef40105e36b84314d6b4446ac4c0a596 | f6073aee5291d66372f6b476d82a4c86 | parse string to get source and destination id | void Graph::GetS(const std::string& s_cmd, int& src, int& dst){
std::regex re_s("s\\s(\\d+)\\s(\\d+)");
std::smatch m_s;
bool isValidS = std::regex_search(s_cmd,m_s,re_s);
if(isValidS){
src = stoi(m_s[1]);
dst = stoi(m_s[2]);
}
else throw "Error: invalid input!\n";
} | 1 |
070dfcea2931f825ec2da505a18f5dd1 | 597667fc4776ab3ca0e4f6454081aa7d | 获取摄像头名称接口 | namespace Justec.Alcohol.Pulse
public partial class FrmMain : Form
private void GetCamera()
{
try
{
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
if (videoDevices.Count == 0)
throw new ApplicationExceptio... | 1 |
8e62dc1737ea29849ba9672dac3d5898 | ff7648a4686801ec835a3de0a077530a | https://developer.mozilla.org/en-US/docs/Web/CSS/:empty | namespace svg
bool isNone (const String& s) noexcept
{
return s.equalsIgnoreCase ("none");
} | 0 |
3106eb56e1c11de8d63ff3ac14e20d51 | e78c9161b96134363d396cddb04e3650 | Remove productCompany | class CompanyProductController extends Controller
public function destroy($slug, Product $product, Request $request)
{
$company = Company::where('slug', $slug)->first();
$user = auth()->user();
if($user->hasRole('vendor') && $company !== NULL && $company->belongsToUser($user->id))
{
... | 1 |
0078b6be9c8fdb5dc67eaae7968606c7 | c8d58ca45031c93bfe9ab0728794c831 | 显示 北向资金板 -- 块历史资金流数据 | today = datetime.date.today()
params = request.query_params.dict()
out_limit = int(params.get('out_limit')) if params.get('out_limit') else 5
sql = ('select a.variety, a.index_contract, a.variety_name from chart_variety as a '
'left join day_kline as b on a.index_contract=... | 1 |
283ffac1cd3dc641b69fc1fb49007c41 | b4e481a56a98b61590924481457cd7d0 | The Rails built-in test parallelization doesn't make it easy to find the worker number.
So here we're using the number suffixed to the Postgres database name, because that is unique for each worker. | def database(worker_id, cleanup_old_docker_containers, autouse=True):
offset = get_workerid_offset(worker_id)
port = 15433 + offset
docker = subprocess.Popen(['docker',
'run',
'--rm',
'--name', F'postgres-{worker_id}',
'-p', F'{port}:5432',
'damast-pytest-testdb'
... | 1 |
0cfe63a990ffdf6ce76120651715d45c | 43c9f870269ab0bb84165fbfc6f3c15e | 泛型和Instanceof用法Demo | public class GenericTest03<E>
public static void main(String[] args) {
GenericTest03<String> g = new GenericTest03<>();
g.doSome("abc");
} | 0 |
ac73355143ed6cac78200fae636f7898 | 452830be84e9927cfd84545ffa138ec8 | Populate Services table with dummy data. | class StubController:
def add_services(self) -> None:
pass | 0 |
22670f8cde0e8cb617cbb7fa67702643 | d746c831b3f87d9dd6dbd5b3a6ba7c58 | @brief 设置QQ平台id | public class JumpContactOperation
public static void SetQQ(String qq) {
TARGET_QQ_NUM = qq;
} | 1 |
1e4f215f3092bd25f0a47a0d2bd3fda9 | 2089ab859b00179df69328ab8181f568 | Make an enumerable of type enumerableType and fill it with items. | {
var type = TypeCache.EnumerableType.MakeGenericType(typeFrom);
return (IEnumerable<object>)resolver.Resolve(type, name, dependencyOverrides, resolutionBehavior);
} | 0 |
c92163b8257555cc1ee95631e2a07f3a | 5f9344048f48cdafacacb1b2b72d2c79 | check to make sure button is low after bouncing | void push_button_check(void)
{
if(push_button == 0)
{
__delay_ms(75);
if(push_button == 0)
{
buzzer = 1;
__delay_ms(500);
buzzer = 0;
start_timer();
}
}
} | 1 |
e5afa78dc426a4707da2a596e6eff5ab | 0ec98bbd9b0a435a4757c2a6f6bf69f9 | Tests finding all records | fun findAllTest() {
val result = runBlocking { serviceService.findAll() }
Assertions.assertNotNull(result)
val size = runBlocking { serviceRepository.findAll() }.size
Assertions.assertEquals(size, result.size)
} | 1 |
599a4c6a89d7a6e023b60986d14bd028 | 208d1bde9f73e7d390bef5a9ad9bcf4b | Get specific column in a jagged array | {
int[] retArray = new int[10];
for(int i=0; i<=8; i++)
{
retArray[i]=aArray[i][aCol];
}
return retArray;
} | 1 |
d174373a3ed292c16f5d19f04c4cf5c8 | 9ba96035cf5d598055acc136e08d754d | method to add cast to movie | def cast_list(title)
Movie.select("actors.id, actors.name")
.joins(:actors)
.order("castings.ord")
.where("movies.title = ?", title).to_a
end | 0 |
c401842a35943c7f7c88de93cae6cd51 | ce5cbb64a415726af3eab9946f7c27c0 | Check if the Instance has any defined dependencies | {
return this._instanceNames != null && this._instanceNames.Count > 0;
} | 0 |
5d2b600e39f92f2061c0f9ffe78e3396 | 1d0373618e355efddd53ced88e2dcf7d | Test for the create ride without origin. | class FlaskTestCase(unittest.TestCase):
# Test if index page is working
def test_E2_given_ride(self):
tester = app.test_client(self)
response = requests.get(ride_url+'/api/v1/rides/{rideId}'.format(rideId=999))
self.assertEqual(response.status_code,204) | 0 |
7268f15b5106befcd690bd4612363168 | 613d9d3ff9a2956e785571e13f12b516 | Génère une jumpbox. | void PBDlg::OnBnClickedButtonBuildJump()
{
patchbuilder.BuildJump();
} | 0 |
4aea6c977a2d91fde29996463118bf9f | 6e3bfd983431115f89af957ce54f96cc | Returns true if column selection is allowed, otherwise false. The default
is false. | public class GDTableColumn implements TableColumnModel,
PropertyChangeListener, ListSelectionListener, Serializable
public boolean getColumnSelectionAllowed() {
return columnSelectionAllowed;
} | 1 |
0806190324c98e3dc76720b9add9d14e | 42d3d8066c3aed8ba1f0df282da4fb00 | 异步删除多余旧文件 | {
if (deletelists.length > 0)
{
this.deleteFile(<string>deletelists.shift(), (err) =>
{
if (err)
{
callback && callback(err);
return;
}
... | 1 |
c94f09ac83d941a1f7bb944e82f6dcac | 2d80f582ec3e88e42d53582551ff007a | @brief Prints the Processor Information to the Serial Output. | auto *platformInfo = new PlatformInfo();
printf(BLURB, platformInfo->appVersion.c_str(), platformInfo->apiLevel.c_str(),
platformInfo->rackVersion.c_str(), platformInfo->os.c_str());
} | 0 |
f791203aeac8008652b0b8eaadf5dbbb | 478ed7ac9c7033a931a5093cdd1bf7a0 | Calculate a correlation, with bootstrapped confidence intervals. | func=spearmanr, absolute=False, return_estimates=False):
r_ab, _ = func(vec_a, vec_b)
r_ac, _ = func(vec_a, vec_c)
if absolute:
r_ab = np.abs(r_ab)
r_ac = np.abs(r_ac)
r_diff = r_ab - r_ac
boot_a, boot_b, boot_c = sample_bootstrap(n_samples, vec_a, vec_b, vec_c)
... | 1 |
a6beee71c7ab8d17fac85f7516288a28 | 1be0a2bfc9af4109e5927eda5b105d01 | Test whether a note is syncopated. [Not yet functional] | {
const float ONE_AND_A_HALF_PERCENT = 1.015f;
bool isMatching = false;
if (userNote < songNote * ONE_AND_A_HALF_PERCENT
&& userNote > songNote / ONE_AND_A_HALF_PERCENT)
isMatching = true;
return isMatching;
} | 0 |
d4e7a4b5f8689a6e501c794c7d1ce323 | 87749fc67c1f7eaa6453ea6dc00237f0 | retorna link da página especificada | String getUrlPage(String idPage); | 1 |
402ed2552e834bfe7866e81f30566fd5 | 1c065a5acf3f6ab8dc54c394a16c9016 | 判断node1和node2是否为同一个集合 | class UnionFind(object):
def is_connect(self, node1, node2):
return self.root(node1) == self.root(node2) | 1 |
31dfe7d544a5001c7e7e9931d5ce2b67 | 473df6366aba2e1e630b370183a16bea | Count the members in a sorted set within the given lexicographical range. | class RedisZSet(RedisObject):
def zcount(self, min_score, max_score):
return self.client.zcount(self.key, min_score, max_score) | 0 |
2cb01132d444016c1df58db8ccff5bc5 | c8bf7fc34ee6a891c318cc179c75b04d | inicia la conexion a la base de datos activando las restricciones de foreign keys | void DB::prepare()
{
QSqlQuery q;
q.exec("pragma foreign_keys = ON");
} | 1 |
3380648635dba8d7dec5439ac932cdd1 | 7fd012723720d3b064ca96a3296963f0 | Direct3Dで自動適用されるビューポート行列を取得する | namespace DxLib
extern MATRIX NS_GetCameraAPIViewportMatrix( void )
{
return GBASE.Direct3DViewportMatrix ;
} | 1 |
df1df707239e9b566f1b35d9246e9dbb | b2cc61f5c155141b9b8505b5a485234f | Test case for patch_extensions_v1beta1_namespaced_network_policy | class ExtensionsV1beta1ApiTest extends \PHPUnit_Framework_TestCase
public function testCreateNamespacedNetworkPolicy()
{
} | 0 |
5300ac41335357512093e142302b5bcd | 7326fb5e500c4902ef4e6aeb8a890816 | Gets the URI-snippet without locale. | public function getUniqueSubUrl()
{
return $this->getUniqueSubUrlIn(getLocale());
} | 0 |
b35f11160def1aeb1d869cd94ff74fc8 | 6df40ec99f4e315d731bce3547601432 | Opens a new DRM session. A session ID is returned. | Validation.instanceOf(sessionSpecification, SessionSpecification, 'sessionSpecification');
const request = new RequestBuilder()
.withPemString(this.pem)
.withBaseUrl(this.apiUrl)
.withEndpoint('/sessions')
.withQueryParam('sdkId', this.sdkId)
.withPost()
.withPayload(new Payl... | 1 |
c75aa62225894099807296d0538f947e | 749010e4e52475335943eec98f5c0611 | Returns the meta object for class '{@link action_artifact.CreateParticipant <em>Create Participant</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getCreateArtifactAsset(); | 0 |
6afcf2b64eb86e4d13ab9ffd1fdced00 | 20990143f40343c213487d0d515c2c3d | 异步获取章列表。 | async list({state, commit}, params) {
return chapter.list(params);
} | 1 |
d59f24e25c9072975ca4da7285601d20 | dbfc12e55a7652be24606aaf01ff8c03 | Check if user has one or all specified roles. | function isInAnyRole(user, roles) {
roles = _.union(roles, _.map(roles, getRoleName));
return !!_.intersection(roles || [], user.roles).length;
} | 1 |
39d8f82fc005796f7e3b038b784422cc | 2809aa81f8b1d9273746cd62d49946ce | Sets the ingredients card. | if (notes != null) {
this.notes = notes;
this.notes.setRecipe(this);
}
return this;
} | 0 |
229c14256039a7eb4b35c705329bdd10 | f61cfd13009ca09e43e0701737165b59 | Genera un camino desde la posicion actual hasta las coordenadas indicadas. | pasoX = [0]
pasoY = [0]
for i in range(cantidad):
x, y = darPaso()
nX = pasoX[i]+x
nY = pasoY[i]+y
pasoX.append(nX)
pasoY.append(nY)
plt.plot(pasoX, pasoY)
plt.show() | 0 |
995bc834f8af3c0585982049ba3d72b5 | 48e2eb66fdeace17fd21ea7ff511c212 | 是否是真人 | export class GodDmMyTeamVo
isAllRealPerson(): boolean {
return this._memberList.every((vo) => {
return vo.isExist() && !vo.isRobot();
});
} | 1 |
078e72122ef6eb1d4da01612c7be6a82 | ad6e1fb7b6e1fa9de47ba0813316be12 | Define the structure of a SPM root hierarchy | return {
'tag' : None,
'level' : 0,
'parent' : None,
'content' : [],
'content_map': {},
'children' : []
} | 1 |
ca3982150a05c4eaf4addfa8cf5b9800 | 09ae5caea907c96b31e358cfe1b2e7d2 | Returns HTML representation of the assets collection required to be included at HTML body top position. | {
if (!$this->isAssetsDisabled) {
$assetsHtml = [];
foreach ($this->assets['css'] as $cssFile) {
$assetsHtml[] = '<link rel="stylesheet" type="text/css" href="' . $cssFile . '">';
$this->debugLog('Assets: ' . $cssFile);
}
foreac... | 1 |
343b0ef108415ee576e3a629df768922 | 03781284eaca2d7eedc6c3b4ff3fc027 | Update the sprites in the select pet buttons | public class CharacterDetail : MonoBehaviour
public void BackButtonTap () {
for (int i = 0; i < SaveData.GetMaxSelectPetCount(); i++) {
GameObject petListPet = GameObject.Find ("SelectPetPanel").transform.FindChild ("PetButton" + i).gameObject;
if (i < SaveData.GetSelPetJoinAllPetDataList().Count) {
Sprite ... | 1 |
d2e6260d381515de963c76200ca83c5f | afcb767e5090b94fa1ab870a741a4a66 | 测试:数组作为形参,数组的大小是否要定义 | void
tt_array_size(){
int array[100];
int n = 0;
array[n++] = 3;
array[n++] = 6;
array[n++] = 9;
printf("n===%d",n);
} | 0 |
ba8386780173c45fe8c145dc95d7fa0d | 423feaebe25c7da7cb7729d109ab2404 | ++++++++++++++++++++++ Remove Outcome Event +++++++++++++++++++++++++ | class OutcomeController extends Controller
public function destroy($Outcome)
{
Outcome::find($Outcome)->delete();
} | 1 |
3160248410efeefe9b750f42c9b40b96 | 2ab3f264c8e635e7b76b9a3c9b4b3dcd | 初始化一个pycurl对象,
尽管urllib2也支持 cookie 但是在登录cas系统时总是失败,并且没有搞清楚失败的原因。
这里采用pycurl主要是因为pycurl设置了cookie后,可以正常登录Cas系统 | self.c.reset()
self.buffer = BytesIO()
self.c.setopt(self.c.WRITEDATA, self.buffer)
self.c.setopt(self.c.HEADERFUNCTION, self.headerFunction)
headers = [ "Accept: application/json" ]
self.c.setopt(pycurl.HTTPHEADER, headers)
self.c.setopt(pycurl.SSL_VERIFYPEER, 0)... | 1 |
b9f2fc51d50ae586831d77bc3470da33 | bb371905640e876b1d5a3f99eb2e3266 | Совпадает ли *примерно* точка с другой? — для использования в тестах | namespace CDO.Model.Modeler.Global
public static class GlobalProperties
public static bool IsAlmostEqualTo(this Point point1, Point point2, double tolerance)
{
return point1.Distance(point2) < tolerance;
} | 1 |
29265d00468265471f3b96a3f5e2efbd | 7f641e9d49e22c670f7e09c6ff9f2dff | Mutates polygon by swapping two verices. | mut_points = sample(range(len(individual)), 2)
i = individual
i[mut_points[0]], i[mut_points[1]] = i[mut_points[1]], i[mut_points[0]]
return i | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.