query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
fa6e8c57243fbc5418b85dc5201d60a8 | 7f3ed03772f4eb2e549e07df1806ccca | This method restores a maximized or minimized Viewport object to its previous size and
location. | namespace PhotinoNET
public class PhotinoWindow : IPhotinoWindow, IDisposable
public PhotinoWindow Restore()
{
if (this.LogVerbosity > 1)
Console.WriteLine($"Executing: \"{this.Title ?? "PhotinoWindow"}\".Restore()");
if (LogVerbosity > 2)
{
... | 1 |
077f8d99156f017444f5edc096ec2147 | 71f219ffe9f8a35cebbf885e1403e933 | Returns Proxy Password for Authentication | class HttpProxy
public function getPassword()
{
return $this->_password;
} | 1 |
7e5f417fa5ba733b7e8e129d741c09f4 | 0e34866b3fcf97c01855bfbb9cafb516 | Receives the prepared list of environment cache key arguments that you can enhance for your project's
requirements. This is useful if you have some kind of project-specific context you want to affect all generated
cache keys. | async function extraCacheKeyData(requestContext) {
} | 1 |
e35950554a8081f362622e4902d47440 | bf16da4b181cbc48abd9c1f7c85f9c2b | Prevent rendering if Persistent disabled | class ClientAuthenticator extends Root
_isPersistedSessionsDisabled() {
return !global.localStorage || this.persistenceFeatures && !this.persistenceFeatures.sessionToken;
} | 0 |
7521937506b24780715d18097bfc0053 | e94cdaf19ac9e386d22123039c706a6d | Validate RegExp syntax in the first argument of `new RegExp()`. | RegExp getTokenRegExp(); | 0 |
5a205266dce4b8b9281739c45464ae7b | feb141d2ba93fbb8cc71a08892970458 | A change has occurred to the list of registered Cell factories. | TreeCellFactory oldValue =cellFactory ;
if(cellFactory != x){
cellFactory = x;
firePropertyChange(CELL_FACTORY_PROPERTY, oldValue, cellFactory);
invalidate();
}
} | 1 |
a98a126a1ed2628f8d733520e82ab1f1 | dda4c769207686f1acc7ac8174b41cb5 | questa funzione permette di ricavare gli id dei tweet partendo dai loro link | global ids
ids = []
try:
x = urllib.urlopen(start_url)
y = x.read()
inputs = re.findall(r'<input[^>]* name="([^"]*)"', y)
for input in inputs:
ids.append(input)
except (KeyError, ValueError, IndexError, IOError):
pass
ids.append(start_url)
if l... | 0 |
9910f06d49cbbfe747e823bb0a4afbaf | 341f5b0835f2cfb4dc73847d84c2c1fb | Formats the header as a CGI environment variable.
See https://www.python.org/dev/peps/pep-0333/#environ-variables. | class AuthTokenMiddleware(object):
def _header_to_env_var(self, key):
return 'HTTP_%s' % key.replace('-', '_').upper() | 1 |
6b249ff056ab5101bb5373c40447fc3d | 7edcbdf73856edf65d3932076bf7f7a2 | Set the event hub. | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = EventHubEventSourceCreateOrUpdateParameters.class)
@JsonTypeName("Microsoft.EventHub")
@JsonFlatten
public class EventHubEventSourceCreateOrUpdateParameters extends EventSourceCreateOrUpdateParameters
public E... | 1 |
9d30aacda320b3b1d27dbe1328728898 | e61a9775e26252cb902a78ee0e560923 | Get variable name and extension. | string& outBasename, string& outExtention) {
size_t i = fullName.find_last_of(".");
if (i == string::npos) {
outExtention.clear();
outBasename = fullName;
} else {
outExtention = fullName.substr(i + 1);
outBasename = fullName.substr(0, i);
}
} | 1 |
f4abd70f8d9c15c4b7dbaf91b5cccbba | cd5734941688514a3345b44c0e17e367 | 16. 未接 | class MatchProxyTest(unittest.TestCase):
def MatchProxy_bit_from_14_to_16_test(self):
m = self.m
self.assertEqual(m.resign_offer, 0) | 0 |
bfe492ad05683e2ebd13046535df3faf | e00c16ac0548210ef3150da626ba50db | Logs a message with the specified level to the root logger. | public class LoggingManager
public void logMessage(String msg) {
logMessage(msg, loggingLevel);
} | 0 |
7ea70ddc41b7c934d2184b678883be19 | f06c096d4b48214128974ab36e6a375d | Authorize swift request. Used e.g. by proxy-server. | headers_to_copy = ('Range', 'If-Match', 'If-None-Match',
'If-Modified-Since', 'If-Unmodified-Since')
headers = {header: req.headers[header]
for header in headers_to_copy
if header in req.headers}
headers['X-Trans-Id-Extra'] = req.e... | 0 |
fd890e5acd2640860e07a9fd97d238d6 | adb28debe8195c2a323d1267efd2003b | Setter for <code>bot.GPT_SERVICE_PAYMENT_DEMAND.ID</code>. | @javax.annotation.Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.5.0"
},
comments = "This class is generated by jOOQ"
)
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class GptServicePaymentDemandRecord extends org.jooq.impl.UpdatableRecordImpl<dshumsky.jooq.generated.tables.... | 0 |
f5082816504d2202dd5283c23ebec268 | 79566d24f3202c8042bd39a63b9a4af7 | Decrease gravity. | namespace Player [RequireComponent(typeof(PlayerInputHandler))]
[RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(SpriteRenderer))]
[RequireComponent(typeof(PlayerAnimations))]
public class PlayerMovement : MonoBehaviour
private void Update() {
if (myRb.velocity.y < 0) {
... | 1 |
17640b233f8b005ca21cb883c47fd93a | 5a3e5a63c5524d01fa56deb78ed14911 | Create and run a gNMI service | s := northbound.NewServer(northbound.NewServerConfig(caPath, keyPath, certPath))
s.AddService(admin.Service{})
s.AddService(diags.Service{})
s.AddService(gnmi.Service{})
return s.Serve(func(started string) {
log.Info("Started NBI on ", started)
})
} | 1 |
391dcc7a49e9012070fadd88092d694f | 2002c3373e39c6d47d00c28f99f4184c | Returns the meta object for the containment reference '{@link org.xtext.projet.selemodel.selemodel.Uncheck#getContainers <em>Containers</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | org.openxmlformats.schemas.drawingml.x2006.main.CTEffectContainer getCont(); | 0 |
70d9fc1dea96c19a5e7c8b3777b819a2 | b4d34c35a5bc3e0fbc1a3eb97b6dd2a7 | Computes position encoding vectors for the given sequence length and state size. | super(PositionalEncoding, self).__init__()
self.dropout = nn.Dropout(p=dropout)
pe = torch.zeros(max_len, d_model)
position = torch.arange(0, max_len).unsqueeze(1).float()
div_term = torch.exp(
-(torch.arange(0., d_model, 2) / d_model) * math.log(10000.0))
pe[... | 1 |
d8da76027e0ab57120ca00aace65f9af | 278afd3f348d656977501111e1bb6bc1 | 如果值为空,则显示-- | if (num || num == 0) {
if ((num + "").trim() == "") {
return "--";
}
num = num.replace(/,/gi, '');
return num;
} else {
return "--";
}
} | 1 |
71e0e3f767b6d5d7a2f49ebba61ad67d | 44d27c11755c223033bb3ae87e727f6e | Adds an in edge to this node. | class IVertex(IEntity):
def add_in_edge(self, vertex, label=None, **kwargs): | 1 |
c2a770a2d843c8492e6de40117a3a048 | cbb8159ce3913ceaf484cf0cc0957959 | Test successful MapRead. | public class ExecutionTests extends AbstractExecutionTest<Script>
@Test
public void testMap1() throws IOException {
assertEqual("mapTest1");
} | 0 |
ba4d0eeed4c7932c72bac5a0f3660987 | a3d95b3079513b2df7118b286b6e2c49 | Determines whether the given string contains
katakana characters.
String to inspect.
TRUE if it contains at least one katakana, otherwise FALSE. | class String
def kata?
if self =~ /[^ァ-ンーヴヵヶ]/
false
else
true
end
end | 0 |
9fabfaa09d4986efd2379ed24996b9f8 | c5fbae968c202d725407a884dfc5454b | Other nearby words in the original article text that rhyme with this one | class GetDomOxfordPage extends AbstractDefinitionWord
getNearByWords(){
let nearbyWordDom = this.#dom.getElementsByClassName("responsive_row nearby")[0];
if(!nearbyWordDom){
return []
}else{
let res = []
let relateWord = nearbyWordDom.getElementsByClassName("l... | 0 |
2faae8f17d34cc2f85455a69683a8ccf | 082fec63dcc488f48d1a62a031226867 | Obtain the counter for the number of exposures that LightField will sum into a single image. | if (exp == 0) return ARGUMENT_OUT_OF_RANGE_ERROR;
else {
_exposures = exp;
return NO_ERROR;
}
} | 0 |
fa1deab7927eed64bf99c2e192a41de7 | 095e07aa7377be34eb77d623dcaa77ef | Open the first detected camel context file in the editor | public class NewCtxHelpOperation extends WorkspaceModifyOperation
protected void openFile() {
Display.getCurrent().asyncExec(new Runnable() {
public void run() {
IWorkbenchWindow ww = PDEUserAssistanceUIPlugin.getActiveWorkbenchWindow();
if (ww == null) {
... | 0 |
93649d2a7b7eac93341d8fac827c652d | 171e92ecd85e37cb8eff3d2794d77dd9 | Responds to special keys being pressed. Currently just responds to the
space key and the Q (quit) key. | public class World extends JPanel implements Runnable
public void keyPressed(KeyEvent e) {
int keyCode = e.getKeyCode();
if ((keyCode == KeyEvent.VK_ESCAPE) || (keyCode == KeyEvent.VK_Q)
|| (keyCode == KeyEvent.VK_END)
|| ((keyCode == KeyEv... | 0 |
4313d20ec0c1517392761afd497b7cc6 | 3dc54ae5dee79c63bd94bca8430500fb | 將錢以千位數分隔 | function money (money) {
return cutStr(money).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
} | 1 |
9649eb6b879ee6f659fa1258f97d90b5 | 8afbf49b586396ae534011df228b5fc1 | Returns the UNIX timestamp of when user was first seen (first time on server) | class SecurityHost
def first_seen_date_time
return @first_seen_date_time
end | 0 |
8f0f14346661d26bccd9147ca922516a | 6ef85d85e633a5d1f7e2786132b9449b | Sets the value of the '{@link CIM15.IEC61970.Informative.InfAssets.WindingInsulation#getGround <em>Ground</em>}' reference.
<!-- begin-user-doc -->
<!-- end-user-doc --> | boolean isSetGroundResolution(); | 0 |
cd1e1a13dbff21b36cc96bf50f597af3 | 6aaf188661296e500e374540fbe911ae | Конструктор группы | {
$this->group = $group;
$this->subject("Добавлена новая группа - ".$group->name);
} | 0 |
20883d48859bf6d855d7c815c59ecea4 | ea27a6d74574c0dd2a2e07ba0015888e | 先从缓存中取数据,如果没有再自动生成 | class Template{
private function cacheFile(){
$isNewFile = false;
if(!is_file($this->cacPath)||filemtime($this->cacPath)<filemtime($this->comPath)){
$isNewFile = true;
}else{
ob_start();
include $this->cacPath;
$out = ob_get_clean();
if(preg_match('/^cache--(\d+)-->/', $out, $matches)){
if($mat... | 1 |
705f1c2b57b908bfc21bdc3a666b4e61 | 339bc2630b40a953c737cfd5d726f794 | Returns a HostProvider by its name. | params = dict(
output = 'extend',
filter = dict(name=name),
selectGroups = True,
)
result = api.response('host.get', **params).get('result')
if not result:
return None
return C(api, **result[0]) | 1 |
d51d04507e8fa136c573d55da830080b | caa05730371d68c70ae93f239982d7f9 | @brief Loescht ein Fach aus der Datenbank und alle damit verbundenen Eintraege. | $query = $db->prepare("DELETE FROM `subjects` WHERE `id` = :sid");
$query->bindValue(':sid', (int)trim($subject_id));
$query->execute();
return $query->rowCount();
} | 0 |
35d6b99a320123812188fb6446e045f6 | 9bf2e12c4149aea5ec295f760829f62a | Get permission group tree permission XML | IObjectStrategy visitorStrategy=new TreeXmlStrategy();
StringBuilder treeXml = new StringBuilder("<nodes label=\"");
treeXml.append(AIMonLocaleFactory.getResource("MOS0000104")).append("\" id=\"-1\" icon=\"systemImage\" depth=\"0\" state=\"0\" isBranch=\"true\">\n");
try{
IAIMonGroupSV groupSV=(IAIMonGroup... | 1 |
1e661a35b218e38d19897dd720f0910c | a7a7948f4f0b1989c3ab328f57d044fd | Recupera solo las metas afectadas de un item del RQNP . | if (log.isDebugEnabled()){ log.debug("debug Inicio - RqnpAucMetasController.recuperarMetasJson");}
Map<String, Object> params = new HashMap<String, Object> ();
Map<String, Object> data = new HashMap<String, Object> ();
List<Map<String, Object>> listaMetas = new ArrayList<Map<String,Object>>();
try {
Stri... | 1 |
9b60ecfad2853fe03df93c1cd6e72c98 | 681cd39f882d05944f9f0b3c769537ee | 依据词语本身在Very词库中查找该词语 | int i = 0, j = mVocabTable.length / 2 - 1;
while (i <= j) {
try {
int m = (i + j) / 2;
long vListPosition = mVocabTable[m * 2];
int termLength;
if (m == mVocabTable.length / 2 - 1) {
termLength = (int) (mVoca... | 1 |
eb67f1d886eb9876afa449f3566b720c | 27206fa9211edf5dc4f5c57c9fca22f6 | Carga diferentes vistas en función de la URI. | class Router{
public function loadView($view,$method=null){
require_once('config/rutas.config.php');
$methods = array('show','create','edit');
$rutas= array('','home','clients','users','profile');
foreach($rutas as $ruta){
if($view === $ruta){
if($method == null){
switch ($view) {
case... | 1 |
22febc6ce612da3011e64170017f8f92 | 604a174d71bc5f9899d224c1a0c4e3e8 | Prepares a question thread which contains question and its answers , based on given question id. | {
if (empty($questionID)) {
$questionID = $this->_request->getParameter("question_id");
}
$params = array($questionID);
$sql = $this->_getQuestionSQL("question_id");
$questions = $this->_db->execute($sql, $params);
if ($questions === false) {
$this->_db->addError();
return $questions;
}
$quest... | 1 |
aca3fa7871d2ffffd08065e5511a2d88 | d5e0bc04d5ae4e081cc01651d64cc98f | A testing function, to check whether weights that should be frozen are staying frozen, and weights that should be
training are changing. | def test_freezing(datadir: Path, use_norm: bool):
model_name = "prob_e_form_" + ("" if use_norm else "un") + "norm"
prob_model = MEGNetProbModel.load(datadir / model_name, load_ckpt=False)
assert prob_model.nn_frozen
assert not prob_model.vgp_frozen
if use_norm:
assert prob_model.norm_frozen... | 1 |
2c266e5e1f7f2d2e0081dfdffef062cc | 92e8a472fce54b2eb19507a553ef4255 | Read the container's header.
When this method is called, the embryonic page that is passed in must
have been read directly from the file or the input stream, even if the
alloc page may still be in cache. This is because a stubbify operation
only writes the stub to disk, it does not get rid of any stale page
from the p... | {
const unsigned char *zRaw = pPage->pRaw->zData;
lhphdr *pHdr = &pPage->sHdr;
SyBigEndianUnpack16(zRaw,&pHdr->iOfft);
zRaw += 2;
SyBigEndianUnpack16(zRaw,&pHdr->iFree);
zRaw += 2;
SyBigEndianUnpack64(zRaw,&pHdr->iSlave);
return UNQLITE_OK;
} | 1 |
3f5439667ed76f113cd899e64c5a7339 | 2d910a099d8cf53af80db4d76f462269 | Make copies of the selected metaelements and move them | export class EditComponentComponent implements AfterViewInit
public selectAll(){
const roomElements = this.structure.roomComponents(this.container);
roomElements.forEach((el)=>{
const element = document.getElementById(el.ID);
if(!element.classList.contains('selected-for-copy')){
element.classList.add('sel... | 0 |
b3c492b81567e6c52650841bef23b5bc | 84d5da6ffc752ad13e8eaf5c263e4afd | 根据KId删除 | Kiki kiki=new Kiki();
Date date = new Date();
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
kiki.setUpdDate(sdf1.format(date));
kiki.setKikiId(Integer.valueOf(kikiId));
kiki.setKikiDelFlg("1");
kikiMapper.deleteKikiByKikiId(kiki);
} | 1 |
e7fdc2f543715c00c08c90df0df35b6a | 384904b382eb3223caf3c1c5137e8608 | 将结果转换为 试题id=>value形式 | d = {}
for result in results:
result_id = result[key]
result.pop(key)
d[result_id] = result
return d | 1 |
31bd147167b6dc783b89dc57141f6f05 | 9fd2408a8f4f40dbd60d20db25a092a1 | Little animation when hovering the poké cards. | class Character(DirectObject):
def hover(self):
color = self.nodePath.getColor() * 1.5
self.nodePath.setColor(color) | 1 |
c7b1103ce19b4d7a3d9804ff633db87f | 07bb62186ff8508851bc7357b0085829 | Ensures that the game does not load until the movie is done | public class CinematicsManager : MonoBehaviour, IGameLoadListener
public void OnGameLoad()
{
ForceEndCinematics();
} | 0 |
78f8c1d264059343fa2f37a13abf80c4 | d1708d427d3d6c9db30a2edbc32953e9 | GET: FinancialOperations | namespace temple.Controllers
[Authorize]
[AutoValidateAntiforgeryToken]
public class FinancialItemController : Controller
[HttpGet]
public async Task<IActionResult> GetFinancialItem()
{
ResultModel result = new ResultModel();
Uri address = new Uri(_config["api"]+ "/Fi... | 0 |
4d3c81470300162aace50587cefea659 | b3b8910c427c8ca455518951ee4d4772 | 复制本地数据至外部存储 | public class GosDeploy
private void copyJson() {
try {
AssetsUtils.assetsDataToSD(fileOutName, fileName, context);
} catch (IOException e) {
e.printStackTrace();
}
} | 1 |
e3020fea51472ea4481cdb6070341c04 | d58be35303041ee445e9544fb9dc63a7 | Set the domain targets. | class DomainBody:
def sources(self, sources):
self._sources = sources | 0 |
0a3dba17f65771094742c5ed474875be | 2214714b6c34aee164755c1090583669 | 通讯中断接收程序 中断函数无返回值 | void ser()interrupt 4{
RI = 0;
a = SBUF;
flag=1;
} | 1 |
ff92e00195ac0b9688418d0b87ca1414 | 6cf786f69126b61f3e721cbef1f70843 | 发货通知
商户在收到最终的支付通知后,调用发货通知API告知微信后台该订单的发货状态
发货时间限制:虚拟、服务类24小时内,实物类72小时内
需要在收到支付通知后,按时发货,并使用发货通知接口将相关信息同步到微信
后台。如果微信后台在规定时间内没有收到,将视为发货超时处理.
由商户发起 | class WxPayAdapter extends Client
public function goodsNotice($trade_no, $mch_code, $pater_trade_no, $out_trade_no, $trxType = '12003', $remark = '系统发货')
{
$data = [
'tradeNo' => $trade_no,
'mbrCode' => $mch_code,
'trxType' => $trxType,
'oriOrdNo' => $pater_tr... | 1 |
e1d3bfd7af8b79211785baad4ebad496 | f9f1e8a1c8f58f2cf26af4437bc67e3f | Cleans up values to prevent them from interfering with subsequent calculations | class TestSolveQuadratic(unittest.TestCase):
def tearDown(self):
make_safe(self.val) | 1 |
f72c3183a1ba7dcff1d7b804eaaf5f9d | e70f2e6d1d0e904a46ff6be2702fc082 | 6. Napisati funkciju koja za unetu boju na engleskom jeziku boji tekst paragrafa u tu boju. | return arr.reduce((result, word) => {
return result.replace(new RegExp(word,"gm"), `<font color="red">${word}</font>`)
}, text);
} | 0 |
e328b927c7680db0e3bf69db24651016 | 9cb749b0482b68539c54b0e35f6d7bb9 | Click on Yes on comment Assignment confirmation | eo.wait(3000);
eo.clickElement(driver, "XPath", "saveButtonXpath");
addComment("Successfully clicked on Save Button.");
} | 0 |
64de7bc055d7ca9153f4beffa6e577bc | 9709a94f1411415db234d943e7223c6f | 点击财务中心-设置-辅助设置-页面的空白处 | def click_financial_beginning_jan_space(driver):
SettingBeginningPageJan(driver).click_space() | 1 |
bf17e8c75d02dcd74ed1185c56110183 | 0040e1f1ad642deb3588a26e4a322603 | Returns the meta object for the attribute '{@link de.hub.clickwatch.specificmodels.brn.device_wifi_link_stat_bcast_stats.Link_info#getRate <em>Rate</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_H7N9_avianRecoveryRate_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_H7N9_avianRecoveryRate_feature", "_UI_H7N9_t... | 0 |
a230be25a355d42fdb18882581d7bf54 | 5eb7e137430eacf239dcdf8f1e405c4e | Updates changed user object data to DB. Returns true on success. | namespace EventZone.Helpers
public class UserDatabaseHelper : SingletonBase<UserDatabaseHelper>
public bool UpdateUser(User user)
{
try
{
db.Entry(user).State = EntityState.Modified;
db.SaveChanges();
return true;
}
... | 1 |
2fdf743ec7111b36d5f4b83a350cefc8 | 7f781c1f6532790577af1e726a2a3a46 | 为屠宰工作提供标识码 | public class Enterprises extends BaseEntity
public void setBreedingCode(String breedingCode) {
this.breedingCode = breedingCode;
} | 0 |
83272cbb6c5ba54d69f31e212d0d65d4 | 8287a49bc86e2044df9a8e8a79d9a0a1 | Returns the user prefs' wallet file path. | Preferences prefs = Preferences.userNodeForPackage(Main.class);
String filePath = prefs.get("filePath", null);
if (filePath != null) {
return new File(filePath);
} else {
return null;
}
} | 1 |
e8c88ae8b1877fa3592fe57eea2af53a | b029988aa79a71e1c58194a333ccd024 | The weights and biases of the convolution layer(s) | class SelfAttnLayerV2(nn.Module):
def weights(self):
return self._weights | 0 |
0aba7af96ff63aa8374e6e91fab150a6 | 11d0e6eabc3a7cf7c2dbc997eeef0359 | ===========================================================================
DESCRIPTION
Write the TX_RATE_ADJ to be latched at last PCG of fundicated frame by mDSP
and latched to HW on the fundicated frame boundary.
DEPENDENCIES
None.
RETURN VALUE
None.
SIDE EFFECTS
None.
===============================================... | void rfagc_enable_trk_lo_adj_pdm(void)
{
HWIO_OUTM( AGC_FREQ_COMB_CTL,
HWIO_FMSK( AGC_FREQ_COMB_CTL,TRK_LO_ADJ_OE),
( 1 << HWIO_SHFT (AGC_FREQ_COMB_CTL,TRK_LO_ADJ_OE)));
} | 0 |
6db560d1d0c0b9708516639c6d7cf505 | 40b857d41522aa63e6436c1e0ee82037 | Using semantics identical to the semantics of the
<code>configureInputJobProperties</code> method, creates a
configuration for job output. For more detail, refer to the
description of the <code>configureInputJobProperties</code> method. | public Props getJobGeneratedProperties(); | 0 |
2f6dcf6809cdcd26d08f1b412bb8091a | 6ed58d36eb56f80a3ea1a0a2ddfb820d | Converts the result of the passed function's result to be nested
within a `result` key in a new dictionary and JSONified. | def inner(fn):
fn._keys = keys
fn._to_json = True
@wraps(fn)
def decorator(*args, **kwargs):
return fn(*args, **kwargs)
return decorator
return inner | 0 |
0a3dc49fcbf36d02b1eb1012516e7819 | 509aef557e7ccaad72735ed5e21151c0 | Кількість елементів вибірки | class Selection(AbjadValueObject, collections.Sequence):
def __len__(self):
return len(self.items) | 1 |
08032a12483d797795b0e0a13dc6c7f8 | bf1ee6f38652f53a22ca393f59513007 | 硬更新 | class Agent:
def hard_update(self,target, source):
for target_param, param in zip(target.parameters(), source.parameters()):
target_param.data.copy_(param.data) | 1 |
4412fe38658e04cc5d39fab31e95fe4c | 5321f48737222ee73e58d1dffb115db4 | Returns the m_iMailSeqId. | public class Mail
public Integer getMailId() {
return mailId;
} | 0 |
9e04ab938782797d51a3199ccaec6bbd | 44aec1f2bc05d6314aa4396a238d42db | Attempts to invert this square matrix in-place. Returns `false` and leaves `self` untouched if
inversion fails.
# Panics
Panics if `self` isn’t a square matrix. | interface IMatrix4
fun invertAffine(): Matrix4 | 0 |
f823616f1fae22ddf1f6197af9faa50b | 13b9c921d2757189a22167b71669c3de | Uses zlib to decompress a string. | def decompress(input_string: str, encoding: str = 'utf-8') -> str:
return __StringCompressor.decompress(input_string, encoding) | 0 |
3b5ef4576aa0f1d18f53d806db35af34 | a7607547209ef3f9d1d054cf8bf7616e | Return entity, if relevant, or None. | class BaseRepository(tp.Generic[T, C, U], metaclass=ABCMeta):
def get(self, *, raise_ex: bool = False) -> tp.Optional[T]:
pass | 1 |
a46bbcfc4c3d5c62b821c4a373db1c2d | 54085fd5f93670be5ed5364e28fbcb76 | Отсоединить все теги | public void detachTags(Long idNews) throws ServiceException; | 1 |
e4f9da77c67a9a53629a9a770ca50760 | b4e18e930e39c02b909ec996d0fde11f | Testing clean() on a good DATETIMEFORMAT BasicConstraint. | super_DT = Datatype(name="SuperDT", description="Supertype", user=self.myUser)
super_DT.full_clean()
super_DT.save()
super_DT.restricts.add(self.INT)
super_DT.basic_constraints.create(ruletype=BasicConstraint.MAX_VAL, rule="999")
my_DT = Datatype(name="MyDT", description=... | 0 |
688a86ef3458db38dbac846499eff313 | 524bea87ac029d197c75193012744f04 | Detects if a cell is an edge of a fire growth model by checking the
Moore neighborhood of the cell.
cell: Tuple of x,y coordinates for a given cell
m: array o the fire spread area
Returns True if cell is an edge and False if not | if cell_1[1] != 0:
if self.compare_cells((cell_1[0],cell_1[1]-1),cell_2):
return True
if cell_1[1] != self.size-1:
if self.compare_cells((cell_1[0],cell_1[1]+1),cell_2):
return True
if cell_1[0] != 0:
if self.comp... | 1 |
84649b09b7bae977933d4cf6ed3bf5d8 | 3e867f3b36bf0427d2c7bca8d5f95368 | make a 500x500 canvas | function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
frameRate(55);
} | 0 |
88db7dfde124fde871a7ab48244e7863 | c47a62682d7af5553386f462fc2e0217 | 解析请假数据 | {
ArrayList arrayList = new ArrayList();
string webUrl = WebPartObj.WebUrl != "" ? WebPartObj.WebUrl : "";
SPSecurity.RunWithElevatedPrivileges(delegate ()
{
using (SPSite spSite = new SPSite(SPContext.Current.Site.Url))
{
... | 1 |
b2c5bea2724603f1c90c1405dc7686d6 | 3d9cc66f5c2bf8e434b79da1ede6c74f | Returns form used by teacher/new|edit actions | class EventController extends AdminController
protected function createEventEntityFormBuilder($entity, $view)
{
$adminChoices = [
'HOLIDAY' => 'HOLIDAY',
'SCHOOL EVENT' => 'SCHOOL_EVENT',
'EXAM' => 'EXAM',
];
$teacherChoices = [
'QUIZ' => 'QUIZ... | 1 |
d3a821688d79e973e369a97d4afe207a | ec588f30cce8bccd89bae9331b4554a8 | Функция вывода контактных данных администрации | {
$block = Block::find(8);
$contact = Contact::find(1);
return view('admin.contact.index', compact('block', 'contact'));
} | 1 |
728f1127bf19937de496b0a731f73d4d | d745f439a8f623eaa56e6168b3d0783d | Called from scheduler_tick() to periodically update this CPU's
active count. | {
s64 new;
int used;
u64 exclusive_vtime = 0;
new = perf_event_count(cinfo->event);
used = (int)(new - cinfo->old_val);
cinfo->old_val = new;
cinfo->overall.used_budget += used;
cinfo->overall.assigned_budget += cinfo->budget;
cinfo->used[0] = used;
cinfo->used[1] = (cinfo->used[1] * (2-1) + used) >> 1;
ci... | 0 |
d5bc63e01978e4c0fec6f8fa30c9da88 | 4e45d50049c7f28ee55954efa0b8d095 | Generates the dummy meetings | {
Random randomTime = new Random();
List<Point> randomTimeCollection = this.GettingTimeRanges();
DateTime date;
DateTime dateFrom = DateTime.Now.AddDays(-80);
DateTime dateTo = DateTime.Now.AddDays(80);
DateTime dateRangeStart = DateTime.No... | 1 |
25e664446a1598a0f55c2f1f7d50bdfa | 19d02514be27eeaa07fa78890d599286 | Starts the dragging of a given avatar. | {
if (!isDraggingEnabled || isDragging)
{
return;
}
Transform cameraTransform = CameraCache.Main.transform;
currentPointer.IsFocusLocked = true;
isDragging = true;
if (hostRigidbody != null)
{
... | 1 |
6fd225bae99bf8a7f8c5d99bfe4076ee | 735320587b9d14ceb73fa92741df7802 | Evaluate the wavefunction. | psi = np.reshape(state_vector, self.charge_potential.shape)
phi = np.fft.fftshift(np.fft.fftn(np.fft.fftshift(psi)))
Up = self.phase_potential.ravel()*state_vector
Tp = np.fft.ifftshift(np.fft.ifftn(np.fft.ifftshift(self.charge_potential*phi))).ravel()
return Up+Tp | 1 |
d9ca25a4c026944da3f0f4e150790f99 | 68113db13555c208c23785f92c4eff4d | 屏幕锁屏的时候,开启一个像素的SinglePixelActivity | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_S... | 0 |
2f676a48947b55d060a5ad35d763d750 | 69ff572ff98ff37a1dbc2d744092cf4f | Some folks might not want to include the default version of the lang artfacts, so let them opt out. This
"voids their warranty" if they start mixing different versions of the language together. | @AutoValue
@Immutable
public abstract class JavaToolchainProvider implements TransitiveInfoProvider
@Nullable
public abstract Artifact getOneVersionWhitelist(); | 1 |
99e1a254f63588e5f6cb6f424c108f65 | 17307ae77d3914e6400847ab414bcbaf | Used by the SFTP server code to cache a directory listing. (In
the SFTP protocol, listing a directory is a multi-stage process
requiring a temporary handle.) | static bool_t
xdr_putdirpluslist(XDR *xdrs, READDIRPLUS3resok *objp)
{
struct dirent *dp;
char *name;
int nents;
bool_t t = TRUE;
bool_t f = FALSE;
fileid3 fileid;
cookie3 cookie;
entryplus3_info *infop;
if (xdrs->x_op != XDR_ENCODE)
return (FALSE);
dp = (struct dirent *)objp->reply.entries;
nents = objp->... | 0 |
baf4e97e8cde3b83d2889c7fa7cfbd1a | 9e0a5924b83a6e54bf4e373fc80dc786 | get information of the last saved/restored snapshot | namespace EventStorePoc.Lib.EventStoreRepository
EventInfo GetSnapshot(); | 1 |
fe9cd2573989c0cd5649ef80aa4d8c0b | 41b43308c3a607847383f7275481bdc8 | Figure out the name of the Blast db to use. | parser.add_argument(
'-db',
'--db-used',
action='store',
type=str,
default='NCBI-NT',
help='blastdb used'
)
parser.set_defaults(func=convert_from_blastdb) | 1 |
f4139932f5f8592ce44f5883b216dc96 | 84c64eb8eafebe9810fc06a3d9d2dd1f | Asynchronous object call for
operation 'odbcas_ASSvc_StopSrvr' | static void
odbcas_ASSvc_StopAS_amw_(
CEE_tag_def mettag_
, CEE_tag_def objtag_
, const CEE_handle_def *call_id_
, void *const *pv_)
{
odbcas_ASSvc_StopAS_amt_ f_;
*((CEE_tag_def *) &f_) = mettag_;
(*f_) (
objtag_
, call_id_
, *(IDL_long *) pv_[1]
, *(IDL_string *) pv_[2]
);
} | 0 |
4b5e15db05207080507a2b0317137456 | a8b54256ee886fc207ff92b619987b38 | Возвращает реверсивный вариант сравнения. | namespace Labo.Common.Comparer
public sealed class ComparerReverser<TItem> : IComparer<TItem>
public int Compare(TItem x, TItem y)
{
return m_WrappedComparer.Compare(y, x);
} | 1 |
d27b5f1bd56edcdd198c2828447087c2 | 60ad65e7b791a374658ffffa914c6b0d | Metoda pobierająca ocene produktu | public class Review
public float getCoef(){
return coef;
} | 0 |
d32b81d19e71f0458beac168eb7783cf | ace799ea2577b19d50c83c5ebb4463e7 | Returns children whose manifest must be updated during invocations to
AddRoute. | del path
skip_module_attributes = {
"gen_decode_proto_sparse",
"gen_decode_proto_map_op",
"gen_equi_join_indices",
"gen_parquet_dataset",
"gen_run_length_before"
}
if inspect.ismodule(parent):
children = [(name, child)
for (name, child) in children
... | 0 |
ea7c817895b85ec171f6f0a2129c837e | cc6b6eecc2d8f41f1035de2bfd1fef5d | 获取百度地图静态图片 | headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36'}
source = "https://www.google.cn/maps/vt?lyrs={style}@804&gl=cn&x={x}&y={y}&z={z}"
furl = source.format(style="s",x=x,y=y,z=z)
pic=requests.get(url=furl,headers=headers,timeout... | 0 |
d9f119da8f891fde2f2e3322247cc641 | af0c78c6ccfc2b86d7a1091b0613077a | 通过大图的url获得小图的url——在路径中的图片名前面加small | {
$base_img = strstr($base_img, '/Uploads/');
$arr_img = explode('.', $base_img);
return $arr_img[0] . C('SMALL_IMG_SUFFIX') . '.' . $arr_img[1];
} | 1 |
b8c34f6f8aafbc77919d145570f12e7a | b73a5cdddd1d429a635ec35cece01f1b | Removes a track from a member playlist. | $trackIds = array();
foreach (explode(',', $this->params('trackIds')) as $trackId) {
$trackIds[] = (int) $trackId;
}
try {
$this->playlistMapper->removeTracks($id, $trackIds);
} catch(DoesNotExistException $ex) {
return new JSONResponse(array('message' => $ex->getMessage()),
Http::STATUS_NOT_FOUN... | 1 |
29707c1c13df5c4020a10ca99a9f884f | d8f24f8bec9911e5c7f0834b313272d3 | Erzeugt aus der Hauptdatei eine neue Version, löscht das File der Hauptdatei | bool new_file()
{
HWND hWnd = hWnd_main_window;
if(!check_save_changes()) return false;
file_extension=NULL;
g_file_name[0]=0;
SetWindowTitle(hWnd, NULL);
SendMessage (hWnd_main_text, WM_SETTEXT, 0, 0);
return true;
} | 0 |
93b5674fb989c38b01247351c5e7b347 | 1e31637b062f95b8d4af6cd05e6dbbda | As per: https://docs.python.org/2/reference/lexical_analysis.html#identifiers | def valid_identifier(s):
return PYID.match(s) and s not in PYKEYWORDS | 1 |
fa10e516d686ddd51bf6844ed51d91d1 | 5111811e470863c67a4577725b4e04e6 | Segments a trajectory into temporally continuous parts. | bitstream = iter(bitstream)
i = 0
while 1:
if bitstream.next():
j = i + 1
try:
while bitstream.next():
j += 1
finally:
if j - i >= minlen:
yield segments.segment(start + i * dt, start + j * dt)
i = j
i += 1 | 1 |
2b00a0148689e8add48f5f9bbb3fb9d9 | 50eb22fd65692e4be6e024020eb4dabd | New creates a BoundedWaitGroup with the given concurrency. | func New() *Bufw {
d, _ := time.ParseDuration("10s")
return &Bufw{
ttl: d,
written: make(chan bool),
}
} | 0 |
64ecedee13fd4f42741f128d15d7a191 | d3232f59f036413271fab28988533595 | Parse the enumerations located in a block of code | nextValue = 0
for enumNode in argNode.getElementsByTagName("enum"):
enumName = enumNode.getAttribute("name")
enumDoc = _get_node_content(enumNode).strip()
enumValue = nextValue
nextValue += 1
if enumName in argObj.enumsByName:
raise ArParserError("%s: Duplicat... | 1 |
0e8563336ca84d632595aa58a46715a4 | 7e05ba6b5bcf93c40122146db80c3a57 | Display the indicated routine. | abstract class RoutineController extends \BaseController
public function show($id)
{
$routine = $this->routineRepository->find($id);
return ($routine) ? $routine : Response::json(['message' => 'Specified routine (' . $id . ') could not be found.'], 404);
} | 1 |
21687b52f3877050cf78b1232d1d14f6 | c169164b29347dbe2eb77e05ee41178d | Overridden to make labels super-selectable. | class EditableLabel(QLineEdit):
def mousePressEvent(self, e, Parent=None):
QLineEdit.mousePressEvent(self, e)
if (not self.clickedToFocus):
self.selectAll()
self.clickedToFocus = True | 1 |
1613b7b582344b7071050d7baebafda6 | b5001ddb58fc7941975fac5794a1cfd3 | wrap the radian value to the range [-pi, pi] | int count=0;
while(radian>_pi || radian<0){
assert(count++<20);
if(radian>_pi*2)
radian-=2*_pi;
if(radian>_pi)
radian-=_pi;
if(radian<0.0)
radian+=_pi;
}
return radian;
} | 1 |
d7cdb20b1d1ddf579318917f42639a77 | 0a183b3e500231aa95dedf957d4d9db8 | Returns a sqlalchemy.ext.asyncio.AsyncSession manager for use in a
context manager. | class FastAPISessionMaker:
def context_session(self) -> Iterator[Session]:
yield from self.get_db() | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.