query_id
string
corpus_id
string
query
string
code
string
label
int64
b4fc61f7f6a48ca46af5dbe32aa30d3a
a220e4bde0127f3b7b5d2a3fc56869f3
Controlla l'aggiunta della sinergia al danno
void Thief::addStealth (int stealth){ if ((this->stealth + stealth) > 100 ){ cout << ("Stealth invalido. Stealth max = 100!") << endl; this->stealth = 100; cout << "Stealth atual = " << this->stealth << endl; } else{ if ((this->stealth+stealth) < 0){ cout << ("Stealth invalido. Stealth min = 0!") << end...
0
7f03ddf3a193645a77566d6d888c17b8
88e90bc9cc6db99cf1295f22cfecb34f
判断是否是二进制字节数组
class DataType extends SplEnum public static function typeIsBinary(string $type) { $binaryType = [ DataType::BLOB, DataType::TINYBLOB, DataType::LONGBLOB, DataType::MEDIUMBLOB ]; return in_array($type, $binaryType); }
1
626d23d73fd388975d31ce0ef04b7a90
1644fa24e8d57ed05c3a0b7ad4f99eff
Format a date + time as an ISO string
def to_iso_8601_format(dt): if not dt: return if isinstance(dt, str): return dt return dt.strftime('%Y-%m-%dT%H:%M:%SZ')
1
08b3fc58df4182519f68138d01776457
f2d1f6e69d5433a9b591a6d66c26488b
Gets the commit options from a user response.
{ if (result == MessageBoxResult.Cancel) return CommitOption.Stop; else if (result != MessageBoxResult.Yes) return CommitOption.Continue; else return CommitOption.CommitAndContinue; }
1
8aff72c027b0fc17ada4dd7fe95e0bcd
0c2f54564aee4eff9171362497f44e24
Retrieves all the trackable links in an email.
{ Set<String> result = new HashSet<String>(); ElementIterator iterator = new ElementIterator(document); Element element; while((element = iterator.next()) != null) { AttributeSet attributes = element.getAttributes(); Object name = attribu...
0
fe8154d793d831dd07328f2c1040ea81
87affeeaded35218c1c196917c21da39
Der Dateiname wird zurückgegeben.
namespace NN class Netzwerk public string GetFilename() { string time = DateTime.Now.ToString(); int index = time.IndexOf(" "); time = time.Remove(0, index + 1); time = time.Replace(':', '_'); string fileName = @"NeuNet" + @time + @".weights"; ...
1
3758fce10e1308bedd5855fa7daa57a5
377116a89f229990cdb9e6449a773b50
15.2.9.3.4 Float#-
class Integer def -@ Primitive.attr! 'inline' Primitive.cexpr! 'rb_int_uminus(self)' end
0
bd9770f3ede3ffdd930db011244aa876
ca4461c097167c7681d59994b9b4680a
Устанавливает слушатель на удаление карточки из адаптера.
@SuppressWarnings({"RedundantSuppression", "UnnecessaryInterfaceModifier"}) public class NacCardHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener, CompoundButton.OnCheckedChangeListener, TimePickerDialog.OnTimeSetListener, NacDialog.OnDismissListener, ...
1
08b153c365269606a2899321451cbf71
8425e53371d9a373092829dc2b3b795f
获取flex方向类
function FlexDirectionScreen() { return ( <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> <Text style={{fontSize: 24}}>Flex Direction</Text> <FlexDirectionBasics /> </View> ); }
0
344f6f541ba6b581a244b42f97dd1a43
ebec4f36627e729b806c4e65296c7217
sorts the ships in the allShips buffer by how far away they are from the player -JNE
MVPShip[] sortArray = new MVPShip[ships.size()]; for (int i = 0; i < ships.size(); ++i) { sortArray[i] = new MVPShip(ships.get(i), ydam[i]); } Arrays.sort(sortArray, new Comparator<MVPShip>() { @Override public int compare(MVPShip d1, MVPShip d2) { ...
0
01c6cf5ea3b14040d94f53fcc26e77f1
80ad198e5f82504ec59c3fd3c9b50bba
Get the next payroll period to process
let self = this, sid: string = GetUrlParameter('SID'), uriKey: string = encodeURIComponent($('#mupUriKey').data('value')), pid: string = encodeURIComponent(AesEncrypt('EmployeeNo:' + self._employeeNo + '|CompanyNo:' + self._companyNo + '|De...
1
a4c851770d4a045475f17272e37781fb
2c8bc7b7fe24f0a2e5c7c3b4a4c2a06e
숙소 한 개의 사진 여러 개를 가져오는 메서드입니다.
public List<HotelImage> selectHotelImages(int hotelNo) { List<HotelImage> hotelImages = hotelDAO.selectHotelImages(hotelNo); return hotelImages; }
1
f86fa10c5222d7ea4e434d434bdafaa3
503dec59fe7b088a2ad347941e15bb7d
handleMakeTable creates all tables necessary in db
class searchnet: def makeTables(self): self.con.execute("create table hiddennode(create_key)") self.con.execute("create table wordhidden(fromid, toid, strength)") self.con.execute("create table hiddenurl(fromid, toid, strength)") self.con.commit()
1
a761cda9529490205c8b0f4a1372b274
d07fbaa3275b39b4f66f30df010609a9
================================================================================ Initialisation ================================================================================
void SMonolith::Initialise() { #ifdef CUDA std::cout << "- Using GPU version event by event monolith" << std::endl; #endif nKnots = 0; NEvents = 0; _max_knots = 0; nParams = 0; NSplines_total = 0; NSplines_valid = 0; NSplines_total_large = 0; index_cpu = NULL; gpu_weights = NULL; cpu_weights_var...
1
bdd3b3c7a41e7b123597c98f2b7c222d
1809fbe4d1c9dc19cc1743bafec705dd
是否刷新BOSS
function My:Refresh(bossList) if bossList == nil then return; end if #bossList == 0 then return; end if self.ComView == nil then self.ComView = ObjPool.Get(UIComView); self.ComView:Init(self.root); end local info = bossList[1]; self.MontId = info.type_id; ...
1
05aa734313dd31313f495c82e64a13af
45c1d8d1c0bc991ec2a5320227444d9c
POST /spend_categories
class ExpenseCategoriesController def create @expense_category = ExpenseCategory.new(expense_category_params) if @expense_category.save redirect_to @expense_category, notice: I18n.t('message.notice.created') else render action: 'new' end end
1
fabc5648ed0c2c5a9693565e5ba3f4fc
e5019a26b3c71c4cce076946db4ba927
Confirms a given user registration request and creates the user
namespace CLOUD.Artik.Api public partial class RegistrationsApi : IRegistrationsApi public DeviceRegConfirmUserResponseEnvelope ConfirmUser (DeviceRegConfirmUserRequest registrationInfo) { ApiResponse<DeviceRegConfirmUserResponseEnvelope> localVarResponse = ConfirmUserWithHttpInfo(registrationI...
1
a98d131c4386e14a9309615fc917e65a
6bd580b6c49758f8476b32a9c931e97c
change the order of the operators to match hierarchy
def replaceOperators(result): result = result.lower() if "plus" in result: return "+"; elif "minus" in result: return "-"; elif "divided" in result: return "/"; elif "multiplied" in result: return "*"; elif "times" in result: return "*"; elif "modulus"...
0
6ca44f9d9117183ab3ddcce90c021d9e
b02a1b0460248d41823b34fd3598e9bd
Question 1 This function will test primality of a number using trial and error method. Note: negative numbers, 0, and 1 are not considered prime by definition. The following number form Lucas primes can be used for testing: 2, 3, 7, 11, 29, 47, 199, 521, 2207, 3571, 9349, 3010349, 54018521, 370248451, 6643838879, 11921...
if (num < 2): return False lowPrimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, ...
0
26577123ea0e741de0d1f74b4c739241
bb23eca7ffb898e559f2e5323ca76a72
Положить объект в redis по указнному ключу на заданное время, если объект в redis уже существовал, он перезапишется
namespace DeskRedis.Util.Redis bool Set<T>(string key, T value, TimeSpan expiresIn, int index = 0);
1
0311aada6496adf38033c9be0663c027
074715e6b3f553ec77a27bd6dfd74ddb
Counts the number of KitComponent objects for the current store.
abstract class BaseSProducts extends ShopBaseObject implements Persistent public function countShopKits(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { if(null === $this->collShopKits || null !== $criteria) { if ($this->isNew() && null === $this->collShopKits) { return 0; } else { ...
0
94ebcc8746d93f64295f7d411a4164e3
ff1f0d6bcf97263c1526806deafc6c29
자동 링크
function autoSlider(parent, speed) { if ( +(new Date()) - date_current < speed * 4.5 ) { setTimeout(function() { autoSlider($('.slider'), speed); }, speed * 5); return; } date_current = +new Date(); var slideClass_01 = 's_on'; v...
0
1e2bc237c8980e508bbc73dba8e92dbb
2a9b74056935ebc40260fdd0b4328d0a
米迪广告
let url = el.getAttribute('href') let target = el.getAttribute('target') let srcs = el.getAttribute('src').split(';') let dataTxt = el.getAttribute('data-txt') let dataAds = el.getAttribute('data-ads') let txts = dataTxt ? dataTxt.split(';') : [] let ads = dataAds ? dataAds.split(';') : [] let title = e...
1
98457cec75bdff7675a0c9870c17b205
5395cfc7283047a6a34af832ced5d3c4
Misura il tempo e lo stampa
long mstime = (System.nanoTime() - tickTime) / 1000000; System.out.println(action + ": " + mstime + "ms"); }
1
275108b913f455648fedee7e3999992e
2941850e4a8659378024138d7f33f4ed
Retrieve the instruction set of the code at the current execution location.
public abstract class OatHeader implements StructConverter abstract public OatInstructionSet getInstructionSet();
0
cd4c33b5631190f313fed2cd52df6fe0
d9101d3e0a146a361c9c754d41d64fec
Метод быстрой сортировки
public class FastSort<T extends Sortable<T>> extends AlgorithmSort<T> private void fastSort(List<T> list) { Collections.sort(list); }
0
e92eae552e407443fbf7d1414e7ebe69
9241c353b7c69e213fe528515094c32c
Smooths scrolling and fixes some refreshing issue.
function smoothScroll(targetY, ref) { const targetElement = ref || window; const targetElementScrollY = ref ? targetElement.scrollY : window.pageYOffset; const movingSpacing = Math.abs(targetElementScrollY - targetY); const windowHeight = window.innerHeight; const windowScrollableHeight = document.documentEle...
1
5169a1623e35d87f8c05d6d239c90b81
af3ea107ccf20043663fb7bbe800818a
Display the specified Kecamatan.
{ $kelurahan = Kelurahan::findOrFail($id); $kecamatan = Kecamatan::all(); return view('kelurahan.show',compact('kelurahan','kecamatan')); }
0
109a83819a726c039f81ef4bbac4ee7c
e94f82a892beca21220a892dc9e3d826
Main function of the class that allows generating and saving the tfrecords for labeled train, unlabeled train, validation and test datasets. 类的主要函数,允许产生和保存标记训练,无标记训练,验证,测试集的tf格式数据
print('Creating TF records') if not osp.exists(self.out_dir): os.makedirs(self.out_dir) for img_file, mask_file in self.img_mask_list: tf_record_file = osp.join(self.out_dir, osp.basename(img_file) + '.tfrecord') img = self._load_img(img_file) if i...
1
a89cb0ad988b9dfe76c6dfb55bcc8176
218d84475cacafd212cffbc29678d950
将BASE64编码的字符转换为原6bit的数据 字符
byte[] characterMap = new byte[65536]; int length = characterMapData.length(); int i = 0; int j = 0; while (i < length) { byte curValue = (byte)characterMapData.charAt(i++); for (int x=characterMapData.charAt(i++);x>0;x--) { characterMap[j+...
0
2229cc829cf37bc1d26a228aa1419179
3e323f2787b4f20807e9d1b2af92178f
Создание DocumentFragment из массива HTML-нод "Маг"
function createDocumentFragment() { return document.createDocumentFragment() }
0
e7eb7ac5f0c74cd91085de74790e8f2a
a5c57a8cfd6ba569875aaaba64ea965f
Determines whether specified operation is allowed for the specified number of arguments.
namespace QuickAccess.Parser.Flexpressions.Model [Pure] FXConstraintResult IsBinaryOperatorAllowed(OverloadableCodeBinarySymmetricOperator binaryOperator, int argsCount);
1
a1a6e925d0ea3fbaa070a25f7ca60592
762d4ae59bca111dd4af9144186b4802
Initialize processor environment for SMM profile.
VOID ScSwDispatchInit ( VOID ) { EFI_STATUS Status; Status = gSmst->SmmLocateProtocol (&gEfiSmmCpuProtocolGuid, NULL, (VOID **)&mSmmCpuProtocol); ASSERT_EFI_ERROR (Status); }
1
73c5f172958a73df18dbdfdc1fd34604
fd44862f70d9772afe84cb5e0e92cd33
Adds an option field
$this->options[] = (new FormInput()) ->setType('option') ->setValue($value) ->setText($text) ; return $this; }
1
58c29240bedc4ececf05cdbb4ed3ac94
48ff1fa9f0f303cbc75e5167f93eb56f
Getter for <code>pg_catalog.pg_index.indisready</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.8.4" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class PgIndexRecord extends TableRecordImpl<PgIndexRecord> implements Record20<Long, Long, Short, Short, Boolean, B...
0
b37588564baae32e854692791aff6376
7c2fd6e7fd1166c0c8b413404d11f918
Gets the value of originalAllowEditAccounts
class InMemoryAccountInfo(UrlPoolAccountInfo): def get_allowed(self): return self._allowed
0
11a3bc43b6dc8e91fb7053cc098126e3
a2fa83e3b5130abe86abbff0c1000206
- Bring you into an existing game of uno.
deck_id, deck_cut, num_of_players, player_num, bank = new_game() print(deck_cut) print(num_of_players) print(bank) cont = "y" while cont.lower() == "y": card, remaining = draw_card(deck_id) print(card) print(remaining) cont = input("Draw another card? y/n\n")
0
e695b22487af8608aea3a34e23aa9994
e53c6ebfb1be0c74ff99579059e565bb
Updates a media file. Retrieves the updated `MediaFile` object
namespace VitalsService.DomainLogic.Services.Implementations public class AssessmentMediaService : IAssessmentMediaService public async Task<OperationResultDto<AssessmentMedia, UpdateAssessmentMediaStatus>> Update(int customerId, Guid patientId, Guid id, byte[] file) { var existingMe...
1
fd18bba1d3ddbe599923b8dbb25e893e
3be20d2b672e9019bebfe6638a9fc634
Run the validation against all attribute values
class Unique extends Validator protected function run() { $attribute = current($this->attributes); if ($attribute !== null) { $this->validateAttribute($attribute); } }
0
388e07c0af38040698a085a68091f74d
f5ce8008d585f1015dd63b6a4b9e8b9d
Betygsätter ett recept
$(".btn-primaryAdd").click(function(){ post('rest/recept', JSON.stringify({ receptId : $("#inputID")["0"].value, receptNavn : $("#inputName")["0"].value }), function(){ $('#addModal').modal('hide'); $.notify("Recepten blev operettet", "success"); loadRecepts(); }, function(){ $('#addModal...
0
821f045adcbdfb5b8186d13411c97bb2
b0c9ffedb7cba9bc06dd7de762ae47cb
Personel tipine göre arama
{ $organization_id = Session::get('organization_id'); $person = HrmPersonType::select('hrm_person_types.id', 'hrm_person_types.name', 'hrm_person_types.type', 'hrm_person_types.description', 'hrm_person_types.status', 'hrm_person_types.delete_status'); $person->where('organization_id', $organization_id); $pers...
0
6a36102a5fdacf0c7533f51df1c913fb
5bf0fb3c63afe7b43b42c57598ee1269
adds one yellow card to Team A's current # of yellow cards
public class MainActivity extends AppCompatActivity public void addOneYellowCardForTeamA(View view) { yellowCardsForTeamA = yellowCardsForTeamA + 1; displayYellowCardsForTeamA(yellowCardsForTeamA); }
1
7a514f8b6093198fba714d8e8c4b7e5a
31b29b5b724ec81046f925516d2d328b
Gets a borrower Id.
public class Book implements LibraryBook @Override public String getBorrowerID() { if (borrower == null) { return null; } else { return borrower.getMemberID(); } }
1
2df7896f80c6d9feba0da8e7e28644fc
6e502644bcddca83fca4aeba4a746bc8
将映射关系添加到xml文件
public void addToXml(Element element);
1
f2bdf3454506877d41f4bf1042762392
2da01828ad96ef9880b8341315941340
When the corresponding button is clicked, get and display the logged in gamer's referral code.
class AuthController extends Controller public function authRefCodeGen(){ $user = JWTAuth::parseToken()->authenticate(); $userId = $user->id; $userInfo=User::where('id','=',$userId)->select('ref_code','isReferred')->first(); $isRef_code=$userInfo->ref_code; if ($isRef_code==NULL)...
1
bbd5ea21d6f7bb3e46de424362534d94
3e4844dd28c4c54ff002569cb9d88257
Get all the transcripts associated with the gene.
transcript_ids = [] transcripts = data.transcript_ids_of_gene_name(gene_name) for t in transcripts: transcript_ids.append(t) transcript_ids = sorted(transcript_ids) return transcript_ids
1
53617a3ab5789d53406a02efa59e20a5
af372252d772f4d86df229dbcdff5e33
Handler for when review requests are closed. Posts an entry to any configured I Done This teams when a review request is closed.
def handle_incoming_resolved_issue(issue: Dict[str, Any]) -> Dict[str, Any]: closing_entry: Dict[str, Any] = {} issue_id = issue.get('id', '') or '' issue_fields = issue.get('fields') or {} resolution_date = '' if (demisto.get(issue_fields, 'status.name', '') == 'Done') \ or (resolution_...
0
924c014570b46c6201791dd7359d3353
1c5e6894d8f3c228d4e9ab778d2735d6
Determines if the provided path is a directory and can be read
{ var data = TryGetFileInfo(path); return data.HasValue && (data.Value.Attributes & FileAttributes.FILE_ATTRIBUTE_DIRECTORY) != FileAttributes.FILE_ATTRIBUTE_DIRECTORY; }
0
4bfbefe545ce0925c96463934834390f
7f61448ad6da3ef0f9cb03f40c5be655
******************************** login ************************************
cases like (1)
0
b9e16633ef013df1b67c058b5e93a5a5
f1f3b32e627cda31e9d13c252c61214e
失去生命值最高的单位
{ float MIN = float.MaxValue; int index = -1; for (int i = 0; i < this.m_vecTargetHero.Length; i++) { if ( this.m_vecTargetHero[i] != null && this.m_vecTargetHero[i].m_iHp < MIN && !this.m_vecTargetHero[i].m_bDead) { MIN = this.m_vecTargetHero[...
0
f388ccaca7df0ba088e42492bba39da3
3961e4de815e9d58e1d8eea3a63e9bf7
Returns a new object of class '<em>Trg Global Error Response</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
TrgDialog createTrgDialog();
0
baf7ff43315d834b0eb9efa82257e3d0
d0fc9abb1e08ef8fbb864ba4d293daf3
Copies a dictionary and returns the copy
dictionary_copy = {} for key, value in dictionary.items(): new_value = value.copy() dictionary_copy[key] = new_value return dictionary_copy
1
a156847053d1b768ae5ce2b226eb94ba
34d716ef616d1b8afb0a5a188c1966f3
矩阵最小路径和
result = 0 m = len(matrix) n = len(matrix[0]) if m > 0: n = len(matrix[0]) else: return result f = [[0 for i in range(n)] for j in range(m)] for i in range(m): f[i][0] = matrix[i][0] result = max(f[i][0], result) ...
0
a702493df17114bbaf6c87dc90bcf0f8
3addaa1cd3217c19fcf29cbaa2514915
是否是中国电信4G网络
fun is3Gor4G(paramContext: Context): Boolean { try { val i = (paramContext.getSystemService("phone") as TelephonyManager).networkType if (i == 8 || i == 13 || i == 3 || i == 15 || i == 10 || i == 14 || i == 6 || i == 9 || i == 12) return true ...
0
de1a79716cc64dadfdc874c2cafac91b
0dd8f3a21b89ea5510fccc2772798791
Process an individual sample through the filter and return the modified value Value to process
{ if (_filterLength > 0) { if (0 == _filterSamples) { _filterOutput = newSample; _filterSamples++; } else { _filterOutput = _lastFilterOutput + (newSample - _lastFilterOutput) / (float)_filterLength; } _lastFilterOutput = _filterOutput; } else { _filterOutput ...
1
99e2306e9362c7c36b9b45d6d57cc378
40e868194b81d16e8c7ea5217c69b57b
根据起运港编号取得对象
public RailWhseInfo getWhseInfoByCode(String whseCode);
1
4cb2218ccf674fb2bd41c7f515cfb6de
a9a14955e19364c7916cb2c32e063591
扑克初始化
var cardType = ['黑桃', '红桃', '梅花', '方块'] var cardValue = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']; var specialCard = ['大王', '小王'] var allCards = [] for (var i = 0, len1 = cardType.length; i < len1; i++) { for (var j = 0, len2 = cardValue.length; j < len2; j++) { allCards.push(cardType...
1
0cca4b354494849b05aac5c87f9a0535
4c5aa52d0eabeb5ab2c9b887c767683a
获取用户上次提醒的时间
$res = $db->field('rtime')->where(" uid=$uid")->select('userstatic'); return $res ? $res[0]['rtime'] : ''; }
1
5805f19b00e20d80591a8c4f4b816270
beaa2f58ac95f61160dd2450f75d113c
WithDescribeCommandName creates an Option that sets the name to use for the command.
func WithDescribeCommandName(val string) DescribeOption { return func(cfg *describeConfig) { cfg.CommandName = val } }
1
c720a3952c683323a755b8637556ea7c
6f8191163285209dd02e0a3c78b97786
Tests when ETM is supported on a Cortex-M core.
self.ctx = TritonContext() self.ctx.setArchitecture(ARCH.X86_64) self.ctx.processing(Instruction(b"\x66\x0F\x17\x08")) self.ctx.processing(Instruction(b"\x66\x0F\x16\x08")) self.ctx.processing(Instruction(b"\x0F\x17\x08")) self.ctx.processing(Instruction(b"\x0F\x16\x08"))...
0
a7a9a22b63dcdb07b4f4188c448666c4
1ac33112be8064a4cbd20bd2ef4bc20d
Returns a MaxHeap representation of the array, where the array elements should be comparable, i.e. should implement the means to have a logical comparison done
int heapsize = arrayHeap.size(); if (arrayHeap.size() == 0) return null; EppsteinHeap eh = arrayHeap.get(0); for (int i = 1; i < arrayHeap.size(); i++) { EppsteinHeap h = arrayHeap.get(i); arrayHeap.get(getParentIndex(i)).addChild(h); } ...
0
9fb78fb345001209eeadab905b175842
07da0fba0009d272b86bfd7b8c8fe348
Selects Deficiency records by DeficiencyIDPermitKeyTOCID </summary>
String UserToken) { SqlParameter _PermitKey = new SqlParameter("PermitKey", SqlDbType.Int); SqlParameter _UserToken = new SqlParameter("UserToken", SqlDbType.VarChar); _PermitKey.Value = PermitKey; _UserToken.Value = UserToken; SqlParameter[] _params ...
0
b851e44239413ab8065c092d57db6f5b
164221d804acd84a4ed708f6f7782fbe
This is the action that's used in the features to test localization.
{ const Translation* translation; ASLocalizer localizer; localizer.setLanguageFromName("xx_XX"); translation = localizer.getTranslationClass(); string className = typeid(*translation).name(); bool foundClassName = className.find("English") != string::npos; EXPECT_TRUE(foundClassName) << className; }
1
aa403fb7d21db71d59284ae7aef3739f
6b3c2d0b010e1ae5971db301347fbc90
Represents an outgoing acknowledgement for a message ID
self.messageId = messageId self.TTL = TTL self.file_name = file_name self.sender_info = sender_info
0
869872c1c1418dd0a96df168a455a091
6d59eb7a853bcc6dddd6807d549b8d94
定时获取debug状态
class GPlayerMgr(object): def is_debug_time(self): if not self._debug_status or not self._debug_ips: return True rpc = client_rpc.get_cur_rpc() ip = rpc.addr[0] if ip in self._debug_ips: return True log.info('during debug time in_ip:%s forbid :%s', self._d...
0
0f8b33b77b8155b295249c8826d00e21
9a9bc8f9fdc5174d528f9b3f640eb1b8
Returns a new gradient which is a copy of this gradient with a different gradient axis.
const M = this.clone(); M.m = this.n; M.n = this.m; return M.map((_: T, i: number, j: number) => this.get(j, i)); }
1
1ea86b1f34381e3ae7f255e4a79ccebc
4360e1fd0a954582e12f9810412e540d
Check that the moments do change when the masking changes.
data = self.data for mfunc, nfunc in self.func_pairs: for k in [3, 4, 5]: result = mfunc(data, k) self.failUnless(isinstance(result, MaskedArray)) for x in range(len(data)-k+1): assert_almost_equal(result[x+k-1], nfunc(data[...
0
2d0089b1684c9cdf2e59ffeaab970210
c7ba28b8b9aa6dd4069c335fe53d77f6
得到τ的np数组的原始数据,即未经过标准化
def unNormalizeData(normalized_data, data_mean, data_std): T = normalized_data.shape[0] D = data_mean.shape[0] stdMat = data_std.reshape((1, D)) stdMat = np.repeat(stdMat, T, axis=0) meanMat = data_mean.reshape((1, D)) meanMat = np.repeat(meanMat, T, axis=0) orig_data = np.multiply(normalized_data, stdM...
1
65beb2d502e0b056d7810fdf1c588eb5
8daecae22e001dab27b0b58f93b79d61
日期时间字符串转LocalDateTime
public class LocalDateTimeUtil public static LocalDateTime string2LocalDateTime(String dateTime) { return LocalDateTime.parse(dateTime, DATETIME_FORMATTER); }
1
6ddef6a2afa70e163fdd0ac33bfca09d
8e39a64d841edddd19ca254feb785837
Traverses the given lock statement.
Contract.Requires(emptyStatement != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(emptyStatement); if (this.StopTraversal) return; this.TraverseChildren(emptyStatement); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Vis...
0
e1083c87d9a3561de8d72f697f8e4f19
52ff2a0d21e6f7f50f10adbae2de9377
Change e-mail sender to sitename.
class UpdraftPlus public function set_sender_email_address($phpmailer) { $sitename = preg_replace('/^www\./i', '', strtolower($_SERVER['SERVER_NAME'])); $admin_email = get_bloginfo('admin_email'); $admin_email_domain = preg_replace('/^[^@]+@(.+)$/', "$1", $admin_email); if (trim(strtolower($sitename)) === trim(...
1
8ef38c84c49a35429c32c23fc65773bd
1cae13792464d0761f7ed93eb9bf70c5
Toggle using subtitles
function toggleRequestingSubtitles() { return { type: TOGGLE_REQUESTING_SUBTITLES }; }
1
1b7351f8704713303f9a1de3fc96d6f9
5097e6d9216f696ba5733dce135574a4
Returns whether the current movie has been recently watched. Returns: True - Is has been recently watched. False - Is has NOT been recently watched.
if len(kwargs.keys()) == 0: kwargs.update(minutes=RECENTLY_MINUTES) if not self.created: return False recently = datetime.now() - timedelta(**kwargs) return self.created >= recently
1
0b0cdafc42ec3c91c0bac009174093f5
91645baf5bdb26e33c8b2639f63440e6
geometric mean for each variable
def geomean(x,w=None,axis=None,NN=True): x,w = weighttest(x,w) if NN: result = numpy.product(x**w,axis=axis)**(1./numpy.sum(w,axis=axis)) else: are_nan = numpy.isnan(x) x[are_nan] = 1 result = numpy.product(x**w,axis=axis)**(1./numpy.nansum(w,axis=axis)) return result
1
6cc9a0684c7056c09c34c40087e0e109
89321c4fc8d2127b05dbae409042de24
Submit a payment for settlement using the Braintree PHP SDK
export default class BraintreeService processPayment(paymentData) { return this.$http.post(this.apiUrl + this._processPath, paymentData); }
0
ba9d7d90a03425a366724fed0e7ce776
a7bf1465600632d538dcc968dec0bb5c
deserialize the saved data and apply it to the achievements on this object
achievementManager.NotifyPurchaseableBought( savedData.GetPurchaseableBoughtCount() ); if( savedData.IsPowerupAtMaxLevel() ) { achievementManager.NotifyPowerupAtMaxLevel(); } if( savedData.IsEverythingUnlocked() ) { achievementManager.NotifyEverythingUnlocked(); ...
1
5d4319b3b3d8ed7ff70005e8f8ef8678
69611291edb490a03fee311e051c2034
Delete the LeagueTeam's data.
namespace WelshWanderers.Database class LeagueData public void ClearLeagueData() { id = -1; name = ""; team = ""; }
0
7d891e844130985cc55f2c79aa29085b
4307bed46601abf47470ad831cb19b17
申請責任者(かな)名を設定し、自オブジェクトを返します。
public class MeiboTempTableEntity public void setカナ氏名(AtenaKanaMeisho カナ氏名) { this.カナ氏名 = カナ氏名; }
0
798ad13d0a46fda682895f2ef83a5508
2a9ea1c81418256cbb4e5f785a480d0a
得到train_examples和dev_examples中的所有字符集合
vocabset = set([]) for line in dataset: vocabset = vocabset | set(line) return list(vocabset)
1
a828beaaac052db4de268e0d736d03a7
7bf578efcf20fd553d0f7f3ad185cabc
Returns copy of the game's grid
public class GomokuGameState extends Observable implements Observer{ public GameGrid getGameGrid(){ return gameGrid; }
0
7ca0f985c78b89b9bdd5eedc783b6d06
a3c083218626820d6d41480ef4022f8d
Returns a list of Paths of all the files with the extension. All subdirectories of file_path are included. Sort list can be invoked in case time matters, e.g. in case of log data.
from os import listdir file = [f for f in listdir(path) if f.endswith(ext)] file.sort() return file
0
0f69a61b614b4672e3c10ba7f20092e8
93595de500f3a0c0621d7843b1ccc33d
Gets unit_name
public class AppointmentHistoryDataObject extends AbstractDataObject public String getUnitName( ) { return _strUnitName; }
1
aa58eca965cc38ca4cf6d6ffe88d1d4a
431319a95a832b65d8a45529230e60fb
将同一个路径下的所有pdf文件合并成一个pdf
def MergePDF(filepath, output_file_name): pdf_file_names = getFileName(filepath) outfile = output_file_name + '.pdf' root_dir = filepath output = PdfFileWriter() output_pages = 0 for each in pdf_file_names: print(each) input = PdfFileReader(os.path.join(root_dir, each), "r") ...
1
e9f1c59843d6ed35a174cb05e3a39544
8c6f954df4549d551ac8d7ab9c2da23a
해당 요소의 텍스트를 글자 하나하나로 쪼개서 배열로 만든 후 그것을 targetStringArr라는 변수에 저장합니다.
int i = 0; char * strArr[3] = { "Simple","String","Array" }; char str1[] = { "kimdonghyun" }; char str2[] = { "donghyun" }; char str3[] = { "is 개발자" }; char * strArr2[3] = { str1,str2,str3 }; for (i = 0; i < 3; i++) { printf("%s \n", strArr[i]); } for (i = 0; i < 3; i++) { printf("%s \n", strArr2[i]); } ...
0
d157208aced13952513e21fdf5ca9948
aad0060ffb68432f2dea7a586153174f
filters out future polls
class PollManager(models.Manager): def active(self): utc_now = datetime.utcnow().replace(tzinfo=pytz.utc) return self.get_queryset().filter(end_date__gt=utc_now)
0
57e76ac51208ed10cd426f0ced965e38
200920eb3b39ee84f2645799a6cc91cc
发送给当前频道在线玩家喇叭的封包
func packet_world_notices(cmd int, uid int32, bits []byte) gnet.IByteArray { return gnet.NewPackArgs(command.SERVER_WORLD_NOTICE_PLAYERS, uid, cmd, bits) }
1
ded58176025da5f70ad1457dc565b98a
7f61448ad6da3ef0f9cb03f40c5be655
No extra stuff to stop
cases like (1)
0
a753997101939ab18774c7ca3166c307
6ccabb0bac752ddca8a8f0c440d5c530
减少购物车内某一商品数量
let cartList = state.CART_LIST let shop = (cartList[shopId] || {}) if (shop && shop[itemId]) { if (shop[itemId]['num'] > 1) { shop[itemId]['num']--; state.CART_LIST = {...cartList} lstore.setData('CART_LIST', state.CART_LIST) ...
1
766325329a4c0c3fa9185c2179f085ba
c951d7abd620a5ba82df92966a8a741d
通知监听器
public class IMMsgManager public void addChatListener() { HuxinSdkManager.instance().setNotifyListener(mNotifyListener); HuxinSdkManager.instance().setNotifyListener(mGroupListener); HuxinSdkManager.instance().setNotifyListener(mServiceListener); HuxinSdkManager.instance().setNotifyListe...
1
8d1bd507938d11245518c6feabc1347f
cb271a75672d516fe2e3500be6b8eaff
Marks this filter as invalid.
class IamPair(object): def mark_as_invalid(self): self.invalidated = True
1
84ff2873f16268fb29f866ed07ef6032
4e63484c804fc40d18996edebd73a706
请求提升印记效果
if isClick == true then return end local row = TableReader:TableRowByUniqueKey("ghostPowerUp", self.data.id, self.data.power + 1) if row == nil then return end local list = RewardMrg.getConsumeTable(row.consume) table.foreach(list, function(i, v) local t = v:getType() local num = v.r...
1
dc6361c8ac26c3d38d6b5e149cc9e8b6
00b21cc5350991d424b551a9eed23e84
获取直播间骰子游戏记录
class History extends Base public function dice($game_id=2){ $count = db("dice_kj")->where('kjsjzt>=0 and game_id='.$game_id)->order('add_time desc')->count(); $list = db("dice_kj")->where('kjsjzt>=0 and game_id='.$game_id)->order('add_time desc')->paginate(20,$count); if(!empty($list)){ ...
1
d1c161127522741867a82843989350f9
9baae8e6f464334b1951e67a92221bfc
Extract $cashtag references from Tweet text.
class PerchTwitter_Tweets extends PerchAPI_Factory private function _link_hashtags($text) { $pattern = ''; $pattern = '/([\s\(]+)(#([a-z0-9_]*))\b/i'; preg_match_all($pattern, ' '.$text, $matches, PREG_SET_ORDER); if (PerchUtil::count($matches)) { foreach($matches as $mat...
1
618e9f93e00d81fc8fde55f390ed2286
fade34b376917e0f0d19e2cc593639c0
Učitavanje asteroida u listu i vracanje popunjene liste
{ float x; float y; for (int i = 0; i < numAsteroids; ++i) { x = (getRandom(100) - xmax); y = (getRandom(100) - ymax); if (hasCollided(x, y)) { --i; } else { asteroidX[i] = x; asteroidY[i] = y; } } }
0
5a25aab83c5c4af833ea8be8097345d1
8053541bff62890f065098fbcb2e2dc7
update profile of admin
class ProfileController extends Controller public function edit(Request $request, $id) { $this->validate($request,[ 'name' => 'required|string|max:255', 'email' => 'required|string|email|max:255', 'phone' => 'required|numeric', 'education' => 'required|max:255...
1
552e625c5d85c455e7ef4c6f5a886180
76d31d20a32bec9c05798a7e6575ce53
Calculates the hebrew year text representation.
{ var result = string.Format("{0} {1:00} {2} {3}", GetShortDayOfWeekName, Day, GetLongMonthName, GetShortYear); if (EnglishNumber) return result; return ToPersianNumber(result); }
0
4b7bd61f57e63efcb733a9a4d782278b
7c03f67d6d04730138f4693b7054a847
Check that the tabs appear in the correct order
public class initialStateTest extends MoneyKeeperGUITestAbstract{ @Test public void checkTabsAreClickeable() { clickOn("#pieChartTab").sleep(500).clickOn("#barChartTab").sleep(500).clickOn("#tableTab"); System.out.println("1.4. Tabs are clickable"); }
0
c9e6a4134e888955c044410d02863a25
25acfaaad3a772f037c8b0a17b76c5fc
Creates a modification that performs a scaling about a given point
impl Matrix2D pub fn scaling_point<P: Point>(p: &P) -> Matrix2D { let p = p.into_f64(); Matrix2D([p[0], 0.0, 0.0, p[1], 0.0, 0.0]) }
0
462ec582d8cf5e7f8517b40b89b597f7
590af5e44a3f14c53fe27993d1165342
Return whether the specifics preclude using copy_image.
namespace DotGecko.Gecko.Interop Boolean CanCopyImageContents();
1
412a04c08121572211484d83279b4df5
2e96c275f5f1c06a315f7a897dfbda33
Returns an instance of the UMI without dashes
for um_pattern in um_patterns: m = re.search(um_pattern, name) if m: um = m.group(1).strip() name = re.sub(um_pattern, "", name) name = re.sub("(,)$", "", name).strip() return (name, um) return (name, None)
0