query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f4bd2d368d6f79148534d65e9b52d0ee | 82fe02ba6abdc8dd0462c54c8b790002 | Funksioni qe kontrollon a ka votuar studenti njeher ne ate semester | {
Pass pass = new Pass();
foreach (var entry in journal.GetEntriesForStudent(studId,weekNumber))
{
switch (entry.FirstHour)
{
case StudentPresence.AbsentNoReason: pass.NotValidHours++; pass.NotValidLessons++; break;
... | 0 |
fc1d564347b74456119aad50d579f7a8 | 2c8ceaeb1d0a64fbb93ed49d8211f9e6 | 指定された配列のクローンを作成する。各要素もクローンを作成します。 | {
var clone = (OpcReadOnlyCollection)MemberwiseClone();
var array = new ArrayList(array_.Length);
Type elementType = null;
for (var ii = 0; ii < array_.Length; ii++)
{
var element = array_.GetValue(ii);
if (elementType =... | 1 |
1e188dbcf46f4fb55fe45b9b6a3459c0 | e145abba3e7b165f925c9aeca97e83e7 | Interpret the UID response data received from the tag. | try:
status = _unit_data_status(reply)
data_type = unpack_uint(reply[REPLY_START:REPLY_START + 2])
fragment_returned = reply[REPLY_START + 2:]
except Exception as e:
raise DataError(e)
fragment_returned_length = len(fragment_returned)
idx =... | 1 |
a32aa0b907ab61c7db7fe54304ffa8d9 | a878b6fb7b2ec485a16e76f71e2e0fe9 | Returns the true binary length of the given number | namespace DisCatSharp.Common
public static class Extensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int CalculateLength(this sbyte num)
=> num == 0 ? 1 : (int)Math.Floor(Math.Log10(Math.Abs(num == sbyte.MinValue ? num + 1 : num))) + (num < 0 ? 2 : 1); | 0 |
459bba3c6f0c431faffd149cd975e902 | a4ac35025dd69f52212e699f04c3dc26 | Get Participant Subscriptions
Get a participant's subscriptions. | com.squareup.okhttp.Call call = getSubscriptionsByMerchantSubscriberIdUsingGETValidateBeforeCall(merchantSubscriberId, page, size, sort, null, null);
Type localVarReturnType = new TypeToken<List<Subsription>>(){}.getType();
return apiClient.execute(call, localVarReturnType);
} | 1 |
8b4938321670d3b15f6d1cafda610e65 | 67bfa0bf20bd610c49075984328708b8 | 根据用户id查询节点信息 | @GET("/api/Node/MyNode")
Observable<NodeInfo> NodeInfo(@Query("id") int id,@Query("userId") String userId); | 1 |
c3dea3e2ece81f6fb3d3effde45ee3aa | 79eb57f2d316337380ae62a8750e475f | Clears the plugin list, loads the plugin jars from the new directory and
resets the watcher to use the new directory. | class PluginLoader(object):
def reload(self):
self.logger.debug('Reloading')
self.clear()
self._discover_from_packages(self.packages)
self._discover_from_paths(self.paths, self.ignore_paths) | 1 |
61b387e99c3eeeefebfb9a23a5121ea9 | 1e8145e86b1bc9a346ad9296c2362327 | >>Done<<
Function creates and returns a new request with two values. | char message[2048];
if(quotes)
sprintf(message, "{\"%s\":\"%s\",\"%s\":\"%s\"}", key1, value1, key2, value2);
else
sprintf(message, "{\"%s\":\"%s\",\"%s\":%s}", key1, value1, key2, value2);
return strdup(message);
} | 1 |
6ea16560584413222e940fc5dab625e2 | 4dc0ede365e0fdef8876579860a55bd9 | 表存在判断函数 | sql = "select * from %s" % tablename
result = self.executeCommit(sql)
if result is None:
return True
else:
if re.search("doesn't exist", result):
return False
else:
return True | 1 |
588c78bac671954836e2de7895bb3105 | 23d4a1f6bb2b10e8a22ee973614e6bd7 | BooleanConverter constructor. | class BooleanParser
function BooleanParser() {
} | 0 |
2691fe793636ca0456ef84604c122832 | c1d46307bb1eb1b09227c199954ef085 | Clears the existing generic buttons | bbDelButtons.Clear ();
foreach (Transform child in dropdownContent.transform) {
Destroy (child.gameObject);
}
} | 1 |
5ba55d64172c051e2a697016179002bb | b648c76c6bc3067e69f74ffe6c428c90 | 因为某一键名的值不能重复,删除重复项 | namespace Operation.TaoBao
public partial class TB_Keys2 : Form
List<lh_rankinglist> RemoveRepeat(List<lh_rankinglist> list_temp)
{
List<lh_rankinglist> list_ok = new List<lh_rankinglist>();
int num = 0;
foreach (lh_rankinglist obj in list_temp)
{
... | 1 |
fc9817360db47048e54cc8b09a53dec3 | cee7b470d619819880cd841546fc111b | Interaction logic for the AddRegConfirm button. Gathers and prepares the data
for database insertion. | String Name = name.getText().toString();
String Password = password.getText().toString();
String Surname = surname.getText().toString();
String Status = status.getText().toString();
String Login = login.getText().toString();
String Grade = grade.getText().toString();
... | 1 |
85c59a13c1c3f6d5f8b793e5366d7cea | 965779e837b977527a8ecd391d7f1e75 | Gets the BEPU Shape offset, if any. | public double getOffset(); | 1 |
4ff8acc400683485f92ba2bb9db567ca | f90a4a7db50c13afd5b670563dd77a6b | ドラッグを開始したときに呼び出される<br />
ドラッグ中の項目を表示する | public class ScheduleSelectController extends Controller
public void startSelect(MouseEvent e) {
Node source = (Node) e.getSource();
source.startFullDrag();
} | 0 |
abaa802f0c864be69bf1c6728b6a222b | 2b6f8ab7a80e2bd549b03fbc4c275224 | Zeigt einem neuen Spieler sein Geheimnis und merkt es sich zusammen mit seiner Farbe. | public void onUpdate(Player player, Player otherPlayer) {
currentPlayer = player;
System.out.println("*** Spielerwechsel: " + player.getPlayerColor());
} | 0 |
48e36cc9b9f920fd0bb1b766687312d6 | 30a25e87ca429def8b1350721b957f8a | Method to rotate the dance floor object | getSprite().rotate(-0.01f);
if(getSprite().getRotation() <= -1 && getSprite().getRotation() > -88){
getSprite().translateY(-0.1f);
}
else if (getSprite().getRotation() <= -88 && getSprite().getRotation() > -158){
getSprite().translateX(0.1f);
}
els... | 1 |
b6599d989f01bf986c0a923ff273cb44 | 9298cc4ac507234093f93abf92ab8411 | 플레이어의 Experience값을 표시한다 | namespace View public class View_DisplayPlayInfo : MonoBehaviour
void DisplayEXP(KeyValuesUpdate kv) {
if (kv.Key.Equals("EXP")) {
Txt_EXP.text = kv.Values.ToString();
Txt_EXPByScreen.text = kv.Values.ToString();
}
} | 1 |
c7323cc95c2b701b4dac68d36260799e | e4ca9c6e2e6478f0d5ef84a52f3f420e | Kth bit set or not | unsigned int i = k/32;
unsigned int pos = k%32;
unsigned int flag = 1;
flag = flag << pos;
if ( *(fbs+i) & flag ) {
return true;
} else {
return false;
}
} | 1 |
8d45d26e99d23d7fe2f97a10fdfe35f2 | e2adb12de37cd83b84e091871d517871 | Asynchronously poll the current state of a DNS job. | {
return Task.Factory.StartNew(s => ((IJobsOperations)s).GetAsync(resourceGroupName, jobCollectionName, jobName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
} | 0 |
cb893e5ca5a0c46de69a0c8638745408 | 078bcf0676b70ce4a585aeddb61f79a3 | Turn off the busy LED. | spin_lock(&lock);
char reset[2] = {MTCP_LED_USR, MTCP_BIOC_ON};
tuxctl_ldisk_put(tty, reset, 2);
reset_ready = 1;
spin_unlock(&lock);
return 0;
} | 0 |
0ae7137931c11a19be1477156be4a7df | e57ef2410a3d0b65410b8ca590c981a5 | 导出学生信息 | @Slf4j
@Service
public class StudentInfoServiceImpl implements StudentInfoService
@Override
public Integer exportStudentList(StudentInfoParam param) {
return excelExportComment.invoke((a) -> exportStudent(param), param, ExcelExportBizTypeEnum.STUDENT_INFO, StudentExportVO.class);
} | 1 |
e17559b4fd25be4df304e5385745b24c | 10d6301451414729088909f368e01431 | 查找连续的非小写字母 | int count=0;
Pattern p = Pattern.compile("[a-z]");
Matcher m = p.matcher(str);
while(m.find()){
count++;
}
return count;
} | 0 |
4fed6551372093b29bc00bf266d19960 | 23e3a41a0f41bccad4c13724c30b8012 | Convert julian day number to struct datetime. | interval = jd - julian_base_number
dt = timedelta(seconds=day2sec*interval)
return julian_base_datetime + dt | 1 |
750fbfdc594367d12d2b2c4b6c7a2b12 | 04d4ad4089c0a86d2035b0e5ef16ebac | 态势地图服务器实体转换 服务器 ===> WCF | namespace LWLCX.Erds.Server.Access.Converter
public static class CustomerConverter
public static DataContract.SituationMapServer ConvertTo(this ISituationMapServer source)
{
var target = new DataContract.SituationMapServer();
target.ID = source.ID;
target.Name = source.Na... | 1 |
4c35c9e4d7c83f4412439adf85318909 | 307b8f63b92dab1fce84d5fd138d4f8a | Halo bias as a function of mass. | def HaloBoost(z, M, c, alpha):
profile = NFWProfile(M=M, mdef='vir', z=z, c=c)
rho0, rs = profile.fundamentalParameters(M, c, z, 'vir')
Rmax= c*rs
if alpha==1:
R = np.logspace(np.log10(rs)-2, np.log10(Rmax), 100)
else:
R = np.logspace(np.log10(Rmax)-24, np.log10(Rmax), 1000)
rho ... | 0 |
30aae9d9adfc0c6dd7f711633614b245 | e4ce9d4536cae06bdf5d3c497e863d79 | Send a signal to all Peers. | {
boost::mutex::scoped_lock sl(mPeerLock);
BOOST_FOREACH(const uint64& peerID, fromPeers)
{
const boost::unordered_map<uint64, Peer::pointer>::iterator& it = mPeerIdMap.find(peerID);
if ((it != mPeerIdMap.end()) && it->second->isConnected())
it->second->sendPacket(msg);
}
} | 1 |
91fd76d5034d346238be8e63afcdbcef | 5bc40a08251169b93920d62fadb258cd | Ordina una lista in modo <i>crescente</i> secondo una relazione d'ordine definita dall'utente e passata come parametro.
La relazione deve essere implementata come una funzione che prende in ingresso il contenuto di due nodi,
e li confronta restituendo: | int ll_sort(LinkedList* this, int (*pFunc)(void* ,void*), int order)
{
int returnAux = -1;
int a;
int cambio;
void* pElementA;
void* pElementB;
if (this != NULL && (order == 0 || order == 1) && pFunc != NULL)
{
while(cambio)
{
cambio = 0;
... | 1 |
7b5ab45506d796c98f7cca67f0148ec5 | 9b63be1275f1127e0d124f7d710edb47 | Get user's or group's name.
This is the id. PAS doesn't do prefixes and such like GRUF. | class forum_driver_phpbb2 extends forum_driver_base
function pname_id($r)
{
return $r['user_id'];
} | 0 |
06f044238b2ce63e19682ec65ed6b6f5 | 226c09b743fcdf5861e4f70c1d6e3407 | Cleanup non tagged fields | class CachingBrineObject(BrineObject):
def unmark(self, *fields):
for field in fields:
if field not in self.__dirty:
continue
self.__dirty.remove(field) | 0 |
b98286db2f39859c9c7059afb72b755a | 01f45cf209c43969ab4b5d69f899d4fc | Replace old symbols with new ones based on the mapping | def apply_mapping(text, mapping):
return "".join([mapping.get(char, '*') for char in text]) | 1 |
402c8413e85cb8b934bda40a36154a91 | 201318274dc5997b7ace7d76be15c691 | Возвращает True, если число четное | def is_even(number: int) -> bool:
return number % 2 == 0 | 1 |
25aeb4b458dd0998ff301fa5a4b22ce4 | 00b47d10806f2a2ba22eccc8bfe6f576 | Sets up booleans that affect Juwico's behavior | {
SetAutoGroupUnits(false);
start_done = false;
hell = false;
game_over = false;
at_recycler = false;
builder1_a = true;
sscav1_a = true;
sscav2_a = true;
sscav3_a = true;
sscav4_a = true;
sscav5_a = true;
scav1_to_pool = false;
scav1_at_pool = false;
scav1_deployed = false;
scav2_to_pool = true;
scav2_... | 1 |
e8972384fe9b58a5e27327ca5bb11979 | 2c42ca3326833c407e3b7ffab18c9f85 | Gets the request builder for ReportRootGetOffice365ServicesUserCounts. | string period)
{
return new ReportRootGetTeamsDeviceUsageDistributionUserCountsRequestBuilder(
this.AppendSegmentToRequestUrl("microsoft.graph.getTeamsDeviceUsageDistributionUserCounts"),
this.Client,
period);
} | 0 |
3009c3d231ef8bdfd387ac06debf9434 | 927d6e30727cb26b69e65be9ec483bc4 | Insert item in msglist so that it remain sorted after insertation | tCIDLib::TCard4
TResEdMsgList::c4AddNew(const tCIDLib::TCard4 c4Id
, const TString& strName
, const TString& strMsgText)
{
TResEdMsgItem remitNew(c4Id, strName, strMsgText);
tCIDLib::TCard4 c4Ret;
m_colList.InsertSorted(remitNew, TResEdMsgItem:... | 1 |
cfcc2fa58e3a1c8f0caf0a6727756d4e | 50a2c118418feee586ed1339246c6b8d | プロジェクト内に存在するすべてのオーディオファイルをAudioDataに変換して取得する | audio_list = []
for p in pathlib.Path(location).iterdir():
if p.is_file():
try:
audio_list.append(audio(str(p)))
except NotAnAudioFileException:
pass
return audio_list | 1 |
9aa12e94b562a8baab81cedc16648ed5 | 898348aee51f0ec92f4c11c85689d097 | Get details for the selected page | class Api extends API_Controller
public function details_get($id)
{
$this->load->model('page_m');
$page = $this->page_m->get($id);
if ( $page and ! empty($page))
{
$fields = array(
'id', 'slug', 'title', 'uri', 'css', 'js', 'meta_title',
'meta_keywords', 'meta_description', 'rss_enabled',
'comme... | 1 |
d6a00808afe3885419f4521ba0bdf792 | b2536a3417fcc8de613558a21140bbc6 | Устанавливает постер к статье (главную тумбу) | {
if (empty($this->main_poster)) {
$this->populatePoster();
}
if (!$thumb && empty($this->main_poster)) {
return false;
}
if ($thumb && empty($this->main_poster_thumb)) {
return false;
}
if ($thumb) {
return $thi... | 0 |
5f0f56ae8a9f5b4e81ec720828c51479 | da99acc433930080bea1517c7786d3f5 | Setups the world with placeholder tileset using a top-down approach. Anchor is upper-left. | int posX = 0;
int posZ = 0;
for(int col = 0; col < GameConstants.TILE_COUNT_Y; col++) {
for(int row = 0; row < GameConstants.TILE_COUNT_X; row++) {
BaseTile baseTile = GameObject.Instantiate(this.tilePrefabList[Random.Range(0, this.tilePrefabList.Length)]) as BaseTile;
baseTile.transform.SetParent(this... | 1 |
e18aa21d768cec6a131c29c0fbc9370e | f59098f0fb064dc42c5ead9530ea33e5 | Accesseur à un objet précis de la liste de dessins | public class DrawingStorage
public ArrayList<Drawing> getdList() {
return dList;
} | 0 |
c29d2723a45692b87fd452c87d30983e | 82ea0f4919bc12474aecff38afc4381b | 物理计划:连接实现:使用嵌套循环算法 | namespace NEPS.OSP.COPPER.BALANCE.QUANTUM
class clsBalance
private void LoopNRConnect(int iFID, Dictionary<string, string> pairCount, int jointFID)
{
int cFID = -1;
int oFID = -1;
int oFNO = -1;
ADODB.Recordset rs = new ADODB.Recordset();
rs = GTBa... | 1 |
64f6f891b9b3e8913cc10049b7fe75f9 | e1d632cb8878a25d2f2d308930f0337b | 類似 T-SQL 中的 EXISTS
有下訂單的客戶 | fun Shop.hasCustomerFrom(city: City): Boolean = customers.any { it.city === city } | 0 |
bb197b3a764ea46733ca8ae887ace575 | e77bdcf61e0c41cd1b19d7251ae53492 | Returns the maximum angle covered by the sonar. | double[] sonarValues = getRanges();
double lowest = sonarValues[15];
return lowest;
} | 0 |
4b5497afa78b82f1f0d4bc80c3ed19c2 | 83695ad8032ce32eaf8e9914928507d8 | Calculates the sum of the square of deviations. | global add
global mean
for number in numbers:
add = add + (number - mean)**2
return add | 1 |
84e604f14f8e916209ad2a52bb52b3bc | 85fa9af8c8dacd71d44b99c10649ad61 | 返回下一个参数的类型。 | public unsafe RuntimeTypeHandle GetNextArgType()
{
return new RuntimeTypeHandle(Type.GetTypeFromHandleUnsafe((IntPtr) this._GetNextArgType()));
} | 1 |
928cdefdffaff1f159a253e912ec90f7 | 8892a2770ddcfb0a0e789249f2c35083 | 返回删除键的个数 | {
int num = 0;
for (int i = 0; i < L->curNum; i++)
{
if (L->element[i] == x)
num = num + deletePos_seq(L, i);
}
return num;
} | 1 |
daa48e759efca553978c00b2d7069433 | e7e782254b83d799bf1a501c07d78983 | Get the t1 radius to use when canopy clustering is being used as start
points and/or to reduce the number of distance calcs | def get_t1_params(device_name, qcid):
def t1_parse(qc):
t1_params = qc['t1_params']
return {
'start': t1_params['start'],
'stop': t1_params['stop'],
'num_pts': t1_params['num_pts'],
}
return get_params(device_name, qcid, t1_parse) | 0 |
d9931051fb883b6104558a860e59c99a | 11e3e28c6f98b2a140ac4bd46e4825be | Получение информации о месте проката по идентификатору | bool DB::get_info_point_from_id(CP_O_Point &pnt)
{
QSqlQuery qr(db);
QString usr;
usr = QString("SELECT points.name, points.lat, points.lng, "
"points.adress, points.id_type "
"FROM trolleybus.points "
"WHERE points.id_user=%1 and points.id=%2; ").arg(this->id_user).arg(pnt.id); ... | 1 |
19d5614c665da417438e09ef3f614795 | dbd82928e70c3495bf7850d95b312793 | Test Inkbird parser for Inkbird iBBQ with 1 probe. | data_string = "043E1702010000A5808FE648540B02010607161C180312E204CC"
data = bytes(bytearray.fromhex(data_string))
ble_parser = BleParser()
sensor_msg, tracker_msg = ble_parser.parse_raw_data(data)
assert sensor_msg["firmware"] == "BTHome V1"
assert sensor_msg["type"] == "... | 0 |
76406d9eb032f991fe1cde4eeecc736a | d2873a7694dfa8576dcaad09c7108632 | Deletes a resource group.
When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. | Response<Void> deleteWithResponse(String resourceGroupName, String hostGroupName, Context context); | 0 |
b780f9d6f7dfc4b44060fa83835390cc | b9bd8ea1b245d70876e642b7189406d9 | DATE CREATED: 22/8/2010
Applies Bandwidth Expansion (BW) to a vector of LSPs. Prevents any
two LSPs getting too close together after quantisation. We know
from experiment that LSP quantisation errors < 12.5Hz (25Hz step
size) are inaudible so we use that as the minimum LSP separation. | uint32_t long_cb)
{
float m_b[8], new[8], old[8];
float x, y, xy;
int k;
uint32_t end = long_cb + SRSLTE_TCOD_RATE;
float *beta = s->beta;
uint32_t i;
for (i = 0; i < 8; i++) {
old[i] = beta[8 * (end) + i];
}
for (k = end - 1; k >= 0; k--) {
x = input[k];
y = parity[k];
... | 0 |
9ce232c5facd1c119ad9264ccd3146c1 | 9ad0c6bf769db2d7fbe51190cd60a137 | ストック休暇データを取得する。<br> | Date startDate, Date endDate) throws MospException {
Integer stockHolidayAllIndex = null;
Integer stockHolidayHalfIndex = null;
for (ExportFieldDtoInterface dto : fieldList) {
int index = dto.getFieldOrder() - 1;
if (TimeFileConst.FIELD_STOCK_HOLIDAY_ALL.equals(dto.getFieldName())) {
stockHolidayAllI... | 1 |
924d74c3421b03286d967f3e4cc7ebaf | 926e540ae0075b969fa40386edf02d71 | Добавляет пилу. | void insertPill(Point pt) {
for(int i=1;i<=numberOfPills;++i) {
pills[i] = pills[i-1];
}
pills[0] = pt;
numberOfPills++;
} | 1 |
3626a1ae470ce26b118ccb5c5850ee10 | 8a3b52b8dfb0edd517bacc40da17efe0 | Returns the {@code MeSH} record key for this chemical. | public class Synset extends PointerTarget implements DictionaryElement
public java.lang.Object getKey() {
return null;
} | 0 |
2ba8c8aa9a30ebc957a7e743d0dce40c | 3ae82c369d494facac6193e4b17f7cc8 | Replacing symbolic related nodes and initializers in the original
onnx model with new nodes and initializers that can be deployed to the
specific backend. | if isinstance(onx, FunctionProto):
for node in onx.node:
if node.op_type == "Constant":
raise NotImplementedError(
f"Node {node.op_type!r} is not handled yet.")
return onx
if isinstance(onx, ModelProto):
new_graph = replace_initializer_by_c... | 1 |
370ce1fadd32e48521c0f876f3f4ecf0 | 4d4a015bbc48c4390974ff0f29315439 | Reads which hacks are enabled. | channel = ctx.message.channel
author = ctx.message.author
server = ctx.message.guild
if self.settings.getServerStat(ctx.message.guild, "SuppressMentions"):
suppress = True
else:
suppress = False
argList = ctx.message.content.split()
if le... | 1 |
72ebf7353272f6e7ecc8cf3ec7a4d7c6 | b3db2c0b433a93fc7ea14df9744e2952 | Coloca como activos los horarios que hayan caído en el feriado dado, es
la operación opuesta a la realizada por eliminarHorariosEnFeriados(). | {
if ($gestion > 0 && $mes > 0 && $dia > 0) {
$sql = "SELECT f_feriados_en_dia FROM f_feriados_en_dia('$dia-$mes-$gestion',$opcion) ";
return new Resultset(null, $this->_db, $this->_db->getReadConnection()->query($sql));
}
} | 0 |
a8d271f235ca3436b19946ad11060e19 | a7842b9a0af41b29f42292c2e0c74f53 | Reloads the current DPI-Settings of the system. | @IID("06152247-6f50-465a-9245-118bfd3b6007")
@Library("D2D1")
@Runtime(COMRuntime.class)
public class ID2D1Factory extends IUnknown
@Virtual(0)
public native int ReloadSystemMetrics(); | 1 |
8bfe68c7b4be5f9f027726be91863bae | bf96630da1e413e1c338ff8e058c200b | Mark the PTO as sent to Calendar | $this->SQL->put(
"Activity",
["Notified" => self::SENT_OK, "Emailed" => self::SENT_OK],
["ActivityID" => $activityID]
);
} | 0 |
6cc89265b09227499e380e6e85f882a1 | b9f5f007903225412f0e826b4a2e2c13 | دریافت موجودی سپرده | namespace com.digitalwave.iCare.gui.MedicineStore
public class clsDcl_Purchase : com.digitalwave.GUI_Base.clsDomainController_Base
internal long m_lngGetInstorageDetal(long p_lngSeries2ID, out DataTable p_dtbValue)
{
long lngRes = 0;
lngRes = (new weCare.Proxy.ProxyDrug01()).Service.... | 1 |
d8a0659ef60cad667de0b9f95ec8f2f3 | ae4ebb273a91adb59347de2aaa0a7ee1 | An @abstractmethod member fn decorator.
(put this in some library somewhere for reuse). | def abstract_class_attribute(*names: str) -> Callable[..., Type]:
def aca_decorator(klass: Type, *names: str) -> Type:
def new_init_subclass(klass: Type, **kwargs: Any):
try:
orig_init_subclass(klass, **kwargs)
except TypeError:
orig_init_subclass(**kwargs)
... | 0 |
7f0b62e45ab77af626c13d505a40433a | f44aac964437c30618ad7ec5be621a7c | beware, this migration will fail if migrated data currently exists w/ invalid refs | class Db
def migrate
require_relative '../lib/db/db_connection'
TGauge::DBConnection.migrate
puts 'migrated!'
end | 0 |
211c2ed0d323275c40b206e1a90f595c | 8ec5b6caee1091b17f97417e37770e5a | Удалим папку с пользовательскими распределениями при загрузке главной страницы. Если ее не было то создадим. | if (is_dir($p = $_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/'.self::MODULE_ID.'/admin')){
if ($dir = opendir($p)){
while (false !== $item = readdir($dir)){
if ($item == '..' || $item == '.')
continue;
unlink($_SERVER['DOC... | 0 |
4b1d07ac8987239371cffcd13782da99 | b931ac3dbde24990b10fe59bd61eb252 | Re-parameterize the truncnorm function from scipy.stats;
return random value from normal probability curve given mean,
standard deviation, and lower and upper bounds | def bounded_normal(minimum, maximum, mean, std, seed):
return stats.truncnorm.rvs(minimum, maximum, loc=mean, scale=std) | 1 |
92e309f6630a694b8b4ccdbea7ba8410 | 9d8aa6cb32aa35143fcf348fe01a90de | Returns the localized description of this manifestation in the language, optionally using the default language if no localization exists for the requested language. | {
return $this->localizedDescription instanceof LocalizedStringBuilder ? $this->localizedDescription->build() : $this->localizedDescription;
} | 0 |
98a7f286d12aaf4757484dd0bedb1f72 | 275174a9bf9dbdcc6a9b17dd7bae9e89 | 返回当前控制器类中不需要鉴权的Action方法名称列表 | class IndexController extends BaseController
protected function withoutLoginActions()
{
} | 0 |
fbeef62a579911a3f17a6a258728a652 | c8bae27b8506afc6d0d68cf4b9b71dec | Sets the {@code caloriesOut} field.
<p>
This method sets the {@code double} value for the field {@code caloriesOut}.
the new value of the field {@code caloriesOut} for the goal | public class GoalsRecord implements Serializable
public void setCaloriesOut(double caloriesOut) {
this.caloriesOut = caloriesOut;
} | 1 |
c9f3b4e5bfbd1bf3b072f336c9fb5558 | 5ed56cdabc620c09e9f3bf95cb65c945 | Compute the radius of gyration of an individual given their TrajDataFrame | class IndividualEval(object):
def get_gradius(self, trajs):
gradius = []
seq_len = 48
for traj in trajs:
xs = np.array([self.X[t] for t in traj])
ys = np.array([self.Y[t] for t in traj])
xcenter, ycenter = np.mean(xs), np.mean(ys)
dxs = xs - xcente... | 1 |
e0bcaa84e48c7928844d649709349e46 | bb15f3ac8ff28893e53f39569c2a61ab | Convert from DIP to PX | public class MyDialog extends Dialog implements AdapterView.OnItemClickListener private class DemandingCertificatesAdapter extends BaseAdapter
public int DPtoPX(int size, Context context) {
DisplayMetrics metrics = new DisplayMetrics();
((WindowManager) context.getSystemService(Context.WINDO... | 1 |
eb6947605b901ff34f95cdc3d12688a5 | 0d28d22903fec3ebef57fc26a44cbd7b | Determines whether the specified <paramref name="value"/> is a prime number. | public partial class UserDefinedFunctions
[SqlFunction(IsDeterministic = true, IsPrecise = true, SystemDataAccess = SystemDataAccessKind.None)]
public static SqlBoolean xfnIsPrime(SqlInt64 value)
{
if (value <= 1 || value.IsNull)
{
return false;
}
else if (value == 2 || value == 3)
{
return true;
}
... | 1 |
e11bc2af6f41137244b18de8660515dc | 4f34ed28be335b2caf4b236c654f6f5d | Check collision between sprite and group | class SpriteGroupSubset(SpriteGroup):
def __contains__(self, sprite):
return set.__contains__(self, sprite) and sprite in self.parent | 0 |
1dffbfa9ae7d8dd1ccda3b57bbdd5443 | cd4f3db8787ebc01efa40f42951e4c08 | Mutates dataset with 2 metre relative humidity based on present
information on 2 metre dewpoint temperature and 2 metre temperature.
- 't2m' in dataset.variables
- 'd2m' in dataset.variables | shumi_varname='q2'):
with netCDF4.Dataset(ncfile, 'r+') as src:
q2 = src.createVariable(shumi_varname, numpy.float32,
('time', 'latitude', 'longitude', ))
q2.units = 'g/g'
q2.long_name = '2 m specific humidity'
d2m = src.v... | 0 |
cfe1e637e1fe1e1cb54ae40014d9fd7e | 51c0455635660f2dcf249f326ce2f176 | Computes the average error.
Returns | class GuptRunTime(object):
def _estimate_error(self, avg_output, real_output):
errors = []
self._recur_estimate_error(avg_output, real_output, errors)
return float(sum(errors)) / len(errors) | 1 |
a3750dab818d9adec939581c3a8aa01e | 2b188bb54940df6d56237fc49a7ceb1f | Will query the most up-to-date size of a deque (weakly consistent).<p>
If the key does not map to a deque, then {@code 0} is returned.<p> | requireNonNull(key, ERR_KEY_CAN_T_BE_NULL);
return cache.getAsync(key).thenApply(b -> b == null ? 0 : (long) b.size());
} | 1 |
6d6b8d8e2bf3da34e897ca90d1a5ad87 | 0453fb7d3a9741684005e340360a297e | Para obtener la máxima de las alturas de dos nodos. | if (this.altura(izq) > this.altura(der)) {
return this.altura(izq)
}
return this.altura(der)
} | 1 |
7dfbca9258fcc2f2ebf47dea98c13530 | d219647c948fa6d12c20e2a79ff6dfc9 | Hide unnecessary fields if dynamic search selected. | if (isset($_GET["simple_fields_action"]) && $_GET["simple_fields_action"] == "select_file") {
unset(
$form_fields["post_excerpt"],
$form_fields["post_content"],
$form_fields["url"],
$form_fields["image_url"],
$form_fields["image_alt"],
$form_fields["menu_order"]
);
}
return $form_fields;
} | 1 |
0d1cc2b35cdda05d274b13bf6b0db882 | 06fd8d997a6cda08c518f6e93c73b262 | get all notifications from a particular customer_id | public function fetchAllByCustomerId($customerId); | 1 |
87ebb82c937d6d09620f00c7dd1b32a2 | c506ae5f97fe0b92109fb977a433b7e4 | Getting customer threads identifiers. | {
$customerGroupIds = [(int) $sharedCatalog->getCustomerGroupId()];
if ($sharedCatalog->getType() == SharedCatalogInterface::TYPE_PUBLIC) {
$customerGroupIds[] = GroupInterface::NOT_LOGGED_IN_ID;
}
return $customerGroupIds;
} | 0 |
7dbd32b82343df64178afefa05648916 | 334ee23bff636a8d6092a453d073215a | A memory address will never be a literal | {
int i=0;
while(literals[i].address[0] != '\0')
{
if((int)strtol(literals[i].address, NULL, 16) == addr)
{
return literals[i].literal;
}
else
{
i++;
}
}
return NULL;
} | 0 |
2ad78f4f1453370c990d7dc69dae650d | 58d120f04fd9a4e52986c1ea4569a187 | generate suitable host file to do scaling test | for i in xrange(1, NUMBER + 1):
if i >= 100:
PREFIX = "h"
elif i >= 10:
PREFIX = "h0"
else:
PREFIX = "h00"
self.HostList.append(self.addHost(PREFIX + str(i), cpu=1.0 / NUMBER)) | 1 |
6e4b76873baf64f3b22c57929c25a563 | 006f788f1b1fac39cfabc89457b82244 | Muestra en tiempo real la vida del Player | {
m_textLife.text = "Vida: "+m_lifeCounter.ToString();
if(m_lifeCounter == 0){
Time.timeScale = 0;
gameOver_panel.SetActive(true);
}
} | 1 |
c51fd683b3b4edf2d91274bc3b85430d | f03f45ffa563537e84abf3681b61d4d7 | 获取热门车辆列表 | class CarCommon extends Model
public function getCarCommonList($map, $order, $page, $limit = 15)
{
$map['car_status'] = CarStatus::$CarStatusNormal['code'];
$field = "id,brand_id,brand_name,series_id,series_name,series_img,cartype_id,goods_type,cartype_name,reserve_interval,licence_plate,device_numb... | 0 |
fe334e61516c7a856cd51651e07dad43 | 354f812e252a835b000326b837ee0c65 | @brief PCA0 counter init function,It must be initialized last
PCA_SCLK_DIV_6 | PCA_SCLK_DIV_8 | PCA_SCLK_DIV_12
PCA_TIMER0 | PCA_ECI | FSCSTATE PCA_CNT_Init(PCACLKSrc_Type clkSrc,BOOL run)
{
CMOD = (CMOD & 0xF1)|(clkSrc);
CL = 0;
CH = 0;
CR = run;
return FSC_SUCCESS;
} | 1 |
d85f0106416e2d35d2fa1d40eeba576a | 6b78dc05fdce4101530673d599ed68c4 | Returns the latest release for a repo. | def fetch_release(repo):
return repo | 0 |
47f39d1d2b75cd02db5affbee8f251e9 | 7655d4f4a901ce28aac63863b6fd4dd6 | Dump a static model to be used during the tests. | class FrameworkTest extends \PHPUnit_Framework_TestCase
public function testDumpModel() {
$runtime = $this->GetTestRuntime();
$dumper = new \NetPhp\Core\TypeDumper();
$dumper->Initialize();
$dumper->SetDestination(Utilities::GetClassLocation(\NetPhp\RootDetector::class) . '/ms');
$dumper->SetBaseNam... | 1 |
dec8d3c916373ab20ed065b0e5f2e521 | 7f61448ad6da3ef0f9cb03f40c5be655 | MethodName_StateUnderTest_ExpectedBehavior | cases like (1) | 0 |
c1c5c05c58c28f7ae1c7571b1d528a92 | 50c0584a139c2c6dc62e18399d41a6e9 | Tests if the mouse is inside a rectangle that's been rotated | double backX = getCurrentLocation().getX() + ((getLengthPixels()/2) * (Math.cos(Math.toRadians(getCurRotation()-90+180))));
double backY = getCurrentLocation().getY() + ((getLengthPixels()/ 2) * (Math.sin(Math.toRadians(getCurRotation() - 90 + 180))));
double frontX = getCurrentLocation().getX()... | 1 |
46dccf76a7d215cdf7cb446c92731ad6 | d8e4a853a8b35ac04447f6dc27913f2a | STEP 1 //
initialize values | FARADAY_CONST = 96500;
NO_OF_ELECTRONS = 2;
CATHODE_BOUNADARY_X = 390;
CATHODE_BOUNADARY_Y = 330;
timer_interval = 0.5;
rheostat_initial_x = 450;
total_weight = (parseFloat(10).toFixed(2));
scope.total_weight_value = total_weight;
load_flag = true;
selected_analyte_index = 0;
scope.voltage_ctrls_disable ... | 1 |
abe58a6b7c32c5c3b0fa57773ef9ada2 | d6f485db69f706f51e59c82c81aa2853 | Build SLO object path. | slo_path = SSM.build_slo_id(window, slo_config, full=True)
LOGGER.info(f'Deleting SLO "{slo_path}"')
try:
return self.client.delete_service_level_objective(slo_path)
except google.api_core.exceptions.NotFound:
LOGGER.warning(
f'SLO "{slo_path}" doe... | 1 |
10e26c8b0613b3cc8bec97a006d9bccb | fd7368a1d5467a5e5494660790d03db7 | Rewrite HTTP POST action.
If the form is rendered embedded on the others pages we
make sure the form is posted always through the same view,
instead of making a HTTP POST request to the page
where the form was rendered. | if (hasattr(request, 'COOKIES')
and request.COOKIES.get('frontend_editing', False)):
if hasattr(response, 'add_post_render_callback'):
response.add_post_render_callback(add_never_cache_headers)
else:
add_never_cache_headers(response) | 0 |
d5c0f33306d63c3eb4e4e951f8afd3d2 | 737747e582854cd70c90119a3c55d1a1 | Перед обработкой запроса создадим активное соединение с MySql | self::$objMySql = new \mysqli(
AppConfig::$DB_HOST . ':' . AppConfig::$DB_PORT,
AppConfig::$DB_USER,
AppConfig::$DB_PSWD,
AppConfig::$DB_NAME);
if (self::$objMySql->connect_error) {
di... | 1 |
643d6d3bfa38abc557cfd0a01af24f0f | 7e79cc352b93666b5e791c300488b4bc | 获取重量监听者 | basicEmptyWeight.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void aft... | 1 |
866dd7d7aaa7b0bf4c60093140911ac6 | 9124da2ad34e7d135069a24a244cbd76 | Add a chart of accounts.
Check permissions. | if ( ! isset( $_POST['submit_erp_ac_chart'] ) ) {
return;
}
if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'erp-ac-chart' ) ) {
die( __( 'Are you cheating?', 'erp-accounting' ) );
}
if ( ! current_user_can( 'read' ) ) {
wp_die( __( 'Permission Den... | 1 |
366052847020273788b14b82f2a9abbf | e0a08001ec5c3cc7deb8f6d03b50ffe4 | 静态方法,该方法将输入的数组递归的转换成对应编码的数组 | if(is_array($arr) && count($arr)){
foreach($arr as $key=>$value){
if(is_array($value)){
$arrRs[$key] = utf8togbk($value);
}else{
$arrRs[$key] = _toGBK($value);
}
$arrRs[$key] = str_replace("'","''",$arrRs[$key]);
}
... | 1 |
964a5b0487b0b55b94e6f77e672f752f | 8fec59e65fc5c4f424039b305282574c | Return a dictionary opf output files to include in the summary. | class BaseAnalytic(object):
def output_files(self):
pass | 0 |
b4521a7c7b9e19d2af1bd6802ebe94ec | 24d7d92513ef7b5b0000ff955e26c26d | Getter method for parent SHA-1 Hash IDs. | public class Superblock
public Keccak256Hash getParentId() {
return parentId;
} | 0 |
3835af4df99a50de064e343e144837f8 | efb836f226baed84dbcd333b8f20027f | currently retro power is hardcoded to 1 | void retro_init(void) {
std::cout << "retro_init()" << std::endl;
audio_mixer_init(44100);
game_init();
} | 0 |
b3865e498ff1cb7e0a44251a9e27d27b | 23944daaabb36d984378c22876c0abf1 | 长度大于指定值 | namespace Wxl.Extensions.StringExtensions
public static class StringLengthExtensions
public static bool LongerLengthThan(this string value, int length)
{
return LongerLengthThanImpl(value, length);
} | 1 |
ddb704058344014f0960a4925ed3c68c | 50fe69e949d557d8d289788483b9ae16 | findCleanUpsAndPlugin()のCleanup対象プラグインを複数取得テスト | {
$this->markTestIncomplete('このテストは、まだ実装されていません。');
$theme = Configure::read('BcSite.theme');
$path = BASER_THEMES . $theme . DS . 'Plugin';
$Folder = new Folder();
$Folder->delete($path);
$result = BcUtil::getThemesPlugins($theme);
$expect = [];
$this... | 0 |
b6615fc5090ea6001569b3d58543ecff | cc8417eef3f72e54eec7196f717f23da | Calculates the range of the pagination links. | class WithPagination extends Component
getPageRange() {
const { totalPages, maxButtonCount } = this.props;
const currentPage = this.getCurrentPage();
let beginPage = Math.max(0, currentPage - (maxButtonCount / 2));
let endPage = beginPage + (maxButtonCount - 1);
if (endPage >= totalPages) ... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.