query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
cb9dc65b327d72f6591c94551e9513ab | 82824a490880a417251715619cab5950 | !Gets the current thread's database connection. Each thread
has its own connection. | try:
con = self.thread.connection
except AttributeError:
con = self.steady_connection()
self.thread.connection = con
return con | 1 |
333d41e79b549dd13e40379df7538f8b | 83583ef21641b67b9387630f5fcf7710 | 市站点总数 | public R list() {
int count = stationService.count();
return R.ok().data("allTotal",count);
} | 1 |
714adb8dbca8b22c6eb3e1a6048b78f1 | 4c84a15d0617fd9d2ba6c099b7366b3b | (j.gruber 2016-02-01 13:44) - PLID 68000 - helper function that adds one row from the map to the datalist | class Table : AppCompatActivity()
private fun addRow(marker: MapMarker, colour: Int = ContextCompat.getColor(applicationContext, R.color.table_default)){
var existingTable = findViewById<TableLayout>(R.id.table_layout)
var newRow = TableRow(this)
newRow.layoutParams = ViewGroup.LayoutParams(
... | 1 |
5f273b16229c66374ece0e06d4236860 | 839acf2f7d72ed52213665db1dd0ee74 | Closeness of two rectangles via their center distance | a1, a2 = rect_a
b1, b2 = rect_b
left = b2[0] < a1[0]
right = a2[0] < b1[0]
bottom = b2[1] < a1[1]
top = a2[1] < b1[1]
if top and left:
return distance.euclidean((a1[0], a2[1]), (b2[0], b1[1]))
elif left and bottom:
return distance.euclidean((a1[0], a1[1]), (b2[0], b2[1]))... | 0 |
023426fbc2dcdd5dc803ad047605d943 | eda126a656cf542ecd5b9c2672c78345 | Add a file open listener to this. | public class GnutellaDownloadService extends Connection
public void addFileListener(GnutellaFileListener l) {
flistener.addFileListener(l);
} | 1 |
f0732b64925e5c8552dae74440c8b12c | 8ae2ab926cab86e3528f721bae4d6fee | Tests the /devices endpoint.
Since the demo device does not seem to record
temperature/humidity/pressure, this is tested with an actual Point. | nbirth = self.make_nbirth()
group_id = 'group0'
node_id = 'node0'
device_id = 'device0'
self.trigger_message(nbirth, 'NBIRTH', group_id, node_id)
dbirth = self.make_dbirth()
self.trigger_message(dbirth, 'DBIRTH', group_id, node_id, device_id)
endpoints = s... | 0 |
2243b0d95465b17391bdfed904cdfab9 | 22e7a5976e0a4e22e86ad51e0dbcca63 | 更新垃圾回收单位 | {
$post=Request::post();
if(array_key_exists("name",$post)&&$post['name']!="") {
$mcont['name'] = $post['name'];
$fadmin = $this->MFind($mcont);
if ($fadmin) {
if ($fadmin['token'] != $post['token']) {
$this->error = "此垃圾名已经存在";... | 1 |
0089575c25e2b785cf219030de49d8ed | 1e2b895bc6198982de27090a7d165038 | constructor where it initialize different parts of Marahel | HaineBarbati::HaineBarbati() : Haine::Haine()
{
this->NrBuzunare = 0;
this->Imprimeu = false;
this->TaraFabricatie = "";
} | 0 |
503fe6b6bdc87ca4625b305b60f449f9 | f69717d0e6d4c34ac2cc222c92894545 | Gets the states to indicate whether to allow redirection of unicasts for this RTSP
profile. If enabled, the client is allowed to select the destination where data will
be streamed. | class HttpRequest(HttpPacket):
def allow_redirects(self):
return self.__allow_redirects | 1 |
daa32ce55e41a7c851bd5b4f149c0107 | 4833784bfad6b8af1ff810904e9799f4 | Scrolls to the specified column. | int lineCount = content.getLineCount();
int oldColumnX = columnX;
int caretLine;
caretLine = content.getLineAtOffset(caretOffset);
if (caretLine < lineCount - 1) {
GC _gc = getGC();
int verticalMaximum = contentHelper.getHeightOfLines(_gc, 0, lineCount);
int pageSize = clientAreaHeight - topMargi... | 0 |
9b090df3e60106fdb7378e93e63ca734 | 67e43471aa928eb41b697302cbce6eae | Set the id late (after constructor).
Use in case it is not POSTed. | class JoomleagueModelItem extends JModel
function setId($id)
{
$this->_id=$id;
$this->_data=null;
} | 1 |
8427ca791e1968312ceb8b87abc11c6f | 4d0dbea48af1aacc92b1b2ca5e117b77 | Devuelve la instancia del Manejador de Seguridad | function security()
{
$current_container = \Zeriyoshi\Figurare\Supports\Framework::getContainer()->getCurrentContainer();
$security_manager = $current_container->resolve(\Zeriyoshi\Figurare\Contracts\Engine\SecurityManagerInterface::class);
return $security_manager;
} | 1 |
ca809398400cdcda2d3e5ef3d89f7fcd | c74f7a32305a0cb25253a941d896662b | \brief Effect of shooting a bullet from the larget turret. | {
shot.play();
m_bulletRotation = m_turretRotation + m_rotation;
m_bullet.setRotation(m_bulletRotation);
bulletAlive = true;
shotsFired = true;
} | 1 |
ca78eabc1e6df3c6dcb9654292b9b237 | af7737091dfc58ae453f7dac5fd20a0d | Fill array with randomly oriented quads | {
float* vert = Vert;
float* color = Color;
float* vel = Vel;
float* start = Start;
n = N;
for (int i=0;i<n;i++)
for (int j=0;j<n;j++)
{
*vert++ = frand(2*dim, -dim);
*vert++ = dim;
*vert++ = frand(2*dim, -dim);
*color++ = frand(0.5,0.5);
*co... | 0 |
e95278db5df6c356d834f7fdb0ce5e74 | 7e72118e813faf82516b07c089831fd1 | 只有还在审核中的才可以废弃 | @Service
public class WareStockinServiceImpl extends BaseServiceImpl implements WareStockinService
@Override
@Transactional
public void auditRejectStockin(Integer[] ids, String reasonsRejection) {
WareStockinExample example = new WareStockinExample();
WareStockinExample.Criteria criteria = example.createCriteria(... | 1 |
a6e69d1d1b3d93d33a5e7d8605fb5536 | 06c2597e03af4ec3751def0af6dfac9d | Reset 'alarm' status, usually after emergency stop or hard limit. | def reset_alm(device_id):
send = get_bytes(device_id, 0x5c)
SER[device_id].write(send)
printResult(SER[device_id].read_until(b'\x0d\x0a')) | 1 |
df34124c3d34fe60bd13dba11728b0ea | 8ecad9e49e5566f1307624e4c64acf01 | Handles the Click event of the buttonCharacter control. | namespace EVEMon.SkillPlanner
public partial class AttributesOptimizationSettingsForm : EVEMonForm
private void buttonCharacter_Click(object sender, EventArgs e)
{
string title = String.Format(CultureConstants.DefaultCulture, "Attributes optimization ({0})", m_character.Name);
string... | 1 |
756bc0310e26a0aca20f56ccae19c738 | 2eb5d527b80754b87564f15281558251 | Get inactive emails quantity | $result = ConnectionFactory::getConnection( 'db' )->createCommand()->select( "count(distinct(rec_date)) number" )->from( 'postfix.mail_size' )->where( $condition, $params )->queryRow();
return $result ? $result ['number'] : 0;
} | 0 |
cc85435059392fd956268c05a061eeb8 | 1ff4b0e167f7d1a538c38a6969bcb800 | Removes the last element of this list. | namespace ModToolFramework.Utils.DataStructures public class CachedImmutableListHolder<TElement> : IEnumerable<TElement>
public TElement RemoveLast() {
TElement result = this._list.RemoveLast();
this.Invalidate();
return result;
} | 1 |
3dfddef5eff42793b61acf1790223164 | e19aabf14b4490705f98c759fae55293 | 屏蔽链接 | if link.rstrip('?').rstrip('#').rstrip('/') in self.spider.fetcher_cache:
return False
if not link.startswith("http"):
return False
if self.spider.same_origin:
if not self._check_same_origin(link):
try:
spider_url = ScanSpid... | 1 |
11d6857b544b58f862343cf8feaff487 | cbd21063d9431a6cddbdd4dd50647873 | Tell if the option is a network option. | if (in_array($s, listNetworkTypes())) {
return True;
} else {
return False;
}
} | 1 |
ccdee316afcc2674346433f4a6b51d90 | 0d78fd234156e63522c53bd22f7efcac | Agrega un registro del nodo "implocal:TrasladosLocales" de un comprobante CFDI. | if (trasladosLocales == null) {
trasladosLocales = new ArrayList<ImpuestosLocales.TrasladosLocales>();
}
return this.trasladosLocales;
} | 0 |
f200efecdce8e068749b544b57820c53 | 3344e9b6e8a0af183df58f8e62f99006 | Shows or hides the buttons based on the filters. | public class ParkFinder implements EntryPoint
private void loadFilterAndViewButtons(boolean onMapView) {
if(onMapView)
addParkListButton();
else
addMapViewButton();
loadFilterButton();
} | 0 |
0343803918ea383b9374a0e05d04edf4 | 3854ea39926aaa9f2086520abcde7a6e | Delete or mark as not present the database entries for files
within the given experiment that no longer exist or were broken at
index time. | class FileStore(AbstractStore):
def _hard_delete_experiment(self, experiment_id):
experiment_dir = self._get_experiment_path(experiment_id, ViewType.DELETED_ONLY)
shutil.rmtree(experiment_dir) | 0 |
8c065b6d4f6bbcb9309bc2c9904da2b0 | 133c102c33462557d0c655f024382ce7 | Obtiene los grupos de los orígenes | class FilesStore(object):
def get_sources_groups(self):
return set(j for i in end_request(self.server_conn.foofind.source.find()) if "g" in i for j in i["g"]) | 1 |
0df83f5ba39d6f9d3a3d147fb1fdb302 | eae184502ee91bf19d3db1524143f12d | Get Port if it is set by environment, else use a defined one like "4747" | func GetPort(
ctx context.Context,
) string {
return env.Get(ctx).Config[EnvCfgPort]
} | 0 |
6ac4f8219852efd40cf9e126c8204afb | 1f3c7b4b763eaf0edaf407ed96886e6d | Algorithme gérant la propagation du feu | {
for (var i=0; i<a; i++)
{
for (var j=0; j<b; j++)
{
VivantAutour = 0;
if (i!=0 && j!=0 && etat1[i-1][j-1]==1){VivantAutour=(VivantAutour+1);}
if (j!=0 && etat1[i][j-1]==1){VivantAutour=VivantAutour+1;}
if (j!=0 && i!=a-1 && etat1[i+1][j-1]==1)... | 0 |
8f8c158728b58bac815bee6626ecffa4 | 3c93312bdc771b9c0d81e4759bfad86c | Serialize session to cache element. | class SessionCache extends Cache
public function save(CacheItemInterface $item)
{
Simple::getSession()->set(self::$sessionKey . '.' . $item->getKey(), $item);
} | 0 |
a70e91fc2207c86d874fbe849ed89a16 | 8d66a931c9f670377cfb68356b0fce3b | 根据单id获取明细 | abstract class Apply
public function getdetailbyid($id)
{
$data = Db::table($this->table)->where($this->op . '_id', $id)->find();
return $data;
} | 1 |
e65dfc9d28eb3c2d1083e705d6757263 | a4ffb79b26252880d201a0a3c2dd925d | Specifies whether to connect with the SAP HANA database over Secure Sockets Layer (SSL). | public class CimConnectionInfo
public boolean getUseSSL() {
return _useSSL;
} | 1 |
fb29dfc8f9ca83fd8e38a9dc43bdc925 | 163701fecdea658a2c37a0a578dfa66f | Preprocesses all the databases stored in the NASS DB folder | Path headerPath = Util.getRunDirectory().resolve(Paths.get("CDAHeaders"));
File headDir = headerPath.toFile();
for (File head: headDir.listFiles()){
String header = head.getName();
String path = (Util.getRunDirectory()).relativize(head.toPath()).toString();
addHeaderToDatabase(header, path);
}
} | 0 |
3014f2adde85e56702a89ac3208362f5 | a94971f282c5620e4b50f2c9fb63800f | 判断是否包含协议 | function hasProtocol(image) {
const { type, path } = image;
if (type === IMAGE_TYPES.Local) {
return false;
}
if (path.slice(0, 2) !== "//") {
return true;
}
return false;
} | 1 |
0427732b90e80f7084f153d5e84130e1 | 81e8a4f01bca78b75247e622b04665e1 | funkcja wczytujaca plik i tworzaca tablice obiektow Number (tyle obiektow ile jest ich w pliku zrodlowym) | numbers lst;
ifstream namesFile;
namesFile.open("datFile.txt");
if (!namesFile) {
perror("Your file wasn't opened correctly");
}
else {
int count = 0;
int a;
while (namesFile) {
namesFile >> a;
lst.push_back(a);
}
namesFile.close();
}
return lst;
} | 0 |
b2031b57e205425d36a0c7922f61e90c | 20e9cc20740b7f4ad36a3f43f6ddbcba | Convert a float to an array of 4 bytes | namespace PcmLib
class RiffWriter : IDisposable
unsafe private byte[] ToByteArray(float[] src)
{
byte[] dest = new byte[src.Length * 4];
fixed (byte* pDest = &dest[0]) {
fixed (float* pSrc = &src[0]) {
CopyMemory(pDest, pSrc, (uint)src.Length*4);
}
}
return dest;
} | 1 |
e4dd35ba9c3bce97398669ac0c1d9bde | 2de0f83ea88e220a581fdbe0c785f898 | 양식 마커를 생성하고 주차장 마커 배열에 추가하는 함수입니다 | function createpubMarkers() {
for (var i = 0; i < pubPositions.length; i++) {
var imageSize = new kakao.maps.Size(29, 42),
imageOptions = {
spriteOrigin: new kakao.maps.Point(0, 0),
};
var markerImage = createMarkerImage(markerImageSrc, imageSize, imageOption... | 1 |
e19b5a7ccda376bbaa943ec61e3ccb85 | 7448ae6a61bfbe66a62350346f0343c4 | 获取贴吧的tbs和id | headers = {
'Host': 'tieba.baidu.com',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36',
}
url = 'https://tieba.baidu.com/p/' + str(tid)
res = requests.get(url=url, headers=headers,timeout=2).text
kw = re.sea... | 0 |
49c1112009d047a6a93c484064def405 | 108b2571f3659a53718fa7664e5240db | disable controllers for child-cgroups | efi_handle_t child_handle)
{
efi_status_t ret;
ret = boottime->close_protocol(
controller_handle, &guid_controller,
child_handle, child_handle);
if (ret != EFI_SUCCESS) {
efi_st_error("Cannot close protocol\n");
return ret;
}
ret = boottime->uninstall_protocol_interface(
child_handle, &gui... | 0 |
bfc09153f3bba4c18621db1520354def | 38d9bb09076be7275fbe29cd927a6e3a | 实现平衡树的节点删除 | bool deleteNode(node * & root,int key,bool & lesser)
{
if (!root)
return false;
if (key < root->val)
{
if (!deleteNode(root->lchild, key, lesser))
return false;
if (lesser)
{
switch (root->bf)
{
case 1:
root->bf = 0;
lesser = true;
break;
case 0:
root->bf = -1;
lesser = fal... | 1 |
543b0199f954b91f5e1fb0607ba4722e | 7713633cce13482f4a64e4e4bb0ab98e | <OPERATORS> | if p[2] == '+' : p[0] = p[1] + p[3]
elif p[2] == '-': p[0] = p[1] - p[3]
elif p[2] == '*': p[0] = p[1] * p[3]
elif p[2] == '/': p[0] = p[1] / p[3]
elif p[2] == '>': p[0] = p[1] > p[3]
elif p[2] == '<': p[0] = p[1] < p[3] | 1 |
555950e392ec0d2b88a8cb291a1f974b | d4e500edc64fe43e1f66a2bd9476d914 | Compute a gamma distribution envelope | Proj = lambda z, a0, a1 : np.minimum(a1, np.maximum(z, a0))
N = signal.size
H = KernelGP(N, fs, params['sigma'], params['thold'])
MAX_ITER = 1000
lower = (np.min(signal) - 2) * np.ones(signal.shape)
upper = signal
z = EnvGP(signal, lower, upper, H, params['alp'], params['lambda'], params['be... | 0 |
3eaa8089952edd0ac174151c9fe011bd | 07cb37ca6e5e15b36eb2eb20f3982391 | 保存编辑的知识库信息 | @ResponseBody
public ResultInfo updateRepositoryCategory(HttpServletRequest request, Integer repCatId, String repCatName) {
ResultInfo resultInfo = new ResultInfo();
try {
UserInfo userInfo = SessionGetUtil.getSession(request);
if (null == userInfo || null == repCatId || ... | 1 |
6dd6fcf4d2b1433c9c0d84f0fb72b0cd | 9751a44ab46500165708c46efd77547c | Optimize graph using TransformGraph | self._tmp_graph_def = FuseConvRequantizeTransformer(
self._tmp_graph_def,
self.device,
self.new_api).do_transformation()
self._tmp_graph_def = FuseMatMulRequantizeTransformer(
self._tmp_graph_def).do_transformation()
self._tmp_graph_def = FuseMatMu... | 1 |
ed51fd9786be3e25c52535f733e90926 | 6925a00c64502722a5985daf95360a20 | Get this subreddit's description as HTML instead of text | String getDescriptionHTML(); | 1 |
756203fc819502d639692d3c137e5baa | 6c169e42bc1cf24343e1475fe21cf959 | Simulates the rolling of an eightr-sided die. | def single_roll(number_of_sides: int) -> int:
return random.randint(1, number_of_sides) | 1 |
73b2e340c62210ea433ad9d1ae583303 | 2b75492646edaa9aa0fd86cb88d35911 | Sets Fancy Box modal triggers | function setModalTriggerLink()
{
$('.repolink').modalTrigger({width:960, type:'iframe'});
$(".export").modalTrigger({width:650, type:'iframe'});
} | 1 |
90762bef5bbf621f21f9955633781c89 | baeb73e3f0870cd6b1a57f30c3bd6d3d | Obtain the name of the file in which stores are being saved. | public abstract class Persistent implements Serializable
public String getFilename() {
return filename;
} | 1 |
ea09ffef0d590966cd6d4dede2504231 | 5e3a7253bb8648b7c7cf35a50af18281 | Gets the index in the <see cref="ItemsControl.ItemsSource"/> of the data item
for which a container is being selected. | namespace Charites.Windows.Mvc.Wrappers
public static class ChoosingItemContainerEventArgsWrapper
public static int ItemIndex(this ChoosingItemContainerEventArgs e) => Resolver.ItemIndex(e); | 1 |
a2b41314a68857b2bedfa5eaaf622b76 | 6f5684201bd27e5e21754e8e6a02f962 | 推送手机验证码
验证码存储于Redis,30分钟内获取超过3次提示太频繁 | @Controller
public class LoginController
@ResponseBody
@GetMapping("/sms/sendCode")
public String sendCode(@RequestParam("phone") String phone) {
String redisCode = redisTemplate.opsForValue().get(AuthConstant.SMS_CODE_CACHE_PREFIX + phone);
if (!StringUtils.isEmpty(redisCode)) {
Str... | 0 |
be113769f8e208473b022c438611bfb3 | 06c7e2579710a30ea44e0b2b0ab7c899 | Emits the IL to indirectly load an int8 onto the evaluation stack. | namespace Business.Utils.Emit
internal static class OpCodeExtention
public static System.Reflection.Emit.ILGenerator Ldc_I4_8(this System.Reflection.Emit.ILGenerator il)
{
il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_8);
return il;
} | 1 |
3ab1bbe2265721792f039513e25d53ac | bc36dfde67040b6f13aafe4292f3e90d | Write frame to shared memory and notify all client processes
that a new frame is available. Do not block, though. | {
__atomic_store_n(&gpuFrameAvailable, 1, __ATOMIC_SEQ_CST);
syscall(SYS_futex, &gpuFrameAvailable, FUTEX_WAKE, 1, 0, 0, 0);
} | 1 |
e1b63c3531b7485f8e3a1332221ad8bf | 85c80c2e9302df12286d11438795bd11 | Test canPlayTile() method. | self.expected_width = 4.125 * TILE_SIZE
self.expected_height = 1 * TILE_SIZE
bounded_box.run_positioning_tests(self) | 0 |
cb4fea775f6ec8e87ff1c50ad6cd6a5f | 4549d81c67b630c3cc8463a3f53bb440 | 潜在客户修改页面 | public String c_modifyPro(HttpServletRequest req, Model model) {
logger.info("url ==> c_modifyPro");
service.c_modifyPro(req, model);
return "/customer/c_modifyPro";
} | 1 |
861252e36a3c0abc1b2cb519433b28a8 | 13b0dafcb68bf87b68c4f8b2c0280ca2 | Parse decoded METAR for readable output | fullMetar = getMETARwData(stationCode)
if fullMetar.empty:
return ""
else:
metarText = list(fullMetar['raw_text'])[0]
if "RMK" in metarText:
rmkIdx = metarText.index("RMK")
return metarText[rmkIdx + 4:]
return "" | 1 |
e6c338b97e3c07cb9de478bad2f30e82 | d300776294a2a0388e846134f2fe1e13 | HC:将接收到的listGlobalBuddyChainInfo信息按照子链合并到本节点listGlobalBuddyChainInfo中 | getListBck = getList[:]
getList.clear()
rowTmp2 = []
rowTmp1 = []
for getListBckTmp in getListBck:
if len(getList) == 0:
getList.append(getListBckTmp)
else:
rowTmp1.clear()
rowTmp2.clear()
for cmpListTmp in cmpList:
rowTmp1.append(getList[-1][cmpListTmp])
rowTmp2.append(getListBckTmp[cmpLis... | 1 |
c13fbf868dbae84b858360555950da2b | 3ac89828859bdd397f1266c99c6233d9 | <p>
Decode a region of the image with the given sample size. This method is called off the UI
thread so it can safely load the image on the current thread. It is called from
{@link android.os.AsyncTask}s running in an executor that may have multiple threads, so
implementations must be thread safe. Adding <code>synchron... | @NonNull Bitmap decodeRegion(@NonNull Rect sRect, int sampleSize); | 1 |
158ce2c6760780660e7d7bf83de5a159 | 2a07cc584db7675607a764c7303188fc | did analysis pass? | class AnalysisProject(object):
def is_analysis_dir(self):
return len(self.samples) > 0 | 0 |
e5b7f42ca7986d3fc4ca9197718481ae | eb82cbf9031f2ce861cae9eda05110f6 | H = q1*H(S1) + q2*H(S2) + ... + qn*H(Sn) where qi is the subset proportion | def H(vals):
total = sum(vals)
acc = 0
for i in vals:
if total != 0:
percent = i / total
if percent != 0:
acc += percent * math.log2(percent)
return -1 * acc | 0 |
c6b6620213f172f4f393484252998d00 | 609abfd7f0a02ed966680cb5af754797 | Reference: https://en.wikipedia.org/wiki/Euclidean_algorithm | if a == 0: return b
if b == 0: return a
r = a % b
return euclidean_algorithm(b, r) | 1 |
dcda5bbe28a9e49f2ec7a9aceb20cdb6 | 6aa32108eb17fad58bcd3a2c6163d487 | 上传当日日志的方法 | class IndexController extends Controller
public function UploadDiary(){
$diraylog = M('Diraylog');
$diraylog->name = $_POST['user'];
$diraylog->title = $_POST['title'];
$diraylog->content = $_POST['content'];
$diraylog->time = date('Y-m-d H:i:s');
$result = $diraylog->add... | 1 |
a807f6dda08d9ab340434e14cfd54c27 | b0c72c9851ba8b00ecc66c40332bbc56 | Replaces the values of variables marked as sensitive with
stars (*********). | final List<String> args = new ArrayList<>(ManagementFactory.getRuntimeMXBean().getInputArguments());
for (final ListIterator<String> it = args.listIterator(); it.hasNext();) {
final String arg = it.next();
if (arg.contains("secret") || arg.contains("password")) {
int index = arg.indexOf("sec... | 1 |
c2a78b0f9cad881e3a2bbbfd8ead5e8d | eb8744da259c69804a02b44fab8d0bb0 | Case with a single resource ordering by importance | resources = self._set_and_get_resources(['test_resources/input/resource_one_updated.json',
'test_resources/input/resource_one.json'])
rl = list(resources)
print(rl[0])
print(rl[0].resource_metadata)
self.assertEqual(len(resources),... | 0 |
50efa5b802aefe7ed9154a5aa92753aa | 3df804c0a1ae0846a822e37079f1cbcb | don't do anything extra, override in subclasses | class SimpleEntry(EntryBase):
def _update(self):
pass | 1 |
9c84b652a659b37604ca73c9ac064735 | dfb43df3aa9eb0436a49b3aca806b884 | This function gets the count of community members who have added the user as a friend in the community. | class Follow extends AppModel
function getFriendCount($user_id)
{
return count($this->getFriendUserIds($user_id));
} | 1 |
cba44a27f1a3796c9c024f9d37c4222b | f197f2786b9da3ba12ed32f99290198c | Checks if string is an X-separated list of specified strings.
X is a separator character ("sep"). | sep = self.__subchain_separator__
if type(tag) in (str, unicode) \
and sep in tag \
and False not in [ len(t) > 0 for t in tag.split(sep) ]:
return True
return False | 1 |
9ff5d6715644be5eb16d98c09cc72187 | 848d37d83b3e9f81780567ac0227a2ac | 构建全like查询字符串 | if isinstance(value, list):
value = value[0]
key = '{}.like'.format(self.field)
val = '*{}*'.format(value)
return WebParam({key: val}) | 1 |
483db79e6e18085ff3c256b34e2db750 | 190147eea5373aff499a923097d2cc4c | Exit a parse tree produced by {@link VerilogParser#select_condition}. | void exitSelect_condition(VerilogParser.Select_conditionContext ctx); | 1 |
7b571c45af20b16b6ab07c8c4d56b0da | 5dedea18d980ef08230ce7b5370276da | Get the user's choice for storage level. | @Test
public abstract class LogTest extends AbstractLogTest
protected abstract StorageLevel storageLevel(); | 0 |
07024abf18a552005e889e8b81e8f46e | c580f2841a5bbf40b2600ac552e83b3a | Builds a hidden overlay div and populates values based on parameters given. | function inlineCombo( $compile ) function link( scope, element )
function showOverlay() {
var overlay = $compile( "<combo-overlay model='model' options='values'></combo-overlay>" )( scope );
angular.element( document.body ).append( overlay );
} | 1 |
0f65698545c830c6f186e09fd53653c3 | abb39c5d5265f5fe6f21732ff27772e2 | Permet de supprimer des erreurs. | {
$max = count(ACWCore::$my->error);
for ($i = 0; $i < $max; $i ++) {
if (ACWCore::$my->error[$i]['key'] == $key) {
array_splice(ACWCore::$my->error, $i, 1);
}
}
} | 1 |
53814cc05b85ba10aa812bb3499a3009 | 20e6d951e9ca66bbefdfceb59b6ee4aa | 页面生成,第二步,菜单创建完成回调函数 | export class MenuDown extends egret.Sprite
private onCreate():void
{
if(this._conf) this.setup(this._conf);
} | 0 |
797a1cc8547074b04d8e4705b331898b | e27423c9e4672c89a93722c74eaa4492 | Test attribute "resource_resolver_vanitypath_bloomfilter_max_bytes" | filter_params = {
"resolution": "daily",
"time_scope_value": "-10",
"time_scope_units": "day",
"resource_location": FAKE.word(),
"subscription_guid": FAKE.uuid4(),
"instance_type": FAKE.word(),
"service_name": FAKE.word(),
... | 0 |
b24f05d54ebf4a50006f7df7292b9a5f | 8c2768160571f8ee1b97a7c74ad2f694 | 根据mid获取最新的投稿 | "IN (SELECT a_id FROM dice.middle WHERE m_id = #{metaId}) " +
"AND dice.article.status = '" + PostStatusEnum.Constants.PUBLISHED_VALUE + "' AND dice.article.type = '" + Types.POST + "' order by create_time desc")
List<ArticleInfoDto> selectPublishByMeta(@Param("metaId") Integer metaId); | 1 |
cdb8bb1a5420c5b2d4c5fdf15f783cc4 | 2777b28b0cd35ad4b5a79a18abdc3c62 | 对进程组重新排序 | if (isset ( $_POST ['sort'] )) {
foreach ( $_POST ['sort'] as $k => $v ) {
$this->db->where(array ('groupid' => $k ))->update ( array ('sort' => $v ) );
}
$this->_updatecache ();
showmessage ( L ( 'operation_success' ), HTTP_REFERER );
} el... | 1 |
deeee89d3e949cbf3de3b19d5593b7a3 | 67bbcb9d1257e78116696dd9d5241bbc | Unsets the value of the '{@link ifc2x3tc1.IfcOpticalMaterialProperties#getThermalIrTransmittanceAsString <em>Thermal Ir Transmittance As String</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | void unsetThermalIrEmissivityBack(); | 0 |
880bfb4715c31455ac56610dc5cd11a2 | 7e42a578d197e6039c22dd5773ab51cb | Splash screen to create an SQL backup | adr = Helper.settings.BASE_DIR + "/Helper/db_access/db_s.db"
time = datetime.datetime.today().strftime("%Y-%m-%d-%H.%M.%S")
adrout = Helper.settings.BASE_DIR + "/Helper/db_access/backup/db_s-"+ time + ".db"
adr.replace('\\','/')
adrout.replace('\\','/')
copyfile(adr, adrout)
return redirect(... | 0 |
bd61c473c0ecfee2f965f40fce9aaab5 | ffa2874ece13237578569bc4d97edddf | Update the DSCP to CoS mappings | [Get("/networks/{networkId}/switch/dscpToCosMappings")]
Task<DscpToCosMappings> GetNetworkSwitchDscpToCosMappingsAsync(
string networkId,
CancellationToken cancellationToken = default
); | 0 |
2cf19283f8bc76bcd355b568d21b3087 | d270c38ed7567bbc2bcd51a312522a6b | returns true if the passwords match and false if they do not | public class RegistrationMenu extends Menu
public boolean passwordsMatch() {
return passwordField.getText().equals(confirmPasswordField.getText());
} | 1 |
649d2bb97563a694d8bf41e4dee90104 | eeab3de19be020fd21ab3d8a0a42c919 | Returns the delegate template key (name and variant). | {
if (m_imageInfoVariant == null)
m_imageInfoVariant = getTemplate(m_navImageInfoVariantName);
return m_imageInfoVariant;
} | 0 |
97ced264f4043963949768c55ea0cae9 | b78c50b93d43463cc266bc529237bcb0 | <returns>Returns the amount of time until the player can attack again.</returns> | timer += Time.deltaTime;
if (timer >= attackInterval) {
float amari = timer - attackInterval;
timer = amari;
return pointPerAttack;
}
return 0f;
} | 0 |
e9d5fc48f2e141bc6220dbc495606018 | 19ef110cc51bff9d5fba9813e7896e99 | 在非match_parent的情況下
會自己調整是創大小去符合影片比例 | public class VideoPlayerActivity extends KitKitLoggerActivity implements SurfaceHolder.Callback private void playVideo(String fileName)
@Override
public void onPrepared(MediaPlayer mp) {
int videoWidth = mMediaPlayer.getVideoWidth();
int videoHeight = mMediaPl... | 1 |
ede8163c205fc73d08f5f102fd90d994 | bd40a40969a362335b77712fa3756dc5 | Calculate the zoom factor between the start and end distances | void DvRenderer::CalculateZoomFactor(float x1, float y1, float x2, float y2)
{
m_CurrentLine = QLineF(x1, y1, x2, y2);
float currentScalefactor = m_CurrentLine.length() / m_PreviousLine.length();
if( currentScalefactor >= 1.0 ) {
m_MoveScene[2] -= 25.0;
if( m_MoveScene[2] <= 0.0 )
m_MoveScene[2] = 0.0;
... | 1 |
d9d055e860e97f3a69f4a74d4cbf55c6 | b8aac98f454a982944f76b11f87e71a7 | removing parenthesis and everything inside them, works for (),[] and {} | string result;
for (int i = 0; i < expression.length(); i++) {
if (expression[i] == '(' || expression[i] == '[' ||
expression[i] == '{' || expression[i] == ')' ||
expression[i] == ']' || expression[i] == '}') {
result += expression[i];
}
}
return result;
} | 0 |
b660147823702a4903b6ef3e1723c3d5 | ade5602a43cd81dc548a2864432c7b41 | 随即生成i位中文 | namespace Util.Randoms
string GenerateChinese( int maxLength ); | 1 |
47ab05a93b0946339efea2a5ed9ba50d | 62815df76c89d9292940abcb9bea6d7c | Grants permission to list all of the Cognito identity pools registered for your account
Access Level: List
https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_ListIdentityPools.html | {
var request = new DescribeIdentityPoolRequest();
request.IdentityPoolId = identityPoolId;
return DescribeIdentityPoolAsync(request, cancellationToken);
} | 0 |
a785edacc98680d13489023c928324c8 | 843767bda82d674900af88cc3d2aa86f | Check if two elements have an intersection. | class QuotientModuleElement(ModuleElement):
def eq(self, d1, d2):
return self.module.killed_module.contains(d1 - d2) | 0 |
fe66fb7f1dfb785370a121efdef55f3d | 68a503dd75b94d50557a81079b88d125 | Removes the HTTP response for the current thread. | public class HttpInternalObjectManager
public static Object removeCurrentResponse() {
return removeThreadVariable(CommonConstants.THREAD_GLOBAL_VARIABLE_RESPONSE);
} | 1 |
43d56a51e65448950bb1c5dff5c2a5a3 | 24a124dd82fe487c87cf87bb4b622779 | Shift pointer to left | void lcd20x4_i2c_shiftLeft(uint8_t offset)
{
for(uint8_t i=0; i<offset;i++)
{
lcd20x4_i2c_sendCommand(0x18);
}
} | 1 |
3cb1dcb37d667c40ceb15201c2d8fd28 | d3ce496620b7b01d9aaba13e71504a89 | 根据输入的手机号和密码查询userId | UserInfo queryByMobileNoAndPsw(String mobileNo, String password); | 1 |
19b7e46456c77d5a9ef2b77a21865370 | 19e37187bb167e5df0d83e274f7afdd8 | Handles the opening of a tag, moving the array down to the next depth level | class TableReader
function tagClose(&$parser,$name,$attrs) {
if ($name == 'tr') {
$this->items[] = $this->item;
$this->item = array();
}
} | 0 |
5745316f2202f0112a14d02c672166e6 | 662620839c4218e676eb49bb59d744e9 | 根据任务上传ID生成保存文件路径 | if (taskInfo != null) {
return generateFileSavePath(taskInfo.getTaskId(), taskInfo.getProductLineName());
}
throw new ScheduleException("taskInfo can not be null!");
} | 1 |
026fc784b36281ce71d7987ab740709c | 04bfcd895b2193d839b4a6c667dd3613 | Setup the high score table at game startup. | public class SnakeGame
public void initScore() {
try {
NewScore.allTimeHighScores();
} catch (IOException e) {
e.printStackTrace();
}
} | 1 |
dfa2958c19047e1ccd90cbd005bdaa4a | f4c3d8ebae26c2913711dc43465d8548 | Window Expression Attention 1 Layer | super().__init__()
self.w_1 = nn.Conv1d(d_in, d_hid, 1)
self.w_2 = nn.Conv1d(d_hid, d_in, 1)
self.dropout = nn.Dropout(dropout) | 0 |
dff39ccb2e1ce1d336c4e8d451d6a2e7 | 00a941c528e891d51849e15ed9769cda | 通过ES查询文章详情 | ResponseResult esArticleSearch(UserSearchDto dto); | 1 |
c385e9f2f06af7f788b9d438f56378a2 | 19ee92cae36c865fc1614a31a723693e | Randomly pick and remove from list, a location to fire missile at | public class CharacterPreviewRandomizer : MonoBehaviour
public void FireMissle() { } | 0 |
ac67b442c295191f0d1d6bf1b8f54e23 | 061b8cafc771e8d2c246b1bea9939a10 | Test of getExpenditureForOffice method, of class ClientImpl. | global $billAccountOnlyDetail;
$expense = new \model\finance\accounting\Account($this->clientAcc->getAccount(2100));
$asset = new \model\finance\accounting\Account($this->clientAcc->getAccount($billAccountOnlyDetail['asset']));
$liability = new \model\finance\accounting\Account($this->clientAcc->getAccount($bil... | 0 |
d3f4b55720304dd0f6ca6c790099e278 | 88eea644f2aa79586a6ba76b5bbb94d0 | @brief destroy an allocation domain
Frees an allocation domain. Note that this does NOT free all the
memory allocated with the domain. | ld_clean_domain(
struct loader_domain *ld)
{
struct domain_entry *de,
*prev_de,
*tmp_de;
struct domain_altname *da,
*tmp_da;
de = ld->ld_entries;
prev_de = NULL;
while(de) {
if (de->de_usecount == 0) {
da = de->de_altname;
while (da) {
tmp_da = da;
da = da->da_next;
xmfree(tmp_da, l... | 1 |
6d0f9066935aef03b9820f3ec056cfbb | 9ebbff260a32608ae5aa1eaea9c92f1d | Helper routine which computes the full set of
tensor product grid nodes and caches the result.
The result is a (D, product(N_i)) shaped ndarray. | class LinearTFI3D(TFI):
def calc_grid(self, pu, pv, pw):
d1 = len(pu)
d2 = len(pv)
d3 = len(pw)
puc = np.ones(d1) - pu
pvc = np.ones(d2) - pv
pwc = np.ones(d3) - pw
pc35 = np.empty((d1, 3), float)
pc36 = np.empty((d1, 3), float)
pc46 = np.empty((d1... | 0 |
ec4de1982651218673dc292d85f0916b | 5e241ccc0301819499ec41603e642055 | completion function for readline() | {
char *buf;
rl_bind_key('\t', rl_complete);
buf = readline("#");
if (!buf)
{
seerror("input",__LINE__);
exit(1);
}
add_history(buf);
return buf;
} | 1 |
18943ed35ff2dab71a7c41ed51cd7a58 | 64fb3e46bd34953d49d7cfd842e2e06f | Funkcja odpowiedzialna za wyslanie raportu o polaczeniu na serwer lub wyswietlenie odpowiedniej informacji jezeli nie ma mozliwosci przeslania (np. brak polaczenia z internetem). | {
var profile = NetworkInformation.GetInternetConnectionProfile();
if (profile != null)
{
var state = profile.GetNetworkConnectivityLevel();
switch (state)
{
case NetworkConnectivityLevel.None:
DialogMessage dm = new DialogMessage();
dm.Description = MM.M.GetString("Network_NoCon... | 1 |
fa9a933d8847be7cb5e090e172491d4e | feda595caa7bba5fd1a89ddd49d9674e | 根据用户当前的属性,获取结局 | local curLevelConfig = nil
local curIndex = 0
local charData = XDormManager.GetCharacterDataByCharId(charId)
if not charData then
return curLevelConfig, curIndex
end
local scoreA, scoreB, scoreC = XDormManager.GetDormitoryScore(charData.DormitoryId)
lo... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.