query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
ef2ae74795a3c94a328d2c048510fd1d | d252a45a1ec17893cfb2352387c09446 | Calculates transactions for each contact | aggregations = {
'contactsAdded': sum,
'contactsRemoved': sum,
'contacts': lambda x: np.median(x).astype(df['contacts'].dtype)
}
for col in df.columns:
if col not in aggregations:
aggregations[col] = last
df = df[validators.android_phone_contacts(df)]
retu... | 0 |
09a432cdf3619d7ee11c341e564d8f14 | c1e8a4f2ac0ab4a9074582399129fbf3 | Acquire exclusive access to this serial port | void AsyncSerial::unlock() {
} | 0 |
7f1a3955a0631473d29e73b0ca53a93c | 4c41b609b4d5b5d08ae4f579143b15ba | The Kafka client configuration setter method | public void initProperties() {
putPropertie(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, env.getProperty(KafkaConstants.KAFKA_BOOTSTRAP_SERVER));
putPropertie(SslConfigs.DEFAULT_SSL_PROTOCOL, env.getProperty(KafkaConstants.KAFKA_SECURITY_PROTOCOL));
putPropertie(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, env.getProperty(K... | 1 |
f971c98937014fa55093e5d16af47b0b | e62c208a6cd89eff5df25170ef0ba447 | 获取世界死亡率数据 | List<DeathsRatio> getWorldDeathsRatioData(int timestamp); | 1 |
c43836a44045ffe699587815acefab7c | e356374524ae08a2abe99954b7be07a4 | 取消单个设定的Mqtt定时策略 | LogInfo("进入modifyTiming...");
try {
if (!Params.cloudAvailable && !Params.localAvailable) {
LogErr("网络不可用,取消设置定时!");
toastUser("网络不可用,创建定时失败");
return;
}
ArrayList<Integer> repeatNumList = new ArrayList<>();
... | 0 |
698a12fdc0b5cc6d3d2cef33bda5bd77 | 1a6cf419d433d7babc5715fb2f15c4e8 | Initialization
In:
- ``page`` -- the page to edit | class AUTHPage(ConfigPage):
def validate_page(self):
super(AUTHPage, self).validate_page() | 0 |
5a3aeb4ff31ebfd7f522ee039643d2fa | 98a9162a6b3a1f41b74346e607fbc04e | can't JSON-serialize sets, so convert them to lists at print time | class MyJSONEncoder(simplejson.JSONEncoder):
def default(self, o):
try:
iterable = iter(o)
except TypeError:
pass
else:
return list(iterable)
return JSONEncoder.default(self, o) | 1 |
3c21c347e01ae3acfd09844a9a2aad42 | a9f2b2389e5f038d1c2e09bf5dbfffdd | Method for retrieving top content for the entire time | try {
$sContent = BsExtensionManager::getExtension( 'SmartList' )->getToplist( '', array( 'count' => $iCount, 'portletperiod' => $sTime ), null );
} catch ( Exception $e ) {
$oErrorListView = new ViewTagErrorList();
$oErrorListView->addItem( new ViewTagError( $e->getMessage() ) );
$sContent = $oErrorLis... | 1 |
f6ae8ecc8684cac2123e67b7b2613a01 | 630b1380f68dee868c66704a4bb80ae6 | feed-forward energy-based model | _, h, w, c = inputs.get_shape().as_list()
D = c
std = 1./((K*D)**(1/2))
codewords = tf.get_variable(name=name+'/codewords', shape=(K,D),
initializer=tf.random_uniform_initializer(minval=-std,maxval=std,seed=0),
regularizer=None, trainable=... | 1 |
a3e2bd40550759f7d82392d973e2dc6b | c886643d6d0a8f633ceab4fb926f50c7 | 计算离散数据在特定label下的独立概率 | def P_multi_continuous(xi,label,title):
data_xi=data.loc[data['label']==label][title].values
xi_mean=np.mean(data_xi)
xi_std=np.std(data_xi)
return (1/(np.sqrt(2*np.pi)*xi_std))*np.exp(-((xi-xi_mean)**2)/(2*xi_std**2)) | 0 |
189117e84dd8d3c11dc35f0891626de8 | 9764c7b7a077111a85430bf3a09c4734 | گرفتن همه سبدهای یک کاربر | {
var userId = User.Identity.GetUserId<int>();
return _repository.GetWhere(g => g.UserId == userId);
} | 1 |
a880da8fd97f11e67ece193f075e34c8 | 94452619006f1c78681191d2c9094e70 | 加入地址事件队列 | {
$this->queue[] = $event['request'];
if ($this->autoFlushCount && count($this->queue) >= $this->autoFlushCount) {
$this->flush();
}
} | 1 |
6557778cbeb6acc793a20fe064ef4652 | 08378bbf31f8973f218de3d163b6d75c | Loads all discussion references for the current relationship. | class RelatedDiscussionsCounter implements Preloader
public function preload(\ElggEntity $entity) {
return elgg_call(
ELGG_IGNORE_ACCESS,
function () use ($entity) {
return elgg_get_entities([
'types' => 'object',
'subtypes' => Discussion::SUBTYPE,
'metadata_name_value_pairs' => [
'disc... | 1 |
59a7a7a535672abefad3575e4e540478 | e54cc21373d5d5e73f65004d96d79198 | Parse resolved bug fix links from a changeset commit message
and return a list of referenced bug IDs. | class bugzilla_2_16(object):
def filter_unknown_bug_ids(self, node, ids):
self.run('''select bug_id from longdescs where
bug_id in %s and thetext like "%%%s%%"''' %
(buglist(ids), short(node)))
unknown = set(ids)
for (id,) in self.cursor.fetchall():
... | 0 |
4fa4047aed436c430699e86f49ed40be | e0bba99a316a72ce68240a2bf301b709 | Generiert eine neue leere Datei in welcher
das aufgenommene Foto gespeichert werden soll | public class ImageProcessor
private void createNewMarkedFile(String datePath, String id) {
File outputFile = new File(getFormatedPath(this.realPath, datePath, id,
NEW_EXT));
if (outputFile.exists())
return;
FileOutputStream out;
try {
out = new FileOutputStream(outputFile);
out.write(0);
out.clo... | 1 |
bcd56ef8a1e5c1704d8ed346fe9b302b | fac553af6dc1f6d89dcc3d7736c8ad0a | pgtable bits are assigned dynamically depending on processor feature
and statically based on kernel configuration. This spits out the actual
values the kernel is using. Required to make sense from disassembled
TLB exception handlers. | {
uint32 flags;
uint32 *ptbl_phys;
uint32 *ptbl_virt;
uint32 paddr;
uint32 vaddr;
char flag_str[13];
int first_pde = ADDR_TO_PDE_SLOT(virt_start);
int last_pde = ADDR_TO_PDE_SLOT(virt_end);
int first_pte = 0;
int last_pte = 0;
int pde = 0;
int pte = 0;
int f;
for (pde = first_pde; pde <= last_pde; pde++)
... | 1 |
5c8b377e858810b362eefd636ba2d446 | 1968a4c38582debe553f3e20e80b71f3 | Join group using invite link | public class Messenger
@Nullable
@ObjectiveCName("joinGroupViaLinkCommandWithUrl:")
public Command<Integer> joinGroupViaLink(String url) {
return modules.getGroupsModule().joinGroupViaLink(url);
} | 1 |
9318f022ffb762a0667c5799e6322087 | 97ff0546239b3e2a259f2b70edacae20 | Add a <caption> tag | {
if ($strCaption == '') { return(''); }
if ($strOutputMethod == 'tab' || $strOutputMethod == 'csv' || $strOutputMethod == 'xml') {
return($this->_makeListTitles($strCaption, $strOutputMethod));
} else {
if ($this->_arrTitleInfo['strCaptionAttributes'] === null) {
return "<ca... | 1 |
02e8dee93fa1710d4946074608b6c083 | 533ae731f983ee7c0381c9d12fe7a4e5 | Creates speakers group. | class SpeakersController extends BaseConferenceController
public function create($conferenceId)
{
$this->authorize('create-speaker');
return view('layouts.admin.conference_manager.speaker.create');
} | 0 |
8957d5aaf94be8e056bd056d00564b3a | 97f2d62e55d5c7619de99c8d0b8c41da | Plays credits video
input: NONE | function credits_update(dt)
if not vfx_credits:isPlaying() and not played then
vfx_credits:play()
played = true
end
if not vfx_credits:isPlaying() and played then
screen_setState(1)
end
if input.back then
input.back = false
vfx_credits:pause()
screen_s... | 1 |
9947e46009f1ee3007a77ba8d256eef7 | 82d86f4dc34a61026f3f6549cddd0582 | On Click on the positive button - "Edit " - doing all of the actions need for start the create task activity | public class Activity_Task extends ActionBarActivity
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if(id == R.id.btn_edit_task){
Intent intentPlus_W = new Intent(this, Activity_CreateNewTask.class);
startActivity(intentPlus_W);
... | 1 |
86cee8a6e5bfb06d38cd1d4ab9880856 | ba1dd9febcbe47c0e2117dcd272c3fb8 | Creates an ItemStackProducer which produces ItemStacks of the given id,
with a random count anywhere between min and max, inclusive. The damage value will be 0. | @ZenMethod
IItemStack makeStack(@Optional int meta); | 0 |
48c47c57a2026d04ba980ff7f808791d | 0ea5fccb52e7466f8f7b63d9b6049b97 | Signal that processing has ended for a set of parameters. | void endGroup(@Default("") @Name("parameters") Map<String, String> parameters); | 1 |
3424067b4dd7ce1257c23e9c0d2bdade | 5be1e8a5d23b40206e9a1f8bc4d168f1 | Generate a new +Duration+ measuring the given number of milliseconds. | function durationFromSeconds(seconds: number): Duration {
return durationFrom({ seconds: seconds });
} | 0 |
f19fd6ab6591992b5d261d8be1947eb5 | b82a0ce692b5dc922d75f25bf182f70a | Generates and saves a visual highlighting areas identified as containing
street trees. | def makeTreeTif(infile):
outfile = outfileName(infile,"_treetif.tif")
ds = gdal.Open(infile)
band = ds.GetRasterBand(1)
myarray = band.ReadAsArray()
rows = myarray.shape[0]
cols = myarray.shape[1]
geotrans = ds.GetGeoTransform()
proj = ds.GetProjection()
buildingsBinary = np.where(my... | 1 |
0fbd2a0c4c7877af247eba605e37e7aa | a55180b470eaf7ba11dc2e0782efe944 | Converts a dictionary containing the prime factors and powers of an integer into it's integer form. | def factorization_product(fact: Dict[int, int]) -> int:
return reduce(mul, (pow(b, e) for b, e in fact.items()), 1) | 1 |
449aeacf77801ad890d84e569ddd941c | 33920184124bd0ff80ca8763ed4cdf8d | Returns the number of related Idea2comments objects. | {
if ($criteria === null) {
$criteria = new Criteria(IdeaPeer::DATABASE_NAME);
} else {
$criteria = clone $criteria;
}
if ($distinct) {
$criteria->setDistinct();
}
$count = null;
if ($this->collBestideaI18ns === null) {
if ($this->isNew()) {
$count = 0;
} else {
$criteria->add(Best... | 0 |
6c4f0ac0babe4608600caabea465e5e8 | 1b6496606a6be8f33ed70199f1eb0f9b | Construct a hand given a list of cards. | class Hand(Deck):
def __init__(self, label=''):
self.cards = []
self.label = label | 0 |
f6a441523906fbaf2c833e804afaae59 | 8064c102211d38ad3c899a2025e98be5 | get the current working directory and its contents | {
string cwd;
vector<string>contents;
getcwd(directoryName, MaxNameLen);
cwd = directoryName;
printf("\nCurrent directory is: %s\n\n", directoryName);
cout<<"Listing directory contents\n"<<endl;
list_directory_contents(cwd,contents);
contents.clear();
bool flag = user_input(cwd,contents);
if(... | 1 |
6ebbc25b7fd408cb6f7fb5f94fb95465 | 2ec686e18207d56295209c2e76235557 | Returns the meta object for class '{@link org.switchyard.tools.models.switchyard1_0.camel.mqtt.BaseCamelBinding <em>Base Camel Binding</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getCamelSftpBindingType(); | 0 |
5af72830d44f5a5c35c40bf6a186c3b4 | 6d12f0f6cad52cd3ff506fb02112871b | Is any text on the page currently selected | def _text_select_present(buf):
pf = buf.index(SEL_FIRST)
pl = buf.index(SEL_LAST)
return not pl == pf | 1 |
cc99d1cd36351d7eb22fa5888c30119e | f92cfe7b23c5d04e4405bd4903368b1a | Canvas适配 | function setCanvas(){
canvas = document.getElementById("stage");
ctx = canvas.getContext("2d");
var cW = document.documentElement.clientWidth;
var cH = document.documentElement.clientHeight;
if(cW * 10 / 7 >= cH){
canvas.width = cH * 7 / 10;
canvas.height = cH;
} else {
c... | 1 |
67ae544b346412264f67497c753a5fd1 | 95dc29156c7e13dc8815ed434720aabe | Save the updated group and redirect to a page to view the updated group. | public String updateGroup(@PathVariable(value = "id") Integer id,@Valid Group group, BindingResult result, Model model) {
LOGGER.debug("GroupController - updateGroup:{}", group);
if (result.hasErrors()) {
LOGGER.error("GroupController - updateGroup - validation error:{}", group);
... | 1 |
7f4041796a4e72bc1484be378d026408 | 60f3c4300df4e104db6f0159c56d3e12 | Get the content of a TeamCity build artifact dependency. | Guid projectId,
int pipelineId,
string name,
CancellationToken cancellationToken)
{
return await _buildHttpClient.GetArtifactAsync(projectId, pipelineId, name, cancellationToken: cancellationToken);
} | 1 |
d0ebebf7a9061bd6e44d6ba3850b8399 | 236aa36b0077983ecb1366bea9705053 | Sets the source prototype layout uuid of this layout. | @AutoEscape
public String getLayoutPrototypeUuid(); | 0 |
ed265980ab984ef1fe08e83b9dcc991e | 257d2780c501c97d31e11365913d21c9 | Create a Mongo_shelve cls.ms to be tested. | cls.cli = getTestingClient()
cls.cli.drop_database(TESTING_DB)
cls.db = cls.cli[TESTING_DB]
cls.col = cls.db[TESTING_COL]
cls.ms = mongo_shelve.Mongo_shelve(cls.col, KEYFIELD) | 1 |
75163807b44b41055161424faf37aac2 | cd94c299784561b69d3ce7c743dc51c6 | 验证PRCE0208I接口参数 | url_b202015 = config.base_url + config.url_b202015
print url_b202015
_header = header("B202015")
data_b202015 = {
"header": _header,
"body": {
"amt": 1,
"bankAcctNo": "1476932093",
"excomCustNo": "0000000002",
}}
resp = requests.post(url_b2... | 0 |
14c0c6a1de94f09eb38a88f39778f0ea | 1c791a1ad3b1e45d051022e61e210bae | Get colorbar properties.
Get properties for next colorbar and its label based on the number of
axis already in plot | numax = len(self.ax.figure.axes)
if np.mod(numax, 2) == 1:
if numax == 1:
divider_props = dict(pad=0.2)
else:
divider_props = dict(pad=0.5)
props = dict(labelpad=-40, y=1.01, rotation=0,
ha='center', va='bottom'... | 1 |
b6f4d563c4202339e8cae5ee31689695 | e299394090dfd0ed59628019de8d70fb | The airplane's maximum mach operating speed. | class SingleRotorSizingEstimation:
def maximum_speed(self):
Vmax = (9.133 * self.MTOW**(0.380) / self.d)**(1/0.515)
return Vmax | 0 |
971bcf64994ab1ba9253c94dfd3f5e84 | 21d826a22cd9aff6742e74949705f3ec | Return true if this query should use/check the bean cache. | public class QueryValueFetchByJdbcSql implements IQueryValueFetch, IJdomConfig, IValueFetch
public boolean isNeedCache()
{
return needCache;
} | 1 |
eb168246d0ebe1af3e84aa972807dcfe | 0ce6b6b49c7af64a6b6b4dbd4da1e7a0 | 发送角色奖励状态 | function setRoleReward(reward)
info.reward = reward
end | 0 |
076b95a79932e8a09d8ee89b7c8f3947 | 88c855f56a97df6c5439e0c86a854eda | from https://stackoverflow.com/a/36058256 | def progress(iterable, prefix='', suffix='', decimals=1, length=50, fill='█', printEnd='\r'):
total = len(iterable)
def print_progress(iteration):
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total)))
filled = int(length * iteration // total)
bar = fill * fil... | 1 |
ed5c9da9236484e82d18beec53e3b628 | 3341af6e8daa8563952c7f9c5aa8e228 | pwdコマンドの処理 | uint32_t ccCmdsPwd(uint32_t cmd_idx, char **remaining_line)
{
char cwd_buf[CC_PATH_LEN];
char *wd;
if(ccTestNoMoreArgs(remaining_line) == EXIT_FAILURE)
{
return(EXIT_FAILURE);
}
wd = getcwd(cwd_buf, sizeof(cwd_buf));
if(wd == NULL)
{
ccTestPrintError("getting curren... | 1 |
fcb44e35ca6690ee69346543a1364d45 | 9b7fb352854f871a9f87e9246c35d553 | <p>Compute and returns the <tt>ObjectQuery</tt> for this builder with <code>autoAddJCRPath</code> enabled.</p> | Query<O> get(boolean autoAddJCRPath) throws IllegalStateException; | 1 |
4e99908d593a08941e6ee11335817621 | b9b0c3204c63435bb095df2b7ca87667 | 判断是否为ServiceError | class ServiceError extends Error
static is(error) {
return error.name == ServiceErrorName
} | 1 |
078d39e7d02104678a64796e46c673cd | 626f49b881a9a046b29886fff8e26915 | 根据group_id添加组件id | @Service(interfaceClass = CheckGroupService.class)
@Transactional
public class CheckGroupServiceImpl implements CheckGroupService
public void addById(Integer checkgroup_id, Integer[] checkitemIds){
if(checkitemIds!=null&&checkitemIds.length>0){
for (Integer checkitem_id : checkitemIds) {
... | 1 |
b675b916fbfd5a1265d202b187ce7f08 | e1a97d238e432b976790325e7ceaab88 | 合并缓存 | namespace CommonClass.DataCache
IDataCache MergeData(string key,object obj); | 1 |
8d1d031543e43086c7cebf0c69adfb72 | 589be67568e6b1716426e199f7ef905a | проверка размера поля на выход за границы | public class Main extends Application
private void fieldIsEndless(NewBody tail) {
if (tail.getTranslateX() < 0)
tail.setTranslateX(APP_WIDTH - BLOCK_SIZE);
if (tail.getTranslateX() >= APP_WIDTH)
tail.setTranslateX(0.0);
if (tail.getTranslateY() < 0)
tail.setTr... | 1 |
e8b95aca4fcac5fd66f571e9a19881d9 | 443b358c839f318119244b1b3ae5cec1 | Calculate Ertel potential vorticity of buoyancy on rho/rho grids.
Notes | g = 9.81
Ri = np.zeros(windspeed_hor.shape)
for i in range(windspeed_hor.shape[1]):
if np.any(np.logical_not(np.isnan(virtpot_temp[:, i]))):
idx = np.nonzero(np.logical_not(np.isnan(virtpot_temp[:, i])))[0][-1]
else:
idx = 0
Ri[:, i] = g * altitudes[:, i] * (v... | 0 |
396d07641fca436aa791a3d8394e4ac5 | 18513776109a92f167948c9b227ece0a | 设置选择房间数组索引 | bridge.callHandler("room.setSceneIndex", new Object[]{index}, new OnReturnValue<String>() {
@Override
public void onValue(String result) {
if (promise == null) {
return;
}
SDKError sdkError = SDKError.promiseError(result... | 1 |
c9422fe126f2f7cd2227ca30a829bfa1 | 2ac36a77d164d4e66b4bd16bcf44f287 | <pre>
[Output Only] The status of the machine image. One of the following values: INVALID, CREATING, READY, DELETING, and UPLOADING.
Check the Status enum for the list of possible values.
</pre>
<code>optional string status = 181260274;</code> | java.lang.Object ref = status_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
status_ = s;
return s;
} else {
return (java.lang.String) ref;
}
... | 1 |
fb1e7bc376cea2333763268f26c793a1 | 485e68983c3b5664774a33cfa2234ae7 | 将文件里面句子的词向量合并在一起 | def sentence2vec_with_w2v_sum(text_file_path, vec_file_path):
model = gensim.models.Word2Vec.load(model_file_path)
sample_file = open(text_file_path)
svm_training_file = open(vec_file_path, "w")
i = 0
for line in sample_file.readlines():
words = line.replace("\n", "").split(" ")
word... | 1 |
7fffb3bda1dc91f3ff56614ede374872 | 53c80e0e6aa0bfd494f69d53b4b4bf09 | <p>Enables or disables the edition.</p> | void setEnable(boolean editable); | 1 |
6e47724fd49c4cdbb2f467ea31635bc3 | 32193dbe295fde37afe2d05608b24f5c | Update the current mode (triggered by clicking buttons). | self.scene.grScene.updateMode(self.grid_mode_options.currentText())
for eachBlock in self.scene.blocks:
if not (eachBlock.block_type == "CONNECTOR" or eachBlock.block_type == "Connector"):
eachBlock.grBlock.updateMode(self.grid_mode_options.currentText()) | 1 |
acbfb137300274f966d0b2ab78b751b0 | 11660444ee6f21e1a9af34fbab697f16 | Raise every component by specicied exponent. | class Unit(object):
def __pow__(self, exponent):
if self in Unit._pow_cache:
if exponent in Unit._pow_cache[self]:
return Unit._pow_cache[self][exponent]
else:
Unit._pow_cache[self] = {}
result = {}
for unit, exponent2 in self.iter_base_or_scaled_... | 1 |
6efdc5c388353abcfa95586e92b7f5ac | ad3f7427a3ad8775dec7b774af6c2e73 | Gets the last reached location for a group, if any. | if (getLastGroup() != null) {
return getLastGroup().getLongText();
}
return null;
} | 0 |
dc4f0ccf5917c618a8cadd7411b5ff38 | ab1568d7505f7f3994dcad8a78836f95 | Displays the history of the simulation in a form of three plots (position, speed, acceleration). | actual_speeds = get_speed(actuals)
measurement_speeds = get_speed(measurements)
prior_speeds = get_speed(priors)
posterior_speeds = get_speed(posteriors)
x1 = np.arange(0, 31)
x2 = np.arange(1, 31)
ym1 = actual_speeds
ym2 = measurement_speeds
ym3 = prior_speeds
ym4 = posterior_sp... | 0 |
505c1e729e09dbc5b75b45131e50e5b7 | a23e0156fed6af41fc5291c1ceed0fd7 | Get the Square representing the specified number. | public class BoardActivity extends AppCompatActivity
public SquareActivity getSquare(int square)
{
return squares[square];
} | 1 |
cd4e22b4d8d9b19b7edb84f0f3437e31 | 250846cc8ed03d05cd00a6ffb8627203 | Set Fact was created. | class Base implements SoftDeleteInterface
public function setCreated(\DateTime $created) {
$this->created = $created;
return $this;
} | 1 |
0e493474536fedfe8a4d71b64a77177f | 70ad595c1306d9d34a79d7c5371df502 | Signals the GTNShortcutsFragment to update the shortcut ListView. | if (mApplication.isRenameShortcutCreated()) {
mToggleRenameShortcut.setTitle(R.string.remove_rename_shortcut);
mToggleRenameShortcut
.setSummary(R.string.remove_rename_shortcut_desc);
mHideRenameServiceStartConfirmation.setEnabled(true);
} else {
mToggleRenameShortcut.setTitle(R.string.create_renam... | 0 |
add329eee8d7e09c13cd5d4131cf0b01 | 59038020e35a4bb0c5c0330d6d9ee367 | foreach構文の処理の開始時に呼ばれ、カーソル位置を最初に巻き戻す | class Module_OOP_ORM_Result implements Iterator, ArrayAccess, Serializable, Countable, JsonSerializable
public function rewind()
{
$this->offset = 0;
} | 1 |
a4dc974e85efac779509730b148d2298 | 8a8f141281f5b63275c318816890a522 | 打开拍照功能 | fun openCamera(context: Activity) {
EasyPhotos.createCamera(context)
.setFileProviderAuthority(AppUtil.getPackageName(context) + ".fileprovider")
.start(REQUEST_CODE_TAKE_PHOTO)
} | 1 |
63ddb59490740a4274725e7078f8773f | e351f79b8862cfe31b51387565212af8 | Yhteystietolomakkeen tietojen tulostaminen | public class Kayttaja
@Override
public String toString() {
return this.nimi + ", pisteet: " + this.pisteet;
} | 0 |
3f500cf734dbf2bd14d5fd6db8125fa9 | 5b5400b2621951986aab55a54f94830d | Test empty scan from DynamoDB table | def test_empty_db(client): | 0 |
aec5e6d49c33f1427e2b82c62d72d95f | e223ab9e0c58b714fc9bf20d359ae67b | 削除するmodalのhtmlを返す | var fatherBody = $(window.parent.document.body);
fatherBody.find("#deleteModal").modal({
backdrop: false
});
fatherBody.append("<div id='backdropId' class='modal-backdrop fade in'></div>");
fatherBody.find("#deleteModal").on('hidden.bs.modal', function (e) {
fatherBody.find("#backdro... | 0 |
c6f0834f10eab555337ff4185a26b792 | 266ce2f54881444df739266357f5b17e | makes flappy go up when pressing the spacebar | class player(pygame.sprite.Sprite):
#constructs/initilizes the bird
def update(self):
self.acceleration=pygame.math.Vector2(0,2)
self.velocity=pygame.math.Vector2(0,0)
keyPressed=pygame.key.get_pressed()
if keyPressed[pygame.K_SPACE]:
self.acceleration.y=-2
self.velocity=self.... | 1 |
89c5c31c67bb93deb0b4caba9b47ff5f | 59a6c1f481d0e825aa9d8269660e1761 | Исполняет команду на всех редисах, возвращает сумму | namespace Coco_R
void Execute(Sum cmd); | 0 |
b21b270f644a03730564aca131408d33 | d97c89359ab3d37d6f5d94c94e91781a | 查询某帐户一段时间的所有操作 | @Service
@Log
public class OperationService
public Flux<Operation> queryOperationByUserAndCreateTime(String serialNo,
String category,
String user,
... | 1 |
5b2183f6db6f8315d3acbaa7a41f383d | 2984da3bf8334c3ce75c9b2cd50d8029 | banr (bitwise AND register) stores into register C the result of the bitwise AND of register A and register B. | let mut result = registers.clone();
result[instructions.3] = registers[instructions.1] & registers[instructions.2];
return result;
} | 1 |
cf8dfaf0a737dd23f79bb47d6491b916 | 8967581be5b5f2ecb970a56295b1e502 | 创建广播交换机 | public class RabbitExemple
public void createAndBing(Channel channel) throws IOException {
channel.exchangeDeclare(ORDER_OUT, "fanout");
channel.queueDeclare(BILLING_ORDERS, true, false, false, null);
channel.queueBind(BILLING_ORDERS, ORDER_OUT, "");
} | 1 |
d1fbe19086a0ea45e0979b6233547492 | 15df6e46fcc2ff1aa83d116021dbc92e | Método que recupera o tempo total dos testes. | public class Test
public long getTempoTotal() {
return tempoTotal;
} | 1 |
81055637ba73cdfc3d31f22303eba230 | 91e3a86f61e68f75d59e2514dbe84396 | строит тело одного письма | message = MIMEMultipart("alternative")
message["Subject"] = "Запись на мероприятие Adidas"
message["From"] = sender_address
message["To"] = self._reciever_address
text = f"""Привет. Ты был успешно записаны на мероприятие Adidas Runners!"""
html = f"""\
<ht... | 1 |
d7bdd66acd6a74a446ea130dca886509 | 55b47dfad73bf6267be055f11ef1033c | ----------------------------------------------------------------------------------
-------- ОСНОВНАЯ ФУНКЦИЯ РАСЧЕТА ------------------------------------------------
весовых коэффициентов калибровки датчика с помощью МНК
-------------------------------------------------------------... | {
Double sumX = 0;
Double sumDesity = 0;
Double sum3 = 0;
Double sum4 = 0;
Double count = arrTemp.Count + 1;
Double avgX = 0;
Double avgDesity = 0;
Double valX = 0;
Double valDesity = 0;
Doubl... | 1 |
3531ef94594c948665416eafdaf5337b | 01468057d05f1084b3e698c54104bad5 | Gram matrix at current position.
The Gram matrix as a position `q` is defined as
.. code::
gram(q) = jacob_constr(q) @ inv(metric) @ jacob_constr(q).T
where :code:`jacob_constr` is the Jacobian of the constraint function
:code:`constr` and :code:`metric` is the matrix representation of the metric on
the ambient space. | class InnerProductDefinition(ABC):
def ip_jac(self, S, G, H, symbolic_expr=False):
pass | 0 |
d90be08f2411984827a7c4963795e20b | 9e0920205df22627fb4d703a66db0760 | It is for the test case of FindWordController
should initialize a word and board entity to generate the find word request
simulate that they were the chosen word | @Transactional
@WebAppConfiguration
@SpringBootTest
public class LogicServiceIntegrationTestInizializeTurn extends TestSETUPCreatesActiveGame
@Test
public void InitializeTurnErrorBecauseGameIsInChooseMysteryWord() {
createdActiveGame.setStateForLogicService(State.ChooseMysteryWord);
assertThrows(NoC... | 0 |
f096f3b9387ecd6e1077fb075560fe22 | af003d5851eda40166ed573d15878591 | Возвращает индекс выбранного изображения в текущей группе. | export class Group extends Box
public get selectedIndex(): number
{
return this._selectedIndex;
} | 1 |
d166b912d36bc67fc4f49e4b209d2429 | c1a89e318701b0162f01796f35db4e3f | Disable Timer7 | void TIMER7_Clear_v(void)
{
TIM7_SR.UIF = 0;
return;
} | 0 |
e86ff7c3900a4fed083614137673adfa | 522d50138b7864d8466660b6801a9b7d | 附近品牌店 | {
$keyword = $this->request->param('keyword');
$cat_id = $this->request->param('cat_id');
$brandid = $this->request->param('brandid');
$region_id=2347;
$where['a.cat_id'] = [['>',807],['<',899]];
if(!empty($cat_id))
{
$where['a.cat_id'] = $cat_id;
... | 1 |
b1af082c19eedf2a3ce9a6d11004173a | 85558679e36c78603f78f2c5653f1689 | Select the dictionaries relevant to the given comparisons. | class ReducedItemSelector(BaseEstimator, TransformerMixin):
def transform(self, data_dict):
return [{k: item[k] for k in item.keys() & feature_selection[self.key]} for item in data_dict[self.key]] | 0 |
16869044f61b89779a685cc19217a33b | 3282e8f9c3fad49659b148aa658de59e | Returns a ticket object that has the cheapest price | int lowest_index = -1;
int lowest_price = 9999;
for(int count = 0; count < s_dynamic_odds.size(); count++) {
ArrayList <Integer> dOddsTuple = s_dynamic_odds.get(count);
if(dOddsTuple.get(0).intValue() < lowest_price) {
lowest_index = count;
lowest_price = dOddsTuple.get(0).intValue();
}
}
Arr... | 0 |
e25684196d87e9c965588bba0d26ff20 | 899d4c3eb016df9709f956c0f034a18b | 查看评论,通过routeId | public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
Gson gson = new Gson();
Long routeId = Long.parseLong(request.getParameter("routeId"));
Key routeKey = KeyFactory.createKey("Route", routeId);
Query commentsQuery = new Query("Comment").setAncestor(routeKe... | 1 |
f5dc41bb8ad5b3e336e04ebdc75d61b9 | 284480a957b635e5b8a061f4ee0af769 | Convert camera space x,y into image space pixel idx | fx = self.config['camera_info']['focal_length_x']
fy = self.config['camera_info']['focal_length_y']
u = int(-(fx / point_in_camera.x) * point_in_camera.y)
v = int(-(fy / point_in_camera.x) * point_in_camera.z)
return (u, v) | 0 |
ea295d17d2fbadcadca3932c247ad925 | 3a23886ae0e30c524c0e86081cb87f97 | 将页面上显示的bop的值赋予bo | try {
Field[] fields = getRealClass(bo).getDeclaredFields();
for (Field field : fields) {
String fieldName = field.getName();
if(PropertyUtils.isSerialVersionUID(fieldName))
continue;
if(PropertyUtils.enableToCopy(bo, fieldName)) {
BOHelper.setBOPValue(bo, bo_2, fieldName);
continue;
... | 1 |
398c7ddb6eb438e9991f75b1a4716ae3 | 2e79eea329105b3568877ea0881fb36d | e.g. consumerBillingFirstname | class FP_RAC_Previous_Order_Data
public function get_billing_firstname() {
return ( ! $this->extra_cart_content) ? fp_rac_get_order_obj_data( $this->cart_content , 'billing_first_name' ) : $this->cart_content->billing_first_name ;
} | 1 |
55e204c4eebe31fd214cf682e671fd4c | 80030d980cde725da8c3f4c4a9116ffb | Load all GroupAssessmentLists | if ((is_null($this->intId)))
return array();
try {
return IntegrationAssessment::LoadArrayByUserId($this->intId, $objOptionalClauses);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
} | 0 |
c48a7d619791ef12ff66a9da08298135 | e7b742c67d16f218f233a2ccbeec8752 | Writes data to the given FileTransferProtocol server using the given
URL, which must include appropriate login information. | URLConnection conn = null;
String contentType = null;
FileOutputStream fileOut = null;
InputStream input = null;
try {
conn = url.openConnection();
contentType = conn.getContentType();
contentType = (contentType != null) ? contentType : Content... | 0 |
67e4f8e2b7bf149cdd2679780a052921 | 93766613a2c8ebe9a78c0e99568b75d5 | Returns the meta object for the attribute '{@link org.openhealthtools.ihe.common.ebxml._2._1.rim.AuditableEventType#getTimestamp <em>Timestamp</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"crc64",
"upi",
"identicalCrossReferences",
"sequence",
"timestamp"
})
@XmlRootElement(name = "getUPIForAccessionReturn")
public class GetUPIForAccessionReturn
public String getTimestamp() {
return timestamp;
} | 0 |
e59c136a9600533568e8799ea22262db | febc440481b8445b5fcdb4d36205f4d1 | Sets the Content-Language header of the response. | if 'Content-Language' not in cherrypy.response.headers and hasattr(cherrypy.response,'i18n'):
cherrypy.response.headers['Content-Language'] = str(
cherrypy.response.i18n.locale) | 1 |
5460b989771a8a45f05aa15407eeee26 | 71b2c60de73f2e99b7531b65c53ff411 | enableFlgを取得します。 | {
if (byteObj == (byte)(APConst.OnFlg))
{
return true;
}
else
{
return false;
}
} | 0 |
be141576f6d530e2f34edcd34f0e9c96 | 7c7b31187eb8c853a32bc90912f4e1ce | Checks if Date is valid on Group edit screen. | const dateStruct: NgbDateStruct = form.controls.startDate.value;
if (!dateStruct || !dateStruct.year || !dateStruct.month || !dateStruct.day) {
return null;
}
const date = new Date(dateStruct.year, dateStruct.month - 1, dateStruct.day);
let today = new Date();
today.setHours(0, 0, 0, 0);
... | 0 |
511b2c9c0964074afedc5fb1cfe1486b | 1dda927f5a59255a63aca5e5a4a06eaf | Should we update remote url if it has changed? | class Updater
def fast_forward?
branch_merge && ancestor != remote &&
ancestor == @local_parent &&
@local_parent.branch != remote.branch
end | 0 |
529881f63841f5432f28bc9f1a3e0cae | f093a62e73ad969758d2982862808fae | Delete a User. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | class OrganizationApi(object):
def org_delete_member(self, org, username, **kwargs):
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.org_delete_member_with_http_info(org, username, **kwargs)
else:
(data) = self.org_delete_member_with_ht... | 1 |
2944c5794a588efdcdecd862b115f4c5 | bd344a6e0b6075bb0684a86fc7281ba3 | Select the maximum order nr for an exercise | {
if (overviewBindingSource.Position < 0)
{
EnableCorrectButtons();
requestContor = 0;
}
else
{
var auxRequestContor = 0;
foreach (Dlv005DataSet.MainTableRow row in businessOperations.Dlv0... | 1 |
dc0227dc58d2c352e313718b6094298e | a2941cde39b43503ad3a8e3ec46c6661 | Verifica se as faces capturadas não estão registradas no sistema e inicia o processo de salvamento de imagens através do método _prepare_to_save_faces.
Parâmetros= faceRecognizer: Serviço responsável por gerenciar o reconhecimento facial – FaceRecognizer.Services.FaceRecognizer;
image_faces: Lista com todas as faces, e... | namespace FaceAPITutorial.Services
public class FaceAPIService
public async Task<Face[]> UploadAndDetectFaces(string imageFilePath)
{
return await GetDetectedFaces(imageFilePath);
} | 0 |
5479391ee669d6dca14f3d54d256de34 | 490f9a293de1002e2777764475ba07e8 | ========================================
한달 동안 지출 누계
========================================= | function sumDailyExpense() {
initialize();
var data;
while (line = liner.next()) {
data = parseData(line.toString());
if (data == null) continue;
if (data.year == curr.year && data.month == curr.month && data.day == curr.day) {
total += parseInt(data.price);
}
}
console.info(`[INFO] Tota... | 0 |
1e0c2acde6b9335c6a7ad9ab09db8fa7 | 220f878d4ea531079598dda962326938 | 发送通知给所有教师 | public class Teacher
public void notifyObservers(String message) {
for (MyObserver observer : observers) {
observer.update(message);
}
} | 0 |
03874a90deb72d4ab526a7392c3ae4c7 | 29cdd37c4af95d16b168b4d3d6301a3e | calculate the maximum width of each column | class Console
protected static function calculateColumnsWidth($data, $headers)
{
$columnsWidth = [];
array_unshift($data, $headers);
foreach ($data as $row) {
foreach ($row as $index => $element) {
$length = static::stringWidth($element) + 1;
if (!... | 1 |
907d9c41d1a4c9fd15f76c3f2198b513 | 9a1f3468de5a344019add6ad75dbe72c | Verifica se o e-mail possui @ e . | class Helpers
fun isEmailValid(email: String): Boolean =
(email.contains("@") && email.contains(".")) | 1 |
ee4dff00fc1180f974d2b9fb89c50347 | c4810d0f6707e18e59998f1aae7ec89b | Check that the bantam.Main class and main method are declared properly | throws NotFoundException, IllegalAccessException, InstantiationException, CannotCompileException, NoSuchMethodException, InvocationTargetException {
ClassPool classPool = ClassPool.getDefault();
CtClass ctClass = classPool.makeClass("com.threedr3am.bug.compile.javassist.C");
StringBuilde... | 0 |
4e0b3981fc1f6f0d5c765ec147a50d4e | 7c132552fdb75cc83d79c7d0222fce29 | Set HACS stage. | if hvac_mode == HVAC_MODE_AUTO:
data.ENTITIES[self._entity_control_mode].STATE = HMIP_CONTROL_MODE_AUTO
elif hvac_mode == HVAC_MODE_HEAT:
data.ENTITIES[self._entity_control_mode].STATE = HMIP_CONTROL_MODE_MANU
elif hvac_mode == HVAC_MODE_OFF:
self.set_temperat... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.