query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d593299ee1740d15ee009f495d8a4b6a | bd29f9d50765a5316dc37e1c41e000f4 | 获取12306的cookie | def get_cookie():
options = webdriver.ChromeOptions()
options.add_argument('headless')
driver=webdriver.Chrome(chrome_options=options)
url="http://q.10jqka.com.cn/thshy/"
driver.get(url)
cookie=driver.get_cookies()
driver.close()
return cookie[0]['value'] | 0 |
0ad39105a3f885b44ad25f1e6afcd20b | fc71e7c95f25bbee3fa3359bc00a3591 | Create a new stripe subscription for the given customer id to the given price
id. | export class StripeService extends Service
static async createCheckoutSession(priceId: string) {
const result = await Service.post<
{ priceId: string },
StripeSessionIdResponse
>("/stripe/create-checkout-session", {
priceId,
});
try {
const stripe = await this.getStripe();
... | 0 |
53740b98e4ef592cec17c3797170c1c8 | 983ef3da6f362420845bdde8ca8c0ffe | ボールがゴールに入るか、ラインを越えた場合、ボールをキックオフ位置に戻す | {
float CheckBallCharacter = Random.Range(0, 1.0f) * 100;
if (CheckBallCharacter < 48.4)
{
GroundBallOut();
}
else if (CheckBallCharacter < 48.4 + 8.3)
{
LineBallOut();
}
else
{
FlyBallOut();
}
... | 0 |
d9b62da6420214d31e5f017bf9d39ace | 496cb927d1e863d8a709efa9ae4b12fb | 获取具有过期时间的hash | if not self.cursor:
raise ModelNotRegistered('%s not registered. Call orm.register(model_class) to solve the problem.' % self)
return self.cursor.hash(self.basekey(),self.timeout) | 1 |
7a4e7e83af3d9c12915374d03692a865 | e2e34bd7f89725be42e50c4cccffcf47 | Set the position the particle starts at the beginning of a loop | void Skills::SetParticleOffset(DirectX::XMFLOAT3 newOffset)
{
mPS.mStartingPosOffest = newOffset;
} | 1 |
1568c60b475f77ee234d845d58dd7e6a | 3d65548c02bb6125a89e1d78d9b37414 | メンション付メッセージを送信します。 | if not user:
user = message.author
try:
response = await message.channel.send(user.mention + '\n' + content)
return response
except Exception as e:
print('-----メンション送信に失敗-----')
print_error(e) | 1 |
cad8ce08e1f32f9fd8263683f4ec036b | 15cb56f968a1b1b46cc92f595cb2bb66 | Déplacement de la passerelle en fonction de :
et déplacement des surfaces qui la composent | if collisionObjet(position,randPortail1):
position = [randPortail2[0],randPortail2[1]]
motoTab.append(ajoutPosition(position,motoTab[-1][2],motoTab[-1][3]))
randPortail1[0], randPortail1[1] = randMapCoordGen()
randPortail2[0], randPortail2[1] = randMapCoordGen()
elif collisionObj... | 0 |
8c8e7d98a4efa66647366636afe89ae0 | ac53ca01c7ca91cd86c4e65ce584cddc | Given a SLL node, removes nodes with duplicate values
O(n) time, O(n) space | if head is None:
return head
_set = set()
previous = head
current = previous.next_node
_set.add(head.value)
while current:
if current.value in _set:
previous.next_node = current.next_node
else:
previous = current
_set.add(current.value)... | 1 |
9231baa9888f734735e698970847e285 | 52bd18b31ba997fefab90a9b71c2bad8 | Test library handler for top rated group page. | {
$topGroup = (new Group([
GI::PARAM_MIDDLEWARE_LIST => [self::class . '::topMiddlewareHandler'],
GI::PARAM_CONTAINER_CONFIGURATORS => [[self::class, 'topContainerConfigurator']],
GI::PARAM_REQUEST_FACTORY => null,
]))->setUriPrefix('/api/v1');
... | 0 |
f41dfeaf75ceefe77eb93a5cc6cc3e43 | 0aa79dbf2f7400d9767022ccd6d1797f | ### validity | ".valid.r.Model" <- function( obj )
{
univ <- .get.univ.Model()
multiv <- .get.multiv.Model()
if ( obj@r < 1 ) {
stop(paste( "Wrong specification of slot 'r' ",
"in 'model' object. Dimension of ",
"variables must be positive.",
sep ... | 1 |
f3a0ced6dd52a6b6294db237986eb3d1 | b4eb3cf0964381fd60cea20d3d295a69 | Holds information about the carbs consumed | class Meal:
def __init__(self):
self.ready = False
self.started = False
self.forceEnd = False
self.start_time = 0
self.start_weight = 0
self.end_time = 0
self.end_weight = 0
self.step_offset = 0
self.timeLastAte = time.time() | 0 |
a6daafb16ff570b72d8d21a204845968 | 042894a291dd4b2ca4c89b725134c6b8 | Input minimum and maximum latitude and longitude
Returns center latitude and longitude | function getCentroid(minLng, maxLng, minLat, maxLat) {
var avLng = (minLng + maxLng) / 2;
var avLat = (minLat + maxLat) / 2;
return new LatLon(avLat, avLng);
} | 1 |
e1b394a967c7f9bf357878701c240dc5 | f5fce99253b2d8f59791116977647451 | удаляет все связанные с пользователями записи (заказы, пассажиров, логи) | public void deleteRecord(Guest guest, Book book) {
Session session = null;
try {
session = sessionFactory.openSession();
Guest g = (Guest) session.createQuery("from Guest g where g.login=:login")
.setString("login", guest.getLogin())
.u... | 0 |
d453897b53dde114ad0edff531a096b2 | d6d14526638c26770c60a73868ce62f1 | Reset compiler flags to default state. | fInlining = fReuseMem = fReuseAtom = fLoop = false;
fGuardMove = fGrouping = fMerging = fSystemRulesetsInlining = false;
} | 1 |
0f9817315724eca5ca6744550c3c4108 | 5d03a998e689eb98037a9ba3d7377483 | Removes the specified key event post processor from the list of
registered post processors. The manager always post processes events,
regardless of its existence within the list. The manager
can be added and removed from the list, as with any other
post processor, but this does not affect its ability to post process
... | public class Console extends PrintStream implements InputProcessor
public boolean removeProcessor(@Nullable Processor l) {
return COMMIT_PROCESSORS.remove(l);
} | 1 |
d2274d80e278868542b3da582d9f2d65 | c8fbe0c9558ffb631b4c46929ec10bd5 | selecciona un numero aleatorio entre los numeros obtenidos por parametro | public class Niveles : MonoBehaviour
public void GetRandomNum()
{
int auxMax, auxMin;
auxMax = numeroRandom + 2;
if (auxMax > spritesLetras.Length)
{
auxMax = spritesLetras.Length - 1;
}
auxMin = numeroRandom - 2;
if (auxMin < 0)
{
... | 0 |
e80eec69c30d652312cc5ccef2dbb2f5 | fdb10509713e2c744babc7e858fcd26b | Register a new DataGroup object. | class DataGroup(PlotObject):
#-------------------------------------------------------------------------------
def add(self, lst, title='', lineStyle='', options=None, optmerge=False):
opt = self.options if options is None else (self.options + ' ' + options if optmerge else options)
if title: opt +=... | 0 |
f7d3aa99b3a331cd90f9e7c59c445348 | 4390540f1ec187302a814d5993ae7459 | Called when a server ping has been received. | public class RTMPClient extends BaseRTMPHandler
@Override
protected void onPing(RTMPConnection conn, Channel channel,
Header source, Ping ping) {
switch (ping.getValue1()) {
case 6:
Ping pong = new Ping();
pong.setValue1((short) Ping.PONG_SERVER);
int now = (int) (System.currentTimeMillis() ... | 1 |
323a98ec7bae90a9d44e01479f5c40da | 9f56b678e611c58e6cbdc58b962631ac | 猜测给定 url 的友链地址 | var options = {
uri: uri,
followRedirect: true,
encoding: null,
timeout: 10000
};
request(options, function (err, res) {
var data = {
internal: {},
external: {},
res: res
};
if (err || res.statusCode !== 200) {
... | 1 |
ea242d12c4f942cac3cc6d7adb55fcbc | 43545ee36875be59e6a2c2d0323dbc43 | Makes an LSP document symbol request and returns the response and the text snapshot used at
the time the LSP client sends the request to the server. | ITextBuffer textBuffer,
ILanguageServiceBroker2 languageServiceBroker,
string textViewFilePath,
CancellationToken cancellationToken)
{
ITextSnapshot? requestSnapshot = null;
JToken ParameterFunction(ITextSnapshot snapshot)
{
... | 1 |
53a9c8abd8b1f6ef6452ecd99288a62d | 2103d692399f3333082b17b59b1ce4cf | Returns an array of hashes with error codes => messages | class CheckMetaRuby
def results
@results ||= { ok: [], warning: [], critical: [], unknown: [] }
end | 0 |
eb839ef4ad3743e3269f55726bbe3b7d | 1c41ab803780168cec356225372eb9ce | gets the relations of the given type using a query (a lot faster)
will return an empty list if no relations found.
will return null if the type is not supported | namespace MonoSoftware.MonoX.DAL.RelationClasses
public partial class NewsCategoryRelations
public virtual IEntityRelation GetSubTypeRelation(string subTypeEntityName) { return null; } | 0 |
adf85dd473f73e9e167b08977826c71a | 6e1aaec109af6f06726787f39059e6f2 | Get endpoint names | with open(str(REPO_DIR / ENDPOINTS_MD)) as f:
contents = f.read()
return [e.split("?")[0] for e in ENDPOINT_PATTERN.findall(contents) if e] | 1 |
b14bee78115cf1acfa28282e5e829a63 | ff68bac5074f74edd1f31b3ca389e93e | Retorna as propriedades de classes Stateless que devem ser excluidas. | class MyClass
public function getExcluido()
{
return $this->excluido;
} | 0 |
3243de09f024e4cac1ea426501bf3138 | 6d7acf5d26f8629812c1f0e5ae61a4ce | ! \brief Stops BC operation for the device
This function stops BC operation for the device. | {
if( bc66 ) {
bc66->control_lines.MDM_RESET_N(1);
bc66->func_delay(100);
bc66->control_lines.MDM_RESET_N(0);
bc66->func_delay(100);
}
return bc66_ret_error;
} | 0 |
9c310fd61cf2295bea8ed08caa483154 | 721835063c1fcfdbadd5b4a55043f8a4 | FUNCTION
Description : Disable the UART receiver.
This function allows the user to disable the UART receiver.
END | if (UartReceiveEnabled != 0U) {
pUSART->Control(ARM_USART_CONTROL_RX, 0U);
pUSART->Control(ARM_USART_ABORT_RECEIVE, 0U);
UartReceiveEnabled = 0U;
}
} | 1 |
29cc835ba4eb6ac74f09ac0c3b567173 | af10e48653b1669b866db7615fffbcc8 | Specify an empty configuration file. | class TestConfigSerialization:
def test_parsing_empty(self):
with raises(ValueError):
parse_config("") | 1 |
47f27ad5151a3f68c85eeb7b4f1df2f5 | faee5bf9fac7791b2c49f503673fb1d4 | Returns the meta object for class '{@link org.eclipse.stem.diseasemodels.poliodiseasemodel.OpvLabelValue <em>Opv Label Value</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LabelBag_labelBagEvalLabels_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LabelBag_labelBagEvalLabels_feature", "... | 0 |
3bc58955145f926afee6c4b6f6ad9879 | 1c6667fe4b75f29651f58c3dbaafb1c1 | Increase the waiting time of connecting to the server when connection failed or
interrupted | class Configuration
public function setRetryConnect($retryConnect)
{
$this->attributes['retryConnect'] = (integer) $retryConnect;
} | 0 |
4ac3f5e4b3de59b931f841ef20cd6f03 | 6286e34c29c4e05d46fda5d52c3bf121 | Multiplies each element of the vectors together and adds them | {
__inputVecType__ sum = __inputVecType__.Zero;
foreach (var e in vectors)
{
sum += e;
}
return sum;
} | 0 |
bd79ef82398bfb96709473d02eb018eb | faf39455aa59ba4eded562d34a8ff208 | Getter for <code>Recognition.train_set_name</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.6.2"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class RecognitionRecord extends TableRecordImpl<RecognitionRecord> implements Record11<Integer, String, Date, String, Integer, Integer, ... | 0 |
327ef085d7489113cca7e2e5424e3bda | da417d28c2452353bc480fba898221a4 | Fills in form field with current date and strtotime modifier | class AssignmentDatesForm extends FormBase
public function buildForm(array $form, FormStateInterface $form_state) {
date_default_timezone_set('America/Los_Angeles');
$date = date('Y-m-d');
$form['date_start'] = [
'#type' => 'date',
'#default_value' => $date,
'#title' => $this->t('Date you ... | 0 |
c334c8c4b9a0a6d9b9e82d23faf4551a | e4fcbb645ea202f58500ea1a62995e26 | Input two strings of equal length and count mismatches between them | if len(Ref) != len(Alt){
return -1, ErrUnequalSequences(-1.0)
}
mismatches := 0
for pos, _ := range Ref{
if Ref[pos] != Alt[pos] {
mismatches++
}
}
return mismatches, nil
} | 1 |
51350d1745dbe6a09ae6cf015bf5781a | caca6d590ef323b7e7b0021e74f15986 | 测试文件的io | {
$path = "test2.txt";
$path2 = "test3.txt";
$fp = fopen($path, "r");
$arr = file($path);
fread($fp, filesize($path));
fgets($fp);
file_get_contents($path);
fwrite($fp, '@');
file_put_contents($path, 'HaHa');
copy($path2, $p... | 1 |
5746cd0a1e43e717b5cd716a6061a23c | f8dbefcbca9967396a01e15e97c3db89 | Transcript Hash (https://tools.ietf.org/html/rfc8446#section-4.4.1)
Transcript-Hash(M1, M2, ... Mn) = Hash(M1 || M2 || ... || Mn)
注意:Record層(TLSPlaintext)は含めないで Handshake の部分だけを結合してハッシュを求める | assertIsNBuffer(ABuf, params, 'A');
assertIsNBuffer(BBuf, params, 'B');
assertIsNBuffer(SBuf, params, 'S');
return crypto.createHash(params.hash)
.update(ABuf).update(BBuf).update(SBuf)
.digest();
} | 1 |
5ff339f12dbea5ab9b49e5651a2d636c | bc62f64fa4d2f82936b70b7d233138f7 | 添加某一种商品(递增) | @WebServlet("/adminProductServlet")
public class AdminProductServlet extends BaseServlet
public String xiaJia(HttpServletRequest req, HttpServletResponse resp) throws Exception {
String pid = req.getParameter("pid");
System.out.println("执行到这里了");
ProductService productService = new ProductServiceImpl();
Product... | 0 |
f4f30715b9cb4ad5d4677d3ef0e75806 | ccf661830d0d557f345ace3b8f6ad410 | Sets the track count. | if (count <= 0) {
throw new IllegalArgumentException("Count must be greater than 0.");
}
this.count = count;
} | 1 |
497fc3123c690fac8edce60dc5851eb0 | cb6b306d815caa3500fae535a88e55ba | Set the running state to a new value to either report that the animation
Stopped or that it started.
animation is still running, false means that it stopped | void setRunning(bool active); | 1 |
9044b0687c1098bd8840bf89d4b857f2 | d2cdc17892e9a4c9519367e81e69a495 | Set Send Callback
Configure the callback URL to notify when an outbound fax is made. Each FoneNumber can be configured to use its own callback URL for handling send notifications.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be inv... | class CreateIncomingPhoneNumberOptions extends Options
public function setStatusCallback(string $statusCallback): self
{
$this->options['statusCallback'] = $statusCallback;
return $this;
} | 0 |
34f9e9578907080fe64507b6ac375c88 | 01ca891dfc47b8384a56c874ab6c154f | Updates the travel factor for all sea voyages | mc_obj.DAT_B_skim_PK['Total_Cost'] *= boat_fact
mc_obj.DAT_CR_skim_PK['Total_Cost'] *= cr_fact
mc_obj.DAT_RT_skim_PK['Total_Cost'] *= rt_fact
mc_obj.DAT_LB_skim_PK['Total_Cost'] *= lb_fact
mc_obj.WAT_skim_PK['Total_Cost'] *= walk_fact
mc_obj.DAT_B_skim_OP['Total_Cost'] *= boat_fact
mc_obj.DA... | 0 |
6ec405de18dced609afaddbac50992fb | 0d48e7b826361c988371ddf9faedca5b | 获得进程的运行时长 | user_hz = commands.getstatusoutput("getconf CLK_TCK")[1]
jiffies = commands.getstatusoutput("cat /proc/%s/stat | cut -d\" \" -f22" %pid)[1]
sys_uptime = commands.getstatusoutput("cat /proc/uptime | cut -d\" \" -f1")[1]
runtime = int(float(sys_uptime)) - int(jiffies)/int(user_hz)
... | 1 |
b52e4988d0f67e0f7653f335901430f7 | ff6560a0416ad17d58fd2f31cf9459e1 | Special non ascii keyboard input handler | {
switch ( keysym->sym )
{
case SDLK_ESCAPE:
Quit( 0 );
break;
case SDLK_F1:
break;
default:
keystat[keysym->sym%256] = 1;
break;
}
return;
} | 0 |
a5c893ef2fd05137712b5f04e83beaf8 | 6b9e535af9d063942bce5a645fc9a9aa | サウンドのResume処理 | {
if (getStream(sound, out int stream)) {
Mix_Resume(stream);
return true;
}
return false;
} | 1 |
13a91dff03367eb2d28793b4e80d47a9 | 50e7a23b99a2b176b5a2d11394943be1 | Get related revenue and cost values for a specific quote. | @JsonInclude(Include.NON_NULL)
public class OpenAccessPaymentData
public final QuoteData getQuoteData() {
return quoteData;
} | 0 |
2a19128e5037ddaffd20daae42dd9767 | 6d707a7c113d5796fae1d55ddd0dcc01 | Agrega una nueva categoría a la lista de categorías de contadores | namespace Alemana.Nucleo.Common.Instrumentation
public static class InstrumentationProvider
public static void AddCounterInstance(string categoryName, string counterName, string instanceName)
{
if (!isInitialized)
{
PerformanceCounterContainer.AddCounterInstance(categ... | 0 |
ecc509d3b49317857f24884aaac0590c | 1e5a752c240f9dbf3236af885f532212 | Tests the postProcessXml method of LogoutResponse | try {
bean.initialize();
bean.logout(" ");
} catch (Exception e) {
fail("Should not be here.");
}
} | 0 |
6a70afbb26da130457d0078a635ce094 | bb228f46cedaff32c1e8561e880ff5ea | 回答済みユーザー取得 | class PollManager(SingleDeleteManager):
def answered(self, user):
return self.filter(votes__author=user).distinct() | 1 |
0020c1db8bd149069dac42fb9644f3f4 | 2d2a9f0ecbf074ad7f08fa7e829823fc | 获取curl选项 | class cCurl
public static function getCurlOptions() {
return self::$m_curlOptions;
} | 1 |
c5e788615c49ac783d2610cf6dd80c04 | df15e29e7b1adc94654583391b3b7fe8 | 查找2 | def second_found():
s = input()
if s.count('f') == 1:
print(-1)
elif s.count('f') == 0:
print(-2)
else:
print(s.find('f') + s[s.find('f') + 1:].find('f') + 1) | 0 |
6491718fe90e0e22976dca9ca71b2c5d | 0053931d8f98bd3bb9dbc23364e0dd69 | 删除合法位置p处节点返回其数值 | {
if(pos_exist(p))
{
for (int i = p; i < _endl - 1; ++i)
{
_arr[i] = _arr[i + 1];
}
_endl--;
return p;
} else
{
return p;
}
} | 0 |
29186cd24cd6ccc6e169804d2ed2958f | 5e771fd4301d41626536e009886b381a | Create a new surface for PDF output | self.dir = tempfile.mkdtemp()
self.pdf_mode = pdf_mode
self.pdf_files = []
self.ps_files = []
self.pageno = 1
self.orient = orient | 0 |
7f1e8a0da9eec3963224d52c61ead675 | a473eca4fac400f9b7f222019a0ef242 | Function supports temp pages with start and end dates by compiling information into a list of dictionaries. | mobiles = []
mobile_library = 'Mobile 1'
pages = [1, 2, 3, 4]
dates = {
"Monday": "2019-05-20",
"Tuesday": "2019-05-21",
"Wednesday": "2019-05-22",
"Thursday": "2019-05-23",
"Friday": "2019-05-24",
}
for page in pages:
stop_list_html = requests.get... | 0 |
6231aa624442a00d309321a1bcffb285 | 96cabcc8e135a09ffcf119fab2f5e69b | add a function to be processed when writing the scan data | void XsScanner_setScanLogCallback(XsScanLogCallbackFunc cb)
{
Scanner::setScanLogCallback(cb);
} | 1 |
d9979fb41d79db37c5e30f30bacf5bd5 | e70f0a91e8b70fe266c008159ec09ee8 | It enables the module for the sending of events to the API. | namespace Gadgeteer.Modules.Gralin
public class Nordic : Module
public void Enable()
{
Api.Enable();
} | 1 |
7199148ce7ab4fbc9a7f0ca3f45be35f | ed8478763355e6b24a126b53ef4f5a33 | 更新背景颜色
根据节点数 更新指定颜色bg | if (!node) { return }
let s = node.getComponentsInChildren(cc.Sprite);
for (let i = 0; i < s.length; i++) {
if(bGray) {
s[i].setMaterial(0, cc.MaterialVariant.createWithBuiltin("2d-gray-sprite", s[i]));
} else {
s[i].setMaterial(0, cc.MaterialVariant.createWithBuiltin("2d-sprite", s[i]));
}
}
... | 0 |
de4a4b6f53c4881de878720f4e48abde | f167e6704f0e2ab824ec40f28d381597 | Set 'None' normalization for MD plots | self.p.background_fill_color = 'black'
self.p.axis.visible = False
self.p.xgrid.grid_line_color = None
self.p.ygrid.grid_line_color = None
self.p.xgrid.minor_grid_line_color = None | 0 |
291e988282aef5424b8b468e72263f4f | b854aed42c478d55711a5e6a5cc04c35 | Creates a report for the log and updates the "lastCount" values. | self.warnCount = 0
self.errorCount = 0
if (not self.warningPattern) and (not self.errorPattern):
return
wre = self.warningPattern
if isinstance(wre, str):
wre = re.compile(wre)
ere = self.errorPattern
if isinstance(ere, str):
er... | 1 |
18315e176f52cb3ae48bf9b71d007dca | 2a0567cc8162ecb2cad25bba7e2559a5 | 商品移動リスト取得.
<pre>
対象日における対象商品を含む商品移動をすべて取得する.
</pre>
部署
商品移動日
商品 | public function listMovementHistoric(
Product $product,
int $limit,
$query = null
): Collection; | 1 |
92060a0906d15cbb8773ac8056e760d0 | 4820d616ba77ad3fd9cef585a883bcf5 | Class representing a sensor on the ThorLabs PM100USB
.. warning:: This class should NOT be manually created by the user. It
is designed to be initialized by the `PM100USB` class. | self._state = None
self._api = api
self._unit = unit
self._device_state_attributes = {}
self.sensorName = sensor_name | 0 |
5beda924a5feca66f71fd751dc2c5b48 | d9a7f19f362419190bc853bc0704bf4c | remove data from database when plugin deactivated | class PluginSecretblog extends Plugin
public function Deactivate(){
$this->Cache_Clean();
return true;
} | 0 |
d249327387dc398b9f3f07dd81ece0db | 20323ac4527ddabd04e4bb6194a5e2f2 | Indicates whether estimated fundamental matrix is refined among all found inliers.
This is only used when general scenes are allowed. | boolean isRefined(); | 1 |
95c2447bdb10bafb75553b755b3bd6b0 | b6e36e08ba8ea46cd06f3c4f1f730295 | Check if the shorty is expired.
TRUE if shorty is expired, FALSE otherwise. | {
if ($this->getDateTimeObject('expires_at')->getTimestamp() < time()) return true;
else return false;
} | 1 |
e3caa3d96c7b7afec3a9c676ac9c36ff | 4d1aaaedce84c97bf2663a0c3b007dba | Step for Randomized Smoothing. | alpha = self.step_size
gamma = self.mdp_obj.discount
mdp_obj = self.mdp_obj
V = self.v
N = mdp_obj.num_states
A = mdp_obj.num_actions
S = np.random.randint(0,N,self.num_samples)
actions = self.policy[S]
for a in xrange(A):
a_mask = (ac... | 0 |
ebfde2ea08548389bf412a5c72441774 | 6565198b5d306107e778e4b8f507f91d | Returns the object's last projectile fire time in ms | void idProjectile::Event_GetLaunchTime( void ) {
sdProgram::ReturnFloat( MS2SEC( launchTime ) );
} | 0 |
57e1cf105cbf816404bc11e7cfb48117 | 1583c0396fa6b0d9702c6227204dbcd6 | @brief Consults the boot drive. | bios_regs_t regs;
uint8_t count;
if (multiboot_magic == MULTIBOOT_LOADER_MAGIC) {
bios_boot_device = (multiboot_info.boot_device & 0xff000000) >> 24;
dprintf(
"bios: boot device ID is 0x%x, partition ID is 0x%x\n",
bios_boot_device, (multiboot_info.boot_device & 0xff0... | 1 |
0c5cea6202ad2dc0ce621ebe40ff8c3c | 4d6b4ddf56feb6b323fefd91e4b7336a | turn the right face clockwise | std::array<std::array<char,9>,6> temp;
temp = cube;
cube[1][6] = temp[4][8];
cube[1][7] = temp[4][5];
cube[1][8] = temp[4][2];
cube[2][0] = temp[1][6];
cube[2][3] = temp[1][7];
cube[2][6] = temp[1][8];
cube[3][0] = temp[2][6];
cube[3][1] = temp[2][3];
cube[3][2] = temp[2][0];... | 0 |
e40b3b0ca0f8abed7d32f9a39d9bab21 | 220db9228cef7a86a07a22335206df30 | GET /api/training_session_types | class TrainingTypesController extends Controller
public function index()
{
return response()->json([
'allTrainTypes' => $this->trainTypeRepo->getAll()
]);
} | 1 |
89db1f749442e4c91744d1d4766866d1 | 7e5bb06188d4973290f46c8e2999e19b | Generate the main part of the email body, a line at a time.
The text in the body might be truncated after a specified
number of lines (see multimailhook.emailmaxlines). | class mime_mail
function _get_html_mail_body()
{
if(isset($this->_mail_html_body) && !is_null($this->_mail_html_body)) {
if ($this->_mail_embedded_count > 0) {
$this->_mail_html_body = $this->_replace_embedded($this->_mail_html_body);
}
return chunk_split(
base64_encode($this->_mail_html_body), MIM... | 0 |
e7be949890acf4fa976b80933e20dc0a | e9675679db1b1b543b9b198621a9946f | Create a Command object with a ui and store factory. | namespace Rem.Ria.AgencyModule.QuickPickers
public class AgencyQuickPickerViewModel : QuickPickerViewModelBase
protected override ICommandFactoryHelper CreateCommandFactoryHelper ( ICommandFactory commandFactory )
{
return CommandFactoryHelper.CreateHelper ( this, commandFactory );
} | 0 |
5a089120f0bb4905b866886e1fc8798d | fac0269f6ceae339a7945f799b680a69 | The {@linkplain #gt(MqlValue) largest} {@code n} elements of
{@code this} array, or all elements if the array contains fewer than
{@code n} elements. | @Override
public <T> T[] toArray(T[] a); | 0 |
475096b709fdd9adbc0f7fcd77c718fc | 57ec392a8ea64fafc73a3939d1e10ef1 | Create cookie and set cookie "forever" | class Cookie extends \Dsc\Singleton
public static function forever($name, $value, $path = '/', $domain = null, $secure = false)
{
return static::set($name, $value, static::forever, $path, $domain, $secure);
} | 1 |
85deb8cf3bc7adf16d323d152cfe19fd | e620979d41bfae318525f282194c966e | load embedding into memory, skip first line | def loadWordEmbedding(file):
f = open(file, 'r')
f.readline()
lines = f.readlines()
f.close()
wordvec ={}
for line in lines:
items = line.split()
if len(items)<=1:
continue
vec = items[1:]
vec = [float (i) for i in vec]
wordvec[items[0]] = vec... | 1 |
20425b79c04b38ffca8a44358519297c | 56e47d8084d0ac1e7e41828930dc4fc6 | Loads the graphs of the corpus and return the freshly
added text ids. | corpus_files = [f for f in os.listdir(self.path) if f.endswith(".txt")]
self.texts = list()
for corpus_file in corpus_files:
curr_text = self.read_file(self.path + corpus_file)
self.texts.append((corpus_file[:-4],curr_text)) | 0 |
64e7b9c41b424bef6a1da57c9e20f2f9 | 8ec21a1bac284baeb13a203be238d905 | Construct a persistent cache that is stored on disk. | class PersistentCache
public function __construct($cacheKey)
{
$this->cacheKey = $cacheKey;
if (is_null(self::$content)) {
self::$content = array();
self::populateCache();
}
} | 0 |
db411e49098d0973d850400b06c7e57a | c9f63112ab55e1f21a6d21e046a0fd6a | <p><span class="changed_modified_2_0">Return</span> a
<code>URL</code> for the application resource mapped to the
specified path, if it exists; otherwise, return
<code>null</code>.</p>
<p class="changed_added_2_0">It is valid to call this method
during application startup or shutdown. If called during application
star... | URL getResource(String path) throws MalformedURLException; | 0 |
1c33ae05417afb62595b4b94d2f2bc98 | c8b03b3a7d3178d46c4071a5adb590f4 | Function to get all ideas from a specified user from the database | namespace Integratieproject1.BL.Managers
public class IdeationsManager : IIdeationsManager
public IList<Idea> GetAllIdeas(int platformId)
{
return _ideationsRepository.GetAllIdeas(platformId).ToList();
} | 0 |
d810df98b32b1361b7599de085d51d32 | 3457225c441a4f64db13dfe0fa182c9f | Set if this Timer is effected by the Clocks Scale Factor or not | public class StsSensor extends StsMainTimeObject implements StsSelectable, StsTreeObjectI, StsTimeEnabled, StsMonitorable // , StsViewable
public void setIsRelative(boolean val) { isRelative = val; } | 1 |
d03fe9a518ce61def7e2eeec5053bf99 | 3c4aa8467ab754c21171d0010b26e5cd | 导出闸门报表数据 | function exports(){
var param = $("#countForm").serializeObject();
window.open(myPath + '/exports.do?plateNo=' + param.plateNo +'&parkId=' + param.parkId + '&TimeFromD=' + param.TimeFromD+ '&TimeToD=' + param.TimeToD);
} | 1 |
5fb972629af5449448bc431514cce97e | 690f476bc369606cce031741521919e2 | Вытаскивает несколько купюр из пачки. | {
Pack result;
if (Count > 0)
{
result = new Pack { Coin = this.Coin, Count = this.Count };
Count = 0;
}
else
{
throw new Exception("Пачка пуста.");
}
return result;
... | 0 |
28fc6a46e9e5d678a5cabe8ed42cfcff | c0cfba47df468af97f98e92c0487d9bd | 生成kcore链表,按照虚拟地址升序存放kcore提供的所有的地址空间,而且这些地址空间是不重叠的 | vaddr_t
cm_getkpages(unsigned npages)
{
if(npages == 0) {
return 0;
}
spinlock_acquire(&kcoremap->cm_lock);
if(kcoremap->cm_nfreepages < npages) {
spinlock_release(&kcoremap->cm_lock);
return 0;
}
unsigned int start = 0;
unsigned ncontigpages = 0;
for(unsigned int i = 0; i < kcoremap->cm_np... | 0 |
00768f3b20071695e5f75e247f9eca7b | 71ea5fafdf48d62291194be289cfa845 | 步骤3:写入DNS、发送邮件 | Map<String, Object> map = this.freemarkerParameterMap();
map.put("apply", apply);
map.put("computes", apply.getComputeItems());
map.put("storages", apply.getStorageItems());
map.put("elbs", apply.getNetworkElbItems());
map.put("eips", apply.getNetworkEipItems());
map.put("dnses", apply.getNetworkDnsItems(... | 1 |
eaa2a915d3e05e9ee52d1f1e2ddb92a8 | 46f1a64397139b7520ba127e3bf02b2b | Update the display by maintaining the left index and showing as much text as possible
moving left to right. The display field members are changed, the glyph vector is not invalidated. | const char *p = t->line_start;
struct DSP_glyph_atlas *atlas = t->atlas;
SDL_Rect *bounds = t->bounds;
unsigned orig_pen_x = t->pen_x;
unsigned baseline = t->pen_y + atlas->line_height;
for ( ; p < to; p++ ) {
char c = *p;
struct glyph_info *info = &atlas->info[c];
SDL_Rect src, dst;
if ( info->bw != 0 ) ... | 1 |
46be51b7b9a040dd631c7839479069f2 | 44d994616bf604e7643633cda61d99a5 | Get MD5 of current block. | @Nullable
ByteString getMd5(); | 1 |
1002fb8b527f3fdd8c5ccf2f9bfee5bd | 74440dd3021cde4266092ed695067380 | 输出索引文件全部记录 | class Fds(object):
def read_all(self):
ret = []
for record_id in self.dir():
file_id,key,data = self.read_record(record_id)
ret.append({'file_id':file_id,
'key':key,
'record_id':record_id,
'data':data})
... | 1 |
a9253058a4882198f1de8e3e8419ec92 | a7b0ee84273b0ac69c65cb4e1d04ab02 | Gets a list of all places that you can get by taxi. | {
return $this->query()
->where('customerstate', 10)
->whereNotNull('location_lat')
->whereNotNull('location_lng')
->select([
'id',
'title',
'street',
'zip',
'city',
'location_lat',
'location_lng'
])
->get();
} | 1 |
071e63e871890a43b33b41d1ad8216db | 036d900b048c789a40333d07426fcc94 | 설명 : str의 오른쪽 Blank를 소거한다. | int i, last_espaces = 0;
char* value;
for(i = 0; i < len; ++i){
if(BLANKCHAR(str_array,i))
last_espaces++;
else
last_espaces = 0;
}
len = len-last_espaces;
value = (char*) malloc(sizeof(char)*(len+1));
if(value == NULL) return NULL;
for(i = 0; i ... | 1 |
d39d527208ba5bc51b5dc5b0999262c2 | 075afa065db98781d57cd7a7efab4788 | 更新底部bar前进后退状态 | {
if (wb == null) return;
IBrowser iBrowser = wb.GetBrowser();
if (iBrowser.CanGoBack)
{
backBtn.BackgroundImage = Properties.Resources.ico_cef_back_active;
}
else
{
backBtn.BackgroundImage = Prop... | 1 |
3e9b67a3808e932a78dc2bfce0af5a09 | 3d6c67b292c49fc8fb25b7458a755caf | 플로어 키가 위에서 내려온다. | public class Player_Ctrl : MonoBehaviourPunCallbacks
void Player_key_floor2()
{
if (Input.GetKey(KeyCode.A))
{
Move('a');
anim.SetBool("IsWalk", true);
}
if (Input.GetKey(KeyCode.D))
{
Move('d');
anim.SetBool("IsWalk", true);
... | 0 |
d9e9cd51b2c80a2d74d58f36f1fa297b | 9195eaadca98074124fbf18c5693bc60 | residual module of hourglass | super(HourGlassBlock, self).__init__()
self.down1 = TopDownBlock(64, 128, res_type=res_type)
self.down2 = TopDownBlock(128, 128, res_type=res_type)
self.down3 = TopDownBlock(128, 256, res_type=res_type)
self.down4 = TopDownBlock(256, 256, res_type=res_type)
res_block = []... | 1 |
68e0ebb8c3df6e1fa2cb0a0ba8b9e2f5 | a54c0ec7077f3c196383d0b6a6056eec | Key function. Listens to anything that the user types.
It is the learning key of the program. It learns everything
that it hears and then uses that knowledge to talk like a human.
It also gives access to /functions | goNext = {"TALK": False,
"FIGHT": False,
"STARE": False,
"LOOK": False,
"LEAVE": True,
"HELP": False,
"CHECK": False,
"DREAM": False}
proceed = goNext.get(str.upper(userInput))
return proceed | 0 |
23a4a6aa59d98da348d641aeace844a9 | 6f5a21cf0d6e9a65a20a158c1f7bde93 | Checks to see if the files are moving to a new location and whether
they should have the .deploy extension added, then calls the
appropriate helper method. | namespace Ducksoft.Soa.Bl.SponsorFileParser
public abstract class JobSponsorRendererBase<T> where T : RegisteredSponsorsType
protected void MoveOrCopyFiles(string targetFolderName, bool isNewXmlFile)
{
var inputFileDirPath = Utility.GetDirectoryPath(InputFilePath);
var dateFolderPath... | 0 |
f354f7e010c1f379b59af21527edf702 | b4c9ad454eae641247b08343f86ab9ec | Get all folders used to organize campaigns.
Available query fields:
array["fields"] array list of strings of response fields to return
array["exclude_fields"] array list of strings of response fields to exclude (not to be used with "fields")
array["count"] int ... | class OutboundApi
def get_campaigns(opts = {})
data, status_code, headers = get_campaigns_with_http_info(opts)
return data
end | 0 |
97b86f6c31ce7b125954d7c06550fcd0 | 728cf4641be4007b402b05ac3f6588f2 | 根据字符长度以及取值长度,计算出所有的排列个数 | namespace LotteryVoteMVC.Utility
public static class MathHelper
public static long CountPermutation(long num)
{
string number = num.ToString();
IDictionary<char, int> rptNum = new Dictionary<char, int>();
foreach (char ch in number)
{
if (rptNu... | 1 |
8daf0864712e5ac96a943ec3d7898d48 | e7f802361a00096965a4b22d1b8d7cd5 | Finally, approve the asked permissions for the website. | sessionManager.selectedSession?.apply {
appPermissionRequest.consume { permissionsRequest ->
val allPermissionWereGranted = grantResults.all { grantResult ->
grantResult == PackageManager.PERMISSION_GRANTED
}
if (grantResults.isNotE... | 1 |
222f380bee69c7ce22b6e705800efb08 | efc8dca4158ce82ae66503bfa92222f6 | load data.csv to a list | def loadData(fileName):
dataSet = []
with open(fileName) as file:
File = csv.reader(file,delimiter=',')
dataSet = list(File)
for i in range(len(dataSet)):
dataSet[i] = [float(x) for x in dataSet[i]]
return dataSet | 1 |
09f393f0925448d2b88d5a0a51d6ab4f | ece661467f0891d05e25f2602cef4c8c | 前往创建新账号 | tapCreateAnAccount() {
I.waitForElement(loginPage.newAccount);
I.tap(loginPage.newAccount);
} | 1 |
dfb030d4e4c91ff0e398d6220555dcb1 | 4267a1653b4994eea835eb919a3de8e4 | StartFunction converted the ABI-lowered parameter(s) into a
local alloca. We need to turn that into an r-value suitable
for EmitCall. | Explosion &explosion) {
CanType fnType = fn->getType()->getCanonicalType();
CanType resultType = CanType(cast<AnyFunctionType>(fnType)->getResult());
Callee callee = emitDirectCallee(IGF, fn, resultType,
ArrayRef<Substitution>(),
... | 0 |
35574263461b5e44fc75b822ff0daebc | 804e6e501f5619fd8031ca46d39d81e7 | 根据用户id和code值来检验改用户的页面是否有某个权限 | List<UserRole> list=user.getUserRoles();
if(list==null){
list=userService.getUserRolesByUserId(user.getId());
}
if(list !=null && list.size()>0){
for(UserRole ur:list){
Role role=ur.getId().getRole();
for(RolePrivilege rp:role.getRolePrivileges()){
if(code.equals(rp.getId().getCode())){
... | 1 |
d5cad8ca4c9d564e2d8e30fd159f7667 | e226f0c9809a4b06ac0c192c3f43650c | This function is used to call the PropertyChangeEvent of an Item | public void firePropertyChange(String p,Object a,Object b); | 1 |
d5971ae55c22e9c830ba600f15f4076b | f17c06220d46896a44775d3d47109c3f | 特定基地台半徑要完全覆蓋的最少段數 | double ret = 0;
double radius = getRadius();
if(radius == 0) {
return ret;
}
if(super.existCategory("偵察機系統") || super.existCategory("索敵センサー系統") || super.existCategory("滞空索敵弾系統")) {
ret = getSearchSpaceCircle(radius);
}
else if(super.existCategory("レーダーユニット系統")) {
ret = 0;
}
else if(super.exis... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.