query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1c0994546d48e35f9588856b3851fd70 | b074118c172b5a27a645f7992eb76ebd | this method is used for selecting elite individuals from the population according to their fitness level. | def selectParent(fitnessMatrix,populationSize):
fitnessMatrix=fitnessMatrix.sort_values(by='Rank')
fittestParentPopulation=pd.DataFrame
fittestParentPopulation=fitnessMatrix.iloc[:populationSize,:]
return fittestParentPopulation | 1 |
d9aa6470c1b8289de815d35aa34a7c27 | 489c66cbfa6d46756e7609964faac2d1 | Testa criação de transferencias em lote sem erros | {
$response = $this->actingAs($this->user, 'api')->json('POST', '/api/v1/plus-pay/transfer', ['user' => $this->target_user->id, 'amount' => 2121]);
$response->assertStatus(201);
} | 0 |
aec7072e05b3d56154a5fff829b09450 | 86476d657e8d7fd2a2a77c4c1baceeb5 | Register a new cinema object and return if success | class TestOfCinemas extends UnitTestCase
function testAddCinemas()
{
$url = $this->api_url."/cinemas";
$fields = array(
'name' => 'cinema2',
'location' => 'london',
'films' => 23
);
echo "<h1>TEST ADD CINEMAS</h1>";
echo "Params: <br/>";
echo "name => cinemas2 <br/>";
... | 1 |
0dd070afcf1a6444514bae30f8ddfa3b | 7e3a7039e8cb5a3baf77172b47b74aea | 查询有图的评价数量 | @Service("hotelScoreService")
@Transactional
public class HotelScoreServiceImpl implements HotelScoreService
public Integer getCommentCountByMap(Map<String, Object> param) throws Exception {
Integer store = hotelCommentDao.findCommentCount(param);
return store;
} | 0 |
d182de380111f656d6ce4d91c7bc6cc1 | 2ffe3c8d6a16de88d3f5caa2dcc1809a | 查询纳管数据库列表 | function databaseList (params, callback, err) {
dataLink.dataLinkPostJson(databaseListInterface, params, callback, err)
} | 1 |
b5a15eaf5ad2daf9e887b1e8009746d8 | baaa20e5ecf27632b36dd1e302cb8508 | Force all existing browsers to close in case any haven't been deleted | def close_all_browsers
@web_browser.close_all_browsers
end | 1 |
49b028fd30dc58ae5fd63da943d62d3c | 60bdae741d7e21f10b52af4098beba5d | Contrôle si l'extern_id est correct | class MessageTable extends DataManager
public static function validateExternalId(): array
{
return [
new LengthValidator(null, 128),
];
} | 1 |
fc6cb668be61da70daf59972f692a7b1 | 4140d40fad30f9d832c3a7cac8d9eb8f | диалог создания новой темы | {
if (! $this->diafan->_route->cat)
{
Custom::inc('includes/404.php');
}
$this->result["name"] = '';
$this->result["action"] = 'savenew';
$this->result["id"] = '';
$this->result["cat_id"] = $this->diafan->_route->cat;
$this->result["hash"] = $this->diafan->_users->get_hash();
$this->res... | 1 |
df6eba021acabd9306c9202ef53b48ab | cad2a73b0266a298e055afe803af6395 | 保存技能数据 | {
string[] titles = new string[] { "ID", "技能名字", "技能图标", "技能类型(Global查询)", "技能控制脚本", "是否是被动技能", "技能特效路径", "如果是被动技能的激活状态", "技能目标", "技能等级", "技能消耗使用者的属性值", "技能蓄力回合数", "技能对于除了伤害的属性值变化", "技能造成的攻击伤害", "技能暴击几率", "技能的buff或者debuff", "技能描述" };
string result = "";
for (int i = 0; i < ti... | 1 |
8d03fd34ae5b9da5f43b780f03fec3c0 | a41e3c76dbb7632f3e48d3706efbdc94 | Get penalty_amount. | class Gear
public function getCheckPenalty()
{
return $this->check_penalty;
} | 0 |
65d10f5b44378edc4d7c3199768e6bf6 | b0f64b1eedf7f918bb60be73c2792878 | Returns path of all datasets (commonly used shared ones). | datasets = list()
top = self._backend.get_location()
for root, dirs, files in os.walk(top):
if ((persistence.pddatafile in files) or
(persistence.npdatafile in files) or
(persistence.pydatafile in files)):
datasets.append(os.pat... | 1 |
4cb99ffdfd3df01fccb47d3eb7a72aa3 | 4749fae2d39dde1e0bf1e90022bdf560 | function to smooth the map with iterations | {
int num_iter = 0;
int done = 0;
float diff;
float temp;
while(!done){
printf("Iteration %d; ", num_iter);
diff = 0;
for(int i = 1; i < (my_grid->dimension-1); i++){
for(int j = 1; j < (my_grid->dimension-1); j++){
temp = my_grid->element[i * my_grid->dimension + j];
my_grid->element[i * my_g... | 1 |
94a5bc4333688015bf06c12b11bc7718 | 1fa3f86caeb647c51835b1603d5f4ad4 | Switches the hard ambient light conditions | public class PlayerController : MonoBehaviour
private void ChangeLightSource()
{
this.sun.enabled = !this.sun.enabled;
this.centralLamp.enabled = !this.centralLamp.enabled;
} | 1 |
b51cd96262f31d896b4d8b7e7220935d | 72cbe00d891d7376b3d0338b0e1ad330 | 根据年、月、日、时生成日期 | Calendar cal = Calendar.getInstance();
cal.set(year, month-1, day, hour, minute, second);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
} | 1 |
2e5f9f863e2576717e117e60c3e27211 | d80e2dcf7d0109ace5faf889d596510e | Generate a section for AVL | $titleHtml = "<span>" . substr($section->title, 0, strpos($section->title, " ")) . "<br/></span>" . substr($section->title, (strpos($section->title, " ") + 1));
$output = <<<EOD
<div id="sidebar-{$section->class_suffix}" class="sidebar-nav-section">
<a href="{$section->section_link}" class="sidebar-... | 0 |
836e60fbbf1888fb315345f6362e9a7f | ba8e896490930f88829f31100aa2d55a | determines the Yahoo Finance ticker symbol based on currency pair | symbol = symbol.toLowerCase();
const postData = querystring.stringify({
'search_text': symbol,
'term': symbol,
'country_id': '5',
'tab_id': 'All',
});
const req = https.request({
host: 'www.investing.com',
path: '/search/service/search',
method: 'post',
headers: {
... | 0 |
9a63eccacf94099f79f4cbc317d8cfdd | 82fea80a09d739df524e54ed73f5be57 | Resolves the foreign relation for a given table/field/uid pair and returns the table/uid pair. | $fieldName = $this->convertPropertyNameToFieldName($propertyName);
$foreignDataType = $this->getTcaFieldService($fieldName)->relationDataType();
$foreignRepository = \TYPO3\CMS\Vidi\ContentRepositoryFactory::getInstance($foreignDataType);
if ($this->getTcaFieldService($fieldName)->hasRelationWithCommaSeparatedV... | 1 |
84d77efcb9ed495562057204c4fd88d2 | 7c62e2b3e31a990497ce799e8407f7b2 | Same as for getAcute, but with stroke | vre_result vre_stroke_close ( vre_stroke *pStroke )
{
vre_result vres;
vre_fix16 width;
vre_assert ( pStroke->numPoints > 1 );
width = ( pStroke->width + 1 ) >> 1;
vres = vre_stroke_add_line ( pStroke, pStroke->firstPoint );
VRE_RETURN_IF_ERR ( vres );
{
vres = bevelJoint ( &pStroke-... | 0 |
fd6d28a1610f2876d1ca8c9ced6540b8 | 116272a9804f6e5265d2f7a4fa5e9927 | 验证作品详情页里关注按钮功能是否有效 | class TestSmallVideo:
def test_sale_detail_focus(self):
msg = self.main.sale_detail_focus()
assert msg == "已关注" | 1 |
fd895434257a1c8b26287b9dd0817955 | 821cda54c2150aa41ae10f5dbe23b391 | 把LocalDate类型的日志转换成Date类型的日期 | if (localDateTime != null) {
ZoneId zone = ZoneId.systemDefault();
Instant instant = localDateTime.atZone(zone).toInstant();
return Date.from(instant);
}
return null;
} | 0 |
207fc2ae4b8e65691e328c3de9a53f4d | 2adb62b34d66f1673ca8313a7a178d26 | Returns the value of the '<em><b>Values</b></em>' containment reference list.
The list contents are of type {@link org.ow2.mindEd.itf.editor.textual.fractalIDL.AnnotationValue}.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Values</em>' containment reference list isn't clear,
there really should be more of a d... | EList<V> getValues(); | 1 |
9569175be089717bcb497262c56224d2 | 20fcaa00f4ff5189acaae477744f47b6 | <https://github.com/EOSIO/eosio.contracts/blob/v1.9.0-rc3/contracts/eosio.system/src/eosio.system.cpp#L230-L272> | globaltable gtable(get_self(), get_self());
statstable gstore(get_self(), get_self());
statstable store(get_self(), pair);
auto gitr = gtable.begin();
auto itr = store.find(owner);
if (itr != store.end()) {
uint64_t ctime = current_time();
auto last = store.get(owner);
eosio_as... | 1 |
2090d52a73cefb328b4065fc8529f616 | 2c0d9e99926d0905a3c767ad5d2ad81c | Creates and returns a gateway for Page objects | class FeatureContext extends BehatFormatterContext implements PageObjectAware
protected function getPage($pageObjectClass)
{
return $this->pageObjectFactory->create($pageObjectClass);
} | 1 |
6bf65ef81c0e1ddd29323763f98cf455 | 7f55a51df06f0c331cbb66b0311c2551 | 初次登录,获取Cookie | {
string account = "ourstoryzj";
string pwd = "zhangjian";
string url = "http://www.10000kb.cn/login/CheckLogin?action=user&name=" + account + "&pwd=" + pwd;
System.Net.CookieContainer cookie = new System.Net.CookieContainer();
string res = Common.WebS... | 1 |
3eda4c2736b7b06a06d375ecb85094b8 | e09694486069a699b3c13d9d3529e747 | 动态SQL更新方式二 | public void test2() throws IOException {
SqlSessionFactory sqlSessionFactory = getSqlSessionFactory();
SqlSession sqlSession = sqlSessionFactory.openSession();
try{
EmployeeMapperDynamicSQL mapper = sqlSession.getMapper(EmployeeMapperDynamicSQL.class);
Employee employ... | 1 |
60a9802ab416c2181ddcea8650f22f82 | ef4feb8cd4e44cad7c6db2551d7e8a9c | 合并计数字典 | await take_data()
dict_all = {}
for i in range(q_dict.qsize()):
count_dict = dict(q_dict.get())
dict_all = Counter(dict_all) + Counter(count_dict)
with open('D:/data/cbcp_20191011/dict_all.txt', 'w', encoding='gb18030', newline='') as file:
file.write(json.dumps(dict(dict_all), e... | 1 |
4ed6e60fa09339b00a2bfbd975f30da4 | bb746a3ffbe313149cb81f0c2338e67d | 判断一个图像是否大多数都是某种相近的颜色 | {
isDominantColorImage = true;
List<int> colorPixelRList = new List<int>();
List<int> colorPixelGList = new List<int>();
List<int> colorPixelBList = new List<int>();
Color clr;
for (int y = 0; y < bmp.Height; y++)
{
... | 1 |
e016add3c4c072512833c9eb9af56351 | 1be0aa6c0e62904e1bc2cd1f35bd1855 | 入力者CDをレコードに格納します。 | public class JuchuTuminiDenpyoHakoItemRecord extends KitRecord
public void setKaisyaCd(String kaisyaCd) {
put("KAISYA_CD", kaisyaCd);
} | 0 |
3ef7a4eade4e5fa9f05ca8b04ec57ef7 | 3ee26a5efbbb1e3613adde28c1cefcfa | Saves an employer to the database. | def signup_employer(request):
serializer = serializers.SignupEmployerSerializer(data=request.data, context={'request': request})
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(data=serializer.data) | 1 |
b6ee5bc090a20581a57e01232d4c20cb | 3232864aabce34be62cbac0ef3610cbd | Show the payment request UI. | return new Promise(resolve => {
var _a;
if (!((_a = ApplePayPlugin.get()) === null || _a === void 0 ? void 0 : _a.installed)) {
return resolve(CdvPurchase.storeError(CdvPurchase.ErrorCode.SETUP, 'cordova-plugin-purchase-brai... | 1 |
a7f411348d06282d4f1367a737cc5816 | 451cd35ef6ddfe286199b8ea7525add2 | This method is used to create the lottery tickets | while (true) {
try {
MySet<Integer> bet = getBet();
LotterySystem.Ticket ticket = new LotterySystem.Ticket(player.getName(), bet);
lotterySystem.buyTicket(ticket);
return ticket;
} catch (WrongCountOfNumbersException | NotVa... | 1 |
4fc357ad36d45157bcbd7e0885366ad1 | 5d2e67d4dfc6ff7899f36e69ff5f8df7 | test the nuclei are correctly identified for this network | def test_FRCN_color():
run_network(FCRN_A, 3) | 0 |
a58ea32372ceb3efbe4f95f6318de03b | a4877e90b76d982936d6dc666eec772c | Create a color giving ints between 0-255 as the components
and convert to double to use in struct color | struct colour make_colour(int red, int green, int blue){
struct colour new_colour = {red, green, blue};
return new_colour;
} | 0 |
03f8f385d867cf3b49827a85bb632e7c | 2e805f7695f65b18bb94225df3fee677 | Saves the current statistsics in an `HDF5File` object. | class CSSEData:
def save_hist_data(self, output_path):
self.hist_df.to_hdf(f"{output_path}/{self.HIST_FILE_NAME}",
"df",
mode="w",
format="table",
data_columns=True) | 1 |
f6a2ea2779f098f77ea6e6ac46676775 | e53208869f826cdba95bd6ea9c1df097 | 根据微信订单号判断操作方式 | switch($_GET['order_type']){
case 'group':
$now_order = D('Group_order')->get_order_by_id($this->user_session['uid'],intval($_GET['order_id']));
break;
case 'meal':
$now_order = D('Meal_order')->get_order_by_id($this->user_session['uid'],intval($_GET['order_id']));
break;
case 'recharge':
... | 0 |
e42b42e50169024d8b6b278855373eaf | cc7d80f74b128c6162eecb92641befcc | Detiene la ejecucion del simulador | namespace ProjectLibrary
void StopSimulator(); | 1 |
b1ab2b4968a357d492f20474f935aa1c | 89ba9ad69cea21b3e5b317ffdfa31d24 | Vérifie si un sequencer pour le joueur existe déjà | local seq = SequenceManager.GetInstance(seqName);
if seq == nil then
return false;
end
return true;
end | 1 |
c166f0f532e9ed90955eaef869c55c53 | eea785c7df4e70fb56008ea2f6947b3c | Plot calibration curve - given pass data with predictions produce plot to show how
well calibrated the model that made those predictions is | plt.figure(dpi=80)
Y_pred=pd.Series(self.model.predict(X_test),index=Y_test.index)
plt.xlabel('Time')
plt.ylabel('Measured subtract predicted')
plt.plot(Y_test.index,[0 for i in range(len(Y_test))],color='red')
plt.scatter(Y_test.index,(Y_pred-Y_test),s=1,ls='-',color = '... | 0 |
023565204700ffeee6720ec7a8083e78 | ac6cd81d57fef1bf27a3895483764848 | This method is used for displaying the Package Code report. | {
ViewBag.OrderID = OrderID;
PrintBoxModel print = new PrintBoxModel();
DataSet ds = new OrderManagementService().ExportBoxDetails(id.ToString());
DataTable dt = ds.Tables[0];
StringBuilder sb = new StringBuilder();
string OrderNumber = str... | 1 |
e38eacde458f93b7d82094f7b95fcd20 | 2bc090c587635daf6997c93a97400ce3 | Expands the top status bar. | void ScreenTool::expandNotifactionFull()
{
commondAdbNoResults("cmd statusbar expand-settings");
delayMS(500);
} | 1 |
4e0f5389cf7f53d462ff28dc9d8f4be4 | 92c2a01a2da0b09de3d39da914e25447 | 定位第一个单选框 | for (SelectObj<T> obj : this) {
if (obj.isChecked) {
return obj;
}
}
return null;
} | 1 |
b48b68dc568a56fa2974d380272ee2f0 | 0f0150ab638e50325dc91165af08f8c9 | The classifier neural network. | class MnistRecognizer():
def classifier(self):
images = paddle.layer.data(name='x', type=paddle.data_type.dense_vector(784))
out = self.convolutional_neural_network(images)
return out | 1 |
3277ac8ec7a5e2af7f85d197c1c553af | 9392c47910ec6c53cc20892f9df335f5 | 异步上传文件到ipfs | class App extends Component
onSubmit(event) {
event.preventDefault();
ipfs.files.add(this.state.buffer, (err, result) => {
if (err) {
console.error(err);
return
}
this.setState({"ipfsHash": result[0].hash})
console.log("ipfsHash", this.state.ipfsHash);
const {contra... | 1 |
c92c45d34ce94223983c27eaafbc890b | d42dfcfef3280a6e23caa3dda0bf3a7b | copy dict (a shallow copy) | def dict_copy(d):
return d.copy() | 1 |
93492a8eb011cc53f133839da562c92f | b1b8dbfba0bbd33ec6a35190f2030abb | Starting method of program. | namespace Assignment2
class FloatingNumbersWhileAdd
public void Start()
{
WriteProgramInfo();
ReadInputAndSumNumbers();
ShowResults();
} | 1 |
8ad4316518894d722a93994bc935ea64 | d229daa22aec35427f41142d2669bc33 | Removes a user from the lockout list | {
$sql = sprintf(
"DELETE FROM radcheck
WHERE Username=%s
AND Attribute=%s",
$this->db->quote($username),
$this->db->quote('Auth-Type')
);
$result = $this->db->queryOne($sql);
if (PEAR... | 1 |
ba31ea0353505b0e36f58f3380ed7722 | b0cace8254aac08f1a884b191f7b58ce | 获取可选的素材类型列表 | namespace ServiceCenter.Client.Mvc.Areas.QAM.Models
public class CheckSettingViewModel
public IEnumerable<SelectListItem> GetMaterialTypeList()
{
IList<MaterialType> lst = new List<MaterialType>();
using (MaterialTypeServiceClient client = new MaterialTypeServiceClient())
... | 1 |
5ab7884e6bc934469b511a5e972ad984 | 7ab953b2f92c889820a2b54bd9ffdffe | This is overridden to set the inserted item's parent to this
collection. | namespace Kiwi.ComponentFactory.Toolkit
[ToolboxItem(false)]
[ToolboxBitmap(typeof(KiwiBreadCrumbItem), "ToolboxBitmaps.KiwiBreadCrumbItem.bmp")]
[DesignTimeVisible(false)]
[Designer("Kiwi.ComponentFactory.Toolkit.KiwiBreadCrumbItemDesigner, Kiwi.ComponentFactory.Toolkit, Version=1.0.0.0, Culture=neu... | 0 |
6bea982c71631823e7f51e66586de13f | fbe7e81c4b7fd82963cbabd7f7e5bc84 | action displayMainWorkSelector | if (idx === undefined) idx = 0;
var tw = [];
switch (idx) {
case 0:
tw.push({
chk: jQuery("#srcPanel :input"),
script: function() {
var lc = require('local');
return lc.inputCheckS... | 0 |
f1e32e053c9608efb4ef55f8a5d7d274 | 11a4aade16768471bb02e8e8f21c2ace | validates the submitted form | function validForm()
{
global $f3;
$isValid = true;
if (!validName($f3->get('name')))
{
$isValid = false;
$f3->set("errors['name']", "Please enter your name");
}
if (!validMidtermOptions($f3->get('mid')))
{
$isValid = false;
$f3->set("errors['mid']", "Invalid ... | 1 |
5fa125886350dddad53093a9636a0821 | 848eed28c27f36ee04a56638e75351dc | Sets the test xpath. | public class SeleniumParameters
public void setTestPath(String testPath) {
this.testPath = testPath;
} | 0 |
86cc48dbd985e1792cd1a9feb3d44853 | 1108b3134309d60341c0d114b58fecd6 | Обновление слайдера сроков | public class LabItem : MonoBehaviour
private void UpdateSlider()
{
countDownSlider.value = (float)countDown.GetComponentInChildren<CountDown>().GetTheRestOfTime() / (float)labDic.Time;
} | 1 |
253b5cde229dffaf351b08b0b000fd3c | 2be62f4a7756178f3d7e61761fe926dd | Get minimum version of openshift we require | verstring = self._get_value("openshift_required_version",
GENERAL_CONFIGURATION_SECTION,
"openshift_required_version")
if verstring:
return parse_version(verstring)
return None | 1 |
11f370e52a53faa5b4b12b53b11a9ba0 | d73786c2c3a0ac383782d560a7119e10 | GetMonitorData接口的同步版本,获取云产品的监控数据。传入产品的命名空间、对象维度描述和监控指标即可获得相应的监控数据。
接口调用频率限制为:20次/秒,1200次/分钟。
若您需要调用的指标、对象较多,可能存在因限频出现拉取失败的情况,建议尽量将请求按时间维度均摊。 | ShowMonitoringDataRequest request) {
return new AsyncInvoker<ShowMonitoringDataRequest, ShowMonitoringDataResponse>(request,
DrsMeta.showMonitoringData, hcClient);
} | 0 |
50e7c189b697bf2784474597e10b87e9 | 5f77ccfe7562ead4e91af1d09ffc2341 | 将单条数据尾插法插入链表中 | {
linklist head=NULL,tail=NULL,s=NULL;
if(plink == NULL)
{
printf("link description error!\n");
return -1;
}
head = plink->phead;
s = (linklist)malloc(sizeof(LNode));
memset(s,0,sizeof(LNode));
s->data=data;
s->next = NULL;
if(head == NULL)
{
plink->phead = s;
}
else
{
while(head!=NULL)
{
ta... | 1 |
27bda7d37d713c57398416dc309a1676 | fcbd62af5b3fe0439076ebce436d9136 | Fetch most popular words from the RSS feed. | d = feedparser.parse(url)
wc = {}
for e in d.entries:
try: summary = e.summary
except: summary = e.discription
words = getWords(e.title + ' ' + summary)
for word in words:
try: wc[word] += 1
except: wc.setdefault(word,1)
try: title = d.feed.title
... | 1 |
3dc883ea0f6c874d0189703595053615 | 524791fcba824b20f0530527dba86b44 | Gets the atomic radius of this atom | r_C = .70
r_H = .53
r_N = .65
r_O = .60
r_S = .100
r_other = 1.80
if atom.element != '':
element = atom.element
else:
element = ' ' + atom.atomName.lstrip()[0]
if element == ' C': return r_C
elif element == ' H': return r_H
elif element == ' N': return r_N
... | 1 |
a6c9cad5fe3b048e5f7890070565d8ec | 9aa7d474d3de0a6bbf62b07d9fec869f | Test function which compresses an image using the naive RGB scheme, decompresses
it and emits the test results into a CSV file for further analysis. | {
A2Methods_T methods = uarray2_methods_plain;
struct Pnm_ppm packed_image = read_compressed_image(input, methods);
Pnm_ppm packed_pnm = &packed_image;
A2Methods_UArray2 unpacked_image = unpack_image(packed_pnm, methods);
print_decompressed_image(packed_pnm, unpacked_image, methods);... | 0 |
4f61e3e68e3d84e6e63e16a38c8f228e | c2c288e18fd3d8ff656cb0e1f09e4e05 | Moves an item up one in the list box. | namespace WebScraper
public class ListBoxEx : ListBox
public bool MoveUp()
{
int index = SelectedIndex;
if (index > 0)
{
object temp = Items[index];
Items[index] = Items[index - 1];
Items[index - 1] = temp;
S... | 1 |
48de83d47af9a0d9d0387eb14e07b4f3 | 726e913221691a33f7788d95aca71ae6 | 指定したコントローラに振動とバックライトの色を送る | fun setControllerRumble(rumble: Double) {
controller.setRumble(GenericHID.RumbleType.kLeftRumble, rumble)
controller.setRumble(GenericHID.RumbleType.kRightRumble, rumble)
} | 0 |
2013309c1342a53a03a3430948ea92fd | 1a9c39223f7b3a5ae03ddd1ad337694d | Perform drive SW/HW init | {
struct mv_ddr_topology_map *tm = mv_ddr_topology_map_get();
struct if_params *iface_params = &(tm->interface_params[0]);
#ifdef CONFIG_MC6P
mv_ddr_mc6_dfi_config(mc6_base);
#endif
reg_bit_clrset(mc6_base + MC6_USER_CMD0_REG,
USER_CMD0_CH0_VAL << USER_CMD0_CH0_OFFS |
(iface_params->as_bus_params[... | 1 |
2a05b81a3aa68b9496996fee5fb1eb63 | 7290ccb11f56155ad06cf605aabf2918 | 更新srv_room_sup | {
$where = "rid='$rid'";
$this->update(T_ROOM, "title", "'$t'", $where);
$this->update(T_ROOM, "img", "'$i'", $where);
$this->update(T_ROOM, "other_option", "'$o'", $where);
} | 0 |
db2ae419332e9b83422238dc924f4737 | 96ce972b66898e970c34f81b6cc7e089 | Handles the SelectedIndexChanged event of the ngOptionNetComboBox control. | {
try
{
if (this.EnteredByComboBox.SelectedValue == null)
{
this.EnteredByComboBox.SelectedIndex = 0;
}
}
catch (Exception ex)
{
ExceptionManager.ManageException(ex, Ex... | 0 |
e9f7dde113afbc44ee8797dc42b2a69b | 532371d2b295b8da3d59217134ddf300 | given two arrays/lists A and B return an array whether the element of A is in B or not
future work: make a C version of this function | resultSet = []
del listOfElementsA[0]
del listOfElementsB[0]
for i in listOfElementsB:
r = binary_search(listOfElementsA, i)
resultSet.append(r)
return resultSet | 0 |
54d4e58010b9cc803ecdc4e6755802f0 | ebe1ddd57d65e928741c08cfb7b1f5a7 | Een check uitvoeren of een user een geblokkeerde status heeft | class UserLockingModel extends Base
public function isLocked($username)
{
return $this->db->table(UserModel::TABLE)
->eq('username', $username)
->neq('lock_expiration_date', 0)
->gte('lock_expiration_date', time())
->exists();
} | 1 |
44463e42c68e30d4d1a798127e8f1847 | acf85f3000cb6b2f532e6991c142b194 | Function to get all the prediction in the database | engine = create_engine('sqlite:///predictions.db', echo=True)
connection = engine.connect()
metadata = MetaData()
predictions = Table('predictions', metadata, autoload=True, autoload_with=engine)
query = "SELECT * FROM predictions"
ResultProxy = connection.execute(query)
... | 1 |
fe0ee5eefc72f1a34ae8a5f723b1c4cb | 590f8092e9bc44c6f63dfc0af75280cc | Determines whether the batch is the default batch or not | namespace Geres.Engine.DefaultPaaS
internal class JobController : IJobController
private bool IsSharedQueue(string batchId)
{
bool result = false;
if (batchId.Equals(GlobalConstants.DEFAULT_BATCH_ID))
result = true;
return result;
} | 1 |
aa9d3dbb7a385e335f70719ce2ead3b6 | cec54e9cdaf377611c85a25c226662bf | Удаляем файл с цепочкой вычислений | {
$h = get_file_hash($fieldID, $lineID, $fname);
$d1 = $this->rootDir . "/files/" . substr($h, 0, 2);
$d2 = $d1 . "/" . substr($h, 2, 2);
@$dir_files = scandir($d2);
if (count($dir_files) < 3) {
@rmdir($d2);
@$dir_files ... | 0 |
8099f5c184769e9548d2333774e84fed | b4eda302bf242f5e050764661f10fdd5 | Updates the coloring of the phantom.
The coloring is a maximal subset of the blocks V' such that for each v in V': |anticone(v, coloring)| <= k. | def set_color(v, lcntm, rctop, color):
if not has_union(tree[v].block, [lcntm, rctop]):
return
if is_included(tree[v].block, [lcntm, rctop]):
tree[v].color, tree[v].mark = color, True
return
if tree[v].mark:
for child in tree[v].childs:
tree[child].color, tree[chi... | 0 |
e3447a47e29b2546b8970900706384b3 | 8b65f93f63957dbbd5a49cab44a5c7a6 | SO_REUSEPORT | {
int one = 1;
setsockopt( sock_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof( one ) );
} | 0 |
495e45d6eca9043418f64d6a55f83ce0 | 15e7eecc9ef73590990539f2987d0115 | 根据获取的积分获取商品信息 | Request<GetGoodsListBean> request = new Request<>();
GetGoodsListBean bean = new GetGoodsListBean();
bean.setMallTyle(Constants.MALL_SOCRE);
bean.setPageIndex(scoreListPage);
request.setData(bean);
RXUtils.request(getActivity(), request, "getGoodsList", new SupportSubscri... | 1 |
6f7a0a6e3b1b4e1a9b71c1a70a366e6b | 2ed581ea1f4f9ea2fc27f96a20d1ae1b | Returns Array of unique Date objects. | public class QRequest
public final Date[] getDates() {
return this._dates;
} | 0 |
12e70b5599c9f77e6aeb7e044cbbb652 | 5099567af112ee580e7f9f6d4ca6faac | Gets all information about ship placement.
Returns: | class Wave(object):
def getShip(self):
return self._ship | 0 |
992f58cafbe6b75d817ee2a2192ad271 | a69eb88bbb739bf1bee69f14cb7373d8 | 해당 블로그의 포틀릿 레이아웃 ID 에 해당 되는 값 삭제 | void deleteByBlogId(long blogId); | 0 |
5f2753ed632b50100f620af63c4a4f18 | aeeef2e895199a22dc847faf7b4637d3 | Waits for the client's turn. The server will tell the client when. | DWORD CExecLine::WaitForTurn(CTurn* pTurn, DWORD dwTimeout)
{
DWORD dwRes = WbemWaitForSingleObject(pTurn->GetEvent(), dwTimeout);
{
CInCritSec ics(&m_cs);
if(dwRes == WAIT_OBJECT_0)
{
m_pCurrentTurn = pTurn;
}
}
return dwRes;
} | 1 |
1e9d2565aee7144ee74914dc77c556c5 | cff9f857ad53142e0b56ff16dce16078 | fn needs auth code to gen access token | class PromoTests(TestCase):
def test_auth(self):
response = self.client.get(path='/api/v1/promos/')
assert response.status_code == 401
response = self.client.post(path='/api/v1/promos/')
assert response.status_code == 401
response = self.client.put(path='/api/v1/promos/code/')
... | 0 |
d19b77f388da488bcc647c3f0064b2ee | d4c254a0aa1465d2b743c3602e689feb | Méthode retournant toutes les ADNs (configuration de trajet) des éléments | {
var adherencePoints = connexionzRoute.Path
.Select((val, idx) => new { value = val, index = idx })
.Where(a => a.value.IsScheduleAdherancePoint)
.ToList();
adherencePoints.Add(new { value = connexionzRoute.Path.Last(), index = connexionzR... | 0 |
aff1185c7d31efbcb3d30f07c123642d | 9e9a7802203cf1c52cceaf4e62ddf335 | Increases numeric text box value. | {
var nupd = (NumericControl)property;
nupd.UpdateTextBox();
if ((decimal)args.OldValue != (decimal)args.NewValue && nupd.ValueChanged != null) nupd.ValueChanged(nupd, new EventArgs());
} | 0 |
df04e38bd7f59b0efc59ff663641059e | cfcbeda6c0d095e32f4e61aa7f1a03d9 | 首先识别是否需要补充 | local pix = 100
if ServerTypeGlo == 1 then
pix = 255
end
local APRechargeRGB = Tools.Single_ColorRGB(true,APRechargePoint[1],APRechargePoint[2])
local Gray = (APRechargeRGB.r*299 + APRechargeRGB.g*587 + APRechargeRGB.b*114 + 500) / 1000
local ret = Tools.Single_FindColor(true,APRechargeTable)
if Gray < pix and... | 1 |
c4f31d15b21e86ecabd975cdd163224d | 6cb95a798f356d47dffa90fac49f5cdd | Test whether it is possible to deploy an instance with a new network and assign an allocated public IP | class TestBccClient(unittest.TestCase):
def test_assign_private_ip_to_instance(self):
print(self.client.assign_private_ip_to_instance('i-gDwqItW2', '192.168.0.12')) | 0 |
5762bb9573221e6982d229f0849b3aee | 2c330b66d3bf2bc131d917785943620e | Encode a concrete primitive Rtl r sa z3 query.
Returns a tuple (query, var_m) where:
- query is a list of z3 expressions
- var_m is a map from Vars v with non-BVType to their correspodning z3
bitvector variable. | def helper(t, bd_vars):
if t.is_svar():
return "?" + t.name
elif t.is_var() or t.is_const():
return t.name
elif t.is_comb():
if t.fun.is_abs():
str_fun = "(" + helper(t.fun, bd_vars) + ")"
els... | 0 |
446ccb3849ee50e4ddd1b04953d7b7ae | f2780f5cfd19ef8c755dd33ed917c3ec | Application의 AppDomain을 획득합니다. | namespace DotNetTest.AssemblyTest
public class AppDomainTest
public void Demo2()
{
var test = AppDomain.CurrentDomain;
var attribute = AppDomain.CurrentDomain.CreateInstance("DotNetTest", "DotNetTest.AttributeTest.AttributeDemo1").Unwrap() as AttributeDemo1;
var context =... | 1 |
6ba5a1a7c65faf91bfe175ba936bc98a | 12648d6fa06ee7d8e6b2bbeeed3bf050 | Compute the shape of a dense layer. | if inpshape is None:
inpshape = self.inpshape
if not self.encoderactive:
return inpshape
if checkinput:
assert inpshape[(1 if self.inpdim == 4 else 2)] == self.fmapsin or \
inpshape[(1 if self.inpdim == 4 else 2)] is None, "Number of input c... | 0 |
8cbd7e3c16f3f46dd8ef9b2b371c508b | 4bbb6c0c003973a0a745b2e20efb005f | Заменяет в строке Unicode-сущности на представляющие их символы. | for char in unicode_dict:
st = st.replace(char, unicode_dict[char])
return st | 1 |
5dd0509952f885ee5bfd3d526781db24 | fd1ddd9e4ec1dba46d8bd9329c9195c9 | yes we need to be near the flag to pick it up | namespace FinalProject.Teams.TeamA.GoalOrientedBehaviour.Scripts.GameData.Actions
public class PickUpLogAction : GoapAction
public override bool RequiresInRange()
{
return true;
} | 1 |
ed22585ee278586b4f768a0bf15fefd9 | bb7230f0d812cc681f014d8a1e87a0c5 | Attempt to create a addressbook object with a conflicting UID
should raise. | yield self.txn.commit()
yield self._refresh()
self.addressbook1.createAddressBookObjectWithName(
"sample.vcf",
VComponent.fromString(vcard4_text)
)
yield self.txn.abort()
yield self._refresh()
self.assertIdentical(
(yield self.a... | 0 |
bbb3a580dc89e41ed291d902035eed4c | 0b68087fd2fd272ff41b7fbe6b2e11f6 | Gets node manager. Singleton. | public class WorkspaceImpl extends AbstractWorkspace
implements JackrabbitWorkspace, org.apache.jackrabbit.api.jsr283.Workspace,
EventStateCollectionFactory
public NodeTypeManager getNodeTypeManager() throws RepositoryException {
sanityCheck();
return session.getNodeTypeManager();
} | 0 |
8b028be3135dec255be16245ff5b6138 | 6c6ab6a63d2bb935fccdea33ba9d6e4e | 查找指定字符串的value值 | Optional<String> findStringValue(String key); | 1 |
073c3e4c2fee63104bc625fb36d9ea3f | 46e4b00aed92168c0d3b20f53a735bd7 | Get a file collection | {
if (! $this->_filesCollection) {
$this->_filesCollection = Mage::getSingleton('cms/wysiwyg_images_storage')->getFilesCollection(Mage::helper('cms/wysiwyg_images')->getCurrentPath(), $this->_getMediaType());
}
return $this->_filesCollection;
} | 1 |
f7d7644f5d1805cb88a88f1b6d42365b | ef9b0624fd91fb45b3ab65fe1ae561ec | Specifies routing registry name. | @Config("registryName")
public static String provideRegistryName(RegistryConfigSettings config) {
return config.registryPolicy.registryName;
} | 1 |
4b2e432aefa34fd67668a1c9a13541d1 | c036eb3be113cd319c6f3c62009c3aa8 | Adds the multiboot header. | static void
parse_bootinfo(void)
{
Multiboot_info *mbi;
if (mb_magic != MULTIBOOT_BOOTLOADER_MAGIC)
panic("Invalid magic number: %#08x", mb_magic);
if (mb_addr & (MULTIBOOT_INFO_ALIGN - 1))
panic("Unaligned mbi: %p", mb_addr);
mbi = (Multiboot_info *) pa2kva(mb_addr);
for (Multiboot... | 0 |
0b9e27d84678bbb1c2beaeb98f9e3660 | 1566dcef3a82a6b9c5385a11ba6917e6 | Use deep hash code on the 2d array- this creates a unique
hashcode based on the contents of the array | public final int hashCode() {
int result = 17;
for (int i = 0; i < this.nrows(); ++i) {
result = 31 * result + this.get( i ).hashCode();
}
return result;
} | 1 |
532dba37d1e8b62980e5314ed61d8e4e | f0abb90d3cd4dbe28422a3e8dd03a496 | Sets up button that will remove mind from a character | {
if (mind == null)
return;
TransferTo(mind, null);
SetUserId(mind, null);
} | 0 |
8c895a02ba1b3bf36cd7b3b3104e3a2c | 02b27aa26b9dba24024d85a997657172 | Find user in current group. | if isinstance(self.chat, Group):
actual_user_name = self.get('ActualUserName')
for _member in self.chat:
if _member.user_name == actual_user_name:
return _member
return Member(dict(UserName=actual_user_name, NickName=self.get('ActualNickNam... | 1 |
ceeb71c6143867d40d00806566a8747f | 4d7e6d7a9e75313ba6c4d3ab1ee00671 | Tell it to collect bytes from the passed bank and fill the buffer. | {
if (bc) {
segbuf_rp += bc;
segbuf_used -= bc;
if (segbuf_rp == segbuf_end) {
segbuf_rp = segbuf_start;
#if NUTBANK_COUNT > 0
if (++segbuf_rs >= NUTBANK_COUNT)
segbuf_rs = 0;
#endif
NutSegBufEnable(segbuf_rs);
}
if (segbuf_... | 0 |
0db20491ea57c78c4bf0fa3134c07a84 | 38fe1cdcfcdc52613e07eab701d0cdb9 | Calculate which player is the closest to this enemy | public class LevelOwnerComponent : BaseComponent
private static PlayerController CalculateBestOwner(EnemyController enemy, NetworkOwnershipComponent netOwner)
{
CharacterTargetingComponent enemyTargeting = enemy.gameObject.GetComponent<CharacterTargetingComponent>();
PlayerController closestPlayer = null;
float ... | 1 |
55c27c84c2af33cecc1211aa6b352363 | 083d274b6dca01120548b613c5c6b605 | Get the first stroke added to the sketch | def StrokeGetLast() -> object:
pass | 0 |
f4bcd1c6dd2b13740dc5b98968078ccf | a633bbf3ff9e0913ae0c8e9927536509 | 奨学金の通常返済シミュレーション結果を作成するメソッド | k):
np.random.seed(1)
df = pd.DataFrame(columns=['name', 'round', 'count', 'coin'])
for round in range(num_rounds):
strategies = (
FixedAmount('定額(300)', start_coin, 300),
FixedAmount('定額(100)', start_coin, 100),
FixedRate('定率(3%)', start_coin, 0.... | 0 |
a6bc9d10aa8ad7552e574c7001a33421 | e6ca92a441e7f430084f72319e9529c3 | Check if the keyword file is in the default directory. | class KeywordConfig(object):
def CheckKeywordDownloadedWikiFile(self):
absolute_path = os.path.join(os.getcwd(), Common.downloadWikiFiles_path)
print absolute_path
if os.path.exists(absolute_path):
absolute_file_path = os.path.join(absolute_path, self.keyword_wiki_file)
u... | 1 |
48433706ee7300d81202743b739a6ad4 | bebd3f3aff9d6b3af095732918c4010c | Sets the id of this SubsidyBase. | class SubsidyBase(Model):
def id(self, id: str):
self._id = id | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.