query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
eecf8851dbc79ede99cb682b4d505e62 | 40fb6ce81f126d4af07644b577dba2af | Returns length of publications of user | class Profile extends BaseProfile
public function getTotalPublications()
{
return Publication::find()->where(['id_user' => $this->user_id])->count();
} | 1 |
5de6e6f5b80c472c37b448ebbd4dd131 | 84847201f84febc17aaf6fe3c0441d5a | Checks if the verification process goes as expected
making (the maximum possible attempts - 1) to complete with an incorrect OTP
and then trying a correct one | enableWiFi();
ISyncManager syncManager = getISyncManager();
IOperation operation = doCheckAccount(syncManager);
operation = doProvisionNewUser(syncManager);
assertOperationIsCompleted(operation);
operation = syncManager.doChangePin(changePin());
operation.start();... | 0 |
3374766ca195c65991c5e6ad2167fb97 | 1e803924aaa3234e92f8af4f9645879e | <pre>
Deletes a shelf. Returns NOT_FOUND if the shelf does not exist.
</pre> | class ShelfInterface(ABC):
def delete(self, _id): | 0 |
d443b5a3e1060fa022022662fd3f980e | 36fe65cf796dbd4a89d8d43a6a94f638 | Get forwards for a given contact | namespace ConstantContactClient.Services
public class ContactTrackingService : BaseService, IContactTrackingService
public ResultSet<ForwardActivity> GetContactTrackingForwards(string contactId, DateTime? createdSince)
{
return GetForwards(contactId, null, createdSince);
} | 1 |
30bff1db123723ab20e86e55df20f7a8 | b1cecbe43bfadf3dc21da66208d5a607 | Czyści planszę | public class Checkerboard
public void clearAll(){
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
if (pieces[i][j]!=null){
pieces[i][j]=null;
}
}
}
} | 1 |
0a902273d4be8248ef68c44e546e6752 | 3b9360de53426e587bfef798b4725bf5 | Set some lights on, some lights off | for light_it in range(0, constants.RGB_TOTAL):
set_rgb(tunnel, rgb_first + (constants.RGB_STEP * light_it),
[randint(0, 255), randint(0, 255), randint(0, 255), 0])
return True | 0 |
e12761fc37c4f634e5c009f20c671888 | 28084ddce5764b107f1e111f784e4686 | 描述:设置solr查询的core | public class Router{
public void setCore(String s){ core = s;} | 1 |
44c468549be61d08b9cc5d6500e3a6c0 | 1b4f8183144227c6781933cf8b0be200 | click event for the face icon | event.preventDefault();
var el = document.elementFromPoint( event.zClientX, event.zClientY ),
faceListItem = Z.findAncestor( el, function ( el ) {
return el.classList.contains( "face-list-item" );
... | 1 |
9163aa4ab332e0ea5f47ea780bf7e59e | 6097ba213159dfa019eb9bad21bfc633 | resnet50的基础特征提取网络 | def resnet50():
bn_axis = 3
input_tensor = Input(shape=(224, 224, 3))
x = layers.ZeroPadding2D(padding=(3, 3), name='conv1_pad')(input_tensor)
x = layers.Conv2D(64, (7, 7),
strides=(2, 2),
padding='valid',
kernel_initializer='he_normal',
... | 1 |
56c2b4b852b09d686a87933502b98a4c | 0eb11a7d0e18ba52888e8195f49da894 | Get the device acceptance criteria for any UC. | attributes = self._generate_attributes()
if self.get_allow_all():
attributes['pcEnfPref'] = 'unenforced'
else:
attributes['pcEnfPref'] = 'enforced'
return super(Context, self).get_json(self._get_apic_classes()[0],
attri... | 0 |
f935dc9d6db25e6fa57d03ee82e41eaa | 65f306365e3fd7bce90ed52c9eff5331 | 读取配置文件中值.如果配置文件中没该项配置,则使用默认值. | String value = getValue(configDao, name);
return value == null ? defaultValue : value;
} | 1 |
8206d6fa886e574fe0d895f65059d0a8 | 97a54c02fbbf55e7c59869811d2f1ad9 | Whether to allow directory as input path | {
this.fileOpenControl_inputPathes.IsMultiSelect = trueOrFalse;
if (!trueOrFalse)
{
this.fileOpenControl_inputPathes.Top = 5;
this.fileOpenControl_inputPathes.Dock = DockStyle.Top;
this.fileOpenControl_inputPathes.Height = 25;
... | 0 |
c09f22244b7858cdd77d66c6bdd597b8 | 3a0204099363aa95c9084ce9e583a0e9 | Filter dataframe according to given bulletin_date. May want to override. | data = format_date_columns(data=data, date_columns=[date_column])
data = data.loc[(data[date_column] >= date_range[0]) & (data[date_column] <= date_range[1])]
return data | 1 |
ff7faff436075d41294270c5da4a15a1 | 1944154ee07ed6d7be8e977aa00f6b2d | Sorts the array by lexicographic ordering, case-insensitive.
You will need to use one of the sorting algorithms lectured in class. | public class Sorter
public static void sort(String[] a) {
sort(a, 0, a.length-1, true, false, null);
} | 0 |
f7e93cd267774982e594744f4d0ca87d | 0e8c659d411640b5aa9be0395f09924a | Y-coordinate of left manipulator | class ManualController(ControlModel):
def hat_x(self) -> int:
return self._hat_x | 0 |
93be2d552b69a356966da23f67e893da | b30bbbda7fe678f900b072c3e7ef320a | RegisterImplementor registers the gRPC resolver service implementor. | func init() {
log.Debug("init register resolver")
grpcresolver.Register(&resolverBuilder{ResolverETCD3})
grpcresolver.Register(&resolverBuilder{ResolverZookeeper})
} | 1 |
4c440d0e97e9c0bf2c75021e8a483a4a | 6996bc16bf48625ee42ab6435d5e5bd6 | 文字列からactionを取得 | def stringToAction(input_str: str):
action = input_str[:input_str.index(" ")].upper()
col_num = eval(input_str[input_str.index(" ") + 1:])
return action, col_num | 1 |
0c8c4010dae012d4de8e8e8a31154f87 | ae1f0c777d0cd85c19141204d7a438fe | The ID of the RestApi resource to deploy. | class GetBasePathMappingResult:
def rest_api_id(self) -> Optional[str]:
return pulumi.get(self, "rest_api_id") | 1 |
d271372757962ef4fba75b309ef28456 | 50a38d3be9a6e012f444e5f22137d3ac | using recusion, it will remove all empty sub folders within a given directory as well as the root folder. | if (!$path){
$path = $this->getFolder(true);
}
$empty = true;
foreach (glob($path.DIRECTORY_SEPARATOR."*") as $file){
$empty &= is_dir($file) && $this->removeEmptySubFolders($file);
}
return $empty && rmdir($path);
} | 1 |
7fffb54fb4afc03466a4dbb2468856e7 | 84a46357bf34e74c431fcfcb97b8e81e | convert a point in the form of flat tuple to point in the form of a tuple of tuple ((),(),(),...) | def bare(point):
return ((point[1],point[2])) | 0 |
9c9b995d061b68c9ea78162ee01200a5 | 102cb661eec2d7dd4d55453b4d26301f | Clones the given dictionary deeply by copying all values. | public static IDictionary<TKey, TValue> Clone<TKey, TValue>(
this IDictionary<TKey, TValue> dict
)
{
return dict.ToDictionary(o => o.Key, o => o.Value);
} | 0 |
61374860cd83ca79c0c1288a248efe2c | f225a4e57fcca652e4e0aa464f18d19b | Cancel task group.
Calls the external python library (that calls the bindings-common)
in order to request a group cancellation. | class TaskGroup:
async def cancel_remaining(self):
await self._cancel_tasks(self._pending) | 0 |
6d58348be6e4407c2d119825bdf804c0 | 8387816565211872058503b09a9af2d0 | Unit vector along X axis | public class Vector2 implements Serializable
public static Vector2 unitX()
{
return new Vector2(1.0f, 0.0f);
} | 1 |
8213cb7a0bddf38a93d831de73903ae7 | 072e7416b2cbff1d811ab9c70b598406 | Check to see if MemoryStoreRetentionPeriodInHours property is set | namespace Amazon.S3Control.Model
public partial class S3SetObjectRetentionOperation
internal bool IsSetRetention()
{
return this._retention != null;
} | 0 |
b2329363ce8d9c280c401b2a612efebf | f9f0c82b0e27753208939b6928cbd7bd | Performs maximization step. | class LDA(object):
def _M_step(self):
self.beta = self._maximize_beta()
self.alpha = self._maximize_alpha() | 1 |
fb6170e7e5f71a4847267359ea3df794 | 81b5274189afa8f5802368b2e9abea68 | Creates a button which will be used as the control to show or hide
the popup portion of the combo box. | List comps = Misc.newList(this);
JButton popupBtn = new JButton("Change");
popupBtn.addActionListener(makeActionListener(ColorSwatch.this,
"popupNameMenu", popupBtn));
comps.add(popupBtn);
return GuiUtils.hbox(comps, 4);
} | 1 |
8749e2f97d8bdc0d6a554ffcaa9c50f7 | 1abfe957670672a5393965071139ec1d | Tells the shader to look up the fragment's color from the texture. | {
const GLuint ONLY_COLOR_OUTPUT = 0;
glBindFragDataLocation(
Id,
ONLY_COLOR_OUTPUT,
FragmentShader.OutputColorVariableName.c_str());
} | 0 |
1fbc2acb7c69ad5e5c4e384f41991ecf | b1badfee8bd1753f7625b7dc2aa58cda | 初始化沟通目的、意向度 | class ResumeIntent(Base):
def __init__(self, **kwargs):
self.city = []
self.duty = []
self.industry = []
self.salary = ''
super(ResumeIntent, self).__init__(**kwargs) | 0 |
2c7eb12a3dc442ce1e05be3f37909d4a | 98e64e4574dbe2de39809e57d15c4060 | Gets ith "WGS84BoundingBox" element | org.isotc211.x2005.gmd.MDGeometricObjectsPropertyType getGeometricObjectsArray(int i); | 0 |
0ddebfde969ff1ba9054297b7fc167ed | 831d6586d517a1c641cc5d31a01204a9 | Enables AJAX for this component and all sub-components (if they implement IAjaxAware) | class EntityBrowser extends DisplayPluginBase
public function ajaxEnabled() {
return TRUE;
} | 1 |
4676a3be1428c43fa408cf7b85175f68 | ba5dfc30abbc478180f2462eaa4dff0a | Analyzes severity of the patient | interface PatientClassifier
fun classify(bundle: Bundle, takeSyndromes: Int): SeverityResponse | 1 |
9ea15d1f3182516539893af6daf4e572 | e26fc85acb94e65a3029e2ed24af3171 | 指定の商品が販売期間内かどうかをチェックします。
<p>
<dl>
<dd>引数で指定された商品が販売期間内かどうかをチェックし、販売期間内の場合はtrue、それ以外の場合はfalseを返します。
<ol>
<li>引数で受け取ったショップコード、skuコードを元に商品情報を取得します。</li>
<li>1で取得した商品情報がnullの場合、falseを返します。</li>
<li>引数で指定された商品が予約期間内かどうかをチェックし、予約期間内である場合はfalseを返します。</li>
<li>1で取得した商品情報の商品ヘッダより、販売期間開始日時と販売期間終了日時を取得します。</li>
<li>4で取得した販売期間開始日時... | void checkProductValid(ProductValidDto dto); | 0 |
93423094599ba850c5bf370e5b710872 | 46df3a62870996298771bf33256d7244 | Show custom modal dialog from fxml file. | Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle(_title);
alert.setHeaderText(_header);
alert.setContentText(_message);
alert.initModality(Modality.APPLICATION_MODAL);
alert.initOwner(boffoStage);
Optional<ButtonType> result = alert.showAndWait();
... | 0 |
c20fd5976c46f9e639bfb807272073d4 | 40882b1754d0f851939938fc848ccd97 | 统计某一分区帖子COUNT | @Service
public class PostInfoServiceImpl implements PostInfoService
@Override
public Long countPostInfoByPostBarId(Long postBarId) {
return postInfoDAO.countPostInfoByPostBarId(postBarId);
} | 1 |
8496a70da4af9696d347c079037bda28 | 8f1ce09ff38a16d34e3c86a0f7118c58 | Returns the number of rows of coordinates. | public class CRSMatrix
public int getLength() { return length; } | 0 |
7cb73e3f44cfc1d89e0c1a716130097d | d75e8d61b7cb5215859e4dc25407b05c | Заполнить сетку дополнительными точками | {
for (int i = 0; i < 4; i++)
{
Point p1 = new Point(P.mas[i]);
int x = P.mas[i].x;
int y = P.mas[i].y;
Fullfield[x, y] = p1;
}
} | 1 |
fcc40382f2c7770d5dc973dcde7e856c | 5705f2758444f9c6e5844c2041d368f7 | ! \brief Set Ssthresh according to equation (4) in RFC5681.
\context interrupt or task level
\note | {
int16 txAlpha;
int16 start_delta;
ftm_default_txAlpha = mdsp_read(MDSP_txAlpha);
txAlpha = (int16)(-1* ((int16)ftm_default_txAlpha));
start_delta = rfgsmlib_get_tx_sbi_start_delta();
if (txAlpha >= start_delta)
{
mdsp_write(MDSP_txAlpha, (uint16)(-1 * start_delta) + 50);
}
} | 0 |
0b344913217c31bdc464d3d41805643c | 878eaf957e5802d5427f86041d9e2a66 | Clears out the list selection and sets the <i>$selected</i> property of all items to false. | abstract class TListControl extends TDataBoundControl implements \Prado\IDataRenderer
public function clearSelection()
{
if ($this->_items) {
foreach ($this->_items as $item) {
$item->setSelected(false);
}
}
if ($this->getAdapter() instanceof IListControlAdapter) {
$this->getAdapter()->clearSelectio... | 1 |
cd69ffba1a631d3986afe04f4f0016de | f3bfb647817493b4d841c0d15d074729 | 断号查询:求len长数组a[]中缺少的顺序数字
PS:不能是首和尾缺失 | {
int k,l,max, *M,res;
M = (int*) calloc(len, sizeof(int));
l = 0;
for (k = 0; k < len; k++)
{
res = binary_search(M, a[k], l);
if (res != -1)
M[res] = a[k];
else
{
M[l] = a[k];
l++;
}
}
return l;
} | 0 |
e6df799ef27cf25d50da05661346f8cd | b51d3d07ee83365d0f299a7a0341cdc6 | Return True if node is in the static selection. False otherwise. | class NodeTree(bpy_struct):
def tag(self):
return bool() | 0 |
0a737609055534d07d13f9a016f3e6b9 | 33b6c8e20a2beb63649c2ceb6ae5830f | Dolmuş satırları siler | namespace HesapMakinesiUyg
public partial class Form1 : Form
private void btnSil_Click(object sender, EventArgs e)
{
txtEkran.Text = txtEkran.Text.Substring(0,txtEkran.Text.Length-1);
} | 0 |
fdbc63f03e7c2fed50a0d076c4a4a454 | 1590f89064b7052660cfe06df433a94e | Plot first three eigenfunctions for a particle in a box. | graph = graphs.Sensor(20, seed=42)
graph.estimate_lmax()
filters.Heat(graph).plot()
filters.Heat(graph).plot(eigenvalues=False)
graph.compute_fourier_basis()
filters.Heat(graph).plot()
filters.Heat(graph).plot(eigenvalues=True)
filters.Heat(graph).plot(eig... | 0 |
5561ecabfe2b1cb0c733f4e2616a1e6d | 2f48f59449908e926ab53f298bd42ff5 | 삼성 카드 정보 추출 메소드 | BaseUrl = 'http://finance.naver.com/sise/entryJongmok.nhn?&page='
names = []
codes = []
result = []
for i in range(1, 21):
url = BaseUrl + str(i)
r = requests.get(url)
soup = BeautifulSoup(r.text, 'lxml')
items = soup.find_all('td', {'class': 'ctg'})
for item ... | 0 |
667a7e194bf411ca1fa1212a68a5007b | a0a5a689c63ecf44e7357516e93067a7 | Write a function to count a total number of set bits in a 32 bit Integer? (Solution) | int countSetBits(int n)
{
int c=0;
while(n>0)
{
c++;
n=n-(n&(~n+1));
}
return c;
} | 1 |
0c10870c359c3b7987c9b26bf8dbb63e | ff4f1e0dbd369f7833af7924d62ef998 | Verify expected "likes" are present in / URL. | liked = LikeArticles.objects.filter(user=self.user).count()
res = self.client.get(
reverse(
'stats:liked-articles',
kwargs={"username": self.user.username}
)
)
self.assertEqual(res.status_code, status.HTTP_200_OK)
self.asser... | 1 |
acc12a8d0c314030cfdf8110819cd55c | 0d5d6f2d33a209a80b638f9646ba24f8 | 判断得分显示相应分数图片 | if self.side == 'left':
self.score_img = self.context['cof'].words2img(self.score, 90, (160, 55))
else:
self.score_img = self.context['cof'].words2img(self.score, 90, (1660, 55)) | 1 |
e1757b39fc17cfed44ad641b0c2d8e57 | 77d245f21e7ad83add3b09af66fe90f6 | onSubmitClick()
This method is called when a user
hits the register button after filling
the signup form | export class SignupComponent implements OnInit
onSubmit(form: NgForm) {
console.log(form);
this.authService.registerUser({
email: form.value.email,
password: form.value.password
});
} | 1 |
8f978d5342ef43a15d643e1e8e022c36 | 1f51ad8bf4fa02a07e61ac5a7ad8048c | 吸氧结束时间属性元数据 | ColumnDesc column=new ColumnDesc(tblDesc,"Dt_oxygen_end");
column.setLength(19);
column.setSqlType(Types.CHAR);
column.setNullable(true);
column.setLabel("吸氧结束时间");
return column;
} | 1 |
fc3e4094af73a09f4b388c0cc1379639 | 098d67f60b06685e04af0879183360b2 | Turn on A2D. | void init_a2d(void){
ADCON0=0;
ADCON1=0;
ADON=1;
} | 1 |
6ca7c2de9a59d21e2c1d20a5c2cd90e2 | 45c666fbb397ee8197129a35ad8b4f23 | Updates location and propagates validity up the tree | class DisplayContext(props.SyncableHasProperties):
def __locationChanged(self, *a):
self.__propagateLocation('world') | 1 |
d7e162e82897dd92487f1e504f2a9d20 | b21fd6ce1615f39deb0888fc24d66348 | Registers User. Returns str message about the success of the registration. | class Wallet:
def register(self, username, password, email):
self.sock.send(f'REGI,{username},{password},{email}'.encode())
register_result = self._decode_response(self.sock.recv(128))
if 'NO' in register_result:
raise Exception(register_result[1])
return register_result | 1 |
7cfbd49029cec95cf6730867dc4d488e | 5db4067b8c6ecf9bf6f7410a1c66673f | Check if WP Job Manager is activated | class Pronamic_WooCommerce_WooCommerce
public static function is_active() {
return defined( 'WOOCOMMERCE_VERSION' );
} | 0 |
7bf3659e0d68d892aa29255cf716953c | a5815ce21e7c513f0eba1de253e601b9 | 通过店铺id查找店铺包含菜品 | List<Food> listFoodByStore(int storeId); | 1 |
18c3e967f75f4a3f48bbe75e36b9b9a0 | 5426d3dd1946e092308f8d73457789cb | init the session summary data | def init_summary_data(in_params, num_images, summary_data):
summary_data[_('Parameters')] = in_params
summary_data[_('Number of images')] = num_images
summary_data[Control.pixel_size.value] = []
summary_data[Control.bands_len.value] = []
summary_data[Control.dig_level.value] = []
summary_data[Control.rad_ba... | 1 |
131ee64cdda879de4d285cd886f91cca | 8ee55648c2d4103c5fb3b70e4825599d | Returns the bitangent interpolated across the triangle | let (x1, y1, z1, t1) = u;
let (x2, y2, z2, t2) = v;
let a = (y1 - x1) * (y2 + x2);
let b = (y1 + x1) * (y2 - x2);
let c = fe(2) * z1 * t2;
let d = fe(2) * t1 * z2;
let e = d + c;
let f = b - a;
let g = b + a;
let h = d - c;
let x3 = e * f;
let y3 = g * h;
let t3 = e *... | 0 |
b92aec225575e83985585f24aa8fc3c1 | 2be9d4a6b19413fe3fd863d8366870bb | given a document Id, returns the name of the document | {
string selectString = "SELECT name FROM document WHERE id = " + id;
DataTable dt = sqlHelper.QueryForDateSet(new ArrayList() { selectString }).Tables[0];
string name = "";
if (dt.Rows.Count > 0)
{
name = dt.Rows[0]["name"].ToString();... | 1 |
1c2415f6b23f24c3dd5d8525cfd84c3a | 72447d586155f12dbce78db6c38298f5 | 校验信用卡CVV是否有效 | public class CardDataValidator
public static boolean isValidCardCvv(String cvv) {
return (cvv != null && !cvv.isEmpty() && cvv.matches(CVV_CARD_CODE_REGEX));
} | 1 |
7f9806780799c5ccbff07b81ac03c96a | 930e7383c89e97b3827a68a62b1a3049 | 判断表格字段是否为主键 | def checkPri(database,table,field):
db = database
tb = table
fd = field
sql = "DESC "+db+"."+tb
print(sql)
columnInfo = pd.read_sql(sql, conn)
isPri, = columnInfo['Key'][columnInfo['Field'] == fd].values
print(isPri)
if isPri == 'PRI':
return jsonify({fd:isPri})
else:
... | 1 |
706a9891fcdd087cc7b7675e3f8189b8 | e4ecea1bda840f0ae7d989e39b4aaa1b | 清洗低质量数据列 | def marge_less(df, threshold=0.1):
for lineNum, col in enumerate(df.columns):
tmp = pd.DataFrame(df[col].value_counts())
cout = df[col].count()
tmp['Share'] = tmp / cout
lesst = tmp[tmp['Share'] < threshold]
df[col] = df[col].replace(lesst.index.values, [str(lesst.index.value... | 1 |
71d8002f41ee6eb9bc1f46c4989c120a | e4ed14ada02d89de4c7f2081dae3f2bd | Given 1D arrays for lapse rate and change in height, and a threshold, find tropopause. | import numpy as np
import inspect
import seawater as sw
m = len(s)
starti = np.min(np.where(((p - 10.)**2 == np.min((p - 10.)**2)))[0])
pres = p[starti:m]
sal = s[starti:m]
temp = t[starti:m]
starti = 0
m = len(sal)
pden = sw.dens0(sal, temp)-1000
mldepthdens_mldindex = m... | 0 |
92b2857f865269734f5a1dcb6ba8bab4 | bf356ba5c6b15ab5205e9760494c801a | Returns ``True`` if ONNX Runtime dependencies are installed and usable
to support TorchDynamo backend integration; ``False`` otherwise. | def is_available():
return importlib.util.find_spec('rknn') is not None | 0 |
d76de44111c39bc9a6e5ea7c470ebca4 | d93b7345aa5b27933c781dca51f06c01 | Returns the maximum number of events that is used for initializing
each replication | public long getMaximumNumberOfEventsForReplications(); | 1 |
b9e147157d3cf7e1bfd1328f9b481063 | a79829b2de045e05f055bd2cb65e2cc8 | Initialize the list into an empty list. Returns TRUE if all is well | void InitializeList(List * plist)
{
*plist = NULL;
} | 0 |
b50a7d4d25dd01b9043de2548a34b8d8 | 8595aaf24341eaa8888ea48b25b6ae48 | Makes the entire window of the specified process transparent. | namespace Thrak. WinAPI. DLL
public static partial class User32
[DllImport ( USER32, SetLastError = true, CharSet = CharSet. Auto )]
public static extern IntPtr DisableProcessWindowsGhosting ( ) ; | 0 |
02831c411feff4a6204973a81f86cc0f | 19b4ba285f2d46689d5ce82933120df7 | Returns a bool from the application of And (lhs && rhs). | class LU:
def andr(params):
return {
'main': params[0] & params[1],
} | 0 |
0df58f815726471ace1aa1a95314892a | bab96eed884c9e7bc0454df8e2345ee4 | Assigns a callback for notifications of an update to a value in this configuration.
``ValueReceiver.changedValues()`` is invoked when the specified
``Value`` is updated in this configuration. | class ConfigPanelWidget(BaseWidget):
def setValueSetter(self, valueSetter: Callable[[Any], None]) -> None:
self._valueSetter = valueSetter | 0 |
494a59674b0c8e7a660e80ca93697932 | 537dc4cb6d4c45ded84510071484754a | 通过crontab表达式获取之前运行时间 | if (StringUtil.isEmpty(cronExpr)) return "";
long time = getTimeInMillisByCronExprByWeek(cronExpr);
return TimeUtil.getHHmm(time);
} | 0 |
dac6071d83d30218e90fd5decf3cc1ab | 5db37101e3c975c075c2d44d2bbed8f1 | Static constructor for creating default unauthenticated mocked user object. | namespace Infrastructure.Services.Github.Client
[Singleton]
public class GitHubClientFactory : IGitHubClientFactory
public Task<GitHubClient> NewUnauthenticatedClient()
{
return Task.FromResult(new GitHubClient(new ProductHeaderValue(_credentials.ApplicationUserAgent)));
} | 0 |
71538f5412dedfdc34413a113057c335 | 77ad2b38231ffff9bf12f2e290bd6026 | Return an associative array representation of this component | abstract class Component implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
public function toArray()
{
return array_merge($this->attributesToArray(), $this->relationsToArray());
} | 1 |
d87dadb1bc4b6c7e65b80fd968c53a53 | 9c108d4eff9573bdd9134bdcda14791f | Return the cut button active only if the content type is allowed. | {
if (rex::getUser()->hasPerm(static::getPermName()) && true === $ep->getParam('perm')) {
$status = (bool) static::getValueOfSlice($ep->getParam('slice_id'), 'status', 1);
$mode = $status ? 'visible' : 'invisible';
static::addButton($ep, [
'hidden_label' =... | 0 |
86687b3addbf339c5074daf236ed7cc8 | 84429bd0f4a206f4213c0ba99fbcc673 | Creates the main GUI-window for the server-application. | public class ServerApplication
public static void launchGUI(ServerInterface sInterface)
{
ServerWindow window = new ServerWindow(sInterface);
} | 1 |
88fd37e5edc3bd89387ec8c513475af9 | d29d85803338f3805c808cb051dd1ae0 | @brief set the inferred type for binary operations | class PyccelBinaryOperator(PyccelOperator):
def _set_dtype(self):
integers = [a for a in self._args if a.dtype in (NativeInteger(),NativeBool())]
reals = [a for a in self._args if a.dtype is NativeReal()]
complexes = [a for a in self._args if a.dtype is NativeComplex()]
strs = ... | 1 |
2ca56fbe090d92052ed0f8ab49308c37 | 898b5c6c6e189c8a7c54faf63c5b8518 | Tests if fetching average sentiment for single stock works | $client = new Socrata("soda.demo.socrata.com", getenv("APP_TOKEN"));
$response = $client->get("6yvf-kk3n");
$this->assertGreaterThan(0, sizeof($response));
$this->assertGreaterThan(0, $response[0]["magnitude"]);
} | 0 |
61c0ede90dd5403685eafa36a0aa8dba | 95764ba67a58fb8c7a1720a744675640 | 字母坐标->数值坐标 | void get_number_notate(char *column, char *row)
{
*column = *column - 'a';
*row = '8' - *row;
} | 1 |
360e50a700c7bb060255325adec0156b | 70da473225b16a812233fe33af4f0814 | monotonic time in nanoseconds | unsigned long timer() {
struct timespec currentTime;
if (clock_gettime(CLOCK_MONOTONIC, ¤tTime)) {
return 0;
}
return currentTime.tv_sec*NANOSECONDS_IN_A_SECOND + currentTime.tv_nsec;
} | 1 |
b553ad609e77244805a8df4e79da7d92 | 4266a8baf02504f600ecf78f99833ba6 | ランダムにビルド成功時メッセージを取得します | public class MathQuiz extends ConsoleProgram
private String generateSuccessMessage()
{
RandomGenerator rand = RandomGenerator.getInstance();
return SUCCESS_MESSAGES[rand.nextInt(SUCCESS_MESSAGES.length)];
} | 1 |
f564590f5b27d7bdbe365afb81280e2f | abe15511abce1504483582883293cdaa | Спрайт для бафа востановления очков здоровья | class Recovery(Item):
def __init__(self, x, y, machine):
image = pygame.image.load("img/item/recovery.png").convert_alpha()
super().__init__(x, y, image, machine) | 1 |
187cfdc07b84aaa79f4a91f8146a4abf | 93402bfa42b39a3c361d9a3c8b49b932 | initiate a fade from the current screen color (set using "SetScreenOverlayColor") towards "newScreenOverlayColor" taking "fadeDuration" seconds | transitionFadeIn( NewScreen )
NewScreen.opacity = 0
NewScreen:raise_to_top()
NewScreen:animate( { duration = 500,
opacity = 255,
} )
end | 0 |
1fb0120ae501a0242c4887fa4f4dcb9a | 40762f05ab28773efc699da64a03da7d | Very simple spaceship operator based on the object key
For existing objects that shouldn't be the case in most situations as
a collection mostly contains only objects of one kind | class VersionCompareKey:
def __init__(self, obj):
self.obj = obj | 0 |
9af9b50201bf5e46c6a325f2251cc699 | 4e5f1256f75146cad417a72c3d9d133a | 显示3D仿真实验题DIV的函数在这里! | var number = "";
var comMoveWid = Math.ceil(($("#guidePoint").width() - $("#moveBox").width())/2),str='';
$('#studyInfo').html("");
$('#loreBtn').hide();
$('#exampleBtn').show();
for(var i=0;i<list.length;i++){
str += '<div class="listPart jietiPart">';
str += '<div class="smTit"><span class="lineSpan"></spa... | 0 |
75531fd3f37ff81e3c0c6f7db5df1504 | 75afea31409373a7e4170ef010f43a52 | Responds to requests generated by subscriptions registered with
the SharePoint WebHook REST API. | if (!request.content.webhookEvent) {
this.app.getLogger().error('Unrecognized request type');
return this.success();
}
let handler: OnIssueEndpoint | OnCommentEndpoint;
switch (true) {
case request.content.webhookEvent === WebhookEventEnum.IssueUpdated... | 0 |
bac3e1395f6933a366cfaea258db9726 | ed8bfd3cc28c121376265614dd605c7f | Returns a number for a controller, otherwise -1 if none are available. | INT16 get_controller_number(INT16 driveno)
{
INT16 cno;
INT16 dd, ddd;
if (driveno >= TOTAL_DRIVES)
return (-1);
dd = 0;
for (cno = 0; cno < N_INTERFACES; cno++)
{
ddd = dd + drvs_per_controller[cno];
if (driveno >= dd && driveno < ddd)
break;
dd = ddd;
}
return(cno);
} | 1 |
f439bcdfa4696ad5c7091c45bc61da5b | dfeb061763045182dd50865d2e10098d | サーバーから指定のAIを取得 | def get_ai_list(token):
return fetch_api('/ai', token=token) | 1 |
96acf72a85b2b1f0e13fd069a0b31812 | f7af02d785c3a39e30c509e96fe4a7e9 | Makes a pizza | public abstract class PizzaStore
public Pizza orderPizza(String pizzaType) {
Pizza pizza = createPizza(pizzaType);
pizza.bake();
pizza.cut();
pizza.box();
return pizza;
} | 1 |
131592b9951dd6d2cc5dc029f29342ea | a10d4efdeb494a0f504fd16a39cdad74 | Tests that a call to the add endpoint is successful with valid data | with self.client:
response = add_customer(self)
response_data = json.loads(response.data.decode())
self.assertEqual(response.status_code, 201) | 1 |
5488544eaeba2354900c19f997607906 | dba8c2d81e6c80b0e2fcc4c5f582e206 | POST /post18s
POST /post18s.xml | @post163s = Post163.all
respond_to do |format|
format.html
format.xml { render :xml => @post163s }
end
end | 0 |
e99d853df6204168997ae433e1540d7d | c65a8898c5d9239e657377472ce9e8c5 | Evaluates a set of predictions using the appropriate script. | parser = argparse.ArgumentParser(
description="Computes evaluation metrics from prediction files after \
you have run an experiment.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('examples_file',
help='SKLL input file w... | 1 |
87ef2c41cbe4252ada99a7c0aeec543d | 118a168b1cb6ddc932efe4e3549f7b9f | 找数组中最小的不存在的2的幂 | int x =0;
for(int i = HIGH_BIT; i >=0; i--) {
Set<Integer> seen = new HashSet<Integer>();
for(int num : nums) {
seen.add(num >> i);
}
int xNext = (x <<1) + 1;
boolean found = false;
for(int num : nums) {
... | 0 |
b3a09dfc2b23a4ef2c5c6eb8e2e6f979 | df1095d9dcd531943cbe5596ac993ed1 | obtiene los filtros disponibles de eventos | $db = JFactory::getDbo();
$tbl_sasfe_tipo_eventos = $db->getPrefix().'sasfe_tipo_eventos';
$query = "
SELECT * FROM $tbl_sasfe_tipo_eventos WHERE activo=1
";
$db->setQuery($query);
$db->query();
$rows = $db->loadObjectList();
return $rows;
} | 1 |
3aec843e337ba0097274a4113970578c | 537f856c02fb21e9ab122108d3192c29 | >>>>> Use browser back button to close gallery and see thumbnail <<<<< | if ((PIC_INDEX + 1) > 1) {
PIC_INDEX--;
console.log(PIC_INDEX);
} else {
PIC_INDEX = PIC_NUM - 1;
}
THUMB_PIC = $('.gallery .thumbnail img').eq(PIC_INDEX).attr('src');
THUMB_H3 = $('.gallery .thumbnail img').eq(PIC_INDEX).attr('alt');
$('.gallery .ligh... | 0 |
333634c2c7c18bf7c02f1246deaf98fb | 3cb1ecd07fedf15e32d17b2155753bff | Get the current configured gravity state for mapbox_compass_icon for a map view. | Gesture getConfig(String direction); | 0 |
abde5374fcf991af9059357487da41b1 | a30b633a443c5a57f426941277cb81ed | 响应邀请宾客 | {
int inviterId = msg.getBuffer().readInt();
boolean accept = msg.getBuffer().readBoolean();
responseTeam(inviterId,accept);
} | 1 |
855cd02660b9d240f03487a3f74038f1 | 3d25c661751c36c18274f4fd3a43a7a6 | This function will return the state of the mutator. The returned value can be used to restart the
mutator at a later time, by passing it to the create or set_state function. It is the caller's
responsibility to free the memory allocated here by calling the free_state function. | void dynamorio_free_state(char * state)
{
free(state);
} | 0 |
56e7f2ca679b1f5b9bf9d4b6efbd2ba0 | a3e1f759baeca572d4e0af32175657e2 | Returns the controls associated with an app-provided map. | @JsType(isNative = true)
public abstract class PluggableMap extends Object
public native Collection<Control> getControls(); | 1 |
6c778a0948a034a75c3df356e6c2fd15 | 966d19744ad6e49dc87bea0c9551e3a8 | The trace functionality for XML output at initialization | public class OXPathParser/*@bgen(jjtree)*/implements OXPathParserTreeConstants, OXPathParserConstants
final public void enable_tracing() {
} | 0 |
92b02651c3ac07e621710abd1f8f6085 | 2f3aca5ebd7fcd6e0593097e12b653e3 | Move player 1 paddle. | class mainClass
movePaddle() {
if (this.rightPressed) {
this.paddle1.X += 3;
} else if (this.leftPressed) {
this.paddle1.X -= 3;
}
if (!this.multiplayer) {
if (this.moveTopPaddle) {
if (this.ball.dx === -2 && this.ball.dy === -2) {
this.paddle2.X -= 1.7;
}
... | 1 |
20584e19e9c23ef3f328de80e110f23d | 245ab5a6523547a2da0aec39a54acaa5 | Edits the name of the current collection.
*Arguments:*
* ``None``
*Keyword Arguments:*
* ``None``
*Returns:*
* ``None`` | new_name = self.widgets['change_name'].collectData('new_name')
self.widgets['change_name'].findChild(name='new_name').text = u''
if not (len(new_name) == 0 or new_name.isspace()):
RenameObject(instance, new_name).execute(self.session)
self._hide_change_name_dialog() | 1 |
6b2b594648f9c3afd8c8f322b3cbc5e1 | ae55ddc3fa00048f79212324c07467fd | 根据事件 参数 设置未处理消息为已处理 | public class NotificationMgr:Singleton<NotificationMgr>
private void RemoveMsgKey(EventCode eventCode)
{
if (null == eventList[eventCode])
{
eventList.Remove(eventCode);
}
} | 0 |
8ba9371a5f99cafef0d4d95f42bbb222 | 222da42f751cf4f7b4214a6a074d02ac | u'''
Заменяющая стандартный парсер функция, которая предварительно
прогоняет считанное содержимое файла через шаблонизатор. | class Genshi(object):
def template_parsed(self, callback):
self.callback = callback
return callback | 0 |
41c049f49836989683e9cb1cbc729218 | 40f74aa88bfba74c017a54101f476451 | Clears and disables all the saves options. | public class GameMenu : MonoBehaviour
public void SaveLoadDeleteNoButton()
{
gameNotification.SetActive(false);
saveYesNoButtons.SetActive(false);
loadYesNoButtons.SetActive(false);
deleteYesNoButtons.SetActive(false);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.