query_id
string
corpus_id
string
query
string
code
string
label
int64
f8212820c305537e05add6ba46f764d6
b716272bf4de87fd3c16f8d0eeff7326
function that returns the order history for all items
[Serializable()] [System.Web.Services.WebService( Namespace = "http://cards.birchcraft.com/", Description = "Some descriptive text could go here.")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class MainInstance : System.Web.Services.WebService [WebMethod] public List<ItemOrderHistor...
1
dae9dfaf8edf0b20e8f7b7b3d8055abd
5389fb30aa3610d740217ebdbc81c988
The last time an export was attempted. Data is Unix epoch time in milliseconds.
class ExportExecutionResponse(dict): def processing_start_time(self) -> Optional[str]: return pulumi.get(self, "processing_start_time")
0
ef9fe374f1367c868174f56c67af407a
20d3882f49e3180fa35f5ef2f0c8cbbb
Cleans up the properties the text boxes are bound to.
{ foreach (var grid in validatorGrid.Container.Children) { var uiElements = grid.Cast<Grid>().Children.ToList(); grid.Cast<Grid>().Children.Clear(); var textBlock = uiElements[0].Cast<TextBlock>(); textBlock.DataContext = null; var textBox = uiElements[1].TryCast<TextBox>(); if (textBox ...
1
2ca2e37e3369d7ac280b3529899640c9
737291223f7fe086863044a608502beb
获取环信用户登录信息
function getLoginInfo() { return get("/oauth/getLoginInfo"); }
1
507170afef1cf9d65b41b56d6b9da4aa
18dd4c8fa76033d651a69c9e4f9d8628
Handles code for squashing animation
if (this.zoomFactor < this.options.zoomOutFactor) { this.zoomOutAnimation(); } else if (this.isInsaneOffset(this.offset)) { this.sanitizeOffsetAnimation(); } }
0
20b545bb993d3ecd2c613f403f1b28a7
7fbeff56f4fd4a3fc4fcb631f3a91b5c
stops motors and resets encoders
public class AutoLibV2 public void resetEncoders() { leftMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER); rightMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER); leftMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); rightMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); }
1
8fae0c1c80fc965ff1d79fa52dd7163d
d5f65c7f0bcf19d5f788b5ada3ccdbb4
Asynchronously deletes the <see cref="BlogPostFile" /> from the system.
namespace AstralTest.Domain.Interfaces Task DeleteAsync(Guid idFile);
1
50042cbcc4d5d78b8c167d7cfc0a6d87
9013df0432247c24f88a8ef9e7c7a50a
首充的红点
public class ActivityModel : Model public bool IsShowFirstRechargeRedDot() { bool isShow = false; var firstPrize = GlobalData.PlayerModel.PlayerVo.ExtInfo.FirstPrize; if (firstPrize == FirstPrizeStatusPB.FpUnaccalimed ) { isShow = true; } retu...
1
85a910ee63ceef9ce13a5f830a8f7661
f6a9f8f051102e69f20d070a2740f3fd
Acquires the mutex and returns a context object which must be disposed to release the mutex.
namespace Frost.DirectX internal class SafeList<T> : IEnumerable<T> public UnsafeContext AcquireLock() { return new UnsafeContext(this); }
1
72b6d86a120797d607831722bc0620da
49e3c19bc171dc624dde42c523e67ff1
Calculates which Guppies have died.
r, g, b = collect_data(run_data) if (r != 0 and g == 0 and b == 0) or (r == 0 and g != 0 and b == 0) or (r == 0 and g == 0 and b != 0): with open(output_file_name, "w") as fh: fieldnames = ["total count", "red", "total red points", "green", "total green points", "bl...
0
ac96501d5537ab7018189a41477b203a
5da748d5a057fdba8c0f7334d71c832e
蓝牙功能是否已经启用
public class BlissUtils public static boolean hasBluetooth(Context context) { return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH); }
0
2edbcb6651e77c609d854e2d8437e513
d06104216d3441e7bdd4f0692c28d386
Initialize one or more filters as if they were contained in a probe.
self.h5_file.createTable(self.h5_file.root, 'probes', probes, title='Probes', filters=self.pytable_filters) self.h5_file.root.probes[:] = probes self.probes = self.h5_file.root.probes[:]
0
ca01d96cd33b93509971954ea743e8ae
0d4ba005bbd3663167683b58eae60df1
Get customer invoices by customer partner tenantid and filter by date.
{ var request = Request("invoices"); if (page > 1) request.AddParameter("page", page); if (from != null) request.AddParameter("from", from.Value.ToString("yyyyMMdd")); if (to != null) request.AddParameter("to", to.Va...
1
bd6fa2ff1dd39fc2fbbe069c1f61a595
d56affc6d9b9ccf287906185320bdce5
Increase kittens collected
void PlayerStats::keyCollected(){ ++m_keyCollected; addScore(SCORE_INCREASE); }
0
b706f943cab282a7239f4a1f549e274d
b67ee9717c5636f0ec17bc0b3b5bd6c8
@brief Returns whether the IP task is ready.
{ if(this->mode != wifi_AP_MODE){ return this->status.got_ip; }else{ ESP_LOGE(wifiManTag, "Device is AP mode!"); return false; } }
1
2070c22bf8a89d4fbbe032059ef56baf
ee967a96f5aaa8ddb534448a2752913d
Actions require login
class ViewController extends AbstractController public function before_action() { $this->_require_login = false; return parent::before_action(); }
0
2039ef9c6e76347c1300e4944ccbd7a5
d40a9fa4557bf57b27a715295c0f5e82
Cette méthode enregistre les données de l'instance en base de données. Elle retourne vrai quand l'enregistrement réussi.
{ try { $aParameters = $this->getInstanceData(); $oInsert = new Insert(); $oInsert->setFrom($this->getTableName(), true) ->setParameters($aParameters); $oStatement = Pdo::dbQuery($oInsert->build(), $aParameters); $this->{static::PRI...
1
ab2d785c2d2e2bb99eed8b13d0d3bca4
e30445051592f43cd0854cd355898189
返回所有已behavior为endNode的behaviorLine
function getEndLines(boxId) { var arr = []; for (var i = 0; i<lineArray.length; i++) if (lineArray[i].getAttribute("endBoxId")===boxId) arr.push(lineArray[i]); return arr; }
0
d9db9cc29df5fb2507dd65a1ef3fe97d
3ccd49d3444660e6d0c870b533df41d3
标记虚拟物品已经兑换
map<string,GoldExchangeItem*>::iterator it = GlobalData::shared()->goldExchangeList.find(itemId); if (it!= GlobalData::shared()->goldExchangeList.end()){ if(it->second->type=="3"){ it->second->isPayCallBack = true; } } }
0
113849989599c45231a40ebf29d5799d
e09b3773b1f30afd9f60b2c681e15092
función que obtiene el nombre del curso
String getCurso();
1
f7122472405a0866b480d497b1837b0f
5c29f0a18fe4ea6e1bb905adea1a6736
Gibt die gefüllte Liste mit dem Score und dem Usernamen zurück.
class Game: def scoreboard(self) -> List[User]: return sorted(self.users, key=lambda x: x.score, reverse=True)
0
abf1cbc91749cb671ff041ffd233362b
0859ce11ea6099b25ea110b5d1f611b2
Converts object value into a float or returns default value if conversion is not possible.
public class NumberHelper public Float tryParseFloat(Object object, Float defaultValue) { return this._tryParseTo(object, defaultValue, Float.class); }
1
bc04e4abd4d89e6b33a88ae36b0b8536
e86ce5ca18f0d070f8c6da802ab02e75
Create a risk overview table using a model or list of models
figure_size = (20, 8), **kwargs): X = utils.check_data(X) risk = model.predict_risk(X) if use_log: risk = np.log(risk) if len(kwargs) == 0: fig, ax1 = plt.subplots(figsize=figure_size) risk_groups = None else: risk_groups = {} fig, ((ax1...
0
48e321f206ef3d9402b78c2818df8ec5
c9c2ac432dc50aa0f4df08876347b7f0
Get assigned worker ids.
class DaskClient: def getWorkerIds(self): return self.WorkerIds
1
4c8544f9aa62a6444ad076d79277b9a8
3348eba7ccad883ef4cad74e8a473d3b
setzt den boolean-Wert einer Straße neu
public class Tiles public void setWall(int wallDirection, boolean value){ walls[wallDirection] = value; }
0
31bcf61775fe547ec2085f13ed65a564
dd8f7708eeb65539ee168196e714a746
Calculate geographic north from magnetic north
double greenwichMinutes, double greenwichSeconds, double geographicalLongitude) { double a = HmsToDh(greenwichHours, greenwichMinutes, greenwichSeconds); double b = geograp...
0
020e43655489d235d13c4ae495e28003
a5f3d16661f37b9269d8599abd026b2d
To convert the path column to string type. :df: dataframe, dataframe that has path column :visit_path: str, name of column which contains path data Returns :df: dataframe, dataframe that contains path column as string type
df = df.copy() df[col_name] = df[col_name].fillna("") df[col_name] = df[col_name].astype(str) return df
1
528c7354656c757362ff4550ee01ca61
a74d285a94ab01606f9be938bd674289
If nothing else happens, display usage information.
void DisplayUsage(int argc, char **argv) { printf("USAGE %s [-D lvl] [-i initial] [-f final]\n", argv[0]); exit(-1); }
1
688f46afb0ffaa586ba8238871f1d2bc
d5dc11fbf29a46419abf2f423d4e07a6
given a list of lists, replace all Entity references in the inner list with ID numbers
def vocab_to_id(talk_list, vocab_dict): for (sentences, sentences_ind) in zip(talk_list, range(len(talk_list))): for (s, s_ind) in zip(sentences, range(len(sentences))): for (vocab, vocab_ind) in zip(s, range(len(s))): talk_list[sentences_ind][s_ind][vocab_ind] = vocab_dict[vocab...
1
a78c75d558eba52fe03cd41ce7d5ea9e
40fc77d8033f8c2c9def5cc07c3c4ea9
Attack a network by Project Gradient Descent. The attacker performs k steps of gradient descent of step size a, while always staying within the range of epsilon (under l infinity norm) from the input image.
def fgsm_attack(image, epsilon, data_grad): sign_data_grad = data_grad.sign() perturbed_image = image + epsilon * sign_data_grad perturbed_image = torch.clamp(perturbed_image, 0, 1) return perturbed_image
0
4cb6a09d1d6a597c2c2524ea409e2ea3
649b0f7c16b5d06789d5d132f6527bc1
Creates canvas with background image and border and set up it into $this->image property
class Captcha protected function imageCanvas($background) { return \imagecreatefrompng($background); }
0
85b9e72a70dd0655ca0c73aa7f0c434b
6318b1ea752312bdd482127295f1e913
Constructor de la clase Interfaz.
class Interfaz(Frame): def __init__(self, padre): Frame.__init__(self,padre) self.pack(fill=BOTH, expand=True) self.img = None self.cambia = None self.creaCanvas() self.creaMenu()
1
cf29180a97dbfed661251e5f0832b451
205c9ed5644612fae0fd47742f619895
获取单篇文章的法条
namespace InsoftBusinessLogics.Crime public partial class CrimeBusinessLogic : Component public string GetArticle(Guid LawBreakerID) { return crimeDbAdapterX.GetArticle(LawBreakerID); }
1
97f1f6a56c21d3dfc2ff69f286f8eebb
9ffc110dc2cdba3f176aa4e5a689b345
Edit each new customer with the runner to be assigned. <p> Requires an accompanying list of customer descriptors describing these new customers and reflecting the assigned runner.
public void run(String... args) throws Exception { DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm"); Customer customer1 = new Customer(null, "Raphael", "Eiras", df.parse("29/06/1983 00:00"), "22984511093", "337787918", "reirasdev@gmail.com", new String[] {"21998763421"}, ...
0
d41bb5cebba9f2993ba020a549f94d62
32fa575b1fcd14e5e4e3b6de3554a771
(non-Javadoc) 通过主键查找系统参数
public BatchSysParameter getByPK(Long primaryKey) throws ServiceException;
1
592031bd6b8940f8e75595a3090349f3
c4e6956044a3f0b18daf4cde9295f17d
Get achievement from cache.
bool COHSteam_GetAchievement(const char *pchName, bool *pbAchieved) { SetSteamFPUPrecision fpu; bool rc; if (!s_haveStats) return false; rc = SteamUserStats()->GetAchievement(pchName, pbAchieved); if (s_debugLevel) { printf("STEAM DEBUG: COHSteam_GetAchievement '%s': result %d return %d\n", pchName, *pbAchie...
0
4b9e728f8c216c4c131f421c3feb5901
43b080334340544b4c9047ae778edf54
根据课程名查询课程编号
String no=null; String sql = "SELECT lpy_Courseno15 FROM Lupy_Courses15 WHERE lpy_Coursename15=?"; try( Connection conn=getConnection(); PreparedStatement pstmt=conn.prepareStatement(sql)) { pstmt.setString(1,name); ResultSet rst=pstmt.exec...
1
0df25645392e8f69e9d26f6e48152256
27051998e2e7888f45e517ccfe8b0975
Measuring the algorithm process time in milliseconds.
public class ExtendedBenchmark extends Benchmark public long measurement() { long start = System.nanoTime(); benchmark(); return (System.nanoTime() - start); }
0
d9d34a0e9ac2414b1c34e7d72916bce8
a4ba3cb9dad0f98e40d27d447c052146
SMS_Lite 构造方法初始化配置
class Yunxin extends BaseSms protected function initialize(array $config) { parent::initialize($config); $this->smsAccount = $config['sms_account'] ?? null; $this->smsToken = $config['sms_token'] ?? null; $this->payNotify = ($config['site_url'] ?? '') . '/api/sms/pay/notify'; ...
0
261126a6f30170ba21a03230a3b1b0b5
9cf23de6aeb055c5804c7b8f91e82435
Deletes cached entries older than a day
class Vtiger_Cache_Cron extends \App\CronHandler public function process() { $time = strtotime('-30 day'); $dirs = ['pdf', 'import', 'mail', 'session', 'vtlib', 'rss_cache', 'upload']; $exclusion = ['.htaccess', 'index.html']; foreach ($dirs as $dir) { foreach (new \RecursiveIteratorIterator(new \RecursiveD...
0
97ef126a03177043691585891f44ab60
4e7fd2340e32d78ed969ad5cc10bfdbe
Метод для форматирования айдишников присутствующих людей в строку формата "_id_id_..."
def format_id(house_id): return '{}a{}'.format((23 - len(house_id)) * '0', house_id)
0
96716fca2c97a0bc0e34b4939285ac31
4bffe378ba4a1c35eb7ca8f15456f809
Update the target position from RemoteValue (Callback).
public class RemotePositionManager extends RemotePositionBase{ public void onRemotePositionCallBack(final RemotePositionListener listener){ mHandler.post(new Runnable() { @Override public void run() { setListener(listener); } }); }
0
7b744ff072db2844daf101cba0e4c7b7
2e1de527e087503670a61684b2f6a8d2
flip_case: This function accepts a string and a letter and reverses the case of all occurances of the letter in the string.
def f(s): ss = s.swapcase() return ss
0
eb67a4ad0073bb29cad657159e9e7b53
423d1865bd7a3ac02a9e65fe7d1d73f9
The Euclidean Algorithm finds the highest common factor of two numbers. Here we create lists of number pairs and run the algorithm on it, printing out the result and the numbers divided by the HCF.
integer* higher; integer* lower; if(compare_integer(op1, modulus) < 0){ higher = modulus; lower = op1; } else{ higher = op1; lower = modulus; } list* a = create_list(10); list* b = create_list(10); list* q = create_list(10); list* r = create_list(10); append_list(a, (void*)higher); append_list(b, (v...
1
7b24f6db1b7122889eb0e312766c1cb0
d748257e4804e44f26fa56162f8f9388
縦フェードアウト
public class fade_black : MonoBehaviour IEnumerator Fade() { for (float f = 0; f <= 1; f += Time.deltaTime*speed) { panel.color =new Color(0,0,0,f); yield return null; } panel.color =new Color(0,0,0,1); SR.sprite = SP [next]; for (float f = 1f; f >= 0; f -= Time.deltaTime*speed) { panel.color =new C...
0
52809330aa15e8427f4f196efa17028f
a15ded1ae7612cfbdccf4d13bac90d67
是否删除此张图片
@Table(name = "skd_image") public class SkdImage public Integer getIsDel() { return isDel; }
1
7f601773cd17bab148fdf07cf4094b06
37ba2499167d60ca82513d8a578d08b0
Creates a new instance from a ISO 8601 date array.
public static function createFromDate(int $year, ?int $month = null, ?int $day = null, $timeZone = null);
0
c2b30e1a7e486ff78bdeaa2ddde61f31
f76487c753ee9b0546de676ccbe291a1
Updates render angle of the pointer and fires PropertyChanged event.
namespace Tech4WPF.Common internal class AbstractRotatePointer : UserControl, IRotatePointer, INotifyPropertyChanged private static void angleChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { AbstractRotatePointer rotatePointer = (AbstractRotatePointer)d; ro...
1
5a1bbcd24d5d2b18439d4b38cab9d8fd
89c65fe569c716271f055648c5ee9563
GET: StCourseEnrollments
namespace OnyeijeSchool.Controllers [Authorize(Roles = "GlobalAdmin")] public class StCourseEnrollmentsController : Controller public async Task<IActionResult> Index() { var onyeijeContext = _context.StCourseEnrollment.Include(s => s.AdmCourses).Include(s => s.Student); return Vi...
1
c9df470e9ca8d1db4a8dfc29d447fe81
324807e48e02703c9de0d6c08473e362
Set source_image_id
class Project implements HyperionEntityInterface public function setSourceImageId($sourceImageId) { $this->source_image_id = $sourceImageId; return $this; }
1
d73b56caca133af8c58049ced8bc772c
f019faa14dde8022161e684361374d3a
create csp header string
if @cookies.length > 0 and (!args.key?(:cookies) or args[:cookies]) cstr = "" first = true @cookies.each do |cookie_name, cookie_data| cstr << "; " if !first first = false if first cstr << "#{Knj::Web.urlenc(cookie_data["name"])}=#{Knj::Web.urlenc(cookie_data["value"])}" ...
0
f7cd68371f29799e5155bfc0b3a293ca
1d885f9c1f7442ae8a89b014de27741c
Добавление оценки на заявку
{ $form = $this->createForm(AppraiseForm::class); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $data = $form->getData(); $em = $this->getDoctrine()->getManager(); $appraise = new Appraise(); $appraise->setRate...
1
477f8530de7a914df5426424b4070406
277a9ce5ce4d42a3990e107cea1f98a4
Called whenever a write completes and the output buffer is empty
static void output_end ( struct jpeg_compress_struct * cinfo_p) { app_write_t * app_p; app_p = cinfo_p->client_data; app_p->bufn = app_p->bufsize - cinfo_p->dest->free_in_buffer; app_p->writebuf (app_p); }
0
c90a921d74a49a315a2134a1831b3f73
ae9721ae9d5de837d215e8c169247a84
The maximum time a connection can be used before it *may* be given away again.
public class ClientConfiguration public long getConnectionTTL() { return connectionTTL; }
1
e226d0f04be2be530a9edf742b3a5495
42d119918944bf2fcb413205f058bf44
function: generate_csv
def get_csv(n): return '\n'.join(generate(n))
0
71c4258fed4205417c6142bc4635d051
91b2853ebe458b5d0282a8e2230808dc
This function returns the size of the result vector for storing prime numbers
result_type * prime_1_svc(int *argp, struct svc_req *rqstp) { static result_type result; int number = *argp; int test_num = 3; int i; int is_prime; int prime_count; struct timeval t1,t2; gettimeofday(&t1,NULL); if (number > 1) { prime_count = 1; while(prime_...
0
02ebc4029696b0b17c0e42d480318e0d
85c8d9c908bd366680cabdb031bdf1e7
Get the 2d array index for a given pixel number. NB: Returns (y, x) because numpy array is row-based.
x, y = pixel x -= 32 y -= 41 return y // 56, x // 56
1
8f3bcd4d638a1074d957fcebc3f1bc4e
c5f05cae9bdca8bb3563d9f80f3908ea
Returns the ids of the creators the given user has subscribed to.
class UserRepository extends AbstractRepository public function getSubscribers(int $id): array { $dto = []; $user = User::find($id); if (is_null($user)) { throw new NotFoundException(); } foreach ($user->subscribers as $user) { $dto[] = UserDtoFactory:...
0
e597f552824fa33321911794729370e4
8ec9c16ea595667cbce631cdded41158
convert global (row, col) pair to local (row, col) pair
void Boggle:: convertOut(int pos, int& row, int&col) { col = pos%5; row = pos/5; }
0
661db0da9818d083af47706db70ad25f
bdb57d92bb1c1da375ace5481881d437
Convert all dates to DateTime in the UTC time zone for consistency.
if (schedules.length) { const fields = ['arrival', 'departure']; schedules.forEach((schedule) => { fields.forEach((field) => { if (schedule[`${field}_port`] && schedule[`${field}_at`]) { const port = schedule[`${field}_port`]; if (port && port.timezone) { const co...
0
06b2fc6e4c87d126448be5d322fcd7ac
ec3a11d8e9b2a952e0ffd1021111b673
Removes all items from the user's cart and returns them to the appropriate storefront.
{ var requestObj = new BasketIn() { PharmacyId = SessionData.StorePharmacyId, }; var url = WS_MG_CLEAR_CART; HttpResponseModel response = null; try { response = await Client.PostJson(url, JsonConvert.SerializeObject(requestObj), authBundle); } catch (PharmacyChangedException e) {...
1
db9001991c60433a8312cb0905dea957
9b8c94d744e11fa8e7fb3f462d5b6177
Creates a new GWS renderer to perform rendering on any buffer. Only one instance of this object is required by GWS. If you override the default GWS Factory class, and this method call, You need to provide a valid IRenderer implementation.
namespace GorgonLibrary.Graphics public static class GorgonGraphics2DExtensions public static Gorgon2D Create2DRenderer(this GorgonOutputMerger graphics, GorgonRenderTargetView target, int vertexCacheSize = 32768) { return Create2DRenderer(target, false, vertexCacheSize); }
0
c60b82b6aca8184b9ae725e9d51f61fa
e9fee94d566328a601d9eaef2f1dddb7
Obtains eigenvals/vectors for bands at specified wavevectors
void EigenCal(char aorf_c, char uord_c, HM *hm, double u, double k1, double k2, lapack_complex_double *w, lapack_complex_double *v) { lapack_int ln = LN, lda = LDA, ldvl = LDVL, ldvr = LDVR, info; lapack_complex_double vl[LDVL*LN], *work; int aorf, uord; double rwork[2*LN]; double a0re, a1re, a2re, a3re, a1im, a2...
1
5bf97b9145d1ee7f914056cdc1a5e558
a8108e7afd9c6ea87be3f3b3f2c79c48
updates map moves for current player totals before move
if (parseInt(player.playerId) === parseInt(this.selfId)) { const clientAheadBy = player.moveIdx - data.moveIdx; while (player.pendingMoves.length > clientAheadBy) { player.pendingMoves.shift(); } this.updatePosWithRemainingMoves(data, player); } else { player.updatePos(data...
1
a752c01811362abed5c7ead9b266fd90
1e518d23063628fcf9dd9206c6015dcd
PBKDF2 Implementation (described in RFC 2898)
static int32 pkcs12pbe(psPool_t *pool, unsigned char *password, uint32 passLen, unsigned char *salt, int saltLen, int32 iter, int32 id, unsigned char **out, uint32 *outlen) { psDigestContext_t ctx; pstm_int bigb, bigone, bigtmp; unsigned char diversifier[64], saltpass[128], hash[SHA1_HASH_SIZE]; unsigned...
1
6efe684e379fcff11eaa1fbdd9428860
5c210bddc4e8e0cd591fa251610fb419
以一对一的方式对标签进行二值化 适用于多分类
def to_categorical(labels,num_class=12): y_binary = np.zeros((len(labels),num_class)) labels = list(labels) for i in range(len(labels)): if labels[i]<num_class: y_binary[i][int(labels[i])] = 1.0 return y_binary
1
2bcb0e03ce70224e1d342f8ca746ffb0
ec76e394cda88e4eb8473944c196d6cb
Read size bytes, returning an ndarray with np.int8 dtype. Incorporate information from multiple underlying files if necessary. The individual file pointers are assumed to be pointing at the right locations, i.e., just before data that will be read here.
class MPSSE(object): def Read(self, size): return _mpsse.Read(self.context, size)
0
08a9f9730b5752581003333961acfe5e
b1b1e6a66bbadc3734dc568efc9a9025
Converts a Julian Day timestamp to a POSIX time timestamp
Y := float64(t.Year()) M := float64(t.Month()) D := float64(t.Day()) hrs := float64(t.Hour()) min := float64(t.Minute()) sec := float64(t.Second()) d := min + (sec / 60.0) d = hrs + (d / 60.0) if M == 1 || M == 2 { Y = Y - 1 M = M + 12 } A := math.Floor(Y / 100) B := math.Floor(A / 4) C := 2 - A + B E...
0
d6a4936182c3f76c88ab9d0f480ed53b
fc1662c609063269754ad08de5dd0389
Subscribe to notification of ALDB record changes.
const on = db.on as DbEvents & IDBChangEvent; on("changes", (changes) => { changes.forEach((change) => { switch (change.type) { case 1: change = change as ICreateChange; console.log("[DB CREATED]", change); this.tableChanges$[change.table].next(change...
1
574b046b988fbdd48b0b41d2a9f6e131
f844ec0d7c5a0de8e3c7961820a146b6
Gets a list of contact scoring data in specified address book.
{ var route4Me = new Route4MeManagerV5(ActualApiKey); CreateTestContacts(); var contactIDs = new long[] { (long)contact1.AddressId, (long)contact2.AddressId }; var result = await route4Me.GetAddressBookContactByIdsAsync( contactIDs); Pr...
0
3069150f06d148cc364b02bb8d26889b
c9460c2cd6a40a7d6529f9015d00f551
检查试卷是否全部设置了客观题答案
boolean done = true; for (SubjectBasicData data : datas) { int type = data.getType(); String userAnswer = data.getUserAnswer(); String remark = data.getRemark(); if (type == Constant.SUBJECT_TYPE_SINGLE_SELECT || type == Constant.SUBJECT_TYPE_JUDGE) { if (userAnswer.equals("")) { done = false; ...
1
3735d59139f121511a5cf2453cd1ae05
d6bf9b9ac7f1f875a9b1469c71817116
Save holiday calculation plan.
namespace WorkoutHelper.Interfaces void SavePlans(IEnumerable<PlannedWeekday> weekdays, int userId);
0
599afafdf3c827cd5f0c611ba5d68a82
b80b03dcf67a306421eeedb7f127473d
当CheckUser_Authorization时写日志
define('UID', isLogin()); define('ISROOT', isAdministrator()); $url = strtolower(request()->module() . '/' . request()->controller() . '/' . request()->action()); if (!UID && (request()->controller() != 'Pub')) { return $this->redirect('admin/pub/index'); } else { ...
1
e773cb936874c85b46d35a6726e44244
62d3769c6afff5fcc65f7ee96eb4e88d
Creates the statistical feature net.
class NormalSeqFeatures: def __init__(self, stat, sr, cor): self.stat = stat self.SR = sr self.correlation = cor
0
bac550eb27367b4c34a7cf5f487d3e34
1c5e40a5bea70b31f7974e2fe36a4605
暴力法:将给定链表进行直接串联,取出节点的值,进行整体排序,在合成链表上进行赋值,返回其首节点
auto f = [&](const int x, const int y)->bool{return lists[x]->val > lists[y]->val; }; priority_queue<int, vector<int>, decltype(f)> Q(f); ListNode node(1024), *p = &node; int k = lists.size(); for (int i = 0; i < k; ++i) { if (lists[i] == NULL) { conti...
0
fb99dea1490b6917779bc642334e4680
f101ef080f954ef8607fe37107ca83d0
Returns a list containing the first possible path from the start vertex to the end vertex in this graph.
S = [start] pi = {} while end not in pi.keys(): if not S: return [] curr = S.pop() for vertex in self.adjacency_list[curr]: if vertex not in pi.keys(): S.append(vertex) pi[vertex] = curr ...
1
491a577f9da803e48634e502599722c2
ac3b129a15250e5786d620a3d6e664c5
Suppression d'un medecin en base
class MedicamentController extends Controller public function destroy($idMedicament) { $pharmacie = DB::table('medicaments')->where('idMedicament', $idMedicament)->delete(); }
0
d9026ce5053ac3c76a5b5874715b757e
2335caea83dac21576299f2d0c5be0c7
Tester la modification d'un objet avec id = null
@SpringBootTest(classes = TestApplication.class) @RunWith(SpringJUnit4ClassRunner.class) @Import({ CassandraRepositoryConfiguration.class }) public class CassandraServiceTest @Test public void testUpdateIgnoreNull() { TestModel model = new TestModel(); TestModelKey key = new TestModelKey(); key.setId(3); model...
0
8983e95f34616dc7044e3ecc1f05e0b7
4bfbf97109e27c1024b7d32bd5f5438b
msec -> sec
unsigned long usec_to_msec(unsigned long usec) { return usec/1000; }
0
8362d7ad1ed7f03f7badb64defd62954
70e0f643f2e4ef1708c290ed4be5ca89
Проверка, если в автомате нет вообще монет
{ $ret = 1; foreach ($this->monowall as $mono) { if (!$mono->fetchAllNat()) $ret = 0; } return $ret; }
0
5221679ba47679708efd0d17df19173e
2589b65fadbb69437524bfa7550502dc
clear the pixmap to black
class PainterWidget(QWidget): def clear(self): self.pixmap.fill(Qt.white) self.update()
0
6651b5747977e16636e6d488a9e91659
872f7cd2188bf17f057ce76958f25344
reset the Add Rule form field values whenever the user moves folders
const fieldsToReset = ['resourcePool', 'datastore', 'vmFolder']; fieldsToReset.forEach(f => this.formGroup.get(f).setValue("")); }
1
add358f5ac376ccafa87486d30e03f5d
5596668de685e94fbc5a08a4aa1eaa43
Finds the marks for a specific student.
class Student extends ActiveRecord public function getMarks() { return $this->hasMany(Mark::class, ['student_id' => 'id']); }
1
976352fb2eb2802487921d0ea7ddd171
06f83eca36e440e34dc4772775e64473
Returns the root HREF for links.
{ if ($this->isPrefetch() && !$this->skipPreloading('href')) { return $this->node; } return null; }
0
d07b87a8810b3e8d6b9ab5ff4098f3ee
5464f9ba45946d346910cd95ea13ae8a
Metropolis-Adjusted Langevin Algorithm.
class HMC(Sampler): def transition(self, closure): nlp = closure() for i in range(len(self.momentums)): self.momentums[i] = torch.randn_like(self.momentums[i]) for m, p in zip(self.momentums, self.params): m -= (1/2) * (self.t/self.L) * p.grad for l in range(self....
0
2ee6b1228fcf6196b8f3f3887ea3e5fe
cd5808e01e8f6ed6feb1897f91370a2b
Returns the Mechanical Turk Site to post the HIT to (sandbox. prod)
if($this->getOption('sandbox') == "true") { $env = "sandbox"; } else { $env = "prod"; } return $this->_request_url[$env]; }
1
bdf341acc3b7950dd35c0bc0d3a74ab2
01d7d9d9d31323e3dfb80046d8226918
Returns rebuilt property tree as flat property file
function toFlatTranslations(translationTree: ITranslationTree): IFlatTranslationsDictionary { return getFlatTranslations(translationTree); }
1
c703cea651e81c99c70d534aed4bb942
5f95dd172a7869f266a55a69f85c34e7
Returns the user prefs' GUI theme settings.
ETheme PreferencesManager::theme() const { return cache_->theme; }
1
93274ff05649e8a572acfe055fb48cf6
1a416e2a3a11da236c3a08292df9f2c9
Whether to close the window when unloading
function onUnload(deactivatedWhileWindowOpen) { if (!deactivatedWhileWindowOpen) { return } }
0
50ddf5bde3f8d6b4e1eada248931e488
b0f1a636f45b1c593ada7871024b140e
Formats a message for warning. If on a posix system the message will be in color.
void Com_Warn_(const char *func, const char *fmt, ...) { static char msg[MAX_PRINT_MSG]; if (fmt[0] != '!') { g_snprintf(msg, sizeof(msg), "%s: ", func); } else { msg[0] = '\0'; fmt++; } const size_t len = strlen(msg); va_list args; va_start(args, fmt); vsnprintf(msg + len, sizeof(msg) - len, fmt, args); ...
0
1ca978cf69b28f389771954b683678bc
f54ed61ce15b2490400c6248f5da217a
функция, проверяющая число на простоту
def isSimple(number): for i in range (2, number): if number % i == 0: return False return True
1
8fe0c563c584f1c090c4ed68d34d4a67
6232eff59e081bb4a0e36afacec481a3
检测打什么牌后可以听牌
List<Byte> handCards = new ArrayList<Byte>(); handCards.addAll(c.gameData.mPlayerCards[c.position].cardsInHand); if (c.card != 0) { MJHelper.add2SortedList(c.card, handCards); } List<Integer> cardsDown = c.gameData.mPlayerCards[c.position].cardsDown; logger.in...
1
fa6f87bbe7a156302dc34022921802b9
5e17abdadc99278441f070b16a27b04d
devnm - vardas (MZ, MX, ...), devn - kisenes nr., grazina devnr - ireng. masyvo indexa, True - surado
if len(tuple_tuple) > 4: raise IOmodule.MyError ( "Velikost vstupu neodpovida" ) for tup in tuple_tuple: if ( len(tup) != 16 ): raise IOmodule.MyError ( "Velikost podprvku neodpovida" )
0
48183bd3a64bf7712cebc7252d910062
d075f3af38fe451bd63bd33912e947a4
Reshape the image data to be used in a Convolutional Neural Network.
X = inputs X = X.reshape((-1, 1, 28, 28)) return (X, X.reshape((-1, 28 * 28)), targets)
1
1ca4513c6e9a63cfe59114daeedf0fa8
fb91406b7317098f69757437d3627610
Is the parse node a configuration node?
class IpSubscriber(object): class Nodes(object): def is_config(self): return False
0
b5262014dfee157f5901c98cb06c8217
e11be0026659003d6b39691ed592eca6
Assuming you want case-insensitive comparison
namespace TA_IRS_Bus bool AddressUtil::caseInsensitiveCompare(const std::string& s1, const std::string& s2) { return (toupper(s1) == toupper(s2)); }
1
1b73fa39f6a4ca73b3ff6860b83e5cc6
d7d1864a9adfa552f124517ea03c781b
设置巡逻模式--无参
function IDRoleBase:unsetWild() self.state = IDConst.RoleState.idel self:dress(IDConst.dressMode.normal) self:setMoveSpeed(1) self:setAttackSpeed(1) end
0
a54c39570080eee8143b179cf89ba2c4
8b579f724d926c0891fa7b78e0080cd2
Set 'IsPilot' value
abstract class BaseMember extends BaseObject implements Persistent public function setCoPilot($v) { if ($v !== null) { $v = (int) $v; } if ($this->co_pilot !== $v) { $this->co_pilot = $v; $this->modifiedColumns[] = MemberPeer::CO_PILOT; } return $this; }
0
22ca605df4a45e02f5a6926d8ff80e96
72c3de0c60e8eabe5db8812c50c49a74
获取rect_trans的size,来设置target_trans对应控件的大小
public static class RectTransformEx public static Vector2 GetSize(this RectTransform selfTrans) { Vector2 size; Vector3[] corners = new Vector3[4]; selfTrans.GetCornersWorld(corners); size = corners[2] - corners[0]; return size; }
1
dc2eb8883c155438881c0681175f5cfa
66320cc03929d466d3a1c97f0f84ce26
Filter external tasks only with null tenant id.
public void filter(ClientRequestContext clientRequestContext) throws IOException { if (clientRequestContext.getUri().getPath().endsWith("health")) { return; } String tenantIdValue = ThreadContext.get(HEADER_KEY_TENANT_ID); if (tenantIdValue != null) { LOGGER.debug("Forwarding X-Tenant-Id header, current ...
0