query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f509a7bbbec9492ebf9f9d95a9cf782e | f6256275ba495f0c684d12aec8a0291b | Can invalid user add message | with self.client as c:
resp = c.post(f'/messages/new', data={"text": "Msg Here"}, follow_redirects=True)
self.assertEqual(resp.status_code, 200)
self.assertIn('Access unauthorized', str(resp.data)) | 1 |
3b108ba1b24fa4196870015e9e89f26a | 2d561ae32ba27f3e2a2c776cfb399b5b | parse list string in config.ini<br />
split string by "," or whitespace | public class Util
public static String[] parseList(String string) {
List list = new Vector();
StringTokenizer st = new StringTokenizer(string, ",");
while (st.hasMoreTokens()) {
list.add(st.nextToken());
}
return (String[]) list.toArray(new String[0]);
} | 0 |
85cc9a3599735c6bba124bd7aaa9f98a | fbee58db0276179e05f236cc1982727a | Method is called after successful download request. | public void onDownloadSuccess(); | 1 |
4781ea99a158feb9d0b21183827e66db | 298580cf83b2c8158d6a88bdea816da9 | Get the four tiles adjacent to the given tile. | return new IToken[] {grid.getTokenAt(x + 1, y), grid.getTokenAt(x, y - 1),
grid.getTokenAt(x - 1, y), grid.getTokenAt(x, y + 1),};
} | 1 |
d119d9e818e475322cdc0fb31a7cc2a0 | ffe950af64d46e1638aa04431f172b96 | Get an intent instance. | if self.is_real_user:
raise ValueError("Can't get child intent of real user")
if token:
return IntentAPI(user, self.real_user(user, token), self.bot_intent(), self.state_store,
self.intent_log)
return IntentAPI(user, self.user(user), self.bot_... | 1 |
79fc29c51bed87514eb81c8711bbc9ac | 41dfffdae5ec84f597c72891e066d856 | GET: api/IntegrationLog | namespace com.ultracart.admin.v2.Api
System.Threading.Tasks.Task<ApiResponse<IntegrationLogQueryResponse>> GetIntegrationLogsQueryAsyncWithHttpInfo (IntegrationLogQueryRequest integrationLogQuery, int? limit = null, int? offset = null, string sort = null); | 1 |
71722c6e192227f6ef1bddc59d541612 | 888ee390a727d62dc75d468dfd66eccf | Abstract method that should be override by the subclasses to manage the actions to do when the google login is completed | namespace Siren.ViewModels.Forms
[Preserve(AllMembers = true)]
public class LoginPageViewModel : LoginViewModel
private void SocialLoggedIn(object obj)
{
} | 0 |
cad2b0e72071f3a031f0a9119764922c | 4dd3ef91e6fb5715eb19f8ccce818aa8 | 获取时间 如: '2017-11-22' | func GetTimeString() string {
return time.Now().Format("2006-01-02")
} | 1 |
83063af4d15d278e0284c9b31ab67e9c | ebc3614d6fca744f8d0217d2d1456ddc | 更新时间尺度回显 | $('#result_time').empty();
var sceneName =$("#hiddenValue").attr('sceneName');
var smallsceneName = $('#task_type_smallSceneName').find('option:selected').text();
var environment = $('#dimension_environment').find('option:selected').text();
$.ajax({
type: 'POST',
url: '/gtp-report/jm... | 1 |
7bc92099c836c68fd6c31a9870789f89 | c2a62bf8498314d8c64d6b18af74bba5 | Reflect point in given plane | namespace Imml.Numerics
public static Vector3 Reflect(Vector3 value, Vector3 planeNormal)
{
return value - 2 * Dot(value, planeNormal) * planeNormal;
} | 1 |
ccda30d9edca35d6bf7b41d124e981f9 | 2e91d4af4439c6d161526defcc9fb6c8 | Sets the range of the Gyroscope. | unsigned char mpu_set_gyro_range(unsigned char range)
{
return mpu_write_byte(MPU9250_ADDR, MPU_GYRO_CFG_REG, range << 3);
} | 1 |
c0af95134d70099a2d956e575107a2b9 | 7b93a2649206a3b029fe87a206ed4632 | Clamps an integer to the range's bounds. Will round to the nearest integer in the range if necessary. | namespace Framework
public int Clamp(int value)
{
return Mathf.Clamp(value, _min, _max);
} | 1 |
ac4201d27af4ba65f5ec8cb5e23949a2 | 977da42001a00010962d6aa64d9f8f7a | 分页选取关键字查询的常见问题 | function searchCommonQuestion(pageNo,pageSize){
return new Promise(function (resolve, reject) {
util.request(api.SearchCommonQuestion, {
pageNo: pageNo,
pageSize: pageSize
}, 'POST').then(res => {
if (res.errno === 0) {
resolve(res);
} else {
reject(res);
}
})... | 1 |
5bed80e1a84d521944e513059eb2e86a | 5fad2faf538348200833d2040c4819ab | ham nay hien thuc man hinh de tim kiem nguoi dung | List<NguoiDung> nguoiDungList = new ArrayList<>();
String sql = "SELECT * FROM USER WHERE username LIKE '%" +timkiemusername + "%'";
Cursor cursor = mySqlite.getWritableDatabase().rawQuery(sql,null);
if (cursor.getCount()>0){
cursor.moveToFirst();
while (!cursor.i... | 0 |
b9a2b15f5f218958d9d9f5837985ac66 | 8f7793c109477e12ea4993a9c98bb73d | Looks for the message in the given exception
If not found, it looks in the next nested exception, recursively
If not found, returns null | namespace SGTH.Dvtel.Rest.Extensions
public static class ExceptionExtensions
public static string FetchDeepMessage(this Exception ex)
{
return ex.InnerException != null
? ex.InnerException.FetchDeepMessage()
: ex.Message;
} | 0 |
584968306f5373b5d87ece45809d9bd6 | 3cac18a60ddb25e2eb85e83d59254433 | 设置PLC的IP和Port | namespace CiXinLocation
public partial class MainForm : FormBase, MainFromInterface, LabelChangeInterface
private void button1_Click(object sender, EventArgs e)
{
byte[] ip = XWUtils.getIP4byte(textBox2.Text);
byte[] port = XWUtils.getComTime(textBox1.Text);
if... | 1 |
27781cdee8e6759c4de44d334d8f79e2 | 62aaed9d2aad5b839329ae52536b05f6 | 充值或提现提示 | @Service
public class TextService extends H5BaseService{
public String getRechargeText() {
return GlobalProperties.getProperty("app.text.recharge.tips");
} | 1 |
6d2118e11f137d3efd2cde0f30d3b8fe | f8c62b378800ebe18e64b31ac76b5bf9 | 1、使用SimpleDateFormat类,把2018-03-04转换为2018年03月04日。 | public class Example27
public static void main(String[] args) throws ParseException {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd");
String str="2019/07/30";
System.out.println(sdf.parse(str));
} | 0 |
a43c8562144b130a416584931b688805 | 013dcc39f1bf878e62a13706115953db | Returns the vertex label of this vertex. | class Vertex (object):
def get_label (self):
return self.label | 1 |
bd1de9108da9922f7e7f8a2223f7fec7 | 4278522cd67da6174d188a2b5d8cd38f | Возвращает результат Алгоритма | class StrategyContext{
void getResult()
{
stra->algorithmInterface();
} | 0 |
c90ccf5f456d52cadeee467c0aa68e7f | da4b314e740390c3b6fc2806e194bba2 | \brief Returns the current direction of the sprite's animation. | {
int index = m_currentAnim->GetIsoSpriteIndexForTime(m_currentAnim->GetElapsedSeconds());
IsoSprite* isoSprite = m_currentAnim->m_isoSprites[index];
return *isoSprite->GetCurrentTextureByDirection(direction);
} | 0 |
6541af0f65d3fdedbd29272454ce72e1 | 3eeec86e7d2a81e2f2078f567e582d5d | Applica una rapida compressione alla risposta HTTP se il client ha specificato
esplicitamente che è in grado di accettare risposte compresse. | {
var request = context.Request;
var response = context.Response;
string acceptEncoding = request.Headers["Accept-Encoding"];
if (acceptEncoding == null)
{
return;
}
acceptEncoding = acceptEncoding.ToLowerInvariant();
if (acceptEncoding.Contains(GZIP_ENCODING_NAME))
{
response.Filte... | 1 |
c36d051af2cd2b3e562e0d42fc1f4f5d | bf037e3a0a0554fd02cbbc52376d57b3 | Creates a club and player used during testing.- | user_player = User.objects.create_user(username='Matti1', email='matti1.meikalainen1@gmail.com', password='salasana1', first_name='Matti1', last_name='Meikalainen1')
user_player.is_player = True
user_player.save()
Player.objects.create(user=user_player)
user_developer = User.obje... | 0 |
d52cfd0b743ba799dd5de3802c054d43 | 2aa49374009da62567e5c47b3dc07947 | Handle creating a lobby. | class LobbyController extends Controller
public function create()
{
return view('lobby.create');
} | 0 |
f1c8e98f08337419a28314dc255e1368 | df439454d89f71db2c03c51049a92d37 | Gets prev sibling or null | class Node extends Base
public function getPreviousSibling()
{
if ($this->parent) {
return $this->parent->getChildAt($this->getNodeIndex() - 1);
}
} | 1 |
d1d1f4d7b1f17ef55eff5afd892209e8 | 021139c75e0757e2574a4dbc484467ad | Get the tag history, starting at the given time | namespace KTone.Core.KTIRFID
IRFIDTag[] GetAddedTags(string timeStamp, int noOfPrevHistoryRecords); | 1 |
cc57b022513c97098858546e1b41bb56 | 1c37fc25a0a5645d7429ab06ca3af70f | @brief master write data to slave that is mapping mode. | {
uint8_t i;
uint8_t ret = 0;
twiname->MASTER.ADDR = slaveTwiAddr;
wait_for_wif();
twiname->MASTER.DATA = regAddr;
wait_for_wif();
twiname->MASTER.DATA = writeData;
wait_for_wif();
delay_us(10);
return;
} | 1 |
d5a4bfd5ca5a10596451b396c8343697 | 44ea762beb29811bceb9492990a9f309 | 根据年、月、日、时、分、秒、毫秒生成日期 | namespace Bing.Date
public static class DateTimeFactory
public static DateTime Create(int year, int month, int day, int hour, int minute, int second, int millisecond) => new DateTime(year, month, day, hour, minute, second, millisecond); | 1 |
34fc976535f1fda7c546568bb47eb3ba | fd8b83212caea82993a890ecd01f8e3e | Gets a notification type by name. | {
NoticeType noticeType;
if (registeredNoticeTypes.TryGetValue(typeId, out noticeType))
return noticeType;
return null;
} | 0 |
23b5c6977e0d30559265ce69450a075d | 7cec235e0f1b74bf808aa2125a3a4142 | Iterates over the user's activities.
This method is an iterable generator.
Yields | class FlowClient(object):
def iter_activities(self, start_date=None, end_date=None):
logger.debug("Fetching activities between %s and %s",
start_date, end_date)
end_date = end_date or datetime.datetime.now()
start_date = start_date or (end_date - datetime.timedelta(days=30))... | 1 |
b539763d78588be60f55862ce2bbf4f0 | 6751666038528373603ab9127ecb87ee | Feasibility test for implicit deadline-task system | using namespace std;
bool res = true;
for(int j = 0; j < node_count(); j++) {
node& root = G.v(j);
double rmaxprogress = 1.0 / root.activity_duration + 0.000001;
int rduration = 1.0 / rmaxprogress;
if (root.deadline - root.release < root.activity_duration) {
cout ... | 1 |
f84614cbf631a74ab1f12a653a7b52e3 | 28c03ae16d44ed26c1119e8d6ad85660 | Get the position of the touch in world space | namespace Mhl
public class SingleTouchActionEditor : Mhl.ISingleTouchActionable
public Vector3 GetTouchPosition(UnityEngine.Camera camera)
{
return GetWorldPosition(camera, touchInfo[CurrentFrame].Position);
} | 1 |
46bdf49e16f9085b06dcbe8bcb193ff3 | e80018c0c1b1069e6fe26301bac86dca | Transforms double-breaks that delineate paragraphs into proper paragraph
elements. See transform_double_breaks_into_paragraphs. | class MarkdownExtraOverride extends Markdown_Parser
function formParagraphs($text) {
$text = preg_replace('/\A\n+|\n+\z/', '', $text);
$grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
foreach ($grafs as $key => $value) {
$value = trim($this->runSpanGamut($value));
$is_p = !preg_match('/^B\x1... | 1 |
2976ac84b1b5ba1432e1231321346922 | 0f61bad0296da44de0a92d558727c50d | Sobrecarga del operador "<" para comparar dos estados | @Override default int compare(Estado a, Estado b)
{
int h = getH(a) - getH(b),
r = getG(a) - getG(b) + h;
return r == 0 ? h : r;
} | 0 |
c5fb2bedb6f7d4fc156d5e15d85a89f0 | 829ed836410fb32e17214af9ffd755bb | Used by parser to add new status values. | class StatusValue(object):
def __init__(self, status):
self.status = status
self.possible_states = set(s.enumname for s in status.enumclass) | 0 |
c5de310ca4eb7bd0fbc55ace012c03dd | 78d07ef9dccb0ffada379cf6d6d79e9a | jinja2 filter to get next day of datetime | date = datetime.datetime.strptime( dateStr, "%Y%m%d" )
nextDay = date + datetime.timedelta( days = 1 )
return nextDay.strftime( "%Y%m%d" ) | 1 |
cab956a332ee8517a3a7410b68f00fca | b861e97486d34f09460ea7da803f4a42 | Gets a collection Mall_Product objects by custom where clause and order by. | namespace MCD.RLPlanning.BLL.Master
public sealed class KioskSalesCollectionBLL : BaseBLL<IKioskSalesCollectionService>
public List<KioskSalesCollectionEntity> Where(string where, params WcfSqlParameter[] whereParameters)
{
return base.WCFService.Where(where, whereParameters);
} | 0 |
fa7153e5738c80f2073cd1fa05455bf1 | b66396e99a3faee28cc25284f0975f36 | ajax call for schedule event | create(context) {
let params = new URLSearchParams()
params.append('start', context.state.event.start.format("YYYY-MM-DD"))
params.append('end', context.state.event.end.format("YYYY-MM-DD"))
params.append('title', context.state.event.title)
return ... | 1 |
d975be61dd6888c00ee1ba24f3d5cb85 | d9a57b0bf3193cf85ac3dc7ecacd2ddc | 查询语句, 返回一个 二维数组 | $res = $this->query($sql);
$rows = array();
while ($row = $res->fetch_array()){
$rows[] = $row;
}
return $rows;
} | 1 |
d02cc46cefd18fc057e59a4dc6848f39 | 0aaf55f2b36133065e4080390c97724e | MD5二维数组加密 | public class AppUtil
public static String getMD5Str2(Map params, String[][] data) {
Map treeMap = new TreeMap(params);
StringBuilder sb = new StringBuilder();
for (Object key : treeMap.keySet()) {
if (sb.length() == 0) {
sb.append(key).append("=").append(treeMap.get(k... | 1 |
822b465f4997a089029eac30d2e6b979 | 2025b0381b30b6b9b76db3c072b50f02 | split a string on tabs | class Text extends CakeText
public function readTab($text) {
$pieces = explode("\n", $text);
$result = [];
foreach ($pieces as $piece) {
$tmp = explode("\t", trim($piece, "\r\n"));
$result[] = $tmp;
}
return $result;
} | 1 |
1b55e858c542672c1a76b0b69a91ddbb | faf2eac0518254e5776036a8fce473dc | Returns a NICK message. | class IrcUser
def mask(nick)
"#{nick}!#{user}@#{host}"
end | 0 |
c34607fb67355ef14b8978b32af8d86e | d01d94384748abb14fa0eeae0a43c3ea | 实现ApplicationContextAware接口的回调方法,设置上下文环境.
{@link ApplicationContext} | @Component
public class ApplicationContextHolder implements ApplicationContextAware
@Override
public void setApplicationContext(@NonNull ApplicationContext applicationContext) {
doSetApplicationContext(applicationContext);
} | 1 |
77125973df03cb6f08cad1cb388f7517 | f4e06e1a274e6083c90e91ac284f2ef1 | Tests heartbeat processing for an assigned, enrolled device. | class CodeTestGenerator:
def gen_heartbeat_test(self, heartbeat_packet):
_, heartbeat_value = heartbeat_packet
return self.gen_test(
test_name="hearbeat_test",
raw_packet_value=heartbeat_value,
msg="frame_type=[8] channel=[0] payload_size=[0] msg=[]",
) | 1 |
f4bff61425f80d837a910220a1793859 | 69351e00e307ad3a35f536fff84055fd | EXCERPT | function new_excerpt( $words = 90, $link_text = 'view all', $allowed_tags = '<a>,<p>,<i>,<em>,<strong>,<b>,<blockquote>,<li>,<ul>,<ol>', $container = 'p', $smileys = 'no' ){
global $post;
if ( $allowed_tags == 'all' ) {
$allowed_tags = '<a>,<p>,<i>,<em>,<b>,<strong>,<ul>,<ol>,<li>,<span>,<blockquote>,<img>';
... | 1 |
d0144ee354c106cc2ed969043044c430 | d1256ac4448d237eddf1839e9eddc4c6 | Test merging variable-sized DDSketches | use ffi::*;
unsafe {
let sketch_a = minisketch_create(12, 0, 4);
for i in 3_000..3_010 {
minisketch_add_uint64(sketch_a, i as u64);
}
let sersize = minisketch_serialized_size(sketch_a);
assert_eq!(sersize, 12 * 4 / 8);
... | 0 |
954cf13e6c58f09260a6aae6f6f56a7b | 01024947dafcdd053ae44e296db17c77 | Método para construir uma modal com o formulário de atualizar um produto já existente.
Recebe o id de um produto pelo método GET e retorna o html da modal pronto para abrir com o JQuery. | function edProd(produto,dbseller,codigobarras,alerta,idreg){
getId('produto').value = produto;
getId('produto').disabled = true;
getId('dbseller').value = dbseller;
getId('alerta').value = alerta;
getId('idreg').value = idreg;
getId('botaoSubmit').setAttribute('onclick','altProd()');
getId('... | 0 |
7f73b355fd7dfd2ff3a55625a9cf776a | 063cd66a55913d798f434cee4cbbb422 | 这里返回的是你的item的个数 不包括头部和加载view | public class XRecyclerViewAdapter extends RecyclerView.Adapter<XRecyclerViewAdapter.ViewHolder>
@Override
public int getItemCount() {
return list.size();
} | 1 |
6504ebf63121aea8c7bc23f52bd825ea | 83d8a46517c2e4ab123b8dce2fb0ffd4 | Setup jobs table for checking validator unit test error reports. | class JobsTable extends Table
public function validationDefault(Validator $validator)
{
$validator
->add('jobid', 'valid', ['rule' => 'numeric'])
->allowEmpty('jobid', 'create')
->add('propertiesid', 'valid', ['rule' => 'numeric'])
->requirePresence('propertie... | 1 |
5d13125bf1f5998f2fad530e4c249467 | 8ffcc63c7e597d9e818fa1c8f7c49241 | Transforms a list of client ID mappings from a more descriptive format
to the traditional format of alternative IDs to actual ID. | result = {}
for _alias_id, _name, _original in aliases:
if _original:
result[_alias_id] = f'{_original} ({_name})'
else:
result[_alias_id] = _name
return result | 0 |
d9d4798bc0d5f9eec1f2cc77ea6bfa27 | 2ee7adebc2c6d80432df93bafb58d074 | Checks to see if any building is currently selected. | local ourPlot = Map.GetPlotByIndex( plot );
local hasOwner : boolean = ourPlot:IsOwned();
local owner = hasOwner and WorldBuilder.CityManager():GetPlotOwner( ourPlot ) or nil;
local buildingEntry = m_BuildingTypeData.Entries[m_BuildingTypeData.SelectedIndex];
local sConfirmText : string;
if hasOwner then
loc... | 0 |
5ff1c301a8c3c1a5effce4448ec2d97d | d8392ebe597032b676f8458b13d9e480 | Method to Load the Service Requests Grid. | {
if (clsSession.Str_ServiceContract_Operation == "view")
{
AttachDetails.InitializeAttachmentDetails(clsGeneral.Tables.Purchasing_Service_Contract, PK_Purchasing_Service_Contract, false, 4);
gvNotesGridView.DataSource = Purchasing_SC_Notes.SelectAllByServiceContract(PK_Purch... | 0 |
69fd27a512bc1878104b0fecb026d7a3 | 4b22bf0fb5dea9de104cdd344293f5d6 | Remove Event Subscriber | class EventManager extends \Doctrine\Common\EventManager
public function removeEventSubscriber(EventSubscriber $subscriber)
{
$this->removeEventListener($subscriber);
} | 1 |
d5d938136c86432bc899a64b2ee8fe85 | dc54faf13afd0f684c18103833790009 | Test case for analyticsGenericLogFlow
. | pre_test_status = get_analytics_opt_in_status()
runner = CliRunner()
result = runner.invoke(opt_out)
assert result.exit_code == 0
assert not read_global_config()["analytics_opt_in"]
set_analytics_opt_in_status(pre_test_status) | 0 |
5cac016f03b90ba4124e0941902168d7 | e9bdafcaf836663818178e9d4cc18fe2 | 跳转到询问底价 | function fnSelect(ID)
{
var URLParams = $("#SearchCondition").val();
URLParams += fnGetPageInfo();
URLParams += "&SourcePage=Info";
URLParams += "&ID="+ID;
URLParams += "&ModuleID=2041601";
window.location.href = 'PurchaseAskPriceAdd.aspx?'+URLParams;
} | 1 |
ec32506f458e092d91977ecf50b0128e | 979c7d93e1f4e0e7d6902cba6d323d22 | 关键帧之间插值求取 骨骼空间所有关节的变换矩阵 | export default class Project
getFrameBoneTransformMap(animation: Animation, frameIndex: number): { [boneId: number]: BoneTransform } {
const keyframe = this.getKeyframe(animation, frameIndex);
if (keyframe) {
return keyframe.transform;
}
const prevKeyframe = Project.getPrevKe... | 1 |
4b12602d04eda8e1e389e46dd58d8f32 | 78f6332347caa171a18f0d464c0b53f2 | Create a new card and insert it on the top of the pile: | public function randomlyInsertCard(CardInterface $card) : DeckInterface; | 0 |
21a2b8fdf56ffa3019c170b7b35fbac8 | a7dcf26701c79b622822197f7d1636fa | 处理include语句 | string includeFilePath;
if (line.find("<") != string::npos) {
newCode.append(line).push_back('\n');
return;
}
unsigned long mFirstPosition = line.find_first_of('"');
unsigned long mSecondPosition = line.find_first_of('"', mFirstPosition + 1);
includeFilePath = line.substr(mFirstP... | 1 |
8591bed6b67c3698645920aead97b760 | e234855deab7df6df03a898acfa3b312 | 运行频率 | class Intercept
private function frequencyCtrl($keyIp){
if(!$this->useFrequency) return;
foreach(self::$frequencylimits as $time => $count){
$this->counTexpire($keyIp, $time, $count);
}
} | 1 |
4b1988909bba2879eba5ca8e25459bff | 5ae07544de843b6de17536011a6cc595 | Test that a collection of v-site parameters can be mapped to a SMIRNOFF
`VirtualSiteHandler`. | top = GromacsTopFile('systems/tip4pew.top')
system = top.createSystem()
self.assertEqual(3, system.getNumConstraints())
self.assertTrue(system.isVirtualSite(3))
vs = system.getVirtualSite(3)
self.assertIsInstance(vs, ThreeParticleAverageSite)
self.assertEqual(0, v... | 0 |
281baa80597b5466602168326a060c88 | 6507a0023bfade84e82a2da7676ae339 | Read an inequality system. | s = ""
for i in range(N):
for j in range(N):
s += "%d" % values[i][j]
s += "%s" % inequalities[i * 2][j] if j < N - 1 else ""
s += "\n"
if i < N - 1:
s += ' '.join(["%s" % inequalities[i * 2 + 1][j] for j in range(N)])
... | 0 |
256a5b6f184bfc24d72ab01244e77608 | ce8f887c5316b88f7e08a8b0f82309aa | Checken of de muis ergens overheen wordt gehouden. | namespace SchoolEsc.View
public partial class SpeelveldPanel : UserControl
public void CheckAanrakingVijanden()
{
bool Geraakt = false;
foreach (VijandController Item in SchoolEsc.Controller.VijandController.Vijanden)
{
if ((speler.BewegingX > Item.vijand.... | 0 |
5b9520e681ff64f119b7b5ec33f98dac | 56527e16b51b13ba6413c63f0eadfc9a | Get the war_team that owns the warrior. | class Warrior extends Model
public function warTeam()
{
return $this->belongsTo('App\WarTeam');
} | 1 |
40ce0d59ad064274017d710b73bf24e5 | e05d9fcba3c2e17c8e81fb0c2a518a7e | Get a subset of the Fluent's attributes. | def _get_subset_of_attrs(cls, attrs_to_ignore):
all_attrs = cls().__dict__.keys()
return [attr for attr in all_attrs if attr not in attrs_to_ignore] | 1 |
7c7067c74ffd1941bcb37cd49f3e1383 | 1b2d5b45d612b7929ab071fbfed8cf5e | iterate all media type sources and send them to the storage medium | {
$descriptors = $this->identifier->findAllDescriptors();
$operations = $this->storage->createOperations();
$handled = 0;
$batch = 0;
$this->eventDispatcher->dispatch(IndexerMediaEvents::INDEX_ALL_DOCUMENTS);
foreach ($descriptors as $descriptor) {
++$hand... | 1 |
9304a1207bec9915aacf66b3ce841fa4 | f3d4a47cd324547df1265409e20317df | Fetches the Html content from Internet using the requests.
You can any requests params which will be passed to the library
itself.
The requests arguments you supply will also be applied to the
global session meaning all the files will be downloaded using these
settings.
If you want to use some manual page fetch, like u... | def requests(url, sleep=REQUEST_DELAY):
html = LOOP.run_until_complete(asyncio.gather(_get_page(url, sleep)))
if html:
return "".join(html) | 0 |
a108c10989177ce9ab7380719bafc9e0 | c5041b5c87fbf4b53b90842e93698d93 | モデル名からモデルIDを取得する | $model = ComModules::model()->findByAttributes(array('name' => $name), array(
'select' => 'id',
));
if($model !== null)
return $model->id;
else
return '0';
} | 1 |
75c8ed9d90da3a7009ebd80c81d7fb3d | 2f759adc731ffed3608f05b1c4ba859f | Returns the date and time when an incorrect password was most recently entered for the specified account. | namespace Dibware.Web.Security.Providers.Contracts
DateTime GetPasswordChangedDate(String userName); | 0 |
88509e0bce230ebc7d1b5c881a6db6e0 | b4d69349803380b5a13221366ec03b5e | Called when the event ends and before players get teleported back to their previous positions
Used to reward players | void onPlayerTeleport(TeleportEvent e); | 0 |
a015297d7a3c2e17d9c4b1327415f9ff | 26ed14fb8f0514c54e1af988bad54a5a | Rotates the position of the matrix that makes up the Tetrimino container clockwise. | namespace Tetris
void Rotate(); | 1 |
5b75b317574faf339a71eb0ef0ff6f5a | e97e13902d6d958d0481123ca381a714 | Click event handler for Fried Miraak | namespace PointOfSale
public partial class MenuSelection : UserControl
private void FriedMiraak_Click(object sender, RoutedEventArgs e)
{
var controlOrder = this.FindAncestor<MainWindow>();
FriedMiraak item = new FriedMiraak();
FriedMiraakPOS bb = new FriedMiraakPOS(item)... | 1 |
9a92806e81d446c75766fe4eea4c98d4 | 11749372feac222c545f879e30967857 | обновить значение всех анимируемых параметров | namespace MalbersAnimations
public partial class Animal
public virtual void LinkingAnimator()
{
if (!Death)
{
Anim.SetFloat(hash_Vertical, vertical);
Anim.SetFloat(hash_Horizontal, horizontal);
Anim.SetBool(hash_Stand, stand);
... | 1 |
0da560149acd9b6462a375b1c3ff03d4 | dd2a0a2411b9c3a590a652c39b99c7ca | Move to next horizontal line PID | public class ControlRST implements IControl
private void exec_LINECTRL_ALGO_PID() {
double kp = 0.387;
double ki =0.00001;
double kd = 0.0000001;
int speedconst = 35;
leftMotor.forward();
rightMotor.forward();
e = this.lineSensorRight - this.lineSensorLeft;
double x=currentPosition.getX();
double ... | 1 |
a1b5c5599b6666ce9d04ed26803530c6 | fef038e8e4eb1a32f18c058f2101ca99 | Sets the title of the edit article form to the given value. | public class BlogEntryForm
public void setTitle(String title) {
this.title = title;
} | 1 |
ed0a097012ceaee7da15ef83b8dcf9d6 | d233b5d5b0fc082d8e049ced1d949b79 | 结题报告列表. | $map = [];
if(isset($this->GET['state']) && $this->GET['state'] == 3){
$map['task_state'] = TASK_STATE_REPORT;
}else{
$this->GET['state'] = 1;
$map['task_state'] = ['neq',TASK_STATE_REPORT];
}
if(!empty($this->kw)){
$map['title'] =... | 1 |
1d3e41db78ce653c7e69f54329cd3b87 | 7fca454f3104b06270cd1de480af2a1f | gets this wolf's angry state | public class NPC : MobileObject
bool CanGetAngry()
{
if (npc_goal == (short)npc_goals.npc_goal_petrified)
{ return false; }
switch (_RES)
{
case GAME_UW1:
if (npc_whoami == 27)
{
return false;
}
... | 0 |
53b2f34ebec3a9b4248ddca346e7927e | 63cb31750650d4fc105e593c35d60eb2 | Gets a value indicating whether the specified parameter has a default value. | namespace BBT.StructureTools.Provider
bool IsDefault<T>(T value); | 1 |
c9a3212d2e5eef3e70015ddb5c8a4a1a | c4f42edcaa1ace75fde1eaeb3f307486 | Gets the status key. | class JobLogRepository
private function getStatusKey($status)
{
return sprintf('%s:status:%s', self::REDIS_NAMESPACE, $status);
} | 1 |
679f4087f70a0ab51e61c536f9a1f982 | 90a871258017b6d511b256e82e72a74e | Seeds the pagelets. | this.file = file || null;
this.name = name || null;
this.type = type || null;
this.charset = charset || null;
this.belongs = [];
this.phase = 0;
BigPipe.debug("Pagelet " + name + " created as type " + type + " with file ", file);
} | 0 |
15ff1558ec3e56085af36aa5afbc3c3e | 2fc0d8e0ca6c23b5cf45a73584fa2dce | Serializa y guarda un objeto Universidad en un archivo xml | namespace EntidadesInstanciables
[XmlInclude(typeof(Alumno))]
[XmlInclude(typeof(Instructor))]
[XmlInclude(typeof(Jornada))]
[XmlInclude(typeof(Persona))]
[XmlInclude(typeof(PersonaGimnasio))]
public class Gimnasio
public static bool Guardar(Gimnasio gim)
{
Archivos.Xml<Gimna... | 0 |
72a4076736d935b1cdb16b3cfadaeb2a | 89be597d52350d09f73f1809a4967d74 | Funktion, die Rotationswinkel liefert | int Citta::getRotation(void) {
return rotation;
} | 1 |
1b9f86fc23a6608917e5117378491c86 | 954dc1a758fcf1578f1875b7bbad2691 | Set if the Salesforce application is on a
sandbox or a production organization. | class SalesforceUser extends OAuthUser
public function getIsSandbox()
{
return $this->isSandbox;
} | 0 |
b0cd0db47fb897f82b49f62f1e4fe40c | 4912af24ea6fd8574c51b67c9b585cd4 | @brief This example is supposed to demonstrate the intended use of the
library. | void main(void)
{
int rc;
printk("I2C over Grove example.\"\n");
rc = sht35_init ("I2C_1");
printk ("sht35 init returned %d\n", rc);
while (1)
{
float t, h;
rc = sht35_GetTempHum(&t, &h);
snprintf (buf, sizeof(buf), "Main loop. Temp: %1.1f Humidity: %1.0f\n", t, h);
printk ("%s", buf);
k_sleep(K_MSEC... | 1 |
5dfe82c49dbdf54f0c5f0bd74bffb844 | 5f17130520a36bf59271c61054751cbd | The scaling function for weights in the standard MLP. | name = params.setdefault("name", "")
scalar = params.setdefault("scalar", 1.0)
def f(input):
return Lambda(lambda x: tf.scalar_mul(scalar, x))(input)
return f | 1 |
f35540d77f05d1546c2543c58346055d | 63504dd55732992b10b386184b81f556 | Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing
filters are used in many different applications CITE: EM11 .
param src Input 8-bit 3-channel image.
param dst Output 8-bit 3-channel image. | namespace ManagedCuda.NPP
public class NPPImage_16sC1 : NPPImageBase
public void FilterHighPass(NPPImage_16sC1 dst, MaskSize eMaskSize)
{
status = NPPNativeMethods.NPPi.FixedFilters.nppiFilterHighPass_16s_C1R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, eMaskSize);
Debug.WriteLine(String.Form... | 0 |
62fe876e8782bc7bec7138cb2e62bbad | 48a002b0e562260c72d9e185729c3988 | Create a local copy of the callbacks. Otherwise, it could be that
another call to `add_done_callback` would add a new callback to this list
which would then be called twice. (Once from here, once from the
`add_done_callback` function directly. | class Future:
def _schedule_or_invoke_done_callbacks(self):
with self._lock:
executor = self._executor()
callbacks = self._callbacks
self._callbacks = []
if executor is not None:
for callback in callbacks:
executor.create_task(callback, sel... | 1 |
1e66980ca714ec2113955dfb9283dafd | 7552c80262ca5c4a373b08975046ab2a | 指定の地点における曲線の半径を設定する(カントは前の構文の設定値が引き継がれる 構文間の数値は補完される) | function this:setCurve( curve, value )
local search = curve:lower();
if( search == "bre" )then
self._bre = value;
elseif( search == "bri" )then
self._bri = value;
elseif( search == "cle" )then
self._cle = value;
elseif( search == "dyn" )then
... | 0 |
5703b2ebef37b3012425b63bf1c3da9e | c06ee51a99e1097dbadf2599f7e246ad | This calculation accounts for areas that exactly line up with the tiles
and those that end somewhere in the middle, snapping down and right. | var SNAP_DISTANCE_PX = 16;
var startDiff = Math.abs(point - basePoint);
var endDiff = Math.abs(point + width - (basePoint + baseWidth));
if (startDiff < SNAP_DISTANCE_PX && startDiff < endDiff)
return basePoint;
else if (endDiff < SNAP_DISTANCE_PX)
return basePoint + baseWidth - width;
... | 1 |
cebbbf6882c704d9716cd04f0d7fa416 | bfe12e6bcda4f5e1c304f28f3d7d8c53 | Test case for data_context_oam_context_meguuid_meplocal_id_odu_connection_end_point_spec_odu_ctp_get | tapi_oam_oam_service_end_point = TapiOamOamServiceEndPoint()
response = self.client.open(
'/data/context/oam-context/oam-service={uuid}/end-point={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'),
method='PUT',
data=json.dumps(tapi_oam_oam_service_... | 0 |
6986e7f70bd494fceedead2b980677d5 | 52ae62a836fb3d26d07fd1e854e1199d | 验证状态码是否是失败状态码 | public class ResponseUtil
public static boolean isFail(ResponseMessage responseMessage) {
return ResponseContants.SUCCESS != responseMessage.getCode();
} | 1 |
03ffc84fd0fdb229d0a130e722c8033c | 22ca266c2432712d5de40401ee278e98 | 将用户的地理信息保存到cookie | function updateUserLocation(position){
console.log("trying to update user location.",position);
xcookie.set("lat",position.lat,100);
xcookie.set("lon",position.lng,100);
} | 1 |
5cdc02a3933c621a1d9096d1c744fc9a | 94868e721a699b6bf9edb5432e450958 | Returns the last generated token. Does not generate a new one. | class NoCSRF
public function getToken(): string
{
if (empty($_currentToken))
$this->genCurrentToken();
return $this->_currentToken;
} | 1 |
cb9144160fe35e1d44eb0a9895d8994d | 5f98c5a86bae266f958f3d07eb600184 | Unmounts all children of HTMLElement | if ((props = node.props)) {
for (var i = 0; i < node.children.length; i++) {
removeChildren(element.childNodes[i], node.children[i]);
}
if (props.ondestroy) {
props.ondestroy(element);
}
}
return element;
} | 1 |
47d97a268eb246848d41d112e2e49451 | 8183dd5bd966f7f40777b4756a19a777 | first fill in missing entries in both indicator matrix & trader pnls | def add_missing_indicator(df, vars):
for var in vars:
df[var+'_NA'] = np.where(df[var].isnull(),1,0)
return df | 0 |
a8c444cbe08e877db507237345a2b595 | 4cb448a5eb159de7bc18fea76a90e062 | <include file='IVMRWindowlessControl.xml' path='doc/member[@name="IVMRWindowlessControl.GetColorKey"]/*' /> | CWMPTProperties::GetFontColor(
_Inout_ _At_(*pbstrColor, _Pre_maybenull_ _Post_valid_) BSTR* pbstrColor
)
{
HRESULT hr = S_OK;
if (SUCCEEDED(hr = CHECK_POINTER(pbstrColor, E_POINTER)))
{
SysFreeString(*pbstrColor);
*pbstrColor = NULL;
if (m_wmData.type == TextWatermark)
... | 0 |
b293148d024c790ac54ca8be8a74639b | e336fc269e10ad4818d6624d026a2094 | Speichert die bearbeiteten Daten des ausgwählten Fahrers. | void driverEditSave(); | 1 |
0cff45ae950afcb7da1fd3cd7ffe7085 | 2b48b07fe3b6dc7ba08be31acb34373c | Test if flask_bh loads configuration values from
environmnet variables properly | def test_app_config():
mock_env = {
'FLASK_BH_CONFIG_PREFIXES': 'AWS,DB',
'AWS_SECRET': 'S3CR3T',
'DB_USERNAME': 'USER',
'PREFIX_NOT_EXISTS': 'SHOULD_NOT_EXIST',
'FLASK_BH_DEBUG_LEVEL': 'DEBUG'
}
os_environ_mock = patch.dict(os.environ, mock_env)
with os_environ_m... | 1 |
4f72c30aef188d377350cead92f6bef3 | b6f32a964c58b2f09ca49b8b4bf5f62e | Return Angle Between Agent and Target,if target is null, return infinity | public class Maze
public int getTargetBearing( int i )
{
if( ( current[i][0] < 0 ) || ( current[i][1] < 0 ) )
return( 0 );
int [] d = new int[agent_num];
d = new int[2];
d[0] = target[0] - current[i][0];
d[1] = target[1] - current[i][1];
if( d[0] == 0 ... | 0 |
c886862761f595227a43f44aab40395e | 84faf5382c44fb44ec27068dd0d3c7e8 | Returns the classpath containing all plugin libraries. | public class Config
public static String getPluginPath() {
File f = new File(getClassesPath());
String path = f.getParentFile().getAbsolutePath() + "/";
return path;
} | 0 |
0977afa0a47ab98a77cc626b3ed8eda1 | f34832e8ffa76caf17784ee0f676c04a | returns whether the main variable was changed | switch (paramToChange.get_flag()) {
case INTERVAL:
if (paramToChange.get_value() != interval) {
interval = paramToChange.get_value();
changed = true;
cout << "Interval changed to " << interval << "\n";
return true;
}
break;
case COUNT:
if (paramToChange.get_value() != count) ... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.