query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
b86ae8faf9e1d88db9ef6673d031766c | 56468219876cdfcd379332ae5fcc92dd | Lemmatiser une liste de mot | sortie=[]
for sentence in list_of_sentences:
tokens=word_tokenize(sentence.lower(),language="english")
if(stop_words!=None):
filtered=stop_words_filtering(tokens,stop_words)
else:
filtered=tokens
if(stemmer!=None):
stemmed=stemming(filtered,ste... | 0 |
46ab62ec4be17da426918605d000ed4b | 973a4b4939189f7dfd29ad1ea5d56d6c | sets the angle of light to the slide and implicit light-angle animation. | Vec3 lpos = new Vec3(getLightPosition());
tlight.setTransform(Mat4Transform.translate(lpos));
light1.setPosition(lpos);
updateLightPosition(light3, transEdge.children.get(0).getwt().toString());
updateLightPosition(light4, transCenterHead.children.get(0).getwt().toString());
switch(lampState){
... | 1 |
e30be7bc6576c189bb8030437e4161d7 | 1f7de4177ddc0eb501f8cfadf8b3d506 | ressurgimento dos inimigos após morrerem | void reviveGhosts(ghostsInfo *ghostsInfo, int speed)
{
int i;
for(i=0; i < ghostsInfo->quant; i++)
{
if( !ghostsInfo->unid[i].alive && (( clock() - ghostsInfo->unid[i].deathTime) > RESPAWN) )
{
ghostsInfo->unid[i].pos = ghostsInfo->unid[i].origin;
ghostsInfo->unid[i].... | 1 |
6d28a4b83e847a598ce2a9cfc159d498 | f9f1c98cd84e7e97f617cd5159f623e0 | 检查任务是否特定时间刷新(每日/每周) | if(day != this.getRefreshDate()){
this.setRefreshDate(day);
this.baseMgr.task.InitDailyTask();
this.getActionMgr().Reset();
this.getTxFriendMgr().DailyRefresh();
let t1 = Date.parse(this.orm.createdAt.toDateString())/1000;
let t2 = Date.par... | 1 |
5b43a8d84449093e6617549821d1dac6 | f3c0493437fc77395ae3aa05a0c56d9f | Returns the fixing period accrual factors for each sub-period. | public class CouponIborCompoundingFlatSpreadDefinition extends CouponDefinition
implements InstrumentDefinitionWithData<Payment, DoubleTimeSeries<ZonedDateTime>>
public ZonedDateTime[] getFixingSubperiodEndDates() {
return _fixingSuberiodEndDates;
} | 0 |
fd6a986ee14f01c1d43d11619363b3ee | 34b28a8aa5c948e0f9887bbf5cd2c632 | Main method. Takes user input and starts the program. | public class Cipher
public static void main(String[] args) {
userInterface();
} | 0 |
0cece3b841f8fd24db3da03dc4b24b59 | 651e02faf204a02cd1c3c3e7edc2b114 | Функция рисования солнца с переливающимися лучами | def draw_sun(x, y):
arcade.draw_point(x, y, arcade.color.RED, 5)
arcade.draw_circle_filled(x, y, 50, arcade.color.YELLOW) | 0 |
23fba75fd17ad32fbc902df8e84120d6 | fa4bad36782b332f177c53d341012402 | Create a Mesh Renderable Instance for use. | return new Mesh(
new PlaneGeometry(2, 2, 0),
new MeshBasicMaterial({
map,
transparent,
opacity: 1,
depthTest: false,
depthWrite: false
})
)
} | 1 |
5d158428424d26a5e4620df0327937b7 | f310ed9c06c4ef5bc958a77931dabbe9 | Obtiene una lista de comunidades que coinciden con un nombre | ArrayList<Consorcio> consorcios = new ArrayList<Consorcio>();
String sql = "select * from consorcios where nombre like '%" + nombre + "%';";
Statement st;
try {
st = cn.createStatement();
ResultSet rs = st.executeQuery(sql);
while (rs.next()) {
... | 1 |
92e617cddd8b9eec8aaf880dba373137 | 7290b48448956c5c51ce5c4fae6e906f | Merges fields that are equal in this custom tag with the ones in the src
tag. Default implementation does nothing. | @Override
default void fromTag(CompoundTag tag) {
} | 0 |
52423d225622e64d75c6669428dde3ef | fe5a24eef3a512f9350dd8640a64ef68 | Pushes back one character (passed as a parameter) onto *strio* such
that a subsequent buffered read will return it. Pushing back behind
the beginning of the buffer string is not possible. Nothing will be
done if such an attempt is made. In other case, there is no
limitation for multiple pushbacks. | static int richtextgetback()
{
int c;
c = PushbackBuffer[PushbackExtract++];
if (PushbackExtract >= PushbackSize) {
PushbackSize = 0;
PushbackExtract = 0;
}
return(c);
} | 0 |
78f40b87bca6b3139a9603762d85da58 | ea9c66dd0f15a6ac6e1d2177ede849d2 | Sets the labels of protocol navigation bar's button. | @OnThread(Tag.FXPlatform)
public class TeamSettingsPanel extends VBox
private void setProtocol(String protocolKey)
{
String protocolLabel = getSelectedProvider().getProtocolLabel(protocolKey);
protocolComboBox.getSelectionModel().select(protocolLabel);
} | 0 |
c1b132f5ad6b05e2b262be9f3fe814dc | 7a8efd76b751de40aa4c6e887eb4c407 | 숫자를 한글로 표기 | function num2hangul(num){
num = num+"";
num = num.replace(/[^0-9\-]/g,'');
var i, j = 0, k = 0;
var han1 = new Array("", "일", "이", "삼", "사", "오", "육", "칠", "팔", "구");
var han2 = new Array("", "만", "억", "조", "경", "해", "시", "양", "구", "간");
var han3 = new Array("", "십", "백", "천");
var result = ""... | 1 |
750480d27ce6eda35041c8ae6fbc5535 | 8d5c065427353b71640efae6d2b0197b | Calculate and store the log-likelihoods of all subsets of a dataset.
Allows us to avoid recomputation of these when calculating the analytical posterior. | subsets_params = []
for ss, resp_ss in zip(dataset, resp):
ss_params = _estimate_parameters_subset(ss, resp_ss)
subsets_params.append(ss_params)
return _reduce_estimate_parameters(subsets_params, self._arity) | 0 |
e7e0fdcf10e8421212e36b4c77585f7f | 13ff2897dd89b2860b69c031a5569c21 | Tests whether the proper format is returned when castorizing a record field. | test_date = DateTime()
record = {'arg1': [1, test_date, 'str'], 'arg2': 1}
result = complex_marshal([('record',record),])
assert result == [('record.arg1', ':int:list:record', 1),
('record.arg1', ':date:list:record', test_date),
('recor... | 1 |
d54ac88b9aef13e69926007688e5fef4 | f2184fb3b6594eab12591bd08670f957 | Copy any file / directory from the device to the host | class VMrun(): # pylint: disable=too-many-public-methods
def copy_file_from_guest_to_host(self, guest_path, host_path, quiet=False):
return self.vmrun(
'copyFileFromGuestToHost',
self.vmx_file,
guest_path,
host_path,
quiet=quiet) | 1 |
2a648fdcc86023da6d3f54d45032474c | cbd506733ff13552ff5dcd88b9456b70 | Tests validation for matching of OR constraints, type constraints, and attribute value constraints
on dependency requirements. | public void testComplexConstraints() {
assertNotValid(
":Employee rdfs:subClassOf\n" +
" [ a owl:Restriction ;\n" +
" owl:onProperty :works_on ;\n" +
" owl:someValuesFrom\n" +
" [ owl:unionOf (:Project\n" +
" ... | 1 |
dd8cd38209a6f815252fe295a2245eac | 4e9c07994ad5779570d1149dbbedb0d5 | HTTP sessions are initiated by the server. | class MyHoneypot(asyncssh.SSHServerSession):
def session_started(self):
return True | 0 |
54513aea0bb8780d7c8b797d3ad62767 | efb10f225945ac3a12481049e98b1c77 | Checks if edge is a transfer edge | out_node_key = edge[0][0]
in_node_key = edge[0][1]
return mpi_nodes[out_node_key]["host"] != mpi_nodes[in_node_key]["host"] | 1 |
d7e9f73b7cddbaed597a66fa7ee6b424 | d4180d7b3cec3032ab8c29c5ee0fc845 | Returns a JSONArray of the amount of items in the Sprint Backlog every day | public class DBAccess
public AsyncTask<Void, Void, List<Integer>> perDay() {
return new getPerDayTask().execute();
} | 0 |
b52b1b21e40f87d759469d6e04f693e1 | f150d83b15d5dd108632bf849dfddbaa | It sets the peer matching status after that the 1st port has matched. | static int
port_peer_oper_sync_msg_prepare(struct mlag_port_data *port_info, void *data)
{
int err = 0;
struct peer_port_oper_sync_message *oper_sync;
oper_sync = (struct peer_port_oper_sync_message *)data;
if (port_peer_state_get(port_info->peers_oper_state,
oper_sync->mlag_... | 0 |
434ddd4844cf6695c9181231072529f4 | 23ec527bdef818cb73bc9ae5b8f32c5c | Returns the amount of mass in a 1 sq cm column of air above a height given in km | constexpr double gamma = 1.4;
constexpr double gas_constant = 287.05;
return sqrt(gamma * gas_constant * getTemperature(altitude));
} | 0 |
9ac414a7245a2d78ba8fcd4e123929eb | aea24600db27a2e6c8b1df5979f667bc | List the active conversations under a particular campaign. | class Campaigns extends \SoapClient
public function aList($parameters)
{
return $this->__soapCall('List', array($parameters));
} | 0 |
54053230fb925d63cdb9fd78feebba39 | ceb121c75708510f6d5a9c471884e6c0 | Tests whether all elements in given list are distinct or not.
(Please implement it using hashing as in lecture slides.) | def is_unique_list(li):
remaining = [elem for elem in li]
while remaining:
if remaining[0] in remaining[1:]:
return False
else:
remaining = remaining[1:]
return True | 0 |
27834d2103cd5b9bdcf76234a9130ecb | 736164a6d55451aceb0e0b1637db2fb7 | Retorna o objeto subtraindo a quantidade de segundos passado no parâmetro | class CDateTime extends ObjectConnectAdapter
public function sub($seconds) {
$this->fromTimestamp( $this->toTimestamp() - abs($seconds) );
} | 1 |
985b3a753fb22f375a5e76bff70aaf05 | c9a510ee276a35ddf00ff00f80cb6f8c | Metodi asettaa Choicebox:lle valinnat. | int tulkitseChoiceBox(ChoiceBox cb); | 0 |
72eeaa0d96b1a7eb1ae4d99eabf3a804 | 237825d0339d3f4e2943b4457d211ec5 | Envio de Notas Credito Boletas Detalle para Peru | public void executeInterfazIMPEnviarBoletas067CabeceraPeru(Map criteria); | 0 |
6bc0e4125d0b84f27e3360ce4ec833e3 | f6c036c64213698bfa0d13714537ba11 | 测试网关设备id为空 | payload = {'userId':'566453','machineCode':'AA58FE7016CBECD8D3B5CCC9AFA0C915','id':'','type':'1'}
r = requests.get(self.base_url,params = payload)
self.result = r.json()
self.assertEqual(self.result['errorstr'],'参数不能为空') | 1 |
3b00f30652a90e18bf6e4c21ac39001b | ce29e296618eb1ab198e06b895f7d022 | Recupera o saldo de gols do time 1. | public class ScoreManager
public static int getGame1Score(){return game1Score;} | 1 |
e9ae66d20a65aba55ee9a2f7337f2504 | 0dc96c2e4aebb58a9cfbe3670b886a17 | 显示更多公告 | function showMoreAlertInfo() {
openWindow("../../BI/JobEarlyWarning/VMyJobEarlyWarning.aspx", 800, 600);
} | 0 |
0a1362d1ed6cd7616a0989f7fc4486f9 | f6f0570e645e0f9a7926096e25dedbcf | Function that request Github API to get self-hosted runners status | try:
response = requests.get(url="https://api.github.com/search/repositories",
params=params)
if response.status_code != 200:
raise Exception()
return response.json()
except Exception:
raise FailedGitHubR... | 0 |
71d551e9ba261f2351c00f0dbd3f745f | e9ed485728f00466be54f4140ef23fe8 | Check the checkbox having for given selector this given locator | boolean isChecked(String locator); | 0 |
a00841bf5c6eaa290bed6d7c751c13be | 356cdead35757282a920fbe28059c363 | Returns true if the time entry is closed (i.e., returns false for entries which are still in progress) | {
return ($this->status === 'Closed') ? true : false;
} | 1 |
03cf365684e8820fa169434a72a11c57 | e4a1e21ff22cd9fc106ee7f7a00af984 | 获取用户绑定的CD账号的异常情况,如token过期之类 | if(empty($uid))
return [];
$priceministerAccounts = SaasPriceministerUser::find()->where(['uid'=>$uid])->asArray()->all();
if(empty($priceministerAccounts))
return [];
$accountUnActive = [];
$tokenExpired = [];
$order_retrieve_errors = [];
$initial_order_failed = [];
foreach ($priceministerAccount... | 1 |
b171c94caa00904a5378ea4e49511ee6 | c7f6229c63a446df8e4558f2b626c750 | *( [ obs-fold ] WSP )
# The OWS (optional whitespace) rule is used where zero or more linear whitespace characters MAY appear | class Lambra::Parser
def _sp
_save = self.pos
_tmp = apply(:_space)
if _tmp
while true
_tmp = apply(:_space)
break unless _tmp
end
_tmp = true
else
self.pos = _save
end
set_failed_rule :_sp unless _tmp
return _tmp
end | 1 |
d2c8178cc7e2cbb4366b7c778b677cc3 | 293d09e1a05efc87968b99ec26d4fcb1 | 通过redis锁处理数据 | class ShadowController extends BaseController
protected function getRedisData($key, $is_lock = 0)
{
if (0 == $is_lock && !Redis::exists($key)) {
return false;
}
$s_value = uniqid();
do {
$s_lock_key = 'lock:' . $key;
if (Redis::exists($key)) {
... | 1 |
3700c71244c0d6f260a01c7488a933f1 | 514b666818afa895d682b6a3b1e00b45 | #用均值代替缺失值 | function(SNP) {
m <- ncol(SNP)
miss <- is.na(colMeans(SNP))
for (i in (1:m)[miss]){
SNP[is.na(SNP[,i]), i] <- mean( SNP[!is.na(SNP[ , i]), i] )
}
return(SNP)
} | 1 |
7e47182fba99eac98b0a680913ed8840 | a265cb5627336462d252d4a6727bda1e | 通过框架ID查询 | @Service
public class RisksService
public List<Risks> findByFrameNoAndCompanyId(String frameNo, Integer companyId) {
return risksMapper.findByFrameNoAndCompanyId(frameNo,companyId);
} | 1 |
438902ef94996d3c0ef6e11a82f68180 | 82beb441809ce058a84eb0e124fc73cf | 单向链表倒数第n个节点 | public class MyLinkedList<E>
public E getLastN2(int n)
{
isElementIndex(n - 1);
Node<E> former = head;
Node<E> back = former;
int i = n - 1;
while (i > 0)
{
back = back.getNext();
i--;
}
while (back.getNext() != null)
{
... | 1 |
1643b641de15c2c2864288facecd8640 | e49c7f6f5cf9d3d4df57f705d33b47d5 | 申请实验室 | header("Access-Control-Allow-Origin: *");
$date1 = $request['student'];
for ($i=0;$i<count($date1);$i++){
$validator = Validator::make($date1[$i],[
'student_name'=>'required|max:18',
'student_id'=>'required|max:200',
'student_phone'=>'r... | 1 |
82535d4c1c44bafb927ca15a65dbd6ff | 8ae85cc54cc2ecf36bd9a6e05c565d0c | Returns AGV Charge in %age | res = 0.0
for i in ChargeSA:
if abs(float(i[1])) >= 0.2:
res = res + i[2]
return res | 0 |
f134e32aec883fbf9b8e269ab2844558 | 33cd765b70536b66dc42f126d5f50192 | Create a dictionary of wheel parameters. | class WheelLoaderL70(WheelLoader):
def default_tire_settings(cls):
return Struct(
{
'stiffness': {
'radial': 2.0E6,
'lateral': 4.0E6,
'bending': 1.0E6,
'torsional': 1.0E6
},
... | 1 |
60fb61befec45f6fe87d80ecbcb84424 | be78271b7ddd90b1f215b0eb0c1ec914 | assumed to be acceptable. | public class AlphanumericSpecialContentTypeHandler implements ContentTypeHandler
@Override
public boolean contentIsValid(String data) {
return true;
} | 1 |
0f79dfa93b01fde4a3681c5ca6600239 | 8cec75d1358c5d81a9cc7359472a5ed2 | 取消订单:完成的订单不能取消 | instance = self.get_object()
if instance.status == 'CANCELED':
raise exceptions.ValidationError('订单已被取消')
elif instance.status != 'TO_PAY':
raise exceptions.ValidationError('无法取消该订单')
instance.status = 'CANCELED'
instance.save()
if instance.coupon_... | 1 |
5030b966b7542070809cdba48cb36cb7 | a3bb85fa890b32d86c7c87519b412bd0 | Remarks:
-filter packets by looking at packet's uuid, store if new | def filtered(f, newlist):
if ' 0 packets input' in f:
del newlist[-1]
return True
else:
newlist.append(f) | 0 |
efbe5f09e97e413cb1879d7415f34bdb | d3f1690db0d44868e3350124115a189b | 装備箇所(アーマー)の装備変更画面を呼び出します。 | class Game_Interpreter
def command_319
actor = $game_actors[@params[0]]
actor.change_equip_by_id(@params[1], @params[2]) if actor
end | 0 |
2a6198a59c427f7caf40594950b3ce08 | 54a28ddee32bf917a09f70a78f14a785 | Тест именованного фильтра "attribute", где атрибут типа float
Тест-кейс проверки условия фильтрации Less | namespace Visiology.DataCollect.Autotests.API.Tests.Dimensions.Put.v1
[XApiVersion("1.0")]
public class ElementsTests : BaseIntegrationPutTests<ElementsListDto, ElementDto>
[Fact, Trait("Category", "Dimensions")]
public async Task Update_WithNamedAttributeFilter_ForTextAttribute()
{
... | 0 |
b9ce7ff68f46424f5c71ab7836e42736 | 55793653d4f6989ffb6eca190cccefac | Metode til at udelukke muligheden for at gå tilbage. | public class MainView implements FxmlView<MainViewModel>
public void turnback() {
viewModel.turnback();
} | 0 |
df65fc8c12cac3da025187946503e05a | 0e9c06fa066ecfc3d34826c0c17f910b | Instantiate CSVFile object as a setup for every test. | class CSVTests(TestCase):
def setUp(self):
self.log_processor = LogProcessor()
self.log_processor.log_file = tempfile.mkstemp()[1]
self.log_processor.csv_file = tempfile.mkstemp()[1] | 0 |
de1780cfef8f7d236aa346bc630d60a3 | efc0599c1da77445691bd825e19162db | 从右往左查找字符串在某个HTML文本片段中出现的位置 | Matcher matcher = getMatcher(text, Pattern.compile(regex));
int endIndex = -1;
while (matcher.find()) {
endIndex = matcher.start();
}
return endIndex;
} | 0 |
a10b43157e9f5d16f62136d9c1d2c2cc | 10b4bcf33923ddfc02129668a768812e | Constructor allocates the global memory to store the registered guid and Handler list. | {
AllocatedHandlerListLength = HandlerListLength = INITIAL_LIST_SIZE;
HandlerList = SingleHandler;
SingleHandler[0] = DefaultHandler;
return STATUS_SUCCESS;
} | 0 |
7068c8b04ff095e9efd70756d3aedc7e | 33ba1dcef88722ef7bb2ff6651f8644b | 输入域名去空格限制 | if(!empty($sitename)){
str_replace([",","-","_"],["|","|","|"],$sitename);
$arr = explode("|",$sitename);
if(is_array($arr)&&!empty($arr)){
$sitename = end($arr);
}
}
return $sitename;
} | 0 |
76018b64a737a3743df70c182bb34704 | 2833ec1fb480e9f56d73dd41c58bfbc6 | 红黑树修正函数,删除节点后调用 | class RBTree:
def delete_fix(self, node):
while node != self.root and node.color == BLACK:
if node == node.parent.left:
_ = node.parent.right
if _.color == RED:
_.color = BLACK
node.parent.color = RED
self.le... | 1 |
e9dd9c288e44883118e8e11b00aed228 | 1f4f433adf73bdd03cbcef9ca9bcf973 | 計算平均每日銷售金額(AD),傳回值 AD 為一個數值 | class Indicator(object):
def AD(high, low, close, volume):
return talib.AD(high, low, close, volume) | 1 |
72b560fe6d6616b6da8f265392248746 | 7deecce226ecb3edc5acdc751e1213d0 | Returns the Incomplete Gamma function. | double Incomplete_Gamma(a, x)
double a, x;
{ double tiny = 1.0e-10;
double t, sum, term, factor, f, g, c[2], p[3], q[3];
double Ln_Gamma();
long n;
if (x > 0.0)
factor = exp(-x + a * log(x) - Ln_Gamma(a));
else
factor = 0.0;
if (x < a + 1.0) {
t = a;... | 1 |
8822bb175043b197520439326c1e4d71 | 2544c5a0fa6c337f8195449dcc7b667b | get the Sale Order Lines having no timesheet but having generated a task or a project | namespace lntechNew.Components
public class ValidationReports
public DataTable GetNoLORReport()
{
return clsdb.Get_DT_BySPArr("USP_HTP_Get_NOLOR");
} | 0 |
7aa8e01fc8fd62e02504dd7d54b75e64 | fd57de9e86573aca744ed4b864697a39 | 清空对白数据 | export class TalkCache
public static clearTalkList() {
TalkCache.talkMsgList = [];
} | 1 |
3f311e0b602548cb683873e983d5b90a | 6da26b429d36177390012f4392bfe0b6 | Disable the interrupt
Returns 0 if successful, or nonzero otherwise | int caribou_uart_int_disable(int fd)
{
int rc = chip_uart_int_disable(caribou_device_of(fd));
return rc;
} | 1 |
03d129e86586c4d9afa909871447a354 | 35eed4c6b3cd7eb8785ae166198f17fc | Получить статистику пациентов по продукту мониторинга из РГС и датам | class MonitoringView(Resource):
def fetch_by_patients(self, json_request):
return None | 0 |
9f8cb00186a297cfce277508531529a3 | e89b355dbf2bcd720784a77a0f1da29a | Generate button that will prompt user to select one of their chats | $opts = sc_chat_get_options();
?>
<input type="text" name="sc_chat_opts[chat_btn]" value="<?php echo $opts['chat_btn']; ?>" style="width:150px"/>
<?php } | 0 |
4f53f98ccd69e4aec5646701e135c34f | 9d9fe060894696c626a087e5a03149b0 | 获取格式化字符串,带毫秒,格式:yyyy/MM/dd HH:mm:ss.fff | public class Moment
public String formatDateTimeMs() {
return getFormat(DATE_TIME_MS).format(calc.getTime());
} | 1 |
0308ea9ad836023f287ed6e12b93c611 | 5455cf23a7f237ddb22200b3bbc8f19a | [internal] Removes dead QProcesses. | remove = list()
for proc in self.processes:
if not self.processes[proc].alive:
remove.append(proc)
for remItem in remove:
del self.processes[remItem] | 1 |
bc3d8e6b39397f3a69da53cafee5ed3f | 00058ccd173b60cb75fdbd8704c05136 | Constructs a new <code>ParameterizedHeader</code>. | abstract class Builder<T extends MediaTypeHeader> implements SipHeader.Builder<T>
public Builder<T> withParameter(final Buffer name, final Buffer value) throws SipParseException,
IllegalArgumentException {
this.paramSupport.setParameter(name, value);
return this;
} | 0 |
07c9fa4c9a1f5b07aaeaf93ba182aa2a | 679538a9d14e43046a5c81c35fc2f435 | Produce a list of all publically available projects and the private projects the logged in user is a memeber of | def GetAvailableProjectList( arg_user ):
if ( arg_user is None ) or ( not arg_user.is_authenticated ):
q = Project.objects.none()
else:
q = GetMemberedProjectList( arg_user )
return (q | GetAllPublicProjectList()).distinct() | 1 |
8186ca46f2072e94591dc5794804ff5c | eeb132c39eebcfe8075361aeafa46795 | Ensure that recursive filter works as expected, getting all indirect parents/children
of the selected table(s) | parent1 = ManyToManyParent.objects.create()
parent2 = ManyToManyParent.objects.create()
child = ManyToManyChild.objects.create()
parent1.children.add(child)
parent2.children.add(child)
self.assertEqual(
child.parents.all().count(),
2
)
... | 0 |
3f7f52a3ac9e324da5bb1c602a2d95da | 5d869920ca2c95160fd82a66443676bf | Creates an animation bundle for an Activity scale animation. | public class StartAnimationActivity extends AppCompatActivity
public void onCreate(Bundle saveInstanceState) {
super.onCreate(saveInstanceState);
setContentView(R.layout.activity_scale);
as = new AnimationSet(true);
as.setDuration(1000);
AlphaAnimation aa = new AlphaAnimation... | 1 |
7341ddf0e2b74e040964e6d40ce37517 | dd52f26d325c35eb6ac08ec55bf22511 | 还原货品库存。 | namespace FuXi.PSI.Core.PurchaseOrders
public class PurchaseOrderManager : FuXiDomainServiceBase
public void ReturnStock(int purchaseOrderId, int productId, decimal quantity)
{
var purchaseOrder = _purchaseOrderRepository.GetAll().Include(a => a.PurchaseOrderItems).FirstOrDefault(a => a.Id == pu... | 1 |
5b86d1f7790d2b734d49a8e0e141b6d0 | 3f837563b3f809427105638259c7635a | Returns the guid of the album module as assigned by the database | val = self.__item__.albumPersistentID
if val is not None:
val = str(val)
return val | 1 |
9f76955d6f156c681c2e890024bcad09 | 7ed7289ceca8a660a50f38acdeef3c67 | テクスチャデータを取得します。
テクスチャデータの読み込みはResourcesフォルダ⇒外部データの順に試みます。
外部データ読み込み時はラップモード=固定、フィルターモード=ポイントを設定します。 | public class JavaETC1Util public static class ETC1Texture
public ByteBuffer getData() { return mData; } | 0 |
3a34dfa638861db99f3c5a3199b13322 | 41ba7667d664a1f08d9ddd6a2cc94c46 | Calculate slip factor with Wiesner's formula. | A = (2.*Mw*sigma_w(T))/(R*T*rho_w*r)
B = (3.*ns*Mw*nu)/(4.*np.pi*rho_w*(r**3. - r_dry**3.))
return np.exp(A - B) - 1.0 | 1 |
efba4f1a8b1de65eba416a889ae41824 | 5e7da39df8daeded03a2446f9fe8097a | Determine whether strong mode for angular spring is enabled. | class Spring
def strong_mode_enabled=(state)
MSPhysics::Newton::Spring.enable_strong_mode(@address, state)
end | 0 |
f1057712d515ccaa6bc90602284a7ac3 | 1106697252155082efba8c164777e7ed | Load IATA codes from the IATA codes file | class RegistrationCode:
def load_registration_codes(cls):
cls.registration_codes = tools.get_data_from_file(cls._file_name, RegistrationCode) | 0 |
d9dcac75eafb3c728b35ae61f381cbc3 | 8702d438e4f4669e31b68f60ee3ffec2 | (str, str) -> str
Return a new string containing all characters from s1 that appear at leastonce in s2. The characters in the result will appear in the same order asthey appear in s1. | for i in s1:
if i in s2:
return 'YES'
return 'NO' | 0 |
02c48b0e717cf94ab1548ad03ced97ba | cd20476672d3aec899a4b1b5dea01c71 | Sets the path to the source HTML files | function setHtmlPath(_path) {
htmlPath = _path;
} | 1 |
5f747332f0d44620e778029bc00599b2 | 72d4c9ad20bf17d28a6884d745ba1f84 | Appends and returns a new empty value (as xml) as the last "Blast4-error" element | {
synchronized (monitor())
{
check_orphaned();
gov.nih.nlm.ncbi.www.Blast4ErrorDocument.Blast4Error target = null;
target = (gov.nih.nlm.ncbi.www.Blast4ErrorDocument.Blast4Error)get_store().insert_element_user(BLAST4... | 1 |
455a6bfb9f3cb931ca59649119b0762d | eb8e40a08eb67a43634114da3adcd373 | Fractional Fourier Transform | def FT_2D(img):
N, M = img.shape
result = np.zeros((N, M), dtype=complex)
for k in range(N):
for l in range(M):
for m in range(M):
for n in range(N):
result[k, l] += img[n, m] * np.exp(-2j * np.pi * ((l * m / M) + (k * n / N)))
return result | 0 |
67fd7d36acc00e29bc015c43c31caa7a | 473c88ddb8f5932a800834db416a8e95 | Set the work factor for bcrypt | self.pw = credentials({
work: self.options.insecurePasswords ? 0.01 : 1
});
} | 1 |
279f82c79fcb4b38e11876760fc9101f | cac4713ea3596b00d6d5306f7956b9d0 | 前天流水 | function m_index_yesterday_type(&$mysql,$webid){
$date = date('Ymd',strtotime("-1 day",time()));
$res = table_total_day_date($mysql,$webid,$date);
return $res;
} | 0 |
5d04367360f2cb3914371715f0cca9fd | 35a38f14ba0a5e3b71633489df886367 | Computes the load factor of a hash set. | public class HashTable<K, V> implements Iterable<V>
public double loadFactor() {
return size * 1. / hashCount;
} | 1 |
53a19fdcdd9ff63cca33819e26702c61 | 7c4813ca6bd632cdf60dd927285a25d5 | Test of getUsed method, of class UsableItem. | public void usedItem(); | 0 |
90a0784ffd04ff3ac411721bb0cca9b9 | 18815e8ab404312f966253569d001c45 | Function to update the progress bar to pick up an item. | def makeReadProgress():
global readProgressBar
readProgressBar["value"] = readProgressBar["value"] + 1
root.update_idletasks() | 1 |
6c688b8402f70ff2ab494438dacec6a7 | effd99b248803842dbe8e93df67e41b5 | Group all param filter_ to array. | {
$formvars = [];
foreach ($this->filters as $k => $v) {
$formvars[$k] = is_array($v) ? end($v):'';
}
return $formvars;
} | 1 |
cda46f9f7899dc819844fe5ed17ab44a | 9657f1f7d0ace91c33a0fefa52f4eb89 | Gets RELOAD value | class Fetcher
private function parseReload()
{
$regex = "/(?<=RELOAD = )[$\\S]+/";
preg_match_all($regex, $this->contents, $matches);
$reload = $matches[0][0];
return $reload;
} | 1 |
e2ec57d40133bc7cf9d1029f7a410d03 | 211e7ac4fdd809f0fb99cec1636c705b | Bottom up, return all children to rest | last_nonleaf = self.get_parent_index(self.size() - 1)
while (last_nonleaf >= 0):
self.restore_subtree(last_nonleaf)
last_nonleaf -= 1 | 1 |
bc7630e266aff5ee7d0980809d0633fa | 82d4e7bcc09e5dbb02670d1a645c6c24 | 良仓的商品信息,抓取某一个分类下面的商品 | def goods_list():
url = ConfigYaml().get_conf_url() + "/categories/115/skus/"
json_data = {"page": "1", "page_size": "10", "ordering": "create_time"}
res = requests_get(url, json=json_data)
print(res) | 1 |
c0f9e9379b686fa52e15ba621f647cb9 | a4a441eebef28eb064afc004d307cacc | Using values stored in the Lid and Ldur slots, call the LED Board and
request that LED # Lid be turned on for Ldur seconds | if (flashStatusText.get() == "Flash"):
input = str(int(float(ledOnTimeInput.get()) * 1000))
while (len(input) < 7):
input = "0" + input
print("11_" + input + "\r\n")
ser.write("11_" + input + "\r\n") | 0 |
b97e28b2511f82f57cf2ea45c8f12397 | be6172c0089c5245e46f6211bcb9a156 | 布局每行的view到当前容器里 | public class FlowLayout extends ViewGroup
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int lineCount = allLines.size();
int curL = getPaddingLeft();
int curT = getPaddingTop();
for (int i = 0; i < lineCount; i++) {
List<View> lineViews ... | 1 |
ea29f4ae3703738e259c8ffcd7d38442 | 813b39b73bb1459c939dd14d7f382627 | Export values from the record's association. | $type = $this->getType ();
if ('reset' == $type || 'image' == $type || 'button' == $type || 'file' == $type) {
return null;
} else {
return parent::exportValue ( $submitValues, $assoc );
}
} | 1 |
118c337df0c7dcf983271ba7caece94b | b928f7f32274090befba6ea835473d89 | Gets a hash code for a <see cref="Unit"/>. A constant. | {
return Value.GetHashCode () & this.Unit.GetHashCode () & this.TextColor.GetHashCode ();
} | 0 |
f078d10d5455dbcd412747aea9f8a693 | 7d825efbab56f99bcb6f39776ffa5961 | Remove all the current fill styles. | class Style extends WriterPart
public function allFills(Spreadsheet $spreadsheet)
{
$aFills = [];
$fill0 = new Fill();
$fill0->setFillType(Fill::FILL_NONE);
$aFills[] = $fill0;
$fill1 = new Fill();
$fill1->setFillType(Fill::FILL_PATTERN_GRAY125);
$aFills[] = $... | 0 |
d1e2e81026a71aab9b13b057742ae9db | 7f61448ad6da3ef0f9cb03f40c5be655 | Do the transformation | cases like (1) | 0 |
154e83870e926c2eb246ded62c1e038c | 3a14b2245b02e4a32d3301a8b4f9ccd6 | 根据类型获取前5个产品 | final class GoodsModel extends CommonModel
public function getRecGoods($type) {
return $this->where("is_sale=1 AND {$type}=1")-> limit(5)->select();
} | 1 |
452cd2b48d67d1c5e24cf7a025ee829f | 851416f825aea8bbcbd6bc87d7afc090 | 특정 노트에대한 새로운 태깅 생성 | try {
let tagging = new Tagging.Entity();
tagging.action = action;
tagging.type = type;
tagging.var = (valueTitle ? `${valueTitle},` : '') + value.replace(/,/g, '_');
if (this.router.url.indexOf('view/intro') > -1) {
tagging.module = this.layoutService.iaCodes.introIaCode;
} else if (this.router... | 1 |
8fd61e8d766bdba65a0404eceb759c76 | 939b5b4fda31236eb25a01c0c0c3d8eb | Gets longConnectEnable
是否支持长连接,0表示不支持,1表示支持 | class RedfishBase(HttpClient):
def set_long_connection(self, is_enable=True):
self._long_connection = is_enable | 0 |
a0bf385e1b7f9dff700e794f388099d3 | 5bf4806758374a49fb8be23401b6bad3 | Given a string sort field, get the enum field value.
On error, -1 is returned.
On success, the enumerated field value is returned. | {
$value = (int) $value;
$name = __METHOD__ . '_' . $value;
if (!Registry::has($name)) {
$ret = $this->getByPk('field_name', $value);
$fieldName = ($ret['err_no'] !== ErrorNo::SUCCESS_NUM) ? '' : $ret['field_name'];
Registry::set($name, $fieldName);
}
return Registry::get($name);
} | 0 |
8fc457339a6acedb1ee7cbd11a9fa766 | d61501ce57262633d77e70ff2de70fb7 | Dispatch to the right visitor case in the post-order walk. We know
that the operands have already been processed and are valid. | if (node instanceof MethodCall)
{
return visit((MethodCall)node);
}
else if (node instanceof Slice)
{
return visit((Slice)node);
}
else if (node instanceof Usage)
{
return visit((Usage)node);
}
return null;
} | 1 |
8696de282d79644a28632d36e51e8934 | a5f47d633e170ba315cbf6d6cc0657e3 | 测试 Xml 装饰者。 | public void RegisterNotXml()
{
_container.Register(Classes
.FromThisAssembly()
.Where(type => type == typeof(AB))
.WithServiceAllInterfaces()
.LifestyleSingleton());
var a = _container.Resolve<IA>();
... | 0 |
399e60e6fe827773026d3f8498927668 | 041b3426f6d913d26550450b2385ba89 | Поиск контакта по имени и фамилии | public List<Contact> findByFirstNameAndLastName(String firstName, String lastName); | 1 |
e5d6b6b31cb66022589ea1458df0bf7d | c17bfbc949112d0ea742b5b74530d2b1 | Returns multilanguage template found by user languages. | namespace NailGun.Objects
[Serializable]
public class MLS : MultiLanguageString
public string GetMultiLanguageString(bool shortCodes, bool removeEmptyTags, params string[] languages)
{
StringBuilder ret = new StringBuilder(1024);
foreach (string language in languages)
... | 1 |
f27e3bc02e106b9ec440577c2c31e92f | c7a79956490ce3c3a91a60fb3ab89def | function for conversion from Decimal to Octal | long int DecToOct(long int n)
{
int octalNum[100];
int i = 0;
while (n != 0) {
octalNum[i] = n % 8;
n = n / 8;
i++;
}
printf("\nOctal Number = ");
for (int j = i - 1; j >= 0; j--)
printf("%d", octalNum[j]);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.