query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
be7013d994a6d78df36881cdf46f52ca | c5bf664f79da61c40d2204c28ca2f96e | Returns a category by index. | class SimplePie_Enclosure
public function get_category($key = 0)
{
$categories = $this->get_categories();
if (isset($categories[$key]))
{
return $categories[$key];
}
else
{
return null;
}
} | 1 |
a7479c99a810be24153eebe327637de2 | 4ef4c07c781d1f3ad9f0e235dd34eaeb | Prefetches all card images | void CarouselDeckView::Render()
{
bool prefetch = options[Options::CARDPREFETCHING].number?true:false;
if (prefetch && WResourceManager::Instance()->IsThreaded())
{
WResourceManager::Instance()->RetrieveCard(mCards[0].card);
WResourceManager::Instance()->RetrieveCard(mCards[3].card);
... | 1 |
4db649291e3631ab874eff81ed4d2161 | 1dab038ee7beaae70f185bbf652a365f | constructs matrix from row vectors | CMatrix4::CMatrix4( const CVector4 a_pvecRows [ ERow_Count ] )
{
SetMatrix( a_pvecRows );
} | 1 |
9d622542fe0132f88498430260c736e5 | 3a75020019f48f2b2fba629865a8a926 | Returns a sequence of precise extent geometries. | {
RegionBoundary rb = GetRegionBoundary(region);
for (int precision = precisionStart; precision < precisionStart + precisionCount; ++precision)
{
double step = PrecisionHelper.GetStep(precision);
for (double lat = rb.Min.Latitude - extension * ... | 1 |
7894027d359753ee1f5c9df1037f15ea | bded414ad75a11d397f244a5e2bb89f5 | Gets all versions of available SNVPhyl pipelines from the given settings file. | fd = StringIO()
remote = os.path.join(workspace, "visibile_versions.log")
get(remote, fd)
rows = fd.getvalue().split("\n")
return list(map(json.loads, filter(None, rows))) | 0 |
cb009dbb945431284ee2e7e012a043db | 217c3c99c177acbbf985e340dce3d379 | Get a List with all the User-agent Ongoing Calls. | public class UAStateCallback extends Callback
public SipCallSessionImpl[] getCalls() {
if (mCallsList != null) {
List<SipCallSessionImpl> calls = new ArrayList<SipCallSessionImpl>();
synchronized (mCallsList) {
for (int i = 0; i < mCallsList.size(); i++) {
... | 1 |
3353da053a39fd7cd14331990309c148 | f03c7f409a3c8d63a7646c03b425748b | Check if we are on the same side of the hemisphere | public class UPSCoordinate
public char getHemisphere() {
return hemisphere;
} | 0 |
7398d9f328b036e38c5c17a584a07964 | 060f51c6d0cd5d123b442fb93340e190 | Находим ID документа по артикулу | function GetArticulOfferByID($ITEM_ID) {
$IBLOCK_ID = StockMan\Config::CATALOG_OFFERS;
$ID = $ITEM_ID;
$articul = "";
$rsOffers = CIBlockElement::GetList(array('PROPERTY_CML2_ARTICLE'), array('IBLOCK_ID' => $IBLOCK_ID, 'ID'=>$ID), array('PROPERTY_CML2_ARTICLE'));
while ($arOffer = $rsOff... | 0 |
c4a53e1af32a3f511c097b0b5ed83019 | e0cdc5079aa38c3612170cfc2161e4af | Create expression that selects map items identified by values and returns selected data specified by
returnType. | namespace smecy
SgExpression* smecyReturn(SgStatement* target,
SgExpression* mapName,
std::vector<SgExpression*> mapCoordinates,
SgExpression* functionToMap,
SgType* returnType) {
SgScopeStatement* scope ... | 1 |
de8a37b7ef58a03108bc8fbc0afaa809 | 0a4fd92544719e7dbf96e78448d63a88 | 0x06 LD B, d8 : Load 8-bit immediate into B
Flags affected:
None | unsigned op_b8 (e8086_t *c)
{
e86_set_ax (c, e86_mk_uint16 (c->pq[1], c->pq[2]));
e86_set_clk (c, 4);
return (3);
} | 0 |
e6f25e83dda235e2791658e32231d423 | 23fec1fb66fa1c2e6c33e778b8a89332 | Set the class descriptor for this binding. This will only be applicable for
class bindings. | void setClass(Object value); | 1 |
057483452c97360cd2766aed6fcfe10a | 424b126ffbc6a376d53a728329cbd83b | Arrays are realized as lists. Parses children of array element and appends them to new created array.
Returns array. | @SuppressWarnings("CheckReturnValue")
class PainlessParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements PainlessParserVisitor<T>
@Override
public T visitNewarray(PainlessParser.NewarrayContext ctx) {
return visitChildren(ctx);
} | 0 |
cfe24ea69c814f9f8d85c6a3df542284 | b6d3268071fa8d01660d2424d19204fc | Plot the (sorted) base frequencies for each of the significant offsets. | class IV_Response():
def plot_binSlopeOffsetCorrected(self):
plot(self.binSlopeOffsetCorrected) | 0 |
750167fb43999e97ae24741603924a3a | 42e679c926cef5b071c0b5514146f4ed | Initiates the asynchronous execution of the ListIndex operation. | namespace Raven.Client.Documents
public abstract class DocumentStoreBase : IDocumentStore
public virtual Task ExecuteIndexAsync(AbstractIndexCreationTask task, CancellationToken token = default(CancellationToken))
{
AssertInitialized();
return task.ExecuteAsync(this, Conventions, tok... | 0 |
75fd670dc079333be7798d14213b5557 | b4b419a277a70bc97f509d1ae4ae5a69 | Deletes all contents of the specified folder.
This is generally used to empty the trash (wastebasked), but could also be used on any
other folder. | @NonNull
Completable deleteFolder(@NonNull String folderToDelete); | 0 |
cb40a7580134a6caa515b9f496bbf8c3 | 1ed39e40472a72f02a20168763c1690d | Add the provided Entity to the CosmosDB table. | {
var tcs = new TaskCompletionSource<bool>();
Database.Enqueue(tcs, () => {
tcs.SetResult(UnderlyingCollection.Upsert(entity));
});
return tcs.Task;
} | 1 |
cc2288d22bceb593bff67aa9c41a3553 | 78556356303e48ac47ad0bef14238d6e | 把UserView对象放入session中. | public class AccountUtilsGiveUP
public static void addSession(User user) {
Account account = fromSession();
assertBean(account);
account.setUser(user);
WebResource.session().setAttribute(ACCOUNT_SESSION_KEY, account);
} | 0 |
f043ef3906753a121ae6d36605908897 | 10f07f00a3b5fd47740d21bdbe30a9bb | Funcion para obtener el backtracking una vez que se encuentra la meta, recibe el estado y un arreglo con todos los nodos | global decisionsTaken
global depth
global numbersAssigned
global totalSearched
q = Q.PriorityQueue()
IniNode = Node(values,h(values),0)
index = 0
q.put((IniNode.cost,index,IniNode))
PoppedNode = Node(values,h(values))
Visited = []
Visited.append(values)
emptyFlag = False
... | 0 |
24e7159071630fe56fdc8b6843fb7c12 | f0c584b3710c655fccec3a834d7fa86d | Performs a free-form Search which handles the most fuzzy of inputs handling any combination of address or POI tokens. | namespace GuildfordBoroughCouncil.Address.Api.Controllers
[EnableCors("*", "*", "*")]
[RoutePrefix("Lookup")]
//[RoutePrefix("v1/Lookup")]
[Obsolete]
public class LookupV1Controller : ApiController
[HttpGet]
[Route("BySomething")]
public async Task<IEnumerable<Address.Models.Address>... | 1 |
d96e60007494df5b78b56fa721c39872 | 0a4ce03c2733de2e96f9a67b409bc7fe | Returns string like <input type="hidden" name="bms_req_tk" value="adsf&asd " | namespace Dev.Comm.Web
public class DevRequest
public static string GetFormString(string strName)
{
return GetFormString(strName, false);
} | 0 |
66947043ac269e008523a541b5134f1f | e99c9436145dc95471d70640d3224732 | リストの中のランダムな要素を1つ返します | namespace Ksnm.ExtensionMethods.System.Collections.Generic.List
public static class ListExtensions
public static int IndexOfRandom<T>(this IList<T> list)
{
return list.IndexOfRandom(new global::System.Random());
} | 0 |
a9d035760ea0d3a935c0676066d44223 | 62f0724cd6a01c8c233453f31857239d | same as above but will be used for pairs of atoms as keys | class dNdSEntry(object):
def __key(self):
return (self.ref) | 0 |
fa5064526f9a88561d407bb592957651 | e8d77a99b34df6ec806a0021030e79b8 | Sets the scan units. See MPS_AVAILABLE_UNITS for accepted values. | namespace TwainWeb.Standalone.App.Twain
[ToolboxBitmap(typeof(Twain32),"Resources.scanner.bmp")]
[DefaultEvent("AcquireCompleted")]
[DefaultProperty("AppProductName")]
public sealed class Twain32:Component
public void SetUnitOfMeasure(TwUnits value) {
this.SetCap(TwCap.IUnits,(ushort)value);... | 1 |
9b6190d5f3d9b39106ef86ee04651fab | 5307d5223d4d15897d0f9e35e459acfa | Verify that case insensitive variants of 'true' returns the True
boolean. | class UtilityTests(unittest.TestCase):
def test_boolify(self):
trues = [
'yes', '1', 'on', 'enable', 'true', 'yes', '1', 'on', 'enable', 'true', 'YES', 'ON', 1, True]
falses = [
'no', '0', 'off', 'disable', 'false', 'no', '0', 'off', 'disable', 'false', 'NO', 'OFF', 0, False, 'monkeyfa... | 1 |
7ca2461aa7dedb6f8193b8ffd8b9b0c5 | 0d0eb98f2e8b27f4cd8670ba6ed63090 | Generate random number in range 1 to 6 | var rand = Math.ceil( Math.random() * 6 )
console.log(rand)
return rand
} | 1 |
c1487301fa295aaefcb741ca03904dac | 13bd4bdce406b010a39085c8ec3d7507 | Counts all countries in the repository. | namespace Hotcakes.Commerce.Tests.IRepository.Admin
int GetCountryCount(); | 1 |
1cfbca5ac938b0e86905a231150d64f9 | 168a7689fe0027b153132cd903f20c59 | 更新经销店最后上报日期 | class cc_models_dbtdl extends Common_Model_Base
public function updateDbtdlxx($filter)
{
$sql="UPDATE H01DB012447 SET DCHSHJ = SYSDATE WHERE QYBH = :QYBH AND CKBH = :CKBH AND DBTBH = :DBTBH AND DLSHJ = "
. "(SELECT MAX(DLSHJ) FROM H01DB012447 WHERE QYBH = :QYBH AND CKBH = :CKBH AND DBTBH = :DBTBH )";
$bind["QYBH... | 1 |
dc0fecc4708ea149cce13ef3d4e69e23 | 065de3c8a558e533f226b0be81f40b2b | Get the total yearly income tax. | def get_total_taxable_income(gross_income, salary_sacrifice):
taxable_income = get_net_adjusted_income(gross_income, salary_sacrifice)\
- get_personal_allowance(gross_income, salary_sacrifice)
return taxable_income | 0 |
168050a9917121ff49513e9c1650419a | dd1334141d5e7b4f7ac5dd6dbd13ef13 | Слот для добавления операции | void MainWindow::onAdd()
{
mLastOperation = E_INSERT_ROW;
accountDialog->setTextFields(tr(""), tr(""));
accountDialog->show();
} | 1 |
8c297616fa8c7a5464138af837d14d06 | 8f764c5560f01770bdae877fe726dabe | ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream. | class GetMetricStreamResult:
def firehose_arn(self) -> Optional[str]:
return pulumi.get(self, "firehose_arn") | 1 |
e07d2e9e34f4e9687f5bdff583f055c3 | ee76685e44a6a840652455f1ab94fb25 | Tests how Zuora client's on-demand auth check. | httpretty.register_uri(
httpretty.GET, 'http://localhost/docs/swagger.json',
body=open('tests/data/swagger.json', 'r').read(),
content_type='application/json')
opsy = OpsyClient(url='http://localhost/')
assert opsy.authenticated is False
assert dir(opsy).sort() == ['authenticate'... | 0 |
4cb8162ac55f13720a0b3bf248fdcc68 | 67e2987c0455b7f7ca6876a21a4d19b4 | 是不是必需的 | class CheckBase(ABC):
def is_required(self) -> bool:
return True | 1 |
7d3b638360b2f267116c5648dc26977d | 4ebeaee6d27f706f8d7d0a28fc990820 | Check that method returns the dictionary __objects | store = FileStorage()
dict_instances = store.all()
self.assertIsNotNone(dict_instances)
self.assertEqual(type(dict_instances), dict)
self.assertIs(dict_instances, store._FileStorage__objects) | 1 |
8dc9fae1d3b793702cc1969b1391cd67 | 3b2ecc4bae2a0e1b2fbc4099bcbfe8d2 | Clean up eventTable every time a new level loads. | for(int j = 0; j < 9; j++) {
events[j].clear();
}
eventLoader();
} | 1 |
112e64368dc7f53d3895891aa594e5c1 | d25a0265c01083aba74574dace648c40 | Clears the cached Cognito ID associated with the currently configured
identity pool ID. Use this to manually invalidate your cache if
the identity pool ID was deleted. | namespace Amazon.CognitoIdentity
public partial class CognitoAWSCredentials : RefreshingAWSCredentials
public virtual void ClearIdentityCache()
{
var settings = ServiceFactory.Instance.GetService<IApplicationSettings>();
settings.RemoveValue(GetNamespacedKey(IDENTITY_ID_CACHE_KEY), A... | 1 |
9b8af5102f5e802048c5325298390155 | a5179eee64ed821e757abf0208e31327 | call when ship is hit by an obstacle | public class ShipMovement : MonoBehaviour
public void OnCollisionEnter(Collision obstacle)
{
Vector3 bounceForce = transform.position - obstacle.transform.position;
bounceForce.Normalize();
rb.AddForce(bounceForce * collisionKnockback);
gameObject.GetComponent<PlayerHP>().TakeDamage (5);
} | 1 |
26d462c69c2ed818b7be4a5d7d416c7e | def7a51886dfb4e6ae8d33bdc3a5519e | this retrieves all the different coding languages used | db_cursor.execute("select lang from master_help group by lang;")
result = db_cursor.fetchall()
langs = []
for row in result:
if row[0] != '':
langs.append(row[0])
return langs | 0 |
b7979c9f651d5d3027d910c16611923f | 679ae197d5221f2f5244027b1633849f | 브릿지씬이 종료된후 불려지게될 씬번호 등록 | class ViewManager extends BaseClass
private initChangeSceneCloseUI(key:number):void {
var config:GuiConfig = GuiConfig.GetConfig(key);
if(config != null && config.switchSceneIsClose)
{
this._changeSceneClose.push(key);
}
} | 1 |
b84292f81629ee037b83e65f6c2418ed | 5db9f7ac86df5d545b7e2a922e251f6a | 通过ID播放媒体资源
R.raw.xxx | @Suppress("DEPRECATION")
class SoundHelper private constructor()
fun load(context: Context, @RawRes resId: Int) {
soundId = soundPool.load(context, resId, 1)
} | 0 |
3548e0844cc8b55b8533dbfcf5abdd66 | 6712813c73eae86a82dbd26ab9271ed3 | r"""Represent the content of the tabular in LaTeX syntax.
This adds the top and bottomrule when using a booktabs style tabular. | check = r"""\begin{table}[!htbp]
\centering
\caption{\label{tb:foo}Bar}
\begin{tabular}{lr}
\end{tabular}
\end{table}"""
lines = []
header, _, footer = lt.prepare("lr", table=True, caption="Bar", label="foo")
lines.append(header)
lines.append(footer)
result = "\n".join(lines)
assert ... | 0 |
e76028046fa33080d345bd69b49988de | e302f1ae9636ab09fe0f4f5bbe8b2b96 | POST: api/Contact/Delete | namespace InternalApp.Web.Controllers
public class ContactsController : ApiController
[HttpDelete]
public bool DeleteUser(string id)
{
return true;
} | 0 |
2977ee67715630967ed6cce289f7a6a2 | 53ecafcd96fea78f869fd2cfd5a9e7b7 | 10、药店单据往B2B系统传递任务 | {
deleteJob();
$sid = $tasks->sid;
$db = getUserDb($sid);
if(!$db)
{
logx("wms_push_trades getUserDb failed!!",$sid.'/WMS');
return TASK_OK;
}
$data = array();
$push_result = array();
$wms_type = '';
$wms... | 0 |
66537033e61f60e11ef0b60f1769c33a | e1b9e8905b169822f15ff81093535322 | text中で、patternが出現する位置の集合を返す。 | if '$' in pattern:
raise ValueError('The pattern contains $.')
if '$' in text:
raise ValueError('The text contains $.')
if pattern == '':
return list(range(0, 1 + len(text)))
work_text = pattern + '$' + text
prefix_function = Util._compute_pref... | 1 |
b31dbbad4f141716af662e9d52a709fe | 37a5448d0b02986135b4b4cbfd62b6bb | 按主键查询店铺标签服务
如果没有记录,返回空集 | List<PmLabelDto> findPmLabelByMerchantNo(String merchantNo) throws TsfaServiceException; | 1 |
98c70f815a9473d6b5282750973a8eeb | 6e2e8a33ba149ce2f5f9d0bb7a1508be | Creates a venue and sets self.venue_id to it's id. Used as before_create. | class CreateVenueSerializer(serializers.ModelSerializer):
def create(self, validated_data):
return Venue.objects.create_venue(**validated_data) | 0 |
72e72b04a979f39d461bfc164e798eb9 | 380426edbf8fbb9fccacfe2c64980657 | If the hunter manages to make it such that every possible diagonal move is invalid for them, they are trapped | bool Heuristic_1::isTrapped(const checkerboard::Checkerboard& board, const sf::Vector2i& squareCoord) const
{
return checkerboard::findValidFullMoves(board, board.currentPlayer == 0 ? kBlack : kRed, squareCoord).empty();
} | 1 |
2e759b773a3b514b3309810b7b1e7d44 | 722003cf4c161f070d6864c618f3e3c0 | Handles the KeyDown event of the ComponentsConfigGridView control. | {
try
{
this.EditEnabled();
this.ItemCodeGridView.AllowSorting = false;
}
catch (Exception ex)
{
ExceptionManager.ManageException(ex, ExceptionManager.ActionType.Display, this.ParentForm);
}
... | 0 |
b90b66c7eb91d441a6d5625d8e3aef36 | d814e7a8b0210cf2c428cbcdabc59341 | 更新日期描述,对已有日期判断并更新 | public class CompletedOrderFragment extends Fragment implements OnCheckedChangeListener,OnFocusChangeListener,
OnClickListener,android.view.View.OnClickListener
private void updateDateDisplay(EditText editText) {
String oldDate = editText.getText().toString();
String newDate = new StringBuilder().append(mYear).appe... | 1 |
8fb72093756349b0794f5d199a8a53bb | 74b480e72ce31ff8e9dbe371ca15098d | Ponyfill for Array.from | function array(a, n) {
return Array.prototype.slice.call(a, n || 0);
} | 0 |
88cb6eec2a19867ecfc69b9f4fac850f | 54a7058e5b659d69655dd400ca163235 | Empty out the DB table data for page field, but leave everything else in tact.
In most cases this may be nearly identical to `Fieldtype::deletePageField()`, but would be different
for things like page references where we wouldn't want relational data deleted.
#pw-group-deleting | {
global $wgRequest;
$this->build();
foreach($this->mForm->mFieldData as $field => $value) {
$wgRequest->setVal('wp'.$field, NULL);
}
} | 0 |
002606e7183b738c453e26a1f92c788c | 90f23a43231d8fbc52ae2887ada35f60 | 分页按条件获取排行榜数据列表 | {
var list = _universityrankingDao.GetPageList(para);
var result = new UniversityrankingList { TotalCount = GetEntityCount(para) };
result.AddRange(list);
return result;
} | 1 |
f967939e63e8de0d44806348f610a7b2 | 7929c376cf447b60035d024389b93b25 | # 计算模型系数
# 映前预测总票房或首周票房 | factor_name = [i for i in data.columns.tolist() if i not in [
'industry', 'total_mv']]
def _calc_resid(x: pd.DataFrame, y: pd.Series) -> float:
result = sm.OLS(y, x).fit()
return result.resid
X = pd.get_dummies(data['industry'])
X['total_mv'] = np.log(data['total_mv'] * 100000000... | 0 |
001dcbf0c8631a11452d00b1c7e8a84c | efd5a5b0de5fcf7df53d68f015a71bce | 将本地的GPMS对象通过RMI暴露出来 | public class SlaveImpl implements Slave
public void generateRemoteRef() throws RemoteException {
this.remoteRef = (Slave) UnicastRemoteObject.exportObject(this, 0);
} | 1 |
8bc1f12aa6068cada0090b6d70b34747 | 900da03e7e8e184b662d2be0a00d5307 | Compute grouping key from move line | int iRetVal;
Char cChr1;
Char cChr2;
if (strMove.Length != 2) {
iRetVal = -1;
} else {
cChr1 = strMove.ToLower()[0];
cChr2 = strMove[1];
if (cChr1 < 'a' || cChr1 > 'h' || cChr2 < '1' || ... | 1 |
2e908f03e5b0372b3d58ce945d5d18a3 | cc13e348d3141e5e880828df9ecb65b3 | The deposit function takes the depAmount args and adds it to the balance. This is relayed to the user through a message box | namespace ATM
public class Program
public static void Deposit(double amount)
{
balance = balance + amount;
Console.WriteLine();
} | 0 |
a32164ecb346a837d4ddbee95c14b0d4 | 10423d330cb6df6108ef2bf5d3fed7d5 | Add an empty parameter block. | namespace Logivision.Communication.Protocols
public class PumpProtocol
public void AddParameter(string inKey)
{
ParameterList.Add(inKey, string.Empty);
} | 1 |
686f4dd4ebe49de557093781cc302376 | c34d51931db89c4264f998c041f5aaa1 | Получает леммы для указанного текста построчно | namespace Schemas
public abstract class IAsmDealer
public abstract List<string> MorphGetSeparatedSentsList(string text); | 0 |
b3f689e427611a2e7a52cec7c46baa05 | 8210222b08936aaee1de3cfdbdb216d6 | 获取第i个园的半径 | public class LockView extends View implements LockViewApi{
private float getX(int i) {
if (i == 0) {
return mCircleSpacing + mRadius;
} else if (i == 1) {
return width / 2;
}
return mCircleSpacing * 3 + mOuterRingWidth * 2 + mRadius;
} | 0 |
33bb4f96a37b82d2b3f58da78dbd69ee | 71197b6c9d1246c99d440aea40a64aef | Returns whether this is the {@link #SECONDARY} type. | public class ImportNodeProxy
implements VRMLNodeType, VRMLNodeListener, Cloneable
public int[] getSecondaryType() {
return TypeConstants.NO_SECONDARY_TYPE;
} | 0 |
82243361e4b6f3a3c401867370f4e020 | 4f96e7199ab5c5e0c50bfd83d31bb562 | Updates an Amenity object | def update_amenity(amenity_id):
ignore = ["id", "created_at", "updated_at"]
amenity = storage.get("Amenity", amenity_id)
if amenity is None:
abort(404)
json_data = request.get_json()
if json_data is None:
return "Not a JSON", 400
for key, value in json_data.items():
if ke... | 1 |
1142203efb07d07927e47f39821096cd | fd840765714c61c61a35e14947671cfa | 设置请求头, 如果该Header已存在, 则删除原Header | public abstract class RequestBuilder
public RequestBuilder setHeader(Map<String, String> map) {
if (mHeaders != null) {
mHeaders.clear();
}
mHeaders = map;
return this;
} | 1 |
5799b03e55bfcef30a09df692784db64 | 3766391701eb7fcf92915e02c272a1f4 | From the given variation object, build a variations description to be used
in simple text fields. | abstract class WC_Connect_Compatibility
abstract public function get_formatted_variation( WC_Product_Variation $product, $flat = false ); | 1 |
557c4b876c2618c4846ea43c504a9107 | 21a67e490f168d94d2e97124c8892489 | 根据订单ID获取payId(支付宝流水),payOuterId(系统流水),payPrice money(支付金额) | class PayClassModel extends PdoModel
public function getorderinfo($outordersn)
{
$data = array();
if(empty($outordersn))
{
return $data;
}
$sql ="select a.order_id,d.id from s11_order_info as a
inner join base_order_info as b on a.order_id=b.id
left join app_order_details as d on a.order_id=d.order_i... | 0 |
750683169c41221c1edeec2279edbfe0 | 6b94e4a21f34a02e0e579ec1ee710858 | Mapping of the previously set capacities before the actual optimisation.
Similar to capacity mapping,
but without the fine param: capacityVariablesOptimum. | class Info(object):
def capacities(self, capacities):
self._capacities = capacities | 0 |
3ed661144fd804c26a12283dcc59b529 | 3626789f985732b812a2626288da11f2 | Find news articles that do not have a scientific paper pairing | "LEFT JOIN pec_articleaudio audio " +
" ON article.sys_id = audio.articleid " +
" WHERE audio.articleid IS NULL " +
" AND article.pec_publshstate NOT IN (3,4) " +
" LIMIT 0,2 ", nativeQuery = true)
List<Article> findOutNotTtsArticle(); | 0 |
6d55c1fb18c981005b9ec50dd4ff9d93 | 1ab7bd54839b215e750d2fab4ddb888c | Gets heat exchanger data ready for doing stuff to it. | class Simple_heat_exchanger:
def __update__(self):
self.capacity = self.EnergyF()
self.outlet_temperature = mainvar.streamlist[self.outlet].T
if mainvar.exergyflag == True:
self.exergy_loss = self.ExergyF()
return | 1 |
6fd9078274f1ba132f940b10cc72591e | a87464bec9f2a5acdcc6faba6f2488aa | Return the structure of the hessian
in coordinate format. That is, return (rows,cols)
where rows and cols are both numpy ndarray
objects that contain the row and column indices
for each of the nonzeros in the hessian.
Note: return ONLY the lower diagonal of this symmetric matrix. | co = self.vhartree_coo(**kw)
if self.nspin==1:
vh = co.toarray()
elif self.nspin==2:
vh = np.stack((co[0].toarray(), co[1].toarray() ))
else:
raise RuntimeError('nspin>2?')
return vh | 0 |
89197ad30bb1c341fbde4a9cf5cb27a1 | 3b66a3775892c818c4201e9bd34a7273 | 按照创建时间降序获取所有用户文章或者某个特定用户的所有文章 | class Article{
getArticles(author) {
let self = this;
const query = {}
if (author) {
query.author = author
}
return self.model.find(query).sort({createTime: -1})
} | 1 |
e298ca60c9f654024ec8e27a9f833f68 | 5d145370bf46d613907f52927d59f6b3 | load game data from file
then insert character selection into variables to be used | int main()
{
load_game();
} | 0 |
2b616ea2c96bfca2d778d6f54abb134c | 3a001fd7d9357fb3b280e15bd16bcde5 | 涂色,返回是否遇到冲突 | {
for (int i = head[p]; i != -1; i = e[i].next) {
if (color[e[i].to] == -1) {
color[e[i].to] = color[p] ^ 1;
Coloring(e[i].to);
if (FAIL) return;
}
else {
if (color[e[i].to] == color[p]) {
FAIL = 1;
return;
}
}
}
} | 1 |
409a7e28ac1c2f348aca979793710fcc | d87a28d7326ccf1211183ee4cfd94e96 | Set the lot ID to the given value, e.g. "ABC1234" | public class RFTId5530 extends SendIdMessage
public void setLotNo(String lotNo)
{
setToBuffer(lotNo, OFF_LOT_NO);
} | 1 |
6575ddbe1b1d9f93945bc3537f08b4c9 | 7a31c42db6fc706529e85f93b73cc0a8 | Returns true if every entry in the database has been added. | namespace RevisionControl
public static class Repository
[StateInvariant]
static bool ValidDatabaseRevisionTail()
{
foreach (Sequence<Revision> changeLog in db.Values)
if (changeLog.Count > 0 && Last(changeLog) != Op.Add)
return false;
retu... | 1 |
2493f1431cdfe2da922c95dccbe7348d | 56df413b9ea63b77023c4e0989bebe49 | [firebase] 친구 정보를 저장하는 메소드 | db.collection("users").document(uid).set(dbUser)
.addOnCompleteListener {task ->
if (task.isSuccessful) {
callBack.onCallBack("success")
}
}
.addOnFailureListener {
}
} | 0 |
27b51b0dc0732cc24dc53203d3022da0 | c6b5a3d662b6bdc9b47c7823331c4377 | Async (event driven) wait for given time period (in seconds) | class Rosie(Robot):
def wait(self, timeSec):
lgr.debug('Waiting for %f second(s)', timeSec)
startTime = self.getTime()
while self.getTime() < startTime + timeSec:
self.myStep() | 0 |
6c51a3c71c8220875ed285968b5a9b2f | 5442c45be7cf02fde5d241a85caacc01 | Выбирает сокет, доступный для чтения/записи и вызывет функции, выполняющие необзодимые действия | class ClientSocket(object):
def start_socket(self):
server_ip = self.ask_sent_ip()
self.connect(server_ip, PORT)
file_adress = self.ask_file_adress()
self.sent_file(file_adress) | 0 |
4c03c025f3e593cae62c70c3c8ffcd64 | 327525ee53655f3a5ab10ea75524fdfa | Learns a linear value function with TD lambda. | class TD(Agent):
def __init__(self, mdp_info, policy, approximator, learning_rate,
features=None):
self._alpha = learning_rate
policy.set_q(approximator)
self.Q = approximator
self._add_save_attr(_alpha='mushroom', Q='mushroom')
super().__init__(mdp_info, policy,... | 0 |
66582a2948a6793b2c563e1264c00920 | 79ec1c18d0fd6111340418fcec63315d | Returns the meta object for the reference '{@link org.example.domainmodel.domainmodel.Feature#getType <em>Type</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getTypeRef_Type(); | 0 |
3e8190b3921fbe62f65bd95f1148535e | 2fe7fefd17f50c5f757b588faf5fc7d5 | Draws the eye, either closed or open with the iris in the current position. | {
int eyeHeight = rightOLED.height()-20;
int eyeWidth = rightOLED.height();
int eyeX = (rightOLED.width()-eyeWidth)/2;
int eyeY = (rightOLED.height()-eyeHeight)/2;
closeEyes();
delay(100);
drawRightEye(eyeHeight, eyeWidth, eyeX, eyeY+10);
drawLeftEye(eyeHeight, eyeWidth, eyeX, eyeY+10);
} | 1 |
ac4edbd22e6b33f25aa8b4caa58f36ae | e5edc61787260027b9255ca90f1b1127 | Function to compare two strings (combined logic of strcmp and strncmp). | int cmplstr(const void *t1, const void *t2)
{
char *v1 = *(char**)t1;
char *v2 = *(char**)t2;
int len1 = strlen(v1);
int len2 = strlen(v2);
if(len1 > len2)
return 1;
else if(len1 < len2)
return -1;
else
return 0;
} | 0 |
22e8331d70d3c2d44e62d1fbc665b7d4 | 98567e0627ab3845dc53f3223a10a400 | Returns true if the command's current result is an array of values. | class ResponseType
public function isArray()
{
return $this->isArray;
} | 1 |
908cdf753b3a987c3aa5da27efa92dd9 | a07cd67725abac042080b0d54845a2d4 | Function to find the smallest number out of three numbers | int min(int num1,int num2,int num3){
int min=num1;
if(num2<min)
min=num2;
if(num3<min)
min=num3;
return min;
} | 1 |
972da019afc16254db66ea3eccf7f7c4 | 78dd1dffe1c3f53e20b0e7ed98e6be1b | This simply redirects users to the site root | def index(request):
return HttpResponseRedirect('/') | 1 |
811a875694a5c31e1e955ff1850766ba | 1e7b185516efd5debd23693bdf71f5bc | Stores a key/values in memcache. If key already exists then it is overridden. | class memcachedCacheHandler implements CacheHandlerInterface
function put($name, $contents)
{
return $this->memcached->set($this->unique_id."_".$name, $contents);
} | 1 |
72087ecd6db37d7fa6e9210f7e1cd862 | 4aa41b47f6cb4b7f7678f6bb8642c859 | 获取 记录抵扣的上限 | public HttpResponseMessage GetEntityLimitAmount(BaseParaDTO data)
{
POSVoucherDetail detail = new POSVoucherDetail();
return httpMessageProcess(detail.GetEntityLimitAmount(data));
} | 1 |
f9388a7e13d3f4dba651367fefad1da5 | 0d4ce11e824a910841a87819a69cb78b | in-place normalize maximum value to be 1. | def norm_to_max(vals):
best = max(vals)
return [i/best for i in vals] | 0 |
f3e372f0580c9ce6a705b5a9ae57d3aa | f241067a27ca0916724186e577c5ff61 | 返回一个大于零小于1的数 | double rand1()
{
return (double)rand()/RAND_MAX;
} | 1 |
83904c605661bbe18934dfd46ab0a550 | ec1db7a32c696914125b375bcaf48905 | поиск замены удаляемому элементу | Note index = headIndex;
if (index == null){
System.out.println("Список пуст");
}
while (index != null){
if (index == headIndex && headIndex.getVar() == var){
headIndex = headIndex.getNextAdres();
break;
} else if (index.... | 0 |
dfbea743de3761982ae4759c3ecbd355 | f117e090a2390c32badda35a9e9791ea | Returns an array of <code>String</code>s recognized as names by this
property source that begin with the supplied prefix. If no property names
match, <code>null</code> will be returned. The comparison is done in a
case-independent manner.
<p>
The default implementation calls <code>getPropertyNames()</code> and
searches... | public class PropertyUtils implements BeanFactoryAware
public Set<String> getSet(String prefix) {
if (properties == null || prefix == null) {
return Collections.emptySet();
}
Set<String>set=new TreeSet<String>();
Enumeration<?> en = properties.propertyNames();
String key;
while (en.hasMoreElements()) {
... | 0 |
23f9fc79d90699afa4a2877daab18562 | caa61f020917cc5b554f129646cf4b32 | updates the program with new information. | function updateData(newData) {
buildPlots(newData);
getMetadata(newData);
} | 1 |
7999d6b04c454a86429d9a0ea370908f | 1b3c6bf6047ba56caab3b4798f658027 | 根据条件更新UserHandleInfo中指定记录<br/> | @Service
@Transactional
public class UserBackUserServiceBaseImpl implements UserBackUserServiceBase
@Override
public int updateByExampleSelective(UserBackUser record, UserBackUserExample example) {
return userBackUserMapper.updateByExampleSelective(record, example);
} | 0 |
1a612f35c4650f4cbc2233ad32b51606 | 354e5233a7473e11401fd021396e366c | Adds cuisines to Cuisine table in DB. | test_cuisines_in_db = []
test_cuisines = get_test_cuisines()
for test_cuisine in test_cuisines:
cuisine = crud.create_cuisine(test_cuisine)
test_cuisines_in_db.append(cuisine)
return test_cuisines_in_db | 1 |
da9061cb5f815557cff8486a563e4027 | 1abda84c9860978873a0781079abdd97 | Only create new document if one does not yet exist | if not doc in self.docs:
self.docs.append(doc)
return True
else:
return False | 1 |
a74730c675c8d624f6db8aa31b43cc63 | 65180247465b13306352706280e160d7 | Returns a dictionary with a bitfield map for each printable character | char_col_dict = {}
for sep in Separators:
char_col_dict[sep] = SEP
for op in Operators:
char_col_dict[op] = OP
for i in range(65, 91):
char_col_dict[chr(i)] = ALPHA
for i in range(97, 123):
char_col_dict[chr(i)] = ALPHA
fo... | 1 |
88820b932dfc8f597e4e6dfc39e6f071 | 096680cb226aa330522610da21732172 | Test that if a Running foreground application is reported to be stopping by Mir, AppMan cleans up after it ok | {
using namespace ::testing;
const QString appId("testAppId");
const pid_t procId = 5551;
ON_CALL(*taskController, appIdHasProcessId(appId, procId)).WillByDefault(Return(true));
EXPECT_CALL(*taskController, start(appId, _))
.Times(1)
.WillOnce(Return(true));
applicationManager.st... | 1 |
969053f2080167804f72f5a2d56078d4 | ba752ffb5d1cb7a04e7073c6fd074222 | 返回消息,如果无消息,最多等待 10秒 | public Message getNextMessage(long timeout); | 1 |
ba577dbdee802b99bf7937472d9b4b60 | f1183d079072c4a6276a4680d55c8071 | 获取localStorage中的用户信息 | function getUserInfo() {
return getLocalStorage("userInfo") && JSON.parse(getLocalStorage("userInfo"));
} | 1 |
07c7e884a00c7b65d893041bac9a622a | 7c6a1b7a44cb48750d695d133c4580d2 | Retrieves a goal information using a specified ID.
Provides the goal information of the goal whose ID matches the
one specified. | namespace Microsoft.HealthVault.RestApi.Generated
public static partial class GoalRecommendationsExtensions
public static GoalRecommendationInstance GetById(this IGoalRecommendations operations, string goalRecommendationId)
{
return operations.GetByIdAsync(goalRecommendationId).GetAwaite... | 1 |
c192a22f19a1c59c887f253c5b75b819 | 60f26ee2279d61a53d96d0340a10aa2e | 获取超级管理员角色名称 | public class AccessControl implements AccessControlInf
public static String getAdministratorRoleName() {
return AppSecurityCollaborator.getInstance().getAdministratorRoleName();
} | 1 |
1b7b9e9bd8cf24f61f56bccb1c96bd7e | 3020185ae147fb9dff9c4b9bddec3484 | 將Json檔轉成assetbundle | AssetData data = JsonUtility.FromJson<AssetData>(_json);
foreach (AssetVO VO in data.assetList) {
assetDict.Add(VO.assetId, VO);
}
Ulog.Log(this, "Asset Json Loaded!");
} | 0 |
11a8930d2cac1c37f74d500396fe1cde | e50a5a4a7a2c4332d1dbbcabf512ee21 | mdファイルのcontentHtmlに<h2>,<h3>があれば、Table of contents用のidを追加して返す。 | export default class Toc
_preMakeHeadings(article) {
let eleArr = article.children;
let headings = [];
let ids = [];
for (let i = 0; i < eleArr.length; i++) {
const currentEl = eleArr[i];
const validHeadingLevel = [];
for (let i = 1; i <= this.options.deep; i++) {
validHeadingL... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.