query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
8fbb8d40dcff8101d5149bb1385a116a | 1a77236b7084ccc1c4b0b0da2820576c | Returns whether or not the passed element is a valid child of the
passed tag handler | public boolean filter( TagProcessor processor, ITagHandler parent, IModelObject element); | 1 |
6b26fd987e51322c568c7f85c1ba9e09 | 54555ee17453e24be89a08765beadcb7 | Constructor, does not receive any parameters. | stringManip::stringManip(){
} | 1 |
a88ef37fa7427e602728b8385c71e7ea | 69583490c72510e0ccafb08fbdde0412 | Zwraca tablice komunikatu dla danego walidatora | class CommonServices
public function messages() {
return $this->_validator->messages();
} | 1 |
e175a6489fed801edbc976986fa40db5 | 9521fcb613fa5eae21f53e24c68b03c0 | Cette méthode montre comment obtenir la liste des contacts de tiers répondant à un critère. | {
List<Order> orders = new List<Order>() { new Order("NumeroTiers", OrderType.Asc) };
ContactTiersService service = new ContactTiersService(_webServiceUrl);
IList<ContactTiers> contactAsc = service.GetList(orders: orders);
} | 1 |
3ba676ec875dab53dbb0519070aeb0a7 | 64a982fce1574b323c8dca58f925d04b | 获取所有订单的退款数据 | export class OrderService extends BaseApplicationService implements IOrderService
private GetOrderRefundPro(orderId: string): Promise<any> {
let query = new EsQuery({
Filter: {
brandId: "#",
storeId: "#",
ordersId: orderId
}
});
... | 0 |
36333eecf996a9f55a674293a464bebd | 85a2883a129f0dc305828910ae273349 | 根据 交易月份查找总账表里面所有的 不重复的项目id | public List<Object[]> findByMonth(String tranMonths,String sourceTag) {
log.debug("find ProjectMonthGeneralLedger");
try {
Session session = this.getSession();
Query query = session
.createQuery("select distinct(v.itemUid),v.itemName,p.depreciationAtm,p.depreciationEquipment from ProjectMonthGeneralLedg... | 1 |
2818af92fbc8bc4de6db78fc320410bc | 7c5b691b536adb0609157cd9c7f10764 | GET /referencias : get all the referencias. | class ReferenciaController extends Controller
public function index()
{
return View::make('referencia.index')
->with('modal', false);
} | 0 |
9b8d596e3b3688c9f8783219e5d42fd3 | 9d6fe2565b831d153a9e4421d8285fb3 | Updating a non existing deposit should raise an error. | asset = Asset.objects.create(
code="USD",
issuer=Keypair.random().public_key,
sep24_enabled=True,
deposit_enabled=True,
)
response = client.post(DEPOSIT_PATH, {"asset_code": asset.code}, follow=True)
assert response.status_code == 200 | 0 |
93e60732630cffd5f2d6e3c8024fc6a7 | a89f516e54f8e25ffe99f2fd4340ea7b | 延迟delay多长时间之后,尝试关闭子线程 | public class CustomAlertDialog extends AlertDialog
private void postDelay(long delayMillis, final PostDelayListener postDelayListener) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
dialog.dismiss();
... | 0 |
85ac8dd4049c6a4a1eef6d5a7d8affc0 | 2419983456d56ced997db49478b704b1 | sql查询错误包装方法 | class CRes
public static function QRowNoErr($query)
{
$result = mysql_query($query);
if (!$result && in_array(IInt($_SESSION['bbs_uid']), array(103896, 70794))) {
die('ERROR Q: ' . $query);
}
if (!$result) return false;
return mysql_fetch_array($result);
} | 1 |
e7584c1d3e009df285e982aeea86aa38 | 26b2a72d70db601d7fc8db88ec8741fc | Indicative check to flag years with 95th or 99th percentiles equal to zero.
Returns:
Years where 95th and 99th percentiles are zero | class Qc:
def check_percentiles(self) -> Tuple[List[int], List[int]]:
perc95 = self.gauge.data.groupby(pd.Grouper(freq='A')).quantile(.95)
perc99 = self.gauge.data.groupby(pd.Grouper(freq='A')).quantile(.99)
return [d.year for d in list(perc95[perc95 == 0].index)], [d.year for d in list(perc99[p... | 1 |
5c6397e9a1cc8d9ce5f0431074a4a2fe | fe8aa4b2c622b93c179b4ea73a8a6a63 | Parse Ext4 block group descriptor internally | class Ext4Parser(object):
def parse_ext4_bg_desc(self, bg_num):
blocks_per_group = self.ext4_super_block['s_blocks_per_group']
if self.is_ext4_bg_has_sb(bg_num) is True:
if bg_num == 0:
offset = self.get_sb_blocks() * EXT4_BLOCK_SZ
else:
offset = (... | 1 |
7e762d0f6ab842fdca16029bc60c1ddd | da47553e571975fe55b54229fa02b35a | IdgClient constructor. | class Client
public function __construct(
string $birdid_id,
string $birdid_secret,
string $vaultid_id,
string $vaultid_secret
)
{
$this->birdid_id = $birdid_id;
$this->birdid_secret = $birdid_secret;
$this->vaultid_id = $vaultid_id;
$this->vaultid... | 0 |
ba920d0fb90f09c38e2c7474a5ce4d70 | f389fef072a200d6937141fc9aee64c1 | 返回词法分析的结果token表 | namespace CMM.Interpreter
class Lexer
public List<Token> GetTokenList()
{
return this.tokenList;
} | 1 |
fb2a4f58231aafc496a9ef94537783a7 | 30e9001d120e8bd3a71b3deaea122ffd | Report current frequency for IEEE 802.11 device. | class NrRrcAnalyzer(ProtocolAnalyzer):
def get_cur_freq(self):
return self.__status.freq if self.__status else None | 0 |
58e232ea0cdceed9babd0784f6f76b29 | 12e97514688ab7ce22850d7e18d0bdd4 | Construct a new launcher widget. | {
mOsWindow->SetTitle("Plasma Launcher");
LauncherConfig* versionConfig = mConfigCog->has(LauncherConfig);
LauncherWindow* launcher = new LauncherWindow(mMainWindow, mConfigCog);
launcher->SetSizing(SizeAxis::Y, SizePolicy::Flex, 1);
if(mArguments.Empty() == false)
{
LauncherCommunicationEvent toSend;
... | 1 |
286b828c54e51031ef8c57557f9bd7ba | e5f19c2618248020fc1567990cebf74c | Format response in JSON:
Display basic info for boat and each load carried on the boat. | Class BoatView
public function showBoat(Boat $boat)
{
$contentString = "
<h4>Boat Information</h4>
<ul>
<li>Boat type: " . $boat->getBoatType() . "</li>
<li>Boat length: " . $boat->getLength() . "</li>
</ul>
";
return $contentString;
} | 0 |
3ae70b8ef426e72f1cbd449ec8dc15c8 | de61a6919f433f0a6204365dbed590e9 | This function calculates the gradient of the likelihood function using sigmoidal link | ywTx = y * (X @ W)
temp = 1. / (1. + np.exp(ywTx))
grad = -(X.T @ (y * temp)) + lmbd * W
return grad | 1 |
fc1486399b18a61d8dfbc370c47e67ee | e98a30ee100aa2fee5f74fea8cfd1554 | Returns true if this color can be displayed on the current color device. | impl VRDisplayCapabilitiesMethods for VRDisplayCapabilities
fn CanPresent(&self) -> bool {
self.capabilities.borrow().can_present
} | 0 |
0366dcf20d7bdf8776aaf427fa6891bf | 720c7316abfb62cb8d7840f5f9bb5307 | Returns the mode label of the k nearest neighbors.
Vectorization from: https://stackoverflow.com/a/49239335 | distances = [sqrt(np.sum((x - x_train)**2)) for x_train in self._X_train]
indices = np.argsort(distances)[:self.k]
labels = [self._y_train[idx] for idx in indices]
return Counter(labels).most_common(1)[0][0] | 1 |
b22cf32b43c659b1f738570a07fe0986 | cddca354d30fa4ab2e7af899add2e729 | Test one line with mode "delimiter after last field" for the case the last field is empty. | public void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
final INIConfiguration config = new INIConfiguration();
final String data = INI_DATA.substring(0, INI_DATA.length() - LINE_SEPARATOR.length()) + "nolist = 1,2, 3";
load(config, data);
assertEquals("1,2... | 0 |
44590749c5947a7a55303ded511b10af | 3b84984ec3c817e86011cf42f7c31bc0 | 计算秒杀 redis的过期时间 | if(!run()) { return 0l; }
long time = redisTemplate.getExpire(key,TimeUnit.SECONDS);
return time;
} | 1 |
c3dc5949b8c0bd4773f8ecdf51cb728a | b2597506e2419171e806b26ec3dd7827 | Function which checks permissions and then renders the index page
with a list of all inventory items | class ItemController extends Controller
public function index(Request $request)
{
if(!checkACL('manager')) {
return view('errors.403');
}
$items = Item::with('user')->get();
return view('items.index',compact('items'));
} | 1 |
b7cd26bea81b8f50ee1fbe0d24d9bd8d | 01a8148e736e440f89627de10c666ad4 | Gets the og:description value | class Noginn_Service_Bing_WebResult
public function getDescription()
{
return $this->_description;
} | 0 |
c0e13fd81ed6ec1e1c9267d61550d108 | 48a1b85856f53ffc24a9ea16ae7357e4 | 根据新闻ID获取新闻评论数 | @Controller
@Slf4j
@RequestMapping("/mlxc")
public class CommentController
@GetMapping("/commentNums.do")
@ResponseBody
public Object getCommentNums(@RequestParam("newsId")Long newsId){
return new BaseReturnDto<>(ReturnCode.SUCCESS,commentService.countComments(newsId));
} | 1 |
b161550ddd7fe16aacbb6b965060134f | 3ac2c1b8550b2dad7dfda945be4307f0 | Send multipart mail | {
$subject = $this->getSubject();
$destination = implode(self::DELIMITER, $this->getDestination());
$boundary = md5(uniqid(microtime(), true));
$headers = 'From: ' . $this->getOrigin() . "\r\n";
$headers .= 'Mime-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: multipart/mixed;boundary=' . $boundary . "\... | 1 |
a9fedb72487f9edc9aad32942addf677 | e6ff775ba54f6da89f49549a3dc04b72 | <p>获取单个应用的帐号管理Service类</p> | AppUserAPI getAppUserAPI(); | 1 |
924ea95ebdeed945205ff9f2eae4968d | b78e01b6ec59384ea591a13c8218d724 | ARouter带参数跳转页面 | public class ARouterUtils
public static void navigation(String path, Bundle bundle) {
if (path == null || bundle == null) {
return;
}
ARouter.getInstance()
.build(path)
.with(bundle)
.navigation();
} | 1 |
70dc609d5ed2c55fb6a3bd3a7d1fecd8 | ed377ad2969e21ac6bded7ab0de9391a | Memberships should be either created or destroyed, not updated. | class ListMembershipsController
def destroy
if @list_membership.user_id == current_user_id || @list_membership.list.created_by_id == current_user_id
@list_membership.destroy
head :ok
else
head :unauthorized
end
end | 1 |
bab5410106b16e984e78449aef99235c | fb4a62ad5c9f1b0b1283b6a4d0229dab | 获取视力标准信息 | @Service
public class CheckDataServiceImpl implements CheckDataService{
@Override
public Map<String,Object> getCheckData() {
int id = ShiroUtils.getUserId().intValue();
Map<String,Object> paramsMap = new HashMap<String,Object>();
paramsMap.put("studentId", id);
List<CheckDataDO> list = checkDataDao.getCheckDa... | 1 |
b893e3539e47a3a7e6275c177bbf830f | 0cd190ff9300339b608666dbcd1b8e99 | Retourne le niveau du joueur en fonction de son expérience | {
double experience = Math.Round(Math.Pow(this.m_niveau, 3), MidpointRounding.AwayFromZero);
return (int)experience;
} | 0 |
309e7a0d1f54c45753c31cd72d11f57d | d39057b437c29e3e61c6a0b4396aa02f | 注册avatar实例信息 | {
$uploadFile = UploadedFile::getInstance($model, 'avatar_file');
if ($uploadFile) {
$model->avatar_url = $this->processUpload($uploadFile, md5($model->username));
}
return $model;
} | 1 |
6177219d64d7ef153df367ebdc666287 | 2f2d6fac16a58cf3c07d4315767b7956 | Set the incoming of this neuron to be another neuron (a helper method for connect) | class SimpleNeuron (TrivialNeuron):
def receive_connection(self, origin_neuron, axon):
self.ingoing += 1 | 0 |
0cd868526aa116e9e057ea152fda3598 | e4073a420c967982dfea6d005ce2b3fa | Integration passthrough behavior (`WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`). **Required** if `request_templates` is used. | class InvalidTemplate(Template):
def request_method(self):
pass | 0 |
53f9fdabbd35321387d6fa7407b064e5 | b8e0356979b1f9193c463ce3d882bc47 | Sometimes we need to pass params with different naming to the form
attribute so we create a param_alias for the attribute. We then dealias
the parameter here | class Configurator extends ConfiguratorBase
public function aliasAttribute($elName, $attrName, $alias)
{
$elName = $this->normalizeElementName($elName);
$attrName = $this->normalizeAttributeName($attrName);
$this->aliases[$elName][$attrName] = AttributeName::normalize($alias);
} | 1 |
b5f0fb78cd1786218705309dca8b8447 | 7ed3a54a13bdb3977fb21d2b8fbc0ed3 | 获取精彩回顾点赞 | try {
$result = $this->dynamics->getDynamicsPraise($did);
if($result['code'] == $this->status->getCode('OK') && !empty($result['data'])){
foreach($result['data'] as &$val){
$val['userInfo'] = $this->userMgr->getMobileUserInfo($val['uid'])['data'];
... | 1 |
2d9502072c9d92a13a4c0040d2199cf0 | de2d90492cc4a5d05e4147d30afb5659 | Add property in test-suite. | assert hasattr(obj, "name")
assert hasattr(obj, "type")
assert hasattr(obj, "help")
assert hasattr(obj, "postprocess")
self._testenv_attr.append(obj) | 0 |
53c80216327ca9d5e96434cac1bf35a5 | a118a98acd16a102b0cea5fc4b7b92eb | Перестановка текста в середину кнопки | function splitText(className: string) {
const btnElArr = document.getElementsByClassName(className);
if (!btnElArr.length) return;
[...btnElArr].forEach(el => {
const text = el.textContent;
const newText = getSplitText(text);
el.innerHTML = newText;
});
function getSplitText(text: string) {
le... | 0 |
bad42fbe430b8c8410a326c4760b629d | 4b54d5418700aa8e3e03fd50bd02f2e7 | 从缓存获取所有奖品数量 | {
$key = $this->redisRewardKey();
$redis = bean('redis');
$rewardList = $redis->SMEMBERS($key);
return $rewardList;
} | 0 |
422297eda26a0c316a9aec3657f6fa9f | cd3ff9614171120a532cacae0fd3f97e | 根据路径或文件名选择Excel版本 | if(absolutePath != null && !"".equals(absolutePath)){
if(absolutePath.matches("^.+\\.(?i)((xls)|(xlsx))$")){
FileInputStream fis = new FileInputStream(new File(absolutePath));
return absolutePath.matches("^.+\\.(?i)((xls)$")?new HSSFWorkbook(fis):new XSSFWorkbook(fis);
}else{
throw new FileNotFound... | 1 |
6ff5475a975fafc1dd4171080c3134e1 | 55cbcc06fc61b08741671754c04e9545 | Set issuer type | class Attestation
public function setType($type)
{
$this->type = $type;
return $this;
} | 0 |
485e7e38eb4c8005937499c1616d79e1 | 8bb230eb08e26f8d8e69506e55e9050e | Funkcja, która odkrywa pole. | namespace Krestiki_noliki_ver._3._1
public partial class Form1 : Form
void LookPole()
{
foreach (PictureBox P in GamePole)
P.Enabled = false;
} | 0 |
4cd52cf32ea58be5af541193007f0fac | f1776e2b478eca1cb04c3ab6a857f886 | Function to look at a node's friends, and their friends and returns which node we should travel to next | uint32_t idNextNode;
uint32_t neighbourStep;
if(nodeCounter == 1){
nodeList[currentNode].mark++;
return currentNode;
}
neighbourStep = nodeList[currentNode].mark % nodeList[currentNode].neighbour_count;
idNextNode = nodeList[currentNode].neighbourList[neighbourStep];
nodeLi... | 0 |
5997e551a5741ed67fa36546a2dd050d | d370f4ca8597226bbd8dcab7c838df2b | Set default topic configuration | {
$this->topicConf = new \RdKafka\TopicConf();
$this->topicConf->set('request.required.acks', -1);
$this->topicConf->set('auto.commit.enable', 0);
$this->topicConf->set('auto.commit.interval.ms', 100);
$this->topicConf->set('offset.store.method', 'broker');
$this->top... | 1 |
630cf4568d8575ef2dfac853918a0623 | b9021b5639ada76a368ce9b9df3ce076 | Returns the value of the '<em><b>View Property Value</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>View Property Value</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | default boolean isPropertyValue() {
return false;
} | 0 |
88f344ea1c39f5194feb979055ab8b1a | 23eea0557cd0a38c47d52d9f0751feb9 | Some columns are unsupported. They should therefore
neither be inserted nor updated. Filter them out. | static void
pgxc_handle_unsupported_stmts(Query *query)
{
ListCell *lc;
if (query == NULL ||
!IsA(query, Query))
return;
check_stack_depth();
validate_part_col_updatable(query);
foreach(lc, query->cteList)
{
CommonTableExpr *cte = (CommonTableExpr *) lfirst(lc);
pgxc_handle_unsupported_stmts((Query *)cte-... | 0 |
af70769be39604a06f4883e88eca1512 | 6894cbc7a8054be5d8c1168b539f632a | 根据监控探头id删除 | public MyCloudResult<Boolean> deletePerformanceMonitor(int id); | 1 |
5ba82d74ecfe848fb488f14ad3ae206f | 6ce29907adf5130d7bd5a9777adf72d3 | 与えられた名前(name), 属性(attributes), 子ノードを持つ要素を作成して返す関数 | let elem = document.createElementNS(this.SVG_NS, tag);
for (let attribute in attributes) {
let name = attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute;
let value = attributes[attribute];
if (attribute in this.NS_MAP) {
elem.setAttributeNS(this.NS_MAP[attribute], name, ... | 0 |
f319ccf01bbeb9f85a472452c791efec | bf3aca541060ff7c10a1b04bd452bbe9 | !
GulmayGeneratorConnector class provides a low level API for communicatig with Gulmay
generator. The generator is based on RS-232 communication protocol. The main duty
of the GulmayGeneratorConnector class is to handel the difficulties that are related to
multi-threading communication with the generator.
Settings of t... | {
public:
static const int PARITY_NONE=0;
static const int PARITY_ODD=1;
static const int PARITY_EVEN=2;
static const int OK=1;
static const int DEV_NOT_FOUND=-1;
static const int BAUD_NOT_SUPPORTED=-2;
static const int DATABITS_NOT_SUPPORTED=-3;
static const int PARITYMODE_NOT_SUPPORTED... | 0 |
9aa933b4677f2bd0ee37235a6ae7f9cd | c14e3b88f8f9c854afa2d030903b42c2 | 简单实现存储String的ListView | public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(
this, android.R.layout.simple_list_item_multiple_choice, item);
ListView listView1 = ... | 1 |
02173a61c7119ec07250c3dc0c1298c2 | 0c40c1b397acaa115c30484bd503728c | تنظیمات را به عنوان تنظیمهای جاری سیستم لود میکند. | class BaseSetting extends \yii\base\Model
public function init()
{
parent::init();
$this->app_type = Yii::$app->setting->get($this->getId('app_type'), 'company');
$this->online = Yii::$app->setting->get($this->getId('online'), 1);
$this->name = unserialize(Yii::$app->setting->get($this->getId('name')));
$thi... | 1 |
fdd4b43ed9bef7cf805793e48c9797fc | 7f2c04b5f5ad39fc3aaeff7d8efddff6 | Prueba de caso borde(fallo) en EliminarActividad_It | $this->seek_existe_actividad();
if ($this->feedback['code'] === '60011'){
$this->feedback['ok'] = true;
$this->feedback['code'] = '20032';
return true;
}
return false;
} | 0 |
95911d3a6521dd94030e02373236b906 | 596e1c195ff3a50ac04c0ed9de3ce302 | \brief Creates an enumeration structure to traverse the hash table. | {
static Tcl_HashKeyType hash_key_type = {
TCL_HASH_KEY_TYPE_VERSION,
0,
hashValuesKey,
compareValuesKey,
allocValuesEntry,
freeValuesEntry
... | 0 |
604715dad1873eb5177f00dcad25aea0 | da817a3ae2e4e6ac3cd0128541f382e8 | Returns the tensor with value `val` and dtype `dtype`. | def scalar_type(dtype):
return TensorType(tvm.convert([]), dtype) | 0 |
ce6b8bcb9c2a3ca856f9e2e2fb64738c | cfabab22144e63c30d1486a9036e94c4 | Render the entity as seen normally, in 2D. | void CEntity::RenderEntity(CRenderCamera* Camera, COLORREF Colour, TSRenderContext* rc, int ViewType)
{
Point2I start, end;
if(EntityStyle != ENTITY_S_ORIGIN )
return;
if(!( mFlags & ENTITY_ACTIVE ) )
return;
if( (ViewType == ID_VIEW_SOLIDRENDER ) ||
( ViewType == ID_VIEW_TEXTUREVIEW ) )
... | 1 |
e90087f52cf4f0a5ba7a045c1959590f | 5c6a1b797dfd54a5107eed692142d465 | Remove o CPF do responsável ou CNPJ da empresa responsável. | void setCpfOuCnpj(String cpfOuCnpj); | 0 |
eed2505a1e32c681ac75995f701263f4 | e98c737a0bcc13ffd24491b84e47ad34 | Возвращает кол-во подарков пользователя, временное решение пока подарки в фидах | {
if (activity == null)
return 0;
return _giftRepository.TableNoTracking.Count(a => a.ActivityId == activity.Id && !a.IsTaken);
} | 1 |
3e13bdd3a06071838c2b9ab169b8ae19 | 02784ab70497e5ee271d3b8eb17cc545 | update the tuples in the DB that were changed in the table | boolean blob = false;
Connection con = SWBUtils.DB.getConnection(dbcon);
Statement st = con.createStatement();
if(table.existColumnName("lastupdate"))
setTimestamp("lastupdate", new Timestamp((new java.util.Date()).getTime()));
String na = "";
for(Iterator it = tabl... | 1 |
dfc2213e5c0f6244ac05985face87d58 | f87cdd30a7464a1d42b3dc7efe06d4af | 从所有可能的View生成名中检索type可能的全限定名。因为View必定不是嵌套类,所以不需要考虑type是嵌套类的可能性 | namespace Rafy.MetaModel
public abstract class ViewConfig : EntityConfigBase
internal static string GetViewName(Type viewType)
{
if (viewType == null) return null;
return viewType.FullName;
} | 1 |
24321844f52c930741adb838b1b3fc76 | 5c45b1ee29dda0ed7be2aeafe013c8d4 | Get the number of line items displayed. | class SearchResultScreen(ed_basewin.EdBaseCtrlBox):
def GetDisplayedLines(self):
return self._list.GetLineCount() | 1 |
531edd8d781471f40c5c679814f31922 | 6190f5ceb87b8706475e2b6c0c0faeab | 背包总的承载重量为Wkg,有n个物品,每个物品的重量不等,且不可分割,如何在不超过承载重量的情况下使得背包中总价值最大 | int[][] dp = new int[n + 1][maxW+1];
for (int i=0;i<n+1;i++) {
for(int j=0;j<maxW+1;j++) {
if (j == 0) {
dp[i][j] = 0;
} else {
dp[i][j] = -1;
}
}
}
for (int i=1;i<=n;i++) {
... | 1 |
c20d6c0694a7956392cd603e61a5d150 | 87f45848aa7815a01d2c3b028b26898f | Plots a single line x, y. | x_var = check_xvar(x_var)
if vals is not None:
ax.plot(prog[x_var], vals, label=label) | 1 |
4aba2cbc5ded618bb36d18c452173cac | ddffdc4dd1e9730cf2c21d9d296bb7c9 | prüft, ob ein bestimmter Wert enthalten ist | function has_inclusion_of($value, $set) {
return in_array($value, $set);
} | 1 |
8a3974b717bb1d7fe5897847f56a8246 | 756a2791d3a29e0ff13b5986e7775707 | Stop the component which is specified by its name. | JobResult stopComponent(String instanceId); | 0 |
0264b3b7c7ccd900fe9e95c125d26939 | 15457ca9312b608da8658e907d3a19f1 | NewResponseBody returns a ResponseBody. | r := bufio.NewReader(resp.Body)
defer resp.Body.Close()
p := ParseBody(r)
p.Document = resp
return p
} | 0 |
843c4b36bf0aa09b4ee0197fd78ae322 | 898d883e3610cfb76145f81ed2558d85 | Returns the index of a peak. Brute force as a baseline. Time Complexity: Theta(n) | finite_difference_1 = numpy.gradient(y, t)
is_peak = [finite_difference_1[i] * finite_difference_1[i + 1] <= 0
for i in range(len(finite_difference_1) - 1)]
peak_indices = [i for i, b in enumerate(is_peak) if b]
if len(peak_indices) == 0:
return 0
return len(peak_indices) | 0 |
c7411a023a78a7c916bb35b148753456 | 15376b5b03b5c769f7089488b78ed381 | A metódus hatására az objektum munkavégző képessége csökken | namespace PPT_Jatek
public abstract class Jatekelem
public abstract void Utkozes(Jatekelem elem); | 0 |
223c4d577f28da5485d3e4ef6c41d469 | 581bcb4657b913801674920c61f80b6b | 五花牛:五张牌都是J、Q、K组成的牌型。 | class TestJudgement(unittest.TestCase):
def test_four_of_a_kind2(self):
hand = [card.Card("club", 6), card.Card("club", 9), card.Card(
"diamond", 6), card.Card("spade", 6), card.Card("heart", 6)]
result = self.judge.judge(hand)
self.assertEqual(result, 706) | 0 |
ee1659ec35c7a4dfbbc47a6265c74cf7 | 624ca2cf554354d7ca4f7ee6994ecd3b | Get latest activity for project and locale if provided. | class Projects(BacklogBase):
def get_project_recent_updates_raw(
self, project_id_or_key, query_parameters):
return self._request(
'/projects/{}/activities'.format(project_id_or_key),
method='GET',
query_parameters=query_parameters) | 1 |
197e0c0eec0e6e1aba26da42c7e6cdfc | 0131788ada2d573eeee28aaa533f8ed3 | 可设置广告数量 | String key = new StringBuffer().append(DSP_SITE_SHOW_TOTAL)
.append("_")
.append(ConstDefine.AD_TYPE_SDK_SPOT)
.toString().trim();
AdsPreferences.getInstance(context).setInt(channel, k... | 1 |
194f78c99df03c1342edc97c4cfd7c08 | 84ed2506705f4b3028b54d37e12154c2 | Appends <code>$file</code> onto the full <code>$path</code>, taking care to make sure
the path ends with a slash before appending the file name. | public abstract class SFTPRemoteConnector extends RemoteConnector
protected static String slashify(String file) {
return StringUtils.prependIfMissing(file, "/");
} | 0 |
71bb67b9c9d0bc0298c7cf2c0077cf51 | dc9611713716dc4e0b1393ea60c99db2 | 获取程序集中标记了某标记的所有类型。 | namespace Prime.Core.Objects
public static class AttributeHelper
public static IList<Type> GetTypes<T>(String assemblyName) where T: Attribute
{
var __assm = Assembly.LoadFrom(assemblyName);
return GetTypes<T>(__assm);
} | 1 |
26179278f636fb074c4a6def14de1699 | f86e2d015776ed3e720ad38fd22ebb77 | Checks in an item of given name by incrementing that product's count attribute | if(itemsList.containsKey(item)){
this.itemsList.replace(item, (int)itemsList.get(item)+1);
Log.d(LOG_TAG, "one item replaced");
}
else{
this.itemsList.put(item, 1);
Log.d(LOG_TAG, "one item added");
}
} | 1 |
f58354c1b1b81a74a2ca960ec4f93a7b | d68943990f9bfc6d555366b48870e5e4 | Tests that adding a duplicate report throws an exception | {
setup();
Task task = TestUtils.makeSimpleTask();
Report report = TestUtils.makeSimpleReport(task);
DeviceStorage ds = new DeviceStorage(getContext());
ds.storeReport(report);
ArrayList<Report> reportList = ds.getGlobalReports(task);
assertEquals(0, reportList.size());
} | 0 |
26aac7a744ec48561509abb68edbacc0 | 07e64333b20e60ec26e2d78500e525ec | Changes the size of the text to fit on the screen | let calculatedSize = 0;
if (this.textObject.text.length === 1 || this.textObject.text.length === 0)
calculatedSize = 128;
else
calculatedSize = 128 / (this.textObject.text.length * 0.4)
if (calculatedSize < 38)
calculatedSize = 38;
this.textObj... | 1 |
cbfb115e9fa419c704a3a6605410ac97 | 89de611a2f1524c9feec1b49f1ce4726 | Test case for set_course_version_configuration
Set configuration settings for this course and version. # noqa: E501 | def set_configstring(*args, **kwargs):
pass | 0 |
308d53134417d3fcaa061418381e7442 | ef501beefc8d33b1b202a9582087a7dd | Поставить ТС на ворота | namespace InteligentnyTraktor.Model
void StopTractor(); | 0 |
c7c163e0206a700aff35d2ce81bea0e2 | fa78e210e82729efda655a170423e910 | Makes sure that the specified method actually exists on the widget. | $exists = method_exists($this, $name) || method_exists($this, "___$name") || $this->hasHook($name);
if(!$exists && $allowCombos) {
$methods = $this->parseMethod($name, '_');
if(empty($methods)) return false;
$exists = true;
foreach($methods as $method) {
if($method['exists']) continue;
$exists =... | 1 |
fcdee132bc382ecb74ef22f924a81af8 | cb8cc2f47ce2abca8f676a4bd4d88b4f | @brief Insufficient bytes error constructor. | class CompressionError(Error):
def __init__(self, compressed_bytes_length, uncompressed_bytes_length):
super().__init__()
self.compressed_bytes_length = compressed_bytes_length
self.uncompressed_bytes_length = uncompressed_bytes_length | 0 |
588cbaf04b44d8cb17fee52af0b0e387 | bd8298ee27abe583ec519d6e943407fb | Adds participants to a room. If participants already exist, no change occurs.
Adds participants to a room. If participants already exist, no change occurs. | namespace VmosoApiClient.Api
System.Threading.Tasks.Task<AddSpaceParticipantsResult> AddSpaceParticipantsAsync (string key, AddSpaceParticipantsInput input); | 1 |
88c1793e42a866915ab05db075389af2 | b12909a1ad537c2ee5486dd83c2c187c | Print the description for the General Pet | def desribe_pet(animal_t,pet_n):
print("\nI have a " + animal_t + " . ")
print("My " + animal_t + "'s name is " + pet_n.title() + " . ") | 1 |
8ecf70838aee570991aa2aa7f7b2a808 | f80b5f5399498889552b86bc18f8d476 | Gets all of the currently installed mods. Note this does not mean
they are enabled. | CompletableFuture<List<ModInfoBean>> getAvailableMods(); | 0 |
be7ae8e6a806841ee340f348ae440de7 | ce8486ca3d17cefecad6e8964c6a1c8d | Unityちゃんを移動させる | public class ItemGenerator2 : MonoBehaviour
void Start () {
unitychan = GameObject.Find("unitychan");
} | 0 |
95fd61e48602f4144a412ae08ab98004 | babb183c91d9c1895780d1349faecabb | Lister les billets en ligne et les commentaires signalés
depuis la page d'administration | class CommentairesController extends AppController //herite de AppController présent dans Admin
public function indexComm()
{
$this->template = 'allarticles';
$reported = $this->Commentaire->allEtat(2);
$deleted = $this->Commentaire->allEtat(3);
$fine = $this->Commentaire->allEtat(1);
$this->r... | 1 |
3b93d6231e28a95fe0ea51b59bd30de9 | f98da2bb4f64cfbc67c237912f2603be | Set a div class for each of our displayed reviews. | function setClass(cname)
{
$div.removeClass()
.addClass(cssClass('holder'))
.addClass(cname);
} | 1 |
2dc0b4b20fc846266ff3966c99b368fb | 5783ec66835cea3fb129815eb0da500a | 购买panel放大缩小的动画 | Animation animHide = new AlphaAnimation(1.0f, 0.0f);
Animation animShow = new AlphaAnimation(0.0f, 1.0f);
Animation animNarrow = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f,
Animation.RELATIVE_TO_PARENT, Animation.RELATIVE_TO_PARENT);
Animation animBoost = new ScaleAnimatio... | 1 |
2d15eac8d37b62883d9a7bba2c8b239c | ee3232354df6e5e2171cb0e3b680ce64 | Test code following the assignment directions given. | {
struct area* ottawa = NULL;
struct area* toronto_1 = NULL;
struct area* toronto_2 = NULL;
struct area* windsor = NULL;
struct area* niagraFalls = NULL;
ottawa = (struct area*)malloc(sizeof(struct area));
toronto_1 = (struct area*)malloc(sizeof(struct area));
toronto_2 = (struct area*)m... | 1 |
b372f67726ae15faac5514092705f73a | 02c5971c784f98b7df35f59aa3b43022 | [13] 설명 OpenAPI모듈의 경로를 반환한다.
반환값 경로 | protected function getOpenApiSpecPath(): string
{
return config('openapi_validator.spec_path');
} | 1 |
580d0b9df02db7ea6468aa5ebc16c127 | 8714197d262f90a8c19e0e35a6c48e9a | Sets URLs to retrieve room information | v1_0, v1_2,
act_sum, act1min, act15min,
resources, sleep, heart,
goals_daily, goals_weekly):
sleep_url = [prefix + v1_2 ... | 0 |
37451ecdc130b207247cd547dad65465 | 0861cdf4c5d708613e4dac825be692bf | Create the Vf in SDC if not already existing.
Raises: | fileutils.ensure_tree(self.sofs_mount_point)
if not self._sofs_is_mounted():
self._execute('mount', '-t', 'sofs', self.sofs_config,
self.sofs_mount_point, run_as_root=True)
if not self._sofs_is_mounted():
msg = _("Cannot mount Scality SOF... | 0 |
1a790f0f918e302b8b352b1af48f869c | 7444c2e75b83cafcea6c607adbaedf40 | 文章長かったら(13行しか格納できない)分割して3枚目以降作成 | class OrderX12
public function formatAddress($address)
{
if(!is_array($address)) return self::formatAddress(explode("\n",$address));
$max_per = 35;
$lines = count($address);
if($lines >= 3)
{
array_walk($address, function(&$v,$k) use ($max_per) {
if(strlen($v) > $max_per) $v = trim(substr($v,0,$max_p... | 0 |
11b66d89c1a604f247f6fc434c81c950 | 8314edcbfcb08376445064a37a8af3f5 | force use transaction | namespace AppBoilerplate.Web.Tests
[DependsOn(
typeof(AppBoilerplateWebMvcModule),
typeof(AbpAspNetCoreTestBaseModule)
)]
public class AppBoilerplateWebTestModule : AbpModule
public override void PreInitialize()
{
Configuration.UnitOfWork.IsTransactional = false;
... | 0 |
ae53946697799d7c467e0e127544c49f | 7e0a7fd81c8fd614540503f6599b4252 | 获取距离单位转为单位为米 | public final class Convert
public static double resolveDistance(String distance) {
double distMeter = 0;
try {
if (distance.indexOf("公里") != -1 || distance.indexOf("km") != -1) {
distMeter = Double.valueOf(distance.replace("公里", "").replace("km", "").trim()) * 1000;
} else if(distance.indexOf("英里") != -1 ... | 1 |
cf56e910a2eb81bb3de12ec6b988420b | 72d174929dc864b3a69e124143e83862 | Fade out and then change level | public class StudioOpening : MonoBehaviour
private IEnumerator FadeToMain() {
yield return new WaitForSeconds(menuDelay);
if (levelChanger != null)
levelChanger.FadeToLevel("MainMenu");
else
SceneManager.LoadScene("MainMenu");
} | 1 |
387ed71d85973bf32215f8f50cf5c277 | 41fa0d66104ba0c02b425d8b851b36cb | Clicks the insights button. | {
_queryString.Clear();
_queryString["accessToken"] = await GetVideoAccessTokenAsync(videoId).ConfigureAwait(false);
Uri requestUri = new Uri($"{apiUrl}/{_location}/Accounts/{_accountId}/Videos/{videoId}/Index?{_queryString}");
HttpResponseMessage insightsRequestR... | 0 |
1152351337b0e37105a51e9e60a0b6d0 | bdfa1b5aac785e2314520ca8e554a567 | 编辑路口页面 | public String intersectionsQuery(Model model,HttpServletRequest request) {
User user = (User)request.getSession().getAttribute("user");
if(user == null || user.getUsername() == null){
return "login";
}
model.addAttribute("sectionId", "intersectionsQuery");
model.a... | 0 |
23c0875d748d5bf38b9d154d97faee01 | 1b0e4785d7886335d10aa2b604c6463c | 根据groupId获得运营活动类型 | public ITuanGroupInfoValue[] findTuanGroupType(String groupType) throws Exception; | 0 |
2aef9b2d3df9b5d1c066406c9c500d7e | a8d0d0a3435586e6a823023c0909107d | 根据Class获得类信息 | String isStatic) {
String fixedName = TypeUtils.simpleClassNameToBinary(className);
ClassInfo classInfo = mClassList.get(fixedName);
if (classInfo == null) {
classInfo = new ClassInfo(fixedName, superclassName, isStatic);
mClassList.put(fixedName, classInfo);
... | 1 |
64be9304bfcb330916cc0fc28372bf64 | f712b8c8a0dccc1363f96001abb044ab | 视频信息缩略图上传 | function UpVideoFile(params) {
return request({
url: '/upload/upload',
method: 'post',
data: params
})
} | 0 |
0c8cfbabf562a0a95a38ccabdf6da99b | 43d3ccb009b3d5c1cc2e563bcf81e035 | Calculates lithostatic pressure | pressure = 101.3 * pow(((293-0.0065 * z)/293) , 5.26)
es_current = Es(Ta)
es_previous = Es(Ta_previous)
q_s = (es_current) / pressure ... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.