query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2d22f8905f8b28cfe617bc8b67c46c53 | 0ec91e6707ff7c5f23a132b1aef16966 | this code can only used for estimation of first passage time for diffusion
cannot be used to find shortest path | {
float check = (1 / tr);
int counter = 0;
while (logisticsFunc(a, counter) <= check)
{
counter++;
}
return a.getTimeInfected() + counter;
} | 1 |
03fc6c4d008d894fad937350e6bbdd3b | 6bad2c59a4b9be6750f9c9a24f9740e0 | 等待子进程全退出后主进程再退出 | def main():
p = Process(target=tm)
p.daemon = True
p.start()
sleep(5)
print('主进程退出') | 0 |
aad18609a60407f79eeca2c86cdf60d1 | 9a04485fb9e66e86eaff168a80de93f8 | 檢查同宮有沒有相同的數字, 若有傳回 1 | class sudoku{
check(obj,num){
if(obj.arr.length>1){
for(let i=0,len=num.length;i<len;i++){
obj.arr = obj.arr.filter(item=>item!==num[i]);
}
}
} | 0 |
3f21d8c01891a601e7682ca8322b727e | 5cb3f00558bacd1d753405355be4688b | Monitors a given process and its children | class ProcessMonitor(object):
def __init__(self, pid, interval, file=None, **kwargs):
self.pid = pid
self.interval = interval
if file:
self.file = open(file, 'w')
else:
self.file = sys.stdout
self.numProcessors=1
if "numProcessors" in kwargs:
self.numProcessors = int(kwargs["numProcessors"]) | 0 |
1ef768945ce17b49f46cd3291205fcd4 | 91e98fe7159688db75d695d9f39b4c4f | Inits PersonEntity's FieldInfo objects | static void nativeClassInit (JNIEnv *env)
{
jclass personClass = (*env)->FindClass(env, JNIPAR_CLASS);
gPersonOffsets.name = (*env)->GetFieldID(env, personClass, "mName" , "Ljava/lang/String;");
gPersonOffsets.age = (*env)->GetFieldID(env, personClass, "mAge" , "I");
gPersonOffsets.height ... | 1 |
553ae436004ec798e1817184f761a2ac | a5cc46a1bbb4b5f486a767cb9618f328 | Returns workflow cycle rows. | if filter_exp:
filter_exp = u"?filter=" + urllib.quote(filter_exp)
url = (u"/workflows/{workflow_id}"
u"{filter_exp}"
u"#current_widget/cycle/{cycle_id}").format(
workflow_id=cycle_task.cycle_task_group.cycle.workflow.id,
filter_exp=filter_exp,
cycle_id=cycle_task.cycle_task_... | 0 |
ca9128d13c4092b2ac296e588cd06fd0 | 1ae33c4e9bfc90b58cefe190fa7c6a14 | Sets new toolbar to action activity's actionBar | public abstract class BaseActivity extends AppCompatActivity
public final void setCustomActionBar(Toolbar actionBar) {
setSupportActionBar(actionBar);
} | 1 |
13110e4175c7981cc2d79b9a9b574a5a | 756097e797de6b391760becfeef42553 | Prepare conditional logic settings | function prepareSettings(first = false) {
setupSettingsTabs()
initSettingsValidators()
initSettingsValues()
prepareJavaTab()
} | 0 |
ef4e0fa479ea41c471dca7218d860509 | b8955bf03b0fd00711dd7e58aa8b6cf3 | @brief Checks if the exit requested flag is set. | bool HumanPlayer::exitRequested() { return exit_game; } | 1 |
742a81ae281e0ac7793c581469e21dcc | 8d09d364390cd15d9df7af81e21b3f1c | Generated on the fly, so just return expiry of one hour | class SimpleDelayingThrottle(AbstractDelayingThrottle):
def get_cache_timeout(self):
return 3600 | 1 |
6768cc1e45eeeb23f593f95cc1aeb6f9 | f76930d33914d8a149fd82e4db050d9e | Extracts the two water autotiles from provided chipset. | namespace RM2k2XP.Converters
public class RPGMaker2000ChipsetConverter
private List<Bitmap> ExtractWaterAutotiles(Bitmap chipsetBitmap)
{
List<Bitmap> waterAutotilesBitmaps = new List<Bitmap>();
for (int waterAutotileIndex = 0; waterAutotileIndex < 2; waterAutotileIndex++)
... | 1 |
f327c54412db709141afbdb21b7a1587 | ba751206700ed0d34ee636935ce66866 | Return sorted content types for all registered models. | return {
k: get_content_type_for_model(m)
for k, m in KLASS_MAP.items()
} | 0 |
66a283418537aa595fdd1894a07ffdce | 9a16b49bc0d026d83245c58d021f8d4d | Suppress unwanted fields from scanned map IIIF manifests | return key === "start" ||
key === "end" ||
key === "loc" ||
key === "directives" ||
key === "leadingComments" ||
key === "trailingComments" ||
key === "innerComments" ||
key[0] === "_"
? undefined
: value;
} | 1 |
10382dcb02adee6ccb0220452dd6af49 | a40740491743fcff9d52bf40cabfd870 | Get position margin change history
https://binance-docs.github.io/apidocs/futures/en/#get-postion-margin-change-history-trade | params = {'contract_code': contract_code,
'size': size}
url = self.__url + '/swap-ex/market/history/trade'
return http_get_request(url, params) | 0 |
dbd0ced229fa0fb162facabc13b8cad0 | 8d2c0613f49a21e398fd56fb2098d095 | see http://bugs.python.org/issue2578 - by design it
only uses rich assertion if the two objects are the
exact same type | class ReallyEqualMixin(object):
def assertReallyEqual(self, a, b):
self.assertEqual(a, b)
self.assertEqual(b, a)
self.assertTrue(a == b)
self.assertTrue(b == a)
self.assertFalse(a != b)
self.assertFalse(b != a)
self.assertEqual(0, cmp(a, b))
self.assertEqual(0, cmp(b, a)) | 0 |
e91d7baf8d6f4aa3e15e20deef20c2fe | f2bda97441eb920e61c1e4ff7e6dd471 | Access HSL API to retrieve GPS coordinates for each Waypoint (if stopCode is available). | bool get_waypoints(const lon_lat_32& start, const lon_lat_32& end) {
enum {REQUEST, NUMBER, WAYPOINT, TIMEOUT, DONE, NONE} current = REQUEST;
String identifier, points, lat, lon;
int waypoint_index = 0;
while (current != DONE) {
if (current == REQUEST) {
Serial.print(routing_flag);
... | 0 |
21283bba44a2d9d80459b2cf1afd2fd9 | c277d1983e2eaf8cb0d87ddaa6d51c7e | Fuction to populate expense summary for edit | class ExpenseController extends Controller
public function EditExpense($id)
{
$tdy = DB::table('expenses')->where('id',$id)->first();
return view('edit_expense',compact('tdy'));
} | 1 |
9295d8d5b2af9741947b5617835a2f86 | 8337732a744b6f8b1536198552c20b32 | 计算css类名 | c (className) {
const { name } = this.$options
return className ? `${pre}${case2Param(name)}${className}` : `${pre}${case2Param(name)}`
} | 1 |
4ac861993262a43905cf5b756ac2ab73 | 01903bdc1e251888ca5a948fb05525d2 | Determines an appropriate java type to use for the given sql type name.
could be found | Type type = null;
switch (sqlType) {
case Types.BIGINT:
type = Hibernate.LONG;
break;
case Types.BOOLEAN:
type = Hibernate.BOOLEAN;
break;
case Types.CHAR:
type = Hibernate.CHARACTER;
break;
case Type... | 1 |
4375d969dc9513a39d8a3c65cbcb5777 | 5ee82db6665421d7b64d76f050d38f0e | TO WRITE | uint16_t FATFile::write(const char* buffer, size_t length)
{
return 0;
} | 1 |
31ad8e9690db953e12f7e64fc1c21b4b | da72ede3511e9b8b28fe64984b178175 | 批量新增雷射定位儀資訊 | public int[] batchAdd(final List<Meas> list) throws SQLException {
String sql = "insert into Em_Meas (meas_Mrid,name,meatype_Mrid,phase,obj_Mrid,measource) values (?,?,?,?,?,?)";
log.debug("sql=" + sql);
return this.jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
@Override
public void se... | 1 |
fe188fa8d1bdaad8b1141bc8fb46bdc7 | 6c3bce75568e4cc523be6a20719c1931 | A nested block containing configuration options for Oracle connections.
*See Configuration Options for more info* | class Oracle(object):
def __init__(self, di):
self.host = di['host']
self.user = di['user']
self.passwd = di['password']
self.db = di['db']
self.con = None | 1 |
951df646738df645b28ead87ed69eb57 | 91e4c1aefc2dfb49ce48ddfb0f0364ee | Gets a name that's not already in the graph. | while 1:
aux = generate_name(x, model, verbose=0)
if aux.lower() not in set(names.apply(lambda x: x[:-1].lower())):
break
return aux | 1 |
b0e2e52f9caf846c87d2f9660f713631 | 9cfcc042c77beb444362b2aa6bedccb1 | Updates a user preference and calls all added callbacks. | this.log.info(
`Value for ${this.state.pendingAction} will be set to ${value}`
);
setStorage(`prefs.${this.state.pendingAction}`, value);
setStorage("prefMode", "true");
this.log.info("Reload the page to apply the new preference.");
} | 0 |
55abd18894420138ac20b2df30138c2b | 31b251b76dbea562b2d3ff02777597ef | determina se può causare danni critici | if self.crippling() is not False:
if sum(self.wounds) > self.crippling():
return True
return False | 1 |
d162284a3873ad55bcd8ef427cab9b9f | e40aae22034188a0c95d0b058dfc9289 | Kaydı onarır. | class KahveYapma:
def kahve_yap(self, siparis):
for item in siparis.icerikler:
self.kaynaklar[item] -= siparis.icerikler[item]
print(f"{siparis.isim} içeceğinizi alabilirsiniz. Afiyet olsun!") | 0 |
f97bbb0ee80bb71b760d6f7030cf0607 | 33d2950dc5a3e700249503658eaa9c2b | Determines if should fetch based off a cache time | export class MgtSearchResults extends MgtTemplatedComponent
private shouldRetrieveCache(): boolean {
return getIsResponseCacheEnabled() && this.cacheEnabled && !this.isRefreshing;
} | 0 |
b46d94336c136c7759b60bc26a5b3c30 | ce7b54e18f10bf6d8191c54e47e278f7 | Access control list strategy that prevents anyone from doing anything. | class ForbidAll(object):
def __call__(self, authorization, requested):
return False | 1 |
ff21e56e663ef7ad7ff767145e07e20e | 59c94c5a8e22a41a122aa73b1c04279f | ! Extract a number of memory page spans from the global cache for large blocks,
similar to _memory_global_cache_extract | _rpmalloc_global_get_reserved_spans(size_t span_count) {
span_t* span = _memory_global_reserve;
_rpmalloc_span_mark_as_subspan_unless_master(_memory_global_reserve_master, span, span_count);
_memory_global_reserve_count -= span_count;
if (_memory_global_reserve_count)
_memory_global_reserve = (span_t*)pointer_off... | 1 |
1c621f920aaab21df030d03df62833d8 | 8c09e6ac69b3172e2d99c6e82aede40f | Sleep until a semaphore slot is acquired. | namespace Qoollo.Turbo.Threading
[DebuggerDisplay("CurrentCount = {CurrentCount}")]
public class SemaphoreLight: IDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Wait(CancellationToken token)
{
bool semaphoreSlotTaken = Wait(Timeout.Infinite, token, true);
... | 1 |
764bbf8af6019ea88c7a531e63e1f52b | 82d084337886762b44d422353e83764e | 获取Type12材料卡片 | namespace HanGang.MaterialSystem.MaterialTrials
public class MaterialTrialAppService : MaterialSystemAppService, IMaterialTrialAppService
public async Task<JObject> GetType15CardInfo(GetType15CardDto input)
{
string name;
string mid = " 1001";
string ro;
... | 0 |
b5f37ddb8d0aa819902122baad724f87 | a4fce11a9d7e2230092a27d19aef208b | !
Updates the settings screen strings based on current settings. | SetWindowText(hwnd, getLangString(gSystemSettings.lang, IIG_LANGSTR_SETTINGSLBL));
SetDlgItemText(hwnd, ID_GROUP_EMUMODE, getLangString(gSystemSettings.lang, IIG_LANGSTR_EMUMODELBL));
SetDlgItemText(hwnd, ID_RADIO_EMUMUSIC, getLangString(gSystemSettings.lang, IIG_LANGSTR_ACTMUSICLBL));
SetDlgItemText(hwnd, ID_RADIO... | 1 |
ef0b50a9753411c37f050aa8fecdbe55 | 8327db3318e6148c2cf3b196081ecbd3 | A recursive subtraction method. | public class Subtraction implements Operation
@Override
public Result perform(final Input input) {
final int num = input.getValues().get(0);
return Result.builder().result(input.getValues().stream().skip(1).reduce(num, Math::subtractExact)).build();
} | 0 |
dbc6304dcaddcc180b1e4ab9405033d9 | a3a67038152bc92ba1ad95dbe2a95a71 | Check can send message to user | $feedItems = array(
array(
'feed_id' => 1,
'target' => FeedModel::INBOX,
'user_id' => $this->User1->getId(),
'owner_id' => 1,
'created' => date('Y-m-d H:i:s', \Application::getInstance()->getTime()->getTime()),
... | 1 |
463547d2b187ccc6b1dd1947e3ac1d5e | d00d16ee97db6fc0bfc35e1f821ab943 | 构造一本空书 | constructor(title: string, author: string) {
this.title = title;
this.author = author;
this.contents = new Array<Item>();
} | 1 |
839ca5d3c6f53a58fd2c0ba8eb5e66f7 | 42ddc94a7333f4d87957457a73bd3b15 | This method determines if the internal default {@link #iterator() types} shall be extended, when
configuring {@link SearchEntryType}s. In this case existing types are replaced if overridden. This is the
default. If you want to reduce the number of {@link #iterator() types}, you need to set this to
<code>false</code> an... | void setUsingExternalTypes(boolean useExternalTypes); | 1 |
217af3f18ec990c6ab7e1cc7fd012415 | 4a9200a70d18bcd8076c2a16f5f33a7d | Reloads queued telecommands based on the transmission pass ID given. | CmdStream* pCmdStream,
ComputeQueueDeferFreeList* pList,
uint32* pIndex,
uint64 lastTimeStamp)
{
if (lastTimeStamp == 0)
{
pCmdStream->Reset(nullptr, true);
}
else
{
pCmdStream->Reset(nullptr, false);
Pal:... | 0 |
ff5e799a8db944e831b51b54f8533e6e | 3b06b51e7f06d499beb19bb3bdb54844 | activity销毁时清除所有消息 | public class HandlerActivity extends BaseActivity
@Override
protected void onDestroy() {
super.onDestroy();
mHandler.removeCallbacksAndMessages(this);
} | 1 |
5e85521c39a15dd9651325fa28cc8a79 | 9df77841758535a48af2163c87349361 | Sets texture color modulation | void setTextureColorMod(SDL_Texture *t, uint8_t r, uint8_t g, uint8_t b)
{
SDL_SetTextureColorMod(t, r, g, b);
} | 1 |
be507b81c83f401c3cfa92d718737d71 | 2bf3c93caa71f874132a60ef6c781b3d | Perform any manual connection closure procedures if necessary. | try:
self._client.serial.close()
except:
self.logger.warning(
"Failed to manually close serial connection", exc_info=True) | 1 |
2df35597aeae91f62230ae322ef3edbe | 14ee7b1264d263ba5e8e2ab5e078420c | Parses message XML and returns a dictionary. | class NidhoggHttp(object):
def parse_xml_reply(self, xmlresponse):
return xmltodict.parse(xmlresponse) | 1 |
9f82c422db1d4caaff78b09a36c9ddb3 | ef8dddf63c0490e942e3828a8081e1b8 | Wczytuje do tablicy struktur dane z wejścia, zwraca długość tablicy | int n = 0;
int c = 0;
String[] tokens;
String delimit = "[ ]+";
String sIn = f.readLine();
while (sIn != null) {
tokens = sIn.split(delimit);
for (int i = 0; i < 5; i++) {
try {
l[n] = Integer.parseInt(tokens[i]);
c = Integer.parseInt(tokens[i])... | 1 |
cb5260f9c36cf80b6c4030d90e60dbfc | decd51a378efb6d9086c31d323d39ecb | Method to create the CDR risk analysis questions. | class CSCIRiskAnalysis(gtk.VPaned):
def __init__(self):
gtk.VPaned.__init__(self)
self._lst_handler_id = []
self._software_model = None
self.chkCDRAMQ3 = Widgets.make_check_button()
self.chkCDRAMQ4 = Widgets.make_check_button()
self.chkCDRAMQ5 = Widgets.make_check_button(... | 1 |
56cc973acdb6da17eb0e96dc8c2f1693 | ad2b1675e4497d97681fdbfad8721675 | funcion para controlar el movimiento del raton | function teclado(evento){
var paso = 10;
switch (evento.keyCode) {
case teclas.UP:
y1 = y1 - paso;
break;
case teclas.DOWN:
y1 = y1 + paso;
break;
case teclas.LEFT:
x1 = x1 - paso;
break;
case teclas.RIGHT:
x1 = x1 + paso;
break;
default:
}
dibujar();
} | 0 |
c81c2e28a677f5a65b9a39aa0fa3e852 | 7426b54feda94b02a24d1d3c77477dd8 | 回到最近一个activity | WeakReference<Activity> activity = null;
try {
activity = activities.get(activities.size() - 1);
return activity.get();
} catch (Exception e) {
Zog.i("none activity.");
return null;
}
} | 1 |
a24b78c088f6e83fe318f8368b960399 | 0fd59f8940f118d0bc38eafc10779520 | Retrieves an API's entry point resource. | @Component
@RequiredArgsConstructor
@Slf4j
public class EntryPointUseCase
public List<UserGroupEntryPointDTO> queryApiByResource(String key) {
List<EntryPointConfig> entryPointConfigList = new EntryPointConfigGroups(entryPointConfigRepository).getEntryPointByKey(key);
List<EntryPointConfigGroup> entry... | 1 |
9c8ad01c9143875c009afeeffc2c693a | a4d028fa0d50fd76e55a8d573fbe49f5 | 将指定该用户踢出房间 | @Controller
@RequestMapping("/room")
public class UserRoomController
@RequestMapping("/kick_out")
@ResponseBody
public Response getOutRoom(@RequestParam String uid, @RequestParam String roomId) {
Response response;
try {
response = userRoomService.getOutRoom(roomId, uid, roomId);
... | 1 |
246002a1f9b13dd17e5e3a87e025f438 | 5561d1d75584ef38783a8a6d43ad366f | 将选中的操作添加到菜单下 | {
Menu *m = this->checkedMenu;
if (m == nullptr) {
qDebug() << "null";
} else {
qDebug() << m->name;
QListWidgetItem *item = new QListWidgetItem();
item->setCheckState(Qt::Checked);
item->setData(Qt::UserRole, m->price);
QString qs;
item->setText(qs.a... | 0 |
3586eb976493965a38b56a6f48c5f7ab | a810fe664a4c9daad27931be0dd5d89c | 개별 주문 조회: order_uuid를 통해 개별 주문건을 조회한다. | public OrderDetailDTO findByUuId(@Param("uuid") String uuid); | 1 |
89bbb5cd734b145e633e984d0189688d | 1227a3d7aefe42164fcac0723815c1eb | Bring the button back to its default location | public class VRButton : MonoBehaviour
public void Reset()
{
this.transform.localPosition = startPosition;
rigidbody.velocity = Vector3.zero;
} | 1 |
30e87e12cae74e7fe57c4af03b716ca1 | b57606ca25b917814c6dac338e4ed896 | Displays the version number in the response header. | func Version(c *gin.Context) {
buildNumber := os.Getenv("BUILD_NUMBER")
if buildNumber == "" {
buildNumber = "no build number available"
}
result := fmt.Sprintf("buildNumber: %s\r\n" +
"uuid: %s", buildNumber, uid)
c.String(http.StatusOK, result)
} | 0 |
06fa55adbdbd22e389113001fb5822b9 | 0178ef7b169bb8b44bc8629750164393 | Is this card an ace? | export class PokerHand
public hasAce(): boolean {
return this.cards.map((card: PokerCard) => card.value).includes('A');
} | 0 |
4be6542cbcec4f57974b8bdd0d8e0f2e | a7279697a1067a9843e4d0dd0b28ae57 | 1、根据传入的cid,获得要删除的一级分类Category对象
2、调用业务层方法进行删除 | @Service
@Transactional
public class CategoryService
public void deleteCategory(Integer cid){
categoryDao.deleteCategorySecondByCid(cid);
categoryDao.deleteCategory(cid);
} | 0 |
75918822c7f2af9dd73863ffcf9ef7ab | 6b84dfb14db21956416aa7aefb99d095 | Die Methode liefert die Beschreibung zur Serien-Wiederholung als Text zurück. | {
if (Repetitions[index].Count == 0)
return "";
else
{
StringBuilder output = new StringBuilder();
output.Append("(");
foreach (KeyValuePair<int, int> rep in Repetitions[index])
output.Append(... | 1 |
b2f0a1ab69e69497078d4b47cfd9fd93 | 212a34a16d256452c4578c3d6aea7a3f | Update local preference from version store on Cloud (usefull when preference was updated on Cloud) | public class ALPreferenceManager extends ALProxy
public void update() throws DynamicCallException, ExecutionException{
call("update").get();
} | 1 |
8becd3419789b3d5fbe961f05387e0bb | 3c93f55fc5b1e8289221207e3d204085 | サンプルデータ表示ボタンクリックイベント。 | {
try
{
OpenSamplePnl((Control)sender);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
} | 1 |
022a5b5f25a4427bc2f38932360c3594 | bd63b0a4d4a7a7d61ec7213132d9cb17 | Returns a list of all current secretaries | @Stateless
public class UserDao implements UserDaoLocal
@Override
public List<User> findAllSecretarys() {
Query q = em.createNamedQuery("User.findByRole");
q.setParameter("role", "secretary");
List<User> users = q.getResultList();
return users;
} | 1 |
0b76f1144eb36f0c2b257cee942d831f | 81a1a44a84daeac7537a6027d1d89ff0 | 根据搜索条件,分页获取JobLog实体 | namespace GrainManage.Web.Controllers
public class LogController : BaseController
public ActionResult JobList(InputJobList input)
{
if (IsGetRequest)
{
return View(CurrentUser);
}
var result = new BaseOutput();
var filter = Expressi... | 1 |
5980875be24c68352a0d7972a15944f1 | 1c1b178f78082cb877acba961d595c17 | poll for proposal messages | class NetworkIOMPI : public galois::runtime::NetworkIO
void probe() {
int flag = 0;
MPI_Status status;
int rv = MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &flag,
&status);
handleError(rv);
if (flag) {
++inflightRecvs;
int nbytes;
... | 1 |
1f43fc631410859724a978edfe913fbc | 560144ae2f42c91da0febe2aa78dabd8 | POST /sizes
POST /sizes.json | @text_size = TextSize.new(params[:text_size])
respond_to do |format|
if @text_size.save
format.html { redirect_to @text_size, notice: 'Text size was successfully created.' }
format.json { render json: @text_size, status: :created, location: @text_size }
else
format.html { ren... | 1 |
44c2b62815bf275d72eaadd3efac65f4 | e4372fe77cac7c985087491d7057669e | Set 当前标准存储量,单位是字节。 | @Table(name = "t7_spg_detail")
public class T7SpgDetail extends T13GdsDetail{
public void setQlyStd(String qlyStd) {
this.qlyStd = qlyStd;
} | 0 |
e9664045e1d6fdb48519a5a0e21be4bc | 7947ffe6bc281aa52ab43c1c7451d9a5 | ReplacingPlaceHoldersInFiles replaces placeholders in file from values provider | var s = myFile.Substring(0);
foreach (var kv in processors)
s = Regex.Replace(s, "%" + kv.Key + "%", kv.Value());
return s;
} | 1 |
c9f25122ceb1cde972150d5f8682b0b8 | ca6ef909da0650f312e1c1f726223aab | Returns the result of interpreting the object as an instance of '<em>Communication End Point</em>'.
<!-- begin-user-doc -->
This implementation returns null;
returning a non-null result will terminate the switch.
<!-- end-user-doc --> | public class EsbSwitch<T> extends Switch<T>
public T caseAbstractEndPoint(AbstractEndPoint object) {
return null;
} | 1 |
cf23c54ce3dee0f25250adb3842b8de5 | 998b7e26d5d412b2771481bc7e5fd752 | Name of the Custom Assessment Automation. | class CustomAssessmentAutomation(pulumi.CustomResource):
def assessment_key(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "assessment_key") | 0 |
bc552a7ff526cbc25f4355ce26c855c4 | 0833a03f94c02158e17b18ac354788a2 | Tests each method that changes a timestamp that it properly validates its
argument to be an int. | start_time = 1455394075
end_time = start_time + 604800
for epoch in range(start_time, end_time):
ftime = interface.epoch_to_ftime(epoch, TZINFO)
epoch2 = interface.ftime_to_epoch(int(ftime[2:6], 16), int(ftime[6:], 16), TZINFO)
assert epoch == epoch2 or epoch == epoch2 + 1 | 0 |
2e26e44df3fff627a889d1017fa64417 | 700b6ff7622fbe3126f6b0bc9e45bc59 | Maps argument passed from cli to docker-compose service name | service = service or ''
env = env or ''
return 'service:' + service + ',env:' + env | 0 |
9605ff19f1eca04fc881ce8e99a25910 | 55b4c950518d2a46160f603c06e0a4df | get a function to generate pseudo-population from a representitive group | random.seed()
r = random.random()
c = 0
for (index, item) in enumerate(plist):
c += item
if r < c:
return population[index] | 0 |
23758815d4a265920466a4d736085ff0 | 492ca08a7470d1a51766cd48aedcdda7 | Returns the user's access token if it is logged. 'null' otherwise. | class AuthProvider
getAccessToken() {
return null;
} | 1 |
53ce3e5b6829fc4da3468e4dfbec3d6f | ba63a846cb369a1739e1b18072b9cafe | Send a request to the TF-server to obtain a prediction. | logger.debug("Sending prediction %s for %d." % (str(prediction), seq_num))
response = {"SequenceNumber": seq_num, "Valid": prediction is not None}
if prediction is not None:
response["PredictX"] = prediction[0]
response["PredictY"] = prediction[1]
response = json.dumps(response)
response... | 0 |
cd1939f49cfa536b6672964ed94f1324 | c9fe1774791223c4662a3c866727cbb6 | Create a rendering frame around the target. | namespace hello
void Helper::renderFrame(
QPainter* painter, const QRect& rect,
const QColor& color, const QColor& outline ) const
{
painter->setRenderHint( QPainter::Antialiasing );
QRectF frameRect( rect.adjusted( 1, 1, -1, -1 ) );
qreal radius( frameRadius() );
if(... | 1 |
5931e5e887e9264601035cc8ef038a49 | aa64877f7761327c18f7a289b78a9f1c | converts a list to a char ** needed for ldap_search | static krb5_error_code
convert_realm_name2dn_list(char **list, const char *krbcontainer_loc)
{
krb5_error_code retval = 0;
char temp_str[MAX_DN_CHARS] = "\0";
char *temp_node = NULL;
int i = 0;
if (list == NULL) {
return EINVAL;
}
for (i = 0; (list[i] != NULL) && (i < MAX_LIST_ENTRIE... | 1 |
b9da1272483ae48e3f31939bc332b37d | d37def6a947d9541f64857be52132720 | output the packet to stdout | self.packet += "\nSrc: "+self.src.decode('utf-8')+"\nDst: " + \
self.dst.decode('utf-8')+"\nDatas: " + \
self.datas.decode('utf-8')+"\n" | 0 |
f65c213a74515bfcd692410eaa8e171c | 094d2d6958e6b2b858c41328930c007f | Sets the loc code of this interface request field. | public class DueInsDO
public void setLocCoCode(String theLocCoCode) {
locCoCode = theLocCoCode;
} | 1 |
8df3d14f4fbc0b6711a639dff8538161 | b50fa6f43f35242a49c2bebd1c3dea4e | Helper to validate Token algorithm, expire time, and claim value | def load_key(header, _):
jwk_set = JsonWebKey.import_key_set(client.fetch_jwk_set())
try:
return jwk_set.find_by_kid(header.get('kid'))
except ValueError:
jwk_set = JsonWebKey.import_key_set(
client.fetch_jwk_set(force=True)
)
r... | 1 |
ccafe6d96cd3781ba277b54e5b7d57d9 | 2c224685c971e46e1001933114da1adf | Gets the json instance for replay. | namespace RivieraStudio.Magic.Logic.Avatar
public class LogicAvatar
public virtual void LoadForReplay(LogicJSONObject jsonObject)
{
} | 0 |
80e4abbacd25757650651e8d16d38496 | 5bbbcaf3e802948c2ea3c64342b6a92a | Writes an event to the audit log when a user logs off. | class UserEventSubscriber
public function onUserLogout($event)
{
$actionLog = ActionLog::log(ActionLog::ACTION_LOGOUT);
} | 1 |
96a4111e34ff038863b347de82283445 | bd36069b11d16338e6fde4d5c5c725d6 | Gets the delivery options summary. | namespace MPD.Electio.SDK.Services
public class DeliveryOptionsService : BaseService, IDeliveryOptionsService
public Task<DeliveryOptionsResponse> GetDeliveryOptionsAsync(DeliveryOptionsRequest request)
{
return Rest.PostAsync<DeliveryOptionsRequest, DeliveryOptionsResponse>(request, string.Empt... | 1 |
b17266c329eae33342878252532635ba | c8091ff5ffb1d95b411873d2039442dc | Returns an enumerable that traces OnNext calls from the specified enumerable
and includes an auto-generated identifier in the trace output. | namespace KitchenSink.Collections
public static class ReplayableExtensions
public static IReplayableEnumerable<A> Replayable<A>(this IEnumerable<A> seq) =>
new ReplayableEnumerable<A>(seq); | 0 |
ec465d4458c1d5b5bae469fab71282fe | 4cf5bb3cfff4de41a8040e7335163274 | ExecEndHashJoin
clean up routine for HashJoin node | static void
sonarEndForeignScan(ForeignScanState *node)
{
ForeignScan *fscan = NULL;
psc_private priv = node->fdw_state;
fscan = (ForeignScan *) node->ss.ps.plan;
if( !priv )
return;
if( priv->uri->cursor )
{
mongoc_cursor_destroy( priv->uri->cursor );
priv->uri->cursor =... | 0 |
f933b1381faa992c57338024b44963ba | 6e7c00c29128ecf8eb5a2e9aa82c1ccb | Count number of mapped reads. | transcriptome_reads = 0
for gene_result in results:
if gene_result is not None:
logging.info("nreads: %d" % (gene_result['nreads']))
transcriptome_reads += gene_result['nreads']
return transcriptome_reads | 1 |
3a90e846bae934cd6c3d7a4f98c901f7 | 856009f9a51d8366c1ac73056addf91e | It executed the command given through an id. This will move any joint
of Sawyer, including the gripper if it has it. | int floor = (int) (this.floor/100.0 + 0.5);
controller.sendCommand("s " + id + " " + floor);
} | 1 |
4bab033d63644629ad6cf069a8eb2f73 | dc5433eca8b9ce01202da4c01db7fd2c | Returns the meta object for class '{@link org.example.myunodsl.myunodsl.Rotation <em>Rotation</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getMove_Rotation(); | 0 |
75c3d3a138b878e748672f3cc82102ad | 2c8a6380efdb7d073be7b7eda4357663 | \brief Busca la primer ocurrencia de un proveedor mediante su codigo | namespace MedNeg.Proveedores
public class BlProveedores
public MedDAL.DAL.proveedores Buscar(string sClave)
{
return odalProveedores.Buscar(sClave);
} | 1 |
1ed86bd0d9fd42bf729758bafb7dbf53 | 6eef96226e7e8e35a4199416f7920428 | Return the current time, in microseconds. | struct timeval t;
struct timezone tzdummy;
gettimeofday(&t, &tzdummy);
return (unsigned int)(t.tv_usec);
} | 1 |
4ab4025d307ec85e96b0a263212b26df | 04d05e02d94988d3a5f81c95ab5235c2 | Flush the contents of the data buffer to the handler, as
appropriate, and reset the buffer for new input. | syck_emitter_flush( SyckEmitter *e, long check_room )
{
if ( check_room > 0 )
{
if ( e->bufsize > ( e->marker - e->buffer ) + check_room )
{
return;
}
}
else
{
check_room = e->bufsize;
}
if ( check_room > e->marker - e->buffer )
{
check... | 1 |
122f5ca0488019af4b6ead7abc0cb8bf | 12c6970253a821278f14848c4f99a039 | Client disconnected, remove the entity and from map. | {
IMapObject robj;
(obj as MapObjectController)._screenObjects.TryRemove(MapObject.ClientId, out robj);
_screenObjects.TryRemove(obj.ClientId, out robj);
if (obj is Models.Entities.Player)
{
(obj as Models.Entities.Player).ClientSocket.Send(removePacket);
}
if (player != null)
{
player... | 1 |
768a184f91484992faad507cc132df32 | 4e0db06aabb1319ec22e8297f085c7f9 | 婚姻信息表(面审)表,分页查询数据 | public EasyUIPage queryDbrwsjmxb(DbrwDbrwsjmxb dbrwDbrwsjmxb,SessionBean sessionBean,EasyUIPage page); | 1 |
9f87275da01afdea4addaf1539a3e14c | 6d644992f91f7fe91e3e13926af19e28 | Save data to table | class Table
public function persist(array $data)
{
if ($this->insert($data)) {
return $this->db->getLastId();
}
return false;
} | 1 |
c6ec579af25012828d7856c37b1629d6 | 68f02433dd364c99658a1e921d9ccfc7 | Creates a VHDL boolean value out of a Python boolean
value. | class Bool(ast.expr):
def __init__(self, b):
ast.expr.__init__(self, b=b)
self._fields = ('b', ) | 0 |
1267c451fe98bead6e1d6d4bc13c1737 | e442d7fd087587acad7392bbcd8dae7f | It takes input hourly wage & no of hours
of employe & Returns the payment of an
employe for a week | def weekly_pay(hours_worked, hourly_pay_rate):
return hours_worked * hourly_pay_rate | 1 |
d344ead12ab00420261741f673799a86 | 810c55d7861aef717134e6e7786f5292 | 测试用户自定realm实现权限管理授权 | public void test05() {
Factory<SecurityManager> factory = new IniSecurityManagerFactory("classpath:shiro-permissions_customRealm.ini");
SecurityManager securityManager = factory.getInstance();
SecurityUtils.setSecurityManager(securityManager);
Subject subject = SecurityUtils.getSubje... | 1 |
25674e6dda921629b97e5aeeb5ed3b91 | 9719755e48453ac6070a623323a657fd | SSM の初期化 | {
first_ss->free = 0;
memset(first_ss->node_id, 0, SS_NODE_ID_MAX_LEN);
strcpy(first_ss->space_id,SS_SPACE_ID);
first_ss->transaction_id = 0;
first_ss->socket = 0;
#if defined(ACCESS_NOTA)
strcpy(first_ss->address.sid, SS_ADDRESS);
#else
strcpy(first_ss->address.ip, SS_ADDRESS);
#endif
first_ss->address... | 1 |
95fee0aab0aa6a9d46f05b4dd3bf6a1d | 6c2f32e9e2ba82ffe7760cc9279f057d | This method creates the Observable used with RxAndroid to update the UI when the Lens Lists
are retrieved from the database | public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.browse_activity);
ObservationList observationList = ObservationManager.getInstance().getObservationList(this, offset, COUNT);
BrowseObservationListAdapter adapter = new Brows... | 0 |
f7bf3c7f8478b69f964c2f960ce7f24c | 42511dad00d66379ca7c21ea7fe86d08 | Obtiene todos los productos filtrando por estado | class ProductoController extends Controller
public function index()
{
$productos = Producto::with('categoria')
->where('estado','1')
->orderBy('categoria_id','ASC')
->get();
return $productos;
} | 1 |
3d7c1441ed951efe63021d1541fe64f5 | 485de3bc22593a187a25dd2913ae8830 | 设置页码模式 | DocPageData data = mDocMap.get(columnId);
if (null != data) {
data.mPageNumber = number;
data.mMode = mode;
}
} | 1 |
4882bd46fc9d5cf70c71294b453823e2 | 64e3c4d34f1eb26b8d96b3f5e587eb2c | Finds a link between two points | namespace ORTS.TrackViewer.Editing
public class AutoConnectTools
public bool FindConnection(TrainpathNode fromNode, TrainpathNode toNode)
{
return FindConnection(fromNode, toNode, null);
} | 1 |
f54332867dbcd3dc29c9bb305b03a694 | 6a1d9b762b2e732915c72bad71894144 | 是否简单值类型或简单值类型的数组<br>
包括:原始类型,、String、other CharSequence, a Number, a Date, a URI, a URL, a Locale
or a Class及其数组 | public abstract class ReflectUtils
public static boolean isSimpleType(Class<?> clazz) {
if (clazz.equals(int.class) || clazz.equals(Integer.class))
return true;
if (clazz.equals(String.class))
return true;
if (clazz.equals(long.class) || clazz.equals(Long.class))
... | 0 |
9a29a7a74840cb86137e00223a6a708f | 15bfec5a982b29e690654f2371bceeed | Export current site data to local disk | class SiteCreator(object):
def export(self):
self._copy_static()
self._create_tree_data()
self._copy_storage() | 1 |
54af30200e0e9409f1c9290e5c38501e | 17e59f318c7e87fd0606f28d1a6a325c | 不使用数据库 | function connectPgWithoutPool(config, app) {
var conStr = "tcp://postgres:123456@192.168.100.181:5432/postgres";
var client = new pgOpt.Client(conStr);
client.connect(function (isErr) {
if (isErr) {
console.log('连接数据库失败:' + isErr.message);
client.end();
} else{
... | 0 |
3e379b8d422e571f9e522abe7a6aacac | 00ba2535109c6106e09d3eedc7393b9d | 不用建立實體MyTime。該Method除了取得「分鐘」外,還會將個位數字前面補上0 | {
String stringMinutes = "";
Integer integerMinutes = new Integer(minutes);
if (minutes < 10)
stringMinutes = "0" + integerMinutes.toString();
else
stringMinutes = integerMinutes.toString();
return stringMinutes;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.