query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
293d310415c8269a4861a1750a9b90eb | add3dc8222c92e002a54048b59f2b4fe | Get dictionary for node checks. | pdict = {}
for a in node.__dict__:
if not a.startswith( "_NodeMixin" ):
pdict[a] = node.__dict__[a]
return pdict | 1 |
22cceeb7f886134a9abf4040d755750b | 985fbdd34b8a6d2c3370f714307e2032 | Determines whether a content spec tree represents an "all" content model | if (xsType instanceof XSComplexType) {
XSComplexType complexType = (XSComplexType) xsType;
XSContentType contentType = complexType.getContentType();
if (contentType != null) {
XSParticle particle = contentType.asParticle();
if (particle != null) {
XSTerm term = particle.getTerm();
if (term ... | 0 |
6d156479b3a6376581765bb63102d1c2 | 4d9fc55d3b67ad1001b7ea19b03ee078 | returns how many terms make up the current sum | def get_term_count():
return 1+sum_end-sum_begin | 1 |
af3ae20f3319e7daa94b2187ded0e417 | 781d009da97a631798a1c497064e1854 | 判断请求是否来自gateway | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String token = request.getHeader(RainbowConstant.GATEWAY_TOKEN_HEADER);
if(StringUtils.isBlank(token)){
RainbowUtil.makeJsonResponse(response, HttpServletResponse.SC_FORB... | 1 |
cc9845cfee494da7cd266ba8cb9609e1 | 36bf2e657d90bcc63c7ce302b003a3b6 | 非阻塞的TCP连接. | conn, err := net.Dial("tcp", addr)
if err != nil {
return nil, err
}
return conn.(*net.TCPConn), nil
} | 0 |
48be06afd3f6139b343d5c121d4f4389 | dcb1f8b7688daa5434acd2634d3b0739 | 添加列表到队列的最右方 | public Long addList(String key, Object... obj) {
return redisTemplate.boundListOps(key).rightPushAll(obj);
} | 1 |
3894cc321c052f0b2d0e516edf6857b5 | 131c50e1aa221e04defae65ca07473d1 | uses the callback to inform the controller a new contact was created | {
CEvent Event;
Event.eType = EVENT_CONTACT_ADDED;
Event.hContact = (HANDLE)wParam;
CAppletManager::GetInstance()->HandleEvent(&Event);
return 0;
} | 1 |
037cc5b03858c3093e2a47ab9551c554 | e92b8eab2426c1b9bcaa2250d75ab3c3 | 音楽を一括取得 | {
return Request(new MusicApiConfig.Detail { FormData = new { ids = string.Join(",", ids).AddBrackets() } });
} | 1 |
d1b3c85c30aea1b7b0cdab4f58b794ce | 6aa1f8b1ec2e74cb6036b340ecced960 | counting sort(stable):
time complexity: O(k + n)
space complexity: O(k + n) | void countingSort(int arr[], int n, int k){
int *counters = new int[k]();
int *results = new int [n]();
for(int i = 0; i < n; i++)
counters[arr[i]]++;
for(int i = 1; i< k; i++)
counters[i] += counters[i-1];
for(int i = 0; i < n; i++){
results[counters[arr[i]]-1] = arr[i];
... | 1 |
543912855ac9f905bb66df5d4c7852e6 | 93d79c86a6470f1065b76962978b7c10 | Iterates the all clauses to check if all of them are satisfied. | class Formula(object):
def unsat(self):
for c in self.clauses:
if c.unsat():
return True
return False | 0 |
5c4d7ac65cd320b293e82f81c63b17a5 | 07e31cae4120d31bcb090c1d49035b81 | @brief ads8688 chip-select function(active low logic). | IO_SET(ADS782X_PORT, ADS782X_RC);
if (ch & (1<<0)) IO_SET(ADS782X_PORT, ADS782X_A0);
else IO_CLR(ADS782X_PORT, ADS782X_A0);
if (ch & (1<<1)) IO_SET(ADS782X_PORT, ADS782X_A1);
else IO_CLR(ADS782X_PORT, ADS782X_A1);
IO_CLR(ADS782X_PORT, ADS782X_RC);
} | 0 |
aa9d7973f9c6fe749d7f19dd49ddb224 | d8a5509f84f46175d0809dde56803186 | <para>Restores a minimized (iconic) window to its previous size and position; it then activates the window.</para> | {
var succeeded = TryActivate();
if (succeeded == false)
{
ThrowExternalExceptionForLastError(nameof(SetForegroundWindow));
}
} | 0 |
940821eb59e45554ee3e7d85c1d2564b | 44cb13099033bb2e4cf321cd69d56795 | Combine and write the PL CONF MSI Controller Upper Address
(RC-mode MSI receiver) register | (
CSL_PlConfRegs *baseAddr,
pciePlconfMsiCtrlUpperAddressReg_t *swReg
)
{
uint32_t new_val = swReg->raw;
pcie_range_check_begin;
pcie_setbits(new_val, CSL_PLCONF_MSI_CTRL_UPPER_ADDRESS_MSI_CTRL_UPPER_ADDRESS, swReg->msiCtrlUpperAddress);
baseAddr->MSI_ADDRESS.MSI_CTRL_UPPER_ADDRESS = swReg->raw = new_val;
... | 1 |
e8ef78c399732c29db5e7881c5698717 | 0d34b7cfcc00e53d81ba61b3ffe64055 | If a numpy obj of the name given exists, then load it and return the data, otherwise it runs call_func(), saves it
to the cache dir, then returns it. | try:
key = str(cache_key(*args, **kwargs)).encode('ascii')
except DontCache:
return func(*args, **kwargs)
hashed_key = hashlib.sha1(key).hexdigest()[:8]
filename = os.path.join(
cache_path or CACHE_PATH,
'{}.... | 1 |
e1dfc985abc2efe5f3c811e1fa83684e | 06c187f83fb8d46630354b2fd4bf59b3 | Group of commands related to key provisioning. | def cli_group():
pass | 0 |
95c4f4c1028bf6e594f92a6aeb36ba56 | afd64e8642bfc540163dd35eeae3181b | Public : Returns all the campaigns found in the specified account
=== Parameters
account_id - account who owns the campaigns
=== Examples
=> Array[BingAdsApi::Campaign] | class ListsApi
def get_list_campaigns_0_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: ListsApi.get_list_campaigns_0 ..."
end
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required p... | 0 |
0e68bc77a9ffe1157d0eab36c0ec4ce5 | b4d8b149e0b3e69402d6db896e179704 | Read/write attribute holding the referrent. | class Attribute(SecondaryObject, PrivacyBase, SourceBase, NoteBase):
def get_handle_referents(self):
return self.source_list | 0 |
0909c193029e682f301e46120004e5b0 | b10fb063fba9814610344a1f4d48ceab | Get the mtime cache entry for data file ``fname``. | if os.path.exists(filename):
mtime = os.stat(filename).st_mtime
else:
mtime = None
return mtime | 1 |
16f892db3be1c808f2d9bdaf7253bf6c | 24f6d7c518c3240d277eb91a28f20ca2 | 将status cotent中的@转换成链接 | class Link implements FormatterInterface
public function format(StatusInterface $status)
{
return $status->setText(preg_replace_callback(
'#(?P<all>(?P<href>href=("|\'))?(?P<link>https?://(?P<name>[^\s]+)))#',
function($matches) {
if ($matches['href']) {
... | 0 |
15071877759cad1a34d0ed618ebd02c0 | 7e341884d9791fd05df7cdf2c6fc5094 | Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. | class LeaseSpecPatch(dict):
def lease_duration_seconds(self) -> Optional[int]:
return pulumi.get(self, "lease_duration_seconds") | 0 |
f67db5f7ccbff2287bfba3ef3ca49152 | f9713f9e9f0864042e822e7ac076ad14 | Test adding fields to configuration | {
$path = __DIR__.'/'.$this->path;
$config = new Config($path);
$result = $config->getConfig();
$this->assertTrue(isset($result['event/add']));
} | 0 |
68548de21abf824d4d71168f36ac813b | 6053a25e742fe99af6d5d0f4f53d56a7 | 连通区域递归函数,传入中心目标像素的二维坐标(x,y) | def PaintFill(img,oldcolor,newcolor,point):
x = point[0]
y = point[1]
if x >= img.rows or x < 0 or y >= img.cols or y < 0:
return False
if img[x,y] == oldcolor:
img[x,y] = newcolor
PaintFill(img,oldcolor,newcolor,(x,y+1))
PaintFill(img, oldcolor, newcolor, (x, y - 1))
... | 1 |
14a32cb41be37718911d6a23d7e02a0b | ab5f72411dd89bafcc256f4e483d37f8 | Send an email with the analysis results. | import smtplib
from email import encoders
from email.header import Header
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
msg = MIMEMultipart()
msg['From'] = f'Polaris 通知 <{sender}>'
msg['To'] = ', '.join(receiv... | 1 |
c0b6a3d2b20f9e9c38c2286375703bec | 592f129a26eeda16b68f2312bb042424 | เพิ่มสถานที่จองคิวตรวจโควิด | namespace RM.Core.Data.Implementation
public class CrudFuntion : BizLogic, ICrudFuntion
public string InsertVisit(BizVisit bizVisit)
{
string Result = "";
int result = 0;
Result = BizCall(
new Action(() =>
{
result = dbC... | 0 |
1dda7babea4b039a415f499045e9090f | 1cb4b2ff3448e3d062653221b629b366 | Returns output buffered content of included files. | class File extends BaseHandler implements FileInterface
public function includeFile($once = true)
{
return $this->filesystem->includeFile($this->path, $once);
} | 0 |
38c1801d822cf2c7c485bdee510c7a90 | 9d135f7d74d19c406b8125f066235e8a | prepare a propel result for displaying with printTable | $string = "";
$result = $queryResult->fetchAll(PDO::FETCH_NAMED);
foreach ($result as $row => $columns) {
foreach ($columns as $columnName => $columnValue) {
$string .= $columnName." - ".$columnValue."<br>";
}
$string .= "<br>";
}
return $string;
} | 0 |
486708f746fd21eb01450eb7288fae77 | 3cbfc80de638457ca0dbbfdc80737613 | Gets the number of reviews of an user | function get_the_hrb_user_total_reviews( $user = '', $args = array() ) {
$user = get_the_hrb_userdata( $user );
return (int) appthemes_get_user_total_reviews( $user->ID, $args );
} | 1 |
40dabe69539f0f2bbefe79611e3b9b5f | 8a3d7f77499e3a844e02b2f1809a73ec | Принимаем чистый номер в виде строки, только то, что ввел пользователь.
возвращаем номер, обернутый в template | try:
int(int_number)
except ValueError:
return 'Number is not integer\n'
number = str(int_number)
if number == '0':
return number_str_list[0]
num_str = number.zfill((len(number) // 3 + (len(number) % 3 > 0)) * 3)
three_digit_group = [num_str[k - 3:k] for k in range(len(... | 0 |
9452b12cc066e9ba7af2f55d7a2a56b8 | 54b0c89f293563d5bffc3bf19988cf0f | Validation method.
Verifies if FirstName/LastName/Email.
Returns false in case one of them is null or empty. | namespace BeautySalonValidation
public static class ClientValidation
public static bool InfoIsValid(this Client client)
{
return (client.ClientFirstName == null || client.ClientFirstName.Trim().Length == 0 ||
client.ClientLastName == null || client.ClientLastName.Trim().Length ==... | 0 |
4e6968cf5abf01460baba9218e13f76e | 8bd344875e6ab29ca5a5a65b2afd54cd | Calculate number of all symptoms per day for chart SymptomsPerDay | getAllClients($http, (result) => {
if (result) {
let datas = [];
for (let i = 0; i < result.data.length; i++) {
for (let j = 0; j < result.data[i].checkInHistory.length; j++) {
datas.push(result.data[i].checkInHistory[j].at);
}
... | 0 |
97415a1b7cb169f15c0fa7ba17fc8ca2 | c2b397281eb6202892c0857e952d3e96 | Generate {@link ContentValues} (for insertion and update) for similar {@link Artist}s. | public class ArticleSourceImage
public ContentValues getContent() {
final ContentValues values = new ContentValues();
values.put(COL_SOURCE, source);
values.put(COL_ART_IMG_URL, artImgUrl);
values.put(COL_ART_TITLE, artTitle);
return values;
} | 0 |
241c1ec1275e85a46edb6cf64219f8e3 | a3bd5d5c696a1be596251b27a5e744ff | Add a value to a header field, supplimenting any existing values | List valueList = (List)headers.get(name);
if (valueList == null) {
valueList = new ArrayList();
headers.put(name, valueList);
}
valueList.add(value);
} | 1 |
38b7a5357b3f884bcf477e471abca155 | 702c5a01b3e45ba27929a06baffed23a | Validates document signature, returns +true+ on success, +false+ otherwise. | class OMSAML2
public static function validateSignature(XMLSecurityKey $publicKey = null, ?SignedElement $idp_descriptor = null): bool
{
if (empty($idp_descriptor)) {
$idp_descriptor = self::getIdpDescriptor();
}
if (empty($publicKey)) {
$publicKey = self::getIdpCertif... | 1 |
ca73d0dbc5ef5d9a81996c8ce872a7c6 | 7cce32f7b2fd4d2b88020aef0f0b4cff | Start Caddy. | def main():
cli(auto_envvar_prefix="COCKROACH") | 0 |
057735b32aa451a863e6b2f4745e5182 | cdb9de6bfaa3b399e053ceeb5e1ea59c | check-function for reading input-ports | {
if (testbit16(portddr, value))
{
bitclr16(portddr,value);
switch(value)
{
case 0 : PA0_input_init(); break;
case 1 : PA1_input_init(); break;
case 4 : PA4_input_init(); break;
case 5 : PA5_input_init(); break;
case 6 : PA6_input_init(); break;
case 7 : P... | 1 |
33eb04e915c27159e1b396299471d9d2 | 3255e15cd5a8069d2adb8825323b6b44 | 将已赋值字段设为索引 | TreeMap tm = createBeanRow4Index();
LoopConfig lc=(LoopConfig)config;
for (int i = 0, n = ids.length; i < n; i++) {
FieldConfig fc=(FieldConfig) lc.getIndexConfig(ids[i]);
if (fc == null)
throw new SandPackException("设置值失败,loop域下不存在id=\"" + ids[i] + "\"的子域。" + lc.getNode());
FieldBean fb=(FieldBean) ... | 1 |
48aa27a67f85bfae0b30276c90f1e6e3 | d2186d18dc4b03f87b1c9e2b63a9854d | Ensures the department pages do not require login. | {
if (Program.LoginDepartment == "EE" | Program.LoginDepartment == "ES" | Program.LoginDepartID == "EM041" |
Program.LoginDepartID == "Admin")
{
btnSave.Enabled = false;
btnCancel.Enabled = false;
}
else
... | 0 |
aefc6ce72ed9ca1a52c5e441bbbf30de | 5cd616a0931ab9c3ac92ca1fc213756c | Returns a target-total bounded distribution sample. | class StepEnv(RewardEnv):
def sample_target(self):
return self.np_random.normal(0, self.max_rate, size=3) | 0 |
4581c0d96d11f34929ce2a153dcd2f48 | a126e223def638a47f29dc1612c0697a | 设定整体校验结果. 1-未被判为转载,可以群发,2-被判为转载,可以群发,3-被判为转载,不能群发 | @Table(name = "petitioncheck")
public class Petitioncheck
public void setResult(Integer result) {
this.result = result;
} | 1 |
5697f5fc39064962f4b905db0ad0da64 | 2fd65927e416520f3e095d78b1123ada | Add a new wish list for the given owner, ensuring a unique name | public void WishListInsert(@NotNull ArrayList<Item> items, String listName, String listDescription) {
DbManager dbManager = new DbManager(getApplicationContext());
int listId = (int) dbManager.insertWishLists(listName, listDescription, ApplicationTags.MiscellaneousTags.NOT_CONFIRMED);
if(lis... | 0 |
ce2d1d421370e1b90f05afb4289a9350 | 9128980d6e580bddc519df0e976486d7 | Sets the value of idhour. | class Hour
public function setIdHour($idhour)
{
$this->idhour = $idhour;
return $this;
} | 1 |
9c76f12cfd694447a1f9364cc76d8c2a | 3f3dda6e4b099e2f88a16aa21c047c15 | 自动发送选课请求 | local bean = i3k_sbean.propose_req.new()
bean.grade = grade
i3k_game_send_str_cmd(bean, i3k_sbean.propose_res.getName())
end | 1 |
657063486b52b3c82f7f36fe3e102a1e | 28cb85aa6c3b7407b823e51a062a8f50 | 전치 | for(int i=0; i<N; i++){
for(int j=0; j<M; j++) tmp_arr[N-1-i][j] = arr[i][j];
} arr_copy();
} | 0 |
6c88c51420c86a63546223051259163e | 86f7f2209f7a22de1eb61376df77c70b | 通过数据库信息判断是否支付成功 | namespace EyouSoft.DAL
public class DOnLinePay : DALBase, IOnLinePay
public bool IsPaySuccess(string orderId, EyouSoft.Model.OrderType orderType)
{
bool IsPay = false;
StringBuilder strSql = new StringBuilder();
strSql.Append("select IsPay from tbl_WebOnLinePay ");
... | 1 |
61c3252c6145b1d6b38be266c77ee0d6 | 6e4a9fa8b5d4e7270cb36a92249651ae | map language names to Prism.js names | function translate(){
return require('language/'+ getLanguage() + '.js').languageMap;
} | 0 |
af5c7eb8d7ba4275e1a2605d86c0a0d2 | a158b2045bd46af9c19445d9aa33e95a | bu metod sistemde tanımlı olan ve rezervasyon yapılabilecek maç saatlerini gönderir. | @Service
class ReservationServiceImpl
@Autowired constructor(val reservationRepository: ReservationRepository,
val timetableService: TimetableService,
val placeReservationService: PlaceReservationService,
val userService: UserService,
... | 1 |
6be1a7adf126b1a59385081cd8c25c6e | f79bad9f318953a86bc309826a94eb6e | correspond au read | class SearchController extends Controller
public function lire(Request $req ,$id)
{
$category= Post::get_types();
$post=Post::findOrFail($id);
return view('acc.lire')
->with('post',$post)
->with('category',$category);
} | 1 |
0e7b2bf468fc268e3dd25218fbab4129 | 211dc7763b81af917ac3dfe78a7b727c | Returns valid entities which are valid for given moment in time.
Valid entities have:
1. Begining is not NULL AND is LESS than given moment in time.
2. End is NULL OR is GREATER OR EQUAL than given moment in time. | namespace NinjaSoftware.Api.CoolJ
public static class PredicateHelper
public static PredicateExpression FilterValidEntities(DateTime momentInTime,
EntityField2 validFromDateTimeField,
EntityField2 validToDateTimeField)
{
PredicateExpression predicateExpression = new Predi... | 1 |
a455eb2557c8c3fd677601c0e6b0745c | dce02c080d0e7ba389069f9c8032c002 | Converts vertically integrated temperature advection into heat transport | float vintz[], float zt[], float tz[])
{
int iz;
float vfz,vlz;
if ( vintz[0] < 0.0 )
err("Negative value detected! Only positive velocities allowed");
tz[0] = 2.0*fz/vintz[0];
for (iz=1; iz<nz; iz++) {
if ( vintz[iz] < 0.0 )
err("Negative value detected! Only positive velocities allowed");
tz[iz] = tz[... | 0 |
710e4035c7b388370f8e5872e99a30be | 8559688bf6af48204758956650db0b27 | #ARL for Shewhart Control Chart | Root.wYSYL.TMV<-function(ARL0, w, n0, n1, n2, LW1, LW2, LC1, LC2,tol=0.001,maxiter=100){
R=(sqrt(5)-1)/2; qmin=0.01;qmax=0.7
k=0
repeat{
k=k+1
hmax=h(ARL0,w, n0, n1, n2, LW1, LW2, LC1, LC2,qmax)[1]
if(hmax<0.7|k==7){qmax=qmax+0.1;break}else{qmax=qmax-0.1}
}
q1=qmax-R*(qmax-qmin);q2=qmin +R*(qmax... | 0 |
bee1e03a328846e538097b05625e3905 | 082407a9ee049b163ea14a2975706aca | https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2456-L2458 # noqa: E501 | class TestNanReductions:
def test_all_nans_no_numpy_compat(self, ndim, identity, func_name):
settings.numpy_compat = False
shape = (3,) * ndim
in_num = num.random.random(shape)
in_num[...] = np.nan
func_num = getattr(num, func_name)
out_num = func_num(in_num)
asse... | 1 |
0763194f19113ebbe0dd04c0916e2ea2 | c156bf2d05a5981909b26df23e4659d8 | コンソール読み書きテスト | public void setUp() {
testConsole = new IConsole() {
@Override
public String read() {
return consoleData;
}
@Override
public void println(String input) {
consoleData = input;
}
};
} | 1 |
5f78ac66ca1df3f2e853cbc0b52a8ea8 | d02c5638b815013946dc0fe1d9a480ab | *INTERNAL FUNCTION*
Computes the degree matrix, D.
INPUT:
inputMatrix - adjacency matrix to be used for computation
OUTPUT:
degMat - degree matrix to be used to compute Laplacian matrix | def degree_matrix(adj: np.ndarray):
return np.diag(adj.sum(axis=1)) | 1 |
a3c5f2f94b3e74c2acd20e88d0eec192 | 08f5841dbb72b090b4c9a0e7b9fc32aa | Retorna un float con el valor de la operacion de los atributos valorA y valorB.
Utiliza una selectiva segun el simblo asignado a operador | {
double resultado = 0;
switch (operador)
{
case "+":
resultado = numero1.getNumero() + numero2.getNumero();
break;
case "-":
resultado = numero1.getNumero() - numero2.getNumero();
... | 1 |
efeefcf4478a8eaa8fc78877f84f36bc | 8c69b89495b379366c5a955b51f5cdc1 | Add a flip to the pattern flip map. | class SimData(SimDataBase):
#---+----|----+----|----+----|----+----|----+----|----+----|----+----|
def insertPattern(self, weight):
SimDataBase.insertPattern(self, weight) | 0 |
39dd3e559056b3c408765abbcab72070 | c8000f8e369f6f9a830bf5c3cdd5e85e | 오프라인웹 서비스 회원ID를 할당한다. | @Service
public class MemberService
public int addWIOMember(Member member) {
int addMemberResult = memberMapper.addWIOMember(member);
return addMemberResult;
} | 0 |
ea790296784d8ca850300baccafbc588 | 18bd9a9b40e9b3d5ca3bfe1ab7115daa | 포인트 내역 갯수(페이징용) | public ModelAndView getPointUseHistListCnt(@RequestParam Map<String,Object> params, HttpServletRequest request) {
log.info("{}","====================== Admin ========================");
log.info("[{} START]", "getPointUseHistListCnt()");
log.info("Request URI : {}", request.getRequestURI());
log.info("Input Pa... | 1 |
bc250c6b2c3df1785fcd8ca287cd21b5 | f4d73fd643bd33105342e47001858c61 | returns true if this entity is to be removed from the world completely | boolean shouldWeKillThisCreature(MultiverseWorld w, Entity e); | 1 |
9237f4dff6bc06b4ec6cd4529e7ff9d6 | 3aa3c479aff7ef506ebdcc432727c9dc | Gets the value of the attribute {@link #keySelector}. | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BetFailureDetail", propOrder = {
"selectionKey",
"selectionName",
"eventKey",
"eventName",
"price"
})
public class BetFailureDetail
public String getSelectionKey() {
return selectionKey;
} | 0 |
a94f234b6a9580ab94c92e7c0033de6b | 30a22cfefdb72d75e9860593ce0de28f | 一车一档信息分页查询 | @Valid
@PostMapping("/page")
public ServerResponse page(@RequestBody @Valid RequestParams<CarPageDto> requestParams, BindingResult result) {
Integer pageNum = requestParams.getPage().getPageNum();
Integer pageSize = requestParams.getPage().getPageSize();
if (pageNum == null)
pageNum = 1;
if (pageSize == n... | 1 |
33e0544d42762e9a639a3675f408fbdd | 6a51ab5b08dc2bcb2366da61eb35fe6f | :summary:同时检查多个包的更新状态 | utils._check_kwargs(kwargs, {'yes', 'branch', 'commit', 'tag',
'update_cache', 'pip_options', 'include_non_msl', 'all_msl'})
yes = kwargs.get('yes', False)
branch = kwargs.get('branch', None)
commit = kwargs.get('commit', None)
tag = kwargs.get('tag', None)
updat... | 1 |
4750a54a455bcdf88ce570f48dd5b2f5 | a0227da084ae1d0d86d5c20938d54bb6 | GET /losts | class LostItemsController extends BaseController
public function index()
{
$query = LostItem::orderBy('created_at', 'desc');
$lostItems = $query->paginate(9);
return View::make('lostItems.index')->with(array('lostItems' => $lostItems));
} | 1 |
c16ce3ff574afe39b69b6c7d4685f765 | 4134d4c508f1897216bdc3d6cf9bdf54 | Retrieve sufficient statistics from the seed decoder. | uint32_t uiWidth = pDecStat->uiWidth;
uint32_t uiHeight = pDecStat->uiHeight;
int32_t iAvgLumaQp = pDecStat->iAvgLumaQp;
uint32_t iLogInterval = pDecStat->iStatisticsLogInterval;
uint32_t uiProfile = pDecStat->uiProfile;
uint32_t uiLevel = pDecStat->uiLevel;
memset (pDecStat, 0, sizeof (SDecoderStatistics... | 0 |
ca1116190c974eb8bb82fc4330e6ac92 | fd4ddcdbebfa5bd9cf0329d22cca272d | 数据库结果验证 | if (params == null) {
return false;
}
Object object = params.get(SQLValidateParamNames.VALIDATE_RESULT);
if (object == null) {
return false;
}
return (Boolean) object;
} | 1 |
ec33d6efcbc55072f1b906a9110b109a | 2611dd30229244f7a206e4e823330f45 | Make empty intensity array. | def a(k):
return np.zeros(k) | 1 |
f9e23b63bf0f4b0107b48fa6888c0a8f | 90853e04d62f0982c64a2141619f3e5a | 百度搜索输入框的属性值 | function getSearchInputInfo() {
return {
keyWorld: jQuery('#kw').val(),
searchBtnText: jQuery('#su').val(),
};
} | 1 |
e503d9db8fa58c5e2a9c7e3851148e68 | 6dbba0425b6fe8d4e2847efe247c5912 | moving pool objects into place | {
int i;
object *objp;
if ( !skipped_time_init ) {
memset( skipped_time, 0, MAX_OBJECTS*sizeof(int) );
skipped_time_init = 1;
}
if (Highest_object_index > Max_used_objects)
free_object_slots(Max_used_objects);
obj_delete_all_that_should_be_dead();
if (Auto_leveling_on)
ConsoleObject... | 1 |
9184d293e4d5e8f9cdb6b397805c5ea3 | 2144dfe42ae51ec76e326b99fea0db3a | Retrieves a team object from slack. | def team(id):
return get('teams/{}'.format(id)) | 1 |
7544238551f66e4f8a8be1a130aed7a8 | d4f50499cfdf060d4999d3224c3816aa | !
Test case when there is no valid snmp related section | {
EXPECT_CALL( *this, createSnmpServiceMibEnvironment() )
.WillOnce( Invoke( []
{
return std::make_unique< TestSnmpServiceMibEnvironment >();
} ) );
} | 0 |
994c9b75e2ece7d9a6d282ae5156fb24 | 64aace5ca96b3fc9ea77c3c14e7ed3a3 | print the values of v in the list, starting at node n. | void printValues( Node *n )
{
if ( n ) {
printValues( n->left );
printf( "%d ", n->value );
printValues( n->right );
}
} | 1 |
baf438ec674dba0f7aa3ef2c30828ebe | cba2a44a63a8fc5907fd04673e6b3c98 | tests elements on transaction start page | {
$client = static::createClient();
$crawler = $client->request('GET', '/');
$this->assertTrue($crawler->filter('h1:contains("Je donne")')->count() == 1);
$this->assertTrue($crawler->filter('h3:contains("Je donne")')->count() == 1);
$this->assertTrue($crawler->filter('h3:cont... | 1 |
e37076993247539ce068c08b6fe2c01d | d173b1f69eb6800bd6713f73274585eb | Método que devuelve un indicador booleano para determinar si el tipo de
gestión es comercial o no. | public class Cmp implements com.iabtcf.extras.cmp.Cmp
@Override
public boolean isCommercial() {
return this.isCommercial;
} | 1 |
03751620c1fcbd5160af980408c0d03b | 9dd60fbebcb1af433108de3ef8840115 | Get metering regions. | List<? extends Meter> list(); | 0 |
dff23beea10d7e5873979a25b84ebcb6 | f11e6b4798631f0e44db00e0f46b8215 | Sets the path leading linking nodes | public class RoutePath
public void setRoutePath(LinkedList<String> routePath) {
this.routePath = routePath;
} | 1 |
b476e3ce1e7e1ce80b51a226f748fcd1 | 14dccbafd0e728e7b908c819e162ea58 | Calculate the total file size in bytes for all files with file extension
of ext arg found in directory hierarchy | def total_files_counter(inp_path, ext):
filecounter = 0
for dirpath, dirs, files in os.walk(inp_path):
for filename in files:
if filename.endswith(ext):
filecounter += 1
return filecounter | 0 |
c4db1d798031127ecaebdb120dcb1e9a | 88760f317c771736244053fffccf5b9c | Set Centrally maintained. Information maintained in System Element table | public class X_AD_Process_Para extends PO
public void setIsCentrallyMaintained(boolean IsCentrallyMaintained) {
set_Value("IsCentrallyMaintained", new Boolean(IsCentrallyMaintained));
} | 1 |
265231dff760f14943557c85c14c5a56 | b8210f9773463986dc6f2d424584a21d | This internal method listens for authentication state changes and upon detecting a change, fires an AuthEvent | internal class ReadDocumentViewModelImpl : BaseViewModel(), ReadDocumentViewModel
override fun onAuthStateChange(user: FirebaseUser?) {
configs.filter {
it.value.requireAuth
}.forEach {
attachListener(it.value)
}
} | 0 |
9673ae9bf350478c134aed8f7592bd70 | e2b23e0bb9a9b6a510a0982cadabf1e8 | verifier le nombre de membres connectés | function isconnected(){
if(isset($_SESSION['membre'])){
return true;
}
return false;
} | 0 |
06a24289569467949e73b257d9281bf1 | cb61c4b3b3af432f06c6e1b79f1589af | 功能:将链表中的数据elem更改为newelem
参数:L带头结点的链表,elem现存链表中的数据,newelem要更改成的数据
返回值:成功返回0,失败返回-1 | if (L.elem == NULL || L.length < 2) {
return ERROR;
}
ElemType *p = L.elem;
Status flag = ERROR;
for (int i = 0; i < L.length - 1; i++) {
if (p[i] == cur_e) {
flag = OK;
*next_e = p[i + 1];
break;
}
}
return flag;
} | 0 |
be0861e96d0ea4a0c4a085e557b30663 | 134f2e391be6bb849b00ee8423ad3e71 | Clear all PlacementGroups in the graph. | pgs = cs.placement_groups.list(detailed=False, search_opts=None, paginate_opts=None)
columns = ["ID", "PG ID", "State", "UP", "Acting"]
utils.print_list(pgs, columns) | 0 |
b5921ba1f9dae6e89dd09a533f4d5644 | 3079deb4d673d7a68651b583e234524a | При выключении необходимо проверить, работает ли анимация. Если да, то кинуть остановить и сообщить об этом. | public class ImageSprite extends Sprite implements OnStopListener, OnResumeListener, OnConfigurationListener
@Override
public void onStop() {
if (autoToggle) {
if (animRunning || running) {
this.running = false;
}
Enabled(false);
}
} | 1 |
440151edfff2e3d523a7a6e767791235 | cfafbe1304876cfeef2f1b44ac9a87a2 | Drops a table from the JDBC database. | public class DatabaseConnection implements TriggerListener
public void dropTable(TableName table_name) {
getTransaction().dropTable(table_name);
} | 1 |
8d6a8ccb0f8e21a306d7cae16f7e39b3 | 7d58cecaa98cb58082254099a7943eea | module class and nessesary information | self.p = 20
self.k = 20
self.f = (self.p + 1,self.k +1,3)
self.e = np.zeros(self.f)
self.Q = np.ones(self.f)*5
self.g = (self.p + 1,self.k +1)
self.locx = np.ones(self.g)
self.locvx = np.ones(self.g)
self.phi = np.zeros(self.g)
self.previou... | 1 |
edbcde9df07eeafd68d3156146788fc8 | 36ea54877f85b5720116a78a95a21115 | the common usage of decorators, like doing some logging. | def log(func):
@wraps(func)
def decorated(*args, **kwargs):
res = func(*args, **kwargs)
print("Log {}({}, {}) = {}").format(func.__name__, args, kwargs, res)
return res
return decorated | 1 |
28af80bb036ff576ea7816c9f7d5955c | 42554f8c3954922906ad1e6312931364 | Test of setBank method, of class Agency. | public class ApplyViewEntity extends PageBaseEntity
public void setAgencyBank(String agencyBank) {
this.agencyBank = agencyBank;
} | 0 |
467d84af1450a9fe474cb8c0e93144a3 | 3517db63d480b5ad7ee8eee7d623de4d | This implementation will only work if elements occur exactly
once or twice in the input. | public class ArrayUtils
public static boolean sameElements(Comparable[] arr1, Comparable[] arr2) {
HashMap<Comparable, Integer> map = new HashMap<>();
for(int i = 0; i < arr1.length; i++) {
if(map.containsKey(arr1[i])) {
map.put(arr1[i], map.remove(arr1[i])+1);
} ... | 0 |
81e57089975789a5ff8465b39c1a6004 | 2fc21f5f69888c8be5fa3d408805a3a6 | 查询该课程的所有班级和上课周次地点 | List<SchoolWeek> schoolWeeks = new ArrayList<SchoolWeek>();
List<SchoolCourseDetail> schoolCourseDetails = schoolCourseDetailService.getSchoolCourseDetailByCourseCode(courseCode);
for (SchoolCourseDetail schoolCourseDetail : schoolCourseDetails) {
int termId = schoolCourseDetail.getSchoolTerm().getId();
int... | 0 |
2217fb404b148da554f2de0dd79581e4 | 9b2067ad89f57d18d1a644c098ab7da1 | zdecyduj, gdzie użytkownik ma być przekierowany po zalogowaniu | function RedirectUser()
{
if(isAuthUser() != null)
header('Location: /Modules/'.isAuthUser());
} | 1 |
4a50988f83f8f6bdfb9fc3dbee479d7e | 46e97a888245eb0eb2b689afac385811 | 上架 | if (DataService::update($this->table)) {
$this->success("商品上架成功!", '');
} else {
$this->error("商品上架失败,请稍候再试!");
}
} | 1 |
ef8554d5db35d4e42b568ffd320e5025 | 65919d7a4b1c74d5eaba8d8a0117ac61 | Returns the richieste sequence with the primary key or returns <code>null</code> if it could not be found. | public class SequenceKeyGenerator implements KeyGenerator{
public Object generateKey(RepositoryView view,
Connection conn,String vendor,
SqlInterface sqlInterface)
throws KeyGenerationException{
Object identity = null;
ResultSet rs = null;;
Statement stmt = null;
logger.log(Le... | 0 |
322593714495cad5bda30ea174102875 | c73b6b05fa7d939b6b2a4f2eaec76025 | 根据C#类型返回对应的SQLite类型名称 | namespace Agebull.Common.Access.ADO.Sqlite
public static class SQLiteDefault
public static string ToCSharpType(string csharpType)
{
switch (csharpType)
{
case "Char":
case "Byte":
case "Byte[]":
case "Decimal":
... | 0 |
3f8f83f3c394a823a6ad2a801d0c6a69 | 740c7aa7d0809bef6834396547fc4de6 | 验证查看投票调查表权限(查看投票状态) | @Service
public class SurveyService implements IBaseService
public boolean checkPermission(Long bid, Long userId) {
CmUser cmUser = userDao.get(CmUser.class, userId);
if(cmUser!=null){
Long cuMedliveId = cmUser.getCuMedliveId();
if(cuMedliveId!=null){
List<CatsExp... | 1 |
b08d80de42761697cc9412d9d7c6c63f | 00ddee52e2d66f3711f5c0e970c0cd93 | copies working debugging points to real debugging points. prevents flickering. | void UpdateBrkpts(KE *pKE) {
int i;
if( DbgMem!=NULL ) {
KDBG_BRKPT_CNT = (WORD)pKE->DB_BPcnt;
for(i=0; i<DB_MAX_BP; i++) {
if( i<pKE->DB_BPcnt ) {
*((DWORD *)(KDBG_BRKPT+4*i)) = pKE->DB_BP[i];
} else {
*((DWORD *)(KDBG_BRKPT+4*i)) = 0;
}
}
}
} | 1 |
600bc342b62dfd03b1e567915d3453f7 | ceb4b4463bb51f422eb313b5b95326cf | Creates a unique id using the <a href="https://en.wikipedia.org/wiki/Cantor_pairing_function">Cantor
pairing</a> function. | @Override public int hashCode() {
return (int) (from + 0.5 * (to + from) * (to + from + 1));
} | 0 |
8d549e74f36009937771ab2392da010d | 102e9714da33d8937417a26efb8cea57 | bitwise addition of numbers | namespace
unsigned add( unsigned a, unsigned b )
{
while ( b )
{
unsigned carry = a & b;
a ^= b;
b = carry << 1;
}
return a;
} | 1 |
99a3f97e06c1e66f452558a3cfe6b17b | 318b21a19d9efdc3015e0fdd35a94f54 | 返回正常状态view | def view_success(request):
return HttpResponse('success') | 1 |
f69cb33e856986ee60b02e96557e7a15 | 8eaf12b4666e2c6ab1aa67a9b2f80459 | liga dois vertices simultaneamente (sem direcionamento) | if (!inGraph(v1)) {
contents.add(v1);
}
if (!inGraph(v2)) {
contents.add(v2);
}
v1.connect(v2);
v2.connect(v1);
return;
} | 1 |
10bc5bf82f5a722f87dc9f341e95bdcc | 6ffd2f05ce40d852a280959826c53726 | Creates a new virtual disk at the specified location on a file system. | namespace DiscUtils
public abstract class VirtualDisk : IDisposable
public static VirtualDisk OpenDisk(string path, FileAccess access)
{
return OpenDisk(path, access, null, null);
} | 0 |
3af4f51230ce306b93946ede5eb1d6c8 | 0f71298054edd3fdc0c5a89a1d196390 | 找到三坐标轴上最大、最小值,来生成最小网格 | ref Geometric.Point p3, ref Geometric.Point p4)
{
DateTime t0, t1, t2, t3;
t0 = DateTime.Now;
Hashtable ht = new Hashtable();
Grid3D gid1 = new Grid3D(), gid2 = new Grid3D(), gid3 = new Grid3D(), gid4 = new Grid3D();
GridHelper.getInstance(... | 0 |
42e1ef8bca20bef76cc41777875c4825 | 6a09cf01c97120bf8a95a589e47e49ab | 底部启动Activity动画 | public class UIUtils
public static void pushToBotom(Activity activity) {
activity.overridePendingTransition(R.anim.push_bottom_in, R.anim.push_bottom_out);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.