query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
fafaed42e545d7d0e473fdc4807f1744 | bb508cbc795abb118647be9a6c60c268 | Retrieves a content object to be used for creating typolinks. | class tx_multicolumn_db
public static function getContentElement($uid, $selectFields = '*', $additionalWhere = null, $useDeleteClause = true) {
if (TYPO3_MODE == 'BE') {
return t3lib_befunc::getRecordWSOL('tt_content', $uid, $selectFields, $additionalWhere, $useDeleteClause);
}
$fromTable = 'tt_content';
$wh... | 1 |
cf4cddbca87ecbfebf054f28c784036c | 9137fd865dab764ec62d40b4627c0cee | Returns true if the string input can be turned into an int AND is
greater than or equal to zero.
Argument:
stringValue - the user input.
Returns:
boolean - true or false | try:
string = int(string)
if int(string) > 0:
return True
except ValueError:
return False | 0 |
a0cf3c429181d062189b07ec0b5c4321 | 12fd1beea7e3b7ab3236b3f95aff2feb | Прив'язування ключових слів до документа | namespace API.Models
public class DocumentContext : DbContext
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Document>().HasKey(d => d.DocumentId);
modelBuilder.Entity<Document>().Property(d => d.Amount).IsRequired();
modelBuilder... | 0 |
6dcc6a21215284f6033e2ac4c3259ce3 | 2021f2cb302e5e8b70b0d0f8daf71ab8 | integrate using Euler | def Euler(t0,y0,h):
tic = tm.time()
tVals = ay.array('f',[t0])
yVals = ay.array('f',[y0])
for i in range(0,int(N-1)):
tVals.append(t0 + h)
yVals.append(y0 + h*f(t0,y0))
t0 = t0 + h
y0 = y0 + h*f(t0,y0)
plt.plot(tVals,yVals,'r-')
plt.show()
toc = tm.time()
... | 1 |
f730e08f4a842212263c75138bb6b870 | 0d18786d862da090d9fa453aea775c24 | 保存闪屏页信息 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
Editor editor = preferences.edit();
editor.putString("SplashPicMd5", md5);
editor.commit();
} | 1 |
1a02ac2822fe6d9498b17f576ba162cf | 745c67c0d02046242c94a9aab7f766c1 | Called when the library is loaded, open the config database | {
if (File.Exists(ConfigPath))
{
UnlimitedInventoriesConfig.Instance = JsonConvert.DeserializeObject<UnlimitedInventoriesConfig>(File.ReadAllText(ConfigPath));
}
_database = new Database();
_commands = new UnlimitedInventoriesCommands(_database);
_database.ConnectDatabase();
} | 1 |
c439f5245e5bc8b46eb30989c3d33f3f | a45482b2b53acfbbeda746d12bc504e1 | 比较两个字节的每一个bit位是否相等. | {
byte[] s_bytesA = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
byte[] s_bytesB = new byte[] { 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4... | 1 |
95d8995df8798d693513b9df07f5482d | 359c94a0b7b01e4a612cd6113543bf83 | Returns right operator. | @SuppressWarnings("serial")
public abstract class AbstractBinaryOperator extends AbstractOperator implements BinaryOperator
@Override
public Operator getRightChild()
{
List<Operator> children = this.getChildren();
assert (children.size() == 2);
return children.get(1);
} | 1 |
6126be3364262129ce9ce70fc10d3ac2 | e5453a82c56c33a9d03ec7c89c909c49 | アセットの名前を変える | namespace GameCoreEditor
public class AssetFileManager : AssetPostprocessor
static void ChangeModName(string NewModName, UnityEngine.Object asset)
{
AssetDatabase.RenameAsset(AssetDatabase.GetAssetOrScenePath(asset), asset.GetAssetNameEditor() + NewModName);
} | 1 |
9c49ff2b9511ce540b743371a880cb9e | 1ebb9529c79ebfe6415eb1a8662c1a69 | 读取数据, 根据数据设置UI | public class ReadDataActivity extends Activity
private void refreshUI(MeterReadingResult result){
if (result == null) return;
final MeterReadingResult dispresult = result;
runOnUiThread(new Runnable() {
@Override
public void run() {
if (dispresult.getMeasu... | 1 |
217f7fb378e1e99b0c57b1e2c5229070 | c79270cd20d12ab54ee997083f46abf9 | This slot is called when animation ends | class SongCard(QWidget):
def aniFinishedSlot(self):
self.setDynamicProperty("enter-play")
self.songNameCard.checkBox.hide()
self.clicked.emit(self.itemIndex)
self.aniGroup.disconnect() | 1 |
6bdf1e522c5515a3dcfb5be478f3dcd5 | 3a88885bd525fef7b924cb9e75fcd4ff | function that computes a similarity matrix using cosine similarity | def compute_similarity(df):
tfidf = TfidfVectorizer(stop_words='english')
tfidf_matrix = tfidf.fit_transform(df.ingredients)
return cosine_similarity(tfidf_matrix, tfidf_matrix) | 1 |
daa8e5f085a94deea856f83e7720df61 | 43e96664619cab260eb19ee8f1afc111 | Gets the current amount of EPC stored | public long getEcont(); | 0 |
c6670840c8b0f2b02c5d3860d9c51984 | c368dcfcadf048c51e76f697987c7fc9 | Positions of the interstitial candidates (and not those of the atoms).
IMPORTANT: Do not set positions via numpy setter, i.e.
BAD:
``` | class Lattice(NetworkX):
def atoms_coord(self):
return self._atoms_coord | 0 |
035c92a346251f7fb987eec0394872dd | 573bc7b1bd6db6d3db41c79fbccd84d3 | Change status on multiple Orders. | class Commissions extends AbstractReport
public function execute()
{
$request = $this->getRequest();
try {
if ($ordersToChange = $request->getParam('orders_to_change')) {
$salesRepId = $request->getParam('sales_rep_id');
$status = $request->getParam('statu... | 1 |
022022a0a75fec50d17fbe497d1ec9e8 | f4032346f4f289074385ba8e555e8592 | G:036
When lazy mode is turned off, we issue the do-nothing hypercall to
flush any stored calls, and call the generic helper to reset the
per-cpu lazy mode variable. | void set_iounmap_nonlazy(void)
{
atomic_long_set(&vmap_lazy_nr, lazy_max_pages()+1);
} | 0 |
8ce83c8b1ea7f33eba974a2d47a435ac | 02a8e86bbb3ada10a96c9acb2b7c53f3 | 切換主從服務器的連接 | {
if (!empty($this->handle) && $this->isMaster) {
return;
}
$this->disconnect();
$this->connect($this->master);
$this->isMaster = true;
} | 1 |
57e78a5a13d202edd511c169b9c9524d | 8cbc011cea2262ed3f69712b1049e863 | Select function. Gets called when the bbox for the object is selected.
This function just selects the object without doing any intersection tests. | class Plane():
def select_me(self, mouse_pos):
self.active = True | 1 |
8a411642652617121b23de315bf6b426 | 434fbe2058979b0b7153679802cedc37 | <p>
Reconnects a session to a managed node after it has been disconnected. Connections can be resumed for
disconnected sessions, but not terminated sessions.
</p>
<note>
<p>
This command is primarily for use by client machines to automatically reconnect during intermittent network
issues. It isn't intended for any othe... | java.util.concurrent.Future<ResumeSessionResult> resumeSessionAsync(ResumeSessionRequest resumeSessionRequest,
com.amazonaws.handlers.AsyncHandler<ResumeSessionRequest, ResumeSessionResult> asyncHandler); | 1 |
7bc6ce893b5a30c1130f300df28dc3ff | 0f77e47b60819b38b6f81620d264d1f6 | add an object to an existing local storage array or creates new one | function storageObj(keyName, arrayObj) {
var arrayStr = JSON.stringify(arrayObj);
localStorage.setItem(keyName, arrayStr);
} | 0 |
0d8396d94cebc8c9e66a868fb854f67f | cf6c82b19892173f5aee1c0de95991ff | Conversion method for clean up from marshalling of: UnityEngine.Experimental.U2D.Animation.UpdateBoundsSystem/CalculateBoundsJob | {
marshaled.___name_0 = il2cpp_codegen_marshal_bstring(unmarshaled.get_name_0());
marshaled.___parentName_1 = il2cpp_codegen_marshal_bstring(unmarshaled.get_parentName_1());
marshaled.___position_2 = unmarshaled.get_position_2();
marshaled.___rotation_3 = unmarshaled.get_rotation_3();
marshaled.___scale_4 = unmars... | 0 |
ace2566750df5f5699671062d4255bc0 | 28f95c7557aaf1fbd88f3de57fb24297 | save all frequent item set into a .txt file | file_w = codecs.open(file_name, 'w', encoding='utf-8')
for item in feature_items:
file_w.write('{0}\n'.format(item))
file_w.close() | 1 |
b70ed84a8e49d0dafe0913340bcb2e98 | a6adcbd6531b77104c5634814794d8b7 | <p>Convierte información binaria en una cadena de texto hexadecimal.</p> | StringBuffer str = new StringBuffer();
int digital;
for (int i = 0; i < b.length; i++) {
digital = b[i];
if(digital < 0) {
digital += 256;
}
if(digital < 16){
str.append("0");
}
str.append(Integer.toHexString(digital));
}
return str.toString();
} | 1 |
5ecdd1c3c30c0adc09ed09342f096f31 | de7b226b8b8102a11ecc23e0cbdbab41 | Description:CPUID命令を実行して結果を引数のアドレスに格納する関数 | static inline void cpuid(int code, int *a, int *d) {
asm volatile("cpuid":"=a"(*a),"=d"(*d):"0"(code):"ecx","ebx");
} | 1 |
b577b6389e14923a9324ce5ad8b1add4 | 7f61448ad6da3ef0f9cb03f40c5be655 | mostly defunct for me helios set, I put this here so every time I changed my augs I'd just have one place to change it | cases like (1) | 0 |
09b451644ad9ea9a5804ea6dac40e56d | 092978819df76a705c49faee1c836dad | Initialize the Soft Orthogonalization Regularizer. | class l2_regularization():
def __init__(self, alpha):
self.alpha = alpha | 0 |
cb563108054be1d9a280cd8cae0238d9 | 1f35f23f598fb3ab73acff038105167b | Gets a document writer for a table and a document type provided. | {
$writer = new Writer();
$writer->document = new Spreadsheet();
return $writer;
} | 0 |
ade54e6584cc99b306a8323381f6c0fa | 16caaf918d7a07c0f17d6bd0c7afe625 | Dump incomplete labels. | df = self._fill_label(df)
df = self._fill_prob(df)
df = self._fill_tombstone(df)
return df | 0 |
aec3d52f6897c7da9c2a95a7bf14c4a5 | d38fc2d44c007f34a7f92acfc7cded48 | 获取进程的后缀名 | {
char* path_end;
if(readlink("/proc/self/exe", processdir,len) <=0)
return -1;
path_end = strrchr(processdir, '/');
if(path_end == NULL)
return -1;
++path_end;
strcpy(processname, path_end);
*path_end = '\0';
retu... | 0 |
dc1eaf100e2497d6bb36f0647f7cd904 | b08cd2c93bc3cb60da13c4cfe61c439d | AjaxNotify event handler for widget RichWidgets_wt_WebBlockInstance13 | namespace ssCaseConferencing.Flows.FlowLearnerView public class ScrnLearnerDetailsExtraCurr: OSPageViewStateCompressed, IWebScreen, INegotiateTabIndexes, IBookmarkableURL
public void RichWidgets_webBlck_WebBlockInstance15_AjaxNotify(object sender, System.EventArgs e) {
if (CommandOnNotify(heContext
)) {
doAJ... | 0 |
d1a5fa3865ae227b161fb52930b1af35 | 1996ffbdb796b641687bfb1673d7e0e1 | Tests whether the from relationship name is directed. | default boolean isFrom(IGraphVertex vertex) {
return vertex != null && vertex == from();
} | 0 |
9f8d68b9848e75e9e28259242ca6266d | 0d20d2412e5e5aca7a8a612232d6bd9d | Checks if the given point is contained within this bounding box. The point should be normalized to the resolved
transform attached to the game object that this bounding box is attached to. Since the size and offset of this
bounding box is also relative to the same transform, this check is fairly straightforward. | export class BoundingRectangle extends Bounds2d implements ITyped
public ContainsPoint(point: Vector2d): boolean {
var savedRotation: number = this.Rotation;
if (this.Rotation !== 0) {
this.Rotation = 0;
point = point.RotateAround(this.Position, -savedRotation);
... | 1 |
e8f73a02eefc432bd535f565e6613990 | 4570e4792256f79b9cf711d2849052a2 | Raises a ThreadAbortException in the thread on which it is invoked,
to begin the process of terminating the thread while also providing
exception information about the thread termination.
Calling this method usually terminates the thread. | namespace FireSpider.Threading
public abstract class ServiceThread : BackgroundThread
protected override void Abort()
{
ServiceStop();
} | 0 |
3bce67fb9374b8a84425d8df8562272e | 62c65b80b6ced4f589d5c0b8ff8818c4 | Produce a human-readable text of the board location example: "a 2" | class Board extends Observable
String toString(boolean legend) {
Formatter out = new Formatter();
return out.toString();
} | 0 |
ade53c4e7ebcece61088991a76561b4e | 6690fd89f412fdb4edff85f6b818dff7 | This hook is called when the code pointer changes.<br>
The default implementation does nothing. | public class mumpsBaseListener implements mumpsListener
@Override public void enterCode(mumpsParser.CodeContext ctx) { } | 0 |
a6dc06065108fe93bfb11f4d3aec7649 | 33f672016afbfd9e6395b2b95b0ff6fe | cria o segundo jogador para fazer jogadas automaticas e aleatorias | var aux = document.getElementsByClassName('campo');
var numero = Math.floor(Math.random() * 9);
while (true) {
if (_escolha === 'x') {
if (aux[numero].innerHTML.length === 0 || aux[numero].innerHTML === '') {
aux[numero].innerHTML = 'o';
cont++;
break;
} else {
numero = Math.floor(Math.random... | 1 |
ab0e6c1b9c9b5a5c2705b83674fe3e35 | 3733f9b6ac3d6c2068ef7c81e6c8c951 | Retorna um objeto Address com as informações | $addressId = $this->_properties['id'];
$model = new My_Model_Table_Address();
return $model->find($addressId)->current();
} | 1 |
b0f898005a30ea9320bfcdda4bcbf243 | 6c0bd613216dd7388f590b3c67519e92 | Получение коллекции индексов тире для заданного текста | class AbstractSearch
public function getRanks($text) : array
{
$result = $this->rankingAlgorithm->rank(
$text,
$this->indices,
$this->strategy,
$this->caseSensitive,
$this->included,
$this->files
);
return $result;
} | 0 |
79fe11255c5c7ba8884bfc659d03fbbe | e50dac2cf44cef4ba59effbf3668ab4c | 验证皮肤信息 | if not skinData then return end
if self._data and self._data.hSkin then
local uSkinData = self._data.hSkin
for k,v in pairs(skinData) do
if uSkinData[tostring(k)] and type(v) == "table" then
for kk,vv in pairs(v) do
uSkinData[tostring(k)][tostring(... | 0 |
b951e3bf8ae4aa4302581f3778845251 | af0daf2d7f0ad2647fa8e14a51cd778e | Находим курсы по id | public async Task<IActionResult> GetCourses(
[FromRoute]
[ModelBinder(BinderType = typeof(ArrayModelBinder))]
IEnumerable<Guid> ids)
{
if (ids == null)
{
return BadRequest();
}
var list = await _context.C... | 1 |
4e7527a6aec80b454b0cd11d9595be35 | 92bf46f0b714f63a42bfafaa2fe9a765 | Returns the meta object for the containment reference list '{@link RequirementSourcesConf.RequirementSources#getRequirementSources <em>Requirement Sources</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getRequirementSources(); | 1 |
4dcefc67e0b130b6f2091b91de3ea97d | 7bd79eebd21865531dfa6698b5f5ce19 | 获取美住的最后一个已开通的hotelid | Integer getCurrentHotelId(); | 0 |
64dd6fc0a2a834ff7240e5d33ec82a8d | 16b495779b555c0e8ea05598f1e8d84e | Helper function to remove the last element of a list | def delete_last_from_list(lst: List[Any]) -> List[Any]:
lst.pop()
return lst | 1 |
d9556a60bc1be10561e1b3a2815854e9 | 71c958793083f454865df443075ceaed | <p>将基本数据类型double数组转换成包装数据类型Double数组。</p> | public class DataConversion
public static double[] toPrimitives(Collection<? extends Number> values) {
if (values == null)
return null;
return values.stream().mapToDouble(Number::doubleValue).toArray();
} | 0 |
a98958758c94e5b4b6cd5b3493d4c46b | 9f18a26be553f0461f5c9ce4de4e6554 | Called when the thread just exited it's loop and needs to clean up. | class Database ():
def clean_up_thread(self):
print("Database: clean_up_thread")
return | 1 |
9c53a0e943106ab103cc55b92f65ae7e | 347e680aee4f1a364ae51a1cc2c5c549 | <para>
Returns a list of markers around a point.
</para> | {
List<Vector3i> ret = new List<Vector3i>();
for (float x = -0.5f; x <= 0.5f; x += 1.0f)
for (float y = -0.5f; y <= 0.5f; y += 1.0f)
{
Vector3i pos = Convert(position.x + x, position.y + y);
if (IsNextToThisPoint(pos... | 1 |
3d0b16b57862c168e0062902520342df | 9be9c1788c2a37e9de436527b4c24475 | Returns a string format of date with pattern "MM/dd/yyyy". | def getStringDate(input):
return input.strftime("%m/%d/%Y") | 1 |
98fb0b5006e94bc24d43d60524ff42ef | 5a0da4247926e91a4343d47602bfbb3d | NewDeliveryDefinition builds a DeliveryDefinition with defaults | func NewFetchDefinition(url string) *FetchDefinition {
return &FetchDefinition{
Name: urlToName(url),
URL: url,
Timeout: DefaultTimeout,
FollowRedirects: false,
Required: true,
Method: "GET",
ErrHandler: NewDefaultErrorHandler(),
CacheStrategy: cac... | 0 |
d3c961546db44829d7368e0651494db3 | b1953611cadd0a83fc34eee27ba7ae32 | Hash the en-passant square | class Board
public function setEnPassantSquare($value) {
$this->enPassantSquare = $value;
return $this;
} | 0 |
88705a4f85c4cea195f16f874f472a4a | d43d0dc2cba0ac729e6ecee440a3d87e | Process the updated 'langnoremap' option value. | var newMapping = PreferencesManager.get(pref),
newNames = Object.keys(newMapping),
state = _prefState[pref],
last = state.last,
overridden = state.overridden;
newNames.forEach(function (name) {
var language;
if (newMapping[name] !==... | 1 |
9bad9d6d4430f163c778d382a8daa155 | 089cd3a71b4a8481a8a5341dfe4bca8b | Dá início ao jogo e seta os callbacks de resize e click | window.addEventListener('resize', resize)
window.addEventListener('keydown', handleKeyDown)
window.addEventListener('keyup', handleKeyUp)
window.addEventListener('mousemove', handleMouseMove)
window.addEventListener('click', handleClick)
initCamera()
const assets = await loadAssets()
tileMap = new TileMap(20, 0... | 1 |
cee60bc4febee495c282e47361d43629 | a5cb1a5e353ded0ea6c6f019d6878e23 | Delete the favorite file from the favorite grid | int i = listBox1.SelectedIndex;
if(DeleteFavorite != null && listBox1.SelectedItem != null)
DeleteFavorite(listBox1.SelectedItem.ToString(), EventArgs.Empty);
try {
listBox1.SelectedIndex = i;
} catch {}
ItemsEnabled();
} | 1 |
fcf21def74000c3f992f40738a3f8899 | 013e9cf1a666e71f0c813f05d7fc5f66 | converts configuration hash (keys as directives, config as values)
to an array of strings with camelized directive and stringified values | declarations.gsub!(/(^[\s]*)|([\s]*$)/, '')
output = {}
declarations.split(/[\;$]+/m).each do |decs|
if matches = decs.match(/\s*(.[^:]*)\s*\:\s*(.[^;]*)\s*(;|\Z)/i)
property, value, end_of_declaration = matches.captures
output[property] = value
end
end
output
end | 0 |
994b20d2c83e307ea2d86f567ea29880 | 13af4e2f6eb225701a52f286e3dec4de | 判断能否不填写表单直接启动 | public class GetMachine extends Close public class MyModel extends Model
public boolean canStart() {
return url == null && path == null && get == null && progress == null && exception == null;
} | 1 |
fce67e45d377f64038cd29c2b4235be3 | d230e320cf75aac95c85d95598a13adc | Sets what the minimal days required in the first week of the year are;
For example, if the first week is defined as one that contains the first
day of the first month of a year, call the method with value 1. If it
must be a full week, use value 7.
of the year. | public void setEarlydays(Integer value); | 1 |
931dffe6d403c5f19eea9e694f7b5361 | ab81408b5739e024ddf53deb8e669907 | 是否有虚拟键 | public class ViewUtil
private static boolean isVirtualKeyShow(Context context) {
boolean hasNavigationBar = false;
Resources rs = context.getResources();
int id = rs.getIdentifier("config_showNavigationBar", "bool", "android");
if (id > 0) {
hasNavigationBar = rs.getBoolean(i... | 1 |
2c24dda62ab5a007a481cd20689b0751 | 7f61a898006a5155263af8bff1772744 | pad string to 8 chars with 0s on left | function PADZero(&$HexString,$HexStringlen)
{
if( $HexStringlen < 8 )
{
for($i = $HexStringlen ;$i<8;$i++)
{
$HexString = "0".$HexString;
}
}
} | 1 |
8f5b8b06e6608eb7d0c0f929e0a10e41 | 2bb289213e8ebc3c28e9b766aae92dd8 | 每隔1s钟运行一次定时器 | public class FlowManageService extends Service
public int onStartCommand(Intent intent, int flags, int startId) {
if (timer == null) {
timer = new Timer();
timer.scheduleAtFixedRate(new RefeshTimer(), 0, 1000*59);
}
return super.onStartCommand(intent, flags, startId);
... | 0 |
621951b06cb69834914994e830f74b71 | cf8f34891b9cf49610a397e2f5f173b3 | Creates new test for a helper. | class Itabs_LogViewer_Test_Helper_Data extends EcomDev_PHPUnit_Test_Case
protected function setUp()
{
parent::setUp();
$this->_helper = Mage::helper('itabs_logviewer');
} | 1 |
d81e5ecd50303e34da28e8c98b2e70af | 86f5b9b636a8dc966f25381ad2eb900d | Write a macro star to disk, then recursively write its children too | config = ConfigObj(raise_errors=True,list_values=False)
config.filename = filename
for macro in macro_dict:
config[macro]={}
config[macro]['trigger']=macro_dict[macro]['trigger']
config[macro]['actions']={}
action_list=macro_dict[macro]['actions']
for item in izip(cou... | 0 |
2c4141d2033e282c012aeddae30acec0 | 2bc04581eb7c6a01af669fa737e6022f | Outputs appropriate checked statement for checkbox. | abstract class Form
static function activateCheckbox(bool $checked): string
{
return $checked ? ' checked' : '';
} | 1 |
440e092b4ba6f1b715900b5989d7c25a | 7941429b0b43771dd0d0e7db704e6760 | Removes a button from the right side of the navigation bar. | {
if (array_key_exists($buttonId, $this->buttons)) {
unset($this->buttons[$buttonId]);
}
return $this;
} | 0 |
1de294514b91182e24569a4e787a92cf | ead98e93272b4c90314c8039c4110424 | Setting all controls back to active once the plotting is stopped | {
setDisabledRecursiv(ui->controls_client_1, false);
setDisabledRecursiv(ui->controls_client_2, false);
setDisabledRecursiv(ui->Audio_out_left, false);
setDisabledRecursiv(ui->Audio_out_right, false);
ui->verticalSlider_operator1_setGain->setEnabled(false);
ui->verticalSlider_operator2_setGain->setEnabled(false);... | 1 |
299bd7f79cbbdb113483de82359e3081 | cf402ce89dc387c8cf141a0a6872db6b | This OP returns the truth value of :math:`x < y` elementwise,
which is equivalent function to the overloaded operator `<`. | x0, x1 = _broadcast(x0, x1)
from impl.less_equal import less_equal_compute
return less_equal_compute(x0, x1, None, kernel_name=attrs["fusion_op_name"]) | 0 |
f766aafd19902083f9c8bd7d999c9a43 | 49d71394db50058bd25575684fe35be1 | Add the CPT to the list of pages to show on the front page. | function add_all_cpt_to_query( $query ) {
if (
$query->is_home() &&
empty( $query->query_vars['suppress_filters'] )
) {
$query->set( 'post_type', array(
'post',
'snippet',
'video',
'wlr_web_link'
) );
}
} | 1 |
6505042d6b6427ea56af0bf879eabff5 | 8944b94f37c28fd658b6834ddcff836e | Get the request binding purchase. | class PurchaseBuilder
public function getPurchaseRequest()
{
$amountDetails = new BillingDetails\AmountDetails(
$this->get('amountValue'),
$this->get('amountExponent'),
$this->get('amountCurrencyCode')
);
$billingDetails = new BillingDetails($amountDetails... | 1 |
67e9dbdeb32b8cf51bbb5f5a8767015f | 7c7aa2a6adfe6b5e04202ef59c84fd5a | Updates the internal hero database | hero_links = get_hero_links()
hero_list = get_hero_detail(hero_links)
entry_list = Heroes_helper(hero_list)
construct_DB_Heroes()
add_DB_Heroes(entry_list) | 1 |
ebe49e9e20eb6a9bc64f1f2cb499d6a2 | 6ef4dcf19ee8e57579ce61c8c5fbf544 | Allow use as dictionary key | class ApiObject(object):
def __hash__(self):
return hash(tuple(sorted(self.__dict__.items()))) | 1 |
2cdafb8564c5317f1ae120f2e6b8191d | 96873527ede23080319ba125652307af | print that the test is done, and ask the user to continue (if) | void MinimalistPrinter::OnTestEnd(const ::testing::TestInfo& test_info)
{
printf("\n");
} | 0 |
451675652613dbc36401f971e91c4705 | 9abb059e961acd452670ea955c58b241 | Sets the {@code traceCells} property in the builder. | @BeanDefinition
public final class CalculationArguments implements ImmutableBean public static final class Builder extends DirectFieldsBeanBuilder<CalculationArguments>
public Builder traceCells(Map<Cell, TraceType> traceCells) {
JodaBeanUtils.notNull(traceCells, "traceCells");
this._traceCells = traceCel... | 1 |
1e1da57734d2dcf6610b07f787398ec3 | c28c231a730a7ba8cebbb91bf884d670 | 添加基础测试用例,返回未在prarmeters_dict中的字段列表 | def add_variables_basic_test(testcase_list,notAddedParams):
if len(notAddedParams) == 0:
return notAddedParams
for param in notAddedParams:
templateTest = copy.deepcopy(testcase_list[1])
data = templateTest['test']['request']['data']
del data[param]
testcase_list.append(t... | 1 |
8515c4e28918e3b429e1e73b2fb63d0d | 6b4e4419104815afd33db21ec5bc4064 | <p>Retains element of which appears in the both sequence. Duplicate elements in this sequence are also removed.
In other words, Produce the set intersection between this sequence and the other.</p>
<p>Comparison is performed between results of mapping.</p>
<p>This overload is executed in sequential and causes sequentia... | this IIterable<T> first,
IIterable<T> second)
{
return first.Intersect(second, null);
} | 1 |
1867680a9704a9773eb58cd57000e4c3 | f0e57d845b3acb33b6823aa1a4912b5e | Displays the race results for a single kart. | {
$results = Result::where('xc_time_trial_race_id', $race->id)->orderBy('place')
->with('race', 'athlete')->get();
return view('timeTrials.crossCountry.races.show', compact('race', 'results'));
} | 0 |
61c4236e82fa6281f1ee0a163f8ea5e3 | 6932fb9743c9f9cf7828319f0d61cb16 | Поиск файла лога | namespace STCLINE.KP50.REPORT
public partial class ReportGen
public void FileChangeLS(object container)
{
MonitorLog.WriteLog("Старт " + System.Reflection.MethodBase.GetCurrentMethod().Name, MonitorLog.typelog.Warn, 20, 201, true);
ParamContainer cont = (ParamContainer)container;
... | 0 |
f6218c64f4fa5e4ea0916c3009668e3b | 7dc8bd6ca9b75b7f6d5b04e7e8091b97 | 保存华为的推送token | class Home extends CI_Controller
function savePushToken()
{
$token = $this->input->post('pushToken');
if (empty($token)) {
return $this->output
->set_content_type('application/json')
->set_status_header(200)
->set_output(json_encode(['result' => false]));
}
$userId = $this->user_info->id;
$row... | 1 |
2b1e6d20b801fd704c2b6fd9a3ddc30b | e92addbfc58bbfb0c869e83588a433f1 | Updates the current log stream that logs will be published to | const req = new UpdateReq();
const options = new UpdateReq.Options();
const identifier = new StreamIdentifier();
const settings = new UpdateReq.Settings();
settings.setResolveLinks(this._resolveLink);
settings.setRevision(this._revision.toString(10));
settings.setExtraStatistics(this._extraS... | 1 |
ea75f0b69a461c58c2111fa9001ef68e | 751c6a529063d1ee6a80b38dd3585bd0 | Creates constraints that limit unit output based on capacity. | class SinkDSMDIWBlock(ScalarBlock):
def _create(self, group=None):
def dsm_up_constraint_rule(block):
for t in m.TIMESTEPS:
for g in group:
lhs = self.dsm_up[g, t]
rhs = g.capacity_up[t] * g.max_capacity_up
block.dsm_up_constrai... | 1 |
18c31ea6c287bf2c3b7455f72f921fca | b695786fccab6435d464cdfe9ca1a5be | 启动H2数据库 | public void contextInitialized(ServletContextEvent sce) {
try {
logger.info("正在启动h2数据库...");
server = Server.createTcpServer().start();
logger.info("h2数据库启动成功...");
} catch (SQLException e) {
logger.info("启动h2数据库出错:" + e.toString());
e.prin... | 1 |
2313d5cee1428864f82ed3d43d1d06f6 | 262ee38c558a9f68e6f26830dc83702a | Metric for ratio data. | class Metafeatures:
def DatasetRatio(self, X, y, categorical):
return float(self.metafeatures["NumberOfFeatures"]) / \
float(self.metafeatures["NumberOfInstances"]) | 1 |
252847b4ee4e369cea154aa428d843d4 | 16f5aa55a20c199c65772c593eeedf23 | Reset direct priors. | self._cumulative_estimates[:] = self.prior
self.action_attempts[:] = 0
self.last_action = None
self.last_op_action = None
self.t = 0 | 1 |
84da31470f71d2c25a10ceced102ab55 | 9f9b8929ee67035100de891f27b8e5e2 | Checks if a given learning path tree node is completed | class LearningPathService
public function isLearningPathEmpty(LearningPath $learningPath)
{
return $this->treeNodeDataService->countTreeNodesDataForLearningPath($learningPath) == 0;
} | 0 |
20c6e312c84267b432459486b143f454 | f0046bfd63239f17d3eed0585dc241dc | Install Payment Instruction
Installs a payment instruction for caller. | namespace LoveBank.Services.Payments
void Install(IPayment payment); | 1 |
6b9573758942b583d0e38a3e894df383 | 5a4d1d0827edb6757a140ccf945d05e8 | 导入标定数据 | namespace XGCAP.UI.P.PB
public partial class FrmPB_TSTJ_OLD : Form
private void btn_import_Click(object sender, EventArgs e)
{
try
{
DataTable dt = ReadExcel(this.txtUrl.Text);
if (dt.Rows.Count > 0)
{
for (int i = 0... | 1 |
e585dfe699b3ba0ed08156f3ae33636f | 7b5b6cb13a9a341c89091e25e8a28d39 | CARGAR EL FORMULARIO PARA EDITAR EQUIPO | {
$areas= Area::lists('Descripcion','Area_ID')->prepend('Seleccioname el Area');
$sistemas= Sistema::lists('Descripcion','Sistema_ID')->prepend('Seleccioname el Sistema');
$subsistemas= SubSistema::lists('Descripcion','SubSistema_ID')->prepend('Seleccioname el SubSistema');
if (!Auth... | 0 |
05124a0bd08d5828fcc766fe0262d7e3 | c6755ff2a6f36390f3fd1fa10545d1a7 | Returns a new object of class '<em>XSD Cardinality Facet</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | @XmlRegistry
public class ObjectFactory
public FacetCountType createFacetCountType() {
return new FacetCountType();
} | 0 |
342ff2d8d8ffb8821ba432e0483de0c0 | 329ad00f70673982a544227eb68524da | A method invocation is used as a stand-alone statement. | namespace CodeModel
public class JBlock : JGenerable, JStatement
public JInvocation invoke(JMethod method)
{
return insert(new JInvocation((JExpression)null, method));
} | 1 |
afec1933d1c8f43e7034bd1110b3d2b5 | 86be19105914c22dfb489f346479ebe3 | Facebook Comments block | function felixcomments($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
if ( 'div' == $args['style'] ) {
$tag = 'div';
$add_below = 'comment';
} else {
$tag = 'li';
$add_below = 'div-comment';
}
?>
<<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ... | 0 |
c04393f75172d2f9891d2b6b450661ea | bb1b4835598bd461c3eebdc69556bd55 | ## compare results of different scenarios in a dataframe | deaths_compare_scenarios_point_single <- function(model_output_list,scenario_labels,deaths_data,funerals_data,init_date,last_date,admin_df,N_reg,max_date=NULL){
deaths_ts_admin1_list <- list()
date_output <- data.frame(time=1:time_period,date=ymd(seq(init_date,last_date,by="days")))
date_output <- head(date_outpu... | 1 |
ad09580f8314b8c4ca1dc7094ca08d14 | e91571f3533fe31e6d8b10cc7fbf2606 | Returns the value of the cummulative reward in the current episode | class Environment:
def episode_reward(self) -> float:
return self._episode_reward | 1 |
73de0683d92acb3a5c84d79016d81488 | 63c0e8d730367cab6205e09837e442f0 | @brief Function for adding speaker characteristic. | static uint32_t temperature_char_add(ble_sts_t * p_sts, const ble_sts_init_t * p_sts_init)
{
ble_gatts_char_md_t char_md;
ble_gatts_attr_md_t cccd_md;
ble_gatts_attr_t attr_char_value;
ble_uuid_t ble_uuid;
ble_gatts_attr_md_t attr_md;
memset(&cccd_md, 0, sizeof(cccd_md));
BLE_GAP... | 0 |
5b967c612d2ad6b90b3750dc30065594 | 63c4468fa28967af2ec03e355d0b75e1 | Test that two hashcodes are different if the order is different | public void GetHashOfDifferentObjects()
{
Node n1 = new Node(),
n2 = new Node("Test", this.flowIdentifier1);
Assert.AreNotEqual(n1.GetHashCode(), n2.GetHashCode());
} | 0 |
3c68e3a2dda6262e7b64cff6ef1b1e86 | 582695a92bddb1fb587ddd69110fc5fc | Visualisation du Bilan de parcours 66 | {
include "connexion_bd_gesoraux.php";
extract($_POST);
$leexam = $bdd->query("SELECT nom FROM NomExam");
$exam = $leexam->fetch();
$leProf = $bdd->query("SELECT nom, prenom
FROM utilisateur
WHERE id = $lst_prof");
$ptof = $leProf->fetch();
$nomProf = $... | 0 |
aafbd9fa4a204500433f8c5542dddaf6 | 183ed40a48e5679faa893e09849ca6ef | Gets the tour package states by countr identifier. | namespace HiTours.Services
Task<TourPackageNightModel> GetNightsByPackageNightIDAsync(Guid packagenightid); | 0 |
3f283724dfb9fc2a0e13e6e67b128975 | 282c544728ebf8c39ba05ff6745059f5 | Функция возвращает признак, относящий доску к стандартному ряду типоразмеров | class Shape
public function isTable(): bool
{
} | 0 |
ea782cad251b34e857af05cc1d3d71e5 | 87f5c47cb56f61af2dd9d46362379959 | Called when the Month radio button is pressed. | {
if (e.Value.ToString() == "All")
mFilterOptions = FilterOptions.Default;
else
{
DevotionsCategory.DevotionMonth = e.Value.ToString();
mFilterOptions = FilterOptions.Month;
}
} | 1 |
0bbbb64117f180cff89c643eb4cdb891 | edaac8f5c81448dee03a22598d91a832 | Get gift card recipient name. | class UserGift extends Model
public function getReceiver()
{
if($receiver = $this->user) {
return $receiver->name;
}
return 'Anonymous';
} | 1 |
5a3df7ba44e63bc2c0e82a9ae3495e44 | ae145dd6b88f35e3dfe9dfaf0883dba3 | ####MODEL#### | census_KNN_model <- function(scored_bg, new_bg, K){
knn.pred.new<- class::knn(train = scored_bg[,3:26], test = new_bg[,2:25], cl = scored_bg[,2],k=K)
outscore <- as.data.frame(knn.pred.new)
bg_geo_id <- new_bg$bg_geo_id
model_number <- 14
date <- Sys.Date()
output <- cbind(bg_geo_id, model_number, outscore... | 1 |
fb125465cb362ca2f2808044f238908b | e63ac1176f3f9e5ab915247e730809c7 | 如果超出边界返回边界值 不超出边界则返回原来的值 | {
if (val < 0)
{
val += boundary;
}
return val % boundary;
} | 0 |
7c2a810b3b0ff66cc85e8a9863f55d6a | 29fc91fdb041be01a9f2c2b838a0d1e1 | Handles the Click event of the mnuPlugins control. | {
if (this.dataGridPlugins.SelectedItem is WsapmPluginAdvancedBase)
this.buttonPluginSettings.IsEnabled = true;
else
this.buttonPluginSettings.IsEnabled = false;
} | 0 |
72f8aeaf872a3ab3429f8fd03a8c54e3 | bc0c16e36866202eb4db476a2971de43 | Convert network order to host order for longwords | CommandBase::convertNetworkToHost(void* theBuffer, int32_t theBufferLength)
{
cast_ptr_t lData = { theBuffer };
const int32_t lIntegerToConvert = (theBufferLength - COMMAND_ID_SIZE) / sizeof(int32_t);
for (int32_t l = 1; l < lIntegerToConvert; l++)
{
lData.asIntegerPtr[l] = ntohl(lData.asInteger... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.